mcanoglu/cwe-class-group huggingface dataset:
b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(l=function(v){t.style.marginBottom="24px";var x=document.createElement("a");x.style.display="inline-block";x.style.color="gray";x.style.cursor="pointer";x.style.marginTop="6px";mxUtils.write(x,mxResources.get("signOut"));t.style.marginBottom="16px";u.style.paddingBottom="18px";mxEvent.addListener(x,"click",function(){b.confirm(mxResources.get("areYouSure"),
function(){v()})});u.appendChild(x)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var m=b.drive.getUsersList();if(0<m.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");t.style.marginBottom="16px";u.style.paddingBottom="18px";u.appendChild(d);var q=document.createElement("select");q.style.marginLeft="4px";q.style.width="140px";for(l=0;l<m.length;l++)D=document.createElement("option"),mxUtils.write(D,m[l].displayName),D.value=l,q.appendChild(D),

// Vulnerability class: CWE-20
Menus.prototype.init=function(){function l(n,y,K){this.ui=n;this.previousExtFonts=this.extFonts=y;this.prevCustomFonts=this.customFonts=K}f.apply(this,arguments);var d=this.editorUi,u=d.editor.graph,t=mxUtils.bind(u,u.isEnabled),D=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),c=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&

// Vulnerability class: CWE-20
function test_behavior_with_bad_packet(test_case_name, bad_packet, expectError, done) {
        redirectToFile(
            "MessageBuilder_" + test_case_name + ".log",
            () => {
                const messageBuilder = new MessageBuilder();

                let full_message_body_event_received = false;
                let on_message__received = false;

                messageBuilder
                    .on("message", (message) => {
                        on_message__received = true;
                    })
                    .on("full_message_body", (full_message_body) => {
                        full_message_body_event_received = true;
                    })
                    .on("invalid_message", (err) => {
                        expectError.should.eql(false);
                        on_message__received.should.equal(false);
                        full_message_body_event_received.should.equal(true);
                        done();
                    })
                    .on("error", (err) => {
                        err.should.be.instanceOf(Error);
                        expectError.should.eql(true);
                        done();
                    });

                messageBuilder.feed(bad_packet); // OpenSecureChannel message
            },
            function () {}
        );
    }

// Vulnerability class: CWE-400
this.addMenuItems(O,["copyAsImage"],null,ea)};EditorUi.prototype.toggleFormatPanel=function(O){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=O?O:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&

// Vulnerability class: CWE-20
function(){e.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(g){e.handleFileError(g,!0)}))))};EditorUi.prototype.getFileData=function(c,e,g,k,m,q,v,x,A,z,L){m=null!=m?m:!0;q=null!=q?q:!1;var M=this.editor.graph;if(e||!c&&null!=A&&/(\.svg)$/i.test(A.getTitle())){var n=null!=M.themes&&"darkTheme"==M.defaultThemeName;z=!1;if(n||null!=this.pages&&this.currentPage!=this.pages[0]){var y=M.getGlobalVariable;M=this.createTemporaryGraph(n?M.getDefaultStylesheet():M.getStylesheet());
M.setBackgroundImage=this.editor.graph.setBackgroundImage;M.background=this.editor.graph.background;var K=this.pages[0];this.currentPage==K?M.setBackgroundImage(this.editor.graph.backgroundImage):null!=K.viewState&&null!=K.viewState&&M.setBackgroundImage(K.viewState.backgroundImage);M.getGlobalVariable=function(B){return"page"==B?K.getName():"pagenumber"==B?1:y.apply(this,arguments)};document.body.appendChild(M.container);M.model.setRoot(K.root)}}v=null!=v?v:this.getXmlFileData(m,q,z,L);A=null!=A?
A:this.getCurrentFile();c=this.createFileData(v,M,A,window.location.href,c,e,g,k,m,x,z);M!=this.editor.graph&&M.container.parentNode.removeChild(M.container);return c};EditorUi.prototype.getHtml=function(c,e,g,k,m,q){q=null!=q?q:!0;var v=null,x=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=e){v=q?e.getGraphBounds():e.getBoundingBox(e.getSelectionCells());var A=e.view.scale;q=Math.floor(v.x/A-e.view.translate.x);A=Math.floor(v.y/A-e.view.translate.y);v=e.background;null==m&&(e=this.getBasenames().join(";"),

// Vulnerability class: CWE-20
"checked"),O.style.visibility="visible"):A.setAttribute("checked","checked")):f=null}else f=null}catch(J){}x.style=y+(f?f:m());x.vertex=!0;l.addCell(x,null,null,null,null);l.selectAll();l.addListener(mxEvent.CELLS_MOVED,C);l.addListener(mxEvent.CELLS_RESIZED,C);var X=l.graphHandler.mouseUp,u=l.graphHandler.mouseDown;l.graphHandler.mouseUp=function(){X.apply(this,arguments);k.style.backgroundColor="#fff9"};l.graphHandler.mouseDown=function(){u.apply(this,arguments);k.style.backgroundColor=""};l.dblClick=

// 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=
"gray";V.style.fontSize="11px";var W=document.createElement("div");V.appendChild(W);mxUtils.write(W,K);if(null!=H&&null==b[H]){M.style.visibility="hidden";mxUtils.setOpacity(W,10);var U=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});U.spin(V);var X=window.setTimeout(function(){null==b[H]&&(U.stop(),V.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[H]&&(window.clearTimeout(X),
mxUtils.setOpacity(W,100),M.style.visibility="",U.stop(),S())}))}else S();C.appendChild(V);++D==p&&(mxUtils.br(C),D=0)}function O(P){var K=z.value;if(null==P||null!=K&&0<K.length)B&&b.hideDialog(),f(K,P,z)}l="1"==urlParams.noDevice?!1:l;v=null!=v?v:!0;d=null!=d?d:!0;p=null!=p?p:4;B=null!=B?B:!0;n=document.createElement("div");n.style.whiteSpace="nowrap";null==c&&b.addLanguageMenu(n);var t=document.createElement("h2");mxUtils.write(t,m||mxResources.get("create"));t.style.marginTop="0px";t.style.marginBottom=

// Vulnerability class: CWE-20
function(){if(null!=this.marker&&(bb.apply(this),null!=this.state&&null!=this.linkHint)){var z=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(z=new mxRectangle(z.x,z.y,z.width,z.height),z.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(z.x+(z.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(z.y+z.height+Editor.hintOffset)+"px"}};var Pa=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Pa.apply(this,arguments);

// Vulnerability class: CWE-20
mxClient.IS_CHROMEAPP&&!g||navigator.standalone||!(g||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(null!=c?c:mxResources.get(5E5>f.length?"preview":"openInNewWindow"),function(){var v=5E5>f.length?k.value:f;if(null!=u)u(v);else if(g)try{var x=b.openLink(v);null!=x&&(null==l||0<l)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=x&&null!=x.location.href&&x.location.href.substring(0,8)!=v.substring(0,8)&&(x.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(z){}}),

// 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"),
Q.shape.node.style.opacity=0);window.setTimeout(function(){Q.destroy()},1200)},J));return Q};Graph.prototype.addSvgShadow=function(u,E,J,T){J=null!=J?J:!1;T=null!=T?T:!0;var N=u.ownerDocument,Q=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"filter"):N.createElement("filter");Q.setAttribute("id",this.shadowId);var R=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):N.createElement("feGaussianBlur");R.setAttribute("in","SourceAlpha");R.setAttribute("stdDeviation",

// Vulnerability class: CWE-20
function compileObjectNode(node, defs, args) {
    if (!(node instanceof ObjectNode)) {
      throw new TypeError('No valid ObjectNode')
    }

    var entries = [];
    for (var key in node.properties) {
      if (hasOwnProperty(node.properties, key)) {
        if (!isSafeProperty(node.properties, key)) {
          throw new Error('No access to property "' + key + '"');
        }

        entries.push(stringify(key) + ': ' + compile(node.properties[key], defs, args));
      }
    }
    return '{' + entries.join(', ') + '}';
  }

// Vulnerability class: CWE-20
0),!1,null,0,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*v));return c};Ka.prototype.getConstraints=function(c,l,x){c=[];var p=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),v=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1));c.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));c.push(new mxConnectionConstraint(new mxPoint(1,0),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,l,.5*v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(l+p),v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,v));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(x+v)));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,x));c.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,
1),!1));return c};bb.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Za.prototype.getConstraints=

// Vulnerability class: CWE-20
"url("+Editor.plusImage+")",aa.setAttribute("title",mxResources.get("insert")),aa.style.width="24px",va=!0)}));ja();F.addListener("darkModeChanged",ja);F.addListener("sketchModeChanged",ja)}else F.editor.addListener("statusChanged",mxUtils.bind(this,function(){F.setStatusText(F.editor.getStatus())}));if(null!=E){var Ba=function(da){H.popupMenuHandler.hideMenu();mxEvent.isAltDown(da)||mxEvent.isShiftDown(da)?F.actions.get("customZoom").funct():F.actions.get("smartFit").funct()},Ha=F.actions.get("zoomIn"),

// Vulnerability class: CWE-20
this.handleError(K)}return y};EditorUi.prototype.updatePageLinks=function(d,g){for(var k=0;k<g.length;k++)this.updatePageLinksForCell(d,g[k].root),null!=g[k].viewState&&this.updateBackgroundPageLink(d,g[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(d,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var k=d[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=k&&(g.originalSrc="data:page/id,"+k)}}catch(l){}};EditorUi.prototype.updatePageLinksForCell=

// Vulnerability class: CWE-20
["exportPdf"],y):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(n,["exportPdf"],y);mxClient.IS_IE||"undefined"===typeof VsdxExport&&d.isOffline()||this.addMenuItems(n,["exportVsdx"],y);this.addMenuItems(n,["-","exportHtml","exportXml","exportUrl"],y);d.isOffline()||(n.addSeparator(y),this.addMenuItem(n,"export",y).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(n,y){function K(G){G.pickFile(function(N){d.spinner.spin(document.body,
mxResources.get("loading"))&&G.getFile(N,function(J){var E="data:image/"==J.getData().substring(0,11)?F(J.getTitle()):"text/xml";/\.svg$/i.test(J.getTitle())&&!d.editor.isDataSvg(J.getData())&&(J.setData(Editor.createSvgDataUri(J.getData())),E="image/svg+xml");B(J.getData(),E,J.getTitle())},function(J){d.handleError(J,null!=J?mxResources.get("errorLoadingFile"):null)},G==d.drive)},!0)}var B=mxUtils.bind(this,function(G,N,J){var E=u.view,H=u.getGraphBounds(),S=u.snap(Math.ceil(Math.max(0,H.x/E.scale-

// Vulnerability class: CWE-20
this.executeLayoutList(JSON.parse(P),function(){Fa();Ma()});u=null}else if("circle"==P){var Oa=new mxCircleLayout(H);Oa.disableEdgeStyle=!1;Oa.resetEdges=!1;var Qa=Oa.isVertexIgnored;Oa.isVertexIgnored=function(Da){return Qa.apply(this,arguments)||0>mxUtils.indexOf(y,Da)};this.executeLayout(function(){Oa.execute(H.getDefaultParent());Fa()},!0,u);u=null}else if("horizontaltree"==P||"verticaltree"==P||"auto"==P&&ma.length==2*y.length-1&&1==ia.length){H.view.validate();var Ta=new mxCompactTreeLayout(H,

// Vulnerability class: CWE-20
exports.getPadRaw = function(padId, callback){
  async.waterfall([
  function(cb){

    // Get the Pad available content keys
    db.findKeys("pad:"+padId+"*", null, function(err,records){
      if(!err){
        cb(err, records);
      }
    })
  },
  function(records, cb){
    var data = {};

    async.forEachSeries(Object.keys(records), function(key, r){

      // For each piece of info about a pad.
      db.get(records[key], function(err, entry){
        data[records[key]] = entry;

        // Get the Pad Authors
        if(entry.pool && entry.pool.numToAttrib){
          var authors = entry.pool.numToAttrib;
          async.forEachSeries(Object.keys(authors), function(k, c){
            if(authors[k][0] === "author"){
              var authorId = authors[k][1];

              // Get the author info
              db.get("globalAuthor:"+authorId, function(e, authorEntry){
                if(authorEntry && authorEntry.padIDs) authorEntry.padIDs = padId;
                if(!e) data["globalAuthor:"+authorId] = authorEntry;
              });

            }
            // console.log("authorsK", authors[k]);
            c(null);
          });
        }
        r(null); // callback;
      });
    }, function(err){ 
      cb(err, data);
    })
  }
  ], function(err, data){
    callback(null, data);
  });
}

// Vulnerability class: CWE-200
c.init()};EditorUi.prototype.confirm=function(c,e,g,k,m,q){var v=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},x=Math.min(200,28*Math.ceil(c.length/50));c=new ConfirmDialog(this,c,function(){v();null!=e&&e()},function(){v();null!=g&&g()},k,m,null,null,null,null,x);this.showDialog(c.container,340,46+x,!0,q);c.init()};EditorUi.prototype.showBanner=function(c,e,g,k){var m=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=

// 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=

// Vulnerability class: CWE-20
document.createElement("div");oa.className="geTempDlgNewDiagramCatItemLbl";oa.innerHTML=qa;ma.appendChild(oa);Da.appendChild(ma);mxEvent.addListener(ma,"click",function(){function Ja(){var Ra=Ga.querySelector(".geTemplateDrawioCatLink");null!=Ra?Ra.click():setTimeout(Ja,200)}Z=!0;var Ga=Q.querySelector(".geTemplatesList");Ga.style.display="block";Aa.style.width="";Oa.style.display="";Oa.value="";da=null;Ja()});ea.style.display=fa.length<=ba?"none":""}function G(fa,ca,ba){function ja(Qa,Ya){var La=

// Vulnerability class: CWE-20
peekAhead: function(i, e1, e2, e3, e4) {
    if (this.tokens.length > i) {
      var token = this.tokens[i];
      var t = token.text;
      if (t === e1 || t === e2 || t === e3 || t === e4 ||
          (!e1 && !e2 && !e3 && !e4)) {
        return token;
      }
    }
    return false;
  },

// Vulnerability class: CWE-74
I.height,Y.y+Y.height)-Math.max(I.y,Y.y))/C))}}P?X=0:Q=0;for(O=0;O<T.length;O++)if(R=x.model.getTerminal(T[O],!1),V==c(R)&&(Y=x.view.getState(R),R!=H&&null!=Y&&(P&&S!=Y.getCenterX()<p.getCenterX()||!P&&S!=Y.getCenterY()<p.getCenterY()))){var da=[];x.traverse(Y.cell,!0,function(ha,Z){var ea=null!=Z&&x.isTreeEdge(Z);ea&&da.push(Z);(null==Z||ea)&&da.push(ha);return null==Z||ea});x.moveCells(da,(S?1:-1)*Q,(S?1:-1)*X)}}}return x.addCells(W,U)}finally{x.model.endUpdate()}}function g(H){x.model.beginUpdate();

// Vulnerability class: CWE-20
internals.parseOutput = function (output) {

    const lines = output.split('\n');
    const hops = [];

    lines.shift();
    lines.pop();

    if (internals.isWin) {
        for (let i = 0; i < lines.length; ++i) {
            if (/^\s+1/.test(lines[i])) {
                break;
            }
        }
        lines.splice(0,i);
        lines.pop();
        lines.pop();
    }

    for (let i = 0; i < lines.length; ++i) {
        hops.push(internals.parseHop(lines[i]));
    }

    return hops;
};

// Vulnerability class: CWE-74
invokeValidation: function (field, rules, k, options) {
			//If validation engine already maked the field as error
			// we dont want to proceed
			if (typeof options !== 'undefined') {
				if (options.isError === true) {
					return;
				}
			}
			let listOfValidators = Vtiger_Base_Validator_Js.getValidator(field);
			for (let i = 0; i < listOfValidators.length; i++) {
				let validatorList = listOfValidators[i],
					validatorName = validatorList.name,
					validatorInstance = new validatorName(),
					result;
				validatorInstance.setElement(field);
				if (validatorList.hasOwnProperty('params')) {
					result = validatorInstance.validate(validatorList.params);
				} else {
					result = validatorInstance.validate();
				}
				if (!result) {
					return validatorInstance.getError();
				}
			}
		},

// Vulnerability class: CWE-20
(va.appendChild(Z),va.appendChild(fa),ba.appendChild(va));return{div:ba,refresh:aa}};Graph.prototype.getCustomFonts=function(){var u=this.extFonts;u=null!=u?u.slice():[];for(var E in Graph.customFontElements){var J=Graph.customFontElements[E];u.push({name:J.name,url:J.url})}return u};Graph.prototype.setFont=function(u,E){Graph.addFont(u,E);document.execCommand("fontname",!1,u);if(null!=E){var J=this.cellEditor.textarea.getElementsByTagName("font");E=Graph.getFontUrl(u,E);for(var T=0;T<J.length;T++)J[T].getAttribute("face")==
u&&J[T].getAttribute("data-font-src")!=E&&J[T].setAttribute("data-font-src",E)}};var t=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return t.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var u=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=u)for(var E in u)this.globalVars[E]=

// Vulnerability class: CWE-20
else{var z=c.getFileData(!0,null,null,null,null,!0),L=A.getGraphBounds(),M=Math.floor(L.width*m/A.view.scale),n=Math.floor(L.height*m/A.view.scale);if(z.length<=MAX_REQUEST_SIZE&&M*n<MAX_AREA)if(c.hideDialog(),"png"!=g&&"jpg"!=g&&"jpeg"!=g||!c.isExportToCanvas()){var y={globalVars:A.getExportVariables()};x&&(y.grid={size:A.gridSize,steps:A.view.gridSteps,color:A.view.gridColor});c.saveRequest(e,g,function(K,B){return new mxXmlRequest(EXPORT_URL,"format="+g+"&base64="+(B||"0")+(null!=K?"&filename="+
encodeURIComponent(K):"")+"&extras="+encodeURIComponent(JSON.stringify(y))+(0<v?"&dpi="+v:"")+"&bg="+(null!=k?k:"none")+"&w="+M+"&h="+n+"&border="+q+"&xml="+encodeURIComponent(z))})}else"png"==g?c.exportImage(m,null==k||"none"==k,!0,!1,!1,q,!0,!1,null,x,v):c.exportImage(m,!1,!0,!1,!1,q,!0,!1,"jpeg",x);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,e="";if(null!=this.pages)for(var g=

// Vulnerability class: CWE-20
ba,ja,ia){function ma(La,Ta){null==Ja?(Ga=La,Ga=/^https?:\/\//.test(Ga)&&!b.editor.isCorsEnabledForUrl(Ga)?PROXY_URL+"?url="+encodeURIComponent(Ga):TEMPLATE_PATH+"/"+Ga,mxUtils.get(Ga,mxUtils.bind(this,function(Ua){200<=Ua.getStatus()&&299>=Ua.getStatus()&&(Ja=Ua.getText());Ta(Ja,Ga)}))):Ta(Ja,Ga)}function qa(La,Ta,Ua){if(null!=La&&mxUtils.isAncestorNode(document.body,na)){La=mxUtils.parseXml(La);La=Editor.parseDiagramNode(La.documentElement);var Za=new mxCodec(La.ownerDocument),Wa=new mxGraphModel;
Za.decode(La,Wa);La=Wa.root.getChildAt(0).children;b.sidebar.createTooltip(na,La,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-80,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-80,800),null!=ya?mxResources.get(ya,null,ya):null,!0,new mxPoint(Ta,Ua),!0,function(){Ya=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;y(na,null,null,pa,fa,ia)},!0,!1)}}function oa(La,Ta){null==pa||Ra||

// Vulnerability class: CWE-20
J.substring(0,17)&&(N[R].setAttribute("href",this.updateCustomLink(u,J)),Q=!0);Q&&this.labelChanged(E,T.innerHTML)}};Graph.prototype.updateCustomLink=function(u,E){if("data:action/json,"==E.substring(0,17))try{var J=JSON.parse(E.substring(17));null!=J.actions&&(this.updateCustomLinkActions(u,J.actions),E="data:action/json,"+JSON.stringify(J))}catch(T){}return E};Graph.prototype.updateCustomLinkActions=function(u,E){for(var J=0;J<E.length;J++){var T=E[J],N;for(N in T)this.updateCustomLinkAction(u,
T[N],"cells"),this.updateCustomLinkAction(u,T[N],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(u,E,J){if(null!=E&&null!=E[J]){for(var T=[],N=0;N<E[J].length;N++)if("*"==E[J][N])T.push(E[J][N]);else{var Q=u[E[J][N]];null!=Q?""!=Q&&T.push(Q):T.push(E[J][N])}E[J]=T}};Graph.prototype.getCellsForAction=function(u,E){E=this.getCellsById(u.cells).concat(this.getCellsForTags(u.tags,null,E));if(null!=u.excludeCells){for(var J=[],T=0;T<E.length;T++)0>u.excludeCells.indexOf(E[T].id)&&J.push(E[T]);

// Vulnerability class: CWE-20
function deleteGroup() {
  var tr = $(this).closest("tr");
  var id = tr.attr("data-id");
  var name = tr.find("#name_" + id).val();

  utils.disableAll();
  utils.showAlert("info", "", "Deleting group...", name);
  $.ajax({
    url: "scripts/pi-hole/php/groups.php",
    method: "post",
    dataType: "json",
    data: { action: "delete_group", id: id, token: token },
    success: function (response) {
      utils.enableAll();
      if (response.success) {
        utils.showAlert("success", "far fa-trash-alt", "Successfully deleted group ", name);
        table.row(tr).remove().draw(false);
      } else {
        utils.showAlert("error", "", "Error while deleting group with ID " + id, response.message);
      }
    },
    error: function (jqXHR, exception) {
      utils.enableAll();
      utils.showAlert("error", "", "Error while deleting group with ID " + id, jqXHR.responseText);
      console.log(exception); // eslint-disable-line no-console
    }
  });
}

// Vulnerability class: CWE-862
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
var K=A.div.querySelector(".geCommentEditTxtArea"),F=A.div.querySelector(".geCommentEditBtns");A.comment.content=K.value;K.parentNode.removeChild(K);F.parentNode.removeChild(F)}catch(H){b.handleError(H)}O.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";y=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(H){function S(V){if(null!=V){V.sort(function(W,U){return new Date(W.modifiedDate)-
new Date(U.modifiedDate)});for(var M=0;M<V.length;M++)S(V[M].replies)}}H.sort(function(V,M){return new Date(V.modifiedDate)-new Date(M.modifiedDate)});O.innerHTML="";O.appendChild(t);t.style.display="block";D=H;for(H=0;H<D.length;H++)S(D[H].replies),q(D[H],D,null,0,C);null!=A&&null==A.comment.id&&null==A.comment.pCommentId&&(O.appendChild(A.div),d(A.comment,A.div,A.saveCallback,A.deleteOnCancel))},mxUtils.bind(this,function(H){O.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(H&&H.message?

// Vulnerability class: CWE-20
ka-aa,ha=ua+(ya.y-ua)/ka-aa,da=new Image;da.onload=function(){try{for(var ca=-Math.round(sa-mxUtils.mod((wa-xa)*Y,sa)),la=-Math.round(sa-mxUtils.mod((ua-ha)*Y,sa));ca<Da;ca+=sa)for(var ia=la;ia<La;ia+=sa)Aa.drawImage(da,ca/Y,ia/Y);Fa()}catch(ma){null!=N&&N(ma)}};da.onerror=function(ca){null!=N&&N(ca)};da.src=oa}else Fa()}catch(ca){null!=N&&N(ca)}});Ga.onerror=function(Fa){null!=N&&N(Fa)};ea&&this.graph.addSvgShadow(za);this.graph.mathEnabled&&this.addMathCss(za);var Na=mxUtils.bind(this,function(){try{null!=

// Vulnerability class: CWE-20
function isLiteral(ast) {
  return ast.body.length === 0 ||
      ast.body.length === 1 && (
      ast.body[0].expression.type === AST.Literal ||
      ast.body[0].expression.type === AST.ArrayExpression ||
      ast.body[0].expression.type === AST.ObjectExpression);
}

// Vulnerability class: CWE-74
"url("+Editor.plusImage+")",ta.setAttribute("title",mxResources.get("insert")),ta.style.width="24px",Na=!0)}));Ca();U.addListener("darkModeChanged",Ca);U.addListener("sketchModeChanged",Ca)}else U.editor.addListener("statusChanged",mxUtils.bind(this,function(){U.setStatusText(U.editor.getStatus())}));if(null!=J){var Ra=function(za){I.popupMenuHandler.hideMenu();mxEvent.isAltDown(za)||mxEvent.isShiftDown(za)?U.actions.get("customZoom").funct():U.actions.get("smartFit").funct()},ab=U.actions.get("zoomIn"),

// Vulnerability class: CWE-20
T[N],"cells"),this.updateCustomLinkAction(u,T[N],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(u,E,J){if(null!=E&&null!=E[J]){for(var T=[],N=0;N<E[J].length;N++)if("*"==E[J][N])T.push(E[J][N]);else{var Q=u[E[J][N]];null!=Q?""!=Q&&T.push(Q):T.push(E[J][N])}E[J]=T}};Graph.prototype.getCellsForAction=function(u,E){E=this.getCellsById(u.cells).concat(this.getCellsForTags(u.tags,null,E));if(null!=u.excludeCells){for(var J=[],T=0;T<E.length;T++)0>u.excludeCells.indexOf(E[T].id)&&J.push(E[T]);
E=J}return E};Graph.prototype.getCellsById=function(u){var E=[];if(null!=u)for(var J=0;J<u.length;J++)if("*"==u[J]){var T=this.model.getRoot();E=E.concat(this.model.filterDescendants(function(Q){return Q!=T},T))}else{var N=this.model.getCell(u[J]);null!=N&&E.push(N)}return E};var S=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(u){return S.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(u))};Graph.prototype.isAllTagsHidden=function(u){if(null==u||0==u.length||

// Vulnerability class: CWE-20
mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,e),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=q&&q.isModified()?this.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var e=
0;e<this.pages.length;e++)this.updatePageRoot(this.pages[e]),this.addBasenamesForCell(this.pages[e].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);e=[];for(var g in c)e.push(g);return e};EditorUi.prototype.addBasenamesForCell=function(c,e){function g(v){if(null!=v){var x=v.lastIndexOf(".");0<x&&(v=v.substring(x+1,v.length));null==e[v]&&(e[v]=!0)}}var k=this.editor.graph,m=k.getCellStyle(c);g(mxStencilRegistry.getBasenameForStencil(m[mxConstants.STYLE_SHAPE]));k.model.isEdge(c)&&

// Vulnerability class: CWE-20
P)this.editPlantUmlData(D,G,P);else if(P=this.graph.getAttributeForCell(D,"mermaidData"),null!=P)this.editMermaidData(D,G,P);else{var K=g.getCellStyle(D);"1"==mxUtils.getValue(K,"metaEdit","0")?d.showDataDialog(D):k.apply(this,arguments)}}catch(F){d.handleError(F)}};g.getLinkTitle=function(D){return d.getLinkTitle(D)};g.customLinkClicked=function(D){var G=!1;try{d.handleCustomLink(D),G=!0}catch(P){d.handleError(P)}return G};var l=g.parseBackgroundImage;g.parseBackgroundImage=function(D){var G=l.apply(this,
arguments);null!=G&&null!=G.src&&Graph.isPageLink(G.src)&&(G={originalSrc:G.src});return G};var p=g.setBackgroundImage;g.setBackgroundImage=function(D){null!=D&&null!=D.originalSrc&&(D=d.createImageForPageLink(D.originalSrc,d.currentPage,this));p.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",

// Vulnerability class: CWE-20
H.x+" "+H.y;S="";d=[];for(V=2;V<x.length;V+=2)H=P(V),S+=" L"+H.x+" "+H.y,d.push(H);c.setAttribute("d",n+S)}p&&(H=b.view.translate,b.scrollRectToVisible((new mxRectangle(K.x-H.x,K.y-H.y)).grow(20)));F.consume()}}),mouseUp:mxUtils.bind(this,function(K,F){c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(z(F.getEvent()),F.consume())})});var D=function(K){return mxUtils.convertPoint(b.container,mxEvent.getClientX(K),mxEvent.getClientY(K))},G=function(K){for(x.push(K);x.length>f;)x.shift()},P=

// Vulnerability class: CWE-20
Array.prototype.push.apply(P.shape.customProperties,Editor.commonEdgeProperties)),T(P.shape.customProperties));p=p.getAttribute("customProperties");if(null!=p)try{T(JSON.parse(p))}catch(O){}}};var v=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var p=this.editorUi.getSelectionState();"image"!=p.style.shape&&!p.containsLabel&&0<p.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));v.apply(this,arguments);if(Editor.enableCustomProperties){for(var C=
{},I=p.vertices,T=p.edges,P=0;P<I.length;P++)this.findCommonProperties(I[P],C,0==P);for(P=0;P<T.length;P++)this.findCommonProperties(T[P],C,0==I.length&&0==P);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(C).length&&this.container.appendChild(this.addProperties(this.createPanel(),C,p))}};var x=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(p){this.addActions(p,["copyStyle","pasteStyle"]);return x.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=

// Vulnerability class: CWE-20
function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(n,null,null,q,v,x)):(n=b.convertDataUri(n),y=null==y?120:y,K=null==K?100:K,b.hideDialog(),d(n,y,K,q,v,x))},z=function(n,y){if(null!=n){var K=u?null:g.getModel().getGeometry(g.getSelectionCell());null!=K?A(n,K.width,K.height,y):A(n,null,null,y)}else b.hideDialog(),d(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",

// Vulnerability class: CWE-20
"inline-block":"none"};Ca=function(){ta.innerHTML="";if(null!=F.currentPage){mxUtils.write(ta,F.currentPage.getName());var da=null!=F.pages?F.pages.length:1,ca=F.getPageIndex(F.currentPage);ca=null!=ca?ca+1:1;var la=F.currentPage.getId();ta.setAttribute("title",F.currentPage.getName()+" ("+ca+"/"+da+")"+(null!=la?" ["+la+"]":""))}};Ea.parentNode.removeChild(Ea);var Da=F.actions.get("delete"),La=D("",Da.funct,null,mxResources.get("delete"),Da,Editor.trashImage);La.style.opacity="0.1";Q.appendChild(La);

// Vulnerability class: CWE-20
_size ({ id, token }, done) {
    return this.client
      .get(`https://graph.facebook.com/${id}`)
      .qs({ fields: 'images' })
      .auth(token)
      .request((err, resp, body) => {
        if (err || resp.statusCode !== 200) {
          err = this._error(err, resp)
          logger.error(err, 'provider.facebook.size.error')
          return done(err)
        }

        getURLMeta(this._getMediaUrl(body))
          .then(({ size }) => done(null, size))
          .catch((err2) => {
            logger.error(err2, 'provider.facebook.size.error')
            done(err2)
          })
      })
  }

// Vulnerability class: CWE-863
function onConnectionClosed (message) {
    if (readyState === EventSource.CLOSED) return
    readyState = EventSource.CONNECTING
    _emit('error', new Event('error', {message: message}))

    // The url may have been changed by a temporary
    // redirect. If that's the case, revert it now.
    if (reconnectUrl) {
      url = reconnectUrl
      reconnectUrl = null
    }
    setTimeout(function () {
      if (readyState !== EventSource.CONNECTING || self.connectionInProgress) {
        return
      }
      self.connectionInProgress = true
      connect()
    }, self.reconnectInterval)
  }

// Vulnerability class: CWE-200
function(C){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=C?C:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),

// Vulnerability class: CWE-20
this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),f(g)):n||401!==g.getStatus()&&400!==g.getStatus()?c(this.parseRequestText(g)):this.authenticate(function(){m(!0)},c,n))}),mxUtils.bind(this,function(g){window.clearTimeout(d);v&&c(g)}))});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){m(!0)},c):m(!1)};OneDriveClient.prototype.checkToken=function(e){null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(e,this.emptyFn):e()};OneDriveClient.prototype.getItemRef=

// Vulnerability class: CWE-20
function onSearchKeyUp () {
        var searchTerm = $searchBox.val().toLowerCase()
        $('.all-user-list li').each(function () {
          if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
            $(this).show()
          } else {
            $(this).hide()
          }
        })
      }

// Vulnerability class: CWE-662
function make_process(object, prop) {
        var labels = {
            from: 'Unserialize',
            to: 'Serialize'
        };
        var prefix_message = labels[prop] + ' Error: ';
        return function(data) {
            var fn = object[prop];
            try {
                if (fn) {
                    return fn(data);
                }
                return data;
            } catch (e) {
                console.warn(prefix_message + e.message);
            }
        };
    }

// Vulnerability class: CWE-200
Graph.sanitizeHtml = function(value, editing)
{
	return DOMPurify.sanitize(value, {ADD_ATTR: ['target'], FORBID_TAGS: ['form'],
		ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i});
};

// Vulnerability class: CWE-20
this.startDrawing=function(){t(!0)};this.isDrawing=function(){return y};var z=mxUtils.bind(this,function(K){if(c){var F=d.length,H=A&&0<v.length&&null!=d&&2>d.length;H||v.push.apply(v,d);d=[];v.push(null);m.push(c);c=null;(H||l)&&this.stopDrawing();l&&2<=F&&this.startDrawing();mxEvent.consume(K)}}),L=new mxCell;L.edge=!0;var C=function(){var K=b.getCurrentCellStyle(L);K=mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(K,mxConstants.STYLE_STROKECOLOR,"#000"));"default"==

// Vulnerability class: CWE-20
function stringify(value) {
  if (value == null) { // null || undefined
    return '';
  }
  switch (typeof value) {
    case 'string':
      break;
    case 'number':
      value = '' + value;
      break;
    default:
      if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {
        value = value.toString();
      } else {
        value = toJson(value);
      }
  }

  return value;
}

// Vulnerability class: CWE-74
function cpOptsInData(data, opts) {
  _OPTS.forEach(function (p) {
    if (typeof data[p] != 'undefined') {
      // Disallow setting the root opt for includes via a passed data obj
      // Unsanitized, parameterized use of `render` could allow the
      // include directory to be reset, opening up the possibility of
      // remote code execution
      if (p == 'root') {
        return;
      }
      opts[p] = data[p];
    }
  });
}

// Vulnerability class: CWE-20
va&&("shape"!=va||Na)&&(!Na||la||0>mxUtils.indexOf(d,va))&&(Ca=mxUtils.setStyle(Ca,va,Ra))}Editor.simpleLabels&&(Ca=mxUtils.setStyle(mxUtils.setStyle(Ca,"html",null),"whiteSpace",null));Q.setStyle(J,Ca)}}finally{Q.endUpdate()}return I};n.addListener("cellsInserted",function(I,V){q(V.getProperty("cells"),null,null,null,null,!0,!0)});n.addListener("textInserted",function(I,V){q(V.getProperty("cells"),!0)});this.insertHandler=q;this.createDivs();this.createUi();this.refresh();var y=mxUtils.bind(this,

// Vulnerability class: CWE-20
Manager.prototype.authorize = function (data, fn) {
  if (this.get('authorization')) {
    var self = this;

    this.get('authorization').call(this, data, function (err, authorized) {
      self.log.debug('client ' + authorized ? 'authorized' : 'unauthorized');
      fn(err, authorized);
    });
  } else {
    this.log.debug('client authorized');
    fn(null, true);
  }

  return this;
};

// Vulnerability class: CWE-330
function fileCompletion (root, req, depth, cb) {
  if (typeof cb !== 'function') {
    cb = depth
    depth = Infinity
  }
  correctMkdir(root, function (er) {
    if (er) return cb(er)

    // can be either exactly the req, or a descendent
    var pattern = root + '/{' + req + ',' + req + '/**/*}'
    var opts = { mark: true, dot: true, maxDepth: depth }
    glob(pattern, opts, function (er, files) {
      if (er) return cb(er)
      return cb(null, (files || []).map(function (f) {
        return f.substr(root.length + 1).replace(/^\/|\/$/g, '')
      }))
    })
  })
}

// Vulnerability class: CWE-732
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
2)?O.substring(45,O.lastIndexOf("%26ex")):O.substring(2);this.showError(g,x,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+O);this.handleError(d,g,k,l,p)}),I,mxResources.get("changeUser"),mxUtils.bind(this,function(){function z(){G.innerHTML="";for(var P=0;P<L.length;P++){var K=document.createElement("option");mxUtils.write(K,L[P].displayName);K.value=P;G.appendChild(K);K=document.createElement("option");K.innerHTML="&nbsp;&nbsp;&nbsp;";
mxUtils.write(K,"<"+L[P].email+">");K.setAttribute("disabled","disabled");G.appendChild(K)}K=document.createElement("option");mxUtils.write(K,mxResources.get("addAccount"));K.value=L.length;G.appendChild(K)}var L=this.drive.getUsersList(),C=document.createElement("div"),D=document.createElement("span");D.style.marginTop="6px";mxUtils.write(D,mxResources.get("changeUser")+": ");C.appendChild(D);var G=document.createElement("select");G.style.width="200px";z();mxEvent.addListener(G,"change",mxUtils.bind(this,

// Vulnerability class: CWE-20
Number(L.value),[f[n]])}}finally{l.getModel().endUpdate()}});M.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",function(n){13==n.keyCode&&M.click()});t=document.createElement("div");t.style.marginTop="20px";t.style.textAlign="right";b.editor.cancelFirst?(t.appendChild(d),t.appendChild(M)):(t.appendChild(M),t.appendChild(d));u.appendChild(t);this.container=u},LibraryDialog=function(b,f,l,d,u,t){function D(F){for(F=document.elementFromPoint(F.clientX,F.clientY);null!=F&&F.parentNode!=
v;)F=F.parentNode;var G=null;if(null!=F){var N=v.firstChild;for(G=0;null!=N&&N!=F;)N=N.nextSibling,G++}return G}function c(F,G,N,J,E,H,S,U,Q){try{if(b.spinner.stop(),null==G||"image/"==G.substring(0,6))if(null==F&&null!=S||null==A[F]){var W=function(){O.innerHTML="";O.style.cursor="pointer";O.style.whiteSpace="nowrap";O.style.textOverflow="ellipsis";mxUtils.write(O,null!=R.title&&0<R.title.length?R.title:mxResources.get("untitled"));O.style.color=null==R.title||0==R.title.length?"#d0d0d0":""};v.style.backgroundImage=

// Vulnerability class: CWE-20
[H],"{1} ago"));F.setAttribute("title",K.toLocaleDateString()+" "+K.toLocaleTimeString())}function k(K){var F=document.createElement("img");F.className="geCommentBusyImg";F.src=IMAGE_PATH+"/spin.gif";K.appendChild(F);K.busyImg=F}function l(K){K.style.border="1px solid red";K.removeChild(K.busyImg)}function p(K){K.style.border="";K.removeChild(K.busyImg)}function q(K,F,H,S,V){function M(N,Q,R){var Y=document.createElement("li");Y.className="geCommentAction";var ba=document.createElement("a");ba.className=

// Vulnerability class: CWE-20
null,"Error fetching folder items")+(null!=Ca?" ("+Ca+")":""));V=!1;P.stop()}})}}function L(N){J.className=J.className.replace("odCatSelected","");J=N;J.className+=" odCatSelected"}function C(N){V||(T=null,z("search",null,null,null,N))}var D="";null==e&&(e=I,D='<div style="text-align: center;" class="odPreview"></div>');null==m&&(m=function(){var N=null;try{N=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(Q){}return N});null==n&&(n=function(N){if(null!=N){var Q=m()||{};delete N["@microsoft.graph.downloadUrl"];

// Vulnerability class: CWE-20
O.focus();document.execCommand("selectAll",!1,null);M=function(){O.removeAttribute("contentEditable");O.style.cursor="pointer";R.title=O.innerHTML;W()};mxEvent.consume(Z)}};mxEvent.addListener(O,"click",T);mxEvent.addListener(C,"dblclick",T);v.appendChild(C);mxEvent.addListener(C,"dragstart",function(Z){null==F&&null!=S&&(P.style.visibility="hidden",O.style.visibility="hidden");mxClient.IS_FF&&null!=S.xml&&Z.dataTransfer.setData("Text",S.xml);z=D(Z);mxClient.IS_GC&&(C.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(C.style,

// Vulnerability class: CWE-20
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,
D,G),E=X.getDefaultParent();1<X.model.getChildCount(X.getSelectionCell())&&(E=X.getSelectionCell());u.execute(E);P=!1}},F=document.createElement("div"),H=document.createElement("div");H.style.marginTop="6px";H.style.display="inline-block";H.style.width="140px";mxUtils.write(H,mxResources.get("orgChartType")+": ");F.appendChild(H);var S=document.createElement("select");S.style.width="200px";S.style.boxSizing="border-box";H=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),

// Vulnerability class: CWE-20
n.getStatus()&&300>=n.getStatus()?(this.updateDiagram(n.getText()),L()):this.handleError({message:mxResources.get("error")+" "+n.getStatus()}))}),mxUtils.bind(this,function(n){this.handleError(n)}))}),L=mxUtils.bind(this,function(){window.clearTimeout(A);A=window.setTimeout(z,x)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){L();z()}));L();z()}null!=e&&e()});null!=c.url&&0<c.url.length?this.editor.loadUrl(c.url,mxUtils.bind(this,function(q){m(q)}),mxUtils.bind(this,function(q){null!=

// Vulnerability class: CWE-20
Menus.prototype.createPopupMenu=function(C,D,G){var P=this.editorUi.editor.graph;C.smartSeparators=!0;y.apply(this,arguments);"1"==urlParams.sketch?P.isEnabled()&&(C.addSeparator(),1==P.getSelectionCount()&&this.addMenuItems(C,["-","lockUnlock"],null,G)):1==P.getSelectionCount()?(P.isCellFoldable(P.getSelectionCell())&&this.addMenuItems(C,P.isCellCollapsed(D)?["expand"]:["collapse"],null,G),this.addMenuItems(C,["collapsible","-","lockUnlock","enterGroup"],null,G),C.addSeparator(),this.addSubmenu("layout",
C)):P.isSelectionEmpty()&&P.isEnabled()?(C.addSeparator(),this.addMenuItems(C,["editData"],null,G),C.addSeparator(),this.addSubmenu("layout",C),this.addSubmenu("insert",C),this.addMenuItems(C,["-","exitGroup"],null,G)):P.isEnabled()&&this.addMenuItems(C,["-","lockUnlock"],null,G)};var A=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(C,D,G){A.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(C,["copyAsImage"],null,G)};EditorUi.prototype.toggleFormatPanel=

// Vulnerability class: CWE-20
"default")},ma.addListener("stateChanged",da),H.addListener("enabledChanged",da),da());return pa}function G(da,ca,la){la=document.createElement("div");la.className="geMenuItem";la.style.display="inline-block";la.style.verticalAlign="top";la.style.marginRight="6px";la.style.padding="0 4px 0 4px";la.style.height="30px";la.style.position="relative";la.style.top="0px";"1"==urlParams.sketch&&(la.style.boxShadow="none");for(var ia=0;ia<da.length;ia++)null!=da[ia]&&("1"==urlParams.sketch&&(da[ia].style.padding=
"10px 8px",da[ia].style.width="30px"),da[ia].style.margin="0px",da[ia].style.boxShadow="none",la.appendChild(da[ia]));null!=ca&&mxUtils.setOpacity(la,ca);null!=F.statusContainer&&"1"!=urlParams.sketch?S.insertBefore(la,F.statusContainer):S.appendChild(la);return la}function P(){if("1"==urlParams.sketch)"1"!=urlParams.embedInline&&(Q.style.left=58>N.offsetTop-N.offsetHeight/2?"70px":"10px");else{for(var da=S.firstChild;null!=da;){var ca=da.nextSibling;"geMenuItem"!=da.className&&"geItem"!=da.className||

// Vulnerability class: CWE-20