mcanoglu/cwe-class-group huggingface dataset:
this.resolvedFontCss&&this.addFontCss(za,this.resolvedFontCss),Ga.src=Editor.createSvgDataUri(mxUtils.getXml(za))}catch(Fa){null!=N&&N(Fa)}});this.embedExtFonts(mxUtils.bind(this,function(Fa){try{null!=Fa&&this.addFontCss(za,Fa),this.loadFonts(Na)}catch(Ea){null!=N&&N(Ea)}}))}catch(Fa){null!=N&&N(Fa)}}),J,Z)}catch(za){null!=N&&N(za)}};Editor.crcTable=[];for(var m=0;256>m;m++)for(var n=m,v=0;8>v;v++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[m]=n;Editor.updateCRC=function(u,E,J,T){for(var N=
0;N<T;N++)u=Editor.crcTable[(u^E.charCodeAt(J+N))&255]^u>>>8;return u};Editor.crc32=function(u){for(var E=-1,J=0;J<u.length;J++)E=E>>>8^Editor.crcTable[(E^u.charCodeAt(J))&255];return(E^-1)>>>0};Editor.writeGraphModelToPng=function(u,E,J,T,N){function Q(Z,fa){var aa=ba;ba+=fa;return Z.substring(aa,ba)}function R(Z){Z=Q(Z,4);return Z.charCodeAt(3)+(Z.charCodeAt(2)<<8)+(Z.charCodeAt(1)<<16)+(Z.charCodeAt(0)<<24)}function Y(Z){return String.fromCharCode(Z>>24&255,Z>>16&255,Z>>8&255,Z&255)}u=u.substring(u.indexOf(",")+

// Vulnerability class: CWE-20
Q.addTolerance=R};var N=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(Q,R,Y,ba,ea,Z){null!=Q.handJiggle&&Q.handJiggle.constructor==u?(Q.handJiggle.passThrough=!0,N.apply(this,arguments),Q.handJiggle.passThrough=!1):N.apply(this,arguments)}})();Editor.fastCompress=function(u){return null==u||0==u.length||"undefined"===typeof pako?u:Graph.arrayBufferToString(pako.deflateRaw(u))};Editor.fastDecompress=function(u){return null==u||0==u.length||"undefined"===typeof pako?
u:pako.inflateRaw(Graph.stringToArrayBuffer(atob(u)),{to:"string"})};Editor.extractGraphModel=function(u,E,J){if(null!=u&&"undefined"!==typeof pako){var T=u.ownerDocument.getElementsByTagName("div"),N=[];if(null!=T&&0<T.length)for(var Q=0;Q<T.length;Q++)if("mxgraph"==T[Q].getAttribute("class")){N.push(T[Q]);break}0<N.length&&(T=N[0].getAttribute("data-mxgraph"),null!=T?(N=JSON.parse(T),null!=N&&null!=N.xml&&(u=mxUtils.parseXml(N.xml),u=u.documentElement)):(N=N[0].getElementsByTagName("div"),0<N.length&&

// Vulnerability class: CWE-20
function(u,E,J,T){for(var N=0;N<u.length;N++)this.highlightCell(u[N],E,J,T)};Graph.prototype.highlightCell=function(u,E,J,T,N){E=null!=E?E:mxConstants.DEFAULT_VALID_COLOR;J=null!=J?J:1E3;u=this.view.getState(u);var Q=null;null!=u&&(N=null!=N?N:4,N=Math.max(N+1,mxUtils.getValue(u.style,mxConstants.STYLE_STROKEWIDTH,1)+N),Q=new mxCellHighlight(this,E,N,!1),null!=T&&(Q.opacity=T),Q.highlight(u),window.setTimeout(function(){null!=Q.shape&&(mxUtils.setPrefixedStyle(Q.shape.node.style,"transition","all 1200ms ease-in-out"),

// Vulnerability class: CWE-20
TagCreationContainer.prototype._convertInputToTag = function(textfield, value, span) {
    var that = this; 

    var link = $('<a>', {
        'html': value
    });
    textfield.remove();
    span.find ('.delete-tag').remove ();
    that._appendRemove (span);
    span.append(link);

    $(link).attr (
        'href', that.searchUrl + '?term=' + encodeURIComponent ($(link).text ()));
    link.click(function(e) {
        e.stopPropagation(); // prevent #x2-inline-tags click event
    });
    return link;
};

// Vulnerability class: CWE-20
("/"==R.charAt(0)?"":u)+R);E.push('url("'+R+'"'+J[Q].substring(T))}else E.push(J[Q])}else E=[u]}return null!=E?E.join(""):null};Editor.prototype.mapFontUrl=function(u,E,J){/^https?:\/\//.test(E)&&!this.isCorsEnabledForUrl(E)&&(E=PROXY_URL+"?url="+encodeURIComponent(E));J(u,E)};Editor.prototype.embedCssFonts=function(u,E){var J=u.split("url("),T=0;null==this.cachedFonts&&(this.cachedFonts={});var N=mxUtils.bind(this,function(){if(0==T){for(var ba=[J[0]],ea=1;ea<J.length;ea++){var Z=J[ea].indexOf(")");

// Vulnerability class: CWE-20
mxUtils.bind(this,function(D,G){D=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=D){var P=D.indexOf(",");if(0<P)for(D=D.substring(P+1),G=G.getProperty("patches"),P=0;P<G.length;P++)if(null!=G[P][EditorUi.DIFF_UPDATE]&&null!=G[P][EditorUi.DIFF_UPDATE][D]||null!=G[P][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(G[P][EditorUi.DIFF_REMOVE],D)){g.refreshBackgroundImage();break}}}));var q=g.getBackgroundImageObject;g.getBackgroundImageObject=function(D,G){var P=q.apply(this,arguments);
if(null!=P&&null!=P.originalSrc)if(!G)P={src:P.originalSrc};else if(G&&null!=this.themes&&"darkTheme"==this.defaultThemeName){var K=this.stylesheet,F=this.shapeForegroundColor,H=this.shapeBackgroundColor;this.stylesheet=this.getDefaultStylesheet();this.shapeBackgroundColor="#ffffff";this.shapeForegroundColor="#000000";P=d.createImageForPageLink(P.originalSrc);this.shapeBackgroundColor=H;this.shapeForegroundColor=F;this.stylesheet=K}return P};var x=this.clearDefaultStyle;this.clearDefaultStyle=function(){x.apply(this,

// Vulnerability class: CWE-20
[];Editor.doMathJaxRender=function(R){window.setTimeout(function(){"hidden"!=R.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,R])},0)};var J=null!=urlParams["math-font"]?decodeURIComponent(urlParams["math-font"]):"TeX";E=null!=E?E:{"HTML-CSS":{availableFonts:[J],imageFont:null},SVG:{font:J,useFontCache:!1},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(E);

// Vulnerability class: CWE-20
new mxPoint(l,v),new mxPoint(0,v)],this.isRounded,A,!0);c.end()};mxCellRenderer.registerShape("corner",Ka);mxUtils.extend(bb,mxActor);bb.prototype.redrawPath=function(c,l,x,p,v){c.moveTo(0,0);c.lineTo(0,v);c.end();c.moveTo(p,0);c.lineTo(p,v);c.end();c.moveTo(0,v/2);c.lineTo(p,v/2);c.end()};mxCellRenderer.registerShape("crossbar",bb);mxUtils.extend(Pa,mxActor);Pa.prototype.dx=20;Pa.prototype.dy=20;Pa.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,

// Vulnerability class: CWE-20
null,null,function(N){console.log(N)},600,null,null,null,null,null,F):(v(H,void 0),n(H))}function I(N){function Q(R){E.style.background="transparent";E.innerHTML="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,R);E.appendChild(Y);P.stop()}if(null!=E)if(E.style.background="transparent",E.innerHTML="",null==N||N.folder||/\.drawiolib$/.test(N.name))Q(mxResources.get("noPreview"));else try{null!=N.remoteItem&&(N=N.remoteItem),U=N,P.spin(E),A(N,function(R){P.stop();
if(U==N)if("mxlibrary"==R.documentElement.nodeName)Q(mxResources.get("noPreview"));else{var Y=R.getElementsByTagName("diagram");F=AspectDialog.prototype.createViewer(E,0==Y.length?R.documentElement:Y[0],null,"transparent")}},function(){H=null;Q(mxResources.get("notADiagramFile"))})}catch(R){H=null,Q(mxResources.get("notADiagramFile"))}}function O(){var N=y(".odFilesBreadcrumb");if(null!=N){N.innerHTML="";for(var Q=0;Q<M.length-1;Q++){var R=document.createElement("span");R.className="odBCFolder";R.innerHTML=

// Vulnerability class: CWE-20
Ra=document.createElement("div");Ra.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var Qa=document.createElement("img");Qa.style.display="none";(function(Ma,Ta,Ua){Qa.onload=function(){Ta.className="geTempDlgDiagramTileImg";Ma.style.display=""};Qa.onerror=function(){this.src!=Ua?this.src=Ua:Ta.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(Qa,Ra,Ia?Ia.replace(".drawio.xml","").replace(".drawio","").replace(".xml",""):"");Qa.src=Ia;Ra.appendChild(Qa);Pa.appendChild(Ra);

// Vulnerability class: CWE-20
R,Y,da),this.lastX=Y,this.lastY=da)};p.prototype.curveTo=function(O,R,Y,da,ha,Z){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,O,R,Y,da,ha,Z),this.lastX=ha,this.lastY=Z)};p.prototype.arcTo=function(O,R,Y,da,ha,Z,ea){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var aa=mxUtils.arcToCurves(this.lastX,this.lastY,O,R,Y,da,ha,Z,ea);if(null!=aa)for(var ua=0;ua<aa.length;ua+=6)this.curveTo(aa[ua],aa[ua+1],aa[ua+2],aa[ua+3],aa[ua+4],

// Vulnerability class: CWE-20
p[C]}catch(I){null!=window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var y=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(p){var C=y.apply(this,arguments);null==C&&null!=this.globalVars&&(C=this.globalVars[p]);return C};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var p=this.themes["default-style2"];this.defaultStylesheet=
(new mxCodec(p.ownerDocument)).decode(p)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=function(p,C,I,T,P,O,R,Y,da,ha,Z,ea,aa,ua){var la=null,Aa=null,Fa=null;ea||null==this.themes||"darkTheme"!=this.defaultThemeName||(la=this.stylesheet,Aa=this.shapeForegroundColor,Fa=this.shapeBackgroundColor,this.shapeForegroundColor="darkTheme"==this.defaultThemeName?"#000000":Editor.lightColor,this.shapeBackgroundColor=

// Vulnerability class: CWE-20
function(y){this.spinner.stop();this.handleError(y)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,v,null,1<x,A,k,q,m);x=this.isServices(x)?4<x?390:280:160;this.showDialog(c.container,420,x,!0,!0);c.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,e,g,k,m,q){};EditorUi.prototype.pickFolder=function(c,
e,g){e(null)};EditorUi.prototype.exportSvg=function(c,e,g,k,m,q,v,x,A,z,L,M,n,y){if(this.spinner.spin(document.body,mxResources.get("export")))try{var K=this.editor.graph.isSelectionEmpty();g=null!=g?g:K;var B=e?null:this.editor.graph.background;B==mxConstants.NONE&&(B=null);null==B&&0==e&&(B=L?this.editor.graph.defaultPageBackgroundColor:"#ffffff");var F=this.editor.graph.getSvg(B,c,v,x,null,g,null,null,"blank"==z?"_blank":"self"==z?"_top":null,null,!n,L,M);k&&this.editor.graph.addSvgShadow(F);var G=

// Vulnerability class: CWE-20
!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var U=document.createElement("canvas"),X=new Image;X.onload=function(){try{U.getContext("2d").drawImage(X,0,0);var u=U.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=u&&6<u.length}catch(E){}};X.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(u){}})();

// Vulnerability class: CWE-20
return returnValue;}},uploadifyUpload:function(ID){jQuery(this).each(function(){document.getElementById(jQuery(this).attr('id')+'Uploader').startFileUpload(ID,false);});},uploadifyCancel:function(ID){jQuery(this).each(function(){document.getElementById(jQuery(this).attr('id')+'Uploader').cancelFileUpload(ID,true,false);});},uploadifyClearQueue:function(){jQuery(this).each(function(){document.getElementById(jQuery(this).attr('id')+'Uploader').clearFileUploadQueue(false);});}})})(jQuery);

// Vulnerability class: CWE-20
export function getInnerText (element, buffer) {
  const first = (buffer === undefined)
  if (first) {
    buffer = {
      _text: '',
      flush: function () {
        const text = this._text
        this._text = ''
        return text
      },
      set: function (text) {
        this._text = text
      }
    }
  }

  // text node
  if (element.nodeValue) {
    // remove return characters and the whitespace surrounding return characters
    const trimmedValue = element.nodeValue.replace(/\s*\n\s*/g, '')
    if (trimmedValue !== '') {
      return buffer.flush() + trimmedValue
    } else {
      // ignore empty text
      return ''
    }
  }

  // divs or other HTML elements
  if (element.hasChildNodes()) {
    const childNodes = element.childNodes
    let innerText = ''

    for (let i = 0, iMax = childNodes.length; i < iMax; i++) {
      const child = childNodes[i]

      if (child.nodeName === 'DIV' || child.nodeName === 'P') {
        const prevChild = childNodes[i - 1]
        const prevName = prevChild ? prevChild.nodeName : undefined
        if (prevName && prevName !== 'DIV' && prevName !== 'P' && prevName !== 'BR') {
          if (innerText !== '') {
            innerText += '\n'
          }
          buffer.flush()
        }
        innerText += getInnerText(child, buffer)
        buffer.set('\n')
      } else if (child.nodeName === 'BR') {
        innerText += buffer.flush()
        buffer.set('\n')
      } else {
        innerText += getInnerText(child, buffer)
      }
    }

    return innerText
  }

  // br or unknown
  return ''
}

// Vulnerability class: CWE-400
this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var E=this.editorUi,J=E.editor.graph,T=this.createOption(mxResources.get("shadow"),function(){return J.shadowVisible},function(N){var Q=new ChangePageSetup(E);Q.ignoreColor=!0;Q.ignoreImage=!0;Q.shadowVisible=N;J.model.execute(Q)},{install:function(N){this.listener=function(){N(J.shadowVisible)};E.addListener("shadowVisibleChanged",this.listener)},destroy:function(){E.removeListener(this.listener)}});Editor.enableShadowOption||

// Vulnerability class: CWE-20
ea.x-16;ka.y+=ea.y;return ka};var C=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(O,X,ea){var ka=this.editorUi.editor.graph;O.smartSeparators=!0;C.apply(this,arguments);"1"==urlParams.sketch?ka.isEnabled()&&(O.addSeparator(),1==ka.getSelectionCount()&&this.addMenuItems(O,["-","lockUnlock"],null,ea)):1==ka.getSelectionCount()?(ka.isCellFoldable(ka.getSelectionCell())&&this.addMenuItems(O,ka.isCellCollapsed(X)?["expand"]:["collapse"],null,ea),this.addMenuItems(O,["collapsible",
"-","lockUnlock","enterGroup"],null,ea),O.addSeparator(),this.addSubmenu("layout",O)):ka.isSelectionEmpty()&&ka.isEnabled()?(O.addSeparator(),this.addMenuItems(O,["editData"],null,ea),O.addSeparator(),this.addSubmenu("layout",O),this.addSubmenu("insert",O),this.addMenuItems(O,["-","exitGroup"],null,ea)):ka.isEnabled()&&this.addMenuItems(O,["-","lockUnlock"],null,ea)};var H=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(O,X,ea){H.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&

// Vulnerability class: CWE-20
function g(D){D.dataTransfer.dropEffect=null!=B?"move":"copy";D.stopPropagation();D.preventDefault()}function k(D){D.stopPropagation();D.preventDefault();z=!1;I=v(D);if(null!=B)null!=I&&I<x.children.length?(l.splice(I>B?I-1:I,0,l.splice(B,1)[0]),x.insertBefore(x.children[B],x.children[I])):(l.push(l.splice(B,1)[0]),x.appendChild(x.children[B]));else if(0<D.dataTransfer.files.length)b.importFiles(D.dataTransfer.files,0,0,b.maxImageSize,L(D));else if(0<=mxUtils.indexOf(D.dataTransfer.types,"text/uri-list")){var G=
decodeURIComponent(D.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(G)||/(\.png)($|\?)/i.test(G)||/(\.gif)($|\?)/i.test(G)||/(\.svg)($|\?)/i.test(G))&&b.loadImage(G,function(P){d(G,null,0,0,P.width,P.height);x.scrollTop=x.scrollHeight})}D.stopPropagation();D.preventDefault()}var l=[];f=document.createElement("div");f.style.height="100%";var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.height="40px";f.appendChild(p);mxUtils.write(p,mxResources.get("filename")+

// Vulnerability class: CWE-20
mxResources.get("pageWithNumber",[l+1]));p.setAttribute("value","data:page/id,"+b.pages[l].getId());b.pages[l]==b.currentPage&&p.setAttribute("disabled","disabled");null!=f&&f.originalSrc==p.getAttribute("value")&&(p.setAttribute("selected","selected"),m=!0);k.appendChild(p)}n||null!=b.pages&&1!=b.pages.length||(v.style.display="none",d.style.display="none",k.style.display="none");var q=document.createElement("option"),x=!1,y=!1,A=function(z,L){x||null!=z&&y||(d.checked?null!=L&&L(q.selected?null:
k.value):""==g.value||b.isOffline()?(I.value="",O.value="",null!=L&&L("")):(g.value=mxUtils.trim(g.value),b.loadImage(g.value,function(C){I.value=C.width;O.value=C.height;null!=L&&L(g.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));I.value="";O.value="";null!=L&&L(null)})))},B=mxUtils.bind(this,function(z){b.importFiles(z,0,0,b.maxBackgroundSize,function(L,C,D,G,P,K){g.value=L;A();g.focus()},function(){},function(L){return"image/"==L.type.substring(0,

// Vulnerability class: CWE-20
(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(f,l,d){d.ui=f.ui;return l};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="18.0.3";EditorUi.compactUi="atlas"!=uiTheme;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=

// Vulnerability class: CWE-20
mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var v=this.getCurrentFile();window.location.hash=null!=v?v.getHash():""}));else{var q=b.charAt(0);b=decodeURIComponent(b.substring(1));g.getFile(b,mxUtils.bind(this,function(v){this.spinner.stop();this.fileLoaded(v);var x=this.getCurrentFile();null==x?(window.location.hash="",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(x.getHash=function(){return q+b},window.location.hash="#"+x.getHash()):v==x&&null==v.getMode()&&

// Vulnerability class: CWE-20
ma.x=Math.round(A.snap(ma.x));ma.y=Math.round(A.snap(ma.y));"auto"==E&&(ma.width=Math.round(A.snap(ma.width)));"auto"==H&&(ma.height=Math.round(A.snap(ma.height)))}};if("["==O.charAt(0)){var va=p;A.view.validate();this.executeLayoutList(JSON.parse(O),function(){ya();va()});p=null}else if("circle"==O){var ra=new mxCircleLayout(A);ra.disableEdgeStyle=!1;ra.resetEdges=!1;var wa=ra.isVertexIgnored;ra.isVertexIgnored=function(ia){return wa.apply(this,arguments)||0>mxUtils.indexOf(q,ia)};this.executeLayout(function(){ra.execute(A.getDefaultParent());

// Vulnerability class: CWE-20
l)/2,(v-l)/2),c.moveTo(0,.25*l),c.lineTo(.5*l,l*Ua),c.lineTo(l,.25*l),c.lineTo(l,.75*l),c.lineTo(.5*l,(1-Ua)*l),c.lineTo(0,.75*l),c.close());c.end()};mxCellRenderer.registerShape("isoCube",F);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(c,l,x,p,v,A){l=Math.min(v/2,Math.round(v/8)+this.strokewidth-1);if(A&&null!=this.fill||!A&&null==this.fill)c.moveTo(0,l),c.curveTo(0,2*l,p,2*l,p,l),A||(c.stroke(),c.begin()),c.translate(0,l/2),c.moveTo(0,l),c.curveTo(0,2*l,p,2*l,p,l),A||(c.stroke(),
c.begin()),c.translate(0,l/2),c.moveTo(0,l),c.curveTo(0,2*l,p,2*l,p,l),A||(c.stroke(),c.begin()),c.translate(0,-l);A||(c.moveTo(0,l),c.curveTo(0,-l/3,p,-l/3,p,l),c.lineTo(p,v-l),c.curveTo(p,v+l/3,0,v+l/3,0,v-l),c.close())};d.prototype.getLabelMargins=function(c){return new mxRectangle(0,2.5*Math.min(c.height/2,Math.round(c.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",d);mxUtils.extend(f,mxCylinder);f.prototype.size=30;f.prototype.darkOpacity=0;f.prototype.paintVertexShape=

// Vulnerability class: CWE-20
function(){A()}),1E3)});mxEvent.addListener(q,"click",mxUtils.bind(this,function(L){var M=mxEvent.getSource(L);M!=v&&M!=x?(null!=g&&g(),A(),mxEvent.consume(L)):z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(q.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(z,3E4);m=!0}return m};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=

// Vulnerability class: CWE-20
!0));q.push(B)}this.updatePageLinks(c,q)}}if(null!=L&&"mxGraphModel"===L.nodeName){x=A.importGraphModel(L,e,g,k);if(null!=x)for(y=0;y<x.length;y++)this.updatePageLinksForCell(c,x[y]);var G=A.parseBackgroundImage(L.getAttribute("backgroundImage"));if(null!=G&&null!=G.originalSrc){this.updateBackgroundPageLink(c,G);var N=new ChangePageSetup(this,null,G);N.ignoreColor=!0;A.model.execute(N)}}v&&this.insertHandler(x,null,null,A.defaultVertexStyle,A.defaultEdgeStyle,!1,!0)}finally{A.model.endUpdate()}}}catch(J){if(m)throw J;
this.handleError(J)}return x};EditorUi.prototype.updatePageLinks=function(c,e){for(var g=0;g<e.length;g++)this.updatePageLinksForCell(c,e[g].root),null!=e[g].viewState&&this.updateBackgroundPageLink(c,e[g].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,e){try{if(null!=e&&Graph.isPageLink(e.originalSrc)){var g=c[e.originalSrc.substring(e.originalSrc.indexOf(",")+1)];null!=g&&(e.originalSrc="data:page/id,"+g)}}catch(k){}};EditorUi.prototype.updatePageLinksForCell=

// Vulnerability class: CWE-20
setTimeout(function(){Fa.style.display="none"},4E3)}function B(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",u=X,X=null)}function I(ha,da,ca,la,ia,ma,qa){if(-1<ha.className.indexOf("geTempDlgRadioBtnActive"))return!1;ha.className+=" geTempDlgRadioBtnActive";M.querySelector(".geTempDlgRadioBtn[data-id="+la+"]").className="geTempDlgRadioBtn "+(qa?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");M.querySelector("."+da).src="/images/"+ca+"-sel.svg";M.querySelector("."+ia).src=

// Vulnerability class: CWE-20
function(P,K){0<D.getSelectionCount()?(C.appendChild(G),G.innerHTML="Selected: "+D.getSelectionCount()):null!=G.parentNode&&G.parentNode.removeChild(G)}))};var z=!1;EditorUi.prototype.initFormatWindow=function(){if(!z&&null!=this.formatWindow){z=!0;this.formatWindow.window.setClosable(!1);var C=this.formatWindow.window.toggleMinimized;this.formatWindow.window.toggleMinimized=function(){C.apply(this,arguments);this.minimized?(this.div.style.width="90px",this.table.style.width="90px",this.div.style.left=
parseInt(this.div.style.left)+150+"px"):(this.div.style.width="240px",this.table.style.width="240px",this.div.style.left=Math.max(0,parseInt(this.div.style.left)-150)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var L=EditorUi.prototype.init;EditorUi.prototype.init=function(){function C(da,ca,la){var ia=F.menus.get(da),ma=M.addMenu(mxResources.get(da),

// Vulnerability class: CWE-20
return scope.$watch(function expressionInputWatch(scope) {
          var newInputValue = inputExpressions(scope);
          if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {
            lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);
            oldInputValueOf = newInputValue && getValueOf(newInputValue);
          }
          return lastResult;
        }, listener, objectEquality, prettyPrintExpression);

// Vulnerability class: CWE-74
readString: function(quote) {
    var start = this.index;
    this.index++;
    var string = '';
    var rawString = quote;
    var escape = false;
    while (this.index < this.text.length) {
      var ch = this.text.charAt(this.index);
      rawString += ch;
      if (escape) {
        if (ch === 'u') {
          var hex = this.text.substring(this.index + 1, this.index + 5);
          if (!hex.match(/[\da-f]{4}/i)) {
            this.throwError('Invalid unicode escape [\\u' + hex + ']');
          }
          this.index += 4;
          string += String.fromCharCode(parseInt(hex, 16));
        } else {
          var rep = ESCAPE[ch];
          string = string + (rep || ch);
        }
        escape = false;
      } else if (ch === '\\') {
        escape = true;
      } else if (ch === quote) {
        this.index++;
        this.tokens.push({
          index: start,
          text: rawString,
          constant: true,
          value: string
        });
        return;
      } else {
        string += ch;
      }
      this.index++;
    }
    this.throwError('Unterminated quote', start);
  }

// Vulnerability class: CWE-74
null!=sa[ra]&&(ra=sa[ra]);ra={url:pa.getAttribute("url"),libs:pa.getAttribute("libs"),title:pa.getAttribute("title"),tooltip:pa.getAttribute("name")||pa.getAttribute("url"),preview:pa.getAttribute("preview"),clibs:ra,tags:pa.getAttribute("tags")};wa.push(ra);null!=ya&&(wa=Ba[va],null==wa&&(wa={},Ba[va]=wa),va=wa[ya],null==va&&(va=[],wa[ya]=va),va.push(ra))}pa=pa.nextSibling}S.stop();B()}})};G.appendChild(ea);G.appendChild(Aa);G.appendChild(Z);var ta=!1,ka=k;/^https?:\/\//.test(ka)&&!b.editor.isCorsEnabledForUrl(ka)&&

// Vulnerability class: CWE-20
a.charAt(f)||" "===k)f++;else if(g.test(k)&&!a.slice(f).indexOf(g.exec(k)[1]))f+=k.length-2;else{"..."===k&&(f=a.length);break}e.H=e.H||h.h12(e.h,e.A);e._index=f;e._length=a.length;return e};d.isValid=function(a,c){var b="string"===typeof a?d.preparse(a,c):a,e=[31,28+d.isLeapYear(b.Y)|0,31,30,31,30,31,31,30,31,30,31][b.M-1];return!(1>b._index||1>b._length||b._index-b._length||1>b._match||1>b.Y||9999<b.Y||1>b.M||12<b.M||1>b.D||b.D>e||0>b.H||23<b.H||0>b.m||59<b.m||0>b.s||59<b.s||0>b.S||999<b.S||-720>
b.Z||840<b.Z)};d.parse=function(a,c,b){a=d.preparse(a,c);return d.isValid(a)?(a.M-=100>a.Y?22801:1,b||a.Z?new Date(Date.UTC(a.Y,a.M,a.D,a.H,a.m+a.Z,a.s,a.S)):new Date(a.Y,a.M,a.D,a.H,a.m,a.s,a.S)):new Date(NaN)};d.transform=function(a,c,b,e){return d.format(d.parse(a,c),b,e)};d.addYears=function(a,c){return d.addMonths(a,12*c)};d.addMonths=function(a,c){var b=new Date(a.getTime());b.setMonth(b.getMonth()+c);return b};d.addDays=function(a,c){var b=new Date(a.getTime());b.setDate(b.getDate()+c);return b};

// Vulnerability class: CWE-400
"1"==urlParams.embed&&(d.actions.get("save").funct=function(n){u.isEditing()&&u.stopEditing();var y="0"!=urlParams.pages||null!=d.pages&&1<d.pages.length?d.getFileData(!0):mxUtils.getXml(d.editor.getGraphXml());if("json"==urlParams.proto){var K=d.createLoadMessage("save");K.xml=y;n&&(K.exit=!0);y=JSON.stringify(K)}(window.opener||window.parent).postMessage(y,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(d.editor.modified=!1,d.editor.setStatus(""));n=d.getCurrentFile();null==n||n.constructor==
EmbedFile||n.constructor==LocalFile&&null==n.mode||d.saveFile()},d.actions.addAction("saveAndExit",function(){d.actions.get("save").funct(!0)}).label="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),d.actions.addAction("exit",function(){if("1"==urlParams.embedInline)d.sendEmbeddedSvgExport();else{var n=function(){d.editor.modified=!1;var y="json"==urlParams.proto?JSON.stringify({event:"exit",modified:d.editor.modified}):"";(window.opener||window.parent).postMessage(y,

// Vulnerability class: CWE-20
(q.parentNode.removeChild(q),q=null)});null!=X&&null!=W&&(/(\.v(dx|sdx?))($|\?)/i.test(W)||/(\.vs(x|sx?))($|\?)/i.test(W))?this.importVisio(X,function(J){E(J,"text/xml")},null,W):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,W)&&null!=X?this.isExternalDataComms()?this.parseFile(X,mxUtils.bind(this,function(J){4==J.readyState&&(this.spinner.stop(),200<=J.status&&299>=J.status?E(J.responseText,"text/xml"):this.handleError({message:mxResources.get(413==J.status?"drawingTooLarge":"invalidOrMissingFile")},
mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):E(K,F)}}));P.stopPropagation();P.preventDefault()})),mxEvent.addListener(y,"dragleave",function(P){y.style.cursor="";y.style.backgroundColor="";P.stopPropagation();P.preventDefault()}));I=I.cloneNode(!1);I.setAttribute("src",Editor.editImage);I.setAttribute("title",mxResources.get("edit"));B.insertBefore(I,B.firstChild);mxEvent.addListener(I,"click",L);mxEvent.addListener(y,

// Vulnerability class: CWE-20
I&&N.replAllPos>=B)break;E[J.id]={replAllMrk:I,replAllPos:B};l.isCellEditable(J)&&(l.model.setValue(J,H(T,A,L.value,B-A.length,l.getCurrentCellStyle(J))),u++)}U!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,U));mxUtils.write(F,mxResources.get("matchesRepl",[u]))}catch(Q){b.handleError(Q)}finally{l.getModel().endUpdate(),b.editor.graph.setSelectionCells(X),b.editor.graph.rendering=!0}I++}});M.setAttribute("title",mxResources.get("replaceAll"));M.style.float="none";M.style.width="120px";

// Vulnerability class: CWE-20
var CreateDialog=function(b,e,f,c,m,n,v,d,g,k,l,p,q,x,y,A,B){function I(P,K,F,H){function S(){mxEvent.addListener(V,"click",function(){var u=F;if(v){var E=z.value,J=E.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>J){u=null!=u?u:G.value;var T="";u==App.MODE_GOOGLE?T=b.drive.extension:u==App.MODE_GITHUB?T=b.gitHub.extension:u==App.MODE_GITLAB?T=b.gitLab.extension:u==App.MODE_TRELLO?T=b.trello.extension:u==App.MODE_DROPBOX?T=b.dropbox.extension:u==App.MODE_ONEDRIVE?T=b.oneDrive.extension:u==App.MODE_DEVICE&&
(T=".drawio");0<=J&&(E=E.substring(0,J));z.value=E+T}}O(F)})}var V=document.createElement("a");V.style.overflow="hidden";var M=document.createElement("img");M.src=P;M.setAttribute("border","0");M.setAttribute("align","absmiddle");M.style.width="60px";M.style.height="60px";M.style.paddingBottom="6px";V.style.display="inline-block";V.className="geBaseButton";V.style.position="relative";V.style.margin="4px";V.style.padding="8px 8px 10px 8px";V.style.whiteSpace="nowrap";V.appendChild(M);V.style.color=

// Vulnerability class: CWE-20
c.executeLayoutList(L);c.customLayoutConfig=L}catch(C){c.handleError(C),null!=window.console&&console.error(C)}},null,null,null,null,null,!0,null,null,"https://www.diagrams.net/doc/faq/apply-layouts");c.showDialog(t.container,620,460,!0,!0);t.init()});l=this.get("layout");var y=l.funct;l.funct=function(t,z){y.apply(this,arguments);t.addItem(mxResources.get("orgChart"),null,function(){function L(){"undefined"!==typeof mxOrgChartLayout||c.loadingOrgChart||c.isOffline(!0)?K():c.spinner.spin(document.body,
mxResources.get("loading"))&&(c.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",K)})})}):mxscript("js/extensions.min.js",K))}var C=null,D=20,G=20,P=!0,K=function(){c.loadingOrgChart=!1;c.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&null!=C&&P){var X=c.editor.graph,u=new mxOrgChartLayout(X,C,

// Vulnerability class: CWE-20
var P=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"#000",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),K=new Editor,F=null,H=null,S=null,V=!1,M=[],W=null,U=null;this.getSelectedItem=function(){null!=H&&n(H);return H};if(null==y("#mxODPickerCss")){var X=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");X.appendChild(u);u.type="text/css";u.id="mxODPickerCss";u.appendChild(document.createTextNode(G))}b.innerHTML=

// Vulnerability class: CWE-20
": "+H.message:""));this.hasError=!0})):M.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});G();this.refreshComments=G;y=mxUtils.bind(this,function(){function J(Q){var W=H[Q.id];if(null!=W)for(e(Q,W),W=0;null!=Q.replies&&W<Q.replies.length;W++)J(Q.replies[W])}if(this.window.isVisible()){for(var E=M.querySelectorAll(".geCommentDate"),H={},S=0;S<E.length;S++){var U=E[S];H[U.getAttribute("data-commentId")]=U}for(S=0;S<F.length;S++)J(F[S])}});setInterval(y,6E4);this.refreshCommentsTime=y;this.window=

// Vulnerability class: CWE-20
function(c,e,g,k,m,q,v,x,A,z,L){e=null!=e?e:this.editor.graph;m=null!=m?m:!1;A=null!=A?A:!0;var M=null;if(null==g||g.getMode()==App.MODE_DEVICE||g.getMode()==App.MODE_BROWSER)var n="_blank";else M=n=k;if(null==c)return"";var y=c;if("mxfile"!=y.nodeName.toLowerCase()){if(L){var K=c.ownerDocument.createElement("diagram");K.setAttribute("id",Editor.guid());K.appendChild(c)}else{K=Graph.zapGremlins(mxUtils.getXml(c));y=Graph.compress(K);if(Graph.decompress(y)!=K)return K;K=c.ownerDocument.createElement("diagram");
K.setAttribute("id",Editor.guid());mxUtils.setTextContent(K,y)}y=c.ownerDocument.createElement("mxfile");y.appendChild(K)}z?(y=y.cloneNode(!0),y.removeAttribute("modified"),y.removeAttribute("host"),y.removeAttribute("agent"),y.removeAttribute("etag"),y.removeAttribute("userAgent"),y.removeAttribute("version"),y.removeAttribute("editor"),y.removeAttribute("type")):(y.removeAttribute("userAgent"),y.removeAttribute("version"),y.removeAttribute("editor"),y.removeAttribute("pages"),y.removeAttribute("type"),
mxClient.IS_CHROMEAPP?y.setAttribute("host","Chrome"):EditorUi.isElectronApp?y.setAttribute("host","Electron"):y.setAttribute("host",window.location.hostname),y.setAttribute("modified",(new Date).toISOString()),y.setAttribute("agent",navigator.appVersion),y.setAttribute("version",EditorUi.VERSION),y.setAttribute("etag",Editor.guid()),c=null!=g?g.getMode():this.mode,null!=c&&y.setAttribute("type",c),1<y.getElementsByTagName("diagram").length&&null!=this.pages&&y.setAttribute("pages",this.pages.length));
L=L?mxUtils.getPrettyXml(y):mxUtils.getXml(y);if(!q&&!m&&(v||null!=g&&/(\.html)$/i.test(g.getTitle())))L=this.getHtml2(mxUtils.getXml(y),e,null!=g?g.getTitle():null,n,M);else if(q||!m&&null!=g&&/(\.svg)$/i.test(g.getTitle()))null==g||g.getMode()!=App.MODE_DEVICE&&g.getMode()!=App.MODE_BROWSER||(k=null),L=this.getEmbeddedSvg(L,e,k,null,x,A,M);return L};EditorUi.prototype.getXmlFileData=function(c,e,g,k){c=null!=c?c:!0;e=null!=e?e:!1;g=null!=g?g:!Editor.compressXml;var m=this.editor.getGraphXml(c,k);

// Vulnerability class: CWE-20
window.addEventListener("message",v)}})));c(q);q.onversionchange=function(){q.close()}});k.onerror=e;k.onblocked=function(){}}catch(m){null!=e&&e(m)}else null!=e&&e()}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,e,g,k,m){this.openDatabase(mxUtils.bind(this,function(q){try{m=m||"objects";Array.isArray(m)||(m=[m],c=[c],e=[e]);var v=q.transaction(m,"readwrite");v.oncomplete=g;v.onerror=k;for(q=0;q<m.length;q++)v.objectStore(m[q]).put(null!=c&&null!=c[q]?{key:c[q],data:e[q]}:e[q])}catch(x){null!=

// Vulnerability class: CWE-20
function setUser (cb) {
  var defaultConf = this.root
  assert(defaultConf !== Object.prototype)

  // If global, leave it as-is.
  // If not global, then set the user to the owner of the prefix folder.
  // Just set the default, so it can be overridden.
  if (this.get('global')) return cb()
  if (process.env.SUDO_UID) {
    defaultConf.user = +(process.env.SUDO_UID)
    return cb()
  }

  var prefix = path.resolve(this.get('prefix'))
  correctMkdir(prefix, function (er) {
    if (er) return cb(er)
    fs.stat(prefix, function (er, st) {
      defaultConf.user = st && st.uid
      return cb(er)
    })
  })
}

// Vulnerability class: CWE-732
TrafficAnalyser.prototype.add = function (data) {

    const stream = new BinaryStream(data);
    if (argv.block) {
        console.log(hexDump(data));
        return;
    }
    const messageHeader = opcua.readMessageHeader(stream);

    if (messageHeader.msgType === "ERR") {

        var err = new s.TCPErrorMessage();
        err.decode(stream);
        console.log(" Error 0x" + err.statusCode.toString() + " reason:" + err.reason);
        console.log(hexDump(data));
    }

    const messageBuild = new MessageBuilder();
    messageBuild.on("full_message_body", function (full_message_body) {

        console.log(hexDump(full_message_body));

        try {
            analyseExtensionObject(full_message_body);
        }
        catch (err) {
            console.log(chalk.red("ERROR : "), err);
        }
    });


    switch (messageHeader.msgType) {

        case "HEL":
        case "ACK":
            if (this.id % 2) {
                console.log(chalk.red.bold(JSON.stringify(messageHeader, null, "")));
            } else {
                console.log(chalk.yellow.bold(JSON.stringify(messageHeader, null, "")));
            }
            break;

        case "OPN": // open secure channel
        case "CLO": // close secure channel
        case "MSG": // message
                    // decode secure message
            if (this.id % 2) {
                console.log(chalk.red.bold(messageHeaderToString(data)));
            } else {
                console.log(chalk.yellow.bold(messageHeaderToString(data)));
            }

            messageBuild.feed(data);
            break;
        case "ERR":
            console.log(hexDump(data));
            break;
        default:
            break;

    }

};

// Vulnerability class: CWE-400
ra([])},P?null:t)):J(P)),da=fa,ha=P}function S(fa){null!=wa&&clearTimeout(wa);13==fa.keyCode?H(Oa.value):wa=setTimeout(function(){H(Oa.value)},1E3)}var U='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" '+(c?"":'style="display: none"')+' placeholder="'+mxResources.get("search")+'"></div><div class="geTemplatesList" style="display: none"><div class="geTempDlgBack">&lt; '+mxResources.get("back")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+

// Vulnerability class: CWE-20
_convertAddresses(addresses, uniqueList) {
        let values = [];

        uniqueList = uniqueList || [];

        [].concat(addresses || []).forEach(address => {
            if (address.address) {
                address.address = this._normalizeAddress(address.address);

                if (!address.name) {
                    values.push(address.address);
                } else if (address.name) {
                    values.push(this._encodeAddressName(address.name) + ' <' + address.address + '>');
                }

                if (address.address) {
                    if (!uniqueList.filter(a => a.address === address.address).length) {
                        uniqueList.push(address);
                    }
                }
            } else if (address.group) {
                values.push(
                    this._encodeAddressName(address.name) + ':' + (address.group.length ? this._convertAddresses(address.group, uniqueList) : '').trim() + ';'
                );
            }
        });

        return values.join(', ');
    }

// Vulnerability class: CWE-74
I.length)t();else{var D=I[O];StorageFile.getFileContent(this,D,mxUtils.bind(this,function(G){null==G||".scratchpad"==D&&G==this.emptyLibraryXml?y.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[D]}),"*"):z()}),z)}}catch(G){console.log(G)}}),C=mxUtils.bind(this,function(D){try{this.setDatabaseItem(null,[{title:D.title,size:D.data.length,lastModified:Date.now(),type:D.isLib?"L":"F"},{title:D.title,data:D.data}],z,z,["filesInfo","files"])}catch(G){console.log(G)}});

// Vulnerability class: CWE-20
e()?"":Editor.isDarkMode()?"#ff0000":"#ffcfcf"}catch(V){b.handleError(V)}});J.setAttribute("title",mxResources.get("find")+" (Enter)");J.style.float="none";J.style.width="120px";J.style.marginTop="6px";J.style.marginLeft="8px";J.style.overflow="hidden";J.style.textOverflow="ellipsis";J.className="geBtn gePrimaryBtn";n.appendChild(J);var E=document.createElement("div");E.style.marginTop="10px";if(t){var H=function(V,X,p,C,I){if(null==I||"1"!=I.html)return C=V.toLowerCase().indexOf(X,C),0>C?V:V.substr(0,
C)+p+V.substr(C+X.length);var T=V;X=mxUtils.htmlEntities(X);I=[];var P=-1;for(V=V.replace(/<br>/ig,"\n");-1<(P=V.indexOf("<",P+1));)I.push(P);P=V.match(/<[^>]*>/g);V=V.replace(/<[^>]*>/g,"");C=V.toLowerCase().indexOf(X,C);if(0>C)return T;T=C+X.length;p=mxUtils.htmlEntities(p);V=V.substr(0,C)+p+V.substr(T);for(var O=0,R=0;R<I.length;R++){if(I[R]-O<C)V=V.substr(0,I[R])+P[R]+V.substr(I[R]);else{var Y=I[R]-O<T?C+O:I[R]+(p.length-X.length);V=V.substr(0,Y)+P[R]+V.substr(Y)}O+=P[R].length}return V.replace(/\n/g,
"<br>")},S=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=A&&null!=q&&K.value){var V=q.cell,X=k.getLabel(V);k.isCellEditable(V)&&k.model.setValue(V,H(X,A,K.value,z-A.length,k.getCurrentCellStyle(V)));y.style.backgroundColor=e(!1,!0)?"":Editor.isDarkMode()?"#ff0000":"#ffcfcf"}}catch(p){b.handleError(p)}});S.setAttribute("title",mxResources.get("replFind"));S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft="8px";S.style.overflow="hidden";S.style.textOverflow=

// Vulnerability class: CWE-20
F.createStatusContainer();F.statusContainer.style.position="relative";F.statusContainer.style.maxWidth="";F.statusContainer.style.marginTop="7px";F.statusContainer.style.marginLeft="6px";F.statusContainer.style.color="gray";F.statusContainer.style.cursor="default";var W=F.hideCurrentMenu;F.hideCurrentMenu=function(){W.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var U=F.descriptorChanged;F.descriptorChanged=function(){U.apply(this,arguments);var da=F.getCurrentFile();if(null!=

// Vulnerability class: CWE-20
"#ffffff")),Da=mxUtils.setStyle(Da,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(Aa,mxConstants.STYLE_STROKECOLOR,"#000000")),Da=mxUtils.setStyle(Da,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(Aa,mxConstants.STYLE_GRADIENTCOLOR,null)),T.getModel().isVertex(Fa[Ea])&&(Da=mxUtils.setStyle(Da,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(Aa,mxConstants.STYLE_FONTCOLOR,null))));T.getModel().setStyle(Fa[Ea],Da)}}finally{T.getModel().endUpdate()}}));Ca.className="geStyleButton";Ca.style.width="36px";

// Vulnerability class: CWE-20
this.init=function(){function G(H){if(null!=H){var S=H.getAttribute("background");if(null==S||""==S||S==mxConstants.NONE)S=Editor.isDarkMode()?"transparent":"#ffffff";B.style.backgroundColor=S;(new mxCodec(H.ownerDocument)).decode(H,I.getModel());I.maxFitScale=1;I.fit(8);I.center()}return H}function P(H){null!=H&&(H=G(Editor.parseDiagramNode(H)));return H}mxEvent.addListener(D,"change",function(H){z=parseInt(D.value);P(L[z]);mxEvent.consume(H)});if("mxfile"==t.nodeName){var K=t.getElementsByTagName("diagram");

// Vulnerability class: CWE-20
18*B.childNodes.length+"px")}),D=mxUtils.bind(this,function(P,K,F,H){P=t.cloneCells(mxUtils.sortCells(t.model.getTopmostCells(P)));for(var S=0;S<P.length;S++){var V=t.getCellGeometry(P[S]);null!=V&&V.translate(-K.x,-K.y)}y.appendChild(this.sidebar.createVertexTemplateFromCells(P,K.width,K.height,H||"",!0,null,!1));P={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(P))),w:K.width,h:K.height};null!=H&&(P.title=H);g.push(P);C(F);null!=q&&null!=q.parentNode&&0<g.length&&(q.parentNode.removeChild(q),

// Vulnerability class: CWE-20
function(c,l,x){return tb(c,["width"],l,function(p,v,A,B,ha){ha=c.shape.getEdgeWidth()*c.view.scale+x;return new mxPoint(B.x+v*p/4+A*ha/2,B.y+A*p/4-v*ha/2)},function(p,v,A,B,ha,K){p=Math.sqrt(mxUtils.ptSegDistSq(B.x,B.y,ha.x,ha.y,K.x,K.y));c.style.width=Math.round(2*p)/c.view.scale-x})},tb=function(c,l,x,p,v){return fb(c,l,function(A){var B=c.absolutePoints,ha=B.length-1;A=c.view.translate;var K=c.view.scale,xa=x?B[0]:B[ha];B=x?B[1]:B[ha-1];ha=B.x-xa.x;var na=B.y-xa.y,$a=Math.sqrt(ha*ha+na*na);xa=
p.call(this,$a,ha/$a,na/$a,xa,B);return new mxPoint(xa.x/K-A.x,xa.y/K-A.y)},function(A,B,ha){var K=c.absolutePoints,xa=K.length-1;A=c.view.translate;var na=c.view.scale,$a=x?K[0]:K[xa];K=x?K[1]:K[xa-1];xa=K.x-$a.x;var ib=K.y-$a.y,db=Math.sqrt(xa*xa+ib*ib);B.x=(B.x+A.x)*na;B.y=(B.y+A.y)*na;v.call(this,db,xa/db,ib/db,$a,K,B,ha)})},qb=function(c){return function(l){return[fb(l,["arrowWidth","arrowSize"],function(x){var p=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Za.prototype.arrowWidth))),

// Vulnerability class: CWE-20
mxEvent.getSource(F);null!=G;){if(G==v||G==x){F.stopPropagation();F.preventDefault();break}G=G.parentNode}});var K=function(F){return function(G,N,J,E,H,S,U,Q,W){null!=W&&(/(\.v(dx|sdx?))($|\?)/i.test(W.name)||/(\.vs(x|sx?))($|\?)/i.test(W.name))?b.importVisio(W,mxUtils.bind(this,function(V){c(V,N,J,E,H,S,U,"fixed",mxEvent.isAltDown(F)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," "))})):null!=W&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(G,W.name)?b.isExternalDataComms()?b.parseFile(W,
mxUtils.bind(this,function(V){4==V.readyState&&(b.spinner.stop(),200<=V.status&&299>=V.status&&(c(V.responseText,N,J,E,H,S,U,"fixed",mxEvent.isAltDown(F)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," ")),v.scrollTop=v.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(c(G,N,J,E,H,S,U,"fixed",mxEvent.isAltDown(F)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g," ")),v.scrollTop=v.scrollHeight)}};mxEvent.addListener(v,"dragover",e);

// Vulnerability class: CWE-20
e,g,k){var m=this,q=function(){try{this.loadingMermaid=!1,e=null!=e?e:mxUtils.clone(EditorUi.defaultMermaidConfig),e.securityLevel="strict",e.startOnLoad=!1,Editor.isDarkMode()&&(e.theme="dark"),mermaid.mermaidAPI.initialize(e),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c,function(v){try{if(mxClient.IS_IE||mxClient.IS_IE11)v=v.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var x=mxUtils.parseXml(v).getElementsByTagName("svg");
if(0<x.length){var A=parseFloat(x[0].getAttribute("width")),z=parseFloat(x[0].getAttribute("height"));if(isNaN(A)||isNaN(z))try{var L=x[0].getAttribute("viewBox").split(/\s+/);A=parseFloat(L[2]);z=parseFloat(L[3])}catch(M){A=A||100,z=z||100}g(m.convertDataUri(Editor.createSvgDataUri(v)),A,z)}else k({message:mxResources.get("invalidInput")})}catch(M){k(M)}})}catch(v){k(v)}};"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?q():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",
q):mxscript("js/extensions.min.js",q))};EditorUi.prototype.generatePlantUmlImage=function(c,e,g,k){function m(x,A,z){c1=x>>2;c2=(x&3)<<4|A>>4;c3=(A&15)<<2|z>>6;c4=z&63;r="";r+=q(c1&63);r+=q(c2&63);r+=q(c3&63);return r+=q(c4&63)}function q(x){if(10>x)return String.fromCharCode(48+x);x-=10;if(26>x)return String.fromCharCode(65+x);x-=26;if(26>x)return String.fromCharCode(97+x);x-=26;return 0==x?"-":1==x?"_":"?"}var v=new XMLHttpRequest;v.open("GET",("txt"==e?PLANT_URL+"/txt/":"png"==e?PLANT_URL+"/png/":

// Vulnerability class: CWE-20
$.fn.hideWidgetRight = function() {
    $(this).each(function() {
        var widget = $(this);

        // slice of the "x2widget_" from the id to get widget name
        var widgetName = $(this).attr('id').slice(7); 
        $.post(
            yii.scriptUrl+'/site/hideWidget', 
            {name: widgetName}, 
            function(response) {

                widget.slideUp(function() {
                    widget.remove();
                    $('#x2-hidden-widgets-menu').replaceWith(response);
                //    $('.x2-widget-menu-item').draggable({revert: 'invalid', helper:'clone', revertDuration:200, appendTo:'#x2-hidden-widgets-menu',iframeFix:true});
                    $('.x2-hidden-widgets-menu-item.widget-center').click(function() {
                        return handleWidgetMenuItemClick($(this));
                    });
                    $('.x2-hidden-widgets-menu-item.widget-right').click(function() {
                        return handleWidgetRightMenuItemClick($(this));
                    });
                    if($('#sidebar-right .portlet').length == 0 && window.fullscreen == false) {
                        $('#fullscreen-button').trigger('click');
                    }
                });
            });
    });
};

// Vulnerability class: CWE-20