Language: JavaScript
Label: safe
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",d,"\nresponse:",U,"\nresult:",R),this.spinner.stop(),g(R,N,Q,P))}),G)}),G,mxUtils.bind(this,function(N){3>q++?x.clear()&&(this.spinner.stop(),t()):G(N)}))}),G);else{var F={message:mxResources.get("error")+" "+I.getStatus()};try{F=JSON.parse(I.getText()),F=F.error}catch(U){}G(F)}}),G)}),n)});t()};EditorUi.prototype.extractMermaidMindmap=function(d){for(0<d[1].indexOf("orientation")&&d.splice(1,1);1<d.length&&""==d[1];)d.splice(1,1);
for(var g=[],n=2;n<d.length;n++){var q=mxUtils.trim(d[n]);"["!=q&&"]"!=q&&"%%"!=q.substring(0,2)&&"##"!=q.substring(0,2)&&(q=d[n].replace(/[-|>]/g," "),""!=mxUtils.trim(q)&&" "==q.charAt(0)&&g.push(q))}return"mindmap\nroot(("+mxUtils.trim(d[1])+"))\n"+g.join("\n")};EditorUi.prototype.extractMermaidDeclaration=function(d){"o\n\n"==d.substring(0,3)&&(d=d.substring(3));var g=d.split("```");g=1<g.length?g:d.split("<pre>");g=1<g.length?g:d.split("~~~");g=1<g.length?g:d.split("%%");g=1<g.length?g:d.split("(Begins)");