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S,EAAC;MAAW,GACxBD,iEAAA;QACE2B,GAAG,EAAC,EAAE;QACNxB,GAAG,EAAE,IAAI,CAACgB,KAAK,CAACE,SAAU;QAC1BO,MAAM,EAAE,IAAI,CAACT,KAAK,CAACE,SAAU;QAC7BpB,SAAS,EAAC,wBAAwB;QAClC4B,MAAM,EAAC,IAAI;QACXC,KAAK,EAAC,IAAI;QACVC,OAAO,EAAC,MAAM;QACdC,QAAQ,EAAC;MAAO,EAChB,CACE,EACNhC,iEAAA;QAAKC,SAAS,EAAC;MAAa,GAC1BD,iEAAA;QAAKC,SAAS,EAAC;MAAc,GAC3BD,iEAAA,eAAM,cAAY,CAAO,CACrB,EACNA,iEAAA;QAAKC,SAAS,EAAC;MAAM,GACnBD,iEAAA,eAAO,IAAI,CAACmB,KAAK,CAACG,QAAQ,CAAQ,CAC9B,CACF,CAET;IACH;IAEA,OAAOI,IAAI;EACb;AACF;AAEA,+DAAepB,cAAc,EAAC;AAE9B2B,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,UAAUC,KAAK,EAAE;EAC7D,IAAIC,IAAI,GAAGH,QAAQ,CAACI,sBAAsB,CACxC,+CAA+C,CAChD;EACD,IAAID,IAAI,CAACE,MAAM,GAAG,CAAC,EAAE;IACnBC,QAAQ,CAAC3C,MAAM,CAACN,0DAAmB,CAACgB,cAAc,CAAC,EAAE8B,IAAI,CAAC,CAAC,CAAC,CAAC;EAC/D;AACF,CAAC,CAAC,C","sources":["webpack://learndash-reports-by-wisdmlabs/./includes/blocks/src/commons/loader/index.js","webpack://learndash-reports-by-wisdmlabs/./includes/blocks/src/student-profile/index.scss?1168","webpack://learndash-reports-by-wisdmlabs/external window \"React\"","webpack://learndash-reports-by-wisdmlabs/external window [\"wp\",\"element\"]","webpack://learndash-reports-by-wisdmlabs/external window [\"wp\",\"i18n\"]","webpack://learndash-reports-by-wisdmlabs/webpack/bootstrap","webpack://learndash-reports-by-wisdmlabs/webpack/runtime/compat get default export","webpack://learndash-reports-by-wisdmlabs/webpack/runtime/define property getters","webpack://learndash-reports-by-wisdmlabs/webpack/runtime/hasOwnProperty shorthand","webpack://learndash-reports-by-wisdmlabs/webpack/runtime/make namespace object","webpack://learndash-reports-by-wisdmlabs/./includes/blocks/src/student-profile/index-student-profile.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { __ } from '@wordpress/i18n';\n\nclass WisdmLoader extends React.Component {\n\n constructor(props) {\n super(props);\n }\n\n render() {\n let loadingData = '';\n let show_text = '';\n if ( true == this.props.text ) {\n show_text = {__( 'Your report is being generated.', 'learndash-reports-by-wisdmlabs' )};\n }\n loadingData =
\n
\n
\n \n \n {show_text}\n
\n
\n
;\n return loadingData;\n }\n }\n\n export default WisdmLoader;\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import \"./index.scss\";\n\nimport WisdmLoader from \"../commons/loader/index.js\";\nimport React, { Component } from \"react\";\nimport { __ } from \"@wordpress/i18n\";\n\nclass StudentProfile extends Component {\n constructor(props) {\n super(props);\n let error = null;\n let avatar = this.getUserType() ? \"www.gravatar.com/avatar/789047b2eb7fd33f3fb6858358dcc5d8?s=150&r=g&d=mm\" : wisdm_learndash_reports_front_end_script_student_table.avatar_url;\n console.log(avatar);\n let username = this.getUserType() ? \"No Name\" : wisdm_learndash_reports_front_end_script_student_table.current_user.data.display_name;\n if (this.getUserType()) {\n error = {\n message: __(\n \"Sorry you are not allowed to access this block, please check if you have proper access permissions\",\n \"learndash-reports-by-wisdmlabs\"\n ),\n };\n }\n this.state = {\n isLoaded: true,\n userImage : avatar,\n userName : username,\n error: error,\n };\n }\n\n /**\n * Based on the current user roles aray this function desides wether a user is a group\n * leader or an Administrator and returns the same.\n */\n getUserType() {\n if(wisdm_learndash_reports_front_end_script_student_table.current_user.ID == 0){\n return true;\n }\n return false;\n }\n\n componentDidMount() {\n \n }\n\n componentDidUpdate() {\n }\n\n render() {\n let body =
;\n\n if (this.state.error) {\n // error\n body = '';\n } else if (!this.state.isLoaded) {\n // yet loading\n body = ;\n } else {\n body = (\n
\n
\n \n
\n
\n
\n Student Name\n
\n
\n {this.state.userName}\n
\n
\n
\n );\n }\n\n return body;\n }\n}\n\nexport default StudentProfile;\n\ndocument.addEventListener(\"DOMContentLoaded\", function (event) {\n let elem = document.getElementsByClassName(\n \"wisdm-learndash-reports-student-profile front\"\n );\n if (elem.length > 0) {\n ReactDOM.render(React.createElement(StudentProfile), elem[0]);\n }\n});\n"],"names":["React","Component","__","WisdmLoader","constructor","props","render","loadingData","show_text","text","createElement","className","class","src","wisdm_learndash_reports_front_end_script_total_revenue_earned","plugin_asset_url","StudentProfile","error","avatar","getUserType","wisdm_learndash_reports_front_end_script_student_table","avatar_url","console","log","username","current_user","data","display_name","message","state","isLoaded","userImage","userName","ID","componentDidMount","componentDidUpdate","body","alt","srcSet","height","width","loading","decoding","document","addEventListener","event","elem","getElementsByClassName","length","ReactDOM"],"sourceRoot":""}