You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
24 KiB
JavaScript

9 months ago
"use strict";exports.id=648,exports.ids=[648],exports.modules={26648:(t,e,i)=>{i.d(e,{diagram:()=>A});var r=i(15537),n=i(3896),s=i(348),a=i(38601);i(48869),i(43795),i(57581);var l=function(){var t=function(t,e,i,r){for(i=i||{},r=t.length;r--;i[t[r]]=e);return i},e=[1,3],i=[1,4],r=[1,5],n=[1,6],s=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],a=[1,18],l=[2,7],h=[1,22],o=[1,23],c=[1,24],u=[1,25],y=[1,26],d=[1,27],p=[1,20],_=[1,28],E=[1,29],g=[62,63],R=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],m=[1,47],f=[1,48],I=[1,49],b=[1,50],S=[1,51],k=[1,52],T=[1,53],N=[53,54],x=[1,64],A=[1,60],v=[1,61],q=[1,62],$=[1,63],O=[1,65],w=[1,69],C=[1,70],L=[1,67],F=[1,68],M=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],D={trace:function(){},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,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$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",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"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],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:function(t,e,i,r,n,s,a){var l=s.length-1;switch(n){case 4:this.$=s[l].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=s[l].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:r.addRequirement(s[l-3],s[l-4]);break;case 14:r.setNewReqId(s[l-2]);break;case 15:r.setNewReqText(s[l-2]);break;case 16:r.setNewReqRisk(s[l-2]);break;case 17:r.setNewReqVerifyMethod(s[l-2]);break;case 20:this.$=r.RequirementType.REQUIREMENT;break;case 21:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=r.RiskLevel.LOW_RISK;break;case 27:this.$=r.RiskLevel.MED_RISK;break;case 28:this.$=r.RiskLevel.HIGH_RISK;break;case 29:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=r.VerifyType.VERIFY_TEST;break;case 33:r.addElement(s[l-3]);break;case 34:r.setNewElementType(s[l-2]);break;case 35:r.setNewElementDocRef(s[l-2]);break;case 38:r.addRelationship(s[l-2],s[l],s[l-4]);break;case 39:r.addRelationship(s[l-2],s[l-4],s[l]);break;case 40:this.$
L${e.line_height},${e.line_height/2}
M${e.line_height},${e.line_height/2}
L0,${e.line_height}`).attr("stroke-width",1)}},E={},g=0,R=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",E.rect_min_width+"px").attr("height",E.rect_min_height+"px"),m=(t,e,i)=>{let r=E.rect_min_width/2,n=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",r).attr("y",E.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach(t=>{0==s?n.append("tspan").attr("text-anchor","middle").attr("x",E.rect_min_width/2).attr("dy",0).text(t):n.append("tspan").attr("text-anchor","middle").attr("x",E.rect_min_width/2).attr("dy",.75*E.line_height).text(t),s++});let a=1.5*E.rect_padding+s*E.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",E.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:n,y:a}},f=(t,e,i,r)=>{let n=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",E.rect_padding).attr("y",r).attr("dominant-baseline","hanging"),s=0,a=[];return i.forEach(t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0}),a.forEach(t=>{n.append("tspan").attr("x",E.rect_padding).attr("dy",E.line_height).text(t)}),n},I=(t,e,i,r)=>{let n=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*n),a="rel"+g;g++;let l=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(r).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-l.width/2).attr("y",s.y-l.height/2).attr("width",l.width).attr("height",l.height).attr("fill","white").attr("fill-opacity","85%")},b=function(t,e,i,s,a){let l=i.edge(x(e.src),x(e.dst)),h=(0,n.jvg)().x(function(t){return t.x}).y(function(t){return t.y}),o=t.insert("path","#"+s).attr("class","er relationshipLine").attr("d",h(l.points)).attr("fill","none");e.type==a.db.Relationships.CONTAINS?o.attr("marker-start","url("+r.e.getUrl(E.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+r.e.getUrl(E.arrowMarkerAbsolute)+"#"+_.ReqMarkers.ARROW+"_line_ending)")),I(t,o,E,`<<${e.type}>>`)},S=(t,e,i)=>{Object.keys(t).forEach(n=>{let s=t[n];n=x(n),r.l.info("Added new requirement: ",n);let a=i.append("g").attr("id",n),l=R(a,"req-"+n),h=m(a,n+"_title",[`<<${s.type}>>`,`${s.name}`]);f(a,n+"_body",[`Id: ${s.id}`,`Text: ${s.text}`,`Risk: ${s.risk}`,`Verification: ${s.verifyMethod}`],h.y);let o=l.node().getBBox();e.setNode(n,{width:o.width,height:o.height,shape:"rect",id:n})})},k=(t,e,i)=>{Object.keys(t).forEach(r=>{let n=t[r],s=x(r),a=i.append("g").attr("id",s),l="element-"+s,h=R(a,l),o=m(a,l+"_title",["<<Element>>",`${r}`]);f(a,l+"_body",[`Type: ${n.type||"Not Specified"}`,`Doc Ref: ${n.docRef||"None"}`],o.y);let c=h.node().getBBox();e.setNode(s,{width:c.width,height:c.height,shape:"rect",id:s})})},T=(t,e)=>(t.forEach(function(t){let i=x(t.src),r=x(t.dst);e.setEdge(i,r,{relationship:t})}),t),N=function(t,e){e.nodes().forEach(function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))})},x=t=>t.replace(/\s/g,"").replace(/\./g,"_"),A={parser:l,db:d,renderer:{draw:(t,e,i,l)=>{let h;let o=(E=(0,r.c)().requirement).securityLevel;"sandbox"===o&&(h=(0,n.Ys)("#i"+e));let c=("sandbox"===o?(0,n.Ys)(h.nodes()[0].contentDocument.body):(0,n.Ys)("body")).select(`[id='${e}']`);_.insertLineEndings(c,E);let u=new a.k({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:E.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}}),y=l.db.getRequirements(),d=l.db.getElements(),p=l.db.getRelationships();S(y,u,c),k(d,u,c),T(p,u),(0,s.bK)(u),N(c,u),p.forEach(function(t){b(c,t,u,e,l)});let g=E.rect_padding,R=c.node().getBBox(),m=R.width+2*g,f=R.height+2*g;(0,r.i)(c,f,m,E.useMaxWidt
marker {
fill: ${t.relationColor};
stroke: ${t.relationColor};
}
marker.cross {
stroke: ${t.lineColor};
}
svg {
font-family: ${t.fontFamily};
font-size: ${t.fontSize};
}
.reqBox {
fill: ${t.requirementBackground};
fill-opacity: 1.0;
stroke: ${t.requirementBorderColor};
stroke-width: ${t.requirementBorderSize};
}
.reqTitle, .reqLabel{
fill: ${t.requirementTextColor};
}
.reqLabelBox {
fill: ${t.relationLabelBackground};
fill-opacity: 1.0;
}
.req-title-line {
stroke: ${t.requirementBorderColor};
stroke-width: ${t.requirementBorderSize};
}
.relationshipLine {
stroke: ${t.relationColor};
stroke-width: 1;
}
.relationshipLabel {
fill: ${t.relationLabelColor};
}
`}}};