{"version":3,"file":"a4istaff_badge.min.js","sources":["https:\/\/moodle.develop-modular.com\/siemens\/theme\/siemens\/amd\/src\/a4istaff_badge.js"],"sourcesContent":["\/**\n * @package theme_siemens\n * @subpackage amd\n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\ndefine(['jquery'], function($) {\n return {\n init: function(personnelArray) {\n \/\/ CORRECT CHECK: Skip if on the settings page\n if ($('#page-admin-setting-themesettingsiemens').length) {\n return;\n }\n\n personnelArray.forEach(function(person) {\n \/\/ TARGET SAFELY: Avoid form elements and scripts\n $('body').find('*:not(input, textarea, script, style)').contents().filter(function() {\n return this.nodeType === 3 && $.trim(this.nodeValue).length > 0;\n }).each(function() {\n const $node = $(this);\n const text = $node.text();\n const regex = new RegExp('\\\\b' + person + '\\\\b', 'g');\n if (regex.test(text)) {\n \/\/ SAFE REPLACEMENT: Preserve DOM structure\n const newText = text.replace(regex, person + ' \"A4I');\n $node.replaceWith($('').html(newText));\n }\n });\n });\n }\n };\n});\n\n\n\n"],"names":["define","$","init","personnelArray","length","forEach","person","find","contents","filter","this","nodeType","trim","nodeValue","each","$node","text","regex","RegExp","test","newText","replace","M","cfg","wwwroot","replaceWith","html"],"mappings":";;;;;AAKAA,sCAAO,CAAC,WAAW,SAASC,SACjB,CACHC,KAAM,SAASC,gBAEPF,EAAE,2CAA2CG,QAIjDD,eAAeE,SAAQ,SAASC,QAE5BL,EAAE,QAAQM,KAAK,yCAAyCC,WAAWC,QAAO,kBAC7C,IAAlBC,KAAKC,UAAkBV,EAAEW,KAAKF,KAAKG,WAAWT,OAAS,KAC\/DU,MAAK,iBACEC,MAAQd,EAAES,MACVM,KAAOD,MAAMC,OACbC,MAAQ,IAAIC,OAAO,MAAQZ,OAAS,MAAO,QAC7CW,MAAME,KAAKH,MAAO,OAEZI,QAAUJ,KAAKK,QAAQJ,MAAOX,OAAS,cAAgBgB,EAAEC,IAAIC,QAAU,yEAC7ET,MAAMU,YAAYxB,EAAE,UAAUyB,KAAKN"}