{"version":3,"file":"script.min.js","sources":["https:\/\/www.virtual.facen.una.py\/gradofacen\/local\/accessibility\/widgets\/fontkerning\/amd\/src\/script.js"],"sourcesContent":["\/\/ This file is part of Moodle - https:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\n\/**\n * Font face widget JS\n *\n * @module accessibility\/fontferning\n * @copyright 2024 Ponlawat Weerapanpisit \n * @license https:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\nimport $ from 'jquery';\nimport { saveWidgetConfig } from 'local_accessibility\/common';\n\n\/**\n * Initialisation\n *\n * @param {string|number|undefined} data\n *\/\nexport const init = (data) => {\n $(() => {\n const $body = $('body');\n const $container = $('#accessibility_fontkerning-container');\n if (!$container.length) {\n return;\n }\n const $btn = $container.find('.btn-toggler');\n if (!$btn.length) {\n return;\n }\n\n let userdata = data;\n\n const updatebtn = () => {\n $btn.html(userdata ? M.str.accessibility_fontkerning.turnonkerning : M.str.accessibility_fontkerning.turnoffkerning);\n };\n updatebtn();\n\n $btn.on('click', async() => {\n userdata = userdata ? undefined : 1;\n if (userdata) {\n $body.addClass('accessibility-fontkerning-none');\n } else {\n $body.removeClass('accessibility-fontkerning-none');\n }\n updatebtn();\n await saveWidgetConfig('fontkerning', userdata);\n });\n });\n};\n"],"names":["e","_jquery","__esModule","default","_exports","init","data","$","$body","$container","length","$btn","find","userdata","updatebtn","html","M","str","accessibility_fontkerning","turnonkerning","turnoffkerning","on","async","undefined","addClass","removeClass","saveWidgetConfig"],"mappings":"gIAuBuB,IAAAA;;;;;;;kFAAvBC,SAAuBD,EAAvBC,UAAuBD,EAAAE,WAAAF,EAAAG,CAAAA,QAAAH,GAsCrBI,SAAAC,KA9BmBC,QACjB,EAAAC,QAAAA,UAAE,KACE,MAAMC,OAAQ,EAAAD,QAACJ,SAAC,QACVM,YAAa,EAAAF,QAACJ,SAAC,wCACrB,IAAKM,WAAWC,OACZ,OAEJ,MAAMC,KAAOF,WAAWG,KAAK,gBAC7B,IAAKD,KAAKD,OACN,OAGJ,IAAIG,SAAWP,KAEf,MAAMQ,UAAYA,KACdH,KAAKI,KAAKF,SAAWG,EAAEC,IAAIC,0BAA0BC,cAAgBH,EAAEC,IAAIC,0BAA0BE,eAAe,EAExHN,YAEAH,KAAKU,GAAG,SAASC,UACbT,SAAWA,cAAWU,EAAY,EAC9BV,SACAL,MAAMgB,SAAS,kCAEfhB,MAAMiB,YAAY,kCAEtBX,kBACM,EAAAY,QAAgBA,kBAAC,cAAeb,SAAS,GACjD,GACJ,CACJ"}