From fbb41aee9dfce15e2fcc57d9d78e5a13da081b80 Mon Sep 17 00:00:00 2001 From: tianma-if Date: Wed, 30 Sep 2026 19:42:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(attachments):=20=E5=85=A8=E9=9D=A2?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E7=AC=94=E8=AE=B0=E9=99=84=E4=BB=B6=E4=B8=93?= =?UTF-8?q?=E5=B1=9E=E5=9B=BE=E6=A0=87=E4=B8=8E=E6=A0=87=E7=AD=BE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=BD=93=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 细分支持各平台原生安装包 (APK, EXE, DMG, Linux 包) - 新增设计工程 (AI/PSD/FIG/SKETCH) 与 3D/CAD 建模 (BLEND/STL/DWG) - 新增终端运维自动化脚本 (SH/PS1/BAT) 与系统日志排障 (LOG/CRASH) - 新增证书密钥安全凭据 (CRT/PEM/PUB/KEY) 与思维导图架构 (XMIND/DRAWIO) - 新增电子书 (EPUB/MOBI)、字体资源 (WOFF2/TTF)、磁盘镜像 (ISO) 与数据库 (DB) - 增加大写扩展名精准徽标输出与 .key 密钥/Keynote 消歧 - 跨端同步更新 Web、iOS 原生 EditorBundle 与 Android/Mobile 编辑器样式 - 补全单元测试与格式映射断言 --- .../Resources/EditorBundle/index.html | 684 +++++++++--------- apps/ios/EditorBundle/index.html | 684 +++++++++--------- apps/ios/EditorSource/src/styles.css | 42 +- .../src/components/LocalTiptapEditor.tsx | 12 +- .../attachments/AttachmentFileIcon.tsx | 22 +- packages/shared/src/attachment-kind.test.mjs | 88 ++- packages/shared/src/attachment-kind.ts | 65 +- packages/shared/src/attachment-metadata.ts | 83 ++- 8 files changed, 977 insertions(+), 703 deletions(-) diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/index.html b/apps/ios/EdgeEver/Resources/EditorBundle/index.html index 4bc06767..f9e1b123 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"),IT,au=(IT=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(IT,"PathBuilder"),IT),NT,n4r=(NT=class{constructor(e,r=hie()){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(NT,"RailroadRenderer"),NT),Zye=w((t,e,r)=>{Fs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),i4r=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram +`+t);try{const n=Ko(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"),Zye(n,{height:100,width:200},s);return}const l=new n4r(n,hie()).renderDiagram(a);Zye(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),GP={draw:i4r},s4r=lne().Railroad.parser.LangiumParser,j2=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(j2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(j2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:j2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:j2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:j2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),a4r=w(t=>({name:t.name,definition:j2(t.definition)}),"transformRule"),o4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(a4r(e)))},"populateDb"),l4r={parse:w(t=>{Qi.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=s4r.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),o4r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Qi}},c4r={parser:l4r,db:Qi,renderer:GP,styles:HP};const u4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:c4r},Symbol.toStringTag,{value:"Module"}));var h4r=cne().RailroadEbnf.parser.LangiumParser,t9=w(t=>{const e=t.alternatives.map(d4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),d4r=w(t=>{const e=t.elements.map(p4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),wje=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 t9(t.element);case"EbnfOptional":return{type:"optional",element:t9(t.element)};case"EbnfRepetition":return{type:"repetition",element:t9(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),f4r=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:"-"},wje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),p4r=w(t=>t.postfixes.reduce((e,r)=>f4r(e,r),wje(t.base)),"transformTerm"),g4r=w(t=>({name:t.name,definition:t9(t.definition)}),"transformRule"),m4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(g4r(e)))},"populateDb"),y4r={parse:w(t=>{Qi.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=h4r.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),m4r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},v4r={parser:y4r,db:Qi,renderer:GP,styles:HP};const b4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:v4r},Symbol.toStringTag,{value:"Module"}));var x4r=une().RailroadAbnf.parser.LangiumParser,eX=w(t=>{const e=t.alternatives.map(w4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),w4r=w(t=>{const e=t.elements.map(C4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),T4r=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"),C4r=w(t=>{const e=k4r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=T4r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),k4r=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 eX(t.element);case"AbnfOptionalGroup":return{type:"optional",element:eX(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),S4r=w(t=>({name:t.name,definition:eX(t.definition)}),"transformRule"),E4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(S4r(e)))},"populateDb"),A4r={parse:w(t=>{Qi.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=x4r.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),E4r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},M4r={parser:A4r,db:Qi,renderer:GP,styles:HP};const R4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:M4r},Symbol.toStringTag,{value:"Module"}));var _4r=hne().RailroadPeg.parser.LangiumParser,Tje=w(t=>{const e=t.alternatives.map(L4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),L4r=w(t=>{const e=t.elements.map(I4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),I4r=w(t=>{const e=N4r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Qye(e)}`:`!${Qye(e)}`}:e},"transformPrefix"),Qye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),N4r=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 Tje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),O4r=w(t=>({name:t.name,definition:Tje(t.definition)}),"transformRule"),P4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(O4r(e)))},"populateDb"),$4r={parse:w(t=>{Qi.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=_4r.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}},B4r={parser:$4r,db:Qi,renderer:GP,styles:HP};const F4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:B4r},Symbol.toStringTag,{value:"Module"}));var z4r=1;function die(){if(!(typeof globalThis>"u"))return globalThis}w(die,"getCaptureGlobal");function Cje(){var t;return!!((t=die())!=null&&t.mermaidCaptureSizes)}w(Cje,"shouldCaptureSizes");function kje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(kje,"capturedFromLocation");function Sje(t,e){const r=die();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(Sje,"emitCapturedSizes");function Eje(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&&Sje({metadata:{captureVersion:z4r,capturedAt:new Date().toISOString(),capturedFrom:kje()},nodes:r},t)}w(Eje,"captureNodeSizes");const V4r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Eje,shouldCaptureSizes:Cje},Symbol.toStringTag,{value:"Module"})),H4r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:zGe,createInfoServices:VGe},Symbol.toStringTag,{value:"Module"})),G4r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:HGe,createPacketServices:GGe},Symbol.toStringTag,{value:"Module"})),W4r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:WGe,createPieServices:qGe},Symbol.toStringTag,{value:"Module"})),q4r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:UGe,createTreeViewServices:YGe},Symbol.toStringTag,{value:"Module"})),U4r=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:jGe,createArchitectureServices:XGe},Symbol.toStringTag,{value:"Module"})),Y4r=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:BGe,createGitGraphServices:FGe},Symbol.toStringTag,{value:"Module"})),j4r=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:ZGe,createEventModelingServices:QGe},Symbol.toStringTag,{value:"Module"})),X4r=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:SGe,createRadarServices:EGe},Symbol.toStringTag,{value:"Module"})),K4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:AGe,createRailroadServices:lne},Symbol.toStringTag,{value:"Module"})),Z4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:MGe,createRailroadEbnfServices:cne},Symbol.toStringTag,{value:"Module"})),Q4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:RGe,createRailroadAbnfServices:une},Symbol.toStringTag,{value:"Module"})),J4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:_Ge,createRailroadPegServices:hne},Symbol.toStringTag,{value:"Module"})),ewr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:IGe,createTreemapServices:NGe},Symbol.toStringTag,{value:"Module"})),twr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:DGe,createWardleyServices:OGe},Symbol.toStringTag,{value:"Module"})),rwr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:PGe,createCynefinServices:$Ge},Symbol.toStringTag,{value:"Module"})); + "),typeof $t!="string"&&!gs($t)&&($t=Bgt($t),typeof $t!="string"))throw Sm("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=Rc(te)),G.uponSanitizeAttribute.length>0&&($e=Rc($e)),e.removed=[];const ln=qe&&typeof $t!="string"&&gs($t);if(ln){pt($t);const Yl=E($t);if(typeof Yl=="string"){const jl=xt(Yl);if(!te[jl]||he[jl])throw Br($t),Sm("root node is forbidden and cannot be sanitized in-place")}if(un($t))throw Br($t),Sm("root node is clobbered and cannot be sanitized in-place");try{ip($t)}catch(jl){throw Br($t),jl}}else if(gs($t))nt=ar("\x3C!---->"),_t=nt.ownerDocument.importNode($t,!0),_t.nodeType===Sc.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 Yl=Ie(_i);for(;jt=Yl.nextNode();)vm(jt,_i),Js(jt),En(jt.content)&&kc(jt.content)}catch(Yl){throw ln&&(Br($t),Um(e.removed,jl=>{jl.element&&bt(jl.element)})),Yl}if(ln)return Um(e.removed,Yl=>{Yl.element&&bt(Yl.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&&Do(Xgt,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 bm(_t,jt,nt)},e.addHook=function($t,Pe){typeof Pe=="function"&&Jl(G,$t)&&U3(G[$t],Pe)},e.removeHook=function($t,Pe){if(Jl(G,$t)){if(Pe!==void 0){const nt=Lgt(G[$t],Pe);return nt===-1?void 0:Igt(G[$t],nt,1)[0]}return Hoe(G[$t])}},e.removeHooks=function($t){Jl(G,$t)&&(G[$t]=[])},e.removeAllHooks=function(){G=ele()},e}var h0=iTe(),BH=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>BH(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]=BH(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"),aa=BH,Vd="#ffffff",Hd="#f2f2f2",rn=w((t,e)=>e?ye(t,{s:-40,l:10}):ye(t,{s:-40,l:-10}),"mkBorder"),Zb,nmt=(Zb=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(Zb,"Theme"),Zb),imt=w(t=>{const e=new nmt;return e.calculate(t),e},"getThemeVariables"),Qb,smt=(Qb=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(Qb,"Theme"),Qb),amt=w(t=>{const e=new smt;return e.calculate(t),e},"getThemeVariables"),Jb,omt=(Jb=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(Jb,"Theme"),Jb),V0=w(t=>{const e=new omt;return e.calculate(t),e},"getThemeVariables"),ex,lmt=(ex=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(ex,"Theme"),ex),cmt=w(t=>{const e=new lmt;return e.calculate(t),e},"getThemeVariables"),tx,umt=(tx=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(tx,"Theme"),tx),hmt=w(t=>{const e=new umt;return e.calculate(t),e},"getThemeVariables"),rx,dmt=(rx=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(rx,"Theme"),rx),fmt=w(t=>{const e=new dmt;return e.calculate(t),e},"getThemeVariables"),nx,pmt=(nx=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(nx,"Theme"),nx),gmt=w(t=>{const e=new pmt;return e.calculate(t),e},"getThemeVariables"),ix,mmt=(ix=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(ix,"Theme"),ix),ymt=w(t=>{const e=new mmt;return e.calculate(t),e},"getThemeVariables"),sx,vmt=(sx=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(sx,"Theme"),sx),bmt=w(t=>{const e=new vmt;return e.calculate(t),e},"getThemeVariables"),ax,xmt=(ax=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(ax,"Theme"),ax),wmt=w(t=>{const e=new xmt;return e.calculate(t),e},"getThemeVariables"),ox,Tmt=(ox=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(ox,"Theme"),ox),Cmt=w(t=>{const e=new Tmt;return e.calculate(t),e},"getThemeVariables"),r0={base:{getThemeVariables:imt},dark:{getThemeVariables:amt},default:{getThemeVariables:V0},forest:{getThemeVariables:cmt},neutral:{getThemeVariables:hmt},neo:{getThemeVariables:fmt},"neo-dark":{getThemeVariables:gmt},redux:{getThemeVariables:ymt},"redux-dark":{getThemeVariables:bmt},"redux-color":{getThemeVariables:wmt},"redux-dark-color":{getThemeVariables:Cmt}},lo={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},sTe={...lo,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:r0.default.getThemeVariables(),sequence:{...lo.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:{...lo.gantt,tickInterval:void 0,useWidth:void 0},c4:{...lo.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...lo.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:{...lo.pie,useWidth:984},xyChart:{...lo.xyChart,useWidth:void 0},requirement:{...lo.requirement,useWidth:void 0},packet:{...lo.packet},eventmodeling:{...lo.eventmodeling},treeView:{...lo.treeView,useWidth:void 0},radar:{...lo.radar},railroad:{...lo.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:{...lo.ishikawa},sankey:{...lo.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:{...lo.venn},cynefin:{...lo.cynefin}},aTe=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...aTe(t[n],"")]:[...r,e+n],[]),"keyify"),kmt=new Set(aTe(sTe,"")),Sn=sTe,Smt={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Emt=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"),_9=w(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>_9(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!kmt.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Smt[e];n?Emt(t[e],n):(de.debug("sanitizing object",e),_9(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=oTe(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"),oTe=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"),sc=aa({},r5),L9,vy=[],jk=aa({},r5),ZE=w((t,e)=>{let r=aa({},t),n={};for(const i of e)uTe(i),n=aa(n,i);if(r=aa(r,n),n.theme&&n.theme in r0){const i=aa({},L9),s=aa(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in r0&&(r.themeVariables=r0[r.theme].getThemeVariables(s))}return jk=r,Imt(jk),jk},"updateCurrentConfig"),Amt=w(t=>(sc=aa({},r5),sc=aa(sc,t),t.theme&&r0[t.theme]&&(sc.themeVariables=r0[t.theme].getThemeVariables(t.themeVariables)),ZE(sc,vy),sc),"setSiteConfig"),Mmt=w(t=>{L9=aa({},t)},"saveConfigFromInitialize"),Rmt=w(t=>(sc=aa(sc,t),ZE(sc,vy),sc),"updateSiteConfig"),lTe=w(()=>aa({},sc),"getSiteConfig"),cTe=w(t=>(ZE(jk,[t]),br()),"setConfig"),br=w(()=>aa({},jk),"getConfig"),uTe=w(t=>{t&&(["secure",...sc.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"&&uTe(t[e])}))},"sanitize"),_mt=w(t=>{var e;_9(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),vy.push(t),ZE(sc,vy)},"addDirective"),I9=w((t=sc)=>{vy=[],ZE(t,vy)},"reset"),Lmt={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."},tle={},hTe=w(t=>{tle[t]||(de.warn(Lmt[t]),tle[t]=!0)},"issueWarning"),Imt=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&hTe("LAZY_LOAD_DEPRECATED")},"checkConfig"),dTe=w(()=>{let t={};L9&&(t=aa(t,L9));for(const e of vy)t=aa(t,e);return t},"getUserDefinedConfig"),di=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&hTe("FLOWCHART_HTML_LABELS_DEPRECATED"),Gd(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),fTe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Xk=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Nmt=/\s*%%.*\n/gm,lx,pTe=(lx=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(lx,"UnknownDiagramError"),lx),by={},SK=w(function(t,e){t=t.replace(fTe,"").replace(Xk,"").replace(Nmt,` -`);for(const[r,{detector:n}]of Object.entries(by))if(n(t,e))return r;throw new pTe(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),FH=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)gTe(e,r,n)},"registerLazyLoadedDiagrams"),gTe=w((t,e,r)=>{by[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),by[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Dmt=w(t=>by[t].loader,"getDiagramLoader"),a3=//gi,Omt=w(t=>t?vTe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Pmt=(()=>{let t=!1;return()=>{t||(mTe(),t=!0)}})();function mTe(){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(mTe,"setupDompurifyHooks");var yTe=w(t=>(Pmt(),h0.sanitize(t)),"removeScript"),rle=w((t,e)=>{if(di(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=yTe(t):r!=="loose"&&(t=vTe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=zmt(t))}return t},"sanitizeMore"),Ln=w((t,e)=>t&&(e.dompurifyConfig?t=h0.sanitize(rle(t,e),e.dompurifyConfig).toString():t=h0.sanitize(rle(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),$mt=w((t,e)=>typeof t=="string"?Ln(t,e):t.flat().map(r=>Ln(r,e)),"sanitizeTextOrArray"),Bmt=w(t=>a3.test(t),"hasBreaks"),Fmt=w(t=>t.split(a3),"splitBreaks"),zmt=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),vTe=w(t=>t.replace(a3,"#br#"),"breakToPlaceholder"),HN=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"),Vmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Hmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Sp=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Gmt=w((t,e)=>{const r=zH(t,"~"),n=zH(e,"~");return r===1&&n===1},"shouldCombineSets"),Wmt=w(t=>{const e=zH(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"),nle=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),VH=/\$\$(.*?)\$\$/g,Ks=w(t=>{var e;return(((e=t.match(VH))==null?void 0:e.length)??0)>0},"hasKatex"),QE=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await GN(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"),qmt=w(async(t,e)=>{if(!Ks(t))return t;if(!(nle()||e.legacyMathML||e.forceLegacyMathML))return t.replace(VH,"MathML is unsupported in this environment.");{const{default:r}=await Rr(async()=>{const{default:i}=await Promise.resolve().then(()=>Pzt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!nle()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(a3).map(i=>Ks(i)?`
${i}
`:`
${i}
`).join("").replace(VH,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),GN=w(async(t,e)=>Ln(await qmt(t,e),e),"renderKatexSanitized"),Vt={getRows:Omt,sanitizeText:Ln,sanitizeTextOrArray:$mt,hasBreaks:Bmt,splitBreaks:Fmt,lineBreakRegex:a3,removeScript:yTe,getUrl:HN,evaluate:Gd,getMax:Vmt,getMin:Hmt},Umt=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),Ymt=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=Ymt(e,r,n);Umt(t,i)},"configureSvgSize"),o3=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"),AM={};function HH(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}w(HH,"cssStyleSheetToString");var jmt=w((t,e,r,n)=>{let i="";return t in AM&&AM[t]?i=AM[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[DH({find:cgt,type:this.type,getAttributes:t=>({language:t[1]})}),DH({find:ugt,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 hgt=Jwe;const dgt="modulepreload",fgt=function(t,e){return new URL(t,e).href},$oe={},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=fgt(h,n),h in $oe)return;$oe[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":dgt,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 eTe=Object.defineProperty,w=(t,e)=>eTe(t,"name",{value:e,configurable:!0}),zN=(t,e)=>{for(var r in e)eTe(t,r,{get:e[r],enumerable:!0})},SM={exports:{}},pgt=SM.exports,Boe;function ggt(){return Boe||(Boe=1,(function(t,e){(function(r,n){t.exports=n()})(pgt,(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")},TK=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${qa().format("ss.SSS")} : ${t} : `,"format");const EM={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 EM.hue2rgb(s,i,t+1/3)*255;case"g":return EM.hue2rgb(s,i,t)*255;case"b":return EM.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},vgt={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},on={channel:EM,lang:ygt,unit:vgt},Tp={};for(let t=0;t<=255;t++)Tp[t]=on.unit.dec2hex(t);const Oo={ALL:0,RGB:1,HSL:2};let bgt=class{constructor(){this.type=Oo.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=Oo.ALL}is(e){return this.type===e}};class xgt{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new bgt}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Oo.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(Oo.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(Oo.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(Oo.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(Oo.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(Oo.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(Oo.RGB)&&r!==void 0?r:(this._ensureRGB(),on.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Oo.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Oo.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Oo.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Oo.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Oo.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Oo.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const VN=new xgt({r:0,g:0,b:0,a:0},"transparent"),Ab={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Ab.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 VN.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?`#${Tp[Math.round(e)]}${Tp[Math.round(r)]}${Tp[Math.round(n)]}${Tp[Math.round(i*255)]}`:`#${Tp[Math.round(e)]}${Tp[Math.round(r)]}${Tp[Math.round(n)]}`}},D1={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(D1.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(D1.re);if(!r)return;const[,n,i,s,a,o]=r;return VN.set({h:D1._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)}%)`}},Yk={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=Yk.colors[t];if(e)return Ab.parse(e)},stringify:t=>{const e=Ab.stringify(t);for(const r in Yk.colors)if(Yk.colors[r]===e)return r}},WC={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(WC.re);if(!r)return;const[,n,i,s,a,o,l,u,h]=r;return VN.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:Yk,hex:Ab,rgb:WC,rgba:WC,hsl:D1,hsla:D1},parse:t=>{if(typeof t!="string")return t;const e=Ab.parse(t)||WC.parse(t)||D1.parse(t)||Yk.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Oo.HSL)||t.data.r===void 0?D1.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?WC.stringify(t):Ab.stringify(t)},tTe=(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 tTe(t,{a:e});const i=VN.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)},CK=(t,e)=>on.lang.round(Ah.parse(t)[e]),wgt=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)},Tgt=t=>wgt(t)>=.5,Bl=t=>!Tgt(t),kK=(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)=>kK(t,"l",e),ut=(t,e)=>kK(t,"l",-e),Foe=(t,e)=>kK(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 tTe(t,n)},Cgt=(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,Cgt(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 zoe(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:fa(BigInt.prototype.toString),Uoe=typeof Symbol>"u"?null:fa(Symbol.prototype.toString),Jl=fa(Object.prototype.hasOwnProperty),j3=fa(Object.prototype.toString),Do=fa(RegExp.prototype.test),Sm=$gt(TypeError);function fa(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]:qC;if(Voe&&Voe(t,null),!Mb(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const s=r(i);s!==i&&(Rgt(e)||(e[n]=s),i=s)}t[i]=!0}return t}function Bgt(t){for(let e=0;e/g),qgt=Ja(/\${[\w\W]*/g),Ugt=Ja(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ygt=Ja(/^aria-[\-\w]+$/),Zoe=Ja(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jgt=Ja(/^(?:\w+script|data):/i),Xgt=Ja(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kgt=Ja(/^html$/i),Zgt=Ja(/^[a-z][.\w]*(-[.\w]+)+$/i),Qoe=Ja(/<[/\w!]/g),Joe=Ja(/<[/\w]/g),Qgt=Ja(/<\/no(script|embed|frames)/i),Jgt=Ja(/\/>/i),Sc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},iTe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],emt=Ea(Gn({},iTe)),tmt=(function(){const t={};return Um(iTe,e=>{t[e]=Ja(new RegExp("])","i"))}),Ea(t)})(),rmt=function(){return typeof window>"u"?null:window},nmt=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}},ele=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lp=function(e,r,n,i){return Jl(e,r)&&Mb(e[r])?Gn(i.base?Rc(i.base):{},e[r],i.transform):n},P$=function(e,r,n){const i=Jl(e,r)?e[r]:void 0;return i&&typeof i=="object"?Rc(i):n()};function sTe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rmt();const e=$t=>sTe($t);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==Sc.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 Sm('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||(_=nmt(d,i),P=!0),_},D=r,F=D.implementation,z=D.createNodeIterator,V=D.createDocumentFragment,B=D.getElementsByTagName,H=n.importNode;let G=ele();e.isSupported=typeof rTe=="function"&&typeof v=="function"&&F&&F.createHTMLDocument!==void 0;const W=Ggt,K=Wgt,q=qgt,oe=Ugt,Q=Ygt,Z=jgt,re=Xgt,ie=Zgt;let me=Zoe,te=null;const _e=Gn({},[...Yoe,...I$,...N$,...D$,...joe]);let $e=null;const Fe=Gn({},[...Xoe,...O$,...Koe,...AA]);let ce=Object.seal(T2(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(T2(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],L$),Nt=Ea(["mi","mo","mn","ms","mtext"]);let Tt=Gn({},Nt);const yt=Ea(["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=Rc(Pe),Ee=it.indexOf(Pe.PARSER_MEDIA_TYPE)===-1?gt:Pe.PARSER_MEDIA_TYPE,xt=Ee==="application/xhtml+xml"?L$:qC,te=lp(Pe,"ALLOWED_TAGS",_e,{transform:xt}),$e=lp(Pe,"ALLOWED_ATTR",Fe,{transform:xt}),ft=lp(Pe,"ALLOWED_NAMESPACES",xe,{transform:L$}),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",Rc({}),{transform:xt}),Te=lp(Pe,"FORBID_ATTR",Rc({}),{transform:xt}),De=Jl(Pe,"USE_PROFILES")?Pe.USE_PROFILES&&typeof Pe.USE_PROFILES=="object"?Rc(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=zgt(Pe.ALLOWED_URI_REGEXP)?Pe.ALLOWED_URI_REGEXP:Zoe,zt=typeof Pe.NAMESPACE=="string"?Pe.NAMESPACE:lt,Tt=P$(Pe,"MATHML_TEXT_INTEGRATION_POINTS",()=>Gn({},Nt)),Rt=P$(Pe,"HTML_INTEGRATION_POINTS",()=>Gn({},yt));const nt=P$(Pe,"CUSTOM_ELEMENT_HANDLING",()=>T2(null));if(ce=T2(null),Jl(nt,"tagNameCheck")&&kr(nt.tagNameCheck)&&(ce.tagNameCheck=nt.tagNameCheck),Jl(nt,"attributeNameCheck")&&kr(nt.attributeNameCheck)&&(ce.attributeNameCheck=nt.attributeNameCheck),Jl(nt,"allowCustomizedBuiltInElements")&&typeof nt.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=nt.allowCustomizedBuiltInElements),Ja(ce),le&&(we=!1),fe&&(X=!0),De&&(te=Gn({},joe),$e=T2(null),De.html===!0&&(Gn(te,Yoe),Gn($e,Xoe)),De.svg===!0&&(Gn(te,I$),Gn($e,O$),Gn($e,AA)),De.svgFilters===!0&&(Gn(te,N$),Gn($e,O$),Gn($e,AA)),De.mathMl===!0&&(Gn(te,D$),Gn($e,Koe),Gn($e,AA))),ge.tagCheck=null,ge.attributeCheck=null,Jl(Pe,"ADD_TAGS")&&(typeof Pe.ADD_TAGS=="function"?ge.tagCheck=Pe.ADD_TAGS:Mb(Pe.ADD_TAGS)&&(te===_e&&(te=Rc(te)),Gn(te,Pe.ADD_TAGS,xt))),Jl(Pe,"ADD_ATTR")&&(typeof Pe.ADD_ATTR=="function"?ge.attributeCheck=Pe.ADD_ATTR:Mb(Pe.ADD_ATTR)&&($e===Fe&&($e=Rc($e)),Gn($e,Pe.ADD_ATTR,xt))),Jl(Pe,"ADD_FORBID_CONTENTS")&&Mb(Pe.ADD_FORBID_CONTENTS)&&(Ke===ze&&(Ke=Rc(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 Sm('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Pe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sm('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("")));Ea&&Ea(Pe),nr=Pe},Er=Gn({},[...I$,...N$,...Vgt]),nn=Gn({},[...D$,...Hgt]),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=qC(Pe.tagName),jt=qC(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){U3(e.removed,{element:Pe});try{v(Pe).removeChild(Pe)}catch{if(g(Pe),!v(Pe))throw Sm("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=[];Um(nt,Ar=>{U3(jt,Ar)}),Um(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}U3(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)===Sc.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===Sc.processingInstruction||jt===Sc.comment&&Do(Joe,_t.data)){try{g(_t)}catch{}continue}if(jt===Sc.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=Goe(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=Y3(Pe,W," "),Pe=Y3(Pe,K," "),Pe=Y3(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&&Um(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)===Sc.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&&Um($t,_t=>{_t.call(e,Pe,nt,nr)})}const mi=function(Pe,nt){return!!(pe&&Pe.hasChildNodes()&&!gs(Pe.firstElementChild)&&Do(Qoe,Pe.textContent)&&Do(Qoe,Pe.innerHTML)||pe&&Pe.namespaceURI===lt&&emt[nt]&&(gs(Pe.firstElementChild)||typeof Pe.textContent=="string"&&Do(tmt[nt],Pe.textContent))||Pe.nodeType===Sc.processingInstruction||pe&&Pe.nodeType===Sc.comment&&Do(Joe,Pe.data))},An=function(Pe,nt){if(Pe instanceof RegExp)return Do(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},Io=function(Pe,nt,_t){if(!he[nt]&&ma(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?Rc(nt):nt},Fh=function(Pe,nt){return Pe===nt||v(Pe)!==null?!1:(qe&&bt(Pe),!0)},vm=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=Io(Pe,_t,nt);return Ar===!1&&mn(G.afterSanitizeElements,Pe,null),Ar}if(k(Pe)===Sc.element&&!ht(Pe)||(_t==="noscript"||_t==="noembed"||_t==="noframes")&&Do(Qgt,Pe.innerHTML))return vt(Pe),!0;if(le&&Pe.nodeType===Sc.text){const Ar=ai(Pe.textContent);Pe.textContent!==Ar&&(U3(e.removed,{element:Pe.cloneNode()}),Pe.textContent=Ar)}return mn(G.afterSanitizeElements,Pe,null),!1},bm=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&&Do(oe,nt)||He&&Do(Q,nt)?!0:jt?mt[nt]||Do(me,Y3(_t,re,""))||(nt==="src"||nt==="xlink:href"||nt==="href")&&Pe!=="script"&&Woe(_t,"data:")===0&&st[Pe]||Me&&!Do(Z,Y3(_t,re,""))?!0:!_t:ma(Pe)&&An(ce.tagNameCheck,Pe)&&An(ce.attributeNameCheck,nt,Pe)||nt==="is"&&ce.allowCustomizedBuiltInElements&&An(ce.tagNameCheck,_t)},xm=Gn({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ma=function(Pe){return!xm[qC(Pe)]&&Do(ie,Pe)},Ul=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},oo=function(Pe,nt,_t,jt){try{_t?Pe.setAttributeNS(_t,nt,jt):Pe.setAttribute(nt,jt),un(Pe)?vt(Pe):Hoe(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,Yl=ln.value,jl=xt(_i),WP=Yl;let tl=_i==="value"?WP:Dgt(WP);if(_t.attrName=jl,_t.attrValue=tl,_t.keepAttr=!0,_t.forceKeepAttr=void 0,mn(G.uponSanitizeAttribute,Pe,_t),tl=_t.attrValue,Re&&(jl==="id"||jl==="name")&&Woe(tl,Xe)!==0&&(cn(_i,Pe,ln),tl=Xe+tl),pe&&Do(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,tl)){cn(_i,Pe,ln);continue}if(jl==="attributename"&&Goe(tl,"href")){cn(_i,Pe,ln);continue}if(!_t.forceKeepAttr){if(!_t.keepAttr){cn(_i,Pe,ln);continue}if(!je&&Do(Jgt,tl)){cn(_i,Pe,ln);continue}if(le&&(tl=ai(tl)),!bm(Ar,jl,tl)){cn(_i,Pe,ln);continue}tl=Ul(Ar,jl,ms,tl),tl!==WP&&oo(Pe,_i,ms,tl)}}mn(G.afterSanitizeAttributes,Pe,null)},kc=function(Pe){let nt=null;const _t=Ie(Pe);for(mn(G.beforeSanitizeShadowDOM,Pe,null);nt=_t.nextNode();)if(mn(G.uponSanitizeShadowNode,nt,null),vm(nt,Pe),Js(nt),En(nt.content)&&kc(nt.content),k(nt)===Sc.element){const jt=x(nt);En(jt)&&(ip(jt),kc(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){kc(_t.shadow);continue}const jt=_t.node,ln=k(jt)===Sc.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 Yl=jt.content;En(Yl)&&nt.push({node:Yl,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=Fgt($t),typeof $t!="string"))throw Sm("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=Rc(te)),G.uponSanitizeAttribute.length>0&&($e=Rc($e)),e.removed=[];const ln=qe&&typeof $t!="string"&&gs($t);if(ln){pt($t);const Yl=E($t);if(typeof Yl=="string"){const jl=xt(Yl);if(!te[jl]||he[jl])throw Br($t),Sm("root node is forbidden and cannot be sanitized in-place")}if(un($t))throw Br($t),Sm("root node is clobbered and cannot be sanitized in-place");try{ip($t)}catch(jl){throw Br($t),jl}}else if(gs($t))nt=ar("\x3C!---->"),_t=nt.ownerDocument.importNode($t,!0),_t.nodeType===Sc.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 Yl=Ie(_i);for(;jt=Yl.nextNode();)vm(jt,_i),Js(jt),En(jt.content)&&kc(jt.content)}catch(Yl){throw ln&&(Br($t),Um(e.removed,jl=>{jl.element&&bt(jl.element)})),Yl}if(ln)return Um(e.removed,Yl=>{Yl.element&&bt(Yl.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&&Do(Kgt,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 bm(_t,jt,nt)},e.addHook=function($t,Pe){typeof Pe=="function"&&Jl(G,$t)&&U3(G[$t],Pe)},e.removeHook=function($t,Pe){if(Jl(G,$t)){if(Pe!==void 0){const nt=Igt(G[$t],Pe);return nt===-1?void 0:Ngt(G[$t],nt,1)[0]}return Hoe(G[$t])}},e.removeHooks=function($t){Jl(G,$t)&&(G[$t]=[])},e.removeAllHooks=function(){G=ele()},e}var h0=sTe(),BH=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>BH(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]=BH(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"),aa=BH,Vd="#ffffff",Hd="#f2f2f2",rn=w((t,e)=>e?ye(t,{s:-40,l:10}):ye(t,{s:-40,l:-10}),"mkBorder"),Zb,imt=(Zb=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(Zb,"Theme"),Zb),smt=w(t=>{const e=new imt;return e.calculate(t),e},"getThemeVariables"),Qb,amt=(Qb=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(Qb,"Theme"),Qb),omt=w(t=>{const e=new amt;return e.calculate(t),e},"getThemeVariables"),Jb,lmt=(Jb=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(Jb,"Theme"),Jb),V0=w(t=>{const e=new lmt;return e.calculate(t),e},"getThemeVariables"),ex,cmt=(ex=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(ex,"Theme"),ex),umt=w(t=>{const e=new cmt;return e.calculate(t),e},"getThemeVariables"),tx,hmt=(tx=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(tx,"Theme"),tx),dmt=w(t=>{const e=new hmt;return e.calculate(t),e},"getThemeVariables"),rx,fmt=(rx=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(rx,"Theme"),rx),pmt=w(t=>{const e=new fmt;return e.calculate(t),e},"getThemeVariables"),nx,gmt=(nx=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(nx,"Theme"),nx),mmt=w(t=>{const e=new gmt;return e.calculate(t),e},"getThemeVariables"),ix,ymt=(ix=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(ix,"Theme"),ix),vmt=w(t=>{const e=new ymt;return e.calculate(t),e},"getThemeVariables"),sx,bmt=(sx=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(sx,"Theme"),sx),xmt=w(t=>{const e=new bmt;return e.calculate(t),e},"getThemeVariables"),ax,wmt=(ax=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(ax,"Theme"),ax),Tmt=w(t=>{const e=new wmt;return e.calculate(t),e},"getThemeVariables"),ox,Cmt=(ox=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(ox,"Theme"),ox),kmt=w(t=>{const e=new Cmt;return e.calculate(t),e},"getThemeVariables"),r0={base:{getThemeVariables:smt},dark:{getThemeVariables:omt},default:{getThemeVariables:V0},forest:{getThemeVariables:umt},neutral:{getThemeVariables:dmt},neo:{getThemeVariables:pmt},"neo-dark":{getThemeVariables:mmt},redux:{getThemeVariables:vmt},"redux-dark":{getThemeVariables:xmt},"redux-color":{getThemeVariables:Tmt},"redux-dark-color":{getThemeVariables:kmt}},lo={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},aTe={...lo,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:r0.default.getThemeVariables(),sequence:{...lo.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:{...lo.gantt,tickInterval:void 0,useWidth:void 0},c4:{...lo.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...lo.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:{...lo.pie,useWidth:984},xyChart:{...lo.xyChart,useWidth:void 0},requirement:{...lo.requirement,useWidth:void 0},packet:{...lo.packet},eventmodeling:{...lo.eventmodeling},treeView:{...lo.treeView,useWidth:void 0},radar:{...lo.radar},railroad:{...lo.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:{...lo.ishikawa},sankey:{...lo.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:{...lo.venn},cynefin:{...lo.cynefin}},oTe=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...oTe(t[n],"")]:[...r,e+n],[]),"keyify"),Smt=new Set(oTe(aTe,"")),Sn=aTe,Emt={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Amt=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"),_9=w(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>_9(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Smt.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Emt[e];n?Amt(t[e],n):(de.debug("sanitizing object",e),_9(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=lTe(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"),lTe=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"),sc=aa({},r5),L9,vy=[],jk=aa({},r5),ZE=w((t,e)=>{let r=aa({},t),n={};for(const i of e)hTe(i),n=aa(n,i);if(r=aa(r,n),n.theme&&n.theme in r0){const i=aa({},L9),s=aa(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in r0&&(r.themeVariables=r0[r.theme].getThemeVariables(s))}return jk=r,Nmt(jk),jk},"updateCurrentConfig"),Mmt=w(t=>(sc=aa({},r5),sc=aa(sc,t),t.theme&&r0[t.theme]&&(sc.themeVariables=r0[t.theme].getThemeVariables(t.themeVariables)),ZE(sc,vy),sc),"setSiteConfig"),Rmt=w(t=>{L9=aa({},t)},"saveConfigFromInitialize"),_mt=w(t=>(sc=aa(sc,t),ZE(sc,vy),sc),"updateSiteConfig"),cTe=w(()=>aa({},sc),"getSiteConfig"),uTe=w(t=>(ZE(jk,[t]),br()),"setConfig"),br=w(()=>aa({},jk),"getConfig"),hTe=w(t=>{t&&(["secure",...sc.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"&&hTe(t[e])}))},"sanitize"),Lmt=w(t=>{var e;_9(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),vy.push(t),ZE(sc,vy)},"addDirective"),I9=w((t=sc)=>{vy=[],ZE(t,vy)},"reset"),Imt={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."},tle={},dTe=w(t=>{tle[t]||(de.warn(Imt[t]),tle[t]=!0)},"issueWarning"),Nmt=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&dTe("LAZY_LOAD_DEPRECATED")},"checkConfig"),fTe=w(()=>{let t={};L9&&(t=aa(t,L9));for(const e of vy)t=aa(t,e);return t},"getUserDefinedConfig"),di=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&dTe("FLOWCHART_HTML_LABELS_DEPRECATED"),Gd(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),pTe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Xk=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Dmt=/\s*%%.*\n/gm,lx,gTe=(lx=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(lx,"UnknownDiagramError"),lx),by={},SK=w(function(t,e){t=t.replace(pTe,"").replace(Xk,"").replace(Dmt,` +`);for(const[r,{detector:n}]of Object.entries(by))if(n(t,e))return r;throw new gTe(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),FH=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)mTe(e,r,n)},"registerLazyLoadedDiagrams"),mTe=w((t,e,r)=>{by[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),by[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Omt=w(t=>by[t].loader,"getDiagramLoader"),a3=//gi,Pmt=w(t=>t?bTe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),$mt=(()=>{let t=!1;return()=>{t||(yTe(),t=!0)}})();function yTe(){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(yTe,"setupDompurifyHooks");var vTe=w(t=>($mt(),h0.sanitize(t)),"removeScript"),rle=w((t,e)=>{if(di(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=vTe(t):r!=="loose"&&(t=bTe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=Vmt(t))}return t},"sanitizeMore"),Ln=w((t,e)=>t&&(e.dompurifyConfig?t=h0.sanitize(rle(t,e),e.dompurifyConfig).toString():t=h0.sanitize(rle(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),Bmt=w((t,e)=>typeof t=="string"?Ln(t,e):t.flat().map(r=>Ln(r,e)),"sanitizeTextOrArray"),Fmt=w(t=>a3.test(t),"hasBreaks"),zmt=w(t=>t.split(a3),"splitBreaks"),Vmt=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),bTe=w(t=>t.replace(a3,"#br#"),"breakToPlaceholder"),HN=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"),Hmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Gmt=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Sp=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),Wmt=w((t,e)=>{const r=zH(t,"~"),n=zH(e,"~");return r===1&&n===1},"shouldCombineSets"),qmt=w(t=>{const e=zH(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"),nle=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),VH=/\$\$(.*?)\$\$/g,Ks=w(t=>{var e;return(((e=t.match(VH))==null?void 0:e.length)??0)>0},"hasKatex"),QE=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await GN(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"),Umt=w(async(t,e)=>{if(!Ks(t))return t;if(!(nle()||e.legacyMathML||e.forceLegacyMathML))return t.replace(VH,"MathML is unsupported in this environment.");{const{default:r}=await Rr(async()=>{const{default:i}=await Promise.resolve().then(()=>$zt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!nle()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(a3).map(i=>Ks(i)?`
${i}
`:`
${i}
`).join("").replace(VH,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),GN=w(async(t,e)=>Ln(await Umt(t,e),e),"renderKatexSanitized"),Vt={getRows:Pmt,sanitizeText:Ln,sanitizeTextOrArray:Bmt,hasBreaks:Fmt,splitBreaks:zmt,lineBreakRegex:a3,removeScript:vTe,getUrl:HN,evaluate:Gd,getMax:Hmt,getMin:Gmt},Ymt=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),jmt=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=jmt(e,r,n);Ymt(t,i)},"configureSvgSize"),o3=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"),AM={};function HH(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}w(HH,"cssStyleSheetToString");var Xmt=w((t,e,r,n)=>{let i="";return t in AM&&AM[t]?i=AM[t]({...r,svgId:n}):de.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -1058,48 +1058,48 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),Xmt=w((t,e)=>{e!==void 0&&(AM[t]=e)},"addStylesForDiagram"),Kmt=jmt,EK={};zN(EK,{clear:()=>Ri,getAccDescription:()=>ns,getAccTitle:()=>ts,getDiagramTitle:()=>qi,setAccDescription:()=>rs,setAccTitle:()=>Hi,setDiagramTitle:()=>Ji});var AK="",MK="",RK="",_K=w(t=>Ln(t,br()),"sanitizeText"),Ri=w(()=>{AK="",RK="",MK=""},"clear"),Hi=w(t=>{AK=_K(t).replace(/^\s+/g,"")},"setAccTitle"),ts=w(()=>AK,"getAccTitle"),rs=w(t=>{RK=_K(t).replace(/\n\s+/g,` -`)},"setAccDescription"),ns=w(()=>RK,"getAccDescription"),Ji=w(t=>{MK=_K(t)},"setDiagramTitle"),qi=w(()=>MK,"getDiagramTitle"),ile=de,Zmt=TK,Ve=br,GH=cTe,bTe=r5,LK=w(t=>Ln(t,Ve()),"sanitizeText"),IK=o3,Qmt=w(()=>EK,"getCommonDb"),N9={},D9=w((t,e,r)=>{var n;N9[t]&&ile.warn(`Diagram with id ${t} already registered. Overwriting.`),N9[t]=e,r&&gTe(t,r),Xmt(t,e.styles),(n=e.injectUtils)==null||n.call(e,ile,Zmt,Ve,LK,IK,Qmt(),()=>{})},"registerDiagram"),WH=w(t=>{if(t in N9)return N9[t];throw new Jmt(t)},"getDiagram"),cx,Jmt=(cx=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(cx,"DiagramNotFoundError"),cx);function MM(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function e1t(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function NK(t){let e,r,n;t.length!==2?(e=MM,r=(o,l)=>MM(t(o),l),n=(o,l)=>t(o)-l):(e=t===MM||t===e1t?t:t1t,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 t1t(){return 0}function r1t(t){return t===null?NaN:+t}const n1t=NK(MM),i1t=n1t.right;NK(r1t).center;class sle extends Map{constructor(e,r=o1t){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(ale(this,e))}has(e){return super.has(ale(this,e))}set(e,r){return super.set(s1t(this,e),r)}delete(e){return super.delete(a1t(this,e))}}function ale({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function s1t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function a1t({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(r),t.delete(n)),r}function o1t(t){return t!==null&&typeof t=="object"?t.valueOf():t}const l1t=Math.sqrt(50),c1t=Math.sqrt(10),u1t=Math.sqrt(2);function O9(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>=l1t?10:s>=c1t?5:s>=u1t?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 f1t(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 p1t(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 b1t(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function x1t(){return!this.__axis}function xTe(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===RM||t===MA?-1:1,h=t===MA||t===$$?"x":"y",d=t===RM||t===YH?m1t:y1t;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):g1t),y=Math.max(s,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,T=(e.bandwidth?b1t:v1t)(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===RM?"0em":t===YH?"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",ole).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",ole).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===MA||t===$$?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(x1t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===$$?"start":t===MA?"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 w1t(t){return xTe(RM,t)}function T1t(t){return xTe(YH,t)}var C1t={value:()=>{}};function wTe(){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}})}_M.prototype=wTe.prototype={constructor:_M,on:function(t,e){var r=this._,n=k1t(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)),cle.hasOwnProperty(e)?{space:cle[e],local:t}:t}function E1t(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===jH&&e.documentElement.namespaceURI===jH?e.createElement(t):e.createElementNS(r,t)}}function A1t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function TTe(t){var e=WN(t);return(e.local?A1t:E1t)(e)}function M1t(){}function DK(t){return t==null?M1t:function(){return this.querySelector(t)}}function R1t(t){typeof t!="function"&&(t=DK(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 eyt(t){t||(t=tyt);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 ryt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function nyt(){return Array.from(this)}function iyt(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?gyt:typeof e=="function"?yyt:myt)(t,e,r??"")):n5(this.node(),t)}function n5(t,e){return t.style.getPropertyValue(e)||ATe(t).getComputedStyle(t,null).getPropertyValue(e)}function byt(t){return function(){delete this[t]}}function xyt(t,e){return function(){this[t]=e}}function wyt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Tyt(t,e){return arguments.length>1?this.each((e==null?byt:typeof e=="function"?wyt:xyt)(t,e)):this.node()[t]}function MTe(t){return t.trim().split(/^|\s+/)}function OK(t){return t.classList||new RTe(t)}function RTe(t){this._node=t,this._names=MTe(t.getAttribute("class")||"")}RTe.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 _Te(t,e){for(var r=OK(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Kyt(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?RA(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?RA(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=svt.exec(t))?new Vo(e[1],e[2],e[3],1):(e=avt.exec(t))?new Vo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ovt.exec(t))?RA(e[1],e[2],e[3],e[4]):(e=lvt.exec(t))?RA(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=cvt.exec(t))?mle(e[1],e[2]/100,e[3]/100,1):(e=uvt.exec(t))?mle(e[1],e[2]/100,e[3]/100,e[4]):ule.hasOwnProperty(t)?fle(ule[t]):t==="transparent"?new Vo(NaN,NaN,NaN,0):null}function fle(t){return new Vo(t>>16&255,t>>8&255,t&255,1)}function RA(t,e,r,n){return n<=0&&(t=e=r=NaN),new Vo(t,e,r,n)}function DTe(t){return t instanceof Xy||(t=xy(t)),t?(t=t.rgb(),new Vo(t.r,t.g,t.b,t.opacity)):new Vo}function XH(t,e,r,n){return arguments.length===1?DTe(t):new Vo(t,e,r,n??1)}function Vo(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}e7(Vo,XH,qN(Xy,{brighter(t){return t=t==null?$9:Math.pow($9,t),new Vo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?h6:Math.pow(h6,t),new Vo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Vo(ey(this.r),ey(this.g),ey(this.b),B9(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:ple,formatHex:ple,formatHex8:fvt,formatRgb:gle,toString:gle}));function ple(){return`#${O1(this.r)}${O1(this.g)}${O1(this.b)}`}function fvt(){return`#${O1(this.r)}${O1(this.g)}${O1(this.b)}${O1((isNaN(this.opacity)?1:this.opacity)*255)}`}function gle(){const t=B9(this.opacity);return`${t===1?"rgb(":"rgba("}${ey(this.r)}, ${ey(this.g)}, ${ey(this.b)}${t===1?")":`, ${t})`}`}function B9(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ey(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function O1(t){return t=ey(t),(t<16?"0":"")+t.toString(16)}function mle(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 OTe(t){if(t instanceof oh)return new oh(t.h,t.s,t.l,t.opacity);if(t instanceof Xy||(t=xy(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 pvt(t,e,r,n){return arguments.length===1?OTe(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}e7(oh,pvt,qN(Xy,{brighter(t){return t=t==null?$9:Math.pow($9,t),new oh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?h6:Math.pow(h6,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 Vo(B$(t>=240?t-240:t+120,i,n),B$(t,i,n),B$(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new oh(yle(this.h),_A(this.s),_A(this.l),B9(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=B9(this.opacity);return`${t===1?"hsl(":"hsla("}${yle(this.h)}, ${_A(this.s)*100}%, ${_A(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yle(t){return t=(t||0)%360,t<0?t+360:t}function _A(t){return Math.max(0,Math.min(1,t||0))}function B$(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 gvt=Math.PI/180,mvt=180/Math.PI,F9=18,PTe=.96422,$Te=1,BTe=.82521,FTe=4/29,_b=6/29,zTe=3*_b*_b,yvt=_b*_b*_b;function VTe(t){if(t instanceof Sd)return new Sd(t.l,t.a,t.b,t.opacity);if(t instanceof Vf)return HTe(t);t instanceof Vo||(t=DTe(t));var e=H$(t.r),r=H$(t.g),n=H$(t.b),i=F$((.2225045*e+.7168786*r+.0606169*n)/$Te),s,a;return e===r&&r===n?s=a=i:(s=F$((.4360747*e+.3850649*r+.1430804*n)/PTe),a=F$((.0139322*e+.0971045*r+.7141733*n)/BTe)),new Sd(116*i-16,500*(s-i),200*(i-a),t.opacity)}function vvt(t,e,r,n){return arguments.length===1?VTe(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}e7(Sd,vvt,qN(Xy,{brighter(t){return new Sd(this.l+F9*(t??1),this.a,this.b,this.opacity)},darker(t){return new Sd(this.l-F9*(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=PTe*z$(e),t=$Te*z$(t),r=BTe*z$(r),new Vo(V$(3.1338561*e-1.6168667*t-.4906146*r),V$(-.9787684*e+1.9161415*t+.033454*r),V$(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function F$(t){return t>yvt?Math.pow(t,1/3):t/zTe+FTe}function z$(t){return t>_b?t*t*t:zTe*(t-FTe)}function V$(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function H$(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bvt(t){if(t instanceof Vf)return new Vf(t.h,t.c,t.l,t.opacity);if(t instanceof Sd||(t=VTe(t)),t.a===0&&t.b===0)return new Vf(NaN,0()=>t;function GTe(t,e){return function(r){return t+r*e}}function xvt(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 wvt(t,e){var r=e-t;return r?GTe(t,r>180||r<-180?r-360*Math.round(r/360):r):UN(isNaN(t)?e:t)}function Tvt(t){return(t=+t)==1?Kk:function(e,r){return r-e?xvt(e,r,t):UN(isNaN(e)?r:e)}}function Kk(t,e){var r=e-t;return r?GTe(t,r):UN(isNaN(t)?e:t)}const z9=(function t(e){var r=Tvt(e);function n(i,s){var a=r((i=XH(i)).r,(s=XH(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),u=Kk(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 Cvt(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=G$.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;--i5}function ble(){wy=(H9=f6.now())+YN,i5=UC=0;try{Bvt()}finally{i5=0,zvt(),wy=0}}function Fvt(){var t=f6.now(),e=t-H9;e>YTe&&(YN-=e,H9=t)}function zvt(){for(var t,e=V9,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:V9=r);YC=t,JH(n)}function JH(t){if(!i5){UC&&(UC=clearTimeout(UC));var e=t-wy;e>24?(t<1/0&&(UC=setTimeout(ble,t-f6.now()-YN)),X3&&(X3=clearInterval(X3))):(X3||(H9=f6.now(),X3=setInterval(Fvt,YTe)),i5=1,jTe(ble))}}function xle(t,e,r){var n=new G9;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Vvt=wTe("start","end","cancel","interrupt"),Hvt=[],KTe=0,wle=1,eG=2,LM=3,Tle=4,tG=5,IM=6;function jN(t,e,r,n,i,s){var a=t.__transition;if(!a)t.__transition={};else if(r in a)return;Gvt(t,r,{name:e,index:n,group:i,on:Vvt,tween:Hvt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:KTe})}function BK(t,e){var r=Oh(t,e);if(r.state>KTe)throw new Error("too late; already scheduled");return r}function Wd(t,e){var r=Oh(t,e);if(r.state>LM)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 Gvt(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=XTe(s,0,r.time);function s(u){r.state=wle,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!==wle)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===LM)return xle(a);p.state===Tle?(p.state=IM,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+heG&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function x2t(t,e,r){var n,i,s=b2t(e)?BK:Wd;return function(){var a=s(this,t),o=a.on;o!==n&&(i=(n=o).copy()).on(e,r),a.on=i}}function w2t(t,e){var r=this._id;return arguments.length<2?Oh(this.node(),r).on.on(t):this.each(x2t(r,t,e))}function T2t(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function C2t(){return this.on("end.remove",T2t(this._id))}function k2t(t){var e=this._name,r=this._id;typeof t!="function"&&(t=DK(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 e5e;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;iYm)if(!(Math.abs(d*l-u*h)>Ym)||!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((rG-Math.acos((m+f-y)/(2*v*x)))/2),T=b/x,C=b/v;Math.abs(T-1)>Ym&&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)>Ym||Math.abs(this._y1-h)>Ym)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%nG+nG),f>X2t?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>Ym&&this._append`A${n},${n},0,${+(f>=rG)},${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 Q2t(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function W9(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 s5(t){return t=W9(Math.abs(t)),t?t[1]:NaN}function J2t(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 ebt(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var tbt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function q9(t){if(!(e=tbt.exec(t)))throw new Error("invalid format: "+t);var e;return new zK({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]})}q9.prototype=zK.prototype;function zK(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+""}zK.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 rbt(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 U9;function nbt(t,e){var r=W9(t,e);if(!r)return U9=void 0,t.toPrecision(e);var n=r[0],i=r[1],s=i-(U9=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")+W9(t,Math.max(0,e+s-1))[0]}function Cle(t,e){var r=W9(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 kle={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Q2t,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)=>Cle(t*100,e),r:Cle,s:nbt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Sle(t){return t}var Ele=Array.prototype.map,Ale=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ibt(t){var e=t.grouping===void 0||t.thousands===void 0?Sle:J2t(Ele.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?Sle:ebt(Ele.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=q9(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"):kle[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=kle[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=rbt(P)),D&&+P==0&&m!=="+"&&(D=!1),N=(D?m==="("?m:o:m==="-"||m==="("?"":m)+N,L=(S==="s"&&!isNaN(P)&&U9!==void 0?Ale[8+U9/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(s5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=q9(d),d.type="f",d),{suffix:Ale[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var IA,u1,t5e;sbt({thousands:",",grouping:[3],currency:["$",""]});function sbt(t){return IA=ibt(t),u1=IA.format,t5e=IA.formatPrefix,IA}function abt(t){return Math.max(0,-s5(Math.abs(t)))}function obt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s5(e)/3)))*3-s5(Math.abs(t)))}function lbt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,s5(e)-s5(t))+1}function cbt(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 ubt(){return this.eachAfter(cbt)}function hbt(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function dbt(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 fbt(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 mbt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function ybt(t){for(var e=this,r=vbt(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 vbt(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 bbt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function xbt(){return Array.from(this)}function wbt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Tbt(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*Cbt(){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 Y9(a[o])),s.parent=n,s.depth=n.depth+1;return r.eachBefore(Mbt)}function kbt(){return VK(this).eachBefore(Abt)}function Sbt(t){return t.children}function Ebt(t){return Array.isArray(t)?t[1]:null}function Abt(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Mbt(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Y9(t){this.data=t,this.depth=this.height=0,this.parent=null}Y9.prototype=VK.prototype={constructor:Y9,count:ubt,each:hbt,eachAfter:fbt,eachBefore:dbt,find:pbt,sum:gbt,sort:mbt,path:ybt,ancestors:bbt,descendants:xbt,leaves:wbt,links:Tbt,copy:kbt,[Symbol.iterator]:Cbt};function Rbt(t){if(typeof t!="function")throw new Error;return t}function K3(){return 0}function Z3(t){return function(){return t}}function _bt(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 Lbt(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})(Nbt);function Pbt(){var t=Obt,e=!1,r=1,n=1,i=[0],s=K3,a=K3,o=K3,l=K3,u=K3;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(_bt),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 zbt(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i2?Vbt:zbt,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,Bbt),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=_vt,h()},d.clamp=function(f){return arguments.length?(a=f?!0:Q2,h()):a!==Q2},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 n5e(){return Hbt()(Q2,Q2)}function Gbt(t,e,r,n){var i=UH(t,e,r),s;switch(n=q9(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=obt(i,a))&&(n.precision=s),t5e(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=lbt(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=abt(i))&&(n.precision=s-(n.type==="%")*2);break}}return u1(n)}function Wbt(t){var e=t.domain;return t.ticks=function(r){var n=e();return h1t(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return Gbt(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=qH(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 a5(){var t=n5e();return t.copy=function(){return r5e(t,a5())},XN.apply(t,arguments),Wbt(t)}function qbt(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(uNa(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)=>(W$.setTime(+s),q$.setTime(+a),t(W$),t(q$),Math.floor(r(W$,q$))),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 o5=Na(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);o5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Na(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):o5);o5.range;const Hf=1e3,vu=Hf*60,Gf=vu*60,f0=Gf*24,HK=f0*7,_le=f0*30,U$=f0*365,Vp=Na(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hf)},(t,e)=>(e-t)/Hf,t=>t.getUTCSeconds());Vp.range;const p6=Na(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hf)},(t,e)=>{t.setTime(+t+e*vu)},(t,e)=>(e-t)/vu,t=>t.getMinutes());p6.range;const Ubt=Na(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*vu)},(t,e)=>(e-t)/vu,t=>t.getUTCMinutes());Ubt.range;const g6=Na(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());g6.range;const Ybt=Na(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Gf)},(t,e)=>(e-t)/Gf,t=>t.getUTCHours());Ybt.range;const Ty=Na(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);Ty.range;const GK=Na(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/f0,t=>t.getUTCDate()-1);GK.range;const jbt=Na(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/f0,t=>Math.floor(t/f0));jbt.range;function Ky(t){return Na(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)/HK)}const t7=Ky(0),m6=Ky(1),i5e=Ky(2),s5e=Ky(3),Cy=Ky(4),a5e=Ky(5),o5e=Ky(6);t7.range;m6.range;i5e.range;s5e.range;Cy.range;a5e.range;o5e.range;function Zy(t){return Na(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)/HK)}const l5e=Zy(0),j9=Zy(1),Xbt=Zy(2),Kbt=Zy(3),l5=Zy(4),Zbt=Zy(5),Qbt=Zy(6);l5e.range;j9.range;Xbt.range;Kbt.range;l5.range;Zbt.range;Qbt.range;const y6=Na(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());y6.range;const Jbt=Na(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());Jbt.range;const p0=Na(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:Na(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 ky=Na(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());ky.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Na(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)});ky.range;function ext(t,e,r,n,i,s){const a=[[Vp,1,Hf],[Vp,5,5*Hf],[Vp,15,15*Hf],[Vp,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,HK],[e,1,_le],[e,3,3*_le],[t,1,U$]];function o(u,h,d){const f=hy).right(a,f);if(p===a.length)return t.every(UH(u/U$,h/U$,d));if(p===0)return o5.every(Math.max(UH(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=j$(Q3(ie.y,0,1)),_e=te.getUTCDay(),te=_e>4||_e===0?j9.ceil(te):j9(te),te=GK.offset(te,(ie.V-1)*7),ie.y=te.getUTCFullYear(),ie.m=te.getUTCMonth(),ie.d=te.getUTCDate()+(ie.w+6)%7):(te=Y$(Q3(ie.y,0,1)),_e=te.getDay(),te=_e>4||_e===0?m6.ceil(te):m6(te),te=Ty.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?j$(Q3(ie.y,0,1)).getUTCDay():Y$(Q3(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,j$(ie)):Y$(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 Lle?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 Lle={"-":"",_:" ",0:"0"},to=/^\s*\d+/,ixt=/^%/,sxt=/[\\^$*+?|[\]().{}]/g;function ii(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s[e.toLowerCase(),r]))}function oxt(t,e,r){var n=to.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function lxt(t,e,r){var n=to.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function cxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function uxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function hxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Ile(t,e,r){var n=to.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Nle(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function dxt(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 fxt(t,e,r){var n=to.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function pxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Dle(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function gxt(t,e,r){var n=to.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Ole(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function mxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function yxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function vxt(t,e,r){var n=to.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function bxt(t,e,r){var n=to.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function xxt(t,e,r){var n=ixt.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function wxt(t,e,r){var n=to.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Txt(t,e,r){var n=to.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Ple(t,e){return ii(t.getDate(),e,2)}function Cxt(t,e){return ii(t.getHours(),e,2)}function kxt(t,e){return ii(t.getHours()%12||12,e,2)}function Sxt(t,e){return ii(1+Ty.count(p0(t),t),e,3)}function c5e(t,e){return ii(t.getMilliseconds(),e,3)}function Ext(t,e){return c5e(t,e)+"000"}function Axt(t,e){return ii(t.getMonth()+1,e,2)}function Mxt(t,e){return ii(t.getMinutes(),e,2)}function Rxt(t,e){return ii(t.getSeconds(),e,2)}function _xt(t){var e=t.getDay();return e===0?7:e}function Lxt(t,e){return ii(t7.count(p0(t)-1,t),e,2)}function u5e(t){var e=t.getDay();return e>=4||e===0?Cy(t):Cy.ceil(t)}function Ixt(t,e){return t=u5e(t),ii(Cy.count(p0(t),t)+(p0(t).getDay()===4),e,2)}function Nxt(t){return t.getDay()}function Dxt(t,e){return ii(m6.count(p0(t)-1,t),e,2)}function Oxt(t,e){return ii(t.getFullYear()%100,e,2)}function Pxt(t,e){return t=u5e(t),ii(t.getFullYear()%100,e,2)}function $xt(t,e){return ii(t.getFullYear()%1e4,e,4)}function Bxt(t,e){var r=t.getDay();return t=r>=4||r===0?Cy(t):Cy.ceil(t),ii(t.getFullYear()%1e4,e,4)}function Fxt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ii(e/60|0,"0",2)+ii(e%60,"0",2)}function $le(t,e){return ii(t.getUTCDate(),e,2)}function zxt(t,e){return ii(t.getUTCHours(),e,2)}function Vxt(t,e){return ii(t.getUTCHours()%12||12,e,2)}function Hxt(t,e){return ii(1+GK.count(ky(t),t),e,3)}function h5e(t,e){return ii(t.getUTCMilliseconds(),e,3)}function Gxt(t,e){return h5e(t,e)+"000"}function Wxt(t,e){return ii(t.getUTCMonth()+1,e,2)}function qxt(t,e){return ii(t.getUTCMinutes(),e,2)}function Uxt(t,e){return ii(t.getUTCSeconds(),e,2)}function Yxt(t){var e=t.getUTCDay();return e===0?7:e}function jxt(t,e){return ii(l5e.count(ky(t)-1,t),e,2)}function d5e(t){var e=t.getUTCDay();return e>=4||e===0?l5(t):l5.ceil(t)}function Xxt(t,e){return t=d5e(t),ii(l5.count(ky(t),t)+(ky(t).getUTCDay()===4),e,2)}function Kxt(t){return t.getUTCDay()}function Zxt(t,e){return ii(j9.count(ky(t)-1,t),e,2)}function Qxt(t,e){return ii(t.getUTCFullYear()%100,e,2)}function Jxt(t,e){return t=d5e(t),ii(t.getUTCFullYear()%100,e,2)}function e4t(t,e){return ii(t.getUTCFullYear()%1e4,e,4)}function t4t(t,e){var r=t.getUTCDay();return t=r>=4||r===0?l5(t):l5.ceil(t),ii(t.getUTCFullYear()%1e4,e,4)}function r4t(){return"+0000"}function Ble(){return"%"}function Fle(t){return+t}function zle(t){return Math.floor(+t/1e3)}var zv,X9;n4t({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 n4t(t){return zv=nxt(t),X9=zv.format,zv.parse,zv.utcFormat,zv.utcParse,zv}function i4t(t){return new Date(t)}function s4t(t){return t instanceof Date?+t:+new Date(+t)}function f5e(t,e,r,n,i,s,a,o,l,u){var h=n5e(),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?v6:Math.acos(t)}function Hle(t){return t>=1?K9:t<=-1?-K9:Math.asin(t)}function p5e(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 Z2t(e)}function h4t(t){return t.innerRadius}function d4t(t){return t.outerRadius}function f4t(t){return t.startAngle}function p4t(t){return t.endAngle}function g4t(t){return t&&t.padAngle}function m4t(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 c5(){var t=h4t,e=d4t,r=Gs(0),n=null,i=f4t,s=p4t,a=g4t,o=null,l=p5e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-K9,m=s.apply(this,arguments)-K9,y=Vle(m-g),v=m>g;if(o||(o=h=l()),pPo))o.moveTo(0,0);else if(y>NM-Po)o.moveTo(p*Em(g),p*zh(g)),o.arc(0,0,p,g,m,!v),f>Po&&(o.moveTo(f*Em(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>Po&&(n?+n.apply(this,arguments):J2(f*f+p*p)),R=X$(Vle(p-f)/2,+r.apply(this,arguments)),_=R,P=R,N,L;if(A>Po){var I=Hle(A/f*zh(E)),$=Hle(A/p*zh(E));(S-=I*2)>Po?(I*=v?1:-1,T+=I,C-=I):(S=0,T=C=(g+m)/2),(k-=$*2)>Po?($*=v?1:-1,x+=$,b-=$):(k=0,x=b=(g+m)/2)}var O=p*Em(x),D=p*zh(x),F=f*Em(C),z=f*zh(C);if(R>Po){var V=p*Em(b),B=p*zh(b),H=f*Em(T),G=f*zh(T),W;if(yPo?P>Po?(N=NA(H,G,O,D,p,P,v),L=NA(V,B,F,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),PPo)||!(S>Po)?o.lineTo(F,z):_>Po?(N=NA(F,z,V,B,f,-_,v),L=NA(O,D,H,G,f,-_,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),_t?1:e>=t?0:NaN}function x4t(t){return t}function w4t(){var t=x4t,e=b4t,r=null,n=Gs(0),i=Gs(NM),s=Gs(0);function a(o){var l,u=(o=g5e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(NM,Math.max(-NM,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 y5e{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 v5e(t){return new y5e(t,!0)}function b5e(t){return new y5e(t,!1)}function yg(){}function Z9(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 KN(t){this._context=t}KN.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:Z9(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:Z9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function x6(t){return new KN(t)}function x5e(t){this._context=t}x5e.prototype={areaStart:yg,areaEnd:yg,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:Z9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function T4t(t){return new x5e(t)}function w5e(t){this._context=t}w5e.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:Z9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function C4t(t){return new w5e(t)}function T5e(t,e){this._basis=new KN(t),this._beta=e}T5e.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 k4t=(function t(e){function r(n){return e===1?new KN(n):new T5e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function Q9(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 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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Q9(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:Q9(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 C5e=(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){this._context=t,this._k=(1-e)/6}qK.prototype={areaStart:yg,areaEnd:yg,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:Q9(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 S4t=(function t(e){function r(n){return new qK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function UK(t,e){this._context=t,this._k=(1-e)/6}UK.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:Q9(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 E4t=(function t(e){function r(n){return new UK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function YK(t,e,r){var n=t._x1,i=t._y1,s=t._x2,a=t._y2;if(t._l01_a>Po){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>Po){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 k5e(t,e){this._context=t,this._alpha=e}k5e.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:YK(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 S5e=(function t(e){function r(n){return e?new k5e(n,e):new WK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function E5e(t,e){this._context=t,this._alpha=e}E5e.prototype={areaStart:yg,areaEnd:yg,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:YK(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 A4t=(function t(e){function r(n){return e?new E5e(n,e):new qK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function A5e(t,e){this._context=t,this._alpha=e}A5e.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:YK(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 M4t=(function t(e){function r(n){return e?new A5e(n,e):new UK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function M5e(t){this._context=t}M5e.prototype={areaStart:yg,areaEnd:yg,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 R4t(t){return new M5e(t)}function Gle(t){return t<0?-1:1}function Wle(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(Gle(s)+Gle(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function qle(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function K$(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 J9(t){this._context=t}J9.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:K$(this,this._t0,qle(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,K$(this,qle(this,r=Wle(this,t,e)),r);break;default:K$(this,this._t0,r=Wle(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function R5e(t){this._context=new _5e(t)}(R5e.prototype=Object.create(J9.prototype)).point=function(t,e){J9.prototype.point.call(this,e,t)};function _5e(t){this._context=t}_5e.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 L5e(t){return new J9(t)}function I5e(t){return new R5e(t)}function N5e(t){this._context=t}N5e.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=Ule(t),i=Ule(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 O5e(t){return new ZN(t,.5)}function P5e(t){return new ZN(t,0)}function $5e(t){return new ZN(t,1)}function jC(t,e,r){this.k=t,this.x=e,this.y=r}jC.prototype={constructor:jC,scale:function(t){return t===1?this:new jC(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new jC(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+")"}};jC.prototype;var Ko=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 jK(t){return typeof t>"u"||t===null}w(jK,"isNothing");function B5e(t){return typeof t=="object"&&t!==null}w(B5e,"isObject");function F5e(t){return Array.isArray(t)?t:jK(t)?[]:[t]}w(F5e,"toArray");function z5e(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r{e!==void 0&&(AM[t]=e)},"addStylesForDiagram"),Zmt=Xmt,EK={};zN(EK,{clear:()=>Ri,getAccDescription:()=>ns,getAccTitle:()=>ts,getDiagramTitle:()=>qi,setAccDescription:()=>rs,setAccTitle:()=>Hi,setDiagramTitle:()=>Ji});var AK="",MK="",RK="",_K=w(t=>Ln(t,br()),"sanitizeText"),Ri=w(()=>{AK="",RK="",MK=""},"clear"),Hi=w(t=>{AK=_K(t).replace(/^\s+/g,"")},"setAccTitle"),ts=w(()=>AK,"getAccTitle"),rs=w(t=>{RK=_K(t).replace(/\n\s+/g,` +`)},"setAccDescription"),ns=w(()=>RK,"getAccDescription"),Ji=w(t=>{MK=_K(t)},"setDiagramTitle"),qi=w(()=>MK,"getDiagramTitle"),ile=de,Qmt=TK,Ve=br,GH=uTe,xTe=r5,LK=w(t=>Ln(t,Ve()),"sanitizeText"),IK=o3,Jmt=w(()=>EK,"getCommonDb"),N9={},D9=w((t,e,r)=>{var n;N9[t]&&ile.warn(`Diagram with id ${t} already registered. Overwriting.`),N9[t]=e,r&&mTe(t,r),Kmt(t,e.styles),(n=e.injectUtils)==null||n.call(e,ile,Qmt,Ve,LK,IK,Jmt(),()=>{})},"registerDiagram"),WH=w(t=>{if(t in N9)return N9[t];throw new e1t(t)},"getDiagram"),cx,e1t=(cx=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(cx,"DiagramNotFoundError"),cx);function MM(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function t1t(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function NK(t){let e,r,n;t.length!==2?(e=MM,r=(o,l)=>MM(t(o),l),n=(o,l)=>t(o)-l):(e=t===MM||t===t1t?t:r1t,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 r1t(){return 0}function n1t(t){return t===null?NaN:+t}const i1t=NK(MM),s1t=i1t.right;NK(n1t).center;class sle extends Map{constructor(e,r=l1t){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(ale(this,e))}has(e){return super.has(ale(this,e))}set(e,r){return super.set(a1t(this,e),r)}delete(e){return super.delete(o1t(this,e))}}function ale({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function a1t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function o1t({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(r),t.delete(n)),r}function l1t(t){return t!==null&&typeof t=="object"?t.valueOf():t}const c1t=Math.sqrt(50),u1t=Math.sqrt(10),h1t=Math.sqrt(2);function O9(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>=c1t?10:s>=u1t?5:s>=h1t?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 p1t(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 g1t(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 x1t(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function w1t(){return!this.__axis}function wTe(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===RM||t===MA?-1:1,h=t===MA||t===$$?"x":"y",d=t===RM||t===YH?y1t:v1t;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):m1t),y=Math.max(s,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,T=(e.bandwidth?x1t:b1t)(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===RM?"0em":t===YH?"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",ole).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",ole).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===MA||t===$$?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(w1t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===$$?"start":t===MA?"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 T1t(t){return wTe(RM,t)}function C1t(t){return wTe(YH,t)}var k1t={value:()=>{}};function TTe(){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}})}_M.prototype=TTe.prototype={constructor:_M,on:function(t,e){var r=this._,n=S1t(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)),cle.hasOwnProperty(e)?{space:cle[e],local:t}:t}function A1t(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===jH&&e.documentElement.namespaceURI===jH?e.createElement(t):e.createElementNS(r,t)}}function M1t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function CTe(t){var e=WN(t);return(e.local?M1t:A1t)(e)}function R1t(){}function DK(t){return t==null?R1t:function(){return this.querySelector(t)}}function _1t(t){typeof t!="function"&&(t=DK(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 tyt(t){t||(t=ryt);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 nyt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function iyt(){return Array.from(this)}function syt(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?myt:typeof e=="function"?vyt:yyt)(t,e,r??"")):n5(this.node(),t)}function n5(t,e){return t.style.getPropertyValue(e)||MTe(t).getComputedStyle(t,null).getPropertyValue(e)}function xyt(t){return function(){delete this[t]}}function wyt(t,e){return function(){this[t]=e}}function Tyt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Cyt(t,e){return arguments.length>1?this.each((e==null?xyt:typeof e=="function"?Tyt:wyt)(t,e)):this.node()[t]}function RTe(t){return t.trim().split(/^|\s+/)}function OK(t){return t.classList||new _Te(t)}function _Te(t){this._node=t,this._names=RTe(t.getAttribute("class")||"")}_Te.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 LTe(t,e){for(var r=OK(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Zyt(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?RA(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?RA(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=avt.exec(t))?new Vo(e[1],e[2],e[3],1):(e=ovt.exec(t))?new Vo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=lvt.exec(t))?RA(e[1],e[2],e[3],e[4]):(e=cvt.exec(t))?RA(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=uvt.exec(t))?mle(e[1],e[2]/100,e[3]/100,1):(e=hvt.exec(t))?mle(e[1],e[2]/100,e[3]/100,e[4]):ule.hasOwnProperty(t)?fle(ule[t]):t==="transparent"?new Vo(NaN,NaN,NaN,0):null}function fle(t){return new Vo(t>>16&255,t>>8&255,t&255,1)}function RA(t,e,r,n){return n<=0&&(t=e=r=NaN),new Vo(t,e,r,n)}function OTe(t){return t instanceof Xy||(t=xy(t)),t?(t=t.rgb(),new Vo(t.r,t.g,t.b,t.opacity)):new Vo}function XH(t,e,r,n){return arguments.length===1?OTe(t):new Vo(t,e,r,n??1)}function Vo(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}e7(Vo,XH,qN(Xy,{brighter(t){return t=t==null?$9:Math.pow($9,t),new Vo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?h6:Math.pow(h6,t),new Vo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Vo(ey(this.r),ey(this.g),ey(this.b),B9(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:ple,formatHex:ple,formatHex8:pvt,formatRgb:gle,toString:gle}));function ple(){return`#${O1(this.r)}${O1(this.g)}${O1(this.b)}`}function pvt(){return`#${O1(this.r)}${O1(this.g)}${O1(this.b)}${O1((isNaN(this.opacity)?1:this.opacity)*255)}`}function gle(){const t=B9(this.opacity);return`${t===1?"rgb(":"rgba("}${ey(this.r)}, ${ey(this.g)}, ${ey(this.b)}${t===1?")":`, ${t})`}`}function B9(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ey(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function O1(t){return t=ey(t),(t<16?"0":"")+t.toString(16)}function mle(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 PTe(t){if(t instanceof oh)return new oh(t.h,t.s,t.l,t.opacity);if(t instanceof Xy||(t=xy(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 gvt(t,e,r,n){return arguments.length===1?PTe(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}e7(oh,gvt,qN(Xy,{brighter(t){return t=t==null?$9:Math.pow($9,t),new oh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?h6:Math.pow(h6,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 Vo(B$(t>=240?t-240:t+120,i,n),B$(t,i,n),B$(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new oh(yle(this.h),_A(this.s),_A(this.l),B9(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=B9(this.opacity);return`${t===1?"hsl(":"hsla("}${yle(this.h)}, ${_A(this.s)*100}%, ${_A(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yle(t){return t=(t||0)%360,t<0?t+360:t}function _A(t){return Math.max(0,Math.min(1,t||0))}function B$(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 mvt=Math.PI/180,yvt=180/Math.PI,F9=18,$Te=.96422,BTe=1,FTe=.82521,zTe=4/29,_b=6/29,VTe=3*_b*_b,vvt=_b*_b*_b;function HTe(t){if(t instanceof Sd)return new Sd(t.l,t.a,t.b,t.opacity);if(t instanceof Vf)return GTe(t);t instanceof Vo||(t=OTe(t));var e=H$(t.r),r=H$(t.g),n=H$(t.b),i=F$((.2225045*e+.7168786*r+.0606169*n)/BTe),s,a;return e===r&&r===n?s=a=i:(s=F$((.4360747*e+.3850649*r+.1430804*n)/$Te),a=F$((.0139322*e+.0971045*r+.7141733*n)/FTe)),new Sd(116*i-16,500*(s-i),200*(i-a),t.opacity)}function bvt(t,e,r,n){return arguments.length===1?HTe(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}e7(Sd,bvt,qN(Xy,{brighter(t){return new Sd(this.l+F9*(t??1),this.a,this.b,this.opacity)},darker(t){return new Sd(this.l-F9*(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=$Te*z$(e),t=BTe*z$(t),r=FTe*z$(r),new Vo(V$(3.1338561*e-1.6168667*t-.4906146*r),V$(-.9787684*e+1.9161415*t+.033454*r),V$(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function F$(t){return t>vvt?Math.pow(t,1/3):t/VTe+zTe}function z$(t){return t>_b?t*t*t:VTe*(t-zTe)}function V$(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function H$(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function xvt(t){if(t instanceof Vf)return new Vf(t.h,t.c,t.l,t.opacity);if(t instanceof Sd||(t=HTe(t)),t.a===0&&t.b===0)return new Vf(NaN,0()=>t;function WTe(t,e){return function(r){return t+r*e}}function wvt(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 Tvt(t,e){var r=e-t;return r?WTe(t,r>180||r<-180?r-360*Math.round(r/360):r):UN(isNaN(t)?e:t)}function Cvt(t){return(t=+t)==1?Kk:function(e,r){return r-e?wvt(e,r,t):UN(isNaN(e)?r:e)}}function Kk(t,e){var r=e-t;return r?WTe(t,r):UN(isNaN(t)?e:t)}const z9=(function t(e){var r=Cvt(e);function n(i,s){var a=r((i=XH(i)).r,(s=XH(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),u=Kk(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 kvt(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=G$.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;--i5}function ble(){wy=(H9=f6.now())+YN,i5=UC=0;try{Fvt()}finally{i5=0,Vvt(),wy=0}}function zvt(){var t=f6.now(),e=t-H9;e>jTe&&(YN-=e,H9=t)}function Vvt(){for(var t,e=V9,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:V9=r);YC=t,JH(n)}function JH(t){if(!i5){UC&&(UC=clearTimeout(UC));var e=t-wy;e>24?(t<1/0&&(UC=setTimeout(ble,t-f6.now()-YN)),X3&&(X3=clearInterval(X3))):(X3||(H9=f6.now(),X3=setInterval(zvt,jTe)),i5=1,XTe(ble))}}function xle(t,e,r){var n=new G9;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Hvt=TTe("start","end","cancel","interrupt"),Gvt=[],ZTe=0,wle=1,eG=2,LM=3,Tle=4,tG=5,IM=6;function jN(t,e,r,n,i,s){var a=t.__transition;if(!a)t.__transition={};else if(r in a)return;Wvt(t,r,{name:e,index:n,group:i,on:Hvt,tween:Gvt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:ZTe})}function BK(t,e){var r=Oh(t,e);if(r.state>ZTe)throw new Error("too late; already scheduled");return r}function Wd(t,e){var r=Oh(t,e);if(r.state>LM)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 Wvt(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=KTe(s,0,r.time);function s(u){r.state=wle,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!==wle)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===LM)return xle(a);p.state===Tle?(p.state=IM,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+heG&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function w2t(t,e,r){var n,i,s=x2t(e)?BK:Wd;return function(){var a=s(this,t),o=a.on;o!==n&&(i=(n=o).copy()).on(e,r),a.on=i}}function T2t(t,e){var r=this._id;return arguments.length<2?Oh(this.node(),r).on.on(t):this.each(w2t(r,t,e))}function C2t(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function k2t(){return this.on("end.remove",C2t(this._id))}function S2t(t){var e=this._name,r=this._id;typeof t!="function"&&(t=DK(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 t5e;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;iYm)if(!(Math.abs(d*l-u*h)>Ym)||!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((rG-Math.acos((m+f-y)/(2*v*x)))/2),T=b/x,C=b/v;Math.abs(T-1)>Ym&&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)>Ym||Math.abs(this._y1-h)>Ym)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%nG+nG),f>K2t?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>Ym&&this._append`A${n},${n},0,${+(f>=rG)},${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 J2t(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function W9(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 s5(t){return t=W9(Math.abs(t)),t?t[1]:NaN}function ebt(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 tbt(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var rbt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function q9(t){if(!(e=rbt.exec(t)))throw new Error("invalid format: "+t);var e;return new zK({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]})}q9.prototype=zK.prototype;function zK(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+""}zK.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 nbt(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 U9;function ibt(t,e){var r=W9(t,e);if(!r)return U9=void 0,t.toPrecision(e);var n=r[0],i=r[1],s=i-(U9=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")+W9(t,Math.max(0,e+s-1))[0]}function Cle(t,e){var r=W9(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 kle={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:J2t,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)=>Cle(t*100,e),r:Cle,s:ibt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Sle(t){return t}var Ele=Array.prototype.map,Ale=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sbt(t){var e=t.grouping===void 0||t.thousands===void 0?Sle:ebt(Ele.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?Sle:tbt(Ele.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=q9(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"):kle[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=kle[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=nbt(P)),D&&+P==0&&m!=="+"&&(D=!1),N=(D?m==="("?m:o:m==="-"||m==="("?"":m)+N,L=(S==="s"&&!isNaN(P)&&U9!==void 0?Ale[8+U9/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(s5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=q9(d),d.type="f",d),{suffix:Ale[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var IA,u1,r5e;abt({thousands:",",grouping:[3],currency:["$",""]});function abt(t){return IA=sbt(t),u1=IA.format,r5e=IA.formatPrefix,IA}function obt(t){return Math.max(0,-s5(Math.abs(t)))}function lbt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s5(e)/3)))*3-s5(Math.abs(t)))}function cbt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,s5(e)-s5(t))+1}function ubt(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 hbt(){return this.eachAfter(ubt)}function dbt(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function fbt(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 pbt(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 ybt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function vbt(t){for(var e=this,r=bbt(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 bbt(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 xbt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function wbt(){return Array.from(this)}function Tbt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Cbt(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*kbt(){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 Y9(a[o])),s.parent=n,s.depth=n.depth+1;return r.eachBefore(Rbt)}function Sbt(){return VK(this).eachBefore(Mbt)}function Ebt(t){return t.children}function Abt(t){return Array.isArray(t)?t[1]:null}function Mbt(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Rbt(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Y9(t){this.data=t,this.depth=this.height=0,this.parent=null}Y9.prototype=VK.prototype={constructor:Y9,count:hbt,each:dbt,eachAfter:pbt,eachBefore:fbt,find:gbt,sum:mbt,sort:ybt,path:vbt,ancestors:xbt,descendants:wbt,leaves:Tbt,links:Cbt,copy:Sbt,[Symbol.iterator]:kbt};function _bt(t){if(typeof t!="function")throw new Error;return t}function K3(){return 0}function Z3(t){return function(){return t}}function Lbt(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 Ibt(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})(Dbt);function $bt(){var t=Pbt,e=!1,r=1,n=1,i=[0],s=K3,a=K3,o=K3,l=K3,u=K3;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(Lbt),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 Vbt(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i2?Hbt:Vbt,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,Fbt),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=Lvt,h()},d.clamp=function(f){return arguments.length?(a=f?!0:Q2,h()):a!==Q2},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 i5e(){return Gbt()(Q2,Q2)}function Wbt(t,e,r,n){var i=UH(t,e,r),s;switch(n=q9(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=lbt(i,a))&&(n.precision=s),r5e(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=cbt(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=obt(i))&&(n.precision=s-(n.type==="%")*2);break}}return u1(n)}function qbt(t){var e=t.domain;return t.ticks=function(r){var n=e();return d1t(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return Wbt(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=qH(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 a5(){var t=i5e();return t.copy=function(){return n5e(t,a5())},XN.apply(t,arguments),qbt(t)}function Ubt(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(uNa(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)=>(W$.setTime(+s),q$.setTime(+a),t(W$),t(q$),Math.floor(r(W$,q$))),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 o5=Na(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);o5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Na(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):o5);o5.range;const Hf=1e3,vu=Hf*60,Gf=vu*60,f0=Gf*24,HK=f0*7,_le=f0*30,U$=f0*365,Vp=Na(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hf)},(t,e)=>(e-t)/Hf,t=>t.getUTCSeconds());Vp.range;const p6=Na(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hf)},(t,e)=>{t.setTime(+t+e*vu)},(t,e)=>(e-t)/vu,t=>t.getMinutes());p6.range;const Ybt=Na(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*vu)},(t,e)=>(e-t)/vu,t=>t.getUTCMinutes());Ybt.range;const g6=Na(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());g6.range;const jbt=Na(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Gf)},(t,e)=>(e-t)/Gf,t=>t.getUTCHours());jbt.range;const Ty=Na(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);Ty.range;const GK=Na(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/f0,t=>t.getUTCDate()-1);GK.range;const Xbt=Na(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/f0,t=>Math.floor(t/f0));Xbt.range;function Ky(t){return Na(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)/HK)}const t7=Ky(0),m6=Ky(1),s5e=Ky(2),a5e=Ky(3),Cy=Ky(4),o5e=Ky(5),l5e=Ky(6);t7.range;m6.range;s5e.range;a5e.range;Cy.range;o5e.range;l5e.range;function Zy(t){return Na(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)/HK)}const c5e=Zy(0),j9=Zy(1),Kbt=Zy(2),Zbt=Zy(3),l5=Zy(4),Qbt=Zy(5),Jbt=Zy(6);c5e.range;j9.range;Kbt.range;Zbt.range;l5.range;Qbt.range;Jbt.range;const y6=Na(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());y6.range;const ext=Na(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());ext.range;const p0=Na(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:Na(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 ky=Na(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());ky.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Na(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)});ky.range;function txt(t,e,r,n,i,s){const a=[[Vp,1,Hf],[Vp,5,5*Hf],[Vp,15,15*Hf],[Vp,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,HK],[e,1,_le],[e,3,3*_le],[t,1,U$]];function o(u,h,d){const f=hy).right(a,f);if(p===a.length)return t.every(UH(u/U$,h/U$,d));if(p===0)return o5.every(Math.max(UH(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=j$(Q3(ie.y,0,1)),_e=te.getUTCDay(),te=_e>4||_e===0?j9.ceil(te):j9(te),te=GK.offset(te,(ie.V-1)*7),ie.y=te.getUTCFullYear(),ie.m=te.getUTCMonth(),ie.d=te.getUTCDate()+(ie.w+6)%7):(te=Y$(Q3(ie.y,0,1)),_e=te.getDay(),te=_e>4||_e===0?m6.ceil(te):m6(te),te=Ty.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?j$(Q3(ie.y,0,1)).getUTCDay():Y$(Q3(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,j$(ie)):Y$(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 Lle?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 Lle={"-":"",_:" ",0:"0"},to=/^\s*\d+/,sxt=/^%/,axt=/[\\^$*+?|[\]().{}]/g;function ii(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s[e.toLowerCase(),r]))}function lxt(t,e,r){var n=to.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function cxt(t,e,r){var n=to.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function uxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function hxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function dxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Ile(t,e,r){var n=to.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Nle(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function fxt(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 pxt(t,e,r){var n=to.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function gxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Dle(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function mxt(t,e,r){var n=to.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Ole(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function yxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function vxt(t,e,r){var n=to.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function bxt(t,e,r){var n=to.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function xxt(t,e,r){var n=to.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function wxt(t,e,r){var n=sxt.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Txt(t,e,r){var n=to.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Cxt(t,e,r){var n=to.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Ple(t,e){return ii(t.getDate(),e,2)}function kxt(t,e){return ii(t.getHours(),e,2)}function Sxt(t,e){return ii(t.getHours()%12||12,e,2)}function Ext(t,e){return ii(1+Ty.count(p0(t),t),e,3)}function u5e(t,e){return ii(t.getMilliseconds(),e,3)}function Axt(t,e){return u5e(t,e)+"000"}function Mxt(t,e){return ii(t.getMonth()+1,e,2)}function Rxt(t,e){return ii(t.getMinutes(),e,2)}function _xt(t,e){return ii(t.getSeconds(),e,2)}function Lxt(t){var e=t.getDay();return e===0?7:e}function Ixt(t,e){return ii(t7.count(p0(t)-1,t),e,2)}function h5e(t){var e=t.getDay();return e>=4||e===0?Cy(t):Cy.ceil(t)}function Nxt(t,e){return t=h5e(t),ii(Cy.count(p0(t),t)+(p0(t).getDay()===4),e,2)}function Dxt(t){return t.getDay()}function Oxt(t,e){return ii(m6.count(p0(t)-1,t),e,2)}function Pxt(t,e){return ii(t.getFullYear()%100,e,2)}function $xt(t,e){return t=h5e(t),ii(t.getFullYear()%100,e,2)}function Bxt(t,e){return ii(t.getFullYear()%1e4,e,4)}function Fxt(t,e){var r=t.getDay();return t=r>=4||r===0?Cy(t):Cy.ceil(t),ii(t.getFullYear()%1e4,e,4)}function zxt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ii(e/60|0,"0",2)+ii(e%60,"0",2)}function $le(t,e){return ii(t.getUTCDate(),e,2)}function Vxt(t,e){return ii(t.getUTCHours(),e,2)}function Hxt(t,e){return ii(t.getUTCHours()%12||12,e,2)}function Gxt(t,e){return ii(1+GK.count(ky(t),t),e,3)}function d5e(t,e){return ii(t.getUTCMilliseconds(),e,3)}function Wxt(t,e){return d5e(t,e)+"000"}function qxt(t,e){return ii(t.getUTCMonth()+1,e,2)}function Uxt(t,e){return ii(t.getUTCMinutes(),e,2)}function Yxt(t,e){return ii(t.getUTCSeconds(),e,2)}function jxt(t){var e=t.getUTCDay();return e===0?7:e}function Xxt(t,e){return ii(c5e.count(ky(t)-1,t),e,2)}function f5e(t){var e=t.getUTCDay();return e>=4||e===0?l5(t):l5.ceil(t)}function Kxt(t,e){return t=f5e(t),ii(l5.count(ky(t),t)+(ky(t).getUTCDay()===4),e,2)}function Zxt(t){return t.getUTCDay()}function Qxt(t,e){return ii(j9.count(ky(t)-1,t),e,2)}function Jxt(t,e){return ii(t.getUTCFullYear()%100,e,2)}function e4t(t,e){return t=f5e(t),ii(t.getUTCFullYear()%100,e,2)}function t4t(t,e){return ii(t.getUTCFullYear()%1e4,e,4)}function r4t(t,e){var r=t.getUTCDay();return t=r>=4||r===0?l5(t):l5.ceil(t),ii(t.getUTCFullYear()%1e4,e,4)}function n4t(){return"+0000"}function Ble(){return"%"}function Fle(t){return+t}function zle(t){return Math.floor(+t/1e3)}var zv,X9;i4t({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 i4t(t){return zv=ixt(t),X9=zv.format,zv.parse,zv.utcFormat,zv.utcParse,zv}function s4t(t){return new Date(t)}function a4t(t){return t instanceof Date?+t:+new Date(+t)}function p5e(t,e,r,n,i,s,a,o,l,u){var h=i5e(),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?v6:Math.acos(t)}function Hle(t){return t>=1?K9:t<=-1?-K9:Math.asin(t)}function g5e(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 Q2t(e)}function d4t(t){return t.innerRadius}function f4t(t){return t.outerRadius}function p4t(t){return t.startAngle}function g4t(t){return t.endAngle}function m4t(t){return t&&t.padAngle}function y4t(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 c5(){var t=d4t,e=f4t,r=Gs(0),n=null,i=p4t,s=g4t,a=m4t,o=null,l=g5e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-K9,m=s.apply(this,arguments)-K9,y=Vle(m-g),v=m>g;if(o||(o=h=l()),pPo))o.moveTo(0,0);else if(y>NM-Po)o.moveTo(p*Em(g),p*zh(g)),o.arc(0,0,p,g,m,!v),f>Po&&(o.moveTo(f*Em(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>Po&&(n?+n.apply(this,arguments):J2(f*f+p*p)),R=X$(Vle(p-f)/2,+r.apply(this,arguments)),_=R,P=R,N,L;if(A>Po){var I=Hle(A/f*zh(E)),$=Hle(A/p*zh(E));(S-=I*2)>Po?(I*=v?1:-1,T+=I,C-=I):(S=0,T=C=(g+m)/2),(k-=$*2)>Po?($*=v?1:-1,x+=$,b-=$):(k=0,x=b=(g+m)/2)}var O=p*Em(x),D=p*zh(x),F=f*Em(C),z=f*zh(C);if(R>Po){var V=p*Em(b),B=p*zh(b),H=f*Em(T),G=f*zh(T),W;if(yPo?P>Po?(N=NA(H,G,O,D,p,P,v),L=NA(V,B,F,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),PPo)||!(S>Po)?o.lineTo(F,z):_>Po?(N=NA(F,z,V,B,f,-_,v),L=NA(O,D,H,G,f,-_,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),_t?1:e>=t?0:NaN}function w4t(t){return t}function T4t(){var t=w4t,e=x4t,r=null,n=Gs(0),i=Gs(NM),s=Gs(0);function a(o){var l,u=(o=m5e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(NM,Math.max(-NM,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 v5e{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 b5e(t){return new v5e(t,!0)}function x5e(t){return new v5e(t,!1)}function yg(){}function Z9(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 KN(t){this._context=t}KN.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:Z9(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:Z9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function x6(t){return new KN(t)}function w5e(t){this._context=t}w5e.prototype={areaStart:yg,areaEnd:yg,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:Z9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function C4t(t){return new w5e(t)}function T5e(t){this._context=t}T5e.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:Z9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function k4t(t){return new T5e(t)}function C5e(t,e){this._basis=new KN(t),this._beta=e}C5e.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 S4t=(function t(e){function r(n){return e===1?new KN(n):new C5e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function Q9(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 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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Q9(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:Q9(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 k5e=(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){this._context=t,this._k=(1-e)/6}qK.prototype={areaStart:yg,areaEnd:yg,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:Q9(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 E4t=(function t(e){function r(n){return new qK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function UK(t,e){this._context=t,this._k=(1-e)/6}UK.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:Q9(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 A4t=(function t(e){function r(n){return new UK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function YK(t,e,r){var n=t._x1,i=t._y1,s=t._x2,a=t._y2;if(t._l01_a>Po){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>Po){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 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(){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:YK(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 E5e=(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 A5e(t,e){this._context=t,this._alpha=e}A5e.prototype={areaStart:yg,areaEnd:yg,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:YK(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 M4t=(function t(e){function r(n){return e?new A5e(n,e):new qK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);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(){(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:YK(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 R4t=(function t(e){function r(n){return e?new M5e(n,e):new UK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function R5e(t){this._context=t}R5e.prototype={areaStart:yg,areaEnd:yg,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 _4t(t){return new R5e(t)}function Gle(t){return t<0?-1:1}function Wle(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(Gle(s)+Gle(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function qle(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function K$(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 J9(t){this._context=t}J9.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:K$(this,this._t0,qle(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,K$(this,qle(this,r=Wle(this,t,e)),r);break;default:K$(this,this._t0,r=Wle(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function _5e(t){this._context=new L5e(t)}(_5e.prototype=Object.create(J9.prototype)).point=function(t,e){J9.prototype.point.call(this,e,t)};function L5e(t){this._context=t}L5e.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 I5e(t){return new J9(t)}function N5e(t){return new _5e(t)}function D5e(t){this._context=t}D5e.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=Ule(t),i=Ule(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 P5e(t){return new ZN(t,.5)}function $5e(t){return new ZN(t,0)}function B5e(t){return new ZN(t,1)}function jC(t,e,r){this.k=t,this.x=e,this.y=r}jC.prototype={constructor:jC,scale:function(t){return t===1?this:new jC(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new jC(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+")"}};jC.prototype;var Ko=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 jK(t){return typeof t>"u"||t===null}w(jK,"isNothing");function F5e(t){return typeof t=="object"&&t!==null}w(F5e,"isObject");function z5e(t){return Array.isArray(t)?t:jK(t)?[]:[t]}w(z5e,"toArray");function V5e(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(DM,"getLine");function OM(t,e){return ka.repeat(" ",e-t.length)+t}w(OM,"padStart");function G5e(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=DM(t.buffer,n[a-l],i[a-l],t.position-(n[a]-n[a-l]),d),o=ka.repeat(" ",e.indent)+OM((t.line-l+1).toString(),h)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}w(XK,"formatError");function u5(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=XK(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}w(u5,"YAMLException$1");u5.prototype=Object.create(Error.prototype);u5.prototype.constructor=u5;u5.prototype.toString=w(function(e){return this.name+": "+XK(this,e)},"toString");var lc=u5;function DM(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(DM,"getLine");function OM(t,e){return ka.repeat(" ",e-t.length)+t}w(OM,"padStart");function W5e(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=DM(t.buffer,n[a-l],i[a-l],t.position-(n[a]-n[a-l]),d),o=ka.repeat(" ",e.indent)+OM((t.line-l+1).toString(),h)+" | "+u.str+` `+o;for(u=DM(t.buffer,n[a],i[a],t.position,d),o+=ka.repeat(" ",e.indent)+OM((t.line+1).toString(),h)+" | "+u.str+` `,o+=ka.repeat("-",e.indent+h+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(a+l>=i.length);l++)u=DM(t.buffer,n[a+l],i[a+l],t.position-(n[a]-n[a+l]),d),o+=ka.repeat(" ",e.indent)+OM((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}w(G5e,"makeSnippet");var P4t=G5e,$4t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],B4t=["scalar","sequence","mapping"];function W5e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}w(W5e,"compileStyleAliases");function q5e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if($4t.indexOf(r)===-1)throw new lc('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=W5e(e.styleAliases||null),B4t.indexOf(this.kind)===-1)throw new lc('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}w(q5e,"Type$1");var Ho=q5e;function aG(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(aG,"compileList");function U5e(){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"]}}),Y4t=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function s3e(t){return!(t===null||!Y4t.test(t)||t[t.length-1]==="_")}w(s3e,"resolveYamlFloat");function a3e(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(a3e,"constructYamlFloat");var j4t=/^[-+]?[0-9]+e/;function o3e(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(ka.isNegativeZero(t))return"-0.0";return r=t.toString(10),j4t.test(r)?r.replace("e",".e"):r}w(o3e,"representYamlFloat");function l3e(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||ka.isNegativeZero(t))}w(l3e,"isFloat");var X4t=new Ho("tag:yaml.org,2002:float",{kind:"scalar",resolve:s3e,construct:a3e,predicate:l3e,represent:o3e,defaultStyle:"lowercase"}),c3e=G4t.extend({implicit:[W4t,q4t,U4t,X4t]}),K4t=c3e,u3e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),h3e=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 d3e(t){return t===null?!1:u3e.exec(t)!==null||h3e.exec(t)!==null}w(d3e,"resolveYamlTimestamp");function f3e(t){var e,r,n,i,s,a,o,l=0,u=null,h,d,f;if(e=u3e.exec(t),e===null&&(e=h3e.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(f3e,"constructYamlTimestamp");function p3e(t){return t.toISOString()}w(p3e,"representYamlTimestamp");var Z4t=new Ho("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:d3e,construct:f3e,instanceOf:Date,represent:p3e});function g3e(t){return t==="<<"||t===null}w(g3e,"resolveYamlMerge");var Q4t=new Ho("tag:yaml.org,2002:merge",{kind:"scalar",resolve:g3e}),KK=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function m3e(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=KK;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(m3e,"resolveYamlBinary");function y3e(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=KK,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(y3e,"constructYamlBinary");function v3e(t){var e="",r=0,n,i,s=t.length,a=KK;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(v3e,"representYamlBinary");function b3e(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(b3e,"isBinary");var J4t=new Ho("tag:yaml.org,2002:binary",{kind:"scalar",resolve:m3e,construct:y3e,predicate:b3e,represent:v3e}),ewt=Object.prototype.hasOwnProperty,twt=Object.prototype.toString;function x3e(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(D3e,"charFromCodepoint");function ZK(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(ZK,"setProperty");var O3e=new Array(256),P3e=new Array(256);for(Am=0;Am<256;Am++)O3e[Am]=lG(Am)?1:0,P3e[Am]=lG(Am);var Am;function $3e(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||E3e,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($3e,"State$1");function QK(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=P4t(r),new lc(e,r)}w(QK,"generateError");function Ir(t,e){throw QK(t,e)}w(Ir,"throwError");function w6(t,e){t.onWarning&&t.onWarning.call(null,QK(t,e))}w(w6,"throwWarning");var jle={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&&w6(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],R3e.test(i)||Ir(e,"ill-formed tag handle (first argument) of the TAG directive"),vg.call(e.tagMap,i)&&Ir(e,'there is a previously declared suffix for "'+i+'" tag handle'),_3e.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+=ka.repeat(` -`,e-1))}w(JN,"writeFoldedLines");function B3e(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),bl(p)||P1(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),bl(i)||r&&P1(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),bl(i)||r&&P1(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),bl(n))break}else{if(t.position===t.lineStart&&r7(t)||r&&P1(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),JN(t,t.line-l),s=a=t.position,o=!1),rg(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(B3e,"readPlainScalar");function F3e(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),JN(t,Ys(t,!1,e)),n=i=t.position):t.position===t.lineStart&&r7(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(F3e,"readSingleQuotedScalar");function z3e(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&&O3e[o])t.result+=P3e[o],t.position++;else if((a=I3e(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=L3e(o))>=0?s=(s<<4)+a:Ir(t,"expected hexadecimal character");t.result+=D3e(s),t.position++}else Ir(t,"unknown escape sequence");r=n=t.position}else mh(o)?(n0(t,r,n,!0),JN(t,Ys(t,!1,e)),r=n=t.position):t.position===t.lineStart&&r7(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(z3e,"readDoubleQuotedScalar");function V3e(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),bl(u)&&(d=f=!0,t.position++,Ys(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,Sy(t,e,t_,!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),Sy(t,e,t_,!1,!0),v=t.result),p?$1(t,o,g,y,m,v,n,i,s):d?o.push($1(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(V3e,"readFlowCollection");function H3e(t,e){var r,n,i=Z$,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)Z$===i?i=d===43?Yle:owt:Ir(t,"repeat of a chomping mode identifier");else if((h=N3e(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(rg(d)){do d=t.input.charCodeAt(++t.position);while(rg(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!mh(d)&&d!==0)}for(;d!==0;){for(QN(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!a||t.lineIndento&&(o=t.lineIndent),mh(d)){l++;continue}if(t.lineIndent=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"]}}),j4t=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function a3e(t){return!(t===null||!j4t.test(t)||t[t.length-1]==="_")}w(a3e,"resolveYamlFloat");function o3e(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(o3e,"constructYamlFloat");var X4t=/^[-+]?[0-9]+e/;function l3e(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(ka.isNegativeZero(t))return"-0.0";return r=t.toString(10),X4t.test(r)?r.replace("e",".e"):r}w(l3e,"representYamlFloat");function c3e(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||ka.isNegativeZero(t))}w(c3e,"isFloat");var K4t=new Ho("tag:yaml.org,2002:float",{kind:"scalar",resolve:a3e,construct:o3e,predicate:c3e,represent:l3e,defaultStyle:"lowercase"}),u3e=W4t.extend({implicit:[q4t,U4t,Y4t,K4t]}),Z4t=u3e,h3e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),d3e=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 f3e(t){return t===null?!1:h3e.exec(t)!==null||d3e.exec(t)!==null}w(f3e,"resolveYamlTimestamp");function p3e(t){var e,r,n,i,s,a,o,l=0,u=null,h,d,f;if(e=h3e.exec(t),e===null&&(e=d3e.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(p3e,"constructYamlTimestamp");function g3e(t){return t.toISOString()}w(g3e,"representYamlTimestamp");var Q4t=new Ho("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:f3e,construct:p3e,instanceOf:Date,represent:g3e});function m3e(t){return t==="<<"||t===null}w(m3e,"resolveYamlMerge");var J4t=new Ho("tag:yaml.org,2002:merge",{kind:"scalar",resolve:m3e}),KK=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function y3e(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=KK;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(y3e,"resolveYamlBinary");function v3e(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=KK,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(v3e,"constructYamlBinary");function b3e(t){var e="",r=0,n,i,s=t.length,a=KK;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(b3e,"representYamlBinary");function x3e(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(x3e,"isBinary");var ewt=new Ho("tag:yaml.org,2002:binary",{kind:"scalar",resolve:y3e,construct:v3e,predicate:x3e,represent:b3e}),twt=Object.prototype.hasOwnProperty,rwt=Object.prototype.toString;function w3e(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(O3e,"charFromCodepoint");function ZK(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(ZK,"setProperty");var P3e=new Array(256),$3e=new Array(256);for(Am=0;Am<256;Am++)P3e[Am]=lG(Am)?1:0,$3e[Am]=lG(Am);var Am;function B3e(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||A3e,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(B3e,"State$1");function QK(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=$4t(r),new lc(e,r)}w(QK,"generateError");function Ir(t,e){throw QK(t,e)}w(Ir,"throwError");function w6(t,e){t.onWarning&&t.onWarning.call(null,QK(t,e))}w(w6,"throwWarning");var jle={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&&w6(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],_3e.test(i)||Ir(e,"ill-formed tag handle (first argument) of the TAG directive"),vg.call(e.tagMap,i)&&Ir(e,'there is a previously declared suffix for "'+i+'" tag handle'),L3e.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+=ka.repeat(` +`,e-1))}w(JN,"writeFoldedLines");function F3e(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),bl(p)||P1(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),bl(i)||r&&P1(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),bl(i)||r&&P1(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),bl(n))break}else{if(t.position===t.lineStart&&r7(t)||r&&P1(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),JN(t,t.line-l),s=a=t.position,o=!1),rg(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(F3e,"readPlainScalar");function z3e(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),JN(t,Ys(t,!1,e)),n=i=t.position):t.position===t.lineStart&&r7(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(z3e,"readSingleQuotedScalar");function V3e(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&&P3e[o])t.result+=$3e[o],t.position++;else if((a=N3e(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=I3e(o))>=0?s=(s<<4)+a:Ir(t,"expected hexadecimal character");t.result+=O3e(s),t.position++}else Ir(t,"unknown escape sequence");r=n=t.position}else mh(o)?(n0(t,r,n,!0),JN(t,Ys(t,!1,e)),r=n=t.position):t.position===t.lineStart&&r7(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(V3e,"readDoubleQuotedScalar");function H3e(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),bl(u)&&(d=f=!0,t.position++,Ys(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,Sy(t,e,t_,!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),Sy(t,e,t_,!1,!0),v=t.result),p?$1(t,o,g,y,m,v,n,i,s):d?o.push($1(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(H3e,"readFlowCollection");function G3e(t,e){var r,n,i=Z$,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)Z$===i?i=d===43?Yle:lwt:Ir(t,"repeat of a chomping mode identifier");else if((h=D3e(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(rg(d)){do d=t.input.charCodeAt(++t.position);while(rg(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!mh(d)&&d!==0)}for(;d!==0;){for(QN(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),Sy(t,e,r_,!0,i)&&(y?g=t.result:m=t.result),y||($1(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(Sy,"composeNode");function Y3e(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&&!bl(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(;rg(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&&!bl(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}a!==0&&QN(t),vg.call(jle,n)?jle[n](t,n,i):w6(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"),Sy(t,t.lineIndent-1,r_,!1,!0),Ys(t,!0,-1),t.checkLineBreaks&&cwt.test(t.input.slice(e,t.position))&&w6(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&r7(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=JK(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),Sy(t,e,r_,!0,i)&&(y?g=t.result:m=t.result),y||($1(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(Sy,"composeNode");function j3e(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&&!bl(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(;rg(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&&!bl(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}a!==0&&QN(t),vg.call(jle,n)?jle[n](t,n,i):w6(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"),Sy(t,t.lineIndent-1,r_,!1,!0),Ys(t,!0,-1),t.checkLineBreaks&&uwt.test(t.input.slice(e,t.position))&&w6(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&r7(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=JK(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(eb,"codePointAt");function tZ(t){var e=/^\n* /;return e.test(t)}w(tZ,"needIndentIndicator");var lCe=1,gG=2,cCe=3,uCe=4,C2=5;function hCe(t,e,r,n,i,s,a,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=aCe(eb(t,0))&&oCe(eb(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=eb(t,l),!h5(u))return C2;m=m&&pG(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=eb(t,l),u===T6)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!h5(u))return C2;m=m&&pG(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!a&&!i(t)?lCe:s===C6?C2:gG:r>9&&tZ(t)?C2:a?s===C6?C2:gG:f?uCe:cCe}w(hCe,"chooseScalarStyle");function dCe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===C6?'""':"''";if(!t.noCompatMode&&(_wt.indexOf(e)!==-1||Lwt.test(e)))return t.quotingType===C6?'"'+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 sCe(t,u)}switch(w(l,"testAmbiguity"),hCe(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!n,i)){case lCe:return e;case gG:return"'"+e.replace(/'/g,"''")+"'";case cCe:return"|"+mG(e,t.indent)+yG(dG(e,s));case uCe:return">"+mG(e,t.indent)+yG(dG(fCe(e,a),s));case C2:return'"'+pCe(e)+'"';default:throw new lc("impossible error: invalid scalar style")}})()}w(dCe,"writeScalar");function mG(t,e){var r=tZ(t)?String(e):"",n=t[t.length-1]===` +`+ka.repeat(" ",t.indent*e)}w(i_,"generateNextLine");function aCe(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(eb,"codePointAt");function tZ(t){var e=/^\n* /;return e.test(t)}w(tZ,"needIndentIndicator");var cCe=1,gG=2,uCe=3,hCe=4,C2=5;function dCe(t,e,r,n,i,s,a,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=oCe(eb(t,0))&&lCe(eb(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=eb(t,l),!h5(u))return C2;m=m&&pG(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=eb(t,l),u===T6)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!h5(u))return C2;m=m&&pG(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!a&&!i(t)?cCe:s===C6?C2:gG:r>9&&tZ(t)?C2:a?s===C6?C2:gG:f?hCe:uCe}w(dCe,"chooseScalarStyle");function fCe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===C6?'""':"''";if(!t.noCompatMode&&(Lwt.indexOf(e)!==-1||Iwt.test(e)))return t.quotingType===C6?'"'+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 aCe(t,u)}switch(w(l,"testAmbiguity"),dCe(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!n,i)){case cCe:return e;case gG:return"'"+e.replace(/'/g,"''")+"'";case uCe:return"|"+mG(e,t.indent)+yG(dG(e,s));case hCe:return">"+mG(e,t.indent)+yG(dG(pCe(e,a),s));case C2:return'"'+gCe(e)+'"';default:throw new lc("impossible error: invalid scalar style")}})()}w(fCe,"writeScalar");function mG(t,e){var r=tZ(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),s=i?"+":n?"":"-";return r+s+` `}w(mG,"blockHeader");function yG(t){return t[t.length-1]===` -`?t.slice(0,-1):t}w(yG,"dropEndingNewline");function fCe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`?t.slice(0,-1):t}w(yG,"dropEndingNewline");function pCe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` `);return u=u!==-1?u:t.length,r.lastIndex=u,vG(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!==""?` -`:"")+vG(l,e),i=s}return n}w(fCe,"foldString");function vG(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+=` +`:"")+vG(l,e),i=s}return n}w(pCe,"foldString");function vG(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(vG,"foldLine");function pCe(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=eb(t,i),n=Zo[r],!n&&h5(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||nCe(r);return e}w(pCe,"escapeString");function gCe(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(gCe,"writeFlowSequence");function bG(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+=i_(t,e)),t.dump&&T6===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}w(bG,"writeBlockSequence");function mCe(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(mCe,"writeFlowMapping");function yCe(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 lc("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,d&&(t.dump&&T6===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=i_(t,e)),Nd(t,e+1,h,!0,d)&&(t.dump&&T6===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}w(yCe,"writeBlockMapping");function xG(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(xG,"detectType");function Nd(t,e,r,n,i,s,a){t.tag=null,t.dump=r,xG(t,r,!1)||xG(t,r,!0);var o=X3e.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?(yCe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(mCe(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?bG(t,e-1,t.dump,i):bG(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(gCe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&dCe(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new lc("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 vCe(t,e){var r=[],n=[],i,s;for(s_(t,r,n),i=0,s=n.length;i=65536?i+=2:i++)r=eb(t,i),n=Zo[r],!n&&h5(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||iCe(r);return e}w(gCe,"escapeString");function mCe(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(mCe,"writeFlowSequence");function bG(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+=i_(t,e)),t.dump&&T6===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}w(bG,"writeBlockSequence");function yCe(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(yCe,"writeFlowMapping");function vCe(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 lc("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,d&&(t.dump&&T6===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=i_(t,e)),Nd(t,e+1,h,!0,d)&&(t.dump&&T6===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}w(vCe,"writeBlockMapping");function xG(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(xG,"detectType");function Nd(t,e,r,n,i,s,a){t.tag=null,t.dump=r,xG(t,r,!1)||xG(t,r,!0);var o=K3e.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?(vCe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(yCe(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?bG(t,e-1,t.dump,i):bG(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(mCe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&fCe(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new lc("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 bCe(t,e){var r=[],n=[],i,s;for(s_(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"),l3=w(t=>{const e=Pwt([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Pwt=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"),rZ=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}=l3(t),r=[],n=[],i=[],s=[];return e.forEach(a=>{const o=a[0];rZ(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}=l3(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:$wt(a.get("stroke-dasharray"))},e)},"userNodeOverrides"),$wt=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"),DA={},ya={},Xle;function Bwt(){return Xle||(Xle=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.BLANK_URL=ya.relativeFirstCharacters=ya.whitespaceEscapeCharsRegex=ya.urlSchemeRegex=ya.ctrlCharactersRegex=ya.htmlCtrlEntityRegex=ya.htmlEntitiesRegex=ya.invalidProtocolRegex=void 0,ya.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,ya.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ya.htmlCtrlEntityRegex=/&(newline|tab);/gi,ya.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ya.urlSchemeRegex=/^.+(:|:)/gim,ya.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,ya.relativeFirstCharacters=[".","/"],ya.BLANK_URL="about:blank"),ya}var Kle;function Fwt(){if(Kle)return DA;Kle=1,Object.defineProperty(DA,"__esModule",{value:!0}),DA.sanitizeUrl=s;var t=Bwt();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 DA}var Qy=Fwt();function zwt(t){return Array.isArray(t)}function Q$(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 Vwt(){}function bCe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function n7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const xCe="[object RegExp]",nZ="[object String]",iZ="[object Number]",sZ="[object Boolean]",aZ="[object Arguments]",wCe="[object Symbol]",TCe="[object Date]",CCe="[object Map]",kCe="[object Set]",SCe="[object Array]",ECe="[object ArrayBuffer]",ACe="[object Object]",MCe="[object DataView]",RCe="[object Uint8Array]",_Ce="[object Uint8ClampedArray]",LCe="[object Uint16Array]",ICe="[object Uint32Array]",NCe="[object Int8Array]",DCe="[object Int16Array]",OCe="[object Int32Array]",PCe="[object Float32Array]",$Ce="[object Float64Array]",Zle=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function oZ(t){return typeof Zle.Buffer<"u"&&Zle.Buffer.isBuffer(t)}function Hwt(t){return Number.isSafeInteger(t)&&t>=0}function BCe(t){return t!=null&&typeof t!="function"&&Hwt(t.length)}function Gwt(t){return t==="__proto__"}function rD(t){return t==null||typeof t!="object"&&typeof t!="function"}function lZ(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Wwt(t,e){return tb(t,void 0,t,new Map,e)}function tb(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(rD(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(n7(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 iZ:case nZ:case sZ:{const a=new t.constructor(t==null?void 0:t.valueOf());return ju(a,t),a}case aZ:{const a={};return ju(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function Qle(t){return Uwt(t)}function wG(t){return t!==null&&typeof t=="object"&&n7(t)==="[object Arguments]"}function TG(t){return typeof t=="object"&&t!==null}function Ywt(t){return TG(t)&&BCe(t)}function Qk(t){return lZ(t)}function jwt(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function i7(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(i7.Cache||Map),r}i7.Cache=Map;function Xwt(t){if(rD(t))return t;const e=n7(t);if(!Kwt(t))return{};if(zwt(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(Qk(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]"?Qwt(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 Jwt(r,t),J$(r,t),Zwt(r,t),r}function Kwt(t){switch(n7(t)){case aZ:case SCe:case ECe:case MCe:case sZ:case TCe:case PCe:case $Ce:case NCe:case DCe:case OCe:case CCe:case iZ:case ACe:case xCe:case kCe:case nZ:case wCe:case RCe:case _Ce:case LCe:case ICe:return!0;default:return!1}}function J$(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function Zwt(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function Jwt(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function eTt(t){if(rD(t))return t;if(Array.isArray(t)||lZ(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 tTt(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 FCe="​",nTt={curveBasis:x6,curveBasisClosed:T4t,curveBasisOpen:C4t,curveBumpX:v5e,curveBumpY:b5e,curveBundle:k4t,curveCardinalClosed:S4t,curveCardinalOpen:E4t,curveCardinal:C5e,curveCatmullRomClosed:A4t,curveCatmullRomOpen:M4t,curveCatmullRom:S5e,curveLinear:Zk,curveLinearClosed:R4t,curveMonotoneX:L5e,curveMonotoneY:I5e,curveNatural:D5e,curveStep:O5e,curveStepAfter:$5e,curveStepBefore:P5e},iTt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,sTt=w(function(t,e){const r=zCe(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);_9(a),n=aa(n,[...a])}else n=r.args;if(!n)return;let i=SK(t,e);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),zCe=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${iTt.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=Xk.exec(t))!==null;)if(s.index===Xk.lastIndex&&Xk.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"),aTt=w(function(t){return t.replace(Xk,"")},"removeDirectives"),oTt=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function cZ(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return nTt[r]??e}w(cZ,"interpolateToCurve");function VCe(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Qy.sanitizeUrl(r):r}w(VCe,"formatUrl");var lTt=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let s=window;for(let a=0;a{r+=uZ(i,e),e=i});const n=r/2;return hZ(t,n)}w(HCe,"traverseEdge");function GCe(t){return t.length===1?t[0]:HCe(t)}w(GCe,"calcLabelPosition");var ece=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),hZ=w((t,e)=>{let r,n=e;for(const i of t){if(r){const s=uZ(i,r);if(s===0)return r;if(s=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:ece((1-a)*r.x+a*i.x,5),y:ece((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),cTt=w((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=hZ(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 WCe(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=hZ(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(WCe,"calcTerminalLabelPosition");function dZ(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(dZ,"getStylesFromArray");var tce=0,qCe=w(()=>(tce++,"id-"+Math.random().toString(36).substr(2,12)+"-"+tce),"generateId");function UCe(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iUCe(t.length),"random"),uTt=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"),hTt=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"),Jk=i7((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=El(`${a} `,r),u=El(s,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=dTt(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}`),dTt=i7((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(El(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 a_(t,e){return nD(t,e).height}w(a_,"calculateTextHeight");function El(t,e){return nD(t,e).width}w(El,"calculateTextWidth");var nD=i7((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=uTt();y.text=m||FCe;const v=hTt(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}`),ux,fTt=(ux=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(ux,"InitIDGenerator"),ux),OA,pTt=w(function(t){return OA=OA||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),OA.innerHTML=t,unescape(OA.textContent)},"entityDecode");function fZ(t){return"str"in t}w(fZ,"isDetailedError");var gTt=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 rTt({},t,e)}w(es,"cleanAndMerge");var Kr={assignWithDepth:aa,wrapLabel:Jk,calculateTextHeight:a_,calculateTextWidth:El,calculateTextDimensions:nD,cleanAndMerge:es,detectInit:sTt,detectDirective:zCe,isSubstringInArray:oTt,interpolateToCurve:cZ,calcLabelPosition:GCe,calcCardinalityPosition:cTt,calcTerminalLabelPosition:WCe,formatUrl:VCe,getStylesFromArray:dZ,generateId:qCe,random:YCe,runFunc:lTt,entityDecode:pTt,insertTitle:gTt,isLabelCoordinateInPath:jCe,parseFontSize:H0,InitIDGenerator:fTt},mTt=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"),Lb=w((t,e,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Xa(t){return t??null}w(Xa,"handleUndefinedAttr");function jCe(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(jCe,"isLabelCoordinateInPath");var c3=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 pZ(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(pZ,"configureLabelImages");const yTt=Object.freeze({left:0,top:0,width:16,height:16}),o_=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),XCe=Object.freeze({...yTt,...o_}),vTt=Object.freeze({...XCe,body:"",hidden:!1}),bTt=Object.freeze({width:null,height:null}),xTt=Object.freeze({...bTt,...o_}),wTt=(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 eB(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 eB(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return eB(o,r)?o:null}return null},eB=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function TTt(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 rce(t,e){const r=TTt(t,e);for(const n in vTt)n in o_?n in t&&!(n in r)&&(r[n]=o_[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function CTt(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 nce(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let s={};function a(o){s=rce(n[o]||i[o],s)}return a(e),r.forEach(a),rce(t,s)}function kTt(t,e){if(t.icons[e])return nce(t,e,[]);const r=CTt(t,[e])[e];return r?nce(t,e,r):null}const STt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ETt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ice(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(STt);if(n===null||!n.length)return t;const i=[];let s=n.shift(),a=ETt.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 ATt(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 MTt(t,e){return t?""+t+""+e:e}function RTt(t,e,r){const n=ATt(t);return MTt(n.defs,e+n.content+r)}const _Tt=t=>t==="unset"||t==="undefined"||t==="none";function LTt(t,e){const r={...XCe,...t},n={...xTt,...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=RTt(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=ice(d,l/u)):(h=a==="auto"?l:a,d=o===null?ice(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{_Tt(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 ITt=/\sid="(\S+)"/g,sce=new Map;function NTt(t){t=t.replace(/[0-9]+$/,"")||"a";const e=sce.get(t)||0;return sce.set(t,e+1),e?`${t}${e}`:t}function DTt(t){const e=[];let r;for(;r=ITt.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=NTt(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 OTt(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 KCe={body:'?',height:80,width:80},CG=new Map,ZCe=new Map,gZ=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)ZCe.set(e.name,e.loader);else if("icons"in e)CG.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"),QCe=w(async(t,e)=>{const r=wTt(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=CG.get(n);if(!i){const a=ZCe.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},CG.set(n,i)}catch(o){throw de.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=kTt(i,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),PTt=w(async t=>{try{return await QCe(t),!0}catch{return!1}},"isIconAvailable"),m0=w(async(t,e,r)=>{let n;try{n=await QCe(t,e==null?void 0:e.fallbackPrefix)}catch(a){de.error(a),n=KCe}const i=LTt(n,e),s=OTt(DTt(i.body),{...i.attributes,...r});return Ln(s,br())},"getIconSVG");function mZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Jy=mZ();function JCe(t){Jy=t}var eS={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(xl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var $Tt=(()=>{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")},BTt=/^(?:[ \t]*(?:\n|$))+/,FTt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zTt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,s7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,VTt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yZ=/(?:[*+-]|\d{1,9}[.)])/,eke=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tke=si(eke).replace(/bull/g,yZ).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(),HTt=si(eke).replace(/bull/g,yZ).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(),vZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,GTt=/^[^\n]+/,bZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,WTt=si(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qTt=si(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yZ).getRegex(),iD="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",xZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,UTt=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",xZ).replace("tag",iD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rke=si(vZ).replace("hr",s7).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",iD).getRegex(),YTt=si(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rke).getRegex(),wZ={blockquote:YTt,code:FTt,def:WTt,fences:zTt,heading:VTt,hr:s7,html:UTt,lheading:tke,list:qTt,newline:BTt,paragraph:rke,table:eS,text:GTt},ace=si("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",s7).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",iD).getRegex(),jTt={...wZ,lheading:HTt,table:ace,paragraph:si(vZ).replace("hr",s7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ace).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",iD).getRegex()},XTt={...wZ,html:si(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xZ).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:eS,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:si(vZ).replace("hr",s7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",tke).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},KTt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ZTt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,nke=/^( {2,}|\\)\n(?!\s*$)/,QTt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$Tt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ake=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,n5t=si(ake,"u").replace(/punct/g,sD).getRegex(),i5t=si(ake,"u").replace(/punct/g,ske).getRegex(),oke="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",s5t=si(oke,"gu").replace(/notPunctSpace/g,ike).replace(/punctSpace/g,TZ).replace(/punct/g,sD).getRegex(),a5t=si(oke,"gu").replace(/notPunctSpace/g,t5t).replace(/punctSpace/g,e5t).replace(/punct/g,ske).getRegex(),o5t=si("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ike).replace(/punctSpace/g,TZ).replace(/punct/g,sD).getRegex(),l5t=si(/\\(punct)/,"gu").replace(/punct/g,sD).getRegex(),c5t=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(),u5t=si(xZ).replace("(?:-->|$)","-->").getRegex(),h5t=si("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",u5t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),l_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,d5t=si(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",l_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lke=si(/^!?\[(label)\]\[(ref)\]/).replace("label",l_).replace("ref",bZ).getRegex(),cke=si(/^!?\[(ref)\](?:\[\])?/).replace("ref",bZ).getRegex(),f5t=si("reflink|nolink(?!\\()","g").replace("reflink",lke).replace("nolink",cke).getRegex(),oce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,CZ={_backpedal:eS,anyPunctuation:l5t,autolink:c5t,blockSkip:r5t,br:nke,code:ZTt,del:eS,emStrongLDelim:n5t,emStrongRDelimAst:s5t,emStrongRDelimUnd:o5t,escape:KTt,link:d5t,nolink:cke,punctuation:JTt,reflink:lke,reflinkSearch:f5t,tag:h5t,text:QTt,url:eS},p5t={...CZ,link:si(/^!?\[(label)\]\((.*?)\)/).replace("label",l_).getRegex(),reflink:si(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",l_).getRegex()},kG={...CZ,emStrongRDelimAst:a5t,emStrongLDelim:i5t,url:si(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",oce).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]*?(?:(?=[\\":">",'"':""","'":"'"},lce=t=>m5t[t];function qh(t,e){if(e){if(xl.escapeTest.test(t))return t.replace(xl.escapeReplace,lce)}else if(xl.escapeTestNoEncode.test(t))return t.replace(xl.escapeReplaceNoEncode,lce);return t}function cce(t){try{t=encodeURI(t).replace(xl.percentDecode,"%")}catch{return null}return t}function uce(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 hce(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 v5t(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +*/var Pwt=w(t=>{const{handDrawnSeed:e}=Ve();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),l3=w(t=>{const e=$wt([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),$wt=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"),rZ=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}=l3(t),r=[],n=[],i=[],s=[];return e.forEach(a=>{const o=a[0];rZ(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}=l3(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:Bwt(a.get("stroke-dasharray"))},e)},"userNodeOverrides"),Bwt=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"),DA={},ya={},Xle;function Fwt(){return Xle||(Xle=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.BLANK_URL=ya.relativeFirstCharacters=ya.whitespaceEscapeCharsRegex=ya.urlSchemeRegex=ya.ctrlCharactersRegex=ya.htmlCtrlEntityRegex=ya.htmlEntitiesRegex=ya.invalidProtocolRegex=void 0,ya.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,ya.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,ya.htmlCtrlEntityRegex=/&(newline|tab);/gi,ya.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ya.urlSchemeRegex=/^.+(:|:)/gim,ya.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,ya.relativeFirstCharacters=[".","/"],ya.BLANK_URL="about:blank"),ya}var Kle;function zwt(){if(Kle)return DA;Kle=1,Object.defineProperty(DA,"__esModule",{value:!0}),DA.sanitizeUrl=s;var t=Fwt();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 DA}var Qy=zwt();function Vwt(t){return Array.isArray(t)}function Q$(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 Hwt(){}function xCe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function n7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const wCe="[object RegExp]",nZ="[object String]",iZ="[object Number]",sZ="[object Boolean]",aZ="[object Arguments]",TCe="[object Symbol]",CCe="[object Date]",kCe="[object Map]",SCe="[object Set]",ECe="[object Array]",ACe="[object ArrayBuffer]",MCe="[object Object]",RCe="[object DataView]",_Ce="[object Uint8Array]",LCe="[object Uint8ClampedArray]",ICe="[object Uint16Array]",NCe="[object Uint32Array]",DCe="[object Int8Array]",OCe="[object Int16Array]",PCe="[object Int32Array]",$Ce="[object Float32Array]",BCe="[object Float64Array]",Zle=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function oZ(t){return typeof Zle.Buffer<"u"&&Zle.Buffer.isBuffer(t)}function Gwt(t){return Number.isSafeInteger(t)&&t>=0}function FCe(t){return t!=null&&typeof t!="function"&&Gwt(t.length)}function Wwt(t){return t==="__proto__"}function rD(t){return t==null||typeof t!="object"&&typeof t!="function"}function lZ(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function qwt(t,e){return tb(t,void 0,t,new Map,e)}function tb(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(rD(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(n7(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 iZ:case nZ:case sZ:{const a=new t.constructor(t==null?void 0:t.valueOf());return ju(a,t),a}case aZ:{const a={};return ju(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function Qle(t){return Ywt(t)}function wG(t){return t!==null&&typeof t=="object"&&n7(t)==="[object Arguments]"}function TG(t){return typeof t=="object"&&t!==null}function jwt(t){return TG(t)&&FCe(t)}function Qk(t){return lZ(t)}function Xwt(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function i7(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(i7.Cache||Map),r}i7.Cache=Map;function Kwt(t){if(rD(t))return t;const e=n7(t);if(!Zwt(t))return{};if(Vwt(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(Qk(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]"?Jwt(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 eTt(r,t),J$(r,t),Qwt(r,t),r}function Zwt(t){switch(n7(t)){case aZ:case ECe:case ACe:case RCe:case sZ:case CCe:case $Ce:case BCe:case DCe:case OCe:case PCe:case kCe:case iZ:case MCe:case wCe:case SCe:case nZ:case TCe:case _Ce:case LCe:case ICe:case NCe:return!0;default:return!1}}function J$(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function Qwt(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function eTt(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function tTt(t){if(rD(t))return t;if(Array.isArray(t)||lZ(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 rTt(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 zCe="​",iTt={curveBasis:x6,curveBasisClosed:C4t,curveBasisOpen:k4t,curveBumpX:b5e,curveBumpY:x5e,curveBundle:S4t,curveCardinalClosed:E4t,curveCardinalOpen:A4t,curveCardinal:k5e,curveCatmullRomClosed:M4t,curveCatmullRomOpen:R4t,curveCatmullRom:E5e,curveLinear:Zk,curveLinearClosed:_4t,curveMonotoneX:I5e,curveMonotoneY:N5e,curveNatural:O5e,curveStep:P5e,curveStepAfter:B5e,curveStepBefore:$5e},sTt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,aTt=w(function(t,e){const r=VCe(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);_9(a),n=aa(n,[...a])}else n=r.args;if(!n)return;let i=SK(t,e);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),VCe=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${sTt.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=Xk.exec(t))!==null;)if(s.index===Xk.lastIndex&&Xk.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"),oTt=w(function(t){return t.replace(Xk,"")},"removeDirectives"),lTt=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function cZ(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return iTt[r]??e}w(cZ,"interpolateToCurve");function HCe(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Qy.sanitizeUrl(r):r}w(HCe,"formatUrl");var cTt=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let s=window;for(let a=0;a{r+=uZ(i,e),e=i});const n=r/2;return hZ(t,n)}w(GCe,"traverseEdge");function WCe(t){return t.length===1?t[0]:GCe(t)}w(WCe,"calcLabelPosition");var ece=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),hZ=w((t,e)=>{let r,n=e;for(const i of t){if(r){const s=uZ(i,r);if(s===0)return r;if(s=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:ece((1-a)*r.x+a*i.x,5),y:ece((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),uTt=w((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=hZ(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 qCe(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=hZ(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(qCe,"calcTerminalLabelPosition");function dZ(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(dZ,"getStylesFromArray");var tce=0,UCe=w(()=>(tce++,"id-"+Math.random().toString(36).substr(2,12)+"-"+tce),"generateId");function YCe(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iYCe(t.length),"random"),hTt=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"),dTt=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"),Jk=i7((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=El(`${a} `,r),u=El(s,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=fTt(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}`),fTt=i7((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(El(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 a_(t,e){return nD(t,e).height}w(a_,"calculateTextHeight");function El(t,e){return nD(t,e).width}w(El,"calculateTextWidth");var nD=i7((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=hTt();y.text=m||zCe;const v=dTt(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}`),ux,pTt=(ux=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(ux,"InitIDGenerator"),ux),OA,gTt=w(function(t){return OA=OA||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),OA.innerHTML=t,unescape(OA.textContent)},"entityDecode");function fZ(t){return"str"in t}w(fZ,"isDetailedError");var mTt=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 nTt({},t,e)}w(es,"cleanAndMerge");var Kr={assignWithDepth:aa,wrapLabel:Jk,calculateTextHeight:a_,calculateTextWidth:El,calculateTextDimensions:nD,cleanAndMerge:es,detectInit:aTt,detectDirective:VCe,isSubstringInArray:lTt,interpolateToCurve:cZ,calcLabelPosition:WCe,calcCardinalityPosition:uTt,calcTerminalLabelPosition:qCe,formatUrl:HCe,getStylesFromArray:dZ,generateId:UCe,random:jCe,runFunc:cTt,entityDecode:gTt,insertTitle:mTt,isLabelCoordinateInPath:XCe,parseFontSize:H0,InitIDGenerator:pTt},yTt=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"),Lb=w((t,e,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Xa(t){return t??null}w(Xa,"handleUndefinedAttr");function XCe(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(XCe,"isLabelCoordinateInPath");var c3=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 pZ(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(pZ,"configureLabelImages");const vTt=Object.freeze({left:0,top:0,width:16,height:16}),o_=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),KCe=Object.freeze({...vTt,...o_}),bTt=Object.freeze({...KCe,body:"",hidden:!1}),xTt=Object.freeze({width:null,height:null}),wTt=Object.freeze({...xTt,...o_}),TTt=(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 eB(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 eB(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return eB(o,r)?o:null}return null},eB=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function CTt(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 rce(t,e){const r=CTt(t,e);for(const n in bTt)n in o_?n in t&&!(n in r)&&(r[n]=o_[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function kTt(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 nce(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let s={};function a(o){s=rce(n[o]||i[o],s)}return a(e),r.forEach(a),rce(t,s)}function STt(t,e){if(t.icons[e])return nce(t,e,[]);const r=kTt(t,[e])[e];return r?nce(t,e,r):null}const ETt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ATt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ice(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(ETt);if(n===null||!n.length)return t;const i=[];let s=n.shift(),a=ATt.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 MTt(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 RTt(t,e){return t?""+t+""+e:e}function _Tt(t,e,r){const n=MTt(t);return RTt(n.defs,e+n.content+r)}const LTt=t=>t==="unset"||t==="undefined"||t==="none";function ITt(t,e){const r={...KCe,...t},n={...wTt,...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=_Tt(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=ice(d,l/u)):(h=a==="auto"?l:a,d=o===null?ice(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{LTt(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 NTt=/\sid="(\S+)"/g,sce=new Map;function DTt(t){t=t.replace(/[0-9]+$/,"")||"a";const e=sce.get(t)||0;return sce.set(t,e+1),e?`${t}${e}`:t}function OTt(t){const e=[];let r;for(;r=NTt.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=DTt(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 PTt(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 ZCe={body:'?',height:80,width:80},CG=new Map,QCe=new Map,gZ=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)QCe.set(e.name,e.loader);else if("icons"in e)CG.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"),JCe=w(async(t,e)=>{const r=TTt(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=CG.get(n);if(!i){const a=QCe.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},CG.set(n,i)}catch(o){throw de.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=STt(i,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),$Tt=w(async t=>{try{return await JCe(t),!0}catch{return!1}},"isIconAvailable"),m0=w(async(t,e,r)=>{let n;try{n=await JCe(t,e==null?void 0:e.fallbackPrefix)}catch(a){de.error(a),n=ZCe}const i=ITt(n,e),s=PTt(OTt(i.body),{...i.attributes,...r});return Ln(s,br())},"getIconSVG");function mZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Jy=mZ();function eke(t){Jy=t}var eS={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(xl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var BTt=(()=>{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")},FTt=/^(?:[ \t]*(?:\n|$))+/,zTt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,VTt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,s7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,HTt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yZ=/(?:[*+-]|\d{1,9}[.)])/,tke=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rke=si(tke).replace(/bull/g,yZ).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(),GTt=si(tke).replace(/bull/g,yZ).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(),vZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,WTt=/^[^\n]+/,bZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qTt=si(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),UTt=si(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yZ).getRegex(),iD="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",xZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,YTt=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",xZ).replace("tag",iD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nke=si(vZ).replace("hr",s7).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",iD).getRegex(),jTt=si(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nke).getRegex(),wZ={blockquote:jTt,code:zTt,def:qTt,fences:VTt,heading:HTt,hr:s7,html:YTt,lheading:rke,list:UTt,newline:FTt,paragraph:nke,table:eS,text:WTt},ace=si("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",s7).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",iD).getRegex(),XTt={...wZ,lheading:GTt,table:ace,paragraph:si(vZ).replace("hr",s7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ace).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",iD).getRegex()},KTt={...wZ,html:si(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xZ).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:eS,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:si(vZ).replace("hr",s7).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",rke).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ZTt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,QTt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ike=/^( {2,}|\\)\n(?!\s*$)/,JTt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",BTt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),oke=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,i5t=si(oke,"u").replace(/punct/g,sD).getRegex(),s5t=si(oke,"u").replace(/punct/g,ake).getRegex(),lke="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",a5t=si(lke,"gu").replace(/notPunctSpace/g,ske).replace(/punctSpace/g,TZ).replace(/punct/g,sD).getRegex(),o5t=si(lke,"gu").replace(/notPunctSpace/g,r5t).replace(/punctSpace/g,t5t).replace(/punct/g,ake).getRegex(),l5t=si("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ske).replace(/punctSpace/g,TZ).replace(/punct/g,sD).getRegex(),c5t=si(/\\(punct)/,"gu").replace(/punct/g,sD).getRegex(),u5t=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(),h5t=si(xZ).replace("(?:-->|$)","-->").getRegex(),d5t=si("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",h5t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),l_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,f5t=si(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",l_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cke=si(/^!?\[(label)\]\[(ref)\]/).replace("label",l_).replace("ref",bZ).getRegex(),uke=si(/^!?\[(ref)\](?:\[\])?/).replace("ref",bZ).getRegex(),p5t=si("reflink|nolink(?!\\()","g").replace("reflink",cke).replace("nolink",uke).getRegex(),oce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,CZ={_backpedal:eS,anyPunctuation:c5t,autolink:u5t,blockSkip:n5t,br:ike,code:QTt,del:eS,emStrongLDelim:i5t,emStrongRDelimAst:a5t,emStrongRDelimUnd:l5t,escape:ZTt,link:f5t,nolink:uke,punctuation:e5t,reflink:cke,reflinkSearch:p5t,tag:d5t,text:JTt,url:eS},g5t={...CZ,link:si(/^!?\[(label)\]\((.*?)\)/).replace("label",l_).getRegex(),reflink:si(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",l_).getRegex()},kG={...CZ,emStrongRDelimAst:o5t,emStrongLDelim:s5t,url:si(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",oce).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]*?(?:(?=[\\":">",'"':""","'":"'"},lce=t=>y5t[t];function qh(t,e){if(e){if(xl.escapeTest.test(t))return t.replace(xl.escapeReplace,lce)}else if(xl.escapeTestNoEncode.test(t))return t.replace(xl.escapeReplaceNoEncode,lce);return t}function cce(t){try{t=encodeURI(t).replace(xl.percentDecode,"%")}catch{return null}return t}function uce(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 hce(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 b5t(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 c_=class{constructor(e){xr(this,"options");xr(this,"rules");xr(this,"lexer");this.options=e||Jy}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:rC(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=v5t(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=rC(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:rC(r[0],` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=b5t(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=rC(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:rC(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=rC(r[0],` `).split(` `),i="",s="",a=[];for(;n.length>0;){let o=!1,l=[],u;for(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=rC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=y5t(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)),hce(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 hce(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 SG{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||Jy,this.options.tokenizer=this.options.tokenizer||new c_,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:PA.normal,inline:tC.normal};this.options.pedantic?(r.block=PA.pedantic,r.inline=tC.pedantic):this.options.gfm&&(r.block=PA.gfm,this.options.breaks?r.inline=tC.breaks:r.inline=tC.gfm),this.tokenizer.rules=r}static get rules(){return{block:PA,inline:tC}}static lex(e,r){return new SG(r).lex(e)}static lexInline(e,r){return new SG(r).inlineTokens(e)}lex(e){e=e.replace(xl.carriageReturn,` +`?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=rC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=v5t(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)),hce(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 hce(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 SG{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||Jy,this.options.tokenizer=this.options.tokenizer||new c_,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:PA.normal,inline:tC.normal};this.options.pedantic?(r.block=PA.pedantic,r.inline=tC.pedantic):this.options.gfm&&(r.block=PA.gfm,this.options.breaks?r.inline=tC.breaks:r.inline=tC.gfm),this.tokenizer.rules=r}static get rules(){return{block:PA,inline:tC}}static lex(e,r){return new SG(r).lex(e)}static lexInline(e,r){return new SG(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(` `)?"":` @@ -1153,27 +1153,27 @@ ${this.parser.parse(e)} ${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`${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=cce(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=cce(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 u_(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 c_(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 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}}},Ey=new b5t;function pi(t,e){return Ey.parse(t,e)}pi.options=pi.setOptions=function(t){return Ey.setOptions(t),pi.defaults=Ey.defaults,JCe(pi.defaults),pi};pi.getDefaults=mZ;pi.defaults=Jy;pi.use=function(...t){return Ey.use(...t),pi.defaults=Ey.defaults,JCe(pi.defaults),pi};pi.walkTokens=function(t,e){return Ey.walkTokens(t,e)};pi.parseInline=Ey.parseInline;pi.Parser=rh;pi.parser=rh.parse;pi.Renderer=u_;pi.TextRenderer=kZ;pi.Lexer=th;pi.lexer=th.lex;pi.Tokenizer=c_;pi.Hooks=XC;pi.parse=pi;pi.options;pi.setOptions;pi.use;pi.walkTokens;pi.parseInline;rh.parse;th.lex;function uke(t){for(var e=[],r=1;r{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 u_(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 c_(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 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}}},Ey=new x5t;function pi(t,e){return Ey.parse(t,e)}pi.options=pi.setOptions=function(t){return Ey.setOptions(t),pi.defaults=Ey.defaults,eke(pi.defaults),pi};pi.getDefaults=mZ;pi.defaults=Jy;pi.use=function(...t){return Ey.use(...t),pi.defaults=Ey.defaults,eke(pi.defaults),pi};pi.walkTokens=function(t,e){return Ey.walkTokens(t,e)};pi.parseInline=Ey.parseInline;pi.Parser=rh;pi.parser=rh.parse;pi.Renderer=u_;pi.TextRenderer=kZ;pi.Lexer=th;pi.lexer=th.lex;pi.Tokenizer=c_;pi.Hooks=XC;pi.parse=pi;pi.options;pi.setOptions;pi.use;pi.walkTokens;pi.parseInline;rh.parse;th.lex;function hke(t){for(var e=[],r=1;r/g,` +`)),a+=d+n[l+1]}),a}function dke(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return uke(n)}w(hke,"preprocessMarkdown");function dke(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(dke,"nonMarkdownToLines");function fke(t,e={}){const r=hke(t,e),n=pi.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(fke,"markdownToLines");function pke(t){return t?`

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

`:""}w(pke,"nonMarkdownToHTML");function gke(t,{markdownAutoWrap:e}={}){const r=pi.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(gke,"markdownToHTML");function mke(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(mke,"splitTextToChars");function yke(t,e){const r=mke(e.content);return SZ(t,[],r,e.type)}w(yke,"splitWordToFitWidth");function SZ(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}])?SZ(t,a,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(SZ,"splitWordToFitWidthRecursion");function vke(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return h_(t,e)}w(vke,"splitLineToFitWidth");function h_(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 h_(t,e,r,a);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[o,l]=yke(e,s);r.push([o]),l.content&&t.unshift(l)}return h_(t,e,r)}w(h_,"splitLineToFitWidthRecursion");function AG(t,e){e&&t.attr("style",e)}w(AG,"applyStyle");var dce=16384;async function bke(t,e,r,n,i=!1,s=br()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,dce)}px`),a.attr("height",`${Math.min(10*r,dce)}px`);const o=a.append("xhtml:div"),l=Ks(e.label)?await GN(e.label.replace(Vt.lineBreakRegex,` -`),s):Ln(e.label,s),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),AG(h,e.labelStyle),h.attr("class",`${u} ${n}`),AG(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(bke,"addHtmlSpan");function aD(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(aD,"createTspan");function xke(t,e,r){const n=t.append("text"),i=aD(n,1,e);oD(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}w(xke,"computeWidthOfText");function wke(t,e,r){var a;const n=t.append("text"),i=aD(n,1,e);oD(i,[{content:r,type:"normal"}]);const s=(a=i.node())==null?void 0:a.getBoundingClientRect();return s&&n.remove(),s}w(wke,"computeDimensionOfText");function Tke(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=>xke(a,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:vke(h,d);for(const p of f){const g=aD(l,u,1.1,i);oD(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(Tke,"createFormattedText");function MG(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(MG,"decodeHTMLEntities");function oD(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(MG(r.content)):i.text(" "+MG(r.content))})}w(oD,"updateTextContentAndStyles");async function Cke(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await PTt(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(Cke,"replaceIconSubstring");var Qo=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?gke(e,h):pke(e),f=await Cke(g0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ks(e)?p:f,labelStyle:r.replace("fill:","color:")};return await bke(t,g,l,i,u,h)}else{const d=g0(e.replace(//g,"
")),f=a?fke(d.replace("
","
"),h):dke(d),p=Tke(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 tB(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 x5t(t,e){return t[0]===e[0]&&t[1]===e[1]}function w5t(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)tB(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];x5t(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)tB(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),tB(f,h,d)})(l,o,-i)}return l}function a7(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),w5t(t,i,n,s||1)}class EZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=a7(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 lD(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 T5t=class extends EZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=a7(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)lD([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 C5t extends EZ{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 k5t=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=a7(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=lD(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=lD(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=lD(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 Ske(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)&&(Eke(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 nC(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Eke(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]=nC(t,e,-h),[r,n]=nC(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=Eke(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=bce(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=bce(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return a&&(o?v.push(...bg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...bg(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 mce(t,e){const r=Ske(kke(AZ(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(...bg(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(...L5t(l,u,h,d,f,p,s,e)),s=[f,p];break}case"Z":n.push(...bg(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function iB(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*Rke(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 BA(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=jm(l,u,.5),p=jm(u,h,.5),g=jm(h,d,.5),m=jm(f,p,.5),y=jm(p,g,.5),v=jm(m,y,.5);LG([l,f,m,v],0,r,i),LG([v,y,g,d],0,r,i)}var s,a;return i}function N5t(t,e){return p_(t,0,t.length,e)}function p_(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?(p_(t,e,u+1,n,s),p_(t,u,r,n,s)):(s.length||s.push(a),s.push(o)),s}function sB(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s0?p_(n,0,n.length,r):n}const Ec="none";let g_=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",[Ake(e,r,n,i,a)],a)}rectangle(e,r,n,i,s){const a=this._o(s),o=[],l=_5t(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(iB([u],a)):o.push(Vv([u],a))}return a.stroke!==Ec&&o.push(l),this._d("rectangle",o,a)}ellipse(e,r,n,i,s){const a=this._o(s),o=[],l=Mke(n,i,a),u=RG(e,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=RG(e,r,a,l).opset;h.type="fillPath",o.push(h)}else o.push(Vv([u.estimatedPoints],a));return a.stroke!==Ec&&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",[$M(e,!1,n)],n)}arc(e,r,n,i,s,a,o=!1,l){const u=this._o(l),h=[],d=gce(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=gce(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]),Vv([R],x)})(e,r,n,i,s,a,u));return u.stroke!==Ec&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],s=pce(e,n);if(n.fill&&n.fill!==Ec)if(n.fillStyle==="solid"){const a=pce(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(...sB(xce([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):a.push(...sB(xce(u),10,(1+n.roughness)/2))}a.length&&i.push(Vv([a],n))}return n.stroke!==Ec&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=$M(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(iB([e],n)):i.push(Vv([e],n))),n.stroke!==Ec&&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!==Ec,a=n.stroke!==Ec,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=Ske(kke(AZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...sB(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=N5t(C,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=mce(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=mce(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(iB(l,n));else i.push(Vv(l,n));return a&&(o?l.forEach((h=>{i.push($M(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:Ec};break;case"fillPath":a={d:this.opsToPath(s),stroke:Ec,strokeWidth:0,fill:n.fill||Ec};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||Ec,strokeWidth:n,fill:Ec}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class D5t{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new g_(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 FA="http://www.w3.org/2000/svg";class O5t{constructor(e,r){this.svg=e,this.gen=new g_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(FA,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(FA,"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(FA,"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(FA,"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 D5t(t,e),svg:(t,e)=>new O5t(t,e),generator:t=>new g_(t),newSeed:()=>g_.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",Xa(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 Qo(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 pZ(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"),aB=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??di(Ve()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Qo(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(di(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 xg(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(xg,"generateFullSineWavePoints");function S6(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(IG,"mergePaths");var P5t=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"),ev=P5t,$5t=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=di(a);return await Qo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Hp=$5t,Qg=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"),B5t=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 Qo(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 ev(e,N)},{cluster:f,labelBBox:v}},"swimlane"),_ke=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=di(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Qo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Hp(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(di(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(Qg(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}=c3(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 ev(e,k)},{cluster:d,labelBBox:m}},"rect"),F5t=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 ev(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),z5t=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 Hp(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(di(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(Qg(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-(di(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 ev(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),V5t=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=di(r),p=d.insert("g").attr("class","cluster-label "),g=await Qo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(di(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(Qg(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}=c3(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 ev(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),H5t=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 ev(e,m)},{cluster:a,labelBBox:{}}},"divider"),G5t=_ke,W5t={rect:_ke,squareRect:G5t,roundedWithTitle:z5t,noteGroup:F5t,divider:H5t,kanbanSection:V5t,swimlane:B5t},Lke=new Map,cD=w(async(t,e)=>{const r=e.shape||"rect",n=await W5t[r](t,e);return Lke.set(e.id,n),n},"insertCluster"),Ike=w(()=>{Lke=new Map},"clear");function Nke(t,e){return t.intersect(e)}w(Nke,"intersectNode");var q5t=Nke;function Dke(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(NG,"sameSign");var Y5t=$ke;function Bke(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",Xa(o)),Tr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,a,f),or.circle(e,a,f)},s}w(Fke,"anchor");function DG(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(DG,"generateArcPoints");function zke(t,e,r){const[n,i]=[e,r].sort((s,a)=>a-s);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(zke,"calculateArcSagitta");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=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=zke(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},...DG(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...DG(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(Vke,"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 zA=12;async function Hke(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+zA),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+zA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+zA},{x:d+zA,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(Hke,"card");function Gke(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(Gke,"choice");async function MZ(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",Xa(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(MZ,"circle");function Wke(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(Wke,"createLine");function qke(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=Wke(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(qke,"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(Uke,"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(Yke,"curlyBraceRight");function uo(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(jke,"curlyBraces");async function Xke(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},...S6(-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(Xke,"curvedTrapezoid");var X5t=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"),K5t=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"),Z5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),wce=8,Tce=8;async function Kke(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=X5t(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xa(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(Kke,"cylinder");async function u3(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(Qg(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",Xa(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Xa(f)).attr("ry",Xa(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(u3,"drawRect");async function Zke(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 u3(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(Zke,"datastore");async function Qke(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(Qke,"dividedRectangle");async function Jke(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",Xa(e.cssClasses)).attr("style",Xa(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(Jke,"doublecircle");function eSe(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(eSe,"filledCircle");var Cce=10,kce=10;async function tSe(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(tSe,"flippedTriangle");function rSe(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(rSe,"forkJoin");async function nSe(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(nSe,"halfRoundedRectangle");var Q5t=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 iSe(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=Q5t(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(iSe,"hexagon");async function sSe(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(sSe,"hourglass");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,label:d}=await Qr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=l3(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(aSe,"icon");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,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}=l3(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(oSe,"iconCircle");async function lSe(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}=l3(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(Qg(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(lSe,"iconRounded");async function cSe(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}=l3(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(Qg(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(cSe,"iconSquare");async function uSe(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(uSe,"imageSquare");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=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(hSe,"inv_trapezoid");async function dSe(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(dSe,"labelRect");async function fSe(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(fSe,"lean_left");async function pSe(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(pSe,"lean_right");function gSe(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(gSe,"lightningBolt");var J5t=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"),e3t=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"),t3t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Sce=10,Ece=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"?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=J5t(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",Xa(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(mSe,"linedCylinder");async function ySe(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},...xg(-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(ySe,"linedWaveEdgedRect");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,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=IG(k),A=IG(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(vSe,"multiRect");async function bSe(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=xg(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(bSe,"multiWaveEdgedRectangle");async function xSe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n,e.useHtmlLabels||di(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(xSe,"note");var r3t=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 wSe(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=r3t(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(wSe,"question");async function TSe(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(TSe,"rect_left_inv_arrow");async function CSe(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 Hp(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(di(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 Hp(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(CSe,"rectWithTitle");async function kSe(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 u3(t,e,i)}w(kSe,"roundedRect");var Mm=8;async function SSe(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"?Mm:Mm*2),h=((e==null?void 0:e.height)??o.height)+s*2,d=u-Mm,f=h,p=Mm-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-Mm,y:g+f},{x:p-Mm,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",Xa(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(${Mm/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(SSe,"shadedProcess");async function ESe(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(ESe,"slopedRect");async function ASe(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 u3(t,e,s)}w(ASe,"squareRect");async function MSe(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},...S6(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...S6(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(MSe,"stadium");async function RSe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return u3(t,e,r)}w(RSe,"state");function _Se(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(_Se,"stateEnd");function LSe(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,Owt(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(LSe,"stateStart");var Hv=8;async function ISe(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*Hv+s,h=((e==null?void 0:e.height)??l.height)+a,d=u-2*Hv,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+Hv,g,p+Hv,g+f,v),T=y.line(p+Hv+d,g,p+Hv+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",Xa(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(ISe,"subroutine");var oB=.2;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"?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-oB*(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=oB*u,d=oB*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(NSe,"taggedRect");async function DSe(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},...xg(-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},...xg(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(DSe,"taggedWaveEdgedRectangle");async function OSe(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(OSe,"text");var n3t=w((t,e,r,n,i,s)=>`M${t},${e} +`);return hke(n)}w(dke,"preprocessMarkdown");function fke(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(fke,"nonMarkdownToLines");function pke(t,e={}){const r=dke(t,e),n=pi.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(pke,"markdownToLines");function gke(t){return t?`

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

`:""}w(gke,"nonMarkdownToHTML");function mke(t,{markdownAutoWrap:e}={}){const r=pi.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(mke,"markdownToHTML");function yke(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(yke,"splitTextToChars");function vke(t,e){const r=yke(e.content);return SZ(t,[],r,e.type)}w(vke,"splitWordToFitWidth");function SZ(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}])?SZ(t,a,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(SZ,"splitWordToFitWidthRecursion");function bke(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return h_(t,e)}w(bke,"splitLineToFitWidth");function h_(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 h_(t,e,r,a);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[o,l]=vke(e,s);r.push([o]),l.content&&t.unshift(l)}return h_(t,e,r)}w(h_,"splitLineToFitWidthRecursion");function AG(t,e){e&&t.attr("style",e)}w(AG,"applyStyle");var dce=16384;async function xke(t,e,r,n,i=!1,s=br()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,dce)}px`),a.attr("height",`${Math.min(10*r,dce)}px`);const o=a.append("xhtml:div"),l=Ks(e.label)?await GN(e.label.replace(Vt.lineBreakRegex,` +`),s):Ln(e.label,s),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),AG(h,e.labelStyle),h.attr("class",`${u} ${n}`),AG(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(xke,"addHtmlSpan");function aD(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(aD,"createTspan");function wke(t,e,r){const n=t.append("text"),i=aD(n,1,e);oD(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}w(wke,"computeWidthOfText");function Tke(t,e,r){var a;const n=t.append("text"),i=aD(n,1,e);oD(i,[{content:r,type:"normal"}]);const s=(a=i.node())==null?void 0:a.getBoundingClientRect();return s&&n.remove(),s}w(Tke,"computeDimensionOfText");function Cke(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=>wke(a,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:bke(h,d);for(const p of f){const g=aD(l,u,1.1,i);oD(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(Cke,"createFormattedText");function MG(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(MG,"decodeHTMLEntities");function oD(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(MG(r.content)):i.text(" "+MG(r.content))})}w(oD,"updateTextContentAndStyles");async function kke(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await $Tt(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(kke,"replaceIconSubstring");var Qo=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?mke(e,h):gke(e),f=await kke(g0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ks(e)?p:f,labelStyle:r.replace("fill:","color:")};return await xke(t,g,l,i,u,h)}else{const d=g0(e.replace(//g,"
")),f=a?pke(d.replace("
","
"),h):fke(d),p=Cke(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 tB(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 w5t(t,e){return t[0]===e[0]&&t[1]===e[1]}function T5t(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)tB(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];w5t(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)tB(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),tB(f,h,d)})(l,o,-i)}return l}function a7(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),T5t(t,i,n,s||1)}class EZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=a7(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 lD(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 C5t=class extends EZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=a7(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)lD([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 k5t extends EZ{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 S5t=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=a7(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=lD(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=lD(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=lD(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 Eke(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)&&(Ake(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 nC(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Ake(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]=nC(t,e,-h),[r,n]=nC(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=Ake(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=bce(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=bce(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return a&&(o?v.push(...bg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...bg(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 mce(t,e){const r=Eke(Ske(AZ(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(...bg(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(...I5t(l,u,h,d,f,p,s,e)),s=[f,p];break}case"Z":n.push(...bg(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function iB(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*_ke(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 BA(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=jm(l,u,.5),p=jm(u,h,.5),g=jm(h,d,.5),m=jm(f,p,.5),y=jm(p,g,.5),v=jm(m,y,.5);LG([l,f,m,v],0,r,i),LG([v,y,g,d],0,r,i)}var s,a;return i}function D5t(t,e){return p_(t,0,t.length,e)}function p_(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?(p_(t,e,u+1,n,s),p_(t,u,r,n,s)):(s.length||s.push(a),s.push(o)),s}function sB(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s0?p_(n,0,n.length,r):n}const Ec="none";let g_=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",[Mke(e,r,n,i,a)],a)}rectangle(e,r,n,i,s){const a=this._o(s),o=[],l=L5t(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(iB([u],a)):o.push(Vv([u],a))}return a.stroke!==Ec&&o.push(l),this._d("rectangle",o,a)}ellipse(e,r,n,i,s){const a=this._o(s),o=[],l=Rke(n,i,a),u=RG(e,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=RG(e,r,a,l).opset;h.type="fillPath",o.push(h)}else o.push(Vv([u.estimatedPoints],a));return a.stroke!==Ec&&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",[$M(e,!1,n)],n)}arc(e,r,n,i,s,a,o=!1,l){const u=this._o(l),h=[],d=gce(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=gce(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]),Vv([R],x)})(e,r,n,i,s,a,u));return u.stroke!==Ec&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],s=pce(e,n);if(n.fill&&n.fill!==Ec)if(n.fillStyle==="solid"){const a=pce(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(...sB(xce([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):a.push(...sB(xce(u),10,(1+n.roughness)/2))}a.length&&i.push(Vv([a],n))}return n.stroke!==Ec&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=$M(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(iB([e],n)):i.push(Vv([e],n))),n.stroke!==Ec&&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!==Ec,a=n.stroke!==Ec,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=Eke(Ske(AZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...sB(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=D5t(C,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=mce(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=mce(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(iB(l,n));else i.push(Vv(l,n));return a&&(o?l.forEach((h=>{i.push($M(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:Ec};break;case"fillPath":a={d:this.opsToPath(s),stroke:Ec,strokeWidth:0,fill:n.fill||Ec};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||Ec,strokeWidth:n,fill:Ec}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class O5t{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new g_(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 FA="http://www.w3.org/2000/svg";class P5t{constructor(e,r){this.svg=e,this.gen=new g_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(FA,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(FA,"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(FA,"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(FA,"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 O5t(t,e),svg:(t,e)=>new P5t(t,e),generator:t=>new g_(t),newSeed:()=>g_.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",Xa(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 Qo(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 pZ(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"),aB=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??di(Ve()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Qo(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(di(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 xg(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(xg,"generateFullSineWavePoints");function S6(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(IG,"mergePaths");var $5t=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"),ev=$5t,B5t=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=di(a);return await Qo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Hp=B5t,Qg=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"),F5t=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 Qo(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 ev(e,N)},{cluster:f,labelBBox:v}},"swimlane"),Lke=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=di(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Qo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Hp(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(di(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(Qg(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}=c3(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 ev(e,k)},{cluster:d,labelBBox:m}},"rect"),z5t=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 ev(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),V5t=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 Hp(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(di(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(Qg(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-(di(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 ev(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),H5t=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=di(r),p=d.insert("g").attr("class","cluster-label "),g=await Qo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(di(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(Qg(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}=c3(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 ev(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),G5t=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 ev(e,m)},{cluster:a,labelBBox:{}}},"divider"),W5t=Lke,q5t={rect:Lke,squareRect:W5t,roundedWithTitle:V5t,noteGroup:z5t,divider:G5t,kanbanSection:H5t,swimlane:F5t},Ike=new Map,cD=w(async(t,e)=>{const r=e.shape||"rect",n=await q5t[r](t,e);return Ike.set(e.id,n),n},"insertCluster"),Nke=w(()=>{Ike=new Map},"clear");function Dke(t,e){return t.intersect(e)}w(Dke,"intersectNode");var U5t=Dke;function Oke(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(NG,"sameSign");var j5t=Bke;function Fke(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",Xa(o)),Tr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,a,f),or.circle(e,a,f)},s}w(zke,"anchor");function DG(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(DG,"generateArcPoints");function Vke(t,e,r){const[n,i]=[e,r].sort((s,a)=>a-s);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(Vke,"calculateArcSagitta");async function Hke(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=Vke(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},...DG(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...DG(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(Hke,"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 zA=12;async function Gke(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+zA),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+zA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+zA},{x:d+zA,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(Gke,"card");function Wke(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(Wke,"choice");async function MZ(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",Xa(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(MZ,"circle");function qke(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(qke,"createLine");function Uke(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=qke(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(Uke,"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(Yke,"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(jke,"curlyBraceRight");function uo(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(Xke,"curlyBraces");async function Kke(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},...S6(-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(Kke,"curvedTrapezoid");var K5t=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"),Z5t=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"),Q5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),wce=8,Tce=8;async function Zke(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=K5t(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xa(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(Zke,"cylinder");async function u3(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(Qg(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",Xa(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Xa(f)).attr("ry",Xa(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(u3,"drawRect");async function Qke(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 u3(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(Qke,"datastore");async function Jke(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(Jke,"dividedRectangle");async function eSe(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",Xa(e.cssClasses)).attr("style",Xa(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(eSe,"doublecircle");function tSe(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(tSe,"filledCircle");var Cce=10,kce=10;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*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(rSe,"flippedTriangle");function nSe(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(nSe,"forkJoin");async function iSe(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(iSe,"halfRoundedRectangle");var J5t=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 sSe(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=J5t(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(sSe,"hexagon");async function aSe(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(aSe,"hourglass");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,label:d}=await Qr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=l3(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(oSe,"icon");async function lSe(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}=l3(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(lSe,"iconCircle");async function cSe(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}=l3(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(Qg(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(cSe,"iconRounded");async function uSe(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}=l3(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(Qg(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(uSe,"iconSquare");async function hSe(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(hSe,"imageSquare");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=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(dSe,"inv_trapezoid");async function fSe(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(fSe,"labelRect");async function pSe(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(pSe,"lean_left");async function gSe(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(gSe,"lean_right");function mSe(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(mSe,"lightningBolt");var e3t=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"),t3t=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"),r3t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Sce=10,Ece=10;async function ySe(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=e3t(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",Xa(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(ySe,"linedCylinder");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;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},...xg(-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(vSe,"linedWaveEdgedRect");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,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=IG(k),A=IG(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(bSe,"multiRect");async function xSe(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=xg(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(xSe,"multiWaveEdgedRectangle");async function wSe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n,e.useHtmlLabels||di(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(wSe,"note");var n3t=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 TSe(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=n3t(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(TSe,"question");async function CSe(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(CSe,"rect_left_inv_arrow");async function kSe(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 Hp(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(di(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 Hp(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(kSe,"rectWithTitle");async function SSe(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 u3(t,e,i)}w(SSe,"roundedRect");var Mm=8;async function ESe(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"?Mm:Mm*2),h=((e==null?void 0:e.height)??o.height)+s*2,d=u-Mm,f=h,p=Mm-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-Mm,y:g+f},{x:p-Mm,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",Xa(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(${Mm/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(ESe,"shadedProcess");async function ASe(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(ASe,"slopedRect");async function MSe(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 u3(t,e,s)}w(MSe,"squareRect");async function RSe(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},...S6(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...S6(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(RSe,"stadium");async function _Se(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return u3(t,e,r)}w(_Se,"state");function LSe(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(LSe,"stateEnd");function ISe(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,Pwt(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(ISe,"stateStart");var Hv=8;async function NSe(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*Hv+s,h=((e==null?void 0:e.height)??l.height)+a,d=u-2*Hv,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+Hv,g,p+Hv,g+f,v),T=y.line(p+Hv+d,g,p+Hv+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",Xa(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(NSe,"subroutine");var oB=.2;async function DSe(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-oB*(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=oB*u,d=oB*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(DSe,"taggedRect");async function OSe(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},...xg(-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},...xg(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(OSe,"taggedWaveEdgedRectangle");async function PSe(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(PSe,"text");var i3t=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"),i3t=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"),s3t=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Ace=5,Mce=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"?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=n3t(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Xa(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(PSe,"tiltedCylinder");async function $Se(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($Se,"trapezoid");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,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(BSe,"trapezoidalPentagon");var Rce=10,_ce=10;async function FSe(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.width<_ce&&(e.width=_ce),e.height=(e==null?void 0:e.height)??0,e.heightx,":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(FSe,"triangle");async function zSe(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},...xg(-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(zSe,"waveEdgedRectangle");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"?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},...xg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...xg(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(VSe,"waveRectangle");var As=10;async function HSe(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"),s3t=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"),a3t=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Ace=5,Mce=10;async function $Se(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=i3t(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Xa(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($Se,"tiltedCylinder");async function BSe(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(BSe,"trapezoid");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"?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(FSe,"trapezoidalPentagon");var Rce=10,_ce=10;async function zSe(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.width<_ce&&(e.width=_ce),e.height=(e==null?void 0:e.height)??0,e.heightx,":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(zSe,"triangle");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;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},...xg(-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(VSe,"waveEdgedRectangle");async function HSe(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},...xg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...xg(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(HSe,"waveRectangle");var As=10;async function GSe(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))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,x,S)},a}w(HSe,"windowPane");var Lce=new Set(["redux-color","redux-dark-color"]),a3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function RZ(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 RZ(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};El(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&&Lce.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=S2(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=S2(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=S2(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=S2(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=S2(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&&a3t.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(RZ,"erBox");async function k2(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!==Sp(e)&&(e=Sp(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Qo(o,e,{width:El(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(k2,"addText");function S2(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(S2,"lineToPolygon");async function GSe(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 KC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await KC(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 KC(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 KC(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(GSe,"textHelper");async function KC(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 Qo(i,LK(g0(o)),{width:El(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(KC,"addText");async function WSe(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 GSe(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(WSe,"classBox");async function qSe(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(qSe,"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 Qo(i,LK(g0(e)),{width:El(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 o3t=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 USe(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 aB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await aB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await aB(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(Qg(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",o3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(USe,"kanbanItem");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+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(GSe,"windowPane");var Lce=new Set(["redux-color","redux-dark-color"]),o3t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function RZ(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 RZ(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};El(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&&Lce.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=S2(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=S2(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=S2(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=S2(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=S2(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&&o3t.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(RZ,"erBox");async function k2(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!==Sp(e)&&(e=Sp(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Qo(o,e,{width:El(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(k2,"addText");function S2(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(S2,"lineToPolygon");async function WSe(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 KC(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await KC(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 KC(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 KC(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(WSe,"textHelper");async function KC(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 Qo(i,LK(g0(o)),{width:El(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(KC,"addText");async function qSe(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 WSe(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(qSe,"classBox");async function USe(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(USe,"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 Qo(i,LK(g0(e)),{width:El(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 l3t=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 YSe(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 aB(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await aB(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await aB(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(Qg(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",l3t(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(YSe,"kanbanItem");async function jSe(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",Xa(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(YSe,"bang");async function jSe(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",Xa(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(jSe,"bang");async function XSe(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",Xa(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(jSe,"cloud");async function XSe(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",Xa(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(XSe,"cloud");async function KSe(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,32 +1225,32 @@ 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()),Tr(e,f),e.calcIntersect=function(p,g){return or.rect(p,g)},e.intersect=function(p){return or.rect(e,p)},i}w(XSe,"defaultMindmapNode");async function KSe(t,e){const r={padding:e.padding??0};return MZ(t,e,r)}w(KSe,"mindmapCircle");var l3t=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ASe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:kSe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:MSe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ISe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Kke},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Zke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:MZ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:YSe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:jSe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:wSe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:iSe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:pSe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:fSe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:$Se},{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:hSe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Jke},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:OSe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Hke},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:SSe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:LSe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:_Se},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:rSe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:sSe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Uke},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Yke},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:jke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:gSe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:zSe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:nSe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:PSe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:mSe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Xke},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Qke},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:FSe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:HSe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:eSe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:BSe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:tSe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ESe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:bSe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:vSe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Vke},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:qke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:DSe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:NSe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:VSe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:TSe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ySe}],c3t=w(()=>{const e=[...Object.entries({state:RSe,choice:Gke,note:xSe,rectWithTitle:CSe,labelRect:dSe,iconSquare:cSe,iconCircle:oSe,icon:aSe,iconRounded:lSe,imageSquare:uSe,anchor:Fke,kanbanItem:USe,mindmapCircle:KSe,defaultMindmapNode:XSe,classBox:WSe,erBox:RZ,requirementBox:qSe}),...l3t.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),ZSe=c3t();function QSe(t){return t in ZSe}w(QSe,"isValidShape");var uD=new Map;async function o7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?ZSe[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",Xa(e.look)),e.tooltip&&i.attr("title",e.tooltip),uD.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(o7,"insertNode");var u3t=w((t,e)=>{uD.set(e.id,t)},"setNodeElem"),JSe=w(()=>{uD.clear()},"clear"),m_=w(t=>{const e=uD.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"),Pa={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},Ice={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ZC(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(ZC,"calculateDeltaAndAngle");var is=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),e6e=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(Pa,t.arrowTypeEnd)){const{angle:p,deltaX:g}=ZC(n[n.length-1],n[n.length-2]);i=Pa[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=Pa[t.arrowTypeStart],d=Pa[t.arrowTypeEnd],f=1;if(a0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Pa,t.arrowTypeEnd)){const{angle:p,deltaY:g}=ZC(n[n.length-1],n[n.length-2]);i=Pa[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=Pa[t.arrowTypeStart],d=Pa[t.arrowTypeEnd],f=1;if(a0&&o0&&u{e.arrowTypeStart&&Nce(t,"start",e.arrowTypeStart,r,n,i,s,a),e.arrowTypeEnd&&Nce(t,"end",e.arrowTypeEnd,r,n,i,s,a)},"addEdgeMarkers"),d3t={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}},f3t=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Nce=w((t,e,r,n,i,s,a=!1,o)=>{var g;const l=d3t[r],u=l&&f3t.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"),p3t=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ve())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),E6=new Map,Hs=new Map,t6e=w(()=>{E6.clear(),Hs.clear()},"clear"),sC=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),y_=w(async(t,e)=>{const r=Ve();let n=di(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 Qo(t,e.label,{style:sC(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)),E6.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 Hp(g,e.startLabelLeft,sC(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,QC(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Hp(g,e.startLabelRight,sC(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,QC(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Hp(p,e.endLabelLeft,sC(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,QC(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Hp(p,e.endLabelRight,sC(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,QC(f,e.endLabelRight)}return u},"insertEdgeLabel");function QC(t,e){di(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(QC,"setTerminalWidth");var r6e=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,E6.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=c3(n);if(t.label){const s=E6.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"),g3t=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"),m3t=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"),y3t=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(KSe,"defaultMindmapNode");async function ZSe(t,e){const r={padding:e.padding??0};return MZ(t,e,r)}w(ZSe,"mindmapCircle");var c3t=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:MSe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:SSe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:RSe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:NSe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Zke},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Qke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:MZ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:jSe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:XSe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:TSe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:sSe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:gSe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:pSe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:BSe},{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:dSe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:eSe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:PSe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Gke},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ESe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:ISe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:LSe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:nSe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:aSe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Yke},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:jke},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Xke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:mSe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:VSe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:iSe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:$Se},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ySe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Kke},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Jke},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:zSe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:GSe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:tSe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:FSe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:rSe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ASe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:xSe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:bSe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Hke},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Uke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:OSe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:DSe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:HSe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:CSe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:vSe}],u3t=w(()=>{const e=[...Object.entries({state:_Se,choice:Wke,note:wSe,rectWithTitle:kSe,labelRect:fSe,iconSquare:uSe,iconCircle:lSe,icon:oSe,iconRounded:cSe,imageSquare:hSe,anchor:zke,kanbanItem:YSe,mindmapCircle:ZSe,defaultMindmapNode:KSe,classBox:qSe,erBox:RZ,requirementBox:USe}),...c3t.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),QSe=u3t();function JSe(t){return t in QSe}w(JSe,"isValidShape");var uD=new Map;async function o7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?QSe[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",Xa(e.look)),e.tooltip&&i.attr("title",e.tooltip),uD.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(o7,"insertNode");var h3t=w((t,e)=>{uD.set(e.id,t)},"setNodeElem"),e6e=w(()=>{uD.clear()},"clear"),m_=w(t=>{const e=uD.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"),Pa={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},Ice={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ZC(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(ZC,"calculateDeltaAndAngle");var is=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),t6e=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(Pa,t.arrowTypeEnd)){const{angle:p,deltaX:g}=ZC(n[n.length-1],n[n.length-2]);i=Pa[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=Pa[t.arrowTypeStart],d=Pa[t.arrowTypeEnd],f=1;if(a0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Pa,t.arrowTypeEnd)){const{angle:p,deltaY:g}=ZC(n[n.length-1],n[n.length-2]);i=Pa[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=Pa[t.arrowTypeStart],d=Pa[t.arrowTypeEnd],f=1;if(a0&&o0&&u{e.arrowTypeStart&&Nce(t,"start",e.arrowTypeStart,r,n,i,s,a),e.arrowTypeEnd&&Nce(t,"end",e.arrowTypeEnd,r,n,i,s,a)},"addEdgeMarkers"),f3t={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}},p3t=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Nce=w((t,e,r,n,i,s,a=!1,o)=>{var g;const l=f3t[r],u=l&&p3t.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"),g3t=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ve())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),E6=new Map,Hs=new Map,r6e=w(()=>{E6.clear(),Hs.clear()},"clear"),sC=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),y_=w(async(t,e)=>{const r=Ve();let n=di(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 Qo(t,e.label,{style:sC(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)),E6.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 Hp(g,e.startLabelLeft,sC(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,QC(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Hp(g,e.startLabelRight,sC(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,QC(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Hp(p,e.endLabelLeft,sC(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,QC(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Hp(p,e.endLabelRight,sC(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,QC(f,e.endLabelRight)}return u},"insertEdgeLabel");function QC(t,e){di(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(QC,"setTerminalWidth");var n6e=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,E6.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=c3(n);if(t.label){const s=E6.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"),m3t=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"),y3t=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"),v3t=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),!m3t(e,s)&&!i){const a=y3t(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 n6e(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(n6e,"extractCornerPoints");var Oce=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"),v3t=w(function(t){const{cornerPointPositions:e}=n6e(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"),b3t=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"),_Z=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)rZ(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=p3t(e.curve);v!=="rounded"&&(y=v3t(y));let x=Zk;switch(v){case"linear":x=Zk;break;case"basis":x=x6;break;case"cardinal":x=C5e;break;case"bumpX":x=v5e;break;case"bumpY":x=b5e;break;case"catmullRom":x=S5e;break;case"monotoneX":x=L5e;break;case"monotoneY":x=I5e;break;case"natural":x=D5e;break;case"step":x=O5e;break;case"stepAfter":x=$5e;break;case"stepBefore":x=P5e;break;case"rounded":x=Zk;break;default:x=x6}const{x:b,y:T}=e6e(e),C=b6().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"?i6e(s6e(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=Ice[e.arrowTypeStart]||0,W=Ice[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?b3t(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",Xa(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";h3t(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 i6e(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&&Pa[e.arrowTypeStart]){const i=Pa[e.arrowTypeStart],s=t[0],a=t[1],{angle:o}=OG(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&&Pa[e.arrowTypeEnd]){const i=Pa[e.arrowTypeEnd],s=t[n-1],a=t[n-2],{angle:o}=OG(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(s6e,"applyMarkerOffsetsToPoints");var x3t=w((t,e,r,n)=>{e.forEach(i=>{G3t[i](t,r,n)})},"insertMarkers"),w3t=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"),T3t=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"),C3t=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"),k3t=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"),S3t=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"),E3t=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"),A3t=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"),M3t=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"),R3t=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"),_3t=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"),L3t=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"),I3t=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"),N3t=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"),D3t=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"),O3t=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"),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+"-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"),$3t=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"),B3t=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"),F3t=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),!y3t(e,s)&&!i){const a=v3t(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 i6e(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(i6e,"extractCornerPoints");var Oce=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"),b3t=w(function(t){const{cornerPointPositions:e}=i6e(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"),x3t=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"),_Z=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)rZ(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=g3t(e.curve);v!=="rounded"&&(y=b3t(y));let x=Zk;switch(v){case"linear":x=Zk;break;case"basis":x=x6;break;case"cardinal":x=k5e;break;case"bumpX":x=b5e;break;case"bumpY":x=x5e;break;case"catmullRom":x=E5e;break;case"monotoneX":x=I5e;break;case"monotoneY":x=N5e;break;case"natural":x=O5e;break;case"step":x=P5e;break;case"stepAfter":x=B5e;break;case"stepBefore":x=$5e;break;case"rounded":x=Zk;break;default:x=x6}const{x:b,y:T}=t6e(e),C=b6().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"?s6e(a6e(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=Ice[e.arrowTypeStart]||0,W=Ice[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?x3t(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",Xa(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";d3t(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 s6e(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&&Pa[e.arrowTypeStart]){const i=Pa[e.arrowTypeStart],s=t[0],a=t[1],{angle:o}=OG(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&&Pa[e.arrowTypeEnd]){const i=Pa[e.arrowTypeEnd],s=t[n-1],a=t[n-2],{angle:o}=OG(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(a6e,"applyMarkerOffsetsToPoints");var w3t=w((t,e,r,n)=>{e.forEach(i=>{W3t[i](t,r,n)})},"insertMarkers"),T3t=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"),C3t=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"),k3t=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"),S3t=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"),E3t=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"),A3t=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"),M3t=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"),R3t=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"),_3t=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"),L3t=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"),I3t=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"),N3t=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"),D3t=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"),O3t=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"),P3t=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"),$3t=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"),B3t=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"),F3t=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"),z3t=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"),z3t=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 + L0,20`)},"requirement_arrow"),V3t=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"),V3t=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"),H3t=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"),G3t={extension:w3t,composition:T3t,aggregation:C3t,dependency:k3t,lollipop:S3t,point:E3t,circle:A3t,cross:M3t,barb:R3t,barbNeo:_3t,only_one:L3t,zero_or_one:I3t,one_or_more:N3t,zero_or_more:D3t,only_one_neo:O3t,zero_or_one_neo:P3t,one_or_more_neo:$3t,zero_or_more_neo:B3t,requirement_arrow:F3t,requirement_contains:V3t,requirement_arrow_neo:z3t,requirement_contains_neo:H3t},LZ=x3t,W3t={common:Vt,getConfig:br,insertCluster:cD,insertEdge:_Z,insertEdgeLabel:y_,insertMarkers:LZ,insertNode:o7,interpolateToCurve:cZ,labelHelper:Qr,log:de,positionEdgeLabel:r6e},A6={},a6e=w(t=>{for(const e of t)A6[e.name]=e},"registerLayoutLoaders"),q3t=w(()=>{a6e([{name:"dagre",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>BHt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>KHt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>zXt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");q3t();var h3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in A6))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=A6[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,W3t,{algorithm:n.algorithm},r)},"render"),l7=w((t="",{fallback:e="dagre"}={})=>{if(t in A6)return t;if(e in A6)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"),IZ="comm",o6e="rule",l6e="decl",U3t="@media",Y3t="@import",j3t="@supports",X3t="@namespace",PG="@keyframes",c6e="@layer",K3t="@scope",Z3t=Math.abs,tS=String.fromCharCode;function u6e(t){return t.trim()}function $G(t,e,r){return t.replace(e,r)}function Ib(t,e){return t.charCodeAt(e)|0}function d5(t,e,r){return t.slice(e,r)}function id(t){return t.length}function h6e(t){return t.length}function VA(t,e){return e.push(t),t}var hD=1,f5=1,d6e=0,Ru=0,ia=0,d3="";function NZ(t,e,r,n,i,s,a,o){return{value:t,root:e,parent:r,type:n,props:i,children:s,line:hD,column:f5,length:a,return:"",siblings:o}}function Q3t(){return ia}function J3t(){return ia=Ru>0?Ib(d3,--Ru):0,f5--,ia===10&&(f5=1,hD--),ia}function yh(){return ia=Ru2||M6(ia)>3?"":" "}function nCt(t,e){for(;--e&&yh()&&!(ia<48||ia>102||ia>57&&ia<65||ia>70&&ia<97););return dD(t,FM()+(e<6&&Gp()==32&&yh()==32))}function BG(t){for(;yh();)switch(ia){case t:return Ru;case 34:case 39:t!==34&&t!==39&&BG(ia);break;case 40:t===41&&BG(t);break;case 92:yh();break}return Ru}function iCt(t,e){for(;yh()&&t+ia!==57;)if(t+ia===84&&Gp()===47)break;return"/*"+dD(e,Ru-1)+"*"+tS(t===47?t:yh())}function sCt(t){for(;!M6(Gp());)yh();return dD(t,Ru)}function aCt(t){return tCt(zM("",null,null,null,[""],t=eCt(t),0,[0],t))}function zM(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&&Ib(E,d-1)==58?(x++,E+="("):E+=lB(b);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=lB(b);break;case 9:case 10:case 13:case 32:if(x>0){E+=tS(b);break}E+=rCt(g);break;case 92:E+=nCt(FM()-1,7);continue;case 47:switch(Gp()){case 42:case 47:VA(oCt(iCt(yh(),FM()),e,r,l),l),(M6(g||1)==5||M6(Gp()||1)==5)&&id(E)&&d5(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+=tS(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=$G(E,/\f/g,"")),p>0&&(id(E)-d||m===0)&&VA(p>32?$ce(E+";",n,r,d-1,l):$ce($G(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(VA(k=Pce(E,e,r,u,h,i,o,T,C=[],S=[],d,s),s),b===123)if(h===0)zM(E,e,k,k,C,s,d,o,S);else{switch(f){case 99:if(Ib(E,3)===110)break;case 108:if(Ib(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?zM(t,k,k,n&&VA(Pce(t,k,k,0,0,i,o,T,i,C=[],d,S),S),i,S,d,o,n?C:S):zM(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&&J3t()==125)continue}switch(E+=tS(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:Gp()===45&&(E+=lB(yh())),f=Gp(),h=d=id(T=E+=sCt(FM())),b++;break;case 45:g===45&&id(E)==2&&(m=0)}}return s}function Pce(t,e,r,n,i,s,a,o,l,u,h,d){for(var f=i-1,p=i===0?s:[""],g=h6e(p),m=0,y=0,v=0;m0?p[x]+" "+b:$G(b,/&\f/g,p[x])))&&(l[v++]=T);return NZ(t,e,r,i===0?o6e:o,l,u,h,d)}function oCt(t,e,r,n){return NZ(t,e,r,IZ,tS(Q3t()),d5(t,2,-2),0,n)}function $ce(t,e,r,n,i){return NZ(t,e,r,l6e,d5(t,0,n),d5(t,n+1,-1),n,i)}function FG(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),hCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>OKt);return{diagram:e}},void 0,import.meta.url);return{id:f6e,diagram:t}},"loader"),dCt={id:f6e,detector:uCt,loader:hCt},fCt=dCt,p6e="flowchart",pCt=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"),gCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xee);return{diagram:e}},void 0,import.meta.url);return{id:p6e,diagram:t}},"loader"),mCt={id:p6e,detector:pCt,loader:gCt},yCt=mCt,g6e="flowchart-v2",vCt=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"),bCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xee);return{diagram:e}},void 0,import.meta.url);return{id:g6e,diagram:t}},"loader"),xCt={id:g6e,detector:vCt,loader:bCt},wCt=xCt,m6e="swimlane",TCt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),CCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>KKt);return{diagram:e}},void 0,import.meta.url);return{id:m6e,diagram:t}},"loader"),kCt={id:m6e,detector:TCt,loader:CCt},SCt=kCt,y6e="er",ECt=w(t=>/^\s*erDiagram/.test(t),"detector"),ACt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>iZt);return{diagram:e}},void 0,import.meta.url);return{id:y6e,diagram:t}},"loader"),MCt={id:y6e,detector:ECt,loader:ACt},RCt=MCt,v6e="gitGraph",_Ct=w(t=>/^\s*gitGraph/.test(t),"detector"),LCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cdr);return{diagram:e}},void 0,import.meta.url);return{id:v6e,diagram:t}},"loader"),ICt={id:v6e,detector:_Ct,loader:LCt},NCt=ICt,b6e="gantt",DCt=w(t=>/^\s*gantt/.test(t),"detector"),OCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>yfr);return{diagram:e}},void 0,import.meta.url);return{id:b6e,diagram:t}},"loader"),PCt={id:b6e,detector:DCt,loader:OCt},$Ct=PCt,x6e="info",BCt=w(t=>/^\s*info/.test(t),"detector"),FCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Sfr);return{diagram:e}},void 0,import.meta.url);return{id:x6e,diagram:t}},"loader"),zCt={id:x6e,detector:BCt,loader:FCt},w6e="pie",VCt=w(t=>/^\s*pie/.test(t),"detector"),HCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hfr);return{diagram:e}},void 0,import.meta.url);return{id:w6e,diagram:t}},"loader"),GCt={id:w6e,detector:VCt,loader:HCt},T6e="quadrantChart",WCt=w(t=>/^\s*quadrantChart/.test(t),"detector"),qCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Kfr);return{diagram:e}},void 0,import.meta.url);return{id:T6e,diagram:t}},"loader"),UCt={id:T6e,detector:WCt,loader:qCt},YCt=UCt,C6e="xychart",jCt=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),XCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>h0r);return{diagram:e}},void 0,import.meta.url);return{id:C6e,diagram:t}},"loader"),KCt={id:C6e,detector:jCt,loader:XCt},ZCt=KCt,k6e="requirement",QCt=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),JCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>b0r);return{diagram:e}},void 0,import.meta.url);return{id:k6e,diagram:t}},"loader"),ekt={id:k6e,detector:QCt,loader:JCt},tkt=ekt,S6e="sequence",rkt=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),nkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ppr);return{diagram:e}},void 0,import.meta.url);return{id:S6e,diagram:t}},"loader"),ikt={id:S6e,detector:rkt,loader:nkt},skt=ikt,E6e="class",akt=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"),okt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xpr);return{diagram:e}},void 0,import.meta.url);return{id:E6e,diagram:t}},"loader"),lkt={id:E6e,detector:akt,loader:okt},ckt=lkt,A6e="classDiagram",ukt=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"),hkt=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:A6e,diagram:t}},"loader"),dkt={id:A6e,detector:ukt,loader:hkt},fkt=dkt,M6e="state",pkt=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"),gkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>hgr);return{diagram:e}},void 0,import.meta.url);return{id:M6e,diagram:t}},"loader"),mkt={id:M6e,detector:pkt,loader:gkt},ykt=mkt,R6e="stateDiagram",vkt=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"),bkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>fgr);return{diagram:e}},void 0,import.meta.url);return{id:R6e,diagram:t}},"loader"),xkt={id:R6e,detector:vkt,loader:bkt},wkt=xkt,_6e="journey",Tkt=w(t=>/^\s*journey/.test(t),"detector"),Ckt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ogr);return{diagram:e}},void 0,import.meta.url);return{id:_6e,diagram:t}},"loader"),kkt={id:_6e,detector:Tkt,loader:Ckt},Skt=kkt,Ekt=w((t,e,r)=>{de.debug(`rendering svg for syntax error -`);const n=Ko(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"),L6e={draw:Ekt},Akt=L6e,Mkt={db:{},renderer:L6e,parser:{parse:w(()=>{},"parse")}},Rkt=Mkt,I6e="flowchart-elk",_kt=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"),Lkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xee);return{diagram:e}},void 0,import.meta.url);return{id:I6e,diagram:t}},"loader"),Ikt={id:I6e,detector:_kt,loader:Lkt},Nkt=Ikt,N6e="timeline",Dkt=w(t=>/^\s*timeline/.test(t),"detector"),Okt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>umr);return{diagram:e}},void 0,import.meta.url);return{id:N6e,diagram:t}},"loader"),Pkt={id:N6e,detector:Dkt,loader:Okt},$kt=Pkt,D6e="mindmap",Bkt=w(t=>/^\s*mindmap/.test(t),"detector"),Fkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Emr);return{diagram:e}},void 0,import.meta.url);return{id:D6e,diagram:t}},"loader"),zkt={id:D6e,detector:Bkt,loader:Fkt},Vkt=zkt,O6e="kanban",Hkt=w(t=>/^\s*kanban/.test(t),"detector"),Gkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Umr);return{diagram:e}},void 0,import.meta.url);return{id:O6e,diagram:t}},"loader"),Wkt={id:O6e,detector:Hkt,loader:Gkt},qkt=Wkt,P6e="sankey",Ukt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),Ykt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>L1r);return{diagram:e}},void 0,import.meta.url);return{id:P6e,diagram:t}},"loader"),jkt={id:P6e,detector:Ukt,loader:Ykt},Xkt=jkt,$6e="packet",Kkt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),Zkt=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"),Qkt={id:$6e,detector:Kkt,loader:Zkt},B6e="radar",Jkt=w(t=>/^\s*radar-beta/.test(t),"detector"),eSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cyr);return{diagram:e}},void 0,import.meta.url);return{id:B6e,diagram:t}},"loader"),tSt={id:B6e,detector:Jkt,loader:eSt},F6e="block",rSt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),nSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Pvr);return{diagram:e}},void 0,import.meta.url);return{id:F6e,diagram:t}},"loader"),iSt={id:F6e,detector:rSt,loader:nSt},sSt=iSt,z6e="treeView",aSt=w(t=>/^\s*treeView-beta/.test(t),"detector"),oSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>a2r);return{diagram:e}},void 0,import.meta.url);return{id:z6e,diagram:t}},"loader"),lSt={id:z6e,detector:aSt,loader:oSt},cSt=lSt,V6e="architecture",uSt=w(t=>/^\s*architecture/.test(t),"detector"),hSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>D2r);return{diagram:e}},void 0,import.meta.url);return{id:V6e,diagram:t}},"loader"),dSt={id:V6e,detector:uSt,loader:hSt},fSt=dSt,H6e="eventmodeling",pSt=w(t=>/^\s*eventmodeling/.test(t),"detector"),gSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>K2r);return{diagram:e}},void 0,import.meta.url);return{id:H6e,diagram:t}},"loader"),mSt={id:H6e,detector:pSt,loader:gSt},ySt=mSt,G6e="ishikawa",vSt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),bSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>fbr);return{diagram:e}},void 0,import.meta.url);return{id:G6e,diagram:t}},"loader"),xSt={id:G6e,detector:vSt,loader:bSt},W6e="venn",wSt=w(t=>/^\s*venn-beta/.test(t),"detector"),TSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Qbr);return{diagram:e}},void 0,import.meta.url);return{id:W6e,diagram:t}},"loader"),CSt={id:W6e,detector:wSt,loader:TSt},kSt=CSt,q6e="treemap",SSt=w(t=>/^\s*treemap/.test(t),"detector"),ESt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cxr);return{diagram:e}},void 0,import.meta.url);return{id:q6e,diagram:t}},"loader"),ASt={id:q6e,detector:SSt,loader:ESt},U6e="wardley",MSt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),RSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wxr);return{diagram:e}},void 0,import.meta.url);return{id:U6e,diagram:t}},"loader"),_St={id:U6e,detector:MSt,loader:RSt},LSt=_St,Y6e="cynefin",ISt=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),NSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Bxr);return{diagram:e}},void 0,import.meta.url);return{id:Y6e,diagram:t}},"loader"),DSt={id:Y6e,detector:ISt,loader:NSt},j6e="railroad",OSt=w(t=>/^\s*railroad-beta/i.test(t),"detector"),PSt=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"),$St={id:j6e,detector:OSt,loader:PSt},X6e="railroadEbnf",BSt=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),FSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>v4r);return{diagram:e}},void 0,import.meta.url);return{id:X6e,diagram:t}},"loader"),zSt={id:X6e,detector:BSt,loader:FSt},K6e="railroadAbnf",VSt=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),HSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>M4r);return{diagram:e}},void 0,import.meta.url);return{id:K6e,diagram:t}},"loader"),GSt={id:K6e,detector:VSt,loader:HSt},Z6e="railroadPeg",WSt=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),qSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>B4r);return{diagram:e}},void 0,import.meta.url);return{id:Z6e,diagram:t}},"loader"),USt={id:Z6e,detector:WSt,loader:qSt},Bce=!1,fD=w(()=>{Bce||(Bce=!0,D9("error",Rkt,t=>t.toLowerCase().trim()==="error"),D9("---",{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("---")),FH(Nkt,Vkt,fSt),FH(fCt,qkt,fkt,ckt,RCt,$Ct,zCt,GCt,tkt,skt,SCt,wCt,yCt,$kt,NCt,wkt,ykt,Skt,YCt,Xkt,Qkt,ZCt,sSt,ySt,cSt,tSt,xSt,ASt,$St,zSt,GSt,USt,kSt,LSt,DSt))},"addDiagrams"),YSt=w(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(by).map(async([r,{detector:n,loader:i}])=>{if(i)try{WH(r)}catch{try{const{diagram:s,id:a}=await i();D9(a,s,n)}catch(s){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete by[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"),jSt="graphics-document document";function Q6e(t,e){t.attr("role",jSt),e!==""&&t.attr("aria-roledescription",e)}w(Q6e,"setA11yDiagramInfo");function J6e(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(J6e,"addSVGa11yTitleDescription");var ay,zG=(ay=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=SK(e,n);e=mTt(e)+` -`;try{WH(i)}catch{const d=Dmt(i);if(!d)throw new pTe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();D9(f,p)}const{db:s,parser:a,renderer:o,init:l}=WH(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 ay(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(ay,"Diagram"),ay),Fce=[],XSt=w(()=>{Fce.forEach(t=>{t()}),Fce=[]},"attachFunctions"),KSt=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function eEe(t){const e=t.match(fTe);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),H3t=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"),G3t=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"),W3t={extension:T3t,composition:C3t,aggregation:k3t,dependency:S3t,lollipop:E3t,point:A3t,circle:M3t,cross:R3t,barb:_3t,barbNeo:L3t,only_one:I3t,zero_or_one:N3t,one_or_more:D3t,zero_or_more:O3t,only_one_neo:P3t,zero_or_one_neo:$3t,one_or_more_neo:B3t,zero_or_more_neo:F3t,requirement_arrow:z3t,requirement_contains:H3t,requirement_arrow_neo:V3t,requirement_contains_neo:G3t},LZ=w3t,q3t={common:Vt,getConfig:br,insertCluster:cD,insertEdge:_Z,insertEdgeLabel:y_,insertMarkers:LZ,insertNode:o7,interpolateToCurve:cZ,labelHelper:Qr,log:de,positionEdgeLabel:n6e},A6={},o6e=w(t=>{for(const e of t)A6[e.name]=e},"registerLayoutLoaders"),U3t=w(()=>{o6e([{name:"dagre",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>FHt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>ZHt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await Rr(()=>Promise.resolve().then(()=>VXt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");U3t();var h3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in A6))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=A6[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,q3t,{algorithm:n.algorithm},r)},"render"),l7=w((t="",{fallback:e="dagre"}={})=>{if(t in A6)return t;if(e in A6)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"),IZ="comm",l6e="rule",c6e="decl",Y3t="@media",j3t="@import",X3t="@supports",K3t="@namespace",PG="@keyframes",u6e="@layer",Z3t="@scope",Q3t=Math.abs,tS=String.fromCharCode;function h6e(t){return t.trim()}function $G(t,e,r){return t.replace(e,r)}function Ib(t,e){return t.charCodeAt(e)|0}function d5(t,e,r){return t.slice(e,r)}function id(t){return t.length}function d6e(t){return t.length}function VA(t,e){return e.push(t),t}var hD=1,f5=1,f6e=0,Ru=0,ia=0,d3="";function NZ(t,e,r,n,i,s,a,o){return{value:t,root:e,parent:r,type:n,props:i,children:s,line:hD,column:f5,length:a,return:"",siblings:o}}function J3t(){return ia}function eCt(){return ia=Ru>0?Ib(d3,--Ru):0,f5--,ia===10&&(f5=1,hD--),ia}function yh(){return ia=Ru2||M6(ia)>3?"":" "}function iCt(t,e){for(;--e&&yh()&&!(ia<48||ia>102||ia>57&&ia<65||ia>70&&ia<97););return dD(t,FM()+(e<6&&Gp()==32&&yh()==32))}function BG(t){for(;yh();)switch(ia){case t:return Ru;case 34:case 39:t!==34&&t!==39&&BG(ia);break;case 40:t===41&&BG(t);break;case 92:yh();break}return Ru}function sCt(t,e){for(;yh()&&t+ia!==57;)if(t+ia===84&&Gp()===47)break;return"/*"+dD(e,Ru-1)+"*"+tS(t===47?t:yh())}function aCt(t){for(;!M6(Gp());)yh();return dD(t,Ru)}function oCt(t){return rCt(zM("",null,null,null,[""],t=tCt(t),0,[0],t))}function zM(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&&Ib(E,d-1)==58?(x++,E+="("):E+=lB(b);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=lB(b);break;case 9:case 10:case 13:case 32:if(x>0){E+=tS(b);break}E+=nCt(g);break;case 92:E+=iCt(FM()-1,7);continue;case 47:switch(Gp()){case 42:case 47:VA(lCt(sCt(yh(),FM()),e,r,l),l),(M6(g||1)==5||M6(Gp()||1)==5)&&id(E)&&d5(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+=tS(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=$G(E,/\f/g,"")),p>0&&(id(E)-d||m===0)&&VA(p>32?$ce(E+";",n,r,d-1,l):$ce($G(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(VA(k=Pce(E,e,r,u,h,i,o,T,C=[],S=[],d,s),s),b===123)if(h===0)zM(E,e,k,k,C,s,d,o,S);else{switch(f){case 99:if(Ib(E,3)===110)break;case 108:if(Ib(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?zM(t,k,k,n&&VA(Pce(t,k,k,0,0,i,o,T,i,C=[],d,S),S),i,S,d,o,n?C:S):zM(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&&eCt()==125)continue}switch(E+=tS(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:Gp()===45&&(E+=lB(yh())),f=Gp(),h=d=id(T=E+=aCt(FM())),b++;break;case 45:g===45&&id(E)==2&&(m=0)}}return s}function Pce(t,e,r,n,i,s,a,o,l,u,h,d){for(var f=i-1,p=i===0?s:[""],g=d6e(p),m=0,y=0,v=0;m0?p[x]+" "+b:$G(b,/&\f/g,p[x])))&&(l[v++]=T);return NZ(t,e,r,i===0?l6e:o,l,u,h,d)}function lCt(t,e,r,n){return NZ(t,e,r,IZ,tS(J3t()),d5(t,2,-2),0,n)}function $ce(t,e,r,n,i){return NZ(t,e,r,c6e,d5(t,0,n),d5(t,n+1,-1),n,i)}function FG(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),dCt=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:p6e,diagram:t}},"loader"),fCt={id:p6e,detector:hCt,loader:dCt},pCt=fCt,g6e="flowchart",gCt=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"),mCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xee);return{diagram:e}},void 0,import.meta.url);return{id:g6e,diagram:t}},"loader"),yCt={id:g6e,detector:gCt,loader:mCt},vCt=yCt,m6e="flowchart-v2",bCt=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"),xCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xee);return{diagram:e}},void 0,import.meta.url);return{id:m6e,diagram:t}},"loader"),wCt={id:m6e,detector:bCt,loader:xCt},TCt=wCt,y6e="swimlane",CCt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),kCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ZKt);return{diagram:e}},void 0,import.meta.url);return{id:y6e,diagram:t}},"loader"),SCt={id:y6e,detector:CCt,loader:kCt},ECt=SCt,v6e="er",ACt=w(t=>/^\s*erDiagram/.test(t),"detector"),MCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>sZt);return{diagram:e}},void 0,import.meta.url);return{id:v6e,diagram:t}},"loader"),RCt={id:v6e,detector:ACt,loader:MCt},_Ct=RCt,b6e="gitGraph",LCt=w(t=>/^\s*gitGraph/.test(t),"detector"),ICt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>udr);return{diagram:e}},void 0,import.meta.url);return{id:b6e,diagram:t}},"loader"),NCt={id:b6e,detector:LCt,loader:ICt},DCt=NCt,x6e="gantt",OCt=w(t=>/^\s*gantt/.test(t),"detector"),PCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vfr);return{diagram:e}},void 0,import.meta.url);return{id:x6e,diagram:t}},"loader"),$Ct={id:x6e,detector:OCt,loader:PCt},BCt=$Ct,w6e="info",FCt=w(t=>/^\s*info/.test(t),"detector"),zCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Efr);return{diagram:e}},void 0,import.meta.url);return{id:w6e,diagram:t}},"loader"),VCt={id:w6e,detector:FCt,loader:zCt},T6e="pie",HCt=w(t=>/^\s*pie/.test(t),"detector"),GCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Gfr);return{diagram:e}},void 0,import.meta.url);return{id:T6e,diagram:t}},"loader"),WCt={id:T6e,detector:HCt,loader:GCt},C6e="quadrantChart",qCt=w(t=>/^\s*quadrantChart/.test(t),"detector"),UCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zfr);return{diagram:e}},void 0,import.meta.url);return{id:C6e,diagram:t}},"loader"),YCt={id:C6e,detector:qCt,loader:UCt},jCt=YCt,k6e="xychart",XCt=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),KCt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>d0r);return{diagram:e}},void 0,import.meta.url);return{id:k6e,diagram:t}},"loader"),ZCt={id:k6e,detector:XCt,loader:KCt},QCt=ZCt,S6e="requirement",JCt=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),ekt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>x0r);return{diagram:e}},void 0,import.meta.url);return{id:S6e,diagram:t}},"loader"),tkt={id:S6e,detector:JCt,loader:ekt},rkt=tkt,E6e="sequence",nkt=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),ikt=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:E6e,diagram:t}},"loader"),skt={id:E6e,detector:nkt,loader:ikt},akt=skt,A6e="class",okt=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"),lkt=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:A6e,diagram:t}},"loader"),ckt={id:A6e,detector:okt,loader:lkt},ukt=ckt,M6e="classDiagram",hkt=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"),dkt=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:M6e,diagram:t}},"loader"),fkt={id:M6e,detector:hkt,loader:dkt},pkt=fkt,R6e="state",gkt=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"),mkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>dgr);return{diagram:e}},void 0,import.meta.url);return{id:R6e,diagram:t}},"loader"),ykt={id:R6e,detector:gkt,loader:mkt},vkt=ykt,_6e="stateDiagram",bkt=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"),xkt=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:_6e,diagram:t}},"loader"),wkt={id:_6e,detector:bkt,loader:xkt},Tkt=wkt,L6e="journey",Ckt=w(t=>/^\s*journey/.test(t),"detector"),kkt=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:L6e,diagram:t}},"loader"),Skt={id:L6e,detector:Ckt,loader:kkt},Ekt=Skt,Akt=w((t,e,r)=>{de.debug(`rendering svg for syntax error +`);const n=Ko(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"),I6e={draw:Akt},Mkt=I6e,Rkt={db:{},renderer:I6e,parser:{parse:w(()=>{},"parse")}},_kt=Rkt,N6e="flowchart-elk",Lkt=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"),Ikt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>xee);return{diagram:e}},void 0,import.meta.url);return{id:N6e,diagram:t}},"loader"),Nkt={id:N6e,detector:Lkt,loader:Ikt},Dkt=Nkt,D6e="timeline",Okt=w(t=>/^\s*timeline/.test(t),"detector"),Pkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>hmr);return{diagram:e}},void 0,import.meta.url);return{id:D6e,diagram:t}},"loader"),$kt={id:D6e,detector:Okt,loader:Pkt},Bkt=$kt,O6e="mindmap",Fkt=w(t=>/^\s*mindmap/.test(t),"detector"),zkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Amr);return{diagram:e}},void 0,import.meta.url);return{id:O6e,diagram:t}},"loader"),Vkt={id:O6e,detector:Fkt,loader:zkt},Hkt=Vkt,P6e="kanban",Gkt=w(t=>/^\s*kanban/.test(t),"detector"),Wkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ymr);return{diagram:e}},void 0,import.meta.url);return{id:P6e,diagram:t}},"loader"),qkt={id:P6e,detector:Gkt,loader:Wkt},Ukt=qkt,$6e="sankey",Ykt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),jkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>I1r);return{diagram:e}},void 0,import.meta.url);return{id:$6e,diagram:t}},"loader"),Xkt={id:$6e,detector:Ykt,loader:jkt},Kkt=Xkt,B6e="packet",Zkt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),Qkt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>G1r);return{diagram:e}},void 0,import.meta.url);return{id:B6e,diagram:t}},"loader"),Jkt={id:B6e,detector:Zkt,loader:Qkt},F6e="radar",eSt=w(t=>/^\s*radar-beta/.test(t),"detector"),tSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>uyr);return{diagram:e}},void 0,import.meta.url);return{id:F6e,diagram:t}},"loader"),rSt={id:F6e,detector:eSt,loader:tSt},z6e="block",nSt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),iSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$vr);return{diagram:e}},void 0,import.meta.url);return{id:z6e,diagram:t}},"loader"),sSt={id:z6e,detector:nSt,loader:iSt},aSt=sSt,V6e="treeView",oSt=w(t=>/^\s*treeView-beta/.test(t),"detector"),lSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>o2r);return{diagram:e}},void 0,import.meta.url);return{id:V6e,diagram:t}},"loader"),cSt={id:V6e,detector:oSt,loader:lSt},uSt=cSt,H6e="architecture",hSt=w(t=>/^\s*architecture/.test(t),"detector"),dSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>O2r);return{diagram:e}},void 0,import.meta.url);return{id:H6e,diagram:t}},"loader"),fSt={id:H6e,detector:hSt,loader:dSt},pSt=fSt,G6e="eventmodeling",gSt=w(t=>/^\s*eventmodeling/.test(t),"detector"),mSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Z2r);return{diagram:e}},void 0,import.meta.url);return{id:G6e,diagram:t}},"loader"),ySt={id:G6e,detector:gSt,loader:mSt},vSt=ySt,W6e="ishikawa",bSt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),xSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>pbr);return{diagram:e}},void 0,import.meta.url);return{id:W6e,diagram:t}},"loader"),wSt={id:W6e,detector:bSt,loader:xSt},q6e="venn",TSt=w(t=>/^\s*venn-beta/.test(t),"detector"),CSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Jbr);return{diagram:e}},void 0,import.meta.url);return{id:q6e,diagram:t}},"loader"),kSt={id:q6e,detector:TSt,loader:CSt},SSt=kSt,U6e="treemap",ESt=w(t=>/^\s*treemap/.test(t),"detector"),ASt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>uxr);return{diagram:e}},void 0,import.meta.url);return{id:U6e,diagram:t}},"loader"),MSt={id:U6e,detector:ESt,loader:ASt},Y6e="wardley",RSt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),_St=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Txr);return{diagram:e}},void 0,import.meta.url);return{id:Y6e,diagram:t}},"loader"),LSt={id:Y6e,detector:RSt,loader:_St},ISt=LSt,j6e="cynefin",NSt=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),DSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Fxr);return{diagram:e}},void 0,import.meta.url);return{id:j6e,diagram:t}},"loader"),OSt={id:j6e,detector:NSt,loader:DSt},X6e="railroad",PSt=w(t=>/^\s*railroad-beta/i.test(t),"detector"),$St=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>u4r);return{diagram:e}},void 0,import.meta.url);return{id:X6e,diagram:t}},"loader"),BSt={id:X6e,detector:PSt,loader:$St},K6e="railroadEbnf",FSt=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),zSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>b4r);return{diagram:e}},void 0,import.meta.url);return{id:K6e,diagram:t}},"loader"),VSt={id:K6e,detector:FSt,loader:zSt},Z6e="railroadAbnf",HSt=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),GSt=w(async()=>{const{diagram:t}=await Rr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>R4r);return{diagram:e}},void 0,import.meta.url);return{id:Z6e,diagram:t}},"loader"),WSt={id:Z6e,detector:HSt,loader:GSt},Q6e="railroadPeg",qSt=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),USt=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:Q6e,diagram:t}},"loader"),YSt={id:Q6e,detector:qSt,loader:USt},Bce=!1,fD=w(()=>{Bce||(Bce=!0,D9("error",_kt,t=>t.toLowerCase().trim()==="error"),D9("---",{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("---")),FH(Dkt,Hkt,pSt),FH(pCt,Ukt,pkt,ukt,_Ct,BCt,VCt,WCt,rkt,akt,ECt,TCt,vCt,Bkt,DCt,Tkt,vkt,Ekt,jCt,Kkt,Jkt,QCt,aSt,vSt,uSt,rSt,wSt,MSt,BSt,VSt,WSt,YSt,SSt,ISt,OSt))},"addDiagrams"),jSt=w(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(by).map(async([r,{detector:n,loader:i}])=>{if(i)try{WH(r)}catch{try{const{diagram:s,id:a}=await i();D9(a,s,n)}catch(s){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete by[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"),XSt="graphics-document document";function J6e(t,e){t.attr("role",XSt),e!==""&&t.attr("aria-roledescription",e)}w(J6e,"setA11yDiagramInfo");function eEe(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(eEe,"addSVGa11yTitleDescription");var ay,zG=(ay=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=SK(e,n);e=yTt(e)+` +`;try{WH(i)}catch{const d=Omt(i);if(!d)throw new gTe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();D9(f,p)}const{db:s,parser:a,renderer:o,init:l}=WH(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 ay(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(ay,"Diagram"),ay),Fce=[],KSt=w(()=>{Fce.forEach(t=>{t()}),Fce=[]},"attachFunctions"),ZSt=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function tEe(t){const e=t.match(pTe);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=tD(n,{schema:eD})??{};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(eEe,"extractFrontMatter");var ZSt=w(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),QSt=w(t=>{const{text:e,metadata:r}=eEe(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"),JSt=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:aTt(t),directive:e}},"processDirectives");function DZ(t){const e=ZSt(t),r=QSt(e),n=JSt(r.text),i=es(r.config,n.directive);return t=KSt(n.text),{code:t,title:r.title,config:i}}w(DZ,"preprocessDiagram");function tEe(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(tEe,"toBase64");var e6t=5e4,t6t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",r6t="sandbox",n6t="loose",i6t="http://www.w3.org/2000/svg",s6t="http://www.w3.org/1999/xlink",a6t="http://www.w3.org/1999/xhtml",o6t="100%",l6t="100%",c6t="border:0;margin:0;",u6t="margin:0",h6t="allow-top-navigation-by-user-activation allow-popups",d6t='The "iframe" tag is not supported by your browser.',f6t=["foreignobject"],p6t=["dominant-baseline"];function OZ(t){const e=DZ(t);return I9(),_mt(e.config??{}),e}w(OZ,"processAndSetConfigs");async function rEe(t,e){fD();try{const{code:r,config:n}=OZ(t);return{diagramType:(await iEe(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(rEe,"parse");var zce=w((t,e,r=[])=>{const n=oTe(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),g6t=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=di(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Jle(l.styles)||o.forEach(u=>{r.insertRule(zce(l.id,u,l.styles),r.cssRules.length)}),Jle(l.textStyles)||r.insertRule(zce(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=HH(i)+` +`):e[2];let i=tD(n,{schema:eD})??{};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(tEe,"extractFrontMatter");var QSt=w(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),JSt=w(t=>{const{text:e,metadata:r}=tEe(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"),e6t=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:oTt(t),directive:e}},"processDirectives");function DZ(t){const e=QSt(t),r=JSt(e),n=e6t(r.text),i=es(r.config,n.directive);return t=ZSt(n.text),{code:t,title:r.title,config:i}}w(DZ,"preprocessDiagram");function rEe(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(rEe,"toBase64");var t6t=5e4,r6t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",n6t="sandbox",i6t="loose",s6t="http://www.w3.org/2000/svg",a6t="http://www.w3.org/1999/xlink",o6t="http://www.w3.org/1999/xhtml",l6t="100%",c6t="100%",u6t="border:0;margin:0;",h6t="margin:0",d6t="allow-top-navigation-by-user-activation allow-popups",f6t='The "iframe" tag is not supported by your browser.',p6t=["foreignobject"],g6t=["dominant-baseline"];function OZ(t){const e=DZ(t);return I9(),Lmt(e.config??{}),e}w(OZ,"processAndSetConfigs");async function nEe(t,e){fD();try{const{code:r,config:n}=OZ(t);return{diagramType:(await sEe(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(nEe,"parse");var zce=w((t,e,r=[])=>{const n=lTe(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),m6t=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=di(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Jle(l.styles)||o.forEach(u=>{r.insertRule(zce(l.id,u,l.styles),r.cssRules.length)}),Jle(l.textStyles)||r.insertRule(zce(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=HH(i)+` `}else n+=`${t.themeCSS} -`;return n+HH(r)},"createCssStyles"),m6t=w((t,e)=>FG(aCt(`${t}{${e}}`),cCt([w(function(n,i,s,a){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===PG)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("@")&&([...[U3t,j3t,c6e,K3t,"@container","@starting-style"],PG].includes(n.type)||(de.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=IZ))},"addNamespace"),lCt])),"compileCSS"),y6t=w((t,e,r,n)=>{const i=g6t(t,r),s=Kmt(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return m6t(n,s)},"createUserStyles"),v6t=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"),b6t=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":l6t,n=tEe(`${t}`);return``},"putIntoIFrame"),Vce=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",i6t);return i&&a.attr("xmlns:xlink",i),a.append("g"),t},"appendDivSvgG");function VG(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(VG,"sandboxedIframe");var x6t=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"),w6t=w(async function(t,e,r){var P,N,L,I,$,O;fD();const n=OZ(e);e=n.code;const i=br();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??e6t)&&(e=t6t);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===r6t,p=i.securityLevel===n6t,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=VG(wt(r),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt(r);Vce(d,t,l,`font-family: ${g}`,s6t)}else{if(x6t(document,t,l,a),f){const D=VG(wt(document.body),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt("body");Vce(d,t,l)}let m,y;try{m=await zG.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await zG.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=y6t(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():Akt.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($);sEe(x,E,A,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",a6t);let _=d.select(u).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=v6t(_,f,Gd(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();_=b6t(_,D)}else p||(_=h0.sanitize(_,{ADD_TAGS:f6t,ADD_ATTR:p6t,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(XSt(),y)throw y;return h(),{diagramType:x,svg:_,bindFunctions:m.db.bindFunctions}},"render");function nEe(t={}){var n;const e=aa({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Mmt(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"?Amt(e):lTe();TK(r.logLevel),fD()}w(nEe,"initialize");var iEe=w((t,e={})=>{const{code:r}=DZ(t);return zG.fromText(r,e)},"getDiagramFromText");function sEe(t,e,r,n){Q6e(e,t),J6e(e,r,n,e.attr("id"))}w(sEe,"addA11yInfo");var Ay=Object.freeze({render:w6t,parse:rEe,getDiagramFromText:iEe,initialize:nEe,getConfig:br,setConfig:cTe,getSiteConfig:lTe,updateSiteConfig:Rmt,reset:w(()=>{I9()},"reset"),globalReset:w(()=>{I9(r5)},"globalReset"),defaultConfig:r5});TK(br().logLevel);I9(br());var T6t=w((t,e,r)=>{de.warn(t),fZ(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"),aEe=w(async function(t={querySelector:".mermaid"}){try{await C6t(t)}catch(e){if(fZ(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"),C6t=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=Ay.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)),Ay.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=uke(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 uEe(u,a,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){T6t(d,o,Fc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),oEe=w(function(t){Ay.initialize(t)},"initialize"),k6t=w(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&oEe(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await aEe(n)},"init"),S6t=w(async(t,{lazyLoad:e=!0}={})=>{fD(),FH(...t),e===!1&&await YSt()},"registerExternalDiagrams"),lEe=w(function(){if(Fc.startOnLoad){const{startOnLoad:t}=Ay.getConfig();t&&Fc.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",lEe,!1);var E6t=w(function(t){Fc.parseError=t},"setParseErrorHandler"),v_=[],cB=!1,cEe=w(async()=>{if(!cB){for(cB=!0;v_.length>0;){const t=v_.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}cB=!1}},"executeQueue"),A6t=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((s,a)=>{Ay.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");v_.push(i),cEe().catch(n)}),"parse"),uEe=w((t,e,r)=>new Promise((n,i)=>{const s=w(()=>new Promise((a,o)=>{Ay.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");v_.push(s),cEe().catch(i)}),"render"),M6t=w(()=>Object.keys(by).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Fc={startOnLoad:!0,mermaidAPI:Ay,parse:A6t,render:uEe,init:k6t,run:aEe,registerExternalDiagrams:S6t,registerLayoutLoaders:a6e,initialize:oEe,parseError:void 0,contentLoaded:lEe,setParseErrorHandler:E6t,detectType:SK,registerIconPacks:gZ,getRegisteredDiagramsMetadata:M6t},Hce=Fc;/*! Check if previously processed *//*! +`;return n+HH(r)},"createCssStyles"),y6t=w((t,e)=>FG(oCt(`${t}{${e}}`),uCt([w(function(n,i,s,a){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===PG)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("@")&&([...[Y3t,X3t,u6e,Z3t,"@container","@starting-style"],PG].includes(n.type)||(de.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=IZ))},"addNamespace"),cCt])),"compileCSS"),v6t=w((t,e,r,n)=>{const i=m6t(t,r),s=Zmt(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return y6t(n,s)},"createUserStyles"),b6t=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"),x6t=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":c6t,n=rEe(`${t}`);return``},"putIntoIFrame"),Vce=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",s6t);return i&&a.attr("xmlns:xlink",i),a.append("g"),t},"appendDivSvgG");function VG(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(VG,"sandboxedIframe");var w6t=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"),T6t=w(async function(t,e,r){var P,N,L,I,$,O;fD();const n=OZ(e);e=n.code;const i=br();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??t6t)&&(e=r6t);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===n6t,p=i.securityLevel===i6t,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=VG(wt(r),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt(r);Vce(d,t,l,`font-family: ${g}`,a6t)}else{if(w6t(document,t,l,a),f){const D=VG(wt(document.body),a);d=wt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=wt("body");Vce(d,t,l)}let m,y;try{m=await zG.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await zG.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=v6t(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():Mkt.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($);aEe(x,E,A,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",o6t);let _=d.select(u).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=b6t(_,f,Gd(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();_=x6t(_,D)}else p||(_=h0.sanitize(_,{ADD_TAGS:p6t,ADD_ATTR:g6t,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(KSt(),y)throw y;return h(),{diagramType:x,svg:_,bindFunctions:m.db.bindFunctions}},"render");function iEe(t={}){var n;const e=aa({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Rmt(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"?Mmt(e):cTe();TK(r.logLevel),fD()}w(iEe,"initialize");var sEe=w((t,e={})=>{const{code:r}=DZ(t);return zG.fromText(r,e)},"getDiagramFromText");function aEe(t,e,r,n){J6e(e,t),eEe(e,r,n,e.attr("id"))}w(aEe,"addA11yInfo");var Ay=Object.freeze({render:T6t,parse:nEe,getDiagramFromText:sEe,initialize:iEe,getConfig:br,setConfig:uTe,getSiteConfig:cTe,updateSiteConfig:_mt,reset:w(()=>{I9()},"reset"),globalReset:w(()=>{I9(r5)},"globalReset"),defaultConfig:r5});TK(br().logLevel);I9(br());var C6t=w((t,e,r)=>{de.warn(t),fZ(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"),oEe=w(async function(t={querySelector:".mermaid"}){try{await k6t(t)}catch(e){if(fZ(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"),k6t=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=Ay.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)),Ay.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=hke(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 hEe(u,a,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){C6t(d,o,Fc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),lEe=w(function(t){Ay.initialize(t)},"initialize"),S6t=w(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&lEe(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await oEe(n)},"init"),E6t=w(async(t,{lazyLoad:e=!0}={})=>{fD(),FH(...t),e===!1&&await jSt()},"registerExternalDiagrams"),cEe=w(function(){if(Fc.startOnLoad){const{startOnLoad:t}=Ay.getConfig();t&&Fc.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",cEe,!1);var A6t=w(function(t){Fc.parseError=t},"setParseErrorHandler"),v_=[],cB=!1,uEe=w(async()=>{if(!cB){for(cB=!0;v_.length>0;){const t=v_.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}cB=!1}},"executeQueue"),M6t=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((s,a)=>{Ay.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");v_.push(i),uEe().catch(n)}),"parse"),hEe=w((t,e,r)=>new Promise((n,i)=>{const s=w(()=>new Promise((a,o)=>{Ay.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");v_.push(s),uEe().catch(i)}),"render"),R6t=w(()=>Object.keys(by).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Fc={startOnLoad:!0,mermaidAPI:Ay,parse:M6t,render:hEe,init:S6t,run:oEe,registerExternalDiagrams:E6t,registerLayoutLoaders:o6e,initialize:lEe,parseError:void 0,contentLoaded:cEe,setParseErrorHandler:A6t,detectType:SK,registerIconPacks:gZ,getRegisteredDiagramsMetadata:R6t},Hce=Fc;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */function R6t(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 _6t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function ng(t){const e=[];for(let r=0,n=t.length;rAc||t.height>Ac)&&(t.width>Ac&&t.height>Ac?t.width>t.height?(t.height*=Ac/t.width,t.width=Ac):(t.width*=Ac/t.height,t.height=Ac):t.width>Ac?(t.height*=Ac/t.width,t.width=Ac):(t.width*=Ac/t.height,t.height=Ac))}function x_(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 O6t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function P6t(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),O6t(i)}const fc=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||fc(r,e)};function $6t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function B6t(t,e){return hEe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function F6t(t,e,r,n){const i=`.${t}:${e}`,s=r.cssText?$6t(r):B6t(r,n);return document.createTextNode(`${i}{${s}}`)}function Gce(t,e,r,n){const i=window.getComputedStyle(t,r),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=_6t();try{e.className=`${e.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild(F6t(a,r,i,n)),e.appendChild(o)}function z6t(t,e,r){Gce(t,e,":before",r),Gce(t,e,":after",r)}const Wce="application/font-woff",qce="image/jpeg",V6t={woff:Wce,woff2:Wce,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:qce,jpeg:qce,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function H6t(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function PZ(t){const e=H6t(t).toLowerCase();return V6t[e]||""}function G6t(t){return t.split(/,/)[1]}function HG(t){return t.search(/^(data:)/)!==-1}function W6t(t,e){return`data:${e};base64,${t}`}async function fEe(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 uB={};function q6t(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 $Z(t,e,r){const n=q6t(t,e,r.includeQueryParams);if(uB[n]!=null)return uB[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const s=await fEe(t,r.fetchRequestInit,({res:a,result:o})=>(e||(e=a.headers.get("Content-Type")||""),G6t(o)));i=W6t(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 uB[n]=i,i}async function U6t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):x_(e)}async function Y6t(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 x_(o)}const r=t.poster,n=PZ(r),i=await $Z(r,n,e);return x_(i)}async function j6t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await pD(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function X6t(t,e){return fc(t,HTMLCanvasElement)?U6t(t):fc(t,HTMLVideoElement)?Y6t(t,e):fc(t,HTMLIFrameElement)?j6t(t,e):t.cloneNode(pEe(t))}const K6t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",pEe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function Z6t(t,e,r){var n,i;if(pEe(e))return e;let s=[];return K6t(t)&&t.assignedNodes?s=ng(t.assignedNodes()):fc(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?s=ng(t.contentDocument.body.childNodes):s=ng(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),s.length===0||fc(t,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>pD(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function Q6t(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):hEe(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`),fc(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 J6t(t,e){fc(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),fc(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function eEt(t,e){if(fc(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function tEt(t,e,r){return fc(e,Element)&&(Q6t(t,e,r),z6t(t,e,r),J6t(t,e),eEt(t,e)),e}async function rEt(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let s=0;sX6t(n,e)).then(n=>Z6t(t,n,e)).then(n=>tEt(t,n,e)).then(n=>rEt(n,e))}const gEe=/url\((['"]?)([^'"]+?)\1\)/g,nEt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,iEt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function sEt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function aEt(t){const e=[];return t.replace(gEe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!HG(r))}async function oEt(t,e,r,n,i){try{const s=r?R6t(e,r):e,a=PZ(e);let o;return i||(o=await $Z(s,a,n)),t.replace(sEt(e),`$1${o}$3`)}catch{}return t}function lEt(t,{preferredFontFormat:e}){return e?t.replace(iEt,r=>{for(;;){const[n,,i]=nEt.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function mEe(t){return t.search(gEe)!==-1}async function yEe(t,e,r){if(!mEe(t))return t;const n=lEt(t,r);return aEt(n).reduce((s,a)=>s.then(o=>oEt(o,a,e,r)),Promise.resolve(n))}async function Wv(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const s=await yEe(i,null,r);return e.style.setProperty(t,s,e.style.getPropertyPriority(t)),!0}return!1}async function cEt(t,e){await Wv("background",t,e)||await Wv("background-image",t,e),await Wv("mask",t,e)||await Wv("-webkit-mask",t,e)||await Wv("mask-image",t,e)||await Wv("-webkit-mask-image",t,e)}async function uEt(t,e){const r=fc(t,HTMLImageElement);if(!(r&&!HG(t.src))&&!(fc(t,SVGImageElement)&&!HG(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await $Z(n,PZ(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 hEt(t,e){const n=ng(t.childNodes).map(i=>vEe(i,e));await Promise.all(n).then(()=>t)}async function vEe(t,e){fc(t,Element)&&(await cEt(t,e),await uEt(t,e),await hEt(t,e))}function dEt(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 Uce={};async function Yce(t){let e=Uce[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},Uce[t]=e,e}async function jce(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),fEe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>r)}function Xce(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 fEt(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{ng(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,u=Yce(l).then(h=>jce(h,e)).then(h=>Xce(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(Yce(i.href).then(o=>jce(o,e)).then(o=>Xce(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{ng(i.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),r))}function pEt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>mEe(e.style.getPropertyValue("src")))}async function gEt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=ng(t.ownerDocument.styleSheets),n=await fEt(r,e);return pEt(n)}function bEe(t){return t.trim().replace(/["']/g,"")}function mEt(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{e.add(bEe(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(t),e}async function yEt(t,e){const r=await gEt(t,e),n=mEt(t);return(await Promise.all(r.filter(s=>n.has(bEe(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return yEe(s.cssText,a,e)}))).join(` -`)}async function vEt(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await yEt(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 bEt(t,e={}){const{width:r,height:n}=dEe(t,e),i=await pD(t,e,!0);return await vEt(i,e),await vEe(i,e),dEt(i,e),await P6t(i,r,n)}async function xEt(t,e={}){const{width:r,height:n}=dEe(t,e),i=await bEt(t,e),s=await x_(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=e.pixelRatio||N6t(),u=e.canvasWidth||r,h=e.canvasHeight||n;return a.width=u*l,a.height=h*l,e.skipAutoScale||D6t(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 BZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tv=BZ();function xEe(t){tv=t}var h1={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(wl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var wEt=(()=>{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)}}>`)},TEt=/^(?:[ \t]*(?:\n|$))+/,CEt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kEt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,c7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,SEt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,FZ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,wEe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,TEe=Vn(wEe).replace(/bull/g,FZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),EEt=Vn(wEe).replace(/bull/g,FZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,AEt=/^[^\n]+/,VZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,MEt=Vn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",VZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),REt=Vn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,FZ).getRegex(),gD="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",HZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,_Et=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",HZ).replace("tag",gD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),CEe=Vn(zZ).replace("hr",c7).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",gD).getRegex(),LEt=Vn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",CEe).getRegex(),GZ={blockquote:LEt,code:CEt,def:MEt,fences:kEt,heading:SEt,hr:c7,html:_Et,lheading:TEe,list:REt,newline:TEt,paragraph:CEe,table:h1,text:AEt},Kce=Vn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",c7).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",gD).getRegex(),IEt={...GZ,lheading:EEt,table:Kce,paragraph:Vn(zZ).replace("hr",c7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kce).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",gD).getRegex()},NEt={...GZ,html:Vn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",HZ).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:h1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vn(zZ).replace("hr",c7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",TEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},DEt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OEt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kEe=/^( {2,}|\\)\n(?!\s*$)/,PEt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",wEt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),EEe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,VEt=Vn(EEe,"u").replace(/punct/g,f3).getRegex(),HEt=Vn(EEe,"u").replace(/punct/g,SEe).getRegex(),AEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",GEt=Vn(AEe,"gu").replace(/notPunctSpace/g,WZ).replace(/punctSpace/g,mD).replace(/punct/g,f3).getRegex(),WEt=Vn(AEe,"gu").replace(/notPunctSpace/g,FEt).replace(/punctSpace/g,BEt).replace(/punct/g,SEe).getRegex(),qEt=Vn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,WZ).replace(/punctSpace/g,mD).replace(/punct/g,f3).getRegex(),UEt=Vn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,f3).getRegex(),YEt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",jEt=Vn(YEt,"gu").replace(/notPunctSpace/g,WZ).replace(/punctSpace/g,mD).replace(/punct/g,f3).getRegex(),XEt=Vn(/\\(punct)/,"gu").replace(/punct/g,f3).getRegex(),KEt=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(),ZEt=Vn(HZ).replace("(?:-->|$)","-->").getRegex(),QEt=Vn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",ZEt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),w_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,JEt=Vn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",w_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),MEe=Vn(/^!?\[(label)\]\[(ref)\]/).replace("label",w_).replace("ref",VZ).getRegex(),REe=Vn(/^!?\[(ref)\](?:\[\])?/).replace("ref",VZ).getRegex(),e7t=Vn("reflink|nolink(?!\\()","g").replace("reflink",MEe).replace("nolink",REe).getRegex(),Zce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qZ={_backpedal:h1,anyPunctuation:XEt,autolink:KEt,blockSkip:zEt,br:kEe,code:OEt,del:h1,delLDelim:h1,delRDelim:h1,emStrongLDelim:VEt,emStrongRDelimAst:GEt,emStrongRDelimUnd:qEt,escape:DEt,link:JEt,nolink:REe,punctuation:$Et,reflink:MEe,reflinkSearch:e7t,tag:QEt,text:PEt,url:h1},t7t={...qZ,link:Vn(/^!?\[(label)\]\((.*?)\)/).replace("label",w_).getRegex(),reflink:Vn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w_).getRegex()},GG={...qZ,emStrongRDelimAst:WEt,emStrongLDelim:HEt,delLDelim:UEt,delRDelim:jEt,url:Vn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Zce).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]*?(?:(?=[\\":">",'"':""","'":"'"},Qce=t=>n7t[t];function Yh(t,e){if(e){if(wl.escapeTest.test(t))return t.replace(wl.escapeReplace,Qce)}else if(wl.escapeTestNoEncode.test(t))return t.replace(wl.escapeReplaceNoEncode,Qce);return t}function Jce(t){try{t=encodeURI(t).replace(wl.percentDecode,"%")}catch{return null}return t}function eue(t,e){var s;let r=t.replace(wl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(wl.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 s7t(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 tue(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 a7t(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */function _6t(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 L6t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function ng(t){const e=[];for(let r=0,n=t.length;rAc||t.height>Ac)&&(t.width>Ac&&t.height>Ac?t.width>t.height?(t.height*=Ac/t.width,t.width=Ac):(t.width*=Ac/t.height,t.height=Ac):t.width>Ac?(t.height*=Ac/t.width,t.width=Ac):(t.width*=Ac/t.height,t.height=Ac))}function x_(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 P6t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function $6t(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),P6t(i)}const fc=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||fc(r,e)};function B6t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function F6t(t,e){return dEe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function z6t(t,e,r,n){const i=`.${t}:${e}`,s=r.cssText?B6t(r):F6t(r,n);return document.createTextNode(`${i}{${s}}`)}function Gce(t,e,r,n){const i=window.getComputedStyle(t,r),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=L6t();try{e.className=`${e.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild(z6t(a,r,i,n)),e.appendChild(o)}function V6t(t,e,r){Gce(t,e,":before",r),Gce(t,e,":after",r)}const Wce="application/font-woff",qce="image/jpeg",H6t={woff:Wce,woff2:Wce,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:qce,jpeg:qce,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function G6t(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function PZ(t){const e=G6t(t).toLowerCase();return H6t[e]||""}function W6t(t){return t.split(/,/)[1]}function HG(t){return t.search(/^(data:)/)!==-1}function q6t(t,e){return`data:${e};base64,${t}`}async function pEe(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 uB={};function U6t(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 $Z(t,e,r){const n=U6t(t,e,r.includeQueryParams);if(uB[n]!=null)return uB[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const s=await pEe(t,r.fetchRequestInit,({res:a,result:o})=>(e||(e=a.headers.get("Content-Type")||""),W6t(o)));i=q6t(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 uB[n]=i,i}async function Y6t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):x_(e)}async function j6t(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 x_(o)}const r=t.poster,n=PZ(r),i=await $Z(r,n,e);return x_(i)}async function X6t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await pD(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function K6t(t,e){return fc(t,HTMLCanvasElement)?Y6t(t):fc(t,HTMLVideoElement)?j6t(t,e):fc(t,HTMLIFrameElement)?X6t(t,e):t.cloneNode(gEe(t))}const Z6t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",gEe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function Q6t(t,e,r){var n,i;if(gEe(e))return e;let s=[];return Z6t(t)&&t.assignedNodes?s=ng(t.assignedNodes()):fc(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?s=ng(t.contentDocument.body.childNodes):s=ng(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),s.length===0||fc(t,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>pD(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function J6t(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):dEe(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`),fc(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 eEt(t,e){fc(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),fc(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function tEt(t,e){if(fc(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function rEt(t,e,r){return fc(e,Element)&&(J6t(t,e,r),V6t(t,e,r),eEt(t,e),tEt(t,e)),e}async function nEt(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let s=0;sK6t(n,e)).then(n=>Q6t(t,n,e)).then(n=>rEt(t,n,e)).then(n=>nEt(n,e))}const mEe=/url\((['"]?)([^'"]+?)\1\)/g,iEt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,sEt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function aEt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function oEt(t){const e=[];return t.replace(mEe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!HG(r))}async function lEt(t,e,r,n,i){try{const s=r?_6t(e,r):e,a=PZ(e);let o;return i||(o=await $Z(s,a,n)),t.replace(aEt(e),`$1${o}$3`)}catch{}return t}function cEt(t,{preferredFontFormat:e}){return e?t.replace(sEt,r=>{for(;;){const[n,,i]=iEt.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function yEe(t){return t.search(mEe)!==-1}async function vEe(t,e,r){if(!yEe(t))return t;const n=cEt(t,r);return oEt(n).reduce((s,a)=>s.then(o=>lEt(o,a,e,r)),Promise.resolve(n))}async function Wv(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const s=await vEe(i,null,r);return e.style.setProperty(t,s,e.style.getPropertyPriority(t)),!0}return!1}async function uEt(t,e){await Wv("background",t,e)||await Wv("background-image",t,e),await Wv("mask",t,e)||await Wv("-webkit-mask",t,e)||await Wv("mask-image",t,e)||await Wv("-webkit-mask-image",t,e)}async function hEt(t,e){const r=fc(t,HTMLImageElement);if(!(r&&!HG(t.src))&&!(fc(t,SVGImageElement)&&!HG(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await $Z(n,PZ(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 dEt(t,e){const n=ng(t.childNodes).map(i=>bEe(i,e));await Promise.all(n).then(()=>t)}async function bEe(t,e){fc(t,Element)&&(await uEt(t,e),await hEt(t,e),await dEt(t,e))}function fEt(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 Uce={};async function Yce(t){let e=Uce[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},Uce[t]=e,e}async function jce(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),pEe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>r)}function Xce(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 pEt(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{ng(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,u=Yce(l).then(h=>jce(h,e)).then(h=>Xce(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(Yce(i.href).then(o=>jce(o,e)).then(o=>Xce(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{ng(i.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),r))}function gEt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>yEe(e.style.getPropertyValue("src")))}async function mEt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=ng(t.ownerDocument.styleSheets),n=await pEt(r,e);return gEt(n)}function xEe(t){return t.trim().replace(/["']/g,"")}function yEt(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{e.add(xEe(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(t),e}async function vEt(t,e){const r=await mEt(t,e),n=yEt(t);return(await Promise.all(r.filter(s=>n.has(xEe(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return vEe(s.cssText,a,e)}))).join(` +`)}async function bEt(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await vEt(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 xEt(t,e={}){const{width:r,height:n}=fEe(t,e),i=await pD(t,e,!0);return await bEt(i,e),await bEe(i,e),fEt(i,e),await $6t(i,r,n)}async function wEt(t,e={}){const{width:r,height:n}=fEe(t,e),i=await xEt(t,e),s=await x_(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=e.pixelRatio||D6t(),u=e.canvasWidth||r,h=e.canvasHeight||n;return a.width=u*l,a.height=h*l,e.skipAutoScale||O6t(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 BZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tv=BZ();function wEe(t){tv=t}var h1={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(wl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var TEt=(()=>{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)}}>`)},CEt=/^(?:[ \t]*(?:\n|$))+/,kEt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,SEt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,c7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,EEt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,FZ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,TEe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,CEe=Vn(TEe).replace(/bull/g,FZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),AEt=Vn(TEe).replace(/bull/g,FZ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,MEt=/^[^\n]+/,VZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,REt=Vn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",VZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_Et=Vn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,FZ).getRegex(),gD="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",HZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,LEt=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",HZ).replace("tag",gD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kEe=Vn(zZ).replace("hr",c7).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",gD).getRegex(),IEt=Vn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kEe).getRegex(),GZ={blockquote:IEt,code:kEt,def:REt,fences:SEt,heading:EEt,hr:c7,html:LEt,lheading:CEe,list:_Et,newline:CEt,paragraph:kEe,table:h1,text:MEt},Kce=Vn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",c7).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",gD).getRegex(),NEt={...GZ,lheading:AEt,table:Kce,paragraph:Vn(zZ).replace("hr",c7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kce).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",gD).getRegex()},DEt={...GZ,html:Vn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",HZ).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:h1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vn(zZ).replace("hr",c7).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",CEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},OEt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PEt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,SEe=/^( {2,}|\\)\n(?!\s*$)/,$Et=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",TEt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),AEe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,HEt=Vn(AEe,"u").replace(/punct/g,f3).getRegex(),GEt=Vn(AEe,"u").replace(/punct/g,EEe).getRegex(),MEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",WEt=Vn(MEe,"gu").replace(/notPunctSpace/g,WZ).replace(/punctSpace/g,mD).replace(/punct/g,f3).getRegex(),qEt=Vn(MEe,"gu").replace(/notPunctSpace/g,zEt).replace(/punctSpace/g,FEt).replace(/punct/g,EEe).getRegex(),UEt=Vn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,WZ).replace(/punctSpace/g,mD).replace(/punct/g,f3).getRegex(),YEt=Vn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,f3).getRegex(),jEt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",XEt=Vn(jEt,"gu").replace(/notPunctSpace/g,WZ).replace(/punctSpace/g,mD).replace(/punct/g,f3).getRegex(),KEt=Vn(/\\(punct)/,"gu").replace(/punct/g,f3).getRegex(),ZEt=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(),QEt=Vn(HZ).replace("(?:-->|$)","-->").getRegex(),JEt=Vn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",QEt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),w_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,e7t=Vn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",w_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),REe=Vn(/^!?\[(label)\]\[(ref)\]/).replace("label",w_).replace("ref",VZ).getRegex(),_Ee=Vn(/^!?\[(ref)\](?:\[\])?/).replace("ref",VZ).getRegex(),t7t=Vn("reflink|nolink(?!\\()","g").replace("reflink",REe).replace("nolink",_Ee).getRegex(),Zce=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qZ={_backpedal:h1,anyPunctuation:KEt,autolink:ZEt,blockSkip:VEt,br:SEe,code:PEt,del:h1,delLDelim:h1,delRDelim:h1,emStrongLDelim:HEt,emStrongRDelimAst:WEt,emStrongRDelimUnd:UEt,escape:OEt,link:e7t,nolink:_Ee,punctuation:BEt,reflink:REe,reflinkSearch:t7t,tag:JEt,text:$Et,url:h1},r7t={...qZ,link:Vn(/^!?\[(label)\]\((.*?)\)/).replace("label",w_).getRegex(),reflink:Vn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w_).getRegex()},GG={...qZ,emStrongRDelimAst:qEt,emStrongLDelim:GEt,delLDelim:YEt,delRDelim:XEt,url:Vn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Zce).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]*?(?:(?=[\\":">",'"':""","'":"'"},Qce=t=>i7t[t];function Yh(t,e){if(e){if(wl.escapeTest.test(t))return t.replace(wl.escapeReplace,Qce)}else if(wl.escapeTestNoEncode.test(t))return t.replace(wl.escapeReplaceNoEncode,Qce);return t}function Jce(t){try{t=encodeURI(t).replace(wl.percentDecode,"%")}catch{return null}return t}function eue(t,e){var s;let r=t.replace(wl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(wl.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 a7t(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 tue(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 o7t(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 T_=class{constructor(e){xr(this,"options");xr(this,"rules");xr(this,"lexer");this.options=e||tv}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:oC(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=a7t(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=oC(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:oC(r[0],` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=o7t(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=oC(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:oC(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=oC(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=s7t(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=a7t(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(` @@ -1271,7 +1271,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+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=eue(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=oC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=i7t(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)),tue(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 tue(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 WG{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||tv,this.options.tokenizer=this.options.tokenizer||new T_,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:wl,block:HA.normal,inline:aC.normal};this.options.pedantic?(r.block=HA.pedantic,r.inline=aC.pedantic):this.options.gfm&&(r.block=HA.gfm,this.options.breaks?r.inline=aC.breaks:r.inline=aC.gfm),this.tokenizer.rules=r}static get rules(){return{block:HA,inline:aC}}static lex(e,r){return new WG(r).lex(e)}static lexInline(e,r){return new WG(r).inlineTokens(e)}lex(e){e=e.replace(wl.carriageReturn,` +`?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=oC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=s7t(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)),tue(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 tue(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 WG{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||tv,this.options.tokenizer=this.options.tokenizer||new T_,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:wl,block:HA.normal,inline:aC.normal};this.options.pedantic?(r.block=HA.pedantic,r.inline=aC.pedantic):this.options.gfm&&(r.block=HA.gfm,this.options.breaks?r.inline=aC.breaks:r.inline=aC.gfm),this.tokenizer.rules=r}static get rules(){return{block:HA,inline:aC}}static lex(e,r){return new WG(r).lex(e)}static lexInline(e,r){return new WG(r).inlineTokens(e)}lex(e){e=e.replace(wl.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(` `)?"":` @@ -1303,67 +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`${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=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 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 C_(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 T_(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 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}}},My=new o7t;function vi(t,e){return My.parse(t,e)}vi.options=vi.setOptions=function(t){return My.setOptions(t),vi.defaults=My.defaults,xEe(vi.defaults),vi};vi.getDefaults=BZ;vi.defaults=tv;vi.use=function(...t){return My.use(...t),vi.defaults=My.defaults,xEe(vi.defaults),vi};vi.walkTokens=function(t,e){return My.walkTokens(t,e)};vi.parseInline=My.parseInline;vi.Parser=ih;vi.parser=ih.parse;vi.Renderer=C_;vi.TextRenderer=UZ;vi.Lexer=nh;vi.lexer=nh.lex;vi.Tokenizer=T_;vi.Hooks=JC;vi.parse=vi;vi.options;vi.setOptions;vi.use;vi.walkTokens;vi.parseInline;ih.parse;nh.lex;const l7t=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function c7t(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(l7t);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function u7t(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=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 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 C_(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 T_(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 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}}},My=new l7t;function vi(t,e){return My.parse(t,e)}vi.options=vi.setOptions=function(t){return My.setOptions(t),vi.defaults=My.defaults,wEe(vi.defaults),vi};vi.getDefaults=BZ;vi.defaults=tv;vi.use=function(...t){return My.use(...t),vi.defaults=My.defaults,wEe(vi.defaults),vi};vi.walkTokens=function(t,e){return My.walkTokens(t,e)};vi.parseInline=My.parseInline;vi.Parser=ih;vi.parser=ih.parse;vi.Renderer=C_;vi.TextRenderer=UZ;vi.Lexer=nh;vi.lexer=nh.lex;vi.Tokenizer=T_;vi.Hooks=JC;vi.parse=vi;vi.options;vi.setOptions;vi.use;vi.walkTokens;vi.parseInline;ih.parse;nh.lex;const c7t=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function u7t(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(c7t);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function h7t(t,e){const r=e.split(` `).flatMap(n=>[n,""]).map(n=>`${t}${n}`).join(` -`);return r.slice(0,r.length-1)}function rue(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&&JT(s.attrs,i.attrs))||r.push(n)}),r}function h7t(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const s=t.get(n);(!s||!JT(s.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function d7t(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&&JT(h.attrs,u.attrs))||o.push(l)}):(i||s)&&o.push(...Array.from(t.keys()).reverse())),o}function f7t(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 p7t(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 hB(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 GA(t,e){return typeof t!="string"?"json":e}const g7t=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"]),m7t=/<\/?([a-zA-Z][\w-]*)/g;function y7t(t){const e=[];let r;for(;(r=m7t.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function v7t(t){const e=t.toLowerCase();return e.includes("-")?!1:!g7t.has(e)}function b7t(t,e){return y7t(t).some(r=>v7t(r)?!e.has(r):!1)}var UG=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,Eb($N(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=Jn(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?c7t(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,` +`);return r.slice(0,r.length-1)}function rue(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&&JT(s.attrs,i.attrs))||r.push(n)}),r}function d7t(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const s=t.get(n);(!s||!JT(s.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function f7t(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&&JT(h.attrs,u.attrs))||o.push(l)}):(i||s)&&o.push(...Array.from(t.keys()).reverse())),o}function p7t(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 g7t(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 hB(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 GA(t,e){return typeof t!="string"?"json":e}const m7t=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"]),y7t=/<\/?([a-zA-Z][\w-]*)/g;function v7t(t){const e=[];let r;for(;(r=y7t.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function b7t(t){const e=t.toLowerCase();return e.includes("-")?!1:!m7t.has(e)}function x7t(t,e){return v7t(t).some(r=>b7t(r)?!e.has(r):!1)}var UG=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,Eb($N(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=Jn(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?u7t(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=>hB(o).isTask),r=t.items.some(o=>!hB(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||[];J0t(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:Aoe(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=Hft(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=LH(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return b7t(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=LH(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(F0t(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:u7t},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=rue(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=rue(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=d7t(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=f7t(s,(v,x)=>this.getMarkClosing(v,x,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":p7t(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&&JT(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=h7t(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&&JT(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 x7t=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)||GA(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)||GA(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)||GA(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 UG({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 UG({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||GA(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)}}),w7t="listItem",nue="textStyle",iue=/^\s*([-+*])\s$/,_Ee=Qn.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(w7t,this.editor.getAttributes(nue)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=t5({find:iue,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=t5({find:iue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(nue),editor:this.editor})),[t]}}),T7t=(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}},C7t=(t,e,r,n)=>{const i=T7t(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},k7t=(t,e,r)=>C7t(t.state,t.view.dispatch,e,r),LEe=(t,e)=>Wi.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>k7t(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),IEe=[[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"]],WA="abcdefghijklmnopqrstuvwxyz",NEe=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function yD(t){let e=t,r="";for(const[n,i]of IEe)for(;e>=n;)r+=i,e-=n;return r}function YZ(t){return yD(t).toUpperCase()}function DEe(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 A7t(t,e){if(t==="numeric")return String(e);switch(t){case"a":return k_(e);case"A":return k_(e).toUpperCase();case"i":return yD(e);case"I":return YZ(e);default:return String(e)}}function M7t(t){var e;if(t.length===0)return!1;const r=(e=vD(t[0]))!==null&&e!==void 0?e:"numeric",n=jZ(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(I7t(t))return{type:"listItem",content:[{type:"paragraph",content:N7t(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)=>Nwe(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 L7t((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[LEe(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)}}}),XZ=(t,e)=>{const{$from:r}=e.selection,n=Ra(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}},PEe=(t,e)=>{const r=XZ(t,e);if(!r)return!1;const[,n]=Yft(e,t,r.$pos.pos+4);return n},D7t=(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))},sue=(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)&&D7t(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)||!Zft(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()},O7t=(t,e)=>{const r=PEe(t,e),n=XZ(t,e);return!n||!r?!1:r>n.depth},P7t=(t,e)=>{const r=PEe(t,e),n=XZ(t,e);return!n||!r?!1:r{if(!u0(t.state,e)||!Kft(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:O7t(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():P7t(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},$7t=(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=jft(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))},$Ee=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&&aue(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&&aue(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&&sue(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&&sue(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&&$7t(t,e,r))return!0;return!1}}}}),YG=new RegExp(`^(\\s*)(${NEe})([.)])\\s+(.*)$`),B7t=/^\s/,E2={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function F7t(t){return YG.test(t.trimStart())}function z7t(t){const e=t.trimStart();return E2.bulletItem.test(e)||F7t(e)||E2.heading.test(e)||E2.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||E2.codeFence.test(e)||E2.blockMath.test(e)}function V7t(t){return Object.values(E2).some(e=>e.test(t))}function H7t(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&&z7t(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function G7t(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||[];ept(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:Aoe(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=Gft(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=LH(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return x7t(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=LH(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(z0t(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:h7t},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=rue(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=rue(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=f7t(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=p7t(s,(v,x)=>this.getMarkClosing(v,x,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":g7t(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&&JT(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=d7t(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&&JT(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 w7t=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)||GA(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)||GA(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)||GA(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 UG({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 UG({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||GA(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)}}),T7t="listItem",nue="textStyle",iue=/^\s*([-+*])\s$/,LEe=Qn.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(T7t,this.editor.getAttributes(nue)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=t5({find:iue,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=t5({find:iue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(nue),editor:this.editor})),[t]}}),C7t=(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}},k7t=(t,e,r,n)=>{const i=C7t(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},S7t=(t,e,r)=>k7t(t.state,t.view.dispatch,e,r),IEe=(t,e)=>Wi.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>S7t(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),NEe=[[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"]],WA="abcdefghijklmnopqrstuvwxyz",DEe=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function yD(t){let e=t,r="";for(const[n,i]of NEe)for(;e>=n;)r+=i,e-=n;return r}function YZ(t){return yD(t).toUpperCase()}function OEe(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 M7t(t,e){if(t==="numeric")return String(e);switch(t){case"a":return k_(e);case"A":return k_(e).toUpperCase();case"i":return yD(e);case"I":return YZ(e);default:return String(e)}}function R7t(t){var e;if(t.length===0)return!1;const r=(e=vD(t[0]))!==null&&e!==void 0?e:"numeric",n=jZ(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(N7t(t))return{type:"listItem",content:[{type:"paragraph",content:D7t(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)=>Dwe(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 I7t((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[IEe(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)}}}),XZ=(t,e)=>{const{$from:r}=e.selection,n=Ra(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}},$Ee=(t,e)=>{const r=XZ(t,e);if(!r)return!1;const[,n]=jft(e,t,r.$pos.pos+4);return n},O7t=(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))},sue=(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)&&O7t(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)||!Qft(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()},P7t=(t,e)=>{const r=$Ee(t,e),n=XZ(t,e);return!n||!r?!1:r>n.depth},$7t=(t,e)=>{const r=$Ee(t,e),n=XZ(t,e);return!n||!r?!1:r{if(!u0(t.state,e)||!Zft(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:P7t(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():$7t(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},B7t=(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=Xft(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))},BEe=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&&aue(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&&aue(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&&sue(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&&sue(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&&B7t(t,e,r))return!0;return!1}}}}),YG=new RegExp(`^(\\s*)(${DEe})([.)])\\s+(.*)$`),F7t=/^\s/,E2={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function z7t(t){return YG.test(t.trimStart())}function V7t(t){const e=t.trimStart();return E2.bulletItem.test(e)||z7t(e)||E2.heading.test(e)||E2.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||E2.codeFence.test(e)||E2.blockMath.test(e)}function H7t(t){return Object.values(E2).some(e=>e.test(t))}function G7t(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&&V7t(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function W7t(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(W7t);if(!i)return null;r.push({marker:i[1],content:i[3]})}return M7t(r.map(n=>n.marker))?{type:"orderedList",attrs:_7t(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function BEe(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(q7t);if(!i)return null;r.push({marker:i[1],content:i[3]})}return R7t(r.map(n=>n.marker))?{type:"orderedList",attrs:L7t(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function FEe(t,e,r){const n=[];let i=0;for(;ie;)f.push(t[d]),d+=1;if(f.length>0){const p=BEe(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 U7t(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 Y7t="listItem",oue="textStyle",lue=/^(\d+)\.\s$/;function cue(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 FEe=Qn.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=cue(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const s=cue(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?U7t(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=FEe(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 Y7t(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 j7t="listItem",oue="textStyle",lue=/^(\d+)\.\s$/;function cue(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 zEe=Qn.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=cue(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const s=cue(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?Y7t(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]=G7t(s);if(a.length===0)return;const l=BEe(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(Y7t,this.editor.getAttributes(oue)).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=q7t(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=t5({find:lue,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=t5({find:lue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(oue)}),joinPredicate:t,editor:this.editor})),[e]}}),j7t=/^\s*(\[([( |x])?\])\s$/,X7t="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",K7t=(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"}`},zEe=Qn.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 Nwe(t,e,n)},addExtensions(){return this.options.nested?[LEe(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=X7t;const u=d=>{const f=K7t(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=QT(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[t5({find:j7t,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),VEe=Qn.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=Moe(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=Moe(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(_Ee.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(OEe.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push($Ee.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(FEe.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(zEe.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(VEe.configure(this.options.taskList)),t}});let jG,XG;if(typeof WeakMap<"u"){let t=new WeakMap;jG=e=>t.get(e),XG=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;jG=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 J7t(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 tAt(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 bD(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=Ry(e.$head)||rAt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function rAt(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 KG(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function nAt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function KZ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function HEe(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 _y(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 GEe(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 l4e(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(KG(n)&&KG(i)&&KZ(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=_y(v,0,m)),y>0&&(v=_y(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(Wa.node(n,n+r.nodeSize,{class:"selectedCell"}))}),zn.create(t.doc,e)}function oAt({$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 lAt({$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 cAt(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&&oAt(n)?s=wr.create(i,n.from):n instanceof wr&&lAt(n)&&(s=wr.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const uAt=new us("fix-tables");function qEe(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=hAt(t,i,s,r))};return e?e.doc!=t.doc&&qEe(e.doc,t.doc,0,n):t.doc.descendants(n),r}function hAt(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;iAt(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;mAt(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=uue(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 due(t,e){const r=qo(t.schema);return TAt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function TAt(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=tAt(n.$from),!i)return!1;s=(a=Ry(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 kAt(t){return function(e,r){if(!Ph(e))return!1;if(r){const n=qo(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}}R6("row",{useDeprecatedLogic:!0});R6("column",{useDeprecatedLogic:!0});const SAt=R6("cell",{useDeprecatedLogic:!0});function EAt(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 qA(t,e){const r=t.selection;if(!(r instanceof zi))return!1;if(e){const n=t.tr,i=qo(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 er(i,0,0))}),n.docChanged&&e(n)}return!0}function MAt(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(_y(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 LAt(t,e,r,n,i,s,a){const o=t.doc.type.schema,l=qo(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 VM(r,n,Xr.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=XEe(i,t,e);if(a==null)return!1;if(t=="horiz")return VM(r,n,Xr.near(r.doc.resolve(s.head+e),e));{const o=r.doc.resolve(a),l=HEe(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),VM(r,n,u)}}}function YA(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=XEe(i,t,e);if(l==null)return!1;a=new zi(r.doc.resolve(l))}const o=HEe(a.$headCell,t,e);return o?VM(r,n,new zi(a.$anchorCell,o)):!1}}function NAt(t,e){const r=t.state.doc,n=Ry(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new zi(n))),!0):!1}function DAt(t,e,r){if(!Ph(t.state))return!1;let n=MAt(r);const i=t.state.selection;if(i instanceof zi){n||(n={width:1,height:1,rows:[Mt.from(ZG(qo(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=_At(n,o.right-o.left,o.bottom-o.top),yue(t.state,t.dispatch,a,o,n),!0}else if(n){const s=bD(t.state),a=s.start(-1);return yue(t.state,t.dispatch,a,Ds.get(s.node(-1)).findCell(s.pos-a),n),!0}else return!1}function OAt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=vue(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=Ry(t.state.selection.$anchor))!=null&&((r=dB(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=dB(t,u);const d=$p.getState(t.state)==null;if(!h||!KZ(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($p,l.pos),t.dispatch(p)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",o),$p.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta($p,-1))}function o(l){const u=l,h=$p.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(vue(t,u.target)!=n&&(d=dB(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 XEe(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 vue(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function dB(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&&Ry(t.state.doc.resolve(n))||Ry(t.state.doc.resolve(i))}var PAt=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")),QG(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,QG(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function QG(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 BAt(-1,!1)},apply(a,o){return o.apply(a)}},props:{attributes:a=>{const o=Dc.getState(a);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,o)=>{FAt(a,o,t,i)},mouseleave:a=>{zAt(a)},mousedown:(a,o)=>{VAt(a,o,e,r)}},decorations:a=>{const o=Dc.getState(a);if(o&&o.activeHandle>-1)return UAt(a,o.activeHandle)},nodeViews:{}}});return s}var BAt=class HM{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(Dc);if(n&&n.setHandle!=null)return new HM(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new HM(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return KG(e.doc.resolve(i))||(i=-1),new HM(i,r.dragging)}return r}};function FAt(t,e,r,n){if(!t.editable)return;const i=Dc.getState(t.state);if(i&&!i.dragging){const s=GAt(e.target);let a=-1;if(s){const{left:o,right:l}=s.getBoundingClientRect();e.clientX-o<=r?a=bue(t,e,"left",r):l-e.clientX<=r&&(a=bue(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}KEe(t,a)}}}function zAt(t){if(!t.editable)return;const e=Dc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&KEe(t,-1)}function VAt(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=Dc.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const o=t.state.doc.nodeAt(a.activeHandle),l=HAt(t,a.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(Dc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",h);const f=Dc.getState(t.state);f!=null&&f.dragging&&(WAt(t,f.activeHandle,xue(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(Dc,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=Dc.getState(t.state);if(f&&f.dragging){const p=xue(f.dragging,d,r);wue(t,f.activeHandle,p,n)}}return wue(t,a.activeHandle,l,n),s.addEventListener("mouseup",u),s.addEventListener("mousemove",h),e.preventDefault(),!0}function HAt(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;ljAt(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function KAt(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 QEe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):KAt(t)}const ZAt=/[ \t\r\n\f]+/g;function JEe(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(ZAt,"")===""}function e7e(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const QAt=Qn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:QEe},align:ZEe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>JEe(t)?{}:!1,getContent:(t,e)=>e7e(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",xn(this.options.HTMLAttributes,t),0]}}),JAt=Qn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:QEe},align:ZEe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>JEe(t)?{}:!1,getContent:(t,e)=>e7e(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",xn(this.options.HTMLAttributes,t),0]}}),e8t=Qn.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 JG(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Tue(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 i8t(t,e,r,n,i){const s=n8t(t),a=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!s8t(e))return!1;let r=0;const n=c6(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 kue(t,e){const r=t.mapping.map(e),n=c6(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 a8t(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 o8t(t){return t.split(` -`).map(e=>!e.includes("|")||!e.includes("`")?e:a8t(e)).join(` -`)}function l8t(t){return(t||"").replace(/\s+/g," ").trim()}function c8t(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=l8t(v.split(i).join(` -`).replace(/[ \t]*\r?\n[ \t]*/g,"
")),b=y.type==="tableHeader",T=XAt(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(j7t,this.editor.getAttributes(oue)).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=U7t(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=t5({find:lue,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=t5({find:lue,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(oue)}),joinPredicate:t,editor:this.editor})),[e]}}),X7t=/^\s*(\[([( |x])?\])\s$/,K7t="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",Z7t=(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"}`},VEe=Qn.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 Dwe(t,e,n)},addExtensions(){return this.options.nested?[IEe(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=K7t;const u=d=>{const f=Z7t(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=QT(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[t5({find:X7t,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),HEe=Qn.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=Moe(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=Moe(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(LEe.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(PEe.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(BEe.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(zEe.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(VEe.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(HEe.configure(this.options.taskList)),t}});let jG,XG;if(typeof WeakMap<"u"){let t=new WeakMap;jG=e=>t.get(e),XG=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;jG=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 eAt(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 rAt(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 bD(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=Ry(e.$head)||nAt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function nAt(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 KG(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function iAt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function KZ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function GEe(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 _y(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 WEe(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 c4e(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(KG(n)&&KG(i)&&KZ(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=_y(v,0,m)),y>0&&(v=_y(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(Wa.node(n,n+r.nodeSize,{class:"selectedCell"}))}),zn.create(t.doc,e)}function lAt({$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 cAt({$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 uAt(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&&lAt(n)?s=wr.create(i,n.from):n instanceof wr&&cAt(n)&&(s=wr.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const hAt=new us("fix-tables");function UEe(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=dAt(t,i,s,r))};return e?e.doc!=t.doc&&UEe(e.doc,t.doc,0,n):t.doc.descendants(n),r}function dAt(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;sAt(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;yAt(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=uue(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 due(t,e){const r=qo(t.schema);return CAt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function CAt(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=rAt(n.$from),!i)return!1;s=(a=Ry(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 SAt(t){return function(e,r){if(!Ph(e))return!1;if(r){const n=qo(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}}R6("row",{useDeprecatedLogic:!0});R6("column",{useDeprecatedLogic:!0});const EAt=R6("cell",{useDeprecatedLogic:!0});function AAt(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 qA(t,e){const r=t.selection;if(!(r instanceof zi))return!1;if(e){const n=t.tr,i=qo(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 er(i,0,0))}),n.docChanged&&e(n)}return!0}function RAt(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(_y(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 IAt(t,e,r,n,i,s,a){const o=t.doc.type.schema,l=qo(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 VM(r,n,Xr.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=KEe(i,t,e);if(a==null)return!1;if(t=="horiz")return VM(r,n,Xr.near(r.doc.resolve(s.head+e),e));{const o=r.doc.resolve(a),l=GEe(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),VM(r,n,u)}}}function YA(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=KEe(i,t,e);if(l==null)return!1;a=new zi(r.doc.resolve(l))}const o=GEe(a.$headCell,t,e);return o?VM(r,n,new zi(a.$anchorCell,o)):!1}}function DAt(t,e){const r=t.state.doc,n=Ry(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new zi(n))),!0):!1}function OAt(t,e,r){if(!Ph(t.state))return!1;let n=RAt(r);const i=t.state.selection;if(i instanceof zi){n||(n={width:1,height:1,rows:[Mt.from(ZG(qo(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=LAt(n,o.right-o.left,o.bottom-o.top),yue(t.state,t.dispatch,a,o,n),!0}else if(n){const s=bD(t.state),a=s.start(-1);return yue(t.state,t.dispatch,a,Ds.get(s.node(-1)).findCell(s.pos-a),n),!0}else return!1}function PAt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=vue(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=Ry(t.state.selection.$anchor))!=null&&((r=dB(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=dB(t,u);const d=$p.getState(t.state)==null;if(!h||!KZ(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($p,l.pos),t.dispatch(p)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",o),$p.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta($p,-1))}function o(l){const u=l,h=$p.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(vue(t,u.target)!=n&&(d=dB(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 KEe(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 vue(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function dB(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&&Ry(t.state.doc.resolve(n))||Ry(t.state.doc.resolve(i))}var $At=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")),QG(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,QG(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function QG(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 FAt(-1,!1)},apply(a,o){return o.apply(a)}},props:{attributes:a=>{const o=Dc.getState(a);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,o)=>{zAt(a,o,t,i)},mouseleave:a=>{VAt(a)},mousedown:(a,o)=>{HAt(a,o,e,r)}},decorations:a=>{const o=Dc.getState(a);if(o&&o.activeHandle>-1)return YAt(a,o.activeHandle)},nodeViews:{}}});return s}var FAt=class HM{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(Dc);if(n&&n.setHandle!=null)return new HM(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new HM(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return KG(e.doc.resolve(i))||(i=-1),new HM(i,r.dragging)}return r}};function zAt(t,e,r,n){if(!t.editable)return;const i=Dc.getState(t.state);if(i&&!i.dragging){const s=WAt(e.target);let a=-1;if(s){const{left:o,right:l}=s.getBoundingClientRect();e.clientX-o<=r?a=bue(t,e,"left",r):l-e.clientX<=r&&(a=bue(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}ZEe(t,a)}}}function VAt(t){if(!t.editable)return;const e=Dc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&ZEe(t,-1)}function HAt(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=Dc.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const o=t.state.doc.nodeAt(a.activeHandle),l=GAt(t,a.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(Dc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",h);const f=Dc.getState(t.state);f!=null&&f.dragging&&(qAt(t,f.activeHandle,xue(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(Dc,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=Dc.getState(t.state);if(f&&f.dragging){const p=xue(f.dragging,d,r);wue(t,f.activeHandle,p,n)}}return wue(t,a.activeHandle,l,n),s.addEventListener("mouseup",u),s.addEventListener("mousemove",h),e.preventDefault(),!0}function GAt(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;lXAt(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function ZAt(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 JEe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):ZAt(t)}const QAt=/[ \t\r\n\f]+/g;function e7e(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(QAt,"")===""}function t7e(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const JAt=Qn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:JEe},align:QEe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>e7e(t)?{}:!1,getContent:(t,e)=>t7e(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",xn(this.options.HTMLAttributes,t),0]}}),e8t=Qn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:JEe},align:QEe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>e7e(t)?{}:!1,getContent:(t,e)=>t7e(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",xn(this.options.HTMLAttributes,t),0]}}),t8t=Qn.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 JG(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Tue(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 s8t(t,e,r,n,i){const s=i8t(t),a=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!a8t(e))return!1;let r=0;const n=c6(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 kue(t,e){const r=t.mapping.map(e),n=c6(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 o8t(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 l8t(t){return t.split(` +`).map(e=>!e.includes("|")||!e.includes("`")?e:o8t(e)).join(` +`)}function c8t(t){return(t||"").replace(/\s+/g," ").trim()}function u8t(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=c8t(v.split(i).join(` +`).replace(/[ \t]*\r?\n[ \t]*/g,"
")),b=y.type==="tableHeader",T=KAt(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 u8t=Qn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:t8t,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}=r8t(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=S_((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=S_((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)=>c8t(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(` +`}),f}const h8t=Qn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:r8t,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}=n8t(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=S_((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=S_((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)=>u8t(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=o8t(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=l8t(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=i8t(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})=>dAt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>fAt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=c6(t.selection.$from,n=>n.type.name==="table");return gAt(t,e&&(n=>{r&&kue(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>yAt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>vAt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=c6(t.selection.$from,n=>n.type.name==="table");return xAt(t,e&&(n=>{r&&kue(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>AAt(t,e),mergeCells:()=>({state:t,dispatch:e})=>hue(t,e),splitCell:()=>({state:t,dispatch:e})=>due(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>R6("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>R6("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>SAt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>hue(t,e)?!0:due(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>CAt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>pue(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>pue(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&UEe(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:jA,"Mod-Backspace":jA,Delete:jA,"Mod-Delete":jA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[$At({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],YAt({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:Jn(gr(t,"tableRole",e))}}}),Sue=Wi.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(u8t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(QAt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(JAt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(e8t.configure(this.options.tableRow)),t}}),t7e=new WeakSet,r7e=new WeakSet;function Rm(t){const e=t;return t7e.add(e),e}function eW(t){return Array.isArray(t)&&t7e.has(t)}function n7e(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&r7e.has(e)&&!eW(e)?n7e(e):[e])}function h8t(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!eW(i)&&!r7e.has(i)?Rm(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(eW(r))return Rm([t,n,r]);if(r.length===0)return Rm([t,n]);const i=n7e(r);return i.length===0?Rm([t,n]):Rm([t,n,...i])}return r!=null?Rm([t,n,r]):Rm([t,n])}const E_=(t,e)=>h8t(t,e),d8t=(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 er(p,0,0);return d.replace(h,s.after(),g),d.setSelection(wr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},f8t=/^\s*>\s$/,p8t=Qn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return E_("blockquote",{...xn(this.options.HTMLAttributes,t),children:E_("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=s8t(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})=>fAt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>pAt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=c6(t.selection.$from,n=>n.type.name==="table");return mAt(t,e&&(n=>{r&&kue(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>vAt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>bAt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=c6(t.selection.$from,n=>n.type.name==="table");return wAt(t,e&&(n=>{r&&kue(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>MAt(t,e),mergeCells:()=>({state:t,dispatch:e})=>hue(t,e),splitCell:()=>({state:t,dispatch:e})=>due(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>R6("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>R6("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>EAt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>hue(t,e)?!0:due(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>kAt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>pue(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>pue(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&YEe(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:jA,"Mod-Backspace":jA,Delete:jA,"Mod-Delete":jA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BAt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],jAt({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:Jn(gr(t,"tableRole",e))}}}),Sue=Wi.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(h8t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(JAt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(e8t.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(t8t.configure(this.options.tableRow)),t}}),r7e=new WeakSet,n7e=new WeakSet;function Rm(t){const e=t;return r7e.add(e),e}function eW(t){return Array.isArray(t)&&r7e.has(t)}function i7e(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&n7e.has(e)&&!eW(e)?i7e(e):[e])}function d8t(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!eW(i)&&!n7e.has(i)?Rm(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(eW(r))return Rm([t,n,r]);if(r.length===0)return Rm([t,n]);const i=i7e(r);return i.length===0?Rm([t,n]):Rm([t,n,...i])}return r!=null?Rm([t,n,r]):Rm([t,n])}const E_=(t,e)=>d8t(t,e),f8t=(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 er(p,0,0);return d.replace(h,s.after(),g),d.setSelection(wr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},p8t=/^\s*>\s$/,g8t=Qn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return E_("blockquote",{...xn(this.options.HTMLAttributes,t),children:E_("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:()=>d8t(this.editor,this.type)}},addInputRules(){return[t5({find:f8t,type:this.type})]}}),g8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,m8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,y8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,v8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,b8t=Zg.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 E_("strong",{...xn(this.options.HTMLAttributes,t),children:E_("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[yy({find:g8t,type:this.type}),yy({find:y8t,type:this.type})]},addPasteRules(){return[mg({find:m8t,type:this.type}),mg({find:v8t,type:this.type})]}}),x8t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},w8t=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},T8t=Zg.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[yy({find:x8t,type:this.type})]},addPasteRules(){return[mg({find:w8t,type:this.type})]}}),C8t=Qn.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:()=>f8t(this.editor,this.type)}},addInputRules(){return[t5({find:p8t,type:this.type})]}}),m8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,y8t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,v8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,b8t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,x8t=Zg.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 E_("strong",{...xn(this.options.HTMLAttributes,t),children:E_("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[yy({find:m8t,type:this.type}),yy({find:v8t,type:this.type})]},addPasteRules(){return[mg({find:y8t,type:this.type}),mg({find:b8t,type:this.type})]}}),w8t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},T8t=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},C8t=Zg.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[yy({find:w8t,type:this.type})]},addPasteRules(){return[mg({find:T8t,type:this.type})]}}),k8t=Qn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):""}),k8t=Qn.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` +`):""}),S8t=Qn.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()}}}),S8t=Qn.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=>DH({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),E8t=Qn.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(!$0t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return kwe(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[Bwe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),A8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,M8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,R8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,L8t=Zg.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[yy({find:A8t,type:this.type}),yy({find:R8t,type:this.type})]},addPasteRules(){return[mg({find:M8t,type:this.type}),mg({find:_8t,type:this.type})]}}),I8t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",N8t="ελ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",tW="numeric",rW="ascii",nW="alpha",rS="asciinumeric",ek="alphanumeric",iW="domain",i7e="emoji",D8t="scheme",O8t="slashscheme",fB="whitespace";function P8t(t,e){return t in e||(e[t]=[]),e[t]}function B1(t,e,r){e[tW]&&(e[rS]=!0,e[ek]=!0),e[rW]&&(e[rS]=!0,e[nW]=!0),e[rS]&&(e[ek]=!0),e[nW]&&(e[ek]=!0),e[ek]&&(e[iW]=!0),e[i7e]&&(e[iW]=!0);for(const n in e){const i=P8t(n,r);i.indexOf(t)<0&&i.push(t)}}function $8t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function ac(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ac.groups={};ac.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),Eue=(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",sW="UWORD",s7e="ASCIINUMERICAL",a7e="ALPHANUMERICAL",_6="LOCALHOST",aW="TLD",oW="UTLD",GM="SCHEME",A2="SLASH_SCHEME",ZZ="NUM",lW="WS",QZ="NL",nS="OPENBRACE",iS="CLOSEBRACE",A_="OPENBRACKET",M_="CLOSEBRACKET",R_="OPENPAREN",__="CLOSEPAREN",L_="OPENANGLEBRACKET",I_="CLOSEANGLEBRACKET",N_="FULLWIDTHLEFTPAREN",D_="FULLWIDTHRIGHTPAREN",O_="LEFTCORNERBRACKET",P_="RIGHTCORNERBRACKET",$_="LEFTWHITECORNERBRACKET",B_="RIGHTWHITECORNERBRACKET",F_="FULLWIDTHLESSTHAN",z_="FULLWIDTHGREATERTHAN",V_="AMPERSAND",H_="APOSTROPHE",G_="ASTERISK",Ep="AT",W_="BACKSLASH",q_="BACKTICK",U_="CARET",F1="COLON",JZ="COMMA",Y_="DOLLAR",Qh="DOT",j_="EQUALS",eQ="EXCLAMATION",lu="HYPHEN",sS="PERCENT",X_="PIPE",K_="PLUS",Z_="POUND",aS="QUERY",tQ="QUOTE",o7e="FULLWIDTHMIDDLEDOT",rQ="SEMI",Jh="SLASH",oS="TILDE",Q_="UNDERSCORE",l7e="EMOJI",J_="SYM";var c7e=Object.freeze({__proto__:null,ALPHANUMERICAL:a7e,AMPERSAND:V_,APOSTROPHE:H_,ASCIINUMERICAL:s7e,ASTERISK:G_,AT:Ep,BACKSLASH:W_,BACKTICK:q_,CARET:U_,CLOSEANGLEBRACKET:I_,CLOSEBRACE:iS,CLOSEBRACKET:M_,CLOSEPAREN:__,COLON:F1,COMMA:JZ,DOLLAR:Y_,DOT:Qh,EMOJI:l7e,EQUALS:j_,EXCLAMATION:eQ,FULLWIDTHGREATERTHAN:z_,FULLWIDTHLEFTPAREN:N_,FULLWIDTHLESSTHAN:F_,FULLWIDTHMIDDLEDOT:o7e,FULLWIDTHRIGHTPAREN:D_,HYPHEN:lu,LEFTCORNERBRACKET:O_,LEFTWHITECORNERBRACKET:$_,LOCALHOST:_6,NL:QZ,NUM:ZZ,OPENANGLEBRACKET:L_,OPENBRACE:nS,OPENBRACKET:A_,OPENPAREN:R_,PERCENT:sS,PIPE:X_,PLUS:K_,POUND:Z_,QUERY:aS,QUOTE:tQ,RIGHTCORNERBRACKET:P_,RIGHTWHITECORNERBRACKET:B_,SCHEME:GM,SEMI:rQ,SLASH:Jh,SLASH_SCHEME:A2,SYM:J_,TILDE:oS,TLD:aW,UNDERSCORE:Q_,UTLD:oW,UWORD:sW,WORD:Cf,WS:lW});const uf=/[a-z]/,lC=new RegExp("\\p{L}","u"),pB=new RegExp("\\p{Emoji}","u"),hf=/\d/,gB=/\s/,Aue="\r",mB=` -`,B8t="️",F8t="‍",yB="";let XA=null,KA=null;function z8t(t=[]){const e={};ac.groups=e;const r=new ac;XA==null&&(XA=Mue(I8t)),KA==null&&(KA=Mue(N8t)),Wt(r,"'",H_),Wt(r,"{",nS),Wt(r,"}",iS),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,">",z_),Wt(r,"&",V_),Wt(r,"*",G_),Wt(r,"@",Ep),Wt(r,"`",q_),Wt(r,"^",U_),Wt(r,":",F1),Wt(r,",",JZ),Wt(r,"$",Y_),Wt(r,".",Qh),Wt(r,"=",j_),Wt(r,"!",eQ),Wt(r,"-",lu),Wt(r,"%",sS),Wt(r,"|",X_),Wt(r,"+",K_),Wt(r,"#",Z_),Wt(r,"?",aS),Wt(r,'"',tQ),Wt(r,"/",Jh),Wt(r,";",rQ),Wt(r,"~",oS),Wt(r,"_",Q_),Wt(r,"\\",W_),Wt(r,"・",o7e);const n=Ms(r,hf,ZZ,{[tW]:!0});Ms(n,hf,n);const i=Ms(n,uf,s7e,{[rS]:!0}),s=Ms(n,lC,a7e,{[ek]:!0}),a=Ms(r,uf,Cf,{[rW]:!0});Ms(a,hf,i),Ms(a,uf,a),Ms(i,hf,i),Ms(i,uf,i);const o=Ms(r,lC,sW,{[nW]:!0});Ms(o,uf),Ms(o,hf,s),Ms(o,lC,o),Ms(s,hf,s),Ms(s,uf),Ms(s,lC,s);const l=Wt(r,mB,QZ,{[fB]:!0}),u=Wt(r,Aue,lW,{[fB]:!0}),h=Ms(r,gB,lW,{[fB]:!0});Wt(r,yB,h),Wt(u,mB,l),Wt(u,yB,h),Ms(u,gB,h),Wt(h,Aue),Wt(h,mB),Ms(h,gB,h),Wt(h,yB,h);const d=Ms(r,pB,l7e,{[i7e]:!0});Wt(d,"#"),Ms(d,pB,d),Wt(d,B8t,d);const f=Wt(d,F8t);Wt(f,"#"),Ms(f,pB,d);const p=[[uf,a],[hf,i]],g=[[uf,null],[lC,o],[hf,s]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?x[iW]=!0:uf.test(y)?hf.test(y)?x[rS]=!0:x[rW]=!0:x[tW]=!0,Eue(r,y,y,x)}return Eue(r,"localhost",_6,{ascii:!0}),r.jd=new ac(J_),{start:r,tokens:Object.assign({groups:e},c7e)}}function u7e(t,e){const r=V8t(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 V8t(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 L6={defaultProtocol:"http",events:null,format:Rue,formatHref:Rue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function nQ(t,e=null){let r=Object.assign({},L6);t&&(r=Object.assign(r,t instanceof nQ?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=L6.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 xD(t,e){class r extends h7e{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 H8t=xD("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_ue=xD("text"),G8t=xD("nl"),ZA=xD("url",{isLink:!0,toHref(t=L6.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_6&&t[1].t===F1}}),nu=t=>new ac(t);function W8t({groups:t}){const e=t.domain.concat([V_,G_,Ep,W_,q_,U_,Y_,j_,lu,ZZ,sS,X_,K_,Z_,Jh,J_,oS,Q_]),r=[H_,F1,JZ,Qh,eQ,sS,aS,tQ,rQ,L_,I_,nS,iS,M_,A_,R_,__,N_,D_,O_,P_,$_,B_,F_,z_],n=[V_,H_,G_,W_,q_,U_,Y_,j_,lu,nS,iS,sS,X_,K_,Z_,aS,Jh,J_,oS,Q_],i=nu(),s=Wt(i,oS);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,Ep);Wt(s,Ep,u),Wt(o,Ep,u),Wt(l,Ep,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(H8t);Tn(f,t.tld,p),Tn(f,t.utld,p),Wt(u,_6,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(ZA);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,Ep,u);const x=Wt(v,F1),b=nu(ZA);Tn(x,t.numeric,b);const T=nu(ZA),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,F1),k=Wt(l,F1),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,aS,T),Tn(A,t.domain,T),Tn(A,e,T),Wt(A,Jh,T);const R=[[nS,iS],[A_,M_],[R_,__],[L_,I_],[N_,D_],[O_,P_],[$_,B_],[F_,z_]];for(let _=0;_=0&&f++,i++,h++;if(f<0)i-=h,i0&&(s.push(vB(_ue,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(vB(p,e,g))}}return a.length>0&&s.push(vB(_ue,e,a)),s}function vB(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 U8t=typeof console<"u"&&console&&console.warn||(()=>{}),Y8t="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 j8t(){return ac.groups={},Xi.scanner=null,Xi.parser=null,Xi.tokenQueue=[],Xi.pluginQueue=[],Xi.customSchemes=[],Xi.initialized=!1,Xi}function Lue(t,e=!1){if(Xi.initialized&&U8t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Y8t}`),!/^[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()}}}),E8t=Qn.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=>DH({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),A8t=Qn.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(!B0t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return Swe(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[Fwe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),M8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,R8t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,L8t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,I8t=Zg.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[yy({find:M8t,type:this.type}),yy({find:_8t,type:this.type})]},addPasteRules(){return[mg({find:R8t,type:this.type}),mg({find:L8t,type:this.type})]}}),N8t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",D8t="ελ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",tW="numeric",rW="ascii",nW="alpha",rS="asciinumeric",ek="alphanumeric",iW="domain",s7e="emoji",O8t="scheme",P8t="slashscheme",fB="whitespace";function $8t(t,e){return t in e||(e[t]=[]),e[t]}function B1(t,e,r){e[tW]&&(e[rS]=!0,e[ek]=!0),e[rW]&&(e[rS]=!0,e[nW]=!0),e[rS]&&(e[ek]=!0),e[nW]&&(e[ek]=!0),e[ek]&&(e[iW]=!0),e[s7e]&&(e[iW]=!0);for(const n in e){const i=$8t(n,r);i.indexOf(t)<0&&i.push(t)}}function B8t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function ac(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ac.groups={};ac.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),Eue=(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",sW="UWORD",a7e="ASCIINUMERICAL",o7e="ALPHANUMERICAL",_6="LOCALHOST",aW="TLD",oW="UTLD",GM="SCHEME",A2="SLASH_SCHEME",ZZ="NUM",lW="WS",QZ="NL",nS="OPENBRACE",iS="CLOSEBRACE",A_="OPENBRACKET",M_="CLOSEBRACKET",R_="OPENPAREN",__="CLOSEPAREN",L_="OPENANGLEBRACKET",I_="CLOSEANGLEBRACKET",N_="FULLWIDTHLEFTPAREN",D_="FULLWIDTHRIGHTPAREN",O_="LEFTCORNERBRACKET",P_="RIGHTCORNERBRACKET",$_="LEFTWHITECORNERBRACKET",B_="RIGHTWHITECORNERBRACKET",F_="FULLWIDTHLESSTHAN",z_="FULLWIDTHGREATERTHAN",V_="AMPERSAND",H_="APOSTROPHE",G_="ASTERISK",Ep="AT",W_="BACKSLASH",q_="BACKTICK",U_="CARET",F1="COLON",JZ="COMMA",Y_="DOLLAR",Qh="DOT",j_="EQUALS",eQ="EXCLAMATION",lu="HYPHEN",sS="PERCENT",X_="PIPE",K_="PLUS",Z_="POUND",aS="QUERY",tQ="QUOTE",l7e="FULLWIDTHMIDDLEDOT",rQ="SEMI",Jh="SLASH",oS="TILDE",Q_="UNDERSCORE",c7e="EMOJI",J_="SYM";var u7e=Object.freeze({__proto__:null,ALPHANUMERICAL:o7e,AMPERSAND:V_,APOSTROPHE:H_,ASCIINUMERICAL:a7e,ASTERISK:G_,AT:Ep,BACKSLASH:W_,BACKTICK:q_,CARET:U_,CLOSEANGLEBRACKET:I_,CLOSEBRACE:iS,CLOSEBRACKET:M_,CLOSEPAREN:__,COLON:F1,COMMA:JZ,DOLLAR:Y_,DOT:Qh,EMOJI:c7e,EQUALS:j_,EXCLAMATION:eQ,FULLWIDTHGREATERTHAN:z_,FULLWIDTHLEFTPAREN:N_,FULLWIDTHLESSTHAN:F_,FULLWIDTHMIDDLEDOT:l7e,FULLWIDTHRIGHTPAREN:D_,HYPHEN:lu,LEFTCORNERBRACKET:O_,LEFTWHITECORNERBRACKET:$_,LOCALHOST:_6,NL:QZ,NUM:ZZ,OPENANGLEBRACKET:L_,OPENBRACE:nS,OPENBRACKET:A_,OPENPAREN:R_,PERCENT:sS,PIPE:X_,PLUS:K_,POUND:Z_,QUERY:aS,QUOTE:tQ,RIGHTCORNERBRACKET:P_,RIGHTWHITECORNERBRACKET:B_,SCHEME:GM,SEMI:rQ,SLASH:Jh,SLASH_SCHEME:A2,SYM:J_,TILDE:oS,TLD:aW,UNDERSCORE:Q_,UTLD:oW,UWORD:sW,WORD:Cf,WS:lW});const uf=/[a-z]/,lC=new RegExp("\\p{L}","u"),pB=new RegExp("\\p{Emoji}","u"),hf=/\d/,gB=/\s/,Aue="\r",mB=` +`,F8t="️",z8t="‍",yB="";let XA=null,KA=null;function V8t(t=[]){const e={};ac.groups=e;const r=new ac;XA==null&&(XA=Mue(N8t)),KA==null&&(KA=Mue(D8t)),Wt(r,"'",H_),Wt(r,"{",nS),Wt(r,"}",iS),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,">",z_),Wt(r,"&",V_),Wt(r,"*",G_),Wt(r,"@",Ep),Wt(r,"`",q_),Wt(r,"^",U_),Wt(r,":",F1),Wt(r,",",JZ),Wt(r,"$",Y_),Wt(r,".",Qh),Wt(r,"=",j_),Wt(r,"!",eQ),Wt(r,"-",lu),Wt(r,"%",sS),Wt(r,"|",X_),Wt(r,"+",K_),Wt(r,"#",Z_),Wt(r,"?",aS),Wt(r,'"',tQ),Wt(r,"/",Jh),Wt(r,";",rQ),Wt(r,"~",oS),Wt(r,"_",Q_),Wt(r,"\\",W_),Wt(r,"・",l7e);const n=Ms(r,hf,ZZ,{[tW]:!0});Ms(n,hf,n);const i=Ms(n,uf,a7e,{[rS]:!0}),s=Ms(n,lC,o7e,{[ek]:!0}),a=Ms(r,uf,Cf,{[rW]:!0});Ms(a,hf,i),Ms(a,uf,a),Ms(i,hf,i),Ms(i,uf,i);const o=Ms(r,lC,sW,{[nW]:!0});Ms(o,uf),Ms(o,hf,s),Ms(o,lC,o),Ms(s,hf,s),Ms(s,uf),Ms(s,lC,s);const l=Wt(r,mB,QZ,{[fB]:!0}),u=Wt(r,Aue,lW,{[fB]:!0}),h=Ms(r,gB,lW,{[fB]:!0});Wt(r,yB,h),Wt(u,mB,l),Wt(u,yB,h),Ms(u,gB,h),Wt(h,Aue),Wt(h,mB),Ms(h,gB,h),Wt(h,yB,h);const d=Ms(r,pB,c7e,{[s7e]:!0});Wt(d,"#"),Ms(d,pB,d),Wt(d,F8t,d);const f=Wt(d,z8t);Wt(f,"#"),Ms(f,pB,d);const p=[[uf,a],[hf,i]],g=[[uf,null],[lC,o],[hf,s]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?x[iW]=!0:uf.test(y)?hf.test(y)?x[rS]=!0:x[rW]=!0:x[tW]=!0,Eue(r,y,y,x)}return Eue(r,"localhost",_6,{ascii:!0}),r.jd=new ac(J_),{start:r,tokens:Object.assign({groups:e},u7e)}}function h7e(t,e){const r=H8t(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 H8t(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 L6={defaultProtocol:"http",events:null,format:Rue,formatHref:Rue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function nQ(t,e=null){let r=Object.assign({},L6);t&&(r=Object.assign(r,t instanceof nQ?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=L6.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 xD(t,e){class r extends d7e{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 G8t=xD("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_ue=xD("text"),W8t=xD("nl"),ZA=xD("url",{isLink:!0,toHref(t=L6.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_6&&t[1].t===F1}}),nu=t=>new ac(t);function q8t({groups:t}){const e=t.domain.concat([V_,G_,Ep,W_,q_,U_,Y_,j_,lu,ZZ,sS,X_,K_,Z_,Jh,J_,oS,Q_]),r=[H_,F1,JZ,Qh,eQ,sS,aS,tQ,rQ,L_,I_,nS,iS,M_,A_,R_,__,N_,D_,O_,P_,$_,B_,F_,z_],n=[V_,H_,G_,W_,q_,U_,Y_,j_,lu,nS,iS,sS,X_,K_,Z_,aS,Jh,J_,oS,Q_],i=nu(),s=Wt(i,oS);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,Ep);Wt(s,Ep,u),Wt(o,Ep,u),Wt(l,Ep,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(G8t);Tn(f,t.tld,p),Tn(f,t.utld,p),Wt(u,_6,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(ZA);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,Ep,u);const x=Wt(v,F1),b=nu(ZA);Tn(x,t.numeric,b);const T=nu(ZA),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,F1),k=Wt(l,F1),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,aS,T),Tn(A,t.domain,T),Tn(A,e,T),Wt(A,Jh,T);const R=[[nS,iS],[A_,M_],[R_,__],[L_,I_],[N_,D_],[O_,P_],[$_,B_],[F_,z_]];for(let _=0;_=0&&f++,i++,h++;if(f<0)i-=h,i0&&(s.push(vB(_ue,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(vB(p,e,g))}}return a.length>0&&s.push(vB(_ue,e,a)),s}function vB(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 Y8t=typeof console<"u"&&console&&console.warn||(()=>{}),j8t="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 X8t(){return ac.groups={},Xi.scanner=null,Xi.parser=null,Xi.tokenQueue=[],Xi.pluginQueue=[],Xi.customSchemes=[],Xi.initialized=!1,Xi}function Lue(t,e=!1){if(Xi.initialized&&Y8t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${j8t}`),!/^[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 X8t(){Xi.scanner=z8t(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=mwe(r.doc,[...e]);if(BN(o).forEach(({newRange:l})=>{const u=$ft(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(!Z8t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(K8t).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=iQ(p).map(y=>y.toObject(t.defaultProtocol));if(!J8t(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=>{yK(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 tMt(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=Twe(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 rMt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,nMt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function f7e(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function iMt(t,e){let r=0,n=0;for(;n0}function p7e(t,e,r){var n,i;const[,s,a]=e;return(e.index?t[e.index-1]:void 0)==="!"||f7e(t,(n=e.index)!==null&&n!==void 0?n:0)||iMt(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&r(a)}function g7e(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 sMt(t,e){return t.index{const n=rMt.exec(r);return!n||!p7e(r,n,t.isAllowedHref)?null:g7e(n)},type:t.type,getAttributes:m7e});return new jy({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 oMt(t){const e=mg({find:r=>{var n,i;const s=[];for(const o of r.matchAll(nMt))p7e(r,o,t.isAllowedHref)&&s.push(g7e(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=>sMt(l,o)));return[...s,...a]},type:t.type,getAttributes:m7e});return new Pwe({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 lMt(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=d7e(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(Q8t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const y7e=Zg.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"){Lue(t);return}Lue(t.scheme,t.optionalSlashes)})},onDestroy(){j8t()},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?[aMt({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;d7e(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?[oMt({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})]:[mg({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(eMt({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(tMt({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(lMt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var cMt=y7e;const QA=" ",bB=" ",uMt=Qn.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===QA||r[0].text===QA||r[0].raw===bB||r[0].text===bB)&&n.length===1&&n[0].type==="text"&&(n[0].text===QA||n[0].text===bB)?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?QA:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),hMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,dMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,fMt=Zg.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[yy({find:hMt,type:this.type})]},addPasteRules(){return[mg({find:dMt,type:this.type})]}}),pMt=Qn.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),gMt=Zg.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()}}}),mMt=Wi.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(b8t.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(p8t.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(_Ee.configure(this.options.bulletList)),this.options.code!==!1&&t.push(T8t.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(Qwe.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(C8t.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(Wpt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(qpt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(k8t.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(S8t.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(agt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(E8t.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(L8t.configure(this.options.italic)),this.options.listItem!==!1&&t.push(OEe.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push($Ee.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(y7e.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(FEe.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(uMt.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(fMt.configure(this.options.strike)),this.options.text!==!1&&t.push(pMt.configure(this.options.text)),this.options.underline!==!1){var n;t.push(gMt.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(sgt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var xB=mMt;const eL=(t,e)=>{const r=e.view.domAtPos(t).node,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;return n?n.offsetParent!==null:!1},yMt=(t,e,r)=>{for(let n=t.depth;n>0;n-=1){const i=t.node(n),s=e(i),a=eL(t.start(n),r);if(s&&a)return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}},Iue=(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=Yy(y=>y.type===s.nodes.details)(a);if(!h)return!1;const d=TM(h.node,y=>y.type===s.nodes.detailsContent);if(!d.length||eL(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},vMt=Qn.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]},...bK({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=Yy(m=>m.type===this.type)(r);if(!i)return!1;const s=TM(i.node,m=>m.type===n.nodes.detailsSummary),a=TM(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=eL(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=ON(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})=>Iue(t,"right"),ArrowDown:({editor:t})=>Iue(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||!Cwe(r,i.name))return;const{$from:s}=r.selection;if(eL(s.pos,n))return;const a=yMt(s,d=>d.type===i,n);if(!a)return;const o=TM(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=Yy(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=ON(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}}},...bK({nodeName:"detailsContent"})}),xMt=Qn.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]},...bK({nodeName:"detailsSummary",content:"inline"})}),aQ=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},wMt={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"},TMt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:wMt[aQ(e)]??null},CMt={m4v:"video/mp4",mov:"video/quicktime",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},oQ=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("video/")?r:CMt[aQ(e)]??null},ry=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=aQ(e);return r.startsWith("image/")?"image":TMt(r,e)?"audio":oQ(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("android.package-archive")||r.includes("application/x-msdownload")||r.includes("application/x-msi")||r.includes("application/x-apple-diskimage")||r.includes("application/x-debian-package")||r.includes("application/x-redhat-package-manager")||r.includes("application/x-executable")||["apk","xapk","apks","aab","ipa","exe","msi","dmg","pkg","deb","rpm","appimage"].includes(n)?"executable":r.includes("epub")||r.includes("mobipocket")||["epub","mobi","azw","azw3","fb2","djvu"].includes(n)?"book":r.startsWith("font/")||r.includes("font")||["ttf","otf","woff","woff2","eot"].includes(n)?"font":r.includes("iso9660")||["iso","img","vmdk","qcow2","vdi"].includes(n)?"diskimage":r.includes("sqlite")||["sqlite","sqlite3","db","db3"].includes(n)?"database":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","scss","less","sh","bash","zsh","py","java","go","rs","c","cpp","h","hpp","cs","swift","kt","kts","rb","php","lua","sql","toml","ini","conf","env"].includes(n)?"code":r.startsWith("text/")||["txt","md","log"].includes(n)?"text":"file"},kMt=/\/api\/v1\/resources\/([^/]+)\/blob(?:$|[?#])/,SMt=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(kMt);return r!=null&&r[1]?decodeURIComponent(r[1]):null}catch{return null}},lQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),EMt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",text:"TXT",executable:"PKG",book:"BOOK",font:"FONT",diskimage:"ISO",database:"DB",file:"FILE"},wg=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},AMt=t=>{const e=wg(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]}`},MMt=(t,e)=>EMt[ry(t,e)],RMt=(t,e,r)=>[MMt(t,e),AMt(r)].filter(Boolean).join(" · "),Wf="edgeeverFileAttachment",Nue=t=>t==="compact"?"compact":"inline",_Mt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,LMt=/^\s*(?:附件[::]|Attachment:)\s*/i,IMt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,NMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),DMt=(t,e)=>{const r=lQ(t)||t||e;return ry(null,r)==="pdf"||ry(null,e)==="pdf"?!1:LMt.test(t)||IMt.test(e)||ry(null,r)!=="file"},OMt=Qn.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=>wg(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=wg(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}},displayMode:{default:"inline",parseHTML:t=>Nue(t.getAttribute("data-file-display-mode")),renderHTML:t=>{const e=Nue(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:lQ(e),mimeType:"",byteSize:null,displayMode:"inline"}}},renderMarkdown:t=>{var e,r;return`[${NMt(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=_Mt.exec(t);if(!(!e||!DMt(e[1],e[2])))return{type:Wf,raw:e[0],label:e[1],url:e[2]}}}}),PMt=25,$Mt=100,BMt=[{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"}],Due=BMt[0].width,FMt=640,zMt=` -@media screen and (max-width: ${FMt}px) { +3. "-" cannot repeat`);Xi.customSchemes.push([t,e])}function K8t(){Xi.scanner=V8t(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=ywe(r.doc,[...e]);if(BN(o).forEach(({newRange:l})=>{const u=Bft(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(!Q8t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(Z8t).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=iQ(p).map(y=>y.toObject(t.defaultProtocol));if(!eMt(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=>{yK(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 rMt(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=Cwe(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 nMt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,iMt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function p7e(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function sMt(t,e){let r=0,n=0;for(;n0}function g7e(t,e,r){var n,i;const[,s,a]=e;return(e.index?t[e.index-1]:void 0)==="!"||p7e(t,(n=e.index)!==null&&n!==void 0?n:0)||sMt(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&r(a)}function m7e(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 aMt(t,e){return t.index{const n=nMt.exec(r);return!n||!g7e(r,n,t.isAllowedHref)?null:m7e(n)},type:t.type,getAttributes:y7e});return new jy({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 lMt(t){const e=mg({find:r=>{var n,i;const s=[];for(const o of r.matchAll(iMt))g7e(r,o,t.isAllowedHref)&&s.push(m7e(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=>aMt(l,o)));return[...s,...a]},type:t.type,getAttributes:y7e});return new $we({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 cMt(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=f7e(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(J8t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const v7e=Zg.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"){Lue(t);return}Lue(t.scheme,t.optionalSlashes)})},onDestroy(){X8t()},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?[oMt({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;f7e(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?[lMt({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})]:[mg({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(tMt({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(rMt({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(cMt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var uMt=v7e;const QA=" ",bB=" ",hMt=Qn.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===QA||r[0].text===QA||r[0].raw===bB||r[0].text===bB)&&n.length===1&&n[0].type==="text"&&(n[0].text===QA||n[0].text===bB)?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?QA:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),dMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,fMt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,pMt=Zg.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[yy({find:dMt,type:this.type})]},addPasteRules(){return[mg({find:fMt,type:this.type})]}}),gMt=Qn.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),mMt=Zg.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()}}}),yMt=Wi.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(x8t.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(g8t.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(LEe.configure(this.options.bulletList)),this.options.code!==!1&&t.push(C8t.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(Jwe.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(k8t.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(qpt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(Upt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(S8t.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(E8t.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(ogt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(A8t.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(I8t.configure(this.options.italic)),this.options.listItem!==!1&&t.push(PEe.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(BEe.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(v7e.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(zEe.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(hMt.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(pMt.configure(this.options.strike)),this.options.text!==!1&&t.push(gMt.configure(this.options.text)),this.options.underline!==!1){var n;t.push(mMt.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(agt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var xB=yMt;const eL=(t,e)=>{const r=e.view.domAtPos(t).node,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;return n?n.offsetParent!==null:!1},vMt=(t,e,r)=>{for(let n=t.depth;n>0;n-=1){const i=t.node(n),s=e(i),a=eL(t.start(n),r);if(s&&a)return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}},Iue=(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=Yy(y=>y.type===s.nodes.details)(a);if(!h)return!1;const d=TM(h.node,y=>y.type===s.nodes.detailsContent);if(!d.length||eL(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},bMt=Qn.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]},...bK({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=Yy(m=>m.type===this.type)(r);if(!i)return!1;const s=TM(i.node,m=>m.type===n.nodes.detailsSummary),a=TM(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=eL(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=ON(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})=>Iue(t,"right"),ArrowDown:({editor:t})=>Iue(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||!kwe(r,i.name))return;const{$from:s}=r.selection;if(eL(s.pos,n))return;const a=vMt(s,d=>d.type===i,n);if(!a)return;const o=TM(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=Yy(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=ON(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}}},...bK({nodeName:"detailsContent"})}),wMt=Qn.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]},...bK({nodeName:"detailsSummary",content:"inline"})}),aQ=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},TMt={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"},CMt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:TMt[aQ(e)]??null},kMt={m4v:"video/mp4",mov:"video/quicktime",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},oQ=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("video/")?r:kMt[aQ(e)]??null},ry=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=aQ(e);return r.startsWith("image/")?"image":CMt(r,e)?"audio":oQ(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")||r.includes("keynote")||["ppt","pptx","odp","keynote"].includes(n)||n==="key"&&r.includes("keynote")?"presentation":r.includes("android.package-archive")||["apk","xapk","apks","aab"].includes(n)?"apk":r.includes("application/x-msdownload")||r.includes("application/x-msdos-program")||r.includes("application/x-msi")||["exe","msi"].includes(n)?"exe":r.includes("application/x-apple-diskimage")||["dmg","pkg","ipa"].includes(n)?"dmg":r.includes("application/x-debian-package")||r.includes("application/x-redhat-package-manager")||["appimage","deb","rpm","flatpak"].includes(n)?"linux":r.includes("application/x-executable")||["run","elf"].includes(n)?"executable":r.includes("epub")||r.includes("mobipocket")||["epub","mobi","azw","azw3","fb2","djvu"].includes(n)?"book":r.startsWith("font/")||r.includes("font")||["ttf","otf","woff","woff2","eot"].includes(n)?"font":r.includes("iso9660")||["iso","img","vmdk","qcow2","vdi"].includes(n)?"diskimage":r.includes("sqlite")||["sqlite","sqlite3","db","db3"].includes(n)?"database":r.includes("photoshop")||["psd","psb","ai","sketch","fig","xd","afphoto","afdesign","cdr"].includes(n)?"design":r.startsWith("model/")||["blend","obj","stl","fbx","gltf","glb","step","stp","iges","igs","dwg","dxf"].includes(n)?"model3d":r.includes("pkix")||r.includes("x-x509")||r.includes("pkcs")||["pem","crt","cer","key","pub","pfx","p12","der","csr"].includes(n)?"certificate":["xmind","drawio","excalidraw","vsdx","vsd","mindnode","mmap"].includes(n)?"diagram":["log","crash","out","trace"].includes(n)?"log":["sh","bash","zsh","fish","bat","cmd","ps1"].includes(n)?"script":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","scss","less","py","java","go","rs","c","cpp","h","hpp","cs","swift","kt","kts","rb","php","lua","sql","toml","ini","conf","env"].includes(n)?"code":r.startsWith("text/")||["txt","md"].includes(n)?"text":"file"},SMt=/\/api\/v1\/resources\/([^/]+)\/blob(?:$|[?#])/,EMt=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(SMt);return r!=null&&r[1]?decodeURIComponent(r[1]):null}catch{return null}},lQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),AMt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",script:"SHELL",text:"TXT",apk:"APK",exe:"EXE",dmg:"DMG",linux:"LINUX",executable:"BIN",book:"BOOK",font:"FONT",diskimage:"ISO",database:"DB",design:"DESIGN",model3d:"3D",log:"LOG",certificate:"KEY",diagram:"DIAGRAM",file:"FILE"},Nue={msi:"MSI",appimage:"APPIMAGE",deb:"DEB",rpm:"RPM",pkg:"PKG",ipa:"IPA",aab:"AAB",psd:"PSD",ai:"AI",sketch:"SKETCH",fig:"FIG",xd:"XD",stl:"STL",obj:"OBJ",blend:"BLEND",fbx:"FBX",gltf:"GLTF",glb:"GLB",dwg:"DWG",sh:"SH",bash:"BASH",zsh:"ZSH",bat:"BAT",cmd:"CMD",ps1:"PS1",pem:"PEM",crt:"CERT",cer:"CERT",pub:"PUB",key:"KEY",xmind:"XMIND",drawio:"DRAWIO",vsdx:"VSDX",epub:"EPUB",mobi:"MOBI",woff2:"WOFF2",woff:"WOFF",ttf:"TTF",otf:"OTF",csv:"CSV",tsv:"TSV",md:"MD",docx:"DOCX",xlsx:"XLSX",pptx:"PPTX","7z":"7Z",tar:"TAR",gz:"GZ"},wg=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},MMt=t=>{const e=wg(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]}`},RMt=(t,e)=>{var n;const r=((n=e==null?void 0:e.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:n[1])??"";return Nue[r]?Nue[r]:AMt[ry(t,e)]},_Mt=(t,e,r)=>[RMt(t,e),MMt(r)].filter(Boolean).join(" · "),Wf="edgeeverFileAttachment",Due=t=>t==="compact"?"compact":"inline",LMt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,IMt=/^\s*(?:附件[::]|Attachment:)\s*/i,NMt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,DMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),OMt=(t,e)=>{const r=lQ(t)||t||e;return ry(null,r)==="pdf"||ry(null,e)==="pdf"?!1:IMt.test(t)||NMt.test(e)||ry(null,r)!=="file"},PMt=Qn.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=>wg(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=wg(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}},displayMode:{default:"inline",parseHTML:t=>Due(t.getAttribute("data-file-display-mode")),renderHTML:t=>{const e=Due(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:lQ(e),mimeType:"",byteSize:null,displayMode:"inline"}}},renderMarkdown:t=>{var e,r;return`[${DMt(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=LMt.exec(t);if(!(!e||!OMt(e[1],e[2])))return{type:Wf,raw:e[0],label:e[1],url:e[2]}}}}),$Mt=25,BMt=100,FMt=[{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"}],Oue=FMt[0].width,zMt=640,VMt=` +@media screen and (max-width: ${zMt}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; } } -`,VMt=()=>{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=zMt,document.head.appendChild(t)},Oue=t=>Math.min($Mt,Math.max(PMt,Math.round(t))),v7e=t=>{if(typeof t=="number"&&Number.isFinite(t))return Oue(t);if(typeof t!="string")return null;const e=/(\d+(?:\.\d+)?)/.exec(t);return e?Oue(Number(e[1])):null},cW="details",b7e="detailsSummary",x7e="detailsContent",HMt=/^]*)>/i,GMt=/^\s*]*>([\s\S]*?)<\/summary\s*>\s*/i,WMt=/^\s*]*data-type=["']detailsContent["'][^>]*>([\s\S]*)<\/div>\s*$/i,w7e=t=>t?typeof t.text=="string"?t.text:Array.isArray(t.content)?t.content.map(e=>w7e(e)).join(""):"":"",cQ=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),T7e=t=>t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),qMt=t=>T7e(t.replace(/<[^>]+>/g,"")).trim(),UMt=(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=WMt.exec(t.trim());return e?e[1]:t},jMt=t=>new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"),cC=(t,e)=>{const r=jMt(e).exec(t);return T7e(((r==null?void 0:r[1])??(r==null?void 0:r[2])??(r==null?void 0:r[3])??"").trim())},XMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),C7e=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t)||SMt(t))return!1;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},KMt=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)?v7e(e):null},k7e=t=>{const e=t.trim();if(!C7e(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:oQ(null,n)??"video/mp4"}},Pue=(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(""),QMt=t=>{const e=[],r=[],n=Pue(t,/]*)>([\s\S]*?)<\/video\s*>|]*)\/>/gi,(s,a,o,l)=>{const u=k7e(cC(a||l||"","src"));return u?(r.push(u.src),` +`,HMt=()=>{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=VMt,document.head.appendChild(t)},Pue=t=>Math.min(BMt,Math.max($Mt,Math.round(t))),b7e=t=>{if(typeof t=="number"&&Number.isFinite(t))return Pue(t);if(typeof t!="string")return null;const e=/(\d+(?:\.\d+)?)/.exec(t);return e?Pue(Number(e[1])):null},cW="details",x7e="detailsSummary",w7e="detailsContent",GMt=/^]*)>/i,WMt=/^\s*]*>([\s\S]*?)<\/summary\s*>\s*/i,qMt=/^\s*]*data-type=["']detailsContent["'][^>]*>([\s\S]*)<\/div>\s*$/i,T7e=t=>t?typeof t.text=="string"?t.text:Array.isArray(t.content)?t.content.map(e=>T7e(e)).join(""):"":"",cQ=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),C7e=t=>t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),UMt=t=>C7e(t.replace(/<[^>]+>/g,"")).trim(),YMt=(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=qMt.exec(t.trim());return e?e[1]:t},XMt=t=>new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"),cC=(t,e)=>{const r=XMt(e).exec(t);return C7e(((r==null?void 0:r[1])??(r==null?void 0:r[2])??(r==null?void 0:r[3])??"").trim())},KMt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),k7e=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t)||EMt(t))return!1;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},ZMt=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}},QMt=t=>{const e=t.trim();return/^\d+(?:\.\d+)?%$/.test(e)?b7e(e):null},S7e=t=>{const e=t.trim();if(!k7e(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:oQ(null,n)??"video/mp4"}},$ue=(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(""),JMt=t=>{const e=[],r=[],n=$ue(t,/]*)>([\s\S]*?)<\/video\s*>|]*)\/>/gi,(s,a,o,l)=>{const u=S7e(cC(a||l||"","src"));return u?(r.push(u.src),` -[${XMt(u.label)}](${u.src}) +[${KMt(u.label)}](${u.src}) -`):""});return{markdown:Pue(n,/]*)\/?>/gi,(s,a)=>{const o=cC(a||"","src");if(!o)return s;const l=cC(a||"","alt"),u=cC(a||"","title");return e.push({src:o,width:ZMt(cC(a||"","width"))}),u?`![${l}](${o} "${u}")`:`![${l}](${o})`}),images:e,videoUrls:r}},JMt=(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:oQ(null,h)??"video/mp4"}}}return Array.isArray(a.content)?{...a,content:a.content.map(s)}:a};return t.map(s)},JA=(t,e)=>`${t}="${cQ(e)}"`,eRt=t=>{var a,o,l,u;const e=typeof((a=t.attrs)==null?void 0:a.src)=="string"?t.attrs.src.trim():"";if(!KMt(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:v7e(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}%`)),``},tRt=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},rRt=t=>{var s,a,o;const e=tRt(t);if(!e)return null;const r=typeof((s=e.attrs)==null?void 0:s.url)=="string"?e.attrs.url.trim():"";if(!C7e(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 ry(i,n||r)!=="video"?null:``},nRt=(t,e)=>{const r=[],n=[],i=()=>{if(n.length===0)return;const s=e.renderChildren(n,` +`):""});return{markdown:$ue(n,/]*)\/?>/gi,(s,a)=>{const o=cC(a||"","src");if(!o)return s;const l=cC(a||"","alt"),u=cC(a||"","title");return e.push({src:o,width:QMt(cC(a||"","width"))}),u?`![${l}](${o} "${u}")`:`![${l}](${o})`}),images:e,videoUrls:r}},eRt=(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:oQ(null,h)??"video/mp4"}}}return Array.isArray(a.content)?{...a,content:a.content.map(s)}:a};return t.map(s)},JA=(t,e)=>`${t}="${cQ(e)}"`,tRt=t=>{var a,o,l,u;const e=typeof((a=t.attrs)==null?void 0:a.src)=="string"?t.attrs.src.trim():"";if(!ZMt(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:b7e(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}%`)),``},rRt=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},nRt=t=>{var s,a,o;const e=rRt(t);if(!e)return null;const r=typeof((s=e.attrs)==null?void 0:s.url)=="string"?e.attrs.url.trim():"";if(!k7e(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 ry(i,n||r)!=="video"?null:``},iRt=(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"?eRt(s):rRt(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"?tRt(s):nRt(s);if(!a){n.push(s);continue}i(),r.push(a)}return i(),r.join(` -`)},iRt=(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},sRt=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},aRt=` +`)},sRt=(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},aRt=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},oRt=` .ProseMirror [data-type="details"], .edgeever-editor-content [data-type="details"] { display: flex; @@ -1444,22 +1444,22 @@ ${r} .edgeever-editor-content [data-type="details"].is-open [data-type="detailsContent"] { margin-top: 0.15em; } -`,oRt=(t,e)=>{const r=typeof t.summary=="string"?t.summary:"",n=t,i=JMt(e.parseChildren(t.tokens||[]),n.detailImages||[],n.detailVideoUrls||[]),s=i.length>0?i:[{type:"paragraph"}];return e.createNode(cW,void 0,[e.createNode(b7e,void 0,r?[e.createTextNode(r)]:[]),e.createNode(x7e,void 0,s)])},lRt=(t,e)=>{const r=Array.isArray(t.content)?t.content:[],n=r.find(o=>o.type===b7e),i=r.find(o=>o.type===x7e),s=cQ(w7e(n).trim()),a=Array.isArray(i==null?void 0:i.content)&&i.content.length>0?nRt(i.content,e):"";return`
+`,lRt=(t,e)=>{const r=typeof t.summary=="string"?t.summary:"",n=t,i=eRt(e.parseChildren(t.tokens||[]),n.detailImages||[],n.detailVideoUrls||[]),s=i.length>0?i:[{type:"paragraph"}];return e.createNode(cW,void 0,[e.createNode(x7e,void 0,r?[e.createTextNode(r)]:[]),e.createNode(w7e,void 0,s)])},cRt=(t,e)=>{const r=Array.isArray(t.content)?t.content:[],n=r.find(o=>o.type===x7e),i=r.find(o=>o.type===w7e),s=cQ(T7e(n).trim()),a=Array.isArray(i==null?void 0:i.content)&&i.content.length>0?iRt(i.content,e):"";return`
${s} ${a} -
`},cRt=vMt.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:oRt,renderMarkdown:lRt,markdownTokenizer:{name:cW,level:"block",start(t){const e=/[cRt,uRt,hRt],y0="edgeeverImageGallery",S7e=["auto","2","3","1"],fRt="edgeever-image-upload://",pRt=t=>typeof t=="string"&&t.startsWith(fRt),uW=t=>S7e.includes(t)?t:"auto",E7e=Qn.create({name:y0,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>uW(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":uW(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??[],` +
`},uRt=bMt.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:lRt,renderMarkdown:cRt,markdownTokenizer:{name:cW,level:"block",start(t){const e=/[uRt,hRt,dRt],y0="edgeeverImageGallery",E7e=["auto","2","3","1"],pRt="edgeever-image-upload://",gRt=t=>typeof t=="string"&&t.startsWith(pRt),uW=t=>E7e.includes(t)?t:"auto",A7e=Qn.create({name:y0,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>uW(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":uW(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??[],` -`)}}),e8="edgeeverMergeDivider",gRt="\x3C!-- edgeever:merge-divider -->",mRt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,yRt=Qn.create({name:e8,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`${gRt} +`)}}),e8="edgeeverMergeDivider",mRt="\x3C!-- edgeever:merge-divider -->",yRt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,vRt=Qn.create({name:e8,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`${mRt} ----`},parseMarkdown(t,e){return e.createNode(e8)},markdownTokenizer:{name:e8,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=mRt.exec(t);if(e)return{type:e8,raw:e[0],text:""}}}}),rb="edgeeverPdfAttachment",$ue=t=>t==="inline"?"inline":"compact",vRt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,Bue=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,bRt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),xRt=Qn.create({name:rb,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=>wg(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=wg(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>$ue(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":$ue(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:rb,attrs:{url:t.url||"",label:t.label||"PDF",filename:lQ(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${bRt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:rb,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=vRt.exec(t);if(!(!e||!Bue(null,e[1])&&!Bue(null,e[2])))return{type:rb,raw:e[0],label:e[1],url:e[2]}}}}),tk="edgeeverPluginEmbed",A7e="edgeever-plugin-embed",qv=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",Fue=t=>{if(!t||typeof t!="object")return null;const e=t,r=qv(e.id,160),n=qv(e.pluginId,160),i=qv(e.type,120),s=qv(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:qv(e.previewResourceId,200),title:qv(e.title,500),dataJson:a}},wRt=t=>`\`\`\`${A7e} +---`},parseMarkdown(t,e){return e.createNode(e8)},markdownTokenizer:{name:e8,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=yRt.exec(t);if(e)return{type:e8,raw:e[0],text:""}}}}),rb="edgeeverPdfAttachment",Bue=t=>t==="inline"?"inline":"compact",bRt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,Fue=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,xRt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),wRt=Qn.create({name:rb,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=>wg(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=wg(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>Bue(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":Bue(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:rb,attrs:{url:t.url||"",label:t.label||"PDF",filename:lQ(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${xRt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:rb,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=bRt.exec(t);if(!(!e||!Fue(null,e[1])&&!Fue(null,e[2])))return{type:rb,raw:e[0],label:e[1],url:e[2]}}}}),tk="edgeeverPluginEmbed",M7e="edgeever-plugin-embed",qv=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",zue=t=>{if(!t||typeof t!="object")return null;const e=t,r=qv(e.id,160),n=qv(e.pluginId,160),i=qv(e.type,120),s=qv(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:qv(e.previewResourceId,200),title:qv(e.title,500),dataJson:a}},TRt=t=>`\`\`\`${M7e} ${JSON.stringify(t)} -\`\`\``,TRt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,CRt=Qn.create({name:tk,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:tk,attrs:t.attrs}),renderMarkdown:t=>{const e=Fue(t.attrs);return e?wRt(e):""},markdownTokenizer:{name:tk,level:"block",start(t){return t.indexOf(`\`\`\`${A7e}`)},tokenize(t){const e=TRt.exec(t);if(e)try{const r=Fue(JSON.parse(e[1]));return r?{type:tk,raw:e[0],attrs:r}:void 0}catch{return}}}}),uQ="edgeeverEmptyExternalLink",zue=t=>{if(typeof t!="string")return"";const e=t.trim();return/^(?:https?:\/\/|\/|#)/i.test(e)?e:""},kRt=Qn.create({name:uQ,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=zue(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=zue((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})`}}),SRt=cMt.extend({inclusive:!1,parseMarkdown(t,e){var r;return!((r=t.tokens)!=null&&r.length)&&t.text===""&&typeof t.href=="string"&&t.href?{type:uQ,attrs:{href:t.href,title:t.title||null}}:e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})}}),uC=(t,e)=>t===!1?[]:[t??e],M7e=t=>[t.markdown?xB.configure({...t.starterKit,link:!1}):t.starterKit===void 0?xB:xB.configure(t.starterKit),...t.markdown?[SRt]:[],kRt,VEe,zEe.configure({nested:!0}),t.table===void 0?Sue:Sue.configure(t.table),...uC(t.image,zwe),...uC(t.gallery,E7e),...uC(t.pdf,xRt),...uC(t.file,OMt),yRt,...dRt(),...uC(t.pluginEmbed,CRt),...t.mathematics,...t.markdown?[x7t.configure({markedOptions:{gfm:!0}})]:[]],tL="blockMath",rL="inlineMath",ERt=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},R7e=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!ERt(t,n))return n;return-1},_7e={name:rL,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=R7e(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:rL,raw:r,latex:n}}},L7e={name:tL,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=R7e(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:tL,raw:t.slice(0,e+2),latex:r}}},ARt=Qn.create({name:rL,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:rL,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:_7e}),MRt=Qn.create({name:tL,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:tL,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` -`)},markdownTokenizer:L7e}),RRt=()=>[MRt.configure(),ARt.configure()],hQ="edgeeverUnsupportedBlock",I6="edgeeverUnsupportedInline",u7="edgeeverUnsupportedMark",N6=new Set([hQ,I6]),I7e=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",uQ,"inlineMath","blockMath",...N6]),hW=new Set(["bold","italic","strike","underline","code","link",u7]),_Rt=new Set([...I7e,Wf,rb,tk]),N7e=new Set(["paragraph","heading"]),wD=t=>t.type==="text"&&"text"in t,D6=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",p5=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:e==="ja"?`未対応のコンテンツ: ${t}`:`Unsupported content: ${t}`,LRt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:p5(t.type,e)}),D7e=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}},IRt=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[]}},NRt=Qn.create({name:hQ,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=D6(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:p5(e)]}}),DRt=Qn.create({name:I6,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=D6(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:p5(e)]}}),ORt=Zg.create({name:u7,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]}}),PRt=()=>[NRt,DRt,ORt],$Rt=t=>{const e=t.marks??[],r=e.filter(i=>hW.has(i.type));return e.filter(i=>!hW.has(i.type)).length?{...t,marks:[...r,{type:u7,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},BRt=(t,e)=>{const r=(n,i)=>{if(wD(n))return $Rt(n);if(!I7e.has(n.type))return{type:N7e.has(i)?I6:hQ,attrs:LRt(n,e)};const s=n;return N6.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"))}},dQ=t=>{const e=r=>{var i;if(N6.has(r.type)){const s=r;return D7e(s.attrs)??{type:r.type===I6?"text":"paragraph",...r.type===I6?{text:p5(D6(s.attrs))}:{content:[{type:"text",text:p5(D6(s.attrs))}]}}}if(wD(r)){const s=r,a=(i=s.marks)==null?void 0:i.find(l=>l.type===u7),o=a?IRt(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))}},O7e=t=>{var e;return wD(t)?t.text:((e=t.content)==null?void 0:e.map(O7e).filter(Boolean).join(" "))??""},FRt=t=>{const e=(r,n)=>{var s;if(wD(r)){const a=r;return{...a,marks:(s=a.marks)==null?void 0:s.filter(o=>hW.has(o.type)&&o.type!==u7)}}if(!_Rt.has(r.type)||N6.has(r.type)){const a=r,o=N6.has(r.type)?D7e(a.attrs):a,l=(o==null?void 0:o.type)??D6(a.attrs),h=(o?O7e(o):"")||p5(l);return N7e.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"))}},zRt=t=>new UG({extensions:M7e({...t,markdown:!0})}),VRt=zRt({mathematics:RRt()}),HRt=t=>{if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=$7e(FRt(dW(t)));return VRt.serialize(r).replaceAll(P7e,"\\$")},P7e="edgeever-dollar",$7e=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("$",P7e)}:t:Array.isArray(e.content)?{...e,content:e.content.map($7e)}:t},dW=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=GRt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(dW)]}}return Array.isArray(e.content)?{...e,content:e.content.map(dW)}:t},GRt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""};var Vue;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 Nb extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class B7e extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Vue=globalThis).__zod_globalConfig??(Vue.__zod_globalConfig={});const fQ=globalThis.__zod_globalConfig;function v0(t){return fQ}function F7e(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 fW(t,e){return typeof e=="bigint"?e.toString():e}function TD(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function pQ(t){return t==null}function gQ(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function WRt(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 O6(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const URt=TD(()=>{var t;if(fQ.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 g5(t){if(O6(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(O6(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function V7e(t){return g5(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const YRt=new Set(["string","number","symbol"]);function m5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function em(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 jRt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const XRt={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 KRt(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=Jg(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 rv(this,"shape",a),a},checks:[]});return em(t,s)}function ZRt(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=Jg(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 rv(this,"shape",a),a},checks:[]});return em(t,s)}function QRt(t,e){if(!g5(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=Jg(t._zod.def,{get shape(){const s={...t._zod.def.shape,...e};return rv(this,"shape",s),s}});return em(t,i)}function JRt(t,e){if(!g5(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Jg(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return rv(this,"shape",n),n}});return em(t,r)}function e9t(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=Jg(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return rv(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return em(t,r)}function t9t(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=Jg(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 rv(this,"shape",l),l},checks:[]});return em(e,a)}function r9t(t,e,r){const n=Jg(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 rv(this,"shape",s),s}});return em(e,n)}function nb(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 t8(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:t8((h=(u=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:h.call(u,t))??t8((d=e==null?void 0:e.error)==null?void 0:d.call(e,t))??t8((f=r.customError)==null?void 0:f.call(r,t))??t8((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 mQ(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function P6(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const H7e=(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,fW,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},G7e=Ct("$ZodError",H7e),W7e=Ct("$ZodError",H7e,{Parent:Error});function i9t(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 s9t(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 Nb;if(a.issues.length){const o=new((i==null?void 0:i.Err)??t)(a.issues.map(l=>b0(l,s,v0())));throw z7e(o,i==null?void 0:i.callee),o}return a.value},vQ=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 z7e(o,i==null?void 0:i.callee),o}return a.value},CD=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 Nb;return s.issues.length?{success:!1,error:new(t??G7e)(s.issues.map(a=>b0(a,i,v0())))}:{success:!0,data:s.value}},a9t=CD(W7e),kD=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}},o9t=kD(W7e),l9t=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return yQ(t)(e,r,i)},c9t=t=>(e,r,n)=>yQ(t)(e,r,n),u9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return vQ(t)(e,r,i)},h9t=t=>async(e,r,n)=>vQ(t)(e,r,n),d9t=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return CD(t)(e,r,i)},f9t=t=>(e,r,n)=>CD(t)(e,r,n),p9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return kD(t)(e,r,i)},g9t=t=>async(e,r,n)=>kD(t)(e,r,n),m9t=/^[cC][0-9a-z]{6,}$/,y9t=/^[0-9a-z]+$/,v9t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,b9t=/^[0-9a-vA-V]{20}$/,x9t=/^[A-Za-z0-9]{27}$/,w9t=/^[a-zA-Z0-9_-]{21}$/,T9t=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,C9t=/^([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})$/,Wue=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)$/,k9t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,S9t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function E9t(){return new RegExp(S9t,"u")}const 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])$/,M9t=/^(([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}|:))$/,R9t=/^((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])$/,_9t=/^(([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])$/,L9t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q7e=/^[A-Za-z0-9_-]*$/,I9t=/^https?$/,N9t=/^\+[1-9]\d{6,14}$/,U7e="(?:(?:\\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])))",D9t=new RegExp(`^${U7e}$`);function Y7e(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 O9t(t){return new RegExp(`^${Y7e(t)}$`)}function P9t(t){const e=Y7e({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(`^${U7e}T(?:${n})$`)}const $9t=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}$`)},B9t=/^-?\d+$/,j7e=/^-?\d+(?:\.\d+)?$/,F9t=/^(?:true|false)$/i,z9t=/^[^A-Z]*$/,V9t=/^[^a-z]*$/,xc=Ct("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),X7e={number:"number",bigint:"bigint",object:"date"},K7e=Ct("$ZodCheckLessThan",(t,e)=>{xc.init(t,e);const r=X7e[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{xc.init(t,e);const r=X7e[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})}}),H9t=Ct("$ZodCheckMultipleOf",(t,e)=>{xc.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):WRt(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})}}),G9t=Ct("$ZodCheckNumberFormat",(t,e)=>{var a;xc.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]=XRt[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=B9t)}),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})}}),W9t=Ct("$ZodCheckMaxLength",(t,e)=>{var r;xc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!pQ(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=mQ(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),q9t=Ct("$ZodCheckMinLength",(t,e)=>{var r;xc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!pQ(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=mQ(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),U9t=Ct("$ZodCheckLengthEquals",(t,e)=>{var r;xc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!pQ(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=mQ(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})}}),SD=Ct("$ZodCheckStringFormat",(t,e)=>{var r,n;xc.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=()=>{})}),Y9t=Ct("$ZodCheckRegex",(t,e)=>{SD.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})}}),j9t=Ct("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=z9t),SD.init(t,e)}),X9t=Ct("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=V9t),SD.init(t,e)}),K9t=Ct("$ZodCheckIncludes",(t,e)=>{xc.init(t,e);const r=m5(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})}}),Z9t=Ct("$ZodCheckStartsWith",(t,e)=>{xc.init(t,e);const r=new RegExp(`^${m5(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})}}),Q9t=Ct("$ZodCheckEndsWith",(t,e)=>{xc.init(t,e);const r=new RegExp(`.*${m5(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})}}),J9t=Ct("$ZodCheckOverwrite",(t,e)=>{xc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class e_t{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(` +\`\`\``,CRt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,kRt=Qn.create({name:tk,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:tk,attrs:t.attrs}),renderMarkdown:t=>{const e=zue(t.attrs);return e?TRt(e):""},markdownTokenizer:{name:tk,level:"block",start(t){return t.indexOf(`\`\`\`${M7e}`)},tokenize(t){const e=CRt.exec(t);if(e)try{const r=zue(JSON.parse(e[1]));return r?{type:tk,raw:e[0],attrs:r}:void 0}catch{return}}}}),uQ="edgeeverEmptyExternalLink",Vue=t=>{if(typeof t!="string")return"";const e=t.trim();return/^(?:https?:\/\/|\/|#)/i.test(e)?e:""},SRt=Qn.create({name:uQ,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=Vue(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=Vue((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})`}}),ERt=uMt.extend({inclusive:!1,parseMarkdown(t,e){var r;return!((r=t.tokens)!=null&&r.length)&&t.text===""&&typeof t.href=="string"&&t.href?{type:uQ,attrs:{href:t.href,title:t.title||null}}:e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})}}),uC=(t,e)=>t===!1?[]:[t??e],R7e=t=>[t.markdown?xB.configure({...t.starterKit,link:!1}):t.starterKit===void 0?xB:xB.configure(t.starterKit),...t.markdown?[ERt]:[],SRt,HEe,VEe.configure({nested:!0}),t.table===void 0?Sue:Sue.configure(t.table),...uC(t.image,Vwe),...uC(t.gallery,A7e),...uC(t.pdf,wRt),...uC(t.file,PMt),vRt,...fRt(),...uC(t.pluginEmbed,kRt),...t.mathematics,...t.markdown?[w7t.configure({markedOptions:{gfm:!0}})]:[]],tL="blockMath",rL="inlineMath",ARt=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},_7e=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!ARt(t,n))return n;return-1},L7e={name:rL,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=_7e(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:rL,raw:r,latex:n}}},I7e={name:tL,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=_7e(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:tL,raw:t.slice(0,e+2),latex:r}}},MRt=Qn.create({name:rL,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:rL,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:L7e}),RRt=Qn.create({name:tL,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:tL,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` +`)},markdownTokenizer:I7e}),_Rt=()=>[RRt.configure(),MRt.configure()],hQ="edgeeverUnsupportedBlock",I6="edgeeverUnsupportedInline",u7="edgeeverUnsupportedMark",N6=new Set([hQ,I6]),N7e=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",uQ,"inlineMath","blockMath",...N6]),hW=new Set(["bold","italic","strike","underline","code","link",u7]),LRt=new Set([...N7e,Wf,rb,tk]),D7e=new Set(["paragraph","heading"]),wD=t=>t.type==="text"&&"text"in t,D6=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",p5=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:e==="ja"?`未対応のコンテンツ: ${t}`:`Unsupported content: ${t}`,IRt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:p5(t.type,e)}),O7e=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}},NRt=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[]}},DRt=Qn.create({name:hQ,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=D6(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:p5(e)]}}),ORt=Qn.create({name:I6,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=D6(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:p5(e)]}}),PRt=Zg.create({name:u7,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]}}),$Rt=()=>[DRt,ORt,PRt],BRt=t=>{const e=t.marks??[],r=e.filter(i=>hW.has(i.type));return e.filter(i=>!hW.has(i.type)).length?{...t,marks:[...r,{type:u7,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},FRt=(t,e)=>{const r=(n,i)=>{if(wD(n))return BRt(n);if(!N7e.has(n.type))return{type:D7e.has(i)?I6:hQ,attrs:IRt(n,e)};const s=n;return N6.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"))}},dQ=t=>{const e=r=>{var i;if(N6.has(r.type)){const s=r;return O7e(s.attrs)??{type:r.type===I6?"text":"paragraph",...r.type===I6?{text:p5(D6(s.attrs))}:{content:[{type:"text",text:p5(D6(s.attrs))}]}}}if(wD(r)){const s=r,a=(i=s.marks)==null?void 0:i.find(l=>l.type===u7),o=a?NRt(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))}},P7e=t=>{var e;return wD(t)?t.text:((e=t.content)==null?void 0:e.map(P7e).filter(Boolean).join(" "))??""},zRt=t=>{const e=(r,n)=>{var s;if(wD(r)){const a=r;return{...a,marks:(s=a.marks)==null?void 0:s.filter(o=>hW.has(o.type)&&o.type!==u7)}}if(!LRt.has(r.type)||N6.has(r.type)){const a=r,o=N6.has(r.type)?O7e(a.attrs):a,l=(o==null?void 0:o.type)??D6(a.attrs),h=(o?P7e(o):"")||p5(l);return D7e.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"))}},VRt=t=>new UG({extensions:R7e({...t,markdown:!0})}),HRt=VRt({mathematics:_Rt()}),GRt=t=>{if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=B7e(zRt(dW(t)));return HRt.serialize(r).replaceAll($7e,"\\$")},$7e="edgeever-dollar",B7e=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("$",$7e)}:t:Array.isArray(e.content)?{...e,content:e.content.map(B7e)}:t},dW=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=WRt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(dW)]}}return Array.isArray(e.content)?{...e,content:e.content.map(dW)}:t},WRt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""};var Hue;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 Nb extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class F7e extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Hue=globalThis).__zod_globalConfig??(Hue.__zod_globalConfig={});const fQ=globalThis.__zod_globalConfig;function v0(t){return fQ}function z7e(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 fW(t,e){return typeof e=="bigint"?e.toString():e}function TD(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function pQ(t){return t==null}function gQ(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function qRt(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 O6(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const YRt=TD(()=>{var t;if(fQ.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 g5(t){if(O6(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(O6(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function H7e(t){return g5(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const jRt=new Set(["string","number","symbol"]);function m5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function em(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 XRt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const KRt={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 ZRt(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=Jg(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 rv(this,"shape",a),a},checks:[]});return em(t,s)}function QRt(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=Jg(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 rv(this,"shape",a),a},checks:[]});return em(t,s)}function JRt(t,e){if(!g5(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=Jg(t._zod.def,{get shape(){const s={...t._zod.def.shape,...e};return rv(this,"shape",s),s}});return em(t,i)}function e9t(t,e){if(!g5(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Jg(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return rv(this,"shape",n),n}});return em(t,r)}function t9t(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=Jg(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return rv(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return em(t,r)}function r9t(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=Jg(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 rv(this,"shape",l),l},checks:[]});return em(e,a)}function n9t(t,e,r){const n=Jg(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 rv(this,"shape",s),s}});return em(e,n)}function nb(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 t8(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:t8((h=(u=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:h.call(u,t))??t8((d=e==null?void 0:e.error)==null?void 0:d.call(e,t))??t8((f=r.customError)==null?void 0:f.call(r,t))??t8((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 mQ(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function P6(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const G7e=(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,fW,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},W7e=Ct("$ZodError",G7e),q7e=Ct("$ZodError",G7e,{Parent:Error});function s9t(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 a9t(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 Nb;if(a.issues.length){const o=new((i==null?void 0:i.Err)??t)(a.issues.map(l=>b0(l,s,v0())));throw V7e(o,i==null?void 0:i.callee),o}return a.value},vQ=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 V7e(o,i==null?void 0:i.callee),o}return a.value},CD=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 Nb;return s.issues.length?{success:!1,error:new(t??W7e)(s.issues.map(a=>b0(a,i,v0())))}:{success:!0,data:s.value}},o9t=CD(q7e),kD=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}},l9t=kD(q7e),c9t=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return yQ(t)(e,r,i)},u9t=t=>(e,r,n)=>yQ(t)(e,r,n),h9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return vQ(t)(e,r,i)},d9t=t=>async(e,r,n)=>vQ(t)(e,r,n),f9t=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return CD(t)(e,r,i)},p9t=t=>(e,r,n)=>CD(t)(e,r,n),g9t=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return kD(t)(e,r,i)},m9t=t=>async(e,r,n)=>kD(t)(e,r,n),y9t=/^[cC][0-9a-z]{6,}$/,v9t=/^[0-9a-z]+$/,b9t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x9t=/^[0-9a-vA-V]{20}$/,w9t=/^[A-Za-z0-9]{27}$/,T9t=/^[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)?)?)$/,k9t=/^([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})$/,que=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)$/,S9t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,E9t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function A9t(){return new RegExp(E9t,"u")}const 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])$/,R9t=/^(([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}|:))$/,_9t=/^((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])$/,L9t=/^(([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])$/,I9t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,U7e=/^[A-Za-z0-9_-]*$/,N9t=/^https?$/,D9t=/^\+[1-9]\d{6,14}$/,Y7e="(?:(?:\\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])))",O9t=new RegExp(`^${Y7e}$`);function j7e(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 P9t(t){return new RegExp(`^${j7e(t)}$`)}function $9t(t){const e=j7e({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(`^${Y7e}T(?:${n})$`)}const B9t=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}$`)},F9t=/^-?\d+$/,X7e=/^-?\d+(?:\.\d+)?$/,z9t=/^(?:true|false)$/i,V9t=/^[^A-Z]*$/,H9t=/^[^a-z]*$/,xc=Ct("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),K7e={number:"number",bigint:"bigint",object:"date"},Z7e=Ct("$ZodCheckLessThan",(t,e)=>{xc.init(t,e);const r=K7e[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{xc.init(t,e);const r=K7e[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})}}),G9t=Ct("$ZodCheckMultipleOf",(t,e)=>{xc.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):qRt(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})}}),W9t=Ct("$ZodCheckNumberFormat",(t,e)=>{var a;xc.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]=KRt[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=F9t)}),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})}}),q9t=Ct("$ZodCheckMaxLength",(t,e)=>{var r;xc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!pQ(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=mQ(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),U9t=Ct("$ZodCheckMinLength",(t,e)=>{var r;xc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!pQ(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=mQ(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Y9t=Ct("$ZodCheckLengthEquals",(t,e)=>{var r;xc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!pQ(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=mQ(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})}}),SD=Ct("$ZodCheckStringFormat",(t,e)=>{var r,n;xc.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=()=>{})}),j9t=Ct("$ZodCheckRegex",(t,e)=>{SD.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})}}),X9t=Ct("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=V9t),SD.init(t,e)}),K9t=Ct("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=H9t),SD.init(t,e)}),Z9t=Ct("$ZodCheckIncludes",(t,e)=>{xc.init(t,e);const r=m5(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})}}),Q9t=Ct("$ZodCheckStartsWith",(t,e)=>{xc.init(t,e);const r=new RegExp(`^${m5(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})}}),J9t=Ct("$ZodCheckEndsWith",(t,e)=>{xc.init(t,e);const r=new RegExp(`.*${m5(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})}}),e_t=Ct("$ZodCheckOverwrite",(t,e)=>{xc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class t_t{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 t_t={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=t_t;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=nb(o),d;for(const f of l){if(f._zod.def.when){if(n9t(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 Nb;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,o.issues.length!==p&&(h||(h=nb(o,p)))});else{if(o.issues.length===p)continue;h||(h=nb(o,p))}}return d?d.then(()=>o):o},a=(o,l,u)=>{if(nb(o))return o.aborted=!0,o;const h=s(l,n,u);if(h instanceof Promise){if(u.async===!1)throw new Nb;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 Nb;return u.then(h=>s(h,n,l))}return s(u,n,l)}}bi(t,"~standard",()=>({validate:s=>{var a;try{const o=a9t(t,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return o9t(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}))}),bQ=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()??$9t(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)=>{SD.init(t,e),bQ.init(t,e)}),r_t=Ct("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=C9t),hs.init(t,e)}),n_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=Wue(n))}else e.pattern??(e.pattern=Wue());hs.init(t,e)}),i_t=Ct("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=k9t),hs.init(t,e)}),s_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)===I9t.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})}}}),a_t=Ct("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=E9t()),hs.init(t,e)}),o_t=Ct("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=w9t),hs.init(t,e)}),l_t=Ct("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=m9t),hs.init(t,e)}),c_t=Ct("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=y9t),hs.init(t,e)}),u_t=Ct("$ZodULID",(t,e)=>{e.pattern??(e.pattern=v9t),hs.init(t,e)}),h_t=Ct("$ZodXID",(t,e)=>{e.pattern??(e.pattern=b9t),hs.init(t,e)}),d_t=Ct("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=x9t),hs.init(t,e)}),f_t=Ct("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=P9t(e)),hs.init(t,e)}),p_t=Ct("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=D9t),hs.init(t,e)}),g_t=Ct("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=O9t(e)),hs.init(t,e)}),m_t=Ct("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=T9t),hs.init(t,e)}),y_t=Ct("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=A9t),hs.init(t,e),t._zod.bag.format="ipv4"}),v_t=Ct("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=M9t),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})}}}),b_t=Ct("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=R9t),hs.init(t,e)}),x_t=Ct("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=_9t),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 Q7e(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const w_t=Ct("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=L9t),hs.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Q7e(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function T_t(t){if(!q7e.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Q7e(r)}const C_t=Ct("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=q7e),hs.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{T_t(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),k_t=Ct("$ZodE164",(t,e)=>{e.pattern??(e.pattern=N9t),hs.init(t,e)});function S_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 E_t=Ct("$ZodJWT",(t,e)=>{hs.init(t,e),t._zod.check=r=>{S_t(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),J7e=Ct("$ZodNumber",(t,e)=>{Cs.init(t,e),t._zod.pattern=t._zod.bag.pattern??j7e,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}}),A_t=Ct("$ZodNumberFormat",(t,e)=>{G9t.init(t,e),J7e.init(t,e)}),M_t=Ct("$ZodBoolean",(t,e)=>{Cs.init(t,e),t._zod.pattern=F9t,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}}),R_t=Ct("$ZodUnknown",(t,e)=>{Cs.init(t,e),t._zod.parse=r=>r}),__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 que(t,e,r){t.issues.length&&e.issues.push(...ib(r,t.issues)),e.value[r]=t.value}const L_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;aque(u,r,a))):que(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function nL(t,e,r,n,i,s){const a=r in n;if(t.issues.length){if(i&&s&&!a)return;e.issues.push(...ib(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 eAe(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=jRt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function tAe(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=>nL(g,r,f,e,h,d))):nL(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 I_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=TD(()=>eAe(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=O6,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=>nL(v,o,f,u,g,m))):nL(y,o,f,u,g,m)}return s?tAe(h,u,o,l,n.value,t):h.length?Promise.all(h).then(()=>o):o}}),N_t=Ct("$ZodObjectJIT",(t,e)=>{I_t.init(t,e);const r=t._zod.parse,n=TD(()=>eAe(e)),i=f=>{var b,T;const p=new e_t(["shape","payload","ctx"]),g=n.value,m=C=>{const S=Gue(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=Gue(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 r_t={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=r_t;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=nb(o),d;for(const f of l){if(f._zod.def.when){if(i9t(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 Nb;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,o.issues.length!==p&&(h||(h=nb(o,p)))});else{if(o.issues.length===p)continue;h||(h=nb(o,p))}}return d?d.then(()=>o):o},a=(o,l,u)=>{if(nb(o))return o.aborted=!0,o;const h=s(l,n,u);if(h instanceof Promise){if(u.async===!1)throw new Nb;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 Nb;return u.then(h=>s(h,n,l))}return s(u,n,l)}}bi(t,"~standard",()=>({validate:s=>{var a;try{const o=o9t(t,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return l9t(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}))}),bQ=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()??B9t(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)=>{SD.init(t,e),bQ.init(t,e)}),n_t=Ct("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=k9t),hs.init(t,e)}),i_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=que(n))}else e.pattern??(e.pattern=que());hs.init(t,e)}),s_t=Ct("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=S9t),hs.init(t,e)}),a_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)===N9t.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})}}}),o_t=Ct("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=A9t()),hs.init(t,e)}),l_t=Ct("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=T9t),hs.init(t,e)}),c_t=Ct("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=y9t),hs.init(t,e)}),u_t=Ct("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=v9t),hs.init(t,e)}),h_t=Ct("$ZodULID",(t,e)=>{e.pattern??(e.pattern=b9t),hs.init(t,e)}),d_t=Ct("$ZodXID",(t,e)=>{e.pattern??(e.pattern=x9t),hs.init(t,e)}),f_t=Ct("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=w9t),hs.init(t,e)}),p_t=Ct("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=$9t(e)),hs.init(t,e)}),g_t=Ct("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=O9t),hs.init(t,e)}),m_t=Ct("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=P9t(e)),hs.init(t,e)}),y_t=Ct("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=C9t),hs.init(t,e)}),v_t=Ct("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=M9t),hs.init(t,e),t._zod.bag.format="ipv4"}),b_t=Ct("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=R9t),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})}}}),x_t=Ct("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=_9t),hs.init(t,e)}),w_t=Ct("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=L9t),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 J7e(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const T_t=Ct("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=I9t),hs.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{J7e(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function C_t(t){if(!U7e.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return J7e(r)}const k_t=Ct("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=U7e),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})}}),S_t=Ct("$ZodE164",(t,e)=>{e.pattern??(e.pattern=D9t),hs.init(t,e)});function E_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 A_t=Ct("$ZodJWT",(t,e)=>{hs.init(t,e),t._zod.check=r=>{E_t(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),eAe=Ct("$ZodNumber",(t,e)=>{Cs.init(t,e),t._zod.pattern=t._zod.bag.pattern??X7e,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}}),M_t=Ct("$ZodNumberFormat",(t,e)=>{W9t.init(t,e),eAe.init(t,e)}),R_t=Ct("$ZodBoolean",(t,e)=>{Cs.init(t,e),t._zod.pattern=z9t,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}}),__t=Ct("$ZodUnknown",(t,e)=>{Cs.init(t,e),t._zod.parse=r=>r}),L_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 Uue(t,e,r){t.issues.length&&e.issues.push(...ib(r,t.issues)),e.value[r]=t.value}const I_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;aUue(u,r,a))):Uue(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function nL(t,e,r,n,i,s){const a=r in n;if(t.issues.length){if(i&&s&&!a)return;e.issues.push(...ib(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 tAe(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=XRt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function rAe(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=>nL(g,r,f,e,h,d))):nL(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 N_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=TD(()=>tAe(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=O6,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=>nL(v,o,f,u,g,m))):nL(y,o,f,u,g,m)}return s?rAe(h,u,o,l,n.value,t):h.length?Promise.all(h).then(()=>o):o}}),D_t=Ct("$ZodObjectJIT",(t,e)=>{N_t.init(t,e);const r=t._zod.parse,n=TD(()=>tAe(e)),i=f=>{var b,T;const p=new t_t(["shape","payload","ctx"]),g=n.value,m=C=>{const S=Wue(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=Wue(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 => ({ @@ -1518,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=O6,o=!fQ.jitless,u=o&&URt.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?tAe([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)}});function Uue(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=>!nb(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 rAe=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=>gQ(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=>Uue(o,n,t,i)):Uue(a,n,t,i)}}),D_t=Ct("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,rAe.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=TD(()=>{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(!O6(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)}}),O_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])=>Yue(r,l,u)):Yue(r,s,a)}});function pW(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(g5(t)&&g5(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=pW(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}),nb(t))return t;const a=pW(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 P_t=Ct("$ZodRecord",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!g5(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(...ib(u,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...ib(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"&&j7e.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(...ib(o,d.issues)),r.value[l.value]=d.value})):(h.issues.length&&r.issues.push(...ib(o,h.issues)),r.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}}),$_t=Ct("$ZodEnum",(t,e)=>{Cs.init(t,e);const r=F7e(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>YRt.has(typeof i)).map(i=>typeof i=="string"?m5(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}}),B_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"?m5(n):n?m5(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}}),F_t=Ct("$ZodTransform",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new B7e(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 Nb;return r.value=i,r.fallback=!0,r}});function jue(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const nAe=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(`^(${gQ(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=>jue(a,i)):jue(s,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),z_t=Ct("$ZodExactOptional",(t,e)=>{nAe.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)}),V_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(`^(${gQ(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)}),H_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=>Xue(s,e)):Xue(i,e)}});function Xue(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const G_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))}),W_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=>Kue(s,t)):Kue(i,t)}});function Kue(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 q_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)}}),U_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=>r8(a,e.in,n)):r8(s,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>r8(s,e.out,n)):r8(i,e.out,n)}});function r8(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 Y_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(Zue):Zue(i)}});function Zue(t){return t.value=Object.freeze(t.value),t}const j_t=Ct("$ZodCustom",(t,e)=>{xc.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=>Que(s,r,n,t));Que(i,r,n,t)}});function Que(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(P6(i))}}var Jue;class X_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 K_t(){return new X_t}(Jue=globalThis).__zod_globalRegistry??(Jue.__zod_globalRegistry=K_t());const rk=globalThis.__zod_globalRegistry;function Z_t(t,e){return new t({type:"string",..._r(e)})}function Q_t(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,..._r(e)})}function ehe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,..._r(e)})}function J_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,..._r(e)})}function eLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._r(e)})}function tLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._r(e)})}function rLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._r(e)})}function nLt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,..._r(e)})}function iLt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,..._r(e)})}function sLt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,..._r(e)})}function aLt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,..._r(e)})}function oLt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,..._r(e)})}function lLt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,..._r(e)})}function cLt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,..._r(e)})}function uLt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,..._r(e)})}function hLt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,..._r(e)})}function dLt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,..._r(e)})}function fLt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._r(e)})}function pLt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._r(e)})}function gLt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,..._r(e)})}function mLt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,..._r(e)})}function yLt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,..._r(e)})}function vLt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,..._r(e)})}function bLt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._r(e)})}function xLt(t,e){return new t({type:"string",format:"date",check:"string_format",..._r(e)})}function wLt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,..._r(e)})}function TLt(t,e){return new t({type:"string",format:"duration",check:"string_format",..._r(e)})}function CLt(t,e){return new t({type:"number",checks:[],..._r(e)})}function kLt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",..._r(e)})}function SLt(t,e){return new t({type:"boolean",..._r(e)})}function ELt(t){return new t({type:"unknown"})}function ALt(t,e){return new t({type:"never",..._r(e)})}function the(t,e){return new K7e({check:"less_than",..._r(e),value:t,inclusive:!1})}function wB(t,e){return new K7e({check:"less_than",..._r(e),value:t,inclusive:!0})}function rhe(t,e){return new Z7e({check:"greater_than",..._r(e),value:t,inclusive:!1})}function TB(t,e){return new Z7e({check:"greater_than",..._r(e),value:t,inclusive:!0})}function nhe(t,e){return new H9t({check:"multiple_of",..._r(e),value:t})}function iAe(t,e){return new W9t({check:"max_length",..._r(e),maximum:t})}function iL(t,e){return new q9t({check:"min_length",..._r(e),minimum:t})}function sAe(t,e){return new U9t({check:"length_equals",..._r(e),length:t})}function MLt(t,e){return new Y9t({check:"string_format",format:"regex",..._r(e),pattern:t})}function RLt(t){return new j9t({check:"string_format",format:"lowercase",..._r(t)})}function _Lt(t){return new X9t({check:"string_format",format:"uppercase",..._r(t)})}function LLt(t,e){return new K9t({check:"string_format",format:"includes",..._r(e),includes:t})}function ILt(t,e){return new Z9t({check:"string_format",format:"starts_with",..._r(e),prefix:t})}function NLt(t,e){return new Q9t({check:"string_format",format:"ends_with",..._r(e),suffix:t})}function p3(t){return new J9t({check:"overwrite",tx:t})}function DLt(t){return p3(e=>e.normalize(t))}function OLt(){return p3(t=>t.trim())}function PLt(){return p3(t=>t.toLowerCase())}function $Lt(){return p3(t=>t.toUpperCase())}function BLt(){return p3(t=>qRt(t))}function FLt(t,e,r){return new t({type:"array",element:e,..._r(r)})}function zLt(t,e,r){return new t({type:"custom",check:"custom",fn:e,..._r(r)})}function VLt(t,e){const r=HLt(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(P6(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(P6(s))}},t(n.value,n)),e);return r}function HLt(t,e){const r=new xc({check:"custom",..._r(e)});return r._zod.check=t,r}function aAe(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)??rk,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 da(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),da(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"&&al(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 oAe(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=O6,o=!fQ.jitless,u=o&&YRt.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?rAe([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)}});function Yue(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=>!nb(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 nAe=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=>gQ(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=>Yue(o,n,t,i)):Yue(a,n,t,i)}}),O_t=Ct("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,nAe.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=TD(()=>{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(!O6(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)}}),P_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])=>jue(r,l,u)):jue(r,s,a)}});function pW(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(g5(t)&&g5(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=pW(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}),nb(t))return t;const a=pW(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 $_t=Ct("$ZodRecord",(t,e)=>{Cs.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!g5(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(...ib(u,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...ib(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"&&X7e.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(...ib(o,d.issues)),r.value[l.value]=d.value})):(h.issues.length&&r.issues.push(...ib(o,h.issues)),r.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}}),B_t=Ct("$ZodEnum",(t,e)=>{Cs.init(t,e);const r=z7e(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>jRt.has(typeof i)).map(i=>typeof i=="string"?m5(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}}),F_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"?m5(n):n?m5(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}}),z_t=Ct("$ZodTransform",(t,e)=>{Cs.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new F7e(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 Nb;return r.value=i,r.fallback=!0,r}});function Xue(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const iAe=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(`^(${gQ(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=>Xue(a,i)):Xue(s,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),V_t=Ct("$ZodExactOptional",(t,e)=>{iAe.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)}),H_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(`^(${gQ(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)}),G_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=>Kue(s,e)):Kue(i,e)}});function Kue(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const W_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))}),q_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=>Zue(s,t)):Zue(i,t)}});function Zue(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 U_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)}}),Y_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=>r8(a,e.in,n)):r8(s,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>r8(s,e.out,n)):r8(i,e.out,n)}});function r8(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 j_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(Que):Que(i)}});function Que(t){return t.value=Object.freeze(t.value),t}const X_t=Ct("$ZodCustom",(t,e)=>{xc.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=>Jue(s,r,n,t));Jue(i,r,n,t)}});function Jue(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(P6(i))}}var ehe;class K_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 Z_t(){return new K_t}(ehe=globalThis).__zod_globalRegistry??(ehe.__zod_globalRegistry=Z_t());const rk=globalThis.__zod_globalRegistry;function Q_t(t,e){return new t({type:"string",..._r(e)})}function J_t(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,..._r(e)})}function the(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,..._r(e)})}function eLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,..._r(e)})}function tLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._r(e)})}function rLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._r(e)})}function nLt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._r(e)})}function iLt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,..._r(e)})}function sLt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,..._r(e)})}function aLt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,..._r(e)})}function oLt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,..._r(e)})}function lLt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,..._r(e)})}function cLt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,..._r(e)})}function uLt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,..._r(e)})}function hLt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,..._r(e)})}function dLt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,..._r(e)})}function fLt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,..._r(e)})}function pLt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._r(e)})}function gLt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._r(e)})}function mLt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,..._r(e)})}function yLt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,..._r(e)})}function vLt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,..._r(e)})}function bLt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,..._r(e)})}function xLt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._r(e)})}function wLt(t,e){return new t({type:"string",format:"date",check:"string_format",..._r(e)})}function TLt(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 kLt(t,e){return new t({type:"number",checks:[],..._r(e)})}function SLt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",..._r(e)})}function ELt(t,e){return new t({type:"boolean",..._r(e)})}function ALt(t){return new t({type:"unknown"})}function MLt(t,e){return new t({type:"never",..._r(e)})}function rhe(t,e){return new Z7e({check:"less_than",..._r(e),value:t,inclusive:!1})}function wB(t,e){return new Z7e({check:"less_than",..._r(e),value:t,inclusive:!0})}function nhe(t,e){return new Q7e({check:"greater_than",..._r(e),value:t,inclusive:!1})}function TB(t,e){return new Q7e({check:"greater_than",..._r(e),value:t,inclusive:!0})}function ihe(t,e){return new G9t({check:"multiple_of",..._r(e),value:t})}function sAe(t,e){return new q9t({check:"max_length",..._r(e),maximum:t})}function iL(t,e){return new U9t({check:"min_length",..._r(e),minimum:t})}function aAe(t,e){return new Y9t({check:"length_equals",..._r(e),length:t})}function RLt(t,e){return new j9t({check:"string_format",format:"regex",..._r(e),pattern:t})}function _Lt(t){return new X9t({check:"string_format",format:"lowercase",..._r(t)})}function LLt(t){return new K9t({check:"string_format",format:"uppercase",..._r(t)})}function ILt(t,e){return new Z9t({check:"string_format",format:"includes",..._r(e),includes:t})}function NLt(t,e){return new Q9t({check:"string_format",format:"starts_with",..._r(e),prefix:t})}function DLt(t,e){return new J9t({check:"string_format",format:"ends_with",..._r(e),suffix:t})}function p3(t){return new e_t({check:"overwrite",tx:t})}function OLt(t){return p3(e=>e.normalize(t))}function PLt(){return p3(t=>t.trim())}function $Lt(){return p3(t=>t.toLowerCase())}function BLt(){return p3(t=>t.toUpperCase())}function FLt(){return p3(t=>URt(t))}function zLt(t,e,r){return new t({type:"array",element:e,..._r(r)})}function VLt(t,e,r){return new t({type:"custom",check:"custom",fn:e,..._r(r)})}function HLt(t,e){const r=GLt(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(P6(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(P6(s))}},t(n.value,n)),e);return r}function GLt(t,e){const r=new xc({check:"custom",..._r(e)});return r._zod.check=t,r}function oAe(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)??rk,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 da(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),da(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"&&al(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 lAe(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 lAe(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:sL(e,"input",t.processors),output:sL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function al(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 al(n.element,r);if(n.type==="set")return al(n.valueType,r);if(n.type==="lazy")return al(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 al(n.innerType,r);if(n.type==="intersection")return al(n.left,r)||al(n.right,r);if(n.type==="record"||n.type==="map")return al(n.keyType,r)||al(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:al(n.in,r)||al(n.out,r);if(n.type==="object"){for(const i in n.shape)if(al(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(al(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(al(i,r))return!0;return!!(n.rest&&al(n.rest,r))}return!1}const GLt=(t,e={})=>r=>{const n=aAe({...r,processors:e});return da(t,n),oAe(n,t),lAe(n,t)},sL=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=aAe({...i??{},target:s,io:e,processors:r});return da(t,a),oAe(a,t),lAe(a,t)},WLt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qLt=(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=WLt[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}))])}},ULt=(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)},YLt=(t,e,r,n)=>{r.type="boolean"},jLt=(t,e,r,n)=>{r.not={}},XLt=(t,e,r,n)=>{},KLt=(t,e,r,n)=>{const i=t._zod.def,s=F7e(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},ZLt=(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},QLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},JLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},eIt=(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=da(s.element,e,{...n,path:[...n.path,"items"]})},tIt=(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]=da(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=da(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},rIt=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>da(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},nIt=(t,e,r,n)=>{const i=t._zod.def,s=da(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=da(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},iIt=(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=da(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=da(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=da(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)}},sIt=(t,e,r,n)=>{const i=t._zod.def,s=da(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"}]},aIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},oIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},lIt=(t,e,r,n)=>{const i=t._zod.def;da(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)))},cIt=(t,e,r,n)=>{const i=t._zod.def;da(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},uIt=(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;da(a,e,n);const o=e.seen.get(t);o.ref=a},hIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},cAe=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},dIt=Ct("ZodISODateTime",(t,e)=>{f_t.init(t,e),Ss.init(t,e)});function fIt(t){return bLt(dIt,t)}const pIt=Ct("ZodISODate",(t,e)=>{p_t.init(t,e),Ss.init(t,e)});function gIt(t){return xLt(pIt,t)}const mIt=Ct("ZodISOTime",(t,e)=>{g_t.init(t,e),Ss.init(t,e)});function yIt(t){return wLt(mIt,t)}const vIt=Ct("ZodISODuration",(t,e)=>{m_t.init(t,e),Ss.init(t,e)});function bIt(t){return TLt(vIt,t)}const xIt=(t,e)=>{G7e.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>s9t(t,r)},flatten:{value:r=>i9t(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,fW,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,fW,2)}},isEmpty:{get(){return t.issues.length===0}}})},$u=Ct("ZodError",xIt,{Parent:Error}),wIt=yQ($u),TIt=vQ($u),CIt=CD($u),kIt=kD($u),SIt=l9t($u),EIt=c9t($u),AIt=u9t($u),MIt=h9t($u),RIt=d9t($u),_It=f9t($u),LIt=p9t($u),IIt=g9t($u),ihe=new WeakMap;function h7(t,e,r){const n=Object.getPrototypeOf(t);let i=ihe.get(n);if(i||(i=new Set,ihe.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:sL(t,"input"),output:sL(t,"output")}}),t.toJSONSchema=GLt(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>wIt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>CIt(t,r,n),t.parseAsync=async(r,n)=>TIt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>kIt(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>SIt(t,r,n),t.decode=(r,n)=>EIt(t,r,n),t.encodeAsync=async(r,n)=>AIt(t,r,n),t.decodeAsync=async(r,n)=>MIt(t,r,n),t.safeEncode=(r,n)=>RIt(t,r,n),t.safeDecode=(r,n)=>_It(t,r,n),t.safeEncodeAsync=async(r,n)=>LIt(t,r,n),t.safeDecodeAsync=async(r,n)=>IIt(t,r,n),h7(t,"ZodType",{check(...r){const n=this.def;return this.clone(Jg(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 em(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(kNt(r,n))},superRefine(r,n){return this.check(SNt(r,n))},overwrite(r){return this.check(p3(r))},optional(){return lhe(this)},exactOptional(){return hNt(this)},nullable(){return che(this)},nullish(){return lhe(che(this))},nonoptional(r){return yNt(this,r)},array(){return Xn(this)},or(r){return $6([this,r])},and(r){return aNt(this,r)},transform(r){return uhe(this,cNt(r))},default(r){return pNt(this,r)},prefault(r){return mNt(this,r)},catch(r){return bNt(this,r)},pipe(r){return uhe(this,r)},readonly(){return TNt(this)},describe(r){const n=this.clone();return rk.add(n,{description:r}),n},meta(...r){if(r.length===0)return rk.get(this);const n=this.clone();return rk.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=rk.get(t))==null?void 0:r.description},configurable:!0}),t)),uAe=Ct("_ZodString",(t,e)=>{bQ.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>qLt(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,h7(t,"_ZodString",{regex(...n){return this.check(MLt(...n))},includes(...n){return this.check(LLt(...n))},startsWith(...n){return this.check(ILt(...n))},endsWith(...n){return this.check(NLt(...n))},min(...n){return this.check(iL(...n))},max(...n){return this.check(iAe(...n))},length(...n){return this.check(sAe(...n))},nonempty(...n){return this.check(iL(1,...n))},lowercase(n){return this.check(RLt(n))},uppercase(n){return this.check(_Lt(n))},trim(){return this.check(OLt())},normalize(...n){return this.check(DLt(...n))},toLowerCase(){return this.check(PLt())},toUpperCase(){return this.check($Lt())},slugify(){return this.check(BLt())}})}),NIt=Ct("ZodString",(t,e)=>{bQ.init(t,e),uAe.init(t,e),t.email=r=>t.check(Q_t(DIt,r)),t.url=r=>t.check(nLt(OIt,r)),t.jwt=r=>t.check(vLt(KIt,r)),t.emoji=r=>t.check(iLt(PIt,r)),t.guid=r=>t.check(ehe(she,r)),t.uuid=r=>t.check(J_t(n8,r)),t.uuidv4=r=>t.check(eLt(n8,r)),t.uuidv6=r=>t.check(tLt(n8,r)),t.uuidv7=r=>t.check(rLt(n8,r)),t.nanoid=r=>t.check(sLt($It,r)),t.guid=r=>t.check(ehe(she,r)),t.cuid=r=>t.check(aLt(BIt,r)),t.cuid2=r=>t.check(oLt(FIt,r)),t.ulid=r=>t.check(lLt(zIt,r)),t.base64=r=>t.check(gLt(YIt,r)),t.base64url=r=>t.check(mLt(jIt,r)),t.xid=r=>t.check(cLt(VIt,r)),t.ksuid=r=>t.check(uLt(HIt,r)),t.ipv4=r=>t.check(hLt(GIt,r)),t.ipv6=r=>t.check(dLt(WIt,r)),t.cidrv4=r=>t.check(fLt(qIt,r)),t.cidrv6=r=>t.check(pLt(UIt,r)),t.e164=r=>t.check(yLt(XIt,r)),t.datetime=r=>t.check(fIt(r)),t.date=r=>t.check(gIt(r)),t.time=r=>t.check(yIt(r)),t.duration=r=>t.check(bIt(r))});function Ze(t){return Z_t(NIt,t)}const Ss=Ct("ZodStringFormat",(t,e)=>{hs.init(t,e),uAe.init(t,e)}),DIt=Ct("ZodEmail",(t,e)=>{i_t.init(t,e),Ss.init(t,e)}),she=Ct("ZodGUID",(t,e)=>{r_t.init(t,e),Ss.init(t,e)}),n8=Ct("ZodUUID",(t,e)=>{n_t.init(t,e),Ss.init(t,e)}),OIt=Ct("ZodURL",(t,e)=>{s_t.init(t,e),Ss.init(t,e)}),PIt=Ct("ZodEmoji",(t,e)=>{a_t.init(t,e),Ss.init(t,e)}),$It=Ct("ZodNanoID",(t,e)=>{o_t.init(t,e),Ss.init(t,e)}),BIt=Ct("ZodCUID",(t,e)=>{l_t.init(t,e),Ss.init(t,e)}),FIt=Ct("ZodCUID2",(t,e)=>{c_t.init(t,e),Ss.init(t,e)}),zIt=Ct("ZodULID",(t,e)=>{u_t.init(t,e),Ss.init(t,e)}),VIt=Ct("ZodXID",(t,e)=>{h_t.init(t,e),Ss.init(t,e)}),HIt=Ct("ZodKSUID",(t,e)=>{d_t.init(t,e),Ss.init(t,e)}),GIt=Ct("ZodIPv4",(t,e)=>{y_t.init(t,e),Ss.init(t,e)}),WIt=Ct("ZodIPv6",(t,e)=>{v_t.init(t,e),Ss.init(t,e)}),qIt=Ct("ZodCIDRv4",(t,e)=>{b_t.init(t,e),Ss.init(t,e)}),UIt=Ct("ZodCIDRv6",(t,e)=>{x_t.init(t,e),Ss.init(t,e)}),YIt=Ct("ZodBase64",(t,e)=>{w_t.init(t,e),Ss.init(t,e)}),jIt=Ct("ZodBase64URL",(t,e)=>{C_t.init(t,e),Ss.init(t,e)}),XIt=Ct("ZodE164",(t,e)=>{k_t.init(t,e),Ss.init(t,e)}),KIt=Ct("ZodJWT",(t,e)=>{E_t.init(t,e),Ss.init(t,e)}),hAe=Ct("ZodNumber",(t,e)=>{J7e.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>ULt(t,n,i),h7(t,"ZodNumber",{gt(n,i){return this.check(rhe(n,i))},gte(n,i){return this.check(TB(n,i))},min(n,i){return this.check(TB(n,i))},lt(n,i){return this.check(the(n,i))},lte(n,i){return this.check(wB(n,i))},max(n,i){return this.check(wB(n,i))},int(n){return this.check(ahe(n))},safe(n){return this.check(ahe(n))},positive(n){return this.check(rhe(0,n))},nonnegative(n){return this.check(TB(0,n))},negative(n){return this.check(the(0,n))},nonpositive(n){return this.check(wB(0,n))},multipleOf(n,i){return this.check(nhe(n,i))},step(n,i){return this.check(nhe(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 sa(t){return CLt(hAe,t)}const ZIt=Ct("ZodNumberFormat",(t,e)=>{A_t.init(t,e),hAe.init(t,e)});function ahe(t){return kLt(ZIt,t)}const QIt=Ct("ZodBoolean",(t,e)=>{M_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YLt(t,r,n)});function ni(t){return SLt(QIt,t)}const JIt=Ct("ZodUnknown",(t,e)=>{R_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XLt()});function Dd(){return ELt(JIt)}const eNt=Ct("ZodNever",(t,e)=>{__t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jLt(t,r,n)});function tNt(t){return ALt(eNt,t)}const rNt=Ct("ZodArray",(t,e)=>{L_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eIt(t,r,n,i),t.element=e.element,h7(t,"ZodArray",{min(r,n){return this.check(iL(r,n))},nonempty(r){return this.check(iL(1,r))},max(r,n){return this.check(iAe(r,n))},length(r,n){return this.check(sAe(r,n))},unwrap(){return this.element}})});function Xn(t,e){return FLt(rNt,t,e)}const nNt=Ct("ZodObject",(t,e)=>{N_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tIt(t,r,n,i),bi(t,"shape",()=>e.shape),h7(t,"ZodObject",{keyof(){return ci(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:tNt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return QRt(this,r)},safeExtend(r){return JRt(this,r)},merge(r){return e9t(this,r)},pick(r){return KRt(this,r)},omit(r){return ZRt(this,r)},partial(...r){return t9t(pAe,this,r[0])},required(...r){return r9t(gAe,this,r[0])}})});function Zt(t,e){const r={type:"object",shape:t??{},..._r(e)};return new nNt(r)}const dAe=Ct("ZodUnion",(t,e)=>{rAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rIt(t,r,n,i),t.options=e.options});function $6(t,e){return new dAe({type:"union",options:t,..._r(e)})}const iNt=Ct("ZodDiscriminatedUnion",(t,e)=>{dAe.init(t,e),D_t.init(t,e)});function fAe(t,e,r){return new iNt({type:"union",options:e,discriminator:t,..._r(r)})}const sNt=Ct("ZodIntersection",(t,e)=>{O_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nIt(t,r,n,i)});function aNt(t,e){return new sNt({type:"intersection",left:t,right:e})}const ohe=Ct("ZodRecord",(t,e)=>{P_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iIt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function ED(t,e,r){return!e||!e._zod?new ohe({type:"record",keyType:Ze(),valueType:t,..._r(e)}):new ohe({type:"record",keyType:t,valueType:e,..._r(r)})}const gW=Ct("ZodEnum",(t,e)=>{$_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>KLt(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 gW({...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 gW({...e,checks:[],..._r(i),entries:s})}});function ci(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new gW({type:"enum",entries:r,..._r(e)})}const oNt=Ct("ZodLiteral",(t,e)=>{B_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZLt(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 na(t,e){return new oNt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const lNt=Ct("ZodTransform",(t,e)=>{F_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JLt(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new B7e(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(P6(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(P6(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 cNt(t){return new lNt({type:"transform",transform:t})}const pAe=Ct("ZodOptional",(t,e)=>{nAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lhe(t){return new pAe({type:"optional",innerType:t})}const uNt=Ct("ZodExactOptional",(t,e)=>{z_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function hNt(t){return new uNt({type:"optional",innerType:t})}const dNt=Ct("ZodNullable",(t,e)=>{V_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});function che(t){return new dNt({type:"nullable",innerType:t})}const fNt=Ct("ZodDefault",(t,e)=>{H_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.removeDefault=t.unwrap});function pNt(t,e){return new fNt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():V7e(e)}})}const gNt=Ct("ZodPrefault",(t,e)=>{G_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function mNt(t,e){return new gNt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():V7e(e)}})}const gAe=Ct("ZodNonOptional",(t,e)=>{W_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 yNt(t,e){return new gAe({type:"nonoptional",innerType:t,..._r(e)})}const vNt=Ct("ZodCatch",(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,t.removeCatch=t.unwrap});function bNt(t,e){return new vNt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const xNt=Ct("ZodPipe",(t,e)=>{U_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uIt(t,r,n,i),t.in=e.in,t.out=e.out});function uhe(t,e){return new xNt({type:"pipe",in:t,out:e})}const wNt=Ct("ZodReadonly",(t,e)=>{Y_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function TNt(t){return new wNt({type:"readonly",innerType:t})}const CNt=Ct("ZodCustom",(t,e)=>{j_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QLt(t,r)});function kNt(t,e={}){return zLt(CNt,t,e)}function SNt(t,e){return VLt(t,e)}const mW=["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"],ENt=["professional","friendly","casual","direct"],ANt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt"],MNt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],RNt=4,hhe=4*1024*1024,_Nt=256*1024,LNt=8*1024*1024,mAe=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},INt=t=>t.startsWith("text/")||t==="application/json",xQ=["none","target-language","tone"],wQ=["append","replace","both"],aL=Ze().uuid();Zt({content:Ze().trim().min(1).max(500),sourceTurnId:aL.optional()}).strict();Zt({content:Ze().trim().min(1).max(500),version:sa().int().positive()}).strict();const NNt=Zt({memoId:Ze().trim().min(1).max(100).optional(),notebookId:Ze().trim().min(1).max(100).optional(),notebookTitle:Ze().trim().max(160).optional(),title:Ze().trim().max(160).optional(),selectionMarkdown:Ze().max(2e3).optional(),contentMarkdown:Ze().max(4e3).optional(),contentTruncated:ni().optional(),diagramKind:ci(["mind-map","flowchart","architecture"]).optional()}).strict(),DNt=Zt({type:ci(["memo","notebook","tag"]),id:Ze().trim().min(1).max(100),title:Ze().trim().max(160).optional()}).strict();Zt({id:aL,threadId:aL,message:Ze().trim().min(1).max(4e3),useMemory:ni().default(!0),allowNotes:ni().default(!1),allowWrites:ni().optional(),locale:ci(["zh-CN","en-US","ja"]).default("en-US"),focus:NNt.optional(),mentions:Xn(DNt).max(8).optional(),attachmentIds:Xn(Ze().uuid()).max(4).optional()}).strict();Zt({id:Ze().trim().min(1).max(80),prompt:Ze().trim().min(1).max(200),inputType:ci(["free_text","single_select","multi_select"]),options:Xn(Zt({id:Ze().trim().min(1).max(80),label:Ze().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const ONt=Zt({questionId:Ze().trim().min(1).max(80),optionIds:Xn(Ze().trim().min(1).max(80)).max(6).optional(),text:Ze().trim().max(400).optional()}).strict();Zt({answers:Xn(ONt).max(3).optional()}).strict();Zt({name:Ze().trim().min(1).max(80),input:ED(Ze(),Dd()).default({}),callId:Ze().trim().min(1).max(100).optional(),response:Ze().max(16e3).optional(),process:Ze().max(32e3).optional()}).strict();Zt({response:Ze().max(16e3),process:Ze().max(32e3).optional()}).strict();Zt({response:Ze().max(16e3),process:Ze().max(32e3).optional(),status:ci(["completed","interrupted","failed"]),inputTokens:sa().int().nonnegative().optional(),outputTokens:sa().int().nonnegative().optional()}).strict();Zt({enabled:ni(),learningEnabled:ni().optional(),useMemory:ni().optional(),version:sa().int().nonnegative()}).strict();const PNt=Ze().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");Zt({suggestion:Zt({kind:ci(["insight","merge","append","move","tag"]),title:Ze().trim().min(1).max(60),body:PNt,sourceIds:Xn(Ze().min(1).max(100)).min(1).max(5),memoryIds:Xn(Ze().max(100)).max(8).optional(),notebookId:Ze().max(100).nullable().optional(),tags:Xn(Ze().min(1).max(40)).max(5).optional(),targetId:Ze().max(100).nullable()}).nullable()});Zt({turnId:aL,output:Dd()}).strict();const TQ=Ze().trim().min(1).max(400),yAe=Ze().trim().min(1).max(100),$Nt=Zt({kind:na("merge"),memoIds:Xn(yAe).min(2).max(5),title:Ze().trim().min(1).max(160),reason:TQ}).strict(),BNt=Zt({kind:na("tag"),memoId:yAe,tags:Xn(Ze().trim().min(1).max(40)).min(1).max(5),reason:TQ}).strict(),FNt=Zt({kind:na("tool"),toolName:Ze().min(1).max(80),arguments:ED(Ze(),Dd()),reason:TQ}).strict();fAe("kind",[$Nt,BNt,FNt]);Zt({version:$6([na(1),na(2)]),memories:Xn(Zt({content:Ze().trim().min(1).max(500),kind:ci(["explicit","inferred"]).optional()})).max(50),controls:Zt({useMemory:ni(),learningEnabled:ni()}).optional()}).strict();const Uv=(t,e,r,n)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n}});Uv({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("")}),Uv({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 の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"}),Uv({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 書式は残してください。整えた本文だけを返してください。"}),Uv({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 書式は残してください。簡潔にした本文だけを返してください。"}),Uv({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 のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"}),Uv({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 zNt=new Set([Wf,rb]),hC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},dhe="edgeever-attachment-kind-",CQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),vAe=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(dhe)):[],i=ry(e,CQ(t));return[...n,"edgeever-attachment-link",`${dhe}${i}`].join(" ")},VNt=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=>wg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=wg(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":RMt(n,r,e)}}}}}]}}),fhe=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/")},HNt=t=>{var e;return(e=t.marks)!=null&&e.some(fhe)?{...t,marks:t.marks.map(r=>{var n,i;return fhe(r)?{...r,attrs:{...r.attrs,class:vAe(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:CQ(t.text)}}:r})}:t},GNt=t=>{var a;const e=hC(t,"url"),r=hC(t,"label")||hC(t,"filename")||"Attachment",n=hC(t,"mimeType"),i=hC(t,"filename")||CQ(r),s=wg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:vAe(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},WNt=t=>{const e=r=>zNt.has(r.type)?GNt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?HNt(r):r;return{...t,content:t.content.map(r=>e(r))}},qNt="edgeever-zip",UNt=2,vh=Ze().datetime();Zt({format:na(qNt),formatVersion:$6([na(1),na(UNt)]),schemaVersion:sa().int().positive(),edgeeverVersion:Ze().trim().min(1),buildId:Ze().trim().min(1),exportedAt:vh,includesTrash:na(!1),counts:Zt({notebooks:sa().int().min(0),memos:sa().int().min(0),revisions:sa().int().min(0),resources:sa().int().min(0),prompts:sa().int().min(0).optional()})});const YNt=Zt({id:Ze().trim().min(1),parentId:Ze().trim().min(1).nullable(),name:Ze().trim().min(1).max(80),slug:Ze().nullable(),icon:Ze().nullable(),color:Ze().nullable(),sortOrder:sa().int(),createdAt:vh,updatedAt:vh}),jNt=Zt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),revision:sa().int().min(0),title:Ze().nullable(),tags:Xn(Ze()),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),createdBy:Ze(),createdAt:vh}),XNt=Zt({id:Ze().trim().min(1),notebookId:Ze().trim().min(1),title:Ze().nullable(),excerpt:Ze(),tags:Xn(Ze()),isPinned:ni(),isArchived:ni(),isDeleted:ni(),revision:sa().int().min(0),createdAt:vh,updatedAt:vh,deletedAt:vh.nullable(),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),sourceMemoIds:Xn(Ze()),mergeSourceCount:sa().int().min(0),mergedIntoMemoId:Ze().nullable()}),bAe=Zt({memo:XNt,revisions:Xn(jNt),resources:Xn(Zt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),originalMemoId:Ze().nullable(),kind:ci(["image","attachment"]),mimeType:Ze().nullable(),filename:Ze().nullable(),byteSize:sa().int().min(0),sha256:Ze().nullable(),width:sa().int().positive().nullable(),height:sa().int().positive().nullable(),createdAt:vh,updatedAt:vh,archivePath:Ze().trim().min(1)}))});Zt({notebooks:Xn(YNt).min(1).max(100)});Zt({memos:Xn(bAe).min(1).max(10)});const KNt=Zt({id:Ze().trim().min(1).max(200),origin:ci(["default","custom"]),seedKey:ci(mW.filter(t=>t!=="custom")).nullable(),action:ci(mW),parameterKind:ci(xQ),resultMode:ci(wQ),nameCustomized:ni(),descriptionCustomized:ni(),instructionCustomized:ni(),name:Ze().trim().min(1).max(80),description:Ze().max(200).nullable(),instruction:Ze().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."})});Zt({prompts:Xn(KNt).max(100)});bAe.shape.resources.element;const dC=(t,e,r,n)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n}});dC({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 cAe(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:sL(e,"input",t.processors),output:sL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function al(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 al(n.element,r);if(n.type==="set")return al(n.valueType,r);if(n.type==="lazy")return al(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 al(n.innerType,r);if(n.type==="intersection")return al(n.left,r)||al(n.right,r);if(n.type==="record"||n.type==="map")return al(n.keyType,r)||al(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:al(n.in,r)||al(n.out,r);if(n.type==="object"){for(const i in n.shape)if(al(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(al(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(al(i,r))return!0;return!!(n.rest&&al(n.rest,r))}return!1}const WLt=(t,e={})=>r=>{const n=oAe({...r,processors:e});return da(t,n),lAe(n,t),cAe(n,t)},sL=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=oAe({...i??{},target:s,io:e,processors:r});return da(t,a),lAe(a,t),cAe(a,t)},qLt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ULt=(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=qLt[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}))])}},YLt=(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)},jLt=(t,e,r,n)=>{r.type="boolean"},XLt=(t,e,r,n)=>{r.not={}},KLt=(t,e,r,n)=>{},ZLt=(t,e,r,n)=>{const i=t._zod.def,s=z7e(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},QLt=(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},JLt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},eIt=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},tIt=(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=da(s.element,e,{...n,path:[...n.path,"items"]})},rIt=(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]=da(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=da(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},nIt=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>da(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},iIt=(t,e,r,n)=>{const i=t._zod.def,s=da(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=da(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},sIt=(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=da(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=da(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=da(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)}},aIt=(t,e,r,n)=>{const i=t._zod.def,s=da(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"}]},oIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},lIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},cIt=(t,e,r,n)=>{const i=t._zod.def;da(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)))},uIt=(t,e,r,n)=>{const i=t._zod.def;da(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},hIt=(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;da(a,e,n);const o=e.seen.get(t);o.ref=a},dIt=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},uAe=(t,e,r,n)=>{const i=t._zod.def;da(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},fIt=Ct("ZodISODateTime",(t,e)=>{p_t.init(t,e),Ss.init(t,e)});function pIt(t){return xLt(fIt,t)}const gIt=Ct("ZodISODate",(t,e)=>{g_t.init(t,e),Ss.init(t,e)});function mIt(t){return wLt(gIt,t)}const yIt=Ct("ZodISOTime",(t,e)=>{m_t.init(t,e),Ss.init(t,e)});function vIt(t){return TLt(yIt,t)}const bIt=Ct("ZodISODuration",(t,e)=>{y_t.init(t,e),Ss.init(t,e)});function xIt(t){return CLt(bIt,t)}const wIt=(t,e)=>{W7e.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>a9t(t,r)},flatten:{value:r=>s9t(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,fW,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,fW,2)}},isEmpty:{get(){return t.issues.length===0}}})},$u=Ct("ZodError",wIt,{Parent:Error}),TIt=yQ($u),CIt=vQ($u),kIt=CD($u),SIt=kD($u),EIt=c9t($u),AIt=u9t($u),MIt=h9t($u),RIt=d9t($u),_It=f9t($u),LIt=p9t($u),IIt=g9t($u),NIt=m9t($u),she=new WeakMap;function h7(t,e,r){const n=Object.getPrototypeOf(t);let i=she.get(n);if(i||(i=new Set,she.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:sL(t,"input"),output:sL(t,"output")}}),t.toJSONSchema=WLt(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>TIt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>kIt(t,r,n),t.parseAsync=async(r,n)=>CIt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>SIt(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>EIt(t,r,n),t.decode=(r,n)=>AIt(t,r,n),t.encodeAsync=async(r,n)=>MIt(t,r,n),t.decodeAsync=async(r,n)=>RIt(t,r,n),t.safeEncode=(r,n)=>_It(t,r,n),t.safeDecode=(r,n)=>LIt(t,r,n),t.safeEncodeAsync=async(r,n)=>IIt(t,r,n),t.safeDecodeAsync=async(r,n)=>NIt(t,r,n),h7(t,"ZodType",{check(...r){const n=this.def;return this.clone(Jg(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 em(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(SNt(r,n))},superRefine(r,n){return this.check(ENt(r,n))},overwrite(r){return this.check(p3(r))},optional(){return che(this)},exactOptional(){return dNt(this)},nullable(){return uhe(this)},nullish(){return che(uhe(this))},nonoptional(r){return vNt(this,r)},array(){return Xn(this)},or(r){return $6([this,r])},and(r){return oNt(this,r)},transform(r){return hhe(this,uNt(r))},default(r){return gNt(this,r)},prefault(r){return yNt(this,r)},catch(r){return xNt(this,r)},pipe(r){return hhe(this,r)},readonly(){return CNt(this)},describe(r){const n=this.clone();return rk.add(n,{description:r}),n},meta(...r){if(r.length===0)return rk.get(this);const n=this.clone();return rk.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=rk.get(t))==null?void 0:r.description},configurable:!0}),t)),hAe=Ct("_ZodString",(t,e)=>{bQ.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>ULt(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,h7(t,"_ZodString",{regex(...n){return this.check(RLt(...n))},includes(...n){return this.check(ILt(...n))},startsWith(...n){return this.check(NLt(...n))},endsWith(...n){return this.check(DLt(...n))},min(...n){return this.check(iL(...n))},max(...n){return this.check(sAe(...n))},length(...n){return this.check(aAe(...n))},nonempty(...n){return this.check(iL(1,...n))},lowercase(n){return this.check(_Lt(n))},uppercase(n){return this.check(LLt(n))},trim(){return this.check(PLt())},normalize(...n){return this.check(OLt(...n))},toLowerCase(){return this.check($Lt())},toUpperCase(){return this.check(BLt())},slugify(){return this.check(FLt())}})}),DIt=Ct("ZodString",(t,e)=>{bQ.init(t,e),hAe.init(t,e),t.email=r=>t.check(J_t(OIt,r)),t.url=r=>t.check(iLt(PIt,r)),t.jwt=r=>t.check(bLt(ZIt,r)),t.emoji=r=>t.check(sLt($It,r)),t.guid=r=>t.check(the(ahe,r)),t.uuid=r=>t.check(eLt(n8,r)),t.uuidv4=r=>t.check(tLt(n8,r)),t.uuidv6=r=>t.check(rLt(n8,r)),t.uuidv7=r=>t.check(nLt(n8,r)),t.nanoid=r=>t.check(aLt(BIt,r)),t.guid=r=>t.check(the(ahe,r)),t.cuid=r=>t.check(oLt(FIt,r)),t.cuid2=r=>t.check(lLt(zIt,r)),t.ulid=r=>t.check(cLt(VIt,r)),t.base64=r=>t.check(mLt(jIt,r)),t.base64url=r=>t.check(yLt(XIt,r)),t.xid=r=>t.check(uLt(HIt,r)),t.ksuid=r=>t.check(hLt(GIt,r)),t.ipv4=r=>t.check(dLt(WIt,r)),t.ipv6=r=>t.check(fLt(qIt,r)),t.cidrv4=r=>t.check(pLt(UIt,r)),t.cidrv6=r=>t.check(gLt(YIt,r)),t.e164=r=>t.check(vLt(KIt,r)),t.datetime=r=>t.check(pIt(r)),t.date=r=>t.check(mIt(r)),t.time=r=>t.check(vIt(r)),t.duration=r=>t.check(xIt(r))});function Ze(t){return Q_t(DIt,t)}const Ss=Ct("ZodStringFormat",(t,e)=>{hs.init(t,e),hAe.init(t,e)}),OIt=Ct("ZodEmail",(t,e)=>{s_t.init(t,e),Ss.init(t,e)}),ahe=Ct("ZodGUID",(t,e)=>{n_t.init(t,e),Ss.init(t,e)}),n8=Ct("ZodUUID",(t,e)=>{i_t.init(t,e),Ss.init(t,e)}),PIt=Ct("ZodURL",(t,e)=>{a_t.init(t,e),Ss.init(t,e)}),$It=Ct("ZodEmoji",(t,e)=>{o_t.init(t,e),Ss.init(t,e)}),BIt=Ct("ZodNanoID",(t,e)=>{l_t.init(t,e),Ss.init(t,e)}),FIt=Ct("ZodCUID",(t,e)=>{c_t.init(t,e),Ss.init(t,e)}),zIt=Ct("ZodCUID2",(t,e)=>{u_t.init(t,e),Ss.init(t,e)}),VIt=Ct("ZodULID",(t,e)=>{h_t.init(t,e),Ss.init(t,e)}),HIt=Ct("ZodXID",(t,e)=>{d_t.init(t,e),Ss.init(t,e)}),GIt=Ct("ZodKSUID",(t,e)=>{f_t.init(t,e),Ss.init(t,e)}),WIt=Ct("ZodIPv4",(t,e)=>{v_t.init(t,e),Ss.init(t,e)}),qIt=Ct("ZodIPv6",(t,e)=>{b_t.init(t,e),Ss.init(t,e)}),UIt=Ct("ZodCIDRv4",(t,e)=>{x_t.init(t,e),Ss.init(t,e)}),YIt=Ct("ZodCIDRv6",(t,e)=>{w_t.init(t,e),Ss.init(t,e)}),jIt=Ct("ZodBase64",(t,e)=>{T_t.init(t,e),Ss.init(t,e)}),XIt=Ct("ZodBase64URL",(t,e)=>{k_t.init(t,e),Ss.init(t,e)}),KIt=Ct("ZodE164",(t,e)=>{S_t.init(t,e),Ss.init(t,e)}),ZIt=Ct("ZodJWT",(t,e)=>{A_t.init(t,e),Ss.init(t,e)}),dAe=Ct("ZodNumber",(t,e)=>{eAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>YLt(t,n,i),h7(t,"ZodNumber",{gt(n,i){return this.check(nhe(n,i))},gte(n,i){return this.check(TB(n,i))},min(n,i){return this.check(TB(n,i))},lt(n,i){return this.check(rhe(n,i))},lte(n,i){return this.check(wB(n,i))},max(n,i){return this.check(wB(n,i))},int(n){return this.check(ohe(n))},safe(n){return this.check(ohe(n))},positive(n){return this.check(nhe(0,n))},nonnegative(n){return this.check(TB(0,n))},negative(n){return this.check(rhe(0,n))},nonpositive(n){return this.check(wB(0,n))},multipleOf(n,i){return this.check(ihe(n,i))},step(n,i){return this.check(ihe(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 sa(t){return kLt(dAe,t)}const QIt=Ct("ZodNumberFormat",(t,e)=>{M_t.init(t,e),dAe.init(t,e)});function ohe(t){return SLt(QIt,t)}const JIt=Ct("ZodBoolean",(t,e)=>{R_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jLt(t,r,n)});function ni(t){return ELt(JIt,t)}const eNt=Ct("ZodUnknown",(t,e)=>{__t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KLt()});function Dd(){return ALt(eNt)}const tNt=Ct("ZodNever",(t,e)=>{L_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XLt(t,r,n)});function rNt(t){return MLt(tNt,t)}const nNt=Ct("ZodArray",(t,e)=>{I_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tIt(t,r,n,i),t.element=e.element,h7(t,"ZodArray",{min(r,n){return this.check(iL(r,n))},nonempty(r){return this.check(iL(1,r))},max(r,n){return this.check(sAe(r,n))},length(r,n){return this.check(aAe(r,n))},unwrap(){return this.element}})});function Xn(t,e){return zLt(nNt,t,e)}const iNt=Ct("ZodObject",(t,e)=>{D_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rIt(t,r,n,i),bi(t,"shape",()=>e.shape),h7(t,"ZodObject",{keyof(){return ci(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:rNt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return JRt(this,r)},safeExtend(r){return e9t(this,r)},merge(r){return t9t(this,r)},pick(r){return ZRt(this,r)},omit(r){return QRt(this,r)},partial(...r){return r9t(gAe,this,r[0])},required(...r){return n9t(mAe,this,r[0])}})});function Zt(t,e){const r={type:"object",shape:t??{},..._r(e)};return new iNt(r)}const fAe=Ct("ZodUnion",(t,e)=>{nAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nIt(t,r,n,i),t.options=e.options});function $6(t,e){return new fAe({type:"union",options:t,..._r(e)})}const sNt=Ct("ZodDiscriminatedUnion",(t,e)=>{fAe.init(t,e),O_t.init(t,e)});function pAe(t,e,r){return new sNt({type:"union",options:e,discriminator:t,..._r(r)})}const aNt=Ct("ZodIntersection",(t,e)=>{P_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iIt(t,r,n,i)});function oNt(t,e){return new aNt({type:"intersection",left:t,right:e})}const lhe=Ct("ZodRecord",(t,e)=>{$_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sIt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function ED(t,e,r){return!e||!e._zod?new lhe({type:"record",keyType:Ze(),valueType:t,..._r(e)}):new lhe({type:"record",keyType:t,valueType:e,..._r(r)})}const gW=Ct("ZodEnum",(t,e)=>{B_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(n,i,s)=>ZLt(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 gW({...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 gW({...e,checks:[],..._r(i),entries:s})}});function ci(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new gW({type:"enum",entries:r,..._r(e)})}const lNt=Ct("ZodLiteral",(t,e)=>{F_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QLt(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 na(t,e){return new lNt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const cNt=Ct("ZodTransform",(t,e)=>{z_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eIt(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new F7e(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(P6(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(P6(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 uNt(t){return new cNt({type:"transform",transform:t})}const gAe=Ct("ZodOptional",(t,e)=>{iAe.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function che(t){return new gAe({type:"optional",innerType:t})}const hNt=Ct("ZodExactOptional",(t,e)=>{V_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function dNt(t){return new hNt({type:"optional",innerType:t})}const fNt=Ct("ZodNullable",(t,e)=>{H_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 uhe(t){return new fNt({type:"nullable",innerType:t})}const pNt=Ct("ZodDefault",(t,e)=>{G_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function gNt(t,e){return new pNt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H7e(e)}})}const mNt=Ct("ZodPrefault",(t,e)=>{W_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 yNt(t,e){return new mNt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H7e(e)}})}const mAe=Ct("ZodNonOptional",(t,e)=>{q_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});function vNt(t,e){return new mAe({type:"nonoptional",innerType:t,..._r(e)})}const bNt=Ct("ZodCatch",(t,e)=>{U_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function xNt(t,e){return new bNt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const wNt=Ct("ZodPipe",(t,e)=>{Y_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hIt(t,r,n,i),t.in=e.in,t.out=e.out});function hhe(t,e){return new wNt({type:"pipe",in:t,out:e})}const TNt=Ct("ZodReadonly",(t,e)=>{j_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dIt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function CNt(t){return new TNt({type:"readonly",innerType:t})}const kNt=Ct("ZodCustom",(t,e)=>{X_t.init(t,e),ks.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JLt(t,r)});function SNt(t,e={}){return VLt(kNt,t,e)}function ENt(t,e){return HLt(t,e)}const mW=["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"],ANt=["professional","friendly","casual","direct"],MNt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt"],RNt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],_Nt=4,dhe=4*1024*1024,LNt=256*1024,INt=8*1024*1024,yAe=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},NNt=t=>t.startsWith("text/")||t==="application/json",xQ=["none","target-language","tone"],wQ=["append","replace","both"],aL=Ze().uuid();Zt({content:Ze().trim().min(1).max(500),sourceTurnId:aL.optional()}).strict();Zt({content:Ze().trim().min(1).max(500),version:sa().int().positive()}).strict();const DNt=Zt({memoId:Ze().trim().min(1).max(100).optional(),notebookId:Ze().trim().min(1).max(100).optional(),notebookTitle:Ze().trim().max(160).optional(),title:Ze().trim().max(160).optional(),selectionMarkdown:Ze().max(2e3).optional(),contentMarkdown:Ze().max(4e3).optional(),contentTruncated:ni().optional(),diagramKind:ci(["mind-map","flowchart","architecture"]).optional()}).strict(),ONt=Zt({type:ci(["memo","notebook","tag"]),id:Ze().trim().min(1).max(100),title:Ze().trim().max(160).optional()}).strict();Zt({id:aL,threadId:aL,message:Ze().trim().min(1).max(4e3),useMemory:ni().default(!0),allowNotes:ni().default(!1),allowWrites:ni().optional(),locale:ci(["zh-CN","en-US","ja"]).default("en-US"),focus:DNt.optional(),mentions:Xn(ONt).max(8).optional(),attachmentIds:Xn(Ze().uuid()).max(4).optional()}).strict();Zt({id:Ze().trim().min(1).max(80),prompt:Ze().trim().min(1).max(200),inputType:ci(["free_text","single_select","multi_select"]),options:Xn(Zt({id:Ze().trim().min(1).max(80),label:Ze().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const PNt=Zt({questionId:Ze().trim().min(1).max(80),optionIds:Xn(Ze().trim().min(1).max(80)).max(6).optional(),text:Ze().trim().max(400).optional()}).strict();Zt({answers:Xn(PNt).max(3).optional()}).strict();Zt({name:Ze().trim().min(1).max(80),input:ED(Ze(),Dd()).default({}),callId:Ze().trim().min(1).max(100).optional(),response:Ze().max(16e3).optional(),process:Ze().max(32e3).optional()}).strict();Zt({response:Ze().max(16e3),process:Ze().max(32e3).optional()}).strict();Zt({response:Ze().max(16e3),process:Ze().max(32e3).optional(),status:ci(["completed","interrupted","failed"]),inputTokens:sa().int().nonnegative().optional(),outputTokens:sa().int().nonnegative().optional()}).strict();Zt({enabled:ni(),learningEnabled:ni().optional(),useMemory:ni().optional(),version:sa().int().nonnegative()}).strict();const $Nt=Ze().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");Zt({suggestion:Zt({kind:ci(["insight","merge","append","move","tag"]),title:Ze().trim().min(1).max(60),body:$Nt,sourceIds:Xn(Ze().min(1).max(100)).min(1).max(5),memoryIds:Xn(Ze().max(100)).max(8).optional(),notebookId:Ze().max(100).nullable().optional(),tags:Xn(Ze().min(1).max(40)).max(5).optional(),targetId:Ze().max(100).nullable()}).nullable()});Zt({turnId:aL,output:Dd()}).strict();const TQ=Ze().trim().min(1).max(400),vAe=Ze().trim().min(1).max(100),BNt=Zt({kind:na("merge"),memoIds:Xn(vAe).min(2).max(5),title:Ze().trim().min(1).max(160),reason:TQ}).strict(),FNt=Zt({kind:na("tag"),memoId:vAe,tags:Xn(Ze().trim().min(1).max(40)).min(1).max(5),reason:TQ}).strict(),zNt=Zt({kind:na("tool"),toolName:Ze().min(1).max(80),arguments:ED(Ze(),Dd()),reason:TQ}).strict();pAe("kind",[BNt,FNt,zNt]);Zt({version:$6([na(1),na(2)]),memories:Xn(Zt({content:Ze().trim().min(1).max(500),kind:ci(["explicit","inferred"]).optional()})).max(50),controls:Zt({useMemory:ni(),learningEnabled:ni()}).optional()}).strict();const Uv=(t,e,r,n)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n}});Uv({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("")}),Uv({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 の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"}),Uv({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 書式は残してください。整えた本文だけを返してください。"}),Uv({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 書式は残してください。簡潔にした本文だけを返してください。"}),Uv({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 のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"}),Uv({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 VNt=new Set([Wf,rb]),hC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},fhe="edgeever-attachment-kind-",CQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),bAe=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(fhe)):[],i=ry(e,CQ(t));return[...n,"edgeever-attachment-link",`${fhe}${i}`].join(" ")},HNt=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=>wg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=wg(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":_Mt(n,r,e)}}}}}]}}),phe=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/")},GNt=t=>{var e;return(e=t.marks)!=null&&e.some(phe)?{...t,marks:t.marks.map(r=>{var n,i;return phe(r)?{...r,attrs:{...r.attrs,class:bAe(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:CQ(t.text)}}:r})}:t},WNt=t=>{var a;const e=hC(t,"url"),r=hC(t,"label")||hC(t,"filename")||"Attachment",n=hC(t,"mimeType"),i=hC(t,"filename")||CQ(r),s=wg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:bAe(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},qNt=t=>{const e=r=>VNt.has(r.type)?WNt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?GNt(r):r;return{...t,content:t.content.map(r=>e(r))}},UNt="edgeever-zip",YNt=2,vh=Ze().datetime();Zt({format:na(UNt),formatVersion:$6([na(1),na(YNt)]),schemaVersion:sa().int().positive(),edgeeverVersion:Ze().trim().min(1),buildId:Ze().trim().min(1),exportedAt:vh,includesTrash:na(!1),counts:Zt({notebooks:sa().int().min(0),memos:sa().int().min(0),revisions:sa().int().min(0),resources:sa().int().min(0),prompts:sa().int().min(0).optional()})});const jNt=Zt({id:Ze().trim().min(1),parentId:Ze().trim().min(1).nullable(),name:Ze().trim().min(1).max(80),slug:Ze().nullable(),icon:Ze().nullable(),color:Ze().nullable(),sortOrder:sa().int(),createdAt:vh,updatedAt:vh}),XNt=Zt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),revision:sa().int().min(0),title:Ze().nullable(),tags:Xn(Ze()),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),createdBy:Ze(),createdAt:vh}),KNt=Zt({id:Ze().trim().min(1),notebookId:Ze().trim().min(1),title:Ze().nullable(),excerpt:Ze(),tags:Xn(Ze()),isPinned:ni(),isArchived:ni(),isDeleted:ni(),revision:sa().int().min(0),createdAt:vh,updatedAt:vh,deletedAt:vh.nullable(),contentJson:Dd(),contentMarkdown:Ze(),contentText:Ze(),contentHash:Ze(),sourceMemoIds:Xn(Ze()),mergeSourceCount:sa().int().min(0),mergedIntoMemoId:Ze().nullable()}),xAe=Zt({memo:KNt,revisions:Xn(XNt),resources:Xn(Zt({id:Ze().trim().min(1),memoId:Ze().trim().min(1),originalMemoId:Ze().nullable(),kind:ci(["image","attachment"]),mimeType:Ze().nullable(),filename:Ze().nullable(),byteSize:sa().int().min(0),sha256:Ze().nullable(),width:sa().int().positive().nullable(),height:sa().int().positive().nullable(),createdAt:vh,updatedAt:vh,archivePath:Ze().trim().min(1)}))});Zt({notebooks:Xn(jNt).min(1).max(100)});Zt({memos:Xn(xAe).min(1).max(10)});const ZNt=Zt({id:Ze().trim().min(1).max(200),origin:ci(["default","custom"]),seedKey:ci(mW.filter(t=>t!=="custom")).nullable(),action:ci(mW),parameterKind:ci(xQ),resultMode:ci(wQ),nameCustomized:ni(),descriptionCustomized:ni(),instructionCustomized:ni(),name:Ze().trim().min(1).max(80),description:Ze().max(200).nullable(),instruction:Ze().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."})});Zt({prompts:Xn(ZNt).max(100)});xAe.shape.resources.element;const dC=(t,e,r,n)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n}});dC({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录 - @@ -1835,11 +1835,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. - [ ] - [ ] -`});const ZNt=["clay","orange","dawn","teal","azure","violet","plum","pink","slate"],QNt=["native",...ZNt],JNt=8*1024;Zt({name:Ze().trim().min(1).max(80),parentId:Ze().trim().min(1).nullable().optional()});Zt({name:Ze().trim().min(1).max(80).optional(),parentId:Ze().trim().min(1).nullable().optional(),sortOrder:sa().int().optional()});Zt({notebookId:Ze().trim().min(1),title:Ze().trim().max(160).optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional()});Zt({expectedRevision:sa().int().min(0).optional(),expectedContentHash:Ze().length(64).optional(),editSessionId:Ze().trim().min(1).optional(),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional(),isPinned:ni().optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional(),allowDestructiveOverwrite:ni().optional()});Zt({name:Ze().trim().min(1).max(160),description:Ze().trim().max(500).optional(),memoId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});Zt({name:Ze().trim().min(1).max(160).optional(),description:Ze().trim().max(500).nullable().optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional()});Zt({notebookId:Ze().trim().min(1)});const xAe=Zt({pluginId:Ze().trim().min(3).max(200),commandId:Ze().trim().min(1).max(200)}),eDt=Zt({name:Ze().trim().min(1).max(120),taskType:na("plugin-command"),taskPayload:xAe,cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ci(["run-once","skip"]).default("run-once"),isEnabled:ni().default(!0)});eDt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:xAe.optional(),executorDeviceId:Ze().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Zt({pluginId:Ze().trim().min(3).max(200),scheduleKey:Ze().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Ze().trim().min(1).max(120),commandId:Ze().trim().min(1).max(200),cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ci(["run-once","skip"]).default("run-once"),isEnabled:ni().optional()});Zt({scheduledFor:Ze().datetime(),executorDeviceId:Ze().trim().min(16).max(160)});Zt({executorDeviceId:Ze().trim().min(16).max(160),status:ci(["succeeded","failed"]),errorMessage:Ze().trim().max(2e3).nullable().optional()});const phe=Ze().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."});Zt({type:ci(["plugin","theme"]),version:Ze().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:ni(),installedAt:Ze().datetime(),manifestUrl:phe,sourceKind:ci(["marketplace","github","manifest"]),verified:ni(),repositoryUrl:phe.max(500).nullable().optional(),releaseTag:Ze().trim().min(1).max(80).nullable().optional(),publisher:na("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."});Zt({memoIds:Xn(Ze().trim().min(1)).min(1).max(100),notebookId:Ze().trim().min(1)});Zt({memoIds:Xn(Ze().trim().min(1)).min(1).max(100),permanent:ni().optional()});Zt({memoIds:Xn(Ze().trim().min(1)).min(2).max(50),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional()});Zt({username:Ze().trim().min(1).max(80),password:Ze().min(1).max(512),deviceId:Ze().trim().min(16).max(160).optional()});Zt({label:Ze().trim().max(80).nullable()});Zt({currentPassword:Ze().min(1).max(512),newPassword:Ze().min(8).max(512),confirmPassword:Ze().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});Zt({username:Ze().trim().min(1).max(80),displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512)});Zt({displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512).optional(),isDisabled:ni().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");Zt({name:Ze().trim().min(1).max(80),scopes:Xn(Ze().trim().min(1).max(80)).min(1).max(32),expiresAt:Ze().datetime().nullable().optional()});Zt({name:Ze().trim().min(1).max(80)});Zt({filename:Ze().trim().min(1).max(160)});const wAe=Ze().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");fAe("provider",[Zt({provider:na("builtin")}),Zt({provider:na("s3"),displayName:Ze().trim().min(1).max(80),endpoint:wAe,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:ni().default(!0),objectPrefix:Ze().trim().max(500).default("")})]);Zt({endpoint:wAe,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:ni().default(!0),objectPrefix:Ze().trim().max(500).default("")});const TAe=ci(["openai-compatible","anthropic","google"]),CAe=Ze().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."})}),kAe=Zt({provider:TAe,displayName:Ze().trim().min(1).max(80),baseUrl:CAe,isEnabled:ni().default(!0)});kAe.extend({apiKey:Ze().min(1).max(4096),initialModelId:Ze().trim().min(1).max(200).optional()});kAe.extend({apiKey:Ze().min(1).max(4096).optional()});Zt({modelId:Ze().trim().min(1).max(200),provider:TAe.optional(),baseUrl:CAe.optional(),apiKey:Ze().min(1).max(4096).optional()});Zt({modelId:Ze().trim().min(1).max(200),displayName:Ze().trim().min(1).max(200).optional()});Zt({modelConfigId:Ze().trim().min(1).nullable()});const tDt=Zt({filename:Ze().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:ci(MNt),base64Data:Ze().min(1).max(Math.ceil(hhe/3)*4)}).superRefine((t,e)=>{const r=mAe(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=INt(t.mediaType)?_Nt:hhe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});Zt({action:ci(mW),promptId:Ze().trim().min(1).max(200).optional(),locale:Ze().trim().min(2).max(35).optional(),title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),stream:ni().default(!1),targetLanguage:ci(ANt).optional(),tone:ci(ENt).optional(),instruction:Ze().trim().min(1).max(2e3).optional(),attachments:Xn(tDt).max(RNt).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+(mAe(s.base64Data)??0),0)>LNt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});Zt({title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),currentTags:Xn(Ze().trim().min(1).max(200)).max(24).default([]),locale:Ze().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."})});Zt({name:Ze().trim().min(1).max(80),description:Ze().trim().max(200).optional(),instruction:Ze().trim().min(1).max(2e3),parameterKind:ci(xQ).default("none"),resultMode:ci(wQ).default("both")});Zt({name:Ze().trim().min(1).max(80).optional(),description:Ze().trim().max(200).nullable().optional(),instruction:Ze().trim().min(1).max(2e3).optional(),parameterKind:ci(xQ).optional(),resultMode:ci(wQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Zt({passwordProtected:ni()});Zt({bodyFont:ci(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});const up=Ze().regex(/^#[0-9a-f]{6}$/i),ghe=Zt({background:up,text:up,muted:up,heading:up,accent:up,soft:up,codeBackground:up,border:up});Zt({fontSize:$6([na(14),na(16),na(18),na(20)]).nullable().optional(),lineHeight:$6([na(1.5),na(1.65),na(2)]).nullable().optional(),palette:ci(QNt).nullable().optional(),customCss:Ze().refine(t=>new TextEncoder().encode(t).byteLength<=JNt).nullable().optional(),customColors:Zt({light:ghe,dark:ghe}).nullable().optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Zt({password:Ze().min(1).max(64)});const rDt=Zt({fieldId:Ze().trim().min(1).max(80),required:ni()});Zt({enabled:ni(),passwordProtected:ni(),rotatePassword:ni().optional(),title:Ze().trim().max(120),description:Ze().trim().max(1e3),submitLabel:Ze().trim().max(40),fields:Xn(rDt).max(40)});Zt({cells:ED(Ze().max(80),Dd())});const SAe="3.9.3",nDt=SAe,mhe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,yhe=typeof TextEncoder=="function"?new TextEncoder:void 0,iDt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nk=Array.prototype.slice.call(iDt),i8=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(nk),sDt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,vo=String.fromCharCode.bind(String),aDt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),EAe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),AAe=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),MAe=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+=nk[e>>18&63]+nk[e>>12&63]+nk[e>>6&63]+nk[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},kQ=typeof btoa=="function"?t=>btoa(t):MAe,yW=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;ne?EAe(yW(t)):yW(t),oDt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?vo(192|e>>>6)+vo(128|e&63):vo(224|e>>>12&15)+vo(128|e>>>6&63)+vo(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return vo(240|e>>>18&7)+vo(128|e>>>12&63)+vo(128|e>>>6&63)+vo(128|e&63)}},lDt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,RAe=t=>t.replace(lDt,oDt),vhe=yhe?t=>yW(yhe.encode(t)):t=>kQ(RAe(t)),Db=(t,e=!1)=>e?EAe(vhe(t)):vhe(t),bhe=t=>Db(t,!0),cDt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,uDt=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 vo((r>>>10)+55296)+vo((r&1023)+56320);case 3:return vo((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return vo((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},_Ae=t=>t.replace(cDt,uDt),LAe=t=>{if(t=t.replace(/\s+/g,""),!sDt.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(vo(e>>16&255,e>>8&255)):i.push(vo(e>>16&255,e>>8&255,e&255));return i.join("")},SQ=typeof atob=="function"?t=>atob(AAe(t)):LAe,IAe=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>aDt(SQ(t).split("").map(e=>e.charCodeAt(0))),NAe=t=>IAe(DAe(t)),hDt=mhe?t=>mhe.decode(IAe(t)):t=>_Ae(SQ(t)),DAe=t=>AAe(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),vW=t=>hDt(DAe(t)),dDt=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)},OAe=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),PAe=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,OAe(r));t("fromBase64",function(){return vW(this)}),t("toBase64",function(e){return Db(this,e)}),t("toBase64URI",function(){return Db(this,!0)}),t("toBase64URL",function(){return Db(this,!0)}),t("toUint8Array",function(){return NAe(this)})},$Ae=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,OAe(r));t("toBase64",function(e){return WM(this,e)}),t("toBase64URI",function(){return WM(this,!0)}),t("toBase64URL",function(){return WM(this,!0)})},fDt=()=>{PAe(),$Ae()},pDt={version:SAe,VERSION:nDt,atob:SQ,atobPolyfill:LAe,btoa:kQ,btoaPolyfill:MAe,fromBase64:vW,toBase64:Db,encode:Db,encodeURI:bhe,encodeURL:bhe,utob:RAe,btou:_Ae,decode:vW,isValid:dDt,fromUint8Array:WM,toUint8Array:NAe,extendString:PAe,extendUint8Array:$Ae,extendBuiltins:fDt},ll="#f8fafb",cl="#191e1b",xhe={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"}}]},BAe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',gDt=12,mDt=550,yDt=17,vDt=10,bDt=14,bW=34,xDt=10,wDt=(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"}},FAe=["client","frontend","service","database","storage","queue","security","external"],TDt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},CDt={light:{canvas:ll,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:cl,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}}}},AD=(t="light")=>CDt[t],kDt=(t,e)=>{const r=AD(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:FAe.includes(t)?r.nodes[t]:r.nodes.service},SDt=(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,whe=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,EDt=t=>Math.round((t-bW)/2),zAe=(t,e)=>{const r=t??(FAe.includes(e)?TDt[e]:"service");return xhe[r]??xhe.service},ADt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=zAe(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"}]},MDt=(t,e,r,n)=>{const i=AD(e),s=kDt(t,e),a=t==="boundary",o=SDt(t,r.height),l=EDt(r.height),u=a?[]:zAe(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:ADt(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:gDt,fontWeight:a?650:mDt,fontFamily:BAe,lineHeight:a?18:yDt,...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:xDt,y:l,width:bW,height:bW,rx:whe(t),ry:whe(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},RDt=(t,e,r=!1)=>{const n=AD(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"}},xW='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',_Dt=10,LDt=14,IDt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},NDt=(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"}},DDt=(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},ODt=.85,PDt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],$Dt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},BDt=t=>t&&PDt.includes(t)?t:t?$Dt[t]??"brand":"plain",FDt={plain:{light:{canvas:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},VAe=(t="light",e)=>FDt[BDt(e)][t],zDt=(t,e,r)=>{const n=VAe(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},VDt=(t,e,r,n)=>{const i=zDt(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:xW,lineHeight:18}}},HDt=1,GDt=2,WDt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],qDt="plain",UDt=["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"],YDt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],jDt=[...YDt,"rect","diamond","cloud"],XDt={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"},EQ=t=>t&&WDt.includes(t)?t:t?XDt[t]??"brand":qDt,KDt=["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"],ZDt="edgeever-diagram-v1",HAe=new RegExp(`\x3C!--\\s*${ZDt}:([\\s\\S]*?)\\s*-->`),QDt=t=>pDt.decode(t),s8=t=>typeof t=="number"&&Number.isFinite(t),JDt=["mind-map","flowchart","architecture"],eOt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],The=["dependency","request","async","data"],tOt=t=>typeof t=="string"&&KDt.includes(t),rOt=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"||!s8(e.x)||!s8(e.y)||!s8(e.width)||!s8(e.height)||!eOt.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}:{},...tOt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},nOt=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&&!The.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}:{},...The.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},iOt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(HAe))==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(QDt(e));if(!JDt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==GDt:i.schemaVersion!==HDt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=UDt.includes(i.theme)?i.theme:void 0,o=jDt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(rOt),u=i.edges.map(nOt);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}},sOt=t=>(t??"").replace(HAe,"").trimEnd(),aOt=1e5;Zt({prompt:Ze().trim().min(1).max(1e3),locale:Ze().trim().min(2).max(35).optional(),currentTemplate:Ze().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:Ze().max(aOt).default(""),candidates:Xn(Ze().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:Xn(Zt({prompt:Ze().max(1e3),response:Ze().max(2e3)})).max(12).default([])});const GAe={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"}},oOt=Object.fromEntries(Object.entries(GAe).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),wW=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)]},lOt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,hl=(t,e,r)=>{const n=wW(t),i=wW(e);return lOt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},cOt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},WAe=t=>{const[e,r,n]=wW(t).map(cOt);return e*.2126+r*.7152+n*.0722},TW=t=>WAe(t)>.35?"#1C1917":"#FFFCF8",uOt=t=>oOt[EQ(t)].colors,hOt=t=>{const e=EQ(t);return e!=="brand"&&e!=="plain"},CW=(t,e)=>{const r=WAe(t);return e==="dark"?r<.22?hl(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?hl(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},dOt=(t,e)=>uOt(t).map(n=>{const i=CW(n,e),s=e==="dark"?hl(n,"#121518",.72):hl(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?hl(i,"#FFFFFF",.15):hl(i,"#1C1917",.12),text:TW(s),edge:i}}),fOt=(t,e)=>{const r=EQ(t),n=GAe[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:cl}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:ll};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:cl}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:ll};if(e==="dark"){const a=CW(i,"dark");return{topicFill:i,topicText:TW(i),nodeFill:hl(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:hl(a,"#FFFFFF",.15),topicStroke:hl(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:hl(i,"#FFFFFF",.15),canvas:cl}}const s=CW(i,"light");return{topicFill:i,topicText:TW(i),nodeFill:hl(i,"#FFFFFF",.88),nodeText:hl(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:hl(s,"#FFFFFF",.5),topicStroke:hl(i,"#1C1917",.15),mindMapEdge:s,flowEdge:hl(i,"#1C1917",.15),canvas:ll}},AQ=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),pOt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},gOt=13,mOt=18,Che=.7,yOt=(t,e)=>t.split(` -`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&AQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),vOt=(t,e)=>{const r=pOt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*Che:a-s)/gOt),l=yOt(e,o),u=Math.max(l.length,1)*mOt,h=Math.max(r.height,n?Math.ceil(u/(1-Che)):u+(i?16:18));return{width:a,height:h,text:l.join(` -`)}},qAe="edgeever-mindmap",khe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',bOt=10,xOt=14,MQ=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",wOt=t=>{const e=MQ(t);return e==="map"||e==="logic"},g3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,RQ=(t,e="primary")=>g3(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",TOt=(t,e="primary")=>{const r=RQ(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"}]},COt={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"}]},kOt=(t,e)=>t.split(` -`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&AQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),tr=t=>(Math.round(t*100)/100).toFixed(2),SOt=t=>hOt(t),qM=(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"},EOt=(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},AOt=(t,e,r)=>{if(t==null)return;const n=r?dOt(r,e):COt[e];return n[t%n.length]},MOt=(t,e="primary",r)=>{const n=e==="root",i=g3(e,r),s=RQ(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,AQ(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},ROt=(t,e,r)=>{const n=MOt(t,e,r),i=g3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=kOt(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}},_Ot=t=>Math.round(Math.max(1,t/2)),LOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,IOt=(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(" ")},NOt=(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:IOt(e,r)}:{rx:n,ry:n},DOt=(t,e,r={})=>{const n=r.underline??g3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=RQ(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:khe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:LOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?_Ot(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,...NOt(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:khe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},She=(t,e,r,n,i,s,a)=>{const o=qM(t,e),l=g3(o,a),u=SOt(n)?AOt(EOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:DOt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},OOt=(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}},POt=(t,e,r)=>{const n=MQ(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"}},Ehe=(t,e,r,n)=>{const i=g3(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"}}},$Ot=(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)}},Ahe=(t,e)=>wOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},BOt=(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}},FOt=(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)}},zOt=(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=BOt(o,l,u,h,v),b=FOt(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(" ")},VOt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${VOt(e)}`).join(" "),HOt=(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])},GOt=(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])},WOt=(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(" ")},qOt=(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]),UOt=(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])},YOt=(t,e,r,n={})=>{const i=MQ(n.structure);return i==="org"?HOt(t,e):i==="tree"?GOt(t,e):i==="brace"?WOt(t,e,n.braceTop,n.braceBottom):i==="timeline"?qOt(t,e):i==="fishbone"?UOt(t,e):zOt(t,e,n.sourceWidth,n.targetWidth)},jOt=(t,e="light")=>fOt(t,e),XOt=(t,e)=>{const r=jOt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?VAe(e,t.theme):null,i=t.kind==="architecture"?AD(e):null,s=t.nodes.map(l=>{const u=t.kind==="mind-map"?qM(t.nodes,l.id):null,h=t.kind==="flowchart"?vOt(l.shape,l.label):u?ROt(l.label,u,t.structure):{width:l.width,height:l.height,text:l.label},d=u?She(t.nodes,l.id,r,t.theme,e,h,t.structure):null,f=(d==null?void 0:d.visual)??null,p=t.kind==="flowchart"?VDt(l.shape,e,h,t.theme):null,g=t.kind==="architecture"?MDt(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:TOt(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)??xW,...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"?qM(t.nodes,l.source):null,p=t.kind==="mind-map"?qM(t.nodes,l.target):null,g=t.kind==="mind-map"?She(t.nodes,l.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,m=f?OOt(f,r,g):null,y=h&&d?POt(h,d,t.structure):{source:"right",target:"left"},v=h&&f?Ehe(h,f,y.source,t.structure):null,x=d&&p?Ehe(d,p,y.target,t.structure):null,b=t.kind==="mind-map"&&t.structure==="brace"?$Ot(t.nodes,l.source):null,T=t.kind==="architecture"?RDt(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"?wDt(h,d):t.kind==="flowchart"?NDt(h,d):null:null,k=!!(S&&h&&d&&DDt(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"}:IDt:void 0,connector:t.kind==="mind-map"?{name:qAe,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?Ahe(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?Ahe(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"?vDt:t.kind==="flowchart"?_Dt:bOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?bDt:t.kind==="flowchart"?LDt:xOt,fontFamily:t.kind==="architecture"?BAe:xW,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}},UAe={compact:560,standard:680,wide:800},KOt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,ZOt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},y5={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"}},Mhe={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'},Rhe={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"}},QOt=(t,e)=>e&&y5[e]?e:t==="warm"?"sunset":t&&y5[t]?t:"slate",JOt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return KOt.test(n)?`_${n}`:n},fC=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),ePt=({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?`
+`});const QNt=["clay","orange","dawn","teal","azure","violet","plum","pink","slate"],JNt=["native",...QNt],eDt=8*1024;Zt({name:Ze().trim().min(1).max(80),parentId:Ze().trim().min(1).nullable().optional()});Zt({name:Ze().trim().min(1).max(80).optional(),parentId:Ze().trim().min(1).nullable().optional(),sortOrder:sa().int().optional()});Zt({notebookId:Ze().trim().min(1),title:Ze().trim().max(160).optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional()});Zt({expectedRevision:sa().int().min(0).optional(),expectedContentHash:Ze().length(64).optional(),editSessionId:Ze().trim().min(1).optional(),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional(),isPinned:ni().optional(),contentJson:Dd().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional(),createdAt:Ze().datetime().optional(),updatedAt:Ze().datetime().optional(),allowDestructiveOverwrite:ni().optional()});Zt({name:Ze().trim().min(1).max(160),description:Ze().trim().max(500).optional(),memoId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});Zt({name:Ze().trim().min(1).max(160).optional(),description:Ze().trim().max(500).nullable().optional(),title:Ze().trim().max(160).nullable().optional(),contentMarkdown:Ze().optional(),tags:Xn(Ze()).optional()});Zt({notebookId:Ze().trim().min(1)});const wAe=Zt({pluginId:Ze().trim().min(3).max(200),commandId:Ze().trim().min(1).max(200)}),tDt=Zt({name:Ze().trim().min(1).max(120),taskType:na("plugin-command"),taskPayload:wAe,cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ci(["run-once","skip"]).default("run-once"),isEnabled:ni().default(!0)});tDt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:wAe.optional(),executorDeviceId:Ze().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Zt({pluginId:Ze().trim().min(3).max(200),scheduleKey:Ze().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Ze().trim().min(1).max(120),commandId:Ze().trim().min(1).max(200),cronExpression:Ze().trim().min(1).max(160),timezone:Ze().trim().min(1).max(80),executorDeviceId:Ze().trim().min(16).max(160),missedRunPolicy:ci(["run-once","skip"]).default("run-once"),isEnabled:ni().optional()});Zt({scheduledFor:Ze().datetime(),executorDeviceId:Ze().trim().min(16).max(160)});Zt({executorDeviceId:Ze().trim().min(16).max(160),status:ci(["succeeded","failed"]),errorMessage:Ze().trim().max(2e3).nullable().optional()});const ghe=Ze().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."});Zt({type:ci(["plugin","theme"]),version:Ze().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:ni(),installedAt:Ze().datetime(),manifestUrl:ghe,sourceKind:ci(["marketplace","github","manifest"]),verified:ni(),repositoryUrl:ghe.max(500).nullable().optional(),releaseTag:Ze().trim().min(1).max(80).nullable().optional(),publisher:na("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."});Zt({memoIds:Xn(Ze().trim().min(1)).min(1).max(100),notebookId:Ze().trim().min(1)});Zt({memoIds:Xn(Ze().trim().min(1)).min(1).max(100),permanent:ni().optional()});Zt({memoIds:Xn(Ze().trim().min(1)).min(2).max(50),notebookId:Ze().trim().min(1).optional(),title:Ze().trim().max(160).optional()});Zt({username:Ze().trim().min(1).max(80),password:Ze().min(1).max(512),deviceId:Ze().trim().min(16).max(160).optional()});Zt({label:Ze().trim().max(80).nullable()});Zt({currentPassword:Ze().min(1).max(512),newPassword:Ze().min(8).max(512),confirmPassword:Ze().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});Zt({username:Ze().trim().min(1).max(80),displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512)});Zt({displayName:Ze().trim().max(80).nullable().optional(),password:Ze().min(8).max(512).optional(),isDisabled:ni().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");Zt({name:Ze().trim().min(1).max(80),scopes:Xn(Ze().trim().min(1).max(80)).min(1).max(32),expiresAt:Ze().datetime().nullable().optional()});Zt({name:Ze().trim().min(1).max(80)});Zt({filename:Ze().trim().min(1).max(160)});const TAe=Ze().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");pAe("provider",[Zt({provider:na("builtin")}),Zt({provider:na("s3"),displayName:Ze().trim().min(1).max(80),endpoint:TAe,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:ni().default(!0),objectPrefix:Ze().trim().max(500).default("")})]);Zt({endpoint:TAe,region:Ze().trim().min(1).max(80),bucket:Ze().trim().min(1).max(255),accessKeyId:Ze().trim().min(1).max(256),secretAccessKey:Ze().min(1).max(1024).optional(),forcePathStyle:ni().default(!0),objectPrefix:Ze().trim().max(500).default("")});const CAe=ci(["openai-compatible","anthropic","google"]),kAe=Ze().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."})}),SAe=Zt({provider:CAe,displayName:Ze().trim().min(1).max(80),baseUrl:kAe,isEnabled:ni().default(!0)});SAe.extend({apiKey:Ze().min(1).max(4096),initialModelId:Ze().trim().min(1).max(200).optional()});SAe.extend({apiKey:Ze().min(1).max(4096).optional()});Zt({modelId:Ze().trim().min(1).max(200),provider:CAe.optional(),baseUrl:kAe.optional(),apiKey:Ze().min(1).max(4096).optional()});Zt({modelId:Ze().trim().min(1).max(200),displayName:Ze().trim().min(1).max(200).optional()});Zt({modelConfigId:Ze().trim().min(1).nullable()});const rDt=Zt({filename:Ze().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:ci(RNt),base64Data:Ze().min(1).max(Math.ceil(dhe/3)*4)}).superRefine((t,e)=>{const r=yAe(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=NNt(t.mediaType)?LNt:dhe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});Zt({action:ci(mW),promptId:Ze().trim().min(1).max(200).optional(),locale:Ze().trim().min(2).max(35).optional(),title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),stream:ni().default(!1),targetLanguage:ci(MNt).optional(),tone:ci(ANt).optional(),instruction:Ze().trim().min(1).max(2e3).optional(),attachments:Xn(rDt).max(_Nt).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+(yAe(s.base64Data)??0),0)>INt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});Zt({title:Ze().trim().max(160).default(""),contentMarkdown:Ze().max(3e5),currentTags:Xn(Ze().trim().min(1).max(200)).max(24).default([]),locale:Ze().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."})});Zt({name:Ze().trim().min(1).max(80),description:Ze().trim().max(200).optional(),instruction:Ze().trim().min(1).max(2e3),parameterKind:ci(xQ).default("none"),resultMode:ci(wQ).default("both")});Zt({name:Ze().trim().min(1).max(80).optional(),description:Ze().trim().max(200).nullable().optional(),instruction:Ze().trim().min(1).max(2e3).optional(),parameterKind:ci(xQ).optional(),resultMode:ci(wQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Zt({passwordProtected:ni()});Zt({bodyFont:ci(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});const up=Ze().regex(/^#[0-9a-f]{6}$/i),mhe=Zt({background:up,text:up,muted:up,heading:up,accent:up,soft:up,codeBackground:up,border:up});Zt({fontSize:$6([na(14),na(16),na(18),na(20)]).nullable().optional(),lineHeight:$6([na(1.5),na(1.65),na(2)]).nullable().optional(),palette:ci(JNt).nullable().optional(),customCss:Ze().refine(t=>new TextEncoder().encode(t).byteLength<=eDt).nullable().optional(),customColors:Zt({light:mhe,dark:mhe}).nullable().optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Zt({password:Ze().min(1).max(64)});const nDt=Zt({fieldId:Ze().trim().min(1).max(80),required:ni()});Zt({enabled:ni(),passwordProtected:ni(),rotatePassword:ni().optional(),title:Ze().trim().max(120),description:Ze().trim().max(1e3),submitLabel:Ze().trim().max(40),fields:Xn(nDt).max(40)});Zt({cells:ED(Ze().max(80),Dd())});const EAe="3.9.3",iDt=EAe,yhe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,vhe=typeof TextEncoder=="function"?new TextEncoder:void 0,sDt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nk=Array.prototype.slice.call(sDt),i8=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(nk),aDt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,vo=String.fromCharCode.bind(String),oDt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),AAe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),MAe=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),RAe=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+=nk[e>>18&63]+nk[e>>12&63]+nk[e>>6&63]+nk[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},kQ=typeof btoa=="function"?t=>btoa(t):RAe,yW=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;ne?AAe(yW(t)):yW(t),lDt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?vo(192|e>>>6)+vo(128|e&63):vo(224|e>>>12&15)+vo(128|e>>>6&63)+vo(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return vo(240|e>>>18&7)+vo(128|e>>>12&63)+vo(128|e>>>6&63)+vo(128|e&63)}},cDt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,_Ae=t=>t.replace(cDt,lDt),bhe=vhe?t=>yW(vhe.encode(t)):t=>kQ(_Ae(t)),Db=(t,e=!1)=>e?AAe(bhe(t)):bhe(t),xhe=t=>Db(t,!0),uDt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,hDt=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 vo((r>>>10)+55296)+vo((r&1023)+56320);case 3:return vo((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return vo((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},LAe=t=>t.replace(uDt,hDt),IAe=t=>{if(t=t.replace(/\s+/g,""),!aDt.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(vo(e>>16&255,e>>8&255)):i.push(vo(e>>16&255,e>>8&255,e&255));return i.join("")},SQ=typeof atob=="function"?t=>atob(MAe(t)):IAe,NAe=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>oDt(SQ(t).split("").map(e=>e.charCodeAt(0))),DAe=t=>NAe(OAe(t)),dDt=yhe?t=>yhe.decode(NAe(t)):t=>LAe(SQ(t)),OAe=t=>MAe(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),vW=t=>dDt(OAe(t)),fDt=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)},PAe=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),$Ae=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,PAe(r));t("fromBase64",function(){return vW(this)}),t("toBase64",function(e){return Db(this,e)}),t("toBase64URI",function(){return Db(this,!0)}),t("toBase64URL",function(){return Db(this,!0)}),t("toUint8Array",function(){return DAe(this)})},BAe=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,PAe(r));t("toBase64",function(e){return WM(this,e)}),t("toBase64URI",function(){return WM(this,!0)}),t("toBase64URL",function(){return WM(this,!0)})},pDt=()=>{$Ae(),BAe()},gDt={version:EAe,VERSION:iDt,atob:SQ,atobPolyfill:IAe,btoa:kQ,btoaPolyfill:RAe,fromBase64:vW,toBase64:Db,encode:Db,encodeURI:xhe,encodeURL:xhe,utob:_Ae,btou:LAe,decode:vW,isValid:fDt,fromUint8Array:WM,toUint8Array:DAe,extendString:$Ae,extendUint8Array:BAe,extendBuiltins:pDt},ll="#f8fafb",cl="#191e1b",whe={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"}}]},FAe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',mDt=12,yDt=550,vDt=17,bDt=10,xDt=14,bW=34,wDt=10,TDt=(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"}},zAe=["client","frontend","service","database","storage","queue","security","external"],CDt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},kDt={light:{canvas:ll,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:cl,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}}}},AD=(t="light")=>kDt[t],SDt=(t,e)=>{const r=AD(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:zAe.includes(t)?r.nodes[t]:r.nodes.service},EDt=(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,The=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,ADt=t=>Math.round((t-bW)/2),VAe=(t,e)=>{const r=t??(zAe.includes(e)?CDt[e]:"service");return whe[r]??whe.service},MDt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=VAe(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"}]},RDt=(t,e,r,n)=>{const i=AD(e),s=SDt(t,e),a=t==="boundary",o=EDt(t,r.height),l=ADt(r.height),u=a?[]:VAe(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:MDt(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:mDt,fontWeight:a?650:yDt,fontFamily:FAe,lineHeight:a?18:vDt,...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:wDt,y:l,width:bW,height:bW,rx:The(t),ry:The(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},_Dt=(t,e,r=!1)=>{const n=AD(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"}},xW='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',LDt=10,IDt=14,NDt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},DDt=(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"}},ODt=(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},PDt=.85,$Dt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],BDt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},FDt=t=>t&&$Dt.includes(t)?t:t?BDt[t]??"brand":"plain",zDt={plain:{light:{canvas:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,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:ll,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:cl,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},HAe=(t="light",e)=>zDt[FDt(e)][t],VDt=(t,e,r)=>{const n=HAe(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},HDt=(t,e,r,n)=>{const i=VDt(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:xW,lineHeight:18}}},GDt=1,WDt=2,qDt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],UDt="plain",YDt=["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"],jDt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],XDt=[...jDt,"rect","diamond","cloud"],KDt={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"},EQ=t=>t&&qDt.includes(t)?t:t?KDt[t]??"brand":UDt,ZDt=["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"],QDt="edgeever-diagram-v1",GAe=new RegExp(`\x3C!--\\s*${QDt}:([\\s\\S]*?)\\s*-->`),JDt=t=>gDt.decode(t),s8=t=>typeof t=="number"&&Number.isFinite(t),eOt=["mind-map","flowchart","architecture"],tOt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],Che=["dependency","request","async","data"],rOt=t=>typeof t=="string"&&ZDt.includes(t),nOt=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"||!s8(e.x)||!s8(e.y)||!s8(e.width)||!s8(e.height)||!tOt.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}:{},...rOt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},iOt=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&&!Che.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}:{},...Che.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},sOt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(GAe))==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(JDt(e));if(!eOt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==WDt:i.schemaVersion!==GDt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=YDt.includes(i.theme)?i.theme:void 0,o=XDt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(nOt),u=i.edges.map(iOt);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}},aOt=t=>(t??"").replace(GAe,"").trimEnd(),oOt=1e5;Zt({prompt:Ze().trim().min(1).max(1e3),locale:Ze().trim().min(2).max(35).optional(),currentTemplate:Ze().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:Ze().max(oOt).default(""),candidates:Xn(Ze().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:Xn(Zt({prompt:Ze().max(1e3),response:Ze().max(2e3)})).max(12).default([])});const WAe={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"}},lOt=Object.fromEntries(Object.entries(WAe).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),wW=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)]},cOt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,hl=(t,e,r)=>{const n=wW(t),i=wW(e);return cOt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},uOt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},qAe=t=>{const[e,r,n]=wW(t).map(uOt);return e*.2126+r*.7152+n*.0722},TW=t=>qAe(t)>.35?"#1C1917":"#FFFCF8",hOt=t=>lOt[EQ(t)].colors,dOt=t=>{const e=EQ(t);return e!=="brand"&&e!=="plain"},CW=(t,e)=>{const r=qAe(t);return e==="dark"?r<.22?hl(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?hl(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},fOt=(t,e)=>hOt(t).map(n=>{const i=CW(n,e),s=e==="dark"?hl(n,"#121518",.72):hl(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?hl(i,"#FFFFFF",.15):hl(i,"#1C1917",.12),text:TW(s),edge:i}}),pOt=(t,e)=>{const r=EQ(t),n=WAe[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:cl}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:ll};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:cl}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:ll};if(e==="dark"){const a=CW(i,"dark");return{topicFill:i,topicText:TW(i),nodeFill:hl(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:hl(a,"#FFFFFF",.15),topicStroke:hl(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:hl(i,"#FFFFFF",.15),canvas:cl}}const s=CW(i,"light");return{topicFill:i,topicText:TW(i),nodeFill:hl(i,"#FFFFFF",.88),nodeText:hl(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:hl(s,"#FFFFFF",.5),topicStroke:hl(i,"#1C1917",.15),mindMapEdge:s,flowEdge:hl(i,"#1C1917",.15),canvas:ll}},AQ=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),gOt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},mOt=13,yOt=18,khe=.7,vOt=(t,e)=>t.split(` +`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&AQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),bOt=(t,e)=>{const r=gOt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*khe:a-s)/mOt),l=vOt(e,o),u=Math.max(l.length,1)*yOt,h=Math.max(r.height,n?Math.ceil(u/(1-khe)):u+(i?16:18));return{width:a,height:h,text:l.join(` +`)}},UAe="edgeever-mindmap",She='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',xOt=10,wOt=14,MQ=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",TOt=t=>{const e=MQ(t);return e==="map"||e==="logic"},g3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,RQ=(t,e="primary")=>g3(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",COt=(t,e="primary")=>{const r=RQ(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"}]},kOt={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"}]},SOt=(t,e)=>t.split(` +`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&AQ(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),tr=t=>(Math.round(t*100)/100).toFixed(2),EOt=t=>dOt(t),qM=(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"},AOt=(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},MOt=(t,e,r)=>{if(t==null)return;const n=r?fOt(r,e):kOt[e];return n[t%n.length]},ROt=(t,e="primary",r)=>{const n=e==="root",i=g3(e,r),s=RQ(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,AQ(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},_Ot=(t,e,r)=>{const n=ROt(t,e,r),i=g3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=SOt(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}},LOt=t=>Math.round(Math.max(1,t/2)),IOt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,NOt=(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(" ")},DOt=(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:NOt(e,r)}:{rx:n,ry:n},OOt=(t,e,r={})=>{const n=r.underline??g3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=RQ(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:She,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:IOt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?LOt(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,...DOt(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:She,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},Ehe=(t,e,r,n,i,s,a)=>{const o=qM(t,e),l=g3(o,a),u=EOt(n)?MOt(AOt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:OOt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},POt=(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}},$Ot=(t,e,r)=>{const n=MQ(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"}},Ahe=(t,e,r,n)=>{const i=g3(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)}},Mhe=(t,e)=>TOt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},FOt=(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}},zOt=(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)}},VOt=(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=FOt(o,l,u,h,v),b=zOt(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(" ")},HOt=t=>`${tr(t.x)} ${tr(t.y)}`,Od=t=>t.map((e,r)=>`${r===0?"M":"L"} ${HOt(e)}`).join(" "),GOt=(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])},WOt=(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])},qOt=(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(" ")},UOt=(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]),YOt=(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])},jOt=(t,e,r,n={})=>{const i=MQ(n.structure);return i==="org"?GOt(t,e):i==="tree"?WOt(t,e):i==="brace"?qOt(t,e,n.braceTop,n.braceBottom):i==="timeline"?UOt(t,e):i==="fishbone"?YOt(t,e):VOt(t,e,n.sourceWidth,n.targetWidth)},XOt=(t,e="light")=>pOt(t,e),KOt=(t,e)=>{const r=XOt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?HAe(e,t.theme):null,i=t.kind==="architecture"?AD(e):null,s=t.nodes.map(l=>{const u=t.kind==="mind-map"?qM(t.nodes,l.id):null,h=t.kind==="flowchart"?bOt(l.shape,l.label):u?_Ot(l.label,u,t.structure):{width:l.width,height:l.height,text:l.label},d=u?Ehe(t.nodes,l.id,r,t.theme,e,h,t.structure):null,f=(d==null?void 0:d.visual)??null,p=t.kind==="flowchart"?HDt(l.shape,e,h,t.theme):null,g=t.kind==="architecture"?RDt(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:COt(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)??xW,...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"?qM(t.nodes,l.source):null,p=t.kind==="mind-map"?qM(t.nodes,l.target):null,g=t.kind==="mind-map"?Ehe(t.nodes,l.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,m=f?POt(f,r,g):null,y=h&&d?$Ot(h,d,t.structure):{source:"right",target:"left"},v=h&&f?Ahe(h,f,y.source,t.structure):null,x=d&&p?Ahe(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"?_Dt(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"?TDt(h,d):t.kind==="flowchart"?DDt(h,d):null:null,k=!!(S&&h&&d&&ODt(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"}:NDt:void 0,connector:t.kind==="mind-map"?{name:UAe,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?Mhe(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?Mhe(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"?bDt:t.kind==="flowchart"?LDt:xOt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?xDt:t.kind==="flowchart"?IDt:wOt,fontFamily:t.kind==="architecture"?FAe:xW,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}},YAe={compact:560,standard:680,wide:800},ZOt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,QOt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},y5={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"}},Rhe={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'},_he={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"}},JOt=(t,e)=>e&&y5[e]?e:t==="warm"?"sunset":t&&y5[t]?t:"slate",ePt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return ZOt.test(n)?`_${n}`:n},fC=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),tPt=({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?`
@@ -1871,7 +1871,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
`:""} -
`},tPt=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=y5[t]||y5.slate,s=Mhe[e]||Mhe.sans,a=Rhe[r]||Rhe.md,o=UAe[n]||680;return` +`},rPt=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=y5[t]||y5.slate,s=Rhe[e]||Rhe.sans,a=_he[r]||_he.md,o=YAe[n]||680;return` :root { --ee-canvas-bg: ${i.canvasBg}; --ee-card-bg: ${i.cardBg}; @@ -2275,7 +2275,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. opacity: 0.9; } `:""} - `};Zt({system:Ze().max(8e3),prompt:Ze().min(1).max(9e4),maxOutputTokens:sa().int().min(1).optional()}).strict();Zt({url:Ze().min(1).max(8192),method:ci(["GET","HEAD"]).default("GET"),headers:ED(Ze().max(100),Ze().max(2e3)).default({})}).strict();const rPt=(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})},nPt=ODt,iPt=2.5,sPt=28,aPt=(t,e=nPt)=>t+1e-6>=e?"fit":"read",oPt=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]}},lPt=(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}},cPt=(t,e,r,n=.1,i=iPt)=>e<8?t:Math.min(i,Math.max(n,t*(r/e))),_he=(t,e)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),uPt=(t,e,r)=>({x:(t.clientX+e.clientX)/2-r.left,y:(t.clientY+e.clientY)/2-r.top}),hPt=(t,e,r,n,i)=>{const s=rPt(e,t),a=e.parentElement;a==null||a.classList.add("edgeever-diagram-reader-host");const o=()=>{t.zoomToFit({maxScale:1,padding:sPt}),t.centerContent()},l=(x,b=1)=>{t.zoomTo(b);const T=lPt(x,{width:y,height:v},r.kind,b);t.translate(T.tx,T.ty)},u=()=>{const x=oPt(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:_he(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=cPt(f.scale,f.distance,_he(x.touches[0],x.touches[1]));t.zoomTo(b,{center:uPt(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(),aPt(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}}},Lhe=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 YAe{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 YAe(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Ed=class jAe{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 jAe(r,Ku.range(this,e))}},Ut=class XAe{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":">","<":"<",'"':""","'":"'"},yPt=/[&><"']/g;function vPt(t){return String(t).replace(yPt,e=>mPt[e])}var KAe=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},bPt=function(e){var r=KAe(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},xPt=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},wPt=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:dPt,deflt:fPt,escape:vPt,hyphenate:gPt,getBaseElem:KAe,isCharacterBox:bPt,protocolFromUrl:wPt},UM={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 TPt(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 _Q=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 UM)if(UM.hasOwnProperty(r)){var n=UM[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:TPt(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}},hp=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[CPt[this.id]]}sub(){return cd[kPt[this.id]]}fracNum(){return cd[SPt[this.id]]}fracDen(){return cd[EPt[this.id]]}cramp(){return cd[APt[this.id]]}text(){return cd[MPt[this.id]]}isTight(){return this.size>=2}};var LQ=0,oL=1,Ob=2,i0=3,B6=4,bu=5,v5=6,Tl=7,cd=[new hp(LQ,0,!1),new hp(oL,0,!0),new hp(Ob,1,!1),new hp(i0,1,!0),new hp(B6,2,!1),new hp(bu,2,!0),new hp(v5,3,!1),new hp(Tl,3,!0)],CPt=[B6,bu,B6,bu,v5,Tl,v5,Tl],kPt=[bu,bu,bu,bu,Tl,Tl,Tl,Tl],SPt=[Ob,i0,B6,bu,v5,Tl,v5,Tl],EPt=[i0,i0,bu,bu,Tl,Tl,Tl,Tl],APt=[oL,oL,i0,i0,bu,bu,Tl,Tl],MPt=[LQ,oL,Ob,i0,Ob,i0,Ob,i0],Hr={DISPLAY:cd[LQ],TEXT:cd[Ob],SCRIPT:cd[B6],SCRIPTSCRIPT:cd[v5]},kW=[{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 RPt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var YM=[];kW.forEach(t=>t.blocks.forEach(e=>YM.push(...e)));function ZAe(t){for(var e=0;e=YM[e]&&t<=YM[e+1])return!0;return!1}var Yv=80,_Pt=function(e,r){return"M95,"+(622+e+r)+` + `};Zt({system:Ze().max(8e3),prompt:Ze().min(1).max(9e4),maxOutputTokens:sa().int().min(1).optional()}).strict();Zt({url:Ze().min(1).max(8192),method:ci(["GET","HEAD"]).default("GET"),headers:ED(Ze().max(100),Ze().max(2e3)).default({})}).strict();const nPt=(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})},iPt=PDt,sPt=2.5,aPt=28,oPt=(t,e=iPt)=>t+1e-6>=e?"fit":"read",lPt=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]}},cPt=(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}},uPt=(t,e,r,n=.1,i=sPt)=>e<8?t:Math.min(i,Math.max(n,t*(r/e))),Lhe=(t,e)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),hPt=(t,e,r)=>({x:(t.clientX+e.clientX)/2-r.left,y:(t.clientY+e.clientY)/2-r.top}),dPt=(t,e,r,n,i)=>{const s=nPt(e,t),a=e.parentElement;a==null||a.classList.add("edgeever-diagram-reader-host");const o=()=>{t.zoomToFit({maxScale:1,padding:aPt}),t.centerContent()},l=(x,b=1)=>{t.zoomTo(b);const T=cPt(x,{width:y,height:v},r.kind,b);t.translate(T.tx,T.ty)},u=()=>{const x=lPt(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:Lhe(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=uPt(f.scale,f.distance,Lhe(x.touches[0],x.touches[1]));t.zoomTo(b,{center:hPt(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(),oPt(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}}},Ihe=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 jAe{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 jAe(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Ed=class XAe{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 XAe(r,Ku.range(this,e))}},Ut=class KAe{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":">","<":"<",'"':""","'":"'"},vPt=/[&><"']/g;function bPt(t){return String(t).replace(vPt,e=>yPt[e])}var ZAe=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},xPt=function(e){var r=ZAe(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},wPt=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},TPt=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:fPt,deflt:pPt,escape:bPt,hyphenate:mPt,getBaseElem:ZAe,isCharacterBox:xPt,protocolFromUrl:TPt},UM={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 CPt(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 _Q=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 UM)if(UM.hasOwnProperty(r)){var n=UM[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:CPt(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}},hp=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[kPt[this.id]]}sub(){return cd[SPt[this.id]]}fracNum(){return cd[EPt[this.id]]}fracDen(){return cd[APt[this.id]]}cramp(){return cd[MPt[this.id]]}text(){return cd[RPt[this.id]]}isTight(){return this.size>=2}};var LQ=0,oL=1,Ob=2,i0=3,B6=4,bu=5,v5=6,Tl=7,cd=[new hp(LQ,0,!1),new hp(oL,0,!0),new hp(Ob,1,!1),new hp(i0,1,!0),new hp(B6,2,!1),new hp(bu,2,!0),new hp(v5,3,!1),new hp(Tl,3,!0)],kPt=[B6,bu,B6,bu,v5,Tl,v5,Tl],SPt=[bu,bu,bu,bu,Tl,Tl,Tl,Tl],EPt=[Ob,i0,B6,bu,v5,Tl,v5,Tl],APt=[i0,i0,bu,bu,Tl,Tl,Tl,Tl],MPt=[oL,oL,i0,i0,bu,bu,Tl,Tl],RPt=[LQ,oL,Ob,i0,Ob,i0,Ob,i0],Hr={DISPLAY:cd[LQ],TEXT:cd[Ob],SCRIPT:cd[B6],SCRIPTSCRIPT:cd[v5]},kW=[{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 _Pt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var YM=[];kW.forEach(t=>t.blocks.forEach(e=>YM.push(...e)));function QAe(t){for(var e=0;e=YM[e]&&t<=YM[e+1])return!0;return!1}var Yv=80,LPt=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 @@ -2286,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"},LPt=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"},IPt=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+` @@ -2296,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"},IPt=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},NPt=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 @@ -2305,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"},NPt=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},DPt=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 @@ -2315,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"},DPt=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},OPt=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"},OPt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},PPt=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"},PPt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},$Pt=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"},$Pt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=_Pt(r,Yv);break;case"sqrtSize1":i=LPt(r,Yv);break;case"sqrtSize2":i=IPt(r,Yv);break;case"sqrtSize3":i=NPt(r,Yv);break;case"sqrtSize4":i=DPt(r,Yv);break;case"sqrtTall":i=PPt(r,Yv,n)}return i},BPt=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""}},Ihe={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},BPt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=LPt(r,Yv);break;case"sqrtSize1":i=IPt(r,Yv);break;case"sqrtSize2":i=NPt(r,Yv);break;case"sqrtSize3":i=DPt(r,Yv);break;case"sqrtSize4":i=OPt(r,Yv);break;case"sqrtTall":i=$Pt(r,Yv,n)}return i},FPt=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""}},Nhe={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 @@ -2501,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`},FPt=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`},zPt=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 @@ -2529,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 d7=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]}},a8={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]},Nhe={Å:"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 zPt(t,e){gd[t]=e}function IQ(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 Nhe&&(n=Nhe[t[0]].charCodeAt(0),i=gd[e][n]),!i&&r==="text"&&ZAe(n)&&(i=gd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var CB={};function VPt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!CB[e]){var r=CB[e]={cssEmPerMu:a8.quad[e]/18};for(var n in a8)a8.hasOwnProperty(n)&&(r[n]=a8[n][e])}return CB[e]}var HPt=[[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]],Dhe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ohe=function(e,r){return r.size<2?e:HPt[e-1][r.size-1]};let QAe=class Xm{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||Xm.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=Dhe[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 Xm(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Ohe(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:Dhe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Ohe(Xm.BASESIZE,e);return this.size===r&&this.textSize===Xm.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!==Xm.BASESIZE?["sizing","reset-size"+this.size,"size"+Xm.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=VPt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};QAe.BASESIZE=6;var SW={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},GPt={ex:!0,em:!0,mu:!0},JAe=function(e){return typeof e!="string"&&(e=e.unit),e in SW||e in GPt||e==="ex"},bs=function(e,r){var n;if(e.unit in SW)n=SW[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"},Tg=function(e){return e.filter(r=>r).join(" ")},e8e=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)}},t8e=function(e){var r=document.createElement(e);r.className=Tg(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]/,r8e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Pr.escape(Tg(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(WPt.test(s))throw new Ut("Invalid attribute name '"+s+"'");r+=" "+s+'="'+Pr.escape(this.attributes[s])+'"'}r+=">";for(var a=0;a",r};let f7=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,e8e.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 t8e.call(this,"span")}toMarkup(){return r8e.call(this,"span")}},NQ=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,e8e.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 t8e.call(this,"a")}toMarkup(){return r8e.call(this,"a")}},qPt=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=Tg(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':''}},EW=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 jPt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},XPt={"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",Fl="close",m3="inner",zr="mathord",pa="op-token",jc="open",MD="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,MD,".","\\ldotp");Y(ae,be,MD,"⋅","\\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,Fl,"⎱","\\rmoustache",!0);Y(ae,be,jc,"⎰","\\lmoustache",!0);Y(ae,be,Fl,"⟯","\\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,Fl,"┐","\\@urcorner",!0);Y(ae,Ge,jc,"└","\\@llcorner",!0);Y(ae,Ge,Fl,"┘","\\@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,Fl,"?","?");Y(ae,be,Fl,"!","!");Y(ae,be,Fl,"⟩","\\rangle",!0);Y(ae,be,Fl,"∣","\\rvert");Y(ae,be,Fl,"∥","\\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,MD,",",",");Y(ae,be,MD,";",";");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,Fl,"}","\\}");Y(Ot,be,et,"}","\\}");Y(Ot,be,et,"}","\\textbraceright");Y(ae,be,jc,"{","\\lbrace");Y(ae,be,Fl,"}","\\rbrace");Y(ae,be,jc,"[","\\lbrack",!0);Y(Ot,be,et,"[","\\lbrack",!0);Y(ae,be,Fl,"]","\\rbrack",!0);Y(Ot,be,et,"]","\\rbrack",!0);Y(ae,be,jc,"(","\\lparen",!0);Y(ae,be,Fl,")","\\rparen",!0);Y(Ot,be,et,"<","\\textless",!0);Y(Ot,be,et,">","\\textgreater",!0);Y(ae,be,jc,"⌊","\\lfloor",!0);Y(ae,be,Fl,"⌋","\\rfloor",!0);Y(ae,be,jc,"⌈","\\lceil",!0);Y(ae,be,Fl,"⌉","\\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,pa,"∐","\\coprod");Y(ae,be,pa,"⋁","\\bigvee");Y(ae,be,pa,"⋀","\\bigwedge");Y(ae,be,pa,"⨄","\\biguplus");Y(ae,be,pa,"⋂","\\bigcap");Y(ae,be,pa,"⋃","\\bigcup");Y(ae,be,pa,"∫","\\int");Y(ae,be,pa,"∫","\\intop");Y(ae,be,pa,"∬","\\iint");Y(ae,be,pa,"∭","\\iiint");Y(ae,be,pa,"∏","\\prod");Y(ae,be,pa,"∑","\\sum");Y(ae,be,pa,"⨂","\\bigotimes");Y(ae,be,pa,"⨁","\\bigoplus");Y(ae,be,pa,"⨀","\\bigodot");Y(ae,be,pa,"∮","\\oint");Y(ae,be,pa,"∯","\\oiint");Y(ae,be,pa,"∰","\\oiiint");Y(ae,be,pa,"⨆","\\bigsqcup");Y(ae,be,pa,"∫","\\smallint");Y(Ot,be,m3,"…","\\textellipsis");Y(ae,be,m3,"…","\\mathellipsis");Y(Ot,be,m3,"…","\\ldots",!0);Y(ae,be,m3,"…","\\ldots",!0);Y(ae,be,m3,"⋯","\\@cdots",!0);Y(ae,be,m3,"⋱","\\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 n8e={"--":!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 kB=0;kB<$he.length;kB++){var Bhe=$he.charAt(kB);Y(ae,be,et,Bhe,Bhe)}var Fhe='0123456789!@*()-=+";:?/.,';for(var SB=0;SB0)return Zu(s,u,i,r,a.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=QPt(s,i,r,a,n);d=p.fontName,f=[p.fontClass]}else o?(d=a8e[l].fontName,f=[l]):(d=u8(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(RD(s,d,i).metrics)return Zu(s,d,i,r,a.concat(f));if(n8e.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m{if(Tg(t.classes)!==Tg(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},t$t=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},ec=function(e,r,n,i){var s=new f7(e,r,n,i);return DQ(s),s},i8e=(t,e,r,n)=>new f7(t,e,r,n),r$t=function(e,r,n){var i=ec([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},n$t=function(e,r,n,i){var s=new NQ(e,r,n,i);return DQ(s),s},s8e=function(e){var r=new d7(e);return DQ(r),r},i$t=function(e,r){return e instanceof d7?ec([],[e],r):e},s$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=ec(["mspace"],[],e),n=bs(t,e);return r.style.marginRight=Xt(n),r},u8=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},a8e={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"}},o8e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},l$t=function(e,r){var[n,i,s]=o8e[e],a=new Cg(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=i8e(["overlay"],[o],r);return l.height=s,l.style.height=Xt(s),l.style.width=Xt(i),l},at={fontMap:a8e,makeSymbol:Zu,mathsym:ZPt,makeSpan:ec,makeSvgSpan:i8e,makeLineSpan:r$t,makeAnchor:n$t,makeFragment:s8e,wrapFragment:i$t,makeVList:a$t,makeOrd:JPt,makeGlue:o$t,staticSvg:l$t,svgData:o8e,tryCombineChars:t$t},ys={number:3,unit:"mu"},Lm={number:4,unit:"mu"},ff={number:5,unit:"mu"},c$t={mord:{mop:ys,mbin:Lm,mrel:ff,minner:ys},mop:{mord:ys,mop:ys,mrel:ff,minner:ys},mbin:{mord:Lm,mop:Lm,mopen:Lm,minner:Lm},mrel:{mord:ff,mop:ff,mopen:ff,minner:ff},mopen:{},mclose:{mop:ys,mbin:Lm,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:Lm,mrel:ff,mopen:ys,mpunct:ys,minner:ys}},u$t={mord:{mop:ys},mop:{mord:ys,mop:ys},mbin:{},mrel:{},mopen:{},mclose:{mop:ys},mpunct:{},minner:{mop:ys}},l8e={},cL={},uL={};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(d$t,v)?m.classes[0]="mord":v==="mbin"&&Pr.contains(h$t,y)&&(g.classes[0]="mord")},{node:d},f,p),Hhe(s,(g,m)=>{var y=MW(m),v=MW(g),x=y&&v?g.hasClass("mtight")?u$t[y][v]:c$t[y][v]:null;if(x)return at.makeGlue(x,u)},{node:d},f,p),s},Hhe=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()},c8e=function(e){return e instanceof d7||e instanceof NQ||e instanceof f7&&e.hasClass("enclosing")?e:null},g$t=function t(e,r){var n=c8e(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},MW=function(e,r){return e?(r&&(e=g$t(e,r)),p$t[e.classes[0]]||null):null},F6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return w0(r.concat(n))},Kn=function(e,r,n){if(!e)return w0();if(cL[e.type]){var i=cL[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 h8(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 RW(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(h8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(h8(a,e));var u;r?(u=h8(_a(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 u8e(t){return new d7(t)}let Oc=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=Tg(this.classes));for(var n=0;n0&&(e+=' class ="'+Pr.escape(Tg(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}},m$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:Oc,TextNode:md,SpaceNode:m$t,newDocumentFragment:u8e},Lu=function(e,r,n){return Vi[r][e]&&Vi[r][e].replace&&e.charCodeAt(0)!==55349&&!(n8e.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)},OQ=function(e){return e.length===1?e[0]:new Ht.MathNode("mrow",e)},PQ=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 IQ(s,a,i)?at.fontMap[n].variant:null};function MB(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 wc=function(e,r,n){if(e.length===1){var i=Ai(e[0],r);return n&&i instanceof Oc&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||MB(a))){var u=l.children[0];u instanceof Oc&&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},kg=function(e,r,n){return OQ(wc(e,r,n))},Ai=function(e,r){if(!e)return new Ht.MathNode("mrow");if(uL[e.type]){var n=uL[e.type](e,r);return n}else throw new Ut("Got group of unknown type: '"+e.type+"'")};function Ghe(t,e,r,n,i){var s=wc(t,r),a;s.length===1&&s[0]instanceof Oc&&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 h8e=function(e){return new QAe({style:e.displayMode?Hr.DISPLAY:Hr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},d8e=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},y$t=function(e,r,n){var i=h8e(n),s;if(n.output==="mathml")return Ghe(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=RW(e,i);s=at.makeSpan(["katex"],[a])}else{var o=Ghe(e,r,i,n.displayMode,!1),l=RW(e,i);s=at.makeSpan(["katex"],[o,l])}return d8e(s,n)},v$t=function(e,r,n){var i=h8e(n),s=RW(e,i),a=at.makeSpan(["katex"],[s]);return d8e(a,n)},b$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":"="},x$t=function(e){var r=new Ht.MathNode("mo",[new Ht.TextNode(b$t[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},w$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]},T$t=function(e){return e.type==="ordgroup"?e.body.length:1},C$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=T$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 Cg(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=w$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},k$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 EW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new EW({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:k$t,mathMLnode:x$t,svgSpan:C$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 $Q(t){var e=_D(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 _D(t){return t&&(t.type==="atom"||XPt.hasOwnProperty(t.type))?t:null}var BQ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=vn(t.base,"accent"),r=n.base,t.base=r,i=YPt(Kn(t,e)),t.base=n):(n=vn(t,"accent"),r=n.base);var s=Kn(r,e.havingCrampedStyle()),a=n.isShifty&&Pr.isCharacterBox(r),o=0;if(a){var l=Pr.getBaseElem(r),u=Kn(l,e.havingCrampedStyle());o=Phe(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=Phe(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},f8e=(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},S$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=hL(e[0]),n=!S$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:BQ,mathmlBuilder:f8e});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:BQ,mathmlBuilder:f8e});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=Kn(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 d8=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(Kn(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(Kn(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=d8(Ai(t.body,e));if(t.below){var s=d8(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=d8(Ai(t.below,e));n=new Ht.MathNode("munder",[r,a])}else n=d8(),n=new Ht.MathNode("mover",[r,n]);return n}});var E$t=at.makeSpan;function p8e(t,e){var r=_a(t.body,e,!0);return E$t([t.mclass],r,e)}function g8e(t,e){var r,n=wc(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:p8e,mathmlBuilder:g8e});var LD=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:LD(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=LD(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:p8e,mathmlBuilder:g8e});ir({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:LD(e[0]),body:js(e[0])}},htmlBuilder(t,e){var r=_a(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=wc(t.body,e),n=new Ht.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var A$t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Whe=()=>({type:"styling",body:[],mode:"math",style:"display"}),qhe=t=>t.type==="textord"&&t.text==="@",M$t=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function R$t(t,e,r){var n=A$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 _$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=R$t(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=Whe()}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(Kn(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(Kn(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 m8e=(t,e)=>{var r=_a(t.body,e.withColor(t.color),!1);return at.makeFragment(r)},y8e=(t,e)=>{var r=wc(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:m8e,mathmlBuilder:y8e});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:m8e,mathmlBuilder:y8e});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 _W={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},v8e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Ut("Expected a control sequence",t);return e},L$t=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},b8e=(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(_W[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=_W[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===_W[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=v8e(e.gullet.popToken());e.gullet.consumeSpaces();var i=L$t(e);return b8e(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=v8e(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return b8e(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ik=function(e,r,n){var i=Vi.math[e]&&Vi.math[e].replace,s=IQ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},FQ=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},x8e=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},I$t=function(e,r,n,i,s,a){var o=at.makeSymbol(e,"Main-Regular",s,i),l=FQ(o,r,i,a);return n&&x8e(l,i,r),l},N$t=function(e,r,n,i){return at.makeSymbol(e,"Size"+r+"-Regular",n,i)},w8e=function(e,r,n,i,s,a){var o=N$t(e,r,s,i),l=FQ(at.makeSpan(["delimsizing","size"+r],[o],i),Hr.TEXT,i,a);return n&&x8e(l,i,Hr.TEXT),l},RB=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}},_B=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 Cg("inner",BPt(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}},LW=.008,f8={type:"kern",size:-1*LW},D$t=["|","\\lvert","\\rvert","\\vert"],O$t=["\\|","\\lVert","\\rVert","\\Vert"],T8e=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(D$t,e)?(u="∣",d="vert",f=333):Pr.contains(O$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=ik(o,p,s),m=g.height+g.depth,y=ik(u,p,s),v=y.height+y.depth,x=ik(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=ik(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=FPt(d,Math.round(N*1e3)),$=new Cg(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(RB(h,p,s)),P.push(f8),l===null){var V=A-m-b+2*LW;P.push(_B(u,V,i))}else{var B=(A-m-b-T)/2+2*LW;P.push(_B(u,B,i)),P.push(f8),P.push(RB(l,p,s)),P.push(f8),P.push(_B(u,B,i))}P.push(f8),P.push(RB(o,p,s))}var H=i.havingBaseStyle(Hr.TEXT),G=at.makeVList({positionType:"bottom",positionData:_,children:P},H);return FQ(at.makeSpan(["delimsizing","mult"],[G],H),Hr.TEXT,i,a)},LB=80,IB=.08,NB=function(e,r,n,i,s){var a=$Pt(e,i,n),o=new Cg(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)},P$t=function(e,r){var n=r.havingBaseSizing(),i=E8e("\\surd",e*n.sizeMultiplier,S8e,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+LB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+IB)/s,u=(1+a)/s,o=NB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+LB)*lS[i.size],u=(lS[i.size]+a)/s,l=(lS[i.size]+a+IB)/s,o=NB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+IB,u=e+a,h=Math.floor(1e3*e+a)+LB,o=NB("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}},C8e=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],$$t=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],k8e=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],lS=[0,1.2,1.8,2.4,3],B$t=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Pr.contains(C8e,e)||Pr.contains(k8e,e))return w8e(e,r,!1,n,i,s);if(Pr.contains($$t,e))return T8e(e,lS[r],!1,n,i,s);throw new Ut("Illegal delimiter: '"+e+"'")},F$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}],z$t=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"stack"}],S8e=[{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"}],V$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.")},E8e=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]},A8e=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Pr.contains(k8e,e)?o=F$t:Pr.contains(C8e,e)?o=S8e:o=z$t;var l=E8e(e,r,o,i);return l.type==="small"?I$t(e,l.style,n,i,s,a):l.type==="large"?w8e(e,l.size,n,i,s,a):T8e(e,r,n,i,s,a)},H$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 A8e(e,d,!0,i,s,a)},s0={sqrtImage:P$t,sizedDelim:B$t,sizeToMaxHeight:lS,customSizedDelim:A8e,leftRightDelim:H$t},Uhe={"\\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}},G$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 ID(t,e){var r=_D(t);if(r&&Pr.contains(G$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=ID(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Uhe[t.funcName].size,mclass:Uhe[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 Yhe(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:ID(e[0],t).text,color:r}}});ir({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=ID(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)=>{Yhe(t);for(var r=_a(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{Yhe(t);var r=wc(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 OQ(r)}});ir({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=ID(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=F6(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 zQ=(t,e)=>{var r=at.wrapFragment(Kn(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=OPt(f),g=new x0([new Cg("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)},VQ=(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:zQ,mathmlBuilder:VQ});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:zQ,mathmlBuilder:VQ});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:zQ,mathmlBuilder:VQ});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 M8e={};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 HQ(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}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 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(jhe(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])},W$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=tm(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:HQ(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=_D(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=$Q(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 tm(t.parser,s,GQ(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=tm(t.parser,n,GQ(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=tm(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=_D(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=$Q(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=tm(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=tm(t.parser,e,GQ(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:_8e,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Pr.contains(["gather","gather*"],t.envName)&&ND(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:HQ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return tm(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:_8e,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){ND(t);var e={autoTag:HQ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return tm(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["CD"],props:{numArgs:0},handler(t){return ND(t),_$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 Xhe=M8e;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 Kn(t.body,n)},I8e=(t,e)=>{var r=t.font,n=e.withFont(r);return Ai(t.body,n)},Khe={"\\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=hL(e[0]),s=n;return s in Khe&&(s=Khe[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:L8e,mathmlBuilder:I8e});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:LD(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:L8e,mathmlBuilder:I8e});var N8e=(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},WQ=(t,e)=>{var r=N8e(t.size,e.style),n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=Kn(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=N8e(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 OQ(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:WQ,mathmlBuilder:qQ});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 Zhe=["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=hL(e[0]),a=s.type==="atom"&&s.family==="open"?Qhe(s.text):null,o=hL(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=Zhe[Number(g.text)]}}else p=vn(p,"textord"),f=Zhe[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:WQ,mathmlBuilder:qQ});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=xPt(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:WQ,mathmlBuilder:qQ});var D8e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Kn(t.sup,e.havingStyle(r.sup()),e):Kn(t.sub,e.havingStyle(r.sub()),e),i=vn(t.base,"horizBrace")):i=vn(t,"horizBrace");var s=Kn(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)},q$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:D8e,mathmlBuilder:q$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=_a(t.body,e,!1);return at.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=kg(t.body,e);return r instanceof Oc||(r=new Oc("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=_a(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)=>kg(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=_a(t.html,e,!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>kg(t.mathml,e)});var DB=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(!JAe(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 qPt(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([],[Kn(t.body,e)]),r=at.makeSpan(["inner"],[r],e)):r=at.makeSpan(["inner"],[Kn(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 Jhe=(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=Jhe(t,e),n=_a(r,e,!1);return at.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=Jhe(t,e);return kg(r,e)}});var O8e=(t,e,r,n,i,s,a)=>{t=at.makeSpan([],[t]);var o=r&&Pr.isCharacterBox(r),l,u;if(e){var h=Kn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Kn(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)},P8e=["\\smallint"],y3=(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(P8e,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=_a(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 Oc("mo",[Lu(t.name,t.mode)]),Pr.contains(P8e,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Oc("mo",wc(t.body,e));else{r=new Oc("mi",[new md(t.name.slice(1))]);var n=new Oc("mo",[Lu("⁡","text")]);t.parentIsSupSub?r=new Oc("mrow",[r,n]):r=u8e([r,n])}return r},U$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=U$t[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:y3,mathmlBuilder:p7});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:y3,mathmlBuilder:p7});var Y$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:y3,mathmlBuilder:p7});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:y3,mathmlBuilder:p7});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=Y$t[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:y3,mathmlBuilder:p7});var $8e=(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=_a(o,e.withFont("mathrm"),!0),u=0;u{for(var r=wc(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:$8e,mathmlBuilder:j$t});ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");nv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?at.makeFragment(_a(t.body,e,!1)):at.makeSpan(["mord"],_a(t.body,e,!0),e)},mathmlBuilder(t,e){return kg(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=Kn(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=_a(t.body,e.withPhantom(),!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=wc(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([],[Kn(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=wc(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"],[Kn(t.body,e.withPhantom())]),n=at.makeSpan(["fix"],[]);return at.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=wc(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=Kn(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 B8e(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 B8e(t.body,r,e)};ir({type:"sizing",names:ede,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:ede.indexOf(n)+1,body:s}},htmlBuilder:X$t,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=wc(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([],[Kn(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=Kn(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=Kn(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 tde={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=tde[t.style],n=e.havingStyle(r).withFont("");return B8e(t.body,n,e)},mathmlBuilder(t,e){var r=tde[t.style],n=e.havingStyle(r),i=wc(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 K$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?y3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===Hr.DISPLAY.size||n.limits);return s?$8e:null}else{if(n.type==="accent")return Pr.isCharacterBox(n.base)?BQ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?D8e:null}else return null}else return null};nv({type:"supsub",htmlBuilder(t,e){var r=K$t(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=Kn(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=Kn(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=Kn(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=MW(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)}});nv({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=PQ(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 F8e={mi:"italic",mn:"normal",mtext:"normal"};nv({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=PQ(t,e)||"italic";return n!==F8e[r.type]&&r.setAttribute("mathvariant",n),r}});nv({type:"textord",htmlBuilder(t,e){return at.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=Lu(t.text,t.mode,e),n=PQ(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!==F8e[i.type]&&i.setAttribute("mathvariant",n),i}});var OB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},PB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};nv({type:"spacing",htmlBuilder(t,e){if(PB.hasOwnProperty(t.text)){var r=PB[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(OB.hasOwnProperty(t.text))return at.makeSpan(["mspace",OB[t.text]],[],e);throw new Ut('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(PB.hasOwnProperty(t.text))r=new Ht.MathNode("mtext",[new Ht.TextNode(" ")]);else{if(OB.hasOwnProperty(t.text))return new Ht.MathNode("mspace");throw new Ut('Unknown type of space "'+t.text+'"')}return r}});var rde=()=>{var t=new Ht.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};nv({type:"tag",mathmlBuilder(t,e){var r=new Ht.MathNode("mtable",[new Ht.MathNode("mtr",[rde(),new Ht.MathNode("mtd",[kg(t.body,e)]),rde(),new Ht.MathNode("mtd",[kg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var nde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ide={"\\textbf":"textbf","\\textmd":"textmd"},Z$t={"\\textit":"textit","\\textup":"textup"},sde=(t,e)=>{var r=t.font;if(r){if(nde[r])return e.withTextFontFamily(nde[r]);if(ide[r])return e.withTextFontWeight(ide[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(Z$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=sde(t,e),n=_a(t.body,r,!0);return at.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=sde(t,e);return kg(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=Kn(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=Kn(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=ade(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),Wp=l8e,z8e=`[ \r - ]`,Q$t="\\\\[a-zA-Z@]+",J$t="\\\\[^\uD800-\uDFFF]",eBt="("+Q$t+")"+z8e+"*",tBt=`\\\\( +-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 d7=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]}},a8={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]},Dhe={Å:"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 VPt(t,e){gd[t]=e}function IQ(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 Dhe&&(n=Dhe[t[0]].charCodeAt(0),i=gd[e][n]),!i&&r==="text"&&QAe(n)&&(i=gd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var CB={};function HPt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!CB[e]){var r=CB[e]={cssEmPerMu:a8.quad[e]/18};for(var n in a8)a8.hasOwnProperty(n)&&(r[n]=a8[n][e])}return CB[e]}var GPt=[[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]],Ohe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Phe=function(e,r){return r.size<2?e:GPt[e-1][r.size-1]};let JAe=class Xm{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||Xm.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=Ohe[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 Xm(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Phe(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:Ohe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Phe(Xm.BASESIZE,e);return this.size===r&&this.textSize===Xm.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!==Xm.BASESIZE?["sizing","reset-size"+this.size,"size"+Xm.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=HPt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};JAe.BASESIZE=6;var SW={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},WPt={ex:!0,em:!0,mu:!0},e8e=function(e){return typeof e!="string"&&(e=e.unit),e in SW||e in WPt||e==="ex"},bs=function(e,r){var n;if(e.unit in SW)n=SW[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"},Tg=function(e){return e.filter(r=>r).join(" ")},t8e=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)}},r8e=function(e){var r=document.createElement(e);r.className=Tg(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]/,n8e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Pr.escape(Tg(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(qPt.test(s))throw new Ut("Invalid attribute name '"+s+"'");r+=" "+s+'="'+Pr.escape(this.attributes[s])+'"'}r+=">";for(var a=0;a",r};let f7=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,t8e.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 r8e.call(this,"span")}toMarkup(){return n8e.call(this,"span")}},NQ=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,t8e.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 r8e.call(this,"a")}toMarkup(){return n8e.call(this,"a")}},UPt=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=Tg(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':''}},EW=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 XPt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},KPt={"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",Fl="close",m3="inner",zr="mathord",pa="op-token",jc="open",MD="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,MD,".","\\ldotp");Y(ae,be,MD,"⋅","\\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,Fl,"⎱","\\rmoustache",!0);Y(ae,be,jc,"⎰","\\lmoustache",!0);Y(ae,be,Fl,"⟯","\\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,Fl,"┐","\\@urcorner",!0);Y(ae,Ge,jc,"└","\\@llcorner",!0);Y(ae,Ge,Fl,"┘","\\@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,Fl,"?","?");Y(ae,be,Fl,"!","!");Y(ae,be,Fl,"⟩","\\rangle",!0);Y(ae,be,Fl,"∣","\\rvert");Y(ae,be,Fl,"∥","\\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,MD,",",",");Y(ae,be,MD,";",";");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,Fl,"}","\\}");Y(Ot,be,et,"}","\\}");Y(Ot,be,et,"}","\\textbraceright");Y(ae,be,jc,"{","\\lbrace");Y(ae,be,Fl,"}","\\rbrace");Y(ae,be,jc,"[","\\lbrack",!0);Y(Ot,be,et,"[","\\lbrack",!0);Y(ae,be,Fl,"]","\\rbrack",!0);Y(Ot,be,et,"]","\\rbrack",!0);Y(ae,be,jc,"(","\\lparen",!0);Y(ae,be,Fl,")","\\rparen",!0);Y(Ot,be,et,"<","\\textless",!0);Y(Ot,be,et,">","\\textgreater",!0);Y(ae,be,jc,"⌊","\\lfloor",!0);Y(ae,be,Fl,"⌋","\\rfloor",!0);Y(ae,be,jc,"⌈","\\lceil",!0);Y(ae,be,Fl,"⌉","\\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,pa,"∐","\\coprod");Y(ae,be,pa,"⋁","\\bigvee");Y(ae,be,pa,"⋀","\\bigwedge");Y(ae,be,pa,"⨄","\\biguplus");Y(ae,be,pa,"⋂","\\bigcap");Y(ae,be,pa,"⋃","\\bigcup");Y(ae,be,pa,"∫","\\int");Y(ae,be,pa,"∫","\\intop");Y(ae,be,pa,"∬","\\iint");Y(ae,be,pa,"∭","\\iiint");Y(ae,be,pa,"∏","\\prod");Y(ae,be,pa,"∑","\\sum");Y(ae,be,pa,"⨂","\\bigotimes");Y(ae,be,pa,"⨁","\\bigoplus");Y(ae,be,pa,"⨀","\\bigodot");Y(ae,be,pa,"∮","\\oint");Y(ae,be,pa,"∯","\\oiint");Y(ae,be,pa,"∰","\\oiiint");Y(ae,be,pa,"⨆","\\bigsqcup");Y(ae,be,pa,"∫","\\smallint");Y(Ot,be,m3,"…","\\textellipsis");Y(ae,be,m3,"…","\\mathellipsis");Y(Ot,be,m3,"…","\\ldots",!0);Y(ae,be,m3,"…","\\ldots",!0);Y(ae,be,m3,"⋯","\\@cdots",!0);Y(ae,be,m3,"⋱","\\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 i8e={"--":!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 Bhe='0123456789/@."';for(var kB=0;kB0)return Zu(s,u,i,r,a.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=JPt(s,i,r,a,n);d=p.fontName,f=[p.fontClass]}else o?(d=o8e[l].fontName,f=[l]):(d=u8(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(RD(s,d,i).metrics)return Zu(s,d,i,r,a.concat(f));if(i8e.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m{if(Tg(t.classes)!==Tg(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},r$t=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},ec=function(e,r,n,i){var s=new f7(e,r,n,i);return DQ(s),s},s8e=(t,e,r,n)=>new f7(t,e,r,n),n$t=function(e,r,n){var i=ec([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},i$t=function(e,r,n,i){var s=new NQ(e,r,n,i);return DQ(s),s},a8e=function(e){var r=new d7(e);return DQ(r),r},s$t=function(e,r){return e instanceof d7?ec([],[e],r):e},a$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=ec(["mspace"],[],e),n=bs(t,e);return r.style.marginRight=Xt(n),r},u8=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},o8e={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"}},l8e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},c$t=function(e,r){var[n,i,s]=l8e[e],a=new Cg(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=s8e(["overlay"],[o],r);return l.height=s,l.style.height=Xt(s),l.style.width=Xt(i),l},at={fontMap:o8e,makeSymbol:Zu,mathsym:QPt,makeSpan:ec,makeSvgSpan:s8e,makeLineSpan:n$t,makeAnchor:i$t,makeFragment:a8e,wrapFragment:s$t,makeVList:o$t,makeOrd:e$t,makeGlue:l$t,staticSvg:c$t,svgData:l8e,tryCombineChars:r$t},ys={number:3,unit:"mu"},Lm={number:4,unit:"mu"},ff={number:5,unit:"mu"},u$t={mord:{mop:ys,mbin:Lm,mrel:ff,minner:ys},mop:{mord:ys,mop:ys,mrel:ff,minner:ys},mbin:{mord:Lm,mop:Lm,mopen:Lm,minner:Lm},mrel:{mord:ff,mop:ff,mopen:ff,minner:ff},mopen:{},mclose:{mop:ys,mbin:Lm,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:Lm,mrel:ff,mopen:ys,mpunct:ys,minner:ys}},h$t={mord:{mop:ys},mop:{mord:ys,mop:ys},mbin:{},mrel:{},mopen:{},mclose:{mop:ys},mpunct:{},minner:{mop:ys}},c8e={},cL={},uL={};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(f$t,v)?m.classes[0]="mord":v==="mbin"&&Pr.contains(d$t,y)&&(g.classes[0]="mord")},{node:d},f,p),Ghe(s,(g,m)=>{var y=MW(m),v=MW(g),x=y&&v?g.hasClass("mtight")?h$t[y][v]:u$t[y][v]:null;if(x)return at.makeGlue(x,u)},{node:d},f,p),s},Ghe=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()},u8e=function(e){return e instanceof d7||e instanceof NQ||e instanceof f7&&e.hasClass("enclosing")?e:null},m$t=function t(e,r){var n=u8e(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},MW=function(e,r){return e?(r&&(e=m$t(e,r)),g$t[e.classes[0]]||null):null},F6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return w0(r.concat(n))},Kn=function(e,r,n){if(!e)return w0();if(cL[e.type]){var i=cL[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 h8(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 RW(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(h8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(h8(a,e));var u;r?(u=h8(_a(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 h8e(t){return new d7(t)}let Oc=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=Tg(this.classes));for(var n=0;n0&&(e+=' class ="'+Pr.escape(Tg(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}},y$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:Oc,TextNode:md,SpaceNode:y$t,newDocumentFragment:h8e},Lu=function(e,r,n){return Vi[r][e]&&Vi[r][e].replace&&e.charCodeAt(0)!==55349&&!(i8e.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)},OQ=function(e){return e.length===1?e[0]:new Ht.MathNode("mrow",e)},PQ=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 IQ(s,a,i)?at.fontMap[n].variant:null};function MB(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 wc=function(e,r,n){if(e.length===1){var i=Ai(e[0],r);return n&&i instanceof Oc&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||MB(a))){var u=l.children[0];u instanceof Oc&&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},kg=function(e,r,n){return OQ(wc(e,r,n))},Ai=function(e,r){if(!e)return new Ht.MathNode("mrow");if(uL[e.type]){var n=uL[e.type](e,r);return n}else throw new Ut("Got group of unknown type: '"+e.type+"'")};function Whe(t,e,r,n,i){var s=wc(t,r),a;s.length===1&&s[0]instanceof Oc&&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 d8e=function(e){return new JAe({style:e.displayMode?Hr.DISPLAY:Hr.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},f8e=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},v$t=function(e,r,n){var i=d8e(n),s;if(n.output==="mathml")return Whe(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=RW(e,i);s=at.makeSpan(["katex"],[a])}else{var o=Whe(e,r,i,n.displayMode,!1),l=RW(e,i);s=at.makeSpan(["katex"],[o,l])}return f8e(s,n)},b$t=function(e,r,n){var i=d8e(n),s=RW(e,i),a=at.makeSpan(["katex"],[s]);return f8e(a,n)},x$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":"="},w$t=function(e){var r=new Ht.MathNode("mo",[new Ht.TextNode(x$t[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},T$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]},C$t=function(e){return e.type==="ordgroup"?e.body.length:1},k$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=C$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 Cg(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=T$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},S$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 EW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new EW({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:S$t,mathMLnode:w$t,svgSpan:k$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 $Q(t){var e=_D(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 _D(t){return t&&(t.type==="atom"||KPt.hasOwnProperty(t.type))?t:null}var BQ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=vn(t.base,"accent"),r=n.base,t.base=r,i=jPt(Kn(t,e)),t.base=n):(n=vn(t,"accent"),r=n.base);var s=Kn(r,e.havingCrampedStyle()),a=n.isShifty&&Pr.isCharacterBox(r),o=0;if(a){var l=Pr.getBaseElem(r),u=Kn(l,e.havingCrampedStyle());o=$he(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=$he(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},p8e=(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},E$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=hL(e[0]),n=!E$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:BQ,mathmlBuilder:p8e});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:BQ,mathmlBuilder:p8e});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=Kn(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 d8=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(Kn(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(Kn(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=d8(Ai(t.body,e));if(t.below){var s=d8(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=d8(Ai(t.below,e));n=new Ht.MathNode("munder",[r,a])}else n=d8(),n=new Ht.MathNode("mover",[r,n]);return n}});var A$t=at.makeSpan;function g8e(t,e){var r=_a(t.body,e,!0);return A$t([t.mclass],r,e)}function m8e(t,e){var r,n=wc(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:g8e,mathmlBuilder:m8e});var LD=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:LD(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=LD(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:g8e,mathmlBuilder:m8e});ir({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:LD(e[0]),body:js(e[0])}},htmlBuilder(t,e){var r=_a(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=wc(t.body,e),n=new Ht.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var M$t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},qhe=()=>({type:"styling",body:[],mode:"math",style:"display"}),Uhe=t=>t.type==="textord"&&t.text==="@",R$t=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function _$t(t,e,r){var n=M$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 L$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=_$t(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=qhe()}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(Kn(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(Kn(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 y8e=(t,e)=>{var r=_a(t.body,e.withColor(t.color),!1);return at.makeFragment(r)},v8e=(t,e)=>{var r=wc(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:y8e,mathmlBuilder:v8e});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:y8e,mathmlBuilder:v8e});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 _W={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},b8e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Ut("Expected a control sequence",t);return e},I$t=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},x8e=(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(_W[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=_W[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===_W[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=b8e(e.gullet.popToken());e.gullet.consumeSpaces();var i=I$t(e);return x8e(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=b8e(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return x8e(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ik=function(e,r,n){var i=Vi.math[e]&&Vi.math[e].replace,s=IQ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},FQ=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},w8e=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},N$t=function(e,r,n,i,s,a){var o=at.makeSymbol(e,"Main-Regular",s,i),l=FQ(o,r,i,a);return n&&w8e(l,i,r),l},D$t=function(e,r,n,i){return at.makeSymbol(e,"Size"+r+"-Regular",n,i)},T8e=function(e,r,n,i,s,a){var o=D$t(e,r,s,i),l=FQ(at.makeSpan(["delimsizing","size"+r],[o],i),Hr.TEXT,i,a);return n&&w8e(l,i,Hr.TEXT),l},RB=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}},_B=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 Cg("inner",FPt(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}},LW=.008,f8={type:"kern",size:-1*LW},O$t=["|","\\lvert","\\rvert","\\vert"],P$t=["\\|","\\lVert","\\rVert","\\Vert"],C8e=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(O$t,e)?(u="∣",d="vert",f=333):Pr.contains(P$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=ik(o,p,s),m=g.height+g.depth,y=ik(u,p,s),v=y.height+y.depth,x=ik(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=ik(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=zPt(d,Math.round(N*1e3)),$=new Cg(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(RB(h,p,s)),P.push(f8),l===null){var V=A-m-b+2*LW;P.push(_B(u,V,i))}else{var B=(A-m-b-T)/2+2*LW;P.push(_B(u,B,i)),P.push(f8),P.push(RB(l,p,s)),P.push(f8),P.push(_B(u,B,i))}P.push(f8),P.push(RB(o,p,s))}var H=i.havingBaseStyle(Hr.TEXT),G=at.makeVList({positionType:"bottom",positionData:_,children:P},H);return FQ(at.makeSpan(["delimsizing","mult"],[G],H),Hr.TEXT,i,a)},LB=80,IB=.08,NB=function(e,r,n,i,s){var a=BPt(e,i,n),o=new Cg(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)},$$t=function(e,r){var n=r.havingBaseSizing(),i=A8e("\\surd",e*n.sizeMultiplier,E8e,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+LB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+IB)/s,u=(1+a)/s,o=NB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+LB)*lS[i.size],u=(lS[i.size]+a)/s,l=(lS[i.size]+a+IB)/s,o=NB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+IB,u=e+a,h=Math.floor(1e3*e+a)+LB,o=NB("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}},k8e=["(","\\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","⎰","⎱"],S8e=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],lS=[0,1.2,1.8,2.4,3],F$t=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Pr.contains(k8e,e)||Pr.contains(S8e,e))return T8e(e,r,!1,n,i,s);if(Pr.contains(B$t,e))return C8e(e,lS[r],!1,n,i,s);throw new Ut("Illegal delimiter: '"+e+"'")},z$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}],V$t=[{type:"small",style:Hr.SCRIPTSCRIPT},{type:"small",style:Hr.SCRIPT},{type:"small",style:Hr.TEXT},{type:"stack"}],E8e=[{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"}],H$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.")},A8e=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]},M8e=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Pr.contains(S8e,e)?o=z$t:Pr.contains(k8e,e)?o=E8e:o=V$t;var l=A8e(e,r,o,i);return l.type==="small"?N$t(e,l.style,n,i,s,a):l.type==="large"?T8e(e,l.size,n,i,s,a):C8e(e,r,n,i,s,a)},G$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 M8e(e,d,!0,i,s,a)},s0={sqrtImage:$$t,sizedDelim:F$t,sizeToMaxHeight:lS,customSizedDelim:M8e,leftRightDelim:G$t},Yhe={"\\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}},W$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 ID(t,e){var r=_D(t);if(r&&Pr.contains(W$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=ID(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Yhe[t.funcName].size,mclass:Yhe[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 jhe(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:ID(e[0],t).text,color:r}}});ir({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=ID(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)=>{jhe(t);for(var r=_a(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{jhe(t);var r=wc(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 OQ(r)}});ir({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=ID(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=F6(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 zQ=(t,e)=>{var r=at.wrapFragment(Kn(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=PPt(f),g=new x0([new Cg("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)},VQ=(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:zQ,mathmlBuilder:VQ});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:zQ,mathmlBuilder:VQ});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:zQ,mathmlBuilder:VQ});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 R8e={};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 HQ(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}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 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(Xhe(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])},q$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=tm(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:HQ(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=_D(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=$Q(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 tm(t.parser,s,GQ(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=tm(t.parser,n,GQ(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=tm(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=_D(e[0]),n=r?[e[0]]:vn(e[0],"ordgroup").body,i=n.map(function(a){var o=$Q(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=tm(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=tm(t.parser,e,GQ(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:L8e,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Pr.contains(["gather","gather*"],t.envName)&&ND(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:HQ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return tm(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:L8e,htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){ND(t);var e={autoTag:HQ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return tm(t.parser,e,"display")},htmlBuilder:Yd,mathmlBuilder:jd});Ud({type:"array",names:["CD"],props:{numArgs:0},handler(t){return ND(t),L$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 Khe=R8e;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 Kn(t.body,n)},N8e=(t,e)=>{var r=t.font,n=e.withFont(r);return Ai(t.body,n)},Zhe={"\\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=hL(e[0]),s=n;return s in Zhe&&(s=Zhe[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:I8e,mathmlBuilder:N8e});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:LD(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:I8e,mathmlBuilder:N8e});var D8e=(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},WQ=(t,e)=>{var r=D8e(t.size,e.style),n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=Kn(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=D8e(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 OQ(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:WQ,mathmlBuilder:qQ});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 Qhe=["display","text","script","scriptscript"],Jhe=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=hL(e[0]),a=s.type==="atom"&&s.family==="open"?Jhe(s.text):null,o=hL(e[1]),l=o.type==="atom"&&o.family==="close"?Jhe(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=Qhe[Number(g.text)]}}else p=vn(p,"textord"),f=Qhe[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:WQ,mathmlBuilder:qQ});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=wPt(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:WQ,mathmlBuilder:qQ});var O8e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Kn(t.sup,e.havingStyle(r.sup()),e):Kn(t.sub,e.havingStyle(r.sub()),e),i=vn(t.base,"horizBrace")):i=vn(t,"horizBrace");var s=Kn(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)},U$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:O8e,mathmlBuilder:U$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=_a(t.body,e,!1);return at.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=kg(t.body,e);return r instanceof Oc||(r=new Oc("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=_a(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)=>kg(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=_a(t.html,e,!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>kg(t.mathml,e)});var DB=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(!e8e(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 UPt(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([],[Kn(t.body,e)]),r=at.makeSpan(["inner"],[r],e)):r=at.makeSpan(["inner"],[Kn(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 ede=(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=ede(t,e),n=_a(r,e,!1);return at.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=ede(t,e);return kg(r,e)}});var P8e=(t,e,r,n,i,s,a)=>{t=at.makeSpan([],[t]);var o=r&&Pr.isCharacterBox(r),l,u;if(e){var h=Kn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Kn(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)},$8e=["\\smallint"],y3=(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($8e,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=_a(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 Oc("mo",[Lu(t.name,t.mode)]),Pr.contains($8e,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Oc("mo",wc(t.body,e));else{r=new Oc("mi",[new md(t.name.slice(1))]);var n=new Oc("mo",[Lu("⁡","text")]);t.parentIsSupSub?r=new Oc("mrow",[r,n]):r=h8e([r,n])}return r},Y$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=Y$t[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:y3,mathmlBuilder:p7});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:y3,mathmlBuilder:p7});var j$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:y3,mathmlBuilder:p7});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:y3,mathmlBuilder:p7});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=j$t[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:y3,mathmlBuilder:p7});var B8e=(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=_a(o,e.withFont("mathrm"),!0),u=0;u{for(var r=wc(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:B8e,mathmlBuilder:X$t});ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");nv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?at.makeFragment(_a(t.body,e,!1)):at.makeSpan(["mord"],_a(t.body,e,!0),e)},mathmlBuilder(t,e){return kg(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=Kn(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=_a(t.body,e.withPhantom(),!1);return at.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=wc(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([],[Kn(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=wc(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"],[Kn(t.body,e.withPhantom())]),n=at.makeSpan(["fix"],[]);return at.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=wc(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=Kn(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 F8e(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 F8e(t.body,r,e)};ir({type:"sizing",names:tde,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:tde.indexOf(n)+1,body:s}},htmlBuilder:K$t,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=wc(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([],[Kn(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=Kn(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=Kn(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 rde={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=rde[t.style],n=e.havingStyle(r).withFont("");return F8e(t.body,n,e)},mathmlBuilder(t,e){var r=rde[t.style],n=e.havingStyle(r),i=wc(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 Z$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?y3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===Hr.DISPLAY.size||n.limits);return s?B8e:null}else{if(n.type==="accent")return Pr.isCharacterBox(n.base)?BQ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?O8e:null}else return null}else return null};nv({type:"supsub",htmlBuilder(t,e){var r=Z$t(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=Kn(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=Kn(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=Kn(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=MW(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)}});nv({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=PQ(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 z8e={mi:"italic",mn:"normal",mtext:"normal"};nv({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=PQ(t,e)||"italic";return n!==z8e[r.type]&&r.setAttribute("mathvariant",n),r}});nv({type:"textord",htmlBuilder(t,e){return at.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=Lu(t.text,t.mode,e),n=PQ(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!==z8e[i.type]&&i.setAttribute("mathvariant",n),i}});var OB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},PB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};nv({type:"spacing",htmlBuilder(t,e){if(PB.hasOwnProperty(t.text)){var r=PB[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(OB.hasOwnProperty(t.text))return at.makeSpan(["mspace",OB[t.text]],[],e);throw new Ut('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(PB.hasOwnProperty(t.text))r=new Ht.MathNode("mtext",[new Ht.TextNode(" ")]);else{if(OB.hasOwnProperty(t.text))return new Ht.MathNode("mspace");throw new Ut('Unknown type of space "'+t.text+'"')}return r}});var nde=()=>{var t=new Ht.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};nv({type:"tag",mathmlBuilder(t,e){var r=new Ht.MathNode("mtable",[new Ht.MathNode("mtr",[nde(),new Ht.MathNode("mtd",[kg(t.body,e)]),nde(),new Ht.MathNode("mtd",[kg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var ide={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},sde={"\\textbf":"textbf","\\textmd":"textmd"},Q$t={"\\textit":"textit","\\textup":"textup"},ade=(t,e)=>{var r=t.font;if(r){if(ide[r])return e.withTextFontFamily(ide[r]);if(sde[r])return e.withTextFontWeight(sde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(Q$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=ade(t,e),n=_a(t.body,r,!0);return at.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=ade(t,e);return kg(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=Kn(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=Kn(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=ode(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),Wp=c8e,V8e=`[ \r + ]`,J$t="\\\\[a-zA-Z@]+",eBt="\\\\[^\uD800-\uDFFF]",tBt="("+J$t+")"+V8e+"*",rBt=`\\\\( |[ \r ]+ -?)[ \r ]*`,IW="[̀-ͯ]",rBt=new RegExp(IW+"+$"),nBt="("+z8e+"+)|"+(tBt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(IW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(IW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+eBt)+("|"+J$t+")");let ode=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(nBt,"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))}},iBt=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 sBt=R8e;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 lde={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=lde[e.text],n==null||n>=r)throw new Ut("Invalid base-"+r+" digit "+e.text);for(var i;(i=lde[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=>UQ(t,!1,!0,!1));ke("\\renewcommand",t=>UQ(t,!0,!1,!1));ke("\\providecommand",t=>UQ(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),Wp[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 cde={",":"\\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 cde?e=cde[r]:(r.slice(0,4)==="\\not"||r in Vi.math&&Pr.contains(["bin","rel"],Vi.math[r].group))&&(e="\\dotsb"),e});var YQ={")":!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 YQ?"\\ldots\\,":"\\ldots"});ke("\\dotsc",function(t){var e=t.future().text;return e in YQ&&e!==","?"\\ldots\\,":"\\ldots"});ke("\\cdots",function(t){var e=t.future().text;return e in YQ?"\\@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 V8e=Xt(gd["Main-Regular"][84][1]-.7*gd["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+V8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+V8e+"}{\\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 H8e=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",H8e(!1));ke("\\bra@set",H8e(!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 G8e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let aBt=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 iBt(sBt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new ode(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 ode(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)||Vi.math.hasOwnProperty(e)||Vi.text.hasOwnProperty(e)||G8e.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 ude=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,p8=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),$B={"́":{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"}},hde={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let W8e=class q8e{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 aBt(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(q8e.endOfExpression.indexOf(i.text)!==-1||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=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(jPt.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&&(ZAe(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 jy({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{j8e.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)}}}}}),K8e=Qn.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 jy({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{j8e.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[X8e.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),K8e.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const dBt=K8e.extend({markdownTokenizer:_7e}),fBt=X8e.extend({markdownTokenizer:L7e}),dde={throwOnError:!1,strict:"warn",trust:!1},pBt=(t={})=>[fBt.configure({katexOptions:dde,onClick:t.onBlockClick}),dBt.configure({katexOptions:dde,onClick:t.onInlineClick})],fde=t=>(t==null?void 0:t.type.name)==="image"&&!pRt(t.attrs.src),g8=(t,e)=>!!t&&t.type.name===y0&&!e.has(t),gBt=(t,e)=>{let r=null;return t.doc.forEach((n,i)=>{n===e&&(r={node:n,pos:i})}),r},mBt=(t,e,r)=>{let n=e,i=e+r.nodeSize;for(;fde(t.doc.resolve(n).nodeBefore);)n-=t.doc.resolve(n).nodeBefore.nodeSize;for(;fde(t.doc.resolve(i).nodeAfter);)i+=t.doc.resolve(i).nodeAfter.nodeSize;return{start:n,end:i}},BB=(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},yBt=(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=gBt(t,i);s&&vBt(t,s.node,s.pos,r)}return t},vBt=(t,e,r,n)=>{const i=t.doc.type.schema.nodes[y0];if(!i)return;const{start:s,end:a}=mBt(t,r,e),o=g8(t.doc.resolve(s).nodeBefore,n)?t.doc.resolve(s).nodeBefore:null,l=o?null:g8(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(!BB(t,s,a,(u==null?void 0:u.type)??i,y))return;if(o)ic(t.doc,s)&&t.join(s);else if(l){const v=t.doc.nodeAt(s),x=v?s+v.nodeSize:null;x!==null&&ic(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;BB(t,y,a,i,d)&&ic(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}},xBt=(t,e,r=t.selection)=>{const{from:n,to:i}=bBt(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},wBt=(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 yBt(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=S7e.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=uW(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)}}}),CBt=` +?)[ \r ]*`,IW="[̀-ͯ]",nBt=new RegExp(IW+"+$"),iBt="("+V8e+"+)|"+(rBt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(IW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(IW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+tBt)+("|"+eBt+")");let lde=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(iBt,"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))}},sBt=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 aBt=_8e;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 cde={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=cde[e.text],n==null||n>=r)throw new Ut("Invalid base-"+r+" digit "+e.text);for(var i;(i=cde[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=>UQ(t,!1,!0,!1));ke("\\renewcommand",t=>UQ(t,!0,!1,!1));ke("\\providecommand",t=>UQ(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),Wp[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 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"};ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in ude?e=ude[r]:(r.slice(0,4)==="\\not"||r in Vi.math&&Pr.contains(["bin","rel"],Vi.math[r].group))&&(e="\\dotsb"),e});var YQ={")":!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 YQ?"\\ldots\\,":"\\ldots"});ke("\\dotsc",function(t){var e=t.future().text;return e in YQ&&e!==","?"\\ldots\\,":"\\ldots"});ke("\\cdots",function(t){var e=t.future().text;return e in YQ?"\\@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 H8e=Xt(gd["Main-Regular"][84][1]-.7*gd["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+H8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+H8e+"}{\\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 G8e=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",G8e(!1));ke("\\bra@set",G8e(!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 W8e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let oBt=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 sBt(aBt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new lde(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 lde(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)||Vi.math.hasOwnProperty(e)||Vi.text.hasOwnProperty(e)||W8e.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 hde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,p8=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),$B={"́":{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"}},dde={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let q8e=class U8e{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 oBt(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(U8e.endOfExpression.indexOf(i.text)!==-1||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=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(XPt.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&&(QAe(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 jy({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{X8e.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)}}}}}),Z8e=Qn.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 jy({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{X8e.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[K8e.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),Z8e.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const fBt=Z8e.extend({markdownTokenizer:L7e}),pBt=K8e.extend({markdownTokenizer:I7e}),fde={throwOnError:!1,strict:"warn",trust:!1},gBt=(t={})=>[pBt.configure({katexOptions:fde,onClick:t.onBlockClick}),fBt.configure({katexOptions:fde,onClick:t.onInlineClick})],pde=t=>(t==null?void 0:t.type.name)==="image"&&!gRt(t.attrs.src),g8=(t,e)=>!!t&&t.type.name===y0&&!e.has(t),mBt=(t,e)=>{let r=null;return t.doc.forEach((n,i)=>{n===e&&(r={node:n,pos:i})}),r},yBt=(t,e,r)=>{let n=e,i=e+r.nodeSize;for(;pde(t.doc.resolve(n).nodeBefore);)n-=t.doc.resolve(n).nodeBefore.nodeSize;for(;pde(t.doc.resolve(i).nodeAfter);)i+=t.doc.resolve(i).nodeAfter.nodeSize;return{start:n,end:i}},BB=(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},vBt=(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=mBt(t,i);s&&bBt(t,s.node,s.pos,r)}return t},bBt=(t,e,r,n)=>{const i=t.doc.type.schema.nodes[y0];if(!i)return;const{start:s,end:a}=yBt(t,r,e),o=g8(t.doc.resolve(s).nodeBefore,n)?t.doc.resolve(s).nodeBefore:null,l=o?null:g8(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(!BB(t,s,a,(u==null?void 0:u.type)??i,y))return;if(o)ic(t.doc,s)&&t.join(s);else if(l){const v=t.doc.nodeAt(s),x=v?s+v.nodeSize:null;x!==null&&ic(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;BB(t,y,a,i,d)&&ic(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}},wBt=(t,e,r=t.selection)=>{const{from:n,to:i}=xBt(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},TBt=(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 vBt(a,o),a.docChanged?(t.view.dispatch(a),!0):!1},CBt=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=E7e.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=uW(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)}}}),kBt=` [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; } @@ -2549,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; } -`,kBt=t=>E7e.extend({addNodeView(){return TBt(t)}}),Z8e=document.createElement("style");Z8e.textContent=CBt;document.head.append(Z8e);VMt();const Q8e=document.createElement("style");Q8e.textContent=aRt;document.head.append(Q8e);dt.registerConnector(qAe,YOt,!0);function ny(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 KQ(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 ZQ(t,e){const r=ny(t);return r?JSON.stringify({kind:"image",href:KQ(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function SBt(t,e){const r=ny(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:KQ(t,r),filename:n,resourceId:r})}const pde="edgeever-attachment-kind-";function EBt(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function J8e(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(pde)&&e.classList.remove(n)});const r=EBt(e.textContent||"");e.classList.add("edgeever-attachment-link",`${pde}${ry(null,r)}`)})}const ABt=performance.now(),gde=256*1024;let ta="viewer",dL="zh-CN",NW="开始输入…",sk=!1;const fL=new Map;let MBt=0;function Ua(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 RBt(t){return new Uint8Array(await t.arrayBuffer())}function _Bt(t){let e="";for(let r=0;r{const r=`r${++MBt}`;fL.set(r,e),Ua({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{fL.delete(r)&&e(null)},3e4)})}async function LBt(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(eMe(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await tMe(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function IBt(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]);Hce.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 Hce.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,a.replaceWith(h)}catch{}}}let ak=null,jM=null,gL=null,ok=null,lk=null,ck=null;function QQ(){var t;jM!==null&&cancelAnimationFrame(jM),jM=null,ak==null||ak.dispose(),ak=null,lk==null||lk.disconnect(),lk=null,ok==null||ok.dispose(),ok=null,ck==null||ck.remove(),ck=null,(t=zo.querySelector(".ProseMirror"))==null||t.removeAttribute("hidden")}function NBt(t,e,r){QQ();const n=t.querySelector(".ProseMirror");if(!n)return!1;const i=XOt(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=hPt(l,s,{...e,nodes:e.nodes.map((f,p)=>({...f,width:i.nodes[p].width,height:i.nodes[p].height}))});ak=u;const h=()=>u.resize(o(),Math.max(1,s.clientHeight));jM=requestAnimationFrame(h);const d=new ResizeObserver(h);return d.observe(a??s),ok=l,lk=d,ck=s,!0}const DBt=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function fp(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 rMe(t){return Math.min(100,Math.max(10,Math.round(t)))}function m8(t,e){const r=e==null?null:rMe(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 mde(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 OBt(){return zwe.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>fp(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=fp(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 _=rMe(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),m8(i,_),f(_)},d=[];for(const E of DBt){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"),mde(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 pL(A)||ny(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=ZQ(E,String(n.attrs.alt??"image"));if(A){Ua({type:"resourcePress",targetJson:A});return}Ua({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&&Ua({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};mde(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=fp(E.width);m8(i,R),f(R);const _=String(E.src??""),P=ny(_);P&&(i.dataset.resourceHref=KQ(_,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(eMe(R)){tMe(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(fp(E.attrs.width)),m8(i,fp(E.attrs.width))),!0},selectNode:()=>{var A,R;C=!0,i.classList.add("is-selected");const E=fp((R=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:R.width)??fp(i.dataset.width)??fp(n.attrs.width);m8(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 PBt(t){return[...M7e({mathematics:pBt(),starterKit:{codeBlock:!1,link:!1},image:OBt(),gallery:kBt(()=>dL),pdf:!1,file:!1,pluginEmbed:!1,table:{table:{resizable:!1}},markdown:!0}),VNt,ugt.configure({languageClassPrefix:"language-"}),...PRt(),ogt.configure({placeholder:t})]}const zo=document.getElementById("editor"),XM=document.getElementById("toolbar"),mr=new wpt({element:zo,extensions:PBt("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{b5(),requestAnimationFrame(()=>J8e(zo)),!(sk||ta!=="editor")&&ed(t)},onSelectionUpdate:()=>b5(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},transformPastedHTML(t){return sRt(t)},handleClick(t,e,r){return yde(r,"click")},handleDOMEvents:{contextmenu(t,e){return yde(e,"contextmenu")}}}});zo.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(),Ua({type:"doubleTap"}))});function yde(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(pL(s)||ny(s)){const a=SBt(s,n.textContent||"");if(a)return t.preventDefault(),t.stopPropagation(),Ua({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||(pL(s)||ny(s)?s:"");if(!a&&!ny(s))return ta==="viewer"&&e==="click"&&s?(t.preventDefault(),Ua({type:"imagePreview",source:s,alt:i.getAttribute("alt")||""}),!0):!1;const o=a||s,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=ZQ(o,l);if(u)return t.preventDefault(),t.stopPropagation(),Ua({type:"resourcePress",targetJson:u}),!0}if(ta==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),Ua({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};zo.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=ZQ(a,e.getAttribute("alt")||"image");o&&Ua({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),zo.addEventListener("touchend",r,{passive:!0}),zo.addEventListener("touchmove",r,{passive:!0}),zo.addEventListener("touchcancel",r,{passive:!0})})();const JQ="edgeever-dollar",eJ=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(eJ)}:t},nMe=t=>HRt(dQ(t.getJSON()));let pC=null;const $Bt=(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(eJ({type:"doc",content:i})).replaceAll(JQ,"\\$"):t.state.doc.textBetween(e,r,` +`,SBt=t=>A7e.extend({addNodeView(){return CBt(t)}}),Q8e=document.createElement("style");Q8e.textContent=kBt;document.head.append(Q8e);HMt();const J8e=document.createElement("style");J8e.textContent=oRt;document.head.append(J8e);dt.registerConnector(UAe,jOt,!0);function ny(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 KQ(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 ZQ(t,e){const r=ny(t);return r?JSON.stringify({kind:"image",href:KQ(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function EBt(t,e){const r=ny(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:KQ(t,r),filename:n,resourceId:r})}const gde="edgeever-attachment-kind-";function ABt(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function eMe(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(gde)&&e.classList.remove(n)});const r=ABt(e.textContent||"");e.classList.add("edgeever-attachment-link",`${gde}${ry(null,r)}`)})}const MBt=performance.now(),mde=256*1024;let ta="viewer",dL="zh-CN",NW="开始输入…",sk=!1;const fL=new Map;let RBt=0;function Ua(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 _Bt(t){return new Uint8Array(await t.arrayBuffer())}function LBt(t){let e="";for(let r=0;r{const r=`r${++RBt}`;fL.set(r,e),Ua({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{fL.delete(r)&&e(null)},3e4)})}async function IBt(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(tMe(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await rMe(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function NBt(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]);Hce.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 Hce.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,a.replaceWith(h)}catch{}}}let ak=null,jM=null,gL=null,ok=null,lk=null,ck=null;function QQ(){var t;jM!==null&&cancelAnimationFrame(jM),jM=null,ak==null||ak.dispose(),ak=null,lk==null||lk.disconnect(),lk=null,ok==null||ok.dispose(),ok=null,ck==null||ck.remove(),ck=null,(t=zo.querySelector(".ProseMirror"))==null||t.removeAttribute("hidden")}function DBt(t,e,r){QQ();const n=t.querySelector(".ProseMirror");if(!n)return!1;const i=KOt(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=dPt(l,s,{...e,nodes:e.nodes.map((f,p)=>({...f,width:i.nodes[p].width,height:i.nodes[p].height}))});ak=u;const h=()=>u.resize(o(),Math.max(1,s.clientHeight));jM=requestAnimationFrame(h);const d=new ResizeObserver(h);return d.observe(a??s),ok=l,lk=d,ck=s,!0}const OBt=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function fp(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 nMe(t){return Math.min(100,Math.max(10,Math.round(t)))}function m8(t,e){const r=e==null?null:nMe(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 yde(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 Vwe.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>fp(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=fp(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 _=nMe(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),m8(i,_),f(_)},d=[];for(const E of OBt){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"),yde(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 pL(A)||ny(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=ZQ(E,String(n.attrs.alt??"image"));if(A){Ua({type:"resourcePress",targetJson:A});return}Ua({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&&Ua({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};yde(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=fp(E.width);m8(i,R),f(R);const _=String(E.src??""),P=ny(_);P&&(i.dataset.resourceHref=KQ(_,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(tMe(R)){rMe(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(fp(E.attrs.width)),m8(i,fp(E.attrs.width))),!0},selectNode:()=>{var A,R;C=!0,i.classList.add("is-selected");const E=fp((R=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:R.width)??fp(i.dataset.width)??fp(n.attrs.width);m8(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 $Bt(t){return[...R7e({mathematics:gBt(),starterKit:{codeBlock:!1,link:!1},image:PBt(),gallery:SBt(()=>dL),pdf:!1,file:!1,pluginEmbed:!1,table:{table:{resizable:!1}},markdown:!0}),HNt,hgt.configure({languageClassPrefix:"language-"}),...$Rt(),lgt.configure({placeholder:t})]}const zo=document.getElementById("editor"),XM=document.getElementById("toolbar"),mr=new Tpt({element:zo,extensions:$Bt("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{b5(),requestAnimationFrame(()=>eMe(zo)),!(sk||ta!=="editor")&&ed(t)},onSelectionUpdate:()=>b5(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},transformPastedHTML(t){return aRt(t)},handleClick(t,e,r){return vde(r,"click")},handleDOMEvents:{contextmenu(t,e){return vde(e,"contextmenu")}}}});zo.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(),Ua({type:"doubleTap"}))});function vde(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(pL(s)||ny(s)){const a=EBt(s,n.textContent||"");if(a)return t.preventDefault(),t.stopPropagation(),Ua({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||(pL(s)||ny(s)?s:"");if(!a&&!ny(s))return ta==="viewer"&&e==="click"&&s?(t.preventDefault(),Ua({type:"imagePreview",source:s,alt:i.getAttribute("alt")||""}),!0):!1;const o=a||s,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=ZQ(o,l);if(u)return t.preventDefault(),t.stopPropagation(),Ua({type:"resourcePress",targetJson:u}),!0}if(ta==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),Ua({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};zo.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=ZQ(a,e.getAttribute("alt")||"image");o&&Ua({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),zo.addEventListener("touchend",r,{passive:!0}),zo.addEventListener("touchmove",r,{passive:!0}),zo.addEventListener("touchcancel",r,{passive:!0})})();const JQ="edgeever-dollar",eJ=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(eJ)}:t},iMe=t=>GRt(dQ(t.getJSON()));let pC=null;const BBt=(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(eJ({type:"doc",content:i})).replaceAll(JQ,"\\$"):t.state.doc.textBetween(e,r,` -`)},FB="edgeever-inline-sentinel",BBt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(eJ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(JQ,"\\$"):r},FBt=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=BBt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=$Bt(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,` +`)},FB="edgeever-inline-sentinel",FBt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(eJ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(JQ,"\\$"):r},zBt=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=FBt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=BBt(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},zBt=(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,`${FB}${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(FB))return[{type:"text",text:a}];const d=h.text.slice(FB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(dQ(t.getJSON())),r=nMe(t);Ua({type:"change",contentMarkdown:r,contentJson:e})}catch(e){Ua({type:"error",message:e instanceof Error?e.message:String(e)})}}function VBt(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 vde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function iMe(t){var r;if(XM.classList.toggle("editor-mode",t),XM.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:()=>Ua({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(vde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(vde()).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[dL==="en-US"?1:0])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),b5()}),XM.appendChild(i)}b5()}function b5(){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")};XM.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 zB(t="light"){zo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=NW}),J8e(zo),await LBt(zo),ta==="viewer"&&(!gL||!NBt(zo,gL,t))&&(QQ(),await IBt(zo,t))}async function HBt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=QOt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=UAe[i]||680,a=y5[e]||y5.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=tPt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=ePt({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=ZOt[e]||a.canvasBg,x=await xEt(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 RBt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=_Bt(S);for(let R=0;RsetTimeout(_,0));Ua({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){Ua({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const GBt={exportImage(t){HBt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,dL=t.locale==="en-US"?"en-US":"zh-CN",mr.setEditable(ta==="editor"),iMe(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&&(NW=t.placeholder,zo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=NW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),zB(t.theme||"light")},setMarkdown(t){var n;sk=!0;const e=ta==="viewer"?iOt(t):null;gL=e;const r=ta==="viewer"?e?"":sOt(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"),Lhe(mr),b5(),sk=!1,zB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){sk=!0,gL=null,QQ();try{const e=JSON.parse(t);mr.commands.setContent(BRt(WNt(e),dL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),Lhe(mr),b5(),sk=!1,zB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=fL.get(t);r&&(fL.delete(t),r(e))},getMarkdown(){return nMe(mr)},getDocument(){return JSON.stringify(dQ(mr.getJSON()))},captureSelection(){const t=FBt(mr);return t?(pC={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})):(pC=null,null)},applySelectionDraft(t,e){var a,o;const r=pC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return pC=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"?zBt(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(),pC=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:Due}).run();const r=zo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(xBt(mr.state,{src:e,alt:r||t||"",width:Due})),ed(mr))},groupImages(t){const e=wBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=zo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=VBt(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{}}Ua({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=GBt;iMe(!1);Ua({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(WBt,"-$1").toLowerCase(),UBt={"&":"&",">":">","<":"<",'"':""","'":"'"},YBt=/[&><"']/g,Go=t=>String(t).replace(YBt,e=>UBt[e]),KM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?KM(t.body[0]):t:t.type==="font"?KM(t.body):t,jBt=new Set(["mathord","textord","atom"]),q0=t=>jBt.has(KM(t).type),XBt=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"},mL={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 KBt(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 ZBt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return KBt(e)}function QBt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:ZBt(n)}class tJ{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(mL)){var n=mL[r];n&&QBt(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=XBt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class pp{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[eFt[this.id]]}fracNum(){return ud[tFt[this.id]]}fracDen(){return ud[rFt[this.id]]}cramp(){return ud[nFt[this.id]]}text(){return ud[iFt[this.id]]}isTight(){return this.size>=2}}var rJ=0,yL=1,Pb=2,a0=3,z6=4,xu=5,x5=6,Cl=7,ud=[new pp(rJ,0,!1),new pp(yL,0,!0),new pp(Pb,1,!1),new pp(a0,1,!0),new pp(z6,2,!1),new pp(xu,2,!0),new pp(x5,3,!1),new pp(Cl,3,!0)],JBt=[z6,xu,z6,xu,x5,Cl,x5,Cl],eFt=[xu,xu,xu,xu,Cl,Cl,Cl,Cl],tFt=[Pb,a0,z6,xu,x5,Cl,x5,Cl],rFt=[a0,a0,xu,xu,Cl,Cl,Cl,Cl],nFt=[yL,yL,a0,a0,xu,xu,Cl,Cl],iFt=[rJ,yL,Pb,a0,Pb,a0,Pb,a0],dn={DISPLAY:ud[rJ],TEXT:ud[Pb],SCRIPT:ud[z6],SCRIPTSCRIPT:ud[x5]},DW=[{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 sFt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var ZM=[];DW.forEach(t=>t.blocks.forEach(e=>ZM.push(...e)));function sMe(t){for(var e=0;e=ZM[e]&&t<=ZM[e+1])return!0;return!1}var ba=t=>t+" "+t,jv=80,aFt=function(e,r){return"M95,"+(622+e+r)+` +`)}:null},VBt=(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,`${FB}${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(FB))return[{type:"text",text:a}];const d=h.text.slice(FB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function ed(t){try{const e=JSON.stringify(dQ(t.getJSON())),r=iMe(t);Ua({type:"change",contentMarkdown:r,contentJson:e})}catch(e){Ua({type:"error",message:e instanceof Error?e.message:String(e)})}}function HBt(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 bde=()=>mr.isActive("taskItem")?"taskItem":"listItem";function sMe(t){var r;if(XM.classList.toggle("editor-mode",t),XM.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:()=>Ua({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(bde()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(bde()).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[dL==="en-US"?1:0])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&ed(mr),b5()}),XM.appendChild(i)}b5()}function b5(){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")};XM.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 zB(t="light"){zo.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=NW}),eMe(zo),await IBt(zo),ta==="viewer"&&(!gL||!DBt(zo,gL,t))&&(QQ(),await NBt(zo,t))}async function GBt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=JOt(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",s=YAe[i]||680,a=y5[e]||y5.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=rPt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=tPt({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=QOt[e]||a.canvasBg,x=await wEt(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=ePt(t.title,t.fallbackTitle),S=await _Bt(b),k=`${C}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=LBt(S);for(let R=0;RsetTimeout(_,0));Ua({type:"imageExportComplete",requestId:t.requestId,filename:k,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){Ua({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const WBt={exportImage(t){GBt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==ta;ta=e,dL=t.locale==="en-US"?"en-US":"zh-CN",mr.setEditable(ta==="editor"),sMe(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&&(NW=t.placeholder,zo.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=NW})),ta==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),zB(t.theme||"light")},setMarkdown(t){var n;sk=!0;const e=ta==="viewer"?sOt(t):null;gL=e;const r=ta==="viewer"?e?"":aOt(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"),Ihe(mr),b5(),sk=!1,zB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){sk=!0,gL=null,QQ();try{const e=JSON.parse(t);mr.commands.setContent(FRt(qNt(e),dL))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(ta==="editor"),Ihe(mr),b5(),sk=!1,zB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=fL.get(t);r&&(fL.delete(t),r(e))},getMarkdown(){return iMe(mr)},getDocument(){return JSON.stringify(dQ(mr.getJSON()))},captureSelection(){const t=zBt(mr);return t?(pC={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})):(pC=null,null)},applySelectionDraft(t,e){var a,o;const r=pC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return pC=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"?VBt(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(),pC=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:Oue}).run();const r=zo.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),ed(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(wBt(mr.state,{src:e,alt:r||t||"",width:Oue})),ed(mr))},groupImages(t){const e=TBt(mr,t);return e&&ed(mr),e},cancelImageUpload(t){const e=zo.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),ed(mr)},search(t,e){const r=HBt(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{}}Ua({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=WBt;sMe(!1);Ua({type:"ready",startupMs:Math.round(performance.now()-MBt)});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(qBt,"-$1").toLowerCase(),YBt={"&":"&",">":">","<":"<",'"':""","'":"'"},jBt=/[&><"']/g,Go=t=>String(t).replace(jBt,e=>YBt[e]),KM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?KM(t.body[0]):t:t.type==="font"?KM(t.body):t,XBt=new Set(["mathord","textord","atom"]),q0=t=>XBt.has(KM(t).type),KBt=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"},mL={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 ZBt(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 QBt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return ZBt(e)}function JBt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:QBt(n)}class tJ{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(mL)){var n=mL[r];n&&JBt(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=KBt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class pp{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[eFt[this.id]]}sub(){return ud[tFt[this.id]]}fracNum(){return ud[rFt[this.id]]}fracDen(){return ud[nFt[this.id]]}cramp(){return ud[iFt[this.id]]}text(){return ud[sFt[this.id]]}isTight(){return this.size>=2}}var rJ=0,yL=1,Pb=2,a0=3,z6=4,xu=5,x5=6,Cl=7,ud=[new pp(rJ,0,!1),new pp(yL,0,!0),new pp(Pb,1,!1),new pp(a0,1,!0),new pp(z6,2,!1),new pp(xu,2,!0),new pp(x5,3,!1),new pp(Cl,3,!0)],eFt=[z6,xu,z6,xu,x5,Cl,x5,Cl],tFt=[xu,xu,xu,xu,Cl,Cl,Cl,Cl],rFt=[Pb,a0,z6,xu,x5,Cl,x5,Cl],nFt=[a0,a0,xu,xu,Cl,Cl,Cl,Cl],iFt=[yL,yL,a0,a0,xu,xu,Cl,Cl],sFt=[rJ,yL,Pb,a0,Pb,a0,Pb,a0],dn={DISPLAY:ud[rJ],TEXT:ud[Pb],SCRIPT:ud[z6],SCRIPTSCRIPT:ud[x5]},DW=[{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 aFt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var ZM=[];DW.forEach(t=>t.blocks.forEach(e=>ZM.push(...e)));function aMe(t){for(var e=0;e=ZM[e]&&t<=ZM[e+1])return!0;return!1}var ba=t=>t+" "+t,jv=80,oFt=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 @@ -2565,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"},oFt=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"},lFt=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+` @@ -2575,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"},lFt=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},cFt=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 @@ -2584,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"},cFt=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},uFt=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 @@ -2594,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"},uFt=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},hFt=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"},hFt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},dFt=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"},dFt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},fFt=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"},fFt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=aFt(r,jv);break;case"sqrtSize1":i=oFt(r,jv);break;case"sqrtSize2":i=lFt(r,jv);break;case"sqrtSize3":i=cFt(r,jv);break;case"sqrtSize4":i=uFt(r,jv);break;case"sqrtTall":i=dFt(r,jv,n)}return i},pFt=function(e,r){switch(e){case"⎜":return ba("M291 0 H417 V"+r+" H291z");case"∣":return ba("M145 0 H188 V"+r+" H145z");case"∥":return ba("M145 0 H188 V"+r+" H145z")+ba("M367 0 H410 V"+r+" H367z");case"⎟":return ba("M457 0 H583 V"+r+" H457z");case"⎢":return ba("M319 0 H403 V"+r+" H319z");case"⎥":return ba("M263 0 H347 V"+r+" H263z");case"⎪":return ba("M384 0 H504 V"+r+" H384z");case"⏐":return ba("M312 0 H355 V"+r+" H312z");case"‖":return ba("M257 0 H300 V"+r+" H257z")+ba("M478 0 H521 V"+r+" H478z");default:return""}},bde={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},pFt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=oFt(r,jv);break;case"sqrtSize1":i=lFt(r,jv);break;case"sqrtSize2":i=cFt(r,jv);break;case"sqrtSize3":i=uFt(r,jv);break;case"sqrtSize4":i=hFt(r,jv);break;case"sqrtTall":i=fFt(r,jv,n)}return i},gFt=function(e,r){switch(e){case"⎜":return ba("M291 0 H417 V"+r+" H291z");case"∣":return ba("M145 0 H188 V"+r+" H145z");case"∥":return ba("M145 0 H188 V"+r+" H145z")+ba("M367 0 H410 V"+r+" H367z");case"⎟":return ba("M457 0 H583 V"+r+" H457z");case"⎢":return ba("M319 0 H403 V"+r+" H319z");case"⎥":return ba("M263 0 H347 V"+r+" H263z");case"⎪":return ba("M384 0 H504 V"+r+" H384z");case"⏐":return ba("M312 0 H355 V"+r+" H312z");case"‖":return ba("M257 0 H300 V"+r+" H257z")+ba("M478 0 H521 V"+r+" H478z");default:return""}},xde={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 @@ -2776,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`},gFt=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`},mFt=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 @@ -2804,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 mFt(t){return"toText"in t}let v3=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(mFt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var OW={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},yFt={ex:!0,em:!0,mu:!0},aMe=function(e){return typeof e!="string"&&(e=e.unit),e in OW||e in yFt||e==="ex"},xs=function(e,r){var n;if(e.unit in OW)n=OW[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"},Sg=function(e){return e.filter(r=>r).join(" ")},nJ=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=qBt(n)+":"+i+";")}return r},oMe=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)}},lMe=function(e){var r=document.createElement(e);r.className=Sg(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]/,cMe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Go(Sg(this.classes))+'"');var n=nJ(this.style);n&&(r+=' style="'+Go(n)+'"');for(var i of Object.keys(this.attributes)){if(vFt.test(i))throw new Gt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Go(this.attributes[i])+'"'}r+=">";for(var s=0;s",r};class b3{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,oMe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return lMe.call(this,"span")}toMarkup(){return cMe.call(this,"span")}}let DD=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,oMe.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 lMe.call(this,"a")}toMarkup(){return cMe.call(this,"a")}};class bFt{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=''+Go(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Yt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Sg(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+=nJ(this.style),n&&(e=!0,r+=' style="'+Go(n)+'"');var i=Go(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 PW{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 CFt=t=>t instanceof b3||t instanceof DD||t instanceof v3,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]}},y8={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]},xde={Å:"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 uMe(t,e){yd[t]=e}function iJ(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 xde&&(n=xde[t[0]].charCodeAt(0),i=yd[e][n]),!i&&r==="text"&&sMe(n)&&(i=yd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var VB={};function kFt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!VB[e]){var r=VB[e]={cssEmPerMu:y8.quad[e]/18};for(var n in y8)y8.hasOwnProperty(n)&&(r[n]=y8[n][e])}return VB[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",zl="close",x3="inner",Vr="mathord",ga="op-token",Xc="open",g7="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,g7,".","\\ldotp");U(se,ve,g7,"⋅","\\cdotp");U(se,ve,g7,"⋅","·");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,zl,"⎱","\\rmoustache",!0);U(se,ve,Xc,"⎰","\\lmoustache",!0);U(se,ve,zl,"⟯","\\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,zl,"┐","\\@urcorner",!0);U(se,We,Xc,"└","\\@llcorner",!0);U(se,We,zl,"┘","\\@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,zl,"?","?");U(se,ve,zl,"!","!");U(se,ve,zl,"⟩","\\rangle",!0);U(se,ve,zl,"∣","\\rvert");U(se,ve,zl,"∥","\\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,g7,",",",");U(se,ve,g7,";",";");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,zl,"}","\\}");U(Dt,ve,Je,"}","\\}");U(Dt,ve,Je,"}","\\textbraceright");U(se,ve,Xc,"{","\\lbrace");U(se,ve,zl,"}","\\rbrace");U(se,ve,Xc,"[","\\lbrack",!0);U(Dt,ve,Je,"[","\\lbrack",!0);U(se,ve,zl,"]","\\rbrack",!0);U(Dt,ve,Je,"]","\\rbrack",!0);U(se,ve,Xc,"(","\\lparen",!0);U(se,ve,zl,")","\\rparen",!0);U(Dt,ve,Je,"<","\\textless",!0);U(Dt,ve,Je,">","\\textgreater",!0);U(se,ve,Xc,"⌊","\\lfloor",!0);U(se,ve,zl,"⌋","\\rfloor",!0);U(se,ve,Xc,"⌈","\\lceil",!0);U(se,ve,zl,"⌉","\\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,ga,"∐","\\coprod");U(se,ve,ga,"⋁","\\bigvee");U(se,ve,ga,"⋀","\\bigwedge");U(se,ve,ga,"⨄","\\biguplus");U(se,ve,ga,"⋂","\\bigcap");U(se,ve,ga,"⋃","\\bigcup");U(se,ve,ga,"∫","\\int");U(se,ve,ga,"∫","\\intop");U(se,ve,ga,"∬","\\iint");U(se,ve,ga,"∭","\\iiint");U(se,ve,ga,"∏","\\prod");U(se,ve,ga,"∑","\\sum");U(se,ve,ga,"⨂","\\bigotimes");U(se,ve,ga,"⨁","\\bigoplus");U(se,ve,ga,"⨀","\\bigodot");U(se,ve,ga,"∮","\\oint");U(se,ve,ga,"∯","\\oiint");U(se,ve,ga,"∰","\\oiiint");U(se,ve,ga,"⨆","\\bigsqcup");U(se,ve,ga,"∫","\\smallint");U(Dt,ve,x3,"…","\\textellipsis");U(se,ve,x3,"…","\\mathellipsis");U(Dt,ve,x3,"…","\\ldots",!0);U(se,ve,x3,"…","\\ldots",!0);U(se,ve,x3,"⋯","\\@cdots",!0);U(se,ve,x3,"⋱","\\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 hMe={"--":!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 wde='0123456789/@."';for(var HB=0;HB{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 Lde[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return EFt[s]}else{if(n===120485||n===120486)return Lde[0];if(120486{if(Sg(t.classes)!==Sg(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},dMe=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 b3(e,r,n,i);return aJ(s),s},Ag=(t,e,r,n)=>new b3(t,e,r,n),w5=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},_Ft=function(e,r,n,i){var s=new DD(e,r,n,i);return aJ(s),s},Y0=function(e){var r=new v3(e);return aJ(r),r},T5=function(e,r){return e instanceof v3?Ft([],[e],r):e},LFt=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},x8=(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},HW={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"}},pMe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},gMe=function(e,r){var[n,i,s]=pMe[e],a=new Eg(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=Ag(["overlay"],[o],r);return l.height=s,l.style.height=Yt(s),l.style.width=Yt(i),l},vs={number:3,unit:"mu"},Nm={number:4,unit:"mu"},pf={number:5,unit:"mu"},IFt={mord:{mop:vs,mbin:Nm,mrel:pf,minner:vs},mop:{mord:vs,mop:vs,mrel:pf,minner:vs},mbin:{mord:Nm,mop:Nm,mopen:Nm,minner:Nm},mrel:{mord:pf,mop:pf,mopen:pf,minner:pf},mopen:{},mclose:{mop:vs,mbin:Nm,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:Nm,mrel:pf,mopen:vs,mpunct:vs,minner:vs}},NFt={mord:{mop:vs},mop:{mord:vs,mop:vs},mbin:{},mrel:{},mopen:{},mclose:{mop:vs},mpunct:{},minner:{mop:vs}},mMe={},bL={},xL={};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"&&OFt.has(v)?m.classes[0]="mord":v==="mbin"&&DFt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),GW(s,(g,m)=>{var y,v,x=qW(m),b=qW(g),T=x&&b?g.hasClass("mtight")?(y=NFt[x])==null?void 0:y[b]:(v=IFt[x])==null?void 0:v[b]:null;if(T)return fMe(T,u)},{node:d},f,p),s},GW=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()},yMe=function(e){return e instanceof v3||e instanceof DD||e instanceof b3&&e.hasClass("enclosing")?e:null},WW=function(e,r){var n=yMe(e);if(n){var i=n.children;if(i.length){if(r==="right")return WW(i[i.length-1],"right");if(r==="left")return WW(i[0],"left")}}return e},qW=function(e,r){if(!e)return null;r&&(e=WW(e,r));var n=e.classes[0];return $Ft[n]||null},V6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ft(r.concat(n))},hi=function(e,r,n){if(!e)return Ft();if(bL[e.type]){var i=bL[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 w8(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 UW(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=La(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(w8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(w8(a,e));var u;r?(u=w8(La(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 vMe(t){return new v3(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=Sg(this.classes));for(var n=0;n0&&(e+=' class ="'+Go(Sg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ha{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Go(this.toText())}toText(){return this.text}}class bMe{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 BFt=new Set(["\\imath","\\jmath"]),FFt=new Set(["mrow","mtable"]),Iu=function(e,r,n){return ls[r][e]&&ls[r][e].replace&&e.charCodeAt(0)!==55349&&!(hMe.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 ha(e)},oJ=function(e){return e.length===1?e[0]:new qt("mrow",e)},zFt={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"},lJ=(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=zFt[r];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(BFt.has(s))return null;if(ls[n][s]){var a=ls[n][s].replace;a&&(s=a)}var o=HW[r].fontName;return iJ(s,o,n)?HW[r].variant:null};function UB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ha&&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 ha&&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"||UB(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 ha&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ha&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},Mg=function(e,r,n){return oJ(Kc(e,r,n))},Mi=function(e,r){if(!e)return new qt("mrow");if(xL[e.type])return xL[e.type](e,r);throw new Gt("Got group of unknown type: '"+e.type+"'")};function Ide(t,e,r,n,i){var s=Kc(t,r),a;s.length===1&&s[0]instanceof qt&&FFt.has(s[0].type)?a=s[0]:a=new qt("mrow",s);var o=new qt("annotation",[new ha(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 VFt=[[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]],Nde=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Dde=function(e,r){return r.size<2?e:VFt[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=Nde[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:Dde(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:Nde[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Dde(_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=kFt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}_f.BASESIZE=6;var xMe=function(e){return new _f({style:e.displayMode?dn.DISPLAY:dn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},wMe=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},HFt=function(e,r,n){var i=xMe(n),s;if(n.output==="mathml")return Ide(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=UW(e,i);s=Ft(["katex"],[a])}else{var o=Ide(e,r,i,n.displayMode,!1),l=UW(e,i);s=Ft(["katex"],[o,l])}return wMe(s,n)},GFt=function(e,r,n){var i=xMe(n),s=UW(e,i),a=Ft(["katex"],[s]);return wMe(a,n)},WFt={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":"="},$D=function(e){var r=new qt("mo",[new ha(WFt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},qFt={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]},UFt=new Set(["widehat","widecheck","widetilde","utilde"]),BD=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(UFt.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 Eg(d),m=new C0([g],{width:"100%",height:Yt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Ag([],[m],r),minWidth:0,height:f}}else{var y=[],v=qFt[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},YFt=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 PW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new PW({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new C0(u,{width:"100%",height:Yt(o)});a=Ag([],[h],s)}return a.height=o,a.style.height=Yt(o),a},jFt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},XFt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function KFt(t){return t in jFt}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 FD(t){var e=zD(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 zD(t){return t&&(t.type==="atom"||XFt.hasOwnProperty(t.type))?t:null}var TMe=t=>{if(t instanceof Wc)return t;if(CFt(t)&&t.children.length===1)return TMe(t.children[0])},cJ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=bn(t.base,"accent"),r=n.base,t.base=r,i=TFt(hi(t,e)),t.base=n):(n=bn(t,"accent"),r=n.base);var s=hi(r,e.havingCrampedStyle()),a=n.isShifty&&q0(r),o=0;if(a){var l,u;o=(l=(u=TMe(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=BD(n,e),f=ui({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=gMe("vec",e),g=pMe.vec[1]):(p=PD({mode:n.mode,text:n.label},e,"textord"),p=wFt(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=ui({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},CMe=(t,e)=>{var r=t.isStretchy?$D(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},ZFt=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=wL(e[0]),n=!ZFt.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:cJ,mathmlBuilder:CMe});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:cJ,mathmlBuilder:CMe});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=hi(t.base,e),n=BD(t,e),i=t.label==="\\utilde"?.12:0,s=ui({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=$D(t.label),n=new qt("munder",[Mi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var T8=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=T5(hi(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=T5(hi(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=BD(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=ui({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=ui({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=$D(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=T8(Mi(t.body,e));if(t.below){var s=T8(Mi(t.below,e));n=new qt("munderover",[r,s,i])}else n=new qt("mover",[r,i])}else if(t.below){var a=T8(Mi(t.below,e));n=new qt("munder",[r,a])}else n=T8(),n=new qt("mover",[r,n]);return n}});function kMe(t,e){var r=La(t.body,e,!0);return Ft([t.mclass],r,e)}function SMe(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:ua(i),isCharacterBox:q0(i)}},htmlBuilder:kMe,mathmlBuilder:SMe});var VD=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:VD(e[0]),body:ua(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=VD(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ua(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:kMe,mathmlBuilder:SMe});sr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:VD(e[0]),body:ua(e[0])}},htmlBuilder(t,e){var r=La(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 QFt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ode=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Pde=t=>t.type==="textord"&&t.text==="@",JFt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function ezt(t,e,r){var n=QFt[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 tzt(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=ezt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=Ode()}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=T5(hi(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=T5(hi(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 EMe=(t,e)=>{var r=La(t.body,e.withColor(t.color),!1);return Y0(r)},AMe=(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:ua(i)}},htmlBuilder:EMe,mathmlBuilder:AMe});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:EMe,mathmlBuilder:AMe});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 YW={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},MMe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},rzt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},RMe=(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(YW[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=YW[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===YW[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=MMe(e.gullet.popToken());e.gullet.consumeSpaces();var i=rzt(e);return RMe(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=MMe(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return RMe(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var uk=function(e,r,n){var i=ls.math[e]&&ls.math[e].replace,s=iJ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},uJ=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},_Me=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},nzt=function(e,r,n,i,s,a){var o=dl(e,"Main-Regular",s,i),l=uJ(o,r,i,a);return _Me(l,i,r),l},izt=function(e,r,n,i){return dl(e,"Size"+r+"-Regular",n,i)},LMe=function(e,r,n,i,s,a){var o=izt(e,r,s,i),l=uJ(Ft(["delimsizing","size"+r],[o],i),dn.TEXT,i,a);return n&&_Me(l,i,dn.TEXT),l},YB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=Ft(["delimsizinginner",i],[Ft([],[dl(e,r,n)])]);return{type:"elem",elem:s}},jB=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 Eg("inner",pFt(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=Ag([],[a],n);return o.height=r,o.style.height=Yt(r),o.style.width=Yt(i),{type:"elem",elem:o}},jW=.008,C8={type:"kern",size:-1*jW},szt=new Set(["|","\\lvert","\\rvert","\\vert"]),azt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),IMe=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"):szt.has(e)?(u="∣",d="vert",f=333):azt.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=uk(o,p,s),m=g.height+g.depth,y=uk(u,p,s),v=y.height+y.depth,x=uk(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=uk(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=gFt(d,Math.round(N*1e3)),$=new Eg(d,I),O=Yt(f/1e3),D=Yt(L/1e3),F=new C0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=Ag([],[F],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(YB(h,p,s)),P.push(C8),l===null){var V=A-m-b+2*jW;P.push(jB(u,V,i))}else{var B=(A-m-b-T)/2+2*jW;P.push(jB(u,B,i)),P.push(C8),P.push(YB(l,p,s)),P.push(C8),P.push(jB(u,B,i))}P.push(C8),P.push(YB(o,p,s))}var H=i.havingBaseStyle(dn.TEXT),G=ui({positionType:"bottom",positionData:_,children:P});return uJ(Ft(["delimsizing","mult"],[G],H),dn.TEXT,i,a)},XB=80,KB=.08,ZB=function(e,r,n,i,s){var a=fFt(e,i,n),o=new Eg(e,a),l=new C0([o],{width:"400em",height:Yt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Ag(["hide-tail"],[l],s)},ozt=function(e,r){var n=r.havingBaseSizing(),i=$Me("\\surd",e*n.sizeMultiplier,PMe,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+XB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+KB)/s,u=(1+a)/s,o=ZB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+XB)*cS[i.size],u=(cS[i.size]+a)/s,l=(cS[i.size]+a+KB)/s,o=ZB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+KB,u=e+a,h=Math.floor(1e3*e+a)+XB,o=ZB("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}},NMe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lzt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),DMe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),cS=[0,1.2,1.8,2.4,3],OMe=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),NMe.has(e)||DMe.has(e))return LMe(e,r,!1,n,i,s);if(lzt.has(e))return IMe(e,cS[r],!1,n,i,s);throw new Gt("Illegal delimiter: '"+e+"'")},czt=[{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}],uzt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"stack"}],PMe=[{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"}],hzt=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.")},$Me=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]},XW=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;DMe.has(e)?o=czt:NMe.has(e)?o=PMe:o=uzt;var l=$Me(e,r,o,i);return l.type==="small"?nzt(e,l.style,n,i,s,a):l.type==="large"?LMe(e,l.size,n,i,s,a):IMe(e,r,n,i,s,a)},QB=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 XW(e,d,!0,i,s,a)},$de={"\\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}},dzt=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 Bde(t){return"isMiddle"in t}function HD(t,e){var r=zD(t);if(r&&dzt.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=HD(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:$de[t.funcName].size,mclass:$de[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ft([t.mclass]):OMe(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(cS[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function Fde(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:HD(e[0],t).text,color:r}}});sr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=HD(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)=>{Fde(t);for(var r=La(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{Fde(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 oJ(r)}});sr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=HD(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=V6(e,[]):(r=OMe(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 GD=(t,e)=>{var r=T5(hi(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=hFt(f),g=new C0([new Eg("phase",p)],{width:"400em",height:Yt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Ag(["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=YFt(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=ui({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=ui({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)},WD=(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:GD,mathmlBuilder:WD});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:GD,mathmlBuilder:WD});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:GD,mathmlBuilder:WD});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:GD,mathmlBuilder:WD});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 BMe={};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.")},fzt=new Set(["gather","gather*"]);function hJ(t){if(!t.includes("ed"))return!t.includes("*")}function rm(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(zde(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=w5("hline",r,h),He=w5("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=ui({positionType:"individualShift",children:we})}if(O.length===0)return Ft(["mord"],[Te],r);var le=ui({positionType:"individualShift",children:O}),pe=Ft(["tag"],[le],r);return Y0([Te,pe])},pzt={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=zD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(a){var o=FD(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 rm(t.parser,s,dJ(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=rm(t.parser,n,dJ(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=rm(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=zD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(o){var l=FD(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=rm(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=rm(t.parser,e,dJ(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:zMe,htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){fzt.has(t.envName)&&qD(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:hJ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return rm(t.parser,e,"display")},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:zMe,htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){qD(t);var e={autoTag:hJ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return rm(t.parser,e,"display")},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return qD(t),tzt(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 Vde=BMe;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 hi(t.body,n)},HMe=(t,e)=>{var r=t.font,n=e.withFont(r);return Mi(t.body,n)},Hde={"\\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=wL(e[0]),s=n;return s in Hde&&(s=Hde[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:VMe,mathmlBuilder:HMe});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:VD(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:VMe,mathmlBuilder:HMe});var gzt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=hi(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 ha(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(r),t.rightDelim!=null){var a=new qt("mo",[new ha(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return oJ(i)}return r},GMe=(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"),GMe({type:"genfrac",mode:r.mode,numer:i,denom:s,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:gzt,mathmlBuilder:mzt});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 Gde=["display","text","script","scriptscript"],Wde=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=wL(e[0]),a=s.type==="atom"&&s.family==="open"?Wde(s.text):null,o=wL(e[1]),l=o.type==="atom"&&o.family==="close"?Wde(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=Gde[Number(g.text)]}}else p=bn(p,"textord"),f=Gde[Number(p.text)];return GMe({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 WMe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?hi(t.sup,e.havingStyle(r.sup()),e):hi(t.sub,e.havingStyle(r.sub()),e),i=bn(t.base,"horizBrace")):i=bn(t,"horizBrace");var s=hi(i.base,e.havingBaseStyle(dn.DISPLAY)),a=BD(i,e),o;if(i.isOver?o=ui({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=ui({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=ui({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=ui({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)},yzt=(t,e)=>{var r=$D(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:WMe,mathmlBuilder:yzt});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:ua(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=La(t.body,e,!1);return _Ft(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Mg(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=La(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)=>Mg(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:ua(e[0]),mathml:ua(e[1])}},htmlBuilder:(t,e)=>{var r=La(t.html,e,!1);return Y0(r)},mathmlBuilder:(t,e)=>Mg(t.mathml,e)});var JB=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(!aMe(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 bFt(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 fMe(t.dimension,e)},mathmlBuilder(t,e){var r=xs(t.dimension,e);return new bMe(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([],[hi(t.body,e)]),r=Ft(["inner"],[r],e)):r=Ft(["inner"],[hi(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 qde=(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:ua(e[0]),text:ua(e[1]),script:ua(e[2]),scriptscript:ua(e[3])}},htmlBuilder:(t,e)=>{var r=qde(t,e),n=La(r,e,!1);return Y0(n)},mathmlBuilder:(t,e)=>{var r=qde(t,e);return Mg(r,e)}});var qMe=(t,e,r,n,i,s,a)=>{t=Ft([],[t]);var o=r&&q0(r),l,u;if(e){var h=hi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=hi(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=ui({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=ui({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=ui({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)},UMe=new Set(["\\smallint"]),w3=(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&&!UMe.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=dl(s.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=gMe(d+"Size"+(o?"2":"1"),e);l=ui({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=La(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)]),UMe.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 ha(t.name.slice(1))]);var n=new qt("mo",[Iu("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=vMe([r,n])}return r},vzt={"∏":"\\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=vzt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:w3,mathmlBuilder:m7});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:ua(n)}},htmlBuilder:w3,mathmlBuilder:m7});var bzt={"∫":"\\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:w3,mathmlBuilder:m7});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:w3,mathmlBuilder:m7});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=bzt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:w3,mathmlBuilder:m7});var YMe=(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=La(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 ha(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]):vMe([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:ua(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:YMe,mathmlBuilder:xzt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");iv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Y0(La(t.body,e,!1)):Ft(["mord"],La(t.body,e,!0),e)},mathmlBuilder(t,e){return Mg(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=hi(t.body,e.havingCrampedStyle()),n=w5("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ui({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 ha("‾")]);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:ua(n)}},htmlBuilder:(t,e)=>{var r=La(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"],[hi(t.body,e.withPhantom())]),n=Ft(["fix"],[]);return Ft(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Kc(ua(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=hi(t.body,e),n=xs(t.dy,e);return ui({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 jMe(t,e,r){for(var n=La(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return jMe(t.body,r,e)};sr({type:"sizing",names:Ude,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:Ude.indexOf(n)+1,body:s}},htmlBuilder:wzt,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([],[hi(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=hi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=T5(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=ui({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=hi(t.index,g,e),y=.6*(p.height-p.depth),v=ui({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 KW={display:dn.DISPLAY,text:dn.TEXT,script:dn.SCRIPT,scriptscript:dn.SCRIPTSCRIPT};function Tzt(t){return t in KW}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=KW[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),jMe(t.body,n,e)},mathmlBuilder(t,e){var r=KW[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 Czt=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?w3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===dn.DISPLAY.size||n.limits);return s?YMe:null}else{if(n.type==="accent")return q0(n.base)?cJ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?WMe:null}else return null}else return null};iv({type:"supsub",htmlBuilder(t,e){var r=Czt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=hi(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=hi(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=hi(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=ui({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=ui({positionType:"shift",positionData:d,children:R})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=ui({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var _=qW(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)}});iv({type:"atom",htmlBuilder(t,e){return sJ(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=lJ(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 XMe={mi:"italic",mn:"normal",mtext:"normal"};iv({type:"mathord",htmlBuilder(t,e){return PD(t,e,"mathord")},mathmlBuilder(t,e){var r=new qt("mi",[Iu(t.text,t.mode,e)]),n=lJ(t,e)||"italic";return n!==XMe[r.type]&&r.setAttribute("mathvariant",n),r}});iv({type:"textord",htmlBuilder(t,e){return PD(t,e,"textord")},mathmlBuilder(t,e){var r=Iu(t.text,t.mode,e),n=lJ(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!==XMe[i.type]&&i.setAttribute("mathvariant",n),i}});var eF={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},tF={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};iv({type:"spacing",htmlBuilder(t,e){if(tF.hasOwnProperty(t.text)){var r=tF[t.text].className||"";if(t.mode==="text"){var n=PD(t,e,"textord");return n.classes.push(r),n}else return Ft(["mspace",r],[sJ(t.text,t.mode,e)],e)}else{if(eF.hasOwnProperty(t.text))return Ft(["mspace",eF[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(tF.hasOwnProperty(t.text))r=new qt("mtext",[new ha(" ")]);else{if(eF.hasOwnProperty(t.text))return new qt("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var Yde=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};iv({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[Yde(),new qt("mtd",[Mg(t.body,e)]),Yde(),new qt("mtd",[Mg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var jde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Xde={"\\textbf":"textbf","\\textmd":"textmd"},kzt={"\\textit":"textit","\\textup":"textup"},Kde=(t,e)=>{var r=t.font;if(r){if(jde[r])return e.withTextFontFamily(jde[r]);if(Xde[r])return e.withTextFontWeight(Xde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(kzt[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:ua(i),font:n}},htmlBuilder(t,e){var r=Kde(t,e),n=La(t.body,r,!0);return Ft(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Kde(t,e);return Mg(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=hi(t.body,e),n=w5("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ui({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 ha("‾")]);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=hi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return ui({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=Zde(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),qp=mMe,KMe=`[ \r - ]`,Szt="\\\\[a-zA-Z@]+",Ezt="\\\\[^\uD800-\uDFFF]",Azt="("+Szt+")"+KMe+"*",Mzt=`\\\\( +-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 yFt(t){return"toText"in t}let v3=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(yFt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var OW={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},vFt={ex:!0,em:!0,mu:!0},oMe=function(e){return typeof e!="string"&&(e=e.unit),e in OW||e in vFt||e==="ex"},xs=function(e,r){var n;if(e.unit in OW)n=OW[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"},Sg=function(e){return e.filter(r=>r).join(" ")},nJ=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=UBt(n)+":"+i+";")}return r},lMe=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)}},cMe=function(e){var r=document.createElement(e);r.className=Sg(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]/,uMe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Go(Sg(this.classes))+'"');var n=nJ(this.style);n&&(r+=' style="'+Go(n)+'"');for(var i of Object.keys(this.attributes)){if(bFt.test(i))throw new Gt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Go(this.attributes[i])+'"'}r+=">";for(var s=0;s",r};class b3{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,lMe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return cMe.call(this,"span")}toMarkup(){return uMe.call(this,"span")}}let DD=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,lMe.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 cMe.call(this,"a")}toMarkup(){return uMe.call(this,"a")}};class xFt{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=''+Go(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Yt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Sg(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+=nJ(this.style),n&&(e=!0,r+=' style="'+Go(n)+'"');var i=Go(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 PW{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 kFt=t=>t instanceof b3||t instanceof DD||t instanceof v3,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]}},y8={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]},wde={Å:"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 hMe(t,e){yd[t]=e}function iJ(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 wde&&(n=wde[t[0]].charCodeAt(0),i=yd[e][n]),!i&&r==="text"&&aMe(n)&&(i=yd[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var VB={};function SFt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!VB[e]){var r=VB[e]={cssEmPerMu:y8.quad[e]/18};for(var n in y8)y8.hasOwnProperty(n)&&(r[n]=y8[n][e])}return VB[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",zl="close",x3="inner",Vr="mathord",ga="op-token",Xc="open",g7="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,g7,".","\\ldotp");U(se,ve,g7,"⋅","\\cdotp");U(se,ve,g7,"⋅","·");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,zl,"⎱","\\rmoustache",!0);U(se,ve,Xc,"⎰","\\lmoustache",!0);U(se,ve,zl,"⟯","\\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,zl,"┐","\\@urcorner",!0);U(se,We,Xc,"└","\\@llcorner",!0);U(se,We,zl,"┘","\\@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,zl,"?","?");U(se,ve,zl,"!","!");U(se,ve,zl,"⟩","\\rangle",!0);U(se,ve,zl,"∣","\\rvert");U(se,ve,zl,"∥","\\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,g7,",",",");U(se,ve,g7,";",";");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,zl,"}","\\}");U(Dt,ve,Je,"}","\\}");U(Dt,ve,Je,"}","\\textbraceright");U(se,ve,Xc,"{","\\lbrace");U(se,ve,zl,"}","\\rbrace");U(se,ve,Xc,"[","\\lbrack",!0);U(Dt,ve,Je,"[","\\lbrack",!0);U(se,ve,zl,"]","\\rbrack",!0);U(Dt,ve,Je,"]","\\rbrack",!0);U(se,ve,Xc,"(","\\lparen",!0);U(se,ve,zl,")","\\rparen",!0);U(Dt,ve,Je,"<","\\textless",!0);U(Dt,ve,Je,">","\\textgreater",!0);U(se,ve,Xc,"⌊","\\lfloor",!0);U(se,ve,zl,"⌋","\\rfloor",!0);U(se,ve,Xc,"⌈","\\lceil",!0);U(se,ve,zl,"⌉","\\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,ga,"∐","\\coprod");U(se,ve,ga,"⋁","\\bigvee");U(se,ve,ga,"⋀","\\bigwedge");U(se,ve,ga,"⨄","\\biguplus");U(se,ve,ga,"⋂","\\bigcap");U(se,ve,ga,"⋃","\\bigcup");U(se,ve,ga,"∫","\\int");U(se,ve,ga,"∫","\\intop");U(se,ve,ga,"∬","\\iint");U(se,ve,ga,"∭","\\iiint");U(se,ve,ga,"∏","\\prod");U(se,ve,ga,"∑","\\sum");U(se,ve,ga,"⨂","\\bigotimes");U(se,ve,ga,"⨁","\\bigoplus");U(se,ve,ga,"⨀","\\bigodot");U(se,ve,ga,"∮","\\oint");U(se,ve,ga,"∯","\\oiint");U(se,ve,ga,"∰","\\oiiint");U(se,ve,ga,"⨆","\\bigsqcup");U(se,ve,ga,"∫","\\smallint");U(Dt,ve,x3,"…","\\textellipsis");U(se,ve,x3,"…","\\mathellipsis");U(Dt,ve,x3,"…","\\ldots",!0);U(se,ve,x3,"…","\\ldots",!0);U(se,ve,x3,"⋯","\\@cdots",!0);U(se,ve,x3,"⋱","\\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 dMe={"--":!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 Tde='0123456789/@."';for(var HB=0;HB{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 Ide[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return AFt[s]}else{if(n===120485||n===120486)return Ide[0];if(120486{if(Sg(t.classes)!==Sg(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},fMe=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 b3(e,r,n,i);return aJ(s),s},Ag=(t,e,r,n)=>new b3(t,e,r,n),w5=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},LFt=function(e,r,n,i){var s=new DD(e,r,n,i);return aJ(s),s},Y0=function(e){var r=new v3(e);return aJ(r),r},T5=function(e,r){return e instanceof v3?Ft([],[e],r):e},IFt=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},x8=(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},HW={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"}},gMe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},mMe=function(e,r){var[n,i,s]=gMe[e],a=new Eg(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=Ag(["overlay"],[o],r);return l.height=s,l.style.height=Yt(s),l.style.width=Yt(i),l},vs={number:3,unit:"mu"},Nm={number:4,unit:"mu"},pf={number:5,unit:"mu"},NFt={mord:{mop:vs,mbin:Nm,mrel:pf,minner:vs},mop:{mord:vs,mop:vs,mrel:pf,minner:vs},mbin:{mord:Nm,mop:Nm,mopen:Nm,minner:Nm},mrel:{mord:pf,mop:pf,mopen:pf,minner:pf},mopen:{},mclose:{mop:vs,mbin:Nm,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:Nm,mrel:pf,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}},yMe={},bL={},xL={};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"&&OFt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),GW(s,(g,m)=>{var y,v,x=qW(m),b=qW(g),T=x&&b?g.hasClass("mtight")?(y=DFt[x])==null?void 0:y[b]:(v=NFt[x])==null?void 0:v[b]:null;if(T)return pMe(T,u)},{node:d},f,p),s},GW=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()},vMe=function(e){return e instanceof v3||e instanceof DD||e instanceof b3&&e.hasClass("enclosing")?e:null},WW=function(e,r){var n=vMe(e);if(n){var i=n.children;if(i.length){if(r==="right")return WW(i[i.length-1],"right");if(r==="left")return WW(i[0],"left")}}return e},qW=function(e,r){if(!e)return null;r&&(e=WW(e,r));var n=e.classes[0];return BFt[n]||null},V6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ft(r.concat(n))},hi=function(e,r,n){if(!e)return Ft();if(bL[e.type]){var i=bL[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 w8(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 UW(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=La(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(w8(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(w8(a,e));var u;r?(u=w8(La(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 bMe(t){return new v3(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=Sg(this.classes));for(var n=0;n0&&(e+=' class ="'+Go(Sg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ha{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Go(this.toText())}toText(){return this.text}}class xMe{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 FFt=new Set(["\\imath","\\jmath"]),zFt=new Set(["mrow","mtable"]),Iu=function(e,r,n){return ls[r][e]&&ls[r][e].replace&&e.charCodeAt(0)!==55349&&!(dMe.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 ha(e)},oJ=function(e){return e.length===1?e[0]:new qt("mrow",e)},VFt={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"},lJ=(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=VFt[r];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(FFt.has(s))return null;if(ls[n][s]){var a=ls[n][s].replace;a&&(s=a)}var o=HW[r].fontName;return iJ(s,o,n)?HW[r].variant:null};function UB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ha&&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 ha&&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"||UB(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 ha&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ha&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},Mg=function(e,r,n){return oJ(Kc(e,r,n))},Mi=function(e,r){if(!e)return new qt("mrow");if(xL[e.type])return xL[e.type](e,r);throw new Gt("Got group of unknown type: '"+e.type+"'")};function Nde(t,e,r,n,i){var s=Kc(t,r),a;s.length===1&&s[0]instanceof qt&&zFt.has(s[0].type)?a=s[0]:a=new qt("mrow",s);var o=new qt("annotation",[new ha(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 HFt=[[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]],Dde=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ode=function(e,r){return r.size<2?e:HFt[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=Dde[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:Ode(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:Dde[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Ode(_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=SFt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}_f.BASESIZE=6;var wMe=function(e){return new _f({style:e.displayMode?dn.DISPLAY:dn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},TMe=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},GFt=function(e,r,n){var i=wMe(n),s;if(n.output==="mathml")return Nde(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=UW(e,i);s=Ft(["katex"],[a])}else{var o=Nde(e,r,i,n.displayMode,!1),l=UW(e,i);s=Ft(["katex"],[o,l])}return TMe(s,n)},WFt=function(e,r,n){var i=wMe(n),s=UW(e,i),a=Ft(["katex"],[s]);return TMe(a,n)},qFt={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":"="},$D=function(e){var r=new qt("mo",[new ha(qFt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},UFt={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]},YFt=new Set(["widehat","widecheck","widetilde","utilde"]),BD=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(YFt.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 Eg(d),m=new C0([g],{width:"100%",height:Yt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Ag([],[m],r),minWidth:0,height:f}}else{var y=[],v=UFt[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},jFt=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 PW({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new PW({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new C0(u,{width:"100%",height:Yt(o)});a=Ag([],[h],s)}return a.height=o,a.style.height=Yt(o),a},XFt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},KFt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function ZFt(t){return t in XFt}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 FD(t){var e=zD(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 zD(t){return t&&(t.type==="atom"||KFt.hasOwnProperty(t.type))?t:null}var CMe=t=>{if(t instanceof Wc)return t;if(kFt(t)&&t.children.length===1)return CMe(t.children[0])},cJ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=bn(t.base,"accent"),r=n.base,t.base=r,i=CFt(hi(t,e)),t.base=n):(n=bn(t,"accent"),r=n.base);var s=hi(r,e.havingCrampedStyle()),a=n.isShifty&&q0(r),o=0;if(a){var l,u;o=(l=(u=CMe(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=BD(n,e),f=ui({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=mMe("vec",e),g=gMe.vec[1]):(p=PD({mode:n.mode,text:n.label},e,"textord"),p=TFt(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=ui({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},kMe=(t,e)=>{var r=t.isStretchy?$D(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},QFt=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=wL(e[0]),n=!QFt.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:cJ,mathmlBuilder:kMe});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:cJ,mathmlBuilder:kMe});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=hi(t.base,e),n=BD(t,e),i=t.label==="\\utilde"?.12:0,s=ui({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=$D(t.label),n=new qt("munder",[Mi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var T8=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=T5(hi(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=T5(hi(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=BD(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=ui({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=ui({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=$D(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=T8(Mi(t.body,e));if(t.below){var s=T8(Mi(t.below,e));n=new qt("munderover",[r,s,i])}else n=new qt("mover",[r,i])}else if(t.below){var a=T8(Mi(t.below,e));n=new qt("munder",[r,a])}else n=T8(),n=new qt("mover",[r,n]);return n}});function SMe(t,e){var r=La(t.body,e,!0);return Ft([t.mclass],r,e)}function EMe(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:ua(i),isCharacterBox:q0(i)}},htmlBuilder:SMe,mathmlBuilder:EMe});var VD=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:VD(e[0]),body:ua(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=VD(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ua(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:SMe,mathmlBuilder:EMe});sr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:VD(e[0]),body:ua(e[0])}},htmlBuilder(t,e){var r=La(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 JFt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Pde=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),$de=t=>t.type==="textord"&&t.text==="@",ezt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function tzt(t,e,r){var n=JFt[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 rzt(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=tzt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=Pde()}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=T5(hi(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=T5(hi(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 AMe=(t,e)=>{var r=La(t.body,e.withColor(t.color),!1);return Y0(r)},MMe=(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:ua(i)}},htmlBuilder:AMe,mathmlBuilder:MMe});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:AMe,mathmlBuilder:MMe});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 YW={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},RMe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},nzt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},_Me=(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(YW[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=YW[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===YW[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=RMe(e.gullet.popToken());e.gullet.consumeSpaces();var i=nzt(e);return _Me(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=RMe(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return _Me(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var uk=function(e,r,n){var i=ls.math[e]&&ls.math[e].replace,s=iJ(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},uJ=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},LMe=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},izt=function(e,r,n,i,s,a){var o=dl(e,"Main-Regular",s,i),l=uJ(o,r,i,a);return LMe(l,i,r),l},szt=function(e,r,n,i){return dl(e,"Size"+r+"-Regular",n,i)},IMe=function(e,r,n,i,s,a){var o=szt(e,r,s,i),l=uJ(Ft(["delimsizing","size"+r],[o],i),dn.TEXT,i,a);return n&&LMe(l,i,dn.TEXT),l},YB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=Ft(["delimsizinginner",i],[Ft([],[dl(e,r,n)])]);return{type:"elem",elem:s}},jB=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 Eg("inner",gFt(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=Ag([],[a],n);return o.height=r,o.style.height=Yt(r),o.style.width=Yt(i),{type:"elem",elem:o}},jW=.008,C8={type:"kern",size:-1*jW},azt=new Set(["|","\\lvert","\\rvert","\\vert"]),ozt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),NMe=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"):azt.has(e)?(u="∣",d="vert",f=333):ozt.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=uk(o,p,s),m=g.height+g.depth,y=uk(u,p,s),v=y.height+y.depth,x=uk(h,p,s),b=x.height+x.depth,T=0,C=1;if(l!==null){var S=uk(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=mFt(d,Math.round(N*1e3)),$=new Eg(d,I),O=Yt(f/1e3),D=Yt(L/1e3),F=new C0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=Ag([],[F],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(YB(h,p,s)),P.push(C8),l===null){var V=A-m-b+2*jW;P.push(jB(u,V,i))}else{var B=(A-m-b-T)/2+2*jW;P.push(jB(u,B,i)),P.push(C8),P.push(YB(l,p,s)),P.push(C8),P.push(jB(u,B,i))}P.push(C8),P.push(YB(o,p,s))}var H=i.havingBaseStyle(dn.TEXT),G=ui({positionType:"bottom",positionData:_,children:P});return uJ(Ft(["delimsizing","mult"],[G],H),dn.TEXT,i,a)},XB=80,KB=.08,ZB=function(e,r,n,i,s){var a=pFt(e,i,n),o=new Eg(e,a),l=new C0([o],{width:"400em",height:Yt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Ag(["hide-tail"],[l],s)},lzt=function(e,r){var n=r.havingBaseSizing(),i=BMe("\\surd",e*n.sizeMultiplier,$Me,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+XB,e<1?s=1:e<1.4&&(s=.7),l=(1+a+KB)/s,u=(1+a)/s,o=ZB("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+XB)*cS[i.size],u=(cS[i.size]+a)/s,l=(cS[i.size]+a+KB)/s,o=ZB("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+KB,u=e+a,h=Math.floor(1e3*e+a)+XB,o=ZB("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}},DMe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),czt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),OMe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),cS=[0,1.2,1.8,2.4,3],PMe=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),DMe.has(e)||OMe.has(e))return IMe(e,r,!1,n,i,s);if(czt.has(e))return NMe(e,cS[r],!1,n,i,s);throw new Gt("Illegal delimiter: '"+e+"'")},uzt=[{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}],hzt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"stack"}],$Me=[{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"}],dzt=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.")},BMe=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]},XW=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;OMe.has(e)?o=uzt:DMe.has(e)?o=$Me:o=hzt;var l=BMe(e,r,o,i);return l.type==="small"?izt(e,l.style,n,i,s,a):l.type==="large"?IMe(e,l.size,n,i,s,a):NMe(e,r,n,i,s,a)},QB=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 XW(e,d,!0,i,s,a)},Bde={"\\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}},fzt=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 Fde(t){return"isMiddle"in t}function HD(t,e){var r=zD(t);if(r&&fzt.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=HD(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Bde[t.funcName].size,mclass:Bde[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ft([t.mclass]):PMe(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(cS[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function zde(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:HD(e[0],t).text,color:r}}});sr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=HD(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)=>{zde(t);for(var r=La(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{zde(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 oJ(r)}});sr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=HD(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=V6(e,[]):(r=PMe(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 GD=(t,e)=>{var r=T5(hi(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=dFt(f),g=new C0([new Eg("phase",p)],{width:"400em",height:Yt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Ag(["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=jFt(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=ui({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=ui({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)},WD=(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:GD,mathmlBuilder:WD});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:GD,mathmlBuilder:WD});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:GD,mathmlBuilder:WD});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:GD,mathmlBuilder:WD});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 FMe={};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.")},pzt=new Set(["gather","gather*"]);function hJ(t){if(!t.includes("ed"))return!t.includes("*")}function rm(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(Vde(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=w5("hline",r,h),He=w5("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=ui({positionType:"individualShift",children:we})}if(O.length===0)return Ft(["mord"],[Te],r);var le=ui({positionType:"individualShift",children:O}),pe=Ft(["tag"],[le],r);return Y0([Te,pe])},gzt={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=zD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(a){var o=FD(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 rm(t.parser,s,dJ(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=rm(t.parser,n,dJ(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=rm(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=zD(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(o){var l=FD(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=rm(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=rm(t.parser,e,dJ(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:VMe,htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){pzt.has(t.envName)&&qD(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:hJ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return rm(t.parser,e,"display")},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:VMe,htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){qD(t);var e={autoTag:hJ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return rm(t.parser,e,"display")},htmlBuilder:Kd,mathmlBuilder:Zd});Xd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return qD(t),rzt(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 Hde=FMe;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 hi(t.body,n)},GMe=(t,e)=>{var r=t.font,n=e.withFont(r);return Mi(t.body,n)},Gde={"\\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=wL(e[0]),s=n;return s in Gde&&(s=Gde[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:HMe,mathmlBuilder:GMe});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:VD(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:HMe,mathmlBuilder:GMe});var mzt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=hi(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 ha(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(r),t.rightDelim!=null){var a=new qt("mo",[new ha(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return oJ(i)}return r},WMe=(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"),WMe({type:"genfrac",mode:r.mode,numer:i,denom:s,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:mzt,mathmlBuilder:yzt});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 Wde=["display","text","script","scriptscript"],qde=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=wL(e[0]),a=s.type==="atom"&&s.family==="open"?qde(s.text):null,o=wL(e[1]),l=o.type==="atom"&&o.family==="close"?qde(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=Wde[Number(g.text)]}}else p=bn(p,"textord"),f=Wde[Number(p.text)];return WMe({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 qMe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?hi(t.sup,e.havingStyle(r.sup()),e):hi(t.sub,e.havingStyle(r.sub()),e),i=bn(t.base,"horizBrace")):i=bn(t,"horizBrace");var s=hi(i.base,e.havingBaseStyle(dn.DISPLAY)),a=BD(i,e),o;if(i.isOver?o=ui({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=ui({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=ui({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=ui({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)},vzt=(t,e)=>{var r=$D(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:qMe,mathmlBuilder:vzt});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:ua(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=La(t.body,e,!1);return LFt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Mg(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=La(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)=>Mg(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:ua(e[0]),mathml:ua(e[1])}},htmlBuilder:(t,e)=>{var r=La(t.html,e,!1);return Y0(r)},mathmlBuilder:(t,e)=>Mg(t.mathml,e)});var JB=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(!oMe(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 xFt(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 pMe(t.dimension,e)},mathmlBuilder(t,e){var r=xs(t.dimension,e);return new xMe(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([],[hi(t.body,e)]),r=Ft(["inner"],[r],e)):r=Ft(["inner"],[hi(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 Ude=(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:ua(e[0]),text:ua(e[1]),script:ua(e[2]),scriptscript:ua(e[3])}},htmlBuilder:(t,e)=>{var r=Ude(t,e),n=La(r,e,!1);return Y0(n)},mathmlBuilder:(t,e)=>{var r=Ude(t,e);return Mg(r,e)}});var UMe=(t,e,r,n,i,s,a)=>{t=Ft([],[t]);var o=r&&q0(r),l,u;if(e){var h=hi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=hi(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=ui({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=ui({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=ui({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)},YMe=new Set(["\\smallint"]),w3=(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&&!YMe.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=dl(s.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=mMe(d+"Size"+(o?"2":"1"),e);l=ui({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=La(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)]),YMe.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 ha(t.name.slice(1))]);var n=new qt("mo",[Iu("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=bMe([r,n])}return r},bzt={"∏":"\\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=bzt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:w3,mathmlBuilder:m7});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:ua(n)}},htmlBuilder:w3,mathmlBuilder:m7});var xzt={"∫":"\\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:w3,mathmlBuilder:m7});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:w3,mathmlBuilder:m7});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=xzt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:w3,mathmlBuilder:m7});var jMe=(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=La(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 ha(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]):bMe([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:ua(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:jMe,mathmlBuilder:wzt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");iv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Y0(La(t.body,e,!1)):Ft(["mord"],La(t.body,e,!0),e)},mathmlBuilder(t,e){return Mg(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=hi(t.body,e.havingCrampedStyle()),n=w5("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ui({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 ha("‾")]);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:ua(n)}},htmlBuilder:(t,e)=>{var r=La(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"],[hi(t.body,e.withPhantom())]),n=Ft(["fix"],[]);return Ft(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Kc(ua(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=hi(t.body,e),n=xs(t.dy,e);return ui({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 XMe(t,e,r){for(var n=La(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return XMe(t.body,r,e)};sr({type:"sizing",names:Yde,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:Yde.indexOf(n)+1,body:s}},htmlBuilder:Tzt,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([],[hi(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=hi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=T5(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=ui({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=hi(t.index,g,e),y=.6*(p.height-p.depth),v=ui({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 KW={display:dn.DISPLAY,text:dn.TEXT,script:dn.SCRIPT,scriptscript:dn.SCRIPTSCRIPT};function Czt(t){return t in KW}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(!Czt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=KW[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),XMe(t.body,n,e)},mathmlBuilder(t,e){var r=KW[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 kzt=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?w3:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===dn.DISPLAY.size||n.limits);return s?jMe:null}else{if(n.type==="accent")return q0(n.base)?cJ:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?qMe:null}else return null}else return null};iv({type:"supsub",htmlBuilder(t,e){var r=kzt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=hi(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=hi(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=hi(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=ui({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=ui({positionType:"shift",positionData:d,children:R})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=ui({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var _=qW(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)}});iv({type:"atom",htmlBuilder(t,e){return sJ(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=lJ(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 KMe={mi:"italic",mn:"normal",mtext:"normal"};iv({type:"mathord",htmlBuilder(t,e){return PD(t,e,"mathord")},mathmlBuilder(t,e){var r=new qt("mi",[Iu(t.text,t.mode,e)]),n=lJ(t,e)||"italic";return n!==KMe[r.type]&&r.setAttribute("mathvariant",n),r}});iv({type:"textord",htmlBuilder(t,e){return PD(t,e,"textord")},mathmlBuilder(t,e){var r=Iu(t.text,t.mode,e),n=lJ(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!==KMe[i.type]&&i.setAttribute("mathvariant",n),i}});var eF={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},tF={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};iv({type:"spacing",htmlBuilder(t,e){if(tF.hasOwnProperty(t.text)){var r=tF[t.text].className||"";if(t.mode==="text"){var n=PD(t,e,"textord");return n.classes.push(r),n}else return Ft(["mspace",r],[sJ(t.text,t.mode,e)],e)}else{if(eF.hasOwnProperty(t.text))return Ft(["mspace",eF[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(tF.hasOwnProperty(t.text))r=new qt("mtext",[new ha(" ")]);else{if(eF.hasOwnProperty(t.text))return new qt("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var jde=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};iv({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[jde(),new qt("mtd",[Mg(t.body,e)]),jde(),new qt("mtd",[Mg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Xde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Kde={"\\textbf":"textbf","\\textmd":"textmd"},Szt={"\\textit":"textit","\\textup":"textup"},Zde=(t,e)=>{var r=t.font;if(r){if(Xde[r])return e.withTextFontFamily(Xde[r]);if(Kde[r])return e.withTextFontWeight(Kde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(Szt[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:ua(i),font:n}},htmlBuilder(t,e){var r=Zde(t,e),n=La(t.body,r,!0);return Ft(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Zde(t,e);return Mg(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=hi(t.body,e),n=w5("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ui({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 ha("‾")]);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=hi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return ui({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=Qde(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),qp=yMe,ZMe=`[ \r + ]`,Ezt="\\\\[a-zA-Z@]+",Azt="\\\\[^\uD800-\uDFFF]",Mzt="("+Ezt+")"+ZMe+"*",Rzt=`\\\\( |[ \r ]+ -?)[ \r ]*`,ZW="[̀-ͯ]",Rzt=new RegExp(ZW+"+$"),_zt="("+KMe+"+)|"+(Mzt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(ZW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ZW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Azt)+("|"+Ezt+")");let Qde=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(_zt,"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 nc(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 nc(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 nc(this,r,this.tokenRegex.lastIndex))}};class Lzt{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 Izt=FMe;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 Jde={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=Jde[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Jde[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=>fJ(t,!1,!0,!1));Se("\\renewcommand",t=>fJ(t,!0,!1,!1));Se("\\providecommand",t=>fJ(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),qp[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 efe={",":"\\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"},Nzt=new Set(["bin","rel"]);Se("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in efe?e=efe[r]:(r.slice(0,4)==="\\not"||r in ls.math&&Nzt.has(ls.math[r].group))&&(e="\\dotsb"),e});var pJ={")":!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 pJ?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in pJ&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in pJ?"\\@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 ZMe=Yt(yd["Main-Regular"][84][1]-.7*yd["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+ZMe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+ZMe+"}{\\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 QMe=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",QMe(!1));Se("\\bra@set",QMe(!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 JMe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Dzt{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 Lzt(Izt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Qde(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("",nc.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 Qde(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)||qp.hasOwnProperty(e)||ls.math.hasOwnProperty(e)||ls.text.hasOwnProperty(e)||JMe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:qp.hasOwnProperty(e)&&!qp[e].primitive}}var tfe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,k8=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),rF={"́":{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"}},rfe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let eRe=class tRe{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 Dzt(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(tRe.endOfExpression.has(i.text)||r&&i.text===r||e&&qp[i.text]&&qp[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&&(sMe(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:nc.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]=Dm,this._children[e]={},this._children[Dm][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(Lc(this._in[e]),r),delete this._in[e],delete this._preds[e],Et(Lc(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=Dm;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!==Dm)return r}}children(e){if(Us(e)&&(e=Dm),this._isCompound){var r=this._children[e];if(r)return Lc(r)}else{if(e===Dm)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Lc(r)}successors(e){var r=this._sucs[e];if(r)return Lc(r)}neighbors(e){var r=this.predecessors(e);if(r)return HV(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 _S(e)||(e=X2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Kf(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return DE(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=hk(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=Bzt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,ife(this._preds[r],e),ife(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?nF(this._isDirected,arguments[0]):hk(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?nF(this._isDirected,arguments[0]):hk(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?nF(this._isDirected,arguments[0]):hk(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],sfe(this._preds[r],e),sfe(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))}}Uo.prototype._nodeCount=0;Uo.prototype._edgeCount=0;function ife(t,e){t[e]?t[e]++:t[e]=1}function sfe(t,e){--t[e]||delete t[e]}function hk(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}return i+nfe+s+nfe+(Us(n)?$zt:n)}function Bzt(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 nF(t,e){return hk(t,e.v,e.w,e.name)}function o0(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Fzt(t),edges:zzt(t)};return Us(t.graph())||(e.value=s9(t.graph())),e}function Fzt(t){return la(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 zzt(t){return la(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,Up=new Map,lRe=new Map,cRe=w(()=>{Up.clear(),lRe.clear(),hn.clear()},"clear"),Ly=w((t,e)=>{const r=Up.get(e)||[];return de.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),Vzt=w((t,e)=>{const r=Up.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)||Ly(t.v,e)||Ly(t.w,e)||r.includes(t.w):(de.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),QW=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)QW(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(Vzt(l,n)){const h=Up.get(n)||[],d=h.includes(l.v)||Ly(l.v,n)||l.v===n,f=h.includes(l.w)||Ly(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"),uRe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)lRe.set(i,t),n=[...n,...uRe(i,e)];return n},"extractDescendants"),Hzt=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"),C5=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=C5(s,e,r),o=Hzt(e,r,a);if(a)if(o.length>0)i=a;else return a}return i},"findNonClusterChild"),afe=w(t=>!hn.has(t)||!hn.get(t).externalConnections?t:hn.has(t)?hn.get(t).id:t,"getAnchorId"),Gzt=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: ",C5(n,t,n)),Up.set(n,uRe(n,t)),hn.set(n,{id:C5(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,Up),s.forEach(a=>{const o=Ly(a.v,n),l=Ly(a.w,n);o^l&&(de.warn("Edge: ",a," leaves cluster ",n),de.warn("Descendants of XXX ",n,": ",Up.get(n)),hn.get(n).externalConnections=!0)})):de.debug("Not a cluster ",n,Up)});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&&fRe(t,i,n)){const o=qzt(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=afe(n.v),a=afe(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)),hRe(t,0),de.trace(hn)},"adjustClustersAndEdges"),hRe=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 Uo({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});QW(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 Uo({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});QW(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&&hRe(u.graph,e+1)}},"extractor"),dRe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),s=dRe(t,i);r=[...r,...s]}),r},"sorter"),Wzt=w(t=>dRe(t,t.children()),"sortNodesByHierarchy"),fRe=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"),qzt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||Ly(i,r))continue;const s=C5(i,t,e);if(s&&!fRe(t,s,e))return s}return null},"findSafeAnchorNode");class Uzt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return ofe(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&ofe(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,Yzt)),n=n._prev;return"["+e.join(", ")+"]"}}function ofe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Yzt(t,e){if(t!=="_next"&&t!=="_prev")return e}var jzt=X2(1);function Xzt(t,e){if(t.nodeCount()<=1)return[];var r=Zzt(t,e||jzt),n=Kzt(r.graph,r.buckets,r.zeroIdx);return J5(la(n,function(i){return t.outEdges(i.v,i.w)}))}function Kzt(t,e,r){for(var n=[],i=e[e.length-1],s=e[0],a;t.nodeCount();){for(;a=s.dequeue();)iF(t,e,r,a);for(;a=i.dequeue();)iF(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(iF(t,e,r,a,!0));break}}}return n}function iF(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,JW(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,JW(e,r,u)}),t.removeNode(n.v),s}function Zzt(t,e){var r=new Uo,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=FT(i+n+3).map(function(){return new Uzt}),a=n+1;return Et(r.nodes(),function(o){JW(s,a,r.node(o))}),{graph:r,buckets:s,zeroIdx:a}}function JW(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 Qzt(t){var e=t.graph().acyclicer==="greedy"?Xzt(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,pN("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 eVt(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 T3(t,e,r,n){var i;do i=pN(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function tVt(t){var e=new Uo().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 pRe(t){var e=new Uo({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 lfe(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 YD(t){var e=la(FT(gRe(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 rVt(t){var e=OS(la(t.nodes(),function(r){return t.node(r).rank}));Et(t.nodes(),function(r){var n=t.node(r);K2(n,"rank")&&(n.rank-=e)})}function nVt(t){var e=OS(la(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 cfe(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),T3(t,"border",i,e)}function gRe(t){return ug(la(t.nodes(),function(e){var r=t.node(e).rank;if(!Us(r))return r}))}function iVt(t,e){var r={lhs:[],rhs:[]};return Et(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function sVt(t,e){return e()}function aVt(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===dfe(t,t.node(h.v),o)&&l!==dfe(t,t.node(h.w),o)});return mX(u,function(h){return H6(e,h)})}function kRe(t,e,r,n){var i=r.v,s=r.w;t.removeEdge(i,s),t.setEdge(n.v,n.w,{}),bJ(t),vJ(t,e),wVt(t,e)}function wVt(t,e){var r=pX(t.nodes(),function(i){return!e.node(i).parent}),n=bVt(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 dfe(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function CVt(t){switch(t.graph().ranker){case"network-simplex":ffe(t);break;case"tight-tree":SVt(t);break;case"longest-path":kVt(t);break;default:ffe(t)}}var kVt=yJ;function SVt(t){yJ(t),yRe(t)}function ffe(t){sv(t)}function EVt(t){var e=T3(t,"root",{},"_root"),r=AVt(t),n=ug(Kf(r))-1,i=2*n+1;t.graph().nestingRoot=e,Et(t.edges(),function(a){t.edge(a).minlen*=i});var s=MVt(t)+1;Et(t.children(),function(a){SRe(t,e,i,s,n,r,a)}),t.graph().nodeRankFactor=i}function SRe(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=cfe(t,"_bt"),u=cfe(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(u,a),h.borderBottom=u,Et(o,function(d){SRe(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 MVt(t){return DE(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function RVt(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 _Vt(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 LVt(t,e,r){var n=IVt(t),i=new Uo({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 IVt(t){for(var e;t.hasNode(e=pN("_root")););return e}function NVt(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 OVt(t){var e={},r=Pf(t.nodes(),function(o){return!t.children(o).length}),n=ug(la(r,function(o){return t.node(o).rank})),i=la(FT(n+1),function(){return[]});function s(o){if(!K2(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),Et(t.successors(o),s)}}var a=Wg(r,function(o){return t.node(o).rank});return Et(a,s),i}function PVt(t,e){return la(e,function(r){var n=t.inEdges(r);if(n.length){var i=DE(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 $Vt(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 BVt(n)}function BVt(t){var e=[];function r(s){return function(a){a.merged||(Us(a.barycenter)||Us(s.barycenter)||a.barycenter>=s.barycenter)&&FVt(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 la(Pf(e,function(s){return!s.merged}),function(s){return BT(s,["vs","i","barycenter","weight"])})}function FVt(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 zVt(t,e){var r=iVt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Wg(r.rhs,function(h){return-h.i}),s=[],a=0,o=0,l=0;n.sort(VVt(!!e)),l=pfe(s,i,l),Et(n,function(h){l+=h.vs.length,s.push(h.vs),a+=h.barycenter*h.weight,o+=h.weight,l=pfe(s,i,l)});var u={vs:J5(s)};return o&&(u.barycenter=a/o,u.weight=o),u}function pfe(t,e,r){for(var n;e.length&&(n=o9(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function VVt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function ERe(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=PVt(t,i);Et(u,function(g){if(t.children(g.v).length){var m=ERe(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&GVt(g,m)}});var h=$Vt(u,r);HVt(h,l);var d=zVt(h,n);if(a&&(d.vs=J5([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 HVt(t,e){Et(t,function(r){r.vs=J5(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function GVt(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 WVt(t){var e=gRe(t),r=gfe(t,FT(1,e+1),"inEdges"),n=gfe(t,FT(e-1,-1,-1),"outEdges"),i=OVt(t);mfe(t,i);for(var s=Number.POSITIVE_INFINITY,a,o=0,l=0;l<4;++o,++l){qVt(o%2?r:n,o%4>=2),i=YD(t);var u=NVt(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 jVt(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 XVt(t,e){var r={};function n(i,s){var a=0,o=0,l=i.length,u=o9(s);return Et(s,function(h,d){var f=ZVt(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)&&ARe(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 DE(e,i),r}function ZVt(t,e){if(t.node(e).dummy)return pX(t.predecessors(e),function(r){return t.node(r).dummy})}function ARe(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 QVt(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=Wg(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",()=>xHt(t));r(" runLayout",()=>uHt(n,r)),r(" updateInputGraph",()=>hHt(t,n))})}function uHt(t,e){e(" makeSpaceForEdgeLabels",()=>wHt(t)),e(" removeSelfEdges",()=>_Ht(t)),e(" acyclic",()=>Qzt(t)),e(" nestingGraph.run",()=>EVt(t)),e(" rank",()=>CVt(pRe(t))),e(" injectEdgeLabelProxies",()=>THt(t)),e(" removeEmptyRanks",()=>nVt(t)),e(" nestingGraph.cleanup",()=>RVt(t)),e(" normalizeRanks",()=>rVt(t)),e(" assignRankMinMax",()=>CHt(t)),e(" removeEdgeLabelProxies",()=>kHt(t)),e(" normalize.run",()=>hVt(t)),e(" parentDummyChains",()=>UVt(t)),e(" addBorderSegments",()=>aVt(t)),e(" order",()=>WVt(t)),e(" insertSelfEdges",()=>LHt(t)),e(" adjustCoordinateSystem",()=>oVt(t)),e(" position",()=>lHt(t)),e(" positionSelfEdges",()=>IHt(t)),e(" removeBorderNodes",()=>RHt(t)),e(" normalize.undo",()=>fVt(t)),e(" fixupEdgeLabelCoords",()=>AHt(t)),e(" undoCoordinateSystem",()=>lVt(t)),e(" translateGraph",()=>SHt(t)),e(" assignNodeIntersects",()=>EHt(t)),e(" reversePoints",()=>MHt(t)),e(" acyclic.undo",()=>eVt(t))}function hHt(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 dHt=["nodesep","edgesep","ranksep","marginx","marginy"],fHt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},pHt=["acyclicer","ranker","rankdir","align"],gHt=["width","height"],mHt={width:0,height:0},yHt=["minlen","weight","width","height","labeloffset"],vHt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},bHt=["labelpos"];function xHt(t){var e=new Uo({multigraph:!0,compound:!0}),r=lF(t.graph());return e.setGraph(Pi({},fHt,oF(r,dHt),BT(r,pHt))),Et(t.nodes(),function(n){var i=lF(t.node(n));e.setNode(n,r2e(oF(i,gHt),mHt)),e.setParent(n,t.parent(n))}),Et(t.edges(),function(n){var i=lF(t.edge(n));e.setEdge(n,Pi({},vHt,oF(i,yHt),BT(i,bHt)))}),e}function wHt(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};T3(t,"edge-proxy",s,"_ep")}})}function CHt(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=ug(e,n.maxRank))}),t.graph().maxRank=e}function kHt(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 SHt(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 EHt(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(lfe(n,s)),r.points.push(lfe(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 MHt(t){Et(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function RHt(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(o9(r.borderLeft)),a=t.node(o9(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 _Ht(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 LHt(t){var e=YD(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){T3(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 IHt(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 oF(t,e){return fN(BT(t,e),Number)}function lF(t){var e={};return Et(t,function(r,n){e[n.toLowerCase()]=r}),e}var yfe=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),vfe=w((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),NHt=w(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),DHt=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 vfe(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":vfe(i)},"getSelfLoopSide"),OHt=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=yfe(Math.max(n,t.width*.35),36,l),h=yfe(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"),PHt=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"),RRe=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=DHt(t,f,o,d.start,s),m=OHt(f,g,e,p.width??0),y=PHt(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"),_Re=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=NHt(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 ]*`,ZW="[̀-ͯ]",_zt=new RegExp(ZW+"+$"),Lzt="("+ZMe+"+)|"+(Rzt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(ZW+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ZW+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Mzt)+("|"+Azt+")");let Jde=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(Lzt,"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 nc(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 nc(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 nc(this,r,this.tokenRegex.lastIndex))}};class Izt{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 Nzt=zMe;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 efe={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=efe[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=efe[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=>fJ(t,!1,!0,!1));Se("\\renewcommand",t=>fJ(t,!0,!1,!1));Se("\\providecommand",t=>fJ(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),qp[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 tfe={",":"\\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 tfe?e=tfe[r]:(r.slice(0,4)==="\\not"||r in ls.math&&Dzt.has(ls.math[r].group))&&(e="\\dotsb"),e});var pJ={")":!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 pJ?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in pJ&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in pJ?"\\@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 QMe=Yt(yd["Main-Regular"][84][1]-.7*yd["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+QMe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+QMe+"}{\\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 JMe=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",JMe(!1));Se("\\bra@set",JMe(!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 eRe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Ozt{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 Izt(Nzt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Jde(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("",nc.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 Jde(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)||qp.hasOwnProperty(e)||ls.math.hasOwnProperty(e)||ls.text.hasOwnProperty(e)||eRe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:qp.hasOwnProperty(e)&&!qp[e].primitive}}var rfe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,k8=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),rF={"́":{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"}},nfe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let tRe=class rRe{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 Ozt(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(rRe.endOfExpression.has(i.text)||r&&i.text===r||e&&qp[i.text]&&qp[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&&(aMe(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:nc.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]=Dm,this._children[e]={},this._children[Dm][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(Lc(this._in[e]),r),delete this._in[e],delete this._preds[e],Et(Lc(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=Dm;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!==Dm)return r}}children(e){if(Us(e)&&(e=Dm),this._isCompound){var r=this._children[e];if(r)return Lc(r)}else{if(e===Dm)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Lc(r)}successors(e){var r=this._sucs[e];if(r)return Lc(r)}neighbors(e){var r=this.predecessors(e);if(r)return HV(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 _S(e)||(e=X2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Kf(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return DE(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=hk(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=Fzt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,sfe(this._preds[r],e),sfe(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?nF(this._isDirected,arguments[0]):hk(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?nF(this._isDirected,arguments[0]):hk(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?nF(this._isDirected,arguments[0]):hk(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],afe(this._preds[r],e),afe(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))}}Uo.prototype._nodeCount=0;Uo.prototype._edgeCount=0;function sfe(t,e){t[e]?t[e]++:t[e]=1}function afe(t,e){--t[e]||delete t[e]}function hk(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}return i+ife+s+ife+(Us(n)?Bzt:n)}function Fzt(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 nF(t,e){return hk(t,e.v,e.w,e.name)}function o0(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:zzt(t),edges:Vzt(t)};return Us(t.graph())||(e.value=s9(t.graph())),e}function zzt(t){return la(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 Vzt(t){return la(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,Up=new Map,cRe=new Map,uRe=w(()=>{Up.clear(),cRe.clear(),hn.clear()},"clear"),Ly=w((t,e)=>{const r=Up.get(e)||[];return de.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),Hzt=w((t,e)=>{const r=Up.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)||Ly(t.v,e)||Ly(t.w,e)||r.includes(t.w):(de.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),QW=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)QW(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(Hzt(l,n)){const h=Up.get(n)||[],d=h.includes(l.v)||Ly(l.v,n)||l.v===n,f=h.includes(l.w)||Ly(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"),hRe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)cRe.set(i,t),n=[...n,...hRe(i,e)];return n},"extractDescendants"),Gzt=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"),C5=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=C5(s,e,r),o=Gzt(e,r,a);if(a)if(o.length>0)i=a;else return a}return i},"findNonClusterChild"),ofe=w(t=>!hn.has(t)||!hn.get(t).externalConnections?t:hn.has(t)?hn.get(t).id:t,"getAnchorId"),Wzt=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: ",C5(n,t,n)),Up.set(n,hRe(n,t)),hn.set(n,{id:C5(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,Up),s.forEach(a=>{const o=Ly(a.v,n),l=Ly(a.w,n);o^l&&(de.warn("Edge: ",a," leaves cluster ",n),de.warn("Descendants of XXX ",n,": ",Up.get(n)),hn.get(n).externalConnections=!0)})):de.debug("Not a cluster ",n,Up)});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&&pRe(t,i,n)){const o=Uzt(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=ofe(n.v),a=ofe(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)),dRe(t,0),de.trace(hn)},"adjustClustersAndEdges"),dRe=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 Uo({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});QW(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 Uo({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});QW(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&&dRe(u.graph,e+1)}},"extractor"),fRe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),s=fRe(t,i);r=[...r,...s]}),r},"sorter"),qzt=w(t=>fRe(t,t.children()),"sortNodesByHierarchy"),pRe=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"),Uzt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||Ly(i,r))continue;const s=C5(i,t,e);if(s&&!pRe(t,s,e))return s}return null},"findSafeAnchorNode");class Yzt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return lfe(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&lfe(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,jzt)),n=n._prev;return"["+e.join(", ")+"]"}}function lfe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function jzt(t,e){if(t!=="_next"&&t!=="_prev")return e}var Xzt=X2(1);function Kzt(t,e){if(t.nodeCount()<=1)return[];var r=Qzt(t,e||Xzt),n=Zzt(r.graph,r.buckets,r.zeroIdx);return J5(la(n,function(i){return t.outEdges(i.v,i.w)}))}function Zzt(t,e,r){for(var n=[],i=e[e.length-1],s=e[0],a;t.nodeCount();){for(;a=s.dequeue();)iF(t,e,r,a);for(;a=i.dequeue();)iF(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(iF(t,e,r,a,!0));break}}}return n}function iF(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,JW(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,JW(e,r,u)}),t.removeNode(n.v),s}function Qzt(t,e){var r=new Uo,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=FT(i+n+3).map(function(){return new Yzt}),a=n+1;return Et(r.nodes(),function(o){JW(s,a,r.node(o))}),{graph:r,buckets:s,zeroIdx:a}}function JW(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 Jzt(t){var e=t.graph().acyclicer==="greedy"?Kzt(t,r(t)):eVt(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,pN("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function eVt(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 tVt(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 T3(t,e,r,n){var i;do i=pN(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function rVt(t){var e=new Uo().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 gRe(t){var e=new Uo({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 cfe(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 YD(t){var e=la(FT(mRe(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 nVt(t){var e=OS(la(t.nodes(),function(r){return t.node(r).rank}));Et(t.nodes(),function(r){var n=t.node(r);K2(n,"rank")&&(n.rank-=e)})}function iVt(t){var e=OS(la(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 ufe(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),T3(t,"border",i,e)}function mRe(t){return ug(la(t.nodes(),function(e){var r=t.node(e).rank;if(!Us(r))return r}))}function sVt(t,e){var r={lhs:[],rhs:[]};return Et(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function aVt(t,e){return e()}function oVt(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===ffe(t,t.node(h.v),o)&&l!==ffe(t,t.node(h.w),o)});return mX(u,function(h){return H6(e,h)})}function SRe(t,e,r,n){var i=r.v,s=r.w;t.removeEdge(i,s),t.setEdge(n.v,n.w,{}),bJ(t),vJ(t,e),TVt(t,e)}function TVt(t,e){var r=pX(t.nodes(),function(i){return!e.node(i).parent}),n=xVt(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 CVt(t,e,r){return t.hasEdge(e,r)}function ffe(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function kVt(t){switch(t.graph().ranker){case"network-simplex":pfe(t);break;case"tight-tree":EVt(t);break;case"longest-path":SVt(t);break;default:pfe(t)}}var SVt=yJ;function EVt(t){yJ(t),vRe(t)}function pfe(t){sv(t)}function AVt(t){var e=T3(t,"root",{},"_root"),r=MVt(t),n=ug(Kf(r))-1,i=2*n+1;t.graph().nestingRoot=e,Et(t.edges(),function(a){t.edge(a).minlen*=i});var s=RVt(t)+1;Et(t.children(),function(a){ERe(t,e,i,s,n,r,a)}),t.graph().nodeRankFactor=i}function ERe(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=ufe(t,"_bt"),u=ufe(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(u,a),h.borderBottom=u,Et(o,function(d){ERe(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 MVt(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 RVt(t){return DE(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function _Vt(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 LVt(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 IVt(t,e,r){var n=NVt(t),i=new Uo({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 NVt(t){for(var e;t.hasNode(e=pN("_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=Pf(t.nodes(),function(o){return!t.children(o).length}),n=ug(la(r,function(o){return t.node(o).rank})),i=la(FT(n+1),function(){return[]});function s(o){if(!K2(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),Et(t.successors(o),s)}}var a=Wg(r,function(o){return t.node(o).rank});return Et(a,s),i}function $Vt(t,e){return la(e,function(r){var n=t.inEdges(r);if(n.length){var i=DE(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 BVt(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 FVt(n)}function FVt(t){var e=[];function r(s){return function(a){a.merged||(Us(a.barycenter)||Us(s.barycenter)||a.barycenter>=s.barycenter)&&zVt(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 la(Pf(e,function(s){return!s.merged}),function(s){return BT(s,["vs","i","barycenter","weight"])})}function zVt(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 VVt(t,e){var r=sVt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=Wg(r.rhs,function(h){return-h.i}),s=[],a=0,o=0,l=0;n.sort(HVt(!!e)),l=gfe(s,i,l),Et(n,function(h){l+=h.vs.length,s.push(h.vs),a+=h.barycenter*h.weight,o+=h.weight,l=gfe(s,i,l)});var u={vs:J5(s)};return o&&(u.barycenter=a/o,u.weight=o),u}function gfe(t,e,r){for(var n;e.length&&(n=o9(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function HVt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function ARe(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=$Vt(t,i);Et(u,function(g){if(t.children(g.v).length){var m=ARe(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&WVt(g,m)}});var h=BVt(u,r);GVt(h,l);var d=VVt(h,n);if(a&&(d.vs=J5([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 GVt(t,e){Et(t,function(r){r.vs=J5(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function WVt(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 qVt(t){var e=mRe(t),r=mfe(t,FT(1,e+1),"inEdges"),n=mfe(t,FT(e-1,-1,-1),"outEdges"),i=PVt(t);yfe(t,i);for(var s=Number.POSITIVE_INFINITY,a,o=0,l=0;l<4;++o,++l){UVt(o%2?r:n,o%4>=2),i=YD(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 XVt(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 KVt(t,e){var r={};function n(i,s){var a=0,o=0,l=i.length,u=o9(s);return Et(s,function(h,d){var f=QVt(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)&&MRe(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 DE(e,i),r}function QVt(t,e){if(t.node(e).dummy)return pX(t.predecessors(e),function(r){return t.node(r).dummy})}function MRe(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 JVt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function eHt(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=Wg(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",()=>wHt(t));r(" runLayout",()=>hHt(n,r)),r(" updateInputGraph",()=>dHt(t,n))})}function hHt(t,e){e(" makeSpaceForEdgeLabels",()=>THt(t)),e(" removeSelfEdges",()=>LHt(t)),e(" acyclic",()=>Jzt(t)),e(" nestingGraph.run",()=>AVt(t)),e(" rank",()=>kVt(gRe(t))),e(" injectEdgeLabelProxies",()=>CHt(t)),e(" removeEmptyRanks",()=>iVt(t)),e(" nestingGraph.cleanup",()=>_Vt(t)),e(" normalizeRanks",()=>nVt(t)),e(" assignRankMinMax",()=>kHt(t)),e(" removeEdgeLabelProxies",()=>SHt(t)),e(" normalize.run",()=>dVt(t)),e(" parentDummyChains",()=>YVt(t)),e(" addBorderSegments",()=>oVt(t)),e(" order",()=>qVt(t)),e(" insertSelfEdges",()=>IHt(t)),e(" adjustCoordinateSystem",()=>lVt(t)),e(" position",()=>cHt(t)),e(" positionSelfEdges",()=>NHt(t)),e(" removeBorderNodes",()=>_Ht(t)),e(" normalize.undo",()=>pVt(t)),e(" fixupEdgeLabelCoords",()=>MHt(t)),e(" undoCoordinateSystem",()=>cVt(t)),e(" translateGraph",()=>EHt(t)),e(" assignNodeIntersects",()=>AHt(t)),e(" reversePoints",()=>RHt(t)),e(" acyclic.undo",()=>tVt(t))}function dHt(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 fHt=["nodesep","edgesep","ranksep","marginx","marginy"],pHt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},gHt=["acyclicer","ranker","rankdir","align"],mHt=["width","height"],yHt={width:0,height:0},vHt=["minlen","weight","width","height","labeloffset"],bHt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xHt=["labelpos"];function wHt(t){var e=new Uo({multigraph:!0,compound:!0}),r=lF(t.graph());return e.setGraph(Pi({},pHt,oF(r,fHt),BT(r,gHt))),Et(t.nodes(),function(n){var i=lF(t.node(n));e.setNode(n,n2e(oF(i,mHt),yHt)),e.setParent(n,t.parent(n))}),Et(t.edges(),function(n){var i=lF(t.edge(n));e.setEdge(n,Pi({},bHt,oF(i,vHt),BT(i,xHt)))}),e}function THt(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 CHt(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};T3(t,"edge-proxy",s,"_ep")}})}function kHt(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=ug(e,n.maxRank))}),t.graph().maxRank=e}function SHt(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 EHt(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 AHt(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(cfe(n,s)),r.points.push(cfe(i,a))})}function MHt(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 RHt(t){Et(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function _Ht(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(o9(r.borderLeft)),a=t.node(o9(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 LHt(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 IHt(t){var e=YD(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){T3(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 NHt(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 oF(t,e){return fN(BT(t,e),Number)}function lF(t){var e={};return Et(t,function(r,n){e[n.toLowerCase()]=r}),e}var vfe=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),bfe=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"),OHt=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 bfe(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":bfe(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=vfe(Math.max(n,t.width*.35),36,l),h=vfe(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"),$Ht=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"),_Re=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=OHt(t,f,o,d.start,s),m=PHt(f,g,e,p.width??0),y=$Ht(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"),LRe=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=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 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 _Re(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),u3t(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(C5(b.id,e)),hn.set(b.id,{id:C5(b.id,e),node:b})):(de.trace("Node - the non recursive path XAX",x,d,e.node(x),a),await o7(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 y_(h,T),T.id=C;return}await y_(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"),MRe(e),de.info("Graph after layout:",JSON.stringify(o0(e)));let g=0,{subGraphTitleTotalMargin:m}=c3(s);await Promise.all(Wzt(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,m_(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 cD(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),m_(b)}}));const y=m/2;return RRe(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=_Z(u,x,hn,r,C,S,n);r6e(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"),$Ht=w(async(t,e)=>{var s,a,o,l,u,h;const r=new Uo({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");LZ(n,t.markers,t.type,t.diagramId),JSe(),t6e(),Ike(),cRe(),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))),Gzt(r),de.warn("Graph after XAX:",JSON.stringify(o0(r)));const i=Ve();await _Re(n,r,t.type,t.diagramId,void 0,i)},"render");const BHt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:RRe,render:$Ht},Symbol.toStringTag,{value:"Module"}));async function LRe(t,e){const r=new Uo({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 o7(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(()=>z4r);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(LRe,"createGraphWithElements");var bfe=5,S8=1e-5,E8=1e-6;function TL(t){const e=[];for(let r=0;r=1-E8||f<=E8||f>=1-E8?null:{point:{x:t.x+d*i,y:t.y+d*s},tA:d,tB:f}}w(IRe,"segmentIntersection");function eq(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(eq,"isHorizontalSeg");function NRe(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(DRe,"getArcSweepFlag");var FHt=.001;function ORe(t,e){if(t.length<2)return t.map(s=>({...s}));const r=t.map(s=>({...s})),n=e.arrowTypeStart&&Pa[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&&Pa[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(ORe,"applyMarkerOffsets");function PRe(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${$b(o)}`];return i==="arc"?u.push(`A${sh(t.r)},${sh(t.r)} 0 0 ${n} ${$b(l)}`):u.push(`M${$b(l)}`),u}w(PRe,"emitJump");function tq(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=tq(i[u-1],i[u],i[u+1]??i[u],bfe);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(zRe,"decodeDataPoints");function VRe(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=zRe(d.getAttribute("data-points"))??u.points;s.push({...u,points:p})}const o=NRe(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&&!FRe(f))continue;const p=a.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!BRe(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=$Re(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(VRe,"applyLineJumpsToSvg");async function HRe(t,e){var i,s;for(const a of t.nodes)a.isGroup?await cD(e.clusters,a):m_(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=_Z(e.edgePaths,{...a},{},t.type,o,l,t.diagramId);a.label&&await y_(e.rootGroups,a),a.label&&GRe(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}));VRe(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:a})}}w(HRe,"adjustLayout");function GRe(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=br(),{subGraphTitleTotalMargin:i}=c3({flowchart:n.flowchart??{}});if(t.label){const s=E6.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(GRe,"positionEdgeLabel");var cF="__swimlane_default__",zHt=21,xfe=20;function rq(t){return Math.max(t.padding??xfe,xfe)}w(rq,"topLaneHorizontalPadding");function WRe(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(zHt,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(WRe,"assignTopLaneTitleRect");function qRe(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===cF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:cF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const s of n)s.parentId=cF}w(qRe,"prepareLayoutForSwimlanes");function URe(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(URe,"toGraphView");function YRe(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*rq(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*rq(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:Bb(e,r,n,i)}:void 0}w(xJ,"measuredNodeRect");function wJ(t){if(t.isGroup)return;const e=xJ(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(wJ,"nodeBoundsInfoFor");function Nu(t,e,r=eo){return Math.abs(t.x-e.x)r}w(Is,"isHorizontalSegment");function Ns(t,e,r=eo){return On(t,e,r)&&Math.abs(t.y-e.y)>r}w(Ns,"isVerticalSegment");function Ll(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(Ll,"overlapLength");function Ad(t,e,r=eo){return t.horizontal&&e.horizontal&&Bn(t.a,e.a,r)?Ll(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&On(t.a,e.a,r)?Ll(t.a.y,t.b.y,e.a.y,e.b.y):0}w(Ad,"sameAxisSegmentOverlapLength");function k5(t,e=eo){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 TJ(t,e=eo){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(TJ,"classifyThreeSegmentRoute");function jD(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(XRe,"rectContainsRect");function CL(t,e){return t.lefte.left&&t.tope.top}w(CL,"rectsOverlap");function nq(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(nq,"inflateRect");function Bb(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w(Bb,"rectFromCenterSize");function mc(t){var e;return(e=xJ(t))==null?void 0:e.rect}w(mc,"rectOfNodeBounds");function z1(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(z1,"portForRectSide");function kJ(t,e,r,n,i,s=eo){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(kJ,"buildOrthogonalPortPath");function SJ(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(SJ,"buildSameSideTrackPath");function XD(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=wJ(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(XD,"collectRealNodeBounds");function nm(t){const e=[],r=[];for(const n of t){const i=wJ(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(nm,"collectNodeRectEntries");function KRe(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,...Bb(i,s,a,o)})}return r}w(KRe,"collectLayoutNodeRects");function EJ(t,e,r=eo){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)?Ll(t.x,e.x,r.x,n.x)>i:!1}w(ZRe,"sameAxisSegmentsOverlap");function kL(t,e,r,n,{epsilon:i=eo,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+eo&&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(SL,"orthogonalizePolyline");function Pd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=JRe(e);if(e=n.points,!n.changed)break}return e}w(Pd,"simplifyPolyline");var Zr=.001,HHt=.5,wfe=4;function MJ(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=e9e(t[i],t[s],e);return r?[a,...t.slice(i)]:[...t.slice(0,i+1),a]}w(sq,"clipEndpoint");function t9e(t,e){for(const r of t){const n=MJ(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=sq(i,n.srcRect,!0)),n.dstRect&&(i=sq(i,n.dstRect,!1)),i=Pd(SL(i)),i=RJ(i,n.srcRect,n.dstRect),n.edge.points=Pd(SL(i))}}w(t9e,"clipEdgeEndpointsToNodeBoundaries");function aq(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(aq,"snapEndpointToBoundary");function EL(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(r9e,"intersectRanges");function lq(t,e){return e==="left"||e==="right"?AL(t.top,t.bottom):AL(t.left,t.right)}w(lq,"clearanceRangeForSide");function ML(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?r9e(s):void 0}w(n9e,"straightClearanceRange");function cq(t,e,r,n,i){const s=n9e(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(dq,"leavesOutward");function fq(t,e,r){if(t.length<3)return t;if(r){const s=hq(t[0],t[1],e);return s&&dq(s,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=hq(t[n-1],t[n],e);return i&&dq(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(fq,"collapseOwnBorderStub");function a9e(t,e,r){let n=t;if(e){const s=EL(n,0,1);if(s){const a=aq(s,n[0],e);a!==n[0]&&(n=[a,...n.slice(1)])}n=fq(n,e,!0)}if(r){const s=n.length-1,a=EL(n,s,-1);if(a){const o=aq(a,n[s],r,!0);o!==n[s]&&(n=[...n.slice(0,s),o])}n=fq(n,r,!1)}const i=RJ(n,e,r);return i!==n||n.length===2?i:(e&&(n=uq(n,e,!0)),r&&(n=uq(n,r,!1)),n)}w(a9e,"snapAndCollapseEndpoints");function pq(t,e){for(const r of t){const n=MJ(r,e,2);if(!n)continue;const i=Yn(n.points,Zr),s=a9e(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(pq,"prepareEdgeEndpointsForRenderer");function _J(t){return new Map(t.map(e=>[e.id,e]))}w(_J,"buildNodeMap");function o9e(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(o9e,"resolveTopLevelGroupId");function gq(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(gq,"groupDepth");function LJ(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(LJ,"boundsForChildren");function l9e(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(l9e,"applyGroupBounds");function c9e(t){const e=_J(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>gq(i,e)-gq(n,e));for(const n of r){const i=t.filter(a=>a.parentId===n.id),s=LJ(i);s&&l9e(n,s)}}w(c9e,"recomputeNestedGroupBounds");function RL(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(RL,"mirrorAxis");function u9e(t){return(t.nodes??[]).some(r=>!r.isGroup)?RL(t,"y"):!0}w(u9e,"applyBtDirectionTransform");function h9e(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}c9e(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&RL(t,"x"),!0;const g=_J(r),m=new Map;for(const N of r){if(N.isGroup)continue;const L=o9e(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=LJ(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&&kL(b,T,t,i,{epsilon:Gu,skipDegenerateOther:!0}),A=!k&&kL(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(d9e,"portSwapToLShape");function f9e(t,e){const{realNodeRects:s,labelNodeRects:a}=nm(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=mc(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?mc(B):void 0;if(H&&CJ(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(f9e,"collapseShortTerminalStub");var yr=.001,Ka=8,yn=k5,uF=w((t,e)=>On(t,e,yr)||Bn(t,e,yr),"orthogonallyAligned");function p9e(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?mc(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(uF(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)>=Ka&&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&&!uF(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&&!uF(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(p9e,"separateSharedRenderedTerminalLanes");function g9e(t,e){const{realNodeRects:n,labelNodeRects:i}=nm(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)>=Ka||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(g9e,"collapseRedundantRectangularDoglegs");function mq(t,e){const{realNodeRects:s,labelNodeRects:a}=nm(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?Ll(m.a.x,m.b.x,x.left,x.right)>=Ka&&m.a.y>=x.top-2&&m.a.y<=x.bottom+2:Ll(m.a.y,m.b.y,x.top,x.bottom)>=Ka&&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)>=Ka)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const 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(mq,"liftObstacleHuggingSameSideRails");function yq(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:Ll(l.a.x,l.b.x,u.left,u.right)>=Ka},"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(yq,"liftTopLaneTitleBandsAboveRails");function vq(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:Ll(u.a.y,u.b.y,h.top,h.bottom)>=Ka},"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:Ll(u.a.x,u.b.x,h.left,h.right)>=Ka},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=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(vq,"shiftLeftLaneTitleBandsLeftOfRails");function m9e(t,e){const{realNodeRects:n}=nm(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+Ic(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)>=Ka)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(m9e,"swapDestinationTerminalTailsToReduceCrossings");function y9e(t,e){const{realNodeRects:s,labelNodeRects:a}=nm(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+Ic(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?mc(k):void 0,R=E?mc(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&&Ll(T.min,T.max,C.min,C.max)>=Ka,"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=Ka)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(y9e,"reassignCrossingExternalRailChannels");function v9e(t,e){const{realNodeRects:n,labelNodeRects:i}=nm(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)&&Ll(p.a.x,p.b.x,g.left,g.right)>=Ka}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Ll(p.a.y,p.b.y,g.top,g.bottom)>=Ka}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?mc(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)>=Ka)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=Ic(C,yr),k=o(C);for(let E=0;E<=C.length-4;E++)for(const A of d(C,E)){const R=Ic(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(v9e,"shortcutRedundantOrthogonalJogs");function b9e(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=mc(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+Ic(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)>=Ka)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,SJ(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=kJ(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=z1(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=z1(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=z1(ge,Me);for(const le of u)we.push(...B(je,Me,z1(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)>=Ka))&&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:Ic(Me,yr),totalBends:Ic(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)>=Ka)),"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,Ic(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=Ic(g(le),yr);for(const Ce of K(le)){const ne=P(le,Ce),j=!ne&&_(le,Ce),J=S(he,le,Ce),ue=Ic(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(b9e,"resolveRenderedOrthogonalCrossings");var mp=.001,qHt=8;function x9e(t,e){const{nodeInfoById:r,realNodeRects:n}=XD(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=kJ(m,y,v,x,s,mp);return T&&b.push(T),y===x&&b.push(SJ(m,y,v,a[y])),b},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let x=0;const b=k5(m,mp),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 k5(A,mp)){if(AJ(R.a,R.b,_.a,_.b,mp,mp)){x++;continue}Ad(R,_,mp)>=qHt&&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=Ic(y,mp);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(x9e,"simplifyDetouredEdges");var Ql=.001,Tfe=10,M8=7;function bq(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&&CL(t,w9e(s)))}w(xq,"labelOverlapsOwnMarker");function QM(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=nq(m,s);for(const{nodeId:v,rect:x}of n)if(v!==g&&CL(y,x))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=nq(m,s);for(const v of r)if(v.edgeId!==g&&jD(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(XRe(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&CL(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=Ql&&W>=Ql||T.push({idx:V,length:G+W,orientation:G>=Ql?"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-Ql&&V.midX<=B.right+Ql&&V.midY>=B.top-Ql&&V.midY<=B.bottom+Ql,"pointInsideRectInclusive"),I=w(V=>{const B=Bb(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=Bb(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)+Ql{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&&!xq(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&&!xq(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(QM,"anchorLabelsToPolyline");var hF=1e-6,UHt=8,Cfe=UHt/2,YHt=3;function wq(t,e){return t{const h=wq(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||wq(g,m)===h&&f(p.labelNodeId)}return d>0?d+YHt:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const o=a.points;if(!TJ(o,hF))continue;const l=EJ(a,r,hF);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>Cfe?x:Cfe,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)&&!kL(S,k,t,a,{epsilon:hF})){a.points=[S,k];break}}}}w(T9e,"straightenCollinearSiblingDetours");function Tq(t,e){const{realNodeRects:l,labelNodeRects:u}=nm(e.values()),h=w((C,S)=>k5(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?Ll(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?Ll(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?mc(E):void 0,_=A?mc(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(Tq,"nudgeSharedInteriorSubpaths");function C9e(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(C9e,"segmentsIntersect");function k9e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=KRe(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(k9e,"validateSwimlanesLayout");function S9e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!h9e(t,e)||e==="BT"&&i.length>0&&!u9e(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Pd(SL(l)))}x9e(n,r),T9e(n,r),d9e(n,r);const s=new Map;for(const o of r)s.set(String(o.id),o);QM(n,s),t9e(n,s),f9e(n,s),Tq(n,s),p9e(n,s),g9e(n,s),mq(n,s),m9e(n,s);const a=w(()=>{b9e(n,s),y9e(n,s),v9e(n,s),QM(n,s),pq(n,s),mq(n,s),QM(n,s),pq(n,s)},"finalizeRenderedEdges");a(),Tq(n,s),a(),yq(n,s),vq(n,s),yq(n,s),vq(n,s)}w(S9e,"postProcessSwimlaneLayout");function im(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(im,"normalizeGraph");function IJ(t,e){return t.edges.filter(r=>r.dst===e)}w(IJ,"incoming");function E9e(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(E9e,"buildSuccessorMap");function NJ(t){const e=E9e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(NJ,"buildSortedSuccessorMap");function DJ(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(DJ,"buildInDegreeMap");function OJ(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(OJ,"sortedZeroInDegreeNodes");function KD(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(KD,"buildPredecessorSuccessorMaps");function PJ(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(PJ,"buildLayersFromRanks");function y7(t){const e=DJ(t),r=OJ(e),n=[],i=NJ(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(A9e,"removeCycles_DFS");function M9e(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(M9e,"buildTopLaneMap");function X0(t){const e=M9e(t);return r=>e.get(r)??null}w(X0,"createTopLaneResolver");function ZD(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(ZD,"buildTopLaneOrder");function BJ(t,e){const r=ZD(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(BJ,"resolveTopLaneOrder");var jHt={EPSILON:1e-6},_L={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},kfe={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function R9e(t,e){const r=im(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:s}=KD(r);for(const C of s.values())C.sort((S,k)=>S.localeCompare(k));const a=y7(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=_9e(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=L9e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=I9e(p),m=N9e(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(R9e,"buildDrivingTree");function _9e(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(_9e,"chooseParent");function L9e(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(L9e,"buildAdjacency");function I9e(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(I9e,"assignComponents");function N9e(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(D9e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||a(o,null);return i}w(N9e,"computeBlocks");function D9e(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(D9e,"popBlock");function O9e(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(O9e,"computeSubtreeCrossCounts");function P9e(t,e,r){const n=new Map,i=w(s=>{let a=r[s]??0;const o=[...e.get(s)??[]];o.sort(FJ(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(P9e,"annotateMinimumLayers");function FJ(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(FJ,"compareByRankThenId");function $9e(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($9e,"emitNodesInTreeOrder");function B9e(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(B9e,"deduplicateLayers");function F9e(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(F9e,"createChildOrderer");function LL(t,e,r){const n=R9e(t,{rankHint:e,laneOf:r}),{children:i,roots:s}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const a=O9e(t,e,n),o=[...s].sort(FJ(e)),l=P9e(o,i,e),u=F9e(i,e,a,l);let h=$9e(o,t.nodes,e,u);return h=B9e(h),h}w(LL,"buildMultitreeLayerOrder");function z9e(t,e,r){const n=new Set(t),i=new Set(e),s=S5(e),a=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&a.push(s.get(o.dst));return $J(a)}w(z9e,"countCrossingsBetweenAdjacent");function Cq(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=LL(t,r,i),y=Cq(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(H9e,"adjustCrossLaneSources");function G9e(t,e){const r=im(t),n=y7(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=IJ(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=V9e(r,a)),e!=null&&e.ignoreCrossLaneEdges&&H9e(r,a),{layers:LL(r,a,s),rankOf:a,dummy:new Set}}w(G9e,"assignLayers_LongestPath");function W9e(t,e){const r=im(t),i={...G9e(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}=KD(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=y7(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=_L.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:PJ(r,l,i),rankOf:i,dummy:new Set}}w(W9e,"assignLayers_Gravity");function q9e(t){const e=DJ(t),r=NJ(t);let n=OJ(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(q9e,"topoSortByGenerationIfAcyclic");function U9e(t,e){const r=im(t),n=(e==null?void 0:e.direction)==="LR"?q9e(r)??[...r.nodes].sort():y7(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=IJ(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:PJ(r,n,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}w(U9e,"assignLayers_LaneAwareCompact");function Y9e(t,e){const r=im(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(Y9e,"makeProperLayering");function kq(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(kq,"median");function Sq(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(Sq,"barycenter");function j9e(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(j9e,"neighborPositionsFor");function X9e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(X9e,"currentOrderTieBreak");function Eq(t,e,r){const n=new Set(t),i=new Set(e),s=S5(t),a=S5(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 $J(l)}w(Eq,"countCrossingsBetweenAdjacent");function JM(t,e,r){return[...t].sort((n,i)=>{const s=kq(e.get(n)??[]),a=kq(e.get(i)??[]);return s===a?X9e(n,i,r):isFinite(s)?isFinite(a)?s-a:-1:1})}w(JM,"sortByHeuristic");function Aq(t,e,r,n,i,s){const a=S5(t),o=S5(e),l=j9e(e,a,r,n);if(!i||!s||s.length===0)return JM(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=JM(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=JM(d,l,o);for(const p of f){const g=Sq(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const x=Sq(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=Eq(t,m,u);return h&&n&&(y+=Eq(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=BJ(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=Aq(n[l+1],n[l],i,"up",s,a),n[l]=Mq(n[l+1],n[l],i,n[l-1],s)}return{layers:n}}w(K9e,"orderLayers");function Z9e(t,e,r){const n=(r==null?void 0:r.layerGap)??kfe.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??kfe.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=BJ(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(Z9e,"assignCoordinates");var Q9e=8;function J9e(t){let e=2166136261;for(let r=0;r>>0}w(J9e,"hashString");function e_e(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(e_e,"mulberry32");function t_e(t,e){const r=[...t],n=e_e(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(t_e,"deterministicShuffle");function r_e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(r_e,"sourceDistance");function Rq(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(Rq,"laneArrangementCost");function n_e(t){const e=ZD(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(n_e,"buildWeightedLaneEdges");function _q(t,e,r){const n=[...t];let i=Rq(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 J9e(`${t.join("|")}#${n}#${r}`)}w(s_e,"seedForRestart");function a_e(t,e={}){const r=ZD(t);if(r.length<2)return r;const n=n_e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let s=_q(r,n,i);const a=Math.max(0,e.restarts??Q9e);for(let o=0;oCn&&l*3>=o?a>0?"bottom":"top":o>Cn?s>0?"right":"left":r}w(Lq,"chooseOrthogonalSide");function Iq(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=XHt;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,Lq(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.minYLq(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+Om:Br.minX-Om,y:Pt?Br.maxY+Xv:Br.minY-Xv,leavesPositiveSide:Pt}}const kt=ht.x>(vt.x??0),bt=(Kt.y??0)>=ht.y;return{x:kt?Br.maxX+Om:Br.minX-Om,y:bt?Br.maxY+Xv:Br.minY-Xv,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=Om,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-R8),St=Math.max(St,ht.maxX+R8),At=Math.min(At,ht.minY-R8),lt=Math.max(lt,ht.maxY+R8))}for(const ht of h){if(ht.maxXSt||ht.maxYlt)continue;const vt=Om;d("horizontal",ht.minY-vt,Le,St),d("horizontal",ht.maxY+vt,Le,St);const Kt=Xv;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||Io<-10&&Fh>5)&&(mi=Math.abs(Fh)*100),(An>10&&Vu<-5||An<-10&&Vu>5)&&(mi+=Math.abs(Vu)*50);let vm=0;const bm=Rt.get(ht.key)??"n",xm=Math.abs(Vu)>Cn?"h":"v";bm!=="n"&&bm!==xm&&(vm=50);const ma=gs+mn+mi+vm,Ul=(Tt.get(ht.key)??1/0)+ma,oo=Math.abs(ee.x-pt.x)+Math.abs(ee.y-pt.y);if(Ul<(Tt.get(En)??1/0))if(yt.set(En,ht.pt),Tt.set(En,Ul),Rt.set(En,xm),!Or.has(En))Ee.push({key:En,f:Ul+oo,pt}),Or.add(En);else{const Js=Ee.findIndex(kc=>kc.key===En);Js!==-1&&(Ee[Js].f=Ul+oo)}}}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 Io=An+mi.visualXHalfExtent+ai;mn=Math.max(mn,Io)}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=Om;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),Io=Be!==vt.y?gt(gs,vt):!1;return!mn&&!mi&&!An&&!Io?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*dF);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*dF*.5)}Re++}let Xe=0;for(const Ne of X)Xe++,ee(Ne,le.coord+Xe*dF)}}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(Km(Xe,qe)),ze&&Ke.orient===Xe.orient)if(Math.abs(Xe.coord-Ke.coord)>Cn){const st=Xe.orient==="vertical"?(qe+Ke.from)/2:Iq(Xe,Ke);ne.push(Km(Xe,st),Km(Ke,st))}else(Re===0||Re===fe.length-2)&&ne.push(Km(Xe,Iq(Xe,Ke)));else if(ze)ne.push(Km(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(l_e,"routeEdgesOrthogonal");function c_e(t){return t.direction??"TB"}w(c_e,"getSwimlaneDirection");function u_e(t){var h,d,f,p,g;const e=URe(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=c_e(t),{ordered:l,coordinates:u}=o_e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:s,automaticLaneOrdering:a,direction:o});YRe(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;l_e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return S9e(t,o),k9e(t),o}w(u_e,"runSwimlaneLayoutCore");async function h_e(t,e){const r=e.select("g");LZ(r,t.markers,t.type,t.diagramId),JSe(),t6e(),Ike(),cRe(),qRe(t);const n=jRe(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await LRe(r,t);u_e(t),await HRe(t,i)}w(h_e,"render");const KHt=Object.freeze(Object.defineProperty({__proto__:null,render:h_e},Symbol.toStringTag,{value:"Module"}));function Nq(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 d_e(t,e,r){return(e=f_e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eGt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tGt(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 rGt(){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 nGt(){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 ZHt(t)||tGt(t,e)||zJ(t,e)||rGt()}function IL(t){return QHt(t)||eGt(t)||zJ(t)||nGt()}function iGt(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 f_e(t){var e=iGt(t,"string");return typeof e=="symbol"?e:e+""}function Ia(t){"@babel/helpers - typeof";return Ia=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},Ia(t)}function zJ(t,e){if(t){if(typeof t=="string")return Nq(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)?Nq(t,e):void 0}}var wa=typeof window>"u"?null:window,Sfe=wa?wa.navigator:null;wa&&wa.document;var sGt=Ia(""),p_e=Ia({}),aGt=Ia(function(){}),oGt=typeof HTMLElement>"u"?"undefined":Ia(HTMLElement),v7=function(e){return e&&e.instanceString&&Ts(e.instanceString)?e.instanceString():null},Dr=function(e){return e!=null&&Ia(e)==sGt},Ts=function(e){return e!=null&&Ia(e)===aGt},Ei=function(e){return!Vc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},jn=function(e){return e!=null&&Ia(e)===p_e&&!Ei(e)&&e.constructor===Object},lGt=function(e){return e!=null&&Ia(e)===p_e},Qt=function(e){return e!=null&&Ia(e)===Ia(1)&&!isNaN(e)},g_e=function(e){return Qt(e)&&Math.floor(e)===e},NL=function(e){if(oGt!=="undefined")return e!=null&&e instanceof HTMLElement},Vc=function(e){return b7(e)||m_e(e)},b7=function(e){return v7(e)==="collection"&&e._private.single},m_e=function(e){return v7(e)==="collection"&&!e._private.single},VJ=function(e){return v7(e)==="core"},y_e=function(e){return v7(e)==="stylesheet"},cGt=function(e){return v7(e)==="event"},Rg=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},uGt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},hGt=function(e){return jn(e)&&Qt(e.x1)&&Qt(e.x2)&&Qt(e.y1)&&Qt(e.y2)},dGt=function(e){return lGt(e)&&Ts(e.then)},fGt=function(){return Sfe&&Sfe.userAgent.match(/msie|trident|edge/i)},E5=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},xGt=function(e,r){return-1*b_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("^"+mGt+"$").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},CGt=function(e){var r,n=new RegExp("^"+pGt+"$").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},kGt=function(e){return SGt[e.toLowerCase()]},x_e=function(e){return(Ei(e)?e:null)||kGt(e)||wGt(e)||CGt(e)||TGt(e)},SGt={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]},w_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 EF=a,EF}var OGt=DGt(),C7=x7(OGt),AF=wa?wa.performance:null,k_e=AF&&AF.now?function(){return AF.now()}:function(){return Date.now()},PGt=(function(){if(wa){if(wa.requestAnimationFrame)return function(t){wa.requestAnimationFrame(t)};if(wa.mozRequestAnimationFrame)return function(t){wa.mozRequestAnimationFrame(t)};if(wa.webkitRequestAnimationFrame)return function(t){wa.webkitRequestAnimationFrame(t)};if(wa.msRequestAnimationFrame)return function(t){wa.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(k_e())},1e3/60)}})(),DL=function(e){return PGt(e)},k0=k_e,f1=9261,S_e=65599,M2=5381,E_e=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f1,n=r,i;i=e.next(),!i.done;)n=n*S_e+i.value|0;return n},W6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f1;return r*S_e+e|0},q6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M2;return(r<<5)+r+e|0},$Gt=function(e,r){return e*2097152+r},yp=function(e){return e[0]*2097152+e[1]},L8=function(e,r){return[W6(e[0],r[0]),q6(e[1],r[1])]},Vfe=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)},UJ=function(e){e.splice(0,e.length)},YGt=function(e,r){for(var n=0;n"u"?"undefined":Ia(Set))!==XGt?Set:KGt,eO=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!VJ(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 C3,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)}}}},nWt={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=hWt(s,e,r),n--}return r},dWt={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/uWt);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},N_e=function(e,r){return r===0?e:N_e(r,e%r)},vWt=function(e){for(var r=e[0],n=0;n0&&(r=N_e(r,e[n]));else return 0;return r},bWt=function(e){return Math.PI*e/180},I8=function(e,r){return Math.atan2(r,e)-Math.PI/2},YJ=Math.log2||function(t){return Math.log(t)/Math.log(2)},jJ=function(e){return e>0?1:e<0?-1:0},Ny=function(e,r){return Math.sqrt(Zm(e,r))},Zm=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},xWt=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}},CWt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},kWt=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},D_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},tR=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},rR=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},Yfe=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},XJ=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},jp=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},jfe=function(e,r){return jp(e,r.x,r.y)},O_e=function(e,r){return jp(e,r.x1,r.y1)&&jp(e,r.x2,r.y2)},SWt=(_F=Math.hypot)!==null&&_F!==void 0?_F:function(t,e){return Math.sqrt(t*t+e*e)};function EWt(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=SWt(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"?Lg(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=Xp(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=Xp(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=Xp(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=Xp(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=dk(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=dk(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=dk(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=dk(e,r,n,i,B,H,u+o),I.length>0&&I[0]<=B&&I[1]>=H)return[I[0],I[1]]}return[]},MWt=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},RWt=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)},_Wt=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]},LWt=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)},IWt=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=[];LWt(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},oc=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=$L(h,-u);m=PL(y)}else m=h;return oc(e,r,m)},DWt=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]},LF=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Xp=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?LF(e,n,o)===o?[o,l]:LF(e,n,s)===s?[s,a]:LF(s,o,n)===n?[n,i]:[]:[]},PWt=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=$L(d,-l);p=PL(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},ZWt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:eqt,o=i,l,u,h=0;h=2?gC(e,r,n,0,Jfe,tqt):gC(e,r,n,0,Qfe)},squaredEuclidean:function(e,r,n){return gC(e,r,n,0,Jfe)},manhattan:function(e,r,n){return gC(e,r,n,0,Qfe)},max:function(e,r,n){return gC(e,r,n,-1/0,rqt)}};A5["squared-euclidean"]=A5.squaredEuclidean;A5.squaredeuclidean=A5.squaredEuclidean;function rO(t,e,r,n,i,s){var a;return Ts(t)?a=t:a=A5[t]||A5.euclidean,e===0&&Ts(t)?a(i,s):a(e,r,n,i,s)}var nqt=Ro({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ZJ=function(e){return nqt(e)},BL=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 rO(e,i.length,o,l,u,h)},NF=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},aqt=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},s0e=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=s0e(e,r,n),i},a0e=function(e){for(var r=this.cy(),n=this.nodes(),i=vqt(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}},D8=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}},Eqt={hopcroftTarjanBiconnected:D8,htbc:D8,htb:D8,hopcroftTarjanBiconnectedComponents:D8},O8=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:O8,tsc:O8,tscc:O8,tarjanStronglyConnectedComponents:O8},G_e={};[U6,rWt,nWt,sWt,oWt,cWt,dWt,zWt,zb,Vb,Pq,JWt,dqt,mqt,Cqt,Sqt,Eqt,Aqt].forEach(function(t){Gr(G_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 LRe(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),h3t(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(C5(b.id,e)),hn.set(b.id,{id:C5(b.id,e),node:b})):(de.trace("Node - the non recursive path XAX",x,d,e.node(x),a),await o7(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 y_(h,T),T.id=C;return}await y_(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"),RRe(e),de.info("Graph after layout:",JSON.stringify(o0(e)));let g=0,{subGraphTitleTotalMargin:m}=c3(s);await Promise.all(qzt(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,m_(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 cD(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),m_(b)}}));const y=m/2;return _Re(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=_Z(u,x,hn,r,C,S,n);n6e(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"),BHt=w(async(t,e)=>{var s,a,o,l,u,h;const r=new Uo({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");LZ(n,t.markers,t.type,t.diagramId),e6e(),r6e(),Nke(),uRe(),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))),Wzt(r),de.warn("Graph after XAX:",JSON.stringify(o0(r)));const i=Ve();await LRe(n,r,t.type,t.diagramId,void 0,i)},"render");const FHt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:_Re,render:BHt},Symbol.toStringTag,{value:"Module"}));async function IRe(t,e){const r=new Uo({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 o7(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(()=>V4r);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(IRe,"createGraphWithElements");var xfe=5,S8=1e-5,E8=1e-6;function TL(t){const e=[];for(let r=0;r=1-E8||f<=E8||f>=1-E8?null:{point:{x:t.x+d*i,y:t.y+d*s},tA:d,tB:f}}w(NRe,"segmentIntersection");function eq(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(eq,"isHorizontalSeg");function DRe(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(ORe,"getArcSweepFlag");var zHt=.001;function PRe(t,e){if(t.length<2)return t.map(s=>({...s}));const r=t.map(s=>({...s})),n=e.arrowTypeStart&&Pa[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&&Pa[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(PRe,"applyMarkerOffsets");function $Re(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${$b(o)}`];return i==="arc"?u.push(`A${sh(t.r)},${sh(t.r)} 0 0 ${n} ${$b(l)}`):u.push(`M${$b(l)}`),u}w($Re,"emitJump");function tq(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=tq(i[u-1],i[u],i[u+1]??i[u],xfe);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(VRe,"decodeDataPoints");function HRe(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=VRe(d.getAttribute("data-points"))??u.points;s.push({...u,points:p})}const o=DRe(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&&!zRe(f))continue;const p=a.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!FRe(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=BRe(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(HRe,"applyLineJumpsToSvg");async function GRe(t,e){var i,s;for(const a of t.nodes)a.isGroup?await cD(e.clusters,a):m_(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=_Z(e.edgePaths,{...a},{},t.type,o,l,t.diagramId);a.label&&await y_(e.rootGroups,a),a.label&&WRe(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}));HRe(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:a})}}w(GRe,"adjustLayout");function WRe(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=br(),{subGraphTitleTotalMargin:i}=c3({flowchart:n.flowchart??{}});if(t.label){const s=E6.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(WRe,"positionEdgeLabel");var cF="__swimlane_default__",VHt=21,wfe=20;function rq(t){return Math.max(t.padding??wfe,wfe)}w(rq,"topLaneHorizontalPadding");function qRe(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(VHt,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(qRe,"assignTopLaneTitleRect");function URe(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===cF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:cF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const s of n)s.parentId=cF}w(URe,"prepareLayoutForSwimlanes");function YRe(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(YRe,"toGraphView");function jRe(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*rq(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*rq(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:Bb(e,r,n,i)}:void 0}w(xJ,"measuredNodeRect");function wJ(t){if(t.isGroup)return;const e=xJ(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(wJ,"nodeBoundsInfoFor");function Nu(t,e,r=eo){return Math.abs(t.x-e.x)r}w(Is,"isHorizontalSegment");function Ns(t,e,r=eo){return On(t,e,r)&&Math.abs(t.y-e.y)>r}w(Ns,"isVerticalSegment");function Ll(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(Ll,"overlapLength");function Ad(t,e,r=eo){return t.horizontal&&e.horizontal&&Bn(t.a,e.a,r)?Ll(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&On(t.a,e.a,r)?Ll(t.a.y,t.b.y,e.a.y,e.b.y):0}w(Ad,"sameAxisSegmentOverlapLength");function k5(t,e=eo){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 TJ(t,e=eo){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(TJ,"classifyThreeSegmentRoute");function jD(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(KRe,"rectContainsRect");function CL(t,e){return t.lefte.left&&t.tope.top}w(CL,"rectsOverlap");function nq(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(nq,"inflateRect");function Bb(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w(Bb,"rectFromCenterSize");function mc(t){var e;return(e=xJ(t))==null?void 0:e.rect}w(mc,"rectOfNodeBounds");function z1(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(z1,"portForRectSide");function kJ(t,e,r,n,i,s=eo){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(kJ,"buildOrthogonalPortPath");function SJ(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(SJ,"buildSameSideTrackPath");function XD(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=wJ(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(XD,"collectRealNodeBounds");function nm(t){const e=[],r=[];for(const n of t){const i=wJ(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(nm,"collectNodeRectEntries");function ZRe(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,...Bb(i,s,a,o)})}return r}w(ZRe,"collectLayoutNodeRects");function EJ(t,e,r=eo){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)?Ll(t.x,e.x,r.x,n.x)>i:!1}w(QRe,"sameAxisSegmentsOverlap");function kL(t,e,r,n,{epsilon:i=eo,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+eo&&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(SL,"orthogonalizePolyline");function Pd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=e9e(e);if(e=n.points,!n.changed)break}return e}w(Pd,"simplifyPolyline");var Zr=.001,GHt=.5,Tfe=4;function MJ(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=t9e(t[i],t[s],e);return r?[a,...t.slice(i)]:[...t.slice(0,i+1),a]}w(sq,"clipEndpoint");function r9e(t,e){for(const r of t){const n=MJ(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=sq(i,n.srcRect,!0)),n.dstRect&&(i=sq(i,n.dstRect,!1)),i=Pd(SL(i)),i=RJ(i,n.srcRect,n.dstRect),n.edge.points=Pd(SL(i))}}w(r9e,"clipEdgeEndpointsToNodeBoundaries");function aq(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(aq,"snapEndpointToBoundary");function EL(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(n9e,"intersectRanges");function lq(t,e){return e==="left"||e==="right"?AL(t.top,t.bottom):AL(t.left,t.right)}w(lq,"clearanceRangeForSide");function ML(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?n9e(s):void 0}w(i9e,"straightClearanceRange");function cq(t,e,r,n,i){const s=i9e(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(dq,"leavesOutward");function fq(t,e,r){if(t.length<3)return t;if(r){const s=hq(t[0],t[1],e);return s&&dq(s,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=hq(t[n-1],t[n],e);return i&&dq(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(fq,"collapseOwnBorderStub");function o9e(t,e,r){let n=t;if(e){const s=EL(n,0,1);if(s){const a=aq(s,n[0],e);a!==n[0]&&(n=[a,...n.slice(1)])}n=fq(n,e,!0)}if(r){const s=n.length-1,a=EL(n,s,-1);if(a){const o=aq(a,n[s],r,!0);o!==n[s]&&(n=[...n.slice(0,s),o])}n=fq(n,r,!1)}const i=RJ(n,e,r);return i!==n||n.length===2?i:(e&&(n=uq(n,e,!0)),r&&(n=uq(n,r,!1)),n)}w(o9e,"snapAndCollapseEndpoints");function pq(t,e){for(const r of t){const n=MJ(r,e,2);if(!n)continue;const i=Yn(n.points,Zr),s=o9e(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(pq,"prepareEdgeEndpointsForRenderer");function _J(t){return new Map(t.map(e=>[e.id,e]))}w(_J,"buildNodeMap");function l9e(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(l9e,"resolveTopLevelGroupId");function gq(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(gq,"groupDepth");function LJ(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(LJ,"boundsForChildren");function c9e(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(c9e,"applyGroupBounds");function u9e(t){const e=_J(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>gq(i,e)-gq(n,e));for(const n of r){const i=t.filter(a=>a.parentId===n.id),s=LJ(i);s&&c9e(n,s)}}w(u9e,"recomputeNestedGroupBounds");function RL(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(RL,"mirrorAxis");function h9e(t){return(t.nodes??[]).some(r=>!r.isGroup)?RL(t,"y"):!0}w(h9e,"applyBtDirectionTransform");function d9e(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}u9e(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&RL(t,"x"),!0;const g=_J(r),m=new Map;for(const N of r){if(N.isGroup)continue;const L=l9e(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=LJ(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&&kL(b,T,t,i,{epsilon:Gu,skipDegenerateOther:!0}),A=!k&&kL(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(f9e,"portSwapToLShape");function p9e(t,e){const{realNodeRects:s,labelNodeRects:a}=nm(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=mc(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?mc(B):void 0;if(H&&CJ(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(p9e,"collapseShortTerminalStub");var yr=.001,Ka=8,yn=k5,uF=w((t,e)=>On(t,e,yr)||Bn(t,e,yr),"orthogonallyAligned");function g9e(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?mc(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(uF(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)>=Ka&&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&&!uF(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&&!uF(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(g9e,"separateSharedRenderedTerminalLanes");function m9e(t,e){const{realNodeRects:n,labelNodeRects:i}=nm(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)>=Ka||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(m9e,"collapseRedundantRectangularDoglegs");function mq(t,e){const{realNodeRects:s,labelNodeRects:a}=nm(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?Ll(m.a.x,m.b.x,x.left,x.right)>=Ka&&m.a.y>=x.top-2&&m.a.y<=x.bottom+2:Ll(m.a.y,m.b.y,x.top,x.bottom)>=Ka&&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)>=Ka)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const 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(mq,"liftObstacleHuggingSameSideRails");function yq(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:Ll(l.a.x,l.b.x,u.left,u.right)>=Ka},"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(yq,"liftTopLaneTitleBandsAboveRails");function vq(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:Ll(u.a.y,u.b.y,h.top,h.bottom)>=Ka},"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:Ll(u.a.x,u.b.x,h.left,h.right)>=Ka},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=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(vq,"shiftLeftLaneTitleBandsLeftOfRails");function y9e(t,e){const{realNodeRects:n}=nm(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+Ic(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)>=Ka)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(y9e,"swapDestinationTerminalTailsToReduceCrossings");function v9e(t,e){const{realNodeRects:s,labelNodeRects:a}=nm(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+Ic(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?mc(k):void 0,R=E?mc(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&&Ll(T.min,T.max,C.min,C.max)>=Ka,"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=Ka)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(v9e,"reassignCrossingExternalRailChannels");function b9e(t,e){const{realNodeRects:n,labelNodeRects:i}=nm(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)&&Ll(p.a.x,p.b.x,g.left,g.right)>=Ka}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Ll(p.a.y,p.b.y,g.top,g.bottom)>=Ka}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?mc(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)>=Ka)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=Ic(C,yr),k=o(C);for(let E=0;E<=C.length-4;E++)for(const A of d(C,E)){const R=Ic(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(b9e,"shortcutRedundantOrthogonalJogs");function x9e(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=mc(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+Ic(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)>=Ka)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,SJ(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=kJ(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=z1(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=z1(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=z1(ge,Me);for(const le of u)we.push(...B(je,Me,z1(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)>=Ka))&&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:Ic(Me,yr),totalBends:Ic(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)>=Ka)),"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,Ic(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=Ic(g(le),yr);for(const Ce of K(le)){const ne=P(le,Ce),j=!ne&&_(le,Ce),J=S(he,le,Ce),ue=Ic(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(x9e,"resolveRenderedOrthogonalCrossings");var mp=.001,UHt=8;function w9e(t,e){const{nodeInfoById:r,realNodeRects:n}=XD(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=kJ(m,y,v,x,s,mp);return T&&b.push(T),y===x&&b.push(SJ(m,y,v,a[y])),b},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let x=0;const b=k5(m,mp),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 k5(A,mp)){if(AJ(R.a,R.b,_.a,_.b,mp,mp)){x++;continue}Ad(R,_,mp)>=UHt&&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=Ic(y,mp);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(w9e,"simplifyDetouredEdges");var Ql=.001,Cfe=10,M8=7;function bq(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&&CL(t,T9e(s)))}w(xq,"labelOverlapsOwnMarker");function QM(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=nq(m,s);for(const{nodeId:v,rect:x}of n)if(v!==g&&CL(y,x))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=nq(m,s);for(const v of r)if(v.edgeId!==g&&jD(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(KRe(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&CL(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=Ql&&W>=Ql||T.push({idx:V,length:G+W,orientation:G>=Ql?"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-Ql&&V.midX<=B.right+Ql&&V.midY>=B.top-Ql&&V.midY<=B.bottom+Ql,"pointInsideRectInclusive"),I=w(V=>{const B=Bb(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=Bb(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)+Ql{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&&!xq(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&&!xq(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(QM,"anchorLabelsToPolyline");var hF=1e-6,YHt=8,kfe=YHt/2,jHt=3;function wq(t,e){return t{const h=wq(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||wq(g,m)===h&&f(p.labelNodeId)}return d>0?d+jHt:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const o=a.points;if(!TJ(o,hF))continue;const l=EJ(a,r,hF);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>kfe?x:kfe,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)&&!kL(S,k,t,a,{epsilon:hF})){a.points=[S,k];break}}}}w(C9e,"straightenCollinearSiblingDetours");function Tq(t,e){const{realNodeRects:l,labelNodeRects:u}=nm(e.values()),h=w((C,S)=>k5(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?Ll(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?Ll(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?mc(E):void 0,_=A?mc(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(Tq,"nudgeSharedInteriorSubpaths");function k9e(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(k9e,"segmentsIntersect");function S9e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=ZRe(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(S9e,"validateSwimlanesLayout");function E9e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!d9e(t,e)||e==="BT"&&i.length>0&&!h9e(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Pd(SL(l)))}w9e(n,r),C9e(n,r),f9e(n,r);const s=new Map;for(const o of r)s.set(String(o.id),o);QM(n,s),r9e(n,s),p9e(n,s),Tq(n,s),g9e(n,s),m9e(n,s),mq(n,s),y9e(n,s);const a=w(()=>{x9e(n,s),v9e(n,s),b9e(n,s),QM(n,s),pq(n,s),mq(n,s),QM(n,s),pq(n,s)},"finalizeRenderedEdges");a(),Tq(n,s),a(),yq(n,s),vq(n,s),yq(n,s),vq(n,s)}w(E9e,"postProcessSwimlaneLayout");function im(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(im,"normalizeGraph");function IJ(t,e){return t.edges.filter(r=>r.dst===e)}w(IJ,"incoming");function A9e(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(A9e,"buildSuccessorMap");function NJ(t){const e=A9e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(NJ,"buildSortedSuccessorMap");function DJ(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(DJ,"buildInDegreeMap");function OJ(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(OJ,"sortedZeroInDegreeNodes");function KD(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(KD,"buildPredecessorSuccessorMaps");function PJ(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(PJ,"buildLayersFromRanks");function y7(t){const e=DJ(t),r=OJ(e),n=[],i=NJ(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(M9e,"removeCycles_DFS");function R9e(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(R9e,"buildTopLaneMap");function X0(t){const e=R9e(t);return r=>e.get(r)??null}w(X0,"createTopLaneResolver");function ZD(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(ZD,"buildTopLaneOrder");function BJ(t,e){const r=ZD(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(BJ,"resolveTopLaneOrder");var XHt={EPSILON:1e-6},_L={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Sfe={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function _9e(t,e){const r=im(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:s}=KD(r);for(const C of s.values())C.sort((S,k)=>S.localeCompare(k));const a=y7(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=L9e(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=I9e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=N9e(p),m=D9e(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(_9e,"buildDrivingTree");function L9e(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(L9e,"chooseParent");function I9e(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(I9e,"buildAdjacency");function N9e(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(N9e,"assignComponents");function D9e(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(O9e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||a(o,null);return i}w(D9e,"computeBlocks");function O9e(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(O9e,"popBlock");function P9e(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(P9e,"computeSubtreeCrossCounts");function $9e(t,e,r){const n=new Map,i=w(s=>{let a=r[s]??0;const o=[...e.get(s)??[]];o.sort(FJ(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($9e,"annotateMinimumLayers");function FJ(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(FJ,"compareByRankThenId");function B9e(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(B9e,"emitNodesInTreeOrder");function F9e(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(F9e,"deduplicateLayers");function z9e(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(z9e,"createChildOrderer");function LL(t,e,r){const n=_9e(t,{rankHint:e,laneOf:r}),{children:i,roots:s}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const a=P9e(t,e,n),o=[...s].sort(FJ(e)),l=$9e(o,i,e),u=z9e(i,e,a,l);let h=B9e(o,t.nodes,e,u);return h=F9e(h),h}w(LL,"buildMultitreeLayerOrder");function V9e(t,e,r){const n=new Set(t),i=new Set(e),s=S5(e),a=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&a.push(s.get(o.dst));return $J(a)}w(V9e,"countCrossingsBetweenAdjacent");function Cq(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=LL(t,r,i),y=Cq(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(G9e,"adjustCrossLaneSources");function W9e(t,e){const r=im(t),n=y7(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=IJ(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=H9e(r,a)),e!=null&&e.ignoreCrossLaneEdges&&G9e(r,a),{layers:LL(r,a,s),rankOf:a,dummy:new Set}}w(W9e,"assignLayers_LongestPath");function q9e(t,e){const r=im(t),i={...W9e(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}=KD(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=y7(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=_L.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:PJ(r,l,i),rankOf:i,dummy:new Set}}w(q9e,"assignLayers_Gravity");function U9e(t){const e=DJ(t),r=NJ(t);let n=OJ(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(U9e,"topoSortByGenerationIfAcyclic");function Y9e(t,e){const r=im(t),n=(e==null?void 0:e.direction)==="LR"?U9e(r)??[...r.nodes].sort():y7(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=IJ(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:PJ(r,n,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}w(Y9e,"assignLayers_LaneAwareCompact");function j9e(t,e){const r=im(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(j9e,"makeProperLayering");function kq(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(kq,"median");function Sq(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(Sq,"barycenter");function X9e(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(X9e,"neighborPositionsFor");function K9e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(K9e,"currentOrderTieBreak");function Eq(t,e,r){const n=new Set(t),i=new Set(e),s=S5(t),a=S5(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 $J(l)}w(Eq,"countCrossingsBetweenAdjacent");function JM(t,e,r){return[...t].sort((n,i)=>{const s=kq(e.get(n)??[]),a=kq(e.get(i)??[]);return s===a?K9e(n,i,r):isFinite(s)?isFinite(a)?s-a:-1:1})}w(JM,"sortByHeuristic");function Aq(t,e,r,n,i,s){const a=S5(t),o=S5(e),l=X9e(e,a,r,n);if(!i||!s||s.length===0)return JM(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=JM(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=JM(d,l,o);for(const p of f){const g=Sq(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const x=Sq(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=Eq(t,m,u);return h&&n&&(y+=Eq(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=BJ(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=Aq(n[l+1],n[l],i,"up",s,a),n[l]=Mq(n[l+1],n[l],i,n[l-1],s)}return{layers:n}}w(Z9e,"orderLayers");function Q9e(t,e,r){const n=(r==null?void 0:r.layerGap)??Sfe.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??Sfe.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=BJ(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(Q9e,"assignCoordinates");var J9e=8;function e_e(t){let e=2166136261;for(let r=0;r>>0}w(e_e,"hashString");function t_e(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(t_e,"mulberry32");function r_e(t,e){const r=[...t],n=t_e(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(r_e,"deterministicShuffle");function n_e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(n_e,"sourceDistance");function Rq(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(Rq,"laneArrangementCost");function i_e(t){const e=ZD(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(i_e,"buildWeightedLaneEdges");function _q(t,e,r){const n=[...t];let i=Rq(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 e_e(`${t.join("|")}#${n}#${r}`)}w(a_e,"seedForRestart");function o_e(t,e={}){const r=ZD(t);if(r.length<2)return r;const n=i_e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let s=_q(r,n,i);const a=Math.max(0,e.restarts??J9e);for(let o=0;oCn&&l*3>=o?a>0?"bottom":"top":o>Cn?s>0?"right":"left":r}w(Lq,"chooseOrthogonalSide");function Iq(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=KHt;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,Lq(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.minYLq(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+Om:Br.minX-Om,y:Pt?Br.maxY+Xv:Br.minY-Xv,leavesPositiveSide:Pt}}const kt=ht.x>(vt.x??0),bt=(Kt.y??0)>=ht.y;return{x:kt?Br.maxX+Om:Br.minX-Om,y:bt?Br.maxY+Xv:Br.minY-Xv,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=Om,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-R8),St=Math.max(St,ht.maxX+R8),At=Math.min(At,ht.minY-R8),lt=Math.max(lt,ht.maxY+R8))}for(const ht of h){if(ht.maxXSt||ht.maxYlt)continue;const vt=Om;d("horizontal",ht.minY-vt,Le,St),d("horizontal",ht.maxY+vt,Le,St);const Kt=Xv;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||Io<-10&&Fh>5)&&(mi=Math.abs(Fh)*100),(An>10&&Vu<-5||An<-10&&Vu>5)&&(mi+=Math.abs(Vu)*50);let vm=0;const bm=Rt.get(ht.key)??"n",xm=Math.abs(Vu)>Cn?"h":"v";bm!=="n"&&bm!==xm&&(vm=50);const ma=gs+mn+mi+vm,Ul=(Tt.get(ht.key)??1/0)+ma,oo=Math.abs(ee.x-pt.x)+Math.abs(ee.y-pt.y);if(Ul<(Tt.get(En)??1/0))if(yt.set(En,ht.pt),Tt.set(En,Ul),Rt.set(En,xm),!Or.has(En))Ee.push({key:En,f:Ul+oo,pt}),Or.add(En);else{const Js=Ee.findIndex(kc=>kc.key===En);Js!==-1&&(Ee[Js].f=Ul+oo)}}}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 Io=An+mi.visualXHalfExtent+ai;mn=Math.max(mn,Io)}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=Om;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),Io=Be!==vt.y?gt(gs,vt):!1;return!mn&&!mi&&!An&&!Io?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*dF);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*dF*.5)}Re++}let Xe=0;for(const Ne of X)Xe++,ee(Ne,le.coord+Xe*dF)}}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(Km(Xe,qe)),ze&&Ke.orient===Xe.orient)if(Math.abs(Xe.coord-Ke.coord)>Cn){const st=Xe.orient==="vertical"?(qe+Ke.from)/2:Iq(Xe,Ke);ne.push(Km(Xe,st),Km(Ke,st))}else(Re===0||Re===fe.length-2)&&ne.push(Km(Xe,Iq(Xe,Ke)));else if(ze)ne.push(Km(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(c_e,"routeEdgesOrthogonal");function u_e(t){return t.direction??"TB"}w(u_e,"getSwimlaneDirection");function h_e(t){var h,d,f,p,g;const e=YRe(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=u_e(t),{ordered:l,coordinates:u}=l_e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:s,automaticLaneOrdering:a,direction:o});jRe(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;c_e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return E9e(t,o),S9e(t),o}w(h_e,"runSwimlaneLayoutCore");async function d_e(t,e){const r=e.select("g");LZ(r,t.markers,t.type,t.diagramId),e6e(),r6e(),Nke(),uRe(),URe(t);const n=XRe(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await IRe(r,t);h_e(t),await GRe(t,i)}w(d_e,"render");const ZHt=Object.freeze(Object.defineProperty({__proto__:null,render:d_e},Symbol.toStringTag,{value:"Module"}));function Nq(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 f_e(t,e,r){return(e=p_e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tGt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rGt(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 nGt(){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 iGt(){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 QHt(t)||rGt(t,e)||zJ(t,e)||nGt()}function IL(t){return JHt(t)||tGt(t)||zJ(t)||iGt()}function sGt(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 p_e(t){var e=sGt(t,"string");return typeof e=="symbol"?e:e+""}function Ia(t){"@babel/helpers - typeof";return Ia=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},Ia(t)}function zJ(t,e){if(t){if(typeof t=="string")return Nq(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)?Nq(t,e):void 0}}var wa=typeof window>"u"?null:window,Efe=wa?wa.navigator:null;wa&&wa.document;var aGt=Ia(""),g_e=Ia({}),oGt=Ia(function(){}),lGt=typeof HTMLElement>"u"?"undefined":Ia(HTMLElement),v7=function(e){return e&&e.instanceString&&Ts(e.instanceString)?e.instanceString():null},Dr=function(e){return e!=null&&Ia(e)==aGt},Ts=function(e){return e!=null&&Ia(e)===oGt},Ei=function(e){return!Vc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},jn=function(e){return e!=null&&Ia(e)===g_e&&!Ei(e)&&e.constructor===Object},cGt=function(e){return e!=null&&Ia(e)===g_e},Qt=function(e){return e!=null&&Ia(e)===Ia(1)&&!isNaN(e)},m_e=function(e){return Qt(e)&&Math.floor(e)===e},NL=function(e){if(lGt!=="undefined")return e!=null&&e instanceof HTMLElement},Vc=function(e){return b7(e)||y_e(e)},b7=function(e){return v7(e)==="collection"&&e._private.single},y_e=function(e){return v7(e)==="collection"&&!e._private.single},VJ=function(e){return v7(e)==="core"},v_e=function(e){return v7(e)==="stylesheet"},uGt=function(e){return v7(e)==="event"},Rg=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},hGt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},dGt=function(e){return jn(e)&&Qt(e.x1)&&Qt(e.x2)&&Qt(e.y1)&&Qt(e.y2)},fGt=function(e){return cGt(e)&&Ts(e.then)},pGt=function(){return Efe&&Efe.userAgent.match(/msie|trident|edge/i)},E5=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},wGt=function(e,r){return-1*x_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("^"+yGt+"$").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},kGt=function(e){var r,n=new RegExp("^"+gGt+"$").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},SGt=function(e){return EGt[e.toLowerCase()]},w_e=function(e){return(Ei(e)?e:null)||SGt(e)||TGt(e)||kGt(e)||CGt(e)},EGt={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]},T_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 EF=a,EF}var PGt=OGt(),C7=x7(PGt),AF=wa?wa.performance:null,S_e=AF&&AF.now?function(){return AF.now()}:function(){return Date.now()},$Gt=(function(){if(wa){if(wa.requestAnimationFrame)return function(t){wa.requestAnimationFrame(t)};if(wa.mozRequestAnimationFrame)return function(t){wa.mozRequestAnimationFrame(t)};if(wa.webkitRequestAnimationFrame)return function(t){wa.webkitRequestAnimationFrame(t)};if(wa.msRequestAnimationFrame)return function(t){wa.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(S_e())},1e3/60)}})(),DL=function(e){return $Gt(e)},k0=S_e,f1=9261,E_e=65599,M2=5381,A_e=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f1,n=r,i;i=e.next(),!i.done;)n=n*E_e+i.value|0;return n},W6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f1;return r*E_e+e|0},q6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M2;return(r<<5)+r+e|0},BGt=function(e,r){return e*2097152+r},yp=function(e){return e[0]*2097152+e[1]},L8=function(e,r){return[W6(e[0],r[0]),q6(e[1],r[1])]},Hfe=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)},UJ=function(e){e.splice(0,e.length)},jGt=function(e,r){for(var n=0;n"u"?"undefined":Ia(Set))!==KGt?Set:ZGt,eO=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!VJ(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 C3,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)}}}},iWt={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=dWt(s,e,r),n--}return r},fWt={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/hWt);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},D_e=function(e,r){return r===0?e:D_e(r,e%r)},bWt=function(e){for(var r=e[0],n=0;n0&&(r=D_e(r,e[n]));else return 0;return r},xWt=function(e){return Math.PI*e/180},I8=function(e,r){return Math.atan2(r,e)-Math.PI/2},YJ=Math.log2||function(t){return Math.log(t)/Math.log(2)},jJ=function(e){return e>0?1:e<0?-1:0},Ny=function(e,r){return Math.sqrt(Zm(e,r))},Zm=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},wWt=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}}},CWt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kWt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},SWt=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},O_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},tR=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},rR=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},jfe=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},XJ=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},jp=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},Xfe=function(e,r){return jp(e,r.x,r.y)},P_e=function(e,r){return jp(e,r.x1,r.y1)&&jp(e,r.x2,r.y2)},EWt=(_F=Math.hypot)!==null&&_F!==void 0?_F:function(t,e){return Math.sqrt(t*t+e*e)};function AWt(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=EWt(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"?Lg(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=Xp(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=Xp(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=Xp(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=Xp(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=dk(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=dk(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=dk(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=dk(e,r,n,i,B,H,u+o),I.length>0&&I[0]<=B&&I[1]>=H)return[I[0],I[1]]}return[]},RWt=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},_Wt=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)},LWt=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]},IWt=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)},NWt=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=[];IWt(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},oc=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=$L(h,-u);m=PL(y)}else m=h;return oc(e,r,m)},OWt=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]},LF=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Xp=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?LF(e,n,o)===o?[o,l]:LF(e,n,s)===s?[s,a]:LF(s,o,n)===n?[n,i]:[]:[]},$Wt=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=$L(d,-l);p=PL(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},QWt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:tqt,o=i,l,u,h=0;h=2?gC(e,r,n,0,e0e,rqt):gC(e,r,n,0,Jfe)},squaredEuclidean:function(e,r,n){return gC(e,r,n,0,e0e)},manhattan:function(e,r,n){return gC(e,r,n,0,Jfe)},max:function(e,r,n){return gC(e,r,n,-1/0,nqt)}};A5["squared-euclidean"]=A5.squaredEuclidean;A5.squaredeuclidean=A5.squaredEuclidean;function rO(t,e,r,n,i,s){var a;return Ts(t)?a=t:a=A5[t]||A5.euclidean,e===0&&Ts(t)?a(i,s):a(e,r,n,i,s)}var iqt=Ro({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ZJ=function(e){return iqt(e)},BL=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 rO(e,i.length,o,l,u,h)},NF=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},oqt=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},a0e=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=a0e(e,r,n),i},o0e=function(e){for(var r=this.cy(),n=this.nodes(),i=bqt(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}},D8=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}},Aqt={hopcroftTarjanBiconnected:D8,htbc:D8,htb:D8,hopcroftTarjanBiconnectedComponents:D8},O8=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}},Mqt={tarjanStronglyConnected:O8,tsc:O8,tscc:O8,tarjanStronglyConnectedComponents:O8},W_e={};[U6,nWt,iWt,aWt,lWt,uWt,fWt,VWt,zb,Vb,Pq,eqt,fqt,yqt,kqt,Eqt,Aqt,Mqt].forEach(function(t){Gr(W_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 W_e=0,q_e=1,U_e=2,Mh=function(e){if(!(this instanceof Mh))return new Mh(e);this.id="Thenable/1.0.7",this.state=W_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))};Mh.prototype={fulfill:function(e){return o0e(this,q_e,"fulfillValue",e)},reject:function(e){return o0e(this,U_e,"rejectReason",e)},then:function(e,r){var n=this,i=new Mh;return n.onFulfilled.push(c0e(e,i,"fulfill")),n.onRejected.push(c0e(r,i,"reject")),Y_e(n),i.proxy}};var o0e=function(e,r,n,i){return e.state===W_e&&(e.state=r,e[n]=i,Y_e(e)),e},Y_e=function(e){e.state===q_e?l0e(e,"onFulfilled",e.fulfillValue):e.state===U_e&&l0e(e,"onRejected",e.rejectReason)},l0e=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 tz=e,tz}var rz,I0e;function Uqt(){if(I0e)return rz;I0e=1;var t=sO();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 rz=e,rz}var nz,N0e;function Yqt(){if(N0e)return nz;N0e=1;var t=Hqt(),e=Gqt(),r=Wqt(),n=qqt(),i=Uqt();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}};nR.className=nR.classNames=nR.classes;var qn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Aa,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},zq=[{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 xGt(t.selector,e.selector)}),kUt=(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},_Ut=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 tLe(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return tee(this,t,e,tLe)};function rLe(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}M5.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tee(this,t,e,rLe)};function BUt(t,e,r){rLe(t,e,r),tLe(t,e,r)}M5.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tee(this,t,e,BUt)};M5.ancestors=M5.parents;var X6,nLe;X6=nLe={data:fi.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:fi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:fi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:fi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:fi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:fi.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};X6.attr=X6.data;X6.removeAttr=X6.removeData;var FUt=nLe,oO={};function Lz(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:Zv("indegree",function(t,e){return te}),minOutdegree:Zv("outdegree",function(t,e){return te})});Gr(oO,{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 zUt=iLe,R5=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},_5=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},VUt=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"}},Hb,om;Hb=om={};om.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}};om.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)};om.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)},Ap=function(e,r){return r==null?e:Qu(e,r.x1,r.y1,r.x2,r.y2)},mC=function(e,r,n){return fl(e,r,n)},P8=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,tR(d,1),Qu(e,d.x1,d.y1,d.x2,d.y2)}}},Iz=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=mC(a,"labelWidth",n),d=mC(a,"labelHeight",n),f=mC(a,"labelX",n),p=mC(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(R5(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(_5(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?mC(s.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(G),K=Math.sin(G),q=(_+P)/2,oe=(N+L)/2;if(!y){switch(R5(l.value)){case"left":q=P;break;case"right":q=_;break}switch(_5(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}},lpe=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;aLe(e,r,n,a,"outside",a/2)}},aLe=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);Ap(e,m)}else a!=null&&a>0&&rR(e,[a,a,a,a])}}},HUt=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;aLe(e,r,n,i,s)}},GUt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),s=n.headless(),a=Il(),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&&lpe(a,e),i&&r.includeOutlines&&!s&&lpe(a,e),i&&HUt(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"||Yp($,"segments")||Yp($,"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&&(P8(a,e,"mid-source"),P8(a,e,"mid-target"),P8(a,e,"source"),P8(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||{};Yfe(ie,a),rR(ie,v),tR(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||{};Yfe(me,a),rR(me,v),tR(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?CWt(te.all):te.all=Il(),i&&r.includeLabels&&(r.includeMainLabels&&Iz(a,e,null),u&&(r.includeSourceLabels&&Iz(a,e,"source"),r.includeTargetLabels&&Iz(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&&(rR(a,v),tR(a,1)),a},oLe=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 tz=e,tz}var rz,N0e;function Yqt(){if(N0e)return rz;N0e=1;var t=sO();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 rz=e,rz}var nz,D0e;function jqt(){if(D0e)return nz;D0e=1;var t=Gqt(),e=Wqt(),r=qqt(),n=Uqt(),i=Yqt();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}};nR.className=nR.classNames=nR.classes;var qn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Aa,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},zq=[{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 wGt(t.selector,e.selector)}),SUt=(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},LUt=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 rLe(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return tee(this,t,e,rLe)};function nLe(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}M5.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tee(this,t,e,nLe)};function FUt(t,e,r){nLe(t,e,r),rLe(t,e,r)}M5.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tee(this,t,e,FUt)};M5.ancestors=M5.parents;var X6,iLe;X6=iLe={data:fi.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:fi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:fi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:fi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:fi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:fi.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};X6.attr=X6.data;X6.removeAttr=X6.removeData;var zUt=iLe,oO={};function Lz(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:Zv("indegree",function(t,e){return te}),minOutdegree:Zv("outdegree",function(t,e){return te})});Gr(oO,{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 VUt=sLe,R5=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},_5=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},HUt=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"}},Hb,om;Hb=om={};om.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}};om.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)};om.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)},Ap=function(e,r){return r==null?e:Qu(e,r.x1,r.y1,r.x2,r.y2)},mC=function(e,r,n){return fl(e,r,n)},P8=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,tR(d,1),Qu(e,d.x1,d.y1,d.x2,d.y2)}}},Iz=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=mC(a,"labelWidth",n),d=mC(a,"labelHeight",n),f=mC(a,"labelX",n),p=mC(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(R5(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(_5(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?mC(s.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(G),K=Math.sin(G),q=(_+P)/2,oe=(N+L)/2;if(!y){switch(R5(l.value)){case"left":q=P;break;case"right":q=_;break}switch(_5(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}},cpe=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;oLe(e,r,n,a,"outside",a/2)}},oLe=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);Ap(e,m)}else a!=null&&a>0&&rR(e,[a,a,a,a])}}},GUt=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;oLe(e,r,n,i,s)}},WUt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),s=n.headless(),a=Il(),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&&cpe(a,e),i&&r.includeOutlines&&!s&&cpe(a,e),i&&GUt(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"||Yp($,"segments")||Yp($,"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&&(P8(a,e,"mid-source"),P8(a,e,"mid-target"),P8(a,e,"source"),P8(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||{};jfe(ie,a),rR(ie,v),tR(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||{};jfe(me,a),rR(me,v),tR(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?kWt(te.all):te.all=Il(),i&&r.includeLabels&&(r.includeMainLabels&&Iz(a,e,null),u&&(r.includeSourceLabels&&Iz(a,e,"source"),r.includeTargetLabels&&Iz(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&&(rR(a,v),tR(a,1)),a},lLe=function(e){var r=0,n=function(a){return(a?1:0)<0&&arguments[0]!==void 0?arguments[0]:iYt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)a(o);return this};Dg.removeAllListeners=function(){return this.removeListener("*")};Dg.emit=Dg.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Ei(e)||(e=[e]),sYt(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===nYt)&&s.eventMatches(s.context,h,a)){var d=[a];e!=null&&YGt(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":Ia(Symbol))!=e&&Ia(Symbol.iterator)!=e;r&&(FL[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},s=0,a=this.length;return d_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)}});Yo.neighbourhood=Yo.neighborhood;Yo.closedNeighbourhood=Yo.closedNeighborhood;Yo.openNeighbourhood=Yo.openNeighborhood;Gr(Yo,{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:bpe({attr:"source"}),targets:bpe({attr:"target"})});function bpe(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]}});Yo.componentsOf=Yo.components;var Eo=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])&&!b7(r[0])){a=!0;for(var o=[],l=new C3,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 Eo(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 mYt=(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=gYt(e,r,n,i);return function(a,o,l){return a+(o-a)*s(l)}},sR={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 sR.linear;var i=mYt(e,r,n);return function(s,a,o){return s+(a-s)*i(o)}},"cubic-bezier":Li};function Tpe(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 Cpe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Qv(t,e,r,n,i){var s=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var a=Cpe(t,i),o=Cpe(e,i);if(Qt(a)&&Qt(o))return Tpe(s,a,o,r,n);if(Ei(a)&&Ei(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(a.duration),a.easingImpl=sR[p].apply(null,g)):a.easingImpl=sR[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={};vC(v.x,x.x)&&(b.x=Qv(v.x,x.x,y,m)),vC(v.y,x.y)&&(b.y=Qv(v.y,x.y,y,m)),t.position(b)}var T=a.startPan,C=a.pan,S=s.pan,k=C!=null&&n;k&&(vC(T.x,C.x)&&(S.x=Qv(T.x,C.x,y,m)),vC(T.y,C.y)&&(S.y=Qv(T.y,C.y,y,m)),t.emit("pan"));var E=a.startZoom,A=a.zoom,R=A!=null&&n;R&&(vC(E,A)&&(s.zoom=Y6(s.minZoom,Qv(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=Qv($,I,y,m,O);h.overrideBypass(t,L,D)}t.emit("style")}}return a.progress=y,y}function vC(t,e){return t==null||e==null?!1:Qt(t)&&Qt(e)?!0:!!(t&&e)}function vYt(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function kpe(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||vYt(h,b,t),yYt(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 bYt={animate:fi.animate(),animation:fi.animation(),animated:fi.animated(),clearQueue:fi.clearQueue(),delay:fi.delay(),delayAnimation:fi.delayAnimation(),stop:fi.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&&DL(function(s){kpe(s,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(s,a){kpe(a,e)},n.beforeRenderPriorities.animations):r()}},xYt={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&&b7(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}},F8=function(e){return Dr(e)?new Ig(e):e},vLe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new lO(xYt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,F8(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,F8(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,F8(r),n),this},once:function(e,r,n){return this.emitter().one(e,F8(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}};fi.eventAliasesOn(vLe);var Hq={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)}};Hq.jpeg=Hq.jpg;var aR={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}};aR.createLayout=aR.makeLayout=aR.layout;var wYt={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)}};Gq.invalidateDimensions=Gq.resize;var oR={collection:function(e,r){return Dr(e)?this.$(e):Vc(e)?e.collection():Ei(e)?(r||(r={}),new Eo(this,e,r.unique,r.removed)):new Eo(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}};oR.elements=oR.filter=oR.$;var ro={},uS="t",CYt="f";ro.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};ro.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)};ro.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)};ro.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)})};ro.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};ro.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()})})};ro.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()})})};ro.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 E7={};E7.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 Ig(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:bWt(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),Qt(e)?a=e:jn(e)&&(a=e.level,e.position!=null?s=tO(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;Qt(u.x)&&(r.pan.x=u.x,o=!1),Qt(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}};Oy.centre=Oy.center;Oy.autolockNodes=Oy.autolock;Oy.autoungrabifyNodes=Oy.autoungrabify;var Z6={data:fi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:fi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:fi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:fi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Z6.attr=Z6.data;Z6.removeAttr=Z6.removeData;var Q6=function(e){var r=this;e=Gr({},e);var n=e.container;n&&!NL(n)&&NL(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=wa!==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 Eo(this),listeners:[],aniEles:new Eo(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:Qt(o.zoom)?o.zoom:1,pan:{x:jn(o.pan)&&Qt(o.pan.x)?o.pan.x:0,y:jn(o.pan)&&Qt(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(dGt);if(y)return k3.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=Il(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 VGt($e(Te),l,Fe[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var MYt={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 xLe(t){this.options=Gr({},MYt,t)}xLe.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=Il(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 RYt={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 wLe(t){this.options=Gr({},RYt,t)}wLe.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=Il(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||(PYt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&s(),DL(h)}};h()}else{for(;u;)u=a(l),l++;Ape(n,t),o()}return this};fO.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};fO.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var LYt=function(e,r,n){for(var i=n.eles.edges(),s=n.eles.nodes(),a=Il(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},TLe=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=VL(e,o,l),y=VL(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)}},FYt=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},VL=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)},zYt=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}}}}},HYt=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},kLe=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)}}},qYt={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 SLe(t){this.options=Gr({},qYt,t)}SLe.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=Il(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=NWt(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=IWt(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 fl(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(oc(t,e,re))return y(k),!0}else if(jp(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};av.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=Il({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 fl(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},ZYt=function(e,r,n,i,s){if(e!==Ipe?Npe(r,e,jh):KYt(ou,jh),Npe(r,n,ou),_pe=jh.nx*ou.ny-jh.ny*ou.nx,Lpe=jh.nx*ou.nx-jh.ny*-ou.ny,gf=Math.asin(Math.max(-1,Math.min(1,_pe))),Math.abs(gf)<1e-6){Wq=r.x,qq=r.y,Qm=e2=0;return}p1=1,lR=!1,Lpe<0?gf<0?gf=Math.PI+gf:(gf=Math.PI-gf,p1=-1,lR=!0):gf>0&&(p1=-1,lR=!0),r.radius!==void 0?e2=r.radius:e2=i,Pm=gf/2,z8=Math.min(jh.len/2,ou.len/2),s?(Vh=Math.abs(Math.cos(Pm)*e2/Math.sin(Pm)),Vh>z8?(Vh=z8,Qm=Math.abs(Vh*Math.sin(Pm)/Math.cos(Pm))):Qm=e2):(Vh=Math.min(z8,e2),Qm=Math.abs(Vh*Math.sin(Pm)/Math.cos(Pm))),Uq=r.x+ou.nx*Vh,Yq=r.y+ou.ny*Vh,Wq=Uq-ou.ny*Qm*p1,qq=Yq+ou.nx*Qm*p1,RLe=r.x+jh.nx*Vh,_Le=r.y+jh.ny*Vh,Ipe=r};function LLe(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 oee(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}:(ZYt(t,e,r,n,i),{cx:Wq,cy:qq,radius:Qm,startX:RLe,startY:_Le,stopX:Uq,stopY:Yq,startAngle:jh.ang+Math.PI/2*p1,endAngle:ou.ang-Math.PI/2*p1,counterClockwise:lR})}var J6=.01,QYt=Math.sqrt(2*J6),Jo={};Jo.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}};Jo.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=jJ(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)}};Jo.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=!Qt(r.startX)||!Qt(r.startY),y=!Qt(r.arrowStartX)||!Qt(r.arrowStartY),v=!Qt(r.endX)||!Qt(r.endY),x=!Qt(r.arrowEndX)||!Qt(r.arrowEndY),b=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*T,S=Ny({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=QYt||(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=!Qt(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=Zm(ce,sb(a)),Te=Zm(ce,sb(Fe)),ge=he;if(Te2){var He=Zm(ce,{x:Fe[2],y:Fe[3]});He0){var ee=h,Ae=Zm(ee,sb(a)),Re=Zm(ee,sb(fe)),Xe=Ae;if(Re2){var Ne=Zm(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=Y6(0,P,1),e=Fb(E.p0,E.p1,E.p2,P),f=ejt(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=Y6(0,V,1),e=wWt($,O,V),f=DLe($,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=Iy(n,t._private.labelDimsKey);if(fl(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=fl(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):fl(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(` +*/var hLe=function(e,r){this.recycle(e,r)};function yC(){return!1}function $8(){return!0}hLe.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=yC,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?$8:yC):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=$8;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=$8;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=$8,this.stopPropagation()},isDefaultPrevented:yC,isPropagationStopped:yC,isImmediatePropagationStopped:yC};var dLe=/^([^.]+)(\.(?:[^.]+))?$/,iYt=".*",fLe={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},ppe=Object.keys(fLe),sYt={};function lO(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:sYt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)a(o);return this};Dg.removeAllListeners=function(){return this.removeListener("*")};Dg.emit=Dg.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Ei(e)||(e=[e]),aYt(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===iYt)&&s.eventMatches(s.context,h,a)){var d=[a];e!=null&&jGt(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":Ia(Symbol))!=e&&Ia(Symbol.iterator)!=e;r&&(FL[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},s=0,a=this.length;return f_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)}});Yo.neighbourhood=Yo.neighborhood;Yo.closedNeighbourhood=Yo.closedNeighborhood;Yo.openNeighbourhood=Yo.openNeighborhood;Gr(Yo,{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:xpe({attr:"source"}),targets:xpe({attr:"target"})});function xpe(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]}});Yo.componentsOf=Yo.components;var Eo=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])&&!b7(r[0])){a=!0;for(var o=[],l=new C3,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 Eo(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 yYt=(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=mYt(e,r,n,i);return function(a,o,l){return a+(o-a)*s(l)}},sR={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 sR.linear;var i=yYt(e,r,n);return function(s,a,o){return s+(a-s)*i(o)}},"cubic-bezier":Li};function Cpe(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 kpe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Qv(t,e,r,n,i){var s=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var a=kpe(t,i),o=kpe(e,i);if(Qt(a)&&Qt(o))return Cpe(s,a,o,r,n);if(Ei(a)&&Ei(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(a.duration),a.easingImpl=sR[p].apply(null,g)):a.easingImpl=sR[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={};vC(v.x,x.x)&&(b.x=Qv(v.x,x.x,y,m)),vC(v.y,x.y)&&(b.y=Qv(v.y,x.y,y,m)),t.position(b)}var T=a.startPan,C=a.pan,S=s.pan,k=C!=null&&n;k&&(vC(T.x,C.x)&&(S.x=Qv(T.x,C.x,y,m)),vC(T.y,C.y)&&(S.y=Qv(T.y,C.y,y,m)),t.emit("pan"));var E=a.startZoom,A=a.zoom,R=A!=null&&n;R&&(vC(E,A)&&(s.zoom=Y6(s.minZoom,Qv(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=Qv($,I,y,m,O);h.overrideBypass(t,L,D)}t.emit("style")}}return a.progress=y,y}function vC(t,e){return t==null||e==null?!1:Qt(t)&&Qt(e)?!0:!!(t&&e)}function bYt(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function Spe(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||bYt(h,b,t),vYt(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 xYt={animate:fi.animate(),animation:fi.animation(),animated:fi.animated(),clearQueue:fi.clearQueue(),delay:fi.delay(),delayAnimation:fi.delayAnimation(),stop:fi.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&&DL(function(s){Spe(s,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(s,a){Spe(a,e)},n.beforeRenderPriorities.animations):r()}},wYt={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&&b7(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}},F8=function(e){return Dr(e)?new Ig(e):e},bLe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new lO(wYt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,F8(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,F8(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,F8(r),n),this},once:function(e,r,n){return this.emitter().one(e,F8(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}};fi.eventAliasesOn(bLe);var Hq={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)}};Hq.jpeg=Hq.jpg;var aR={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}};aR.createLayout=aR.makeLayout=aR.layout;var TYt={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)}};Gq.invalidateDimensions=Gq.resize;var oR={collection:function(e,r){return Dr(e)?this.$(e):Vc(e)?e.collection():Ei(e)?(r||(r={}),new Eo(this,e,r.unique,r.removed)):new Eo(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}};oR.elements=oR.filter=oR.$;var ro={},uS="t",kYt="f";ro.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};ro.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)};ro.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)};ro.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)})};ro.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};ro.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()})})};ro.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()})})};ro.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 E7={};E7.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 Ig(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:xWt(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),Qt(e)?a=e:jn(e)&&(a=e.level,e.position!=null?s=tO(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;Qt(u.x)&&(r.pan.x=u.x,o=!1),Qt(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}};Oy.centre=Oy.center;Oy.autolockNodes=Oy.autolock;Oy.autoungrabifyNodes=Oy.autoungrabify;var Z6={data:fi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:fi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:fi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:fi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Z6.attr=Z6.data;Z6.removeAttr=Z6.removeData;var Q6=function(e){var r=this;e=Gr({},e);var n=e.container;n&&!NL(n)&&NL(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=wa!==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 Eo(this),listeners:[],aniEles:new Eo(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:Qt(o.zoom)?o.zoom:1,pan:{x:jn(o.pan)&&Qt(o.pan.x)?o.pan.x:0,y:jn(o.pan)&&Qt(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(fGt);if(y)return k3.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=Il(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 HGt($e(Te),l,Fe[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var RYt={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 wLe(t){this.options=Gr({},RYt,t)}wLe.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=Il(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 _Yt={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 TLe(t){this.options=Gr({},_Yt,t)}TLe.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=Il(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||($Yt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&s(),DL(h)}};h()}else{for(;u;)u=a(l),l++;Mpe(n,t),o()}return this};fO.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};fO.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var IYt=function(e,r,n){for(var i=n.eles.edges(),s=n.eles.nodes(),a=Il(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},CLe=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=VL(e,o,l),y=VL(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)}},zYt=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},VL=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)},VYt=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}}}}},GYt=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},SLe=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)}}},UYt={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 ELe(t){this.options=Gr({},UYt,t)}ELe.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=Il(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=NWt(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 fl(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(oc(t,e,re))return y(k),!0}else if(jp(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};av.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=Il({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 fl(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},QYt=function(e,r,n,i,s){if(e!==Npe?Dpe(r,e,jh):ZYt(ou,jh),Dpe(r,n,ou),Lpe=jh.nx*ou.ny-jh.ny*ou.nx,Ipe=jh.nx*ou.nx-jh.ny*-ou.ny,gf=Math.asin(Math.max(-1,Math.min(1,Lpe))),Math.abs(gf)<1e-6){Wq=r.x,qq=r.y,Qm=e2=0;return}p1=1,lR=!1,Ipe<0?gf<0?gf=Math.PI+gf:(gf=Math.PI-gf,p1=-1,lR=!0):gf>0&&(p1=-1,lR=!0),r.radius!==void 0?e2=r.radius:e2=i,Pm=gf/2,z8=Math.min(jh.len/2,ou.len/2),s?(Vh=Math.abs(Math.cos(Pm)*e2/Math.sin(Pm)),Vh>z8?(Vh=z8,Qm=Math.abs(Vh*Math.sin(Pm)/Math.cos(Pm))):Qm=e2):(Vh=Math.min(z8,e2),Qm=Math.abs(Vh*Math.sin(Pm)/Math.cos(Pm))),Uq=r.x+ou.nx*Vh,Yq=r.y+ou.ny*Vh,Wq=Uq-ou.ny*Qm*p1,qq=Yq+ou.nx*Qm*p1,_Le=r.x+jh.nx*Vh,LLe=r.y+jh.ny*Vh,Npe=r};function ILe(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 oee(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}:(QYt(t,e,r,n,i),{cx:Wq,cy:qq,radius:Qm,startX:_Le,startY:LLe,stopX:Uq,stopY:Yq,startAngle:jh.ang+Math.PI/2*p1,endAngle:ou.ang-Math.PI/2*p1,counterClockwise:lR})}var J6=.01,JYt=Math.sqrt(2*J6),Jo={};Jo.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}};Jo.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=jJ(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)}};Jo.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=!Qt(r.startX)||!Qt(r.startY),y=!Qt(r.arrowStartX)||!Qt(r.arrowStartY),v=!Qt(r.endX)||!Qt(r.endY),x=!Qt(r.arrowEndX)||!Qt(r.arrowEndY),b=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*T,S=Ny({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=JYt||(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=!Qt(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=Zm(ce,sb(a)),Te=Zm(ce,sb(Fe)),ge=he;if(Te2){var He=Zm(ce,{x:Fe[2],y:Fe[3]});He0){var ee=h,Ae=Zm(ee,sb(a)),Re=Zm(ee,sb(fe)),Xe=Ae;if(Re2){var Ne=Zm(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=Y6(0,P,1),e=Fb(E.p0,E.p1,E.p2,P),f=tjt(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=Y6(0,V,1),e=TWt($,O,V),f=OLe($,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=Iy(n,t._private.labelDimsKey);if(fl(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=fl(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):fl(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=hc(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()?VUt(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=sb(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(Qt(ze[0])&&Qt(ze[1])&&(Ee.x+=ze[0],Ee.y+=ze[1],Or)){var it=t.hoverData.dragDelta;it&&Qt(it[0])&&Qt(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=vWt(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=jJ(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:P_e(s,a,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,s,a,o,l){l=l==="auto"?Lg(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!!(oc(e,r,f)||V1(e,r,u,u,a+i/2-l,o+s/2-l,n)||V1(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",ul(3,0)),this.generateRoundPolygon("round-triangle",ul(3,0)),this.generatePolygon("rectangle",ul(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",ul(5,0)),this.generateRoundPolygon("round-pentagon",ul(5,0)),this.generatePolygon("hexagon",ul(6,0)),this.generateRoundPolygon("round-hexagon",ul(6,0)),this.generatePolygon("heptagon",ul(7,0)),this.generateRoundPolygon("round-heptagon",ul(7,0)),this.generatePolygon("octagon",ul(8,0)),this.generateRoundPolygon("round-octagon",ul(8,0));var n=new Array(20);{var i=Dq(5,0),s=Dq(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*Oz)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||qJ;i.beforeRender(a,o(n))}}}},ijt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:OL;sm(this,t),this.idsByKey=new qf,this.keyForId=new qf,this.cachesByLvl=new qf,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return am(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 C3,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}}])})(),$pe=25,V8=50,cR=-4,jq=3,VLe=7.99,sjt=8,ajt=1024,ojt=1024,ljt=1024,cjt=.2,ujt=.8,hjt=10,djt=.15,fjt=.1,pjt=.9,gjt=.9,mjt=100,yjt=1,ob={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},vjt=Ro({getKey:null,doesEleInvalidateKey:OL,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:M_e,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),pk=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=vjt(r);Gr(n,i),n.lookup=new ijt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Da=pk.prototype;Da.reasons=ob;Da.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Da.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Da.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new k7(function(r,n){return n.reqs-r.reqs});return e};Da.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Da.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(YJ(o*r))),n=VLe||n>jq)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<=$pe?g=$pe:h<=V8?g=V8:g=Math.ceil(h/V8)*V8,h>ljt||d>ojt)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,_,ob.downscale);R()}else return s.queueElement(t,S.level-1),S;else{var P;if(!b&&!T&&!C)for(var N=n-1;N>=cR;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+sjt),y.eleCaches.push(p),l.set(t,n,p),s.checkTextureFullness(y),p};Da.invalidateElements=function(t){for(var e=0;e=cjt*t.width&&this.retireTexture(t)};Da.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>ujt&&t.fullnessChecks>=hjt?_g(r,t):t.fullnessChecks++};Da.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;_g(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,UJ(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),_g(i,a),n.push(a),a}};Da.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}};Da.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,ob.dequeue)}return i};Da.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=WJ,r.updateItem(s),r.pop(),n[i]=null):s.eles.unmerge(t))};Da.onDequeue=function(t){this.onDequeues.push(t)};Da.offDequeue=function(t){_g(this.onDequeues,t)};Da.setupDequeueing=zLe.setupDequeueing({deqRedrawThreshold:mjt,deqCost:djt,deqAvgCost:fjt,deqNoDrawCost:pjt,deqFastCost:gjt,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=xjt||r>GL)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;hS<=$&&$<=GL&&!R($);$+=I);};_(1),_(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&_g(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=Il();for(var R=0;RFpe||N>Fpe)return null;var L=P*N;if(L>Mjt)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/bjt,b=!o,T=0;T=x||!O_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)};_o.getEleLevelForLayerLevel=function(t,e){return t};_o.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,Rjt),s.setImgSmoothing(a,!0))};_o.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};_o.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};_o.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)}))};_o.invalidateLayer=function(t){if(this.lastInvalidationTime=k0(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];_g(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 WLe=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=WLe("overlay");Z0.drawEdgeUnderlay=WLe("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)};ov.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 zjt(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 Gpe(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()}ov.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=fl(i,"labelAngle",e);r=t.isEdge()?o:0}else a.strValue==="none"?r=0:r=a.pfValue;return r};ov.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=fl(a,"labelX",r),u=fl(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=fl(a,"labelWidth",r),m=fl(a,"labelHeight",r),y=fl(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=R5(T),E=_5(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(),Gpe(t,W,K,q,oe,$)):I?(t.beginPath(),zjt(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?Gpe(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=fl(a,"labelWrapCachedLines",r),ie=fl(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 lm={};lm.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(!(!Qt(d.x)||!Qt(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=A_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"?B_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()}}}};lm.drawNodeOverlay=qLe("overlay");lm.drawNodeUnderlay=qLe("underlay");lm.hasPie=function(t){return t=t[0],t._private.hasPie};lm.hasStripe=function(t){return t=t[0],t._private.hasStripe};lm.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)}};lm.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 Vl={},Vjt=100;Vl.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};Vl.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()},Vjt)),n||r.emit("render")};var bC;Vl.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",!bC){var v=h.measureText(y);bC=v.actualBoundingBoxAscent}h.fillText(y,0,bC);var x=60;h.strokeRect(0,bC+10,250,20),h.fillRect(0,bC+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Wpe(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 Hjt(t,e,r){var n=Wpe(t,t.VERTEX_SHADER,e),i=Wpe(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 Gjt(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 uee(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 Wjt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function qjt(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 Ujt(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 Yjt(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 jjt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Xjt(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 ULe(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 YLe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Kjt(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 Zjt(t,e,r,n){var i=ULe(t,e),s=ra(i,2),a=s[0],o=s[1],l=YLe(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=ULe(t,r),s=ra(i,3),a=s[0],o=s[1],l=s[2],u=YLe(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=hc(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=hc(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&&!Yjt(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=hc(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=hc(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}}])})(),aXt=(function(){function t(e){sm(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return am(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}}])})(),oXt=` +`)),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()?HUt(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=sb(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(Qt(ze[0])&&Qt(ze[1])&&(Ee.x+=ze[0],Ee.y+=ze[1],Or)){var it=t.hoverData.dragDelta;it&&Qt(it[0])&&Qt(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=bWt(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=jJ(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:$_e(s,a,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,s,a,o,l){l=l==="auto"?Lg(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!!(oc(e,r,f)||V1(e,r,u,u,a+i/2-l,o+s/2-l,n)||V1(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",ul(3,0)),this.generateRoundPolygon("round-triangle",ul(3,0)),this.generatePolygon("rectangle",ul(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",ul(5,0)),this.generateRoundPolygon("round-pentagon",ul(5,0)),this.generatePolygon("hexagon",ul(6,0)),this.generateRoundPolygon("round-hexagon",ul(6,0)),this.generatePolygon("heptagon",ul(7,0)),this.generateRoundPolygon("round-heptagon",ul(7,0)),this.generatePolygon("octagon",ul(8,0)),this.generateRoundPolygon("round-octagon",ul(8,0));var n=new Array(20);{var i=Dq(5,0),s=Dq(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*Oz)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||qJ;i.beforeRender(a,o(n))}}}},sjt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:OL;sm(this,t),this.idsByKey=new qf,this.keyForId=new qf,this.cachesByLvl=new qf,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return am(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 C3,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}}])})(),Bpe=25,V8=50,cR=-4,jq=3,HLe=7.99,ajt=8,ojt=1024,ljt=1024,cjt=1024,ujt=.2,hjt=.8,djt=10,fjt=.15,pjt=.1,gjt=.9,mjt=.9,yjt=100,vjt=1,ob={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},bjt=Ro({getKey:null,doesEleInvalidateKey:OL,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:R_e,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),pk=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=bjt(r);Gr(n,i),n.lookup=new sjt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Da=pk.prototype;Da.reasons=ob;Da.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Da.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Da.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new k7(function(r,n){return n.reqs-r.reqs});return e};Da.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Da.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(YJ(o*r))),n=HLe||n>jq)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<=Bpe?g=Bpe:h<=V8?g=V8:g=Math.ceil(h/V8)*V8,h>cjt||d>ljt)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,_,ob.downscale);R()}else return s.queueElement(t,S.level-1),S;else{var P;if(!b&&!T&&!C)for(var N=n-1;N>=cR;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+ajt),y.eleCaches.push(p),l.set(t,n,p),s.checkTextureFullness(y),p};Da.invalidateElements=function(t){for(var e=0;e=ujt*t.width&&this.retireTexture(t)};Da.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>hjt&&t.fullnessChecks>=djt?_g(r,t):t.fullnessChecks++};Da.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;_g(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,UJ(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),_g(i,a),n.push(a),a}};Da.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}};Da.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,ob.dequeue)}return i};Da.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=WJ,r.updateItem(s),r.pop(),n[i]=null):s.eles.unmerge(t))};Da.onDequeue=function(t){this.onDequeues.push(t)};Da.offDequeue=function(t){_g(this.onDequeues,t)};Da.setupDequeueing=VLe.setupDequeueing({deqRedrawThreshold:yjt,deqCost:fjt,deqAvgCost:pjt,deqNoDrawCost:gjt,deqFastCost:mjt,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=wjt||r>GL)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;hS<=$&&$<=GL&&!R($);$+=I);};_(1),_(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&_g(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=Il();for(var R=0;Rzpe||N>zpe)return null;var L=P*N;if(L>Rjt)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/xjt,b=!o,T=0;T=x||!P_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)};_o.getEleLevelForLayerLevel=function(t,e){return t};_o.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,_jt),s.setImgSmoothing(a,!0))};_o.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};_o.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};_o.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)}))};_o.invalidateLayer=function(t){if(this.lastInvalidationTime=k0(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];_g(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 qLe=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=qLe("overlay");Z0.drawEdgeUnderlay=qLe("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)};ov.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 Vjt(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 Wpe(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()}ov.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=fl(i,"labelAngle",e);r=t.isEdge()?o:0}else a.strValue==="none"?r=0:r=a.pfValue;return r};ov.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=fl(a,"labelX",r),u=fl(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=fl(a,"labelWidth",r),m=fl(a,"labelHeight",r),y=fl(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=R5(T),E=_5(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(),Wpe(t,W,K,q,oe,$)):I?(t.beginPath(),Vjt(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?Wpe(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=fl(a,"labelWrapCachedLines",r),ie=fl(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 lm={};lm.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(!(!Qt(d.x)||!Qt(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=M_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"?F_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()}}}};lm.drawNodeOverlay=ULe("overlay");lm.drawNodeUnderlay=ULe("underlay");lm.hasPie=function(t){return t=t[0],t._private.hasPie};lm.hasStripe=function(t){return t=t[0],t._private.hasStripe};lm.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)}};lm.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 Vl={},Hjt=100;Vl.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};Vl.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()},Hjt)),n||r.emit("render")};var bC;Vl.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",!bC){var v=h.measureText(y);bC=v.actualBoundingBoxAscent}h.fillText(y,0,bC);var x=60;h.strokeRect(0,bC+10,250,20),h.fillRect(0,bC+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function qpe(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 Gjt(t,e,r){var n=qpe(t,t.VERTEX_SHADER,e),i=qpe(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 Wjt(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 uee(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 qjt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function Ujt(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 Yjt(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 jjt(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 Xjt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Kjt(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 YLe(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 jLe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Zjt(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 Qjt(t,e,r,n){var i=YLe(t,e),s=ra(i,2),a=s[0],o=s[1],l=jLe(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=YLe(t,r),s=ra(i,3),a=s[0],o=s[1],l=s[2],u=jLe(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=hc(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=hc(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&&!jjt(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=hc(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=hc(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}}])})(),oXt=(function(){function t(e){sm(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return am(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}}])})(),lXt=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,lXt=` +`,cXt=` 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); } -`,cXt=` +`,uXt=` 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; } -`,uXt=` +`,hXt=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -2865,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; } -`,dS={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},WL={IGNORE:1,USE_BB:2},Bz=0,jpe=1,Xpe=2,Fz=3,r2=4,H8=5,xC=6,wC=7,hXt=(function(){function t(e,r,n){sm(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=Gjt,this.atlasManager=new sXt(e,n),this.batchManager=new aXt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(dS.SCREEN),this.pickingProgram=this._createShaderProgram(dS.PICKING),this.vao=this._createVAO()}return am(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 +`,dS={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},WL={IGNORE:1,USE_BB:2},Bz=0,Xpe=1,Kpe=2,Fz=3,r2=4,H8=5,xC=6,wC=7,dXt=(function(){function t(e,r,n){sm(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=Wjt,this.atlasManager=new aXt(e,n),this.batchManager=new oXt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(dS.SCREEN),this.pickingProgram=this._createShaderProgram(dS.PICKING),this.vao=this._createVAO()}return am(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; @@ -2946,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(jpe,`) { + else if(aVertType == `).concat(Xpe,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -2961,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(Xpe,`) { + else if(aVertType == `).concat(Kpe,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -3055,10 +3055,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js out vec4 outColor; - `).concat(oXt,` `).concat(lXt,` `).concat(cXt,` `).concat(uXt,` + `).concat(hXt,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -3143,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=Hjt(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]:dS.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===WL.IGNORE)return;if(l==WL.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=s.getAtlasInfo(r,i),h=hc(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;Upe(r);var l=i.getRotation?i.getRotation(s):0;if(l!==0){var u=i.getRotationPoint(s),h=u.x,d=u.y;uR(r,r,[h,d]),Ype(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;uR(r,r,[a,o]),Xq(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]=r2;var o=this.indexBuffer.getView(a);t2(n,o);var l=this.colorBuffer.getView(a);$m([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===H8||o===xC){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===xC&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);t2(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);$m(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);$m(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 r2;case"ellipse":return wC;case"roundrectangle":case"round-rectangle":return H8;case"bottom-round-rectangle":return xC;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var s=i.w,a=i.h;if(r.pstyle(n).value==="auto")return Lg(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);Upe(x),uR(x,x,[a,o]),Xq(x,x,[y,y]),Ype(x,x,l),this.vertTypeBuffer.getView(v)[0]=Fz;var b=this.indexBuffer.getView(v);t2(n,b);var T=this.colorBuffer.getView(v);$m(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]=jpe;var d=this.indexBuffer.getView(h);t2(n,d);var f=this.colorBuffer.getView(h);$m(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?WL.USE_BB:WL.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:Ujt,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:zz(e.getLabelKey,null),getBoundingBox:Vz(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:zz(e.getSourceLabelKey,"source"),getBoundingBox:Vz(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:zz(e.getTargetLabelKey,"target"),getBoundingBox:Vz(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:s("target-label")});var u=C7(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()}),fXt(r)};function dXt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return x_e(r)}function XLe(t,e){var r=t._private.rscratch;return fl(r,"labelWrapCachedLines",e)||[]}var zz=function(e,r){return function(n){var i=e(n),s=XLe(n,r);return s.length>1?s.map(function(a,o){return"".concat(i,"_").concat(o)}):i}},Vz=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=XLe(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 fXt(t){{var e=t.render;t.render=function(s){s=s||{};var a=t.cy;t.webgl&&(a.zoom()>VLe?(pXt(t),e.call(t,s)):(gXt(t),ZLe(t,s,dS.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 wXt(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 pXt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function gXt(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 mXt(t){var e=t.canvasWidth,r=t.canvasHeight,n=uee(t),i=n.pan,s=n.zoom,a=$z();uR(a,a,[i.x,i.y]),Xq(a,a,[s,s]);var o=$z();tXt(o,e,r);var l=$z();return eXt(l,o,a),l}function KLe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=uee(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 yXt(t,e){t.drawSelectionRectangle(e,function(r){return KLe(t,r)})}function vXt(t){var e=t.data.contexts[t.NODE];e.save(),KLe(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 bXt(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 wXt(t,e,r){var n=xXt(t,e,r),i=t.getCachedZSortedEles(),s,a,o=hc(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 Hz(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 ZLe(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]&&yXt(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=mXt(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":Ia(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};[GLe,Jd,Z0,cee,ov,lm,Vl,jLe,cm,R7,eIe].forEach(function(t){Gr(kn,t)});var SXt=[{name:"null",impl:MLe},{name:"base",impl:FLe},{name:"canvas",impl:CXt}],EXt=[{type:"layout",extensions:XYt},{type:"renderer",extensions:SXt}],rIe={},nIe={};function iIe(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(Q6.prototype[e])return i(e);Q6.prototype[e]=r}else if(t==="collection"){if(Eo.prototype[e])return i(e);Eo.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})])})})(hR)),hR.exports}var PXt=OXt();const $Xt=Xg(PXt);Bd.use($Xt);function aIe(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(aIe,"addNodes");function oIe(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(oIe,"addEdges");function lIe(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(),aIe(t.nodes,n),oIe(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(lIe,"createCytoscapeInstance");function cIe(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(cIe,"extractPositionedNodes");function uIe(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(uIe,"extractPositionedEdges");async function hIe(t,e){de.debug("Starting cose-bilkent layout algorithm");try{dIe(t);const r=await lIe(t),n=cIe(r),i=uIe(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(hIe,"executeCoseBilkentLayout");function dIe(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(dIe,"validateLayoutData");var BXt=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 hIe(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"),FXt=BXt;const zXt=Object.freeze(Object.defineProperty({__proto__:null,render:FXt},Symbol.toStringTag,{value:"Module"}));var mO=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"),fIe=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"};mO(t,r).lower()},"drawBackgroundRect"),VXt=w((t,e)=>{const r=e.text.replace(a3," "),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"),hee=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const s=Qy.sanitizeUrl(n);i.attr("xlink:href",s)},"drawImage"),dee=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const s=Qy.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"),fee=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),pee=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"),UL=(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=Gjt(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]:dS.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===WL.IGNORE)return;if(l==WL.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=s.getAtlasInfo(r,i),h=hc(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;Ype(r);var l=i.getRotation?i.getRotation(s):0;if(l!==0){var u=i.getRotationPoint(s),h=u.x,d=u.y;uR(r,r,[h,d]),jpe(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;uR(r,r,[a,o]),Xq(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]=r2;var o=this.indexBuffer.getView(a);t2(n,o);var l=this.colorBuffer.getView(a);$m([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===H8||o===xC){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===xC&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);t2(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);$m(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);$m(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 r2;case"ellipse":return wC;case"roundrectangle":case"round-rectangle":return H8;case"bottom-round-rectangle":return xC;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var s=i.w,a=i.h;if(r.pstyle(n).value==="auto")return Lg(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);Ype(x),uR(x,x,[a,o]),Xq(x,x,[y,y]),jpe(x,x,l),this.vertTypeBuffer.getView(v)[0]=Fz;var b=this.indexBuffer.getView(v);t2(n,b);var T=this.colorBuffer.getView(v);$m(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]=Xpe;var d=this.indexBuffer.getView(h);t2(n,d);var f=this.colorBuffer.getView(h);$m(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?WL.USE_BB:WL.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:Yjt,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:zz(e.getLabelKey,null),getBoundingBox:Vz(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:zz(e.getSourceLabelKey,"source"),getBoundingBox:Vz(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:zz(e.getTargetLabelKey,"target"),getBoundingBox:Vz(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:s("target-label")});var u=C7(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()}),pXt(r)};function fXt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return w_e(r)}function KLe(t,e){var r=t._private.rscratch;return fl(r,"labelWrapCachedLines",e)||[]}var zz=function(e,r){return function(n){var i=e(n),s=KLe(n,r);return s.length>1?s.map(function(a,o){return"".concat(i,"_").concat(o)}):i}},Vz=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=KLe(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 pXt(t){{var e=t.render;t.render=function(s){s=s||{};var a=t.cy;t.webgl&&(a.zoom()>HLe?(gXt(t),e.call(t,s)):(mXt(t),QLe(t,s,dS.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 TXt(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 gXt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function mXt(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 yXt(t){var e=t.canvasWidth,r=t.canvasHeight,n=uee(t),i=n.pan,s=n.zoom,a=$z();uR(a,a,[i.x,i.y]),Xq(a,a,[s,s]);var o=$z();rXt(o,e,r);var l=$z();return tXt(l,o,a),l}function ZLe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=uee(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 vXt(t,e){t.drawSelectionRectangle(e,function(r){return ZLe(t,r)})}function bXt(t){var e=t.data.contexts[t.NODE];e.save(),ZLe(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 xXt(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 TXt(t,e,r){var n=wXt(t,e,r),i=t.getCachedZSortedEles(),s,a,o=hc(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 Hz(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 QLe(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]&&vXt(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=yXt(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 CXt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),s=0;s"u"?"undefined":Ia(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};[WLe,Jd,Z0,cee,ov,lm,Vl,XLe,cm,R7,tIe].forEach(function(t){Gr(kn,t)});var EXt=[{name:"null",impl:RLe},{name:"base",impl:zLe},{name:"canvas",impl:kXt}],AXt=[{type:"layout",extensions:KYt},{type:"renderer",extensions:EXt}],nIe={},iIe={};function sIe(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(Q6.prototype[e])return i(e);Q6.prototype[e]=r}else if(t==="collection"){if(Eo.prototype[e])return i(e);Eo.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})])})})(hR)),hR.exports}var $Xt=PXt();const BXt=Xg($Xt);Bd.use(BXt);function oIe(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(oIe,"addNodes");function lIe(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(lIe,"addEdges");function cIe(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(),oIe(t.nodes,n),lIe(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(cIe,"createCytoscapeInstance");function uIe(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(uIe,"extractPositionedNodes");function hIe(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(hIe,"extractPositionedEdges");async function dIe(t,e){de.debug("Starting cose-bilkent layout algorithm");try{fIe(t);const r=await cIe(t),n=uIe(r),i=hIe(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(dIe,"executeCoseBilkentLayout");function fIe(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(fIe,"validateLayoutData");var FXt=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 dIe(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"),zXt=FXt;const VXt=Object.freeze(Object.defineProperty({__proto__:null,render:zXt},Symbol.toStringTag,{value:"Module"}));var mO=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"),pIe=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"};mO(t,r).lower()},"drawBackgroundRect"),HXt=w((t,e)=>{const r=e.text.replace(a3," "),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"),hee=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const s=Qy.sanitizeUrl(n);i.attr("xlink:href",s)},"drawImage"),dee=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const s=Qy.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"),fee=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),pee=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"),UL=(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})();UL.parser=UL;var HXt=UL,Rh=[],ag=[""],Al="global",xh="",Fd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],eE=[],gee="",mee=!1,YL=4,jL=2,pIe,GXt=w(function(){return pIe},"getC4Type"),WXt=w(function(t){pIe=Ln(t,Ve())},"setC4Type"),qXt=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=eE.find(d=>d.from===e&&d.to===r);if(h?u=h:eE.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=um()},"addRel"),UXt=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=Al,o.wrap=um()},"addPersonOrSystem"),YXt=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=um(),l.typeC4Shape={text:t},l.parentBoundary=Al},"addContainer"),jXt=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=um(),l.typeC4Shape={text:t},l.parentBoundary=Al},"addComponent"),XXt=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=Al,s.wrap=um(),xh=Al,Al=t,ag.push(xh)},"addPersonOrSystemBoundary"),KXt=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=Al,s.wrap=um(),xh=Al,Al=t,ag.push(xh)},"addContainerBoundary"),ZXt=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=Al,l.wrap=um(),xh=Al,Al=e,ag.push(xh)},"addDeploymentNode"),QXt=w(function(){Al=xh,ag.pop(),xh=ag.pop(),ag.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"),eKt=w(function(t,e,r,n,i,s,a){const o=eE.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"),tKt=w(function(t,e,r){let n=YL,i=jL;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&&(YL=n),i>=1&&(jL=i)},"updateLayoutConfig"),rKt=w(function(){return YL},"getC4ShapeInRow"),nKt=w(function(){return jL},"getC4BoundaryInRow"),iKt=w(function(){return Al},"getCurrentBoundaryParse"),sKt=w(function(){return xh},"getParentBoundaryParse"),gIe=w(function(t){return t==null?Rh:Rh.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),aKt=w(function(t){return Rh.find(e=>e.alias===t)},"getC4Shape"),oKt=w(function(t){return Object.keys(gIe(t))},"getC4ShapeKeys"),mIe=w(function(t){return t==null?Fd:Fd.filter(e=>e.parentBoundary===t)},"getBoundaries"),lKt=mIe,cKt=w(function(){return eE},"getRels"),uKt=w(function(){return gee},"getTitle"),hKt=w(function(t){mee=t},"setWrap"),um=w(function(){return mee},"autoWrap"),dKt=w(function(){Rh=[],Fd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],xh="",Al="global",ag=[""],eE=[],ag=[""],gee="",mee=!1,YL=4,jL=2},"clear"),fKt={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},pKt={FILLED:0,OPEN:1},gKt={LEFTOF:0,RIGHTOF:1,OVER:2},mKt=w(function(t){gee=Ln(t,Ve())},"setTitle"),Jq={addPersonOrSystem:UXt,addPersonOrSystemBoundary:XXt,addContainer:YXt,addContainerBoundary:KXt,addComponent:jXt,addDeploymentNode:ZXt,popBoundaryParseStack:QXt,addRel:qXt,updateElStyle:JXt,updateRelStyle:eKt,updateLayoutConfig:tKt,autoWrap:um,setWrap:hKt,getC4ShapeArray:gIe,getC4Shape:aKt,getC4ShapeKeys:oKt,getBoundaries:mIe,getBoundarys:lKt,getCurrentBoundaryParse:iKt,getParentBoundaryParse:sKt,getRels:cKt,getTitle:uKt,getC4Type:GXt,getC4ShapeInRow:rKt,getC4BoundaryInRow:nKt,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,getConfig:w(()=>Ve().c4,"getConfig"),clear:dKt,LINETYPE:fKt,ARROWTYPE:pKt,PLACEMENT:gKt,setTitle:mKt,setC4Type:WXt},yee=w(function(t,e){return mO(t,e)},"drawRect"),yIe=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:Qy.sanitizeUrl(s);a.attr("xlink:href",o)},"drawImage"),yKt=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"),vKt=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};yee(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"),bKt=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},yee(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":yIe(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"),xKt=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"),wKt=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"),CKt=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"),kKt=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"),SKt=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"),EKt=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"),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>vIe)&&(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},tU(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(hx,"Bounds"),hx),tU=w(function(t){aa(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"),TC=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),pR=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),MKt=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=Jk(e[t].text,i,n),e[t].textLines=e[t].text.split(Vt.lineBreakRegex).length,e[t].width=i,e[t].height=a_(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(El(o,n),e[t].width),a=a_(o,n),e[t].height=e[t].height+a}}w(Tu,"calcC4ShapeTextWH");var xIe=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=pR(Sr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let s=El(e.label.text,i);Tu("label",e,n,i,s),ad.drawBoundary(t,e,Sr)},"drawBoundary"),wIe=w(function(t,e,r,n){let i=0;for(const s of n){i=0;const a=r[s];let o=TC(Sr,a.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,a.typeC4Shape.width=El("«"+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=TC(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=TC(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=TC(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=TC(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"),dx,su=(dx=class{constructor(e,r){this.x=e,this.y=r}},w(dx,"Point"),dx),rge=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"),RKt=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=rge(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=rge(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),_Kt=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=MKt(Sr);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=s+": "+a.label.text);let h=El(a.label.text,l);Tu("label",a,o,l,h),a.techn&&a.techn.text!==""&&(h=El(a.techn.text,l),Tu("techn",a,o,l,h)),a.descr&&a.descr.text!==""&&(h=El(a.descr.text,l),Tu("descr",a,o,l,h));let d=r(a.from),f=r(a.to),p=RKt(d,f);a.startPoint=p.startPoint,a.endPoint=p.endPoint}ad.drawRels(t,e,Sr,i)},"drawRels");function vee(t,e,r,n,i){let s=new bIe(i);s.data.widthLimit=r.data.widthLimit/Math.min(eU,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=pR(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=pR(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=pR(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%eU===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&&wIe(s,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&vee(t,e,s,p,i),o.alias!=="global"&&xIe(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),XL=Math.max(XL,r.data.stopx),KL=Math.max(KL,r.data.stopy)}}w(vee,"drawInsideBoundary");var LKt=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),vIe=o.getC4ShapeInRow(),eU=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 bIe(n);u.setData(Sr.diagramMarginX,Sr.diagramMarginX,Sr.diagramMarginY,Sr.diagramMarginY),u.data.widthLimit=screen.availWidth,XL=Sr.diagramMarginX,KL=Sr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");vee(l,"",u,d,n),ad.insertArrowHead(l,e),ad.insertArrowEnd(l,e),ad.insertArrowCrossHead(l,e),ad.insertArrowFilledHead(l,e),_Kt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=XL,u.data.stopy=KL;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"),nge={drawPersonOrSystemArray:wIe,drawBoundary:xIe,setConf:tU,draw:LKt},IKt=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})();UL.parser=UL;var GXt=UL,Rh=[],ag=[""],Al="global",xh="",Fd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],eE=[],gee="",mee=!1,YL=4,jL=2,gIe,WXt=w(function(){return gIe},"getC4Type"),qXt=w(function(t){gIe=Ln(t,Ve())},"setC4Type"),UXt=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=eE.find(d=>d.from===e&&d.to===r);if(h?u=h:eE.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=um()},"addRel"),YXt=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=Al,o.wrap=um()},"addPersonOrSystem"),jXt=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=um(),l.typeC4Shape={text:t},l.parentBoundary=Al},"addContainer"),XXt=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=um(),l.typeC4Shape={text:t},l.parentBoundary=Al},"addComponent"),KXt=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=Al,s.wrap=um(),xh=Al,Al=t,ag.push(xh)},"addPersonOrSystemBoundary"),ZXt=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=Al,s.wrap=um(),xh=Al,Al=t,ag.push(xh)},"addContainerBoundary"),QXt=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=Al,l.wrap=um(),xh=Al,Al=e,ag.push(xh)},"addDeploymentNode"),JXt=w(function(){Al=xh,ag.pop(),xh=ag.pop(),ag.push(xh)},"popBoundaryParseStack"),eKt=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"),tKt=w(function(t,e,r,n,i,s,a){const o=eE.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"),rKt=w(function(t,e,r){let n=YL,i=jL;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&&(YL=n),i>=1&&(jL=i)},"updateLayoutConfig"),nKt=w(function(){return YL},"getC4ShapeInRow"),iKt=w(function(){return jL},"getC4BoundaryInRow"),sKt=w(function(){return Al},"getCurrentBoundaryParse"),aKt=w(function(){return xh},"getParentBoundaryParse"),mIe=w(function(t){return t==null?Rh:Rh.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),oKt=w(function(t){return Rh.find(e=>e.alias===t)},"getC4Shape"),lKt=w(function(t){return Object.keys(mIe(t))},"getC4ShapeKeys"),yIe=w(function(t){return t==null?Fd:Fd.filter(e=>e.parentBoundary===t)},"getBoundaries"),cKt=yIe,uKt=w(function(){return eE},"getRels"),hKt=w(function(){return gee},"getTitle"),dKt=w(function(t){mee=t},"setWrap"),um=w(function(){return mee},"autoWrap"),fKt=w(function(){Rh=[],Fd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],xh="",Al="global",ag=[""],eE=[],ag=[""],gee="",mee=!1,YL=4,jL=2},"clear"),pKt={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},gKt={FILLED:0,OPEN:1},mKt={LEFTOF:0,RIGHTOF:1,OVER:2},yKt=w(function(t){gee=Ln(t,Ve())},"setTitle"),Jq={addPersonOrSystem:YXt,addPersonOrSystemBoundary:KXt,addContainer:jXt,addContainerBoundary:ZXt,addComponent:XXt,addDeploymentNode:QXt,popBoundaryParseStack:JXt,addRel:UXt,updateElStyle:eKt,updateRelStyle:tKt,updateLayoutConfig:rKt,autoWrap:um,setWrap:dKt,getC4ShapeArray:mIe,getC4Shape:oKt,getC4ShapeKeys:lKt,getBoundaries:yIe,getBoundarys:cKt,getCurrentBoundaryParse:sKt,getParentBoundaryParse:aKt,getRels:uKt,getTitle:hKt,getC4Type:WXt,getC4ShapeInRow:nKt,getC4BoundaryInRow:iKt,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,getConfig:w(()=>Ve().c4,"getConfig"),clear:fKt,LINETYPE:pKt,ARROWTYPE:gKt,PLACEMENT:mKt,setTitle:yKt,setC4Type:qXt},yee=w(function(t,e){return mO(t,e)},"drawRect"),vIe=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:Qy.sanitizeUrl(s);a.attr("xlink:href",o)},"drawImage"),vKt=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"),bKt=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};yee(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"),xKt=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},yee(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=MKt(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":vIe(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"),wKt=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"),TKt=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"),CKt=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"),kKt=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"),SKt=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"),EKt=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"),AKt=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"),MKt=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>bIe)&&(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},tU(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(hx,"Bounds"),hx),tU=w(function(t){aa(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"),TC=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),pR=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),RKt=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=Jk(e[t].text,i,n),e[t].textLines=e[t].text.split(Vt.lineBreakRegex).length,e[t].width=i,e[t].height=a_(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(El(o,n),e[t].width),a=a_(o,n),e[t].height=e[t].height+a}}w(Tu,"calcC4ShapeTextWH");var wIe=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=pR(Sr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let s=El(e.label.text,i);Tu("label",e,n,i,s),ad.drawBoundary(t,e,Sr)},"drawBoundary"),TIe=w(function(t,e,r,n){let i=0;for(const s of n){i=0;const a=r[s];let o=TC(Sr,a.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,a.typeC4Shape.width=El("«"+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=TC(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=TC(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=TC(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=TC(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"),dx,su=(dx=class{constructor(e,r){this.x=e,this.y=r}},w(dx,"Point"),dx),nge=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"),_Kt=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=nge(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=nge(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),LKt=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=RKt(Sr);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=s+": "+a.label.text);let h=El(a.label.text,l);Tu("label",a,o,l,h),a.techn&&a.techn.text!==""&&(h=El(a.techn.text,l),Tu("techn",a,o,l,h)),a.descr&&a.descr.text!==""&&(h=El(a.descr.text,l),Tu("descr",a,o,l,h));let d=r(a.from),f=r(a.to),p=_Kt(d,f);a.startPoint=p.startPoint,a.endPoint=p.endPoint}ad.drawRels(t,e,Sr,i)},"drawRels");function vee(t,e,r,n,i){let s=new xIe(i);s.data.widthLimit=r.data.widthLimit/Math.min(eU,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=pR(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=pR(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=pR(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%eU===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&&TIe(s,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&vee(t,e,s,p,i),o.alias!=="global"&&wIe(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),XL=Math.max(XL,r.data.stopx),KL=Math.max(KL,r.data.stopy)}}w(vee,"drawInsideBoundary");var IKt=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),bIe=o.getC4ShapeInRow(),eU=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 xIe(n);u.setData(Sr.diagramMarginX,Sr.diagramMarginX,Sr.diagramMarginY,Sr.diagramMarginY),u.data.widthLimit=screen.availWidth,XL=Sr.diagramMarginX,KL=Sr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");vee(l,"",u,d,n),ad.insertArrowHead(l,e),ad.insertArrowEnd(l,e),ad.insertArrowCrossHead(l,e),ad.insertArrowFilledHead(l,e),LKt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=XL,u.data.stopy=KL;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"),ige={drawPersonOrSystemArray:TIe,drawBoundary:wIe,setConf:tU,draw:IKt},NKt=w(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),NKt=IKt,DKt={parser:HXt,db:Jq,renderer:nge,styles:NKt,init:w(({c4:t,wrap:e})=>{nge.setConf(t),Jq.setWrap(e)},"init")};const OKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:DKt},Symbol.toStringTag,{value:"Module"}));var _7=w(()=>` +`,"getStyles"),DKt=NKt,OKt={parser:GXt,db:Jq,renderer:ige,styles:DKt,init:w(({c4:t,wrap:e})=>{ige.setConf(t),Jq.setWrap(e)},"init")};const PKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:OKt},Symbol.toStringTag,{value:"Module"}));var _7=w(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -3166,21 +3166,21 @@ Expecting `+It.join(", ")+", got '"+(this.terminals_[st]||st)+"'":ft="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),R3=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"),lv=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:s,x:a,y:o}=PKt(t,e);Fs(t,s,i,n);const l=$Kt(a,o,i,s,e);t.attr("viewBox",l),de.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),PKt=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"),$Kt=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),BKt="flowchart-",fx,FKt=(fx=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"),R3=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"),lv=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:s,x:a,y:o}=$Kt(t,e);Fs(t,s,i,n);const l=BKt(a,o,i,s,e);t.attr("viewBox",l),de.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),$Kt=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"),BKt=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),FKt="flowchart-",fx,zKt=(fx=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=tD(m,{schema:eD})}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:BKt+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(!QSe(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=Lb(o.start,o.end,{counter:0,prefix:"L"}):o.id=Lb(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=tD(m,{schema:eD})}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:FKt+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(!JSe(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=Lb(o.start,o.end,{counter:0,prefix:"L"}):o.id=Lb(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=pee();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:Lb(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 bTe.flowchart}},w(fx,"FlowDB"),fx),zKt=w(function(t,e){return e.db.getClasses()},"getClasses"),VKt=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=R3(e,s),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=l7(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 h3(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()),lv(u,d,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),HKt={getClasses:zKt,draw:VKt},rU=(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),Io={yy:{}};for(var Vu in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Vu)&&(Io.yy[Vu]=this.yy[Vu]);An.setInput(kt,Io.yy),Io.yy.lexer=An,Io.yy.parser=this,typeof An.yylloc>"u"&&(An.yylloc={});var Fh=An.yylloc;Ie.push(Fh);var vm=An.options&&An.options.ranges;typeof Io.yy.parseError=="function"?this.parseError=Io.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function bm(jt){Pt.length=Pt.length-2*jt,ar.length=ar.length-jt,Ie.length=Ie.length-jt}w(bm,"popStack");function xm(){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(xm,"lex");for(var ma,Ul,oo,Js,kc={},ip,$t,Pe,nt;;){if(Ul=Pt[Pt.length-1],this.defaultActions[Ul]?oo=this.defaultActions[Ul]:((ma===null||typeof ma>"u")&&(ma=xm()),oo=ai[Ul]&&ai[Ul][ma]),typeof oo>"u"||!oo.length||!oo[0]){var _t="";nt=[];for(ip in ai[Ul])this.terminals_[ip]&&ip>gs&&nt.push("'"+this.terminals_[ip]+"'");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=pee();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:Lb(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 xTe.flowchart}},w(fx,"FlowDB"),fx),VKt=w(function(t,e){return e.db.getClasses()},"getClasses"),HKt=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=R3(e,s),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=l7(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 h3(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()),lv(u,d,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),GKt={getClasses:VKt,draw:HKt},rU=(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),Io={yy:{}};for(var Vu in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Vu)&&(Io.yy[Vu]=this.yy[Vu]);An.setInput(kt,Io.yy),Io.yy.lexer=An,Io.yy.parser=this,typeof An.yylloc>"u"&&(An.yylloc={});var Fh=An.yylloc;Ie.push(Fh);var vm=An.options&&An.options.ranges;typeof Io.yy.parseError=="function"?this.parseError=Io.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function bm(jt){Pt.length=Pt.length-2*jt,ar.length=ar.length-jt,Ie.length=Ie.length-jt}w(bm,"popStack");function xm(){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(xm,"lex");for(var ma,Ul,oo,Js,kc={},ip,$t,Pe,nt;;){if(Ul=Pt[Pt.length-1],this.defaultActions[Ul]?oo=this.defaultActions[Ul]:((ma===null||typeof ma>"u")&&(ma=xm()),oo=ai[Ul]&&ai[Ul][ma]),typeof oo>"u"||!oo.length||!oo[0]){var _t="";nt=[];for(ip in ai[Ul])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_[ma]||ma)+"'":_t="Parse error on line "+(un+1)+": Unexpected "+(ma==mn?"end of input":"'"+(this.terminals_[ma]||ma)+"'"),this.parseError(_t,{text:An.match,token:this.terminals_[ma]||ma,line:An.yylineno,loc:Fh,expected:nt})}if(oo[0]instanceof Array&&oo.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ul+", token: "+ma);switch(oo[0]){case 1:Pt.push(ma),ar.push(An.yytext),Ie.push(An.yylloc),Pt.push(oo[1]),ma=null,En=An.yyleng,Be=An.yytext,un=An.yylineno,Fh=An.yylloc;break;case 2:if($t=this.productions_[oo[1]][1],kc.$=ar[ar.length-$t],kc._$={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},vm&&(kc._$.range=[Ie[Ie.length-($t||1)].range[0],Ie[Ie.length-1].range[1]]),Js=this.performAction.apply(kc,[Be,En,un,Io.yy,oo[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_[oo[1]][0]),ar.push(kc.$),Ie.push(kc._$),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})();rU.parser=rU;var TIe=rU,CIe=Object.assign({},TIe);CIe.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return TIe.parse(e)};var GKt=CIe,WKt=w((t,e)=>{const r=CK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),qKt=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})();rU.parser=rU;var CIe=rU,kIe=Object.assign({},CIe);kIe.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return CIe.parse(e)};var WKt=kIe,qKt=w((t,e)=>{const r=CK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),UKt=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3261,7 +3261,7 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[ma]||ma)+"'":_t="Parse erro /* For html labels only */ .labelBkg { - background-color: ${WKt(t.edgeLabelBackground,.5)}; + background-color: ${qKt(t.edgeLabelBackground,.5)}; // background-color: } @@ -3321,19 +3321,19 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[ma]||ma)+"'":_t="Parse erro text-align: center; } ${_7()} -`,"getStyles"),kIe=qKt,bee=w(({defaultLayout:t,styles:e=kIe}={})=>({parser:GKt,get db(){return new FKt},renderer:HKt,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=dTe().layout??t??r.layout;n&&GH({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,GH({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),UKt=bee();const xee=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:bee,diagram:UKt},Symbol.toStringTag,{value:"Module"}));var YKt=w(t=>`${kIe(t)} +`,"getStyles"),SIe=UKt,bee=w(({defaultLayout:t,styles:e=SIe}={})=>({parser:WKt,get db(){return new zKt},renderer:GKt,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=fTe().layout??t??r.layout;n&&GH({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,GH({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),YKt=bee();const xee=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:bee,diagram:YKt},Symbol.toStringTag,{value:"Module"}));var jKt=w(t=>`${SIe(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),jKt=YKt,XKt=bee({defaultLayout:"swimlane",styles:jKt});const KKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:XKt},Symbol.toStringTag,{value:"Module"}));var nU=(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"),XKt=jKt,KKt=bee({defaultLayout:"swimlane",styles:XKt});const ZKt=Object.freeze(Object.defineProperty({__proto__:null,diagram:KKt},Symbol.toStringTag,{value:"Module"}));var nU=(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})();nU.parser=nU;var ZKt=nU,px,QKt=(px=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:Lb(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(px,"ErDB"),px),SIe={};zN(SIe,{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=R3(e,i);o.type=n.type,o.layoutAlgorithm=l7(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 h3(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()),lv(l,f,"erDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),ige=w((t,e)=>{const r=CK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),gR=new Set(["redux-color","redux-dark-color"]),eZt=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!gR.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})();nU.parser=nU;var QKt=nU,px,JKt=(px=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:Lb(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(px,"ErDB"),px),EIe={};zN(EIe,{draw:()=>eZt});var eZt=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=R3(e,i);o.type=n.type,o.layoutAlgorithm=l7(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 h3(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()),lv(l,f,"erDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),sge=w((t,e)=>{const r=CK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),gR=new Set(["redux-color","redux-dark-color"]),tZt=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!gR.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` - ${eZt(t)} + `;return a},"genColor"),rZt=w(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${tZt(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -3361,7 +3361,7 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse erro } .labelBkg { - background-color: ${gR.has(r)&&n?n:ige(t.tertiaryColor,.5)}; + background-color: ${gR.has(r)&&n?n:sge(t.tertiaryColor,.5)}; } .edgeLabel { @@ -3410,17 +3410,17 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Oe="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${ige(t.tertiaryColor,.5)}; + background-color: ${sge(t.tertiaryColor,.5)}; } -`},"getStyles"),rZt=tZt,nZt={parser:ZKt,get db(){return new QKt},renderer:SIe,styles:rZt};const iZt=Object.freeze(Object.defineProperty({__proto__:null,diagram:nZt},Symbol.toStringTag,{value:"Module"}));var gx,wee=(gx=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(gx,"ImperativeState"),gx);function Hl(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(Hl,"populateCommonDb");var sZt=Object.create,L7=Object.defineProperty,aZt=Object.getOwnPropertyDescriptor,Tee=Object.getOwnPropertyNames,oZt=Object.getPrototypeOf,lZt=Object.prototype.hasOwnProperty,M=(t,e)=>L7(t,"name",{value:e,configurable:!0}),cZt=(t,e)=>function(){return t&&(e=(0,t[Tee(t)[0]])(t=0)),e},pn=(t,e)=>function(){return e||(0,t[Tee(t)[0]])((e={exports:{}}).exports,e),e.exports},hm=(t,e)=>{for(var r in e)L7(t,r,{get:e[r],enumerable:!0})},Cee=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tee(e))!lZt.call(t,i)&&i!==r&&L7(t,i,{get:()=>e[i],enumerable:!(n=aZt(e,i))||n.enumerable});return t},yO=(t,e,r)=>(Cee(t,e,"default"),r),kee=(t,e,r)=>(r=t!=null?sZt(oZt(t)):{},Cee(L7(r,"default",{value:t,enumerable:!0}),t)),See=t=>Cee(L7({},"__esModule",{value:!0}),t),vO={};hm(vO,{AnnotatedTextEdit:()=>kf,ChangeAnnotation:()=>e1,ChangeAnnotationIdentifier:()=>ho,CodeAction:()=>$U,CodeActionContext:()=>PU,CodeActionKind:()=>OU,CodeActionTriggerKind:()=>wk,CodeDescription:()=>fU,CodeLens:()=>BU,Color:()=>yR,ColorInformation:()=>oU,ColorPresentation:()=>lU,Command:()=>Jm,CompletionItem:()=>CU,CompletionItemKind:()=>yU,CompletionItemLabelDetails:()=>TU,CompletionItemTag:()=>bU,CompletionList:()=>kU,CreateFile:()=>R2,DeleteFile:()=>L2,Diagnostic:()=>yk,DiagnosticRelatedInformation:()=>vR,DiagnosticSeverity:()=>hU,DiagnosticTag:()=>dU,DocumentHighlight:()=>RU,DocumentHighlightKind:()=>MU,DocumentLink:()=>zU,DocumentSymbol:()=>DU,DocumentUri:()=>iU,EOL:()=>AIe,FoldingRange:()=>uU,FoldingRangeKind:()=>cU,FormattingOptions:()=>FU,Hover:()=>SU,InlayHint:()=>XU,InlayHintKind:()=>wR,InlayHintLabelPart:()=>TR,InlineCompletionContext:()=>tY,InlineCompletionItem:()=>ZU,InlineCompletionList:()=>QU,InlineCompletionTriggerKind:()=>JU,InlineValueContext:()=>jU,InlineValueEvaluatableExpression:()=>YU,InlineValueText:()=>qU,InlineValueVariableLookup:()=>UU,InsertReplaceEdit:()=>xU,InsertTextFormat:()=>vU,InsertTextMode:()=>wU,Location:()=>mk,LocationLink:()=>aU,MarkedString:()=>xk,MarkupContent:()=>I2,MarkupKind:()=>xR,OptionalVersionedTextDocumentIdentifier:()=>bk,ParameterInformation:()=>EU,Position:()=>oi,Range:()=>$n,RenameFile:()=>_2,SelectedCompletionInfo:()=>eY,SelectionRange:()=>VU,SemanticTokenModifiers:()=>GU,SemanticTokenTypes:()=>HU,SemanticTokens:()=>WU,SignatureInformation:()=>AU,StringValue:()=>KU,SymbolInformation:()=>IU,SymbolKind:()=>_U,SymbolTag:()=>LU,TextDocument:()=>nY,TextDocumentEdit:()=>vk,TextDocumentIdentifier:()=>pU,TextDocumentItem:()=>mU,TextEdit:()=>Xh,URI:()=>mR,VersionedTextDocumentIdentifier:()=>gU,WorkspaceChange:()=>EIe,WorkspaceEdit:()=>bR,WorkspaceFolder:()=>rY,WorkspaceSymbol:()=>NU,integer:()=>sU,uinteger:()=>gk});var iU,mR,sU,gk,oi,$n,mk,aU,yR,oU,lU,cU,uU,vR,hU,dU,fU,yk,Jm,Xh,e1,ho,kf,vk,R2,_2,L2,bR,CC,Gz,EIe,pU,gU,bk,mU,xR,I2,yU,vU,bU,xU,wU,TU,CU,kU,xk,SU,EU,AU,MU,RU,_U,LU,IU,NU,DU,OU,wk,PU,$U,BU,FU,zU,VU,HU,GU,WU,qU,UU,YU,jU,wR,TR,XU,KU,ZU,QU,JU,eY,tY,rY,AIe,nY,sge,ot,I7=cZt({"../../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})(iU||(iU={})),(function(i){function s(a){return typeof a=="string"}M(s,"is"),i.is=s})(mR||(mR={})),(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})(sU||(sU={})),(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})(gk||(gk={})),(function(i){function s(o,l){return o===Number.MAX_VALUE&&(o=gk.MAX_VALUE),l===Number.MAX_VALUE&&(l=gk.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})(mk||(mk={})),(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})(aU||(aU={})),(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})(yR||(yR={})),(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)&&yR.is(l.color)}M(a,"is"),i.is=a})(oU||(oU={})),(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})(lU||(lU={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(cU||(cU={})),(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})(uU||(uU={})),(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)&&mk.is(l.location)&&ot.string(l.message)}M(a,"is"),i.is=a})(vR||(vR={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(hU||(hU={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(dU||(dU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&ot.string(o.href)}M(s,"is"),i.is=s})(fU||(fU={})),(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,vR.is))}M(a,"is"),i.is=a})(yk||(yk={})),(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})(Jm||(Jm={})),(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})(e1||(e1={})),(function(i){function s(a){const o=a;return ot.string(o)}M(s,"is"),i.is=s})(ho||(ho={})),(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)&&(e1.is(h.annotationId)||ho.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)&&bk.is(l.textDocument)&&Array.isArray(l.edits)}M(a,"is"),i.is=a})(vk||(vk={})),(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||ho.is(l.annotationId))}M(a,"is"),i.is=a})(R2||(R2={})),(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||ho.is(l.annotationId))}M(a,"is"),i.is=a})(_2||(_2={})),(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||ho.is(l.annotationId))}M(a,"is"),i.is=a})(L2||(L2={})),(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)?R2.is(l)||_2.is(l)||L2.is(l):vk.is(l)))}M(s,"is"),i.is=s})(bR||(bR={})),CC=(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):ho.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):ho.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):ho.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),Gz=(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(ho.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),EIe=(r=class{constructor(s){this._textEditChanges=Object.create(null),s!==void 0?(this._workspaceEdit=s,s.documentChanges?(this._changeAnnotations=new Gz(s.changeAnnotations),s.changeAnnotations=this._changeAnnotations.all(),s.documentChanges.forEach(a=>{if(vk.is(a)){const o=new CC(a.edits,this._changeAnnotations);this._textEditChanges[a.textDocument.uri]=o}})):s.changes&&Object.keys(s.changes).forEach(a=>{const o=new CC(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(bk.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 CC(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 CC(o),this._textEditChanges[s]=a}return a}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Gz,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;e1.is(a)||ho.is(a)?l=a:o=a;let u,h;if(l===void 0?u=R2.create(s,o):(h=ho.is(l)?l:this._changeAnnotations.manage(l),u=R2.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;e1.is(o)||ho.is(o)?u=o:l=o;let h,d;if(u===void 0?h=_2.create(s,a,l):(d=ho.is(u)?u:this._changeAnnotations.manage(u),h=_2.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;e1.is(a)||ho.is(a)?l=a:o=a;let u,h;if(l===void 0?u=L2.create(s,o):(h=ho.is(l)?l:this._changeAnnotations.manage(l),u=L2.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})(pU||(pU={})),(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})(gU||(gU={})),(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})(bk||(bk={})),(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})(mU||(mU={})),(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})(xR||(xR={})),(function(i){function s(a){const o=a;return ot.objectLiteral(a)&&xR.is(o.kind)&&ot.string(o.value)}M(s,"is"),i.is=s})(I2||(I2={})),(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})(yU||(yU={})),(function(i){i.PlainText=1,i.Snippet=2})(vU||(vU={})),(function(i){i.Deprecated=1})(bU||(bU={})),(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})(xU||(xU={})),(function(i){i.asIs=1,i.adjustIndentation=2})(wU||(wU={})),(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})(TU||(TU={})),(function(i){function s(a){return{label:a}}M(s,"create"),i.create=s})(CU||(CU={})),(function(i){function s(a,o){return{items:a||[],isIncomplete:!!o}}M(s,"create"),i.create=s})(kU||(kU={})),(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})(xk||(xk={})),(function(i){function s(a){let o=a;return!!o&&ot.objectLiteral(o)&&(I2.is(o.contents)||xk.is(o.contents)||ot.typedArray(o.contents,xk.is))&&(a.range===void 0||$n.is(a.range))}M(s,"is"),i.is=s})(SU||(SU={})),(function(i){function s(a,o){return o?{label:a,documentation:o}:{label:a}}M(s,"create"),i.create=s})(EU||(EU={})),(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})(AU||(AU={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(MU||(MU={})),(function(i){function s(a,o){let l={range:a};return ot.number(o)&&(l.kind=o),l}M(s,"create"),i.create=s})(RU||(RU={})),(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})(_U||(_U={})),(function(i){i.Deprecated=1})(LU||(LU={})),(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})(IU||(IU={})),(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})(NU||(NU={})),(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})(DU||(DU={})),(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"})(OU||(OU={})),(function(i){i.Invoked=1,i.Automatic=2})(wk||(wk={})),(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,yk.is)&&(l.only===void 0||ot.typedArray(l.only,ot.string))&&(l.triggerKind===void 0||l.triggerKind===wk.Invoked||l.triggerKind===wk.Automatic)}M(a,"is"),i.is=a})(PU||(PU={})),(function(i){function s(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Jm.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,yk.is))&&(l.kind===void 0||ot.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Jm.is(l.command))&&(l.isPreferred===void 0||ot.boolean(l.isPreferred))&&(l.edit===void 0||bR.is(l.edit))}M(a,"is"),i.is=a})($U||($U={})),(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)||Jm.is(l.command))}M(a,"is"),i.is=a})(BU||(BU={})),(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})(FU||(FU={})),(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})(zU||(zU={})),(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})(VU||(VU={})),(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"})(HU||(HU={})),(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"})(GU||(GU={})),(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})(WU||(WU={})),(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})(qU||(qU={})),(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})(UU||(UU={})),(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})(YU||(YU={})),(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})(jU||(jU={})),(function(i){i.Type=1,i.Parameter=2;function s(a){return a===1||a===2}M(s,"is"),i.is=s})(wR||(wR={})),(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)||I2.is(l.tooltip))&&(l.location===void 0||mk.is(l.location))&&(l.command===void 0||Jm.is(l.command))}M(a,"is"),i.is=a})(TR||(TR={})),(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,TR.is))&&(l.kind===void 0||wR.is(l.kind))&&l.textEdits===void 0||ot.typedArray(l.textEdits,Xh.is)&&(l.tooltip===void 0||ot.string(l.tooltip)||I2.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})(XU||(XU={})),(function(i){function s(a){return{kind:"snippet",value:a}}M(s,"createSnippet"),i.createSnippet=s})(KU||(KU={})),(function(i){function s(a,o,l,u){return{insertText:a,filterText:o,range:l,command:u}}M(s,"create"),i.create=s})(ZU||(ZU={})),(function(i){function s(a){return{items:a}}M(s,"create"),i.create=s})(QU||(QU={})),(function(i){i.Invoked=0,i.Automatic=1})(JU||(JU={})),(function(i){function s(a,o){return{range:a,text:o}}M(s,"create"),i.create=s})(eY||(eY={})),(function(i){function s(a,o){return{triggerKind:a,selectedCompletionInfo:o}}M(s,"create"),i.create=s})(tY||(tY={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&mR.is(o.uri)&&ot.string(o.name)}M(s,"is"),i.is=s})(rY||(rY={})),AIe=[` +`},"getStyles"),nZt=rZt,iZt={parser:QKt,get db(){return new JKt},renderer:EIe,styles:nZt};const sZt=Object.freeze(Object.defineProperty({__proto__:null,diagram:iZt},Symbol.toStringTag,{value:"Module"}));var gx,wee=(gx=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(gx,"ImperativeState"),gx);function Hl(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(Hl,"populateCommonDb");var aZt=Object.create,L7=Object.defineProperty,oZt=Object.getOwnPropertyDescriptor,Tee=Object.getOwnPropertyNames,lZt=Object.getPrototypeOf,cZt=Object.prototype.hasOwnProperty,M=(t,e)=>L7(t,"name",{value:e,configurable:!0}),uZt=(t,e)=>function(){return t&&(e=(0,t[Tee(t)[0]])(t=0)),e},pn=(t,e)=>function(){return e||(0,t[Tee(t)[0]])((e={exports:{}}).exports,e),e.exports},hm=(t,e)=>{for(var r in e)L7(t,r,{get:e[r],enumerable:!0})},Cee=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tee(e))!cZt.call(t,i)&&i!==r&&L7(t,i,{get:()=>e[i],enumerable:!(n=oZt(e,i))||n.enumerable});return t},yO=(t,e,r)=>(Cee(t,e,"default"),r),kee=(t,e,r)=>(r=t!=null?aZt(lZt(t)):{},Cee(L7(r,"default",{value:t,enumerable:!0}),t)),See=t=>Cee(L7({},"__esModule",{value:!0}),t),vO={};hm(vO,{AnnotatedTextEdit:()=>kf,ChangeAnnotation:()=>e1,ChangeAnnotationIdentifier:()=>ho,CodeAction:()=>$U,CodeActionContext:()=>PU,CodeActionKind:()=>OU,CodeActionTriggerKind:()=>wk,CodeDescription:()=>fU,CodeLens:()=>BU,Color:()=>yR,ColorInformation:()=>oU,ColorPresentation:()=>lU,Command:()=>Jm,CompletionItem:()=>CU,CompletionItemKind:()=>yU,CompletionItemLabelDetails:()=>TU,CompletionItemTag:()=>bU,CompletionList:()=>kU,CreateFile:()=>R2,DeleteFile:()=>L2,Diagnostic:()=>yk,DiagnosticRelatedInformation:()=>vR,DiagnosticSeverity:()=>hU,DiagnosticTag:()=>dU,DocumentHighlight:()=>RU,DocumentHighlightKind:()=>MU,DocumentLink:()=>zU,DocumentSymbol:()=>DU,DocumentUri:()=>iU,EOL:()=>MIe,FoldingRange:()=>uU,FoldingRangeKind:()=>cU,FormattingOptions:()=>FU,Hover:()=>SU,InlayHint:()=>XU,InlayHintKind:()=>wR,InlayHintLabelPart:()=>TR,InlineCompletionContext:()=>tY,InlineCompletionItem:()=>ZU,InlineCompletionList:()=>QU,InlineCompletionTriggerKind:()=>JU,InlineValueContext:()=>jU,InlineValueEvaluatableExpression:()=>YU,InlineValueText:()=>qU,InlineValueVariableLookup:()=>UU,InsertReplaceEdit:()=>xU,InsertTextFormat:()=>vU,InsertTextMode:()=>wU,Location:()=>mk,LocationLink:()=>aU,MarkedString:()=>xk,MarkupContent:()=>I2,MarkupKind:()=>xR,OptionalVersionedTextDocumentIdentifier:()=>bk,ParameterInformation:()=>EU,Position:()=>oi,Range:()=>$n,RenameFile:()=>_2,SelectedCompletionInfo:()=>eY,SelectionRange:()=>VU,SemanticTokenModifiers:()=>GU,SemanticTokenTypes:()=>HU,SemanticTokens:()=>WU,SignatureInformation:()=>AU,StringValue:()=>KU,SymbolInformation:()=>IU,SymbolKind:()=>_U,SymbolTag:()=>LU,TextDocument:()=>nY,TextDocumentEdit:()=>vk,TextDocumentIdentifier:()=>pU,TextDocumentItem:()=>mU,TextEdit:()=>Xh,URI:()=>mR,VersionedTextDocumentIdentifier:()=>gU,WorkspaceChange:()=>AIe,WorkspaceEdit:()=>bR,WorkspaceFolder:()=>rY,WorkspaceSymbol:()=>NU,integer:()=>sU,uinteger:()=>gk});var iU,mR,sU,gk,oi,$n,mk,aU,yR,oU,lU,cU,uU,vR,hU,dU,fU,yk,Jm,Xh,e1,ho,kf,vk,R2,_2,L2,bR,CC,Gz,AIe,pU,gU,bk,mU,xR,I2,yU,vU,bU,xU,wU,TU,CU,kU,xk,SU,EU,AU,MU,RU,_U,LU,IU,NU,DU,OU,wk,PU,$U,BU,FU,zU,VU,HU,GU,WU,qU,UU,YU,jU,wR,TR,XU,KU,ZU,QU,JU,eY,tY,rY,MIe,nY,age,ot,I7=uZt({"../../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})(iU||(iU={})),(function(i){function s(a){return typeof a=="string"}M(s,"is"),i.is=s})(mR||(mR={})),(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})(sU||(sU={})),(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})(gk||(gk={})),(function(i){function s(o,l){return o===Number.MAX_VALUE&&(o=gk.MAX_VALUE),l===Number.MAX_VALUE&&(l=gk.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})(mk||(mk={})),(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})(aU||(aU={})),(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})(yR||(yR={})),(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)&&yR.is(l.color)}M(a,"is"),i.is=a})(oU||(oU={})),(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})(lU||(lU={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(cU||(cU={})),(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})(uU||(uU={})),(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)&&mk.is(l.location)&&ot.string(l.message)}M(a,"is"),i.is=a})(vR||(vR={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(hU||(hU={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(dU||(dU={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&ot.string(o.href)}M(s,"is"),i.is=s})(fU||(fU={})),(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,vR.is))}M(a,"is"),i.is=a})(yk||(yk={})),(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})(Jm||(Jm={})),(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})(e1||(e1={})),(function(i){function s(a){const o=a;return ot.string(o)}M(s,"is"),i.is=s})(ho||(ho={})),(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)&&(e1.is(h.annotationId)||ho.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)&&bk.is(l.textDocument)&&Array.isArray(l.edits)}M(a,"is"),i.is=a})(vk||(vk={})),(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||ho.is(l.annotationId))}M(a,"is"),i.is=a})(R2||(R2={})),(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||ho.is(l.annotationId))}M(a,"is"),i.is=a})(_2||(_2={})),(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||ho.is(l.annotationId))}M(a,"is"),i.is=a})(L2||(L2={})),(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)?R2.is(l)||_2.is(l)||L2.is(l):vk.is(l)))}M(s,"is"),i.is=s})(bR||(bR={})),CC=(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):ho.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):ho.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):ho.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),Gz=(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(ho.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),AIe=(r=class{constructor(s){this._textEditChanges=Object.create(null),s!==void 0?(this._workspaceEdit=s,s.documentChanges?(this._changeAnnotations=new Gz(s.changeAnnotations),s.changeAnnotations=this._changeAnnotations.all(),s.documentChanges.forEach(a=>{if(vk.is(a)){const o=new CC(a.edits,this._changeAnnotations);this._textEditChanges[a.textDocument.uri]=o}})):s.changes&&Object.keys(s.changes).forEach(a=>{const o=new CC(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(bk.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 CC(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 CC(o),this._textEditChanges[s]=a}return a}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Gz,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;e1.is(a)||ho.is(a)?l=a:o=a;let u,h;if(l===void 0?u=R2.create(s,o):(h=ho.is(l)?l:this._changeAnnotations.manage(l),u=R2.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;e1.is(o)||ho.is(o)?u=o:l=o;let h,d;if(u===void 0?h=_2.create(s,a,l):(d=ho.is(u)?u:this._changeAnnotations.manage(u),h=_2.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;e1.is(a)||ho.is(a)?l=a:o=a;let u,h;if(l===void 0?u=L2.create(s,o):(h=ho.is(l)?l:this._changeAnnotations.manage(l),u=L2.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})(pU||(pU={})),(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})(gU||(gU={})),(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})(bk||(bk={})),(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})(mU||(mU={})),(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})(xR||(xR={})),(function(i){function s(a){const o=a;return ot.objectLiteral(a)&&xR.is(o.kind)&&ot.string(o.value)}M(s,"is"),i.is=s})(I2||(I2={})),(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})(yU||(yU={})),(function(i){i.PlainText=1,i.Snippet=2})(vU||(vU={})),(function(i){i.Deprecated=1})(bU||(bU={})),(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})(xU||(xU={})),(function(i){i.asIs=1,i.adjustIndentation=2})(wU||(wU={})),(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})(TU||(TU={})),(function(i){function s(a){return{label:a}}M(s,"create"),i.create=s})(CU||(CU={})),(function(i){function s(a,o){return{items:a||[],isIncomplete:!!o}}M(s,"create"),i.create=s})(kU||(kU={})),(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})(xk||(xk={})),(function(i){function s(a){let o=a;return!!o&&ot.objectLiteral(o)&&(I2.is(o.contents)||xk.is(o.contents)||ot.typedArray(o.contents,xk.is))&&(a.range===void 0||$n.is(a.range))}M(s,"is"),i.is=s})(SU||(SU={})),(function(i){function s(a,o){return o?{label:a,documentation:o}:{label:a}}M(s,"create"),i.create=s})(EU||(EU={})),(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})(AU||(AU={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(MU||(MU={})),(function(i){function s(a,o){let l={range:a};return ot.number(o)&&(l.kind=o),l}M(s,"create"),i.create=s})(RU||(RU={})),(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})(_U||(_U={})),(function(i){i.Deprecated=1})(LU||(LU={})),(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})(IU||(IU={})),(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})(NU||(NU={})),(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})(DU||(DU={})),(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"})(OU||(OU={})),(function(i){i.Invoked=1,i.Automatic=2})(wk||(wk={})),(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,yk.is)&&(l.only===void 0||ot.typedArray(l.only,ot.string))&&(l.triggerKind===void 0||l.triggerKind===wk.Invoked||l.triggerKind===wk.Automatic)}M(a,"is"),i.is=a})(PU||(PU={})),(function(i){function s(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Jm.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,yk.is))&&(l.kind===void 0||ot.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Jm.is(l.command))&&(l.isPreferred===void 0||ot.boolean(l.isPreferred))&&(l.edit===void 0||bR.is(l.edit))}M(a,"is"),i.is=a})($U||($U={})),(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)||Jm.is(l.command))}M(a,"is"),i.is=a})(BU||(BU={})),(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})(FU||(FU={})),(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})(zU||(zU={})),(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})(VU||(VU={})),(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"})(HU||(HU={})),(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"})(GU||(GU={})),(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})(WU||(WU={})),(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})(qU||(qU={})),(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})(UU||(UU={})),(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})(YU||(YU={})),(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})(jU||(jU={})),(function(i){i.Type=1,i.Parameter=2;function s(a){return a===1||a===2}M(s,"is"),i.is=s})(wR||(wR={})),(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)||I2.is(l.tooltip))&&(l.location===void 0||mk.is(l.location))&&(l.command===void 0||Jm.is(l.command))}M(a,"is"),i.is=a})(TR||(TR={})),(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,TR.is))&&(l.kind===void 0||wR.is(l.kind))&&l.textEdits===void 0||ot.typedArray(l.textEdits,Xh.is)&&(l.tooltip===void 0||ot.string(l.tooltip)||I2.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})(XU||(XU={})),(function(i){function s(a){return{kind:"snippet",value:a}}M(s,"createSnippet"),i.createSnippet=s})(KU||(KU={})),(function(i){function s(a,o,l,u){return{insertText:a,filterText:o,range:l,command:u}}M(s,"create"),i.create=s})(ZU||(ZU={})),(function(i){function s(a){return{items:a}}M(s,"create"),i.create=s})(QU||(QU={})),(function(i){i.Invoked=0,i.Automatic=1})(JU||(JU={})),(function(i){function s(a,o){return{range:a,text:o}}M(s,"create"),i.create=s})(eY||(eY={})),(function(i){function s(a,o){return{triggerKind:a,selectedCompletionInfo:o}}M(s,"create"),i.create=s})(tY||(tY={})),(function(i){function s(a){const o=a;return ot.objectLiteral(o)&&mR.is(o.uri)&&ot.string(o.name)}M(s,"is"),i.is=s})(rY||(rY={})),MIe=[` `,`\r -`,"\r"],(function(i){function s(u,h,d,f){return new sge(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 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={}))}}),cv=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}}),N7=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}}),_3=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=cv(),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(){}}}),bO=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=cv(),r=N7(),n=_3(),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}}),MIe=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=N7(),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={}))}}),RIe=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}}),uZt=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={}))}}),hZt=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=bO(),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}}),_Ie=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=cv(),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}}),dZt=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=cv(),r=N7(),n=_3(),i=_Ie(),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}}),fZt=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=cv(),r=N7(),n=_Ie(),i=_3(),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}}),pZt=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={}))}}),cv=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}}),N7=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}}),_3=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=cv(),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(){}}}),bO=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=cv(),r=N7(),n=_3(),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}}),RIe=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=N7(),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={}))}}),_Ie=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}}),hZt=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={}))}}),dZt=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=bO(),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}}),LIe=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=cv(),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}}),fZt=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=cv(),r=N7(),n=_3(),i=LIe(),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}}),pZt=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=cv(),r=N7(),n=LIe(),i=_3(),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}}),gZt=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}}),gZt=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=cv(),r=N7(),n=MIe(),i=RIe(),s=_3(),a=bO(),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: +${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}}),mZt=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=cv(),r=N7(),n=RIe(),i=_Ie(),s=_3(),a=bO(),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)} @@ -3446,19 +3446,19 @@ ${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 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}}),iY=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=MIe();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=RIe();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=uZt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:M(function(){return n.Disposable},"get")});var i=_3();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=bO();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=hZt();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=dZt();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=fZt();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=pZt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:M(function(){return u.AbstractMessageBuffer},"get")});var h=gZt();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=cv();t.RAL=d.default}}),mZt=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=iY(),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}}),L3=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=mZt();n.default.install();var i=iY();r(iY(),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}}),age=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=L3()}}),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=L3(),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}}),Eee=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}}),yZt=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={}))}}),vZt=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={}))}}),bZt=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={}))}}),xZt=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={}))}}),wZt=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={}))}}),CZt=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={}))}}),kZt=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={}))}}),SZt=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=L3(),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={}))}}),EZt=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={}))}}),MZt=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={}))}}),RZt=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={}))}}),_Zt=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={}))}}),LZt=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={}))}}),IZt=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={}))}}),NZt=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={}))}}),DZt=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={}))}}),OZt=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=L3(),r=Eee(),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={}))}}),PZt=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=(I7(),See(vO)),r=Eee(),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={}))}}),FZt=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=L3();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}}),zZt=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(L3(),t),r((I7(),See(vO)),t),r(Es(),t),r(BZt(),t);var n=FZt();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={}))}}),VZt=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=age();r(age(),t),r(zZt(),t);function i(s,a,o,l){return(0,n.createMessageConnection)(s,a,o,l)}M(i,"createProtocolConnection"),t.createProtocolConnection=i}}),LIe={};hm(LIe,{AbstractAstReflection:()=>Ree,AbstractCstNode:()=>Lre,AbstractLangiumParser:()=>Nre,AbstractParserErrorMessageProvider:()=>vHe,AbstractThreadedAsyncParser:()=>fcr,AstUtils:()=>_ee,BiMap:()=>DI,Cancellation:()=>$i,CompositeCstNodeImpl:()=>gP,ContextCache:()=>TP,CstNodeBuilder:()=>gHe,CstUtils:()=>Aee,DEFAULT_TOKENIZE_OPTIONS:()=>Zre,DONE_RESULT:()=>pl,DatatypeSymbol:()=>_I,DefaultAstNodeDescriptionProvider:()=>jHe,DefaultAstNodeLocator:()=>KHe,DefaultAsyncParser:()=>pGe,DefaultCommentProvider:()=>fGe,DefaultConfigurationProvider:()=>ZHe,DefaultDocumentBuilder:()=>QHe,DefaultDocumentValidator:()=>YHe,DefaultHydrator:()=>mGe,DefaultIndexManager:()=>JHe,DefaultJsonSerializer:()=>GHe,DefaultLangiumDocumentFactory:()=>DHe,DefaultLangiumDocuments:()=>OHe,DefaultLangiumProfiler:()=>vcr,DefaultLexer:()=>Qre,DefaultLexerErrorMessageProvider:()=>tGe,DefaultLinker:()=>PHe,DefaultNameProvider:()=>$He,DefaultReferenceDescriptionProvider:()=>XHe,DefaultReferences:()=>BHe,DefaultScopeComputation:()=>FHe,DefaultScopeProvider:()=>HHe,DefaultServiceRegistry:()=>WHe,DefaultTokenBuilder:()=>vP,DefaultValueConverter:()=>zre,DefaultWorkspaceLock:()=>gGe,DefaultWorkspaceManager:()=>eGe,Deferred:()=>D0,Disposable:()=>sy,DisposableCache:()=>wP,DocumentCache:()=>VHe,DocumentState:()=>Mn,DocumentValidator:()=>yu,EMPTY_SCOPE:()=>ccr,EMPTY_STREAM:()=>L5,EmptyFileSystem:()=>Lo,EmptyFileSystemProvider:()=>bGe,ErrorWithLocation:()=>MO,GrammarAST:()=>DIe,GrammarUtils:()=>ate,IndentationAwareLexer:()=>gcr,IndentationAwareTokenBuilder:()=>vGe,JSDocDocumentationProvider:()=>dGe,LangiumCompletionParser:()=>bHe,LangiumParser:()=>yHe,LangiumParserErrorMessageProvider:()=>Dre,LeafCstNodeImpl:()=>RI,LexingMode:()=>q1,MapScope:()=>lcr,Module:()=>BY,MultiMap:()=>O0,MultiMapScope:()=>zHe,OperationCancelled:()=>xd,ParserWorker:()=>pcr,ProfilingTask:()=>wGe,Reduction:()=>rE,RefResolving:()=>i1,RegExpUtils:()=>lte,RootCstNodeImpl:()=>Ire,SimpleCache:()=>Ure,StreamImpl:()=>bd,StreamScope:()=>DY,TextDocument:()=>II,TreeStreamImpl:()=>I5,URI:()=>Hc,UriTrie:()=>Wre,UriUtils:()=>Sl,VALIDATE_EACH_NODE:()=>UHe,ValidationCategory:()=>OI,ValidationRegistry:()=>qHe,ValueConverter:()=>od,WorkspaceCache:()=>Yre,assertCondition:()=>ote,assertUnreachable:()=>dm,createCompletionParser:()=>$re,createDefaultCoreModule:()=>no,createDefaultSharedCoreModule:()=>io,createGrammarConfig:()=>Ete,createLangiumParser:()=>Bre,createParser:()=>mP,delayNextTick:()=>bP,diagnosticData:()=>W1,eagerLoad:()=>sne,getDiagnosticRange:()=>Xre,indentationBuilderDefaultOptions:()=>zY,inject:()=>Hn,interruptAndCheck:()=>Va,isAstNode:()=>oa,isAstNodeDescription:()=>Mee,isAstNodeWithComment:()=>jre,isCompositeCstNode:()=>E0,isIMultiModeLexerDefinition:()=>SP,isJSDoc:()=>ene,isLeafCstNode:()=>uv,isLinkingError:()=>g1,isMultiReference:()=>Md,isNamed:()=>qre,isOperationCancelled:()=>Rv,isReference:()=>kl,isRootCstNode:()=>xO,isTokenTypeArray:()=>kP,isTokenTypeDictionary:()=>PI,loadGrammarFromJson:()=>so,parseJSDoc:()=>Jre,prepareLangiumParser:()=>Fre,setInterruptionPeriod:()=>Vre,startCancelableOperation:()=>xP,stream:()=>yi,toDiagnosticData:()=>Kre,toDiagnosticSeverity:()=>AS});var Aee={};hm(Aee,{DefaultNameRegexp:()=>tte,RangeComparison:()=>hd,compareRange:()=>Jee,findCommentNode:()=>rte,findDeclarationNodeAtOffset:()=>JIe,findLeafNodeAtOffset:()=>AO,findLeafNodeBeforeOffset:()=>nte,flattenCst:()=>QIe,getDatatypeNode:()=>ZIe,getInteriorNodes:()=>rNe,getNextNode:()=>eNe,getPreviousNode:()=>ste,getStartlineNode:()=>tNe,inRange:()=>ete,isChildNode:()=>Qee,isCommentNode:()=>fI,streamCst:()=>P5,toDocumentSegment:()=>$5,tokenToRange:()=>nE});function oa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}M(oa,"isAstNode");function kl(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}M(kl,"isReference");function Md(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}M(Md,"isMultiReference");function Mee(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}M(Mee,"isAstNodeDescription");function g1(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}M(g1,"isLinkingError");var mx,Ree=(mx=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 oa(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(mx,"AbstractAstReflection"),mx);function E0(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}M(E0,"isCompositeCstNode");function uv(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}M(uv,"isLeafCstNode");function xO(t){return E0(t)&&typeof t.fullText=="string"}M(xO,"isRootCstNode");var rc,bd=(rc=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 rc(()=>({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 pl})}join(e=","){const r=this.iterator();let n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=IIe(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 rc(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?pl:{done:!1,value:e(i)}})}filter(e){return new rc(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return pl})}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 rc(()=>({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(tE(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return pl})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new rc(()=>({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(tE(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return pl})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new rc(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?pl:this.nextFn(r.state)))}distinct(e){return new rc(()=>({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 pl})}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(rc,"StreamImpl"),rc);function IIe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}M(IIe,"toString");function tE(t){return!!t&&typeof t[Symbol.iterator]=="function"}M(tE,"isIterable");var L5=new bd(()=>{},()=>pl),pl=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(tE(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 pl})}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(yx,"TreeStreamImpl"),yx),rE;(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})(rE||(rE={}));var _ee={};hm(_ee,{assignMandatoryProperties:()=>Lee,copyAstNode:()=>JL,findRootNode:()=>Gb,getContainerOfType:()=>hv,getDocument:()=>wh,getReferenceNodes:()=>ZL,hasContainerOfType:()=>NIe,linkContentToContainer:()=>N5,streamAllContents:()=>Q0,streamAst:()=>Th,streamContents:()=>D7,streamReferences:()=>D5});function N5(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,s)=>{oa(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=s,e.deep&&N5(i,e))}):oa(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&N5(n,e)))}M(N5,"linkContentToContainer");function hv(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}M(hv,"getContainerOfType");function NIe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}M(NIe,"hasContainerOfType");function wh(t){const r=Gb(t).$document;if(!r)throw new Error("AST node has no document.");return r}M(wh,"getDocument");function Gb(t){for(;t.$container;)t=t.$container;return t}M(Gb,"findRootNode");function ZL(t){return kl(t)?t.ref?[t.ref]:[]:Md(t)?t.items.map(e=>e.ref):[]}M(ZL,"getReferenceNodes");function D7(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.keyIndexD7(r,e))}M(Q0,"streamAllContents");function Th(t,e){if(t){if(e!=null&&e.range&&!QL(t,e.range))return new I5(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new I5(t,r=>D7(r,e),{includeRoot:!0})}M(Th,"streamAst");function QL(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?ete(r,e):!1}M(QL,"isAstNodeInRange");function D5(t){return new bd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexKl,AbstractParserRule:()=>fS,AbstractRule:()=>lb,AbstractType:()=>Mc,Action:()=>Mp,Alternatives:()=>pS,ArrayLiteral:()=>eI,ArrayType:()=>tI,Assignment:()=>Rp,BooleanLiteral:()=>rI,CharacterRange:()=>_p,Condition:()=>Lp,Conjunction:()=>gS,CrossReference:()=>Ip,Disjunction:()=>mS,EndOfFile:()=>nI,Grammar:()=>Af,GrammarImport:()=>iI,Group:()=>m1,InferredType:()=>sI,InfixRule:()=>td,InfixRuleOperatorList:()=>yS,InfixRuleOperators:()=>aI,Interface:()=>cb,Keyword:()=>ub,LangiumGrammarAstReflection:()=>Zee,LangiumGrammarTerminals:()=>HZt,NamedArgument:()=>hb,NegatedToken:()=>y1,Negation:()=>oI,NumberLiteral:()=>lI,Parameter:()=>db,ParameterReference:()=>cI,ParserRule:()=>Yu,ReferenceType:()=>vS,RegexToken:()=>v1,ReturnType:()=>uI,RuleCall:()=>b1,SimpleType:()=>fb,StringLiteral:()=>hI,TerminalAlternatives:()=>x1,TerminalElement:()=>Zl,TerminalGroup:()=>w1,TerminalRule:()=>Mf,TerminalRuleCall:()=>T1,Type:()=>bS,TypeAttribute:()=>C1,TypeDefinition:()=>k1,UnionType:()=>dI,UnorderedGroup:()=>xS,UntilToken:()=>S1,ValueLiteral:()=>E1,Wildcard:()=>pb,isAbstractElement:()=>wO,isAbstractParserRule:()=>dv,isAbstractRule:()=>OIe,isAbstractType:()=>PIe,isAction:()=>Og,isAlternatives:()=>TO,isArrayLiteral:()=>$Ie,isArrayType:()=>Nee,isAssignment:()=>A0,isBooleanLiteral:()=>Dee,isCharacterRange:()=>Oee,isCondition:()=>BIe,isConjunction:()=>Pee,isCrossReference:()=>fv,isDisjunction:()=>$ee,isEndOfFile:()=>Bee,isGrammar:()=>FIe,isGrammarImport:()=>zIe,isGroup:()=>pv,isInferredType:()=>O7,isInfixRule:()=>O5,isInfixRuleOperatorList:()=>VIe,isInfixRuleOperators:()=>HIe,isInterface:()=>Fee,isKeyword:()=>M0,isNamedArgument:()=>GIe,isNegatedToken:()=>zee,isNegation:()=>Vee,isNumberLiteral:()=>WIe,isParameter:()=>qIe,isParameterReference:()=>Hee,isParserRule:()=>Nl,isReferenceType:()=>Gee,isRegexToken:()=>Wee,isReturnType:()=>qee,isRuleCall:()=>R0,isSimpleType:()=>CO,isStringLiteral:()=>UIe,isTerminalAlternatives:()=>Uee,isTerminalElement:()=>YIe,isTerminalGroup:()=>Yee,isTerminalRule:()=>Bu,isTerminalRuleCall:()=>kO,isType:()=>SO,isTypeAttribute:()=>jIe,isTypeDefinition:()=>XIe,isUnionType:()=>jee,isUnorderedGroup:()=>EO,isUntilToken:()=>Xee,isValueLiteral:()=>KIe,isWildcard:()=>Kee,reflection:()=>qr});var HZt={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]*/},Kl={$type:"AbstractElement",cardinality:"cardinality"};function wO(t){return qr.isInstance(t,Kl.$type)}M(wO,"isAbstractElement");var fS={$type:"AbstractParserRule"};function dv(t){return qr.isInstance(t,fS.$type)}M(dv,"isAbstractParserRule");var lb={$type:"AbstractRule"};function OIe(t){return qr.isInstance(t,lb.$type)}M(OIe,"isAbstractRule");var Mc={$type:"AbstractType"};function PIe(t){return qr.isInstance(t,Mc.$type)}M(PIe,"isAbstractType");var Mp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Og(t){return qr.isInstance(t,Mp.$type)}M(Og,"isAction");var pS={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function TO(t){return qr.isInstance(t,pS.$type)}M(TO,"isAlternatives");var eI={$type:"ArrayLiteral",elements:"elements"};function $Ie(t){return qr.isInstance(t,eI.$type)}M($Ie,"isArrayLiteral");var tI={$type:"ArrayType",elementType:"elementType"};function Nee(t){return qr.isInstance(t,tI.$type)}M(Nee,"isArrayType");var Rp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function A0(t){return qr.isInstance(t,Rp.$type)}M(A0,"isAssignment");var rI={$type:"BooleanLiteral",true:"true"};function Dee(t){return qr.isInstance(t,rI.$type)}M(Dee,"isBooleanLiteral");var _p={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Oee(t){return qr.isInstance(t,_p.$type)}M(Oee,"isCharacterRange");var Lp={$type:"Condition"};function BIe(t){return qr.isInstance(t,Lp.$type)}M(BIe,"isCondition");var gS={$type:"Conjunction",left:"left",right:"right"};function Pee(t){return qr.isInstance(t,gS.$type)}M(Pee,"isConjunction");var Ip={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function fv(t){return qr.isInstance(t,Ip.$type)}M(fv,"isCrossReference");var mS={$type:"Disjunction",left:"left",right:"right"};function $ee(t){return qr.isInstance(t,mS.$type)}M($ee,"isDisjunction");var nI={$type:"EndOfFile",cardinality:"cardinality"};function Bee(t){return qr.isInstance(t,nI.$type)}M(Bee,"isEndOfFile");var Af={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function FIe(t){return qr.isInstance(t,Af.$type)}M(FIe,"isGrammar");var iI={$type:"GrammarImport",path:"path"};function zIe(t){return qr.isInstance(t,iI.$type)}M(zIe,"isGrammarImport");var m1={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function pv(t){return qr.isInstance(t,m1.$type)}M(pv,"isGroup");var sI={$type:"InferredType",name:"name"};function O7(t){return qr.isInstance(t,sI.$type)}M(O7,"isInferredType");var td={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function O5(t){return qr.isInstance(t,td.$type)}M(O5,"isInfixRule");var yS={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function VIe(t){return qr.isInstance(t,yS.$type)}M(VIe,"isInfixRuleOperatorList");var aI={$type:"InfixRuleOperators",precedences:"precedences"};function HIe(t){return qr.isInstance(t,aI.$type)}M(HIe,"isInfixRuleOperators");var cb={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Fee(t){return qr.isInstance(t,cb.$type)}M(Fee,"isInterface");var ub={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function M0(t){return qr.isInstance(t,ub.$type)}M(M0,"isKeyword");var hb={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function GIe(t){return qr.isInstance(t,hb.$type)}M(GIe,"isNamedArgument");var y1={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function zee(t){return qr.isInstance(t,y1.$type)}M(zee,"isNegatedToken");var oI={$type:"Negation",value:"value"};function Vee(t){return qr.isInstance(t,oI.$type)}M(Vee,"isNegation");var lI={$type:"NumberLiteral",value:"value"};function WIe(t){return qr.isInstance(t,lI.$type)}M(WIe,"isNumberLiteral");var db={$type:"Parameter",name:"name"};function qIe(t){return qr.isInstance(t,db.$type)}M(qIe,"isParameter");var cI={$type:"ParameterReference",parameter:"parameter"};function Hee(t){return qr.isInstance(t,cI.$type)}M(Hee,"isParameterReference");var Yu={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Nl(t){return qr.isInstance(t,Yu.$type)}M(Nl,"isParserRule");var vS={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Gee(t){return qr.isInstance(t,vS.$type)}M(Gee,"isReferenceType");var v1={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Wee(t){return qr.isInstance(t,v1.$type)}M(Wee,"isRegexToken");var uI={$type:"ReturnType",name:"name"};function qee(t){return qr.isInstance(t,uI.$type)}M(qee,"isReturnType");var b1={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function R0(t){return qr.isInstance(t,b1.$type)}M(R0,"isRuleCall");var fb={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function CO(t){return qr.isInstance(t,fb.$type)}M(CO,"isSimpleType");var hI={$type:"StringLiteral",value:"value"};function UIe(t){return qr.isInstance(t,hI.$type)}M(UIe,"isStringLiteral");var x1={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Uee(t){return qr.isInstance(t,x1.$type)}M(Uee,"isTerminalAlternatives");var Zl={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function YIe(t){return qr.isInstance(t,Zl.$type)}M(YIe,"isTerminalElement");var w1={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Yee(t){return qr.isInstance(t,w1.$type)}M(Yee,"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 T1={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function kO(t){return qr.isInstance(t,T1.$type)}M(kO,"isTerminalRuleCall");var bS={$type:"Type",name:"name",type:"type"};function SO(t){return qr.isInstance(t,bS.$type)}M(SO,"isType");var C1={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function jIe(t){return qr.isInstance(t,C1.$type)}M(jIe,"isTypeAttribute");var k1={$type:"TypeDefinition"};function XIe(t){return qr.isInstance(t,k1.$type)}M(XIe,"isTypeDefinition");var dI={$type:"UnionType",types:"types"};function jee(t){return qr.isInstance(t,dI.$type)}M(jee,"isUnionType");var xS={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function EO(t){return qr.isInstance(t,xS.$type)}M(EO,"isUnorderedGroup");var S1={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Xee(t){return qr.isInstance(t,S1.$type)}M(Xee,"isUntilToken");var E1={$type:"ValueLiteral"};function KIe(t){return qr.isInstance(t,E1.$type)}M(KIe,"isValueLiteral");var pb={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Kee(t){return qr.isInstance(t,pb.$type)}M(Kee,"isWildcard");var vx,Zee=(vx=class extends Ree{constructor(){super(...arguments),this.types={AbstractElement:{name:Kl.$type,properties:{cardinality:{name:Kl.cardinality}},superTypes:[]},AbstractParserRule:{name:fS.$type,properties:{},superTypes:[lb.$type,Mc.$type]},AbstractRule:{name:lb.$type,properties:{},superTypes:[]},AbstractType:{name:Mc.$type,properties:{},superTypes:[]},Action:{name:Mp.$type,properties:{cardinality:{name:Mp.cardinality},feature:{name:Mp.feature},inferredType:{name:Mp.inferredType},operator:{name:Mp.operator},type:{name:Mp.type,referenceType:Mc.$type}},superTypes:[Kl.$type]},Alternatives:{name:pS.$type,properties:{cardinality:{name:pS.cardinality},elements:{name:pS.elements,defaultValue:[]}},superTypes:[Kl.$type]},ArrayLiteral:{name:eI.$type,properties:{elements:{name:eI.elements,defaultValue:[]}},superTypes:[E1.$type]},ArrayType:{name:tI.$type,properties:{elementType:{name:tI.elementType}},superTypes:[k1.$type]},Assignment:{name:Rp.$type,properties:{cardinality:{name:Rp.cardinality},feature:{name:Rp.feature},operator:{name:Rp.operator},predicate:{name:Rp.predicate},terminal:{name:Rp.terminal}},superTypes:[Kl.$type]},BooleanLiteral:{name:rI.$type,properties:{true:{name:rI.true,defaultValue:!1}},superTypes:[Lp.$type,E1.$type]},CharacterRange:{name:_p.$type,properties:{cardinality:{name:_p.cardinality},left:{name:_p.left},lookahead:{name:_p.lookahead},parenthesized:{name:_p.parenthesized,defaultValue:!1},right:{name:_p.right}},superTypes:[Zl.$type]},Condition:{name:Lp.$type,properties:{},superTypes:[]},Conjunction:{name:gS.$type,properties:{left:{name:gS.left},right:{name:gS.right}},superTypes:[Lp.$type]},CrossReference:{name:Ip.$type,properties:{cardinality:{name:Ip.cardinality},deprecatedSyntax:{name:Ip.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ip.isMulti,defaultValue:!1},terminal:{name:Ip.terminal},type:{name:Ip.type,referenceType:Mc.$type}},superTypes:[Kl.$type]},Disjunction:{name:mS.$type,properties:{left:{name:mS.left},right:{name:mS.right}},superTypes:[Lp.$type]},EndOfFile:{name:nI.$type,properties:{cardinality:{name:nI.cardinality}},superTypes:[Kl.$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:iI.$type,properties:{path:{name:iI.path}},superTypes:[]},Group:{name:m1.$type,properties:{cardinality:{name:m1.cardinality},elements:{name:m1.elements,defaultValue:[]},guardCondition:{name:m1.guardCondition},predicate:{name:m1.predicate}},superTypes:[Kl.$type]},InferredType:{name:sI.$type,properties:{name:{name:sI.name}},superTypes:[Mc.$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:Mc.$type}},superTypes:[fS.$type]},InfixRuleOperatorList:{name:yS.$type,properties:{associativity:{name:yS.associativity},operators:{name:yS.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:aI.$type,properties:{precedences:{name:aI.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:cb.$type,properties:{attributes:{name:cb.attributes,defaultValue:[]},name:{name:cb.name},superTypes:{name:cb.superTypes,defaultValue:[],referenceType:Mc.$type}},superTypes:[Mc.$type]},Keyword:{name:ub.$type,properties:{cardinality:{name:ub.cardinality},predicate:{name:ub.predicate},value:{name:ub.value}},superTypes:[Kl.$type]},NamedArgument:{name:hb.$type,properties:{calledByName:{name:hb.calledByName,defaultValue:!1},parameter:{name:hb.parameter,referenceType:db.$type},value:{name:hb.value}},superTypes:[]},NegatedToken:{name:y1.$type,properties:{cardinality:{name:y1.cardinality},lookahead:{name:y1.lookahead},parenthesized:{name:y1.parenthesized,defaultValue:!1},terminal:{name:y1.terminal}},superTypes:[Zl.$type]},Negation:{name:oI.$type,properties:{value:{name:oI.value}},superTypes:[Lp.$type]},NumberLiteral:{name:lI.$type,properties:{value:{name:lI.value}},superTypes:[E1.$type]},Parameter:{name:db.$type,properties:{name:{name:db.name}},superTypes:[]},ParameterReference:{name:cI.$type,properties:{parameter:{name:cI.parameter,referenceType:db.$type}},superTypes:[Lp.$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:Mc.$type}},superTypes:[fS.$type]},ReferenceType:{name:vS.$type,properties:{isMulti:{name:vS.isMulti,defaultValue:!1},referenceType:{name:vS.referenceType}},superTypes:[k1.$type]},RegexToken:{name:v1.$type,properties:{cardinality:{name:v1.cardinality},lookahead:{name:v1.lookahead},parenthesized:{name:v1.parenthesized,defaultValue:!1},regex:{name:v1.regex}},superTypes:[Zl.$type]},ReturnType:{name:uI.$type,properties:{name:{name:uI.name}},superTypes:[]},RuleCall:{name:b1.$type,properties:{arguments:{name:b1.arguments,defaultValue:[]},cardinality:{name:b1.cardinality},predicate:{name:b1.predicate},rule:{name:b1.rule,referenceType:lb.$type}},superTypes:[Kl.$type]},SimpleType:{name:fb.$type,properties:{primitiveType:{name:fb.primitiveType},stringType:{name:fb.stringType},typeRef:{name:fb.typeRef,referenceType:Mc.$type}},superTypes:[k1.$type]},StringLiteral:{name:hI.$type,properties:{value:{name:hI.value}},superTypes:[E1.$type]},TerminalAlternatives:{name:x1.$type,properties:{cardinality:{name:x1.cardinality},elements:{name:x1.elements,defaultValue:[]},lookahead:{name:x1.lookahead},parenthesized:{name:x1.parenthesized,defaultValue:!1}},superTypes:[Zl.$type]},TerminalElement:{name:Zl.$type,properties:{cardinality:{name:Zl.cardinality},lookahead:{name:Zl.lookahead},parenthesized:{name:Zl.parenthesized,defaultValue:!1}},superTypes:[Kl.$type]},TerminalGroup:{name:w1.$type,properties:{cardinality:{name:w1.cardinality},elements:{name:w1.elements,defaultValue:[]},lookahead:{name:w1.lookahead},parenthesized:{name:w1.parenthesized,defaultValue:!1}},superTypes:[Zl.$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:[lb.$type]},TerminalRuleCall:{name:T1.$type,properties:{cardinality:{name:T1.cardinality},lookahead:{name:T1.lookahead},parenthesized:{name:T1.parenthesized,defaultValue:!1},rule:{name:T1.rule,referenceType:Mf.$type}},superTypes:[Zl.$type]},Type:{name:bS.$type,properties:{name:{name:bS.name},type:{name:bS.type}},superTypes:[Mc.$type]},TypeAttribute:{name:C1.$type,properties:{defaultValue:{name:C1.defaultValue},isOptional:{name:C1.isOptional,defaultValue:!1},name:{name:C1.name},type:{name:C1.type}},superTypes:[]},TypeDefinition:{name:k1.$type,properties:{},superTypes:[]},UnionType:{name:dI.$type,properties:{types:{name:dI.types,defaultValue:[]}},superTypes:[k1.$type]},UnorderedGroup:{name:xS.$type,properties:{cardinality:{name:xS.cardinality},elements:{name:xS.elements,defaultValue:[]}},superTypes:[Kl.$type]},UntilToken:{name:S1.$type,properties:{cardinality:{name:S1.cardinality},lookahead:{name:S1.lookahead},parenthesized:{name:S1.parenthesized,defaultValue:!1},terminal:{name:S1.terminal}},superTypes:[Zl.$type]},ValueLiteral:{name:E1.$type,properties:{},superTypes:[]},Wildcard:{name:pb.$type,properties:{cardinality:{name:pb.cardinality},lookahead:{name:pb.lookahead},parenthesized:{name:pb.parenthesized,defaultValue:!1}},superTypes:[Zl.$type]}}}},M(vx,"LangiumGrammarAstReflection"),vx),qr=new Zee;function ZIe(t){let e=t,r=!1;for(;e;){const n=hv(e.grammarSource,Nl);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}M(ZIe,"getDatatypeNode");function P5(t){return new I5(t,e=>E0(e)?e.content:[],{includeRoot:!0})}M(P5,"streamCst");function QIe(t){return P5(t).filter(uv)}M(QIe,"flattenCst");function Qee(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}M(Qee,"isChildNode");function nE(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}M(nE,"tokenToRange");function $5(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}M($5,"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 Jee(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(ete,"inRange");var tte=/^[\w\p{L}]$/u;function JIe(t,e,r=tte){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return AO(t,e)}}M(JIe,"findDeclarationNodeAtOffset");function rte(t,e){if(t){const r=ste(t,!0);if(r&&fI(r,e))return r;if(xO(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const s=t.content[i];if(fI(s,e))return s}}}}M(rte,"findCommentNode");function fI(t,e){return uv(t)&&e.includes(t.tokenType.name)}M(fI,"isCommentNode");function AO(t,e){if(uv(t))return t;if(E0(t)){const r=ite(t,e,!1);if(r)return AO(r,e)}}M(AO,"findLeafNodeAtOffset");function nte(t,e){if(uv(t))return t;if(E0(t)){const r=ite(t,e,!0);if(r)return nte(r,e)}}M(nte,"findLeafNodeBeforeOffset");function ite(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(ite,"binarySearch");function ste(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(ste,"getPreviousNode");function eNe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nbte,findNameAssignment:()=>OO,findNodeForKeyword:()=>vte,findNodeForProperty:()=>IO,findNodesForKeyword:()=>hNe,findNodesForKeywordInternal:()=>DO,findNodesForProperty:()=>yte,getActionAtElement:()=>wte,getActionType:()=>Cte,getAllReachableRules:()=>LO,getAllRulesUsedForCrossReferences:()=>uNe,getCrossReferenceTerminal:()=>gte,getEntryRule:()=>dte,getExplicitRuleType:()=>$7,getHiddenRules:()=>fte,getRuleType:()=>kte,getRuleTypeName:()=>mNe,getTypeName:()=>$y,isArrayCardinality:()=>fNe,isArrayOperator:()=>pNe,isCommentTerminal:()=>mte,isDataType:()=>gNe,isDataTypeRule:()=>P7,isOptionalCardinality:()=>dNe,terminalRegex:()=>B7});var bx,MO=(bx=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},M(bx,"ErrorWithLocation"),bx);function dm(t,e="Error: Got unexpected value."){throw new Error(e)}M(dm,"assertUnreachable");function ote(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}M(ote,"assertCondition");var lte={};hm(lte,{NEWLINE_REGEXP:()=>aNe,escapeRegExp:()=>I3,getTerminalParts:()=>lNe,isMultilineComment:()=>cte,isWhitespace:()=>_O,partialMatches:()=>ute,partialRegExp:()=>hte,whitespaceCharacters:()=>cNe});function Jr(t){return t.charCodeAt(0)}M(Jr,"cc");function CR(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}M(CR,"insertToSet");function N2(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}M(N2,"addFlag");function t1(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}M(t1,"ASSERT_EXISTS");function iNe(){throw Error("Internal Error - Should never get here!")}M(iNe,"ASSERT_NEVER_REACH_HERE");function aY(t){return t.type==="Character"}M(aY,"isCharacter");var pI=[];for(let t=Jr("0");t<=Jr("9");t++)pI.push(t);var gI=[Jr("_")].concat(pI);for(let t=Jr("a");t<=Jr("z");t++)gI.push(t);for(let t=Jr("A");t<=Jr("Z");t++)gI.push(t);var oge=[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")],GZt=/[0-9a-fA-F]/,G8=/[0-9]/,WZt=/[1-9]/,xx,sNe=(xx=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":N2(n,"global");break;case"i":N2(n,"ignoreCase");break;case"m":N2(n,"multiLine");break;case"u":N2(n,"unicode");break;case"y":N2(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}}t1(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return iNe()}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;t1(r);break}if(!(e===!0&&r===void 0)&&t1(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()),t1(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=pI;break;case"D":e=pI,r=!0;break;case"s":e=oge;break;case"S":e=oge,r=!0;break;case"w":e=gI;break;case"W":e=gI,r=!0;break}if(t1(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Jr("\f");break;case"n":e=Jr(` +`)),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 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}}),iY=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=RIe();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=_Ie();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=hZt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:M(function(){return n.Disposable},"get")});var i=_3();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=bO();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=dZt();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=fZt();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=pZt();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=gZt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:M(function(){return u.AbstractMessageBuffer},"get")});var h=mZt();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=cv();t.RAL=d.default}}),yZt=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=iY(),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}}),L3=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=yZt();n.default.install();var i=iY();r(iY(),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}}),oge=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=L3()}}),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=L3(),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}}),Eee=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}}),vZt=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={}))}}),bZt=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={}))}}),xZt=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={}))}}),wZt=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={}))}}),TZt=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={}))}}),CZt=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={}))}}),kZt=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={}))}}),SZt=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={}))}}),EZt=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=L3(),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={}))}}),AZt=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={}))}}),MZt=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={}))}}),RZt=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={}))}}),_Zt=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={}))}}),LZt=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={}))}}),IZt=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={}))}}),NZt=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={}))}}),OZt=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=L3(),r=Eee(),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={}))}}),$Zt=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=(I7(),See(vO)),r=Eee(),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={}))}}),zZt=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=L3();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}}),VZt=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(L3(),t),r((I7(),See(vO)),t),r(Es(),t),r(FZt(),t);var n=zZt();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={}))}}),HZt=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=oge();r(oge(),t),r(VZt(),t);function i(s,a,o,l){return(0,n.createMessageConnection)(s,a,o,l)}M(i,"createProtocolConnection"),t.createProtocolConnection=i}}),IIe={};hm(IIe,{AbstractAstReflection:()=>Ree,AbstractCstNode:()=>Lre,AbstractLangiumParser:()=>Nre,AbstractParserErrorMessageProvider:()=>bHe,AbstractThreadedAsyncParser:()=>pcr,AstUtils:()=>_ee,BiMap:()=>DI,Cancellation:()=>$i,CompositeCstNodeImpl:()=>gP,ContextCache:()=>TP,CstNodeBuilder:()=>mHe,CstUtils:()=>Aee,DEFAULT_TOKENIZE_OPTIONS:()=>Zre,DONE_RESULT:()=>pl,DatatypeSymbol:()=>_I,DefaultAstNodeDescriptionProvider:()=>XHe,DefaultAstNodeLocator:()=>ZHe,DefaultAsyncParser:()=>gGe,DefaultCommentProvider:()=>pGe,DefaultConfigurationProvider:()=>QHe,DefaultDocumentBuilder:()=>JHe,DefaultDocumentValidator:()=>jHe,DefaultHydrator:()=>yGe,DefaultIndexManager:()=>eGe,DefaultJsonSerializer:()=>WHe,DefaultLangiumDocumentFactory:()=>OHe,DefaultLangiumDocuments:()=>PHe,DefaultLangiumProfiler:()=>bcr,DefaultLexer:()=>Qre,DefaultLexerErrorMessageProvider:()=>rGe,DefaultLinker:()=>$He,DefaultNameProvider:()=>BHe,DefaultReferenceDescriptionProvider:()=>KHe,DefaultReferences:()=>FHe,DefaultScopeComputation:()=>zHe,DefaultScopeProvider:()=>GHe,DefaultServiceRegistry:()=>qHe,DefaultTokenBuilder:()=>vP,DefaultValueConverter:()=>zre,DefaultWorkspaceLock:()=>mGe,DefaultWorkspaceManager:()=>tGe,Deferred:()=>D0,Disposable:()=>sy,DisposableCache:()=>wP,DocumentCache:()=>HHe,DocumentState:()=>Mn,DocumentValidator:()=>yu,EMPTY_SCOPE:()=>ucr,EMPTY_STREAM:()=>L5,EmptyFileSystem:()=>Lo,EmptyFileSystemProvider:()=>xGe,ErrorWithLocation:()=>MO,GrammarAST:()=>OIe,GrammarUtils:()=>ate,IndentationAwareLexer:()=>mcr,IndentationAwareTokenBuilder:()=>bGe,JSDocDocumentationProvider:()=>fGe,LangiumCompletionParser:()=>xHe,LangiumParser:()=>vHe,LangiumParserErrorMessageProvider:()=>Dre,LeafCstNodeImpl:()=>RI,LexingMode:()=>q1,MapScope:()=>ccr,Module:()=>BY,MultiMap:()=>O0,MultiMapScope:()=>VHe,OperationCancelled:()=>xd,ParserWorker:()=>gcr,ProfilingTask:()=>TGe,Reduction:()=>rE,RefResolving:()=>i1,RegExpUtils:()=>lte,RootCstNodeImpl:()=>Ire,SimpleCache:()=>Ure,StreamImpl:()=>bd,StreamScope:()=>DY,TextDocument:()=>II,TreeStreamImpl:()=>I5,URI:()=>Hc,UriTrie:()=>Wre,UriUtils:()=>Sl,VALIDATE_EACH_NODE:()=>YHe,ValidationCategory:()=>OI,ValidationRegistry:()=>UHe,ValueConverter:()=>od,WorkspaceCache:()=>Yre,assertCondition:()=>ote,assertUnreachable:()=>dm,createCompletionParser:()=>$re,createDefaultCoreModule:()=>no,createDefaultSharedCoreModule:()=>io,createGrammarConfig:()=>Ete,createLangiumParser:()=>Bre,createParser:()=>mP,delayNextTick:()=>bP,diagnosticData:()=>W1,eagerLoad:()=>sne,getDiagnosticRange:()=>Xre,indentationBuilderDefaultOptions:()=>zY,inject:()=>Hn,interruptAndCheck:()=>Va,isAstNode:()=>oa,isAstNodeDescription:()=>Mee,isAstNodeWithComment:()=>jre,isCompositeCstNode:()=>E0,isIMultiModeLexerDefinition:()=>SP,isJSDoc:()=>ene,isLeafCstNode:()=>uv,isLinkingError:()=>g1,isMultiReference:()=>Md,isNamed:()=>qre,isOperationCancelled:()=>Rv,isReference:()=>kl,isRootCstNode:()=>xO,isTokenTypeArray:()=>kP,isTokenTypeDictionary:()=>PI,loadGrammarFromJson:()=>so,parseJSDoc:()=>Jre,prepareLangiumParser:()=>Fre,setInterruptionPeriod:()=>Vre,startCancelableOperation:()=>xP,stream:()=>yi,toDiagnosticData:()=>Kre,toDiagnosticSeverity:()=>AS});var Aee={};hm(Aee,{DefaultNameRegexp:()=>tte,RangeComparison:()=>hd,compareRange:()=>Jee,findCommentNode:()=>rte,findDeclarationNodeAtOffset:()=>eNe,findLeafNodeAtOffset:()=>AO,findLeafNodeBeforeOffset:()=>nte,flattenCst:()=>JIe,getDatatypeNode:()=>QIe,getInteriorNodes:()=>nNe,getNextNode:()=>tNe,getPreviousNode:()=>ste,getStartlineNode:()=>rNe,inRange:()=>ete,isChildNode:()=>Qee,isCommentNode:()=>fI,streamCst:()=>P5,toDocumentSegment:()=>$5,tokenToRange:()=>nE});function oa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}M(oa,"isAstNode");function kl(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}M(kl,"isReference");function Md(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}M(Md,"isMultiReference");function Mee(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}M(Mee,"isAstNodeDescription");function g1(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}M(g1,"isLinkingError");var mx,Ree=(mx=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 oa(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(mx,"AbstractAstReflection"),mx);function E0(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}M(E0,"isCompositeCstNode");function uv(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}M(uv,"isLeafCstNode");function xO(t){return E0(t)&&typeof t.fullText=="string"}M(xO,"isRootCstNode");var rc,bd=(rc=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 rc(()=>({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 pl})}join(e=","){const r=this.iterator();let n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=NIe(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 rc(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?pl:{done:!1,value:e(i)}})}filter(e){return new rc(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return pl})}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 rc(()=>({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(tE(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return pl})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new rc(()=>({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(tE(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return pl})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new rc(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?pl:this.nextFn(r.state)))}distinct(e){return new rc(()=>({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 pl})}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(rc,"StreamImpl"),rc);function NIe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}M(NIe,"toString");function tE(t){return!!t&&typeof t[Symbol.iterator]=="function"}M(tE,"isIterable");var L5=new bd(()=>{},()=>pl),pl=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(tE(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 pl})}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(yx,"TreeStreamImpl"),yx),rE;(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})(rE||(rE={}));var _ee={};hm(_ee,{assignMandatoryProperties:()=>Lee,copyAstNode:()=>JL,findRootNode:()=>Gb,getContainerOfType:()=>hv,getDocument:()=>wh,getReferenceNodes:()=>ZL,hasContainerOfType:()=>DIe,linkContentToContainer:()=>N5,streamAllContents:()=>Q0,streamAst:()=>Th,streamContents:()=>D7,streamReferences:()=>D5});function N5(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,s)=>{oa(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=s,e.deep&&N5(i,e))}):oa(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&N5(n,e)))}M(N5,"linkContentToContainer");function hv(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}M(hv,"getContainerOfType");function DIe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}M(DIe,"hasContainerOfType");function wh(t){const r=Gb(t).$document;if(!r)throw new Error("AST node has no document.");return r}M(wh,"getDocument");function Gb(t){for(;t.$container;)t=t.$container;return t}M(Gb,"findRootNode");function ZL(t){return kl(t)?t.ref?[t.ref]:[]:Md(t)?t.items.map(e=>e.ref):[]}M(ZL,"getReferenceNodes");function D7(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.keyIndexD7(r,e))}M(Q0,"streamAllContents");function Th(t,e){if(t){if(e!=null&&e.range&&!QL(t,e.range))return new I5(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new I5(t,r=>D7(r,e),{includeRoot:!0})}M(Th,"streamAst");function QL(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?ete(r,e):!1}M(QL,"isAstNodeInRange");function D5(t){return new bd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexKl,AbstractParserRule:()=>fS,AbstractRule:()=>lb,AbstractType:()=>Mc,Action:()=>Mp,Alternatives:()=>pS,ArrayLiteral:()=>eI,ArrayType:()=>tI,Assignment:()=>Rp,BooleanLiteral:()=>rI,CharacterRange:()=>_p,Condition:()=>Lp,Conjunction:()=>gS,CrossReference:()=>Ip,Disjunction:()=>mS,EndOfFile:()=>nI,Grammar:()=>Af,GrammarImport:()=>iI,Group:()=>m1,InferredType:()=>sI,InfixRule:()=>td,InfixRuleOperatorList:()=>yS,InfixRuleOperators:()=>aI,Interface:()=>cb,Keyword:()=>ub,LangiumGrammarAstReflection:()=>Zee,LangiumGrammarTerminals:()=>GZt,NamedArgument:()=>hb,NegatedToken:()=>y1,Negation:()=>oI,NumberLiteral:()=>lI,Parameter:()=>db,ParameterReference:()=>cI,ParserRule:()=>Yu,ReferenceType:()=>vS,RegexToken:()=>v1,ReturnType:()=>uI,RuleCall:()=>b1,SimpleType:()=>fb,StringLiteral:()=>hI,TerminalAlternatives:()=>x1,TerminalElement:()=>Zl,TerminalGroup:()=>w1,TerminalRule:()=>Mf,TerminalRuleCall:()=>T1,Type:()=>bS,TypeAttribute:()=>C1,TypeDefinition:()=>k1,UnionType:()=>dI,UnorderedGroup:()=>xS,UntilToken:()=>S1,ValueLiteral:()=>E1,Wildcard:()=>pb,isAbstractElement:()=>wO,isAbstractParserRule:()=>dv,isAbstractRule:()=>PIe,isAbstractType:()=>$Ie,isAction:()=>Og,isAlternatives:()=>TO,isArrayLiteral:()=>BIe,isArrayType:()=>Nee,isAssignment:()=>A0,isBooleanLiteral:()=>Dee,isCharacterRange:()=>Oee,isCondition:()=>FIe,isConjunction:()=>Pee,isCrossReference:()=>fv,isDisjunction:()=>$ee,isEndOfFile:()=>Bee,isGrammar:()=>zIe,isGrammarImport:()=>VIe,isGroup:()=>pv,isInferredType:()=>O7,isInfixRule:()=>O5,isInfixRuleOperatorList:()=>HIe,isInfixRuleOperators:()=>GIe,isInterface:()=>Fee,isKeyword:()=>M0,isNamedArgument:()=>WIe,isNegatedToken:()=>zee,isNegation:()=>Vee,isNumberLiteral:()=>qIe,isParameter:()=>UIe,isParameterReference:()=>Hee,isParserRule:()=>Nl,isReferenceType:()=>Gee,isRegexToken:()=>Wee,isReturnType:()=>qee,isRuleCall:()=>R0,isSimpleType:()=>CO,isStringLiteral:()=>YIe,isTerminalAlternatives:()=>Uee,isTerminalElement:()=>jIe,isTerminalGroup:()=>Yee,isTerminalRule:()=>Bu,isTerminalRuleCall:()=>kO,isType:()=>SO,isTypeAttribute:()=>XIe,isTypeDefinition:()=>KIe,isUnionType:()=>jee,isUnorderedGroup:()=>EO,isUntilToken:()=>Xee,isValueLiteral:()=>ZIe,isWildcard:()=>Kee,reflection:()=>qr});var GZt={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]*/},Kl={$type:"AbstractElement",cardinality:"cardinality"};function wO(t){return qr.isInstance(t,Kl.$type)}M(wO,"isAbstractElement");var fS={$type:"AbstractParserRule"};function dv(t){return qr.isInstance(t,fS.$type)}M(dv,"isAbstractParserRule");var lb={$type:"AbstractRule"};function PIe(t){return qr.isInstance(t,lb.$type)}M(PIe,"isAbstractRule");var Mc={$type:"AbstractType"};function $Ie(t){return qr.isInstance(t,Mc.$type)}M($Ie,"isAbstractType");var Mp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Og(t){return qr.isInstance(t,Mp.$type)}M(Og,"isAction");var pS={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function TO(t){return qr.isInstance(t,pS.$type)}M(TO,"isAlternatives");var eI={$type:"ArrayLiteral",elements:"elements"};function BIe(t){return qr.isInstance(t,eI.$type)}M(BIe,"isArrayLiteral");var tI={$type:"ArrayType",elementType:"elementType"};function Nee(t){return qr.isInstance(t,tI.$type)}M(Nee,"isArrayType");var Rp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function A0(t){return qr.isInstance(t,Rp.$type)}M(A0,"isAssignment");var rI={$type:"BooleanLiteral",true:"true"};function Dee(t){return qr.isInstance(t,rI.$type)}M(Dee,"isBooleanLiteral");var _p={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Oee(t){return qr.isInstance(t,_p.$type)}M(Oee,"isCharacterRange");var Lp={$type:"Condition"};function FIe(t){return qr.isInstance(t,Lp.$type)}M(FIe,"isCondition");var gS={$type:"Conjunction",left:"left",right:"right"};function Pee(t){return qr.isInstance(t,gS.$type)}M(Pee,"isConjunction");var Ip={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function fv(t){return qr.isInstance(t,Ip.$type)}M(fv,"isCrossReference");var mS={$type:"Disjunction",left:"left",right:"right"};function $ee(t){return qr.isInstance(t,mS.$type)}M($ee,"isDisjunction");var nI={$type:"EndOfFile",cardinality:"cardinality"};function Bee(t){return qr.isInstance(t,nI.$type)}M(Bee,"isEndOfFile");var Af={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function zIe(t){return qr.isInstance(t,Af.$type)}M(zIe,"isGrammar");var iI={$type:"GrammarImport",path:"path"};function VIe(t){return qr.isInstance(t,iI.$type)}M(VIe,"isGrammarImport");var m1={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function pv(t){return qr.isInstance(t,m1.$type)}M(pv,"isGroup");var sI={$type:"InferredType",name:"name"};function O7(t){return qr.isInstance(t,sI.$type)}M(O7,"isInferredType");var td={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function O5(t){return qr.isInstance(t,td.$type)}M(O5,"isInfixRule");var yS={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function HIe(t){return qr.isInstance(t,yS.$type)}M(HIe,"isInfixRuleOperatorList");var aI={$type:"InfixRuleOperators",precedences:"precedences"};function GIe(t){return qr.isInstance(t,aI.$type)}M(GIe,"isInfixRuleOperators");var cb={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Fee(t){return qr.isInstance(t,cb.$type)}M(Fee,"isInterface");var ub={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function M0(t){return qr.isInstance(t,ub.$type)}M(M0,"isKeyword");var hb={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function WIe(t){return qr.isInstance(t,hb.$type)}M(WIe,"isNamedArgument");var y1={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function zee(t){return qr.isInstance(t,y1.$type)}M(zee,"isNegatedToken");var oI={$type:"Negation",value:"value"};function Vee(t){return qr.isInstance(t,oI.$type)}M(Vee,"isNegation");var lI={$type:"NumberLiteral",value:"value"};function qIe(t){return qr.isInstance(t,lI.$type)}M(qIe,"isNumberLiteral");var db={$type:"Parameter",name:"name"};function UIe(t){return qr.isInstance(t,db.$type)}M(UIe,"isParameter");var cI={$type:"ParameterReference",parameter:"parameter"};function Hee(t){return qr.isInstance(t,cI.$type)}M(Hee,"isParameterReference");var Yu={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Nl(t){return qr.isInstance(t,Yu.$type)}M(Nl,"isParserRule");var vS={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Gee(t){return qr.isInstance(t,vS.$type)}M(Gee,"isReferenceType");var v1={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Wee(t){return qr.isInstance(t,v1.$type)}M(Wee,"isRegexToken");var uI={$type:"ReturnType",name:"name"};function qee(t){return qr.isInstance(t,uI.$type)}M(qee,"isReturnType");var b1={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function R0(t){return qr.isInstance(t,b1.$type)}M(R0,"isRuleCall");var fb={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function CO(t){return qr.isInstance(t,fb.$type)}M(CO,"isSimpleType");var hI={$type:"StringLiteral",value:"value"};function YIe(t){return qr.isInstance(t,hI.$type)}M(YIe,"isStringLiteral");var x1={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Uee(t){return qr.isInstance(t,x1.$type)}M(Uee,"isTerminalAlternatives");var Zl={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function jIe(t){return qr.isInstance(t,Zl.$type)}M(jIe,"isTerminalElement");var w1={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Yee(t){return qr.isInstance(t,w1.$type)}M(Yee,"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 T1={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function kO(t){return qr.isInstance(t,T1.$type)}M(kO,"isTerminalRuleCall");var bS={$type:"Type",name:"name",type:"type"};function SO(t){return qr.isInstance(t,bS.$type)}M(SO,"isType");var C1={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function XIe(t){return qr.isInstance(t,C1.$type)}M(XIe,"isTypeAttribute");var k1={$type:"TypeDefinition"};function KIe(t){return qr.isInstance(t,k1.$type)}M(KIe,"isTypeDefinition");var dI={$type:"UnionType",types:"types"};function jee(t){return qr.isInstance(t,dI.$type)}M(jee,"isUnionType");var xS={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function EO(t){return qr.isInstance(t,xS.$type)}M(EO,"isUnorderedGroup");var S1={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Xee(t){return qr.isInstance(t,S1.$type)}M(Xee,"isUntilToken");var E1={$type:"ValueLiteral"};function ZIe(t){return qr.isInstance(t,E1.$type)}M(ZIe,"isValueLiteral");var pb={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Kee(t){return qr.isInstance(t,pb.$type)}M(Kee,"isWildcard");var vx,Zee=(vx=class extends Ree{constructor(){super(...arguments),this.types={AbstractElement:{name:Kl.$type,properties:{cardinality:{name:Kl.cardinality}},superTypes:[]},AbstractParserRule:{name:fS.$type,properties:{},superTypes:[lb.$type,Mc.$type]},AbstractRule:{name:lb.$type,properties:{},superTypes:[]},AbstractType:{name:Mc.$type,properties:{},superTypes:[]},Action:{name:Mp.$type,properties:{cardinality:{name:Mp.cardinality},feature:{name:Mp.feature},inferredType:{name:Mp.inferredType},operator:{name:Mp.operator},type:{name:Mp.type,referenceType:Mc.$type}},superTypes:[Kl.$type]},Alternatives:{name:pS.$type,properties:{cardinality:{name:pS.cardinality},elements:{name:pS.elements,defaultValue:[]}},superTypes:[Kl.$type]},ArrayLiteral:{name:eI.$type,properties:{elements:{name:eI.elements,defaultValue:[]}},superTypes:[E1.$type]},ArrayType:{name:tI.$type,properties:{elementType:{name:tI.elementType}},superTypes:[k1.$type]},Assignment:{name:Rp.$type,properties:{cardinality:{name:Rp.cardinality},feature:{name:Rp.feature},operator:{name:Rp.operator},predicate:{name:Rp.predicate},terminal:{name:Rp.terminal}},superTypes:[Kl.$type]},BooleanLiteral:{name:rI.$type,properties:{true:{name:rI.true,defaultValue:!1}},superTypes:[Lp.$type,E1.$type]},CharacterRange:{name:_p.$type,properties:{cardinality:{name:_p.cardinality},left:{name:_p.left},lookahead:{name:_p.lookahead},parenthesized:{name:_p.parenthesized,defaultValue:!1},right:{name:_p.right}},superTypes:[Zl.$type]},Condition:{name:Lp.$type,properties:{},superTypes:[]},Conjunction:{name:gS.$type,properties:{left:{name:gS.left},right:{name:gS.right}},superTypes:[Lp.$type]},CrossReference:{name:Ip.$type,properties:{cardinality:{name:Ip.cardinality},deprecatedSyntax:{name:Ip.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ip.isMulti,defaultValue:!1},terminal:{name:Ip.terminal},type:{name:Ip.type,referenceType:Mc.$type}},superTypes:[Kl.$type]},Disjunction:{name:mS.$type,properties:{left:{name:mS.left},right:{name:mS.right}},superTypes:[Lp.$type]},EndOfFile:{name:nI.$type,properties:{cardinality:{name:nI.cardinality}},superTypes:[Kl.$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:iI.$type,properties:{path:{name:iI.path}},superTypes:[]},Group:{name:m1.$type,properties:{cardinality:{name:m1.cardinality},elements:{name:m1.elements,defaultValue:[]},guardCondition:{name:m1.guardCondition},predicate:{name:m1.predicate}},superTypes:[Kl.$type]},InferredType:{name:sI.$type,properties:{name:{name:sI.name}},superTypes:[Mc.$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:Mc.$type}},superTypes:[fS.$type]},InfixRuleOperatorList:{name:yS.$type,properties:{associativity:{name:yS.associativity},operators:{name:yS.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:aI.$type,properties:{precedences:{name:aI.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:cb.$type,properties:{attributes:{name:cb.attributes,defaultValue:[]},name:{name:cb.name},superTypes:{name:cb.superTypes,defaultValue:[],referenceType:Mc.$type}},superTypes:[Mc.$type]},Keyword:{name:ub.$type,properties:{cardinality:{name:ub.cardinality},predicate:{name:ub.predicate},value:{name:ub.value}},superTypes:[Kl.$type]},NamedArgument:{name:hb.$type,properties:{calledByName:{name:hb.calledByName,defaultValue:!1},parameter:{name:hb.parameter,referenceType:db.$type},value:{name:hb.value}},superTypes:[]},NegatedToken:{name:y1.$type,properties:{cardinality:{name:y1.cardinality},lookahead:{name:y1.lookahead},parenthesized:{name:y1.parenthesized,defaultValue:!1},terminal:{name:y1.terminal}},superTypes:[Zl.$type]},Negation:{name:oI.$type,properties:{value:{name:oI.value}},superTypes:[Lp.$type]},NumberLiteral:{name:lI.$type,properties:{value:{name:lI.value}},superTypes:[E1.$type]},Parameter:{name:db.$type,properties:{name:{name:db.name}},superTypes:[]},ParameterReference:{name:cI.$type,properties:{parameter:{name:cI.parameter,referenceType:db.$type}},superTypes:[Lp.$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:Mc.$type}},superTypes:[fS.$type]},ReferenceType:{name:vS.$type,properties:{isMulti:{name:vS.isMulti,defaultValue:!1},referenceType:{name:vS.referenceType}},superTypes:[k1.$type]},RegexToken:{name:v1.$type,properties:{cardinality:{name:v1.cardinality},lookahead:{name:v1.lookahead},parenthesized:{name:v1.parenthesized,defaultValue:!1},regex:{name:v1.regex}},superTypes:[Zl.$type]},ReturnType:{name:uI.$type,properties:{name:{name:uI.name}},superTypes:[]},RuleCall:{name:b1.$type,properties:{arguments:{name:b1.arguments,defaultValue:[]},cardinality:{name:b1.cardinality},predicate:{name:b1.predicate},rule:{name:b1.rule,referenceType:lb.$type}},superTypes:[Kl.$type]},SimpleType:{name:fb.$type,properties:{primitiveType:{name:fb.primitiveType},stringType:{name:fb.stringType},typeRef:{name:fb.typeRef,referenceType:Mc.$type}},superTypes:[k1.$type]},StringLiteral:{name:hI.$type,properties:{value:{name:hI.value}},superTypes:[E1.$type]},TerminalAlternatives:{name:x1.$type,properties:{cardinality:{name:x1.cardinality},elements:{name:x1.elements,defaultValue:[]},lookahead:{name:x1.lookahead},parenthesized:{name:x1.parenthesized,defaultValue:!1}},superTypes:[Zl.$type]},TerminalElement:{name:Zl.$type,properties:{cardinality:{name:Zl.cardinality},lookahead:{name:Zl.lookahead},parenthesized:{name:Zl.parenthesized,defaultValue:!1}},superTypes:[Kl.$type]},TerminalGroup:{name:w1.$type,properties:{cardinality:{name:w1.cardinality},elements:{name:w1.elements,defaultValue:[]},lookahead:{name:w1.lookahead},parenthesized:{name:w1.parenthesized,defaultValue:!1}},superTypes:[Zl.$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:[lb.$type]},TerminalRuleCall:{name:T1.$type,properties:{cardinality:{name:T1.cardinality},lookahead:{name:T1.lookahead},parenthesized:{name:T1.parenthesized,defaultValue:!1},rule:{name:T1.rule,referenceType:Mf.$type}},superTypes:[Zl.$type]},Type:{name:bS.$type,properties:{name:{name:bS.name},type:{name:bS.type}},superTypes:[Mc.$type]},TypeAttribute:{name:C1.$type,properties:{defaultValue:{name:C1.defaultValue},isOptional:{name:C1.isOptional,defaultValue:!1},name:{name:C1.name},type:{name:C1.type}},superTypes:[]},TypeDefinition:{name:k1.$type,properties:{},superTypes:[]},UnionType:{name:dI.$type,properties:{types:{name:dI.types,defaultValue:[]}},superTypes:[k1.$type]},UnorderedGroup:{name:xS.$type,properties:{cardinality:{name:xS.cardinality},elements:{name:xS.elements,defaultValue:[]}},superTypes:[Kl.$type]},UntilToken:{name:S1.$type,properties:{cardinality:{name:S1.cardinality},lookahead:{name:S1.lookahead},parenthesized:{name:S1.parenthesized,defaultValue:!1},terminal:{name:S1.terminal}},superTypes:[Zl.$type]},ValueLiteral:{name:E1.$type,properties:{},superTypes:[]},Wildcard:{name:pb.$type,properties:{cardinality:{name:pb.cardinality},lookahead:{name:pb.lookahead},parenthesized:{name:pb.parenthesized,defaultValue:!1}},superTypes:[Zl.$type]}}}},M(vx,"LangiumGrammarAstReflection"),vx),qr=new Zee;function QIe(t){let e=t,r=!1;for(;e;){const n=hv(e.grammarSource,Nl);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}M(QIe,"getDatatypeNode");function P5(t){return new I5(t,e=>E0(e)?e.content:[],{includeRoot:!0})}M(P5,"streamCst");function JIe(t){return P5(t).filter(uv)}M(JIe,"flattenCst");function Qee(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}M(Qee,"isChildNode");function nE(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}M(nE,"tokenToRange");function $5(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}M($5,"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 Jee(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(ete,"inRange");var tte=/^[\w\p{L}]$/u;function eNe(t,e,r=tte){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return AO(t,e)}}M(eNe,"findDeclarationNodeAtOffset");function rte(t,e){if(t){const r=ste(t,!0);if(r&&fI(r,e))return r;if(xO(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const s=t.content[i];if(fI(s,e))return s}}}}M(rte,"findCommentNode");function fI(t,e){return uv(t)&&e.includes(t.tokenType.name)}M(fI,"isCommentNode");function AO(t,e){if(uv(t))return t;if(E0(t)){const r=ite(t,e,!1);if(r)return AO(r,e)}}M(AO,"findLeafNodeAtOffset");function nte(t,e){if(uv(t))return t;if(E0(t)){const r=ite(t,e,!0);if(r)return nte(r,e)}}M(nte,"findLeafNodeBeforeOffset");function ite(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(ite,"binarySearch");function ste(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(ste,"getPreviousNode");function tNe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nbte,findNameAssignment:()=>OO,findNodeForKeyword:()=>vte,findNodeForProperty:()=>IO,findNodesForKeyword:()=>dNe,findNodesForKeywordInternal:()=>DO,findNodesForProperty:()=>yte,getActionAtElement:()=>wte,getActionType:()=>Cte,getAllReachableRules:()=>LO,getAllRulesUsedForCrossReferences:()=>hNe,getCrossReferenceTerminal:()=>gte,getEntryRule:()=>dte,getExplicitRuleType:()=>$7,getHiddenRules:()=>fte,getRuleType:()=>kte,getRuleTypeName:()=>yNe,getTypeName:()=>$y,isArrayCardinality:()=>pNe,isArrayOperator:()=>gNe,isCommentTerminal:()=>mte,isDataType:()=>mNe,isDataTypeRule:()=>P7,isOptionalCardinality:()=>fNe,terminalRegex:()=>B7});var bx,MO=(bx=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},M(bx,"ErrorWithLocation"),bx);function dm(t,e="Error: Got unexpected value."){throw new Error(e)}M(dm,"assertUnreachable");function ote(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}M(ote,"assertCondition");var lte={};hm(lte,{NEWLINE_REGEXP:()=>oNe,escapeRegExp:()=>I3,getTerminalParts:()=>cNe,isMultilineComment:()=>cte,isWhitespace:()=>_O,partialMatches:()=>ute,partialRegExp:()=>hte,whitespaceCharacters:()=>uNe});function Jr(t){return t.charCodeAt(0)}M(Jr,"cc");function CR(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}M(CR,"insertToSet");function N2(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}M(N2,"addFlag");function t1(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}M(t1,"ASSERT_EXISTS");function sNe(){throw Error("Internal Error - Should never get here!")}M(sNe,"ASSERT_NEVER_REACH_HERE");function aY(t){return t.type==="Character"}M(aY,"isCharacter");var pI=[];for(let t=Jr("0");t<=Jr("9");t++)pI.push(t);var gI=[Jr("_")].concat(pI);for(let t=Jr("a");t<=Jr("z");t++)gI.push(t);for(let t=Jr("A");t<=Jr("Z");t++)gI.push(t);var lge=[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")],WZt=/[0-9a-fA-F]/,G8=/[0-9]/,qZt=/[1-9]/,xx,aNe=(xx=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":N2(n,"global");break;case"i":N2(n,"ignoreCase");break;case"m":N2(n,"multiLine");break;case"u":N2(n,"unicode");break;case"y":N2(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}}t1(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return sNe()}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;t1(r);break}if(!(e===!0&&r===void 0)&&t1(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()),t1(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=pI;break;case"D":e=pI,r=!0;break;case"s":e=lge;break;case"S":e=lge,r=!0;break;case"w":e=gI;break;case"W":e=gI,r=!0;break}if(t1(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(t1(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,aY(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,aY(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},M(xx,"RegExpParser"),xx),wx,RO=(wx=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(wx,"BaseRegExpVisitor"),wx),aNe=/\r?\n/gm,oNe=new sNe,Tx,qZt=(Tx=class extends RO{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===` +`: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(xx,"RegExpParser"),xx),wx,RO=(wx=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(wx,"BaseRegExpVisitor"),wx),oNe=/\r?\n/gm,lNe=new aNe,Tx,UZt=(Tx=class extends RO{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=I3(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(Tx,"TerminalRegExpVisitor"),Tx),H1=new qZt;function lNe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=oNe.pattern(t),r=[];for(const n of e.value.value)H1.reset(t),H1.visit(n),r.push({start:H1.startRegexp,end:H1.endRegex});return r}catch{return[]}}M(lNe,"getTerminalParts");function cte(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),H1.reset(t),H1.visit(oNe.pattern(t)),H1.multiline}catch{return!1}}M(cte,"isMultilineComment");var cNe=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function _O(t){const e=typeof t=="string"?new RegExp(t):t;return cNe.some(r=>e.test(r))}M(_O,"isWhitespace");function I3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}M(I3,"escapeRegExp");function ute(t,e){const r=hte(t),n=e.match(r);return!!n&&n[0].length>0}M(ute,"partialMatches");function hte(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(hte,"partialRegExp");function dte(t){return t.rules.find(e=>Nl(e)&&e.entry)}M(dte,"getEntryRule");function fte(t){return t.rules.filter(e=>Bu(e)&&e.hidden)}M(fte,"getHiddenRules");function LO(t,e){const r=new Set,n=dte(t);if(!n)return new Set(t.rules);const i=[n].concat(fte(t));for(const a of i)pte(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(LO,"getAllReachableRules");function pte(t,e,r){e.add(t.name),Q0(t).forEach(n=>{if(R0(n)||r&&kO(n)){const i=n.rule.ref;i&&!e.has(i.name)&&pte(i,e,r)}})}M(pte,"ruleDfs");function uNe(t){const e=new Set;return Q0(t).forEach(r=>{fv(r)&&(Nl(r.type.ref)&&e.add(r.type.ref),O7(r.type.ref)&&Nl(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}M(uNe,"getAllRulesUsedForCrossReferences");function gte(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=OO(t.type.ref);return e==null?void 0:e.terminal}}M(gte,"getCrossReferenceTerminal");function mte(t){return t.hidden&&!_O(B7(t))}M(mte,"isCommentTerminal");function yte(t,e){return!t||!e?[]:NO(t,e,t.astNode,!0)}M(yte,"findNodesForProperty");function IO(t,e,r){if(!t||!e)return;const n=NO(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(IO,"findNodeForProperty");function NO(t,e,r,n){if(!n){const i=hv(t.grammarSource,A0);if(i&&i.feature===e)return[t]}return E0(t)&&t.astNode===r?t.content.flatMap(i=>NO(i,e,r,!1)):[]}M(NO,"findNodesForPropertyInternal");function hNe(t,e){return t?DO(t,e,t==null?void 0:t.astNode):[]}M(hNe,"findNodesForKeyword");function vte(t,e,r){if(!t)return;const n=DO(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(vte,"findNodeForKeyword");function DO(t,e,r){if(t.astNode!==r)return[];if(M0(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=P5(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(DO,"findNodesForKeywordInternal");function bte(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=hv(t.grammarSource,A0);if(n)return n;t=t.container}}M(bte,"findAssignment");function OO(t){let e=t;return O7(e)&&(Og(e.$container)?e=e.$container.$container:dv(e.$container)?e=e.$container:dm(e.$container)),xte(t,e,new Map)}M(OO,"findNameAssignment");function xte(t,e,r){var i;function n(s,a){let o;return hv(s,A0)||(o=xte(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)&&Nl(s.rule.ref))return n(s,s.rule.ref);if(CO(s)&&((i=s.typeRef)!=null&&i.ref))return n(s,s.typeRef.ref)}}M(xte,"findNameAssignmentInternal");function wte(t){const e=t.$container;if(pv(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const s=r[i];if(Og(s))return s;{const a=Q0(r[i]).find(Og);if(a)return a}}}if(wO(e))return wte(e)}M(wte,"getActionAtElement");function dNe(t,e){return t==="?"||t==="*"||pv(e)&&!!e.guardCondition}M(dNe,"isOptionalCardinality");function fNe(t){return t==="*"||t==="+"}M(fNe,"isArrayCardinality");function pNe(t){return t==="+="}M(pNe,"isArrayOperator");function P7(t){return Tte(t,new Set)}M(P7,"isDataTypeRule");function Tte(t,e){if(e.has(t))return!0;e.add(t);for(const r of Q0(t))if(R0(r)){if(!r.rule.ref||Nl(r.rule.ref)&&!Tte(r.rule.ref,e)||O5(r.rule.ref))return!1}else{if(A0(r))return!1;if(Og(r))return!1}return!!t.definition}M(Tte,"isDataTypeRuleInternal");function gNe(t){return mI(t.type,new Set)}M(gNe,"isDataType");function mI(t,e){if(e.has(t))return!0;if(e.add(t),Nee(t))return!1;if(Gee(t))return!1;if(jee(t))return t.types.every(r=>mI(r,e));if(CO(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 SO(r)?mI(r.type,e):!1}else return!1}else return!1}M(mI,"isDataTypeInternal");function $7(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($7,"getExplicitRuleType");function $y(t){if(dv(t))return Nl(t)&&P7(t)?t.name:$7(t)??t.name;if(Fee(t)||SO(t)||qee(t))return t.name;if(Og(t)){const e=Cte(t);if(e)return e}else if(O7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}M($y,"getTypeName");function Cte(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return $y(t.type.ref)}M(Cte,"getActionType");function mNe(t){var e;return Bu(t)?((e=t.type)==null?void 0:e.name)??"string":Nl(t)&&P7(t)?t.name:$7(t)??t.name}M(mNe,"getRuleTypeName");function kte(t){var e;return Bu(t)?((e=t.type)==null?void 0:e.name)??"string":$7(t)??t.name}M(kte,"getRuleType");function B7(t){const e={s:!1,i:!1,u:!1},r=gv(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}M(B7,"terminalRegex");var Ste=/[\s\S]/.source;function gv(t,e){var r;if(Uee(t))return yNe(t);if(Yee(t))return vNe(t);if(Oee(t))return wNe(t);if(kO(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Rd(gv(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(zee(t))return xNe(t);if(Xee(t))return bNe(t);if(Wee(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(Kee(t))return Rd(Ste,{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(gv,"abstractElementToRegex");function yNe(t){return Rd(t.elements.map(e=>gv(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(yNe,"terminalAlternativesToRegex");function vNe(t){return Rd(t.elements.map(e=>gv(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(vNe,"terminalGroupToRegex");function bNe(t){return Rd(`${Ste}*?${gv(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(bNe,"untilTokenToRegex");function xNe(t){return Rd(`(?!${gv(t.terminal)})${Ste}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(xNe,"negateTokenToRegex");function wNe(t){return t.right?Rd(`[${kR(t.left)}-${kR(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Rd(kR(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(wNe,"characterRangeToRegex");function kR(t){return I3(t.value)}M(kR,"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 Ete(t){const e=[],r=t.Grammar;for(const n of r.rules)Bu(n)&&mte(n)&&cte(B7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:tte}}M(Ete,"createGrammarConfig");var UZt=typeof global=="object"&&global&&global.Object===Object&&global,TNe=UZt,YZt=typeof self=="object"&&self&&self.Object===Object&&self,jZt=TNe||YZt||Function("return this")(),ef=jZt,XZt=ef.Symbol,Du=XZt,CNe=Object.prototype,KZt=CNe.hasOwnProperty,ZZt=CNe.toString,kC=Du?Du.toStringTag:void 0;function kNe(t){var e=KZt.call(t,kC),r=t[kC];try{t[kC]=void 0;var n=!0}catch{}var i=ZZt.call(t);return n&&(e?t[kC]=r:delete t[kC]),i}M(kNe,"getRawTag");var QZt=kNe,JZt=Object.prototype,eQt=JZt.toString;function SNe(t){return eQt.call(t)}M(SNe,"objectToString");var tQt=SNe,rQt="[object Null]",nQt="[object Undefined]",lge=Du?Du.toStringTag:void 0;function ENe(t){return t==null?t===void 0?nQt:rQt:lge&&lge in Object(t)?QZt(t):tQt(t)}M(ENe,"baseGetTag");var fm=ENe;function ANe(t){return t!=null&&typeof t=="object"}M(ANe,"isObjectLike");var _h=ANe,iQt="[object Symbol]";function MNe(t){return typeof t=="symbol"||_h(t)&&fm(t)==iQt}M(MNe,"isSymbol");var PO=MNe;function RNe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=zQt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}M(UNe,"shortOut");var GQt=UNe;function YNe(t){return function(){return t}}M(YNe,"constant");var WQt=YNe,qQt=(function(){try{var t=yv(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yI=qQt,UQt=yI?function(t,e){return yI(t,"toString",{configurable:!0,enumerable:!1,value:WQt(e),writable:!0})}:V7,YQt=UQt,jQt=GQt(YQt),XQt=jQt;function jNe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}M(tDe,"arrayIncludes");var rDe=tDe,QQt=9007199254740991,JQt=/^(?:0|[1-9]\d*)$/;function nDe(t,e){var r=typeof t;return e=e??QQt,!!e&&(r=="number"||r!="symbol"&&JQt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=nJt}M(uDe,"isLength");var Lte=uDe;function hDe(t){return t!=null&&Lte(t.length)&&!J0(t)}M(hDe,"isArrayLike");var tf=hDe;function dDe(t,e,r){if(!Ou(r))return!1;var n=typeof e;return(n=="number"?tf(r)&&$O(e,r.length):n=="string"&&e in r)?H7(r[e],t):!1}M(dDe,"isIterateeCall");var FO=dDe;function fDe(t){return _te(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&&FO(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n-1}M(GDe,"listCacheHas");var wer=GDe;function WDe(t,e){var r=this.__data__,n=HO(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(WDe,"listCacheSet");var Ter=WDe;function bv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Pte(o,e-1,r,n,i):Ote(i,o):n||(i[i.length]=o)}return i}M(Pte,"baseFlatten");var $te=Pte;function aOe(t){var e=t==null?0:t.length;return e?$te(t,1):[]}M(aOe,"flatten");var Ch=aOe,Ver=EDe(Object.getPrototypeOf,Object),oOe=Ver;function lOe(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&Lrr?new Vte:void 0;for(s.set(t,e),s.set(e,t);++d2?e[2]:void 0;for(i&&FO(e[0],e[1],i)&&(n=1);++r=knr&&(s=Hte,a=!1,e=new Vte(e));e:for(;++i-1?i[s?e[a]:a]:void 0}}M(GPe,"createFind");var _nr=GPe,Lnr=Math.max;function WPe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:z7(r);return i<0&&(i=Lnr(n+i,0)),ZNe(t,rf(e),i)}M(WPe,"findIndex");var Inr=WPe,Nnr=_nr(Inr),F5=Nnr;function qPe(t){return t&&t.length?t[0]:void 0}M(qPe,"head");var Lh=qPe;function UPe(t,e){var r=-1,n=tf(t)?Array(t.length):[];return Tv(t,function(i,s,a){n[++r]=e(i,s,a)}),n}M(UPe,"baseMap");var Dnr=UPe;function YPe(t,e){var r=Zn(t)?F7:Dnr;return r(t,rf(e))}M(YPe,"map");var Lr=YPe;function jPe(t,e){return $te(Lr(t,e),1)}M(jPe,"flatMap");var Au=jPe,Onr=Object.prototype,Pnr=Onr.hasOwnProperty,$nr=wnr(function(t,e,r){Pnr.call(t,r)?t[r].push(e):Rte(t,r,[e])}),Bnr=$nr,Fnr=Object.prototype,znr=Fnr.hasOwnProperty;function XPe(t,e){return t!=null&&znr.call(t,e)}M(XPe,"baseHas");var Vnr=XPe;function KPe(t,e){return t!=null&&pPe(t,e,Vnr)}M(KPe,"has");var jr=KPe,Hnr="[object String]";function ZPe(t){return typeof t=="string"||!Zn(t)&&_h(t)&&fm(t)==Hnr}M(ZPe,"isString");var yc=ZPe;function QPe(t,e){return F7(e,function(r){return t[r]})}M(QPe,"baseValues");var Gnr=QPe;function JPe(t){return t==null?[]:Gnr(t,qc(t))}M(JPe,"values");var Ta=JPe,Wnr=Math.max;function e$e(t,e,r,n){t=tf(t)?t:Ta(t),r=r&&!n?z7(r):0;var i=t.length;return r<0&&(r=Wnr(i+r,0)),yc(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Mte(t,e,r)>-1}M(e$e,"includes");var Gl=e$e,qnr=Math.max;function t$e(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:z7(r);return i<0&&(i=qnr(n+i,0)),Mte(t,e,i)}M(t$e,"indexOf");var zge=t$e,Unr="[object Map]",Ynr="[object Set]",jnr=Object.prototype,Xnr=jnr.hasOwnProperty;function r$e(t){if(t==null)return!0;if(tf(t)&&(Zn(t)||typeof t=="string"||typeof t.splice=="function"||iE(t)||Ite(t)||zO(t)))return!t.length;var e=B5(t);if(e==Unr||e==Ynr)return!t.size;if(W7(t))return!MDe(t).length;for(var r in t)if(Xnr.call(t,r))return!1;return!0}M(r$e,"isEmpty");var Fi=r$e,Knr="[object RegExp]";function n$e(t){return _h(t)&&fm(t)==Knr}M(n$e,"baseIsRegExp");var Znr=n$e,Vge=Pg&&Pg.isRegExp,Qnr=Vge?q7(Vge):Znr,_0=Qnr;function i$e(t){return t===void 0}M(i$e,"isUndefined");var L0=i$e,Jnr="Expected a function";function s$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(s$e,"negate");var eir=s$e;function a$e(t,e,r,n){if(!Ou(t))return t;e=YO(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i=lir){var u=e?null:oir(t);if(u)return Gte(u);a=!1,i=Hte,l=new Vte}else l=e?[]:o;e:for(;++n{r.accept(e)})}},M(Cx,"AbstractProduction"),Cx),kx,Dl=(kx=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(kx,"NonTerminal"),kx),Sx,N3=(Sx=class extends nf{constructor(e){super(e.definition),this.orgText="",Uc(this,$h(e,r=>r!==void 0))}},M(Sx,"Rule"),Sx),Ex,vc=(Ex=class extends nf{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Uc(this,$h(e,r=>r!==void 0))}},M(Ex,"Alternative"),Ex),Ax,Ao=(Ax=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Ax,"Option"),Ax),Mx,Qc=(Mx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Mx,"RepetitionMandatory"),Mx),Rx,Jc=(Rx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Rx,"RepetitionMandatoryWithSeparator"),Rx),_x,Os=(_x=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(_x,"Repetition"),_x),Lx,Tc=(Lx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Lx,"RepetitionWithSeparator"),Lx),Ix,Cc=(Ix=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(Ix,"Alternation"),Ix),Nx,Zi=(Nx=class{constructor(e){this.idx=1,Uc(this,$h(e,r=>r!==void 0))}accept(e){e.visit(this)}},M(Nx,"Terminal"),Nx);function b$e(t){return Lr(t,kS)}M(b$e,"serializeGrammar");function kS(t){function e(r){return Lr(r,kS)}if(M(e,"convertDefinition"),t instanceof Dl){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return yc(t.label)&&(r.label=t.label),r}else{if(t instanceof vc)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ao)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:kS(new Zi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Tc)return{type:"RepetitionWithSeparator",idx:t.idx,separator:kS(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 Cc)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Zi){const r={type:"Terminal",name:t.terminalType.name,label:y$e(t.terminalType),idx:t.idx};yc(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 N3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}M(kS,"serializeProduction");var Dx,D3=(Dx=class{visit(e){const r=e;switch(r.constructor){case Dl:return this.visitNonTerminal(r);case vc:return this.visitAlternative(r);case Ao:return this.visitOption(r);case Qc:return this.visitRepetitionMandatory(r);case Jc:return this.visitRepetitionMandatoryWithSeparator(r);case Tc:return this.visitRepetitionWithSeparator(r);case Os:return this.visitRepetition(r);case Cc:return this.visitAlternation(r);case Zi:return this.visitTerminal(r);case N3: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(Dx,"GAstVisitor"),Dx);function x$e(t){return t instanceof vc||t instanceof Ao||t instanceof Os||t instanceof Qc||t instanceof Jc||t instanceof Tc||t instanceof Zi||t instanceof N3}M(x$e,"isSequenceProd");function cE(t,e=[]){return t instanceof Ao||t instanceof Os||t instanceof Tc?!0:t instanceof Cc?p$e(t.definition,n=>cE(n,e)):t instanceof Dl&&Gl(e,t)?!1:t instanceof nf?(t instanceof Dl&&e.push(t),kh(t.definition,n=>cE(n,e))):!1}M(cE,"isOptionalProd");function w$e(t){return t instanceof Cc}M(w$e,"isBranchingProd");function ah(t){if(t instanceof Dl)return"SUBRULE";if(t instanceof Ao)return"OPTION";if(t instanceof Cc)return"OR";if(t instanceof Qc)return"AT_LEAST_ONE";if(t instanceof Jc)return"AT_LEAST_ONE_SEP";if(t instanceof Tc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(ah,"getProductionDslName");var Ox,KO=(Ox=class{walk(e,r=[]){tn(e.definition,(n,i)=>{const s=mo(e.definition,i+1);if(n instanceof Dl)this.walkProdRef(n,s,r);else if(n instanceof Zi)this.walkTerminal(n,s,r);else if(n instanceof vc)this.walkFlat(n,s,r);else if(n instanceof Ao)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 Tc)this.walkManySep(n,s,r);else if(n instanceof Os)this.walkMany(n,s,r);else if(n instanceof Cc)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 Ao({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=hY(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Ao({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=hY(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);tn(e.definition,s=>{const a=new vc({definition:[s]});this.walk(a,i)})}},M(Ox,"RestWalker"),Ox);function hY(t,e,r){return[new Ao({definition:[new Zi({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}M(hY,"restForRepetitionWithSeparator");function O3(t){if(t instanceof Dl)return O3(t.referencedRule);if(t instanceof Zi)return k$e(t);if(x$e(t))return T$e(t);if(w$e(t))return C$e(t);throw Error("non exhaustive match")}M(O3,"first");function T$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=cE(s),e=e.concat(O3(s)),n=n+1,i=r.length>n;return Ute(e)}M(T$e,"firstForSequence");function C$e(t){const e=Lr(t.definition,r=>O3(r));return Ute(Ch(e))}M(C$e,"firstForBranching");function k$e(t){return[t.terminalType]}M(k$e,"firstForTerminal");var S$e="_~IN~_",Px,uir=(Px=class extends KO{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=A$e(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),a=new vc({definition:s}),o=O3(a);this.follows[i]=o}},M(Px,"ResyncFollowsWalker"),Px);function E$e(t){const e={};return tn(t,r=>{const n=new uir(r).startWalking();Uc(e,n)}),e}M(E$e,"computeAllProdsFollows");function A$e(t,e){return t.name+e+S$e}M(A$e,"buildBetweenProdsFollowPrefix");var SR={},hir=new sNe;function j7(t){const e=t.toString();if(SR.hasOwnProperty(e))return SR[e];{const r=hir.pattern(e);return SR[e]=r,r}}M(j7,"getRegExpAst");function M$e(){SR={}}M(M$e,"clearRegExpParserCache");var R$e="Complement Sets are not supported for first char optimization",xI=`Unable to use "first char" lexer optimizations: -`;function _$e(t,e=!1){try{const r=j7(t);return wI(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===R$e)e&&Yte(`${xI} Unable to optimize: < ${t.toString()} > +`.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(Tx,"TerminalRegExpVisitor"),Tx),H1=new UZt;function cNe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=lNe.pattern(t),r=[];for(const n of e.value.value)H1.reset(t),H1.visit(n),r.push({start:H1.startRegexp,end:H1.endRegex});return r}catch{return[]}}M(cNe,"getTerminalParts");function cte(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),H1.reset(t),H1.visit(lNe.pattern(t)),H1.multiline}catch{return!1}}M(cte,"isMultilineComment");var uNe=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function _O(t){const e=typeof t=="string"?new RegExp(t):t;return uNe.some(r=>e.test(r))}M(_O,"isWhitespace");function I3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}M(I3,"escapeRegExp");function ute(t,e){const r=hte(t),n=e.match(r);return!!n&&n[0].length>0}M(ute,"partialMatches");function hte(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(hte,"partialRegExp");function dte(t){return t.rules.find(e=>Nl(e)&&e.entry)}M(dte,"getEntryRule");function fte(t){return t.rules.filter(e=>Bu(e)&&e.hidden)}M(fte,"getHiddenRules");function LO(t,e){const r=new Set,n=dte(t);if(!n)return new Set(t.rules);const i=[n].concat(fte(t));for(const a of i)pte(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(LO,"getAllReachableRules");function pte(t,e,r){e.add(t.name),Q0(t).forEach(n=>{if(R0(n)||r&&kO(n)){const i=n.rule.ref;i&&!e.has(i.name)&&pte(i,e,r)}})}M(pte,"ruleDfs");function hNe(t){const e=new Set;return Q0(t).forEach(r=>{fv(r)&&(Nl(r.type.ref)&&e.add(r.type.ref),O7(r.type.ref)&&Nl(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}M(hNe,"getAllRulesUsedForCrossReferences");function gte(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=OO(t.type.ref);return e==null?void 0:e.terminal}}M(gte,"getCrossReferenceTerminal");function mte(t){return t.hidden&&!_O(B7(t))}M(mte,"isCommentTerminal");function yte(t,e){return!t||!e?[]:NO(t,e,t.astNode,!0)}M(yte,"findNodesForProperty");function IO(t,e,r){if(!t||!e)return;const n=NO(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(IO,"findNodeForProperty");function NO(t,e,r,n){if(!n){const i=hv(t.grammarSource,A0);if(i&&i.feature===e)return[t]}return E0(t)&&t.astNode===r?t.content.flatMap(i=>NO(i,e,r,!1)):[]}M(NO,"findNodesForPropertyInternal");function dNe(t,e){return t?DO(t,e,t==null?void 0:t.astNode):[]}M(dNe,"findNodesForKeyword");function vte(t,e,r){if(!t)return;const n=DO(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(vte,"findNodeForKeyword");function DO(t,e,r){if(t.astNode!==r)return[];if(M0(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=P5(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(DO,"findNodesForKeywordInternal");function bte(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=hv(t.grammarSource,A0);if(n)return n;t=t.container}}M(bte,"findAssignment");function OO(t){let e=t;return O7(e)&&(Og(e.$container)?e=e.$container.$container:dv(e.$container)?e=e.$container:dm(e.$container)),xte(t,e,new Map)}M(OO,"findNameAssignment");function xte(t,e,r){var i;function n(s,a){let o;return hv(s,A0)||(o=xte(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)&&Nl(s.rule.ref))return n(s,s.rule.ref);if(CO(s)&&((i=s.typeRef)!=null&&i.ref))return n(s,s.typeRef.ref)}}M(xte,"findNameAssignmentInternal");function wte(t){const e=t.$container;if(pv(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const s=r[i];if(Og(s))return s;{const a=Q0(r[i]).find(Og);if(a)return a}}}if(wO(e))return wte(e)}M(wte,"getActionAtElement");function fNe(t,e){return t==="?"||t==="*"||pv(e)&&!!e.guardCondition}M(fNe,"isOptionalCardinality");function pNe(t){return t==="*"||t==="+"}M(pNe,"isArrayCardinality");function gNe(t){return t==="+="}M(gNe,"isArrayOperator");function P7(t){return Tte(t,new Set)}M(P7,"isDataTypeRule");function Tte(t,e){if(e.has(t))return!0;e.add(t);for(const r of Q0(t))if(R0(r)){if(!r.rule.ref||Nl(r.rule.ref)&&!Tte(r.rule.ref,e)||O5(r.rule.ref))return!1}else{if(A0(r))return!1;if(Og(r))return!1}return!!t.definition}M(Tte,"isDataTypeRuleInternal");function mNe(t){return mI(t.type,new Set)}M(mNe,"isDataType");function mI(t,e){if(e.has(t))return!0;if(e.add(t),Nee(t))return!1;if(Gee(t))return!1;if(jee(t))return t.types.every(r=>mI(r,e));if(CO(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 SO(r)?mI(r.type,e):!1}else return!1}else return!1}M(mI,"isDataTypeInternal");function $7(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($7,"getExplicitRuleType");function $y(t){if(dv(t))return Nl(t)&&P7(t)?t.name:$7(t)??t.name;if(Fee(t)||SO(t)||qee(t))return t.name;if(Og(t)){const e=Cte(t);if(e)return e}else if(O7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}M($y,"getTypeName");function Cte(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return $y(t.type.ref)}M(Cte,"getActionType");function yNe(t){var e;return Bu(t)?((e=t.type)==null?void 0:e.name)??"string":Nl(t)&&P7(t)?t.name:$7(t)??t.name}M(yNe,"getRuleTypeName");function kte(t){var e;return Bu(t)?((e=t.type)==null?void 0:e.name)??"string":$7(t)??t.name}M(kte,"getRuleType");function B7(t){const e={s:!1,i:!1,u:!1},r=gv(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}M(B7,"terminalRegex");var Ste=/[\s\S]/.source;function gv(t,e){var r;if(Uee(t))return vNe(t);if(Yee(t))return bNe(t);if(Oee(t))return TNe(t);if(kO(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Rd(gv(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(zee(t))return wNe(t);if(Xee(t))return xNe(t);if(Wee(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(Kee(t))return Rd(Ste,{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(gv,"abstractElementToRegex");function vNe(t){return Rd(t.elements.map(e=>gv(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(vNe,"terminalAlternativesToRegex");function bNe(t){return Rd(t.elements.map(e=>gv(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(bNe,"terminalGroupToRegex");function xNe(t){return Rd(`${Ste}*?${gv(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(xNe,"untilTokenToRegex");function wNe(t){return Rd(`(?!${gv(t.terminal)})${Ste}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(wNe,"negateTokenToRegex");function TNe(t){return t.right?Rd(`[${kR(t.left)}-${kR(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Rd(kR(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(TNe,"characterRangeToRegex");function kR(t){return I3(t.value)}M(kR,"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 Ete(t){const e=[],r=t.Grammar;for(const n of r.rules)Bu(n)&&mte(n)&&cte(B7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:tte}}M(Ete,"createGrammarConfig");var YZt=typeof global=="object"&&global&&global.Object===Object&&global,CNe=YZt,jZt=typeof self=="object"&&self&&self.Object===Object&&self,XZt=CNe||jZt||Function("return this")(),ef=XZt,KZt=ef.Symbol,Du=KZt,kNe=Object.prototype,ZZt=kNe.hasOwnProperty,QZt=kNe.toString,kC=Du?Du.toStringTag:void 0;function SNe(t){var e=ZZt.call(t,kC),r=t[kC];try{t[kC]=void 0;var n=!0}catch{}var i=QZt.call(t);return n&&(e?t[kC]=r:delete t[kC]),i}M(SNe,"getRawTag");var JZt=SNe,eQt=Object.prototype,tQt=eQt.toString;function ENe(t){return tQt.call(t)}M(ENe,"objectToString");var rQt=ENe,nQt="[object Null]",iQt="[object Undefined]",cge=Du?Du.toStringTag:void 0;function ANe(t){return t==null?t===void 0?iQt:nQt:cge&&cge in Object(t)?JZt(t):rQt(t)}M(ANe,"baseGetTag");var fm=ANe;function MNe(t){return t!=null&&typeof t=="object"}M(MNe,"isObjectLike");var _h=MNe,sQt="[object Symbol]";function RNe(t){return typeof t=="symbol"||_h(t)&&fm(t)==sQt}M(RNe,"isSymbol");var PO=RNe;function _Ne(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=VQt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}M(YNe,"shortOut");var WQt=YNe;function jNe(t){return function(){return t}}M(jNe,"constant");var qQt=jNe,UQt=(function(){try{var t=yv(Object,"defineProperty");return t({},"",{}),t}catch{}})(),yI=UQt,YQt=yI?function(t,e){return yI(t,"toString",{configurable:!0,enumerable:!1,value:qQt(e),writable:!0})}:V7,jQt=YQt,XQt=WQt(jQt),KQt=XQt;function XNe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}M(rDe,"arrayIncludes");var nDe=rDe,JQt=9007199254740991,eJt=/^(?:0|[1-9]\d*)$/;function iDe(t,e){var r=typeof t;return e=e??JQt,!!e&&(r=="number"||r!="symbol"&&eJt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=iJt}M(hDe,"isLength");var Lte=hDe;function dDe(t){return t!=null&&Lte(t.length)&&!J0(t)}M(dDe,"isArrayLike");var tf=dDe;function fDe(t,e,r){if(!Ou(r))return!1;var n=typeof e;return(n=="number"?tf(r)&&$O(e,r.length):n=="string"&&e in r)?H7(r[e],t):!1}M(fDe,"isIterateeCall");var FO=fDe;function pDe(t){return _te(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&&FO(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n-1}M(WDe,"listCacheHas");var Ter=WDe;function qDe(t,e){var r=this.__data__,n=HO(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(qDe,"listCacheSet");var Cer=qDe;function bv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Pte(o,e-1,r,n,i):Ote(i,o):n||(i[i.length]=o)}return i}M(Pte,"baseFlatten");var $te=Pte;function oOe(t){var e=t==null?0:t.length;return e?$te(t,1):[]}M(oOe,"flatten");var Ch=oOe,Her=ADe(Object.getPrototypeOf,Object),lOe=Her;function cOe(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&Irr?new Vte:void 0;for(s.set(t,e),s.set(e,t);++d2?e[2]:void 0;for(i&&FO(e[0],e[1],i)&&(n=1);++r=Snr&&(s=Hte,a=!1,e=new Vte(e));e:for(;++i-1?i[s?e[a]:a]:void 0}}M(WPe,"createFind");var Lnr=WPe,Inr=Math.max;function qPe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:z7(r);return i<0&&(i=Inr(n+i,0)),QNe(t,rf(e),i)}M(qPe,"findIndex");var Nnr=qPe,Dnr=Lnr(Nnr),F5=Dnr;function UPe(t){return t&&t.length?t[0]:void 0}M(UPe,"head");var Lh=UPe;function YPe(t,e){var r=-1,n=tf(t)?Array(t.length):[];return Tv(t,function(i,s,a){n[++r]=e(i,s,a)}),n}M(YPe,"baseMap");var Onr=YPe;function jPe(t,e){var r=Zn(t)?F7:Onr;return r(t,rf(e))}M(jPe,"map");var Lr=jPe;function XPe(t,e){return $te(Lr(t,e),1)}M(XPe,"flatMap");var Au=XPe,Pnr=Object.prototype,$nr=Pnr.hasOwnProperty,Bnr=Tnr(function(t,e,r){$nr.call(t,r)?t[r].push(e):Rte(t,r,[e])}),Fnr=Bnr,znr=Object.prototype,Vnr=znr.hasOwnProperty;function KPe(t,e){return t!=null&&Vnr.call(t,e)}M(KPe,"baseHas");var Hnr=KPe;function ZPe(t,e){return t!=null&&gPe(t,e,Hnr)}M(ZPe,"has");var jr=ZPe,Gnr="[object String]";function QPe(t){return typeof t=="string"||!Zn(t)&&_h(t)&&fm(t)==Gnr}M(QPe,"isString");var yc=QPe;function JPe(t,e){return F7(e,function(r){return t[r]})}M(JPe,"baseValues");var Wnr=JPe;function e$e(t){return t==null?[]:Wnr(t,qc(t))}M(e$e,"values");var Ta=e$e,qnr=Math.max;function t$e(t,e,r,n){t=tf(t)?t:Ta(t),r=r&&!n?z7(r):0;var i=t.length;return r<0&&(r=qnr(i+r,0)),yc(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Mte(t,e,r)>-1}M(t$e,"includes");var Gl=t$e,Unr=Math.max;function r$e(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:z7(r);return i<0&&(i=Unr(n+i,0)),Mte(t,e,i)}M(r$e,"indexOf");var Vge=r$e,Ynr="[object Map]",jnr="[object Set]",Xnr=Object.prototype,Knr=Xnr.hasOwnProperty;function n$e(t){if(t==null)return!0;if(tf(t)&&(Zn(t)||typeof t=="string"||typeof t.splice=="function"||iE(t)||Ite(t)||zO(t)))return!t.length;var e=B5(t);if(e==Ynr||e==jnr)return!t.size;if(W7(t))return!RDe(t).length;for(var r in t)if(Knr.call(t,r))return!1;return!0}M(n$e,"isEmpty");var Fi=n$e,Znr="[object RegExp]";function i$e(t){return _h(t)&&fm(t)==Znr}M(i$e,"baseIsRegExp");var Qnr=i$e,Hge=Pg&&Pg.isRegExp,Jnr=Hge?q7(Hge):Qnr,_0=Jnr;function s$e(t){return t===void 0}M(s$e,"isUndefined");var L0=s$e,eir="Expected a function";function a$e(t){if(typeof t!="function")throw new TypeError(eir);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(a$e,"negate");var tir=a$e;function o$e(t,e,r,n){if(!Ou(t))return t;e=YO(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i=cir){var u=e?null:lir(t);if(u)return Gte(u);a=!1,i=Hte,l=new Vte}else l=e?[]:o;e:for(;++n{r.accept(e)})}},M(Cx,"AbstractProduction"),Cx),kx,Dl=(kx=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(kx,"NonTerminal"),kx),Sx,N3=(Sx=class extends nf{constructor(e){super(e.definition),this.orgText="",Uc(this,$h(e,r=>r!==void 0))}},M(Sx,"Rule"),Sx),Ex,vc=(Ex=class extends nf{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Uc(this,$h(e,r=>r!==void 0))}},M(Ex,"Alternative"),Ex),Ax,Ao=(Ax=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Ax,"Option"),Ax),Mx,Qc=(Mx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Mx,"RepetitionMandatory"),Mx),Rx,Jc=(Rx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Rx,"RepetitionMandatoryWithSeparator"),Rx),_x,Os=(_x=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(_x,"Repetition"),_x),Lx,Tc=(Lx=class extends nf{constructor(e){super(e.definition),this.idx=1,Uc(this,$h(e,r=>r!==void 0))}},M(Lx,"RepetitionWithSeparator"),Lx),Ix,Cc=(Ix=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(Ix,"Alternation"),Ix),Nx,Zi=(Nx=class{constructor(e){this.idx=1,Uc(this,$h(e,r=>r!==void 0))}accept(e){e.visit(this)}},M(Nx,"Terminal"),Nx);function x$e(t){return Lr(t,kS)}M(x$e,"serializeGrammar");function kS(t){function e(r){return Lr(r,kS)}if(M(e,"convertDefinition"),t instanceof Dl){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return yc(t.label)&&(r.label=t.label),r}else{if(t instanceof vc)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ao)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:kS(new Zi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Tc)return{type:"RepetitionWithSeparator",idx:t.idx,separator:kS(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 Cc)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Zi){const r={type:"Terminal",name:t.terminalType.name,label:v$e(t.terminalType),idx:t.idx};yc(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 N3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}M(kS,"serializeProduction");var Dx,D3=(Dx=class{visit(e){const r=e;switch(r.constructor){case Dl:return this.visitNonTerminal(r);case vc:return this.visitAlternative(r);case Ao:return this.visitOption(r);case Qc:return this.visitRepetitionMandatory(r);case Jc:return this.visitRepetitionMandatoryWithSeparator(r);case Tc:return this.visitRepetitionWithSeparator(r);case Os:return this.visitRepetition(r);case Cc:return this.visitAlternation(r);case Zi:return this.visitTerminal(r);case N3: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(Dx,"GAstVisitor"),Dx);function w$e(t){return t instanceof vc||t instanceof Ao||t instanceof Os||t instanceof Qc||t instanceof Jc||t instanceof Tc||t instanceof Zi||t instanceof N3}M(w$e,"isSequenceProd");function cE(t,e=[]){return t instanceof Ao||t instanceof Os||t instanceof Tc?!0:t instanceof Cc?g$e(t.definition,n=>cE(n,e)):t instanceof Dl&&Gl(e,t)?!1:t instanceof nf?(t instanceof Dl&&e.push(t),kh(t.definition,n=>cE(n,e))):!1}M(cE,"isOptionalProd");function T$e(t){return t instanceof Cc}M(T$e,"isBranchingProd");function ah(t){if(t instanceof Dl)return"SUBRULE";if(t instanceof Ao)return"OPTION";if(t instanceof Cc)return"OR";if(t instanceof Qc)return"AT_LEAST_ONE";if(t instanceof Jc)return"AT_LEAST_ONE_SEP";if(t instanceof Tc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(ah,"getProductionDslName");var Ox,KO=(Ox=class{walk(e,r=[]){tn(e.definition,(n,i)=>{const s=mo(e.definition,i+1);if(n instanceof Dl)this.walkProdRef(n,s,r);else if(n instanceof Zi)this.walkTerminal(n,s,r);else if(n instanceof vc)this.walkFlat(n,s,r);else if(n instanceof Ao)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 Tc)this.walkManySep(n,s,r);else if(n instanceof Os)this.walkMany(n,s,r);else if(n instanceof Cc)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 Ao({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=hY(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Ao({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=hY(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);tn(e.definition,s=>{const a=new vc({definition:[s]});this.walk(a,i)})}},M(Ox,"RestWalker"),Ox);function hY(t,e,r){return[new Ao({definition:[new Zi({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}M(hY,"restForRepetitionWithSeparator");function O3(t){if(t instanceof Dl)return O3(t.referencedRule);if(t instanceof Zi)return S$e(t);if(w$e(t))return C$e(t);if(T$e(t))return k$e(t);throw Error("non exhaustive match")}M(O3,"first");function C$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=cE(s),e=e.concat(O3(s)),n=n+1,i=r.length>n;return Ute(e)}M(C$e,"firstForSequence");function k$e(t){const e=Lr(t.definition,r=>O3(r));return Ute(Ch(e))}M(k$e,"firstForBranching");function S$e(t){return[t.terminalType]}M(S$e,"firstForTerminal");var E$e="_~IN~_",Px,hir=(Px=class extends KO{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=M$e(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),a=new vc({definition:s}),o=O3(a);this.follows[i]=o}},M(Px,"ResyncFollowsWalker"),Px);function A$e(t){const e={};return tn(t,r=>{const n=new hir(r).startWalking();Uc(e,n)}),e}M(A$e,"computeAllProdsFollows");function M$e(t,e){return t.name+e+E$e}M(M$e,"buildBetweenProdsFollowPrefix");var SR={},dir=new aNe;function j7(t){const e=t.toString();if(SR.hasOwnProperty(e))return SR[e];{const r=dir.pattern(e);return SR[e]=r,r}}M(j7,"getRegExpAst");function R$e(){SR={}}M(R$e,"clearRegExpParserCache");var _$e="Complement Sets are not supported for first char optimization",xI=`Unable to use "first char" lexer optimizations: +`;function L$e(t,e=!1){try{const r=j7(t);return wI(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===_$e)e&&Yte(`${xI} 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=` @@ -3466,48 +3466,48 @@ ${JSON.stringify(Ee,null,4)}`);const it=Ee;if(r.string(it.id)||r.number(it.id)){ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),bI(`${xI} 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(_$e,"getOptimizedStartCodesIndices");function wI(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")Tk(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)Tk(h,e,r);else{for(let h=u.from;h<=u.to&&h=kk){const h=u.from>=kk?u.from:kk,d=u.to,f=I0(h),p=I0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":wI(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"&&TI(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Ta(e)}M(wI,"firstCharOptimizedIndices");function Tk(t,e,r){const n=I0(t);e[n]=n,r===!0&&L$e(t,e)}M(Tk,"addOptimizedIdxToResult");function L$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(L$e,"handleIgnoreCase");function dY(t,e){return F5(t.value,r=>{if(typeof r=="number")return Gl(e,r);{const n=r;return F5(e,i=>n.from<=i&&i<=n.to)!==void 0}})}M(dY,"findCode");function TI(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Zn(t.value)?kh(t.value,TI):TI(t.value):!1}M(TI,"isWholeOptional");var $x,dir=($x=class extends RO{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){Gl(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?dY(e,this.targetCharCodes)===void 0&&(this.found=!0):dY(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},M($x,"CharCodeFinder"),$x);function ZO(t,e){if(e instanceof RegExp){const r=j7(e),n=new dir(t);return n.visit(r),n.found}else return F5(e,r=>Gl(t,r.charCodeAt(0)))!==void 0}M(ZO,"canMatchCharCode");var Fy="PATTERN",Ck="defaultMode",q8="modes";function I$e(t,e){e=qte(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:M((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{J$e()});let n;r("Reject Lexer.NA",()=>{n=XO(t,x=>x[Fy]===Ml.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=Lr(n,x=>{const b=x[Fy];if(_0(b)){const T=b.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!b.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Gl(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:fY(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 fY(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!==Ml.SKIPPED){if(yc(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 Zn(b)?Lr(b,C=>zge(n,C)):[zge(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=Qte(e.lineTerminatorCharacters);d=Lr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Lr(n,b=>jr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:Zte(b,x)===!1&&ZO(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Lr(n,Kte),p=Lr(s,Z$e),g=Yc(n,(x,b)=>{const T=b.GROUP;return yc(T)&&T!==Ml.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);ER(x,S,m[T])}else if(Zn(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,ER(x,E,m[T]))})}else if(_0(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&bI(`${xI} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}M(L$e,"getOptimizedStartCodesIndices");function wI(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")Tk(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)Tk(h,e,r);else{for(let h=u.from;h<=u.to&&h=kk){const h=u.from>=kk?u.from:kk,d=u.to,f=I0(h),p=I0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":wI(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"&&TI(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Ta(e)}M(wI,"firstCharOptimizedIndices");function Tk(t,e,r){const n=I0(t);e[n]=n,r===!0&&I$e(t,e)}M(Tk,"addOptimizedIdxToResult");function I$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(I$e,"handleIgnoreCase");function dY(t,e){return F5(t.value,r=>{if(typeof r=="number")return Gl(e,r);{const n=r;return F5(e,i=>n.from<=i&&i<=n.to)!==void 0}})}M(dY,"findCode");function TI(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Zn(t.value)?kh(t.value,TI):TI(t.value):!1}M(TI,"isWholeOptional");var $x,fir=($x=class extends RO{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){Gl(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?dY(e,this.targetCharCodes)===void 0&&(this.found=!0):dY(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},M($x,"CharCodeFinder"),$x);function ZO(t,e){if(e instanceof RegExp){const r=j7(e),n=new fir(t);return n.visit(r),n.found}else return F5(e,r=>Gl(t,r.charCodeAt(0)))!==void 0}M(ZO,"canMatchCharCode");var Fy="PATTERN",Ck="defaultMode",q8="modes";function N$e(t,e){e=qte(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:M((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{eBe()});let n;r("Reject Lexer.NA",()=>{n=XO(t,x=>x[Fy]===Ml.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=Lr(n,x=>{const b=x[Fy];if(_0(b)){const T=b.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!b.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Gl(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:fY(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 fY(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!==Ml.SKIPPED){if(yc(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 Zn(b)?Lr(b,C=>Vge(n,C)):[Vge(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=Qte(e.lineTerminatorCharacters);d=Lr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Lr(n,b=>jr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:Zte(b,x)===!1&&ZO(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Lr(n,Kte),p=Lr(s,Q$e),g=Yc(n,(x,b)=>{const T=b.GROUP;return yc(T)&&T!==Ml.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);ER(x,S,m[T])}else if(Zn(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,ER(x,E,m[T]))})}else if(_0(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&bI(`${xI} 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=_$e(b.PATTERN,e.ensureOptimizations);Fi(C)&&(y=!1),tn(C,S=>{ER(x,S,m[T])})}else e.ensureOptimizations&&bI(`${xI} 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=L$e(b.PATTERN,e.ensureOptimizations);Fi(C)&&(y=!1),tn(C,S=>{ER(x,S,m[T])})}else e.ensureOptimizations&&bI(`${xI} 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(I$e,"analyzeTokenTypes");function N$e(t,e){let r=[];const n=O$e(t);r=r.concat(n.errors);const i=P$e(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(D$e(s)),r=r.concat(H$e(s)),r=r.concat(G$e(s,e)),r=r.concat(W$e(s)),r}M(N$e,"validatePatterns");function D$e(t){let e=[];const r=Fu(t,n=>_0(n[Fy]));return e=e.concat($$e(r)),e=e.concat(F$e(r)),e=e.concat(z$e(r)),e=e.concat(V$e(r)),e=e.concat(B$e(r)),e}M(D$e,"validateRegExpPattern");function O$e(t){const e=Fu(t,i=>!jr(i,Fy)),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ps.MISSING_PATTERN,tokenTypes:[i]})),n=jO(t,e);return{errors:r,valid:n}}M(O$e,"findMissingPatterns");function P$e(t){const e=Fu(t,i=>{const s=i[Fy];return!_0(s)&&!J0(s)&&!jr(s,"exec")&&!yc(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=jO(t,e);return{errors:r,valid:n}}M(P$e,"findInvalidPatterns");var fir=/[^\\][$]/;function $$e(t){const i=class i extends RO{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=j7(a),l=new e;return l.visit(o),l.found}catch{return fir.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(N$e,"analyzeTokenTypes");function D$e(t,e){let r=[];const n=P$e(t);r=r.concat(n.errors);const i=$$e(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(O$e(s)),r=r.concat(G$e(s)),r=r.concat(W$e(s,e)),r=r.concat(q$e(s)),r}M(D$e,"validatePatterns");function O$e(t){let e=[];const r=Fu(t,n=>_0(n[Fy]));return e=e.concat(B$e(r)),e=e.concat(z$e(r)),e=e.concat(V$e(r)),e=e.concat(H$e(r)),e=e.concat(F$e(r)),e}M(O$e,"validateRegExpPattern");function P$e(t){const e=Fu(t,i=>!jr(i,Fy)),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ps.MISSING_PATTERN,tokenTypes:[i]})),n=jO(t,e);return{errors:r,valid:n}}M(P$e,"findMissingPatterns");function $$e(t){const e=Fu(t,i=>{const s=i[Fy];return!_0(s)&&!J0(s)&&!jr(s,"exec")&&!yc(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=jO(t,e);return{errors:r,valid:n}}M($$e,"findInvalidPatterns");var pir=/[^\\][$]/;function B$e(t){const i=class i extends RO{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=j7(a),l=new e;return l.visit(o),l.found}catch{return pir.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($$e,"findEndOfInputAnchor");function B$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(B$e,"findEmptyMatchRegExps");var pir=/[^\\[][\^]|^\^/;function F$e(t){const i=class i extends RO{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=j7(a),l=new e;return l.visit(o),l.found}catch{return pir.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(B$e,"findEndOfInputAnchor");function F$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(F$e,"findEmptyMatchRegExps");var gir=/[^\\[][\^]|^\^/;function z$e(t){const i=class i extends RO{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=j7(a),l=new e;return l.visit(o),l.found}catch{return gir.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(F$e,"findStartOfInputAnchor");function z$e(t){const e=Fu(t,n=>{const i=n[Fy];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(z$e,"findUnsupportedFlags");function V$e(t){const e=[];let r=Lr(t,s=>Yc(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!Gl(e,o)&&o.PATTERN!==Ml.NA&&(e.push(o),a.push(o)),a),[]));r=Y7(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(V$e,"findDuplicatePatterns");function H$e(t){const e=Fu(t,n=>{if(!jr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Ml.SKIPPED&&i!==Ml.NA&&!yc(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(H$e,"findInvalidGroupType");function G$e(t,e){const r=Fu(t,i=>i.PUSH_MODE!==void 0&&!Gl(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(G$e,"findModesThatDoNotExist");function W$e(t){const e=[],r=Yc(t,(n,i,s)=>{const a=i.PATTERN;return a===Ml.NA||(yc(a)?n.push({str:a,idx:s,tokenType:i}):_0(a)&&U$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(z$e,"findStartOfInputAnchor");function V$e(t){const e=Fu(t,n=>{const i=n[Fy];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(V$e,"findUnsupportedFlags");function H$e(t){const e=[];let r=Lr(t,s=>Yc(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!Gl(e,o)&&o.PATTERN!==Ml.NA&&(e.push(o),a.push(o)),a),[]));r=Y7(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(H$e,"findDuplicatePatterns");function G$e(t){const e=Fu(t,n=>{if(!jr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Ml.SKIPPED&&i!==Ml.NA&&!yc(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(G$e,"findInvalidGroupType");function W$e(t,e){const r=Fu(t,i=>i.PUSH_MODE!==void 0&&!Gl(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(W$e,"findModesThatDoNotExist");function q$e(t){const e=[],r=Yc(t,(n,i,s)=>{const a=i.PATTERN;return a===Ml.NA||(yc(a)?n.push({str:a,idx:s,tokenType:i}):_0(a)&&Y$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(W$e,"findUnreachablePatterns");function q$e(t,e){if(_0(e)){if(Y$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(q$e,"tryToMatchStrToPattern");function U$e(t){return F5([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}M(U$e,"noMetaChar");function Y$e(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its 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(q$e,"findUnreachablePatterns");function U$e(t,e){if(_0(e)){if(j$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(U$e,"tryToMatchStrToPattern");function Y$e(t){return F5([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}M(Y$e,"noMetaChar");function j$e(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition `,type:Ps.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),jr(t,q8)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+q8+`> property in its definition `,type:Ps.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),jr(t,q8)&&jr(t,Ck)&&!jr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Ck}: <${t.defaultMode}>which does not exist `,type:Ps.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),jr(t,q8)&&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=Zn(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];tn(l,u=>{!L0(u)&&!Gl(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(j$e,"performRuntimeChecks");function X$e(t,e,r){const n=[];let i=!1;const s=Y7(Ch(Ta(t.modes))),a=XO(s,l=>l[Fy]===Ml.NA),o=Qte(r);return e&&tn(a,l=>{const u=Zte(l,o);if(u!==!1){const d={message:Q$e(l,u),type:u.issue,tokenType:l};n.push(d)}else jr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):ZO(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +`,type:Ps.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}M(X$e,"performRuntimeChecks");function K$e(t,e,r){const n=[];let i=!1;const s=Y7(Ch(Ta(t.modes))),a=XO(s,l=>l[Fy]===Ml.NA),o=Qte(r);return e&&tn(a,l=>{const u=Zte(l,o);if(u!==!1){const d={message:J$e(l,u),type:u.issue,tokenType:l};n.push(d)}else jr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):ZO(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(X$e,"performWarningRuntimeChecks");function K$e(t){const e={},r=qc(t);return tn(r,n=>{const i=t[n];if(Zn(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(K$e,"cloneEmptyGroups");function Kte(t){const e=t.PATTERN;if(_0(e))return!1;if(J0(e))return!0;if(jr(e,"exec"))return!0;if(yc(e))return!1;throw Error("non exhaustive match")}M(Kte,"isCustomPattern");function Z$e(t){return yc(t)&&t.length===1?t.charCodeAt(0):!1}M(Z$e,"isShortPattern");var gir={test:M(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(Zn(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(Z$e,"cloneEmptyGroups");function Kte(t){const e=t.PATTERN;if(_0(e))return!1;if(J0(e))return!0;if(jr(e,"exec"))return!0;if(yc(e))return!1;throw Error("non exhaustive match")}M(Kte,"isCustomPattern");function Q$e(t){return yc(t)&&t.length===1?t.charCodeAt(0):!1}M(Q$e,"isShortPattern");var mir={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(Q$e,"buildLineBreakIssueMessage");function Qte(t){return Lr(t,r=>yc(r)?r.charCodeAt(0):r)}M(Qte,"getCharCodes");function ER(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}M(ER,"addToMapOfArrays");var kk=256,AR=[];function I0(t){return t255?255+~~(t/255):t}}M(J$e,"initCharCodeToOptimizedIndexMap");function P3(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}M(P3,"tokenStructuredMatcher");function uE(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}M(uE,"tokenStructuredMatcherNoCategories");var Hge=1,eBe={};function $3(t){const e=tBe(t);rBe(e),iBe(e),nBe(e),tn(e,r=>{r.isParent=r.categoryMatches.length>0})}M($3,"augmentTokenTypes");function tBe(t){let e=Mo(t),r=t,n=!0;for(;n;){r=Y7(Ch(Lr(r,s=>s.CATEGORIES)));const i=jO(r,e);e=e.concat(i),Fi(i)?n=!1:r=i}return e}M(tBe,"expandCategories");function rBe(t){tn(t,e=>{ere(e)||(eBe[Hge]=e,e.tokenTypeIdx=Hge++),pY(e)&&!Zn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),pY(e)||(e.CATEGORIES=[]),sBe(e)||(e.categoryMatches=[]),aBe(e)||(e.categoryMatchesMap={})})}M(rBe,"assignTokenDefaultProps");function nBe(t){tn(t,e=>{e.categoryMatches=[],tn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(eBe[n].tokenTypeIdx)})})}M(nBe,"assignCategoriesTokensProp");function iBe(t){tn(t,e=>{Jte([],e)})}M(iBe,"assignCategoriesMapProp");function Jte(t,e){tn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),tn(e.CATEGORIES,r=>{const n=t.concat(e);Gl(n,r)||Jte(n,r)})}M(Jte,"singleAssignCategoriesToksMap");function ere(t){return jr(t,"tokenTypeIdx")}M(ere,"hasShortKeyProperty");function pY(t){return jr(t,"CATEGORIES")}M(pY,"hasCategoriesProperty");function sBe(t){return jr(t,"categoryMatches")}M(sBe,"hasExtendingTokensTypesProperty");function aBe(t){return jr(t,"categoryMatchesMap")}M(aBe,"hasExtendingTokensTypesMapProperty");function oBe(t){return jr(t,"tokenTypeIdx")}M(oBe,"isTokenType");var gY={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 Sk={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}M(J$e,"buildLineBreakIssueMessage");function Qte(t){return Lr(t,r=>yc(r)?r.charCodeAt(0):r)}M(Qte,"getCharCodes");function ER(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}M(ER,"addToMapOfArrays");var kk=256,AR=[];function I0(t){return t255?255+~~(t/255):t}}M(eBe,"initCharCodeToOptimizedIndexMap");function P3(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}M(P3,"tokenStructuredMatcher");function uE(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}M(uE,"tokenStructuredMatcherNoCategories");var Gge=1,tBe={};function $3(t){const e=rBe(t);nBe(e),sBe(e),iBe(e),tn(e,r=>{r.isParent=r.categoryMatches.length>0})}M($3,"augmentTokenTypes");function rBe(t){let e=Mo(t),r=t,n=!0;for(;n;){r=Y7(Ch(Lr(r,s=>s.CATEGORIES)));const i=jO(r,e);e=e.concat(i),Fi(i)?n=!1:r=i}return e}M(rBe,"expandCategories");function nBe(t){tn(t,e=>{ere(e)||(tBe[Gge]=e,e.tokenTypeIdx=Gge++),pY(e)&&!Zn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),pY(e)||(e.CATEGORIES=[]),aBe(e)||(e.categoryMatches=[]),oBe(e)||(e.categoryMatchesMap={})})}M(nBe,"assignTokenDefaultProps");function iBe(t){tn(t,e=>{e.categoryMatches=[],tn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(tBe[n].tokenTypeIdx)})})}M(iBe,"assignCategoriesTokensProp");function sBe(t){tn(t,e=>{Jte([],e)})}M(sBe,"assignCategoriesMapProp");function Jte(t,e){tn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),tn(e.CATEGORIES,r=>{const n=t.concat(e);Gl(n,r)||Jte(n,r)})}M(Jte,"singleAssignCategoriesToksMap");function ere(t){return jr(t,"tokenTypeIdx")}M(ere,"hasShortKeyProperty");function pY(t){return jr(t,"CATEGORIES")}M(pY,"hasCategoriesProperty");function aBe(t){return jr(t,"categoryMatches")}M(aBe,"hasExtendingTokensTypesProperty");function oBe(t){return jr(t,"categoryMatchesMap")}M(oBe,"hasExtendingTokensTypesMapProperty");function lBe(t){return jr(t,"tokenTypeIdx")}M(lBe,"isTokenType");var gY={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 Sk={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:gY,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Sk);var Bx,Ml=(Bx=class{constructor(e,r=Sk){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}=jte(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({},Sk,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===Sk.lineTerminatorsPattern)this.config.lineTerminatorsPattern=gir;else if(this.config.lineTerminatorCharacters===Sk.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),Zn(e)?i={modes:{defaultMode:Mo(e)},defaultMode:Ck}:(s=!1,i=Mo(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(j$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(X$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},tn(i.modes,(o,l)=>{i.modes[l]=XO(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(N$e(o,a))}),Fi(this.lexerDefinitionErrors)){$3(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=I$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(`----------------------- +a boolean 2nd argument is no longer supported`);this.config=Uc({},Sk,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===Sk.lineTerminatorsPattern)this.config.lineTerminatorsPattern=mir;else if(this.config.lineTerminatorCharacters===Sk.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),Zn(e)?i={modes:{defaultMode:Mo(e)},defaultMode:Ck}:(s=!1,i=Mo(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(X$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(K$e(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},tn(i.modes,(o,l)=>{i.modes[l]=XO(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(D$e(o,a))}),Fi(this.lexerDefinitionErrors)){$3(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=N$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=>{Yte(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(s&&(this.handleModes=Oa),this.trackStartLines===!1&&(this.computeNewColumn=V7),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Oa),/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",()=>{M$e()}),this.TRACE_INIT("toFastProperties",()=>{Xte(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",()=>{R$e()}),this.TRACE_INIT("toFastProperties",()=>{Xte(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 _=K$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=By(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 ${iy(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=` +`+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 _=Z$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=By(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 ${iy(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=>iy(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: '`+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=>iy(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(gb);var yir={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- + <${Lr(t,u=>`[${Lr(u,h=>iy(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(gb);var vir={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},G1={buildDuplicateFoundError(t,e){function r(h){return h instanceof Zi?h.terminalType.name:h instanceof Dl?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 @@ -3534,44 +3534,44 @@ 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 N3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function cBe(t,e){const r=new vir(t,e);return r.resolveRefs(),r.errors}M(cBe,"resolveGrammar");var Fx,vir=(Fx=class extends D3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(Ta(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:Ol.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(Fx,"GastRefResolverVisitor"),Fx),zx,bir=(zx=class extends KO{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=Mo(this.path.ruleStack).reverse(),this.occurrenceStack=Mo(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(zx,"AbstractNextPossibleTokensWalker"),zx),Vx,xir=(Vx=class extends bir{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 vc({definition:i});this.possibleTokTypes=O3(s),this.found=!0}}},M(Vx,"NextAfterTokenWalker"),Vx),Hx,QO=(Hx=class extends KO{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(Hx,"AbstractNextTerminalAfterProductionWalker"),Hx),Gx,wir=(Gx=class extends QO{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(Gx,"NextTerminalAfterManyWalker"),Gx),Wx,Zge=(Wx=class extends QO{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(Wx,"NextTerminalAfterManySepWalker"),Wx),qx,Tir=(qx=class extends QO{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(qx,"NextTerminalAfterAtLeastOneWalker"),qx),Ux,Qge=(Ux=class extends QO{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(Ux,"NextTerminalAfterAtLeastOneSepWalker"),Ux);function CI(t,e,r=[]){r=Mo(r);let n=[],i=0;function s(o){return o.concat(mo(t,i+1))}M(s,"remainingPathWith");function a(o){const l=CI(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:mo(t,i)}),n}M(CI,"possiblePathsFrom");function nre(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&&By(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:mo(p),ruleStack:lE(m),occurrenceStack:lE(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(mo(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof vc)d.push({idx:g,def:v.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof N3)d.push(uBe(v,g,m,y));else throw Error("non exhaustive match")}return h}M(nre,"nextPossibleTokensAfter");function uBe(t,e,r,n){const i=Mo(r);i.push(t.name);const s=Mo(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}M(uBe,"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 Ao||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 Tc||t==="RepetitionWithSeparator")return ws.REPETITION_WITH_SEPARATOR;if(t instanceof Cc||t==="Alternation")return ws.ALTERNATION;throw Error("non exhaustive match")}M(JO,"getProdType");function mY(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=JO(n);return s===ws.ALTERNATION?K7(e,r,i):Z7(e,r,s,i)}M(mY,"getLookaheadPaths");function hBe(t,e,r,n,i,s){const a=K7(t,e,r),o=sre(a)?uE:P3;return s(a,n,o,i)}M(hBe,"buildLookaheadFuncForOr");function dBe(t,e,r,n,i,s){const a=Z7(t,e,i,r),o=sre(a)?uE:P3;return s(a[0],o,n)}M(dBe,"buildLookaheadFuncForOptionalProd");function fBe(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;sCI([a],1)),n=yY(r.length),i=Lr(r,a=>{const o={};return tn(a,l=>{const u=MR(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=yY(o.length);for(let l=0;l{const v=MR(y.partialPath);tn(v,x=>{i[l][x]=!0})})}}}}return n}M(ire,"lookAheadSequenceFromAlternatives");function K7(t,e,r,n){const i=new gBe(t,ws.ALTERNATION,n);return e.accept(i),ire(i.result,r)}M(K7,"getLookaheadPathsForOr");function Z7(t,e,r,n){const i=new gBe(t,r);e.accept(i);const s=i.result,o=new Cir(e,t,r).startWalking(),l=new vc({definition:s}),u=new vc({definition:o});return ire([l,u],n)}M(Z7,"getLookaheadPathsForOptionalProd");function kI(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(yBe,"isStrictPrefixOfPath");function sre(t){return kh(t,e=>kh(e,r=>kh(r,n=>Fi(n.categoryMatches))))}M(sre,"areTokenCategoriesNotUsed");function vBe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:Ol.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(vBe,"validateLookahead");function bBe(t,e,r,n){const i=Au(t,l=>xBe(l,r)),s=_Be(t,e,r),a=Au(t,l=>EBe(l,r)),o=Au(t,l=>TBe(l,t,n,r));return i.concat(s,a,o)}M(bBe,"validateGrammar");function xBe(t,e){const r=new kir;t.accept(r);const n=r.allProductions,i=Bnr(n,wBe),s=$h(i,o=>o.length>1);return Lr(Ta(s),o=>{const l=Lh(o),u=e.buildDuplicateFoundError(t,o),h=ah(l),d={message:u,type:Ol.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=are(l);return f&&(d.parameter=f),d})}M(xBe,"validateDuplicateProductions");function wBe(t){return`${ah(t)}_#_${t.idx}_#_${are(t)}`}M(wBe,"identifyProductionForDuplicates");function are(t){return t instanceof Zi?t.terminalType.name:t instanceof Dl?t.nonTerminalName:""}M(are,"getExtraProductionArgument");var Xx,kir=(Xx=class extends D3{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(Xx,"OccurrenceValidationCollector"),Xx);function TBe(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:Ol.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(TBe,"validateRuleDoesNotAlreadyExist");function CBe(t,e,r){const n=[];let i;return Gl(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:Ol.INVALID_RULE_OVERRIDE,ruleName:t})),n}M(CBe,"validateRuleIsOverridden");function ore(t,e,r,n=[]){const i=[],s=SS(e.definition);if(Fi(s))return[];{const a=t.name;Gl(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ol.LEFT_RECURSION,ruleName:a});const l=jO(s,n.concat([t])),u=Au(l,h=>{const d=Mo(n);return d.push(h),ore(t,h,r,d)});return i.concat(u)}}M(ore,"validateNoLeftRecursion");function SS(t){let e=[];if(Fi(t))return e;const r=Lh(t);if(r instanceof Dl)e.push(r.referencedRule);else if(r instanceof vc||r instanceof Ao||r instanceof Qc||r instanceof Jc||r instanceof Tc||r instanceof Os)e=e.concat(SS(r.definition));else if(r instanceof Cc)e=Ch(Lr(r.definition,s=>SS(s.definition)));else if(!(r instanceof Zi))throw Error("non exhaustive match");const n=cE(r),i=t.length>1;if(n&&i){const s=mo(t);return e.concat(SS(s))}else return e}M(SS,"getFirstNoneTerminal");var Kx,lre=(Kx=class extends D3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Kx,"OrCollector"),Kx);function kBe(t,e){const r=new lre;t.accept(r);const n=r.alternations;return Au(n,s=>{const a=lE(s.definition);return Au(a,(o,l)=>{const u=nre([o],[],P3,1);return Fi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:Ol.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}M(kBe,"validateEmptyOrAlternative");function SBe(t,e,r){const n=new lre;t.accept(n);let i=n.alternations;return i=XO(i,a=>a.ignoreAmbiguities===!0),Au(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=K7(o,t,l,a),h=MBe(u,a,t,r),d=RBe(u,a,t,r);return h.concat(d)})}M(SBe,"validateAmbiguousAlternationAlternatives");var Zx,Sir=(Zx=class extends D3{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(Zx,"RepetitionCollector"),Zx);function EBe(t,e){const r=new lre;t.accept(r);const n=r.alternations;return Au(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Ol.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}M(EBe,"validateTooManyAlts");function ABe(t,e,r){const n=[];return tn(t,i=>{const s=new Sir;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=JO(o),u=o.maxLookahead||e,h=o.idx,f=Z7(h,i,l,u)[0];if(Fi(Ch(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Ol.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(ABe,"validateSomeNonEmptyLookaheadPath");function MBe(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&&kI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!kI(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:Ol.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(MBe,"checkAlternativesAmbiguities");function RBe(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 Y7(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:Ol.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(RBe,"checkPrefixAlternativesAmbiguities");function _Be(t,e,r){const n=[],i=Lr(e,s=>s.name);return tn(t,s=>{const a=s.name;if(Gl(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:Ol.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}M(_Be,"checkTerminalAndNoneTerminalsNameSpace");function LBe(t){const e=qte(t,{errMsgProvider:yir}),r={};return tn(t.rules,n=>{r[n.name]=n}),cBe(r,e.errMsgProvider)}M(LBe,"resolveGrammar");function IBe(t){return t=qte(t,{errMsgProvider:G1}),bBe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(IBe,"validateGrammar");var NBe="MismatchedTokenException",DBe="NoViableAltException",OBe="EarlyExitException",PBe="NotAllInputParsedException",$Be=[NBe,DBe,OBe,PBe];Object.freeze($Be);function hE(t){return Gl($Be,t.name)}M(hE,"isRecognitionException");var Qx,eP=(Qx=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(Qx,"RecognitionException"),Qx),Jx,BBe=(Jx=class extends eP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=NBe}},M(Jx,"MismatchedTokenException"),Jx),e4,Eir=(e4=class extends eP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=DBe}},M(e4,"NoViableAltException"),e4),t4,Air=(t4=class extends eP{constructor(e,r){super(e,r),this.name=PBe}},M(t4,"NotAllInputParsedException"),t4),r4,Mir=(r4=class extends eP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=OBe}},M(r4,"EarlyExitException"),r4),Yz={},FBe="InRuleRecoveryException",n4,Rir=(n4=class extends Error{constructor(e){super(e),this.name=FBe}},M(n4,"InRuleRecoveryException"),n4),i4,_ir=(i4=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=jr(e,"recoveryEnabled")?e.recoveryEnabled:N0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=zBe)}getTokenToInsert(e){const r=X7(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 BBe(p,u,this.LA(0));g.resyncedTokens=lE(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 Rir("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 F5(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 Gl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=F5(e,s=>rre(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Yz;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?Yz:{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===Yz)return[$g];const r=e.ruleName+e.idxInCallingRule+S$e+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,$g)||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 lE(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Mo(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(i4,"Recoverable"),i4);function zBe(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=$g,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}M(zBe,"attemptInRepetitionRecovery");var Lir=4,pm=8,VBe=1<ore(r,r,G1))}validateEmptyOrAlternatives(e){return Au(e,r=>kBe(r,G1))}validateAmbiguousAlternationAlternatives(e,r){return Au(e,n=>SBe(n,r,G1))}validateSomeNonEmptyLookaheadPath(e,r){return ABe(e,r,G1)}buildLookaheadForAlternation(e){return hBe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,fBe)}buildLookaheadForOptional(e){return dBe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,JO(e.prodType),pBe)}},M(s4,"LLkLookaheadStrategy"),s4),a4,Iir=(a4=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 cre({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}=GBe(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=_R(this.fullRuleNameToShort[r.name],VBe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,vY,"Repetition",u.maxLookahead,ah(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,HBe,"Option",u.maxLookahead,ah(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,bY,"RepetitionMandatory",u.maxLookahead,ah(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,RR,"RepetitionMandatoryWithSeparator",u.maxLookahead,ah(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,xY,"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=_R(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return _R(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(a4,"LooksAhead"),a4),o4,Nir=(o4=class extends D3{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(o4,"DslMethodsCollectorVisitor"),o4),U8=new Nir;function GBe(t){U8.reset(),t.accept(U8);const e=U8.dslMethods;return U8.reset(),e}M(GBe,"collectMethods");function wY(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 N3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function uBe(t,e){const r=new bir(t,e);return r.resolveRefs(),r.errors}M(uBe,"resolveGrammar");var Fx,bir=(Fx=class extends D3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(Ta(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:Ol.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(Fx,"GastRefResolverVisitor"),Fx),zx,xir=(zx=class extends KO{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=Mo(this.path.ruleStack).reverse(),this.occurrenceStack=Mo(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(zx,"AbstractNextPossibleTokensWalker"),zx),Vx,wir=(Vx=class extends xir{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 vc({definition:i});this.possibleTokTypes=O3(s),this.found=!0}}},M(Vx,"NextAfterTokenWalker"),Vx),Hx,QO=(Hx=class extends KO{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(Hx,"AbstractNextTerminalAfterProductionWalker"),Hx),Gx,Tir=(Gx=class extends QO{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(Gx,"NextTerminalAfterManyWalker"),Gx),Wx,Qge=(Wx=class extends QO{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(Wx,"NextTerminalAfterManySepWalker"),Wx),qx,Cir=(qx=class extends QO{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(qx,"NextTerminalAfterAtLeastOneWalker"),qx),Ux,Jge=(Ux=class extends QO{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(Ux,"NextTerminalAfterAtLeastOneSepWalker"),Ux);function CI(t,e,r=[]){r=Mo(r);let n=[],i=0;function s(o){return o.concat(mo(t,i+1))}M(s,"remainingPathWith");function a(o){const l=CI(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:mo(t,i)}),n}M(CI,"possiblePathsFrom");function nre(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&&By(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:mo(p),ruleStack:lE(m),occurrenceStack:lE(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(mo(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof vc)d.push({idx:g,def:v.definition.concat(mo(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof N3)d.push(hBe(v,g,m,y));else throw Error("non exhaustive match")}return h}M(nre,"nextPossibleTokensAfter");function hBe(t,e,r,n){const i=Mo(r);i.push(t.name);const s=Mo(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}M(hBe,"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 Ao||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 Tc||t==="RepetitionWithSeparator")return ws.REPETITION_WITH_SEPARATOR;if(t instanceof Cc||t==="Alternation")return ws.ALTERNATION;throw Error("non exhaustive match")}M(JO,"getProdType");function mY(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=JO(n);return s===ws.ALTERNATION?K7(e,r,i):Z7(e,r,s,i)}M(mY,"getLookaheadPaths");function dBe(t,e,r,n,i,s){const a=K7(t,e,r),o=sre(a)?uE:P3;return s(a,n,o,i)}M(dBe,"buildLookaheadFuncForOr");function fBe(t,e,r,n,i,s){const a=Z7(t,e,i,r),o=sre(a)?uE:P3;return s(a[0],o,n)}M(fBe,"buildLookaheadFuncForOptionalProd");function pBe(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;sCI([a],1)),n=yY(r.length),i=Lr(r,a=>{const o={};return tn(a,l=>{const u=MR(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=yY(o.length);for(let l=0;l{const v=MR(y.partialPath);tn(v,x=>{i[l][x]=!0})})}}}}return n}M(ire,"lookAheadSequenceFromAlternatives");function K7(t,e,r,n){const i=new mBe(t,ws.ALTERNATION,n);return e.accept(i),ire(i.result,r)}M(K7,"getLookaheadPathsForOr");function Z7(t,e,r,n){const i=new mBe(t,r);e.accept(i);const s=i.result,o=new kir(e,t,r).startWalking(),l=new vc({definition:s}),u=new vc({definition:o});return ire([l,u],n)}M(Z7,"getLookaheadPathsForOptionalProd");function kI(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(vBe,"isStrictPrefixOfPath");function sre(t){return kh(t,e=>kh(e,r=>kh(r,n=>Fi(n.categoryMatches))))}M(sre,"areTokenCategoriesNotUsed");function bBe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:Ol.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(bBe,"validateLookahead");function xBe(t,e,r,n){const i=Au(t,l=>wBe(l,r)),s=LBe(t,e,r),a=Au(t,l=>ABe(l,r)),o=Au(t,l=>CBe(l,t,n,r));return i.concat(s,a,o)}M(xBe,"validateGrammar");function wBe(t,e){const r=new Sir;t.accept(r);const n=r.allProductions,i=Fnr(n,TBe),s=$h(i,o=>o.length>1);return Lr(Ta(s),o=>{const l=Lh(o),u=e.buildDuplicateFoundError(t,o),h=ah(l),d={message:u,type:Ol.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=are(l);return f&&(d.parameter=f),d})}M(wBe,"validateDuplicateProductions");function TBe(t){return`${ah(t)}_#_${t.idx}_#_${are(t)}`}M(TBe,"identifyProductionForDuplicates");function are(t){return t instanceof Zi?t.terminalType.name:t instanceof Dl?t.nonTerminalName:""}M(are,"getExtraProductionArgument");var Xx,Sir=(Xx=class extends D3{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(Xx,"OccurrenceValidationCollector"),Xx);function CBe(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:Ol.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(CBe,"validateRuleDoesNotAlreadyExist");function kBe(t,e,r){const n=[];let i;return Gl(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:Ol.INVALID_RULE_OVERRIDE,ruleName:t})),n}M(kBe,"validateRuleIsOverridden");function ore(t,e,r,n=[]){const i=[],s=SS(e.definition);if(Fi(s))return[];{const a=t.name;Gl(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Ol.LEFT_RECURSION,ruleName:a});const l=jO(s,n.concat([t])),u=Au(l,h=>{const d=Mo(n);return d.push(h),ore(t,h,r,d)});return i.concat(u)}}M(ore,"validateNoLeftRecursion");function SS(t){let e=[];if(Fi(t))return e;const r=Lh(t);if(r instanceof Dl)e.push(r.referencedRule);else if(r instanceof vc||r instanceof Ao||r instanceof Qc||r instanceof Jc||r instanceof Tc||r instanceof Os)e=e.concat(SS(r.definition));else if(r instanceof Cc)e=Ch(Lr(r.definition,s=>SS(s.definition)));else if(!(r instanceof Zi))throw Error("non exhaustive match");const n=cE(r),i=t.length>1;if(n&&i){const s=mo(t);return e.concat(SS(s))}else return e}M(SS,"getFirstNoneTerminal");var Kx,lre=(Kx=class extends D3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Kx,"OrCollector"),Kx);function SBe(t,e){const r=new lre;t.accept(r);const n=r.alternations;return Au(n,s=>{const a=lE(s.definition);return Au(a,(o,l)=>{const u=nre([o],[],P3,1);return Fi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:Ol.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}M(SBe,"validateEmptyOrAlternative");function EBe(t,e,r){const n=new lre;t.accept(n);let i=n.alternations;return i=XO(i,a=>a.ignoreAmbiguities===!0),Au(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=K7(o,t,l,a),h=RBe(u,a,t,r),d=_Be(u,a,t,r);return h.concat(d)})}M(EBe,"validateAmbiguousAlternationAlternatives");var Zx,Eir=(Zx=class extends D3{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(Zx,"RepetitionCollector"),Zx);function ABe(t,e){const r=new lre;t.accept(r);const n=r.alternations;return Au(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Ol.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}M(ABe,"validateTooManyAlts");function MBe(t,e,r){const n=[];return tn(t,i=>{const s=new Eir;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=JO(o),u=o.maxLookahead||e,h=o.idx,f=Z7(h,i,l,u)[0];if(Fi(Ch(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:Ol.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(MBe,"validateSomeNonEmptyLookaheadPath");function RBe(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&&kI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!kI(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:Ol.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(RBe,"checkAlternativesAmbiguities");function _Be(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 Y7(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:Ol.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(_Be,"checkPrefixAlternativesAmbiguities");function LBe(t,e,r){const n=[],i=Lr(e,s=>s.name);return tn(t,s=>{const a=s.name;if(Gl(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:Ol.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}M(LBe,"checkTerminalAndNoneTerminalsNameSpace");function IBe(t){const e=qte(t,{errMsgProvider:vir}),r={};return tn(t.rules,n=>{r[n.name]=n}),uBe(r,e.errMsgProvider)}M(IBe,"resolveGrammar");function NBe(t){return t=qte(t,{errMsgProvider:G1}),xBe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(NBe,"validateGrammar");var DBe="MismatchedTokenException",OBe="NoViableAltException",PBe="EarlyExitException",$Be="NotAllInputParsedException",BBe=[DBe,OBe,PBe,$Be];Object.freeze(BBe);function hE(t){return Gl(BBe,t.name)}M(hE,"isRecognitionException");var Qx,eP=(Qx=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(Qx,"RecognitionException"),Qx),Jx,FBe=(Jx=class extends eP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=DBe}},M(Jx,"MismatchedTokenException"),Jx),e4,Air=(e4=class extends eP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=OBe}},M(e4,"NoViableAltException"),e4),t4,Mir=(t4=class extends eP{constructor(e,r){super(e,r),this.name=$Be}},M(t4,"NotAllInputParsedException"),t4),r4,Rir=(r4=class extends eP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=PBe}},M(r4,"EarlyExitException"),r4),Yz={},zBe="InRuleRecoveryException",n4,_ir=(n4=class extends Error{constructor(e){super(e),this.name=zBe}},M(n4,"InRuleRecoveryException"),n4),i4,Lir=(i4=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=jr(e,"recoveryEnabled")?e.recoveryEnabled:N0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=VBe)}getTokenToInsert(e){const r=X7(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 FBe(p,u,this.LA(0));g.resyncedTokens=lE(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 _ir("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 F5(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 Gl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=F5(e,s=>rre(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Yz;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?Yz:{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===Yz)return[$g];const r=e.ruleName+e.idxInCallingRule+E$e+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,$g)||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 lE(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Mo(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(i4,"Recoverable"),i4);function VBe(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=$g,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}M(VBe,"attemptInRepetitionRecovery");var Iir=4,pm=8,HBe=1<ore(r,r,G1))}validateEmptyOrAlternatives(e){return Au(e,r=>SBe(r,G1))}validateAmbiguousAlternationAlternatives(e,r){return Au(e,n=>EBe(n,r,G1))}validateSomeNonEmptyLookaheadPath(e,r){return MBe(e,r,G1)}buildLookaheadForAlternation(e){return dBe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,pBe)}buildLookaheadForOptional(e){return fBe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,JO(e.prodType),gBe)}},M(s4,"LLkLookaheadStrategy"),s4),a4,Nir=(a4=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 cre({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}=WBe(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=_R(this.fullRuleNameToShort[r.name],HBe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,vY,"Repetition",u.maxLookahead,ah(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,GBe,"Option",u.maxLookahead,ah(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,bY,"RepetitionMandatory",u.maxLookahead,ah(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,RR,"RepetitionMandatoryWithSeparator",u.maxLookahead,ah(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,xY,"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=_R(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return _R(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(a4,"LooksAhead"),a4),o4,Dir=(o4=class extends D3{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(o4,"DslMethodsCollectorVisitor"),o4),U8=new Dir;function WBe(t){U8.reset(),t.accept(U8);const e=U8.dslMethods;return U8.reset(),e}M(WBe,"collectMethods");function wY(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(YBe,"createBaseSemanticVisitorConstructor");function jBe(t,e,r){const n=M(function(){},"derivedConstructor");ure(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return tn(e,s=>{i[s]=UBe}),n.prototype=i,n.prototype.constructor=n,n}M(jBe,"createBaseVisitorConstructorWithDefaults");var CY;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(CY||(CY={}));function XBe(t,e){return KBe(t,e)}M(XBe,"validateVisitor");function KBe(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:CY.MISSING_METHOD,methodName:i}));return Y7(n)}M(KBe,"validateMissingCstMethods");var l4,Oir=(l4=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=jr(e,"nodeLocationTracking")?e.nodeLocationTracking:N0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Oa,this.cstFinallyStateUpdate=Oa,this.cstPostTerminal=Oa,this.cstPostNonTerminal=Oa,this.cstPostRule=Oa;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=TY,this.setNodeLocationFromNode=TY,this.cstPostRule=Oa,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Oa,this.setNodeLocationFromNode=Oa,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=wY,this.setNodeLocationFromNode=wY,this.cstPostRule=Oa,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Oa,this.setNodeLocationFromNode=Oa,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Oa,this.setNodeLocationFromNode=Oa,this.cstPostRule=Oa,this.setInitialNodeLocation=Oa;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];WBe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];qBe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(L0(this.baseCstVisitorConstructor)){const e=YBe(this.className,qc(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(L0(this.baseCstVisitorWithDefaultsConstructor)){const e=jBe(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(l4,"TreeBuilder"),l4),c4,Pir=(c4=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)):SI}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?SI: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(c4,"LexerAdapter"),c4),u4,$ir=(u4=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=EI){if(Gl(this.definedRulesNames,e)){const a={message:G1.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ol.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=EI){const i=CBe(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(hE(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return b$e(Ta(this.gastProductionsCache))}},M(u4,"RecognizerApi"),u4),h4,Bir=(h4=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=uE,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(jBe,"createBaseSemanticVisitorConstructor");function XBe(t,e,r){const n=M(function(){},"derivedConstructor");ure(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return tn(e,s=>{i[s]=YBe}),n.prototype=i,n.prototype.constructor=n,n}M(XBe,"createBaseVisitorConstructorWithDefaults");var CY;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(CY||(CY={}));function KBe(t,e){return ZBe(t,e)}M(KBe,"validateVisitor");function ZBe(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:CY.MISSING_METHOD,methodName:i}));return Y7(n)}M(ZBe,"validateMissingCstMethods");var l4,Pir=(l4=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=jr(e,"nodeLocationTracking")?e.nodeLocationTracking:N0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Oa,this.cstFinallyStateUpdate=Oa,this.cstPostTerminal=Oa,this.cstPostNonTerminal=Oa,this.cstPostRule=Oa;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=TY,this.setNodeLocationFromNode=TY,this.cstPostRule=Oa,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Oa,this.setNodeLocationFromNode=Oa,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=wY,this.setNodeLocationFromNode=wY,this.cstPostRule=Oa,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Oa,this.setNodeLocationFromNode=Oa,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Oa,this.setNodeLocationFromNode=Oa,this.cstPostRule=Oa,this.setInitialNodeLocation=Oa;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];qBe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];UBe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(L0(this.baseCstVisitorConstructor)){const e=jBe(this.className,qc(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(L0(this.baseCstVisitorWithDefaultsConstructor)){const e=XBe(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(l4,"TreeBuilder"),l4),c4,$ir=(c4=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)):SI}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?SI: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(c4,"LexerAdapter"),c4),u4,Bir=(u4=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=EI){if(Gl(this.definedRulesNames,e)){const a={message:G1.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ol.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=EI){const i=kBe(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(hE(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return x$e(Ta(this.gastProductionsCache))}},M(u4,"RecognizerApi"),u4),h4,Fir=(h4=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=uE,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(Zn(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(Zn(e))this.tokensMap=Yc(e,(s,a)=>(s[a.name]=a,s),{});else if(jr(e,"modes")&&kh(Ch(Ta(e.modes)),oBe)){const s=Ch(Ta(e.modes)),a=Ute(s);this.tokensMap=Yc(a,(o,l)=>(o[l.name]=l,o),{})}else if(Ou(e))this.tokensMap=Mo(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=$g;const n=jr(e,"modes")?Ch(Ta(e.modes)):Ta(e),i=kh(n,s=>Fi(s.categoryMatches));this.tokenMatcher=i?uE:P3,$3(Ta(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:EI.resyncEnabled,s=jr(n,"recoveryValueFunc")?n.recoveryValueFunc:EI.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(bY,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,bY,e,Tir)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(RR,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,Qge],o,RR,e,Qge)}else throw this.raiseEarlyExitException(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(vY,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,vY,e,wir,a)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(xY,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,Zge],o,xY,e,Zge)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,RR,e,s)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(VBe,r),i=Zn(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 hE(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 BBe(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===FBe?n:s}}else throw n}saveRecogState(){const e=this.errors,r=Mo(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),$g)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},M(h4,"RecognizerEngine"),h4),d4,Fir=(d4=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=jr(e,"errorMessageProvider")?e.errorMessageProvider:N0.errorMessageProvider}SAVE_ERROR(e){if(hE(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Mo(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Mo(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Z7(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 Mir(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=K7(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 Eir(l,this.LA(1),o))}},M(d4,"ErrorHandler"),d4),f4,zir=(f4=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(L0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return nre([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Lh(e.ruleStack),i=this.getGAstProductions()[r];return new xir(i,e).startWalking()}},M(f4,"ContentAssist"),f4),tP={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(tP);var Jge=!0,eme=Math.pow(2,pm)-1,ZBe=qb({name:"RECORDING_PHASE_TOKEN",pattern:Ml.NA});$3([ZBe]);var QBe=X7(ZBe,`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(QBe);var Vir={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},p4,Hir=(p4=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 SI}topLevelRuleRecord(e,r){try{const n=new N3({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(Zn(e))this.tokensMap=Yc(e,(s,a)=>(s[a.name]=a,s),{});else if(jr(e,"modes")&&kh(Ch(Ta(e.modes)),lBe)){const s=Ch(Ta(e.modes)),a=Ute(s);this.tokensMap=Yc(a,(o,l)=>(o[l.name]=l,o),{})}else if(Ou(e))this.tokensMap=Mo(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=$g;const n=jr(e,"modes")?Ch(Ta(e.modes)):Ta(e),i=kh(n,s=>Fi(s.categoryMatches));this.tokenMatcher=i?uE:P3,$3(Ta(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:EI.resyncEnabled,s=jr(n,"recoveryValueFunc")?n.recoveryValueFunc:EI.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(bY,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,bY,e,Cir)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(RR,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,Jge],o,RR,e,Jge)}else throw this.raiseEarlyExitException(e,ws.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(vY,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,vY,e,Tir,a)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(xY,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,Qge],o,xY,e,Qge)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,RR,e,s)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(HBe,r),i=Zn(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 Mir(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 hE(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 FBe(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===zBe?n:s}}else throw n}saveRecogState(){const e=this.errors,r=Mo(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),$g)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},M(h4,"RecognizerEngine"),h4),d4,zir=(d4=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=jr(e,"errorMessageProvider")?e.errorMessageProvider:N0.errorMessageProvider}SAVE_ERROR(e){if(hE(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Mo(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Mo(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Z7(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 Rir(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=K7(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 Air(l,this.LA(1),o))}},M(d4,"ErrorHandler"),d4),f4,Vir=(f4=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(L0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return nre([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Lh(e.ruleStack),i=this.getGAstProductions()[r];return new wir(i,e).startWalking()}},M(f4,"ContentAssist"),f4),tP={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(tP);var eme=!0,tme=Math.pow(2,pm)-1,QBe=qb({name:"RECORDING_PHASE_TOKEN",pattern:Ml.NA});$3([QBe]);var JBe=X7(QBe,`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(JBe);var Hir={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},p4,Gir=(p4=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 SI}topLevelRuleRecord(e,r){try{const n=new N3({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 D2.call(this,Ao,e,r)}atLeastOneInternalRecord(e,r){D2.call(this,Qc,r,e)}atLeastOneSepFirstInternalRecord(e,r){D2.call(this,Jc,r,e,Jge)}manyInternalRecord(e,r){D2.call(this,Os,r,e)}manySepFirstInternalRecord(e,r){D2.call(this,Tc,r,e,Jge)}orInternalRecord(e,r){return JBe.call(this,e,r)}subruleInternalRecord(e,r,n){if(dE(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=By(this.recordingProdStack),s=e.ruleName,a=new Dl({idx:r,nonTerminalName:s,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?Vir:tP}consumeInternalRecord(e,r,n){if(dE(r),!ere(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=By(this.recordingProdStack),s=new Zi({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(s),QBe}},M(p4,"GastRecorder"),p4);function D2(t,e,r,n=!1){dE(r);const i=By(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(),tP}M(D2,"recordProd");function JBe(t,e){dE(e);const r=By(this.recordingProdStack),n=Zn(t)===!1,i=n===!1?t:t.DEF,s=new Cc({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});jr(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=p$e(i,o=>J0(o.GATE));return s.hasPredicates=a,r.definition.push(s),tn(i,o=>{const l=new vc({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()}),tP}M(JBe,"recordOrProd");function kY(t){return t===0?"":`${t}`}M(kY,"getIdxSuffix");function dE(t){if(t<0||t>eme){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${eme+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}M(dE,"assertMethodIdxIsValid");var g4,Gir=(g4=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}=jte(r),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,s}else return r()}},M(g4,"PerformanceTracer"),g4);function eFe(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(eFe,"applyMixins");var SI=X7($g,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(SI);var N0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:gb,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),EI=Object.freeze({recoveryValueFunc:M(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Ol;(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"})(Ol||(Ol={}));function SY(t=void 0){return function(){return t}}M(SY,"EMPTY_ALT");var oy,hre=(oy=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",()=>{Xte(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=LBe({rules:Ta(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Fi(n)&&this.skipValidations===!1){const i=IBe({rules:Ta(this.gastProductionsCache),tokenTypes:Ta(this.tokensMap),errMsgProvider:G1,grammarName:r}),s=vBe({lookaheadStrategy:this.lookaheadStrategy,rules:Ta(this.gastProductionsCache),tokenTypes:Ta(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Fi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=E$e(Ta(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:Ta(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ta(this.gastProductionsCache))})),!oy.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 D2.call(this,Ao,e,r)}atLeastOneInternalRecord(e,r){D2.call(this,Qc,r,e)}atLeastOneSepFirstInternalRecord(e,r){D2.call(this,Jc,r,e,eme)}manyInternalRecord(e,r){D2.call(this,Os,r,e)}manySepFirstInternalRecord(e,r){D2.call(this,Tc,r,e,eme)}orInternalRecord(e,r){return eFe.call(this,e,r)}subruleInternalRecord(e,r,n){if(dE(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=By(this.recordingProdStack),s=e.ruleName,a=new Dl({idx:r,nonTerminalName:s,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?Hir:tP}consumeInternalRecord(e,r,n){if(dE(r),!ere(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=By(this.recordingProdStack),s=new Zi({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(s),JBe}},M(p4,"GastRecorder"),p4);function D2(t,e,r,n=!1){dE(r);const i=By(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(),tP}M(D2,"recordProd");function eFe(t,e){dE(e);const r=By(this.recordingProdStack),n=Zn(t)===!1,i=n===!1?t:t.DEF,s=new Cc({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});jr(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=g$e(i,o=>J0(o.GATE));return s.hasPredicates=a,r.definition.push(s),tn(i,o=>{const l=new vc({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()}),tP}M(eFe,"recordOrProd");function kY(t){return t===0?"":`${t}`}M(kY,"getIdxSuffix");function dE(t){if(t<0||t>tme){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${tme+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}M(dE,"assertMethodIdxIsValid");var g4,Wir=(g4=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}=jte(r),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,s}else return r()}},M(g4,"PerformanceTracer"),g4);function tFe(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(tFe,"applyMixins");var SI=X7($g,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(SI);var N0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:gb,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),EI=Object.freeze({recoveryValueFunc:M(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),Ol;(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"})(Ol||(Ol={}));function SY(t=void 0){return function(){return t}}M(SY,"EMPTY_ALT");var oy,hre=(oy=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",()=>{Xte(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=IBe({rules:Ta(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Fi(n)&&this.skipValidations===!1){const i=NBe({rules:Ta(this.gastProductionsCache),tokenTypes:Ta(this.tokensMap),errMsgProvider:G1,grammarName:r}),s=bBe({lookaheadStrategy:this.lookaheadStrategy,rules:Ta(this.gastProductionsCache),tokenTypes:Ta(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Fi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=A$e(Ta(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:Ta(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ta(this.gastProductionsCache))})),!oy.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:N0.skipValidations}},M(oy,"Parser"),oy);hre.DEFER_DEFINITION_ERRORS_HANDLING=!1;eFe(hre,[_ir,Iir,Oir,Pir,Bir,$ir,Fir,zir,Hir,Gir]);var m4,Wir=(m4=class extends hre{constructor(e,r=N0){const n=Mo(r);n.outputCst=!1,super(e,n)}},M(m4,"EmbeddedActionsParser"),m4);function tFe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}M(cFe,"listCacheHas");var Kir=cFe;function uFe(t,e){var r=this.__data__,n=rP(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(uFe,"listCacheSet");var Zir=uFe;function Cv(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&nar?new GFe:void 0;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Far}M(dze,"isLength");var pre=dze,zar="[object Arguments]",Var="[object Array]",Har="[object Boolean]",Gar="[object Date]",War="[object Error]",qar="[object Function]",Uar="[object Map]",Yar="[object Number]",jar="[object Object]",Xar="[object RegExp]",Kar="[object Set]",Zar="[object String]",Qar="[object WeakMap]",Jar="[object ArrayBuffer]",eor="[object DataView]",tor="[object Float32Array]",ror="[object Float64Array]",nor="[object Int8Array]",ior="[object Int16Array]",sor="[object Int32Array]",aor="[object Uint8Array]",oor="[object Uint8ClampedArray]",lor="[object Uint16Array]",cor="[object Uint32Array]",ji={};ji[tor]=ji[ror]=ji[nor]=ji[ior]=ji[sor]=ji[aor]=ji[oor]=ji[lor]=ji[cor]=!0;ji[zar]=ji[Var]=ji[Jar]=ji[Har]=ji[eor]=ji[Gar]=ji[War]=ji[qar]=ji[Uar]=ji[Yar]=ji[jar]=ji[Xar]=ji[Kar]=ji[Zar]=ji[Qar]=!1;function fze(t){return z5(t)&&pre(t.length)&&!!ji[B3(t)]}M(fze,"baseIsTypedArray");var uor=fze;function pze(t){return function(e){return t(e)}}M(pze,"baseUnary");var hor=pze,gze=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ES=gze&&typeof module=="object"&&module&&!module.nodeType&&module,dor=ES&&ES.exports===gze,Kz=dor&&gFe.process,por=(function(){try{var t=ES&&ES.require&&ES.require("util").types;return t||Kz&&Kz.binding&&Kz.binding("util")}catch{}})(),ume=por,hme=ume&&ume.isTypedArray,gor=hme?hor(hme):uor,gre=gor,mor=Object.prototype,yor=mor.hasOwnProperty;function mze(t,e){var r=Pl(t),n=!r&&aP(t),i=!r&&!n&&AI(t),s=!r&&!n&&!i&&gre(t),a=r||n||i||s,o=a?Mar(t.length,String):[],l=o.length;for(var u in t)(e||yor.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||hze(u,l)))&&o.push(u);return o}M(mze,"arrayLikeKeys");var vor=mze,bor=Object.prototype;function yze(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bor;return t===r}M(yze,"isPrototype");var vze=yze;function bze(t,e){return function(r){return t(e(r))}}M(bze,"overArg");var xor=bze,wor=xor(Object.keys,Object),Tor=wor,Cor=Object.prototype,kor=Cor.hasOwnProperty;function xze(t){if(!vze(t))return Tor(t);var e=[];for(var r in Object(t))kor.call(t,r)&&r!="constructor"&&e.push(r);return e}M(xze,"baseKeys");var wze=xze;function Tze(t){return t!=null&&pre(t.length)&&!TFe(t)}M(Tze,"isArrayLike");var oP=Tze;function Cze(t){return oP(t)?vor(t):wze(t)}M(Cze,"keys");var mre=Cze;function kze(t){return Tar(t,mre,Aar)}M(kze,"getAllKeys");var dme=kze,Sor=1,Eor=Object.prototype,Aor=Eor.hasOwnProperty;function Sze(t,e,r,n,i,s){var a=r&Sor,o=dme(t),l=o.length,u=dme(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Aor.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;++dkre(t,e,a));return Mv(t,e,n,r,...i)}M(yVe,"alternation");function vVe(t,e,r){const n=Ma(t,e,r,{type:Bg});tp(t,n);const i=Mv(t,e,n,r,gm(t,e,r));return bVe(t,e,r,i)}M(vVe,"option");function gm(t,e,r){const n=klr(Yf(r.definition,i=>kre(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:wVe(t,n)}M(gm,"block");function Sre(t,e,r,n,i){const s=n.left,a=n.right,o=Ma(t,e,r,{type:Rlr});tp(t,o);const l=Ma(t,e,r,{type:cVe});return s.loopback=o,l.loopback=o,t.decisionMap[zy(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(Sre,"plus");function Ere(t,e,r,n,i){const s=n.left,a=n.right,o=Ma(t,e,r,{type:Mlr});tp(t,o);const l=Ma(t,e,r,{type:cVe}),u=Ma(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[zy(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}M(Ere,"star");function bVe(t,e,r,n){const i=n.left,s=n.right;return qs(i,s),t.decisionMap[zy(e,"Option",r.idx)]=i,n}M(bVe,"optional");function tp(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}M(tp,"defineDecisionState");function Mv(t,e,r,n,...i){const s=Ma(t,e,n,{type:Elr,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[zy(e,xVe(n),n.idx)]=r,a}M(Mv,"makeAlts");function xVe(t){if(t instanceof Cc)return"Alternation";if(t instanceof Ao)return"Option";if(t instanceof Os)return"Repetition";if(t instanceof Tc)return"RepetitionWithSeparator";if(t instanceof Qc)return"RepetitionMandatory";if(t instanceof Jc)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}M(xVe,"getProdType");function wVe(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(w4,"ATNConfigSet"),w4);function Are(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}M(Are,"getATNConfigKey");function SVe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Mre(o,e-1,r,n,i):JFe(i,o):n||(i[i.length]=o)}return i}M(Mre,"baseFlatten");var RVe=Mre;function _Ve(t,e){return RVe(Yf(t,e),1)}M(_Ve,"flatMap");var Dlr=_Ve;function LVe(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s-1}M(OVe,"arrayIncludes");var Flr=OVe;function PVe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=qlr){var u=e?null:Wlr(t);if(u)return fre(u);a=!1,i=UFe,l=new GFe}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(jVe,"createDFACache");var T4,XVe=(T4=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=hVe(e.rules),this.dfas=KVe(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=zy(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Yf(mY({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Yf(f,p=>p[0]));if(LY(d,!1)&&!s){const f=kme(d,(p,g,m)=>(Zz(g,y=>{y&&(p[y.tokenTypeIdx]=m,Zz(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 XVe,g=f===void 0?0:f.length;for(let y=0;yYf(f,p=>p[0]));if(LY(d)&&d[0][0]&&!s){const f=d[0],p=jlr(f);if(p.length===1&&tcr(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=kme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,Zz(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=IR.call(this,a,h,Sme,o);return typeof f=="object"?!1:f===0}}},M(C4,"LLStarLookaheadStrategy"),C4);function LY(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(LY,"isLL1Sequence");function KVe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;niy(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${tHe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=jr(r,"skipValidations")?r.skipValidations:N0.skipValidations}},M(oy,"Parser"),oy);hre.DEFER_DEFINITION_ERRORS_HANDLING=!1;tFe(hre,[Lir,Nir,Pir,$ir,Fir,Bir,zir,Vir,Gir,Wir]);var m4,qir=(m4=class extends hre{constructor(e,r=N0){const n=Mo(r);n.outputCst=!1,super(e,n)}},M(m4,"EmbeddedActionsParser"),m4);function rFe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}M(uFe,"listCacheHas");var Zir=uFe;function hFe(t,e){var r=this.__data__,n=rP(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(hFe,"listCacheSet");var Qir=hFe;function Cv(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&iar?new WFe:void 0;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=zar}M(fze,"isLength");var pre=fze,Var="[object Arguments]",Har="[object Array]",Gar="[object Boolean]",War="[object Date]",qar="[object Error]",Uar="[object Function]",Yar="[object Map]",jar="[object Number]",Xar="[object Object]",Kar="[object RegExp]",Zar="[object Set]",Qar="[object String]",Jar="[object WeakMap]",eor="[object ArrayBuffer]",tor="[object DataView]",ror="[object Float32Array]",nor="[object Float64Array]",ior="[object Int8Array]",sor="[object Int16Array]",aor="[object Int32Array]",oor="[object Uint8Array]",lor="[object Uint8ClampedArray]",cor="[object Uint16Array]",uor="[object Uint32Array]",ji={};ji[ror]=ji[nor]=ji[ior]=ji[sor]=ji[aor]=ji[oor]=ji[lor]=ji[cor]=ji[uor]=!0;ji[Var]=ji[Har]=ji[eor]=ji[Gar]=ji[tor]=ji[War]=ji[qar]=ji[Uar]=ji[Yar]=ji[jar]=ji[Xar]=ji[Kar]=ji[Zar]=ji[Qar]=ji[Jar]=!1;function pze(t){return z5(t)&&pre(t.length)&&!!ji[B3(t)]}M(pze,"baseIsTypedArray");var hor=pze;function gze(t){return function(e){return t(e)}}M(gze,"baseUnary");var dor=gze,mze=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ES=mze&&typeof module=="object"&&module&&!module.nodeType&&module,por=ES&&ES.exports===mze,Kz=por&&mFe.process,gor=(function(){try{var t=ES&&ES.require&&ES.require("util").types;return t||Kz&&Kz.binding&&Kz.binding("util")}catch{}})(),hme=gor,dme=hme&&hme.isTypedArray,mor=dme?dor(dme):hor,gre=mor,yor=Object.prototype,vor=yor.hasOwnProperty;function yze(t,e){var r=Pl(t),n=!r&&aP(t),i=!r&&!n&&AI(t),s=!r&&!n&&!i&&gre(t),a=r||n||i||s,o=a?Rar(t.length,String):[],l=o.length;for(var u in t)(e||vor.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||dze(u,l)))&&o.push(u);return o}M(yze,"arrayLikeKeys");var bor=yze,xor=Object.prototype;function vze(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||xor;return t===r}M(vze,"isPrototype");var bze=vze;function xze(t,e){return function(r){return t(e(r))}}M(xze,"overArg");var wor=xze,Tor=wor(Object.keys,Object),Cor=Tor,kor=Object.prototype,Sor=kor.hasOwnProperty;function wze(t){if(!bze(t))return Cor(t);var e=[];for(var r in Object(t))Sor.call(t,r)&&r!="constructor"&&e.push(r);return e}M(wze,"baseKeys");var Tze=wze;function Cze(t){return t!=null&&pre(t.length)&&!CFe(t)}M(Cze,"isArrayLike");var oP=Cze;function kze(t){return oP(t)?bor(t):Tze(t)}M(kze,"keys");var mre=kze;function Sze(t){return Car(t,mre,Mar)}M(Sze,"getAllKeys");var fme=Sze,Eor=1,Aor=Object.prototype,Mor=Aor.hasOwnProperty;function Eze(t,e,r,n,i,s){var a=r&Eor,o=fme(t),l=o.length,u=fme(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:Mor.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;++dkre(t,e,a));return Mv(t,e,n,r,...i)}M(vVe,"alternation");function bVe(t,e,r){const n=Ma(t,e,r,{type:Bg});tp(t,n);const i=Mv(t,e,n,r,gm(t,e,r));return xVe(t,e,r,i)}M(bVe,"option");function gm(t,e,r){const n=Slr(Yf(r.definition,i=>kre(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:TVe(t,n)}M(gm,"block");function Sre(t,e,r,n,i){const s=n.left,a=n.right,o=Ma(t,e,r,{type:_lr});tp(t,o);const l=Ma(t,e,r,{type:uVe});return s.loopback=o,l.loopback=o,t.decisionMap[zy(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(Sre,"plus");function Ere(t,e,r,n,i){const s=n.left,a=n.right,o=Ma(t,e,r,{type:Rlr});tp(t,o);const l=Ma(t,e,r,{type:uVe}),u=Ma(t,e,r,{type:Mlr});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[zy(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}M(Ere,"star");function xVe(t,e,r,n){const i=n.left,s=n.right;return qs(i,s),t.decisionMap[zy(e,"Option",r.idx)]=i,n}M(xVe,"optional");function tp(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}M(tp,"defineDecisionState");function Mv(t,e,r,n,...i){const s=Ma(t,e,n,{type:Alr,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[zy(e,wVe(n),n.idx)]=r,a}M(Mv,"makeAlts");function wVe(t){if(t instanceof Cc)return"Alternation";if(t instanceof Ao)return"Option";if(t instanceof Os)return"Repetition";if(t instanceof Tc)return"RepetitionWithSeparator";if(t instanceof Qc)return"RepetitionMandatory";if(t instanceof Jc)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}M(wVe,"getProdType");function TVe(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(w4,"ATNConfigSet"),w4);function Are(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}M(Are,"getATNConfigKey");function EVe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Mre(o,e-1,r,n,i):eze(i,o):n||(i[i.length]=o)}return i}M(Mre,"baseFlatten");var _Ve=Mre;function LVe(t,e){return _Ve(Yf(t,e),1)}M(LVe,"flatMap");var Olr=LVe;function IVe(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s-1}M(PVe,"arrayIncludes");var zlr=PVe;function $Ve(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=Ulr){var u=e?null:qlr(t);if(u)return fre(u);a=!1,i=YFe,l=new WFe}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(XVe,"createDFACache");var T4,KVe=(T4=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=dVe(e.rules),this.dfas=ZVe(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=zy(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Yf(mY({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Yf(f,p=>p[0]));if(LY(d,!1)&&!s){const f=Sme(d,(p,g,m)=>(Zz(g,y=>{y&&(p[y.tokenTypeIdx]=m,Zz(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 KVe,g=f===void 0?0:f.length;for(let y=0;yYf(f,p=>p[0]));if(LY(d)&&d[0][0]&&!s){const f=d[0],p=Xlr(f);if(p.length===1&&rcr(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Sme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,Zz(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=IR.call(this,a,h,Eme,o);return typeof f=="object"?!1:f===0}}},M(C4,"LLStarLookaheadStrategy"),C4);function LY(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(LY,"isLL1Sequence");function ZVe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;niy(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${rHe(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(eHe,"buildAmbiguityError");function tHe(t){if(t instanceof Dl)return"SUBRULE";if(t instanceof Ao)return"OPTION";if(t instanceof Cc)return"OR";if(t instanceof Qc)return"AT_LEAST_ONE";if(t instanceof Jc)return"AT_LEAST_ONE_SEP";if(t instanceof Tc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(tHe,"getProductionDslName");function rHe(t,e,r){const n=Dlr(e.configs.elements,s=>s.state.transitions),i=Ylr(n.filter(s=>s instanceof Tre).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}M(rHe,"buildAdaptivePredictError");function nHe(t,e){return t.edges[e.tokenTypeIdx]}M(nHe,"getExistingTargetState");function iHe(t,e,r){const n=new _Y,i=[];for(const a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===Q7){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l0&&!cHe(s))for(const a of i)s.add(a);return s}M(iHe,"computeReachSet");function sHe(t,e){if(t instanceof Tre&&rre(e,t.tokenType))return t.target}M(sHe,"getReachableTarget");function aHe(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(aHe,"getUniqueAlt");function Rre(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}M(Rre,"newDFAState");function IY(t,e,r,n){return n=_re(t,n),e.edges[r.tokenTypeIdx]=n,n}M(IY,"addDFAEdge");function _re(t,e){if(e===MI)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(_re,"addDFAState");function oHe(t){const e=new _Y,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};mE(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(fHe,"hasConflictingAltSet");function pHe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}M(pHe,"hasStateAssociatedWithOneAlt");I7();var k4,gHe=(k4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Ire(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new gP;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new RI(e.startOffset,e.image.length,nE(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 RI(s.startOffset,s.image.length,nE(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(k4,"CstNodeBuilder"),k4),S4,Lre=(S4=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(S4,"AbstractCstNode"),S4),E4,RI=(E4=class extends Lre{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(E4,"LeafCstNodeImpl"),E4),A4,gP=(A4=class extends Lre{constructor(){super(...arguments),this.content=new scr(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(A4,"CompositeCstNodeImpl"),A4),ly,scr=(ly=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ly.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(ly,"CstNodeContainer"),ly),M4,Ire=(M4=class extends gP{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},M(M4,"RootCstNodeImpl"),M4),_I=Symbol("Datatype");function NR(t){return t.$type===_I}M(NR,"isDataTypeNode");var Eme="​",mHe=M(t=>t.endsWith(Eme)?t:t+Eme,"withRuleSuffix"),R4,Nre=(R4=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 ocr(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new xHe(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(R4,"AbstractLangiumParser"),R4),_4,yHe=(_4=class extends Nre{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new gHe,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;O5(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(mHe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,s),Nl(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===_I?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(NR(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(NR(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)):NR(e)?this.converter.convert(e.value,e.$cstNode):(Lee(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=hv(e,A0);this.assignmentMap.set(e,{assignment:r,crossRef:r&&fv(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(_4,"LangiumParser"),_4),L4,vHe=(L4=class{buildMismatchTokenMessage(e){return gb.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return gb.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return gb.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return gb.buildEarlyExitMessage(e)}},M(L4,"AbstractParserErrorMessageProvider"),L4),I4,Dre=(I4=class extends vHe{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(I4,"LangiumParserErrorMessageProvider"),I4),N4,bHe=(N4=class extends Nre{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(mHe(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(N4,"LangiumCompletionParser"),N4),acr={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Dre},D4,xHe=(D4=class extends Wir{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...acr,lookaheadStrategy:n?new cre({maxLookahead:r.maxLookahead}):new icr({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(D4,"ChevrotainWrapper"),D4),O4,ocr=(O4=class extends xHe{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(O4,"ProfilerWrapper"),O4);function mP(t,e,r){return wHe({parser:e,tokens:r,ruleNames:new Map},t),e}M(mP,"createParser");function wHe(t,e){const r=LO(e,!1),n=yi(e.rules).filter(Nl).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,Fg(a,s.definition))}const i=yi(e.rules).filter(O5).filter(s=>r.has(s));for(const s of i)t.parser.rule(s,THe(t,s))}M(wHe,"buildRules");function THe(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=yP(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(THe,"buildInfixRule");function Fg(t,e,r=!1){let n;if(M0(e))n=RHe(t,e);else if(Og(e))n=CHe(t,e);else if(A0(e))n=Fg(t,e.terminal);else if(fv(e))n=Ore(t,e);else if(R0(e))n=kHe(t,e);else if(TO(e))n=EHe(t,e);else if(EO(e))n=AHe(t,e);else if(pv(e))n=MHe(t,e);else if(Bee(e)){const i=t.consume++;n=M(()=>t.parser.consume(i,$g,e),"method")}else throw new MO(e.$cstNode,`Unexpected element type: ${e.$type}`);return Pre(t,r?void 0:yE(e),n,e.cardinality)}M(Fg,"buildElement");function CHe(t,e){const r=$y(e);return()=>t.parser.action(r,e)}M(CHe,"buildAction");function kHe(t,e){const r=e.rule.ref;if(dv(r)){const n=t.subrule++,i=Nl(r)&&r.fragment,s=e.arguments.length>0?SHe(r,e.arguments):()=>({});let a;return o=>{a??(a=yP(t,r)),t.parser.subrule(n,a,i,e,s(o))}}else if(Bu(r)){const n=t.consume++,i=LI(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)dm();else throw new MO(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}M(kHe,"buildRuleCall");function SHe(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(Pee(t)){const e=lh(t.left),r=lh(t.right);return n=>e(n)&&r(n)}else if(Vee(t)){const e=lh(t.value);return r=>!e(r)}else if(Hee(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Dee(t)){const e=!!t.true;return()=>e}dm()}M(lh,"buildPredicate");function EHe(t,e){if(e.elements.length===1)return Fg(t,e.elements[0]);{const r=[];for(const i of e.elements){const s={ALT:Fg(t,i,!0)},a=yE(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(EHe,"buildAlternatives");function AHe(t,e){if(e.elements.length===1)return Fg(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Fg(t,o,!0)},u=yE(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=Pre(t,yE(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}M(AHe,"buildUnorderedGroup");function MHe(t,e){const r=e.elements.map(n=>Fg(t,n));return n=>r.forEach(i=>i(n))}M(MHe,"buildGroup");function yE(t){if(pv(t))return t.guardCondition}M(yE,"getGuardCondition");function Ore(t,e,r=e.terminal){if(r)if(R0(r)&&Nl(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let s;return a=>{s??(s=yP(t,n)),t.parser.subrule(i,s,!1,e,a)}}else if(R0(r)&&Bu(r.rule.ref)){const n=t.consume++,i=LI(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(M0(r)){const n=t.consume++,i=LI(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=OO(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+$y(e.type.ref));return Ore(t,e,i)}}M(Ore,"buildCrossReference");function RHe(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(RHe,"buildKeyword");function Pre(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:SY(),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:SY(),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 dm()}M(Pre,"wrap");function yP(t,e){const r=_He(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}M(yP,"getRule");function _He(t,e){if(dv(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Nl(n);)(pv(n)||TO(n)||EO(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(_He,"getRuleName");function LI(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}M(LI,"getToken");function $re(t){const e=t.Grammar,r=t.parser.Lexer,n=new bHe(t);return mP(e,n,r.definition),n.finalize(),n}M($re,"createCompletionParser");function Bre(t){const e=Fre(t);return e.finalize(),e}M(Bre,"createLangiumParser");function Fre(t){const e=t.Grammar,r=t.parser.Lexer,n=new yHe(t);return mP(e,n,r.definition)}M(Fre,"prepareLangiumParser");var P4,vP=(P4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=yi(LO(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=B7(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=_O(r)?Ml.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(dv).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(I3(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&&ute("^"+s.source+"$",e.value)&&n.push(i),n},[])}},M(P4,"DefaultTokenBuilder"),P4),$4,zre=($4=class{convert(e,r){let n=r.grammarSource;if(fv(n)&&(n=gte(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=kte(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($4,"DefaultValueConverter"),$4),od;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}M(bP,"delayNextTick");var DR=0,LHe=10;function xP(){return DR=performance.now(),new $i.CancellationTokenSource}M(xP,"startCancelableOperation");function Vre(t){LHe=t}M(Vre,"setInterruptionPeriod");var xd=Symbol("OperationCancelled");function Rv(t){return t===xd}M(Rv,"isOperationCancelled");async function Va(t){if(t===$i.CancellationToken.None)return;const e=performance.now();if(e-DR>=LHe&&(DR=e,await bP(),DR=performance.now()),t.isCancellationRequested)throw xd}M(Va,"interruptAndCheck");var B4,D0=(B4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},M(B4,"Deferred"),B4),lg,Ame=(lg=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(lg.isIncremental(n)){const i=Gre(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=NY(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&&Hre(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(lg,"FullTextDocument"),lg),II;(function(t){function e(i,s,a,o){return new Ame(i,s,a,o)}M(e,"create"),t.create=e;function r(i,s,a){if(i instanceof Ame)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=NI(s.map(IHe),(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})(II||(II={}));function NI(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);NI(n,e),NI(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(Gre,"getWellformedRange");function IHe(t){const e=Gre(t.range);return e!==t.range?{newText:t.newText,range:e}:t}M(IHe,"getWellformedEdit");var NHe;(()=>{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={})),NHe=n})();var{URI:Hc,Utils:EC}=NHe,Sl;(function(t){t.basename=EC.basename,t.dirname=EC.dirname,t.extname=EC.extname,t.joinPath=EC.joinPath,t.resolvePath=EC.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:Sl.joinPath(Hc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Sl.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(F4,"UriTrie"),F4),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 z4,DHe=(z4=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=II.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},M(z4,"DefaultLangiumDocumentFactory"),z4),V4,OHe=(V4=class{constructor(e){this.documentTrie=new Wre,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(V4,"DefaultLangiumDocuments"),V4),i1=Symbol("RefResolving"),H4,PHe=(H4=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 Va(r),D5(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 Va(r),D5(i).forEach(s=>this.doLink(s,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=i1;try{const i=this.getCandidate(e);if(g1(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=i1;try{const i=this.getCandidates(e),s=[];if(g1(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(oa(this._ref))return this._ref;if(Mee(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=i1;const o=Gb(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(g1(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=Gb(e.container).$document;n&&n.statefv(r)&&r.isMulti)}findDeclarations(e){if(e){const r=bte(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(kl(i)||Md(i))return ZL(i);if(Array.isArray(i)){for(const s of i)if((kl(s)||Md(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return ZL(s)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Qee(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 D5(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=>Sl.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:$5(s),local:!0})}}return n}},M(W4,"DefaultReferences"),W4),q4,O0=(q4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return rE.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):L5}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(q4,"MultiMap"),q4),U4,DI=(U4=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(U4,"BiMap"),U4),Y4,FHe=(Y4=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=D7,i=$i.CancellationToken.None){const s=[];this.addExportedSymbol(e,s,r);for(const a of n(e))await Va(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 Va(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(Y4,"DefaultScopeComputation"),Y4),j4,DY=(j4=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(j4,"StreamScope"),j4),X4,lcr=(X4=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(X4,"MapScope"),X4),K4,zHe=(K4=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(K4,"MultiMapScope"),K4),ccr={getElement(){},getElements(){return L5},getAllElements(){return L5}},Z4,wP=(Z4=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(Z4,"DisposableCache"),Z4),Q4,Ure=(Q4=class extends wP{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(Q4,"SimpleCache"),Q4),J4,TP=(J4=class extends wP{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(J4,"ContextCache"),J4),ew,VHe=(ew=class extends TP{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(ew,"DocumentCache"),ew),tw,Yre=(tw=class extends Ure{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(tw,"WorkspaceCache"),tw),rw,HHe=(rw=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 Yre(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 DY(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 DY(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new zHe(this.indexManager.allElements(e)))}},M(rw,"DefaultScopeProvider"),rw);function jre(t){return typeof t.$comment=="string"}M(jre,"isAstNodeWithComment");function OY(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}M(OY,"isIntermediateReference");var nw,GHe=(nw=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(kl(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(oa(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=yte(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(Rv(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(sw,"ValidationRegistry"),sw),UHe=Object.freeze({validateNode:!0,validateChildren:!0}),aw,YHe=(aw=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 Va(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(Rv(a))throw a;console.error("An error occurred during validation:",a)}return await Va(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:AS(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:Kre(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=nE(i.token);if(s){const a={severity:AS("error"),range:s,message:i.message,data:W1(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 Va(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 Va(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||a.prune()}}}validateSingleNodeOptions(e,r){return UHe}async validateAstAfter(e,r,n,i=$i.CancellationToken.None){const s=this.validationRegistry.checksAfter;for(const a of s)await Va(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Xre(n),severity:AS(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(aw,"DefaultDocumentValidator"),aw);function Xre(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=IO(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=vte(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(Xre,"getDiagnosticRange");function AS(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(AS,"toDiagnosticSeverity");function Kre(t){switch(t){case"error":return W1(yu.LexingError);case"warning":return W1(yu.LexingWarning);case"info":return W1(yu.LexingInfo);case"hint":return W1(yu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}M(Kre,"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 ow,jHe=(ow=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=$5(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:$5(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},M(ow,"DefaultAstNodeDescriptionProvider"),ow),lw,XHe=(lw=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 Va(r),D5(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=[];kl(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=$5(r.$refNode);for(const l of n)a.push({sourceUri:i,sourcePath:s,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Sl.equals(l.documentUri,i)});return a}},M(lw,"DefaultReferenceDescriptionProvider"),lw),cw,KHe=(cw=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(cw,"DefaultAstNodeLocator"),cw),CP={};yO(CP,kee(_3()));var uw,ZHe=(uw=class{constructor(e){this._ready=new D0,this.onConfigurationSectionUpdateEmitter=new CP.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(uw,"DefaultConfigurationProvider"),uw),j8=kee(VZt()),sy;(function(t){function e(r){return{dispose:M(async()=>await r(),"dispose")}}M(e,"create"),t.create=e})(sy||(sy={}));var hw,QHe=(hw=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 Va(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),sy.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),sy.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),sy.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 j8.ResponseError(j8.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 j8.ResponseError(j8.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,u=>{Sl.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 Va(n),await a(e,n)}catch(o){if(!Rv(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 Va(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(hw,"DefaultDocumentBuilder"),hw),dw,JHe=(dw=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new TP,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=>{Sl.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(dw,"DefaultIndexManager"),dw),fw,eGe=(fw=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 Va(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=Sl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},M(fw,"DefaultWorkspaceManager"),fw),pw,tGe=(pw=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return gY.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return gY.buildUnableToPopLexerModeMessage(e)}},M(pw,"DefaultLexerErrorMessageProvider"),pw),Zre={mode:"full"},gw,Qre=(gw=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=PI(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Ml(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Zre){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(PI(e))return e;const r=SP(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},M(gw,"DefaultLexer"),gw);function kP(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}M(kP,"isTokenTypeArray");function SP(t){return t&&"modes"in t&&"defaultMode"in t}M(SP,"isIMultiModeLexerDefinition");function PI(t){return!kP(t)&&!SP(t)}M(PI,"isTokenTypeDictionary");I7();function Jre(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=tne(t),a=EP(n),o=rGe({lines:s,position:i,options:a});return sGe({index:0,tokens:o,position:i})}M(Jre,"parseJSDoc");function ene(t,e){const r=EP(e),n=tne(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(ene,"isJSDoc");function tne(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(aNe)}M(tne,"getLines");var Mme=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,ucr=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function rGe(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{Mme.lastIndex=d;const p=Mme.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=$I(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}M(rGe,"tokenize");function nGe(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(nGe,"buildInlineTokens");var hcr=/\S/,dcr=/\s*$/;function $I(t,e){const r=t.substring(e).match(hcr);return r?e+r.index:t.length}M($I,"skipWhitespace");function iGe(t){const e=t.match(dcr);if(e&&typeof e.index=="number")return e.index}M(iGe,"lastCharacter");function sGe(t){var s,a;const e=oi.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Rme([],$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+=$Y(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+=$Y(r)+i}return r.trim()}},M(mw,"JSDocCommentImpl"),mw),yw,Qz=(yw=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=cGe(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(yw,"JSDocTagImpl"),yw);function cGe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=$I(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))??uGe(e,s)}}M(cGe,"renderInlineTag");function uGe(t,e){try{return Hc.parse(t,!0),`[${e}](${t})`}catch{return t}}M(uGe,"renderLinkDefault");var vw,PY=(vw=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(tHe,"buildAmbiguityError");function rHe(t){if(t instanceof Dl)return"SUBRULE";if(t instanceof Ao)return"OPTION";if(t instanceof Cc)return"OR";if(t instanceof Qc)return"AT_LEAST_ONE";if(t instanceof Jc)return"AT_LEAST_ONE_SEP";if(t instanceof Tc)return"MANY_SEP";if(t instanceof Os)return"MANY";if(t instanceof Zi)return"CONSUME";throw Error("non exhaustive match")}M(rHe,"getProductionDslName");function nHe(t,e,r){const n=Olr(e.configs.elements,s=>s.state.transitions),i=jlr(n.filter(s=>s instanceof Tre).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}M(nHe,"buildAdaptivePredictError");function iHe(t,e){return t.edges[e.tokenTypeIdx]}M(iHe,"getExistingTargetState");function sHe(t,e,r){const n=new _Y,i=[];for(const a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===Q7){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l0&&!uHe(s))for(const a of i)s.add(a);return s}M(sHe,"computeReachSet");function aHe(t,e){if(t instanceof Tre&&rre(e,t.tokenType))return t.target}M(aHe,"getReachableTarget");function oHe(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(oHe,"getUniqueAlt");function Rre(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}M(Rre,"newDFAState");function IY(t,e,r,n){return n=_re(t,n),e.edges[r.tokenTypeIdx]=n,n}M(IY,"addDFAEdge");function _re(t,e){if(e===MI)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(_re,"addDFAState");function lHe(t){const e=new _Y,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};mE(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(pHe,"hasConflictingAltSet");function gHe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}M(gHe,"hasStateAssociatedWithOneAlt");I7();var k4,mHe=(k4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Ire(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new gP;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new RI(e.startOffset,e.image.length,nE(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 RI(s.startOffset,s.image.length,nE(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(k4,"CstNodeBuilder"),k4),S4,Lre=(S4=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(S4,"AbstractCstNode"),S4),E4,RI=(E4=class extends Lre{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(E4,"LeafCstNodeImpl"),E4),A4,gP=(A4=class extends Lre{constructor(){super(...arguments),this.content=new acr(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(A4,"CompositeCstNodeImpl"),A4),ly,acr=(ly=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ly.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(ly,"CstNodeContainer"),ly),M4,Ire=(M4=class extends gP{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},M(M4,"RootCstNodeImpl"),M4),_I=Symbol("Datatype");function NR(t){return t.$type===_I}M(NR,"isDataTypeNode");var Ame="​",yHe=M(t=>t.endsWith(Ame)?t:t+Ame,"withRuleSuffix"),R4,Nre=(R4=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 lcr(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new wHe(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(R4,"AbstractLangiumParser"),R4),_4,vHe=(_4=class extends Nre{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new mHe,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;O5(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(yHe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,s),Nl(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===_I?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(NR(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(NR(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)):NR(e)?this.converter.convert(e.value,e.$cstNode):(Lee(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=hv(e,A0);this.assignmentMap.set(e,{assignment:r,crossRef:r&&fv(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(_4,"LangiumParser"),_4),L4,bHe=(L4=class{buildMismatchTokenMessage(e){return gb.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return gb.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return gb.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return gb.buildEarlyExitMessage(e)}},M(L4,"AbstractParserErrorMessageProvider"),L4),I4,Dre=(I4=class extends bHe{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(I4,"LangiumParserErrorMessageProvider"),I4),N4,xHe=(N4=class extends Nre{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(yHe(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(N4,"LangiumCompletionParser"),N4),ocr={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Dre},D4,wHe=(D4=class extends qir{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...ocr,lookaheadStrategy:n?new cre({maxLookahead:r.maxLookahead}):new scr({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(D4,"ChevrotainWrapper"),D4),O4,lcr=(O4=class extends wHe{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(O4,"ProfilerWrapper"),O4);function mP(t,e,r){return THe({parser:e,tokens:r,ruleNames:new Map},t),e}M(mP,"createParser");function THe(t,e){const r=LO(e,!1),n=yi(e.rules).filter(Nl).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,Fg(a,s.definition))}const i=yi(e.rules).filter(O5).filter(s=>r.has(s));for(const s of i)t.parser.rule(s,CHe(t,s))}M(THe,"buildRules");function CHe(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=yP(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(CHe,"buildInfixRule");function Fg(t,e,r=!1){let n;if(M0(e))n=_He(t,e);else if(Og(e))n=kHe(t,e);else if(A0(e))n=Fg(t,e.terminal);else if(fv(e))n=Ore(t,e);else if(R0(e))n=SHe(t,e);else if(TO(e))n=AHe(t,e);else if(EO(e))n=MHe(t,e);else if(pv(e))n=RHe(t,e);else if(Bee(e)){const i=t.consume++;n=M(()=>t.parser.consume(i,$g,e),"method")}else throw new MO(e.$cstNode,`Unexpected element type: ${e.$type}`);return Pre(t,r?void 0:yE(e),n,e.cardinality)}M(Fg,"buildElement");function kHe(t,e){const r=$y(e);return()=>t.parser.action(r,e)}M(kHe,"buildAction");function SHe(t,e){const r=e.rule.ref;if(dv(r)){const n=t.subrule++,i=Nl(r)&&r.fragment,s=e.arguments.length>0?EHe(r,e.arguments):()=>({});let a;return o=>{a??(a=yP(t,r)),t.parser.subrule(n,a,i,e,s(o))}}else if(Bu(r)){const n=t.consume++,i=LI(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)dm();else throw new MO(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}M(SHe,"buildRuleCall");function EHe(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(Pee(t)){const e=lh(t.left),r=lh(t.right);return n=>e(n)&&r(n)}else if(Vee(t)){const e=lh(t.value);return r=>!e(r)}else if(Hee(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Dee(t)){const e=!!t.true;return()=>e}dm()}M(lh,"buildPredicate");function AHe(t,e){if(e.elements.length===1)return Fg(t,e.elements[0]);{const r=[];for(const i of e.elements){const s={ALT:Fg(t,i,!0)},a=yE(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(AHe,"buildAlternatives");function MHe(t,e){if(e.elements.length===1)return Fg(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:Fg(t,o,!0)},u=yE(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=Pre(t,yE(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}M(MHe,"buildUnorderedGroup");function RHe(t,e){const r=e.elements.map(n=>Fg(t,n));return n=>r.forEach(i=>i(n))}M(RHe,"buildGroup");function yE(t){if(pv(t))return t.guardCondition}M(yE,"getGuardCondition");function Ore(t,e,r=e.terminal){if(r)if(R0(r)&&Nl(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let s;return a=>{s??(s=yP(t,n)),t.parser.subrule(i,s,!1,e,a)}}else if(R0(r)&&Bu(r.rule.ref)){const n=t.consume++,i=LI(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(M0(r)){const n=t.consume++,i=LI(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=OO(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+$y(e.type.ref));return Ore(t,e,i)}}M(Ore,"buildCrossReference");function _He(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(_He,"buildKeyword");function Pre(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:SY(),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:SY(),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 dm()}M(Pre,"wrap");function yP(t,e){const r=LHe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}M(yP,"getRule");function LHe(t,e){if(dv(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Nl(n);)(pv(n)||TO(n)||EO(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(LHe,"getRuleName");function LI(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}M(LI,"getToken");function $re(t){const e=t.Grammar,r=t.parser.Lexer,n=new xHe(t);return mP(e,n,r.definition),n.finalize(),n}M($re,"createCompletionParser");function Bre(t){const e=Fre(t);return e.finalize(),e}M(Bre,"createLangiumParser");function Fre(t){const e=t.Grammar,r=t.parser.Lexer,n=new vHe(t);return mP(e,n,r.definition)}M(Fre,"prepareLangiumParser");var P4,vP=(P4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=yi(LO(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=B7(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=_O(r)?Ml.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(dv).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(I3(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&&ute("^"+s.source+"$",e.value)&&n.push(i),n},[])}},M(P4,"DefaultTokenBuilder"),P4),$4,zre=($4=class{convert(e,r){let n=r.grammarSource;if(fv(n)&&(n=gte(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=kte(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($4,"DefaultValueConverter"),$4),od;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}M(bP,"delayNextTick");var DR=0,IHe=10;function xP(){return DR=performance.now(),new $i.CancellationTokenSource}M(xP,"startCancelableOperation");function Vre(t){IHe=t}M(Vre,"setInterruptionPeriod");var xd=Symbol("OperationCancelled");function Rv(t){return t===xd}M(Rv,"isOperationCancelled");async function Va(t){if(t===$i.CancellationToken.None)return;const e=performance.now();if(e-DR>=IHe&&(DR=e,await bP(),DR=performance.now()),t.isCancellationRequested)throw xd}M(Va,"interruptAndCheck");var B4,D0=(B4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},M(B4,"Deferred"),B4),lg,Mme=(lg=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(lg.isIncremental(n)){const i=Gre(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=NY(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&&Hre(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(lg,"FullTextDocument"),lg),II;(function(t){function e(i,s,a,o){return new Mme(i,s,a,o)}M(e,"create"),t.create=e;function r(i,s,a){if(i instanceof Mme)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=NI(s.map(NHe),(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})(II||(II={}));function NI(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);NI(n,e),NI(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(Gre,"getWellformedRange");function NHe(t){const e=Gre(t.range);return e!==t.range?{newText:t.newText,range:e}:t}M(NHe,"getWellformedEdit");var DHe;(()=>{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={})),DHe=n})();var{URI:Hc,Utils:EC}=DHe,Sl;(function(t){t.basename=EC.basename,t.dirname=EC.dirname,t.extname=EC.extname,t.joinPath=EC.joinPath,t.resolvePath=EC.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:Sl.joinPath(Hc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Sl.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(F4,"UriTrie"),F4),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 z4,OHe=(z4=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=II.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},M(z4,"DefaultLangiumDocumentFactory"),z4),V4,PHe=(V4=class{constructor(e){this.documentTrie=new Wre,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(V4,"DefaultLangiumDocuments"),V4),i1=Symbol("RefResolving"),H4,$He=(H4=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 Va(r),D5(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 Va(r),D5(i).forEach(s=>this.doLink(s,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=i1;try{const i=this.getCandidate(e);if(g1(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=i1;try{const i=this.getCandidates(e),s=[];if(g1(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(oa(this._ref))return this._ref;if(Mee(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=i1;const o=Gb(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(g1(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=Gb(e.container).$document;n&&n.statefv(r)&&r.isMulti)}findDeclarations(e){if(e){const r=bte(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(kl(i)||Md(i))return ZL(i);if(Array.isArray(i)){for(const s of i)if((kl(s)||Md(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return ZL(s)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Qee(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 D5(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=>Sl.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:$5(s),local:!0})}}return n}},M(W4,"DefaultReferences"),W4),q4,O0=(q4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return rE.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):L5}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(q4,"MultiMap"),q4),U4,DI=(U4=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(U4,"BiMap"),U4),Y4,zHe=(Y4=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=D7,i=$i.CancellationToken.None){const s=[];this.addExportedSymbol(e,s,r);for(const a of n(e))await Va(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 Va(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(Y4,"DefaultScopeComputation"),Y4),j4,DY=(j4=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(j4,"StreamScope"),j4),X4,ccr=(X4=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(X4,"MapScope"),X4),K4,VHe=(K4=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(K4,"MultiMapScope"),K4),ucr={getElement(){},getElements(){return L5},getAllElements(){return L5}},Z4,wP=(Z4=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(Z4,"DisposableCache"),Z4),Q4,Ure=(Q4=class extends wP{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(Q4,"SimpleCache"),Q4),J4,TP=(J4=class extends wP{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(J4,"ContextCache"),J4),ew,HHe=(ew=class extends TP{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(ew,"DocumentCache"),ew),tw,Yre=(tw=class extends Ure{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(tw,"WorkspaceCache"),tw),rw,GHe=(rw=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 Yre(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 DY(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 DY(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new VHe(this.indexManager.allElements(e)))}},M(rw,"DefaultScopeProvider"),rw);function jre(t){return typeof t.$comment=="string"}M(jre,"isAstNodeWithComment");function OY(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}M(OY,"isIntermediateReference");var nw,WHe=(nw=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(kl(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(oa(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=yte(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(Rv(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(sw,"ValidationRegistry"),sw),YHe=Object.freeze({validateNode:!0,validateChildren:!0}),aw,jHe=(aw=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 Va(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(Rv(a))throw a;console.error("An error occurred during validation:",a)}return await Va(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:AS(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:Kre(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=nE(i.token);if(s){const a={severity:AS("error"),range:s,message:i.message,data:W1(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 Va(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 Va(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||a.prune()}}}validateSingleNodeOptions(e,r){return YHe}async validateAstAfter(e,r,n,i=$i.CancellationToken.None){const s=this.validationRegistry.checksAfter;for(const a of s)await Va(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Xre(n),severity:AS(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(aw,"DefaultDocumentValidator"),aw);function Xre(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=IO(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=vte(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(Xre,"getDiagnosticRange");function AS(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(AS,"toDiagnosticSeverity");function Kre(t){switch(t){case"error":return W1(yu.LexingError);case"warning":return W1(yu.LexingWarning);case"info":return W1(yu.LexingInfo);case"hint":return W1(yu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}M(Kre,"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 ow,XHe=(ow=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=$5(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:$5(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},M(ow,"DefaultAstNodeDescriptionProvider"),ow),lw,KHe=(lw=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 Va(r),D5(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=[];kl(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=$5(r.$refNode);for(const l of n)a.push({sourceUri:i,sourcePath:s,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Sl.equals(l.documentUri,i)});return a}},M(lw,"DefaultReferenceDescriptionProvider"),lw),cw,ZHe=(cw=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(cw,"DefaultAstNodeLocator"),cw),CP={};yO(CP,kee(_3()));var uw,QHe=(uw=class{constructor(e){this._ready=new D0,this.onConfigurationSectionUpdateEmitter=new CP.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(uw,"DefaultConfigurationProvider"),uw),j8=kee(HZt()),sy;(function(t){function e(r){return{dispose:M(async()=>await r(),"dispose")}}M(e,"create"),t.create=e})(sy||(sy={}));var hw,JHe=(hw=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 Va(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),sy.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),sy.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),sy.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 j8.ResponseError(j8.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 j8.ResponseError(j8.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,u=>{Sl.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 Va(n),await a(e,n)}catch(o){if(!Rv(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 Va(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(hw,"DefaultDocumentBuilder"),hw),dw,eGe=(dw=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new TP,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=>{Sl.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(dw,"DefaultIndexManager"),dw),fw,tGe=(fw=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 Va(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=Sl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},M(fw,"DefaultWorkspaceManager"),fw),pw,rGe=(pw=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return gY.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return gY.buildUnableToPopLexerModeMessage(e)}},M(pw,"DefaultLexerErrorMessageProvider"),pw),Zre={mode:"full"},gw,Qre=(gw=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=PI(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Ml(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Zre){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(PI(e))return e;const r=SP(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},M(gw,"DefaultLexer"),gw);function kP(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}M(kP,"isTokenTypeArray");function SP(t){return t&&"modes"in t&&"defaultMode"in t}M(SP,"isIMultiModeLexerDefinition");function PI(t){return!kP(t)&&!SP(t)}M(PI,"isTokenTypeDictionary");I7();function Jre(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=tne(t),a=EP(n),o=nGe({lines:s,position:i,options:a});return aGe({index:0,tokens:o,position:i})}M(Jre,"parseJSDoc");function ene(t,e){const r=EP(e),n=tne(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(ene,"isJSDoc");function tne(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(oNe)}M(tne,"getLines");var Rme=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,hcr=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function nGe(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{Rme.lastIndex=d;const p=Rme.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=$I(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}M(nGe,"tokenize");function iGe(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(iGe,"buildInlineTokens");var dcr=/\S/,fcr=/\s*$/;function $I(t,e){const r=t.substring(e).match(dcr);return r?e+r.index:t.length}M($I,"skipWhitespace");function sGe(t){const e=t.match(fcr);if(e&&typeof e.index=="number")return e.index}M(sGe,"lastCharacter");function aGe(t){var s,a;const e=oi.create(t.position.line,t.position.character);if(t.tokens.length===0)return new _me([],$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+=$Y(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+=$Y(r)+i}return r.trim()}},M(mw,"JSDocCommentImpl"),mw),yw,Qz=(yw=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=uGe(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(yw,"JSDocTagImpl"),yw);function uGe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=$I(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))??hGe(e,s)}}M(uGe,"renderInlineTag");function hGe(t,e){try{return Hc.parse(t,!0),`[${e}](${t})`}catch{return t}}M(hGe,"renderLinkDefault");var vw,PY=(vw=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(vw,"JSDocTextImpl"),vw),bw,hGe=(bw=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},M(bw,"JSDocLineImpl"),bw);function $Y(t){return t.endsWith(` +`)}return r}},M(vw,"JSDocTextImpl"),vw),bw,dGe=(bw=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},M(bw,"JSDocLineImpl"),bw);function $Y(t){return t.endsWith(` `)?` `:` -`}M($Y,"fillNewlines");var xw,dGe=(xw=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&ene(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=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(xw,"JSDocDocumentationProvider"),xw),ww,fGe=(ww=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return jre(e)?e.$comment:(r=rte(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},M(ww,"DefaultCommentProvider"),ww),Tw,pGe=(Tw=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},M(Tw,"DefaultAsyncParser"),Tw),Cw,fcr=(Cw=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(Cw,"AbstractThreadedAsyncParser"),Cw),kw,pcr=(kw=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new CP.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(kw,"ParserWorker"),kw),Sw,gGe=(Sw=class{constructor(){this.previousTokenSource=new $i.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=xP();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){Rv(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},M(Sw,"DefaultWorkspaceLock"),Sw),Ew,mGe=(Ew=class{constructor(e){this.grammarElementIdMap=new DI,this.tokenTypeIdMap=new DI,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 P5(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)oa(o)?a.push(this.dehydrateAstNode(o,r)):kl(o)?a.push(this.dehydrateReference(o,r)):a.push(o)}else oa(s)?n[i]=this.dehydrateAstNode(s,r):kl(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 xO(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)):uv(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 P5(e.$cstNode)){let a;"fullText"in s?(a=new Ire(s.fullText),i=a):"content"in s?a=new gP:"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)oa(o)?a.push(this.setParent(this.hydrateAstNode(o,r),n)):kl(o)?a.push(this.hydrateReference(o,n,i,r)):a.push(o)}else oa(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):kl(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 RI(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))wO(r)&&this.grammarElementIdMap.set(r,e++)}},M(Ew,"DefaultHydrator"),Ew);function no(t){return{documentation:{CommentProvider:M(e=>new fGe(e),"CommentProvider"),DocumentationProvider:M(e=>new dGe(e),"DocumentationProvider")},parser:{AsyncParser:M(e=>new pGe(e),"AsyncParser"),GrammarConfig:M(e=>Ete(e),"GrammarConfig"),LangiumParser:M(e=>Bre(e),"LangiumParser"),CompletionParser:M(e=>$re(e),"CompletionParser"),ValueConverter:M(()=>new zre,"ValueConverter"),TokenBuilder:M(()=>new vP,"TokenBuilder"),Lexer:M(e=>new Qre(e),"Lexer"),ParserErrorMessageProvider:M(()=>new Dre,"ParserErrorMessageProvider"),LexerErrorMessageProvider:M(()=>new tGe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:M(()=>new KHe,"AstNodeLocator"),AstNodeDescriptionProvider:M(e=>new jHe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:M(e=>new XHe(e),"ReferenceDescriptionProvider")},references:{Linker:M(e=>new PHe(e),"Linker"),NameProvider:M(()=>new $He,"NameProvider"),ScopeProvider:M(e=>new HHe(e),"ScopeProvider"),ScopeComputation:M(e=>new FHe(e),"ScopeComputation"),References:M(e=>new BHe(e),"References")},serializer:{Hydrator:M(e=>new mGe(e),"Hydrator"),JsonSerializer:M(e=>new GHe(e),"JsonSerializer")},validation:{DocumentValidator:M(e=>new YHe(e),"DocumentValidator"),ValidationRegistry:M(e=>new qHe(e),"ValidationRegistry")},shared:M(()=>t.shared,"shared")}}M(no,"createDefaultCoreModule");function io(t){return{ServiceRegistry:M(e=>new WHe(e),"ServiceRegistry"),workspace:{LangiumDocuments:M(e=>new OHe(e),"LangiumDocuments"),LangiumDocumentFactory:M(e=>new DHe(e),"LangiumDocumentFactory"),DocumentBuilder:M(e=>new QHe(e),"DocumentBuilder"),IndexManager:M(e=>new JHe(e),"IndexManager"),WorkspaceManager:M(e=>new eGe(e),"WorkspaceManager"),FileSystemProvider:M(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:M(()=>new gGe,"WorkspaceLock"),ConfigurationProvider:M(e=>new ZHe(e),"ConfigurationProvider")},profilers:{}}}M(io,"createDefaultSharedCoreModule");var BY;(function(t){t.merge=(e,r)=>V5(V5({},e),r)})(BY||(BY={}));function Hn(t,e,r,n,i,s,a,o,l){const u=[t,e,r,n,i,s,a,o,l].reduce(V5,{});return ane(u)}M(Hn,"inject");var yGe=Symbol("isProxy");function sne(t){if(t&&t[yGe])for(const e of Object.values(t))sne(e);return t}M(sne,"eagerLoad");function ane(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===yGe?!0:FY(n,i,t,e||r),"get"),getOwnPropertyDescriptor:M((n,i)=>(FY(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(ane,"_inject");var _me=Symbol();function FY(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]===_me)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]=_me;try{t[e]=typeof i=="function"?i(n):ane(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}M(FY,"_resolve");function V5(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]=V5(i,n):t[r]=V5({},n)}else t[r]=n}return t}M(V5,"_merge");var zY={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},q1;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(q1||(q1={}));var Aw,vGe=(Aw=class extends vP{constructor(e=zY){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...zY,...e},this.indentTokenType=qb({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=qb({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!kP(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=q1.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:{[q1.REGULAR]:[l,u,...d,h],[q1.IGNORE_INDENTATION]:[...d,h]},defaultMode:q1.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 X7(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(Aw,"IndentationAwareTokenBuilder"),Aw),Mw,gcr=(Mw=class extends Qre{constructor(e){if(super(e),e.parser.TokenBuilder instanceof vGe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Zre){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(Mw,"IndentationAwareLexer"),Mw),one={};hm(one,{AstUtils:()=>_ee,BiMap:()=>DI,Cancellation:()=>$i,ContextCache:()=>TP,CstUtils:()=>Aee,DONE_RESULT:()=>pl,Deferred:()=>D0,Disposable:()=>sy,DisposableCache:()=>wP,DocumentCache:()=>VHe,EMPTY_STREAM:()=>L5,ErrorWithLocation:()=>MO,GrammarUtils:()=>ate,MultiMap:()=>O0,OperationCancelled:()=>xd,Reduction:()=>rE,RegExpUtils:()=>lte,SimpleCache:()=>Ure,StreamImpl:()=>bd,TreeStreamImpl:()=>I5,URI:()=>Hc,UriTrie:()=>Wre,UriUtils:()=>Sl,WorkspaceCache:()=>Yre,assertCondition:()=>ote,assertUnreachable:()=>dm,delayNextTick:()=>bP,interruptAndCheck:()=>Va,isOperationCancelled:()=>Rv,loadGrammarFromJson:()=>so,setInterruptionPeriod:()=>Vre,startCancelableOperation:()=>xP,stream:()=>yi});yO(one,CP);var Rw,bGe=(Rw=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(Rw,"EmptyFileSystemProvider"),Rw),Lo={fileSystemProvider:M(()=>new bGe,"fileSystemProvider")},mcr={Grammar:M(()=>{},"Grammar"),LanguageMetaData:M(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},ycr={AstReflection:M(()=>new Zee,"AstReflection")};function xGe(){const t=Hn(io(Lo),ycr),e=Hn(no({shared:t}),mcr);return t.ServiceRegistry.register(e),e}M(xGe,"createMinimalGrammarServices");function so(t){const e=xGe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Hc.parse(`memory:/${r.name??"grammar"}.langium`)),r}M(so,"loadGrammarFromJson");yO(LIe,one);var _w,vcr=(_w=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 wGe(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(_w,"DefaultLangiumProfiler"),_w),Lw,wGe=(Lw=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(Lw,"ProfilingTask"),Lw),VY;(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]+)\]/}})(VY||(VY={}));var HY;(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]*/}})(HY||(HY={}));var GY;(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]*/}})(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]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(WY||(WY={}));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]*|)/,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={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]*/}})(UY||(UY={}));var YY;(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]*/}})(YY||(YY={}));var jY;(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]*/}})(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*{([^}]*)})/,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]*/}})(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*{([^}]*)})/,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]*?\*\)/}})(KY||(KY={}));var ZY;(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]*?\*\//}})(ZY||(ZY={}));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*{([^}]*)})/,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]*/}})(QY||(QY={}));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]*|)/,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:/"[^"]*"|'[^']*'/}})(JY||(JY={}));var ej;(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])*/}})(ej||(ej={}));var tj;(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]*/}})(tj||(tj={}));({...VY.Terminals,...HY.Terminals,...GY.Terminals,...WY.Terminals,...qY.Terminals,...UY.Terminals,...YY.Terminals,...jY.Terminals,...XY.Terminals,...KY.Terminals,...ZY.Terminals,...QY.Terminals,...ej.Terminals,...JY.Terminals,...tj.Terminals});var Lme={$type:"AbnfAlternation",alternatives:"alternatives"},Ime={$type:"AbnfConcatenation",elements:"elements"},Jz={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Nme={$type:"AbnfGroup",element:"element"},Dme={$type:"AbnfNumVal",value:"value"},Ome={$type:"AbnfOptionalGroup",element:"element"},i2={$type:"AbnfPrimary"},eV={$type:"AbnfRule",definition:"definition",name:"name"},Pme={$type:"AbnfRuleName",name:"name"},$me={$type:"AbnfStringLiteral",value:"value"},X8={$type:"Accelerator",name:"name",x:"x",y:"y"},tV={$type:"Alignment",direction:"direction",members:"members"},K8={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},AC={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},rV={$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 bcr(t){return Qs.isInstance(t,Kh.$type)}M(bcr,"isArchitecture");var Z8={$type:"Axis",label:"label",name:"name"},PR={$type:"Branch",name:"name",order:"order"};function xcr(t){return Qs.isInstance(t,PR.$type)}M(xcr,"isBranch");var Bme={$type:"Checkout",branch:"branch"},Q8={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},nV={$type:"ClassDefStatement",className:"className",styleText:"styleText"},O2={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function wcr(t){return Qs.isInstance(t,O2.$type)}M(wcr,"isCommit");var J8={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Bm={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},eM={$type:"Curve",entries:"entries",label:"label",name:"name"},s1={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Tcr(t){return Qs.isInstance(t,s1.$type)}M(Tcr,"isCynefin");var tM={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Fme={$type:"Decorator",strategy:"strategy"},s2={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},$R={$type:"DomainBlock",domain:"domain",items:"items"};function Ccr(t){return Qs.isInstance(t,$R.$type)}M(Ccr,"isDomainBlock");var rj={$type:"DomainItem",label:"label"};function kcr(t){return Qs.isInstance(t,rj.$type)}M(kcr,"isDomainItem");var zme={$type:"EbnfChoice",alternatives:"alternatives"},Vme={$type:"EbnfExceptionPostfix",except:"except"},Hme={$type:"EbnfGroup",element:"element"},Gme={$type:"EbnfNonTerminal",name:"name"},Wme={$type:"EbnfOneOrMorePostfix",operator:"operator"},qme={$type:"EbnfOptional",element:"element"},Ume={$type:"EbnfOptionalPostfix",operator:"operator"},MC={$type:"EbnfPostfix"},Fm={$type:"EbnfPrimary"},Yme={$type:"EbnfRepetition",element:"element"},iV={$type:"EbnfRule",definition:"definition",name:"name"},jme={$type:"EbnfSequence",elements:"elements"},Xme={$type:"EbnfSpecial",text:"text"},sV={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Kme={$type:"EbnfTerminal",value:"value"},Zme={$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"},a2={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},zm={$type:"EmFrame"},RC={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Qme={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},aV={$type:"EmModelEntity",name:"name"};function Scr(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}M(Scr,"isEmModelEntityType");var rM={$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 TGe(t){return Qs.isInstance(t,Sf.$type)}M(TGe,"isEmResetFrame");var bp={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},oV={$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"},Jme={$type:"Evolution",stages:"stages"},nM={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},lV={$type:"Evolve",component:"component",target:"target"},a1={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Ecr(t){return Qs.isInstance(t,a1.$type)}M(Ecr,"isGitGraph");var _C={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ek={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Acr(t){return Qs.isInstance(t,Ek.$type)}M(Acr,"isInfo");var LC={$type:"Item",classSelector:"classSelector",name:"name"},cV={$type:"Junction",id:"id",in:"in"},IC={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},iM={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Vm={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},P2={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Mcr(t){return Qs.isInstance(t,P2.$type)}M(Mcr,"isMerge");var sM={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},uV={$type:"Option",name:"name",value:"value"},$2={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function Rcr(t){return Qs.isInstance(t,$2.$type)}M(Rcr,"isPacket");var B2={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function _cr(t){return Qs.isInstance(t,B2.$type)}M(_cr,"isPacketBlock");var e1e={$type:"PegAny",dot:"dot"},t1e={$type:"PegGroup",element:"element"},r1e={$type:"PegIdentifier",name:"name"},n1e={$type:"PegLiteral",value:"value"},i1e={$type:"PegOrderedChoice",alternatives:"alternatives"},hV={$type:"PegPrefix",operator:"operator",suffix:"suffix"},NC={$type:"PegPrimary"},dV={$type:"PegRule",definition:"definition",name:"name"},s1e={$type:"PegSequence",elements:"elements"},fV={$type:"PegSuffix",operator:"operator",primary:"primary"},o1={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Lcr(t){return Qs.isInstance(t,o1.$type)}M(Lcr,"isPie");var BR={$type:"PieSection",label:"label",value:"value"};function Icr(t){return Qs.isInstance(t,BR.$type)}M(Icr,"isPieSection");var pV={$type:"Pipeline",components:"components",parent:"parent"},aM={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Hm={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},F2={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Ncr(t){return Qs.isInstance(t,F2.$type)}M(Ncr,"isRailroad");var z2={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Dcr(t){return Qs.isInstance(t,z2.$type)}M(Dcr,"isRailroadAbnf");var a1e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},V2={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Ocr(t){return Qs.isInstance(t,V2.$type)}M(Ocr,"isRailroadEbnf");var yf={$type:"RailroadExpression"},o1e={$type:"RailroadNonTerminalExpr",name:"name"},l1e={$type:"RailroadOneOrMoreExpr",element:"element"},c1e={$type:"RailroadOptionalExpr",element:"element"},H2={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Pcr(t){return Qs.isInstance(t,H2.$type)}M(Pcr,"isRailroadPeg");var gV={$type:"RailroadRule",definition:"definition",name:"name"},u1e={$type:"RailroadSequenceExpr",elements:"elements"},h1e={$type:"RailroadSpecialExpr",text:"text"},d1e={$type:"RailroadTerminalExpr",value:"value"},f1e={$type:"RailroadZeroOrMoreExpr",element:"element"},mV={$type:"Section",classSelector:"classSelector",name:"name"},o2={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},yV={$type:"Size",height:"height",width:"width"},l2={$type:"Statement"},Ak={$type:"Transition",from:"from",label:"label",to:"to"};function $cr(t){return Qs.isInstance(t,Ak.$type)}M($cr,"isTransition");var G2={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Bcr(t){return Qs.isInstance(t,G2.$type)}M(Bcr,"isTreemap");var vV={$type:"TreemapRow",indent:"indent",item:"item"},c2={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},DC={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},fo={$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 Fcr(t){return Qs.isInstance(t,fo.$type)}M(Fcr,"isWardley");var Iw,CGe=(Iw=class extends Ree{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Lme.$type,properties:{alternatives:{name:Lme.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Ime.$type,properties:{elements:{name:Ime.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Jz.$type,properties:{primary:{name:Jz.primary},repeat:{name:Jz.repeat}},superTypes:[]},AbnfGroup:{name:Nme.$type,properties:{element:{name:Nme.element}},superTypes:[i2.$type]},AbnfNumVal:{name:Dme.$type,properties:{value:{name:Dme.value}},superTypes:[i2.$type]},AbnfOptionalGroup:{name:Ome.$type,properties:{element:{name:Ome.element}},superTypes:[i2.$type]},AbnfPrimary:{name:i2.$type,properties:{},superTypes:[]},AbnfRule:{name:eV.$type,properties:{definition:{name:eV.definition},name:{name:eV.name}},superTypes:[]},AbnfRuleName:{name:Pme.$type,properties:{name:{name:Pme.name}},superTypes:[i2.$type]},AbnfStringLiteral:{name:$me.$type,properties:{value:{name:$me.value}},superTypes:[i2.$type]},Accelerator:{name:X8.$type,properties:{name:{name:X8.name},x:{name:X8.x},y:{name:X8.y}},superTypes:[]},Alignment:{name:tV.$type,properties:{direction:{name:tV.direction},members:{name:tV.members,defaultValue:[]}},superTypes:[]},Anchor:{name:K8.$type,properties:{evolution:{name:K8.evolution},name:{name:K8.name},visibility:{name:K8.visibility}},superTypes:[]},Annotation:{name:AC.$type,properties:{number:{name:AC.number},text:{name:AC.text},x:{name:AC.x},y:{name:AC.y}},superTypes:[]},Annotations:{name:rV.$type,properties:{x:{name:rV.x},y:{name:rV.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:Z8.$type,properties:{label:{name:Z8.label},name:{name:Z8.name}},superTypes:[]},Branch:{name:PR.$type,properties:{name:{name:PR.name},order:{name:PR.order}},superTypes:[l2.$type]},Checkout:{name:Bme.$type,properties:{branch:{name:Bme.branch}},superTypes:[l2.$type]},CherryPicking:{name:Q8.$type,properties:{id:{name:Q8.id},parent:{name:Q8.parent},tags:{name:Q8.tags,defaultValue:[]}},superTypes:[l2.$type]},ClassDefStatement:{name:nV.$type,properties:{className:{name:nV.className},styleText:{name:nV.styleText}},superTypes:[]},Commit:{name:O2.$type,properties:{id:{name:O2.id},message:{name:O2.message},tags:{name:O2.tags,defaultValue:[]},type:{name:O2.type}},superTypes:[l2.$type]},Common:{name:J8.$type,properties:{accDescr:{name:J8.accDescr},accTitle:{name:J8.accTitle},title:{name:J8.title}},superTypes:[]},Component:{name:Bm.$type,properties:{decorator:{name:Bm.decorator},evolution:{name:Bm.evolution},inertia:{name:Bm.inertia,defaultValue:!1},label:{name:Bm.label},name:{name:Bm.name},visibility:{name:Bm.visibility}},superTypes:[]},Curve:{name:eM.$type,properties:{entries:{name:eM.entries,defaultValue:[]},label:{name:eM.label},name:{name:eM.name}},superTypes:[]},Cynefin:{name:s1.$type,properties:{accDescr:{name:s1.accDescr},accTitle:{name:s1.accTitle},domains:{name:s1.domains,defaultValue:[]},title:{name:s1.title},transitions:{name:s1.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:tM.$type,properties:{name:{name:tM.name},x:{name:tM.x},y:{name:tM.y}},superTypes:[]},Decorator:{name:Fme.$type,properties:{strategy:{name:Fme.strategy}},superTypes:[]},Direction:{name:s2.$type,properties:{accDescr:{name:s2.accDescr},accTitle:{name:s2.accTitle},dir:{name:s2.dir},statements:{name:s2.statements,defaultValue:[]},title:{name:s2.title}},superTypes:[a1.$type]},DomainBlock:{name:$R.$type,properties:{domain:{name:$R.domain},items:{name:$R.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:rj.$type,properties:{label:{name:rj.label}},superTypes:[]},EbnfChoice:{name:zme.$type,properties:{alternatives:{name:zme.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Vme.$type,properties:{except:{name:Vme.except}},superTypes:[MC.$type]},EbnfGroup:{name:Hme.$type,properties:{element:{name:Hme.element}},superTypes:[Fm.$type]},EbnfNonTerminal:{name:Gme.$type,properties:{name:{name:Gme.name}},superTypes:[Fm.$type]},EbnfOneOrMorePostfix:{name:Wme.$type,properties:{operator:{name:Wme.operator}},superTypes:[MC.$type]},EbnfOptional:{name:qme.$type,properties:{element:{name:qme.element}},superTypes:[Fm.$type]},EbnfOptionalPostfix:{name:Ume.$type,properties:{operator:{name:Ume.operator}},superTypes:[MC.$type]},EbnfPostfix:{name:MC.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Fm.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Yme.$type,properties:{element:{name:Yme.element}},superTypes:[Fm.$type]},EbnfRule:{name:iV.$type,properties:{definition:{name:iV.definition},name:{name:iV.name}},superTypes:[]},EbnfSequence:{name:jme.$type,properties:{elements:{name:jme.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Xme.$type,properties:{text:{name:Xme.text}},superTypes:[Fm.$type]},EbnfTerm:{name:sV.$type,properties:{base:{name:sV.base},postfixes:{name:sV.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Kme.$type,properties:{value:{name:Kme.value}},superTypes:[Fm.$type]},EbnfZeroOrMorePostfix:{name:Zme.$type,properties:{operator:{name:Zme.operator}},superTypes:[MC.$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:a2.$type,properties:{dataBlockValue:{name:a2.dataBlockValue},dataType:{name:a2.dataType},name:{name:a2.name}},superTypes:[]},EmFrame:{name:zm.$type,properties:{},superTypes:[]},EmGwt:{name:RC.$type,properties:{givenStatements:{name:RC.givenStatements,defaultValue:[]},sourceFrame:{name:RC.sourceFrame,referenceType:zm.$type},thenStatements:{name:RC.thenStatements,defaultValue:[]},whenStatements:{name:RC.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Qme.$type,properties:{entityIdentifier:{name:Qme.entityIdentifier,referenceType:aV.$type}},superTypes:[]},EmModelEntity:{name:aV.$type,properties:{name:{name:aV.name}},superTypes:[]},EmNoteEntity:{name:rM.$type,properties:{dataBlockValue:{name:rM.dataBlockValue},dataType:{name:rM.dataType},sourceFrame:{name:rM.sourceFrame,referenceType:zm.$type}},superTypes:[]},EmResetFrame:{name:Sf.$type,properties:{dataInlineValue:{name:Sf.dataInlineValue},dataReference:{name:Sf.dataReference,referenceType:a2.$type},dataType:{name:Sf.dataType},entityIdentifier:{name:Sf.entityIdentifier},modelEntityType:{name:Sf.modelEntityType},name:{name:Sf.name},sourceFrames:{name:Sf.sourceFrames,defaultValue:[],referenceType:zm.$type}},superTypes:[zm.$type]},EmTimeFrame:{name:bp.$type,properties:{dataInlineValue:{name:bp.dataInlineValue},dataReference:{name:bp.dataReference,referenceType:a2.$type},dataType:{name:bp.dataType},entityIdentifier:{name:bp.entityIdentifier},modelEntityType:{name:bp.modelEntityType},name:{name:bp.name},sourceFrames:{name:bp.sourceFrames,defaultValue:[],referenceType:zm.$type}},superTypes:[zm.$type]},Entry:{name:oV.$type,properties:{axis:{name:oV.axis,referenceType:Z8.$type},value:{name:oV.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:Jme.$type,properties:{stages:{name:Jme.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:nM.$type,properties:{boundary:{name:nM.boundary},name:{name:nM.name},secondName:{name:nM.secondName}},superTypes:[]},Evolve:{name:lV.$type,properties:{component:{name:lV.component},target:{name:lV.target}},superTypes:[]},GitGraph:{name:a1.$type,properties:{accDescr:{name:a1.accDescr},accTitle:{name:a1.accTitle},statements:{name:a1.statements,defaultValue:[]},title:{name:a1.title}},superTypes:[]},Group:{name:_C.$type,properties:{icon:{name:_C.icon},id:{name:_C.id},in:{name:_C.in},title:{name:_C.title}},superTypes:[]},Info:{name:Ek.$type,properties:{accDescr:{name:Ek.accDescr},accTitle:{name:Ek.accTitle},title:{name:Ek.title}},superTypes:[]},Item:{name:LC.$type,properties:{classSelector:{name:LC.classSelector},name:{name:LC.name}},superTypes:[]},Junction:{name:cV.$type,properties:{id:{name:cV.id},in:{name:cV.in}},superTypes:[]},Label:{name:IC.$type,properties:{negX:{name:IC.negX,defaultValue:!1},negY:{name:IC.negY,defaultValue:!1},offsetX:{name:IC.offsetX},offsetY:{name:IC.offsetY}},superTypes:[]},Leaf:{name:iM.$type,properties:{classSelector:{name:iM.classSelector},name:{name:iM.name},value:{name:iM.value}},superTypes:[LC.$type]},Link:{name:Vm.$type,properties:{arrow:{name:Vm.arrow},from:{name:Vm.from},fromPort:{name:Vm.fromPort},linkLabel:{name:Vm.linkLabel},to:{name:Vm.to},toPort:{name:Vm.toPort}},superTypes:[]},Merge:{name:P2.$type,properties:{branch:{name:P2.branch},id:{name:P2.id},tags:{name:P2.tags,defaultValue:[]},type:{name:P2.type}},superTypes:[l2.$type]},Note:{name:sM.$type,properties:{evolution:{name:sM.evolution},text:{name:sM.text},visibility:{name:sM.visibility}},superTypes:[]},Option:{name:uV.$type,properties:{name:{name:uV.name},value:{name:uV.value,defaultValue:!1}},superTypes:[]},Packet:{name:$2.$type,properties:{accDescr:{name:$2.accDescr},accTitle:{name:$2.accTitle},blocks:{name:$2.blocks,defaultValue:[]},title:{name:$2.title}},superTypes:[]},PacketBlock:{name:B2.$type,properties:{bits:{name:B2.bits},end:{name:B2.end},label:{name:B2.label},start:{name:B2.start}},superTypes:[]},PegAny:{name:e1e.$type,properties:{dot:{name:e1e.dot}},superTypes:[NC.$type]},PegGroup:{name:t1e.$type,properties:{element:{name:t1e.element}},superTypes:[NC.$type]},PegIdentifier:{name:r1e.$type,properties:{name:{name:r1e.name}},superTypes:[NC.$type]},PegLiteral:{name:n1e.$type,properties:{value:{name:n1e.value}},superTypes:[NC.$type]},PegOrderedChoice:{name:i1e.$type,properties:{alternatives:{name:i1e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:hV.$type,properties:{operator:{name:hV.operator},suffix:{name:hV.suffix}},superTypes:[]},PegPrimary:{name:NC.$type,properties:{},superTypes:[]},PegRule:{name:dV.$type,properties:{definition:{name:dV.definition},name:{name:dV.name}},superTypes:[]},PegSequence:{name:s1e.$type,properties:{elements:{name:s1e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:fV.$type,properties:{operator:{name:fV.operator},primary:{name:fV.primary}},superTypes:[]},Pie:{name:o1.$type,properties:{accDescr:{name:o1.accDescr},accTitle:{name:o1.accTitle},sections:{name:o1.sections,defaultValue:[]},showData:{name:o1.showData,defaultValue:!1},title:{name:o1.title}},superTypes:[]},PieSection:{name:BR.$type,properties:{label:{name:BR.label},value:{name:BR.value}},superTypes:[]},Pipeline:{name:pV.$type,properties:{components:{name:pV.components,defaultValue:[]},parent:{name:pV.parent}},superTypes:[]},PipelineComponent:{name:aM.$type,properties:{evolution:{name:aM.evolution},label:{name:aM.label},name:{name:aM.name}},superTypes:[]},Radar:{name:Hm.$type,properties:{accDescr:{name:Hm.accDescr},accTitle:{name:Hm.accTitle},axes:{name:Hm.axes,defaultValue:[]},curves:{name:Hm.curves,defaultValue:[]},options:{name:Hm.options,defaultValue:[]},title:{name:Hm.title}},superTypes:[]},Railroad:{name:F2.$type,properties:{accDescr:{name:F2.accDescr},accTitle:{name:F2.accTitle},rules:{name:F2.rules,defaultValue:[]},title:{name:F2.title}},superTypes:[]},RailroadAbnf:{name:z2.$type,properties:{accDescr:{name:z2.accDescr},accTitle:{name:z2.accTitle},rules:{name:z2.rules,defaultValue:[]},title:{name:z2.title}},superTypes:[]},RailroadChoiceExpr:{name:a1e.$type,properties:{alternatives:{name:a1e.alternatives,defaultValue:[]}},superTypes:[yf.$type]},RailroadEbnf:{name:V2.$type,properties:{accDescr:{name:V2.accDescr},accTitle:{name:V2.accTitle},rules:{name:V2.rules,defaultValue:[]},title:{name:V2.title}},superTypes:[]},RailroadExpression:{name:yf.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:o1e.$type,properties:{name:{name:o1e.name}},superTypes:[yf.$type]},RailroadOneOrMoreExpr:{name:l1e.$type,properties:{element:{name:l1e.element}},superTypes:[yf.$type]},RailroadOptionalExpr:{name:c1e.$type,properties:{element:{name:c1e.element}},superTypes:[yf.$type]},RailroadPeg:{name:H2.$type,properties:{accDescr:{name:H2.accDescr},accTitle:{name:H2.accTitle},rules:{name:H2.rules,defaultValue:[]},title:{name:H2.title}},superTypes:[]},RailroadRule:{name:gV.$type,properties:{definition:{name:gV.definition},name:{name:gV.name}},superTypes:[]},RailroadSequenceExpr:{name:u1e.$type,properties:{elements:{name:u1e.elements,defaultValue:[]}},superTypes:[yf.$type]},RailroadSpecialExpr:{name:h1e.$type,properties:{text:{name:h1e.text}},superTypes:[yf.$type]},RailroadTerminalExpr:{name:d1e.$type,properties:{value:{name:d1e.value}},superTypes:[yf.$type]},RailroadZeroOrMoreExpr:{name:f1e.$type,properties:{element:{name:f1e.element}},superTypes:[yf.$type]},Section:{name:mV.$type,properties:{classSelector:{name:mV.classSelector},name:{name:mV.name}},superTypes:[LC.$type]},Service:{name:o2.$type,properties:{icon:{name:o2.icon},iconText:{name:o2.iconText},id:{name:o2.id},in:{name:o2.in},title:{name:o2.title}},superTypes:[]},Size:{name:yV.$type,properties:{height:{name:yV.height},width:{name:yV.width}},superTypes:[]},Statement:{name:l2.$type,properties:{},superTypes:[]},Transition:{name:Ak.$type,properties:{from:{name:Ak.from},label:{name:Ak.label},to:{name:Ak.to}},superTypes:[]},TreeNode:{name:c2.$type,properties:{classAnnotation:{name:c2.classAnnotation},descAnnotation:{name:c2.descAnnotation},iconAnnotation:{name:c2.iconAnnotation},indent:{name:c2.indent},name:{name:c2.name}},superTypes:[]},TreeView:{name:DC.$type,properties:{accDescr:{name:DC.accDescr},accTitle:{name:DC.accTitle},nodes:{name:DC.nodes,defaultValue:[]},title:{name:DC.title}},superTypes:[]},Treemap:{name:G2.$type,properties:{accDescr:{name:G2.accDescr},accTitle:{name:G2.accTitle},title:{name:G2.title},TreemapRows:{name:G2.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:vV.$type,properties:{indent:{name:vV.indent},item:{name:vV.item}},superTypes:[]},Wardley:{name:fo.$type,properties:{accDescr:{name:fo.accDescr},accelerators:{name:fo.accelerators,defaultValue:[]},accTitle:{name:fo.accTitle},anchors:{name:fo.anchors,defaultValue:[]},annotation:{name:fo.annotation,defaultValue:[]},annotations:{name:fo.annotations,defaultValue:[]},components:{name:fo.components,defaultValue:[]},deaccelerators:{name:fo.deaccelerators,defaultValue:[]},evolution:{name:fo.evolution},evolves:{name:fo.evolves,defaultValue:[]},links:{name:fo.links,defaultValue:[]},notes:{name:fo.notes,defaultValue:[]},pipelines:{name:fo.pipelines,defaultValue:[]},size:{name:fo.size},title:{name:fo.title}},superTypes:[]}}}},M(Iw,"MermaidAstReflection"),Iw),Qs=new CGe,p1e,zcr=M(()=>p1e??(p1e=so(`{"$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"),g1e,Vcr=M(()=>g1e??(g1e=so(`{"$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"),m1e,Hcr=M(()=>m1e??(m1e=so('{"$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"),y1e,Gcr=M(()=>y1e??(y1e=so(`{"$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"),v1e,Wcr=M(()=>v1e??(v1e=so(`{"$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"),b1e,qcr=M(()=>b1e??(b1e=so(`{"$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"),x1e,Ucr=M(()=>x1e??(x1e=so(`{"$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"),w1e,Ycr=M(()=>w1e??(w1e=so(`{"$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"),T1e,jcr=M(()=>T1e??(T1e=so('{"$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"),C1e,Xcr=M(()=>C1e??(C1e=so(`{"$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"),k1e,Kcr=M(()=>k1e??(k1e=so(`{"$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"),S1e,Zcr=M(()=>S1e??(S1e=so(`{"$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"),E1e,Qcr=M(()=>E1e??(E1e=so(`{"$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"),A1e,Jcr=M(()=>A1e??(A1e=so(`{"$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"),M1e,eur=M(()=>M1e??(M1e=so(`{"$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"),tur={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rur={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nur={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iur={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sur={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},aur={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},our={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lur={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cur={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uur={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hur={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dur={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fur={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pur={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gur={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wl={AstReflection:M(()=>new CGe,"AstReflection")},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={Grammar:M(()=>Kcr(),"Grammar"),LanguageMetaData:M(()=>hur,"LanguageMetaData"),parser:{}},Aur={Grammar:M(()=>Zcr(),"Grammar"),LanguageMetaData:M(()=>dur,"LanguageMetaData"),parser:{}},Mur={Grammar:M(()=>Qcr(),"Grammar"),LanguageMetaData:M(()=>fur,"LanguageMetaData"),parser:{}},Rur={Grammar:M(()=>Jcr(),"Grammar"),LanguageMetaData:M(()=>pur,"LanguageMetaData"),parser:{}},_ur={Grammar:M(()=>eur(),"Grammar"),LanguageMetaData:M(()=>gur,"LanguageMetaData"),parser:{}},Lur=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Iur=/accTitle[\t ]*:([^\n\r]*)/,Nur=/title([\t ][^\n\r]*|)/,Dur={ACC_DESCR:Lur,ACC_TITLE:Iur,TITLE:Nur},Nw,sf=(Nw=class extends zre{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=Dur[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($Y,"fillNewlines");var xw,fGe=(xw=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&ene(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=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(xw,"JSDocDocumentationProvider"),xw),ww,pGe=(ww=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return jre(e)?e.$comment:(r=rte(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},M(ww,"DefaultCommentProvider"),ww),Tw,gGe=(Tw=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},M(Tw,"DefaultAsyncParser"),Tw),Cw,pcr=(Cw=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(Cw,"AbstractThreadedAsyncParser"),Cw),kw,gcr=(kw=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new CP.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(kw,"ParserWorker"),kw),Sw,mGe=(Sw=class{constructor(){this.previousTokenSource=new $i.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=xP();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){Rv(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},M(Sw,"DefaultWorkspaceLock"),Sw),Ew,yGe=(Ew=class{constructor(e){this.grammarElementIdMap=new DI,this.tokenTypeIdMap=new DI,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 P5(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)oa(o)?a.push(this.dehydrateAstNode(o,r)):kl(o)?a.push(this.dehydrateReference(o,r)):a.push(o)}else oa(s)?n[i]=this.dehydrateAstNode(s,r):kl(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 xO(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)):uv(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 P5(e.$cstNode)){let a;"fullText"in s?(a=new Ire(s.fullText),i=a):"content"in s?a=new gP:"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)oa(o)?a.push(this.setParent(this.hydrateAstNode(o,r),n)):kl(o)?a.push(this.hydrateReference(o,n,i,r)):a.push(o)}else oa(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):kl(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 RI(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))wO(r)&&this.grammarElementIdMap.set(r,e++)}},M(Ew,"DefaultHydrator"),Ew);function no(t){return{documentation:{CommentProvider:M(e=>new pGe(e),"CommentProvider"),DocumentationProvider:M(e=>new fGe(e),"DocumentationProvider")},parser:{AsyncParser:M(e=>new gGe(e),"AsyncParser"),GrammarConfig:M(e=>Ete(e),"GrammarConfig"),LangiumParser:M(e=>Bre(e),"LangiumParser"),CompletionParser:M(e=>$re(e),"CompletionParser"),ValueConverter:M(()=>new zre,"ValueConverter"),TokenBuilder:M(()=>new vP,"TokenBuilder"),Lexer:M(e=>new Qre(e),"Lexer"),ParserErrorMessageProvider:M(()=>new Dre,"ParserErrorMessageProvider"),LexerErrorMessageProvider:M(()=>new rGe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:M(()=>new ZHe,"AstNodeLocator"),AstNodeDescriptionProvider:M(e=>new XHe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:M(e=>new KHe(e),"ReferenceDescriptionProvider")},references:{Linker:M(e=>new $He(e),"Linker"),NameProvider:M(()=>new BHe,"NameProvider"),ScopeProvider:M(e=>new GHe(e),"ScopeProvider"),ScopeComputation:M(e=>new zHe(e),"ScopeComputation"),References:M(e=>new FHe(e),"References")},serializer:{Hydrator:M(e=>new yGe(e),"Hydrator"),JsonSerializer:M(e=>new WHe(e),"JsonSerializer")},validation:{DocumentValidator:M(e=>new jHe(e),"DocumentValidator"),ValidationRegistry:M(e=>new UHe(e),"ValidationRegistry")},shared:M(()=>t.shared,"shared")}}M(no,"createDefaultCoreModule");function io(t){return{ServiceRegistry:M(e=>new qHe(e),"ServiceRegistry"),workspace:{LangiumDocuments:M(e=>new PHe(e),"LangiumDocuments"),LangiumDocumentFactory:M(e=>new OHe(e),"LangiumDocumentFactory"),DocumentBuilder:M(e=>new JHe(e),"DocumentBuilder"),IndexManager:M(e=>new eGe(e),"IndexManager"),WorkspaceManager:M(e=>new tGe(e),"WorkspaceManager"),FileSystemProvider:M(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:M(()=>new mGe,"WorkspaceLock"),ConfigurationProvider:M(e=>new QHe(e),"ConfigurationProvider")},profilers:{}}}M(io,"createDefaultSharedCoreModule");var BY;(function(t){t.merge=(e,r)=>V5(V5({},e),r)})(BY||(BY={}));function Hn(t,e,r,n,i,s,a,o,l){const u=[t,e,r,n,i,s,a,o,l].reduce(V5,{});return ane(u)}M(Hn,"inject");var vGe=Symbol("isProxy");function sne(t){if(t&&t[vGe])for(const e of Object.values(t))sne(e);return t}M(sne,"eagerLoad");function ane(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===vGe?!0:FY(n,i,t,e||r),"get"),getOwnPropertyDescriptor:M((n,i)=>(FY(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(ane,"_inject");var Lme=Symbol();function FY(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]===Lme)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]=Lme;try{t[e]=typeof i=="function"?i(n):ane(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}M(FY,"_resolve");function V5(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]=V5(i,n):t[r]=V5({},n)}else t[r]=n}return t}M(V5,"_merge");var zY={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},q1;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(q1||(q1={}));var Aw,bGe=(Aw=class extends vP{constructor(e=zY){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...zY,...e},this.indentTokenType=qb({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=qb({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!kP(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=q1.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:{[q1.REGULAR]:[l,u,...d,h],[q1.IGNORE_INDENTATION]:[...d,h]},defaultMode:q1.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 X7(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(Aw,"IndentationAwareTokenBuilder"),Aw),Mw,mcr=(Mw=class extends Qre{constructor(e){if(super(e),e.parser.TokenBuilder instanceof bGe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Zre){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(Mw,"IndentationAwareLexer"),Mw),one={};hm(one,{AstUtils:()=>_ee,BiMap:()=>DI,Cancellation:()=>$i,ContextCache:()=>TP,CstUtils:()=>Aee,DONE_RESULT:()=>pl,Deferred:()=>D0,Disposable:()=>sy,DisposableCache:()=>wP,DocumentCache:()=>HHe,EMPTY_STREAM:()=>L5,ErrorWithLocation:()=>MO,GrammarUtils:()=>ate,MultiMap:()=>O0,OperationCancelled:()=>xd,Reduction:()=>rE,RegExpUtils:()=>lte,SimpleCache:()=>Ure,StreamImpl:()=>bd,TreeStreamImpl:()=>I5,URI:()=>Hc,UriTrie:()=>Wre,UriUtils:()=>Sl,WorkspaceCache:()=>Yre,assertCondition:()=>ote,assertUnreachable:()=>dm,delayNextTick:()=>bP,interruptAndCheck:()=>Va,isOperationCancelled:()=>Rv,loadGrammarFromJson:()=>so,setInterruptionPeriod:()=>Vre,startCancelableOperation:()=>xP,stream:()=>yi});yO(one,CP);var Rw,xGe=(Rw=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(Rw,"EmptyFileSystemProvider"),Rw),Lo={fileSystemProvider:M(()=>new xGe,"fileSystemProvider")},ycr={Grammar:M(()=>{},"Grammar"),LanguageMetaData:M(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},vcr={AstReflection:M(()=>new Zee,"AstReflection")};function wGe(){const t=Hn(io(Lo),vcr),e=Hn(no({shared:t}),ycr);return t.ServiceRegistry.register(e),e}M(wGe,"createMinimalGrammarServices");function so(t){const e=wGe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Hc.parse(`memory:/${r.name??"grammar"}.langium`)),r}M(so,"loadGrammarFromJson");yO(IIe,one);var _w,bcr=(_w=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 TGe(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(_w,"DefaultLangiumProfiler"),_w),Lw,TGe=(Lw=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(Lw,"ProfilingTask"),Lw),VY;(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]+)\]/}})(VY||(VY={}));var HY;(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]*/}})(HY||(HY={}));var GY;(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]*/}})(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]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(WY||(WY={}));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]*|)/,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={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]*/}})(UY||(UY={}));var YY;(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]*/}})(YY||(YY={}));var jY;(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]*/}})(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*{([^}]*)})/,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]*/}})(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*{([^}]*)})/,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]*?\*\)/}})(KY||(KY={}));var ZY;(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]*?\*\//}})(ZY||(ZY={}));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*{([^}]*)})/,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]*/}})(QY||(QY={}));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]*|)/,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:/"[^"]*"|'[^']*'/}})(JY||(JY={}));var ej;(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])*/}})(ej||(ej={}));var tj;(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]*/}})(tj||(tj={}));({...VY.Terminals,...HY.Terminals,...GY.Terminals,...WY.Terminals,...qY.Terminals,...UY.Terminals,...YY.Terminals,...jY.Terminals,...XY.Terminals,...KY.Terminals,...ZY.Terminals,...QY.Terminals,...ej.Terminals,...JY.Terminals,...tj.Terminals});var Ime={$type:"AbnfAlternation",alternatives:"alternatives"},Nme={$type:"AbnfConcatenation",elements:"elements"},Jz={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Dme={$type:"AbnfGroup",element:"element"},Ome={$type:"AbnfNumVal",value:"value"},Pme={$type:"AbnfOptionalGroup",element:"element"},i2={$type:"AbnfPrimary"},eV={$type:"AbnfRule",definition:"definition",name:"name"},$me={$type:"AbnfRuleName",name:"name"},Bme={$type:"AbnfStringLiteral",value:"value"},X8={$type:"Accelerator",name:"name",x:"x",y:"y"},tV={$type:"Alignment",direction:"direction",members:"members"},K8={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},AC={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},rV={$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 xcr(t){return Qs.isInstance(t,Kh.$type)}M(xcr,"isArchitecture");var Z8={$type:"Axis",label:"label",name:"name"},PR={$type:"Branch",name:"name",order:"order"};function wcr(t){return Qs.isInstance(t,PR.$type)}M(wcr,"isBranch");var Fme={$type:"Checkout",branch:"branch"},Q8={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},nV={$type:"ClassDefStatement",className:"className",styleText:"styleText"},O2={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Tcr(t){return Qs.isInstance(t,O2.$type)}M(Tcr,"isCommit");var J8={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Bm={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},eM={$type:"Curve",entries:"entries",label:"label",name:"name"},s1={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Ccr(t){return Qs.isInstance(t,s1.$type)}M(Ccr,"isCynefin");var tM={$type:"Deaccelerator",name:"name",x:"x",y:"y"},zme={$type:"Decorator",strategy:"strategy"},s2={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},$R={$type:"DomainBlock",domain:"domain",items:"items"};function kcr(t){return Qs.isInstance(t,$R.$type)}M(kcr,"isDomainBlock");var rj={$type:"DomainItem",label:"label"};function Scr(t){return Qs.isInstance(t,rj.$type)}M(Scr,"isDomainItem");var Vme={$type:"EbnfChoice",alternatives:"alternatives"},Hme={$type:"EbnfExceptionPostfix",except:"except"},Gme={$type:"EbnfGroup",element:"element"},Wme={$type:"EbnfNonTerminal",name:"name"},qme={$type:"EbnfOneOrMorePostfix",operator:"operator"},Ume={$type:"EbnfOptional",element:"element"},Yme={$type:"EbnfOptionalPostfix",operator:"operator"},MC={$type:"EbnfPostfix"},Fm={$type:"EbnfPrimary"},jme={$type:"EbnfRepetition",element:"element"},iV={$type:"EbnfRule",definition:"definition",name:"name"},Xme={$type:"EbnfSequence",elements:"elements"},Kme={$type:"EbnfSpecial",text:"text"},sV={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Zme={$type:"EbnfTerminal",value:"value"},Qme={$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"},a2={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},zm={$type:"EmFrame"},RC={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Jme={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},aV={$type:"EmModelEntity",name:"name"};function Ecr(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}M(Ecr,"isEmModelEntityType");var rM={$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 CGe(t){return Qs.isInstance(t,Sf.$type)}M(CGe,"isEmResetFrame");var bp={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},oV={$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"},e1e={$type:"Evolution",stages:"stages"},nM={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},lV={$type:"Evolve",component:"component",target:"target"},a1={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Acr(t){return Qs.isInstance(t,a1.$type)}M(Acr,"isGitGraph");var _C={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ek={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Mcr(t){return Qs.isInstance(t,Ek.$type)}M(Mcr,"isInfo");var LC={$type:"Item",classSelector:"classSelector",name:"name"},cV={$type:"Junction",id:"id",in:"in"},IC={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},iM={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},Vm={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},P2={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Rcr(t){return Qs.isInstance(t,P2.$type)}M(Rcr,"isMerge");var sM={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},uV={$type:"Option",name:"name",value:"value"},$2={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function _cr(t){return Qs.isInstance(t,$2.$type)}M(_cr,"isPacket");var B2={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function Lcr(t){return Qs.isInstance(t,B2.$type)}M(Lcr,"isPacketBlock");var t1e={$type:"PegAny",dot:"dot"},r1e={$type:"PegGroup",element:"element"},n1e={$type:"PegIdentifier",name:"name"},i1e={$type:"PegLiteral",value:"value"},s1e={$type:"PegOrderedChoice",alternatives:"alternatives"},hV={$type:"PegPrefix",operator:"operator",suffix:"suffix"},NC={$type:"PegPrimary"},dV={$type:"PegRule",definition:"definition",name:"name"},a1e={$type:"PegSequence",elements:"elements"},fV={$type:"PegSuffix",operator:"operator",primary:"primary"},o1={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Icr(t){return Qs.isInstance(t,o1.$type)}M(Icr,"isPie");var BR={$type:"PieSection",label:"label",value:"value"};function Ncr(t){return Qs.isInstance(t,BR.$type)}M(Ncr,"isPieSection");var pV={$type:"Pipeline",components:"components",parent:"parent"},aM={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Hm={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},F2={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Dcr(t){return Qs.isInstance(t,F2.$type)}M(Dcr,"isRailroad");var z2={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Ocr(t){return Qs.isInstance(t,z2.$type)}M(Ocr,"isRailroadAbnf");var o1e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},V2={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Pcr(t){return Qs.isInstance(t,V2.$type)}M(Pcr,"isRailroadEbnf");var yf={$type:"RailroadExpression"},l1e={$type:"RailroadNonTerminalExpr",name:"name"},c1e={$type:"RailroadOneOrMoreExpr",element:"element"},u1e={$type:"RailroadOptionalExpr",element:"element"},H2={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function $cr(t){return Qs.isInstance(t,H2.$type)}M($cr,"isRailroadPeg");var gV={$type:"RailroadRule",definition:"definition",name:"name"},h1e={$type:"RailroadSequenceExpr",elements:"elements"},d1e={$type:"RailroadSpecialExpr",text:"text"},f1e={$type:"RailroadTerminalExpr",value:"value"},p1e={$type:"RailroadZeroOrMoreExpr",element:"element"},mV={$type:"Section",classSelector:"classSelector",name:"name"},o2={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},yV={$type:"Size",height:"height",width:"width"},l2={$type:"Statement"},Ak={$type:"Transition",from:"from",label:"label",to:"to"};function Bcr(t){return Qs.isInstance(t,Ak.$type)}M(Bcr,"isTransition");var G2={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function Fcr(t){return Qs.isInstance(t,G2.$type)}M(Fcr,"isTreemap");var vV={$type:"TreemapRow",indent:"indent",item:"item"},c2={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},DC={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},fo={$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 zcr(t){return Qs.isInstance(t,fo.$type)}M(zcr,"isWardley");var Iw,kGe=(Iw=class extends Ree{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Ime.$type,properties:{alternatives:{name:Ime.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Nme.$type,properties:{elements:{name:Nme.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Jz.$type,properties:{primary:{name:Jz.primary},repeat:{name:Jz.repeat}},superTypes:[]},AbnfGroup:{name:Dme.$type,properties:{element:{name:Dme.element}},superTypes:[i2.$type]},AbnfNumVal:{name:Ome.$type,properties:{value:{name:Ome.value}},superTypes:[i2.$type]},AbnfOptionalGroup:{name:Pme.$type,properties:{element:{name:Pme.element}},superTypes:[i2.$type]},AbnfPrimary:{name:i2.$type,properties:{},superTypes:[]},AbnfRule:{name:eV.$type,properties:{definition:{name:eV.definition},name:{name:eV.name}},superTypes:[]},AbnfRuleName:{name:$me.$type,properties:{name:{name:$me.name}},superTypes:[i2.$type]},AbnfStringLiteral:{name:Bme.$type,properties:{value:{name:Bme.value}},superTypes:[i2.$type]},Accelerator:{name:X8.$type,properties:{name:{name:X8.name},x:{name:X8.x},y:{name:X8.y}},superTypes:[]},Alignment:{name:tV.$type,properties:{direction:{name:tV.direction},members:{name:tV.members,defaultValue:[]}},superTypes:[]},Anchor:{name:K8.$type,properties:{evolution:{name:K8.evolution},name:{name:K8.name},visibility:{name:K8.visibility}},superTypes:[]},Annotation:{name:AC.$type,properties:{number:{name:AC.number},text:{name:AC.text},x:{name:AC.x},y:{name:AC.y}},superTypes:[]},Annotations:{name:rV.$type,properties:{x:{name:rV.x},y:{name:rV.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:Z8.$type,properties:{label:{name:Z8.label},name:{name:Z8.name}},superTypes:[]},Branch:{name:PR.$type,properties:{name:{name:PR.name},order:{name:PR.order}},superTypes:[l2.$type]},Checkout:{name:Fme.$type,properties:{branch:{name:Fme.branch}},superTypes:[l2.$type]},CherryPicking:{name:Q8.$type,properties:{id:{name:Q8.id},parent:{name:Q8.parent},tags:{name:Q8.tags,defaultValue:[]}},superTypes:[l2.$type]},ClassDefStatement:{name:nV.$type,properties:{className:{name:nV.className},styleText:{name:nV.styleText}},superTypes:[]},Commit:{name:O2.$type,properties:{id:{name:O2.id},message:{name:O2.message},tags:{name:O2.tags,defaultValue:[]},type:{name:O2.type}},superTypes:[l2.$type]},Common:{name:J8.$type,properties:{accDescr:{name:J8.accDescr},accTitle:{name:J8.accTitle},title:{name:J8.title}},superTypes:[]},Component:{name:Bm.$type,properties:{decorator:{name:Bm.decorator},evolution:{name:Bm.evolution},inertia:{name:Bm.inertia,defaultValue:!1},label:{name:Bm.label},name:{name:Bm.name},visibility:{name:Bm.visibility}},superTypes:[]},Curve:{name:eM.$type,properties:{entries:{name:eM.entries,defaultValue:[]},label:{name:eM.label},name:{name:eM.name}},superTypes:[]},Cynefin:{name:s1.$type,properties:{accDescr:{name:s1.accDescr},accTitle:{name:s1.accTitle},domains:{name:s1.domains,defaultValue:[]},title:{name:s1.title},transitions:{name:s1.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:tM.$type,properties:{name:{name:tM.name},x:{name:tM.x},y:{name:tM.y}},superTypes:[]},Decorator:{name:zme.$type,properties:{strategy:{name:zme.strategy}},superTypes:[]},Direction:{name:s2.$type,properties:{accDescr:{name:s2.accDescr},accTitle:{name:s2.accTitle},dir:{name:s2.dir},statements:{name:s2.statements,defaultValue:[]},title:{name:s2.title}},superTypes:[a1.$type]},DomainBlock:{name:$R.$type,properties:{domain:{name:$R.domain},items:{name:$R.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:rj.$type,properties:{label:{name:rj.label}},superTypes:[]},EbnfChoice:{name:Vme.$type,properties:{alternatives:{name:Vme.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Hme.$type,properties:{except:{name:Hme.except}},superTypes:[MC.$type]},EbnfGroup:{name:Gme.$type,properties:{element:{name:Gme.element}},superTypes:[Fm.$type]},EbnfNonTerminal:{name:Wme.$type,properties:{name:{name:Wme.name}},superTypes:[Fm.$type]},EbnfOneOrMorePostfix:{name:qme.$type,properties:{operator:{name:qme.operator}},superTypes:[MC.$type]},EbnfOptional:{name:Ume.$type,properties:{element:{name:Ume.element}},superTypes:[Fm.$type]},EbnfOptionalPostfix:{name:Yme.$type,properties:{operator:{name:Yme.operator}},superTypes:[MC.$type]},EbnfPostfix:{name:MC.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Fm.$type,properties:{},superTypes:[]},EbnfRepetition:{name:jme.$type,properties:{element:{name:jme.element}},superTypes:[Fm.$type]},EbnfRule:{name:iV.$type,properties:{definition:{name:iV.definition},name:{name:iV.name}},superTypes:[]},EbnfSequence:{name:Xme.$type,properties:{elements:{name:Xme.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Kme.$type,properties:{text:{name:Kme.text}},superTypes:[Fm.$type]},EbnfTerm:{name:sV.$type,properties:{base:{name:sV.base},postfixes:{name:sV.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Zme.$type,properties:{value:{name:Zme.value}},superTypes:[Fm.$type]},EbnfZeroOrMorePostfix:{name:Qme.$type,properties:{operator:{name:Qme.operator}},superTypes:[MC.$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:a2.$type,properties:{dataBlockValue:{name:a2.dataBlockValue},dataType:{name:a2.dataType},name:{name:a2.name}},superTypes:[]},EmFrame:{name:zm.$type,properties:{},superTypes:[]},EmGwt:{name:RC.$type,properties:{givenStatements:{name:RC.givenStatements,defaultValue:[]},sourceFrame:{name:RC.sourceFrame,referenceType:zm.$type},thenStatements:{name:RC.thenStatements,defaultValue:[]},whenStatements:{name:RC.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Jme.$type,properties:{entityIdentifier:{name:Jme.entityIdentifier,referenceType:aV.$type}},superTypes:[]},EmModelEntity:{name:aV.$type,properties:{name:{name:aV.name}},superTypes:[]},EmNoteEntity:{name:rM.$type,properties:{dataBlockValue:{name:rM.dataBlockValue},dataType:{name:rM.dataType},sourceFrame:{name:rM.sourceFrame,referenceType:zm.$type}},superTypes:[]},EmResetFrame:{name:Sf.$type,properties:{dataInlineValue:{name:Sf.dataInlineValue},dataReference:{name:Sf.dataReference,referenceType:a2.$type},dataType:{name:Sf.dataType},entityIdentifier:{name:Sf.entityIdentifier},modelEntityType:{name:Sf.modelEntityType},name:{name:Sf.name},sourceFrames:{name:Sf.sourceFrames,defaultValue:[],referenceType:zm.$type}},superTypes:[zm.$type]},EmTimeFrame:{name:bp.$type,properties:{dataInlineValue:{name:bp.dataInlineValue},dataReference:{name:bp.dataReference,referenceType:a2.$type},dataType:{name:bp.dataType},entityIdentifier:{name:bp.entityIdentifier},modelEntityType:{name:bp.modelEntityType},name:{name:bp.name},sourceFrames:{name:bp.sourceFrames,defaultValue:[],referenceType:zm.$type}},superTypes:[zm.$type]},Entry:{name:oV.$type,properties:{axis:{name:oV.axis,referenceType:Z8.$type},value:{name:oV.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:e1e.$type,properties:{stages:{name:e1e.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:nM.$type,properties:{boundary:{name:nM.boundary},name:{name:nM.name},secondName:{name:nM.secondName}},superTypes:[]},Evolve:{name:lV.$type,properties:{component:{name:lV.component},target:{name:lV.target}},superTypes:[]},GitGraph:{name:a1.$type,properties:{accDescr:{name:a1.accDescr},accTitle:{name:a1.accTitle},statements:{name:a1.statements,defaultValue:[]},title:{name:a1.title}},superTypes:[]},Group:{name:_C.$type,properties:{icon:{name:_C.icon},id:{name:_C.id},in:{name:_C.in},title:{name:_C.title}},superTypes:[]},Info:{name:Ek.$type,properties:{accDescr:{name:Ek.accDescr},accTitle:{name:Ek.accTitle},title:{name:Ek.title}},superTypes:[]},Item:{name:LC.$type,properties:{classSelector:{name:LC.classSelector},name:{name:LC.name}},superTypes:[]},Junction:{name:cV.$type,properties:{id:{name:cV.id},in:{name:cV.in}},superTypes:[]},Label:{name:IC.$type,properties:{negX:{name:IC.negX,defaultValue:!1},negY:{name:IC.negY,defaultValue:!1},offsetX:{name:IC.offsetX},offsetY:{name:IC.offsetY}},superTypes:[]},Leaf:{name:iM.$type,properties:{classSelector:{name:iM.classSelector},name:{name:iM.name},value:{name:iM.value}},superTypes:[LC.$type]},Link:{name:Vm.$type,properties:{arrow:{name:Vm.arrow},from:{name:Vm.from},fromPort:{name:Vm.fromPort},linkLabel:{name:Vm.linkLabel},to:{name:Vm.to},toPort:{name:Vm.toPort}},superTypes:[]},Merge:{name:P2.$type,properties:{branch:{name:P2.branch},id:{name:P2.id},tags:{name:P2.tags,defaultValue:[]},type:{name:P2.type}},superTypes:[l2.$type]},Note:{name:sM.$type,properties:{evolution:{name:sM.evolution},text:{name:sM.text},visibility:{name:sM.visibility}},superTypes:[]},Option:{name:uV.$type,properties:{name:{name:uV.name},value:{name:uV.value,defaultValue:!1}},superTypes:[]},Packet:{name:$2.$type,properties:{accDescr:{name:$2.accDescr},accTitle:{name:$2.accTitle},blocks:{name:$2.blocks,defaultValue:[]},title:{name:$2.title}},superTypes:[]},PacketBlock:{name:B2.$type,properties:{bits:{name:B2.bits},end:{name:B2.end},label:{name:B2.label},start:{name:B2.start}},superTypes:[]},PegAny:{name:t1e.$type,properties:{dot:{name:t1e.dot}},superTypes:[NC.$type]},PegGroup:{name:r1e.$type,properties:{element:{name:r1e.element}},superTypes:[NC.$type]},PegIdentifier:{name:n1e.$type,properties:{name:{name:n1e.name}},superTypes:[NC.$type]},PegLiteral:{name:i1e.$type,properties:{value:{name:i1e.value}},superTypes:[NC.$type]},PegOrderedChoice:{name:s1e.$type,properties:{alternatives:{name:s1e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:hV.$type,properties:{operator:{name:hV.operator},suffix:{name:hV.suffix}},superTypes:[]},PegPrimary:{name:NC.$type,properties:{},superTypes:[]},PegRule:{name:dV.$type,properties:{definition:{name:dV.definition},name:{name:dV.name}},superTypes:[]},PegSequence:{name:a1e.$type,properties:{elements:{name:a1e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:fV.$type,properties:{operator:{name:fV.operator},primary:{name:fV.primary}},superTypes:[]},Pie:{name:o1.$type,properties:{accDescr:{name:o1.accDescr},accTitle:{name:o1.accTitle},sections:{name:o1.sections,defaultValue:[]},showData:{name:o1.showData,defaultValue:!1},title:{name:o1.title}},superTypes:[]},PieSection:{name:BR.$type,properties:{label:{name:BR.label},value:{name:BR.value}},superTypes:[]},Pipeline:{name:pV.$type,properties:{components:{name:pV.components,defaultValue:[]},parent:{name:pV.parent}},superTypes:[]},PipelineComponent:{name:aM.$type,properties:{evolution:{name:aM.evolution},label:{name:aM.label},name:{name:aM.name}},superTypes:[]},Radar:{name:Hm.$type,properties:{accDescr:{name:Hm.accDescr},accTitle:{name:Hm.accTitle},axes:{name:Hm.axes,defaultValue:[]},curves:{name:Hm.curves,defaultValue:[]},options:{name:Hm.options,defaultValue:[]},title:{name:Hm.title}},superTypes:[]},Railroad:{name:F2.$type,properties:{accDescr:{name:F2.accDescr},accTitle:{name:F2.accTitle},rules:{name:F2.rules,defaultValue:[]},title:{name:F2.title}},superTypes:[]},RailroadAbnf:{name:z2.$type,properties:{accDescr:{name:z2.accDescr},accTitle:{name:z2.accTitle},rules:{name:z2.rules,defaultValue:[]},title:{name:z2.title}},superTypes:[]},RailroadChoiceExpr:{name:o1e.$type,properties:{alternatives:{name:o1e.alternatives,defaultValue:[]}},superTypes:[yf.$type]},RailroadEbnf:{name:V2.$type,properties:{accDescr:{name:V2.accDescr},accTitle:{name:V2.accTitle},rules:{name:V2.rules,defaultValue:[]},title:{name:V2.title}},superTypes:[]},RailroadExpression:{name:yf.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:l1e.$type,properties:{name:{name:l1e.name}},superTypes:[yf.$type]},RailroadOneOrMoreExpr:{name:c1e.$type,properties:{element:{name:c1e.element}},superTypes:[yf.$type]},RailroadOptionalExpr:{name:u1e.$type,properties:{element:{name:u1e.element}},superTypes:[yf.$type]},RailroadPeg:{name:H2.$type,properties:{accDescr:{name:H2.accDescr},accTitle:{name:H2.accTitle},rules:{name:H2.rules,defaultValue:[]},title:{name:H2.title}},superTypes:[]},RailroadRule:{name:gV.$type,properties:{definition:{name:gV.definition},name:{name:gV.name}},superTypes:[]},RailroadSequenceExpr:{name:h1e.$type,properties:{elements:{name:h1e.elements,defaultValue:[]}},superTypes:[yf.$type]},RailroadSpecialExpr:{name:d1e.$type,properties:{text:{name:d1e.text}},superTypes:[yf.$type]},RailroadTerminalExpr:{name:f1e.$type,properties:{value:{name:f1e.value}},superTypes:[yf.$type]},RailroadZeroOrMoreExpr:{name:p1e.$type,properties:{element:{name:p1e.element}},superTypes:[yf.$type]},Section:{name:mV.$type,properties:{classSelector:{name:mV.classSelector},name:{name:mV.name}},superTypes:[LC.$type]},Service:{name:o2.$type,properties:{icon:{name:o2.icon},iconText:{name:o2.iconText},id:{name:o2.id},in:{name:o2.in},title:{name:o2.title}},superTypes:[]},Size:{name:yV.$type,properties:{height:{name:yV.height},width:{name:yV.width}},superTypes:[]},Statement:{name:l2.$type,properties:{},superTypes:[]},Transition:{name:Ak.$type,properties:{from:{name:Ak.from},label:{name:Ak.label},to:{name:Ak.to}},superTypes:[]},TreeNode:{name:c2.$type,properties:{classAnnotation:{name:c2.classAnnotation},descAnnotation:{name:c2.descAnnotation},iconAnnotation:{name:c2.iconAnnotation},indent:{name:c2.indent},name:{name:c2.name}},superTypes:[]},TreeView:{name:DC.$type,properties:{accDescr:{name:DC.accDescr},accTitle:{name:DC.accTitle},nodes:{name:DC.nodes,defaultValue:[]},title:{name:DC.title}},superTypes:[]},Treemap:{name:G2.$type,properties:{accDescr:{name:G2.accDescr},accTitle:{name:G2.accTitle},title:{name:G2.title},TreemapRows:{name:G2.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:vV.$type,properties:{indent:{name:vV.indent},item:{name:vV.item}},superTypes:[]},Wardley:{name:fo.$type,properties:{accDescr:{name:fo.accDescr},accelerators:{name:fo.accelerators,defaultValue:[]},accTitle:{name:fo.accTitle},anchors:{name:fo.anchors,defaultValue:[]},annotation:{name:fo.annotation,defaultValue:[]},annotations:{name:fo.annotations,defaultValue:[]},components:{name:fo.components,defaultValue:[]},deaccelerators:{name:fo.deaccelerators,defaultValue:[]},evolution:{name:fo.evolution},evolves:{name:fo.evolves,defaultValue:[]},links:{name:fo.links,defaultValue:[]},notes:{name:fo.notes,defaultValue:[]},pipelines:{name:fo.pipelines,defaultValue:[]},size:{name:fo.size},title:{name:fo.title}},superTypes:[]}}}},M(Iw,"MermaidAstReflection"),Iw),Qs=new kGe,g1e,Vcr=M(()=>g1e??(g1e=so(`{"$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"),m1e,Hcr=M(()=>m1e??(m1e=so(`{"$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"),y1e,Gcr=M(()=>y1e??(y1e=so('{"$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"),v1e,Wcr=M(()=>v1e??(v1e=so(`{"$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"),b1e,qcr=M(()=>b1e??(b1e=so(`{"$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"),x1e,Ucr=M(()=>x1e??(x1e=so(`{"$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"),w1e,Ycr=M(()=>w1e??(w1e=so(`{"$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"),T1e,jcr=M(()=>T1e??(T1e=so(`{"$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"),C1e,Xcr=M(()=>C1e??(C1e=so('{"$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"),k1e,Kcr=M(()=>k1e??(k1e=so(`{"$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"),S1e,Zcr=M(()=>S1e??(S1e=so(`{"$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"),E1e,Qcr=M(()=>E1e??(E1e=so(`{"$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"),A1e,Jcr=M(()=>A1e??(A1e=so(`{"$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"),M1e,eur=M(()=>M1e??(M1e=so(`{"$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"),R1e,tur=M(()=>R1e??(R1e=so(`{"$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"),rur={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nur={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iur={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sur={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},aur={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},our={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},lur={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cur={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},uur={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hur={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dur={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fur={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pur={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gur={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mur={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wl={AstReflection:M(()=>new kGe,"AstReflection")},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={Grammar:M(()=>Kcr(),"Grammar"),LanguageMetaData:M(()=>hur,"LanguageMetaData"),parser:{}},Aur={Grammar:M(()=>Zcr(),"Grammar"),LanguageMetaData:M(()=>dur,"LanguageMetaData"),parser:{}},Mur={Grammar:M(()=>Qcr(),"Grammar"),LanguageMetaData:M(()=>fur,"LanguageMetaData"),parser:{}},Rur={Grammar:M(()=>Jcr(),"Grammar"),LanguageMetaData:M(()=>pur,"LanguageMetaData"),parser:{}},_ur={Grammar:M(()=>eur(),"Grammar"),LanguageMetaData:M(()=>gur,"LanguageMetaData"),parser:{}},Lur={Grammar:M(()=>tur(),"Grammar"),LanguageMetaData:M(()=>mur,"LanguageMetaData"),parser:{}},Iur=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Nur=/accTitle[\t ]*:([^\n\r]*)/,Dur=/title([\t ][^\n\r]*|)/,Our={ACC_DESCR:Iur,ACC_TITLE:Nur,TITLE:Dur},Nw,sf=(Nw=class extends zre{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=Our[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(Nw,"AbstractMermaidValueConverter"),Nw),Dw,z3=(Dw=class extends sf{runCustomConverter(e,r,n){}},M(Dw,"CommonValueConverter"),Dw),Ow,ql=(Ow=class extends vP{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(Ow,"AbstractMermaidTokenBuilder"),Ow),Pw;Pw=class extends ql{},M(Pw,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: @@ -3584,12 +3584,12 @@ lodash-es/lodash.js: * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) -*/var $w,Our=($w=class extends ql{constructor(){super(["radar-beta"])}},M($w,"RadarTokenBuilder"),$w),kGe={parser:{TokenBuilder:M(()=>new Our,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function SGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Cur,kGe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}M(SGe,"createRadarServices");var Bw,Pur=(Bw=class extends ql{constructor(){super(["railroad-beta"])}},M(Bw,"RailroadTokenBuilder"),Bw),R1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Pur,"TokenBuilder"),ValueConverter:M(()=>new $ur,"ValueConverter")}};function lne(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Eur,EGe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}M(lne,"createRailroadServices");var zw,Bur=(zw=class extends ql{constructor(){super(["railroad-ebnf-beta"])}},M(zw,"RailroadEbnfTokenBuilder"),zw),_1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Bur,"TokenBuilder"),ValueConverter:M(()=>new Fur,"ValueConverter")}};function cne(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Sur,AGe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}M(cne,"createRailroadEbnfServices");var Hw,zur=(Hw=class extends ql{constructor(){super(["railroad-abnf-beta"])}},M(Hw,"RailroadAbnfTokenBuilder"),Hw),Gw,Vur=(Gw=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(Gw,"RailroadAbnfValueConverter"),Gw),MGe={parser:{TokenBuilder:M(()=>new zur,"TokenBuilder"),ValueConverter:M(()=>new Vur,"ValueConverter")}};function une(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),kur,MGe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}M(une,"createRailroadAbnfServices");var Ww,Hur=(Ww=class extends ql{constructor(){super(["railroad-peg-beta"])}},M(Ww,"RailroadPegTokenBuilder"),Ww),L1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Hur,"TokenBuilder"),ValueConverter:M(()=>new Gur,"ValueConverter")}};function hne(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Aur,RGe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(hne,"createRailroadPegServices");var Uw,Wur=(Uw=class extends ql{constructor(){super(["treemap"])}},M(Uw,"TreemapTokenBuilder"),Uw),qur=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Yw,Uur=(Yw=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=qur.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(Yw,"TreemapValueConverter"),Yw);function _Ge(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(_Ge,"registerValidationChecks");var jw,Yur=(jw=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(jw,"TreemapValidator"),jw),LGe={parser:{TokenBuilder:M(()=>new Wur,"TokenBuilder"),ValueConverter:M(()=>new Uur,"ValueConverter")},validation:{TreemapValidator:M(()=>new Yur,"TreemapValidator")}};function IGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Mur,LGe);return e.ServiceRegistry.register(r),_Ge(r),{shared:e,Treemap:r}}M(IGe,"createTreemapServices");var Xw,jur=(Xw=class extends sf{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(Xw,"WardleyValueConverter"),Xw),NGe={parser:{ValueConverter:M(()=>new jur,"ValueConverter")}};function DGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),_ur,NGe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(DGe,"createWardleyServices");var Kw,Xur=(Kw=class extends ql{constructor(){super(["cynefin-beta"])}},M(Kw,"CynefinTokenBuilder"),Kw),OGe={parser:{TokenBuilder:M(()=>new Xur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function PGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),yur,OGe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M(PGe,"createCynefinServices");var Zw,Kur=(Zw=class extends ql{constructor(){super(["gitGraph"])}},M(Zw,"GitGraphTokenBuilder"),Zw),$Ge={parser:{TokenBuilder:M(()=>new Kur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function BGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),bur,$Ge);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(BGe,"createGitGraphServices");var Qw,Zur=(Qw=class extends ql{constructor(){super(["info","showInfo"])}},M(Qw,"InfoTokenBuilder"),Qw),FGe={parser:{TokenBuilder:M(()=>new Zur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function zGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),xur,FGe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(zGe,"createInfoServices");var Jw,Qur=(Jw=class extends ql{constructor(){super(["packet"])}},M(Jw,"PacketTokenBuilder"),Jw),VGe={parser:{TokenBuilder:M(()=>new Qur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function HGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),wur,VGe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(HGe,"createPacketServices");var eT,Jur=(eT=class extends ql{constructor(){super(["pie","showData"])}},M(eT,"PieTokenBuilder"),eT),tT,ehr=(tT=class extends sf{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(tT,"PieValueConverter"),tT),GGe={parser:{TokenBuilder:M(()=>new Jur,"TokenBuilder"),ValueConverter:M(()=>new ehr,"ValueConverter")}};function WGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Tur,GGe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(WGe,"createPieServices");var rT,thr=(rT=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(rT,"TreeViewValueConverter"),rT),nT,rhr=(nT=class extends ql{constructor(){super(["treeView-beta"])}},M(nT,"TreeViewTokenBuilder"),nT),qGe={parser:{TokenBuilder:M(()=>new rhr,"TokenBuilder"),ValueConverter:M(()=>new thr,"ValueConverter")}};function UGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Rur,qGe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(UGe,"createTreeViewServices");var iT,nhr=(iT=class extends ql{constructor(){super(["architecture"])}},M(iT,"ArchitectureTokenBuilder"),iT),sT,ihr=(sT=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(sT,"ArchitectureValueConverter"),sT),YGe={parser:{TokenBuilder:M(()=>new nhr,"TokenBuilder"),ValueConverter:M(()=>new ihr,"ValueConverter")}};function jGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),mur,YGe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(jGe,"createArchitectureServices");var aT,shr=(aT=class extends ql{constructor(){super(["eventmodeling"])}},M(aT,"EventModelingTokenBuilder"),aT),I1e=new Set(["cmd","command"]),N1e=new Set(["evt","event"]),bV=new Set(["rmo","readmodel"]),D1e=new Set(["pcr","processor"]),O1e=new Set(["ui"]);function XGe(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(XGe,"registerValidationChecks");var oT,ahr=(oT=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(I1e.has(e.modelEntityType)?this.validateSources(e,new Set([...O1e,...D1e]),"command","ui or processor",r):N1e.has(e.modelEntityType)?this.validateSources(e,I1e,"event","command",r):bV.has(e.modelEntityType)?this.validateSources(e,N1e,"read model","event",r):D1e.has(e.modelEntityType)?this.validateSources(e,bV,"processor","read model",r):O1e.has(e.modelEntityType)&&this.validateSources(e,bV,"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(oT,"EventModelingValidator"),oT),KGe={parser:{TokenBuilder:M(()=>new shr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")},validation:{EventModelingValidator:M(()=>new ahr,"EventModelingValidator")}};function ZGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),vur,KGe);return e.ServiceRegistry.register(r),XGe(r),{shared:e,EventModel:r}}M(ZGe,"createEventModelingServices");var go={},ohr={info:M(async()=>{const{createInfoServices:t}=await Rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>V4r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;go.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>H4r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;go.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>G4r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;go.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>W4r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;go.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>q4r);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;go.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>U4r);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;go.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Rr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Y4r);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;go.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>j4r);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;go.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Rr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>X4r);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;go.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Rr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>K4r);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;go.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Rr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Z4r);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;go.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Rr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>Q4r);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;go.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;go.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>ewr);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;go.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Rr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>twr);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;go.cynefin=e},"cynefin")};async function zu(t,e){const r=ohr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);go[t]||await r();const i=go[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new J7(i);return i.value}M(zu,"parse");var lT,J7=(lT=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 $w,Pur=($w=class extends ql{constructor(){super(["radar-beta"])}},M($w,"RadarTokenBuilder"),$w),SGe={parser:{TokenBuilder:M(()=>new Pur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function EGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),kur,SGe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}M(EGe,"createRadarServices");var Bw,$ur=(Bw=class extends ql{constructor(){super(["railroad-beta"])}},M(Bw,"RailroadTokenBuilder"),Bw),_1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew $ur,"TokenBuilder"),ValueConverter:M(()=>new Bur,"ValueConverter")}};function lne(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Aur,AGe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}M(lne,"createRailroadServices");var zw,Fur=(zw=class extends ql{constructor(){super(["railroad-ebnf-beta"])}},M(zw,"RailroadEbnfTokenBuilder"),zw),L1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Fur,"TokenBuilder"),ValueConverter:M(()=>new zur,"ValueConverter")}};function cne(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Eur,MGe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}M(cne,"createRailroadEbnfServices");var Hw,Vur=(Hw=class extends ql{constructor(){super(["railroad-abnf-beta"])}},M(Hw,"RailroadAbnfTokenBuilder"),Hw),Gw,Hur=(Gw=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(Gw,"RailroadAbnfValueConverter"),Gw),RGe={parser:{TokenBuilder:M(()=>new Vur,"TokenBuilder"),ValueConverter:M(()=>new Hur,"ValueConverter")}};function une(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Sur,RGe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}M(une,"createRailroadAbnfServices");var Ww,Gur=(Ww=class extends ql{constructor(){super(["railroad-peg-beta"])}},M(Ww,"RailroadPegTokenBuilder"),Ww),I1e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Gur,"TokenBuilder"),ValueConverter:M(()=>new Wur,"ValueConverter")}};function hne(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Mur,_Ge);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(hne,"createRailroadPegServices");var Uw,qur=(Uw=class extends ql{constructor(){super(["treemap"])}},M(Uw,"TreemapTokenBuilder"),Uw),Uur=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Yw,Yur=(Yw=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=Uur.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(Yw,"TreemapValueConverter"),Yw);function LGe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(LGe,"registerValidationChecks");var jw,jur=(jw=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(jw,"TreemapValidator"),jw),IGe={parser:{TokenBuilder:M(()=>new qur,"TokenBuilder"),ValueConverter:M(()=>new Yur,"ValueConverter")},validation:{TreemapValidator:M(()=>new jur,"TreemapValidator")}};function NGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Rur,IGe);return e.ServiceRegistry.register(r),LGe(r),{shared:e,Treemap:r}}M(NGe,"createTreemapServices");var Xw,Xur=(Xw=class extends sf{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(Xw,"WardleyValueConverter"),Xw),DGe={parser:{ValueConverter:M(()=>new Xur,"ValueConverter")}};function OGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Lur,DGe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(OGe,"createWardleyServices");var Kw,Kur=(Kw=class extends ql{constructor(){super(["cynefin-beta"])}},M(Kw,"CynefinTokenBuilder"),Kw),PGe={parser:{TokenBuilder:M(()=>new Kur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function $Ge(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),vur,PGe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M($Ge,"createCynefinServices");var Zw,Zur=(Zw=class extends ql{constructor(){super(["gitGraph"])}},M(Zw,"GitGraphTokenBuilder"),Zw),BGe={parser:{TokenBuilder:M(()=>new Zur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function FGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),xur,BGe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(FGe,"createGitGraphServices");var Qw,Qur=(Qw=class extends ql{constructor(){super(["info","showInfo"])}},M(Qw,"InfoTokenBuilder"),Qw),zGe={parser:{TokenBuilder:M(()=>new Qur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function VGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),wur,zGe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(VGe,"createInfoServices");var Jw,Jur=(Jw=class extends ql{constructor(){super(["packet"])}},M(Jw,"PacketTokenBuilder"),Jw),HGe={parser:{TokenBuilder:M(()=>new Jur,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")}};function GGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Tur,HGe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(GGe,"createPacketServices");var eT,ehr=(eT=class extends ql{constructor(){super(["pie","showData"])}},M(eT,"PieTokenBuilder"),eT),tT,thr=(tT=class extends sf{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(tT,"PieValueConverter"),tT),WGe={parser:{TokenBuilder:M(()=>new ehr,"TokenBuilder"),ValueConverter:M(()=>new thr,"ValueConverter")}};function qGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),Cur,WGe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(qGe,"createPieServices");var rT,rhr=(rT=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(rT,"TreeViewValueConverter"),rT),nT,nhr=(nT=class extends ql{constructor(){super(["treeView-beta"])}},M(nT,"TreeViewTokenBuilder"),nT),UGe={parser:{TokenBuilder:M(()=>new nhr,"TokenBuilder"),ValueConverter:M(()=>new rhr,"ValueConverter")}};function YGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),_ur,UGe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(YGe,"createTreeViewServices");var iT,ihr=(iT=class extends ql{constructor(){super(["architecture"])}},M(iT,"ArchitectureTokenBuilder"),iT),sT,shr=(sT=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(sT,"ArchitectureValueConverter"),sT),jGe={parser:{TokenBuilder:M(()=>new ihr,"TokenBuilder"),ValueConverter:M(()=>new shr,"ValueConverter")}};function XGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),yur,jGe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(XGe,"createArchitectureServices");var aT,ahr=(aT=class extends ql{constructor(){super(["eventmodeling"])}},M(aT,"EventModelingTokenBuilder"),aT),N1e=new Set(["cmd","command"]),D1e=new Set(["evt","event"]),bV=new Set(["rmo","readmodel"]),O1e=new Set(["pcr","processor"]),P1e=new Set(["ui"]);function KGe(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(KGe,"registerValidationChecks");var oT,ohr=(oT=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(N1e.has(e.modelEntityType)?this.validateSources(e,new Set([...P1e,...O1e]),"command","ui or processor",r):D1e.has(e.modelEntityType)?this.validateSources(e,N1e,"event","command",r):bV.has(e.modelEntityType)?this.validateSources(e,D1e,"read model","event",r):O1e.has(e.modelEntityType)?this.validateSources(e,bV,"processor","read model",r):P1e.has(e.modelEntityType)&&this.validateSources(e,bV,"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(oT,"EventModelingValidator"),oT),ZGe={parser:{TokenBuilder:M(()=>new ahr,"TokenBuilder"),ValueConverter:M(()=>new z3,"ValueConverter")},validation:{EventModelingValidator:M(()=>new ohr,"EventModelingValidator")}};function QGe(t=Lo){const e=Hn(io(t),Wl),r=Hn(no({shared:e}),bur,ZGe);return e.ServiceRegistry.register(r),KGe(r),{shared:e,EventModel:r}}M(QGe,"createEventModelingServices");var go={},lhr={info:M(async()=>{const{createInfoServices:t}=await Rr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>H4r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;go.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Rr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>G4r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;go.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Rr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>W4r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;go.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Rr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>q4r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;go.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Rr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>U4r);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;go.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Rr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Y4r);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;go.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Rr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>j4r);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;go.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Rr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>X4r);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;go.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Rr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>K4r);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;go.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Rr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>Z4r);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;go.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Rr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Q4r);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;go.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Rr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>J4r);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;go.railroadPeg=e},"railroadPeg"),treemap:M(async()=>{const{createTreemapServices:t}=await Rr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>ewr);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;go.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Rr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>twr);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;go.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Rr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>rwr);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;go.cynefin=e},"cynefin")};async function zu(t,e){const r=lhr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);go[t]||await r();const i=go[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new J7(i);return i.value}M(zu,"parse");var lT,J7=(lT=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(lT,"MermaidParseError"),lT),Ci={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},lhr=Sn.gitGraph,_v=w(()=>es({...lhr,...br().gitGraph}),"getConfig"),Jt=new wee(()=>{const t=_v(),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 AP(){return YCe({length:7})}w(AP,"getID");function QGe(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(QGe,"uniqBy");var chr=w(function(t){Jt.records.direction=t},"setDirection"),uhr=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Jt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),hhr=w(function(){return Jt.records.options},"getOptions"),dhr=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=_v();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||Jt.records.seq+"-"+AP(),message:e,seq:Jt.records.seq++,type:n??Ci.NORMAL,tags:i??[],parents:Jt.records.head==null?[]:[Jt.records.head.id],branch:Jt.records.currBranch};Jt.records.head=a,de.info("main branch",s.mainBranchName),Jt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Jt.records.commits.set(a.id,a),Jt.records.branches.set(Jt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),fhr=w(function(t){let e=t.name;const r=t.order;if(e=Vt.sanitizeText(e,_v()),Jt.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}")`);Jt.records.branches.set(e,Jt.records.head!=null?Jt.records.head.id:null),Jt.records.branchConfig.set(e,{name:e,order:r}),JGe(e),de.debug("in createBranch")},"branch"),phr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=_v();e=Vt.sanitizeText(e,s),r&&(r=Vt.sanitizeText(r,s));const a=Jt.records.branches.get(Jt.records.currBranch),o=Jt.records.branches.get(e),l=a?Jt.records.commits.get(a):void 0,u=o?Jt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Jt.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 (${Jt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Jt.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&&Jt.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||`${Jt.records.seq}-${AP()}`,message:`merged branch ${e} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,h],branch:Jt.records.currBranch,type:Ci.MERGE,customType:n,customId:!!r,tags:i??[]};Jt.records.head=d,Jt.records.commits.set(d.id,d),Jt.records.branches.set(Jt.records.currBranch,d.id),de.debug(Jt.records.branches),de.debug("in mergeBranch")},"merge"),ghr=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=_v();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||!Jt.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=Jt.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||!Jt.records.commits.has(r)){if(o===Jt.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=Jt.records.branches.get(Jt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Jt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Jt.records.seq+"-"+AP(),message:`cherry-picked ${a==null?void 0:a.message} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,a.id],branch:Jt.records.currBranch,type:Ci.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ci.MERGE?`|parent:${i}`:""}`]};Jt.records.head=h,Jt.records.commits.set(h.id,h),Jt.records.branches.set(Jt.records.currBranch,h.id),de.debug(Jt.records.branches),de.debug("in cherryPick")}},"cherryPick"),JGe=w(function(t){if(t=Vt.sanitizeText(t,_v()),Jt.records.branches.has(t)){Jt.records.currBranch=t;const e=Jt.records.branches.get(Jt.records.currBranch);e===void 0||!e?Jt.records.head=null:Jt.records.head=Jt.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 nj(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(nj,"upsert");function dne(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 Jt.records.branches)Jt.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=Jt.records.commits.get(e.parents[0]);nj(t,e,i),e.parents[1]&&t.push(Jt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Jt.records.commits.get(e.parents[0]);nj(t,e,i)}}t=QGe(t,i=>i.id),dne(t)}w(dne,"prettyPrintCommitHistory");var mhr=w(function(){de.debug(Jt.records.commits);const t=eWe()[0];dne([t])},"prettyPrint"),yhr=w(function(){Jt.reset(),Ri()},"clear"),vhr=w(function(){return[...Jt.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"),bhr=w(function(){return Jt.records.branches},"getBranches"),xhr=w(function(){return Jt.records.commits},"getCommits"),eWe=w(function(){const t=[...Jt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),whr=w(function(){return Jt.records.currBranch},"getCurrentBranch"),Thr=w(function(){return Jt.records.direction},"getDirection"),Chr=w(function(){return Jt.records.head},"getHead"),tWe={commitType:Ci,getConfig:_v,setDirection:chr,setOptions:uhr,getOptions:hhr,commit:dhr,branch:fhr,merge:phr,cherryPick:ghr,checkout:JGe,prettyPrint:mhr,clear:yhr,getBranchesAsObjArray:vhr,getBranches:bhr,getCommits:xhr,getCommitsArray:eWe,getCurrentBranch:whr,getDirection:Thr,getHead:Chr,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi},khr=w((t,e)=>{Hl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Shr(r,e)},"populate"),Shr=w((t,e)=>{const n={Commit:w(i=>e.commit(Ehr(i)),"Commit"),Branch:w(i=>e.branch(Ahr(i)),"Branch"),Merge:w(i=>e.merge(Mhr(i)),"Merge"),Checkout:w(i=>e.checkout(Rhr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(_hr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ehr=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"),Mhr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ci[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Rhr=w(t=>t.branch,"parseCheckout"),_hr=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"),Lhr={parse:w(async t=>{const e=await zu("gitGraph",t);de.debug(e),khr(e,tWe)},"parse")},Kp=10,Zp=40,rd=4,Lf=2,A1=8,MP=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),ij=12,fne=new Set(["redux-color","redux-dark-color"]),Ihr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),M1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),cc=new Map,pc=new Map,BI=30,Mk=new Map,FI=[],If=0,In="LR",Nhr=w(()=>{cc.clear(),pc.clear(),Mk.clear(),If=0,FI=[],In="LR"},"clear"),rWe=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"),nWe=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=pc.get(i))==null?void 0:a.y:(o=pc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),Dhr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=pc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),Ohr=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=$hr(o),i=Math.max(n,i)):s.push(o),Bhr(o,n)}),n=i,s.forEach(a=>{Fhr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=Dhr(o.parents);n=pc.get(l).y-Zp,n<=i&&(i=n);const u=cc.get(o.branch).pos,h=n-Kp;pc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),Phr=w(t=>{var n;const e=nWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=pc.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"),$hr=w(t=>Phr(t)+Zp,"calculateCommitPosition"),Bhr=w((t,e)=>{const r=cc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Kp;return pc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Fhr=w((t,e,r)=>{const n=cc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;pc.set(t.id,{x:s,y:i})},"setRootPosition"),zhr=w((t,e,r,n,i,s)=>{const{theme:a}=Ve(),o=MP.has(a??""),l=fne.has(a??""),u=Ihr.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${M1(i,A1,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${M1(i,A1,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${M1(i,A1,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${M1(i,A1,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${M1(i,A1,l)}`)}}},"drawCommitBullet"),Vhr=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"),Hhr=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",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},M(lT,"MermaidParseError"),lT),Ci={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},chr=Sn.gitGraph,_v=w(()=>es({...chr,...br().gitGraph}),"getConfig"),Jt=new wee(()=>{const t=_v(),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 AP(){return jCe({length:7})}w(AP,"getID");function JGe(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(JGe,"uniqBy");var uhr=w(function(t){Jt.records.direction=t},"setDirection"),hhr=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Jt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),dhr=w(function(){return Jt.records.options},"getOptions"),fhr=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=_v();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||Jt.records.seq+"-"+AP(),message:e,seq:Jt.records.seq++,type:n??Ci.NORMAL,tags:i??[],parents:Jt.records.head==null?[]:[Jt.records.head.id],branch:Jt.records.currBranch};Jt.records.head=a,de.info("main branch",s.mainBranchName),Jt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Jt.records.commits.set(a.id,a),Jt.records.branches.set(Jt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),phr=w(function(t){let e=t.name;const r=t.order;if(e=Vt.sanitizeText(e,_v()),Jt.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}")`);Jt.records.branches.set(e,Jt.records.head!=null?Jt.records.head.id:null),Jt.records.branchConfig.set(e,{name:e,order:r}),eWe(e),de.debug("in createBranch")},"branch"),ghr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=_v();e=Vt.sanitizeText(e,s),r&&(r=Vt.sanitizeText(r,s));const a=Jt.records.branches.get(Jt.records.currBranch),o=Jt.records.branches.get(e),l=a?Jt.records.commits.get(a):void 0,u=o?Jt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Jt.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 (${Jt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Jt.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&&Jt.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||`${Jt.records.seq}-${AP()}`,message:`merged branch ${e} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,h],branch:Jt.records.currBranch,type:Ci.MERGE,customType:n,customId:!!r,tags:i??[]};Jt.records.head=d,Jt.records.commits.set(d.id,d),Jt.records.branches.set(Jt.records.currBranch,d.id),de.debug(Jt.records.branches),de.debug("in mergeBranch")},"merge"),mhr=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=_v();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||!Jt.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=Jt.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||!Jt.records.commits.has(r)){if(o===Jt.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=Jt.records.branches.get(Jt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Jt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Jt.records.seq+"-"+AP(),message:`cherry-picked ${a==null?void 0:a.message} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,a.id],branch:Jt.records.currBranch,type:Ci.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ci.MERGE?`|parent:${i}`:""}`]};Jt.records.head=h,Jt.records.commits.set(h.id,h),Jt.records.branches.set(Jt.records.currBranch,h.id),de.debug(Jt.records.branches),de.debug("in cherryPick")}},"cherryPick"),eWe=w(function(t){if(t=Vt.sanitizeText(t,_v()),Jt.records.branches.has(t)){Jt.records.currBranch=t;const e=Jt.records.branches.get(Jt.records.currBranch);e===void 0||!e?Jt.records.head=null:Jt.records.head=Jt.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 nj(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(nj,"upsert");function dne(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 Jt.records.branches)Jt.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=Jt.records.commits.get(e.parents[0]);nj(t,e,i),e.parents[1]&&t.push(Jt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Jt.records.commits.get(e.parents[0]);nj(t,e,i)}}t=JGe(t,i=>i.id),dne(t)}w(dne,"prettyPrintCommitHistory");var yhr=w(function(){de.debug(Jt.records.commits);const t=tWe()[0];dne([t])},"prettyPrint"),vhr=w(function(){Jt.reset(),Ri()},"clear"),bhr=w(function(){return[...Jt.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"),xhr=w(function(){return Jt.records.branches},"getBranches"),whr=w(function(){return Jt.records.commits},"getCommits"),tWe=w(function(){const t=[...Jt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Thr=w(function(){return Jt.records.currBranch},"getCurrentBranch"),Chr=w(function(){return Jt.records.direction},"getDirection"),khr=w(function(){return Jt.records.head},"getHead"),rWe={commitType:Ci,getConfig:_v,setDirection:uhr,setOptions:hhr,getOptions:dhr,commit:fhr,branch:phr,merge:ghr,cherryPick:mhr,checkout:eWe,prettyPrint:yhr,clear:vhr,getBranchesAsObjArray:bhr,getBranches:xhr,getCommits:whr,getCommitsArray:tWe,getCurrentBranch:Thr,getDirection:Chr,getHead:khr,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi},Shr=w((t,e)=>{Hl(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)Ehr(r,e)},"populate"),Ehr=w((t,e)=>{const n={Commit:w(i=>e.commit(Ahr(i)),"Commit"),Branch:w(i=>e.branch(Mhr(i)),"Branch"),Merge:w(i=>e.merge(Rhr(i)),"Merge"),Checkout:w(i=>e.checkout(_hr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(Lhr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ahr=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ci[t.type]:Ci.NORMAL,tags:t.tags??void 0}),"parseCommit"),Mhr=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),Rhr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ci[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),_hr=w(t=>t.branch,"parseCheckout"),Lhr=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"),Ihr={parse:w(async t=>{const e=await zu("gitGraph",t);de.debug(e),Shr(e,rWe)},"parse")},Kp=10,Zp=40,rd=4,Lf=2,A1=8,MP=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),ij=12,fne=new Set(["redux-color","redux-dark-color"]),Nhr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),M1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),cc=new Map,pc=new Map,BI=30,Mk=new Map,FI=[],If=0,In="LR",Dhr=w(()=>{cc.clear(),pc.clear(),Mk.clear(),If=0,FI=[],In="LR"},"clear"),nWe=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"),iWe=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=pc.get(i))==null?void 0:a.y:(o=pc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),Ohr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=pc.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=Bhr(o),i=Math.max(n,i)):s.push(o),Fhr(o,n)}),n=i,s.forEach(a=>{zhr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=Ohr(o.parents);n=pc.get(l).y-Zp,n<=i&&(i=n);const u=cc.get(o.branch).pos,h=n-Kp;pc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),$hr=w(t=>{var n;const e=iWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=pc.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"),Bhr=w(t=>$hr(t)+Zp,"calculateCommitPosition"),Fhr=w((t,e)=>{const r=cc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Kp;return pc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),zhr=w((t,e,r)=>{const n=cc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;pc.set(t.id,{x:s,y:i})},"setRootPosition"),Vhr=w((t,e,r,n,i,s)=>{const{theme:a}=Ve(),o=MP.has(a??""),l=fne.has(a??""),u=Nhr.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${M1(i,A1,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${M1(i,A1,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${M1(i,A1,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${M1(i,A1,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${M1(i,A1,l)}`)}}},"drawCommitBullet"),Hhr=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"),Ghr=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} @@ -3601,22 +3601,22 @@ lodash-es/lodash.js: ${r.x+Kp},${m-p-2} ${r.x+Kp+a+4},${m-p-2} ${r.x+Kp+a+4},${m+p+2} - ${r.x+Kp},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+rd/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"),Ghr=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"),Whr=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const s=nWe(t.parents);if(s){const a=n.get(s)??i;return e==="TB"?a.y+Zp:e==="BT"?(n.get(t.id)??i).y-Zp:a.x+Zp}}else return e==="TB"?BI:e==="BT"?(n.get(t.id)??i).y-Zp:0;return 0},"calculatePosition"),qhr=w((t,e,r)=>{var l,u;const n=In==="BT"&&r?e:e+Kp,i=(l=cc.get(t.branch))==null?void 0:l.pos,s=In==="TB"||In==="BT"?(u=cc.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=MP.has(Ve().theme??""),o=In==="TB"||In==="BT"?n:i+(a?ij/2+1:-2);return{x:s,y:o,posWithOffset:n}},"getCommitPosition"),P1e=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"?BI: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&&Ohr(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=Whr(f,In,a,pc));const p=qhr(f,a,l);if(r){const m=Ghr(f),y=f.customType??f.type,v=((g=cc.get(f.branch))==null?void 0:g.index)??0;zhr(i,f,p,m,v,y),Vhr(s,f,p,a,n),Hhr(s,f,p,a)}In==="TB"||In==="BT"?pc.set(f.id,{x:p.x,y:p.posWithOffset}):pc.set(f.id,{x:p.posWithOffset,y:p.y}),a=In==="BT"&&l?a+Zp:a+Zp+Kp,a>If&&(If=a)})},"drawCommits"),Uhr=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"),Rk=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(FI.every(a=>Math.abs(a-n)>=10))return FI.push(n),n;const s=Math.abs(t-e);return Rk(t,e-s/5,r+1)},"findLane"),Yhr=w((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=Ve(),s=fne.has(i??""),a=pc.get(e.id),o=pc.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=Uhr(e,r,a,o,n);let u="",h="",d=0,f=0,p=(m=cc.get(r.branch))==null?void 0:m.index;r.type===Ci.MERGE&&e.id!==r.parents[0]&&(p=(y=cc.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"+M1(p,A1,s))},"drawArrow"),jhr=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=>{Yhr(r,e.get(s),i,e)})})},"drawArrows"),Xhr=w((t,e,r,n)=>{const{look:i,theme:s,themeVariables:a}=Ve(),{dropShadow:o,THEME_COLOR_LIMIT:l}=a,u=MP.has(s??""),h=fne.has(s??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=M1(p,u?l:A1,h),m=(_=cc.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+ij/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",BI),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",BI),v.attr("x2",m)),FI.push(y);const x=f.name,b=rWe(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?ij: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"),Khr=w(function(t,e,r,n,i){return cc.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(In==="TB"||In==="BT"?n.width/2:0),e},"setBranchPosition"),Zhr=w(function(t,e,r,n){Nhr(),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;Mk=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"&&MP.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=rWe(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=Khr(v.name,y,x,k,a),S.remove(),C.remove(),T.remove()}),P1e(l,Mk,!1,s),s.showBranches&&Xhr(l,o,s,e),jhr(l,Mk),P1e(l,Mk,!0,s),Kr.insertTitle(l,"gitTitleText",s.titleTopMargin??0,i.getDiagramTitle()),IK(void 0,l,s.diagramPadding,s.useMaxWidth)},"draw"),Qhr={draw:Zhr},iWe=8,sWe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Jhr=new Set(["redux-color","redux-dark-color"]),edr=new Set(["neo","neo-dark"]),tdr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),rdr=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),ndr=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"),qhr=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const s=iWe(t.parents);if(s){const a=n.get(s)??i;return e==="TB"?a.y+Zp:e==="BT"?(n.get(t.id)??i).y-Zp:a.x+Zp}}else return e==="TB"?BI:e==="BT"?(n.get(t.id)??i).y-Zp:0;return 0},"calculatePosition"),Uhr=w((t,e,r)=>{var l,u;const n=In==="BT"&&r?e:e+Kp,i=(l=cc.get(t.branch))==null?void 0:l.pos,s=In==="TB"||In==="BT"?(u=cc.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=MP.has(Ve().theme??""),o=In==="TB"||In==="BT"?n:i+(a?ij/2+1:-2);return{x:s,y:o,posWithOffset:n}},"getCommitPosition"),$1e=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"?BI: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=qhr(f,In,a,pc));const p=Uhr(f,a,l);if(r){const m=Whr(f),y=f.customType??f.type,v=((g=cc.get(f.branch))==null?void 0:g.index)??0;Vhr(i,f,p,m,v,y),Hhr(s,f,p,a,n),Ghr(s,f,p,a)}In==="TB"||In==="BT"?pc.set(f.id,{x:p.x,y:p.posWithOffset}):pc.set(f.id,{x:p.posWithOffset,y:p.y}),a=In==="BT"&&l?a+Zp:a+Zp+Kp,a>If&&(If=a)})},"drawCommits"),Yhr=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"),Rk=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(FI.every(a=>Math.abs(a-n)>=10))return FI.push(n),n;const s=Math.abs(t-e);return Rk(t,e-s/5,r+1)},"findLane"),jhr=w((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=Ve(),s=fne.has(i??""),a=pc.get(e.id),o=pc.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=Yhr(e,r,a,o,n);let u="",h="",d=0,f=0,p=(m=cc.get(r.branch))==null?void 0:m.index;r.type===Ci.MERGE&&e.id!==r.parents[0]&&(p=(y=cc.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"+M1(p,A1,s))},"drawArrow"),Xhr=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=>{jhr(r,e.get(s),i,e)})})},"drawArrows"),Khr=w((t,e,r,n)=>{const{look:i,theme:s,themeVariables:a}=Ve(),{dropShadow:o,THEME_COLOR_LIMIT:l}=a,u=MP.has(s??""),h=fne.has(s??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=M1(p,u?l:A1,h),m=(_=cc.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+ij/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",BI),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",BI),v.attr("x2",m)),FI.push(y);const x=f.name,b=nWe(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?ij: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"),Zhr=w(function(t,e,r,n,i){return cc.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(In==="TB"||In==="BT"?n.width/2:0),e},"setBranchPosition"),Qhr=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;Mk=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"&&MP.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=nWe(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=Zhr(v.name,y,x,k,a),S.remove(),C.remove(),T.remove()}),$1e(l,Mk,!1,s),s.showBranches&&Khr(l,o,s,e),Xhr(l,Mk),$1e(l,Mk,!0,s),Kr.insertTitle(l,"gitTitleText",s.titleTopMargin??0,i.getDiagramTitle()),IK(void 0,l,s.diagramPadding,s.useMaxWidth)},"draw"),Jhr={draw:Qhr},sWe=8,aWe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),edr=new Set(["redux-color","redux-dark-color"]),tdr=new Set(["neo","neo-dark"]),rdr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),ndr=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),idr=w(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=br(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,s=sWe.has(r);if(edr.has(r)){let a="";for(let o=0;o{const e=br(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,s=aWe.has(r);if(tdr.has(r)){let a="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%iWe;return` + `;return a}},"genColor"),adr=w(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%sWe;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"),adr=w(t=>{const e=br(),{theme:r}=e,n=rdr.has(r);return` +`)}`,"normalTheme"),odr=w(t=>{const e=br(),{theme:r}=e,n=ndr.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -3654,7 +3654,7 @@ lodash-es/lodash.js: font-family: var(--mermaid-font-family); } - ${n?idr(t):sdr(t)} + ${n?sdr(t):adr(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -3685,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: ${sWe.has(r)?t.strokeWidth:8}; + stroke-width: ${aWe.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -3694,12 +3694,12 @@ lodash-es/lodash.js: font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),odr=adr,ldr={parser:Lhr,db:tWe,renderer:Qhr,styles:odr};const cdr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ldr},Symbol.toStringTag,{value:"Module"}));var FR={exports:{}},udr=FR.exports,$1e;function hdr(){return $1e||($1e=1,(function(t,e){(function(r,n){t.exports=n()})(udr,(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)}}}))})(FR)),FR.exports}var ddr=hdr();const fdr=Xg(ddr);var zR={exports:{}},pdr=zR.exports,B1e;function gdr(){return B1e||(B1e=1,(function(t,e){(function(r,n){t.exports=n()})(pdr,(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)}}}))})(zR)),zR.exports}var mdr=gdr();const ydr=Xg(mdr);var VR={exports:{}},vdr=VR.exports,F1e;function bdr(){return F1e||(F1e=1,(function(t,e){(function(r,n){t.exports=n()})(vdr,(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)}}}))})(VR)),VR.exports}var xdr=bdr();const wdr=Xg(xdr);var HR={exports:{}},Tdr=HR.exports,z1e;function Cdr(){return z1e||(z1e=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)}}}))})(HR)),HR.exports}var kdr=Cdr();const Sdr=Xg(kdr);var sj=(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"),ldr=odr,cdr={parser:Ihr,db:rWe,renderer:Jhr,styles:ldr};const udr=Object.freeze(Object.defineProperty({__proto__:null,diagram:cdr},Symbol.toStringTag,{value:"Module"}));var FR={exports:{}},hdr=FR.exports,B1e;function ddr(){return B1e||(B1e=1,(function(t,e){(function(r,n){t.exports=n()})(hdr,(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)}}}))})(FR)),FR.exports}var fdr=ddr();const pdr=Xg(fdr);var zR={exports:{}},gdr=zR.exports,F1e;function mdr(){return F1e||(F1e=1,(function(t,e){(function(r,n){t.exports=n()})(gdr,(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)}}}))})(zR)),zR.exports}var ydr=mdr();const vdr=Xg(ydr);var VR={exports:{}},bdr=VR.exports,z1e;function xdr(){return z1e||(z1e=1,(function(t,e){(function(r,n){t.exports=n()})(bdr,(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)}}}))})(VR)),VR.exports}var wdr=xdr();const Tdr=Xg(wdr);var HR={exports:{}},Cdr=HR.exports,V1e;function kdr(){return V1e||(V1e=1,(function(t,e){(function(r,n){t.exports=n()})(Cdr,(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)}}}))})(HR)),HR.exports}var Sdr=kdr();const Edr=Xg(Sdr);var sj=(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})();sj.parser=sj;var Edr=sj;qa.extend(fdr);qa.extend(ydr);qa.extend(wdr);var V1e={friday:5,saturday:6},wd="",pne="",gne=void 0,mne="",H5=[],G5=[],yne=new Map,vne=[],zI=[],W5="",bne="",aWe=["active","done","crit","milestone","vert"],xne=[],mb="",eA=!1,wne=!1,Tne="sunday",VI="saturday",aj=0,Adr=w(function(){vne=[],zI=[],W5="",xne=[],GR=0,lj=void 0,WR=void 0,va=[],wd="",pne="",bne="",gne=void 0,mne="",H5=[],G5=[],eA=!1,wne=!1,aj=0,yne=new Map,mb="",Ri(),Tne="sunday",VI="saturday"},"clear"),Mdr=w(function(t){mb=t},"setDiagramId"),Rdr=w(function(t){pne=t},"setAxisFormat"),_dr=w(function(){return pne},"getAxisFormat"),Ldr=w(function(t){gne=t},"setTickInterval"),Idr=w(function(){return gne},"getTickInterval"),Ndr=w(function(t){mne=t},"setTodayMarker"),Ddr=w(function(){return mne},"getTodayMarker"),Odr=w(function(t){wd=t},"setDateFormat"),Pdr=w(function(){eA=!0},"enableInclusiveEndDates"),$dr=w(function(){return eA},"endDatesAreInclusive"),Bdr=w(function(){wne=!0},"enableTopAxis"),Fdr=w(function(){return wne},"topAxisEnabled"),zdr=w(function(t){bne=t},"setDisplayMode"),Vdr=w(function(){return bne},"getDisplayMode"),Hdr=w(function(){return wd},"getDateFormat"),oWe=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Gdr=w(function(t){H5=oWe(H5,t)},"setIncludes"),Wdr=w(function(){return H5},"getIncludes"),qdr=w(function(t){G5=oWe(G5,t)},"setExcludes"),Udr=w(function(){return G5},"getExcludes"),Ydr=w(function(){return yne},"getLinks"),jdr=w(function(t){W5=t,vne.push(t)},"addSection"),Xdr=w(function(){return vne},"getSections"),Kdr=w(function(){let t=H1e();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"),oj=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=Lv(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=qa(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"),uWe=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),hWe=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=Lv(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),yne.set(n,r))}),fWe(t,"clickable")},"setLink"),fWe=w(function(t,e){t.split(",").forEach(function(r){let n=Lv(r);n!==void 0&&n.classes.push(e)})},"setClass"),afr=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"),pWe=w(function(t,e){xne.push(function(){const r=mb?`${mb}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=mb?`${mb}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),ofr=w(function(t,e,r){t.split(",").forEach(function(n){afr(n,e,r)}),fWe(t,"clickable")},"setClickEvent"),lfr=w(function(t){xne.forEach(function(e){e(t)})},"bindFunctions"),cfr={getConfig:w(()=>Ve().gantt,"getConfig"),clear:Adr,setDateFormat:Odr,getDateFormat:Hdr,enableInclusiveEndDates:Pdr,endDatesAreInclusive:$dr,enableTopAxis:Bdr,topAxisEnabled:Fdr,setAxisFormat:Rdr,getAxisFormat:_dr,setTickInterval:Ldr,getTickInterval:Idr,setTodayMarker:Ndr,getTodayMarker:Ddr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,setDiagramId:Mdr,setDisplayMode:zdr,getDisplayMode:Vdr,setAccDescription:rs,getAccDescription:ns,addSection:jdr,getSections:Xdr,getTasks:Kdr,addTask:nfr,findTaskById:Lv,addTaskOrg:ifr,setIncludes:Gdr,getIncludes:Wdr,setExcludes:qdr,getExcludes:Udr,setClickEvent:ofr,setLink:sfr,getLinks:Ydr,bindFunctions:lfr,parseDuration:uWe,isInvalidDate:lWe,setWeekday:Zdr,getWeekday:Qdr,setWeekend:Jdr};function Cne(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(Cne,"getTaskTags");qa.extend(Sdr);var ufr=w(function(){de.debug("Something is calling, setConf, remove the call")},"setConf"),G1e={monday:m6,tuesday:i5e,wednesday:s5e,thursday:Cy,friday:a5e,saturday:o5e,sunday:t7},hfr=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,xV=1e4,dfr=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=hfr(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=a4t().domain([f1t(h,function(R){return R.startTime}),d1t(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(qa(F).diff(qa(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=qa(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=qa.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=T1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(X9($));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>xV)de.warn(`The tick interval "${z}${V}" would generate ${K} ticks, which exceeds the maximum allowed (${xV}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(o5.every(z));break;case"second":O.ticks(Vp.every(z));break;case"minute":O.ticks(p6.every(z));break;case"hour":O.ticks(g6.every(z));break;case"day":O.ticks(Ty.every(z));break;case"week":O.ticks(G1e[B].every(z));break;case"month":O.ticks(y6.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=w1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(X9($));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)<=xV)switch(B){case"millisecond":z.ticks(o5.every(V));break;case"second":z.ticks(Vp.every(V));break;case"minute":z.ticks(p6.every(V));break;case"hour":z.ticks(g6.every(V));break;case"day":z.ticks(Ty.every(V));break;case"week":z.ticks(G1e[H].every(V));break;case"month":z.ticks(y6.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})();sj.parser=sj;var Adr=sj;qa.extend(pdr);qa.extend(vdr);qa.extend(Tdr);var H1e={friday:5,saturday:6},wd="",pne="",gne=void 0,mne="",H5=[],G5=[],yne=new Map,vne=[],zI=[],W5="",bne="",oWe=["active","done","crit","milestone","vert"],xne=[],mb="",eA=!1,wne=!1,Tne="sunday",VI="saturday",aj=0,Mdr=w(function(){vne=[],zI=[],W5="",xne=[],GR=0,lj=void 0,WR=void 0,va=[],wd="",pne="",bne="",gne=void 0,mne="",H5=[],G5=[],eA=!1,wne=!1,aj=0,yne=new Map,mb="",Ri(),Tne="sunday",VI="saturday"},"clear"),Rdr=w(function(t){mb=t},"setDiagramId"),_dr=w(function(t){pne=t},"setAxisFormat"),Ldr=w(function(){return pne},"getAxisFormat"),Idr=w(function(t){gne=t},"setTickInterval"),Ndr=w(function(){return gne},"getTickInterval"),Ddr=w(function(t){mne=t},"setTodayMarker"),Odr=w(function(){return mne},"getTodayMarker"),Pdr=w(function(t){wd=t},"setDateFormat"),$dr=w(function(){eA=!0},"enableInclusiveEndDates"),Bdr=w(function(){return eA},"endDatesAreInclusive"),Fdr=w(function(){wne=!0},"enableTopAxis"),zdr=w(function(){return wne},"topAxisEnabled"),Vdr=w(function(t){bne=t},"setDisplayMode"),Hdr=w(function(){return bne},"getDisplayMode"),Gdr=w(function(){return wd},"getDateFormat"),lWe=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Wdr=w(function(t){H5=lWe(H5,t)},"setIncludes"),qdr=w(function(){return H5},"getIncludes"),Udr=w(function(t){G5=lWe(G5,t)},"setExcludes"),Ydr=w(function(){return G5},"getExcludes"),jdr=w(function(){return yne},"getLinks"),Xdr=w(function(t){W5=t,vne.push(t)},"addSection"),Kdr=w(function(){return vne},"getSections"),Zdr=w(function(){let t=G1e();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"),oj=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=Lv(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=qa(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"),hWe=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),dWe=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=Lv(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),yne.set(n,r))}),pWe(t,"clickable")},"setLink"),pWe=w(function(t,e){t.split(",").forEach(function(r){let n=Lv(r);n!==void 0&&n.classes.push(e)})},"setClass"),ofr=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"),gWe=w(function(t,e){xne.push(function(){const r=mb?`${mb}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=mb?`${mb}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),lfr=w(function(t,e,r){t.split(",").forEach(function(n){ofr(n,e,r)}),pWe(t,"clickable")},"setClickEvent"),cfr=w(function(t){xne.forEach(function(e){e(t)})},"bindFunctions"),ufr={getConfig:w(()=>Ve().gantt,"getConfig"),clear:Mdr,setDateFormat:Pdr,getDateFormat:Gdr,enableInclusiveEndDates:$dr,endDatesAreInclusive:Bdr,enableTopAxis:Fdr,topAxisEnabled:zdr,setAxisFormat:_dr,getAxisFormat:Ldr,setTickInterval:Idr,getTickInterval:Ndr,setTodayMarker:Ddr,getTodayMarker:Odr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,setDiagramId:Rdr,setDisplayMode:Vdr,getDisplayMode:Hdr,setAccDescription:rs,getAccDescription:ns,addSection:Xdr,getSections:Kdr,getTasks:Zdr,addTask:ifr,findTaskById:Lv,addTaskOrg:sfr,setIncludes:Wdr,getIncludes:qdr,setExcludes:Udr,getExcludes:Ydr,setClickEvent:lfr,setLink:afr,getLinks:jdr,bindFunctions:cfr,parseDuration:hWe,isInvalidDate:cWe,setWeekday:Qdr,getWeekday:Jdr,setWeekend:efr};function Cne(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(Cne,"getTaskTags");qa.extend(Edr);var hfr=w(function(){de.debug("Something is calling, setConf, remove the call")},"setConf"),W1e={monday:m6,tuesday:s5e,wednesday:a5e,thursday:Cy,friday:o5e,saturday:l5e,sunday:t7},dfr=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,xV=1e4,ffr=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=dfr(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=o4t().domain([p1t(h,function(R){return R.startTime}),f1t(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(qa(F).diff(qa(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=qa(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=qa.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=C1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(X9($));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>xV)de.warn(`The tick interval "${z}${V}" would generate ${K} ticks, which exceeds the maximum allowed (${xV}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(o5.every(z));break;case"second":O.ticks(Vp.every(z));break;case"minute":O.ticks(p6.every(z));break;case"hour":O.ticks(g6.every(z));break;case"day":O.ticks(Ty.every(z));break;case"week":O.ticks(W1e[B].every(z));break;case"month":O.ticks(y6.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=T1t(y).tickSize(-N+_+i.gridLineStartPadding).tickFormat(X9($));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)<=xV)switch(B){case"millisecond":z.ticks(o5.every(V));break;case"second":z.ticks(Vp.every(V));break;case"minute":z.ticks(p6.every(V));break;case"hour":z.ticks(g6.every(V));break;case"day":z.ticks(Ty.every(V));break;case"week":z.ticks(W1e[H].every(V));break;case"month":z.ticks(y6.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}; } @@ -3985,8 +3985,8 @@ Expecting `+He.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),gfr=pfr,mfr={parser:Edr,db:cfr,renderer:ffr,styles:gfr};const yfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:mfr},Symbol.toStringTag,{value:"Module"}));var vfr={parse:w(async t=>{const e=await zu("info",t);de.debug(e)},"parse")},bfr={version:"11.16.1"},xfr=w(()=>bfr.version,"getVersion"),wfr={getVersion:xfr},Tfr=w((t,e,r)=>{de.debug(`rendering info diagram -`+t);const n=Ko(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"),Cfr={draw:Tfr},kfr={parser:vfr,db:wfr,renderer:Cfr};const Sfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:kfr},Symbol.toStringTag,{value:"Module"}));var Efr=Sn.pie,kne={sections:new Map,showData:!1},HI=kne.sections,Sne=kne.showData,Afr=structuredClone(Efr),Mfr=w(()=>structuredClone(Afr),"getConfig"),Rfr=w(()=>{HI=new Map,Sne=kne.showData,Ri()},"clear"),_fr=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.`);HI.has(t)||(HI.set(t,e),de.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Lfr=w(()=>HI,"getSections"),Ifr=w(t=>{Sne=t},"setShowData"),Nfr=w(()=>Sne,"getShowData"),gWe={getConfig:Mfr,clear:Rfr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:_fr,getSections:Lfr,setShowData:Ifr,getShowData:Nfr},Dfr=w((t,e)=>{Hl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Ofr={parse:w(async t=>{const e=await zu("pie",t);de.debug(e),Dfr(e,gWe)},"parse")},Pfr=w(t=>` +`,"getStyles"),mfr=gfr,yfr={parser:Adr,db:ufr,renderer:pfr,styles:mfr};const vfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:yfr},Symbol.toStringTag,{value:"Module"}));var bfr={parse:w(async t=>{const e=await zu("info",t);de.debug(e)},"parse")},xfr={version:"11.16.1"},wfr=w(()=>xfr.version,"getVersion"),Tfr={getVersion:wfr},Cfr=w((t,e,r)=>{de.debug(`rendering info diagram +`+t);const n=Ko(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"),kfr={draw:Cfr},Sfr={parser:bfr,db:Tfr,renderer:kfr};const Efr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Sfr},Symbol.toStringTag,{value:"Module"}));var Afr=Sn.pie,kne={sections:new Map,showData:!1},HI=kne.sections,Sne=kne.showData,Mfr=structuredClone(Afr),Rfr=w(()=>structuredClone(Mfr),"getConfig"),_fr=w(()=>{HI=new Map,Sne=kne.showData,Ri()},"clear"),Lfr=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.`);HI.has(t)||(HI.set(t,e),de.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Ifr=w(()=>HI,"getSections"),Nfr=w(t=>{Sne=t},"setShowData"),Dfr=w(()=>Sne,"getShowData"),mWe={getConfig:Rfr,clear:_fr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:Lfr,getSections:Ifr,setShowData:Nfr,getShowData:Dfr},Ofr=w((t,e)=>{Hl(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Pfr={parse:w(async t=>{const e=await zu("pie",t);de.debug(e),Ofr(e,mWe)},"parse")},$fr=w(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -4023,25 +4023,25 @@ Expecting `+He.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),$fr=Pfr,Bfr=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 w4t().value(i=>i.value).sort(null)(r)},"createPieArcs"),Ffr=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=Ko(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=c5().innerRadius(x*b).outerRadius(b),C=c5().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=Bfr(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=ty(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"),zfr={draw:Ffr},Vfr={parser:Ofr,db:gWe,renderer:zfr,styles:$fr};const Hfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vfr},Symbol.toStringTag,{value:"Module"}));var cj=(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"),Bfr=$fr,Ffr=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 T4t().value(i=>i.value).sort(null)(r)},"createPieArcs"),zfr=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=Ko(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=c5().innerRadius(x*b).outerRadius(b),C=c5().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=Ffr(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=ty(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"),Vfr={draw:zfr},Hfr={parser:Pfr,db:mWe,renderer:Vfr,styles:Bfr};const Gfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hfr},Symbol.toStringTag,{value:"Module"}));var cj=(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})();cj.parser=cj;var Gfr=cj,il=V0(),cT,Wfr=(cT=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:il.quadrant1Fill,quadrant2Fill:il.quadrant2Fill,quadrant3Fill:il.quadrant3Fill,quadrant4Fill:il.quadrant4Fill,quadrant1TextFill:il.quadrant1TextFill,quadrant2TextFill:il.quadrant2TextFill,quadrant3TextFill:il.quadrant3TextFill,quadrant4TextFill:il.quadrant4TextFill,quadrantPointFill:il.quadrantPointFill,quadrantPointTextFill:il.quadrantPointTextFill,quadrantXAxisTextFill:il.quadrantXAxisTextFill,quadrantYAxisTextFill:il.quadrantYAxisTextFill,quadrantTitleFill:il.quadrantTitleFill,quadrantInternalBorderStrokeFill:il.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:il.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=a5().domain([0,1]).range([i,a+i]),l=a5().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(cT,"QuadrantBuilder"),cT),uT,oM=(uT=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(uT,"InvalidStyleError"),uT);function uj(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(uj,"validateHexCode");function mWe(t){return!/^\d+$/.test(t)}w(mWe,"validateNumber");function yWe(t){return!/^\d+px$/.test(t)}w(yWe,"validateSizeInPixels");function af(t){return Ln(t.trim(),Ve())}w(af,"textSanitizer");var ko=new Wfr;function vWe(t){ko.setData({quadrant1Text:af(t.text)})}w(vWe,"setQuadrant1Text");function bWe(t){ko.setData({quadrant2Text:af(t.text)})}w(bWe,"setQuadrant2Text");function xWe(t){ko.setData({quadrant3Text:af(t.text)})}w(xWe,"setQuadrant3Text");function wWe(t){ko.setData({quadrant4Text:af(t.text)})}w(wWe,"setQuadrant4Text");function TWe(t){ko.setData({xAxisLeftText:af(t.text)})}w(TWe,"setXAxisLeftText");function CWe(t){ko.setData({xAxisRightText:af(t.text)})}w(CWe,"setXAxisRightText");function kWe(t){ko.setData({yAxisTopText:af(t.text)})}w(kWe,"setYAxisTopText");function SWe(t){ko.setData({yAxisBottomText:af(t.text)})}w(SWe,"setYAxisBottomText");function RP(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(mWe(i))throw new oM(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(uj(i))throw new oM(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(uj(i))throw new oM(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(yWe(i))throw new oM(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(RP,"parseStyles");function EWe(t,e,r,n,i){const s=RP(i);ko.addPoints([{x:r,y:n,text:af(t.text),className:e,...s}])}w(EWe,"addPoint");function AWe(t,e){ko.addClass(t,RP(e))}w(AWe,"addClass");function MWe(t){ko.setConfig({chartWidth:t})}w(MWe,"setWidth");function RWe(t){ko.setConfig({chartHeight:t})}w(RWe,"setHeight");function _We(){const t=Ve(),{themeVariables:e,quadrantChart:r}=t;return r&&ko.setConfig(r),ko.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}),ko.setData({titleText:qi()}),ko.build()}w(_We,"getQuadrantData");var qfr=w(function(){ko.clear(),Ri()},"clear"),Ufr={setWidth:MWe,setHeight:RWe,setQuadrant1Text:vWe,setQuadrant2Text:bWe,setQuadrant3Text:xWe,setQuadrant4Text:wWe,setXAxisLeftText:TWe,setXAxisRightText:CWe,setYAxisTopText:kWe,setYAxisBottomText:SWe,parseStyles:RP,addPoint:EWe,addClass:AWe,getQuadrantData:_We,clear:qfr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Yfr=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"),jfr={draw:Yfr},Xfr={parser:Gfr,db:Ufr,renderer:jfr,styles:w(()=>"","styles")};const Kfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xfr},Symbol.toStringTag,{value:"Module"}));var hj=(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})();cj.parser=cj;var Wfr=cj,il=V0(),cT,qfr=(cT=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:il.quadrant1Fill,quadrant2Fill:il.quadrant2Fill,quadrant3Fill:il.quadrant3Fill,quadrant4Fill:il.quadrant4Fill,quadrant1TextFill:il.quadrant1TextFill,quadrant2TextFill:il.quadrant2TextFill,quadrant3TextFill:il.quadrant3TextFill,quadrant4TextFill:il.quadrant4TextFill,quadrantPointFill:il.quadrantPointFill,quadrantPointTextFill:il.quadrantPointTextFill,quadrantXAxisTextFill:il.quadrantXAxisTextFill,quadrantYAxisTextFill:il.quadrantYAxisTextFill,quadrantTitleFill:il.quadrantTitleFill,quadrantInternalBorderStrokeFill:il.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:il.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=a5().domain([0,1]).range([i,a+i]),l=a5().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(cT,"QuadrantBuilder"),cT),uT,oM=(uT=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(uT,"InvalidStyleError"),uT);function uj(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(uj,"validateHexCode");function yWe(t){return!/^\d+$/.test(t)}w(yWe,"validateNumber");function vWe(t){return!/^\d+px$/.test(t)}w(vWe,"validateSizeInPixels");function af(t){return Ln(t.trim(),Ve())}w(af,"textSanitizer");var ko=new qfr;function bWe(t){ko.setData({quadrant1Text:af(t.text)})}w(bWe,"setQuadrant1Text");function xWe(t){ko.setData({quadrant2Text:af(t.text)})}w(xWe,"setQuadrant2Text");function wWe(t){ko.setData({quadrant3Text:af(t.text)})}w(wWe,"setQuadrant3Text");function TWe(t){ko.setData({quadrant4Text:af(t.text)})}w(TWe,"setQuadrant4Text");function CWe(t){ko.setData({xAxisLeftText:af(t.text)})}w(CWe,"setXAxisLeftText");function kWe(t){ko.setData({xAxisRightText:af(t.text)})}w(kWe,"setXAxisRightText");function SWe(t){ko.setData({yAxisTopText:af(t.text)})}w(SWe,"setYAxisTopText");function EWe(t){ko.setData({yAxisBottomText:af(t.text)})}w(EWe,"setYAxisBottomText");function RP(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(yWe(i))throw new oM(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(uj(i))throw new oM(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(uj(i))throw new oM(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(vWe(i))throw new oM(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(RP,"parseStyles");function AWe(t,e,r,n,i){const s=RP(i);ko.addPoints([{x:r,y:n,text:af(t.text),className:e,...s}])}w(AWe,"addPoint");function MWe(t,e){ko.addClass(t,RP(e))}w(MWe,"addClass");function RWe(t){ko.setConfig({chartWidth:t})}w(RWe,"setWidth");function _We(t){ko.setConfig({chartHeight:t})}w(_We,"setHeight");function LWe(){const t=Ve(),{themeVariables:e,quadrantChart:r}=t;return r&&ko.setConfig(r),ko.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}),ko.setData({titleText:qi()}),ko.build()}w(LWe,"getQuadrantData");var Ufr=w(function(){ko.clear(),Ri()},"clear"),Yfr={setWidth:RWe,setHeight:_We,setQuadrant1Text:bWe,setQuadrant2Text:xWe,setQuadrant3Text:wWe,setQuadrant4Text:TWe,setXAxisLeftText:CWe,setXAxisRightText:kWe,setYAxisTopText:SWe,setYAxisBottomText:EWe,parseStyles:RP,addPoint:AWe,addClass:MWe,getQuadrantData:LWe,clear:Ufr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},jfr=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"),Xfr={draw:jfr},Kfr={parser:Wfr,db:Yfr,renderer:Xfr,styles:w(()=>"","styles")};const Zfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kfr},Symbol.toStringTag,{value:"Module"}));var hj=(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})();hj.parser=hj;var Zfr=hj;function dj(t){return t.type==="bar"}w(dj,"isBarPlot");function GI(t){return t.type==="band"}w(GI,"isBandAxisData");function jb(t){return t.type==="linear"}w(jb,"isLinearAxisData");var hT,LWe=(hT=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=wke(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(hT,"TextDimensionCalculatorWithFont"),hT),W1e=.7,q1e=.2,dT,IWe=(dT=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(){W1e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(W1e*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=q1e*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=q1e*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(dT,"BaseAxis"),dT),fT,Qfr=(fT=class extends IWe{constructor(e,r,n,i,s){super(e,i,s,r),this.categories=n,this.scale=iG().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=iG().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(fT,"BandAxis"),fT),pT,Jfr=(pT=class extends IWe{constructor(e,r,n,i,s){super(e,i,s,r),this.domain=n,this.scale=a5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=a5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(pT,"LinearAxis"),pT);function fj(t,e,r,n){const i=new LWe(n);return GI(t)?new Qfr(e,r,t.categories,t.title,i):new Jfr(e,r,[t.min,t.max],t.title,i)}w(fj,"getAxis");var gT,e0r=(gT=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(gT,"ChartTitle"),gT);function NWe(t,e,r,n){const i=new LWe(n);return new e0r(i,t,e,r)}w(NWe,"getChartTitleComponent");var mT,t0r=(mT=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=b6().y(i=>i[0]).x(i=>i[1])(e):r=b6().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(mT,"LinePlot"),mT),yT,r0r=(yT=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(yT,"BarPlot"),yT),vT,n0r=(vT=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 t0r(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new r0r(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(vT,"BasePlot"),vT);function DWe(t,e,r){return new n0r(t,e,r)}w(DWe,"getPlotComponent");var bT,i0r=(bT=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:NWe(e,r,n,i),plot:DWe(e,r,n),xAxis:fj(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:fj(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=>dj(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=>dj(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(bT,"Orchestrator"),bT),xT,s0r=(xT=class{static build(e,r,n,i){return new i0r(e,r,n,i).getDrawableElement()}},w(xT,"XYChartBuilder"),xT),vE=0,OWe,bE=Mne(),xE=Ane(),Un=Rne(),pj=xE.plotColorPalette.split(",").map(t=>t.trim()),_P=!1,Ene=!1;function Ane(){const t=V0(),e=br();return es(t.xyChart,e.themeVariables.xyChart)}w(Ane,"getChartDefaultThemeConfig");function Mne(){const t=br();return es(Sn.xyChart,t.xyChart)}w(Mne,"getChartDefaultConfig");function Rne(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(Rne,"getChartDefaultData");function tA(t){const e=br();return Ln(t.trim(),e)}w(tA,"textSanitizer");function PWe(t){OWe=t}w(PWe,"setTmpSVGG");function $We(t){t==="horizontal"?bE.chartOrientation="horizontal":bE.chartOrientation="vertical"}w($We,"setOrientation");function BWe(t){Un.xAxis.title=tA(t.text)}w(BWe,"setXAxisTitle");function _ne(t,e){Un.xAxis={type:"linear",title:Un.xAxis.title,min:t,max:e},_P=!0}w(_ne,"setXAxisRangeData");function FWe(t){Un.xAxis={type:"band",title:Un.xAxis.title,categories:t.map(e=>tA(e.text))},_P=!0}w(FWe,"setXAxisBand");function zWe(t){Un.yAxis.title=tA(t.text)}w(zWe,"setYAxisTitle");function VWe(t,e){Un.yAxis={type:"linear",title:Un.yAxis.title,min:t,max:e},Ene=!0}w(VWe,"setYAxisRangeData");function HWe(t){const e=Math.min(...t),r=Math.max(...t),n=jb(Un.yAxis)?Un.yAxis.min:1/0,i=jb(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(HWe,"setYAxisRangeFromPlotData");function Lne(t){let e=[];if(t.length===0)return e;if(!_P){const r=jb(Un.xAxis)?Un.xAxis.min:1/0,n=jb(Un.xAxis)?Un.xAxis.max:-1/0;_ne(Math.min(r,1),Math.max(n,t.length))}if(GI(Un.xAxis)&&t.length>Un.xAxis.categories.length&&(t=t.slice(0,Un.xAxis.categories.length)),Ene||HWe(t),GI(Un.xAxis)&&(e=Un.xAxis.categories.map((r,n)=>[r,t[n]])),jb(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(Lne,"transformDataWithoutCategory");function Ine(t){return pj[t===0?0:t%pj.length]}w(Ine,"getPlotColorFromPalette");function GWe(t,e){const r=e.map(a=>a.value),n=e.map(a=>a.label?tA(a.label):""),i=Lne(r),s=n.some(a=>a!=="");Un.plots.push({type:"line",strokeFill:Ine(vE),strokeWidth:2,data:i,...s?{pointLabels:n}:{}}),vE++}w(GWe,"setLineData");function WWe(t,e){const r=e.map(i=>i.value),n=Lne(r);Un.plots.push({type:"bar",fill:Ine(vE),data:n}),vE++}w(WWe,"setBarData");function qWe(){if(Un.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Un.title=qi(),s0r.build(bE,Un,xE,OWe)}w(qWe,"getDrawableElem");function UWe(){return xE}w(UWe,"getChartThemeConfig");function YWe(){return bE}w(YWe,"getChartConfig");function jWe(){return Un}w(jWe,"getXYChartData");var a0r=w(function(){Ri(),vE=0,bE=Mne(),Un=Rne(),xE=Ane(),pj=xE.plotColorPalette.split(",").map(t=>t.trim()),_P=!1,Ene=!1},"clear"),o0r={getDrawableElem:qWe,clear:a0r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,setOrientation:$We,setXAxisTitle:BWe,setXAxisRangeData:_ne,setXAxisBand:FWe,setYAxisTitle:zWe,setYAxisRangeData:VWe,setLineData:GWe,setBarData:WWe,setTmpSVGG:PWe,getChartThemeConfig:UWe,getChartConfig:YWe,getXYChartData:jWe},l0r=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=Ko(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"),c0r={draw:l0r},u0r={parser:Zfr,db:o0r,renderer:c0r};const h0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:u0r},Symbol.toStringTag,{value:"Module"}));var gj=(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})();hj.parser=hj;var Qfr=hj;function dj(t){return t.type==="bar"}w(dj,"isBarPlot");function GI(t){return t.type==="band"}w(GI,"isBandAxisData");function jb(t){return t.type==="linear"}w(jb,"isLinearAxisData");var hT,IWe=(hT=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=Tke(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(hT,"TextDimensionCalculatorWithFont"),hT),q1e=.7,U1e=.2,dT,NWe=(dT=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(){q1e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(q1e*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=U1e*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=U1e*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(dT,"BaseAxis"),dT),fT,Jfr=(fT=class extends NWe{constructor(e,r,n,i,s){super(e,i,s,r),this.categories=n,this.scale=iG().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=iG().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(fT,"BandAxis"),fT),pT,e0r=(pT=class extends NWe{constructor(e,r,n,i,s){super(e,i,s,r),this.domain=n,this.scale=a5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=a5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(pT,"LinearAxis"),pT);function fj(t,e,r,n){const i=new IWe(n);return GI(t)?new Jfr(e,r,t.categories,t.title,i):new e0r(e,r,[t.min,t.max],t.title,i)}w(fj,"getAxis");var gT,t0r=(gT=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(gT,"ChartTitle"),gT);function DWe(t,e,r,n){const i=new IWe(n);return new t0r(i,t,e,r)}w(DWe,"getChartTitleComponent");var mT,r0r=(mT=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=b6().y(i=>i[0]).x(i=>i[1])(e):r=b6().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(mT,"LinePlot"),mT),yT,n0r=(yT=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(yT,"BarPlot"),yT),vT,i0r=(vT=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 r0r(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new n0r(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(vT,"BasePlot"),vT);function OWe(t,e,r){return new i0r(t,e,r)}w(OWe,"getPlotComponent");var bT,s0r=(bT=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:DWe(e,r,n,i),plot:OWe(e,r,n),xAxis:fj(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:fj(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=>dj(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=>dj(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(bT,"Orchestrator"),bT),xT,a0r=(xT=class{static build(e,r,n,i){return new s0r(e,r,n,i).getDrawableElement()}},w(xT,"XYChartBuilder"),xT),vE=0,PWe,bE=Mne(),xE=Ane(),Un=Rne(),pj=xE.plotColorPalette.split(",").map(t=>t.trim()),_P=!1,Ene=!1;function Ane(){const t=V0(),e=br();return es(t.xyChart,e.themeVariables.xyChart)}w(Ane,"getChartDefaultThemeConfig");function Mne(){const t=br();return es(Sn.xyChart,t.xyChart)}w(Mne,"getChartDefaultConfig");function Rne(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(Rne,"getChartDefaultData");function tA(t){const e=br();return Ln(t.trim(),e)}w(tA,"textSanitizer");function $We(t){PWe=t}w($We,"setTmpSVGG");function BWe(t){t==="horizontal"?bE.chartOrientation="horizontal":bE.chartOrientation="vertical"}w(BWe,"setOrientation");function FWe(t){Un.xAxis.title=tA(t.text)}w(FWe,"setXAxisTitle");function _ne(t,e){Un.xAxis={type:"linear",title:Un.xAxis.title,min:t,max:e},_P=!0}w(_ne,"setXAxisRangeData");function zWe(t){Un.xAxis={type:"band",title:Un.xAxis.title,categories:t.map(e=>tA(e.text))},_P=!0}w(zWe,"setXAxisBand");function VWe(t){Un.yAxis.title=tA(t.text)}w(VWe,"setYAxisTitle");function HWe(t,e){Un.yAxis={type:"linear",title:Un.yAxis.title,min:t,max:e},Ene=!0}w(HWe,"setYAxisRangeData");function GWe(t){const e=Math.min(...t),r=Math.max(...t),n=jb(Un.yAxis)?Un.yAxis.min:1/0,i=jb(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(GWe,"setYAxisRangeFromPlotData");function Lne(t){let e=[];if(t.length===0)return e;if(!_P){const r=jb(Un.xAxis)?Un.xAxis.min:1/0,n=jb(Un.xAxis)?Un.xAxis.max:-1/0;_ne(Math.min(r,1),Math.max(n,t.length))}if(GI(Un.xAxis)&&t.length>Un.xAxis.categories.length&&(t=t.slice(0,Un.xAxis.categories.length)),Ene||GWe(t),GI(Un.xAxis)&&(e=Un.xAxis.categories.map((r,n)=>[r,t[n]])),jb(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(Lne,"transformDataWithoutCategory");function Ine(t){return pj[t===0?0:t%pj.length]}w(Ine,"getPlotColorFromPalette");function WWe(t,e){const r=e.map(a=>a.value),n=e.map(a=>a.label?tA(a.label):""),i=Lne(r),s=n.some(a=>a!=="");Un.plots.push({type:"line",strokeFill:Ine(vE),strokeWidth:2,data:i,...s?{pointLabels:n}:{}}),vE++}w(WWe,"setLineData");function qWe(t,e){const r=e.map(i=>i.value),n=Lne(r);Un.plots.push({type:"bar",fill:Ine(vE),data:n}),vE++}w(qWe,"setBarData");function UWe(){if(Un.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Un.title=qi(),a0r.build(bE,Un,xE,PWe)}w(UWe,"getDrawableElem");function YWe(){return xE}w(YWe,"getChartThemeConfig");function jWe(){return bE}w(jWe,"getChartConfig");function XWe(){return Un}w(XWe,"getXYChartData");var o0r=w(function(){Ri(),vE=0,bE=Mne(),Un=Rne(),xE=Ane(),pj=xE.plotColorPalette.split(",").map(t=>t.trim()),_P=!1,Ene=!1},"clear"),l0r={getDrawableElem:UWe,clear:o0r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,setOrientation:BWe,setXAxisTitle:FWe,setXAxisRangeData:_ne,setXAxisBand:zWe,setYAxisTitle:VWe,setYAxisRangeData:HWe,setLineData:WWe,setBarData:qWe,setTmpSVGG:$We,getChartThemeConfig:YWe,getChartConfig:jWe,getXYChartData:XWe},c0r=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=Ko(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"),u0r={draw:c0r},h0r={parser:Qfr,db:l0r,renderer:u0r};const d0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:h0r},Symbol.toStringTag,{value:"Module"}));var gj=(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})();gj.parser=gj;var d0r=gj,wT,f0r=(wT=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(wT,"RequirementDB"),wT),p0r=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;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})();gj.parser=gj;var f0r=gj,wT,p0r=(wT=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(wT,"RequirementDB"),wT),g0r=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=br(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${p0r(t)} + `;return a},"genColor"),m0r=w(t=>{const e=br(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${g0r(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -4119,16 +4119,16 @@ Expecting `+Rt.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":Or="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),m0r=g0r,XWe={};zN(XWe,{draw:()=>y0r});var y0r=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=R3(e,i);l.type=n.type,l.layoutAlgorithm=l7(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 h3(l,u);const h=8;Kr.insertTitle(u,"requirementDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),lv(u,h,"requirementDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),v0r={parser:d0r,get db(){return new f0r},renderer:XWe,styles:m0r};const b0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:v0r},Symbol.toStringTag,{value:"Module"}));var mj=(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)+`: +`},"getStyles"),y0r=m0r,KWe={};zN(KWe,{draw:()=>v0r});var v0r=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=R3(e,i);l.type=n.type,l.layoutAlgorithm=l7(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 h3(l,u);const h=8;Kr.insertTitle(u,"requirementDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),lv(u,h,"requirementDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),b0r={parser:f0r,get db(){return new p0r},renderer:KWe,styles:y0r};const x0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:b0r},Symbol.toStringTag,{value:"Module"}));var mj=(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(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})();mj.parser=mj;var x0r=mj,w0r={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},C0r={LEFTOF:0,RIGHTOF:1,OVER:2},lM={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},TT,k0r=(TT=class{constructor(){this.state=new wee(()=>({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=w0r,this.ARROWTYPE=T0r,this.PLACEMENT=C0r}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})();mj.parser=mj;var w0r=mj,T0r={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},C0r={FILLED:0,OPEN:1},k0r={LEFTOF:0,RIGHTOF:1,OVER:2},lM={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},TT,S0r=(TT=class{constructor(){this.state=new wee(()=>({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=T0r,this.ARROWTYPE=C0r,this.PLACEMENT=k0r}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=tD(u,{schema:eD})}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(TT,"SequenceDB"),TT),S0r=w(t=>{const e=t.dropShadow??"none",{look:r}=Ve();return`.actor { +}`,o=tD(u,{schema:eD})}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(TT,"SequenceDB"),TT),E0r=w(t=>{const e=t.dropShadow??"none",{look:r}=Ve();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -4267,25 +4267,25 @@ Expecting `+Er.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":nn="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),E0r=S0r,U1=36,mm="actor-top",ym="actor-bottom",LP="actor-box",Vy="actor-man",rp=new Set(["redux-color","redux-dark-color"]),wE=w(function(t,e){const r=mO(t,e);return br().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=Qy.sanitizeUrl(s[y]);g.attr("xlink:href",m),g.attr("target","_blank"),K0r(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"),IP=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),WI=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await GN(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"),q5=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||FCe;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"),KWe=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,q5(t,e),n},"drawLabel"),Pn=-1,ZWe=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"),M0r=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",IP(`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+=` ${ym}`:y+=` ${mm}`,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=wE(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)==="@"?dee(g,m.x+m.width-20,m.y+10,S.substr(1)):hee(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 ${LP}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),R0r=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",IP(`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+=` ${ym}`:y+=` ${mm}`,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=wE(g,m),T=wE(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)==="@"?dee(g,m.x+m.width-20,m.y+10,A.substr(1)):hee(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 ${LP}`},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"),_0r=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",IP(`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+=` ${ym}`:y+=` ${mm}`,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"),A0r=E0r,U1=36,mm="actor-top",ym="actor-bottom",LP="actor-box",Vy="actor-man",rp=new Set(["redux-color","redux-dark-color"]),wE=w(function(t,e){const r=mO(t,e);return br().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),M0r=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=Qy.sanitizeUrl(s[y]);g.attr("xlink:href",m),g.attr("target","_blank"),Z0r(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"),IP=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),WI=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await GN(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"),q5=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||zCe;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"),ZWe=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,q5(t,e),n},"drawLabel"),Pn=-1,QWe=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"),R0r=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",IP(`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+=` ${ym}`:y+=` ${mm}`,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=wE(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)==="@"?dee(g,m.x+m.width-20,m.y+10,S.substr(1)):hee(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 ${LP}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),_0r=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",IP(`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+=` ${ym}`:y+=` ${mm}`,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=wE(g,m),T=wE(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)==="@"?dee(g,m.x+m.width-20,m.y+10,A.substr(1)):hee(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 ${LP}`},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"),L0r=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",IP(`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+=` ${ym}`:y+=` ${mm}`,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(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)==="@"?dee(g,P,N,_.substr(1)):hee(g,P,N,_)}np(r,Ks(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${LP}`},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"),L0r=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=Vy;n?x+=` ${ym}`:x+=` ${mm}`,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 ${Vy}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),I0r=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+=` ${ym}`:m+=` ${mm}`,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 ${Vy}`},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"),N0r=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",IP(`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+=` ${ym}`:v+=` ${mm}`,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)==="@"?dee(g,P,N,_.substr(1)):hee(g,P,N,_)}np(r,Ks(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${LP}`},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"),I0r=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=Vy;n?x+=` ${ym}`:x+=` ${mm}`,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 ${Vy}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),N0r=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+=` ${ym}`:m+=` ${mm}`,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 ${Vy}`},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",IP(`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+=` ${ym}`:v+=` ${mm}`,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;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 ${LP}`},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"),D0r=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=Vy;n?v+=` ${ym}`:v+=` ${mm}`,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 ${Vy}`},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"),O0r=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=Vy;n?y+=` ${ym}`:y+=` ${mm}`,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-U1/2*v).attr("y1",x+33*v).attr("x2",a+U1/2*v).attr("y2",x+33*v),m.append("line").attr("x1",a-U1/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+(U1/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 ${Vy}`},r),e.height},"drawActorTypeActor"),P0r=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 O0r(t,e,r,n,o);case"participant":return await M0r(t,e,r,n,o);case"boundary":return await D0r(t,e,r,n,o);case"control":return await L0r(t,e,r,n,i,o);case"entity":return await I0r(t,e,r,n,o);case"database":return await N0r(t,e,r,n,o);case"collections":return await R0r(t,e,r,n,o);case"queue":return await _0r(t,e,r,n,o)}},"drawActor"),$0r=w(function(t,e,r){const i=t.append("g");QWe(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"),B0r=w(function(t){return t.append("g")},"anchorElement"),F0r=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=wE(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"),z0r=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=fee();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",KWe(f,g),g=JWe(),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 WI(f,g,e):q5(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 WI(f,g,e)):q5(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"),QWe=w(function(t,e){fIe(t,e)},"drawBackgroundRect"),V0r=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"),H0r=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"),G0r=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"),W0r=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"),q0r=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"),U0r=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"),Y0r=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"),j0r=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"),JWe=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"),X0r=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,rqe(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=NP(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")},tpr=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=fee();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 WI(i,a):q5(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"),U1e=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=aqe(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"),Hy=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),W2=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),yj=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function eqe(t,e){Lt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,s=Vt.splitBreaks(i).length,a=Ks(i),o=a?await QE(i,Ve()):Kr.calculateTextDimensions(i,Hy(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(eqe,"boundMessage");var rpr=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,Hy(tt)),g=fee();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 WI(t,g,{startx:a,stopx:o,starty:r}):q5(t,g);const m=p.width;let y;if(a===o){const x=f||tt.showSequenceNumbers,b=aqe(i,n),T=cpr(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)),wV(i,n)&&U1e(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),wV(i,n)&&U1e(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=HN(!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=wV(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"),npr=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"),vj=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"),tqe=w(function(t,e,r,n){let i=0,s=0;for(const a of r){const o=e.get(a),l=spr(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"),rqe=w(function(t){aa(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"),NP=w(function(t){return Lt.activations.filter(function(e){return e.actor===t})},"actorActivations"),Y1e=w(function(t,e){const r=e.get(t),n=NP(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=Hy(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 nqe(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]}));npr(d,f,p,y,0,v,!1);const k=await hpr(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,NP(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 tpr(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 eqe(d,W);nqe(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 vj(d,f,y,!1,e,n,S);for(const B of _)await rpr(d,B.messageModel,B.lineStartY,n,B.msg,e);tt.mirrorActors&&await vj(d,f,y,!0,e,n,S),P.forEach(B=>Di.drawBackgroundRect(d,B)),ZWe(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=tqe(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=Hy(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(sqe,"calculateActorMargins");var apr=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 QE(t.message,Ve()):Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,tt.width,W2(tt)):t.message,W2(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),W2(tt)):t.message,W2(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),Hy(tt)));const m=Kr.calculateTextDimensions(t.message,Hy(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"),hpr=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=NP(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 apr(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=upr(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"),dpr={bounds:Lt,drawActors:vj,drawActorsPopup:tqe,setConf:rqe,draw:ipr},fpr={parser:x0r,get db(){return new k0r},renderer:dpr,styles:E0r,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,GH({sequence:{wrap:t.wrap}}))},"init")};const ppr=Object.freeze(Object.defineProperty({__proto__:null,diagram:fpr},Symbol.toStringTag,{value:"Module"}));var bj=(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 ${LP}`},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"),O0r=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=Vy;n?v+=` ${ym}`:v+=` ${mm}`,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 ${Vy}`},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=Vy;n?y+=` ${ym}`:y+=` ${mm}`,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-U1/2*v).attr("y1",x+33*v).attr("x2",a+U1/2*v).attr("y2",x+33*v),m.append("line").attr("x1",a-U1/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+(U1/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 ${Vy}`},r),e.height},"drawActorTypeActor"),$0r=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 R0r(t,e,r,n,o);case"boundary":return await O0r(t,e,r,n,o);case"control":return await I0r(t,e,r,n,i,o);case"entity":return await N0r(t,e,r,n,o);case"database":return await D0r(t,e,r,n,o);case"collections":return await _0r(t,e,r,n,o);case"queue":return await L0r(t,e,r,n,o)}},"drawActor"),B0r=w(function(t,e,r){const i=t.append("g");JWe(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"),F0r=w(function(t){return t.append("g")},"anchorElement"),z0r=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=wE(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"),V0r=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=fee();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",ZWe(f,g),g=eqe(),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 WI(f,g,e):q5(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 WI(f,g,e)):q5(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"),JWe=w(function(t,e){pIe(t,e)},"drawBackgroundRect"),H0r=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"),G0r=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"),W0r=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"),q0r=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"),U0r=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"),Y0r=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"),j0r=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"),X0r=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"),eqe=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"),K0r=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,nqe(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=NP(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")},rpr=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=fee();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 WI(i,a):q5(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"),Y1e=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=oqe(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"),Hy=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),W2=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),yj=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function tqe(t,e){Lt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,s=Vt.splitBreaks(i).length,a=Ks(i),o=a?await QE(i,Ve()):Kr.calculateTextDimensions(i,Hy(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(tqe,"boundMessage");var npr=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,Hy(tt)),g=fee();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 WI(t,g,{startx:a,stopx:o,starty:r}):q5(t,g);const m=p.width;let y;if(a===o){const x=f||tt.showSequenceNumbers,b=oqe(i,n),T=upr(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)),wV(i,n)&&Y1e(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),wV(i,n)&&Y1e(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=HN(!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=wV(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"),ipr=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"),vj=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"),rqe=w(function(t,e,r,n){let i=0,s=0;for(const a of r){const o=e.get(a),l=apr(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"),nqe=w(function(t){aa(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"),NP=w(function(t){return Lt.activations.filter(function(e){return e.actor===t})},"actorActivations"),j1e=w(function(t,e){const r=e.get(t),n=NP(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=Hy(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 iqe(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]}));ipr(d,f,p,y,0,v,!1);const k=await dpr(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,NP(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 rpr(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 tqe(d,W);iqe(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 vj(d,f,y,!1,e,n,S);for(const B of _)await npr(d,B.messageModel,B.lineStartY,n,B.msg,e);tt.mirrorActors&&await vj(d,f,y,!0,e,n,S),P.forEach(B=>Di.drawBackgroundRect(d,B)),QWe(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=rqe(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=Hy(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(aqe,"calculateActorMargins");var opr=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 QE(t.message,Ve()):Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,tt.width,W2(tt)):t.message,W2(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),W2(tt)):t.message,W2(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),Hy(tt)));const m=Kr.calculateTextDimensions(t.message,Hy(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"),dpr=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=NP(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 opr(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=hpr(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"),fpr={bounds:Lt,drawActors:vj,drawActorsPopup:rqe,setConf:nqe,draw:spr},ppr={parser:w0r,get db(){return new S0r},renderer:fpr,styles:A0r,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,GH({sequence:{wrap:t.wrap}}))},"init")};const gpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ppr},Symbol.toStringTag,{value:"Module"}));var bj=(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})();bj.parser=bj;var oqe=bj,j1e=["#","+","~","-",""],CT,X1e=(CT=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+Sp(this.id);this.memberType==="method"&&(e+=`(${Sp(this.parameters.trim())})`,this.returnType&&(e+=" : "+Sp(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(j1e.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);j1e.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:""}${Sp(this.id)}${this.memberType==="method"?`(${Sp(this.parameters)})${this.returnType?" : "+Sp(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(CT,"ClassMember"),CT),cM="classId-",K1e=0,Gm=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),cg,lqe=(cg=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=pee();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=Gm(s[0]),n=Gm(s[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Vt.sanitizeText(e,Ve());r&&(r=Gm(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:cM+s+"-"+K1e}),K1e++}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(Gm(s.substring(2,s.length-2))):s.indexOf(")")>0?i.methods.push(new X1e(s,"method")):s&&i.members.push(new X1e(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)),Gm(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=cM+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=Gm(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=cM+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=Gm(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:Lb(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(cg,"ClassDB"),cg),gpr=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})();bj.parser=bj;var lqe=bj,X1e=["#","+","~","-",""],CT,K1e=(CT=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+Sp(this.id);this.memberType==="method"&&(e+=`(${Sp(this.parameters.trim())})`,this.returnType&&(e+=" : "+Sp(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(X1e.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);X1e.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:""}${Sp(this.id)}${this.memberType==="method"?`(${Sp(this.parameters)})${this.returnType?" : "+Sp(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(CT,"ClassMember"),CT),cM="classId-",Z1e=0,Gm=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),cg,cqe=(cg=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=pee();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=Gm(s[0]),n=Gm(s[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Vt.sanitizeText(e,Ve());r&&(r=Gm(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:cM+s+"-"+Z1e}),Z1e++}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(Gm(s.substring(2,s.length-2))):s.indexOf(")")>0?i.methods.push(new K1e(s,"method")):s&&i.members.push(new K1e(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)),Gm(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=cM+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=Gm(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=cM+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=Gm(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:Lb(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(cg,"ClassDB"),cg),mpr=w(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -4485,12 +4485,12 @@ g.classGroup line { text-align: center; } ${_7()} -`,"getStyles"),cqe=gpr,mpr=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"),ypr=w(function(t,e){return e.db.getClasses()},"getClasses"),vpr=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=R3(e,i);o.type=n.type,o.layoutAlgorithm=l7(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 h3(o,l);const u=8;Kr.insertTitle(l,"classDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),lv(l,u,"classDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),uqe={getClasses:ypr,draw:vpr,getDir:mpr},bpr={parser:oqe,get db(){return new lqe},renderer:uqe,styles:cqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const xpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:bpr},Symbol.toStringTag,{value:"Module"}));var wpr={parser:oqe,get db(){return new lqe},renderer:uqe,styles:cqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Tpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:wpr},Symbol.toStringTag,{value:"Module"}));var xj=(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)+`: +`,"getStyles"),uqe=mpr,ypr=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"),vpr=w(function(t,e){return e.db.getClasses()},"getClasses"),bpr=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=R3(e,i);o.type=n.type,o.layoutAlgorithm=l7(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 h3(o,l);const u=8;Kr.insertTitle(l,"classDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),lv(l,u,"classDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),hqe={getClasses:vpr,draw:bpr,getDir:ypr},xpr={parser:lqe,get db(){return new cqe},renderer:hqe,styles:uqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const wpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xpr},Symbol.toStringTag,{value:"Module"}));var Tpr={parser:lqe,get db(){return new cqe},renderer:hqe,styles:uqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Cpr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tpr},Symbol.toStringTag,{value:"Module"}));var xj=(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})();xj.parser=xj;var hqe=xj,Cpr="TB",dqe="TB",Z1e="dir",q2="state",u2="root",wj="relation",kpr="classDef",Spr="style",Epr="applyClass",MS="default",fqe="divider",pqe="fill:none",gqe="fill: #333",mqe="c",yqe="markdown",vqe="normal",TV="rect",CV="rectWithTitle",Apr="stateStart",Mpr="stateEnd",Q1e="divider",J1e="roundedWithTitle",Rpr="note",_pr="noteGroup",rA="statediagram",Lpr="state",Ipr=`${rA}-${Lpr}`,bqe="transition",Npr="note",Dpr="note-edge",Opr=`${bqe} ${Dpr}`,Ppr=`${rA}-${Npr}`,$pr="cluster",Bpr=`${rA}-${$pr}`,Fpr="cluster-alt",zpr=`${rA}-${Fpr}`,xqe="parent",wqe="note",Vpr="state",Nne="----",Hpr=`${Nne}${wqe}`,eye=`${Nne}${xqe}`,Tqe=w((t,e=dqe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Gpr=w(function(t,e){return e.db.getClasses()},"getClasses"),Wpr=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=R3(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 h3(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()),lv(l,h,rA,(s==null?void 0:s.useMaxWidth)??!0)},"draw"),qpr={getClasses:Gpr,draw:Wpr,getDir:Tqe},qR=new Map,Bp=0;function UR(t="",e=0,r="",n=Nne){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Vpr}-${t}${i}-${e}`}w(UR,"stateDomId");var Upr=w((t,e,r,n,i,s,a,o)=>{de.trace("items",e),e.forEach(l=>{switch(l.stmt){case q2:Lk(t,l,r,n,i,s,a,o);break;case MS:Lk(t,l,r,n,i,s,a,o);break;case wj:{Lk(t,l.state1,r,n,i,s,a,o),Lk(t,l.state2,r,n,i,s,a,o);const u=a==="neo",h={id:"edge"+Bp,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:pqe,labelStyle:"",label:Vt.sanitizeText(l.description??"",Ve()),arrowheadStyle:gqe,labelpos:mqe,labelType:yqe,thickness:vqe,classes:bqe,look:a};i.push(h),Bp++}break}})},"setupDoc"),tye=w((t,e=dqe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function _k(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(_k,"insertOrUpdateNode");function Cqe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(Cqe,"getClassesFromDbInfo");function kqe(t){return(t==null?void 0:t.styles)??[]}w(kqe,"getStylesFromDbInfo");var Lk=w((t,e,r,n,i,s,a,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Cqe(u),d=kqe(u),f=Ve();if(de.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=TV;e.start===!0?y=Apr:e.start===!1&&(y=Mpr),e.type!==MS&&(y=e.type),qR.get(l)||qR.set(l,{id:l,shape:y,description:Vt.sanitizeText(l,f),cssClasses:`${h} ${Ipr}`,cssStyles:d});const v=qR.get(l);e.description&&(Array.isArray(v.description)?(v.shape=CV,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=CV,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=TV,v.description=e.description),v.description=Vt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===CV&&(v.type==="group"?v.shape=J1e:v.shape=TV),!v.type&&e.doc&&(de.info("Setting cluster for XCX",l,tye(e)),v.type="group",v.isGroup=!0,v.dir=tye(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===fqe?Q1e:J1e,v.cssClasses=`${v.cssClasses} ${Bpr} ${s?zpr:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:UR(l,Bp),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:a,labelType:"markdown"};if(x.shape===Q1e&&(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:Rpr,label:e.note.text,labelType:"markdown",cssClasses:Ppr,cssStyles:[],cssCompiledStyles:[],id:l+Hpr+"-"+Bp,domId:UR(l,Bp,wqe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:a,position:e.note.position},T=l+eye,C={labelStyle:"",shape:_pr,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+eye,domId:UR(l,Bp,xqe),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position};Bp++,C.id=T,b.parentId=T,_k(n,C,o),_k(n,b,o),_k(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:pqe,labelStyle:"",classes:Opr,arrowheadStyle:gqe,labelpos:mqe,labelType:yqe,thickness:vqe,look:a})}else _k(n,x,o)}e.doc&&(de.trace("Adding nodes children "),Upr(e,e.doc,r,n,i,!s,a,o))},"dataFetcher"),Ypr=w(()=>{qR.clear(),Bp=0},"reset"),sl={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},rye=w(()=>new Map,"newClassesList"),nye=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),uM=w(t=>JSON.parse(JSON.stringify(t)),"clone"),cy,R1=(cy=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=rye(),this.documents={root:nye()},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 q2:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case wj:this.addRelation(i.state1,i.state2,i.description);break;case kpr:this.addStyleClass(i.id.trim(),i.classes);break;case Spr:this.handleStyleDef(i);break;case Epr: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();Ypr(),Lk(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===wj){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===q2&&(r.id===sl.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==u2&&r.stmt!==q2||!r.doc)return;const i=[];let s=[];for(const a of r.doc)if(a.type===fqe){const o=uM(a);o.doc=uM(s),i.push(o),s=[]}else s.push(a);if(i.length>0&&s.length>0){const a={stmt:q2,id:qCe(),type:"divider",doc:uM(s)};i.push(uM(a)),r.doc=i}r.doc.forEach(a=>this.docTranslator(r,a,!0))}getRootDocV2(){return this.docTranslator({id:u2,stmt:u2},{id:u2,stmt:u2,doc:this.rootDoc},!0),{id:u2,doc:this.rootDoc}}addState(e,r=MS,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:q2,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:nye()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=rye(),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===sl.START_NODE?(this.startEndCount++,`${sl.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=MS){return e===sl.START_NODE?sl.START_TYPE:r}endIdIfNeeded(e=""){return e===sl.END_NODE?(this.startEndCount++,`${sl.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=MS){return e===sl.END_NODE?sl.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(sl.STYLECLASS_SEP).forEach(i=>{const s=i.replace(/([^;]*);/,"$1").trim();if(RegExp(sl.COLOR_KEYWORD).exec(i)){const o=s.replace(sl.FILL_KEYWORD,sl.BG_FILL).replace(sl.COLOR_KEYWORD,sl.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(s)})}getClasses(){return this.classes}setupToolTips(e){const r=pee();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===Z1e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Cpr}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Z1e,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:Tqe(this.getRootDocV2())}}getConfig(){return Ve().state}},w(cy,"StateDB"),cy.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},cy),jpr=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})();xj.parser=xj;var dqe=xj,kpr="TB",fqe="TB",Q1e="dir",q2="state",u2="root",wj="relation",Spr="classDef",Epr="style",Apr="applyClass",MS="default",pqe="divider",gqe="fill:none",mqe="fill: #333",yqe="c",vqe="markdown",bqe="normal",TV="rect",CV="rectWithTitle",Mpr="stateStart",Rpr="stateEnd",J1e="divider",eye="roundedWithTitle",_pr="note",Lpr="noteGroup",rA="statediagram",Ipr="state",Npr=`${rA}-${Ipr}`,xqe="transition",Dpr="note",Opr="note-edge",Ppr=`${xqe} ${Opr}`,$pr=`${rA}-${Dpr}`,Bpr="cluster",Fpr=`${rA}-${Bpr}`,zpr="cluster-alt",Vpr=`${rA}-${zpr}`,wqe="parent",Tqe="note",Hpr="state",Nne="----",Gpr=`${Nne}${Tqe}`,tye=`${Nne}${wqe}`,Cqe=w((t,e=fqe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Wpr=w(function(t,e){return e.db.getClasses()},"getClasses"),qpr=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=R3(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 h3(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()),lv(l,h,rA,(s==null?void 0:s.useMaxWidth)??!0)},"draw"),Upr={getClasses:Wpr,draw:qpr,getDir:Cqe},qR=new Map,Bp=0;function UR(t="",e=0,r="",n=Nne){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Hpr}-${t}${i}-${e}`}w(UR,"stateDomId");var Ypr=w((t,e,r,n,i,s,a,o)=>{de.trace("items",e),e.forEach(l=>{switch(l.stmt){case q2:Lk(t,l,r,n,i,s,a,o);break;case MS:Lk(t,l,r,n,i,s,a,o);break;case wj:{Lk(t,l.state1,r,n,i,s,a,o),Lk(t,l.state2,r,n,i,s,a,o);const u=a==="neo",h={id:"edge"+Bp,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:gqe,labelStyle:"",label:Vt.sanitizeText(l.description??"",Ve()),arrowheadStyle:mqe,labelpos:yqe,labelType:vqe,thickness:bqe,classes:xqe,look:a};i.push(h),Bp++}break}})},"setupDoc"),rye=w((t,e=fqe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function _k(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(_k,"insertOrUpdateNode");function kqe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(kqe,"getClassesFromDbInfo");function Sqe(t){return(t==null?void 0:t.styles)??[]}w(Sqe,"getStylesFromDbInfo");var Lk=w((t,e,r,n,i,s,a,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=kqe(u),d=Sqe(u),f=Ve();if(de.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=TV;e.start===!0?y=Mpr:e.start===!1&&(y=Rpr),e.type!==MS&&(y=e.type),qR.get(l)||qR.set(l,{id:l,shape:y,description:Vt.sanitizeText(l,f),cssClasses:`${h} ${Npr}`,cssStyles:d});const v=qR.get(l);e.description&&(Array.isArray(v.description)?(v.shape=CV,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=CV,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=TV,v.description=e.description),v.description=Vt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===CV&&(v.type==="group"?v.shape=eye:v.shape=TV),!v.type&&e.doc&&(de.info("Setting cluster for XCX",l,rye(e)),v.type="group",v.isGroup=!0,v.dir=rye(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===pqe?J1e:eye,v.cssClasses=`${v.cssClasses} ${Fpr} ${s?Vpr:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:UR(l,Bp),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:a,labelType:"markdown"};if(x.shape===J1e&&(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:_pr,label:e.note.text,labelType:"markdown",cssClasses:$pr,cssStyles:[],cssCompiledStyles:[],id:l+Gpr+"-"+Bp,domId:UR(l,Bp,Tqe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:a,position:e.note.position},T=l+tye,C={labelStyle:"",shape:Lpr,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+tye,domId:UR(l,Bp,wqe),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position};Bp++,C.id=T,b.parentId=T,_k(n,C,o),_k(n,b,o),_k(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:gqe,labelStyle:"",classes:Ppr,arrowheadStyle:mqe,labelpos:yqe,labelType:vqe,thickness:bqe,look:a})}else _k(n,x,o)}e.doc&&(de.trace("Adding nodes children "),Ypr(e,e.doc,r,n,i,!s,a,o))},"dataFetcher"),jpr=w(()=>{qR.clear(),Bp=0},"reset"),sl={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},nye=w(()=>new Map,"newClassesList"),iye=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),uM=w(t=>JSON.parse(JSON.stringify(t)),"clone"),cy,R1=(cy=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=nye(),this.documents={root:iye()},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 q2:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case wj:this.addRelation(i.state1,i.state2,i.description);break;case Spr:this.addStyleClass(i.id.trim(),i.classes);break;case Epr:this.handleStyleDef(i);break;case Apr: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();jpr(),Lk(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===wj){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===q2&&(r.id===sl.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==u2&&r.stmt!==q2||!r.doc)return;const i=[];let s=[];for(const a of r.doc)if(a.type===pqe){const o=uM(a);o.doc=uM(s),i.push(o),s=[]}else s.push(a);if(i.length>0&&s.length>0){const a={stmt:q2,id:UCe(),type:"divider",doc:uM(s)};i.push(uM(a)),r.doc=i}r.doc.forEach(a=>this.docTranslator(r,a,!0))}getRootDocV2(){return this.docTranslator({id:u2,stmt:u2},{id:u2,stmt:u2,doc:this.rootDoc},!0),{id:u2,doc:this.rootDoc}}addState(e,r=MS,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:q2,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:iye()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=nye(),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===sl.START_NODE?(this.startEndCount++,`${sl.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=MS){return e===sl.START_NODE?sl.START_TYPE:r}endIdIfNeeded(e=""){return e===sl.END_NODE?(this.startEndCount++,`${sl.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=MS){return e===sl.END_NODE?sl.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(sl.STYLECLASS_SEP).forEach(i=>{const s=i.replace(/([^;]*);/,"$1").trim();if(RegExp(sl.COLOR_KEYWORD).exec(i)){const o=s.replace(sl.FILL_KEYWORD,sl.BG_FILL).replace(sl.COLOR_KEYWORD,sl.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(s)})}getClasses(){return this.classes}setupToolTips(e){const r=pee();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===Q1e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??kpr}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Q1e,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:Cqe(this.getRootDocV2())}}getConfig(){return Ve().state}},w(cy,"StateDB"),cy.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},cy),Xpr=w(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -4715,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"),Sqe=jpr,Xpr=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"),Kpr=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"),Zpr=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"),Qpr=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"),egr=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"),tgr=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"),rgr=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"),ngr=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}=rgr(t,0,0,n);return r.attr("height",s+2*Ve().state.noteMargin),r.attr("width",i+Ve().state.noteMargin*2),r},"drawNote"),iye=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"&&Xpr(i),e.type==="end"&&egr(i),(e.type==="fork"||e.type==="join")&&tgr(i,e),e.type==="note"&&ngr(e.note.text,i),e.type==="divider"&&Kpr(i),e.type==="default"&&e.descriptions.length===0&&Zpr(i,e),e.type==="default"&&e.descriptions.length>0&&Qpr(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"),sye=0,igr=w(function(t,e,r){const n=w(function(l){switch(l){case R1.relationType.AGGREGATION:return"aggregation";case R1.relationType.EXTENSION:return"extension";case R1.relationType.COMPOSITION:return"composition";case R1.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,s=b6().x(function(l){return l.x}).y(function(l){return l.y}).curve(x6),a=t.append("path").attr("d",s(i)).attr("id","edge"+sye).attr("class","transition");let o="";if(Ve().state.arrowMarkerAbsolute&&(o=HN(!0)),a.attr("marker-end","url("+o+"#"+n(R1.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)}sye++},"drawEdge"),_c,kV={},sgr=w(function(){},"setConf"),agr=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"),ogr=w(function(t,e,r,n){_c=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}']`);agr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Eqe(u,h,void 0,!1,a,o,n);const d=_c.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Fs(l,g,m,_c.useMaxWidth),l.attr("viewBox",`${f.x-_c.padding} ${f.y-_c.padding} `+p+" "+g)},"draw"),lgr=w(t=>t?t.length*_c.fontSizeFactor:1,"getLabelWidth"),Eqe=w((t,e,r,n,i,s,a)=>{const o=new Uo({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))),igr(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*_c.padding,y.height=m.height+2*_c.padding,de.debug("Doc rendered",y,o),y},"renderDoc"),cgr={setConf:sgr,draw:ogr},ugr={parser:hqe,get db(){return new R1(1)},renderer:cgr,styles:Sqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const hgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ugr},Symbol.toStringTag,{value:"Module"}));var dgr={parser:hqe,get db(){return new R1(2)},renderer:qpr,styles:Sqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const fgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:dgr},Symbol.toStringTag,{value:"Module"}));var Tj=(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"),Eqe=Xpr,Kpr=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"),Zpr=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"),Qpr=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"),Jpr=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"),egr=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"),tgr=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"),rgr=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"),ngr=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"),igr=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}=ngr(t,0,0,n);return r.attr("height",s+2*Ve().state.noteMargin),r.attr("width",i+Ve().state.noteMargin*2),r},"drawNote"),sye=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"&&Kpr(i),e.type==="end"&&tgr(i),(e.type==="fork"||e.type==="join")&&rgr(i,e),e.type==="note"&&igr(e.note.text,i),e.type==="divider"&&Zpr(i),e.type==="default"&&e.descriptions.length===0&&Qpr(i,e),e.type==="default"&&e.descriptions.length>0&&Jpr(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"),aye=0,sgr=w(function(t,e,r){const n=w(function(l){switch(l){case R1.relationType.AGGREGATION:return"aggregation";case R1.relationType.EXTENSION:return"extension";case R1.relationType.COMPOSITION:return"composition";case R1.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,s=b6().x(function(l){return l.x}).y(function(l){return l.y}).curve(x6),a=t.append("path").attr("d",s(i)).attr("id","edge"+aye).attr("class","transition");let o="";if(Ve().state.arrowMarkerAbsolute&&(o=HN(!0)),a.attr("marker-end","url("+o+"#"+n(R1.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)}aye++},"drawEdge"),_c,kV={},agr=w(function(){},"setConf"),ogr=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"),lgr=w(function(t,e,r,n){_c=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}']`);ogr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Aqe(u,h,void 0,!1,a,o,n);const d=_c.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Fs(l,g,m,_c.useMaxWidth),l.attr("viewBox",`${f.x-_c.padding} ${f.y-_c.padding} `+p+" "+g)},"draw"),cgr=w(t=>t?t.length*_c.fontSizeFactor:1,"getLabelWidth"),Aqe=w((t,e,r,n,i,s,a)=>{const o=new Uo({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))),sgr(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*_c.padding,y.height=m.height+2*_c.padding,de.debug("Doc rendered",y,o),y},"renderDoc"),ugr={setConf:agr,draw:lgr},hgr={parser:dqe,get db(){return new R1(1)},renderer:ugr,styles:Eqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const dgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:hgr},Symbol.toStringTag,{value:"Module"}));var fgr={parser:dqe,get db(){return new R1(2)},renderer:Upr,styles:Eqe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const pgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:fgr},Symbol.toStringTag,{value:"Module"}));var Tj=(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})();Tj.parser=Tj;var pgr=Tj,U5="",Dne=[],TE=[],CE=[],ggr=w(function(){Dne.length=0,TE.length=0,U5="",CE.length=0,Ri()},"clear"),mgr=w(function(t){U5=t,Dne.push(t)},"addSection"),ygr=w(function(){return Dne},"getSections"),vgr=w(function(){let t=aye();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),xgr=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:U5,type:U5,people:s,task:t,score:n};CE.push(a)},"addTask"),wgr=w(function(t){const e={section:U5,type:U5,description:t,task:t,classes:[]};TE.push(e)},"addTaskOrg"),aye=w(function(){const t=w(function(r){return CE[r].processed},"compileTask");let e=!0;for(const[r,n]of CE.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Tgr=w(function(){return bgr()},"getActors"),oye={getConfig:w(()=>Ve().journey,"getConfig"),clear:ggr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:mgr,getSections:ygr,getTasks:vgr,addTask:xgr,addTaskOrg:wgr,getActors:Tgr},Cgr=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})();Tj.parser=Tj;var ggr=Tj,U5="",Dne=[],TE=[],CE=[],mgr=w(function(){Dne.length=0,TE.length=0,U5="",CE.length=0,Ri()},"clear"),ygr=w(function(t){U5=t,Dne.push(t)},"addSection"),vgr=w(function(){return Dne},"getSections"),bgr=w(function(){let t=oye();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),wgr=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:U5,type:U5,people:s,task:t,score:n};CE.push(a)},"addTask"),Tgr=w(function(t){const e={section:U5,type:U5,description:t,task:t,classes:[]};TE.push(e)},"addTaskOrg"),oye=w(function(){const t=w(function(r){return CE[r].processed},"compileTask");let e=!0;for(const[r,n]of CE.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Cgr=w(function(){return xgr()},"getActors"),lye={getConfig:w(()=>Ve().journey,"getConfig"),clear:mgr,setDiagramTitle:Ji,getDiagramTitle:qi,setAccTitle:Hi,getAccTitle:ts,setAccDescription:rs,getAccDescription:ns,addSection:ygr,getSections:vgr,getTasks:bgr,addTask:wgr,addTaskOrg:Tgr,getActors:Cgr},kgr=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -4853,12 +4853,12 @@ Expecting `+G.join(", ")+", got '"+(this.terminals_[$]||$)+"'":W="Parse error on ${t.actor5?`fill: ${t.actor5}`:""}; } ${_7()} -`,"getStyles"),kgr=Cgr,One=w(function(t,e){return mO(t,e)},"drawRect"),Sgr=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=c5().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=c5().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"),Aqe=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"),Mqe=w(function(t,e){return VXt(t,e)},"drawText"),Egr=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,Mqe(t,e)},"drawLabel"),Agr=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,One(n,i),Rqe(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,Mgr=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"),Sgr(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,One(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};Aqe(s,d),l+=10}),Rqe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Rgr=w(function(t,e){fIe(t,e)},"drawBackgroundRect"),Rqe=(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};kE.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=kE.drawText(t,f).node().getBoundingClientRect().width;g>YR&&g>e.leftMargin-g&&(YR=g)}),n+=Math.max(20,u.length*20)})}w(_qe,"drawActorLegend");var Xu=Ve().journey,Np=0,Igr=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);kE.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++}),_qe(d),Np=Xu.leftMargin+YR,cu.insert(0,0,Np,Object.keys(jf).length*50),Ngr(d,f,0,e);const y=cu.getBounds();p&&d.append("text").text(p).attr("x",Np).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=Np+y.stopx+2*Xu.diagramMarginX;Fs(d,v,x,Xu.useMaxWidth),d.append("line").attr("x1",Np).attr("y1",Xu.height*4).attr("x2",x-Np-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")},SV=Xu.sectionFills,lye=Xu.sectionColours,Ngr=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=SV[l%SV.length],d=l%SV.length,h=lye[l%lye.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+Np,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,kE.drawTask(t,p,i,n),cu.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),cye={setConf:Lgr,draw:Igr},Dgr={parser:pgr,db:oye,renderer:cye,styles:kgr,init:w(t=>{cye.setConf(t.journey),oye.clear()},"init")};const Ogr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dgr},Symbol.toStringTag,{value:"Module"}));var kj=(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)+`: +`,"getStyles"),Sgr=kgr,One=w(function(t,e){return mO(t,e)},"drawRect"),Egr=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=c5().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=c5().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"),Mqe=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"),Rqe=w(function(t,e){return HXt(t,e)},"drawText"),Agr=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,Rqe(t,e)},"drawLabel"),Mgr=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,One(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"),Cj=-1,Rgr=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"),Egr(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,One(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};Mqe(s,d),l+=10}),_qe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),_gr=w(function(t,e){pIe(t,e)},"drawBackgroundRect"),_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{const s=jf[i].color,a={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:jf[i].position};kE.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=kE.drawText(t,f).node().getBoundingClientRect().width;g>YR&&g>e.leftMargin-g&&(YR=g)}),n+=Math.max(20,u.length*20)})}w(Lqe,"drawActorLegend");var Xu=Ve().journey,Np=0,Ngr=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);kE.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++}),Lqe(d),Np=Xu.leftMargin+YR,cu.insert(0,0,Np,Object.keys(jf).length*50),Dgr(d,f,0,e);const y=cu.getBounds();p&&d.append("text").text(p).attr("x",Np).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=Np+y.stopx+2*Xu.diagramMarginX;Fs(d,v,x,Xu.useMaxWidth),d.append("line").attr("x1",Np).attr("y1",Xu.height*4).attr("x2",x-Np-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")},SV=Xu.sectionFills,cye=Xu.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=SV[l%SV.length],d=l%SV.length,h=cye[l%cye.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+Np,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,kE.drawTask(t,p,i,n),cu.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),uye={setConf:Igr,draw:Ngr},Ogr={parser:ggr,db:lye,renderer:uye,styles:Sgr,init:w(t=>{uye.setConf(t.journey),lye.clear()},"init")};const Pgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ogr},Symbol.toStringTag,{value:"Module"}));var kj=(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})();kj.parser=kj;var Pgr=kj,Lqe={};zN(Lqe,{addEvent:()=>Vqe,addSection:()=>$qe,addTask:()=>zqe,addTaskOrg:()=>Hqe,clear:()=>Dqe,default:()=>$gr,getCommonDb:()=>Nqe,getDirection:()=>Pqe,getSections:()=>Bqe,getTasks:()=>Fqe,setDirection:()=>Oqe});var Y5="",Iqe=0,Pne="LR",$ne=[],qI=[],j5=[],Nqe=w(()=>EK,"getCommonDb"),Dqe=w(function(){$ne.length=0,qI.length=0,Y5="",j5.length=0,Pne="LR",Ri()},"clear"),Oqe=w(function(t){Pne=t},"setDirection"),Pqe=w(function(){return Pne},"getDirection"),$qe=w(function(t){Y5=t,$ne.push(t)},"addSection"),Bqe=w(function(){return $ne},"getSections"),Fqe=w(function(){let t=uye();const e=100;let r=0;for(;!t&&rr.id===Iqe-1).events.push(t)},"addEvent"),Hqe=w(function(t){const e={section:Y5,type:Y5,description:t,task:t,classes:[]};qI.push(e)},"addTaskOrg"),uye=w(function(){const t=w(function(r){return j5[r].processed},"compileTask");let e=!0;for(const[r,n]of j5.entries())t(r),e=e&&n.processed;return e},"compileTasks"),$gr={clear:Dqe,getCommonDb:Nqe,getDirection:Pqe,setDirection:Oqe,addSection:$qe,getSections:Bqe,getTasks:Fqe,addTask:zqe,addTaskOrg:Hqe,addEvent:Vqe},Gqe=0,DP=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"),Bgr=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=c5().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=c5().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"),Fgr=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"),Wqe=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"),zgr=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,Wqe(t,e)},"drawLabel"),Vgr=w(function(t,e,r){const n=t.append("g"),i=Bne();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,DP(n,i),qqe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Sj=-1,Hgr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");Sj++,s.append("line").attr("id",n+"-task"+Sj).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"),Bgr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Bne();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,DP(s,o),qqe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Ggr=w(function(t,e){DP(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Wgr=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Bne=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),qqe=(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(Fne,"wrap");var Ugr=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(Fne,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})`),jgr(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"),Ygr=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(Fne,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"),jgr=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-"+Gqe++).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"),uc={drawRect:DP,drawCircle:Fgr,drawSection:Vgr,drawText:Wqe,drawLabel:zgr,drawTask:Hgr,drawBackgroundRect:Ggr,getTextObj:Wgr,getNoteRect:Bne,initGraphics:qgr,drawNode:Ugr,getVirtualNodeHeight:Ygr},Xgr=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),uc.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=uc.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=uc.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+=uc.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=uc.drawNode(V,z,A,i,e);de.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&hye(m,F,A,k,E,T,i,_,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,A++}):(R=!1,hye(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)}o3(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),hye=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=uc.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+Kgr(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"),Kgr=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=uc.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"),Zgr={setConf:w(()=>{},"setConf"),draw:Xgr},OP=200,Df=5,Qgr=OP+Df*2,zne=OP+100,Jgr=zne+Df*2,Uqe=10,emr=0,dye=20,Yqe=20,fye=30,jqe=50,tmr=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=Ko(e);a.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();de.debug("task",o),uc.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=Qgr+Yqe,v=Jgr+jqe,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=uc.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:OP,padding:Df,maxHeight:d},H=uc.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:zne,padding:Df,maxHeight:50};G+=uc.getVirtualNodeHeight(a,K,i)}V.events.length>0&&(G+=(V.events.length-1)*Uqe),k=Math.max(k,G)+emr}de.debug("maxSectionHeight before draw",h),de.debug("maxTaskHeight before draw",d);const A=Math.max(d,k)+fye;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=uc.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+dye;V.length>0&&pye(a,V,b,C,K,d,i,A,!1);const q=V.length,oe=G.height+dye+A*Math.max(q,1)-(q>0?fye*2:0);p+=oe,b++}):pye(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(),o3(void 0,a,((D=i.timeline)==null?void 0:D.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),pye=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:OP,padding:Df,maxHeight:s};de.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=uc.drawNode(f,d,r,a),g=p.height;de.debug("taskHeight after draw",g);const m=n-Yqe-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+jqe;rmr(t,h.events,r,n,v,y,a)}i=i+o,l&&!((u=a.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),rmr=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:zne,padding:Df,maxHeight:0};de.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=uc.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+Uqe}return o-s},"drawEvents"),nmr={setConf:w(()=>{},"setConf"),draw:tmr},imr=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;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})();kj.parser=kj;var $gr=kj,Iqe={};zN(Iqe,{addEvent:()=>Hqe,addSection:()=>Bqe,addTask:()=>Vqe,addTaskOrg:()=>Gqe,clear:()=>Oqe,default:()=>Bgr,getCommonDb:()=>Dqe,getDirection:()=>$qe,getSections:()=>Fqe,getTasks:()=>zqe,setDirection:()=>Pqe});var Y5="",Nqe=0,Pne="LR",$ne=[],qI=[],j5=[],Dqe=w(()=>EK,"getCommonDb"),Oqe=w(function(){$ne.length=0,qI.length=0,Y5="",j5.length=0,Pne="LR",Ri()},"clear"),Pqe=w(function(t){Pne=t},"setDirection"),$qe=w(function(){return Pne},"getDirection"),Bqe=w(function(t){Y5=t,$ne.push(t)},"addSection"),Fqe=w(function(){return $ne},"getSections"),zqe=w(function(){let t=hye();const e=100;let r=0;for(;!t&&rr.id===Nqe-1).events.push(t)},"addEvent"),Gqe=w(function(t){const e={section:Y5,type:Y5,description:t,task:t,classes:[]};qI.push(e)},"addTaskOrg"),hye=w(function(){const t=w(function(r){return j5[r].processed},"compileTask");let e=!0;for(const[r,n]of j5.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Bgr={clear:Oqe,getCommonDb:Dqe,getDirection:$qe,setDirection:Pqe,addSection:Bqe,getSections:Fqe,getTasks:zqe,addTask:Vqe,addTaskOrg:Gqe,addEvent:Hqe},Wqe=0,DP=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"),Fgr=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=c5().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=c5().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"),zgr=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"),qqe=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"),Vgr=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,qqe(t,e)},"drawLabel"),Hgr=w(function(t,e,r){const n=t.append("g"),i=Bne();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,DP(n,i),Uqe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Sj=-1,Ggr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");Sj++,s.append("line").attr("id",n+"-task"+Sj).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"),Fgr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Bne();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,DP(s,o),Uqe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Wgr=w(function(t,e){DP(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),qgr=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Bne=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Uqe=(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(Fne,"wrap");var Ygr=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(Fne,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})`),Xgr(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"),jgr=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(Fne,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"),Xgr=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-"+Wqe++).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"),uc={drawRect:DP,drawCircle:zgr,drawSection:Hgr,drawText:qqe,drawLabel:Vgr,drawTask:Ggr,drawBackgroundRect:Wgr,getTextObj:qgr,getNoteRect:Bne,initGraphics:Ugr,drawNode:Ygr,getVirtualNodeHeight:jgr},Kgr=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),uc.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=uc.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=uc.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+=uc.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=uc.drawNode(V,z,A,i,e);de.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&dye(m,F,A,k,E,T,i,_,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,A++}):(R=!1,dye(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)}o3(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),dye=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=uc.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+Zgr(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"),Zgr=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=uc.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"),Qgr={setConf:w(()=>{},"setConf"),draw:Kgr},OP=200,Df=5,Jgr=OP+Df*2,zne=OP+100,emr=zne+Df*2,Yqe=10,tmr=0,fye=20,jqe=20,pye=30,Xqe=50,rmr=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=Ko(e);a.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();de.debug("task",o),uc.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=Jgr+jqe,v=emr+Xqe,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=uc.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:OP,padding:Df,maxHeight:d},H=uc.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:zne,padding:Df,maxHeight:50};G+=uc.getVirtualNodeHeight(a,K,i)}V.events.length>0&&(G+=(V.events.length-1)*Yqe),k=Math.max(k,G)+tmr}de.debug("maxSectionHeight before draw",h),de.debug("maxTaskHeight before draw",d);const A=Math.max(d,k)+pye;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=uc.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+fye;V.length>0&&gye(a,V,b,C,K,d,i,A,!1);const q=V.length,oe=G.height+fye+A*Math.max(q,1)-(q>0?pye*2:0);p+=oe,b++}):gye(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(),o3(void 0,a,((D=i.timeline)==null?void 0:D.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),gye=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:OP,padding:Df,maxHeight:s};de.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=uc.drawNode(f,d,r,a),g=p.height;de.debug("taskHeight after draw",g);const m=n-jqe-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+Xqe;nmr(t,h.events,r,n,v,y,a)}i=i+o,l&&!((u=a.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),nmr=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:zne,padding:Df,maxHeight:0};de.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=uc.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+Yqe}return o-s},"drawEvents"),imr={setConf:w(()=>{},"setConf"),draw:rmr},smr=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}=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{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"?nmr.draw(t,e,r,n):Zgr.draw(t,e,r,n)},"draw")},cmr={db:Lqe,renderer:lmr,parser:Pgr,styles:omr};const umr=Object.freeze(Object.defineProperty({__proto__:null,diagram:cmr},Symbol.toStringTag,{value:"Module"})),po=[];for(let t=0;t<256;++t)po.push((t+256).toString(16).slice(1));function hmr(t,e=0){return(po[t[e+0]]+po[t[e+1]]+po[t[e+2]]+po[t[e+3]]+"-"+po[t[e+4]]+po[t[e+5]]+"-"+po[t[e+6]]+po[t[e+7]]+"-"+po[t[e+8]]+po[t[e+9]]+"-"+po[t[e+10]]+po[t[e+11]]+po[t[e+12]]+po[t[e+13]]+po[t[e+14]]+po[t[e+15]]).toLowerCase()}const dmr=new Uint8Array(16);function fmr(){return crypto.getRandomValues(dmr)}function pmr(t,e,r){return crypto.randomUUID?crypto.randomUUID():gmr(t)}function gmr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??fmr();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,hmr(n)}var Ej=(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"),lmr=omr,cmr={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"?imr.draw(t,e,r,n):Qgr.draw(t,e,r,n)},"draw")},umr={db:Iqe,renderer:cmr,parser:$gr,styles:lmr};const hmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:umr},Symbol.toStringTag,{value:"Module"})),po=[];for(let t=0;t<256;++t)po.push((t+256).toString(16).slice(1));function dmr(t,e=0){return(po[t[e+0]]+po[t[e+1]]+po[t[e+2]]+po[t[e+3]]+"-"+po[t[e+4]]+po[t[e+5]]+"-"+po[t[e+6]]+po[t[e+7]]+"-"+po[t[e+8]]+po[t[e+9]]+"-"+po[t[e+10]]+po[t[e+11]]+po[t[e+12]]+po[t[e+13]]+po[t[e+14]]+po[t[e+15]]).toLowerCase()}const fmr=new Uint8Array(16);function pmr(){return crypto.getRandomValues(fmr)}function gmr(t,e,r){return crypto.randomUUID?crypto.randomUUID():mmr(t)}function mmr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??pmr();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,dmr(n)}var Ej=(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})();Ej.parser=Ej;var mmr=Ej,ymr=12,bf={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},kT,vmr=(kT=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%(ymr-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=dTe().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-"+pmr()}}getLogger(){return de}},w(kT,"MindmapDB"),kT),bmr=w(async(t,e,r,n)=>{var f,p;de.debug(`Rendering mindmap diagram -`+t);const i=n.db,s=i.getData(),a=R3(e,s.config.securityLevel);if(s.type=n.type,s.layoutAlgorithm=l7(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 h3(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)}lv(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"),xmr={draw:bmr},wmr=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})();Ej.parser=Ej;var ymr=Ej,vmr=12,bf={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},kT,bmr=(kT=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%(vmr-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=fTe().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-"+gmr()}}getLogger(){return de}},w(kT,"MindmapDB"),kT),xmr=w(async(t,e,r,n)=>{var f,p;de.debug(`Rendering mindmap diagram +`+t);const i=n.db,s=i.getData(),a=R3(e,s.config.securityLevel);if(s.type=n.type,s.layoutAlgorithm=l7(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 h3(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)}lv(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"),wmr={draw:xmr},Tmr=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"),kmr=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; } - ${wmr(t)} + ${Tmr(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -5066,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"),kmr=Cmr,Smr={get db(){return new vmr},renderer:xmr,parser:mmr,styles:kmr};const Emr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Smr},Symbol.toStringTag,{value:"Module"}));var Aj=(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?Cmr(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),Smr=kmr,Emr={get db(){return new bmr},renderer:wmr,parser:ymr,styles:Smr};const Amr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Emr},Symbol.toStringTag,{value:"Module"}));var Aj=(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})();Aj.parser=Aj;var Amr=Aj,hu=[],Vne=[],Mj=0,Hne={},Mmr=w(()=>{hu=[],Vne=[],Mj=0,Hne={}},"clear"),Rmr=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"),Lmr=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 Ca.ROUNDED_RECT:case Ca.RECT:case Ca.HEXAGON:a*=2}const o={id:Ln(e,s)||"kbn"+Mj++,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})();Aj.parser=Aj;var Mmr=Aj,hu=[],Vne=[],Mj=0,Hne={},Rmr=w(()=>{hu=[],Vne=[],Mj=0,Hne={}},"clear"),_mr=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"),Imr=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 Ca.ROUNDED_RECT:case Ca.RECT:case Ca.HEXAGON:a*=2}const o={id:Ln(e,s)||"kbn"+Mj++,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=tD(d,{schema:eD});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=Rmr(t);l?o.parentId=l.id||"kbn"+Mj++:Vne.push(o),hu.push(o)},"addNode"),Ca={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Imr=w((t,e)=>{switch(de.debug("In get type",t,e),t){case"[":return Ca.RECT;case"(":return e===")"?Ca.ROUNDED_RECT:Ca.CLOUD;case"((":return Ca.CIRCLE;case")":return Ca.CLOUD;case"))":return Ca.BANG;case"{{":return Ca.HEXAGON;default:return Ca.DEFAULT}},"getType"),Nmr=w((t,e)=>{Hne[t]=e},"setElementForId"),Dmr=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"),Omr=w(t=>{switch(t){case Ca.DEFAULT:return"no-border";case Ca.RECT:return"rect";case Ca.ROUNDED_RECT:return"rounded-rect";case Ca.CIRCLE:return"circle";case Ca.CLOUD:return"cloud";case Ca.BANG:return"bang";case Ca.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Pmr=w(()=>de,"getLogger"),$mr=w(t=>Hne[t],"getElementById"),Bmr={clear:Mmr,addNode:Lmr,getSections:Xqe,getData:_mr,nodeType:Ca,getType:Imr,setElementForId:Nmr,decorateNode:Dmr,type2Str:Omr,getLogger:Pmr,getElementById:$mr},Fmr=Bmr,zmr=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=Ko(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 cD(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 o7(u,N,{config:a})).node().getBBox();N.y=A+I.height/2,await m_(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)}o3(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"),Vmr={draw:zmr},Hmr=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 Ca.RECT;case"(":return e===")"?Ca.ROUNDED_RECT:Ca.CLOUD;case"((":return Ca.CIRCLE;case")":return Ca.CLOUD;case"))":return Ca.BANG;case"{{":return Ca.HEXAGON;default:return Ca.DEFAULT}},"getType"),Dmr=w((t,e)=>{Hne[t]=e},"setElementForId"),Omr=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"),Pmr=w(t=>{switch(t){case Ca.DEFAULT:return"no-border";case Ca.RECT:return"rect";case Ca.ROUNDED_RECT:return"rounded-rect";case Ca.CIRCLE:return"circle";case Ca.CLOUD:return"cloud";case Ca.BANG:return"bang";case Ca.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),$mr=w(()=>de,"getLogger"),Bmr=w(t=>Hne[t],"getElementById"),Fmr={clear:Rmr,addNode:Imr,getSections:Kqe,getData:Lmr,nodeType:Ca,getType:Nmr,setElementForId:Dmr,decorateNode:Omr,type2Str:Pmr,getLogger:$mr,getElementById:Bmr},zmr=Fmr,Vmr=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=Ko(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 cD(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 o7(u,N,{config:a})).node().getBBox();N.y=A+I.height/2,await m_(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)}o3(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"),Hmr={draw:Vmr},Gmr=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"),Wmr=w(t=>` .edge { stroke-width: 3; } - ${Hmr(t)} + ${Gmr(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -5155,14 +5155,14 @@ Expecting `+$e.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Fe="Parse erro text-align: center; } ${_7()} -`,"getStyles"),Wmr=Gmr,qmr={db:Fmr,renderer:Vmr,parser:Amr,styles:Wmr};const Umr=Object.freeze(Object.defineProperty({__proto__:null,diagram:qmr},Symbol.toStringTag,{value:"Module"}));function gye(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 Kqe(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 EV(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 Ymr(t){return t.target.depth}function jmr(t){return t.depth}function Xmr(t,e){return e-1-t.height}function Zqe(t,e){return t.sourceLinks.length?t.depth:e-1}function Kmr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Kqe(t.sourceLinks,Ymr)-1:0}function hM(t){return function(){return t}}function mye(t,e){return UI(t.source,e.source)||t.index-e.index}function yye(t,e){return UI(t.target,e.target)||t.index-e.index}function UI(t,e){return t.y0-e.y0}function AV(t){return t.value}function Zmr(t){return t.index}function Qmr(t){return t.nodes}function Jmr(t){return t.links}function vye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function bye({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 e1r(){let t=0,e=0,r=1,n=1,i=24,s=8,a,o=Zmr,l=Zqe,u,h,d=Qmr,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),bye(I),I}g.update=function(I){return bye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:hM(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:hM(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:hM(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:hM(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=vye(O,z)),typeof V!="object"&&(V=F.target=vye(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(EV($.sourceLinks,AV),EV($.targetLinks,AV)):$.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 $=gye(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 $=Kqe(I,O=>(n-e-(O.length-1)*a)/EV(O,AV));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(UI),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(UI),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(yye);for(const{target:{targetLinks:O}}of I)O.sort(mye)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(yye),O.sort(mye)}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 Rj=Math.PI,_j=2*Rj,l1=1e-6,t1r=_j-l1;function Lj(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qqe(){return new Lj}Lj.prototype=Qqe.prototype={constructor:Lj,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>l1)if(!(Math.abs(h*o-l*u)>l1)||!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((Rj-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,T=x/y;Math.abs(b-1)>l1&&(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)>l1||Math.abs(this._y1-u)>l1)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%_j+_j),d>t1r?this._+="A"+r+","+r+",0,1,"+h+","+(t-a)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>l1&&(this._+="A"+r+","+r+",0,"+ +(d>=Rj)+","+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 xye(t){return function(){return t}}function r1r(t){return t[0]}function n1r(t){return t[1]}var i1r=Array.prototype.slice;function s1r(t){return t.source}function a1r(t){return t.target}function o1r(t){var e=s1r,r=a1r,n=r1r,i=n1r,s=null;function a(){var o,l=i1r.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(s||(s=o=Qqe()),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:xye(+o),a):n},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:xye(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function l1r(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function c1r(){return o1r(l1r)}function u1r(t){return[t.source.x1,t.y0]}function h1r(t){return[t.target.x0,t.y1]}function d1r(){return c1r().source(u1r).target(h1r)}var Ij=(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)+`: +`,"getStyles"),qmr=Wmr,Umr={db:zmr,renderer:Hmr,parser:Mmr,styles:qmr};const Ymr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Umr},Symbol.toStringTag,{value:"Module"}));function mye(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 Zqe(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 EV(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 jmr(t){return t.target.depth}function Xmr(t){return t.depth}function Kmr(t,e){return e-1-t.height}function Qqe(t,e){return t.sourceLinks.length?t.depth:e-1}function Zmr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Zqe(t.sourceLinks,jmr)-1:0}function hM(t){return function(){return t}}function yye(t,e){return UI(t.source,e.source)||t.index-e.index}function vye(t,e){return UI(t.target,e.target)||t.index-e.index}function UI(t,e){return t.y0-e.y0}function AV(t){return t.value}function Qmr(t){return t.index}function Jmr(t){return t.nodes}function e1r(t){return t.links}function bye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function xye({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 t1r(){let t=0,e=0,r=1,n=1,i=24,s=8,a,o=Qmr,l=Qqe,u,h,d=Jmr,f=e1r,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),xye(I),I}g.update=function(I){return xye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:hM(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:hM(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:hM(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:hM(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=bye(O,z)),typeof V!="object"&&(V=F.target=bye(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(EV($.sourceLinks,AV),EV($.targetLinks,AV)):$.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 $=mye(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 $=Zqe(I,O=>(n-e-(O.length-1)*a)/EV(O,AV));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(UI),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(UI),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(vye);for(const{target:{targetLinks:O}}of I)O.sort(yye)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(vye),O.sort(yye)}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 Rj=Math.PI,_j=2*Rj,l1=1e-6,r1r=_j-l1;function Lj(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Jqe(){return new Lj}Lj.prototype=Jqe.prototype={constructor:Lj,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>l1)if(!(Math.abs(h*o-l*u)>l1)||!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((Rj-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,T=x/y;Math.abs(b-1)>l1&&(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)>l1||Math.abs(this._y1-u)>l1)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%_j+_j),d>r1r?this._+="A"+r+","+r+",0,1,"+h+","+(t-a)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>l1&&(this._+="A"+r+","+r+",0,"+ +(d>=Rj)+","+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 wye(t){return function(){return t}}function n1r(t){return t[0]}function i1r(t){return t[1]}var s1r=Array.prototype.slice;function a1r(t){return t.source}function o1r(t){return t.target}function l1r(t){var e=a1r,r=o1r,n=n1r,i=i1r,s=null;function a(){var o,l=s1r.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(s||(s=o=Jqe()),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:wye(+o),a):n},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:wye(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function c1r(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function u1r(){return l1r(c1r)}function h1r(t){return[t.source.x1,t.y0]}function d1r(t){return[t.target.x0,t.y1]}function f1r(){return u1r().source(h1r).target(d1r)}var Ij=(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})();Ij.parser=Ij;var YI=Ij,PP=[],$P=[],jI=new Map,f1r=w(()=>{PP=[],$P=[],jI=new Map,Ri()},"clear"),ST,p1r=(ST=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(ST,"SankeyLink"),ST),g1r=w((t,e,r)=>{PP.push(new p1r(t,e,r))},"addLink"),ET,m1r=(ET=class{constructor(e){this.ID=e}},w(ET,"SankeyNode"),ET),y1r=w(t=>{t=Vt.sanitizeText(t,Ve());let e=jI.get(t);return e===void 0&&(e=new m1r(t),jI.set(t,e),$P.push(e)),e},"findOrCreateNode"),v1r=w(()=>$P,"getNodes"),b1r=w(()=>PP,"getLinks"),x1r=w(()=>({nodes:$P.map(t=>({id:t.ID})),links:PP.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),w1r={nodesMap:jI,getConfig:w(()=>Ve().sankey,"getConfig"),getNodes:v1r,getLinks:b1r,getGraph:x1r,addLink:g1r,findOrCreateNode:y1r,getAccTitle:ts,setAccTitle:Hi,getAccDescription:ns,setAccDescription:rs,getDiagramTitle:qi,setDiagramTitle:Ji,clear:f1r},Xf,wye=(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),T1r={left:jmr,right:Xmr,center:Kmr,justify:Zqe},C1r=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"),k1r=w(function(t,e,r,n){const{securityLevel:i,sankey:s}=Ve(),a=bTe.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];e1r().nodeId(D=>D.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=C1r(C.nodes),A=ty(l4t),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=wye.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=wye.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",d1r()).attr("stroke",O).attr("stroke-width",D=>Math.max(1,D.width)),o3(void 0,u,0,f)},"draw"),S1r={draw:k1r},E1r=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})();Ij.parser=Ij;var YI=Ij,PP=[],$P=[],jI=new Map,p1r=w(()=>{PP=[],$P=[],jI=new Map,Ri()},"clear"),ST,g1r=(ST=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(ST,"SankeyLink"),ST),m1r=w((t,e,r)=>{PP.push(new g1r(t,e,r))},"addLink"),ET,y1r=(ET=class{constructor(e){this.ID=e}},w(ET,"SankeyNode"),ET),v1r=w(t=>{t=Vt.sanitizeText(t,Ve());let e=jI.get(t);return e===void 0&&(e=new y1r(t),jI.set(t,e),$P.push(e)),e},"findOrCreateNode"),b1r=w(()=>$P,"getNodes"),x1r=w(()=>PP,"getLinks"),w1r=w(()=>({nodes:$P.map(t=>({id:t.ID})),links:PP.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),T1r={nodesMap:jI,getConfig:w(()=>Ve().sankey,"getConfig"),getNodes:b1r,getLinks:x1r,getGraph:w1r,addLink:m1r,findOrCreateNode:v1r,getAccTitle:ts,setAccTitle:Hi,getAccDescription:ns,setAccDescription:rs,getDiagramTitle:qi,setDiagramTitle:Ji,clear:p1r},Xf,Tye=(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),C1r={left:Xmr,right:Kmr,center:Zmr,justify:Qqe},k1r=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"),S1r=w(function(t,e,r,n){const{securityLevel:i,sankey:s}=Ve(),a=xTe.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=C1r[p];t1r().nodeId(D=>D.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=k1r(C.nodes),A=ty(c4t),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=Tye.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=Tye.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",f1r()).attr("stroke",O).attr("stroke-width",D=>Math.max(1,D.width)),o3(void 0,u,0,f)},"draw"),E1r={draw:S1r},A1r=w(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),M1r=w(t=>`.label { font-family: ${t.fontFamily}; } @@ -5194,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"),M1r=A1r,R1r=YI.parse.bind(YI);YI.parse=t=>R1r(E1r(t));var _1r={styles:M1r,parser:YI,db:w1r,renderer:S1r};const L1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:_1r},Symbol.toStringTag,{value:"Module"}));var I1r=Sn.packet,AT,Jqe=(AT=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({...I1r,...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(AT,"PacketDB"),AT),N1r=1e4,D1r=w((t,e)=>{Hl(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"),eUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("packet",t),r=(n=eUe.parser)==null?void 0:n.yy;if(!(r instanceof Jqe))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),D1r(e,r)},"parse")},P1r=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=Ko(e);m.attr("viewBox",`0 0 ${g} ${p}`),Fs(m,p,g,s.useMaxWidth);for(const[y,v]of h.entries())$1r(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"),$1r=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"),B1r={draw:P1r},F1r={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z1r=w(({packet:t}={})=>{const e=es(F1r,t);return` +`,"getStyles"),R1r=M1r,_1r=YI.parse.bind(YI);YI.parse=t=>_1r(A1r(t));var L1r={styles:R1r,parser:YI,db:T1r,renderer:E1r};const I1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:L1r},Symbol.toStringTag,{value:"Module"}));var N1r=Sn.packet,AT,eUe=(AT=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({...N1r,...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(AT,"PacketDB"),AT),D1r=1e4,O1r=w((t,e)=>{Hl(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"),tUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("packet",t),r=(n=tUe.parser)==null?void 0:n.yy;if(!(r instanceof eUe))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),O1r(e,r)},"parse")},$1r=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=Ko(e);m.attr("viewBox",`0 0 ${g} ${p}`),Fs(m,p,g,s.useMaxWidth);for(const[y,v]of h.entries())B1r(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"),B1r=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"),F1r={draw:$1r},z1r={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},V1r=w(({packet:t}={})=>{const e=es(z1r,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -5217,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"),V1r={parser:eUe,get db(){return new Jqe},renderer:B1r,styles:z1r};const H1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:V1r},Symbol.toStringTag,{value:"Module"}));var U2={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},dM=32,tUe={axes:[],curves:[],options:U2},Td=structuredClone(tUe),G1r=Sn.radar,W1r=w(()=>es({...G1r,...br().radar}),"getConfig"),rUe=w(()=>Td.axes,"getAxes"),q1r=w(()=>Td.curves,"getCurves"),U1r=w(()=>Td.options,"getOptions"),Y1r=w(t=>{Td.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),j1r=w(t=>{Td.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:X1r(e.entries)}))},"setCurves"),X1r=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=rUe();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"),K1r=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)??U2.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??U2.ticks,max:((i=e.max)==null?void 0:i.value)??U2.max,min:((s=e.min)==null?void 0:s.value)??U2.min,graticule:((a=e.graticule)==null?void 0:a.value)??U2.graticule},Td.options.ticks>dM&&(de.warn(`Radar diagram ticks (${Td.options.ticks}) exceeds maximum allowed (${dM}). Using ${dM} instead.`),Td.options.ticks=dM)},"setOptions"),Z1r=w(()=>{Ri(),Td=structuredClone(tUe)},"clear"),Ik={getAxes:rUe,getCurves:q1r,getOptions:U1r,setAxes:Y1r,setCurves:j1r,setOptions:K1r,getConfig:W1r,clear:Z1r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Q1r=w(t=>{Hl(t,Ik);const{axes:e,curves:r,options:n}=t;Ik.setAxes(e),Ik.setCurves(r),Ik.setOptions(n)},"populate"),J1r={parse:w(async t=>{const e=await zu("radar",t);de.debug(e),Q1r(e)},"parse")},eyr=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=Ko(e),d=tyr(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;ryr(d,s,g,o.ticks,o.graticule),nyr(d,s,g,l),nUe(d,s,a,p,f,o.graticule,l),aUe(d,a,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),tyr=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"),ryr=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"),nyr=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 nUe(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=iUe(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",sUe(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(nUe,"drawCurves");function iUe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(iUe,"relativeRadius");function sUe(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(aUe,"drawLegend");var iyr={draw:eyr},syr=w((t,e)=>{let r="";for(let n=0;nes({...W1r,...br().radar}),"getConfig"),nUe=w(()=>Td.axes,"getAxes"),U1r=w(()=>Td.curves,"getCurves"),Y1r=w(()=>Td.options,"getOptions"),j1r=w(t=>{Td.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),X1r=w(t=>{Td.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:K1r(e.entries)}))},"setCurves"),K1r=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=nUe();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"),Z1r=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)??U2.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??U2.ticks,max:((i=e.max)==null?void 0:i.value)??U2.max,min:((s=e.min)==null?void 0:s.value)??U2.min,graticule:((a=e.graticule)==null?void 0:a.value)??U2.graticule},Td.options.ticks>dM&&(de.warn(`Radar diagram ticks (${Td.options.ticks}) exceeds maximum allowed (${dM}). Using ${dM} instead.`),Td.options.ticks=dM)},"setOptions"),Q1r=w(()=>{Ri(),Td=structuredClone(rUe)},"clear"),Ik={getAxes:nUe,getCurves:U1r,getOptions:Y1r,setAxes:j1r,setCurves:X1r,setOptions:Z1r,getConfig:q1r,clear:Q1r,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},J1r=w(t=>{Hl(t,Ik);const{axes:e,curves:r,options:n}=t;Ik.setAxes(e),Ik.setCurves(r),Ik.setOptions(n)},"populate"),eyr={parse:w(async t=>{const e=await zu("radar",t);de.debug(e),J1r(e)},"parse")},tyr=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=Ko(e),d=ryr(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;nyr(d,s,g,o.ticks,o.graticule),iyr(d,s,g,l),iUe(d,s,a,p,f,o.graticule,l),oUe(d,a,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),ryr=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"),nyr=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"),iyr=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 iUe(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=sUe(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",aUe(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(iUe,"drawCurves");function sUe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(sUe,"relativeRadius");function aUe(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(oUe,"drawLegend");var syr={draw:tyr},ayr=w((t,e)=>{let r="";for(let n=0;nb==="outlined"?(D.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),ayr=w(t=>{const e=V0(),r=br(),n=es(e,r.themeVariables),i=es(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),oyr=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=ayr(t);return` + `}return r},"genIndexStyles"),oyr=w(t=>{const e=V0(),r=br(),n=es(e,r.themeVariables),i=es(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),lyr=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=oyr(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -5256,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; } - ${syr(e,r)} - `},"styles"),lyr={parser:J1r,db:Ik,renderer:iyr,styles:oyr};const cyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:lyr},Symbol.toStringTag,{value:"Module"}));var Nj=(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)+`: + ${ayr(e,r)} + `},"styles"),cyr={parser:eyr,db:Ik,renderer:syr,styles:lyr};const uyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:cyr},Symbol.toStringTag,{value:"Module"}));var Nj=(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})();Nj.parser=Nj;var uyr=Nj,Sh=new Map,Gne=[],Dj=new Map,Tye="color",Cye="fill",hyr="bgFill",oUe=",",XI=new Map,Wne="",dyr=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),fyr=w(function(t,e=""){let r=XI.get(t);r||(r={id:t,styles:[],textStyles:[]},XI.set(t,r)),e!=null&&e.split(oUe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Tye).exec(n)){const a=i.replace(Cye,hyr).replace(Tye,Cye);r.textStyles.push(a)}r.styles.push(i)})},"addStyleClass"),pyr=w(function(t,e=""){const r=Sh.get(t);e!=null&&(r.styles=e.split(oUe))},"addStyle2Node"),gyr=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"),lUe=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=dyr(a.label)),a.type==="classDef"){fyr(a.id,a.css);continue}if(a.type==="applyClass"){gyr(a.id,(a==null?void 0:a.styleClass)??"");continue}if(a.type==="applyStyles"){a!=null&&a.stylesStr&&pyr(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=(Dj.get(a.id)??0)+1;Dj.set(a.id,o),a.id=o+"-"+a.id,Gne.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&&lUe(a.children,a),a.type==="space"){const l=a.width??1;for(let u=0;u{de.debug("Clear called"),Ri(),RS={id:"root",type:"composite",children:[],columns:-1},Sh=new Map([["root",RS]]),qne=[],XI=new Map,Gne=[],Dj=new Map,Wne=""},"clear");function cUe(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(cUe,"typeStr2Type");function uUe(t){switch(de.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(uUe,"edgeTypeStr2Type");function hUe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(hUe,"edgeStrToEdgeData");function dUe(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(dUe,"edgeStrToEdgeStartData");function fUe(t){return t.includes("==")?"thick":"normal"}w(fUe,"edgeStrToThickness");function pUe(t){return t.includes(".-")?"dotted":"solid"}w(pUe,"edgeStrToPattern");var kye=0,yyr=w(()=>(kye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+kye),"generateId"),vyr=w(t=>{RS.children=t,lUe(t,RS),qne=RS.children},"setHierarchy"),byr=w(t=>{const e=Sh.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),xyr=w(()=>[...Sh.values()],"getBlocksFlat"),wyr=w(()=>qne||[],"getBlocks"),Tyr=w(()=>Gne,"getEdges"),Cyr=w(t=>Sh.get(t),"getBlock"),kyr=w(t=>{Sh.set(t.id,t)},"setBlock"),Syr=w(t=>{Wne=t},"setDiagramId"),Eyr=w(()=>Wne,"getDiagramId"),Ayr=w(()=>de,"getLogger"),Myr=w(function(){return XI},"getClasses"),Ryr={getConfig:w(()=>br().block,"getConfig"),typeStr2Type:cUe,edgeTypeStr2Type:uUe,edgeStrToEdgeData:hUe,edgeStrToEdgeStartData:dUe,edgeStrToThickness:fUe,edgeStrToPattern:pUe,getLogger:Ayr,getBlocksFlat:xyr,getBlocks:wyr,getEdges:Tyr,setHierarchy:vyr,getBlock:Cyr,setBlock:kyr,getColumns:byr,getClasses:Myr,clear:myr,generateId:yyr,setDiagramId:Syr,getDiagramId:Eyr},_yr=Ryr,MV=w((t,e)=>{const r=CK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),Lyr=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})();Nj.parser=Nj;var hyr=Nj,Sh=new Map,Gne=[],Dj=new Map,Cye="color",kye="fill",dyr="bgFill",lUe=",",XI=new Map,Wne="",fyr=w(t=>Vt.sanitizeText(t,Ve()),"sanitizeText"),pyr=w(function(t,e=""){let r=XI.get(t);r||(r={id:t,styles:[],textStyles:[]},XI.set(t,r)),e!=null&&e.split(lUe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Cye).exec(n)){const a=i.replace(kye,dyr).replace(Cye,kye);r.textStyles.push(a)}r.styles.push(i)})},"addStyleClass"),gyr=w(function(t,e=""){const r=Sh.get(t);e!=null&&(r.styles=e.split(lUe))},"addStyle2Node"),myr=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"),cUe=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=fyr(a.label)),a.type==="classDef"){pyr(a.id,a.css);continue}if(a.type==="applyClass"){myr(a.id,(a==null?void 0:a.styleClass)??"");continue}if(a.type==="applyStyles"){a!=null&&a.stylesStr&&gyr(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=(Dj.get(a.id)??0)+1;Dj.set(a.id,o),a.id=o+"-"+a.id,Gne.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&&cUe(a.children,a),a.type==="space"){const l=a.width??1;for(let u=0;u{de.debug("Clear called"),Ri(),RS={id:"root",type:"composite",children:[],columns:-1},Sh=new Map([["root",RS]]),qne=[],XI=new Map,Gne=[],Dj=new Map,Wne=""},"clear");function uUe(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(uUe,"typeStr2Type");function hUe(t){switch(de.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(hUe,"edgeTypeStr2Type");function dUe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(dUe,"edgeStrToEdgeData");function fUe(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(fUe,"edgeStrToEdgeStartData");function pUe(t){return t.includes("==")?"thick":"normal"}w(pUe,"edgeStrToThickness");function gUe(t){return t.includes(".-")?"dotted":"solid"}w(gUe,"edgeStrToPattern");var Sye=0,vyr=w(()=>(Sye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Sye),"generateId"),byr=w(t=>{RS.children=t,cUe(t,RS),qne=RS.children},"setHierarchy"),xyr=w(t=>{const e=Sh.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),wyr=w(()=>[...Sh.values()],"getBlocksFlat"),Tyr=w(()=>qne||[],"getBlocks"),Cyr=w(()=>Gne,"getEdges"),kyr=w(t=>Sh.get(t),"getBlock"),Syr=w(t=>{Sh.set(t.id,t)},"setBlock"),Eyr=w(t=>{Wne=t},"setDiagramId"),Ayr=w(()=>Wne,"getDiagramId"),Myr=w(()=>de,"getLogger"),Ryr=w(function(){return XI},"getClasses"),_yr={getConfig:w(()=>br().block,"getConfig"),typeStr2Type:uUe,edgeTypeStr2Type:hUe,edgeStrToEdgeData:dUe,edgeStrToEdgeStartData:fUe,edgeStrToThickness:pUe,edgeStrToPattern:gUe,getLogger:Myr,getBlocksFlat:wyr,getBlocks:Tyr,getEdges:Cyr,setHierarchy:byr,getBlock:kyr,setBlock:Syr,getColumns:xyr,getClasses:Ryr,clear:yyr,generateId:vyr,setDiagramId:Eyr,getDiagramId:Ayr},Lyr=_yr,MV=w((t,e)=>{const r=CK,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return gh(n,i,s,e)},"fade"),Iyr=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -5385,13 +5385,13 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error fill: ${t.textColor}; } ${_7()} -`,"getStyles"),Iyr=Lyr,Nyr=w((t,e,r,n)=>{e.forEach(i=>{Gyr[i](t,r,n)})},"insertMarkers"),Dyr=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"),Oyr=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"),Pyr=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"),$yr=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"),Byr=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"),Fyr=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"),zyr=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"),Vyr=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"),Hyr=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"),Gyr={extension:Dyr,composition:Oyr,aggregation:Pyr,dependency:$yr,lollipop:Byr,point:Fyr,circle:zyr,cross:Vyr,barb:Hyr},Wyr=Nyr;function Oj(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(Oj,"calculateBlockPosition");var qyr=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 KI(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)KI(A,e,0,0,i);const x=qyr(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)KI(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(KI,"setBlockSizes");function Une(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}=Oj(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}=Oj(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&&Une(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(Une,"layoutBlocks");function Yne(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}=Yne(s,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(Yne,"findBounds");function gUe(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;KI(e,t,0,0,r),Une(e,t,r),de.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:s,maxY:a}=Yne(e),o=a-i,l=s-n;return{x:n,y:i,width:l,height:o}}w(gUe,"layout");var Uyr=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=di(a);return await Qo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),uh=Uyr,Yyr=w((t,e,r,n,i)=>{e.arrowTypeStart&&Sye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Sye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),jyr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Sye=w((t,e,r,n,i,s)=>{const a=jyr[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"),Pj={},$o={},Xyr=w(async(t,e)=>{const r=Ve(),n=di(r),i=t.insert("g").attr("class","edgeLabel"),s=i.insert("g").attr("class","label"),a=e.labelType==="markdown",o=await Qo(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)),Pj[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)),$o[e.id]||($o[e.id]={}),$o[e.id].startLeft=d,Nk(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)),$o[e.id]||($o[e.id]={}),$o[e.id].startRight=d,Nk(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)),$o[e.id]||($o[e.id]={}),$o[e.id].endLeft=d,Nk(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)),$o[e.id]||($o[e.id]={}),$o[e.id].endRight=d,Nk(h,e.endLabelRight)}return o},"insertEdgeLabel");function Nk(t,e){di(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(Nk,"setTerminalWidth");var Kyr=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,Pj[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=c3(n);if(t.label){const s=Pj[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=$o[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=$o[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=$o[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=$o[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"),Zyr=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"),Qyr=w((t,e,r)=>{de.debug(`intersection calc abc89: +`,"getStyles"),Nyr=Iyr,Dyr=w((t,e,r,n)=>{e.forEach(i=>{Wyr[i](t,r,n)})},"insertMarkers"),Oyr=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"),$yr=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"),Byr=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"),Fyr=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"),zyr=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"),Vyr=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"),Hyr=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"),Gyr=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"),Wyr={extension:Oyr,composition:Pyr,aggregation:$yr,dependency:Byr,lollipop:Fyr,point:zyr,circle:Vyr,cross:Hyr,barb:Gyr},qyr=Dyr;function Oj(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(Oj,"calculateBlockPosition");var Uyr=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 KI(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)KI(A,e,0,0,i);const x=Uyr(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)KI(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(KI,"setBlockSizes");function Une(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}=Oj(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}=Oj(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&&Une(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(Une,"layoutBlocks");function Yne(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}=Yne(s,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(Yne,"findBounds");function mUe(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;KI(e,t,0,0,r),Une(e,t,r),de.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:s,maxY:a}=Yne(e),o=a-i,l=s-n;return{x:n,y:i,width:l,height:o}}w(mUe,"layout");var Yyr=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=di(a);return await Qo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),uh=Yyr,jyr=w((t,e,r,n,i)=>{e.arrowTypeStart&&Eye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Eye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Xyr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Eye=w((t,e,r,n,i,s)=>{const a=Xyr[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"),Pj={},$o={},Kyr=w(async(t,e)=>{const r=Ve(),n=di(r),i=t.insert("g").attr("class","edgeLabel"),s=i.insert("g").attr("class","label"),a=e.labelType==="markdown",o=await Qo(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)),Pj[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)),$o[e.id]||($o[e.id]={}),$o[e.id].startLeft=d,Nk(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)),$o[e.id]||($o[e.id]={}),$o[e.id].startRight=d,Nk(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)),$o[e.id]||($o[e.id]={}),$o[e.id].endLeft=d,Nk(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)),$o[e.id]||($o[e.id]={}),$o[e.id].endRight=d,Nk(h,e.endLabelRight)}return o},"insertEdgeLabel");function Nk(t,e){di(Ve())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(Nk,"setTerminalWidth");var Zyr=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,Pj[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ve(),{subGraphTitleTotalMargin:i}=c3(n);if(t.label){const s=Pj[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=$o[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=$o[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=$o[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=$o[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"),Qyr=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"),Jyr=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(!Zyr(e,s)&&!i){const a=Qyr(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=Eye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(de.debug("from cluster abc88",n[r.fromCluster]),o=Eye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=x6;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=e6e(r),m=b6().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=HN(!0)),Yyr(v,r,x,a,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),evr=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"),tvr=w((t,e,r,n)=>{const i=evr(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 mUe(t,e){return t.intersect(e)}w(mUe,"intersectNode");var rvr=mUe;function yUe(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($j,"sameSign");var ivr=xUe,svr=wUe;function wUe(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"),ovr=avr,ps={node:rvr,circle:nvr,ellipse:vUe,polygon:svr,rect:ovr},ao=w(async(t,e,r,n)=>{const i=Ve();let s;const a=e.useHtmlLabels||di(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=Qo(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(di(i)){const p=h.children[0],g=wt(h);await pZ(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 lvr=w(async(t,e)=>{e.useHtmlLabels||di(Ve())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:s}=await ao(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"),cvr=lvr,Aye=w(t=>t?" "+t:"","formatClass"),eu=w((t,e)=>`${e||"node default"}${Aye(t.classes)} ${Aye(t.class)}`,"getClassesFromNode"),Mye=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),uvr=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"),hvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),dvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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=tvr(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"),fvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),pvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),gvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),mvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),yvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),vvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),bvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),xvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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&&(BP(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"),wvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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&&(BP(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 ao(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&&(BP(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 BP(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(BP,"applyNodePropertyBorders");var Cvr=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(di(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(di(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 ao(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"),Svr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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"),Evr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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"),Avr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),Mvr=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"),Rye=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"),Rvr=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"),_vr=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(di(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!==""&&(di(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(di(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;di(Ve())&&(_=_.replace(//g,">"));const P=await uh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(di(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;di(Ve())&&(_=_.replace(//g,">"));const P=await uh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(di(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"),_ye={rhombus:Mye,composite:wvr,question:Mye,rect:xvr,labelRect:Tvr,rectWithTitle:Cvr,choice:uvr,circle:Svr,doublecircle:Evr,stadium:kvr,hexagon:hvr,block_arrow:dvr,rect_left_inv_arrow:fvr,lean_right:pvr,lean_left:gvr,trapezoid:mvr,inv_trapezoid:yvr,rect_right_inv_arrow:vvr,cylinder:bvr,start:Mvr,end:Rvr,note:cvr,subroutine:Avr,fork:Rye,join:Rye,class_box:_vr},jR={},TUe=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 _ye[e.shape](n,e,r)}else i=await _ye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),jR[e.id]=n,e.haveCallback&&jR[e.id].attr("class",jR[e.id].attr("class")+" clickable"),n},"insertNode"),Lvr=w(t=>{const e=jR[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 jne(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=dZ((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(jne,"getNodeFromBlock");async function CUe(t,e,r){const n=jne(e,r,!1);if(n.type==="group")return;const i=br(),s=await TUe(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(CUe,"calculateBlockSize");async function kUe(t,e,r){const n=jne(e,r,!0);if(r.getBlock(n.id).type!=="space"){const s=br();await TUe(t,n,{config:s}),e.intersect=n==null?void 0:n.intersect,Lvr(n)}}w(kUe,"insertBlockPositioned");async function FP(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await FP(t,i.children,r,n)}w(FP,"performOperations");async function SUe(t,e,r){await FP(t,e,r,CUe)}w(SUe,"calculateBlockSizes");async function EUe(t,e,r){await FP(t,e,r,kUe)}w(EUe,"insertBlocks");async function AUe(t,e,r,n,i){const s=new Uo({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 Xyr(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m}),Kyr({...a,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(AUe,"insertEdges");var Ivr=w(function(t,e){return e.db.getClasses()},"getClasses"),Nvr=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}"]`);Wyr(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 SUe(g,d,a);const m=gUe(a);if(await EUe(g,d,a),await AUe(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"),Dvr={draw:Nvr,getClasses:Ivr},Ovr={parser:uyr,db:_yr,renderer:Dvr,styles:Iyr};const Pvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ovr},Symbol.toStringTag,{value:"Module"}));var MUe=/[─━│┃└┗├┣]/,RUe=/[└┗├┣]/,$vr=/[─━]/,Lye=/^[\s│┃]+$/,Iye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Nye=/^\s*%%/,Bvr=" ";function _Ue(t){return t.some(e=>MUe.test(e))}w(_Ue,"isBoxDrawingFormat");function LUe(t){for(const e of t){const r=RUe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(LUe,"inferSegmentWidth");function IUe(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(IUe,"remapErrorLines");function NUe(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:[]}]})),Fvr=w(()=>{ld.reset(),Ri()},"clear"),zvr=w(()=>ld.records.stack[0],"getRoot"),Vvr=w(()=>ld.records.cnt,"getCount"),Hvr=Sn.treeView,Gvr=w(()=>es(Hvr,br().treeView),"getConfig"),Wvr=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"),qvr={clear:Fvr,addNode:Wvr,getRoot:zvr,getCount:Vvr,getConfig:Gvr,getAccTitle:ts,getAccDescription:ns,getDiagramTitle:qi,setAccDescription:rs,setAccTitle:Hi,setDiagramTitle:Ji},Bj=qvr,Uvr=w(t=>{Hl(t,Bj);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;Bj.addNode(r,n,s,a,l,h)}},"populate"),Yvr={parse:w(async t=>{const{text:e,lineMap:r}=NUe(t);try{const n=await zu("treeView",e);de.debug(n),Uvr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=IUe(n.message,r)),n}},"parse")},SE={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function DUe(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(DUe,"detectIcon");function Fj(t,e){return t.includes(":")?t:t in SE.icons||!e?`${SE.prefix}:${t}`:`${e}:${t}`}w(Fj,"qualifyIcon");function Xne(t,e){if(t.icon!=="none"){if(t.icon)return Fj(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=DUe(t.name,e);if(r==="none")return;if(r)return Fj(r,e.defaultIconPack)}return`${SE.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(Xne,"getNodeIcon");gZ([{name:SE.prefix,icons:SE}]);var zj=14,jvr=4,Xvr=16,OUe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),Kvr=w(async(t,e,r,n)=>{const i=new Set,s=w(l=>{const u=Xne(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:zj,width:zj})}))),o=t.append("defs");for(const{icon:l,svg:u}of a)o.append("g").attr("id",OUe(n,l)).html(u)},"injectIconDefs"),Zvr=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=zj+jvr,u=Xne(r,i),h=u!==void 0;u&&a.append("use").attr("xlink:href",`#${OUe(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"),Dye=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"),Qvr=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=Zvr(m,i,f,d,p,n);a.push(y);const{height:v,width:x}=f.BBox;Dye(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;Dye(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))+Xvr;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=Ko(e);await Kvr(o,s,a,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=Qvr(l,s,a,e);o.attr("viewBox",`-${a.lineThickness/2} 0 ${h} ${u}`),Fs(o,u,h,a.useMaxWidth)},"draw"),e2r={draw:Jvr},t2r=e2r,r2r={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},n2r=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:s,highlightBg:a,highlightStroke:o}=es(r2r,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(!Qyr(e,s)&&!i){const a=Jyr(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"),evr=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=Aye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(de.debug("from cluster abc88",n[r.fromCluster]),o=Aye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=x6;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=t6e(r),m=b6().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=HN(!0)),jyr(v,r,x,a,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),tvr=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"),rvr=w((t,e,r,n)=>{const i=tvr(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 yUe(t,e){return t.intersect(e)}w(yUe,"intersectNode");var nvr=yUe;function vUe(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($j,"sameSign");var svr=wUe,avr=TUe;function TUe(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"),lvr=ovr,ps={node:nvr,circle:ivr,ellipse:bUe,polygon:avr,rect:lvr},ao=w(async(t,e,r,n)=>{const i=Ve();let s;const a=e.useHtmlLabels||di(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=Qo(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(di(i)){const p=h.children[0],g=wt(h);await pZ(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 cvr=w(async(t,e)=>{e.useHtmlLabels||di(Ve())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:s}=await ao(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"),uvr=cvr,Mye=w(t=>t?" "+t:"","formatClass"),eu=w((t,e)=>`${e||"node default"}${Mye(t.classes)} ${Mye(t.class)}`,"getClassesFromNode"),Rye=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),hvr=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"),dvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),fvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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=rvr(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"),pvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),gvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),mvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),yvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),vvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),bvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),xvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),wvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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&&(BP(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"),Tvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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&&(BP(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"),Cvr=w(async(t,e)=>{const{shapeSvg:r}=await ao(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&&(BP(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 BP(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(BP,"applyNodePropertyBorders");var kvr=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(di(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(di(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 ao(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"),Evr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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"),Avr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ao(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"),Mvr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ao(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"),Rvr=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"),_ye=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"),_vr=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"),Lvr=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(di(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!==""&&(di(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(di(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;di(Ve())&&(_=_.replace(//g,">"));const P=await uh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(di(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;di(Ve())&&(_=_.replace(//g,">"));const P=await uh(f,_,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(di(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"),Lye={rhombus:Rye,composite:Tvr,question:Rye,rect:wvr,labelRect:Cvr,rectWithTitle:kvr,choice:hvr,circle:Evr,doublecircle:Avr,stadium:Svr,hexagon:dvr,block_arrow:fvr,rect_left_inv_arrow:pvr,lean_right:gvr,lean_left:mvr,trapezoid:yvr,inv_trapezoid:vvr,rect_right_inv_arrow:bvr,cylinder:xvr,start:Rvr,end:_vr,note:uvr,subroutine:Mvr,fork:_ye,join:_ye,class_box:Lvr},jR={},CUe=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 Lye[e.shape](n,e,r)}else i=await Lye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),jR[e.id]=n,e.haveCallback&&jR[e.id].attr("class",jR[e.id].attr("class")+" clickable"),n},"insertNode"),Ivr=w(t=>{const e=jR[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 jne(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=dZ((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(jne,"getNodeFromBlock");async function kUe(t,e,r){const n=jne(e,r,!1);if(n.type==="group")return;const i=br(),s=await CUe(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(kUe,"calculateBlockSize");async function SUe(t,e,r){const n=jne(e,r,!0);if(r.getBlock(n.id).type!=="space"){const s=br();await CUe(t,n,{config:s}),e.intersect=n==null?void 0:n.intersect,Ivr(n)}}w(SUe,"insertBlockPositioned");async function FP(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await FP(t,i.children,r,n)}w(FP,"performOperations");async function EUe(t,e,r){await FP(t,e,r,kUe)}w(EUe,"calculateBlockSizes");async function AUe(t,e,r){await FP(t,e,r,SUe)}w(AUe,"insertBlocks");async function MUe(t,e,r,n,i){const s=new Uo({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`;evr(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 Kyr(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m}),Zyr({...a,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(MUe,"insertEdges");var Nvr=w(function(t,e){return e.db.getClasses()},"getClasses"),Dvr=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}"]`);qyr(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 EUe(g,d,a);const m=mUe(a);if(await AUe(g,d,a),await MUe(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"),Ovr={draw:Dvr,getClasses:Nvr},Pvr={parser:hyr,db:Lyr,renderer:Ovr,styles:Nyr};const $vr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pvr},Symbol.toStringTag,{value:"Module"}));var RUe=/[─━│┃└┗├┣]/,_Ue=/[└┗├┣]/,Bvr=/[─━]/,Iye=/^[\s│┃]+$/,Nye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Dye=/^\s*%%/,Fvr=" ";function LUe(t){return t.some(e=>RUe.test(e))}w(LUe,"isBoxDrawingFormat");function IUe(t){for(const e of t){const r=_Ue.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(IUe,"inferSegmentWidth");function NUe(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(NUe,"remapErrorLines");function DUe(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:[]}]})),zvr=w(()=>{ld.reset(),Ri()},"clear"),Vvr=w(()=>ld.records.stack[0],"getRoot"),Hvr=w(()=>ld.records.cnt,"getCount"),Gvr=Sn.treeView,Wvr=w(()=>es(Gvr,br().treeView),"getConfig"),qvr=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"),Uvr={clear:zvr,addNode:qvr,getRoot:Vvr,getCount:Hvr,getConfig:Wvr,getAccTitle:ts,getAccDescription:ns,getDiagramTitle:qi,setAccDescription:rs,setAccTitle:Hi,setDiagramTitle:Ji},Bj=Uvr,Yvr=w(t=>{Hl(t,Bj);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;Bj.addNode(r,n,s,a,l,h)}},"populate"),jvr={parse:w(async t=>{const{text:e,lineMap:r}=DUe(t);try{const n=await zu("treeView",e);de.debug(n),Yvr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=NUe(n.message,r)),n}},"parse")},SE={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function OUe(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(OUe,"detectIcon");function Fj(t,e){return t.includes(":")?t:t in SE.icons||!e?`${SE.prefix}:${t}`:`${e}:${t}`}w(Fj,"qualifyIcon");function Xne(t,e){if(t.icon!=="none"){if(t.icon)return Fj(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=OUe(t.name,e);if(r==="none")return;if(r)return Fj(r,e.defaultIconPack)}return`${SE.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(Xne,"getNodeIcon");gZ([{name:SE.prefix,icons:SE}]);var zj=14,Xvr=4,Kvr=16,PUe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),Zvr=w(async(t,e,r,n)=>{const i=new Set,s=w(l=>{const u=Xne(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:zj,width:zj})}))),o=t.append("defs");for(const{icon:l,svg:u}of a)o.append("g").attr("id",PUe(n,l)).html(u)},"injectIconDefs"),Qvr=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=zj+Xvr,u=Xne(r,i),h=u!==void 0;u&&a.append("use").attr("xlink:href",`#${PUe(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"),Oye=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"),Jvr=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=Qvr(m,i,f,d,p,n);a.push(y);const{height:v,width:x}=f.BBox;Oye(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;Oye(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))+Kvr;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"),e2r=w(async(t,e,r,n)=>{de.debug(`Rendering treeView diagram +`+t);const i=n.db,s=i.getRoot(),a=i.getConfig(),o=Ko(e);await Zvr(o,s,a,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=Jvr(l,s,a,e);o.attr("viewBox",`-${a.lineThickness/2} 0 ${h} ${u}`),Fs(o,u,h,a.useMaxWidth)},"draw"),t2r={draw:e2r},r2r=t2r,n2r={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},i2r=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:s,highlightBg:a,highlightStroke:o}=es(n2r,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -5417,7 +5417,7 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error stroke: ${o}; stroke-width: 1; } - `},"styles"),i2r=n2r,s2r={db:Bj,renderer:t2r,parser:Yvr,styles:i2r};const a2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:s2r},Symbol.toStringTag,{value:"Module"}));var XR={exports:{}},KR={exports:{}},ZR={exports:{}},o2r=ZR.exports,Oye;function l2r(){return Oye||(Oye=1,(function(t,e){(function(n,i){t.exports=i()})(o2r,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})()})})(KR)),KR.exports}var h2r=XR.exports,$ye;function d2r(){return $ye||($ye=1,(function(t,e){(function(n,i){t.exports=i(u2r())})(h2r,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})()})})(XR)),XR.exports}var f2r=d2r();const p2r=Xg(f2r);var Bye={L:"left",R:"right",T:"top",B:"bottom"},Fye={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")},fM={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")},g2r=w(function(t){return gl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),zye=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),gl=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),zg=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),Kne=w(function(t,e){const r=gl(t)&&zg(e),n=zg(t)&&gl(e);return r||n},"isArchitectureDirectionXY"),m2r=w(function(t){const e=t[0],r=t[1],n=gl(e)&&zg(r),i=zg(e)&&gl(r);return n||i},"isArchitecturePairXY"),y2r=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),Vj=w(function(t,e){const r=`${t}${e}`;return y2r(r)?r:void 0},"getArchitectureDirectionPair"),v2r=w(function([t,e],r){const n=r[0],i=r[1];return gl(n)?zg(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:gl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),b2r=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"),x2r=w(function(t,e){return Kne(t,e)?"bend":gl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),w2r=w(function(t){return t.type==="service"},"isArchitectureService"),T2r=w(function(t){return t.type==="junction"},"isArchitectureJunction"),PUe=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),$Ue=w(t=>t.data(),"edgeData"),yb=w(t=>t.data(),"nodeData"),C2r=Sn.architecture,MT,BUe=(MT=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(w2r)}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(!zye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!zye(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=x2r(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(PUe(p,g),m)}if(f.lhsId===u){const m=Vj(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=Vj(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,v2r([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({...C2r,...br().architecture})}getConfigField(e){return this.getConfig()[e]}},w(MT,"ArchitectureDB"),MT),k2r=w((t,e)=>{var r;Hl(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"),FUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("architecture",t);de.debug(e);const r=(n=FUe.parser)==null?void 0:n.yy;if(!(r instanceof BUe))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.");k2r(e,r)},"parse")},S2r=w(t=>` + `},"styles"),s2r=i2r,a2r={db:Bj,renderer:r2r,parser:jvr,styles:s2r};const o2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:a2r},Symbol.toStringTag,{value:"Module"}));var XR={exports:{}},KR={exports:{}},ZR={exports:{}},l2r=ZR.exports,Pye;function c2r(){return Pye||(Pye=1,(function(t,e){(function(n,i){t.exports=i()})(l2r,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})()})})(KR)),KR.exports}var d2r=XR.exports,Bye;function f2r(){return Bye||(Bye=1,(function(t,e){(function(n,i){t.exports=i(h2r())})(d2r,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})()})})(XR)),XR.exports}var p2r=f2r();const g2r=Xg(p2r);var Fye={L:"left",R:"right",T:"top",B:"bottom"},zye={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")},fM={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")},m2r=w(function(t){return gl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Vye=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),gl=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),zg=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),Kne=w(function(t,e){const r=gl(t)&&zg(e),n=zg(t)&&gl(e);return r||n},"isArchitectureDirectionXY"),y2r=w(function(t){const e=t[0],r=t[1],n=gl(e)&&zg(r),i=zg(e)&&gl(r);return n||i},"isArchitecturePairXY"),v2r=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),Vj=w(function(t,e){const r=`${t}${e}`;return v2r(r)?r:void 0},"getArchitectureDirectionPair"),b2r=w(function([t,e],r){const n=r[0],i=r[1];return gl(n)?zg(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:gl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),x2r=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"),w2r=w(function(t,e){return Kne(t,e)?"bend":gl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),T2r=w(function(t){return t.type==="service"},"isArchitectureService"),C2r=w(function(t){return t.type==="junction"},"isArchitectureJunction"),$Ue=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),BUe=w(t=>t.data(),"edgeData"),yb=w(t=>t.data(),"nodeData"),k2r=Sn.architecture,MT,FUe=(MT=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(T2r)}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(C2r)}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(!Vye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Vye(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=w2r(f.lhsDir,f.rhsDir);m!=="bend"&&n.set($Ue(p,g),m)}if(f.lhsId===u){const m=Vj(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=Vj(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,b2r([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({...k2r,...br().architecture})}getConfigField(e){return this.getConfig()[e]}},w(MT,"ArchitectureDB"),MT),S2r=w((t,e)=>{var r;Hl(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"),zUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("architecture",t);de.debug(e);const r=(n=zUe.parser)==null?void 0:n.yy;if(!(r instanceof FUe))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.");S2r(e,r)},"parse")},E2r=w(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -5448,19 +5448,19 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),E2r=S2r;function Hj(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(Hj,"withSeededRandom");var h2=w(t=>`${t}`,"wrapIcon"),EE={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:h2('')},server:{body:h2('')},disk:{body:h2('')},internet:{body:h2('')},cloud:{body:h2('')},unknown:KCe,blank:{body:h2("")}}},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}=$Ue(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&&(gl(d)?b+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(gl(m)?k+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((R=r.getNode(h))==null?void 0:R.type)==="junction"&&(gl(d)?b+=d==="L"?a:-a:T+=d==="T"?a:-a),!v&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(gl(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}-${Lb(h,g,{prefix:"L"})}`),f){const N=gl(d)?fM[d](b,o):b-l,L=zg(d)?fM[d](T,o):T-l;P.insert("polygon").attr("points",Fye[d](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(y){const N=gl(m)?fM[m](k,o):k-l,L=zg(m)?fM[m](E,o):E-l;P.insert("polygon").attr("points",Fye[m](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(x){const N=Kne(d,m)?"XY":gl(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 Qo(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 $=Vj(d,m);if($&&m2r($)){const O=I.node().getBoundingClientRect(),[D,F]=b2r($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*D*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` +`,"getStyles"),A2r=E2r;function Hj(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(Hj,"withSeededRandom");var h2=w(t=>`${t}`,"wrapIcon"),EE={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:h2('')},server:{body:h2('')},disk:{body:h2('')},internet:{body:h2('')},cloud:{body:h2('')},unknown:ZCe,blank:{body:h2("")}}},M2r=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}=BUe(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&&(gl(d)?b+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(gl(m)?k+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((R=r.getNode(h))==null?void 0:R.type)==="junction"&&(gl(d)?b+=d==="L"?a:-a:T+=d==="T"?a:-a),!v&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(gl(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}-${Lb(h,g,{prefix:"L"})}`),f){const N=gl(d)?fM[d](b,o):b-l,L=zg(d)?fM[d](T,o):T-l;P.insert("polygon").attr("points",zye[d](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(y){const N=gl(m)?fM[m](k,o):k-l,L=zg(m)?fM[m](E,o):E-l;P.insert("polygon").attr("points",zye[m](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(x){const N=Kne(d,m)?"XY":gl(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 Qo(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 $=Vj(d,m);if($&&y2r($)){const O=I.node().getBoundingClientRect(),[D,F]=x2r($);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"),M2r=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=yb(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:EE.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 Qo(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"),R2r=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 Qo(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:EE.prefix})}`);else if(s.iconText){l.html(`${await m0("blank",{height:o,width:o,fallbackPrefix:EE.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"),_2r=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");gZ([{name:EE.prefix,icons:EE}]);Bd.use(p2r);function zUe(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(zUe,"addServices");function VUe(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(VUe,"addJunctions");function HUe(t,e){e.nodes().map(r=>{const n=yb(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(HUe,"positionNodes");function GUe(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(GUe,"addGroups");function WUe(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=Kne(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(WUe,"addEdges");function qUe(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(qUe,"getAlignments");function UUe(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({[Bye[x]]:C,[Bye[g2r(x)]]:y,gap:s*i})}})}}}}),n}w(UUe,"getRelativeConstraints");function YUe(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(),GUe(r,u),zUe(t,u,i),VUe(e,u,i),WUe(n,u);const h=i.getLayoutHints(),d=qUe(i,s,a,h),f=UUe(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}=yb(T),{parent:k}=yb(C);return S===k?g:m},edgeElasticity(b){const[T,C]=b.connectedNodes(),{parent:S}=yb(T),{parent:k}=yb(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}=$Ue(C),[N,L]=zg(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(),Hj(v,()=>x.run())});try{Hj(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(YUe,"layoutArchitecture");var L2r=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=Ko(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 R2r(i,f,s,e),_2r(i,f,a,e);const g=await YUe(s,a,o,l,i,u);await A2r(d,g,i,e),await M2r(p,g,i,e),HUe(i,g),o3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),I2r={draw:L2r},N2r={parser:FUe,get db(){return new BUe},renderer:I2r,styles:E2r};const D2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:N2r},Symbol.toStringTag,{value:"Module"}));var jUe="position frame",XUe="frame positioned",Gj="position relation",KUe="relation positioned",O2r=w(function(t){de.debug("options str",t)},"setOptions"),P2r=w(function(){return{}},"getOptions"),$2r=w(function(){ZUe(),Ri()},"clear");function ZUe(){Zne={}}w(ZUe,"reset");var B2r=Sn.eventmodeling,F2r=w(()=>es({...B2r,...br().eventmodeling}),"getConfig"),Zne={};function QUe(){let t=z2r;const{ast:e}=Zne,r=Qne();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const s=sYe(n,e.dataEntities,r);t=JR(t,{$kind:jUe,index:i,frame:n,textProps:s});let a;hYe(n)?(de.debug("source frame",n.sourceFrames),a=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),a.forEach(o=>{t=JR(t,{$kind:Gj,index:i,frame:n,sourceFrame:o})})):t=JR(t,{$kind:Gj,index:i,frame:n})}),t={...t,sortedSwimlanesArray:Jne(t.swimlanes)},t}w(QUe,"getState");function JUe(t){Zne.ast=t}w(JUe,"setAst");var ei={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 Qne(){return ei}w(Qne,"getDiagramProps");var z2r={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function eYe(t){const e=t.split(".");if(e.length===2)return e[0]}w(eYe,"extractNamespace");function tYe(t){const e=t.split(".");return e.length===2?e[1]:t}w(tYe,"extractName");function rYe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w(rYe,"findSwimlaneByNamespace");function QR(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(QR,"findNextAvailableIndex");function nYe(t,e){const r=eYe(t.entityIdentifier),n=rYe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||ei.labelUiAutomation}:r?{index:QR(e,0,100),label:ei.labelUiAutomationPrefix+r}:{index:0,label:ei.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||ei.labelCommandReadModel}:r?{index:QR(e,100,200),label:ei.labelCommandReadModelPrefix+r}:{index:100,label:ei.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||ei.labelEvents}:r?{index:QR(e,200,300),label:ei.labelEventsPrefix+r}:{index:200,label:ei.labelEvents}}}w(nYe,"calculateSwimlaneProps");function iYe(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(iYe,"calculateEntityVisualProps");function sYe(t,e,r){const n=br(),i=Ln(tYe(t.entityIdentifier)??"",n);let s;const a={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${Jk(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=Jk(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=Jk(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=nD(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(sYe,"calculateTextProps");function aYe(t,e){const r=e,n=iYe(r.frame),i={width:r.textProps.width+2*ei.boxTextPadding,height:r.textProps.height+2*ei.boxTextPadding};return[{$kind:XUe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(aYe,"decidePositionFrame");function oYe(t,e,r){return e===void 0?ei.contentStartX:e.index===t.index&&t.r?t.r+ei.boxPadding:r===void 0?ei.contentStartX:r.r-ei.boxOverlap+ei.boxPadding}w(oYe,"calculateX");function lYe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(lYe,"calculateMaxRight");function Jne(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(Jne,"sortedSwimlanesArray");function cYe(t,e){const r=e,n=nYe(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*ei.swimlaneMinHeight+ei.swimlaneGap,height:ei.swimlaneMinHeight,maxHeight:ei.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(ei.boxMinWidth,Math.min(ei.boxMaxWidth,r.dimension.width))+2*ei.boxPadding,height:Math.max(ei.boxMinHeight,Math.min(ei.boxMaxHeight,r.dimension.height))+2*ei.boxPadding},l=oYe(i,a,s),u=l+o.width+ei.boxPadding,h=lYe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(ei.swimlaneMinHeight,i.maxHeight)+2*ei.swimlanePadding;const d={x:l,y:ei.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(hYe,"hasSourceFrame");function Wj(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(Wj,"findBoxByFrame");function dYe(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(dYe,"findBoxByLineIndex");function fYe(t,e){const r=e;if(TGe(r.frame)||uYe(r.index,r.frame))return[];const n=Wj(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=Wj(t.boxes,r.sourceFrame):i=dYe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:KUe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(fYe,"decidePositionRelation");function pYe(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(pYe,"evolveRelationPositioned");var V2r={[jUe]:aYe,[Gj]:fYe},H2r={[XUe]:cYe,[KUe]:pYe};function gYe(t,e){const r=V2r[e.$kind];if(r==null)return[];const n=r(t,e);return de.debug("decided events",n),n}w(gYe,"decide");function mYe(t,e){const r=e.reduce((n,i)=>{const s=H2r[i.$kind];return s==null?n:s(n,i)},t);return de.debug("evolve events",{state:t,newState:r,events:e}),r}w(mYe,"evolve");function JR(t,e){const r=gYe(t,e);return mYe(t,r)}w(JR,"dispatch");var qj={getConfig:F2r,setOptions:O2r,getOptions:P2r,clear:$2r,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi,setAst:JUe,getDiagramProps:Qne,getState:QUe},G2r={parse:w(async t=>{const e=await zu("eventmodeling",t);de.debug(e),qj.setAst(e),Hl(e,qj)},"parse")},RV=Ve(),W2r=RV==null?void 0:RV.eventmodeling;function yYe(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(yYe,"renderD3Box");function vYe(t,e){return t>e}w(vYe,"dirUpwards");function bYe(t,e,r,n){return i=>{const s=i.sourceBox.swimlane.y+e.swimlanePadding,a=i.targetBox.swimlane.y+e.swimlanePadding,o=vYe(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(bYe,"renderD3Relation");function xYe(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(xYe,"renderD3Swimlane");var q2r=w(function(t,e,r,n){if(de.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!W2r)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(xYe(o,u.maxR,l,s)),u.boxes.forEach(yYe(o,l)),u.relations.forEach(bYe(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),IK(void 0,o,(a==null?void 0:a.padding)??30,a==null?void 0:a.useMaxWidth)},"draw"),U2r={draw:q2r},Y2r=w(t=>"","getStyles"),j2r=Y2r,X2r={parser:G2r,db:qj,renderer:U2r,styles:j2r};const K2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:X2r},Symbol.toStringTag,{value:"Module"}));var Uj=(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"),R2r=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=yb(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:EE.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 Qo(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"),_2r=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 Qo(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:EE.prefix})}`);else if(s.iconText){l.html(`${await m0("blank",{height:o,width:o,fallbackPrefix:EE.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"),L2r=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");gZ([{name:EE.prefix,icons:EE}]);Bd.use(g2r);function VUe(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(VUe,"addServices");function HUe(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(HUe,"addJunctions");function GUe(t,e){e.nodes().map(r=>{const n=yb(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(GUe,"positionNodes");function WUe(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(WUe,"addGroups");function qUe(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=Kne(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(qUe,"addEdges");function UUe(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(UUe,"getAlignments");function YUe(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({[Fye[x]]:C,[Fye[m2r(x)]]:y,gap:s*i})}})}}}}),n}w(YUe,"getRelativeConstraints");function jUe(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(),WUe(r,u),VUe(t,u,i),HUe(e,u,i),qUe(n,u);const h=i.getLayoutHints(),d=UUe(i,s,a,h),f=YUe(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}=yb(T),{parent:k}=yb(C);return S===k?g:m},edgeElasticity(b){const[T,C]=b.connectedNodes(),{parent:S}=yb(T),{parent:k}=yb(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}=BUe(C),[N,L]=zg(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(),Hj(v,()=>x.run())});try{Hj(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(jUe,"layoutArchitecture");var I2r=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=Ko(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 _2r(i,f,s,e),L2r(i,f,a,e);const g=await jUe(s,a,o,l,i,u);await M2r(d,g,i,e),await R2r(p,g,i,e),GUe(i,g),o3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),N2r={draw:I2r},D2r={parser:zUe,get db(){return new FUe},renderer:N2r,styles:A2r};const O2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:D2r},Symbol.toStringTag,{value:"Module"}));var XUe="position frame",KUe="frame positioned",Gj="position relation",ZUe="relation positioned",P2r=w(function(t){de.debug("options str",t)},"setOptions"),$2r=w(function(){return{}},"getOptions"),B2r=w(function(){QUe(),Ri()},"clear");function QUe(){Zne={}}w(QUe,"reset");var F2r=Sn.eventmodeling,z2r=w(()=>es({...F2r,...br().eventmodeling}),"getConfig"),Zne={};function JUe(){let t=V2r;const{ast:e}=Zne,r=Qne();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const s=aYe(n,e.dataEntities,r);t=JR(t,{$kind:XUe,index:i,frame:n,textProps:s});let a;dYe(n)?(de.debug("source frame",n.sourceFrames),a=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),a.forEach(o=>{t=JR(t,{$kind:Gj,index:i,frame:n,sourceFrame:o})})):t=JR(t,{$kind:Gj,index:i,frame:n})}),t={...t,sortedSwimlanesArray:Jne(t.swimlanes)},t}w(JUe,"getState");function eYe(t){Zne.ast=t}w(eYe,"setAst");var ei={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 Qne(){return ei}w(Qne,"getDiagramProps");var V2r={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function tYe(t){const e=t.split(".");if(e.length===2)return e[0]}w(tYe,"extractNamespace");function rYe(t){const e=t.split(".");return e.length===2?e[1]:t}w(rYe,"extractName");function nYe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w(nYe,"findSwimlaneByNamespace");function QR(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(QR,"findNextAvailableIndex");function iYe(t,e){const r=tYe(t.entityIdentifier),n=nYe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||ei.labelUiAutomation}:r?{index:QR(e,0,100),label:ei.labelUiAutomationPrefix+r}:{index:0,label:ei.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||ei.labelCommandReadModel}:r?{index:QR(e,100,200),label:ei.labelCommandReadModelPrefix+r}:{index:100,label:ei.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||ei.labelEvents}:r?{index:QR(e,200,300),label:ei.labelEventsPrefix+r}:{index:200,label:ei.labelEvents}}}w(iYe,"calculateSwimlaneProps");function sYe(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(sYe,"calculateEntityVisualProps");function aYe(t,e,r){const n=br(),i=Ln(rYe(t.entityIdentifier)??"",n);let s;const a={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${Jk(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=Jk(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=Jk(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=nD(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(aYe,"calculateTextProps");function oYe(t,e){const r=e,n=sYe(r.frame),i={width:r.textProps.width+2*ei.boxTextPadding,height:r.textProps.height+2*ei.boxTextPadding};return[{$kind:KUe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(oYe,"decidePositionFrame");function lYe(t,e,r){return e===void 0?ei.contentStartX:e.index===t.index&&t.r?t.r+ei.boxPadding:r===void 0?ei.contentStartX:r.r-ei.boxOverlap+ei.boxPadding}w(lYe,"calculateX");function cYe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(cYe,"calculateMaxRight");function Jne(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(Jne,"sortedSwimlanesArray");function uYe(t,e){const r=e,n=iYe(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*ei.swimlaneMinHeight+ei.swimlaneGap,height:ei.swimlaneMinHeight,maxHeight:ei.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(ei.boxMinWidth,Math.min(ei.boxMaxWidth,r.dimension.width))+2*ei.boxPadding,height:Math.max(ei.boxMinHeight,Math.min(ei.boxMaxHeight,r.dimension.height))+2*ei.boxPadding},l=lYe(i,a,s),u=l+o.width+ei.boxPadding,h=cYe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(ei.swimlaneMinHeight,i.maxHeight)+2*ei.swimlanePadding;const d={x:l,y:ei.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(dYe,"hasSourceFrame");function Wj(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(Wj,"findBoxByFrame");function fYe(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(fYe,"findBoxByLineIndex");function pYe(t,e){const r=e;if(CGe(r.frame)||hYe(r.index,r.frame))return[];const n=Wj(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=Wj(t.boxes,r.sourceFrame):i=fYe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:ZUe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(pYe,"decidePositionRelation");function gYe(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(gYe,"evolveRelationPositioned");var H2r={[XUe]:oYe,[Gj]:pYe},G2r={[KUe]:uYe,[ZUe]:gYe};function mYe(t,e){const r=H2r[e.$kind];if(r==null)return[];const n=r(t,e);return de.debug("decided events",n),n}w(mYe,"decide");function yYe(t,e){const r=e.reduce((n,i)=>{const s=G2r[i.$kind];return s==null?n:s(n,i)},t);return de.debug("evolve events",{state:t,newState:r,events:e}),r}w(yYe,"evolve");function JR(t,e){const r=mYe(t,e);return yYe(t,r)}w(JR,"dispatch");var qj={getConfig:z2r,setOptions:P2r,getOptions:$2r,clear:B2r,setAccTitle:Hi,getAccTitle:ts,getAccDescription:ns,setAccDescription:rs,setDiagramTitle:Ji,getDiagramTitle:qi,setAst:eYe,getDiagramProps:Qne,getState:JUe},W2r={parse:w(async t=>{const e=await zu("eventmodeling",t);de.debug(e),qj.setAst(e),Hl(e,qj)},"parse")},RV=Ve(),q2r=RV==null?void 0:RV.eventmodeling;function vYe(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(vYe,"renderD3Box");function bYe(t,e){return t>e}w(bYe,"dirUpwards");function xYe(t,e,r,n){return i=>{const s=i.sourceBox.swimlane.y+e.swimlanePadding,a=i.targetBox.swimlane.y+e.swimlanePadding,o=bYe(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(xYe,"renderD3Relation");function wYe(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(wYe,"renderD3Swimlane");var U2r=w(function(t,e,r,n){if(de.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!q2r)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(wYe(o,u.maxR,l,s)),u.boxes.forEach(vYe(o,l)),u.relations.forEach(xYe(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),IK(void 0,o,(a==null?void 0:a.padding)??30,a==null?void 0:a.useMaxWidth)},"draw"),Y2r={draw:U2r},j2r=w(t=>"","getStyles"),X2r=j2r,K2r={parser:W2r,db:qj,renderer:Y2r,styles:X2r};const Z2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:K2r},Symbol.toStringTag,{value:"Module"}));var Uj=(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})();Uj.parser=Uj;var Z2r=Uj,RT,Q2r=(RT=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(RT,"IshikawaDB"),RT),J2r=14,d2=250,ebr=30,tbr=60,rbr=5,wYe=82*Math.PI/180,Vye=Math.cos(wYe),Hye=Math.sin(wYe),Gye=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"),nbr=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=Ko(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=d2;const S=d?void 0:Xb(y,T,C,T,C,"ishikawa-spine");if(ibr(y,T,C,s.text,h,x),!f.length){d&&Xb(y,T,C,T,C,"ishikawa-spine",x),Gye(m,p,g);return}T-=20;const k=f.filter((D,F)=>F%2===0),E=f.filter((D,F)=>F%2===1),A=Wye(k),R=Wye(E),_=A.total+R.total;let P=d2,N=d2;if(_>0){const D=d2*2,F=d2*.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,d2),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)Xb(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)}Gye(m,p,g)},"draw"),Wye=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"),ibr=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=ZI(o,TYe(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"),sbr=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:TYe(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"),abr=w((t,e,r,n,i,s,a)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=ZI(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"),_V=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"),obr=w((t,e,r,n,i,s,a,o)=>{const l=e.children??[],u=s*(l.length?1:.2),h=-Vye*u,d=Hye*u*i,f=r+h,p=n+d;if(Xb(t,r,n,f,p,"ishikawa-branch",o),o&&_V(t,r,n,r-f,n-p,o),abr(t,e.text,f,p,i,a,o),!l.length)return;const{entries:g,yOrder:m}=sbr(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=-Vye,T=Hye*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;_=qye(A.x0,A.x1,L?(E-A.y0)/L:.5),P=E,N=_-(k.childCount>0?tbr+k.childCount*rbr:ebr),Xb(R,_,E,N,E,"ishikawa-sub-branch",o),o&&_V(R,_,E,1,0,o),ZI(R,k.text,N,E,"ishikawa-label align","end",a)}else{const L=A.childrenDrawn++;_=qye(A.x0,A.x1,(A.childCount-L)/(A.childCount+1)),P=A.y0,N=_+b*((E-P)/T),Xb(R,_,P,N,E,"ishikawa-sub-branch",o),o&&_V(R,_,P,_-N,P-E,o),ZI(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"),lbr=w(t=>t.split(/|\n/),"splitLines"),TYe=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"),ZI=w((t,e,r,n,i,s,a)=>{const o=lbr(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"),qye=w((t,e,r)=>t+(e-t)*r,"lerp"),Xb=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"),cbr={draw:nbr},ubr=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})();Uj.parser=Uj;var Q2r=Uj,RT,J2r=(RT=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(RT,"IshikawaDB"),RT),ebr=14,d2=250,tbr=30,rbr=60,nbr=5,TYe=82*Math.PI/180,Hye=Math.cos(TYe),Gye=Math.sin(TYe),Wye=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"),ibr=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]??ebr,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=Ko(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=d2;const S=d?void 0:Xb(y,T,C,T,C,"ishikawa-spine");if(sbr(y,T,C,s.text,h,x),!f.length){d&&Xb(y,T,C,T,C,"ishikawa-spine",x),Wye(m,p,g);return}T-=20;const k=f.filter((D,F)=>F%2===0),E=f.filter((D,F)=>F%2===1),A=qye(k),R=qye(E),_=A.total+R.total;let P=d2,N=d2;if(_>0){const D=d2*2,F=d2*.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,d2),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)Xb(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)}Wye(m,p,g)},"draw"),qye=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"),sbr=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=ZI(o,CYe(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"),abr=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:CYe(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"),obr=w((t,e,r,n,i,s,a)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=ZI(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"),_V=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"),lbr=w((t,e,r,n,i,s,a,o)=>{const l=e.children??[],u=s*(l.length?1:.2),h=-Hye*u,d=Gye*u*i,f=r+h,p=n+d;if(Xb(t,r,n,f,p,"ishikawa-branch",o),o&&_V(t,r,n,r-f,n-p,o),obr(t,e.text,f,p,i,a,o),!l.length)return;const{entries:g,yOrder:m}=abr(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=-Hye,T=Gye*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;_=Uye(A.x0,A.x1,L?(E-A.y0)/L:.5),P=E,N=_-(k.childCount>0?rbr+k.childCount*nbr:tbr),Xb(R,_,E,N,E,"ishikawa-sub-branch",o),o&&_V(R,_,E,1,0,o),ZI(R,k.text,N,E,"ishikawa-label align","end",a)}else{const L=A.childrenDrawn++;_=Uye(A.x0,A.x1,(A.childCount-L)/(A.childCount+1)),P=A.y0,N=_+b*((E-P)/T),Xb(R,_,P,N,E,"ishikawa-sub-branch",o),o&&_V(R,_,P,_-N,P-E,o),ZI(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"),cbr=w(t=>t.split(/|\n/),"splitLines"),CYe=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"),ZI=w((t,e,r,n,i,s,a)=>{const o=cbr(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"),Uye=w((t,e,r)=>t+(e-t)*r,"lerp"),Xb=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"),ubr={draw:ibr},hbr=w(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -5523,18 +5523,18 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[B]||B)+"'":re="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),hbr=ubr,dbr={parser:Z2r,get db(){return new Q2r},renderer:cbr,styles:hbr};const fbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:dbr},Symbol.toStringTag,{value:"Module"})),CYe=1e-10;function zP(t,e){const r=gbr(t),n=r.filter(o=>pbr(o,t));let i=0,s=0;const a=[];if(n.length>1){const o=SYe(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+=Yj(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-CYe,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 pbr(t,e){return e.every(r=>gc(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 Yj(t,n)+Yj(e,i)}function kYe(t,e){const r=gc(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 SYe(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 mbr(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)jj(e))}function Kb(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=Kb(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 vbr(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(),Kj(a,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;feie(t,e,n)-r,0,t+e)}function bbr(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=Zj(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 wbr(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=kbr(t,e);const n=e.lossFunction||X5;if(t.length>=8){const i=Cbr(t,e),s=n(i,t),a=n(r,t);s+1e-8f.map(p=>p/o));const l=(f,p)=>wbr(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+MYe>=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 RYe(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=eie(o.radius,l.radius,gc(o,l))}else i=zP(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 Sbr(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&&gc(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 Ebr(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 Qj(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 _Ye(t,e,r){e==null&&(e=Math.PI/2);let n=NYe(t).map(u=>Object.assign({},u));const i=Ebr(n);for(const u of i){Sbr(u,e,r);const h=Qj(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 IYe(t){const e={};for(const r of t)e[r.setid]=r;return e}function NYe(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=AYe,C=X5;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=_Ye(q,a,f)),R=LYe(q,r,n,i,l),_=OYe(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]]=_br(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 Yye(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=>Yye(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",LV(R,N)):G.each("end",LV(R,N)):G.each(LV(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"?X5:k==="logRatio"?RYe:k,S):C},S}function LV(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 IV(t,e,r){let n=e[0].radius-gc(e[0],t);for(let i=1;i=s&&(i=n[h],s=d)}const a=EYe(h=>-1*IV({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(gc(o,h)>h.radius){l=!1;break}for(const h of e)if(gc(o,h)h.p1))}function Mbr(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 Rbr(t,e,r){const n=[];return n.push(` +`,"getStyles"),dbr=hbr,fbr={parser:Q2r,get db(){return new J2r},renderer:ubr,styles:dbr};const pbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:fbr},Symbol.toStringTag,{value:"Module"})),kYe=1e-10;function zP(t,e){const r=mbr(t),n=r.filter(o=>gbr(o,t));let i=0,s=0;const a=[];if(n.length>1){const o=EYe(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+=Yj(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-kYe,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 gbr(t,e){return e.every(r=>gc(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 Yj(t,n)+Yj(e,i)}function SYe(t,e){const r=gc(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 EYe(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 ybr(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)jj(e))}function Kb(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=Kb(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 bbr(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(),Kj(a,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;feie(t,e,n)-r,0,t+e)}function xbr(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=Zj(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 Tbr(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 Cbr(t,e={}){let r=Sbr(t,e);const n=e.lossFunction||X5;if(t.length>=8){const i=kbr(t,e),s=n(i,t),a=n(r,t);s+1e-8f.map(p=>p/o));const l=(f,p)=>Tbr(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+RYe>=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 _Ye(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=eie(o.radius,l.radius,gc(o,l))}else i=zP(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 Ebr(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&&gc(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 Abr(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 Qj(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 LYe(t,e,r){e==null&&(e=Math.PI/2);let n=DYe(t).map(u=>Object.assign({},u));const i=Abr(n);for(const u of i){Ebr(u,e,r);const h=Qj(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 NYe(t){const e={};for(const r of t)e[r.setid]=r;return e}function DYe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function Mbr(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=MYe,C=X5;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=LYe(q,a,f)),R=IYe(q,r,n,i,l),_=PYe(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]]=Lbr(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 jye(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=>jye(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",LV(R,N)):G.each("end",LV(R,N)):G.each(LV(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"?X5:k==="logRatio"?_Ye:k,S):C},S}function LV(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 IV(t,e,r){let n=e[0].radius-gc(e[0],t);for(let i=1;i=s&&(i=n[h],s=d)}const a=AYe(h=>-1*IV({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(gc(o,h)>h.radius){l=!1;break}for(const h of e)if(gc(o,h)h.p1))}function Rbr(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 _br(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 _br(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function PYe(t){if(t.length===0)return[];const e={};return zP(t,e),e.arcs}function $Ye(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 Rbr(n(s.x),n(s.y),n(s.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function Lbr(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function $Ye(t){if(t.length===0)return[];const e={};return zP(t,e),e.arcs}function BYe(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 _br(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 Yye(t,e){return $Ye(PYe(t),e)}function Lbr(t,e={}){const{lossFunction:r,layoutFunction:n=AYe,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?X5:r==="logRatio"?RYe:r,distinct:f});i&&(g=_Ye(g,s,a));const m=LYe(g,o,l,u,h),y=OYe(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=PYe(C),k=$Ye(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 Jj=(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 jye(t,e){return BYe($Ye(t),e)}function Ibr(t,e={}){const{lossFunction:r,layoutFunction:n=MYe,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?X5:r==="logRatio"?_Ye:r,distinct:f});i&&(g=LYe(g,s,a));const m=IYe(g,o,l,u,h),y=PYe(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=$Ye(C),k=BYe(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 Jj=(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})();Jj.parser=Jj;var Ibr=Jj,tie=[],rie=[],nie=[],iie=new Set,sie,aie=!1,Nbr=w((t,e,r)=>{const n=VP(t).sort(),i=r??10/Math.pow(t.length,2);sie=n,n.length===1&&iie.add(n[0]),tie.push({sets:n,size:i,label:e?AE(e):void 0})},"addSubsetData"),Dbr=w(()=>tie,"getSubsetData"),AE=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),Obr=w(t=>t&&AE(t),"normalizeStyleValue"),Pbr=w((t,e,r)=>{const n=AE(e);rie.push({sets:VP(t).sort(),id:n,label:r?AE(r):void 0})},"addTextData"),$br=w((t,e)=>{const r=VP(t).sort(),n={};for(const[i,s]of e)n[i]=Obr(s)??s;nie.push({targets:r,styles:n})},"addStyleData"),Bbr=w(()=>nie,"getStyleData"),VP=w(t=>t.map(e=>AE(e)),"normalizeIdentifierList"),Fbr=w(t=>{const r=VP(t).filter(n=>!iie.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),zbr=w(()=>rie,"getTextData"),Vbr=w(()=>sie,"getCurrentSets"),Hbr=w(()=>aie,"getIndentMode"),Gbr=w(t=>{aie=t},"setIndentMode"),Wbr=Sn.venn;function BYe(){return es(Wbr,br().venn)}w(BYe,"getConfig");var qbr=w(()=>{Ri(),tie.length=0,rie.length=0,nie.length=0,iie.clear(),sie=void 0,aie=!1},"customClear"),Ubr={getConfig:BYe,clear:qbr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,addSubsetData:Nbr,getSubsetData:Dbr,addTextData:Pbr,addStyleData:$br,validateUnionIdentifiers:Fbr,getTextData:zbr,getStyleData:Bbr,getCurrentSets:Vbr,getIndentMode:Hbr,setIndentMode:Gbr},Ybr=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})();Jj.parser=Jj;var Nbr=Jj,tie=[],rie=[],nie=[],iie=new Set,sie,aie=!1,Dbr=w((t,e,r)=>{const n=VP(t).sort(),i=r??10/Math.pow(t.length,2);sie=n,n.length===1&&iie.add(n[0]),tie.push({sets:n,size:i,label:e?AE(e):void 0})},"addSubsetData"),Obr=w(()=>tie,"getSubsetData"),AE=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),Pbr=w(t=>t&&AE(t),"normalizeStyleValue"),$br=w((t,e,r)=>{const n=AE(e);rie.push({sets:VP(t).sort(),id:n,label:r?AE(r):void 0})},"addTextData"),Bbr=w((t,e)=>{const r=VP(t).sort(),n={};for(const[i,s]of e)n[i]=Pbr(s)??s;nie.push({targets:r,styles:n})},"addStyleData"),Fbr=w(()=>nie,"getStyleData"),VP=w(t=>t.map(e=>AE(e)),"normalizeIdentifierList"),zbr=w(t=>{const r=VP(t).filter(n=>!iie.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),Vbr=w(()=>rie,"getTextData"),Hbr=w(()=>sie,"getCurrentSets"),Gbr=w(()=>aie,"getIndentMode"),Wbr=w(t=>{aie=t},"setIndentMode"),qbr=Sn.venn;function FYe(){return es(qbr,br().venn)}w(FYe,"getConfig");var Ubr=w(()=>{Ri(),tie.length=0,rie.length=0,nie.length=0,iie.clear(),sie=void 0,aie=!1},"customClear"),Ybr={getConfig:FYe,clear:Ubr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs,addSubsetData:Dbr,getSubsetData:Obr,addTextData:$br,addStyleData:Bbr,validateUnionIdentifiers:zbr,getTextData:Vbr,getStyleData:Fbr,getCurrentSets:Hbr,getIndentMode:Gbr,setIndentMode:Wbr},jbr=w(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -5556,7 +5556,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),jbr=Ybr;function FYe(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(FYe,"buildStyleByKey");var Xbr=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=FYe(i.getStyleData()),m=VYe(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=Ko(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=Lbr(m,{width:y,height:v-T,padding:(s==null?void 0:s.padding)??15}),_=new Map;for(const D of R){const F=Dp([...D.data.sets].sort());_.set(F,D)}p.length>0&&zYe(s,_,k,p,b,g);const P=Bl(a.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(D,F){var Q;const z=wt(this),B=Dp([...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:Foe(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=Dp([...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:Foe(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=Dp([...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=Dp([...D.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",D=>{var V;const z=Dp([...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 Dp(t){return t.join("|")}w(Dp,"stableSetsKey");function zYe(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=Dp(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(zYe,"renderTextNodes");function VYe(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(VYe,"ensurePairwiseSubsets");var Kbr={draw:Xbr},Zbr={parser:Ibr,db:Ubr,renderer:Kbr,styles:jbr};const Qbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zbr},Symbol.toStringTag,{value:"Module"}));var _T,HYe=(_T=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=>{rZ(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(_T,"TreeMapDB"),_T);function GYe(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(GYe,"buildHierarchy");var Jbr=w((t,e)=>{Hl(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=exr(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=GYe(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"),exr=w(t=>t.name?String(t.name):"","getItemName"),WYe={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=WYe.parser)==null?void 0:e.yy;if(!(i instanceof HYe))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")},txr=10,f2=10,OC=25,rxr=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),a=s.padding??txr,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=br();if(!l)return;const h=o?30:0,d=Ko(e),f=s.nodeWidth?s.nodeWidth*f2:960,p=s.nodeHeight?s.nodeHeight*f2: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=>"$"+u1(",")(H),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const H=/\.\d+/.exec(B),G=H?H[0]:"";y=w(W=>"$"+u1(","+G)(W),"valueFormat")}else if(B.startsWith("$")){const H=B.substring(1);y=w(G=>"$"+u1(H||"")(G),"valueFormat")}else y=u1(B)}catch(B){de.error("Error creating format function:",B),y=u1(",")}const v=ty().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=ty().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=ty().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=VK(l).sum(B=>B.value??0).sort((B,H)=>(H.value??0)-(B.value??0)),k=Pbt().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?OC+f2:0).paddingInner(a).paddingLeft(B=>B.children&&B.children.length>0?f2:0).paddingRight(B=>B.children&&B.children.length>0?f2:0).paddingBottom(B=>B.children&&B.children.length>0?f2: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",OC).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",OC),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",OC/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",OC/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(sxr,t),s=i.titleColor??n.titleColor,a=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),Xbr=jbr;function zYe(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(zYe,"buildStyleByKey");var Kbr=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=zYe(i.getStyleData()),m=HYe(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=Ko(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=Mbr().width(y).height(v-T);k.datum(m).call(E);const A=u?dr.svg(k.select("svg").node()):void 0,R=Ibr(m,{width:y,height:v-T,padding:(s==null?void 0:s.padding)??15}),_=new Map;for(const D of R){const F=Dp([...D.data.sets].sort());_.set(F,D)}p.length>0&&VYe(s,_,k,p,b,g);const P=Bl(a.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(D,F){var Q;const z=wt(this),B=Dp([...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:Foe(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=Dp([...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:Foe(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=Dp([...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=Dp([...D.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",D=>{var V;const z=Dp([...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 Dp(t){return t.join("|")}w(Dp,"stableSetsKey");function VYe(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=Dp(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(VYe,"renderTextNodes");function HYe(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(HYe,"ensurePairwiseSubsets");var Zbr={draw:Kbr},Qbr={parser:Nbr,db:Ybr,renderer:Zbr,styles:Xbr};const Jbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qbr},Symbol.toStringTag,{value:"Module"}));var _T,GYe=(_T=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=>{rZ(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(_T,"TreeMapDB"),_T);function WYe(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(WYe,"buildHierarchy");var exr=w((t,e)=>{Hl(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=txr(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=WYe(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"),txr=w(t=>t.name?String(t.name):"","getItemName"),qYe={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=qYe.parser)==null?void 0:e.yy;if(!(i instanceof GYe))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.");exr(n,i)}catch(r){throw de.error("Error parsing treemap:",r),r}},"parse")},rxr=10,f2=10,OC=25,nxr=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),a=s.padding??rxr,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=br();if(!l)return;const h=o?30:0,d=Ko(e),f=s.nodeWidth?s.nodeWidth*f2:960,p=s.nodeHeight?s.nodeHeight*f2: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=>"$"+u1(",")(H),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const H=/\.\d+/.exec(B),G=H?H[0]:"";y=w(W=>"$"+u1(","+G)(W),"valueFormat")}else if(B.startsWith("$")){const H=B.substring(1);y=w(G=>"$"+u1(H||"")(G),"valueFormat")}else y=u1(B)}catch(B){de.error("Error creating format function:",B),y=u1(",")}const v=ty().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=ty().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=ty().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=VK(l).sum(B=>B.value??0).sort((B,H)=>(H.value??0)-(B.value??0)),k=$bt().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?OC+f2:0).paddingInner(a).paddingLeft(B=>B.children&&B.children.length>0?f2:0).paddingRight(B=>B.children&&B.children.length>0?f2:0).paddingBottom(B=>B.children&&B.children.length>0?f2: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",OC).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",OC),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",OC/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",OC/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(axr,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}; @@ -5579,8 +5579,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error fill: ${s}; font-size: ${i.titleFontSize}; } - `},"getStyles"),oxr=axr,lxr={parser:WYe,get db(){return new HYe},renderer:ixr,styles:oxr};const cxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:lxr},Symbol.toStringTag,{value:"Module"}));var QI=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"),Wm=w((t,e,r)=>({x:QI(e,`${r} evolution`),y:QI(t,`${r} visibility`)}),"toCoordinates"),jye=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),uxr=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"),hxr=w((t,e)=>{if(Hl(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=Wm(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=Wm(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=Wm(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=QI(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=jye(r.fromPort)??jye(r.toPort);const{flow:s,label:a}=uxr(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=QI(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=Wm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=Wm(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=Wm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=Wm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),qYe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("wardley",t);de.debug(e);const r=(n=qYe.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.");hxr(e,r)},"parse")},LT,dxr=(LT=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(LT,"WardleyBuilder"),LT),el=new dxr;function UYe(){return Ve()["wardley-beta"]}w(UYe,"getConfig");function YYe(t,e,r,n,i,s,a,o,l){el.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:s,labelOffsetY:a,inertia:o,sourceStrategy:l})}w(YYe,"addNode");function jYe(t,e,r=!1,n,i){el.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(jYe,"addLink");function XYe(t,e,r){el.addTrend({nodeId:t,targetX:e,targetY:r})}w(XYe,"addTrend");function KYe(t,e,r){el.addAnnotation({number:t,coordinates:e,text:r})}w(KYe,"addAnnotation");function ZYe(t,e,r){el.addNote({text:t,x:e,y:r})}w(ZYe,"addNote");function QYe(t,e,r){el.addAccelerator({name:t,x:e,y:r})}w(QYe,"addAccelerator");function JYe(t,e,r){el.addDeaccelerator({name:t,x:e,y:r})}w(JYe,"addDeaccelerator");function eje(t,e){el.setAnnotationsBox(t,e)}w(eje,"setAnnotationsBox");function tje(t,e){el.setSize(t,e)}w(tje,"setSize");function rje(t){el.startPipeline(t)}w(rje,"startPipeline");function nje(t,e){el.addPipelineComponent(t,e)}w(nje,"addPipelineComponent");function ije(t){el.setAxes(t)}w(ije,"updateAxes");function sje(t){return el.getNode(t)}w(sje,"getNode");function aje(t){return el.resolveNodeId(t)}w(aje,"resolveNodeId");function oje(){return el.build()}w(oje,"getWardleyData");function lje(){el.clear(),Ri()}w(lje,"clear");var fxr={getConfig:UYe,addNode:YYe,addLink:jYe,addTrend:XYe,addAnnotation:KYe,addNote:ZYe,addAccelerator:QYe,addDeaccelerator:JYe,setAnnotationsBox:eje,setSize:tje,startPipeline:rje,addPipelineComponent:nje,updateAxes:ije,getNode:sje,resolveNodeId:aje,getWardleyData:oje,clear:lje,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},pxr=["Genesis","Custom Built","Product","Commodity"],gxr=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"),mxr=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"),yxr=w((t,e,r,n)=>{var D,F;de.debug(`Rendering Wardley map -`+t);const i=mxr(),s=gxr(),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=Ko(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:pxr;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"),lxr=oxr,cxr={parser:qYe,get db(){return new GYe},renderer:sxr,styles:lxr};const uxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:cxr},Symbol.toStringTag,{value:"Module"}));var QI=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"),Wm=w((t,e,r)=>({x:QI(e,`${r} evolution`),y:QI(t,`${r} visibility`)}),"toCoordinates"),Xye=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),hxr=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"),dxr=w((t,e)=>{if(Hl(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=Wm(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=Wm(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=Wm(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=QI(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=Xye(r.fromPort)??Xye(r.toPort);const{flow:s,label:a}=hxr(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=QI(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=Wm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=Wm(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=Wm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=Wm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),UYe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await zu("wardley",t);de.debug(e);const r=(n=UYe.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.");dxr(e,r)},"parse")},LT,fxr=(LT=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(LT,"WardleyBuilder"),LT),el=new fxr;function YYe(){return Ve()["wardley-beta"]}w(YYe,"getConfig");function jYe(t,e,r,n,i,s,a,o,l){el.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:s,labelOffsetY:a,inertia:o,sourceStrategy:l})}w(jYe,"addNode");function XYe(t,e,r=!1,n,i){el.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(XYe,"addLink");function KYe(t,e,r){el.addTrend({nodeId:t,targetX:e,targetY:r})}w(KYe,"addTrend");function ZYe(t,e,r){el.addAnnotation({number:t,coordinates:e,text:r})}w(ZYe,"addAnnotation");function QYe(t,e,r){el.addNote({text:t,x:e,y:r})}w(QYe,"addNote");function JYe(t,e,r){el.addAccelerator({name:t,x:e,y:r})}w(JYe,"addAccelerator");function eje(t,e,r){el.addDeaccelerator({name:t,x:e,y:r})}w(eje,"addDeaccelerator");function tje(t,e){el.setAnnotationsBox(t,e)}w(tje,"setAnnotationsBox");function rje(t,e){el.setSize(t,e)}w(rje,"setSize");function nje(t){el.startPipeline(t)}w(nje,"startPipeline");function ije(t,e){el.addPipelineComponent(t,e)}w(ije,"addPipelineComponent");function sje(t){el.setAxes(t)}w(sje,"updateAxes");function aje(t){return el.getNode(t)}w(aje,"getNode");function oje(t){return el.resolveNodeId(t)}w(oje,"resolveNodeId");function lje(){return el.build()}w(lje,"getWardleyData");function cje(){el.clear(),Ri()}w(cje,"clear");var pxr={getConfig:YYe,addNode:jYe,addLink:XYe,addTrend:KYe,addAnnotation:ZYe,addNote:QYe,addAccelerator:JYe,addDeaccelerator:eje,setAnnotationsBox:tje,setSize:rje,startPipeline:nje,addPipelineComponent:ije,updateAxes:sje,getNode:aje,resolveNodeId:oje,getWardleyData:lje,clear:cje,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},gxr=["Genesis","Custom Built","Product","Commodity"],mxr=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"),yxr=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"),vxr=w((t,e,r,n)=>{var D,F;de.debug(`Rendering Wardley map +`+t);const i=yxr(),s=mxr(),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=Ko(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:gxr;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} @@ -5598,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"),vxr={draw:yxr},bxr=w(({wardley:t}={})=>{const e=V0(),r=br(),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"),bxr={draw:vxr},xxr=w(({wardley:t}={})=>{const e=V0(),r=br(),n=es(e,r.themeVariables),i=es(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -5656,7 +5656,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),xxr={parser:qYe,db:fxr,renderer:vxr,styles:bxr};const wxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xxr},Symbol.toStringTag,{value:"Module"}));var cje=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),nA=cje(),Txr=w(()=>nA.domains,"getDomains"),Cxr=w(()=>nA.transitions,"getTransitions"),kxr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));nA.domains.set(r,{name:r,items:n})}},"setDomains"),Sxr=w(t=>{t&&(nA.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"),Exr=w(()=>es({...Sn.cynefin,...br().cynefin}),"getConfig"),Axr=w(()=>{Ri(),nA=cje()},"clear"),e9={getDomains:Txr,getTransitions:Cxr,setDomains:kxr,setTransitions:Sxr,getConfig:Exr,clear:Axr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Mxr=w(t=>{Hl(t,e9),e9.setDomains(t.domains),e9.setTransitions(t.transitions)},"populate"),Rxr={parse:w(async t=>{const e=await zu("cynefin",t);de.debug(e),Mxr(e)},"parse")};function ME(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(ME,"seededRandom");function uje(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"),Lxr=w(()=>{const t=V0(),e=br();return es(t,e.themeVariables).cynefin},"getCynefinDomainColors"),NV=3,Ixr=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=Lxr();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=Ko(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=_xr(f,p),k=hje(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",dje(f,p,k,y)).attr("fill","none"),R.append("path").attr("class","cynefinBoundary").attr("d",fje(f,p,k+100,y)).attr("fill","none"),R.append("path").attr("class","cynefinCliff").attr("d",pje(f,p)).attr("fill","none");const _=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",gje(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=Xye[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(Xye.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>NV&&(H=F.items.length-NV,B=F.items.slice(0,NV));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"),Nxr={draw:Ixr},Dxr=w(()=>{const t=V0(),e=br();return es(t,e.themeVariables).cynefin},"getCynefinTheme"),Oxr=w(()=>{const t=Dxr();return` + `},"styles"),wxr={parser:UYe,db:pxr,renderer:bxr,styles:xxr};const Txr=Object.freeze(Object.defineProperty({__proto__:null,diagram:wxr},Symbol.toStringTag,{value:"Module"}));var uje=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),nA=uje(),Cxr=w(()=>nA.domains,"getDomains"),kxr=w(()=>nA.transitions,"getTransitions"),Sxr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));nA.domains.set(r,{name:r,items:n})}},"setDomains"),Exr=w(t=>{t&&(nA.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"),Axr=w(()=>es({...Sn.cynefin,...br().cynefin}),"getConfig"),Mxr=w(()=>{Ri(),nA=uje()},"clear"),e9={getDomains:Cxr,getTransitions:kxr,setDomains:Sxr,setTransitions:Exr,getConfig:Axr,clear:Mxr,setAccTitle:Hi,getAccTitle:ts,setDiagramTitle:Ji,getDiagramTitle:qi,getAccDescription:ns,setAccDescription:rs},Rxr=w(t=>{Hl(t,e9),e9.setDomains(t.domains),e9.setTransitions(t.transitions)},"populate"),_xr={parse:w(async t=>{const e=await zu("cynefin",t);de.debug(e),Rxr(e)},"parse")};function ME(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(ME,"seededRandom");function hje(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"),Ixr=w(()=>{const t=V0(),e=br();return es(t,e.themeVariables).cynefin},"getCynefinDomainColors"),NV=3,Nxr=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=Ixr();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=Ko(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=Lxr(f,p),k=dje(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",fje(f,p,k,y)).attr("fill","none"),R.append("path").attr("class","cynefinBoundary").attr("d",pje(f,p,k+100,y)).attr("fill","none"),R.append("path").attr("class","cynefinCliff").attr("d",gje(f,p)).attr("fill","none");const _=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",mje(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=Kye[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(Kye.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>NV&&(H=F.items.length-NV,B=F.items.slice(0,NV));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:Nxr},Oxr=w(()=>{const t=V0(),e=br();return es(t,e.themeVariables).cynefin},"getCynefinTheme"),Pxr=w(()=>{const t=Oxr();return` .cynefinDomain { stroke: none; } @@ -5717,8 +5717,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),Pxr=Oxr,$xr={parser:Rxr,db:e9,renderer:Nxr,styles:Pxr};const Bxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:$xr},Symbol.toStringTag,{value:"Module"}));var oie="",lie="",cie="",uie=[],JI=new Map,og=w(t=>Ln(t,Ve()),"sanitizeText"),Y2=w(t=>{switch(t.type){case"terminal":return{...t,value:og(t.value)};case"nonterminal":return{...t,name:og(t.name)};case"sequence":return{...t,elements:t.elements.map(Y2)};case"choice":return{...t,alternatives:t.alternatives.map(Y2)};case"optional":return{...t,element:Y2(t.element)};case"repetition":return{...t,element:Y2(t.element),separator:t.separator?Y2(t.separator):void 0};case"special":return{...t,text:og(t.text)}}},"sanitizeAstNode"),Fxr=w(()=>{oie="",lie="",cie="",uie.length=0,JI.clear(),Ri(),de.debug("[Railroad] Database cleared")},"clear"),mje=w(t=>{oie=og(t),de.debug("[Railroad] Title set:",t)},"setTitle"),yje=w(()=>oie,"getTitle"),zxr=w(t=>{const e={...t,name:og(t.name),definition:Y2(t.definition),comment:t.comment?og(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.`),uie.push(e),JI.set(e.name,e)},"addRule"),Vxr=w(()=>uie,"getRules"),Hxr=w(t=>JI.get(t),"getRule"),Gxr=w(t=>{lie=og(t).replace(/^\s+/g,""),de.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Wxr=w(()=>lie,"getAccTitle"),qxr=w(t=>{cie=og(t).replace(/\n\s+/g,` -`),de.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),Uxr=w(()=>cie,"getAccDescription"),Yxr=mje,jxr=yje,Qi={clear:Fxr,setTitle:mje,getTitle:yje,addRule:zxr,getRules:Vxr,getRule:Hxr,setAccTitle:Gxr,getAccTitle:Wxr,setAccDescription:qxr,getAccDescription:Uxr,setDiagramTitle:Yxr,getDiagramTitle:jxr},co={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},Xxr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,Kxr=/^[\w "',.-]+$/,Zxr=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"]),vje=w(t=>t?Object.keys(t).every(e=>e==="railroad"||Zxr.has(e)):!1,"isRailroadStyleOptions"),Qxr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:vje(t)?t:{}:{},"extractRailroadOverrides"),Jxr=w(t=>{if(!t||vje(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 Xxr.test(r)?r:e},"sanitizeColorValue"),bje=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Kxr.test(r)?r:e},"sanitizeFontFamilyValue"),qm=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"),e4r=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"),t4r=w(t=>{const e=bje(t.fontFamily,co.fontFamily),r=e4r(t.fontSize)??co.fontSize;return{...co,fontFamily:e,fontSize:r,terminalFill:wi(t.secondBkg??t.secondaryColor,co.terminalFill),terminalStroke:wi(t.secondaryBorderColor??t.lineColor,co.terminalStroke),terminalTextColor:wi(t.secondaryTextColor??t.textColor,co.terminalTextColor),nonTerminalFill:wi(t.mainBkg??t.background,co.nonTerminalFill),nonTerminalStroke:wi(t.primaryBorderColor??t.lineColor,co.nonTerminalStroke),nonTerminalTextColor:wi(t.primaryTextColor??t.textColor,co.nonTerminalTextColor),lineColor:wi(t.lineColor,co.lineColor),markerFill:wi(t.lineColor,co.markerFill),commentFill:wi(t.labelBackground??t.tertiaryColor,co.commentFill),commentStroke:wi(t.tertiaryBorderColor??t.lineColor,co.commentStroke),commentTextColor:wi(t.tertiaryTextColor??t.textColor,co.commentTextColor),specialFill:wi(t.tertiaryColor??t.secondaryColor,co.specialFill),specialStroke:wi(t.tertiaryBorderColor??t.secondaryBorderColor,co.specialStroke),ruleNameColor:wi(t.titleColor??t.textColor,co.ruleNameColor)}},"buildThemeDefaults"),hie=w(t=>{const e=br(),r={...V0(),...e.themeVariables??{},...Jxr(t)},n=t4r(r),i={...e.railroad??{},...Qxr(t)};return{compactMode:i.compactMode??n.compactMode,padding:qm(i.padding,n.padding),verticalSeparation:qm(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:qm(i.horizontalSeparation,n.horizontalSeparation),arcRadius:qm(i.arcRadius,n.arcRadius),fontSize:qm(i.fontSize,n.fontSize),fontFamily:bje(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:qm(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:qm(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),HP=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}=hie(t);return` + `},"styles"),$xr=Pxr,Bxr={parser:_xr,db:e9,renderer:Dxr,styles:$xr};const Fxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Bxr},Symbol.toStringTag,{value:"Module"}));var oie="",lie="",cie="",uie=[],JI=new Map,og=w(t=>Ln(t,Ve()),"sanitizeText"),Y2=w(t=>{switch(t.type){case"terminal":return{...t,value:og(t.value)};case"nonterminal":return{...t,name:og(t.name)};case"sequence":return{...t,elements:t.elements.map(Y2)};case"choice":return{...t,alternatives:t.alternatives.map(Y2)};case"optional":return{...t,element:Y2(t.element)};case"repetition":return{...t,element:Y2(t.element),separator:t.separator?Y2(t.separator):void 0};case"special":return{...t,text:og(t.text)}}},"sanitizeAstNode"),zxr=w(()=>{oie="",lie="",cie="",uie.length=0,JI.clear(),Ri(),de.debug("[Railroad] Database cleared")},"clear"),yje=w(t=>{oie=og(t),de.debug("[Railroad] Title set:",t)},"setTitle"),vje=w(()=>oie,"getTitle"),Vxr=w(t=>{const e={...t,name:og(t.name),definition:Y2(t.definition),comment:t.comment?og(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.`),uie.push(e),JI.set(e.name,e)},"addRule"),Hxr=w(()=>uie,"getRules"),Gxr=w(t=>JI.get(t),"getRule"),Wxr=w(t=>{lie=og(t).replace(/^\s+/g,""),de.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),qxr=w(()=>lie,"getAccTitle"),Uxr=w(t=>{cie=og(t).replace(/\n\s+/g,` +`),de.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),Yxr=w(()=>cie,"getAccDescription"),jxr=yje,Xxr=vje,Qi={clear:zxr,setTitle:yje,getTitle:vje,addRule:Vxr,getRules:Hxr,getRule:Gxr,setAccTitle:Wxr,getAccTitle:qxr,setAccDescription:Uxr,getAccDescription:Yxr,setDiagramTitle:jxr,getDiagramTitle:Xxr},co={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},Kxr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,Zxr=/^[\w "',.-]+$/,Qxr=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"]),bje=w(t=>t?Object.keys(t).every(e=>e==="railroad"||Qxr.has(e)):!1,"isRailroadStyleOptions"),Jxr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:bje(t)?t:{}:{},"extractRailroadOverrides"),e4r=w(t=>{if(!t||bje(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 Kxr.test(r)?r:e},"sanitizeColorValue"),xje=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Zxr.test(r)?r:e},"sanitizeFontFamilyValue"),qm=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"),t4r=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"),r4r=w(t=>{const e=xje(t.fontFamily,co.fontFamily),r=t4r(t.fontSize)??co.fontSize;return{...co,fontFamily:e,fontSize:r,terminalFill:wi(t.secondBkg??t.secondaryColor,co.terminalFill),terminalStroke:wi(t.secondaryBorderColor??t.lineColor,co.terminalStroke),terminalTextColor:wi(t.secondaryTextColor??t.textColor,co.terminalTextColor),nonTerminalFill:wi(t.mainBkg??t.background,co.nonTerminalFill),nonTerminalStroke:wi(t.primaryBorderColor??t.lineColor,co.nonTerminalStroke),nonTerminalTextColor:wi(t.primaryTextColor??t.textColor,co.nonTerminalTextColor),lineColor:wi(t.lineColor,co.lineColor),markerFill:wi(t.lineColor,co.markerFill),commentFill:wi(t.labelBackground??t.tertiaryColor,co.commentFill),commentStroke:wi(t.tertiaryBorderColor??t.lineColor,co.commentStroke),commentTextColor:wi(t.tertiaryTextColor??t.textColor,co.commentTextColor),specialFill:wi(t.tertiaryColor??t.secondaryColor,co.specialFill),specialStroke:wi(t.tertiaryBorderColor??t.secondaryBorderColor,co.specialStroke),ruleNameColor:wi(t.titleColor??t.textColor,co.ruleNameColor)}},"buildThemeDefaults"),hie=w(t=>{const e=br(),r={...V0(),...e.themeVariables??{},...e4r(t)},n=r4r(r),i={...e.railroad??{},...Jxr(t)};return{compactMode:i.compactMode??n.compactMode,padding:qm(i.padding,n.padding),verticalSeparation:qm(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:qm(i.horizontalSeparation,n.horizontalSeparation),arcRadius:qm(i.arcRadius,n.arcRadius),fontSize:qm(i.fontSize,n.fontSize),fontFamily:xje(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:qm(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:qm(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),HP=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}=hie(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -5803,9 +5803,9 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),IT,au=(IT=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(IT,"PathBuilder"),IT),NT,r4r=(NT=class{constructor(e,r=hie()){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(NT,"RailroadRenderer"),NT),Kye=w((t,e,r)=>{Fs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),n4r=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram -`+t);try{const n=Ko(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"),Kye(n,{height:100,width:200},s);return}const l=new r4r(n,hie()).renderDiagram(a);Kye(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),GP={draw:n4r},i4r=lne().Railroad.parser.LangiumParser,j2=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(j2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(j2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:j2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:j2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:j2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),s4r=w(t=>({name:t.name,definition:j2(t.definition)}),"transformRule"),a4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(s4r(e)))},"populateDb"),o4r={parse:w(t=>{Qi.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=i4r.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),a4r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Qi}},l4r={parser:o4r,db:Qi,renderer:GP,styles:HP};const c4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:l4r},Symbol.toStringTag,{value:"Module"}));var u4r=cne().RailroadEbnf.parser.LangiumParser,t9=w(t=>{const e=t.alternatives.map(h4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),h4r=w(t=>{const e=t.elements.map(f4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),xje=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 t9(t.element);case"EbnfOptional":return{type:"optional",element:t9(t.element)};case"EbnfRepetition":return{type:"repetition",element:t9(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),d4r=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:"-"},xje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),f4r=w(t=>t.postfixes.reduce((e,r)=>d4r(e,r),xje(t.base)),"transformTerm"),p4r=w(t=>({name:t.name,definition:t9(t.definition)}),"transformRule"),g4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(p4r(e)))},"populateDb"),m4r={parse:w(t=>{Qi.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=u4r.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),g4r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},y4r={parser:m4r,db:Qi,renderer:GP,styles:HP};const v4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:y4r},Symbol.toStringTag,{value:"Module"}));var b4r=une().RailroadAbnf.parser.LangiumParser,eX=w(t=>{const e=t.alternatives.map(x4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),x4r=w(t=>{const e=t.elements.map(T4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),w4r=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=C4r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=w4r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),C4r=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 eX(t.element);case"AbnfOptionalGroup":return{type:"optional",element:eX(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),k4r=w(t=>({name:t.name,definition:eX(t.definition)}),"transformRule"),S4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(k4r(e)))},"populateDb"),E4r={parse:w(t=>{Qi.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=b4r.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),S4r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},A4r={parser:E4r,db:Qi,renderer:GP,styles:HP};const M4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:A4r},Symbol.toStringTag,{value:"Module"}));var R4r=hne().RailroadPeg.parser.LangiumParser,wje=w(t=>{const e=t.alternatives.map(_4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),_4r=w(t=>{const e=t.elements.map(L4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),L4r=w(t=>{const e=I4r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Zye(e)}`:`!${Zye(e)}`}:e},"transformPrefix"),Zye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),I4r=w(t=>{const e=N4r(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"),N4r=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return wje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),D4r=w(t=>({name:t.name,definition:wje(t.definition)}),"transformRule"),O4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(D4r(e)))},"populateDb"),P4r={parse:w(t=>{Qi.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=R4r.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),O4r(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Qi}},$4r={parser:P4r,db:Qi,renderer:GP,styles:HP};const B4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:$4r},Symbol.toStringTag,{value:"Module"}));var F4r=1;function die(){if(!(typeof globalThis>"u"))return globalThis}w(die,"getCaptureGlobal");function Tje(){var t;return!!((t=die())!=null&&t.mermaidCaptureSizes)}w(Tje,"shouldCaptureSizes");function Cje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(Cje,"capturedFromLocation");function kje(t,e){const r=die();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(kje,"emitCapturedSizes");function Sje(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&&kje({metadata:{captureVersion:F4r,capturedAt:new Date().toISOString(),capturedFrom:Cje()},nodes:r},t)}w(Sje,"captureNodeSizes");const z4r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Sje,shouldCaptureSizes:Tje},Symbol.toStringTag,{value:"Module"})),V4r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:FGe,createInfoServices:zGe},Symbol.toStringTag,{value:"Module"})),H4r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:VGe,createPacketServices:HGe},Symbol.toStringTag,{value:"Module"})),G4r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:GGe,createPieServices:WGe},Symbol.toStringTag,{value:"Module"})),W4r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:qGe,createTreeViewServices:UGe},Symbol.toStringTag,{value:"Module"})),q4r=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:YGe,createArchitectureServices:jGe},Symbol.toStringTag,{value:"Module"})),U4r=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:$Ge,createGitGraphServices:BGe},Symbol.toStringTag,{value:"Module"})),Y4r=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:KGe,createEventModelingServices:ZGe},Symbol.toStringTag,{value:"Module"})),j4r=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:kGe,createRadarServices:SGe},Symbol.toStringTag,{value:"Module"})),X4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:EGe,createRailroadServices:lne},Symbol.toStringTag,{value:"Module"})),K4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:AGe,createRailroadEbnfServices:cne},Symbol.toStringTag,{value:"Module"})),Z4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:MGe,createRailroadAbnfServices:une},Symbol.toStringTag,{value:"Module"})),Q4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:RGe,createRailroadPegServices:hne},Symbol.toStringTag,{value:"Module"})),J4r=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:LGe,createTreemapServices:IGe},Symbol.toStringTag,{value:"Module"})),ewr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:NGe,createWardleyServices:DGe},Symbol.toStringTag,{value:"Module"})),twr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:OGe,createCynefinServices:PGe},Symbol.toStringTag,{value:"Module"})); - +`},"getStyles"),IT,au=(IT=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(IT,"PathBuilder"),IT),NT,n4r=(NT=class{constructor(e,r=hie()){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(NT,"RailroadRenderer"),NT),Zye=w((t,e,r)=>{Fs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),i4r=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram +`+t);try{const n=Ko(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"),Zye(n,{height:100,width:200},s);return}const l=new n4r(n,hie()).renderDiagram(a);Zye(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),GP={draw:i4r},s4r=lne().Railroad.parser.LangiumParser,j2=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(j2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(j2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:j2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:j2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:j2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),a4r=w(t=>({name:t.name,definition:j2(t.definition)}),"transformRule"),o4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(a4r(e)))},"populateDb"),l4r={parse:w(t=>{Qi.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=s4r.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),o4r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Qi}},c4r={parser:l4r,db:Qi,renderer:GP,styles:HP};const u4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:c4r},Symbol.toStringTag,{value:"Module"}));var h4r=cne().RailroadEbnf.parser.LangiumParser,t9=w(t=>{const e=t.alternatives.map(d4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),d4r=w(t=>{const e=t.elements.map(p4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),wje=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 t9(t.element);case"EbnfOptional":return{type:"optional",element:t9(t.element)};case"EbnfRepetition":return{type:"repetition",element:t9(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),f4r=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:"-"},wje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),p4r=w(t=>t.postfixes.reduce((e,r)=>f4r(e,r),wje(t.base)),"transformTerm"),g4r=w(t=>({name:t.name,definition:t9(t.definition)}),"transformRule"),m4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(g4r(e)))},"populateDb"),y4r={parse:w(t=>{Qi.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=h4r.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),m4r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},v4r={parser:y4r,db:Qi,renderer:GP,styles:HP};const b4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:v4r},Symbol.toStringTag,{value:"Module"}));var x4r=une().RailroadAbnf.parser.LangiumParser,eX=w(t=>{const e=t.alternatives.map(w4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),w4r=w(t=>{const e=t.elements.map(C4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),T4r=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"),C4r=w(t=>{const e=k4r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=T4r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),k4r=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 eX(t.element);case"AbnfOptionalGroup":return{type:"optional",element:eX(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),S4r=w(t=>({name:t.name,definition:eX(t.definition)}),"transformRule"),E4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(S4r(e)))},"populateDb"),A4r={parse:w(t=>{Qi.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=x4r.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),E4r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Qi}},M4r={parser:A4r,db:Qi,renderer:GP,styles:HP};const R4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:M4r},Symbol.toStringTag,{value:"Module"}));var _4r=hne().RailroadPeg.parser.LangiumParser,Tje=w(t=>{const e=t.alternatives.map(L4r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),L4r=w(t=>{const e=t.elements.map(I4r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),I4r=w(t=>{const e=N4r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Qye(e)}`:`!${Qye(e)}`}:e},"transformPrefix"),Qye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),N4r=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 Tje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),O4r=w(t=>({name:t.name,definition:Tje(t.definition)}),"transformRule"),P4r=w(t=>{Hl(t,Qi),t.title&&Qi.setTitle(t.title),t.rules.map(e=>Qi.addRule(O4r(e)))},"populateDb"),$4r={parse:w(t=>{Qi.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=_4r.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}},B4r={parser:$4r,db:Qi,renderer:GP,styles:HP};const F4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:B4r},Symbol.toStringTag,{value:"Module"}));var z4r=1;function die(){if(!(typeof globalThis>"u"))return globalThis}w(die,"getCaptureGlobal");function Cje(){var t;return!!((t=die())!=null&&t.mermaidCaptureSizes)}w(Cje,"shouldCaptureSizes");function kje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(kje,"capturedFromLocation");function Sje(t,e){const r=die();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(Sje,"emitCapturedSizes");function Eje(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&&Sje({metadata:{captureVersion:z4r,capturedAt:new Date().toISOString(),capturedFrom:kje()},nodes:r},t)}w(Eje,"captureNodeSizes");const V4r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Eje,shouldCaptureSizes:Cje},Symbol.toStringTag,{value:"Module"})),H4r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:zGe,createInfoServices:VGe},Symbol.toStringTag,{value:"Module"})),G4r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:HGe,createPacketServices:GGe},Symbol.toStringTag,{value:"Module"})),W4r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:WGe,createPieServices:qGe},Symbol.toStringTag,{value:"Module"})),q4r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:UGe,createTreeViewServices:YGe},Symbol.toStringTag,{value:"Module"})),U4r=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:jGe,createArchitectureServices:XGe},Symbol.toStringTag,{value:"Module"})),Y4r=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:BGe,createGitGraphServices:FGe},Symbol.toStringTag,{value:"Module"})),j4r=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:ZGe,createEventModelingServices:QGe},Symbol.toStringTag,{value:"Module"})),X4r=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:SGe,createRadarServices:EGe},Symbol.toStringTag,{value:"Module"})),K4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:AGe,createRailroadServices:lne},Symbol.toStringTag,{value:"Module"})),Z4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:MGe,createRailroadEbnfServices:cne},Symbol.toStringTag,{value:"Module"})),Q4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:RGe,createRailroadAbnfServices:une},Symbol.toStringTag,{value:"Module"})),J4r=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:_Ge,createRailroadPegServices:hne},Symbol.toStringTag,{value:"Module"})),ewr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:IGe,createTreemapServices:NGe},Symbol.toStringTag,{value:"Module"})),twr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:DGe,createWardleyServices:OGe},Symbol.toStringTag,{value:"Module"})),rwr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:PGe,createCynefinServices:$Ge},Symbol.toStringTag,{value:"Module"})); +