@gregoriusrippenstein/node-red-contrib-introspection 0.6.13 → 0.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/node-red-contrib-introspection",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "dependencies": {
5
5
  "got": "^13",
6
6
  "uglify-js": "^3.17.4",
@@ -2,7 +2,7 @@
2
2
  (function() {
3
3
  var globalRefToSvgData;
4
4
 
5
- let obfuscateHelpers={getFlowDataFromCurrentWorkspace:e=>{var e=e||RED.workspaces.active(),t=RED.nodes.groups(e),e=(t=(t=t.concat(RED.nodes.junctions(e))).concat(RED.nodes.filterNodes({z:e})),RED.nodes.eachConfig(function(e){e.z===RED.workspaces.active()&&!1===e._def.hasUsers&&t.push(e)}),RED.nodes.workspace(e)||RED.nodes.subflow(e));return t.unshift(e),RED.nodes.createExportableNodeSet(t)},openImportDialog:e=>{RED.clipboard.import();let t=e;setTimeout(()=>{$("#red-ui-clipboard-dialog-import-text").val(JSON.stringify(t)).trigger("paste")},300)}};function obfuscatieCurrentFlow(t){let a=obfuscateHelpers.getFlowDataFromCurrentWorkspace(),l=(t.remove_groups&&(a=a.filter(e=>"group"!=e.type)).forEach(e=>{delete e.g}),{}),r={},p={},f={},s=[],d={},o={};if(a.forEach(e=>{"subflow"==(l[e.id]=e).type&&(o[e.id]=e),"junction"==e.type&&(r[e.id]=e),"link out"==e.type&&(f[e.id]=e),"link in"==e.type&&(p[e.id]=e),"link call"==e.type&&s.push(e.id),"catch"==e.type&&(d[e.id]=(e.wires||[])[0]||[])}),t.remove_junctions&&(Object.keys(r).forEach(n=>{let s=r[n];o[s.z]||a.forEach(t=>{for(let e=0;e<(t.wires||[]).length;e++){var r=t.wires[e].indexOf(n);-1<r&&(t.wires[e].splice(r,1),t.wires[e].push(...s.wires[0]))}})}),a=a.filter(e=>!("junction"==e.type&&!o[e.z]))),t.remove_linkout_nodes||t.remove_linkcall_nodes){let n=[],r=[],u=[],i=(t.remove_linkout_nodes&&!t.copy_linkin_nodes&&Object.keys(f).forEach(s=>{var e=f[s],t=e.links||[];t.reduce((e,t)=>e&&!!p[t],!0)&&"return"!=e.mode&&(n.push(s),t.forEach(n=>{a.forEach(t=>{for(let e=0;e<(t.wires||[]).length;e++){var r=t.wires[e].indexOf(s);-1<r&&(t.wires[e].splice(r,1),t.wires[e].push(...p[n].wires[0]))}})}))}),(s,e)=>{if(!e)return!1;let t=[],o=[],r=[];function u(e){if(r.indexOf(e.id)<0)switch(r.push(e.id),t.push(e),e.type){case"link out":if("return"!=e.mode)throw"not handable";break;case"link call":throw"unhandled";default:RED.nodes.getNodeLinks(e).forEach(function(e){u(e.target)})}}try{RED.nodes.getNodeLinks(e).forEach(function(e){u(e.target),o.push(e.target.id)});if(Object.keys(d).forEach(e=>{((t,e)=>{try{return e.map(e=>e.id).forEach(e=>{if(t.includes(e))throw"yes"}),!1}catch(e){return!0}})(d[e],t)&&t.push(l[e])}),0==t.length)return!1;let r={};var i=t[0];let n={x:s.x-i.x,y:s.y-i.y};var a=t.map(e=>{var t=structuredClone(l[e.id]);return t||console.log("WARNING: nodeid not found",[e.id,l[e.id]]),t.id=RED.nodes.id(),t.x+=n.x,t.y+=n.y,r[e.id]=t});return a.forEach(e=>{"catch"==e.type&&Array.isArray(e.scope)&&(e.scope=e.scope.map(e=>{var t=r[e];return t&&t.id||e})),e.wires&&(e.wires=e.wires.map(e=>e.map(e=>{var t=r[e];return t&&"link out"==t.type?[...s.wires[0],(t||{}).id||e]:(t||{}).id||e}).flat()))}),{nodes:a.filter(e=>"link out"!=e.type),entryNodes:o.map(e=>r[e])}}catch(e){return!1}});t.remove_linkout_nodes&&t.copy_linkin_nodes&&Object.keys(f).forEach(o=>{let r=f[o];var e=r.links||[];"return"!=r.mode&&(e=e.map(e=>{var t=p[e],t=i(r,t);if(t)return[e,t]})).reduce((e,t)=>e&&!!t,!0)&&(n.push(o),e.forEach(([,s])=>{a.forEach(t=>{for(let e=0;e<(t.wires||[]).length;e++){var r,n=t.wires[e].indexOf(o);-1<n&&(r=s.entryNodes.map(e=>e.id),t.wires[e].splice(n,1),t.wires[e].push(...r),u.push(...s.nodes))}})}))}),t.remove_linkcall_nodes&&s.forEach(s=>{var e=l[s],t=p[e.links[0]];let o=i(e,t);t&&o&&(r.push(e.id),a.forEach(t=>{for(let e=0;e<(t.wires||[]).length;e++){var r,n=t.wires[e].indexOf(s);-1<n&&(r=o.entryNodes.map(e=>e.id),t.wires[e].splice(n,1),t.wires[e].push(...r),u.push(...o.nodes))}}))}),(a=a.filter(e=>n.indexOf(e.id)<0&&r.indexOf(e.id)<0)).push(...u)}if((a=t.remove_debugs?a.filter(e=>"debug"!=e.type&&"comment"!=e.type):a).forEach(e=>{t.name&&(e.name=RED.nodes.id()),t.shrink_node&&(e.l=!1),t.info&&(e.info="",delete e.outputLabels,delete e.inputLabels),t.add_license&&(t.append_license?e.info=(e.info||"")+"\n---\n\n"+t.license_text:e.info=t.license_text),t.position&&(e.x=150,e.y=150),t.remove_icons&&delete e.icon}),t.replace_switch){let n=(t,r)=>{for(let e=0;e<r.rules.length;e++){var n=r.rules[e];if("nnull"==n.t)t.push("if ( _propValue != null ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("null"==n.t)t.push("if ( _propValue == null ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("eq"==n.t&&"str"==n.vt){s=n.v;s=btoa(encodeURIComponent(s).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}));t.push("if ( _propValue === Buffer.from('"+s+"', 'base64').toString('utf-8') ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }")}else if("gt"==n.t&&"num"==n.vt)t.push("if ( _propValue > "+n.v+" ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("eq"==n.t&&"num"==n.vt)t.push("if ( _propValue == "+n.v+" ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("empty"==n.t)t.push('let p = _propValue ; if ( (Array.isArray(p) && p.length == 0) || ((typeof p === "object") && p != null && Object.keys(p).length == 0) || ((typeof p === "string") && p.length == 0) ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }');else if("nempty"==n.t)t.push('let p = _propValue ; if ( (Array.isArray(p) && p.length > 0) || ((typeof p === "object") && p != null && Object.keys(p).length > 0) || ((typeof p === "string") && p.length > 0) ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }');else{if("else"!=n.t)throw"unhandled";t.push("_returnValue.push(msg)","return node.send(_returnValue)")}}var s};a=a.map(t=>{if("switch"!=t.type)return t;var e={id:t.id,name:t.name,type:"function",x:t.x,y:t.y,func:"",outputs:t.outputs,timeout:"",noerr:0,initialize:"",finalize:"",libs:[{var:"process",module:"process"},{var:"jsonata",module:"jsonata"}],wires:t.wires};t.hasOwnProperty("z")&&(e.z=t.z),t.hasOwnProperty("l")&&(e.l=t.l);try{var r=[];if(t.checkAll)throw"unhandled";if("msg"==t.propertyType)r.push("((msg,node) => {","let _propValue = undefined","try { _propValue = RED.util.getMessageProperty(msg, '"+t.property+"') } catch (ex) {}","let _returnValue = []"),n(r,t),r.push("})(msg,node);");else{if("jsonata"!=t.propertyType)throw"unhandled";r.push("jsonata('"+t.property+"').evaluate(msg).then(_propValue => {","let _returnValue = []"),n(r,t),r.push("})")}return e.func=r.join("\n"),e}catch(e){return t}})}if(t.replace_change){let s=e=>btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}));a=a.map(t=>{if("change"!=t.type)return t;var e={id:t.id,name:t.name,type:"function",x:t.x,y:t.y,func:"",outputs:1,timeout:"",noerr:0,initialize:"",finalize:"",libs:[{var:"process",module:"process"},{var:"jsonata",module:"jsonata"}],wires:t.wires};t.hasOwnProperty("z")&&(e.z=t.z),t.hasOwnProperty("l")&&(e.l=t.l);try{var r=["(async (msg,node) => {","let __s = RED.util.setMessageProperty","let __g = RED.util.getMessageProperty"];for(let e=0;e<t.rules.length;e++){var n=t.rules[e];if("set"==n.t){if(n.dc)throw"unhandled";if("msg"==n.pt&&"str"==n.tot)r.push("__s(msg,'"+n.p+"', Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8') )");else if("msg"==n.pt&&"bool"==n.tot)r.push("__s(msg,'"+n.p+"', "+n.to+")");else if("msg"==n.pt&&"num"==n.tot)r.push("__s(msg,'"+n.p+"', Number(Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8')))");else if("msg"==n.pt&&"json"==n.tot)r.push("__s(msg,'"+n.p+"', JSON.parse(Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8')))");else if("msg"==n.pt&&"msg"==n.tot)r.push("try { __s(msg,'"+n.p+"', __g(msg, '"+n.to+"')) } catch (ex) {}");else if("msg"==n.pt&&"env"==n.tot)r.push("__s(msg,'"+n.p+"', process.env['"+n.to+"'])");else{if("msg"!=n.pt||"jsonata"!=n.tot||!n.to.startsWith("/* @obfuscate-safe */"))throw"unhandlable";r.push("__s(msg,'"+n.p+"', await jsonata(Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8')).evaluate(msg) )")}}else{if("delete"!=n.t||"msg"!=n.pt)throw"unhandlable";r.push("delete msg."+n.p)}}return r.push("node.send(msg) })(msg,node);"),e.func=r.join("\n"),e}catch(e){return console.log(e),t}})}if(t.javascript){let r={},t=[];a.forEach(e=>{"javascript"!=(r[e.id]=e).format&&"function"!=e.type&&"css"!=e.format&&"json"!=e.format||t.push(e)});var e={parse:{bare_returns:!0,expression:!1},compress:{},mangle:{reserved:["$","export","require"]},output:null,sourceMap:null,nameCache:null,toplevel:!1,warnings:!1},u={compatibility:"*",level:2};$.ajax({url:"ClientCode/"+RED.nodes.id()+"/ugify",type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify({nodes:t,jscfg:e,csscfg:u}),success:function(e){e.forEach(e=>{var t=r[e.id];e._error&&console.log("ERROR NODE",e),"function"==t.type?t.func=e.func:"javascript"!=t.format&&"css"!=t.format&&"json"!=t.format||(t.template=e.template)}),obfuscateHelpers.openImportDialog(a)},error:function(e,t,r){RED.notify("ClientCode Communcation Failure: "+n.id+": "+t,{type:"error",timeout:3e3})}})}else obfuscateHelpers.openImportDialog(a)}
5
+ let obfuscateHelpers={getFlowDataFromCurrentWorkspace:e=>{var e=e||RED.workspaces.active(),t=RED.nodes.groups(e),e=(t=(t=t.concat(RED.nodes.junctions(e))).concat(RED.nodes.filterNodes({z:e})),RED.nodes.eachConfig(function(e){e.z===RED.workspaces.active()&&!1===e._def.hasUsers&&t.push(e)}),RED.nodes.workspace(e)||RED.nodes.subflow(e));return t.unshift(e),RED.nodes.createExportableNodeSet(t)},openImportDialog:e=>{RED.clipboard.import();let t=e;setTimeout(()=>{$("#red-ui-clipboard-dialog-import-text").val(JSON.stringify(t)).trigger("paste")},300)}};function obfuscatieCurrentFlow(l){let p=obfuscateHelpers.getFlowDataFromCurrentWorkspace(),f=(l.remove_groups&&(p=p.filter(e=>"group"!=e.type)).forEach(e=>{delete e.g}),{}),t={},d={},c={},s=[],h={},r={};if(p.forEach(e=>{"subflow"==(f[e.id]=e).type&&(r[e.id]=e),"junction"==e.type&&(t[e.id]=e),"link out"==e.type&&(c[e.id]=e),"link in"==e.type&&(d[e.id]=e),"link call"==e.type&&s.push(e.id),"catch"==e.type&&(h[e.id]=(e.wires||[])[0]||[])}),l.remove_junctions&&(Object.keys(t).forEach(n=>{let s=t[n];r[s.z]||p.forEach(t=>{for(let e=0;e<(t.wires||[]).length;e++){var r=t.wires[e].indexOf(n);-1<r&&(t.wires[e].splice(r,1),t.wires[e].push(...s.wires[0]))}})}),p=p.filter(e=>!("junction"==e.type&&!r[e.z]))),l.remove_linkout_nodes||l.remove_linkcall_nodes){let r=[],n=[],i=[],a=(l.remove_linkout_nodes&&!l.copy_linkin_nodes&&Object.keys(c).forEach(n=>{var e=c[n];let s=e.links||[];s.reduce((e,t)=>e&&(!!d[t]||l.ignore_off_flow_links),!0)&&"return"!=e.mode&&(r.push(n),p.forEach(r=>{for(let t=0;t<(r.wires||[]).length;t++){var e=r.wires[t].indexOf(n);-1<e&&(r.wires[t].splice(e,1),s.forEach(e=>{d[e]&&r.wires[t].push(...d[e].wires[0])}))}}))}),(s,e)=>{if(!e)return!1;let t=[],o=[],r=[];function u(e){if(r.indexOf(e.id)<0)switch(r.push(e.id),t.push(e),e.type){case"link out":if("return"!=e.mode)throw"not handable";break;case"link call":throw"unhandled";default:RED.nodes.getNodeLinks(e).forEach(function(e){u(e.target)})}}try{RED.nodes.getNodeLinks(e).forEach(function(e){u(e.target),o.push(e.target.id)});if(Object.keys(h).forEach(e=>{((t,e)=>{try{return e.map(e=>e.id).forEach(e=>{if(t.includes(e))throw"yes"}),!1}catch(e){return!0}})(h[e],t)&&t.push(f[e])}),0==t.length)return!1;let r={};var i=t[0];let n={x:s.x-i.x,y:s.y-i.y};var a=t.map(e=>{var t=structuredClone(f[e.id]);return t||console.log("WARNING: nodeid not found",[e.id,f[e.id]]),t.id=RED.nodes.id(),t.x+=n.x,t.y+=n.y,r[e.id]=t});return a.forEach(e=>{"catch"==e.type&&Array.isArray(e.scope)&&(e.scope=e.scope.map(e=>{var t=r[e];return t&&t.id||e})),e.wires&&(e.wires=e.wires.map(e=>e.map(e=>{var t=r[e];return t&&"link out"==t.type?[...s.wires[0],(t||{}).id||e]:(t||{}).id||e}).flat()))}),{nodes:a.filter(e=>"link out"!=e.type),entryNodes:o.map(e=>r[e])}}catch(e){return!1}});l.remove_linkout_nodes&&l.copy_linkin_nodes&&Object.keys(c).forEach(s=>{let o=c[s],u=o.links||[];if("return"!=o.mode){let t=u.map(e=>{var t=d[e],t=a(o,t);return t?[e,t]:[void 0,void 0]});t.reduce((e,t)=>e&&(!!t[0]||l.ignore_off_flow_links),!0)&&(r.push(s),p.forEach(n=>{for(let r=0;r<(n.wires||[]).length;r++){var e=n.wires[r].indexOf(s);-1<e&&(n.wires[r].splice(e,1),(t=u.map(e=>{var t=d[e],t=a(o,t);return t?[e,t]:[void 0,void 0]})).forEach(([,e])=>{var t;e&&(t=e.entryNodes.map(e=>e.id),n.wires[r].push(...t),i.push(...e.nodes))}))}}))}}),l.remove_linkcall_nodes&&s.forEach(s=>{var e=f[s],t=d[e.links[0]];let o=a(e,t);t&&o&&(n.push(e.id),p.forEach(t=>{for(let e=0;e<(t.wires||[]).length;e++){var r,n=t.wires[e].indexOf(s);-1<n&&(r=o.entryNodes.map(e=>e.id),t.wires[e].splice(n,1),t.wires[e].push(...r),i.push(...o.nodes))}}))}),(p=p.filter(e=>r.indexOf(e.id)<0&&n.indexOf(e.id)<0)).push(...i)}if((p=l.remove_debugs?p.filter(e=>"debug"!=e.type&&"comment"!=e.type):p).forEach(e=>{l.name&&(e.name=RED.nodes.id()),l.shrink_node&&(e.l=!1),l.info&&(e.info="",delete e.outputLabels,delete e.inputLabels),l.add_license&&(l.append_license?e.info=(e.info||"")+"\n---\n\n"+l.license_text:e.info=l.license_text),l.position&&(e.x=150,e.y=150),l.remove_icons&&delete e.icon}),l.replace_switch){let n=(t,r)=>{for(let e=0;e<r.rules.length;e++){var n=r.rules[e];if("nnull"==n.t)t.push("if ( _propValue != null ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("null"==n.t)t.push("if ( _propValue == null ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("eq"==n.t&&"str"==n.vt){s=n.v;s=btoa(encodeURIComponent(s).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}));t.push("if ( _propValue === Buffer.from('"+s+"', 'base64').toString('utf-8') ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }")}else if("gt"==n.t&&"num"==n.vt)t.push("if ( _propValue > "+n.v+" ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("eq"==n.t&&"num"==n.vt)t.push("if ( _propValue == "+n.v+" ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }");else if("empty"==n.t)t.push('let p = _propValue ; if ( (Array.isArray(p) && p.length == 0) || ((typeof p === "object") && p != null && Object.keys(p).length == 0) || ((typeof p === "string") && p.length == 0) ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }');else if("nempty"==n.t)t.push('let p = _propValue ; if ( (Array.isArray(p) && p.length > 0) || ((typeof p === "object") && p != null && Object.keys(p).length > 0) || ((typeof p === "string") && p.length > 0) ) { _returnValue.push(msg) ; return node.send(_returnValue) } else { _returnValue.push(undefined) }');else{if("else"!=n.t)throw"unhandled";t.push("_returnValue.push(msg)","return node.send(_returnValue)")}}var s};p=p.map(t=>{if("switch"!=t.type)return t;var e={id:t.id,name:t.name,type:"function",x:t.x,y:t.y,func:"",outputs:t.outputs,timeout:"",noerr:0,initialize:"",finalize:"",libs:[{var:"process",module:"process"},{var:"jsonata",module:"jsonata"}],wires:t.wires};t.hasOwnProperty("z")&&(e.z=t.z),t.hasOwnProperty("l")&&(e.l=t.l);try{var r=[];if(t.checkAll)throw"unhandled";if("msg"==t.propertyType)r.push("((msg,node) => {","let _propValue = undefined","try { _propValue = RED.util.getMessageProperty(msg, '"+t.property+"') } catch (ex) {}","let _returnValue = []"),n(r,t),r.push("})(msg,node);");else{if("jsonata"!=t.propertyType)throw"unhandled";r.push("jsonata('"+t.property+"').evaluate(msg).then(_propValue => {","let _returnValue = []"),n(r,t),r.push("})")}return e.func=r.join("\n"),e}catch(e){return t}})}if(l.replace_change){let s=e=>btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}));p=p.map(t=>{if("change"!=t.type)return t;var e={id:t.id,name:t.name,type:"function",x:t.x,y:t.y,func:"",outputs:1,timeout:"",noerr:0,initialize:"",finalize:"",libs:[{var:"process",module:"process"},{var:"jsonata",module:"jsonata"}],wires:t.wires};t.hasOwnProperty("z")&&(e.z=t.z),t.hasOwnProperty("l")&&(e.l=t.l);try{var r=["(async (msg,node) => {","let __s = RED.util.setMessageProperty","let __g = RED.util.getMessageProperty"];for(let e=0;e<t.rules.length;e++){var n=t.rules[e];if("set"==n.t){if(n.dc)throw"unhandled";if("msg"==n.pt&&"str"==n.tot)r.push("__s(msg,'"+n.p+"', Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8') )");else if("msg"==n.pt&&"bool"==n.tot)r.push("__s(msg,'"+n.p+"', "+n.to+")");else if("msg"==n.pt&&"num"==n.tot)r.push("__s(msg,'"+n.p+"', Number(Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8')))");else if("msg"==n.pt&&"json"==n.tot)r.push("__s(msg,'"+n.p+"', JSON.parse(Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8')))");else if("msg"==n.pt&&"msg"==n.tot)r.push("try { __s(msg,'"+n.p+"', __g(msg, '"+n.to+"')) } catch (ex) {}");else if("msg"==n.pt&&"env"==n.tot)r.push("__s(msg,'"+n.p+"', process.env['"+n.to+"'])");else{if("msg"!=n.pt||"jsonata"!=n.tot||!n.to.startsWith("/* @obfuscate-safe */"))throw"unhandlable";r.push("__s(msg,'"+n.p+"', await jsonata(Buffer.from('"+s(n.to)+"', 'base64').toString('utf-8')).evaluate(msg) )")}}else{if("delete"!=n.t||"msg"!=n.pt)throw"unhandlable";r.push("delete msg."+n.p)}}return r.push("node.send(msg) })(msg,node);"),e.func=r.join("\n"),e}catch(e){return console.log(e),t}})}if(l.javascript){let r={},t=[];p.forEach(e=>{"javascript"!=(r[e.id]=e).format&&"function"!=e.type&&"css"!=e.format&&"json"!=e.format||t.push(e)});var e={parse:{bare_returns:!0,expression:!1},compress:{},mangle:{reserved:["$","export","require"]},output:null,sourceMap:null,nameCache:null,toplevel:!1,warnings:!1},o={compatibility:"*",level:2};$.ajax({url:"ClientCode/"+RED.nodes.id()+"/ugify",type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify({nodes:t,jscfg:e,csscfg:o}),success:function(e){e.forEach(e=>{var t=r[e.id];e._error&&console.log("ERROR NODE",e),"function"==t.type?t.func=e.func:"javascript"!=t.format&&"css"!=t.format&&"json"!=t.format||(t.template=e.template)}),obfuscateHelpers.openImportDialog(p)},error:function(e,t,r){RED.notify("ClientCode Communcation Failure: "+n.id+": "+t,{type:"error",timeout:3e3})}})}else obfuscateHelpers.openImportDialog(p)}
6
6
 
7
7
  function setupTreelist(){var e=collectOrphans();if(0==e.length){RED.notify("No Orphans Found",{type:"warning",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var n;t.node&&(n=t.node.id,setTimeout(()=>{var e=RED.nodes.node(n);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e)),n==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var n=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),n.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),n.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectOrphans(){const t=new Set;var n=[],i=(RED.nodes.eachLink(e=>{t.add(e.source),t.add(e.target)}),RED.nodes.eachNode(e=>{t.has(e)||n.push(e)}),[]),r={};return n.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var n=t.label,n=("function"==typeof n?n.call(e):n)||"",o=e.type;if(0===o.indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:o,selected:!1,checkbox:!1},i.push(r[e.id])}),i}
8
8
 
@@ -77,6 +77,7 @@
77
77
 
78
78
  remove_linkout_nodes: $('#node-input-obfuscate-remove-linknodes').is(":checked"),
79
79
  copy_linkin_nodes: $('#node-input-obfuscate-copy-linkin-nodes').is(":checked"),
80
+ ignore_off_flow_links: $('#node-input-obfuscate-ignore-off-flow-links').is(':checked'),
80
81
  remove_linkcall_nodes: $("#node-input-obfuscate-remove-linkcall-nodes").is(":checked"),
81
82
 
82
83
  replace_switch: $('#node-input-obfuscate-replace-switch').is(":checked"),
@@ -96,6 +97,14 @@
96
97
  }
97
98
  })
98
99
 
100
+ $('#node-input-obfuscate-remove-linknodes').on('change', (e) => {
101
+ if ( $('#node-input-obfuscate-remove-linknodes').is(":checked") ) {
102
+ $('#node-input-obfuscate-coalesce-link-out-options').fadeIn(300)
103
+ } else {
104
+ $('#node-input-obfuscate-coalesce-link-out-options').fadeOut(300)
105
+ }
106
+ })
107
+
99
108
  $('#node-screenshot-capture-btn').on("click", function (e) {
100
109
  if ( e ) { e.preventDefault() }
101
110
 
@@ -251,7 +260,7 @@
251
260
  <label for="node-input-screenshot-remove-classes-and-ids" class="ml-30" style="width: 200px">
252
261
  <span>Remove Classes and Ids?</span>
253
262
  </label>
254
- <input type="checkbox" checked=checked id="node-input-screenshot-remove-classes-and-ids"
263
+ <input type="checkbox" checked="checked" id="node-input-screenshot-remove-classes-and-ids"
255
264
  style="display:inline-block; width:15px; vertical-align:baseline;">
256
265
  </div>
257
266
 
@@ -312,7 +321,7 @@
312
321
  <i class="fa fa-tag"></i>
313
322
  <span>Obfuscate Name?</span>
314
323
  </label>
315
- <input type="checkbox" checked=checked id="node-input-obfuscate-name"
324
+ <input type="checkbox" id="node-input-obfuscate-name"
316
325
  style="display:inline-block; width:15px; vertical-align:baseline;">
317
326
  </div>
318
327
 
@@ -321,7 +330,7 @@
321
330
  <i class="fa fa-map-pin"></i>
322
331
  <span>Obfuscate Position?</span>
323
332
  </label>
324
- <input type="checkbox" checked=checked id="node-input-obfuscate-position"
333
+ <input type="checkbox" id="node-input-obfuscate-position"
325
334
  style="display:inline-block; width:15px; vertical-align:baseline;">
326
335
  </div>
327
336
 
@@ -330,7 +339,7 @@
330
339
  <i class="fa fa-angle-down"></i>
331
340
  <span>Shrink Nodes?</span>
332
341
  </label>
333
- <input type="checkbox" checked=checked id="node-input-obfuscate-shrink-size"
342
+ <input type="checkbox" id="node-input-obfuscate-shrink-size"
334
343
  style="display:inline-block; width:15px; vertical-align:baseline;">
335
344
  </div>
336
345
 
@@ -339,7 +348,7 @@
339
348
  <i class="fa fa-code"></i>
340
349
  <span>Obfuscate Javascript?</span>
341
350
  </label>
342
- <input type="checkbox" checked=checked id="node-input-obfuscate-javascript"
351
+ <input type="checkbox" id="node-input-obfuscate-javascript"
343
352
  style="display:inline-block; width:15px; vertical-align:baseline;">
344
353
  </div>
345
354
 
@@ -348,7 +357,7 @@
348
357
  <i class="fa fa-adjust"></i>
349
358
  <span>Remove Icon?</span>
350
359
  </label>
351
- <input type="checkbox" checked=checked id="node-input-obfuscate-remove-icons"
360
+ <input type="checkbox" id="node-input-obfuscate-remove-icons"
352
361
  style="display:inline-block; width:15px; vertical-align:baseline;">
353
362
  </div>
354
363
 
@@ -357,7 +366,7 @@
357
366
  <i class="fa fa-info"></i>
358
367
  <span>Remove Info?</span>
359
368
  </label>
360
- <input type="checkbox" checked=checked id="node-input-obfuscate-info"
369
+ <input type="checkbox" id="node-input-obfuscate-info"
361
370
  style="display:inline-block; width:15px; vertical-align:baseline;">
362
371
  </div>
363
372
 
@@ -366,7 +375,7 @@
366
375
  <i class="fa fa-object-group"></i>
367
376
  <span>Remove Groups?</span>
368
377
  </label>
369
- <input type="checkbox" checked=checked id="node-input-obfuscate-remove-groups"
378
+ <input type="checkbox" id="node-input-obfuscate-remove-groups"
370
379
  style="display:inline-block; width:15px; vertical-align:baseline;">
371
380
  </div>
372
381
 
@@ -375,7 +384,7 @@
375
384
  <i class="fa fa-bug"></i>
376
385
  <span>Remove comment & debugs?</span>
377
386
  </label>
378
- <input type="checkbox" checked=checked id="node-input-obfuscate-remove-debugs"
387
+ <input type="checkbox" id="node-input-obfuscate-remove-debugs"
379
388
  style="display:inline-block; width:15px; vertical-align:baseline;">
380
389
  </div>
381
390
 
@@ -384,7 +393,7 @@
384
393
  <i class="fa fa-sitemap"></i>
385
394
  <span>Coalesce Junctions?</span>
386
395
  </label>
387
- <input type="checkbox" checked=checked id="node-input-obfuscate-remove-junctions"
396
+ <input type="checkbox" id="node-input-obfuscate-remove-junctions"
388
397
  style="display:inline-block; width:15px; vertical-align:baseline;">
389
398
  </div>
390
399
 
@@ -393,23 +402,31 @@
393
402
  <i class="fa fa-unlink"></i>
394
403
  <span>Coalesce Link Call Nodes?</span>
395
404
  </label>
396
- <input type="checkbox" checked=checked id="node-input-obfuscate-remove-linkcall-nodes" style="display:inline-block; width:15px; vertical-align:baseline;">
405
+ <input type="checkbox" id="node-input-obfuscate-remove-linkcall-nodes" style="display:inline-block; width:15px; vertical-align:baseline;">
397
406
  </div>
398
407
 
399
408
  <div class="form-row">
400
409
  <label for="node-input-obfuscate-remove-linknodes" class="w-30">
401
410
  <i class="fa fa-unlink"></i>
402
411
  <span>Coalesce Link Out Nodes?</span>
403
- </label>
404
- <input type="checkbox" checked=checked id="node-input-obfuscate-remove-linknodes"
412
+ </label>
413
+ <input type="checkbox" id="node-input-obfuscate-remove-linknodes"
405
414
  style="display:inline-block; width:15px; vertical-align:baseline;">
406
415
  </div>
407
416
 
408
- <div class="form-row">
409
- <label for="node-input-obfuscate-copy-linkin-nodes" class="ml-30">
410
- <span>Copy Link-In Nodes?</span>
417
+ <div id="node-input-obfuscate-coalesce-link-out-options" style="display: none;">
418
+ <div class="form-row">
419
+ <label for="node-input-obfuscate-copy-linkin-nodes" class="ml-30" style="width: 150px;">
420
+ <span>Copy Link-In Nodes?</span>
411
421
  </label>
412
- <input type="checkbox" checked=checked id="node-input-obfuscate-copy-linkin-nodes" style="display:inline-block; width:15px; vertical-align:baseline;">
422
+ <input type="checkbox" id="node-input-obfuscate-copy-linkin-nodes" style="display:inline-block; width:15px; vertical-align:baseline;">
423
+ </div>
424
+ <div class="form-row">
425
+ <label for="node-input-obfuscate-ignore-off-flow-links" class="ml-30" style="width: 150px;">
426
+ <span>Ignore off-flow links?</span>
427
+ </label>
428
+ <input type="checkbox" id="node-input-obfuscate-ignore-off-flow-links" style="display:inline-block; width:15px; vertical-align:baseline;">
429
+ </div>
413
430
  </div>
414
431
 
415
432
  <div class="form-row">
@@ -423,7 +440,7 @@
423
440
  <label for="node-input-obfuscate-replace-switch" class="ml-30">
424
441
  <span>Switch</span>
425
442
  </label>
426
- <input type="checkbox" checked=checked id="node-input-obfuscate-replace-switch"
443
+ <input type="checkbox" id="node-input-obfuscate-replace-switch"
427
444
  style="display:inline-block; width:15px; vertical-align:baseline;">
428
445
  </div>
429
446
 
@@ -431,7 +448,7 @@
431
448
  <label for="node-input-obfuscate-replace-change" class="ml-30">
432
449
  <span>Change</span>
433
450
  </label>
434
- <input type="checkbox" checked=checked id="node-input-obfuscate-replace-change"
451
+ <input type="checkbox" id="node-input-obfuscate-replace-change"
435
452
  style="display:inline-block; width:15px; vertical-align:baseline;">
436
453
  </div>
437
454
 
@@ -443,12 +460,16 @@
443
460
  <input type="checkbox" id="node-input-obfuscate-add-license-text" style="display:inline-block; width:15px; vertical-align:baseline;">
444
461
  </div>
445
462
 
446
- <div id="node-input-obfuscate-add-license-text-row" class="form-row" style="margin-left: 10px; display: none;">
447
- <label for="node-input-obfuscate-append-license-text">
448
- <span>Append to info?</span>
449
- </label>
450
- <input type="checkbox" id="node-input-obfuscate-append-license-text" style="display:inline-block; width:15px; vertical-align:baseline;">
451
- <textarea id="node-input-obfuscate-license-text" placeholder="License Text"></textarea>
463
+ <div id="node-input-obfuscate-add-license-text-row" style="display: none;">
464
+ <div class="form-row ml-30">
465
+ <label for="node-input-obfuscate-append-license-text" style="width: 150px">
466
+ <span>Append to info?</span>
467
+ </label>
468
+ <input type="checkbox" id="node-input-obfuscate-append-license-text" style="display:inline-block; width:15px; vertical-align:baseline;">
469
+ </div>
470
+ <div class="form-row ml-30">
471
+ <textarea id="node-input-obfuscate-license-text" placeholder="License Text"></textarea>
472
+ </div>
452
473
  </div>
453
474
 
454
475
  <div class="form-row">