(self["webpackChunk"] = self["webpackChunk"] || []).push([["/js/quiz"],{ /***/ "./resources/js/axios/axiosClient.js": /*!*******************************************!*\ !*** ./resources/js/axios/axiosClient.js ***! \*******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getRequest": () => (/* binding */ getRequest), /* harmony export */ "postRequest": () => (/* binding */ postRequest), /* harmony export */ "patchRequest": () => (/* binding */ patchRequest), /* harmony export */ "deleteRequest": () => (/* binding */ deleteRequest) /* harmony export */ }); /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__); var axiosClient = axios__WEBPACK_IMPORTED_MODULE_0___default().create(); if (true) axiosClient.defaults.baseURL = 'https://wiser.my/';else {} axiosClient.defaults.headers = { 'Content-Type': 'application/json', Accept: 'application/json', 'Access-Control-Allow-Origin': '*', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content') }; //All request will wait 2 seconds before timeout axiosClient.defaults.timeout = 30000; axiosClient.defaults.withCredentials = true; function getRequest(URL) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (params == null) { return axiosClient.get(URL).then(function (response) { return response; }); } else { return axiosClient.get(URL, { params: params }).then(function (response) { return response; }); } } function postRequest(URL, payload) { return axiosClient.post(URL, payload).then(function (response) { return response; }); } function patchRequest(URL, payload) { return axiosClient.patch(URL, payload).then(function (response) { return response; }); } function deleteRequest(URL) { return axiosClient["delete"](URL).then(function (response) { return response; }); } /***/ }), /***/ "./resources/js/bootstrap.js": /*!***********************************!*\ !*** ./resources/js/bootstrap.js ***! \***********************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); /** * We'll load the axios HTTP library which allows us to easily issue requests * to our Laravel back-end. This library automatically handles sending the * CSRF token as a header based on the value of the "XSRF" token cookie. */ window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting * allows your team to easily build robust real-time web applications. */ // import Echo from 'laravel-echo'; // window.Pusher = require('pusher-js'); // window.Echo = new Echo({ // broadcaster: 'pusher', // key: process.env.MIX_PUSHER_APP_KEY, // cluster: process.env.MIX_PUSHER_APP_CLUSTER, // forceTLS: true // }); /***/ }), /***/ "./resources/js/generic/LoadingComponent.js": /*!**************************************************!*\ !*** ./resources/js/generic/LoadingComponent.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var _axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../axios/axiosClient */ "./resources/js/axios/axiosClient.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var LoadingComponent = /*#__PURE__*/function (_React$Component) { _inherits(LoadingComponent, _React$Component); var _super = _createSuper(LoadingComponent); function LoadingComponent(props) { _classCallCheck(this, LoadingComponent); return _super.call(this, props); } _createClass(LoadingComponent, [{ key: "render", value: function render() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("center", { style: { verticalAlign: 'middle', transform: "translateY(30%)" }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", { style: { textAlign: "center" }, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", { style: { width: 80 }, src: "https://wiser.my" + "/images/loading.gif" }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", { children: this.props.message })] }) }); } }]); return LoadingComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadingComponent); ; /***/ }), /***/ "./resources/js/quiz.js": /*!******************************!*\ !*** ./resources/js/quiz.js ***! \******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var _quiz_QuizWelcomeComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quiz/QuizWelcomeComponent */ "./resources/js/quiz/QuizWelcomeComponent.js"); /* harmony import */ var _quiz_QuizGameComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./quiz/QuizGameComponent */ "./resources/js/quiz/QuizGameComponent.js"); /* harmony import */ var _quiz_QuizSummaryComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./quiz/QuizSummaryComponent */ "./resources/js/quiz/QuizSummaryComponent.js"); /* harmony import */ var antd_dist_antd_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/dist/antd.css */ "./node_modules/antd/dist/antd.css"); /* harmony import */ var _quiz_quiz_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quiz/quiz.css */ "./resources/js/quiz/quiz.css"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js"); var WrapperComponent = function WrapperComponent(props) { // const navigate = useNavigate(); return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Main, {}); }; var Main = /*#__PURE__*/function (_React$Component) { _inherits(Main, _React$Component); var _super = _createSuper(Main); function Main(props) { var _this; _classCallCheck(this, Main); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { game_started: false, game_ended: false, play_sound: false }); _defineProperty(_assertThisInitialized(_this), "startGame", function () { _this.setState({ game_started: true }); }); _defineProperty(_assertThisInitialized(_this), "endGame", function (playSound) { _this.setState({ game_ended: true, play_sound: playSound }); }); return _this; } _createClass(Main, [{ key: "componentDidMount", value: function componentDidMount() {} }, { key: "render", value: function render() { var pathName = window.location.pathname.endsWith('/') ? window.location.pathname.slice(0, -1) : window.location.pathname; var fullUrl = window.location.href; return this.state.game_ended == false ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", { className: 'quiz-slider ' + (this.state.game_started ? 'show-game' : ''), children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_quiz_QuizWelcomeComponent__WEBPACK_IMPORTED_MODULE_2__["default"], { fullUrl: fullUrl, postName: pathName, startGame: this.startGame, endGame: this.endGame }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_quiz_QuizGameComponent__WEBPACK_IMPORTED_MODULE_3__["default"], { gameStarted: this.state.game_started, postName: pathName, endGame: this.endGame })] }) }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_quiz_QuizSummaryComponent__WEBPACK_IMPORTED_MODULE_4__["default"], { playSound: this.state.play_sound, postName: pathName }); } }]); return Main; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Main); if (document.getElementById('game-container')) { react_dom__WEBPACK_IMPORTED_MODULE_1__.render( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(WrapperComponent, {}), document.getElementById('game-container')); } ; /***/ }), /***/ "./resources/js/quiz/QuizAnswerButtonComponent.js": /*!********************************************************!*\ !*** ./resources/js/quiz/QuizAnswerButtonComponent.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/button/index.js"); /* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ant-design/icons */ "./node_modules/@ant-design/icons/es/icons/SyncOutlined.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var QuizAnswerButtonComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizAnswerButtonComponent, _React$Component); var _super = _createSuper(QuizAnswerButtonComponent); function QuizAnswerButtonComponent(props) { var _this; _classCallCheck(this, QuizAnswerButtonComponent); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { selected: false }); _defineProperty(_assertThisInitialized(_this), "handleClick", function (questionId, answer) { if (_this.state.selected != true) { _this.props.onSelected(questionId, answer); _this.setState({ selected: true }, function () { setTimeout(function () { _this.props.onNext(); }, 500); }); } }); return _this; } _createClass(QuizAnswerButtonComponent, [{ key: "render", value: function render() { var _this2 = this; return this.state.selected == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_3__["default"], { disabled: this.props.disable, className: "answer-button answer-active", type: "default", shape: "round", size: "large", children: [this.props.answer.answer, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_4__["default"], { spin: true })] }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_3__["default"], { disabled: this.props.disable, className: "answer-button", onClick: function onClick() { return _this2.handleClick(_this2.props.questionId, _this2.props.answer.answer); }, type: "default", shape: "round", size: "large", children: this.props.answer.answer }); } }]); return QuizAnswerButtonComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizAnswerButtonComponent); /***/ }), /***/ "./resources/js/quiz/QuizGameComponent.js": /*!************************************************!*\ !*** ./resources/js/quiz/QuizGameComponent.js ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/typography/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/card/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/statistic/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/avatar/index.js"); /* harmony import */ var _axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../axios/axiosClient */ "./resources/js/axios/axiosClient.js"); /* harmony import */ var howler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! howler */ "./node_modules/howler/dist/howler.js"); /* harmony import */ var howler__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(howler__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _QuizAnswerButtonComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./QuizAnswerButtonComponent */ "./resources/js/quiz/QuizAnswerButtonComponent.js"); /* harmony import */ var _generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../generic/LoadingComponent */ "./resources/js/generic/LoadingComponent.js"); /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js"); /* harmony import */ var react_animations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-animations */ "./node_modules/react-animations/lib/index.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } var _templateObject, _templateObject2; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var Title = antd__WEBPACK_IMPORTED_MODULE_3__["default"].Title; var Meta = antd__WEBPACK_IMPORTED_MODULE_4__["default"].Meta; var Countdown = antd__WEBPACK_IMPORTED_MODULE_5__["default"].Countdown; var PulseAnimation = (0,styled_components__WEBPACK_IMPORTED_MODULE_11__.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["", ""])), react_animations__WEBPACK_IMPORTED_MODULE_9__.pulse); var pulseTime = 1; var PulseDiv = styled_components__WEBPACK_IMPORTED_MODULE_11__["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n animation: infinite ", "s ", ";\n"])), pulseTime, PulseAnimation); var nextSound = new howler__WEBPACK_IMPORTED_MODULE_6__.Howl({ src: ["https://wiser.my" + '/next.mp3'], volume: 1 }); var startSound = new howler__WEBPACK_IMPORTED_MODULE_6__.Howl({ src: ["https://wiser.my" + '/start.mp3'] }); var endingSound = new howler__WEBPACK_IMPORTED_MODULE_6__.Howl({ src: ["https://wiser.my" + '/ending.mp3'], volume: 1, onend: function onend() { tickingSound.unload(); } }); var tickingSound = new howler__WEBPACK_IMPORTED_MODULE_6__.Howl({ src: ["https://wiser.my" + '/ticking.mp3'], sprite: { tick: [0, 37000] }, loop: true, volume: 0.3 }); var QuizGameComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizGameComponent, _React$Component); var _super = _createSuper(QuizGameComponent); function QuizGameComponent(props) { var _this; _classCallCheck(this, QuizGameComponent); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { initLoading: true, loading: false, data: [], game_started: null, questionIndex: 0, game_finished: false, currentTime: null, endingIn12Seconds: false, answerSelected: false, choosenAnswers: [], sendingAnswerToServer: false }); _defineProperty(_assertThisInitialized(_this), "answerSelected", function (questionId, answer) { var items = _toConsumableArray(_this.state.choosenAnswers); items.push({ questionId: questionId, answer: answer }); _this.setState({ answerSelected: true, choosenAnswers: items }); }); _defineProperty(_assertThisInitialized(_this), "endGame", function (systemClosed) { // send the data to server _this.setState({ game_finished: true }, function () { nextSound.unload(); startSound.unload(); endingSound.unload(); tickingSound.unload(); var time = Date.now() - _this.state.currentTime; if (systemClosed) { time = _this.state.data.game.time_constraint_seconds * 1000; } _this.setState({ sendingAnswerToServer: true }); (0,_axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__.postRequest)('/game' + _this.props.postName + "/end", { answers: _this.state.choosenAnswers, time: time, game_id: _this.state.data.game.id, 'hash': _this.state.data.hash }).then(function (response) { _this.setState({ initLoading: false }, function () { _this.props.endGame(true); }); }); }); }); _defineProperty(_assertThisInitialized(_this), "nextQuestion", function () { if (_this.state.data.game.questions.length - 1 == _this.state.questionIndex) { _this.endGame(false); } else { // continue to next question nextSound.play(); _this.setState({ questionIndex: _this.state.questionIndex + 1, answerSelected: false }); } }); return _this; } _createClass(QuizGameComponent, [{ key: "componentDidMount", value: function componentDidMount() { this.setState({ game_started: this.props.gameStarted }); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this2 = this; if (this.props.gameStarted != this.state.game_started) { this.setState({ game_started: this.props.gameStarted }, function () { if (_this2.state.game_started) { _this2.fetchData(); } }); } } }, { key: "fetchData", value: function fetchData() { var _this3 = this; (0,_axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__.getRequest)('/game' + this.props.postName + "/start").then(function (response) { _this3.setState({ initLoading: false, data: response.data.data, currentTime: Date.now() }, function () { startSound.play(); tickingSound.play('tick'); setTimeout(function () { _this3.endGame(true); }, _this3.state.data.game.time_constraint_seconds * 1000); setTimeout(function () { tickingSound.volume(0.1); endingSound.play(); }, _this3.state.data.game.time_constraint_seconds * 1000 - 12 * 1000); }); }); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { nextSound.unload(); startSound.unload(); endingSound.unload(); tickingSound.unload(); } }, { key: "render", value: function render() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { children: this.state.data.eligible == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { className: "quiz", cover: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { style: { width: "100%", height: 200, backgroundImage: "url('" + this.state.data.game.featured_image + "')", backgroundRepeat: "no-repeat", filter: "blur(2px)", backgroundSize: "100% 100%" } }), this.state.game_started == true ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(Title, { style: { display: "block", top: 0, color: "#fff", position: "absolute", textAlign: "center", background: "#000", opacity: 0.8, padding: 10 }, level: 4, children: ["Kuiz: ", this.state.data.game.title] }, "0"), this.state.sendingAnswerToServer == false ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(PulseDiv, { style: { display: "block", top: 88, position: "absolute" }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Countdown, { className: "dummy-countdown", style: { textAlign: "center", fontWeight: 800, fontSize: 30 }, value: this.state.currentTime + this.state.data.game.time_constraint_seconds * 1000, format: "mm:ss" }) }, "1-0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Countdown, { style: { textAlign: "center", fontWeight: 800, fontSize: 30, display: "block", top: 88, position: "absolute" }, value: this.state.currentTime + 1 + this.state.data.game.time_constraint_seconds * 1000, format: "mm:ss" }, "1-1")] : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { style: { display: "block", top: 88, position: "absolute" }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_8__["default"], { message: "Sila tunggu..." }) }, "1")] : null] }), children: this.state.game_finished != true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Meta, { title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { className: "cirle-question-counter", children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__["default"], { size: 90, style: { backgroundColor: '#fff', fontSize: 28, color: "#333", border: "1px solid #ababab", boxShadow: "0 4px 30px rgb(0 0 0 / 10%)", marginBottom: 20 }, children: [this.state.questionIndex + 1, "/", this.state.data.game.questions.length] }) }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Title, { style: { textAlign: "center", paddingTop: 20, paddingBottom: 20, background: "#d5e4ff", borderRadius: 10, paddingLeft: 10, paddingRight: 10 }, level: 4, children: this.state.data.game.questions[this.state.questionIndex].question })] }), description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: this.state.data.game.questions[this.state.questionIndex].answers.map(function (answer, index) { var _this4 = this; return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_QuizAnswerButtonComponent__WEBPACK_IMPORTED_MODULE_7__["default"], { disable: this.state.answerSelected, questionId: this.state.data.game.questions[this.state.questionIndex].id, answer: answer, onSelected: function onSelected(a, b) { _this4.answerSelected(a, b); }, onNext: function onNext() { _this4.nextQuestion(); } }, this.state.data.game.questions[this.state.questionIndex].id + '_' + answer.answer); }, this) }) }) : null }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { style: { margin: "20px 0", marginBottom: 20, padding: "30px 50px", textAlign: "center" }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_8__["default"], { message: "Sedang memuat turun soalan..." }) }) }); } }]); return QuizGameComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizGameComponent); ; /***/ }), /***/ "./resources/js/quiz/QuizHallOfFameComponent.js": /*!******************************************************!*\ !*** ./resources/js/quiz/QuizHallOfFameComponent.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/typography/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/popover/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/badge/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/avatar/index.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var Title = antd__WEBPACK_IMPORTED_MODULE_3__["default"].Title; var QuizHallOfFameComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizHallOfFameComponent, _React$Component); var _super = _createSuper(QuizHallOfFameComponent); function QuizHallOfFameComponent(props) { _classCallCheck(this, QuizHallOfFameComponent); return _super.call(this, props); } _createClass(QuizHallOfFameComponent, [{ key: "render", value: function render() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { style: { backgroundColor: "rgb(239 239 239)", padding: 20, borderRadius: 20, textAlign: "center" }, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Title, { style: { fontSize: 18, marginBottom: 15, wordSpace: "normal" }, children: "Hall of Fame" }), this.props.fames.map(function (hall, index) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { style: { display: "inline-block", marginRight: 10 }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["Markah: ", ~~hall.correctness, "%"] }) }, "hall_markah_" + index), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["Masa: ", ~~hall.seconds_spent / 1000, "s"] }) }, "hall_masa_" + index), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("small", { children: "Lihat profile" }) }) }, "hall_link_" + index)] }), title: "Keputusan " + hall.user.username, trigger: "click", children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { count: index + 1, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { src: hall.user.profile_image_path, size: 50 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: [~~hall.correctness, "%"] }) }, "hall_badge_markah_" + index), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: [~~hall.seconds_spent / 1000, "s"] }) }, "hall_badge_masa_" + index)] }, "hall_" + hall.id) }) }) }, "ahref_" + hall.user.id); }, this), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { children: this.props.ranks.map(function (hall, index) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { style: { display: "inline-block", marginRight: 5, marginTop: 5 }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["Markah: ", ~~hall.correctness, "%"] }) }, "hall_low_markah_" + index), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["Masa: ", ~~hall.seconds_spent / 1000, "s"] }) }, "hall_low_masa_" + index), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("small", { children: "Lihat profile" }) }) }, "hall_low_link" + index)] }), title: "Keputusan " + hall.user.username, trigger: "click", children: this.props.user == null ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { src: hall.user.profile_image_path, size: 30 }, "0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["#", index + 4] }) }, "1")] : this.props.user.id == hall.user.id ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { dot: true, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { src: hall.user.profile_image_path, size: 30 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["#", index + 4] }) })] }) : [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { src: hall.user.profile_image_path, size: 30 }, "0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("small", { children: ["#", index + 4] }) }, "1")] }) }) }, "ahref_" + hall.user.id); }, this) })] }); } }]); return QuizHallOfFameComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizHallOfFameComponent); /***/ }), /***/ "./resources/js/quiz/QuizParticipantsComponent.js": /*!********************************************************!*\ !*** ./resources/js/quiz/QuizParticipantsComponent.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/typography/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/popover/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/avatar/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/badge/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/button/index.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Title = antd__WEBPACK_IMPORTED_MODULE_3__["default"].Title; var QuizParticipantsComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizParticipantsComponent, _React$Component); var _super = _createSuper(QuizParticipantsComponent); function QuizParticipantsComponent(props) { var _this; _classCallCheck(this, QuizParticipantsComponent); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { moreHeight: 100, moreText: "Lihat Lagi", moreOverflow: "hidden", morePosition: "relative", moreTop: -25 }); _defineProperty(_assertThisInitialized(_this), "showMore", function () { if (_this.state.moreHeight == 100) { _this.setState({ moreHeight: 200, moreText: "Tutup", moreOverflow: "scroll", morePosition: "initial", moreTop: 0 }); } else { _this.setState({ moreHeight: 100, moreText: "Lihat Lagi", moreOverflow: "hidden", morePosition: "relative", moreTop: -25 }); } }); return _this; } _createClass(QuizParticipantsComponent, [{ key: "render", value: function render() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { style: { backgroundColor: "rgb(239 239 239)", padding: 20, paddingBottom: 5, borderRadius: 20, textAlign: "center" }, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Title, { style: { fontSize: 18, marginBottom: 15, wordSpace: "normal" }, children: "Peserta" }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { style: { maxHeight: this.state.moreHeight, overflow: this.state.moreOverflow }, children: this.props.participants.map(function (hall, index) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { style: { display: "inline-block", marginRight: 5, marginTop: 5 }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("small", { children: "Lihat profile" }) }) }, "hall_low_link" + index) }), title: hall.user.username, trigger: "click", children: this.props.user == null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { src: hall.user.profile_image_path, size: 30 }) : this.props.user.id == hall.user.id ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { dot: true, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { src: hall.user.profile_image_path, size: 30 }) }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { src: hall.user.profile_image_path, size: 30 }) }) }) }, "ahref_" + hall.user.id); }, this) }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { style: { background: "linear-gradient(0deg, rgba(165,166,166,0.5) 0%, rgba(239,239,239,0.5) 100%)", padding: 5, borderRadius: "10px", position: this.state.morePosition, top: this.state.moreTop }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__["default"], { onClick: this.showMore, children: this.state.moreText }) })] }); } }]); return QuizParticipantsComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizParticipantsComponent); /***/ }), /***/ "./resources/js/quiz/QuizSummaryComponent.js": /*!***************************************************!*\ !*** ./resources/js/quiz/QuizSummaryComponent.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/typography/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/card/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/tooltip/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/badge/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/avatar/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/list/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/tag/index.js"); /* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ant-design/icons */ "./node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.js"); /* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ant-design/icons */ "./node_modules/@ant-design/icons/es/icons/CloseCircleOutlined.js"); /* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ant-design/icons */ "./node_modules/@ant-design/icons/es/icons/ClockCircleOutlined.js"); /* harmony import */ var _axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../axios/axiosClient */ "./resources/js/axios/axiosClient.js"); /* harmony import */ var howler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! howler */ "./node_modules/howler/dist/howler.js"); /* harmony import */ var howler__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(howler__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../generic/LoadingComponent */ "./resources/js/generic/LoadingComponent.js"); /* harmony import */ var _QuizHallOfFameComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./QuizHallOfFameComponent */ "./resources/js/quiz/QuizHallOfFameComponent.js"); /* harmony import */ var _QuizParticipantsComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./QuizParticipantsComponent */ "./resources/js/quiz/QuizParticipantsComponent.js"); /* harmony import */ var _QuizWinnerComponent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./QuizWinnerComponent */ "./resources/js/quiz/QuizWinnerComponent.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Title = antd__WEBPACK_IMPORTED_MODULE_3__["default"].Title; var Meta = antd__WEBPACK_IMPORTED_MODULE_4__["default"].Meta; var endedSound = new howler__WEBPACK_IMPORTED_MODULE_5__.Howl({ src: ["https://wiser.my" + '/ended.mp3'], volume: 0.5, onend: function onend() { endedSound.unload(); } }); var QuizSummaryComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizSummaryComponent, _React$Component); var _super = _createSuper(QuizSummaryComponent); function QuizSummaryComponent(props) { var _this; _classCallCheck(this, QuizSummaryComponent); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { initLoading: true, loading: false, data: [] }); return _this; } _createClass(QuizSummaryComponent, [{ key: "componentDidUpdate", value: function componentDidUpdate() { if (this.props.playSound == true) { endedSound.play(); } } }, { key: "componentDidMount", value: function componentDidMount() { var _this2 = this; (0,_axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__.getRequest)('/game' + this.props.postName + '/summary').then(function (response) { _this2.setState({ initLoading: false, data: response.data.data }); }); } }, { key: "render", value: function render() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { children: this.state.initLoading == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_6__["default"], { message: "Sedang memuat turun keputusan..." }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { cover: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", { style: { width: "100%" }, alt: "example", src: this.state.data.game.featured_image }), children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Meta, { title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(Title, { level: 3, children: ["Kuiz: ", this.state.data.game.title] }), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("small", { style: { fontSize: 12, marginTop: -15, display: "block", marginBottom: 0 }, children: [" ", this.state.data.globalEntriesCount, " pengguna menyertai kuiz ini"] }), " "] }), description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [this.state.data.game.hide_results_until_complete == true ? this.state.data.game.show_results_at ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_QuizWinnerComponent__WEBPACK_IMPORTED_MODULE_9__["default"], { game: this.state.data.game, winners: this.state.data.winners }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_QuizParticipantsComponent__WEBPACK_IMPORTED_MODULE_8__["default"], { user: this.state.data.entries[0].user, participants: this.state.data.participants }) : this.state.data.game.show_hall_of_fame ? this.state.data.entered == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_QuizHallOfFameComponent__WEBPACK_IMPORTED_MODULE_7__["default"], { user: this.state.data.entries[0].user, fames: this.state.data.fames, ranks: this.state.data.ranks }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_QuizHallOfFameComponent__WEBPACK_IMPORTED_MODULE_7__["default"], { fames: this.state.data.fames, ranks: this.state.data.ranks }) : this.state.data.winners.length > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { style: { backgroundColor: "rgb(239 239 239)", padding: 20, borderRadius: 20, textAlign: "center" }, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Title, { style: { fontSize: 18, marginBottom: 15, wordSpace: "normal" }, children: "Pemenang" }), this.state.data.winners.map(function (hall, index) { var _ref; return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { style: { display: "inline-block", marginRight: 10 }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__["default"], { placement: "top", title: hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__["default"], { count: index + 1, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__["default"], { src: hall.user.profile_image_path, size: 50 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("small", { style: (_ref = { maxWidth: 60, textOverflow: "ellipsis" }, _defineProperty(_ref, "maxWidth", 60), _defineProperty(_ref, "overflow", "hidden"), _defineProperty(_ref, "display", "inline-block"), _ref), children: hall.user.username }) })] }, "hall_" + hall.id) }) }) }); }, this)] }) : null, this.state.data.entered == true ? this.state.data.entries.map(function (session, index) { return session.seconds_spent == null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("center", { children: ["Anda telah menggunakan ", this.state.data.game.entry_limit, " peluang untuk kuiz ini namun tidak menamatkannya. Sila cuba lagi di kuiz akan datang."] }, "warning_" + session.id) : this.state.data.game.hide_results_until_complete == true ? this.state.data.game.show_results_at != null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"], { header: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(Title, { level: 4, children: ["Keputusan ", session.user.username] }, "session_" + session.id), this.state.data.game.show_correctness == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("small", { style: { fontSize: 12, marginTop: -15, display: "block", marginBottom: 0 }, children: ["Markah: ", ~~session.correctness, "%"] }, "markah_correctness_" + session.id) : null, this.state.data.game.show_seconds_spent == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("small", { style: { fontSize: 12, marginTop: -5, display: "block", marginBottom: 0 }, children: ["Masa: ", ~~session.seconds_spent / 1000, "s"] }, "markah_seconds_spent_" + session.id) : null] }), itemLayout: "horizontal", dataSource: session.answers, renderItem: function renderItem(item) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"].Item, { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"].Item.Meta, { avatar: item.is_correct ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_15__["default"], { style: { fontSize: '30px', color: 'green' } }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_16__["default"], { style: { fontSize: '30px', color: 'rgb(249 98 139)' } }), title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { style: { color: "#333" }, children: item.answer.question.question }), description: item.is_correct ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { color: "green", children: item.answer.answer }, "answer_" + item.answer.answer.id) : [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { color: "red", children: item.answer.answer }, "answer_" + item.answer.answer.id), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { color: "green", children: item.answer.question.correct_answer.answer }, "question_answer_" + item.answer.question.correct_answer.id)] }) }, item.id); } }, "list_" + session.id) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"], { header: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Title, { level: 4, children: "Keputusan akan diumumkan selepas kuiz tamat" }, "session_" + session.id) }), itemLayout: "horizontal", dataSource: session.answers, renderItem: function renderItem(item, ii) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"].Item, { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"].Item.Meta, { avatar: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_18__["default"], { style: { fontSize: 30, color: "#ccc" } }), title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("span", { children: ["Soalan ", ii + 1] }), description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { style: { color: "#aaa" }, children: "Jawapan Anda: " }), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { children: item.answer.answer }, "answer_user" + item.answer.id)] }) }) }, Math.random()); } }, "list_" + session.id) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"], { header: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(Title, { level: 4, children: ["Keputusan ", session.user.username] }, "session_" + session.id), this.state.data.game.show_correctness == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("small", { style: { fontSize: 12, marginTop: -15, display: "block", marginBottom: 0 }, children: ["Markah: ", ~~session.correctness, "%"] }, "markah_correctness_" + session.id) : null, this.state.data.game.show_seconds_spent == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("small", { style: { fontSize: 12, marginTop: -5, display: "block", marginBottom: 0 }, children: ["Masa: ", ~~session.seconds_spent / 1000, "s"] }, "markah_seconds_spent_" + session.id) : null] }), itemLayout: "horizontal", dataSource: session.answers, renderItem: function renderItem(item) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"].Item, { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__["default"].Item.Meta, { avatar: item.is_correct ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_15__["default"], { style: { fontSize: '30px', color: 'green' } }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_16__["default"], { style: { fontSize: '30px', color: 'rgb(249 98 139)' } }), title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { style: { color: "#333" }, children: item.answer.question.question }), description: item.is_correct ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { color: "green", children: item.answer.answer }, "answer_" + item.answer.answer.id) : [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { color: "red", children: item.answer.answer }, "answer_" + item.answer.answer.id), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], { color: "green", children: item.answer.question.correct_answer.answer }, "question_answer_" + item.answer.question.correct_answer.id)] }) }, item.id); } }, "list_" + session.id); }, this) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("hr", {}), this.state.data.entered == true ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("br", {}, "0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("center", {}, "1")] : null] }) }) }) }); } }]); return QuizSummaryComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizSummaryComponent); ; /***/ }), /***/ "./resources/js/quiz/QuizWelcomeComponent.js": /*!***************************************************!*\ !*** ./resources/js/quiz/QuizWelcomeComponent.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/typography/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/card/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/button/index.js"); /* harmony import */ var _axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../axios/axiosClient */ "./resources/js/axios/axiosClient.js"); /* harmony import */ var _generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../generic/LoadingComponent */ "./resources/js/generic/LoadingComponent.js"); /* harmony import */ var _QuizHallOfFameComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./QuizHallOfFameComponent */ "./resources/js/quiz/QuizHallOfFameComponent.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Title = antd__WEBPACK_IMPORTED_MODULE_4__["default"].Title; var Meta = antd__WEBPACK_IMPORTED_MODULE_5__["default"].Meta; var QuizWelcomeComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizWelcomeComponent, _React$Component); var _super = _createSuper(QuizWelcomeComponent); function QuizWelcomeComponent(props) { var _this; _classCallCheck(this, QuizWelcomeComponent); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "state", { initLoading: true, loading: false, data: [], list: [], game_started: null }); return _this; } _createClass(QuizWelcomeComponent, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; (0,_axios_axiosClient__WEBPACK_IMPORTED_MODULE_2__.getRequest)('/game' + this.props.postName).then(function (response) { _this2.setState({ initLoading: false, data: response.data.data }, function () { if (_this2.state.data.gameHasEnded == true) { _this2.props.endGame(false); } if (_this2.state.data.noMoreEntry == true && _this2.state.data.entered == true) { _this2.props.endGame(false); } }); }); if (this.state.data.noMoreEntry == true && this.state.data.entered == true) { this.props.endGame(false); } } }, { key: "render", value: function render() { var _this3 = this; return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", { children: this.state.data.eligible == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { cover: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", { style: { width: "100%" }, alt: "example", src: this.state.data.game.featured_image }), children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Meta, { title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(Title, { level: 3, children: ["Kuiz: ", this.state.data.game.title, " "] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", { children: ["Soalan: ", this.state.data.game.question_count] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", { children: ["Masa: ", this.state.data.game.time_constraint_seconds, " saat"] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("small", { style: { fontSize: 12, display: "block", marginBottom: 0, fontStyle: "italic" }, children: [" ", this.state.data.globalEntriesCount, " pengguna menyertai kuiz ini"] })] }), description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", { style: { whiteSpace: "pre-line" }, children: this.state.data.game.description }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("hr", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__["default"], { onClick: function onClick() { return _this3.props.startGame(); }, style: { display: 'block', margin: 'auto' }, type: "danger", shape: "round", size: "large", children: "MULAKAN KUIZ" }), this.state.data.entered == true ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("br", {}, "0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", { children: ["Anda mempunyai ", this.state.data.game.entry_limit - this.state.data.entries.length, " peluang lagi untuk kuiz ini."] }) }, "1")] : null, this.state.data.game.show_hall_of_fame == true && this.state.data.fames != null && this.state.data.ranks != null ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("br", {}, "0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_QuizHallOfFameComponent__WEBPACK_IMPORTED_MODULE_6__["default"], { fames: this.state.data.fames, ranks: this.state.data.ranks }, "1")] : null] }) }) }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", { style: { margin: "0px 0" }, children: this.state.initLoading == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_generic_LoadingComponent__WEBPACK_IMPORTED_MODULE_3__["default"], { message: "Sedang memuat turun data" }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { cover: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", { style: { width: "100%" }, alt: "example", src: this.state.data.game.featured_image }), children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Meta, { title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(Title, { level: 3, children: ["Kuiz: ", this.state.data.game.title, " "] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", { style: { fontStyle: "italic" }, children: ["Soalan: ", this.state.data.game.question_count] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", { style: { fontStyle: "italic" }, children: ["Masa: ", this.state.data.game.time_constraint_seconds, " saat"] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("small", { style: { fontSize: 12, display: "block", marginBottom: 0, fontStyle: "italic" }, children: [" ", this.state.data.globalEntriesCount, " pengguna menyertai kuiz ini"] })] }), description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", { style: { whiteSpace: "pre-line" }, children: this.state.data.game.description }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("hr", {}), this.state.data.error == "login" ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("a", { href: "/login?redirect=" + this.props.fullUrl, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__["default"], { style: { display: 'block', margin: 'auto' }, type: "danger", shape: "round", size: "large", children: this.state.data.message }) }, "0"), this.state.data.gameNotStartedYet ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("br", {}, "1-0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("center", { children: ["Kuiz ini akan bermula pada ", moment(this.state.data.game.start).format('DD/MM/Y, h:mm a')] }, "1-1")] : null] : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__["default"], { style: { display: 'block', margin: 'auto' }, disabled: true, shape: "round", size: "large", children: this.state.data.message }), this.state.data.game.show_hall_of_fame == true && this.state.data.fames != null && this.state.data.ranks != null ? [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("br", {}, "0"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_QuizHallOfFameComponent__WEBPACK_IMPORTED_MODULE_6__["default"], { fames: this.state.data.fames, ranks: this.state.data.ranks }, "1")] : null] }) }) }) }) }); } }]); return QuizWelcomeComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizWelcomeComponent); /***/ }), /***/ "./resources/js/quiz/QuizWinnerComponent.js": /*!**************************************************!*\ !*** ./resources/js/quiz/QuizWinnerComponent.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/typography/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/popover/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/badge/index.js"); /* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/avatar/index.js"); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var Title = antd__WEBPACK_IMPORTED_MODULE_3__["default"].Title; var QuizHallOfFameComponent = /*#__PURE__*/function (_React$Component) { _inherits(QuizHallOfFameComponent, _React$Component); var _super = _createSuper(QuizHallOfFameComponent); function QuizHallOfFameComponent(props) { _classCallCheck(this, QuizHallOfFameComponent); return _super.call(this, props); } _createClass(QuizHallOfFameComponent, [{ key: "render", value: function render() { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { style: { backgroundColor: "rgb(239 239 239)", padding: 20, borderRadius: 20, textAlign: "center" }, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Title, { style: { fontSize: 18, marginBottom: 15, wordSpace: "normal" }, children: "Pemenang Kuiz" }), this.props.winners.map(function (hall, index) { return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { style: { display: "inline-block", marginRight: 10 }, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { children: [this.props.game.show_correctness == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("center", { style: { fontSize: 12, marginTop: -15, display: "block", marginBottom: 0 }, children: ["Markah: ", ~~hall.correctness, "%"] }, "markah_correctness_" + hall.id) : null, this.props.game.show_seconds_spent == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("center", { style: { fontSize: 12, marginTop: -5, display: "block", marginBottom: 0 }, children: ["Masa: ", ~~hall.seconds_spent / 1000, "s"] }, "markah_seconds_spent_" + hall.id) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("center", { children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", { href: "/user/" + hall.user.username, children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("small", { children: "Lihat profile" }) }) }, "hall_link_" + index)] }), title: "Keputusan " + hall.user.username, trigger: "click", children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], { count: index + 1, children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { src: hall.user.profile_image_path, size: 50 }), this.props.game.show_correctness == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("center", { children: ["Markah: ", ~~hall.correctness, "%"] }, "markah_correctness_" + hall.id) : null, this.props.game.show_seconds_spent == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("center", { children: ["Masa: ", ~~hall.seconds_spent / 1000, "s"] }, "markah_seconds_spent_" + hall.id) : null] }, "hall_" + hall.id) }) }) }, "ahref_" + hall.user.id); }, this)] }); } }]); return QuizHallOfFameComponent; }(react__WEBPACK_IMPORTED_MODULE_0__.Component); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuizHallOfFameComponent); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[2]!./resources/js/quiz/quiz.css": /*!**********************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[2]!./resources/js/quiz/quiz.css ***! \**********************************************************************************************************************************************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); // Imports var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); // Module ___CSS_LOADER_EXPORT___.push([module.id, ".quiz-slider {\n\t\n\twidth: 100%;\n\toverflow: hidden;\n\n}\n\n.quiz-slider>div {\n\twidth: 200%;\n display: flex;\n position: relative;\n left: 0px;\n}\n\n.quiz-slider.show-game>div {\n\tleft: -100%;\n\ttransition: left 500ms\n}\n\n.quiz-slider>div>div {\n\n\twidth: 50%;\n\n}\n\n.ant-statistic-content-value{\n\tbackground: #fff;\n\tpadding-left: 20px;\n\tpadding-right: 20px;\n\tborder-radius: 10px;\n\topacity: 0.7;\n}\n\n.dummy-countdown .ant-statistic-content-value{\n\tbackground: rgb(63,94,251);\n\tbackground: radial-gradient(circle, rgba(63,94,251,1) 0%, rgba(252,70,107,1) 100%);\n\tfilter: blur(3px);\n\topacity: 1;\n\tbox-shadow: rgba(0, 0, 0, 0.4) 0px 30px 90px;\n}\n\n.cirle-question-counter{\n\ttext-align: center;\n}\n\n.quiz .ant-card-body{\n\tposition: relative;\n top: -80px;\n}\n\n.answer-button{\n\twidth: 90%;\n\tmargin: auto;\n\tmargin-top: 10px;\n\tfont-weight: 800;\n\tdisplay: block;\n}\n\n.answer-active{\n\tbackground-color: #fffa65!important;\n transition: background-color 500ms linear;\n color: #000!important;\n}\n\nant-typography {\n\tcolor: #000;\n}\n", ""]); // Exports /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); /***/ }), /***/ "./resources/js/quiz/quiz.css": /*!************************************!*\ !*** ./resources/js/quiz/quiz.css ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_oneOf_1_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_oneOf_1_use_2_quiz_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[2]!./quiz.css */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[2]!./resources/js/quiz/quiz.css"); var options = {}; options.insert = "head"; options.singleton = false; var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_oneOf_1_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_oneOf_1_use_2_quiz_css__WEBPACK_IMPORTED_MODULE_1__["default"], options); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_oneOf_1_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_oneOf_1_use_2_quiz_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {}); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, ["/js/vendor"], () => (__webpack_exec__("./resources/js/quiz.js"))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ } ]);