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ons/loader/index.js","webpack://learndash-reports-by-wisdmlabs/./includes/blocks/src/pending-assignments/index.scss?58db","webpack://learndash-reports-by-wisdmlabs/external window \"React\"","webpack://learndash-reports-by-wisdmlabs/external window \"moment\"","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/pending-assignments/index-pending-assignments.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { __ } from '@wordpress/i18n';\n\nclass WisdmLoader extends React.Component {\n\n render() {\n let loadingData = '';\n loadingData =
\n
\n
\n \n \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[\"moment\"];","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';\nimport React, { Component } from \"react\";\nimport WisdmLoader from '../commons/loader/index.js';\nimport { __ } from '@wordpress/i18n';\nimport moment from 'moment';\nvar ld_api_settings = wisdm_learndash_reports_front_end_script_pending_assignments.ld_api_settings;\n\nclass PendingAssignments extends Component {\n constructor(props) {\n super(props);\n \n this.state = {\n isLoaded: false,\n error: null,\n start_date:null,\n end_date:null,\n lock_icon:'',\n start_date:moment(new Date(wisdm_ld_reports_common_script_data.start_date)).unix(),\n end_date:moment(new Date(wisdm_ld_reports_common_script_data.end_date)).unix(),\n upgrade_class:'wisdm-class'\n };\n\n this.durationUpdated = this.durationUpdated.bind(this);\n this.updateBlock = this.updateBlock.bind(this);\n }\n \n durationUpdated(event) {\n this.setState({start_date:event.detail.startDate, end_date:event.detail.endDate});\n if (wisdm_learndash_reports_front_end_script_pending_assignments.is_pro_version_active) {\n this.updateBlock();\n }\n }\n\n componentDidMount() { \n this.updateBlock(); \n }\n\n updateBlock() {\n if (undefined==ld_api_settings['sfwd-assignment']) {\n ld_api_settings['sfwd-assignment'] = 'sfwd-assignment';\n }\n wp.apiFetch({\n path: '/rp/v1/pending-assignments?start_date=' + this.state.start_date + '&&end_date=' + this.state.end_date\n }).then(response => {\n if (true!=wisdm_learndash_reports_front_end_script_pending_assignments.is_pro_version_active) {\n let lock_icon = \n let hideChange = '';\n this.setState(\n {\n graphData: {\n pendingAssignments: '??',\n percentChange:'--' + '%',\n chnageDirectionClass:'udup',\n percentValueClass:'change-value',\n hideChange: hideChange\n },\n upgrade_class: 'wisdm-upgrade-to-pro',\n isLoaded: true,\n lock_icon:lock_icon,\n\n });\n }\n else {\n let pendingAssignments = response.pendingAssignments\n let percentChange = 0;\n let chnageDirectionClass = 'udup';\n let percentValueClass = 'change-value';\n let hideChange = '';\n let udtxt = '';\n let udsrc = '';\n if (0percentChange) {\n chnageDirectionClass = 'uddown'\n percentValueClass = 'change-value-negative';\n udtxt = __('Down', 'learndash-reports-by-wisdmlabs');\n udsrc = wisdm_learndash_reports_front_end_script_total_revenue_earned.plugin_asset_url + '/images/down.png';\n } else if( 0 == percentChange ){\n hideChange = 'wrld-hidden';\n udtxt = __('Up', 'learndash-reports-by-wisdmlabs');\n udsrc = wisdm_learndash_reports_front_end_script_total_revenue_earned.plugin_asset_url + '/images/up.png';\n }\n this.setState(\n {\n isLoaded: true,\n graphData: {\n pendingAssignments: pendingAssignments,\n percentChange:percentChange + '%',\n chnageDirectionClass:chnageDirectionClass,\n percentValueClass:percentValueClass,\n hideChange: hideChange,\n udtxt: udtxt,\n udsrc: udsrc\n },\n });\n }\n }).catch((error) => {\n this.setState({\n error:error,\n graph_summary:[],\n series:[],\n isLoaded: true,\n });\n });\n }\n \n render() {\n let body =
;\n if (!this.state.isLoaded) {\n // yet loading\n body = \n } else if (this.state.error) {\n // error\n body =
\n
{this.state.error.message}
\n
;\n } else {\n let upgrade_notice = '';\n if ( true==wisdm_learndash_reports_front_end_script_pending_assignments.is_admin_user ) {\n upgrade_notice = \n
\n {__('Available in PRO version')}\n \n
\n
;\n }\n body =\n
\n {this.state.lock_icon} \n
\n
\n \n \n
\n
\n
\n {__('Assignments Pending', 'learndash-reports-by-wisdmlabs')}\n
\n
\n {this.state.graphData.pendingAssignments}\n
\n
\n \n \n \n {this.state.graphData.percentChange}\n {this.state.graphData.udtxt}\n
\n
\n
\n {upgrade_notice}\n
;\n }\n return (body);\n }\n }\n\nexport default PendingAssignments;\n\ndocument.addEventListener(\"DOMContentLoaded\", function(event) {\n let elem = document.getElementsByClassName('wisdm-learndash-reports-pending-assignments front');\n if (elem.length>0) {\n ReactDOM.render(React.createElement(PendingAssignments), elem[0]); \n }\n});\n\n"],"names":["React","Component","__","WisdmLoader","render","loadingData","wisdm_learndash_reports_front_end_script_total_revenue_earned","plugin_asset_url","moment","ld_api_settings","wisdm_learndash_reports_front_end_script_pending_assignments","PendingAssignments","constructor","props","state","isLoaded","error","start_date","end_date","lock_icon","Date","wisdm_ld_reports_common_script_data","unix","upgrade_class","durationUpdated","bind","updateBlock","event","setState","detail","startDate","endDate","is_pro_version_active","componentDidMount","undefined","wp","apiFetch","path","then","response","hideChange","graphData","pendingAssignments","percentChange","chnageDirectionClass","percentValueClass","udtxt","udsrc","catch","graph_summary","series","body","message","upgrade_notice","is_admin_user","upgrade_link","document","addEventListener","elem","getElementsByClassName","length","ReactDOM","createElement"],"sourceRoot":""}