@gobing-ai/spur 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/{spur-cli/config → config}/rules/boundary/sp-runtime-path.yaml +5 -0
- package/package.json +4 -3
- package/spur.js +30 -5
- package/web/_astro/BoardApp.Bcfvp2GH.js +1 -0
- package/web/_astro/BoardApp.DjpO2XHn.js +178 -0
- package/web/_astro/BoardApp.t7x-dYDo.css +1 -0
- package/web/_astro/TaskDetail.DilpuD7R.js +1 -0
- package/web/_astro/arc.KcqIior8.js +1 -0
- package/web/_astro/architectureDiagram-3BPJPVTR.BTFU70BY.js +36 -0
- package/web/_astro/blockDiagram-GPEHLZMM.apx49Oy9.js +132 -0
- package/web/_astro/c4Diagram-AAUBKEIU.BM-J4juX.js +10 -0
- package/web/_astro/channel.vSp82e1U.js +1 -0
- package/web/_astro/chunk-2J33WTMH.K6z7IYZU.js +1 -0
- package/web/_astro/chunk-4BX2VUAB.BDYhxKa0.js +1 -0
- package/web/_astro/chunk-55IACEB6.BnNOxqnI.js +1 -0
- package/web/_astro/chunk-727SXJPM.DNeg6N7v.js +206 -0
- package/web/_astro/chunk-AQP2D5EJ.BjILBkba.js +231 -0
- package/web/_astro/chunk-FMBD7UC4.DQ5UvvsV.js +15 -0
- package/web/_astro/chunk-ND2GUHAM.Yn1OvRJs.js +1 -0
- package/web/_astro/chunk-QZHKN3VN.UErqHgqw.js +1 -0
- package/web/_astro/classDiagram-4FO5ZUOK.BmjVF7iZ.js +1 -0
- package/web/_astro/classDiagram-v2-Q7XG4LA2.BmjVF7iZ.js +1 -0
- package/web/_astro/client.CdFpTatq.js +9 -0
- package/web/_astro/cose-bilkent-S5V4N54A.iKBxnkbb.js +1 -0
- package/web/_astro/cytoscape.esm.D3_iZ_3b.js +321 -0
- package/web/_astro/dagre-BM42HDAG.OwnCCrs6.js +4 -0
- package/web/_astro/defaultLocale.CrowFXzY.js +1 -0
- package/web/_astro/diagram-2AECGRRQ.DCdcffxE.js +43 -0
- package/web/_astro/diagram-5GNKFQAL.Ai-LvmVW.js +10 -0
- package/web/_astro/diagram-KO2AKTUF.B6e21QDN.js +3 -0
- package/web/_astro/diagram-LMA3HP47.oPfqy1fq.js +24 -0
- package/web/_astro/diagram-OG6HWLK6.Dh5QRDCE.js +24 -0
- package/web/_astro/erDiagram-TEJ5UH35.DpBiOcO3.js +85 -0
- package/web/_astro/flowDiagram-I6XJVG4X.NbMxFlVk.js +162 -0
- package/web/_astro/ganttDiagram-6RSMTGT7.JgZ3fDME.js +292 -0
- package/web/_astro/gitGraphDiagram-PVQCEYII.oMjFeZRt.js +106 -0
- package/web/_astro/graph.D2o_JWn5.js +1 -0
- package/web/_astro/index.A0eX93qW.js +1 -0
- package/web/_astro/index.CA3GTZM6.css +1 -0
- package/web/_astro/infoDiagram-5YYISTIA.kaio3YzK.js +2 -0
- package/web/_astro/init.Gi6I4Gst.js +1 -0
- package/web/_astro/ishikawaDiagram-YF4QCWOH.CXQfMyeF.js +70 -0
- package/web/_astro/journeyDiagram-JHISSGLW.AvNKMzx6.js +139 -0
- package/web/_astro/kanban-definition-UN3LZRKU.kv3cZGdE.js +89 -0
- package/web/_astro/katex.HP8lGamR.js +257 -0
- package/web/_astro/layout.DNLMvjEt.js +1 -0
- package/web/_astro/linear.CfLoHWjz.js +1 -0
- package/web/_astro/mermaid.core.BSV8pBn-.js +301 -0
- package/web/_astro/mindmap-definition-RKZ34NQL.CbL_3b32.js +96 -0
- package/web/_astro/ordinal.BYWQX77i.js +1 -0
- package/web/_astro/pieDiagram-4H26LBE5.5BXdOLRb.js +30 -0
- package/web/_astro/quadrantDiagram-W4KKPZXB.krXYbhlh.js +7 -0
- package/web/_astro/requirementDiagram-4Y6WPE33.COO4LapZ.js +84 -0
- package/web/_astro/sankeyDiagram-5OEKKPKP.BvL0Jbdx.js +40 -0
- package/web/_astro/sequenceDiagram-3UESZ5HK.Dk7Tu15E.js +162 -0
- package/web/_astro/stateDiagram-AJRCARHV.Cqh_KmEW.js +1 -0
- package/web/_astro/stateDiagram-v2-BHNVJYJU.WapPgDCy.js +1 -0
- package/web/_astro/timeline-definition-PNZ67QCA.CEVdiX0n.js +120 -0
- package/web/_astro/vennDiagram-CIIHVFJN.Cd9A63eF.js +34 -0
- package/web/_astro/wardley-L42UT6IY.DEiaHiIT.js +161 -0
- package/web/_astro/wardleyDiagram-YWT4CUSO.B7nGP61E.js +78 -0
- package/web/_astro/xychartDiagram-2RQKCTM6.Bq8CHmxC.js +7 -0
- package/web/favicon.svg +4 -0
- package/web/index.html +2 -0
- /package/{spur-cli/config → config}/config.example.yaml +0 -0
- /package/{spur-cli/config → config}/plugins/.gitkeep +0 -0
- /package/{spur-cli/config → config}/rules/README.md +0 -0
- /package/{spur-cli/config → config}/rules/boundary/config-loading-ownership.yaml +0 -0
- /package/{spur-cli/config → config}/rules/boundary/dao-boundary.yaml +0 -0
- /package/{spur-cli/config → config}/rules/boundary/planning-folder-hardcode.yaml +0 -0
- /package/{spur-cli/config → config}/rules/boundary/sp-no-vendor-refs.yaml +0 -0
- /package/{spur-cli/config → config}/rules/migration/rg-dialect.yaml +0 -0
- /package/{spur-cli/config → config}/rules/quality/coverage-gate.yaml +0 -0
- /package/{spur-cli/config → config}/rules/quality/tsdoc-exports.yaml +0 -0
- /package/{spur-cli/config → config}/rules/recommended-post-check.yaml +0 -0
- /package/{spur-cli/config → config}/rules/recommended-pre-check.yaml +0 -0
- /package/{spur-cli/config → config}/rules/rg-migration.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict/http-boundaries.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict/rule-files-structural.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict/runtime-boundaries.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict-check.yaml +0 -0
- /package/{spur-cli/config → config}/rules/structure/protected-files.yaml +0 -0
- /package/{spur-cli/config → config}/rules/structure/test-focus-skip.yaml +0 -0
- /package/{spur-cli/config → config}/rules/structure/test-location.yaml +0 -0
- /package/{spur-cli/config → config}/rules/surface/check-cli-surface.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/bun-tooling.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/guarded-happy-dom-register.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/happy-dom-teardown.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-biome-suppressions.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-debugger.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-leaky-module-mocks.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-module-scope-import-calls.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-unmocked-module-eval-side-effects.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/output-boundaries.yaml +0 -0
- /package/{spur-cli/config → config}/rules/ui/ui-import-boundary.yaml +0 -0
- /package/{spur-cli/config → config}/tasks/section-matrix.yaml +0 -0
- /package/{spur-cli/config → config}/templates/AGENTS.md +0 -0
- /package/{spur-cli/config → config}/templates/bdd/checklist.md +0 -0
- /package/{spur-cli/config → config}/templates/bdd/gherkin.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/00_ADR.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/01_PRD.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/02_ROADMAP.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/03_ARCHITECTURE.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/04_DESIGN.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/05_FEATURES.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/99_PROJECT_CONSTITUTION.md +0 -0
- /package/{spur-cli/config → config}/templates/feature/default.md +0 -0
- /package/{spur-cli/config → config}/templates/task/brainstorm.md +0 -0
- /package/{spur-cli/config → config}/templates/task/feature-impl.md +0 -0
- /package/{spur-cli/config → config}/templates/task/issue.md +0 -0
- /package/{spur-cli/config → config}/templates/task/meta.md +0 -0
- /package/{spur-cli/config → config}/templates/task/review.md +0 -0
- /package/{spur-cli/config → config}/templates/task/standard.md +0 -0
- /package/{spur-cli/config → config}/workflows/basic.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/docs-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/feature-dev.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/feature-lifecycle.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/idea-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/planning-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/task-lifecycle.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/task-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/wrapup-pipeline.yaml +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import{g as ae}from"./chunk-55IACEB6.BnNOxqnI.js";import{s as oe}from"./chunk-2J33WTMH.K6z7IYZU.js";import{b as l,aD as C,aa as ce,aU as le,a3 as he,S as G,a4 as B,aY as F,ag as de,au as ge,az as ue,L as pe}from"./mermaid.core.BSV8pBn-.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const o=e.random??e.rng?.()??ye();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,fe(o)}var Y=(function(){var e=l(function(D,s,i,a){for(i=i||{},a=D.length;a--;i[D[a]]=s);return i},"o"),n=[1,4],g=[1,13],o=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(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:l(function(s,i,a,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:o,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:o,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:o,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:o,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:l(function(s){var i=this,a=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var z=y.yylloc;r.push(z);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){a.length=a.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,W,O={},U,x,ee,V;;){if(v=a[a.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`:
|
|
2
|
+
`+y.showPosition()+`
|
|
3
|
+
Expecting `+V.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(M+1)+": Unexpected "+(b==Q?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:z,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(S[0]){case 1:a.push(b),p.push(y.yytext),r.push(y.yylloc),a.push(S[1]),b=null,K=y.yyleng,u=y.yytext,M=y.yylineno,z=y.yylloc;break;case 2:if(x=this.productions_[S[1]][1],O.$=p[p.length-x],O._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},se&&(O._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),W=this.performAction.apply(O,[u,K,M,L.yy,S[1],p,r].concat(ie)),typeof W<"u")return W;x&&(a=a.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),a.push(this.productions_[S[1]][0]),p.push(O.$),r.push(O._$),ee=$[a[a.length-2]][a[a.length-1]],a.push(ee);break;case 3:return!0}}return!0},"parse")},te=(function(){var D={EOF:1,parseError:l(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.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:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+i+"^"},"showPosition"),test_match:l(function(s,i){var a,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,a,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;r<p.length;r++)if(a=this._input.match(this.rules[p[r]]),a&&(!i||a[0].length>i[0].length)){if(i=a,c=r,this.options.backtrack_lexer){if(s=this.test_match(a,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var i=this.next();return i||this.lex()},"lex"),begin:l(function(i){this.conditionStack.push(i)},"begin"),popState:l(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:l(function(i){this.begin(i)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(i,a,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",a.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",a.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",a.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",a.yytext),20;case 36:return i.getLogger().trace("Long description:",a.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 D})();j.lexer=te;function P(){this.yy={}}return l(P,"Parser"),P.prototype=j,j.Parser=P,new P})();Y.parser=Y;var be=Y,ke=12,N={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Se=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=N,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)}static{l(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let n=this.nodes.length-1;n>=0;n--)if(this.nodes[n].level<e)return this.nodes[n];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,n,g,o){C.info("addNode",e,n,g,o);let t=!1;this.nodes.length===0?(this.baseLevel=e,e=0,t=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,t=!1);const h=B();let f=h.mindmap?.padding??G.mindmap.padding;switch(o){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}const m={id:this.count++,nodeId:F(n,h),level:e,descr:F(g,h),type:o,children:[],width:h.mindmap?.maxNodeWidth??G.mindmap.maxNodeWidth,padding:f,isRoot:t},_=this.getParent(e);if(_)_.children.push(m),this.nodes.push(m);else if(t)this.nodes.push(m);else throw new Error(`There can be only one root. No parent could be found for ("${m.descr}")`)}getType(e,n){switch(C.debug("In get type",e,n),e){case"[":return this.nodeType.RECT;case"(":return n===")"?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,n){this.elements[e]=n}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const n=B(),g=this.nodes[this.nodes.length-1];e.icon&&(g.icon=F(e.icon,n)),e.class&&(g.class=F(e.class,n))}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,n){if(e.level===0?e.section=void 0:e.section=n,e.children)for(const[g,o]of e.children.entries()){const t=e.level===0?g%(ke-1):n;this.assignSections(o,t)}}flattenNodes(e,n){const g=B(),o=["mindmap-node"];e.isRoot===!0?o.push("section-root","section--1"):e.section!==void 0&&o.push(`section-${e.section}`),e.class&&o.push(e.class);const t=o.join(" "),h=l(m=>{const T=(g.theme?.toLowerCase()??"").includes("redux");switch(m){case N.CIRCLE:return"mindmapCircle";case N.RECT:return"rect";case N.ROUNDED_RECT:return"rounded";case N.CLOUD:return"cloud";case N.BANG:return"bang";case N.HEXAGON:return"hexagon";case N.DEFAULT:return T?"rounded":"defaultMindmapNode";case N.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:h(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:t,cssStyles:[],look:g.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(n.push(f),e.children)for(const m of e.children)this.flattenNodes(m,n)}generateEdges(e,n){if(!e.children)return;const g=B();for(const o of e.children){let t="edge";o.section!==void 0&&(t+=` section-edge-${o.section}`);const h=e.level+1;t+=` edge-depth-${h}`;const f={id:`edge_${e.id}_${o.id}`,start:e.id.toString(),end:o.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:g.look,classes:t,depth:e.level,section:o.section};n.push(f),this.generateEdges(o,n)}}getData(){const e=this.getMindmap(),n=B(),o=de().layout!==void 0,t=n;if(o||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};C.debug("getData: mindmapRoot",e,n),this.assignSections(e);const h=[],f=[];this.flattenNodes(e,h),this.generateEdges(e,f),C.debug(`getData: processed ${h.length} nodes and ${f.length} edges`);const m=new Map;for(const _ of h)m.set(_.id,{shape:_.shape,width:_.width,height:_.height,padding:_.padding});return{nodes:h,edges:f,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(m),type:"mindmap",diagramId:"mindmap-"+Ee()}}getLogger(){return C}},xe=l(async(e,n,g,o)=>{C.debug(`Rendering mindmap diagram
|
|
7
|
+
`+e);const t=o.db,h=t.getData(),f=ae(n,h.config.securityLevel);if(h.type=o.type,h.layoutAlgorithm=ce(h.config.layout,{fallback:"cose-bilkent"}),h.diagramId=n,!t.getMindmap())return;h.nodes.forEach(d=>{d.shape==="rounded"?(d.radius=15,d.taper=15,d.stroke="none",d.width=0,d.padding=15):d.shape==="circle"?d.padding=10:d.shape==="rect"?(d.width=0,d.padding=10):d.shape==="hexagon"&&(d.width=0,d.height=0)}),await le(h,f);const{themeVariables:_}=he(),{useGradient:T,gradientStart:I,gradientStop:w}=_;if(T&&I&&w){const d=f.attr("id"),R=f.append("defs").append("linearGradient").attr("id",`${d}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");R.append("stop").attr("offset","0%").attr("stop-color",I).attr("stop-opacity",1),R.append("stop").attr("offset","100%").attr("stop-color",w).attr("stop-opacity",1)}oe(f,h.config.mindmap?.padding??G.mindmap.padding,"mindmapDiagram",h.config.mindmap?.useMaxWidth??G.mindmap.useMaxWidth)},"draw"),Ne={draw:xe},De=l(e=>{const{theme:n,look:g}=e;let o="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],ge(e["lineColor"+t])?e["lineColor"+t]=ue(e["lineColor"+t],20):e["lineColor"+t]=pe(e["lineColor"+t],20);for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const h=""+(g==="neo"?Math.max(10-(t-1)*2,2):17-3*t);o+=`
|
|
8
|
+
.section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {
|
|
9
|
+
fill: ${e["cScale"+t]};
|
|
10
|
+
}
|
|
11
|
+
.section-${t-1} text {
|
|
12
|
+
fill: ${e["cScaleLabel"+t]};
|
|
13
|
+
}
|
|
14
|
+
.section-${t-1} span {
|
|
15
|
+
color: ${e["cScaleLabel"+t]};
|
|
16
|
+
}
|
|
17
|
+
.node-icon-${t-1} {
|
|
18
|
+
font-size: 40px;
|
|
19
|
+
color: ${e["cScaleLabel"+t]};
|
|
20
|
+
}
|
|
21
|
+
.section-edge-${t-1}{
|
|
22
|
+
stroke: ${e["cScale"+t]};
|
|
23
|
+
}
|
|
24
|
+
.edge-depth-${t-1}{
|
|
25
|
+
stroke-width: ${h};
|
|
26
|
+
}
|
|
27
|
+
.section-${t-1} line {
|
|
28
|
+
stroke: ${e["cScaleInv"+t]} ;
|
|
29
|
+
stroke-width: 3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.disabled, .disabled circle, .disabled text {
|
|
33
|
+
fill: lightgray;
|
|
34
|
+
}
|
|
35
|
+
.disabled text {
|
|
36
|
+
fill: #efefef;
|
|
37
|
+
}
|
|
38
|
+
[data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon {
|
|
39
|
+
fill: ${n==="redux"||n==="redux-dark"||n==="neutral"?e.mainBkg:e["cScale"+t]};
|
|
40
|
+
stroke: ${n==="redux"||n==="redux-dark"?e.nodeBorder:e["cScale"+t]};
|
|
41
|
+
stroke-width: ${e.strokeWidth??2}px;
|
|
42
|
+
}
|
|
43
|
+
[data-look="neo"].section-edge-${t-1}{
|
|
44
|
+
stroke: ${n?.includes("redux")||n==="neo-dark"?e.nodeBorder:e["cScale"+t]};
|
|
45
|
+
}
|
|
46
|
+
[data-look="neo"].mindmap-node.section-${t-1} text {
|
|
47
|
+
fill: ${n==="redux"||n==="redux-dark"?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:t)]};
|
|
48
|
+
}
|
|
49
|
+
`}return o},"genSections"),Le=l((e,n,g)=>{let o="";for(let t=0;t<e;t++)o+=`
|
|
50
|
+
[data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon {
|
|
51
|
+
stroke: url(${n}-gradient);
|
|
52
|
+
fill: ${g};
|
|
53
|
+
}
|
|
54
|
+
.section-${t-1} line {
|
|
55
|
+
stroke-width: 0;
|
|
56
|
+
}`;return o},"genGradient"),ve=l(e=>{const{theme:n}=e,g=e.svgId,o=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${g}-drop-shadow)`):"none";return`
|
|
57
|
+
.edge {
|
|
58
|
+
stroke-width: 3;
|
|
59
|
+
}
|
|
60
|
+
${De(e)}
|
|
61
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
62
|
+
fill: ${e.git0};
|
|
63
|
+
}
|
|
64
|
+
.section-root text {
|
|
65
|
+
fill: ${e.gitBranchLabel0};
|
|
66
|
+
}
|
|
67
|
+
.section-root span {
|
|
68
|
+
color: ${n?.includes("redux")?e.nodeBorder:e.gitBranchLabel0};
|
|
69
|
+
}
|
|
70
|
+
.icon-container {
|
|
71
|
+
height:100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
}
|
|
76
|
+
.edge {
|
|
77
|
+
fill: none;
|
|
78
|
+
}
|
|
79
|
+
.mindmap-node-label {
|
|
80
|
+
dy: 1em;
|
|
81
|
+
alignment-baseline: middle;
|
|
82
|
+
text-anchor: middle;
|
|
83
|
+
dominant-baseline: middle;
|
|
84
|
+
text-align: center;
|
|
85
|
+
}
|
|
86
|
+
[data-look="neo"].mindmap-node {
|
|
87
|
+
filter: ${o};
|
|
88
|
+
}
|
|
89
|
+
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
|
|
90
|
+
fill: ${n?.includes("redux")?e.mainBkg:e.git0};
|
|
91
|
+
}
|
|
92
|
+
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
|
|
93
|
+
fill: ${n?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:0)]};
|
|
94
|
+
}
|
|
95
|
+
${e.useGradient&&g&&e.mainBkg?Le(e.THEME_COLOR_LIMIT,g,e.mainBkg):""}
|
|
96
|
+
`},"getStyles"),Te=ve,we={get db(){return new Se},renderer:Ne,parser:be,styles:Te};export{we as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as a}from"./init.Gi6I4Gst.js";class o extends Map{constructor(n,t=g){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(const[r,s]of n)this.set(r,s)}get(n){return super.get(c(this,n))}has(n){return super.has(c(this,n))}set(n,t){return super.set(l(this,n),t)}delete(n){return super.delete(p(this,n))}}function c({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):t}function l({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):(e.set(r,t),t)}function p({_intern:e,_key:n},t){const r=n(t);return e.has(r)&&(t=e.get(r),e.delete(r)),t}function g(e){return e!==null&&typeof e=="object"?e.valueOf():e}const f=Symbol("implicit");function h(){var e=new o,n=[],t=[],r=f;function s(u){let i=e.get(u);if(i===void 0){if(r!==f)return r;e.set(u,i=n.push(u)-1)}return t[i%t.length]}return s.domain=function(u){if(!arguments.length)return n.slice();n=[],e=new o;for(const i of u)e.has(i)||e.set(i,n.push(i)-1);return s},s.range=function(u){return arguments.length?(t=Array.from(u),s):t.slice()},s.unknown=function(u){return arguments.length?(r=u,s):r},s.copy=function(){return h(n,t).unknown(r)},a.apply(s,arguments),s}export{h as o};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{F as S,bc as R,g as K,a1 as Q,a$ as Y,a2 as tt,b0 as et,a5 as at,b2 as nt,b as d,aD as F,a4 as rt,s as it,a_ as st,aM as ot,E as lt,t as ct,S as ut}from"./mermaid.core.BSV8pBn-.js";import{p as dt}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{p as pt}from"./wardley-L42UT6IY.DEiaHiIT.js";import{d as I}from"./arc.KcqIior8.js";import{o as gt}from"./ordinal.BYWQX77i.js";function ft(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function ht(t){return t}function mt(){var t=ht,a=ft,f=null,y=S(0),s=S(R),p=S(0);function o(e){var r,l=(e=K(e)).length,g,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,C=Math.min(Math.abs(w)/l,p.apply(this,arguments)),$=C*(w<0?-1:1),u;for(r=0;r<l;++r)(u=i[c[r]=r]=+t(e[r],r,e))>0&&(v+=u);for(a!=null?c.sort(function(A,D){return a(i[A],i[D])}):f!=null&&c.sort(function(A,D){return f(e[A],e[D])}),r=0,h=v?(w-l*$)/v:0;r<l;++r,x=m)g=c[r],u=i[g],m=x+(u>0?u*h:0)+$,i[g]={data:e[g],index:r,value:u,startAngle:x,endAngle:m,padAngle:C};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:S(+e),o):p},o}var vt=ut.pie,W={sections:new Map,showData:!1},T=W.sections,z=W.showData,xt=structuredClone(vt),St=d(()=>structuredClone(xt),"getConfig"),yt=d(()=>{T=new Map,z=W.showData,ct()},"clear"),wt=d(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),F.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=d(()=>T,"getSections"),Dt=d(t=>{z=t},"setShowData"),Ct=d(()=>z,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:nt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Y,getAccDescription:Q,addSection:wt,getSections:At,setShowData:Dt,getShowData:Ct},$t=d((t,a)=>{dt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:d(async t=>{const a=await pt("pie",t);F.debug(a),$t(a,_)},"parse")},bt=d(t=>`
|
|
2
|
+
.pieCircle{
|
|
3
|
+
stroke: ${t.pieStrokeColor};
|
|
4
|
+
stroke-width : ${t.pieStrokeWidth};
|
|
5
|
+
opacity : ${t.pieOpacity};
|
|
6
|
+
}
|
|
7
|
+
.pieOuterCircle{
|
|
8
|
+
stroke: ${t.pieOuterStrokeColor};
|
|
9
|
+
stroke-width: ${t.pieOuterStrokeWidth};
|
|
10
|
+
fill: none;
|
|
11
|
+
}
|
|
12
|
+
.pieTitleText {
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
font-size: ${t.pieTitleTextSize};
|
|
15
|
+
fill: ${t.pieTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
.slice {
|
|
19
|
+
font-family: ${t.fontFamily};
|
|
20
|
+
fill: ${t.pieSectionTextColor};
|
|
21
|
+
font-size:${t.pieSectionTextSize};
|
|
22
|
+
// fill: white;
|
|
23
|
+
}
|
|
24
|
+
.legend text {
|
|
25
|
+
fill: ${t.pieLegendTextColor};
|
|
26
|
+
font-family: ${t.fontFamily};
|
|
27
|
+
font-size: ${t.pieLegendTextSize};
|
|
28
|
+
}
|
|
29
|
+
`,"getStyles"),Et=bt,Mt=d(t=>{const a=[...t.values()].reduce((s,p)=>s+p,0),f=[...t.entries()].map(([s,p])=>({label:s,value:p})).filter(s=>s.value/a*100>=1);return mt().value(s=>s.value).sort(null)(f)},"createPieArcs"),kt=d((t,a,f,y)=>{F.debug(`rendering pie chart
|
|
30
|
+
`+t);const s=y.db,p=rt(),o=it(s.getConfig(),p.pie),e=40,r=18,l=4,g=450,h=g,v=st(a),c=v.append("g");c.attr("transform","translate("+h/2+","+g/2+")");const{themeVariables:i}=p;let[x]=ot(i.pieOuterStrokeWidth);x??=2;const w=o.textPosition,m=Math.min(h,g)/2-e,C=I().innerRadius(0).outerRadius(m),$=I().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Mt(u),D=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(n=>{b+=n});const G=A.filter(n=>(n.data.value/b*100).toFixed(0)!=="0"),E=gt(D).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",C).attr("fill",n=>E(n.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(n=>(n.data.value/b*100).toFixed(0)+"%").attr("transform",n=>"translate("+$.centroid(n)+")").style("text-anchor","middle").attr("class","slice");const V=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),L=[...u.entries()].map(([n,k])=>({label:n,value:k})),M=c.selectAll(".legend").data(L).enter().append("g").attr("class","legend").attr("transform",(n,k)=>{const P=r+l,q=P*L.length/2,H=12*r,J=k*P-q;return"translate("+H+","+J+")"});M.append("rect").attr("width",r).attr("height",r).style("fill",n=>E(n.label)).style("stroke",n=>E(n.label)),M.append("text").attr("x",r+l).attr("y",r-l).text(n=>s.getShowData()?`${n.label} [${n.value}]`:n.label);const U=Math.max(...M.selectAll("text").nodes().map(n=>n?.getBoundingClientRect().width??0)),j=h+e+r+l+U,N=V.node()?.getBoundingClientRect().width??0,X=h/2-N/2,Z=h/2+N/2,B=Math.min(0,X),O=Math.max(j,Z)-B;v.attr("viewBox",`${B} 0 ${O} ${g}`),lt(v,g,O,o.useMaxWidth)},"draw"),Rt={draw:kt},Bt={parser:Tt,db:_,renderer:Rt,styles:Et};export{Bt as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a$ as Se,a1 as _e,a5 as ee,b2 as Ae,a2 as ke,b0 as Fe,b as r,a4 as Et,aD as qt,aZ as vt,E as Pe,t as ve,S as z,aY as Ce,ae as Le}from"./mermaid.core.BSV8pBn-.js";import{l as te}from"./linear.CfLoHWjz.js";var Ct=(function(){var t=r(function(Y,s,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[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],h=[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],c=[55,56,57],S=[2,36],m=[1,37],b=[1,36],y=[1,38],T=[1,35],q=[1,43],g=[1,41],k=[1,45],ct=[1,14],dt=[1,23],ut=[1,18],xt=[1,19],ot=[1,20],bt=[1,21],lt=[1,22],i=[1,24],Dt=[1,25],zt=[1,26],Vt=[1,27],It=[1,28],wt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Ht=[1,73],Xt=[1,74],Mt=[1,75],Yt=[1,76],jt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],St=[1,103],Gt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(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:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:m,5:b,10:y,12:T,13:q,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:m,5:b,10:y,12:T,13:q,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),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,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(c,[2,52],{58:31,43:84,4:m,5:b,10:y,12:T,13:q,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:m,5:b,10:y,12:T,13:q,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(c,[2,51],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:m,5:b,8:H,10:y,12:T,13:q,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(c,[2,29],{10:St}),t(Gt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(c,[2,50],{10:St}),t(Gt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Kt=0,Te=2,Zt=1,qe=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(j.yy[At]=this.yy[At]);D.setInput(s,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var kt=D.yylloc;e.push(kt);var me=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(R){u.length=u.length-2*R,A.length=A.length-R,e.length=e.length-R}r(be,"popStack");function Jt(){var R;return R=d.pop()||D.lex()||Zt,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}r(Jt,"lex");for(var B,G,W,Ft,rt={},pt,M,$t,yt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=Jt()),W=ht[G]&&ht[G][B]),typeof W>"u"||!W.length||!W[0]){var Pt="";yt=[];for(pt in ht[G])this.terminals_[pt]&&pt>Te&&yt.push("'"+this.terminals_[pt]+"'");D.showPosition?Pt="Parse error on line "+(gt+1)+`:
|
|
2
|
+
`+D.showPosition()+`
|
|
3
|
+
Expecting `+yt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Pt="Parse error on line "+(gt+1)+": Unexpected "+(B==Zt?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Pt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:kt,expected:yt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:u.push(B),A.push(D.yytext),e.push(D.yylloc),u.push(W[1]),B=null,Kt=D.yyleng,n=D.yytext,gt=D.yylineno,kt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=A[A.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},me&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Ft=this.performAction.apply(rt,[n,Kt,gt,j.yy,W[1],A,e].concat(qe)),typeof Ft<"u")return Ft;M&&(u=u.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),u.push(this.productions_[W[1]][0]),A.push(rt.$),e.push(rt._$),$t=ht[u[u.length-2]][u[u.length-1]],u.push($t);break;case 3:return!0}}return!0},"parse")},ye=(function(){var Y={EOF:1,parseError:r(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:r(function(s,l){return this.yy=l||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var l=s.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r(function(s){var l=s.length,u=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;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),u.length-1&&(this.yylineno-=u.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:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var s=this.pastInput(),l=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:r(function(s,l){var u,d,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))),d=s[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+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var e in A)this[e]=A[e];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,l,u,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),e=0;e<A.length;e++)if(u=this._input.match(this.rules[A[e]]),u&&(!l||u[0].length>l[0].length)){if(l=u,d=e,this.options.backtrack_lexer){if(s=this.test_match(u,A[e]),s!==!1)return s;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(s=this.test_match(l,A[d]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){var l=this.next();return l||this.lex()},"lex"),begin:r(function(l){this.conditionStack.push(l)},"begin"),popState:r(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(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:r(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:r(function(l){this.begin(l)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(l,u,d,A){switch(d){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();_t.lexer=ye;function ft(){this.yy={}}return r(ft,"Parser"),ft.prototype=_t,_t.Parser=ft,new ft})();Ct.parser=Ct;var Ee=Ct,I=Le(),De=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{r(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,qt.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,a){this.classes.set(t,a)}setConfig(t){qt.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){qt.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,a,p,f){const o=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,x={top:t==="top"&&a?o:0,bottom:t==="bottom"&&a?o:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,h={left:this.config.yAxisPosition==="left"&&p?_:0,right:this.config.yAxisPosition==="right"&&p?_:0},c=this.config.titleFontSize+this.config.titlePadding*2,S={top:f?c:0},m=this.config.quadrantPadding+h.left,b=this.config.quadrantPadding+x.top+S.top,y=this.config.chartWidth-this.config.quadrantPadding*2-h.left-h.right,T=this.config.chartHeight-this.config.quadrantPadding*2-x.top-x.bottom-S.top,q=y/2,g=T/2;return{xAxisSpace:x,yAxisSpace:h,titleSpace:S,quadrantSpace:{quadrantLeft:m,quadrantTop:b,quadrantWidth:y,quadrantHalfWidth:q,quadrantHeight:T,quadrantHalfHeight:g}}}getAxisLabels(t,a,p,f){const{quadrantSpace:o,titleSpace:x}=f,{quadrantHalfHeight:_,quadrantHeight:h,quadrantLeft:c,quadrantHalfWidth:S,quadrantTop:m,quadrantWidth:b}=o,y=!!this.data.xAxisRightText,T=!!this.data.yAxisTopText,q=[];return this.data.xAxisLeftText&&a&&q.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&a&&q.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+S+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+m+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&q.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:m+h-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&q.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:m+_-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),q}getQuadrants(t){const{quadrantSpace:a}=t,{quadrantHalfHeight:p,quadrantLeft:f,quadrantHalfWidth:o,quadrantTop:x}=a,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x,width:o,height:p,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:f,y:x,width:o,height:p,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:f,y:x+p,width:o,height:p,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:f+o,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant4Fill}];for(const h of _)h.text.x=h.x+h.width/2,this.data.points.length===0?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return _}getQuadrantPoints(t){const{quadrantSpace:a}=t,{quadrantHeight:p,quadrantLeft:f,quadrantTop:o,quadrantWidth:x}=a,_=te().domain([0,1]).range([f,x+f]),h=te().domain([0,1]).range([p+o,o]);return this.data.points.map(S=>{const m=this.classes.get(S.className);return m&&(S={...m,...S}),{x:_(S.x),y:h(S.y),fill:S.color??this.themeConfig.quadrantPointFill,radius:S.radius??this.config.pointRadius,text:{text:S.text,fill:this.themeConfig.quadrantPointTextFill,x:_(S.x),y:h(S.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:S.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:S.strokeWidth??"0px"}})}getBorders(t){const a=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=t,{quadrantHalfHeight:f,quadrantHeight:o,quadrantLeft:x,quadrantHalfWidth:_,quadrantTop:h,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h,x2:x+c+a,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x+c,y1:h+a,x2:x+c,y2:h+o-a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h+o,x2:x+c+a,y2:h+o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x,y1:h+a,x2:x,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+_,y1:h+a,x2:x+_,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+a,y1:h+f,x2:x+c-a,y2:h+f}]}getTitle(t){if(t)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 t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),a=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,f=this.data.points.length>0?"bottom":this.config.xAxisPosition,o=this.calculateSpace(f,t,a,p);return{points:this.getQuadrantPoints(o),quadrants:this.getQuadrants(o),axisLabels:this.getAxisLabels(f,t,a,o),borderLines:this.getBorders(o),title:this.getTitle(p)}}},Tt=class extends Error{static{r(this,"InvalidStyleError")}constructor(t,a,p){super(`value for ${t} ${a} is invalid, please use a valid ${p}`),this.name="InvalidStyleError"}};function Lt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}r(Lt,"validateHexCode");function ie(t){return!/^\d+$/.test(t)}r(ie,"validateNumber");function ae(t){return!/^\d+px$/.test(t)}r(ae,"validateSizeInPixels");var ze=Et();function O(t){return Ce(t.trim(),ze)}r(O,"textSanitizer");var V=new De;function ne(t){V.setData({quadrant1Text:O(t.text)})}r(ne,"setQuadrant1Text");function se(t){V.setData({quadrant2Text:O(t.text)})}r(se,"setQuadrant2Text");function re(t){V.setData({quadrant3Text:O(t.text)})}r(re,"setQuadrant3Text");function oe(t){V.setData({quadrant4Text:O(t.text)})}r(oe,"setQuadrant4Text");function le(t){V.setData({xAxisLeftText:O(t.text)})}r(le,"setXAxisLeftText");function he(t){V.setData({xAxisRightText:O(t.text)})}r(he,"setXAxisRightText");function ce(t){V.setData({yAxisTopText:O(t.text)})}r(ce,"setYAxisTopText");function de(t){V.setData({yAxisBottomText:O(t.text)})}r(de,"setYAxisBottomText");function mt(t){const a={};for(const p of t){const[f,o]=p.trim().split(/\s*:\s*/);if(f==="radius"){if(ie(o))throw new Tt(f,o,"number");a.radius=parseInt(o)}else if(f==="color"){if(Lt(o))throw new Tt(f,o,"hex code");a.color=o}else if(f==="stroke-color"){if(Lt(o))throw new Tt(f,o,"hex code");a.strokeColor=o}else if(f==="stroke-width"){if(ae(o))throw new Tt(f,o,"number of pixels (eg. 10px)");a.strokeWidth=o}else throw new Error(`style named ${f} is not supported.`)}return a}r(mt,"parseStyles");function ue(t,a,p,f,o){const x=mt(o);V.addPoints([{x:p,y:f,text:O(t.text),className:a,...x}])}r(ue,"addPoint");function xe(t,a){V.addClass(t,mt(a))}r(xe,"addClass");function fe(t){V.setConfig({chartWidth:t})}r(fe,"setWidth");function ge(t){V.setConfig({chartHeight:t})}r(ge,"setHeight");function pe(){const t=Et(),{themeVariables:a,quadrantChart:p}=t;return p&&V.setConfig(p),V.setThemeConfig({quadrant1Fill:a.quadrant1Fill,quadrant2Fill:a.quadrant2Fill,quadrant3Fill:a.quadrant3Fill,quadrant4Fill:a.quadrant4Fill,quadrant1TextFill:a.quadrant1TextFill,quadrant2TextFill:a.quadrant2TextFill,quadrant3TextFill:a.quadrant3TextFill,quadrant4TextFill:a.quadrant4TextFill,quadrantPointFill:a.quadrantPointFill,quadrantPointTextFill:a.quadrantPointTextFill,quadrantXAxisTextFill:a.quadrantXAxisTextFill,quadrantYAxisTextFill:a.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:a.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:a.quadrantInternalBorderStrokeFill,quadrantTitleFill:a.quadrantTitleFill}),V.setData({titleText:ee()}),V.build()}r(pe,"getQuadrantData");var Ve=r(function(){V.clear(),ve()},"clear"),Ie={setWidth:fe,setHeight:ge,setQuadrant1Text:ne,setQuadrant2Text:se,setQuadrant3Text:re,setQuadrant4Text:oe,setXAxisLeftText:le,setXAxisRightText:he,setYAxisTopText:ce,setYAxisBottomText:de,parseStyles:mt,addPoint:ue,addClass:xe,getQuadrantData:pe,clear:Ve,setAccTitle:Fe,getAccTitle:ke,setDiagramTitle:Ae,getDiagramTitle:ee,getAccDescription:_e,setAccDescription:Se},we=r((t,a,p,f)=>{function o(i){return i==="top"?"hanging":"middle"}r(o,"getDominantBaseLine");function x(i){return i==="left"?"start":"middle"}r(x,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}r(_,"getTransformation");const h=Et();qt.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const c=h.securityLevel;let S;c==="sandbox"&&(S=vt("#i"+a));const b=(c==="sandbox"?vt(S.nodes()[0].contentDocument.body):vt("body")).select(`[id="${a}"]`),y=b.append("g").attr("class","main"),T=h.quadrantChart?.chartWidth??500,q=h.quadrantChart?.chartHeight??500;Pe(b,q,T,h.quadrantChart?.useMaxWidth??!0),b.attr("viewBox","0 0 "+T+" "+q),f.db.setHeight(q),f.db.setWidth(T);const g=f.db.getQuadrantData(),k=y.append("g").attr("class","quadrants"),ct=y.append("g").attr("class","border"),dt=y.append("g").attr("class","data-points"),ut=y.append("g").attr("class","labels"),xt=y.append("g").attr("class","title");g.title&&xt.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",o(g.title.horizontalPos)).attr("text-anchor",x(g.title.verticalPos)).attr("transform",_(g.title)).text(g.title.text),g.borderLines&&ct.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ot=k.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ot.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ot.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),ut.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>o(i.horizontalPos)).attr("text-anchor",i=>x(i.verticalPos)).attr("transform",i=>_(i));const lt=dt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");lt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),lt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),Be={draw:we},We={parser:Ee,db:Ie,renderer:Be,styles:r(()=>"","styles")};export{We as diagram};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import{g as Ge}from"./chunk-55IACEB6.BnNOxqnI.js";import{s as ze}from"./chunk-2J33WTMH.K6z7IYZU.js";import{b as h,a3 as Ye,b0 as Xe,a2 as Je,a$ as Ze,a1 as et,b2 as tt,a5 as st,a4 as Te,aD as Ne,t as it,_ as rt,aa as nt,aU as at,bj as lt}from"./mermaid.core.BSV8pBn-.js";var qe=(function(){var e=h(function($,r,a,c){for(a=a||{},c=$.length;c--;a[$[c]]=r);return a},"o"),u=[1,3],o=[1,4],n=[1,5],i=[1,6],f=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,22],E=[2,7],g=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],p=[1,39],R=[1,40],d=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ce=[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],de=[27,29],Ae=[1,70],Ve=[1,71],ve=[1,72],Le=[1,73],xe=[1,74],Oe=[1,75],we=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],Ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:h(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:h(function(r,a,c,s,m,t,me){var l=t.length-1;switch(m){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:o,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:o,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(f,[2,6]),{3:12,4:2,6:u,9:o,11:n,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},e(f,[2,4]),e(f,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:43,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:44,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:45,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:46,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:47,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:48,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:49,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:50,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{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]},e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),{30:60,33:62,75:P,89:p,90:R},{30:63,33:62,75:P,89:p,90:R},{30:64,33:62,75:P,89:p,90:R},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[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]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{62:77,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{30:78,33:62,75:P,89:p,90:R},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,60]),e(Ee,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:P,76:U,89:p,90:R},{5:[1,95]},{30:96,33:62,75:P,89:p,90:R},{5:[1,97]},{30:98,33:62,75:P,89:p,90:R},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(d,[2,59],{76:U}),e(d,[2,64],{76:De}),{33:103,75:[1,102],89:p,90:R},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(d,[2,57],{76:De}),e(d,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:p,90:R},{33:120,89:p,90:R},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,61]),e(Ee,[2,63]),e(T,[2,68]),e(d,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(d,[2,28]),{5:[1,127]},e(d,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(d,[2,47]),{5:[1,131]},e(d,[2,48]),e(d,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:p,90:R},{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]},e(d,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(d,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{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]},e(d,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(d,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(d,[2,23]),e(d,[2,24]),e(d,[2,25]),e(d,[2,26]),e(d,[2,44]),e(d,[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:h(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:h(function(r){var a=this,c=[0],s=[],m=[null],t=[],me=this.table,l="",Re=0,Fe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(G.yy[Se]=this.yy[Se]);y.setInput(r,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var be=y.yylloc;t.push(be);var We=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(I){c.length=c.length-2*I,m.length=m.length-I,t.length=t.length-I}h(je,"popStack");function Pe(){var I;return I=s.pop()||y.lex()||$e,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=a.symbols_[I]||I),I}h(Pe,"lex");for(var b,z,N,Ie,J={},ge,F,Ue,ye;;){if(z=c[c.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Pe()),N=me[z]&&me[z][b]),typeof N>"u"||!N.length||!N[0]){var ke="";ye=[];for(ge in me[z])this.terminals_[ge]&&ge>He&&ye.push("'"+this.terminals_[ge]+"'");y.showPosition?ke="Parse error on line "+(Re+1)+`:
|
|
2
|
+
`+y.showPosition()+`
|
|
3
|
+
Expecting `+ye.join(", ")+", got '"+(this.terminals_[b]||b)+"'":ke="Parse error on line "+(Re+1)+": Unexpected "+(b==$e?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(ke,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:be,expected:ye})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:c.push(b),m.push(y.yytext),t.push(y.yylloc),c.push(N[1]),b=null,Fe=y.yyleng,l=y.yytext,Re=y.yylineno,be=y.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=m[m.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},We&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Ie=this.performAction.apply(J,[l,Fe,Re,G.yy,N[1],m,t].concat(Ke)),typeof Ie<"u")return Ie;F&&(c=c.slice(0,-1*F*2),m=m.slice(0,-1*F),t=t.slice(0,-1*F)),c.push(this.productions_[N[1]][0]),m.push(J.$),t.push(J._$),Ue=me[c[c.length-2]][c[c.length-1]],c.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var $={EOF:1,parseError:h(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:h(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.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),r},"input"),unput:h(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var m=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-a},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(r){this.unput(this.match.slice(r))},"less"),pastInput:h(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+a+"^"},"showPosition"),test_match:h(function(r,a){var c,s,m;if(this.options.backtrack_lexer&&(m={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&&(m.yylloc.range=this.yylloc.range.slice(0))),s=r[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+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in m)this[t]=m[t];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,a,c,s;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),t=0;t<m.length;t++)if(c=this._input.match(this.rules[m[t]]),c&&(!a||c[0].length>a[0].length)){if(a=c,s=t,this.options.backtrack_lexer){if(r=this.test_match(c,m[t]),r!==!1)return r;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(r=this.test_match(a,m[s]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var a=this.next();return a||this.lex()},"lex"),begin:h(function(a){this.conditionStack.push(a)},"begin"),popState:h(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:h(function(a){this.begin(a)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(a,c,s,m){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return c.yytext=c.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 $})();_e.lexer=Qe;function pe(){this.yy={}}return h(pe,"Parser"),pe.prototype=_e,_e.Parser=pe,new pe})();qe.parser=qe;var ct=qe,ot=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=Xe,this.getAccTitle=Je,this.setAccDescription=Ze,this.getAccDescription=et,this.setDiagramTitle=tt,this.getDiagramTitle=st,this.getConfig=h(()=>Te().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)}static{h(this,"RequirementDB")}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,u){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:u,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"]}),Ne.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,u,o){this.relations.push({type:e,src:u,dst:o})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,it()}setCssStyle(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(!u||!n)return;for(const i of u)i.includes(",")?n.cssStyles.push(...i.split(",")):n.cssStyles.push(i)}}setClass(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(n)for(const i of u){n.classes.push(i);const f=this.classes.get(i)?.styles;f&&n.cssStyles.push(...f)}}}defineClass(e,u){for(const o of e){let n=this.classes.get(o);n===void 0&&(n={id:o,styles:[],textStyles:[]},this.classes.set(o,n)),u&&u.forEach(function(i){if(/color/.exec(i)){const f=i.replace("fill","bgFill");n.textStyles.push(f)}n.styles.push(i)}),this.requirements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))}),this.elements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))})}}getClasses(){return this.classes}getData(){const e=Te(),u=[],o=[];for(const n of this.requirements.values()){const i=n;i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.shape="requirementBox",i.look=e.look,i.colorIndex=u.length,u.push(i)}for(const n of this.elements.values()){const i=n;i.shape="requirementBox",i.look=e.look,i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.colorIndex=u.length,u.push(i)}for(const n of this.relations){let i=0;const f=n.type===this.Relationships.CONTAINS,_={id:`${n.src}-${n.dst}-${i}`,start:this.requirements.get(n.src)?.name??this.elements.get(n.src)?.name,end:this.requirements.get(n.dst)?.name??this.elements.get(n.dst)?.name,label:`<<${n.type}>>`,classes:"relationshipLine",style:["fill:none",f?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:f?"normal":"dashed",arrowTypeStart:f?"requirement_contains":"",arrowTypeEnd:f?"":"requirement_arrow",look:e.look,labelType:"markdown"};o.push(_),i++}return{nodes:u,edges:o,other:{},config:e,direction:this.getDirection()}}},ht=h(e=>{const u=Ye(),{themeVariables:o,look:n}=u,{bkgColorArray:i,borderColorArray:f}=o;if(!f?.length)return"";let _="";for(let E=0;E<e.THEME_COLOR_LIMIT;E++)_+=`
|
|
7
|
+
|
|
8
|
+
[data-look="${n}"][data-color-id="color-${E}"].node path {
|
|
9
|
+
stroke: ${f[E]};
|
|
10
|
+
fill: ${i?.length?i[E]:""};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-look="${n}"][data-color-id="color-${E}"].node rect {
|
|
14
|
+
stroke: ${f[E]};
|
|
15
|
+
fill: ${i?.length?i[E]:""};
|
|
16
|
+
}
|
|
17
|
+
`;return _},"genColor"),ut=h(e=>{const u=Ye(),{look:o,themeVariables:n}=u,{requirementEdgeLabelBackground:i}=n;return`
|
|
18
|
+
${ht(e)}
|
|
19
|
+
marker {
|
|
20
|
+
fill: ${e.relationColor};
|
|
21
|
+
stroke: ${e.relationColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
marker.cross {
|
|
25
|
+
stroke: ${e.lineColor};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
svg {
|
|
29
|
+
font-family: ${e.fontFamily};
|
|
30
|
+
font-size: ${e.fontSize};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.reqBox {
|
|
34
|
+
fill: ${e.requirementBackground};
|
|
35
|
+
fill-opacity: 1.0;
|
|
36
|
+
stroke: ${e.requirementBorderColor};
|
|
37
|
+
stroke-width: ${e.requirementBorderSize};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.reqTitle, .reqLabel{
|
|
41
|
+
fill: ${e.requirementTextColor};
|
|
42
|
+
}
|
|
43
|
+
.reqLabelBox {
|
|
44
|
+
fill: ${e.relationLabelBackground};
|
|
45
|
+
fill-opacity: 1.0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.req-title-line {
|
|
49
|
+
stroke: ${e.requirementBorderColor};
|
|
50
|
+
stroke-width: ${e.requirementBorderSize};
|
|
51
|
+
}
|
|
52
|
+
.relationshipLine {
|
|
53
|
+
stroke: ${e.relationColor};
|
|
54
|
+
stroke-width: ${o==="neo"?e.strokeWidth:"1px"};
|
|
55
|
+
}
|
|
56
|
+
.relationshipLabel {
|
|
57
|
+
fill: ${e.relationLabelColor};
|
|
58
|
+
}
|
|
59
|
+
.edgeLabel {
|
|
60
|
+
background-color: ${e.edgeLabelBackground};
|
|
61
|
+
}
|
|
62
|
+
.edgeLabel .label rect {
|
|
63
|
+
fill: ${e.edgeLabelBackground};
|
|
64
|
+
}
|
|
65
|
+
.edgeLabel .label text {
|
|
66
|
+
fill: ${e.relationLabelColor};
|
|
67
|
+
}
|
|
68
|
+
.divider {
|
|
69
|
+
stroke: ${e.nodeBorder};
|
|
70
|
+
stroke-width: 1;
|
|
71
|
+
}
|
|
72
|
+
.label {
|
|
73
|
+
font-family: ${e.fontFamily};
|
|
74
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
75
|
+
}
|
|
76
|
+
.label text,span {
|
|
77
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
78
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
79
|
+
}
|
|
80
|
+
.labelBkg {
|
|
81
|
+
background-color: ${i??e.edgeLabelBackground};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
`},"getStyles"),ft=ut,Be={};rt(Be,{draw:()=>mt});var mt=h(async function(e,u,o,n){Ne.info("REF0:"),Ne.info("Drawing requirement diagram (unified)",u);const{securityLevel:i,state:f,layout:_,look:E}=Te(),g=n.db.getData(),S=Ge(u,i);g.type=n.type,g.layoutAlgorithm=nt(_),g.nodeSpacing=f?.nodeSpacing??50,g.rankSpacing=f?.rankSpacing??50,g.markers=E==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],g.diagramId=u,await at(g,S);const k=8;lt.insertTitle(S,"requirementDiagramTitleText",f?.titleTopMargin??25,n.db.getDiagramTitle()),ze(S,k,"requirementDiagram",f?.useMaxWidth??!0)},"draw"),Rt={parser:ct,get db(){return new ot},renderer:Be,styles:ft};export{Rt as diagram};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{b2 as kt,a5 as mt,a$ as xt,a1 as _t,b0 as vt,a2 as bt,b as y,a4 as ot,Q as St,aZ as G,b5 as wt,t as Lt,z as Et}from"./mermaid.core.BSV8pBn-.js";import{o as At}from"./ordinal.BYWQX77i.js";function Tt(t){for(var i=t.length/6|0,s=new Array(i),l=0;l<i;)s[l]="#"+t.slice(l*6,++l*6);return s}const Mt=Tt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function at(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s<l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function dt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function J(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Nt(t){return t.target.depth}function Ct(t){return t.depth}function Pt(t,i){return i-1-t.height}function gt(t,i){return t.sourceLinks.length?t.depth:i-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,i){return H(t.source,i.source)||t.index-i.index}function ct(t,i){return H(t.target,i.target)||t.index-i.index}function H(t,i){return t.y0-i.y0}function tt(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function zt(t){return t.links}function ut(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function ht({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function Dt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=Ot,o=gt,a,h,m=$t,_=zt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),ht(n),n}v.update=function(n){return ht(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:Y(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:Y(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:Y(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:Y(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ut(c,p)),typeof b!="object"&&(b=r.target=ut(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=at(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function $(n){const f=dt(n,c=>(l-i-(c.length-1)*g)/J(c,tt));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;r<c.length;++r){const p=c[r];p.y0+=e*(r+1),p.y1+=e*(r+1)}w(c)}}function S(n){const f=N(n);g=Math.min(x,(l-i)/(at(f,c=>c.length)-1)),$(f);for(let c=0;c<d;++c){const e=Math.pow(.99,c),r=Math.max(1-e,(c+1)/d);F(f,e,r),C(f,e,r)}}function C(n,f,c){for(let e=1,r=n.length;e<r;++e){const p=n[e];for(const b of p){let L=0,j=0;for(const{source:W,value:K}of b.targetLinks){let U=K*(b.layer-W.layer);L+=P(W,b)*U,j+=U}if(!(j>0))continue;let V=(L/j-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(H),z(p,c)}}function F(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,j=0;for(const{target:W,value:K}of b.sourceLinks){let U=K*(W.layer-b.layer);L+=E(b,W)*U,j+=U}if(!(j>0))continue;let V=(L/j-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(H),z(p,c)}}function z(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),R(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),R(n,i,0,f)}function R(n,f,c,e){for(;c<n.length;++c){const r=n[c],p=(f-r.y0)*e;p>1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function D({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ct);for(const{target:{targetLinks:c}}of n)c.sort(lt)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ct),c.sort(lt)}function P(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var et=Math.PI,nt=2*et,B=1e-6,jt=nt-B;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pt(){return new it}it.prototype=pt.prototype={constructor:it,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>B)if(!(Math.abs(h*k-o*a)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((et-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,$=I/A;Math.abs(N-1)>B&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+$*k)+","+(this._y1=i+$*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>B||Math.abs(this._y1-a)>B)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%nt+nt),m>jt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=et)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Ft(t){return t[1]}var Rt=Array.prototype.slice;function Vt(t){return t.source}function Wt(t){return t.target}function Ut(t){var i=Vt,s=Wt,l=Bt,u=Ft,x=null;function g(){var k,o=Rt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=pt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:ft(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:ft(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Gt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Yt(){return Ut(Gt)}function Ht(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Xt(){return Yt().source(Ht).target(Qt)}var rt=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(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:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-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:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,$=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var z=S.yylloc;d.push(z);var R=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function D(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(D,"lex");for(var w,P,E,n,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=D()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`:
|
|
2
|
+
`+S.showPosition()+`
|
|
3
|
+
Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:z,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,z=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},R&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),n=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat($)),typeof n<"u")return n;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},"parseError"),setInput:y(function(o,a){return this.yy=a||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var a=o.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),o},"input"),unput:y(function(o){var a=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var o=this.pastInput(),a=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
|
5
|
+
`+a+"^"},"showPosition"),test_match:y(function(o,a){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,a,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!a||h[0].length>a[0].length)){if(a=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(o=this.test_match(a,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var a=this.next();return a||this.lex()},"lex"),begin:y(function(a){this.conditionStack.push(a)},"begin"),popState:y(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:y(function(a){this.begin(a)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(a,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();rt.parser=rt;var Q=rt,q=[],Z=[],X=new Map,qt=y(()=>{q=[],Z=[],X=new Map,Lt()},"clear"),Zt=class{constructor(t,i,s=0){this.source=t,this.target=i,this.value=s}static{y(this,"SankeyLink")}},Kt=y((t,i,s)=>{q.push(new Zt(t,i,s))},"addLink"),Jt=class{constructor(t){this.ID=t}static{y(this,"SankeyNode")}},te=y(t=>{t=Et.sanitizeText(t,ot());let i=X.get(t);return i===void 0&&(i=new Jt(t),X.set(t,i),Z.push(i)),i},"findOrCreateNode"),ee=y(()=>Z,"getNodes"),ne=y(()=>q,"getLinks"),ie=y(()=>({nodes:Z.map(t=>({id:t.ID})),links:q.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),re={nodesMap:X,getConfig:y(()=>ot().sankey,"getConfig"),getNodes:ee,getLinks:ne,getGraph:ie,addLink:Kt,findOrCreateNode:te,getAccTitle:bt,setAccTitle:vt,getAccDescription:_t,setAccDescription:xt,getDiagramTitle:mt,setDiagramTitle:kt,clear:qt},yt=class st{static{y(this,"Uid")}static{this.count=0}static next(i){return new st(i+ ++st.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},se={left:Ct,right:Pt,center:It,justify:gt},oe=y(t=>{let i=0,s=0;for(const l of t){const u=l.value??0;u>i&&(i=u,s=l.layer??0)}return s},"findCentralNodeLayer"),ae=y(function(t,i,s,l){const{securityLevel:u,sankey:x}=ot(),g=St.sankey;let k;u==="sandbox"&&(k=G("#i"+i));const o=u==="sandbox"?G(k.nodes()[0].contentDocument.body):G("body"),a=u==="sandbox"?o.select(`[id="${i}"]`):G(`[id="${i}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",$=x?.nodeColors??{},S=l.db.getGraph(),C=se[d];Dt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const z=oe(S.nodes),R=At(Mt),O=y(e=>$[e]??R(e),"getNodeColor");a.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=yt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const D=y(({id:e,value:r})=>A?`${e}
|
|
7
|
+
${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)<z?{x:e.x0-6,anchor:"end"}:{x:e.x1+6,anchor:"start"}:e.x0<h/2?{x:e.x1+6,anchor:"start"}:{x:e.x0-6,anchor:"end"},"getLabelPosition"),P=a.append("g").attr("class","node-labels").attr("font-size",14),E=y(e=>P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(D),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const n=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=n.append("linearGradient").attr("id",r=>(r.uid=yt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}n.append("path").attr("d",Xt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),wt(void 0,a,0,_)},"draw"),le={draw:ae},ce=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
|
8
|
+
`).trim(),"prepareTextForParsing"),ue=y(t=>`.label {
|
|
9
|
+
font-family: ${t.fontFamily};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.node-labels {
|
|
13
|
+
font-family: ${t.fontFamily};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Outlined label style - background stroke for better readability */
|
|
17
|
+
.sankey-label-bg {
|
|
18
|
+
stroke: ${t.mainBkg||t.background||"#fff"};
|
|
19
|
+
stroke-width: 4px;
|
|
20
|
+
stroke-linejoin: round;
|
|
21
|
+
paint-order: stroke;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Foreground label text */
|
|
25
|
+
.sankey-label-fg {
|
|
26
|
+
fill: ${t.textColor};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Node styling */
|
|
30
|
+
.node rect {
|
|
31
|
+
shape-rendering: crispEdges;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Link styling */
|
|
35
|
+
.link {
|
|
36
|
+
fill: none;
|
|
37
|
+
stroke-opacity: 0.5;
|
|
38
|
+
mix-blend-mode: multiply;
|
|
39
|
+
}
|
|
40
|
+
`,"getStyles"),he=ue,fe=Q.parse.bind(Q);Q.parse=t=>fe(ce(t));var ge={styles:he,parser:Q,db:re,renderer:le};export{ge as diagram};
|