Language: JavaScript
Label: vulnerable
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",d,"\nresponse:",S,"\nresult:",p),this.spinner.stop(),g(p,q,C,J))}),H)}),H,mxUtils.bind(this,function(q){3>t++?v.clear()&&(this.spinner.stop(),u()):H(q)}))}),H);else{var F={message:mxResources.get("error")+" "+L.getStatus()};try{F=JSON.parse(L.getText()),F=F.error}catch(S){}H(F)}}),H)}),n)});u()};EditorUi.prototype.extractMermaidMindmap=function(d){for(0<d[1].indexOf("orientation")&&d.splice(1,1);1<d.length&&""==d[1];)d.splice(1,1);