mcanoglu/cwe-class-group huggingface dataset:
T.appendChild(T.importNode(u[0],!0)),T=T.documentElement));return T};Editor.getDiagramNodeXml=function(u){var E=mxUtils.getTextContent(u),J=null;0<E.length?J=Graph.decompress(E):null!=u.firstChild&&(J=mxUtils.getXml(u.firstChild));return J};Editor.extractGraphModelFromPdf=function(u){u=u.substring(u.indexOf(",")+1);u=window.atob&&!mxClient.IS_SF?atob(u):Base64.decode(u,!0);if("%PDF-1.7"==u.substring(0,8)){var E=u.indexOf("EmbeddedFile");if(-1<E){var J=u.indexOf("stream",E)+9;if(0<u.substring(E,J).indexOf("application#2Fvnd.jgraph.mxfile"))return E=
u.indexOf("endstream",J-1),pako.inflateRaw(Graph.stringToArrayBuffer(u.substring(J,E)),{to:"string"})}return null}J=null;E="";for(var T=0,N=0,Q=[],R=null;N<u.length;){var Y=u.charCodeAt(N);N+=1;10!=Y&&(E+=String.fromCharCode(Y));Y=="/Subject (%3Cmxfile".charCodeAt(T)?T++:T=0;if(19==T){var ba=u.indexOf("%3C%2Fmxfile%3E)",N)+15;N-=9;if(ba>N){J=u.substring(N,ba);break}}10==Y&&("endobj"==E?R=null:"obj"==E.substring(E.length-3,E.length)||"xref"==E||"trailer"==E?(R=[],Q[E.split(" ")[0]]=R):null!=R&&R.push(E),
E="")}null==J&&(J=Editor.extractGraphModelFromXref(Q));null!=J&&(J=decodeURIComponent(J.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return J};Editor.extractGraphModelFromXref=function(u){var E=u.trailer,J=null;null!=E&&(E=/.* \/Info (\d+) (\d+) R/g.exec(E.join("\n")),null!=E&&0<E.length&&(E=u[E[1]],null!=E&&(E=/.* \/Subject (\d+) (\d+) R/g.exec(E.join("\n")),null!=E&&0<E.length&&(u=u[E[1]],null!=u&&(u=u.join("\n"),J=u.substring(1,u.length-1))))));return J};Editor.extractParserError=function(u,E){var J=

// Vulnerability class: CWE-20
TagCreationContainer.prototype._tagInputEnd = function (event, span, textfield) {
    var that = this;
    if (textfield.val() == '' || textfield.val() == '#') { // if no input, get rid of new tag
        that._removeTag (span);
        that._unlockCreateTag(); // we're done with this tag, so a let another get created
    } else { // create new tag
        var value = textfield.val();
        value = value.replace(/#/g, ''); // strip illegal chars
        value = '#' + encodeURIComponent(value); // format into a tag

        that._afterCreateNewTag (textfield, value, span);

        that._unlockCreateTag(); // we're done with this tag, so a let another get created
    }
};

// Vulnerability class: CWE-20
"&extras="+encodeURIComponent(JSON.stringify(m))+(null!=v?"&scale="+v:"")+(null!=x?"&border="+x:"")+(M&&isFinite(M)?"&w="+M:"")+(n&&isFinite(n)?"&h="+n:""))};EditorUi.prototype.setMode=function(c,e){this.mode=c};EditorUi.prototype.loadDescriptor=function(c,e,g){var k=window.location.hash,m=mxUtils.bind(this,function(q){var v=null!=c.data?c.data:"";null!=q&&0<q.length&&(0<v.length&&(v+="\n"),v+=q);q=new LocalFile(this,"csv"!=c.format&&0<v.length?v:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):

// Vulnerability class: CWE-20
function _onVersionValidationChanged() {
    // we want to reload all extensions, but only enable
    // extensions when allowed by the sessionMode, so
    // temporarily disable them all
    enabledExtensions = [];
    for (let uuid in ExtensionUtils.extensions)
        reloadExtension(ExtensionUtils.extensions[uuid]);
    enabledExtensions = getEnabledExtensions();

    if (Main.sessionMode.allowExtensions) {
        enabledExtensions.forEach(function(uuid) {
            enableExtension(uuid);
        });
    }
}

// Vulnerability class: CWE-20
A=this.editor.graph,z=null,L=null,M=null,n=null,y=null,K=null,B=null,F="whiteSpace=wrap;html=1;",G=null,N=null,J="",E="auto",H="auto",S=null,U=null,Q=40,W=40,V=100,X=0,p=function(){null!=e?e(ta):(A.setSelectionCells(ta),A.scrollCellToVisible(A.getSelectionCell()))},C=A.getFreeInsertPoint(),I=C.x,T=C.y;C=T;var P=null,O="auto";N=null;for(var R=[],Y=null,da=null,ha=0;ha<g.length&&"#"==g[ha].charAt(0);){c=g[ha].replace(/\r$/,"");for(ha++;ha<g.length&&"\\"==c.charAt(c.length-1)&&"#"==g[ha].charAt(0);)c=

// Vulnerability class: CWE-20
b.setSelectionCells([E])}}for(E=0;E<u.length;E++)u[E].parentNode.removeChild(u[E]);d=null;u=[];D=[]}n(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(J,E){J=E.getProperty("eventName");E=E.getProperty("event");J==mxEvent.MOUSE_MOVE&&x&&(null!=E.sourceState&&E.sourceState.setCursor("crosshair"),E.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(J,E){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(J=E.getEvent(),x&&!mxEvent.isPopupTrigger(J)&&!mxEvent.isMultiTouchEvent(J))){var H=
parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);H=Math.max(1,H*b.view.scale);var S=B();d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill",M?S:"none");d.setAttribute("stroke",S);d.setAttribute("stroke-width",H);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(S=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",S=S.split(" ").map(function(U){return parseFloat(U)*H}).join(" "),d.setAttribute("stroke-dasharray",S));v=[];J=F(J);G(J);
t="M"+J.x+" "+J.y;D.push(J);c=[];d.setAttribute("d",M?PerfectFreehand.getSvgPathFromStroke([[J.x,J.y]],L):t);f.appendChild(d);E.consume()}}),mouseMove:mxUtils.bind(this,function(J,E){if(d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){J=E.getEvent();J=F(J);G(J);var H=N(0);if(H)if(D.push(H),M){var S=[];for(H=0;H<D.length;H++)S.push([D[H].x,D[H].y]);c=[];for(var U=2;U<v.length;U+=2)H=N(U),S.push([H.x,H.y]),c.push(H);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(S,L))}else{t+=" L"+

// Vulnerability class: CWE-20
Ia),!0,null,!0);var Ja=document.createElement("div");Ja.className="geTempDlgDialogMask";M.appendChild(Ja);var Oa=b.sidebar.hideTooltip;b.sidebar.hideTooltip=function(){Ja&&(M.removeChild(Ja),Ja=null,Oa.apply(this,arguments),b.sidebar.hideTooltip=Oa)};mxEvent.addListener(Ja,"click",function(){b.sidebar.hideTooltip()})}}var qa=null;if(Da||b.sidebar.currentElt==da)b.sidebar.hideTooltip();else{var pa=function(na){Da&&b.sidebar.currentElt==da&&ma(na,mxEvent.getClientX(la),mxEvent.getClientY(la));Da=!1;
ca.src="/images/icon-search.svg"};b.sidebar.hideTooltip();b.sidebar.currentElt=da;Da=!0;ca.src="/images/aui-wait.gif";ha.isExt?g(ha,pa,function(){A(mxResources.get("cantLoadPrev"));Da=!1;ca.src="/images/icon-search.svg"}):ia(ha.url,pa)}}function t(ha,da,ca){if(null!=E){for(var la=E.className.split(" "),ia=0;ia<la.length;ia++)if(-1<la[ia].indexOf("Active")){la.splice(ia,1);break}E.className=la.join(" ")}null!=ha?(E=ha,E.className+=" "+da,J=ca,za.className="geTempDlgCreateBtn"):(J=E=null,za.className=

// Vulnerability class: CWE-20
git.commit = function (files, message, newVer, tagName, callback) {
        assert.equal(message, 'Message');
        assert.equal(newVer, '1.0.0');
        assert.equal(files[0], expectedPath);
        assert.equal(tagName, 'v1.0.0');
        return callback(null);
      };

// Vulnerability class: CWE-77
function(u,E,J,T,N,Q,R,Y,ba,ea){if(null!=J&&null==mxMarker.markers[J]){var Z=this.getPackageForType(J);null!=Z&&mxStencilRegistry.getStencil(Z)}return V.apply(this,arguments)};var M=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(u,E,J,T,N,Q){"1"==mxUtils.getValue(E.style,"lineShape",null)&&u.setFillColor(mxUtils.getValue(E.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return M.apply(this,arguments)};PrintDialog.prototype.create=function(u,E){function J(){aa.value=Math.max(1,

// Vulnerability class: CWE-20
"rough")?this.createComicCanvas(Q):this.createRoughCanvas(Q)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Q,R,Y,ba,ea){null!=Q.handJiggle&&Q.handJiggle.passThrough||J.apply(this,arguments)};var T=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){var R=Q.addTolerance,Y=!0;null!=this.style&&(Y="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Q.handJiggle&&Q.handJiggle.constructor==u&&!this.outline){Q.save();

// Vulnerability class: CWE-20
function angularInit(element, bootstrap) {
  var appElement,
      module,
      config = {};

  // The element `element` has priority over any other element.
  forEach(ngAttrPrefixes, function(prefix) {
    var name = prefix + 'app';

    if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
      appElement = element;
      module = element.getAttribute(name);
    }
  });
  forEach(ngAttrPrefixes, function(prefix) {
    var name = prefix + 'app';
    var candidate;

    if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
      appElement = candidate;
      module = candidate.getAttribute(name);
    }
  });
  if (appElement) {
    if (!isAutoBootstrapAllowed) {
      window.console.error('Angular: disabling automatic bootstrap. <script> protocol indicates ' +
          'an extension, document.location.href does not match.');
      return;
    }
    config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
    bootstrap(appElement, module ? [module] : [], config);
  }
}

// Vulnerability class: CWE-74
Na+="@import url("+La+");\n":Fa+='@font-face {\nfont-family: "'+Da+'";\nsrc: url("'+La+'");\n}\n'}Ga.appendChild(za.createTextNode(Na+Fa));ra.getElementsByTagName("defs")[0].appendChild(Ga)}null!=ja&&(this.shapeBackgroundColor=Ha,this.shapeForegroundColor=Ba,this.stylesheet=ja,this.refresh());return ra};var C=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var u=C.apply(this,arguments);if(this.mathEnabled){var E=u.drawText;u.drawText=function(J,T){if(null!=J.text&&
null!=J.text.value&&J.text.checkBounds()&&(mxUtils.isNode(J.text.value)||J.text.dialect==mxConstants.DIALECT_STRICTHTML)){var N=J.text.getContentNode();if(null!=N){N=N.cloneNode(!0);if(N.getElementsByTagNameNS)for(var Q=N.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<Q.length;)Q[0].parentNode.removeChild(Q[0]);null!=N.innerHTML&&(Q=J.text.value,J.text.value=N.innerHTML,E.apply(this,arguments),J.text.value=Q)}}else E.apply(this,arguments)}}return u};var D=mxCellRenderer.prototype.destroy;

// Vulnerability class: CWE-20
this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(Q){return new u(Q,Editor.createRoughCanvas(Q),this)};var E=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(Q){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?E.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle",
"rough")?this.createComicCanvas(Q):this.createRoughCanvas(Q)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Q,R,Y,ba,ea){null!=Q.handJiggle&&Q.handJiggle.passThrough||J.apply(this,arguments)};var T=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){var R=Q.addTolerance,Y=!0;null!=this.style&&(Y="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Q.handJiggle&&Q.handJiggle.constructor==u&&!this.outline){Q.save();

// Vulnerability class: CWE-20
0);l+=A;x+=A;p-=2*A;v-=2*A;0<p&&0<v&&(c.setShadow(!1),cb.apply(this,[c,l,x,p,v]))}};mxUtils.extend(Q,mxRectangleShape);Q.prototype.isHtmlAllowed=function(){return!1};Q.prototype.getLabelBounds=function(c){if(1==this.style["double"]){var l=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(c.x+l,c.y+l,c.width-2*l,c.height-2*l)}return c};Q.prototype.paintForeground=function(c,l,x,p,v){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var A=
Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);l+=A;x+=A;p-=2*A;v-=2*A;0<p&&0<v&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}c.setDashed(!1);A=0;do{var B=mxCellRenderer.defaultShapes[this.style["symbol"+A]];if(null!=B){var ha=this.style["symbol"+A+"Align"],K=this.style["symbol"+A+"VerticalAlign"],xa=this.style["symbol"+A+"Width"],na=this.style["symbol"+A+"Height"],$a=this.style["symbol"+A+"Spacing"]||0,ib=this.style["symbol"+A+"VSpacing"]||
$a,db=this.style["symbol"+A+"ArcSpacing"];null!=db&&(db*=this.getArcSize(p+this.strokewidth,v+this.strokewidth),$a+=db,ib+=db);db=l;var Ga=x;db=ha==mxConstants.ALIGN_CENTER?db+(p-xa)/2:ha==mxConstants.ALIGN_RIGHT?db+(p-xa-$a):db+$a;Ga=K==mxConstants.ALIGN_MIDDLE?Ga+(v-na)/2:K==mxConstants.ALIGN_BOTTOM?Ga+(v-na-ib):Ga+ib;c.save();ha=new B;ha.style=this.style;B.prototype.paintVertexShape.call(ha,c,db,Ga,xa,na);c.restore()}A++}while(null!=B)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};

// Vulnerability class: CWE-20
!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,e,g,k,m,q){"text/xml"!=g||/(\.drawio)$/i.test(e)||/(\.xml)$/i.test(e)||/(\.svg)$/i.test(e)||/(\.html)$/i.test(e)||(e=e+"."+(null!=q?q:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=k?this.base64ToBlob(c,g):new Blob([c],{type:g}),navigator.msSaveOrOpenBlob(c,e);else if(mxClient.IS_IE)g=window.open("about:blank","_blank"),null==g?mxUtils.popup(c,!0):(g.document.write(c),
g.document.close(),g.document.execCommand("SaveAs",!0,e),g.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==g||"image/"!=g.substring(0,6)?this.showTextDialog(e+":",c):this.openInNewWindow(c,g,k);else{var v=document.createElement("a");q=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof v.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var x=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);q=65==(x?parseInt(x[2],10):
!1)?!1:q}if(q||this.isOffline()){v.href=URL.createObjectURL(k?this.base64ToBlob(c,g):new Blob([c],{type:g}));q?v.download=e:v.setAttribute("target","_blank");document.body.appendChild(v);try{window.setTimeout(function(){URL.revokeObjectURL(v.href)},2E4),v.click(),v.parentNode.removeChild(v)}catch(A){}}else this.createEchoRequest(c,e,g,k,m).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,e,g,k,m,q){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=

// Vulnerability class: CWE-20
function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {
      var unwatch, lastValue;
      unwatch = scope.$watch(function oneTimeWatch(scope) {
        return parsedExpression(scope);
      }, function oneTimeListener(value, old, scope) {
        lastValue = value;
        if (isFunction(listener)) {
          listener(value, old, scope);
        }
        if (isAllDefined(value)) {
          scope.$$postDigest(function() {
            if (isAllDefined(lastValue)) unwatch();
          });
        }
      }, objectEquality);

      return unwatch;

      function isAllDefined(value) {
        var allDefined = true;
        forEach(value, function(val) {
          if (!isDefined(val)) allDefined = false;
        });
        return allDefined;
      }
    }

// Vulnerability class: CWE-74
this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));var F=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==F.embedViewport)mxUtils.fit(this.div);else{var da=parseInt(this.div.offsetLeft),ca=parseInt(this.div.offsetWidth),la=F.embedViewport.x+F.embedViewport.width,ia=parseInt(this.div.offsetTop),ma=parseInt(this.div.offsetHeight),qa=F.embedViewport.y+F.embedViewport.height;
this.div.style.left=Math.max(F.embedViewport.x,Math.min(da,la-ca))+"px";this.div.style.top=Math.max(F.embedViewport.y,Math.min(ia,qa-ma))+"px";this.div.style.height=Math.min(F.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(F.embedViewport.width,parseInt(this.div.style.width))+"px"}};this.keyHandler.bindAction(75,!0,"toggleShapes",!0);EditorUi.windowed&&("1"==urlParams.sketch||1E3<=c)&&"1"!=urlParams.embedInline&&(b(this,!0),"1"==urlParams.sketch?(this.initFormatWindow(),

// Vulnerability class: CWE-20
x.getIncomingTreeEdges(X[Q]);V=x.getIncomingTreeEdges(H[Q]);if(0==p.length&&0<V.length){var C=this.cloneCell(V[0]);this.addEdge(C,x.getDefaultParent(),this.model.getTerminal(V[0],!0),X[Q])}}}finally{this.model.endUpdate()}return X};var n=x.moveCells;x.moveCells=function(H,S,U,Q,W,V,X){var p=null;this.model.beginUpdate();try{var C=W,I=this.getCurrentCellStyle(W);if(null!=H&&d(W)&&"1"==mxUtils.getValue(I,"treeFolding","0")){for(var T=0;T<H.length;T++)if(d(H[T])||x.model.isEdge(H[T])&&null==x.model.getTerminal(H[T],

// Vulnerability class: CWE-20
function oneTimeListener(value, old, scope) {
        lastValue = value;
        if (isFunction(listener)) {
          listener(value, old, scope);
        }
        if (isDefined(value)) {
          scope.$$postDigest(function() {
            if (isDefined(lastValue)) {
              unwatch();
            }
          });
        }
      }

// Vulnerability class: CWE-74
e.appendChild(g);this.container=e},NewDialog=function(b,e,f,c,m,n,v,d,g,k,l,p,q,x,y,A,B,I){function O(oa){null!=oa&&(Ha=ra=oa?135:140);oa=!0;if(null!=La)for(;H<La.length&&(oa||0!=mxUtils.mod(H,30));){var sa=La[H++];sa=L(sa.url,sa.libs,sa.title,sa.tooltip?sa.tooltip:sa.title,sa.select,sa.imgUrl,sa.info,sa.onClick,sa.preview,sa.noImg,sa.clibs);oa&&sa.click();oa=!1}}function t(){if(Y&&null!=x)f||b.hideDialog(),x(Y,ea,F.value);else if(c)f||b.hideDialog(),c(Q,F.value,ba,T);else{var oa=F.value;null!=oa&&

// Vulnerability class: CWE-20
function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
      var inputExpressions = parsedExpression.inputs;
      var lastResult;

      if (inputExpressions.length === 1) {
        var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails
        inputExpressions = inputExpressions[0];
        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);
      }

      var oldInputValueOfValues = [];
      var oldInputValues = [];
      for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
        oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails
        oldInputValues[i] = null;
      }

      return scope.$watch(function expressionInputsWatch(scope) {
        var changed = false;

        for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
          var newInputValue = inputExpressions[i](scope);
          if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {
            oldInputValues[i] = newInputValue;
            oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);
          }
        }

        if (changed) {
          lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);
        }

        return lastResult;
      }, listener, objectEquality, prettyPrintExpression);
    }

// Vulnerability class: CWE-74
a.getTimezoneOffset():0);var e=t[m].formatter,g="";a.utc=b||!1;b=1;for(var h=c.length,f;b<h;b++)f=c[b],g+=e[f]?e.post(e[f](a,c[0])):f.replace(/\[(.*)]/,"$1");return g};d.preparse=function(a,c){var b="string"===typeof c?d.compile(c):c,e={Y:1970,M:1,D:1,H:0,A:0,h:0,m:0,s:0,S:0,Z:0,_index:0,_length:0,_match:0},g=/\[(.*)]/,h=t[m].parser,f=0;a=h.pre(a);for(var l=1,p=b.length,k,n;l<p;l++)if(k=b[l],h[k]){n=h[k](a.slice(f),b[0]);if(!n.length)break;f+=n.length;e[k.charAt(0)]=n.value;e._match++}else if(k===
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>

// Vulnerability class: CWE-400
"geCommentActionLnk";mxUtils.write(da,P);Y.appendChild(da);mxEvent.addListener(da,"click",function(ha){O(ha,J);ha.preventDefault();mxEvent.consume(ha)});T.appendChild(Y);R&&(Y.style.display="none")}function W(){function P(Y){O.push(R);if(null!=Y.replies)for(var da=0;da<Y.replies.length;da++)R=R.nextSibling,P(Y.replies[da])}var O=[],R=X;P(J);return{pdiv:R,replies:O}}function V(P,O,R,Y,da){function ha(){g(ua);J.addReply(aa,function(la){aa.id=la;J.replies.push(aa);m(ua);R&&R()},function(la){Z();k(ua);

// Vulnerability class: CWE-20
getHasOwnProperty: function(element, property) {
    var key = element + '.' + property;
    var own = this.current().own;
    if (!own.hasOwnProperty(key)) {
      own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');
    }
    return own[key];
  },

// Vulnerability class: CWE-74
return null}))}),L,l,I,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else J=E.target.result,p(J,X.type,g+U*F,k+U*F,240,160,X.name,function(ba){M(U,function(){return ba})},X)});/(\.v(dx|sdx?))($|\?)/i.test(X.name)||/(\.vs(x|sx?))($|\?)/i.test(X.name)?p(null,X.type,g+U*F,k+U*F,240,160,X.name,function(E){M(U,function(){return E})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?u.readAsDataURL(X):u.readAsText(X)}})(W)});if(C){C=

// Vulnerability class: CWE-20
'" y="'+u.y.toFixed(2)+'"/>'):U+('<line x="'+u.x.toFixed(2)+'" y="'+u.y.toFixed(2)+'"/>')}U+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){F=this.createStyle("stencil("+Graph.compress(U)+")");U=b.view.scale;X=b.view.translate;F=new mxCell("",new mxGeometry(H/U-X.x,V/U-X.y,K/U,S/U),F);F.vertex=1;b.model.beginUpdate();try{F=b.addCell(F),b.fireEvent(new mxEventObject("cellsInserted","cells",[F])),b.fireEvent(new mxEventObject("freehandInserted","cell",F))}finally{b.model.endUpdate()}B&&
b.setSelectionCells([F])}}for(F=0;F<m.length;F++)m[F].parentNode.removeChild(m[F]);c=null;m=[];v=[]}t(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(K,F){K=F.getProperty("eventName");F=F.getProperty("event");K==mxEvent.MOUSE_MOVE&&y&&(null!=F.sourceState&&F.sourceState.setCursor("crosshair"),F.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(K,F){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(K=F.getEvent(),y&&!mxEvent.isPopupTrigger(K)&&!mxEvent.isMultiTouchEvent(K))){var H=

// Vulnerability class: CWE-20
b.handleError(ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Y,ba)}function Z(){d(aa,va,function(ja){ea()},!0)}var fa=W().pdiv,aa=b.newComment(N,b.getCurrentUser());aa.pCommentId=K.id;null==K.replies&&(K.replies=[]);var va=q(aa,K.replies,fa,S+1);Q?Z():ea()}if(V||!K.isResolved){t.style.display="none";var X=document.createElement("div");X.className="geCommentContainer";X.setAttribute("data-commentId",K.id);X.style.marginLeft=20*S+5+"px";K.isResolved&&!Editor.isDarkMode()&&

// Vulnerability class: CWE-20
'"')):void 0!==Q&&E.push(Q);return""});/,\s*$/.test(u)&&E.push("");return E};Editor.prototype.isCorsEnabledForUrl=function(u){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||u.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(u)||"https://raw.githubusercontent.com/"===u.substring(0,34)||"https://fonts.googleapis.com/"===
u.substring(0,29)||"https://fonts.gstatic.com/"===u.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var u=new mxUrlConverter;u.updateBaseUrl();var E=u.convert,J=this;u.convert=function(T){if(null!=T){var N="http://"==T.substring(0,7)||"https://"==T.substring(0,8);N&&!navigator.onLine?T=Editor.svgBrokenImage.src:!N||T.substring(0,u.baseUrl.length)==u.baseUrl||J.crossOriginImages&&J.isCorsEnabledForUrl(T)?"chrome-extension://"==T.substring(0,19)||mxClient.IS_CHROMEAPP||(T=E.apply(this,

// Vulnerability class: CWE-20
if(0==D&&0==C)D=H,C=1;else if(Math.abs(D-H)<=(S||1==I&&F?y:0))C+=1;else if(1<C&&F){B=B.slice(0,I+1);break}else if(3<=B.length-I&&!F)C=0,G=D=0!=P?P:0,B.splice(0,0==I?1:I),I=-1;else break;0!=G||S||(D=G=H)}3==B.length&&B[1]==q&&(G=0)}y=function(V,M,W,U){var X=[];if(U){U=K;var u=0}else U=0,u=K;X.push(new mxPoint(V.x-U,V.y-u));X.push(new mxPoint(V.x+U,V.y+u));X.push(V);X.push(M);X.push(new mxPoint(M.x-U,M.y-u));X.push(new mxPoint(M.x+U,M.y+u));if(null!=W)return W.points=X,W;V=new mxPolyline(X,mxConstants.GUIDE_COLOR,
mxConstants.GUIDE_STROKEWIDTH);V.dialect=mxConstants.DIALECT_SVG;V.pointerEvents=!1;V.init(p.graph.getView().getOverlayPane());return V};D=function(V,M){if(V&&null!=p.guidesArrHor)for(V=0;V<p.guidesArrHor.length;V++)p.guidesArrHor[V].node.style.visibility="hidden";if(M&&null!=p.guidesArrVer)for(V=0;V<p.guidesArrVer.length;V++)p.guidesArrVer[V].node.style.visibility="hidden"};if(1<C&&C==B.length-1){C=[];P=p.guidesArrHor;k=[];g=0;I=B[0]==q?1:0;F=B[I].y+B[I].height;if(0<G)for(I=0;I<B.length-1;I++)x=

// Vulnerability class: CWE-20
c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(v){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(v){}}catch(v){this.fileLoadedError=v;if(null!=c)try{c.close()}catch(x){}if(EditorUi.enableLogging&&!this.isOffline())try{EditorUi.logEvent({category:"ERROR-LOAD-FILE-"+(null!=c?c.getHash():"none"),action:"message_"+v.message,label:"stack_"+v.stack})}catch(x){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,
mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=g?this.fileLoaded(g)||m():m()});e?c():this.handleError(v,mxResources.get("errorLoadingFile"),c,!0,null,null,!0)}else m();return k};EditorUi.prototype.getHashValueForPages=function(c,e){var g=0,k=new mxGraphModel,m=new mxCodec;null!=e&&(e.byteCount=0,e.attrCount=0,e.eltCount=0,e.nodeCount=0);for(var q=0;q<c.length;q++){this.updatePageRoot(c[q]);var v=c[q].node.cloneNode(!1);v.removeAttribute("name");k.root=c[q].root;

// Vulnerability class: CWE-20
function(la,ra){"1"==urlParams.sketch?(O.insertTemplateEnabled&&!O.isOffline()&&O.menus.addMenuItems(la,["insertTemplate"],ra),O.menus.addMenuItems(la,["insertImage","insertLink","-"],ra),O.menus.addSubmenu("insertLayout",la,ra,mxResources.get("layout")),O.menus.addSubmenu("insertAdvanced",la,ra,mxResources.get("advanced"))):(fa.apply(this,arguments),O.menus.addSubmenu("table",la,ra))}})();var V="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),Q=function(R,

// Vulnerability class: CWE-20
var CreateDialog=function(b,f,l,d,u,t,D,c,e,g,k,m,q,v,x,A,z){function L(N,J,E,H){function S(){mxEvent.addListener(U,"click",function(){var p=E;if(D){var C=y.value,I=C.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>I){p=null!=p?p:G.value;var T="";p==App.MODE_GOOGLE?T=b.drive.extension:p==App.MODE_GITHUB?T=b.gitHub.extension:p==App.MODE_GITLAB?T=b.gitLab.extension:p==App.MODE_TRELLO?T=b.trello.extension:p==App.MODE_DROPBOX?T=b.dropbox.extension:p==App.MODE_ONEDRIVE?T=b.oneDrive.extension:p==App.MODE_DEVICE&&
(T=".drawio");0<=I&&(C=C.substring(0,I));y.value=C+T}}M(E)})}var U=document.createElement("a");U.style.overflow="hidden";var Q=document.createElement("img");Q.src=N;Q.setAttribute("border","0");Q.setAttribute("align","absmiddle");Q.style.width="60px";Q.style.height="60px";Q.style.paddingBottom="6px";U.style.display="inline-block";U.className="geBaseButton";U.style.position="relative";U.style.margin="4px";U.style.padding="8px 8px 10px 8px";U.style.whiteSpace="nowrap";U.appendChild(Q);U.style.color=
"gray";U.style.fontSize="11px";var W=document.createElement("div");U.appendChild(W);mxUtils.write(W,J);if(null!=H&&null==b[H]){Q.style.visibility="hidden";mxUtils.setOpacity(W,10);var V=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});V.spin(U);var X=window.setTimeout(function(){null==b[H]&&(V.stop(),U.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[H]&&(window.clearTimeout(X),
mxUtils.setOpacity(W,100),Q.style.visibility="",V.stop(),S())}))}else S();B.appendChild(U);++F==m&&(mxUtils.br(B),F=0)}function M(N){var J=y.value;if(null==N||null!=J&&0<J.length)z&&b.hideDialog(),l(J,N,y)}k="1"==urlParams.noDevice?!1:k;D=null!=D?D:!0;c=null!=c?c:!0;m=null!=m?m:4;z=null!=z?z:!0;t=document.createElement("div");t.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(t);var n=document.createElement("h2");mxUtils.write(n,u||mxResources.get("create"));n.style.marginTop="0px";n.style.marginBottom=

// Vulnerability class: CWE-20
var T=document.createElement("tbody"),P=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(e=mxUtils.indexOf(b.pages,b.currentPage));for(q=f.length-1;0<=q;q--){var O=function(R){var Y=new Date(R.modifiedDate),da=null;if(0<=Y.getTime()){var ha=function(ea){v.stop();D.innerHTML="";var aa=mxUtils.parseXml(ea),ua=b.editor.extractGraphModel(aa.documentElement,!0);if(null!=ua){var la=function(Fa){null!=Fa&&(Fa=Aa(Editor.parseDiagramNode(Fa)));return Fa},Aa=function(Fa){var xa=Fa.getAttribute("background");
if(null==xa||""==xa||xa==mxConstants.NONE)xa=c.defaultPageBackgroundColor;t.style.backgroundColor=xa;(new mxCodec(Fa.ownerDocument)).decode(Fa,c.getModel());c.maxFitScale=1;c.fit(8);c.center();return Fa};Q.style.display="none";Q.innerHTML="";n=aa;y=ea;g=parseSelectFunction=null;k=0;if("mxfile"==ua.nodeName){aa=ua.getElementsByTagName("diagram");g=[];for(ea=0;ea<aa.length;ea++)g.push(aa[ea]);k=Math.min(e,g.length-1);0<g.length&&la(g[k]);if(1<g.length)for(Q.removeAttribute("disabled"),Q.style.display=

// Vulnerability class: CWE-20
na},null,null,null,ma,v?null:[]),b.showDialog(fa.container,350,80,!0,!0),fa.init())}}function K(fa){Ba.innerHTML=mxUtils.htmlEntities(mxResources.get(Z||fa?"create":"copy"));fa=fa?"none":"";m&&(Ka.style.display=fa);for(var ca=Q.querySelectorAll(".geTempDlgLinkToDiagram"),ba=0;ba<ca.length;ba++)ca[ba].style.display=fa}function B(fa,ca,ba,ja,ia){ia||(aa.innerHTML="",n(),R=fa,Y=ja);var ma=null;if(ba){ma=document.createElement("table");ma.className="geTempDlgDiagramsListGrid";var qa=document.createElement("tr"),

// Vulnerability class: CWE-20
M.scrollCellToVisible(M.getSelectionCell())}}}else{J=function(U){var Q=H[U];null==Q&&(Q=new mxCell(U,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),Q.vertex=!0,H[U]=Q,y.push(Q));return Q};var H={};y=[];for(F=0;F<z.length;F++)if(";"!=z[F].charAt(0)){var S=z[F].split("->");2<=S.length&&(N=J(S[0]),E=J(S[S.length-1]),S=new mxCell(2<S.length?S[1]:"",new mxGeometry),S.edge=!0,N.insertEdge(S,!0),E.insertEdge(S,!1),y.push(S))}if(0<y.length){z=document.createElement("div");z.style.visibility="hidden";

// Vulnerability class: CWE-20
g?"&mime="+g:"")+(null!=m?"&format="+m:"")+(null!=q?"&base64="+q:"")+(null!=e?"&filename="+encodeURIComponent(e):"")+(k?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(c,e){e=e||"";c=atob(c);for(var g=c.length,k=Math.ceil(g/1024),m=Array(k),q=0;q<k;++q){for(var v=1024*q,x=Math.min(v+1024,g),A=Array(x-v),z=0;v<x;++z,++v)A[z]=c[v].charCodeAt(0);m[q]=new Uint8Array(A)}return new Blob(m,{type:e})};EditorUi.prototype.saveLocalFile=function(c,e,g,k,m,q,v,x){q=null!=q?q:!1;v=null!=v?v:"vsdx"!=
m&&(!mxClient.IS_IOS||!navigator.standalone);m=this.getServiceCount(q);isLocalStorage&&m++;var A=4>=m?2:6<m?4:3;e=new CreateDialog(this,e,mxUtils.bind(this,function(z,L){try{if("_blank"==L)if(null!=g&&"image/"==g.substring(0,6))this.openInNewWindow(c,g,k);else if(null!=g&&"text/html"==g.substring(0,9)){var M=new EmbedDialog(this,c);this.showDialog(M.container,450,240,!0,!0);M.init()}else{var n=window.open("about:blank");null==n?mxUtils.popup(c,!0):(n.document.write("<pre>"+mxUtils.htmlEntities(c,
!1)+"</pre>"),n.document.close())}else L==App.MODE_DEVICE||"download"==L?this.doSaveLocalFile(c,z,g,k,null,x):null!=z&&0<z.length&&this.pickFolder(L,mxUtils.bind(this,function(y){try{this.exportFile(c,z,g,k,L,y)}catch(K){this.handleError(K)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,q,v,null,1<m,A,c,g,k);q=this.isServices(m)?m>A?390:280:160;this.showDialog(e.container,420,q,!0,!0);e.init()};EditorUi.prototype.openInNewWindow=

// Vulnerability class: CWE-20
function convertTimezoneToLocal(date, timezone, reverse) {
  reverse = reverse ? -1 : 1;
  var dateTimezoneOffset = date.getTimezoneOffset();
  var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
  return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));
}

// Vulnerability class: CWE-74
function encodeUriQuery(val, pctEncodeSpaces) {
  return encodeURIComponent(val).
             replace(/%40/gi, '@').
             replace(/%3A/gi, ':').
             replace(/%24/g, '$').
             replace(/%2C/gi, ',').
             replace(/%3B/gi, ';').
             replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
}

// Vulnerability class: CWE-74
fa=Array(Z.length);for(var aa=0;aa<Z.length;aa++)fa[aa]=String.fromCharCode(Z[aa]);fa=fa.join("")}Q=null!=Q?Q:"data:image/png;base64,";fa=Q+Editor.base64Encode(fa)}E(fa)}}else null!=J&&(0==Z.getStatus()?J({message:mxResources.get("accessDenied")},Z):J({message:mxResources.get("error")+" "+Z.getStatus()},Z))}),function(Z){null!=J&&J({message:mxResources.get("error")+" "+Z.getStatus()})},ba,this.timeout,function(){N&&null!=J&&J({code:App.ERROR_TIMEOUT,retry:ea})},Y)});ea()}catch(Z){null!=J&&J(Z)}};

// Vulnerability class: CWE-20
20;t.prototype.redrawPath=function(c,l,x,p,v){l=Math.min(p,v/Ya);c.translate((p-l)/2,(v-l)/2+l/4);c.moveTo(0,.25*l);c.lineTo(.5*l,l*Ua);c.lineTo(l,.25*l);c.lineTo(.5*l,(.5-Ua)*l);c.lineTo(0,.25*l);c.close();c.end()};mxCellRenderer.registerShape("isoRectangle",t);mxUtils.extend(F,mxCylinder);F.prototype.size=20;F.prototype.redrawPath=function(c,l,x,p,v,A){l=Math.min(p,v/(.5+Ya));A?(c.moveTo(0,.25*l),c.lineTo(.5*l,(.5-Ua)*l),c.lineTo(l,.25*l),c.moveTo(.5*l,(.5-Ua)*l),c.lineTo(.5*l,(1-Ua)*l)):(c.translate((p-

// Vulnerability class: CWE-20
date.compile = function (formatString) {
        var re = /\[([^\[\]]*|\[[^\[\]]*\])*\]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];

        while ((keys = re.exec(formatString))) {
            pattern[pattern.length] = keys[0];
        }
        return pattern;
    };

// Vulnerability class: CWE-400
async preHandler (request, reply) {
        t.deepEqual(reply.context.config, {
          foo: 'bar',
          url: '/*',
          method: [
            'DELETE',
            'GET',
            'HEAD',
            'PATCH',
            'POST',
            'PUT',
            'OPTIONS'
          ]
        })
        throw new Unauthorized()
      }

// Vulnerability class: CWE-20
function(K){var F=x.length;if(1===F%2||F>=f){var H=0,S=0,V,M=0;for(V=K;V<F;V++)M++,K=x[V],H+=K.x,S+=K.y;return{x:H/M,y:S/M}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,e,f){function c(M,W){if(!P){var U=e.file.getCurrentUser();if(G&&null!=U&&null!=U.email&&(W=JSON.stringify({from:z,id:A,type:M,sessionId:e.clientId,userId:U.id,username:U.displayName,data:W,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION}),K&&"cursor"!=M&&EditorUi.debug("P2PCollab: sending to socket server",[W]),A++,M=!K&&("cursor"==M||"selectionChange"==M),D&&!M&&V("message",W),M))for(p2pId in C)C[p2pId].send(W)}}function m(M){if(b.shareCursorPosition&&!l.isMouseDown){var W=
mxUtils.getOffset(l.container),U=l.view.translate,X=l.view.scale,u=null!=b.currentPage?b.currentPage.getId():null;c("cursor",{pageId:u,x:Math.round((M.getX()-W.x+l.container.scrollLeft)/X-U.x),y:Math.round((M.getY()-W.y+l.container.scrollTop)/X-U.y)})}}function n(M,W){var U=null!=b.currentPage?b.currentPage.getId():null;if(null!=M&&null!=M.cursor&&null!=M.lastCursor)if(null!=M.lastCursor.hide||!b.isShowRemoteCursors()||null!=M.lastCursor.pageId&&M.lastCursor.pageId!=U)M.cursor.style.display="none";

// Vulnerability class: CWE-20
if(0==F&&0==B)F=H,B=1;else if(Math.abs(F-H)<=(S||1==L&&E?x:0))B+=1;else if(1<B&&E){z=z.slice(0,L+1);break}else if(3<=z.length-L&&!E)B=0,G=F=0!=N?N:0,z.splice(0,0==L?1:L),L=-1;else break;0!=G||S||(F=G=H)}3==z.length&&z[1]==q&&(G=0)}x=function(U,Q,W,V){var X=[];if(V){V=J;var p=0}else V=0,p=J;X.push(new mxPoint(U.x-V,U.y-p));X.push(new mxPoint(U.x+V,U.y+p));X.push(U);X.push(Q);X.push(new mxPoint(Q.x-V,Q.y-p));X.push(new mxPoint(Q.x+V,Q.y+p));if(null!=W)return W.points=X,W;U=new mxPolyline(X,mxConstants.GUIDE_COLOR,
mxConstants.GUIDE_STROKEWIDTH);U.dialect=mxConstants.DIALECT_SVG;U.pointerEvents=!1;U.init(m.graph.getView().getOverlayPane());return U};F=function(U,Q){if(U&&null!=m.guidesArrHor)for(U=0;U<m.guidesArrHor.length;U++)m.guidesArrHor[U].node.style.visibility="hidden";if(Q&&null!=m.guidesArrVer)for(U=0;U<m.guidesArrVer.length;U++)m.guidesArrVer[U].node.style.visibility="hidden"};if(1<B&&B==z.length-1){B=[];N=m.guidesArrHor;g=[];e=0;L=z[0]==q?1:0;E=z[L].y+z[L].height;if(0<G)for(L=0;L<z.length-1;L++)v=

// Vulnerability class: CWE-20
function createSubscription(session, callback) {
  const publishingInterval = 1000;
  const createSubscriptionRequest = new CreateSubscriptionRequest({
    requestedPublishingInterval: publishingInterval,
    requestedLifetimeCount: 60,
    requestedMaxKeepAliveCount: 10,
    maxNotificationsPerPublish: 10,
    publishingEnabled: true,
    priority: 6
  });

  session.performMessageTransaction(createSubscriptionRequest, function(err/*, response*/) {
    callback(err);
  });
}

// Vulnerability class: CWE-400
function editAdlist() {
  var elem = $(this).attr("id");
  var tr = $(this).closest("tr");
  var id = tr.attr("data-id");
  var status = tr.find("#status_" + id).is(":checked") ? 1 : 0;
  var comment = tr.find("#comment_" + id).val();
  var groups = tr.find("#multiselect_" + id).val();
  var address = tr.find("#address_" + id).text();

  var done = "edited";
  var notDone = "editing";
  switch (elem) {
    case "status_" + id:
      if (status === 0) {
        done = "disabled";
        notDone = "disabling";
      } else if (status === 1) {
        done = "enabled";
        notDone = "enabling";
      }

      break;
    case "comment_" + id:
      done = "edited comment of";
      notDone = "editing comment of";
      break;
    case "multiselect_" + id:
      done = "edited groups of";
      notDone = "editing groups of";
      break;
    default:
      alert("bad element or invalid data-id!");
      return;
  }

  utils.disableAll();
  utils.showAlert("info", "", "Editing adlist...", address);

  $.ajax({
    url: "scripts/pi-hole/php/groups.php",
    method: "post",
    dataType: "json",
    data: {
      action: "edit_adlist",
      id: id,
      comment: comment,
      status: status,
      groups: groups,
      token: token
    },
    success: function (response) {
      utils.enableAll();
      if (response.success) {
        utils.showAlert(
          "success",
          "fas fa-pencil-alt",
          "Successfully " + done + " adlist ",
          address
        );
        table.ajax.reload(null, false);
      } else {
        utils.showAlert(
          "error",
          "",
          "Error while " + notDone + " adlist with ID " + id,
          Number(response.message)
        );
      }
    },
    error: function (jqXHR, exception) {
      utils.enableAll();
      utils.showAlert(
        "error",
        "",
        "Error while " + notDone + " adlist with ID " + id,
        jqXHR.responseText
      );
      console.log(exception); // eslint-disable-line no-console
    }
  });
}

// Vulnerability class: CWE-862
function mapToRegistry (name, config, cb) {
  log.silly('mapToRegistry', 'name', name)
  var registry

  // the name itself takes precedence
  var data = npa(name)
  if (data.scope) {
    // the name is definitely scoped, so escape now
    name = name.replace('/', '%2f')

    log.silly('mapToRegistry', 'scope (from package name)', data.scope)

    registry = config.get(data.scope + ':registry')
    if (!registry) {
      log.verbose('mapToRegistry', 'no registry URL found in name for scope', data.scope)
    }
  }

  // ...then --scope=@scope or --scope=scope
  var scope = config.get('scope')
  if (!registry && scope) {
    // I'm an enabler, sorry
    if (scope.charAt(0) !== '@') scope = '@' + scope

    log.silly('mapToRegistry', 'scope (from config)', scope)

    registry = config.get(scope + ':registry')
    if (!registry) {
      log.verbose('mapToRegistry', 'no registry URL found in config for scope', scope)
    }
  }

  // ...and finally use the default registry
  if (!registry) {
    log.silly('mapToRegistry', 'using default registry')
    registry = config.get('registry')
  }

  log.silly('mapToRegistry', 'registry', registry)

  var auth = config.getCredentialsByURI(registry)

  // normalize registry URL so resolution doesn't drop a piece of registry URL
  var normalized = registry.slice(-1) !== '/' ? registry + '/' : registry
  var uri = url.resolve(normalized, name)
  log.silly('mapToRegistry', 'uri', uri)

  cb(null, uri, auth, normalized)
}

// Vulnerability class: CWE-200
na},null,null,null,ma,x?null:[]),b.showDialog(ha.container,350,80,!0,!0),ha.init())}}function L(ha){za.innerHTML=mxUtils.htmlEntities(mxResources.get(Z||ha?"create":"copy"));ha=ha?"none":"";p&&(Ga.style.display=ha);for(var da=M.querySelectorAll(".geTempDlgLinkToDiagram"),ca=0;ca<da.length;ca++)da[ca].style.display=ha}function C(ha,da,ca,la,ia){ia||(aa.innerHTML="",t(),R=ha,Y=la);var ma=null;if(ca){ma=document.createElement("table");ma.className="geTempDlgDiagramsListGrid";var qa=document.createElement("tr"),

// Vulnerability class: CWE-20
function startServer(holder, callback) {
    const net = require("net");
    const server_socket = new net.Server();
    holder.server_socket = server_socket;

    server_socket.listen(port);
    server_socket.on("connection", function on_connection(socket) {
        const serverChannel = new ServerSecureChannelLayer({
            timeout: 1000 * 1000
        });
        holder.serverChannel = serverChannel;
        serverChannel.timeout = 1000 * 1000;
        serverChannel.init(socket, function () {});
    });

    callback();
}

// Vulnerability class: CWE-400
EditorUi.prototype.importZipFile=function(c,e,g){var k=this,m=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(q){if(mxUtils.isEmptyObject(q.files))g();else{var v=0,x,A=!1;q.forEach(function(z,L){z=L.name.toLowerCase();"diagram/diagram.xml"==z?(A=!0,L.async("string").then(function(M){0==M.indexOf("<mxfile ")?e(M):g()})):0==z.indexOf("versions/")&&(z=parseInt(z.substr(9)),z>v&&(v=z,x=L))});0<v?x.async("string").then(function(z){(new XMLHttpRequest).upload&&
k.isRemoteFileFormat(z,c.name)?k.isOffline()?k.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,g):k.parseFileData(z,mxUtils.bind(this,function(L){4==L.readyState&&(200<=L.status&&299>=L.status?e(L.responseText):g())}),c.name):g()}):A||g()}},function(q){g(q)}):g()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?m():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",m))};EditorUi.prototype.importFile=function(c,e,g,k,m,q,v,x,A,z,L,M){z=null!=

// Vulnerability class: CWE-20
B&&"fold"==A)&&c.moveTo(K,ha+K):c.moveTo(0,0)};Ea.prototype.lineNWInner=function(c,l,x,p,v,A,B,ha,K,xa,na){xa||na?!xa&&na?c.lineTo(K,0):xa&&!na?c.lineTo(0,K):"square"==B||"default"==B&&"square"==A?c.lineTo(K,K):"rounded"==B||"default"==B&&"rounded"==A||"snip"==B||"default"==B&&"snip"==A?c.lineTo(K,ha+.5*K):("invRound"==B||"default"==B&&"invRound"==A||"fold"==B||"default"==B&&"fold"==A)&&c.lineTo(K,ha+K):c.lineTo(0,0)};Ea.prototype.paintFolds=function(c,l,x,p,v,A,B,ha,K,xa,na,$a,ib,db,Ga){if("fold"==
A||"fold"==B||"fold"==ha||"fold"==K||"fold"==xa)("fold"==B||"default"==B&&"fold"==A)&&$a&&Ga&&(c.moveTo(0,na),c.lineTo(na,na),c.lineTo(na,0)),("fold"==ha||"default"==ha&&"fold"==A)&&$a&&ib&&(c.moveTo(p-na,0),c.lineTo(p-na,na),c.lineTo(p,na)),("fold"==K||"default"==K&&"fold"==A)&&db&&ib&&(c.moveTo(p-na,v),c.lineTo(p-na,v-na),c.lineTo(p,v-na)),("fold"==xa||"default"==xa&&"fold"==A)&&db&&Ga&&(c.moveTo(0,v-na),c.lineTo(na,v-na),c.lineTo(na,v))};mxCellRenderer.registerShape(Ea.prototype.cst.RECT2,Ea);

// Vulnerability class: CWE-20
return na}function C(){function oa(pa,na){var Ka=mxResources.get(pa);null==Ka&&(Ka=pa.substring(0,1).toUpperCase()+pa.substring(1));18<Ka.length&&(Ka=Ka.substring(0,18)+"&hellip;");return Ka+" ("+na.length+")"}function sa(pa,na,Ka){mxEvent.addListener(na,"click",function(){Ea!=na&&(Ea.style.backgroundColor="",Ea=na,Ea.style.backgroundColor=v,Z.scrollTop=0,Z.innerHTML="",H=0,La=Ka?za[pa][Ka]:Ca[pa],W=null,O(!1))})}Fa&&(Fa=!1,mxEvent.addListener(Z,"scroll",function(pa){Z.scrollTop+Z.clientHeight>=Z.scrollHeight&&

// Vulnerability class: CWE-20
c+";"))}}),mxUtils.bind(this,function(){var n=null;A.getModel().beginUpdate();try{n=A.insertVertex(A.getDefaultParent(),null,c,A.snap(e),A.snap(g),1,1,"text;"+(k?"html=1;":"")),A.updateCellSize(n),A.fireEvent(new mxEventObject("textInserted","cells",[n]))}finally{A.getModel().endUpdate()}A.setSelectionCell(n)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,e,g,q,null,x);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,

// Vulnerability class: CWE-20
J.height,Y.y+Y.height)-Math.max(J.y,Y.y))/E))}}N?X=0:M=0;for(Q=0;Q<T.length;Q++)if(R=y.model.getTerminal(T[Q],!1),U==d(R)&&(Y=y.view.getState(R),R!=H&&null!=Y&&(N&&S!=Y.getCenterX()<u.getCenterX()||!N&&S!=Y.getCenterY()<u.getCenterY()))){var ba=[];y.traverse(Y.cell,!0,function(ea,Z){var fa=null!=Z&&y.isTreeEdge(Z);fa&&ba.push(Z);(null==Z||fa)&&ba.push(ea);return null==Z||fa});y.moveCells(ba,(S?1:-1)*M,(S?1:-1)*X)}}}return y.addCells(W,V)}finally{y.model.endUpdate()}}function k(H){y.model.beginUpdate();

// Vulnerability class: CWE-20
setTimeout(function(){Ia.style.display="none"},4E3)}function z(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",p=X,X=null)}function L(fa,ca,ba,ja,ia,ma,qa){if(-1<fa.className.indexOf("geTempDlgRadioBtnActive"))return!1;fa.className+=" geTempDlgRadioBtnActive";Q.querySelector(".geTempDlgRadioBtn[data-id="+ja+"]").className="geTempDlgRadioBtn "+(qa?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");Q.querySelector("."+ca).src="/images/"+ba+"-sel.svg";Q.querySelector("."+ia).src=
"/images/"+ma+".svg";return!0}function M(fa,ca,ba,ja){function ia(na,Ja){null==qa?(na=/^https?:\/\//.test(na)&&!b.editor.isCorsEnabledForUrl(na)?PROXY_URL+"?url="+encodeURIComponent(na):TEMPLATE_PATH+"/"+na,mxUtils.get(na,mxUtils.bind(this,function(Ga){200<=Ga.getStatus()&&299>=Ga.getStatus()&&(qa=Ga.getText());Ja(qa)}))):Ja(qa)}function ma(na,Ja,Ga){if(null!=na&&mxUtils.isAncestorNode(document.body,ca)&&(na=mxUtils.parseXml(na),na=Editor.extractGraphModel(na.documentElement,!0),null!=na)){"mxfile"==

// Vulnerability class: CWE-20