moodle_local_treestudyplan/amd/build/util/premium.min.js.map

1 line
1.4 KiB
Plaintext
Raw Normal View History

2024-06-03 23:24:16 +02:00
{"version":3,"file":"premium.min.js","sources":["../../src/util/premium.js"],"sourcesContent":["/* eslint no-var: \"error\" */\n/* eslint-env es6*/\n\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\n\n// Prepare default value.\nlet premiumstatusCache = null;\n\n/**\n * Check if premium status is enabled.\n * @returns {Bool} True/False\n */\nexport function premiumenabled() {\n const premium = premiumstatus();\n if (premium) {\n return (premium.enabled) ? true : false;\n } else {\n return true; // Temporarily return true, that is easier than going full async.\n }\n}\n\n/**\n * Get premium status object\n * @returns {Object} The premium status object\n */\nfunction premiumstatus() {\n if (!premiumstatusCache) {\n // Retrieve premium status if needed.\n call([{\n methodname: 'local_treestudyplan_premiumstatus',\n args: {}\n }])[0].then((response) => {\n premiumstatusCache = response;\n return;\n }).catch(notification.exception);\n }\n return premiumstatusCache;\n}\n\n// Preload premium status.\npremiumstatus();"],"names":["premium","premiumstatus","enabled","premiumstatusCache","methodname","args","then","response","catch","notification","exception"],"mappings":"uOAcUA,QAAUC,uBACZD,WACQA,QAAQE,iFATpBC,mBAAqB,cAmBhBF,uBACAE,mCAEI,CAAC,CACFC,WAAY,oCACZC,KAAM,MACN,GAAGC,MAAMC,WACTJ,mBAAqBI,YAEtBC,MAAMC,sBAAaC,WAEnBP,mBAIXF"}