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N,iBAVxB,CACI,MAAMC,EAAWrO,OAAO6J,KAAKnI,EAAM4M,QAAQ,GACrCC,EAAa7M,EAAM4M,OAAOD,GAAU,GAC1CtO,EAAWwO,EAEf,MARIxO,EAAWY,EAAayN,YAaQ,EEsBhCI,CAAa9M,EAAMK,SAAS0K,MACrBhK,QAAQE,OAAOjB,EAAMK,SAAS0K,OAH1BhK,QAAQE,OAAO,kBAI5B,EOJN8L,GACmB,CACf,CAAC,SLVL,IAAqBnL,GKWjB,CAAC,OJ2RL,IAAqBU,GI1RjB,CAAC,OHAL,IAAqBoE,GGCjB,CAAC,QF6RL,IAAqBN,IE5RjB,CAAC,eDhBL,IAAqByF,KCkBVmB,SAASC,GAAc,QAAU,OAAQ,OAAQ,GAAQ,YAChE,EAAOlC,KAAK,GAAGkC,EAAU,SAAUA,EAAU,GACjD,MACA,WAAa,MACb,WAAa,KACb,WAAa,KACb,MAAMjN,GAAQ1C,SAAS4P,cAAc,8BACrC,GAAIlN,GAAO,CACP,MAAMmN,EAAoD,QAAvClN,GAAKD,GAAMkN,cAAc,gBAA6B,IAAPjN,QAAgB,EAASA,GAAGmN,YAC1FD,GACA9O,EAAW8O,EAEnB,CACA,EAAO/G,O","sources":["webpack://tuwiaq-exams/./src/resources/css/index.css?f6c2","webpack://tuwiaq-exams/./src/helpers/isMobileDevice.ts","webpack://tuwiaq-exams/./src/config/toastifyConfig.ts","webpack://tuwiaq-exams/./src/utils/errorMesasge.ts","webpack://tuwiaq-exams/./src/utils/errorHandler.ts","webpack://tuwiaq-exams/./src/config/envConfig.ts","webpack://tuwiaq-exams/./src/config/axiosConfig.ts","webpack://tuwiaq-exams/./src/config/alpineConfig.ts","webpack://tuwiaq-exams/./src/components/layout.ts","webpack://tuwiaq-exams/./src/components/Home.ts","webpack://tuwiaq-exams/./src/components/Exam.ts","webpack://tuwiaq-exams/./src/components/Start.ts","webpack://tuwiaq-exams/./src/components/ExamFinished.ts","webpack://tuwiaq-exams/./src/app.ts"],"sourcesContent":["\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!../../../node_modules/postcss-loader/dist/cjs.js!./index.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!../../../node_modules/postcss-loader/dist/cjs.js!./index.css\";\n export default content && content.locals ? content.locals : undefined;\n","const isMobileDevice = () => {\n const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n const mobileWidthThreshold = 768; // Adjust this threshold as needed\n return screenWidth < mobileWidthThreshold;\n};\nexport default isMobileDevice;\n","import Toastify from 'toastify-js';\nimport isMobileDevice from '../helpers/isMobileDevice';\nconst globalStyle = {\n borderRadius: '10px',\n padding: '20px',\n fontSize: isMobileDevice() ? '1.2rem' : '1.2rem'\n};\nconst globalOptions = {\n duration: 5000,\n gravity: isMobileDevice() ? 'top' : 'top',\n position: isMobileDevice() ? 'center' : 'center',\n};\nconst loadingHtml = new DOMParser().parseFromString(`\n
\n \n \n \n \n
\n `, \"text/xml\");\nconst toastifyLoading = Toastify(Object.assign(Object.assign({ node: loadingHtml.firstChild }, globalOptions), { duration: -1, style: Object.assign(Object.assign({}, globalStyle), { background: \"#fcfcfc\", width: \"6rem\", height: \"6rem\" }) }));\nexport const toastSucess = (message) => {\n Toastify(Object.assign(Object.assign({}, globalOptions), { style: Object.assign(Object.assign({}, globalStyle), { background: '#16a34a' }), text: message })).showToast();\n};\nexport const toastError = (message) => {\n Toastify(Object.assign({ style: Object.assign(Object.assign({}, globalStyle), { background: '#dc2626' }), text: message }, globalOptions)).showToast();\n};\nexport const toastInfo = (message) => {\n Toastify(Object.assign({ style: Object.assign(Object.assign({}, globalStyle), { background: '#4b5563' }), text: message }, globalOptions)).showToast();\n};\nexport const toastWarning = (message) => {\n Toastify(Object.assign({ style: Object.assign(Object.assign({}, globalStyle), { background: '#ea580c' }), text: message }, globalOptions)).showToast();\n};\nexport const showLoadingToast = () => {\n toastifyLoading.showToast();\n};\nexport const hideLoadingToast = () => {\n toastifyLoading.hideToast();\n};\n","export var clientErrors;\n(function (clientErrors) {\n clientErrors[\"serverError\"] = \"\\u062D\\u0635\\u0644 \\u062E\\u0637\\u0623 \\u0627\\u0644\\u0631\\u062C\\u0627\\u0621 \\u0627\\u0644\\u0645\\u062D\\u0627\\u0648\\u0644\\u0629 \\u0641\\u064A \\u0648\\u0642\\u062A \\u0644\\u0627\\u062D\\u0642\";\n clientErrors[\"validation\"] = \"\\u0627\\u0644\\u0631\\u062C\\u0627\\u0621 \\u062A\\u0635\\u062D\\u064A\\u062D \\u062C\\u0645\\u064A\\u0639 \\u0627\\u0644\\u0623\\u062E\\u0637\\u0627\\u0621\";\n clientErrors[\"completeAllFields\"] = \"\\u0627\\u0644\\u0631\\u062C\\u0627\\u0621 \\u062A\\u0639\\u0628\\u0626\\u0629 \\u062C\\u0645\\u064A\\u0639 \\u0627\\u0644\\u062D\\u0642\\u0648\\u0644\";\n})(clientErrors || (clientErrors = {}));\nexport var serverErrors;\n(function (serverErrors) {\n serverErrors[\"validation\"] = \"One or more validation errors occurred.\";\n})(serverErrors || (serverErrors = {}));\n","import { toastError } from \"../config/toastifyConfig\";\nimport { clientErrors, serverErrors } from \"./errorMesasge\";\nconst errorHandler = (error) => {\n if (error.status == 500) {\n toastError(clientErrors.serverError);\n return;\n }\n if (error.status == 400 && error.title == serverErrors.validation) {\n const firstKey = Object.keys(error.errors)[0];\n const firstError = error.errors[firstKey][0];\n toastError(firstError);\n return;\n }\n if (error.errorMessage) {\n toastError(error.errorMessage);\n return;\n }\n toastError(clientErrors.serverError);\n};\nexport { errorHandler };\n","// export const BASE_URL = 'https://initiatives.tuwaiqdev.com/';\nexport const BASE_URL = window.base_url;\n","import axios from 'axios';\nimport { errorHandler } from '../utils/errorHandler';\nimport { BASE_URL } from './envConfig';\nimport axiosRetry from \"axios-retry\";\nconst myAxios = axios.create({\n baseURL: BASE_URL,\n headers: {\n 'Content-Type': 'application/json'\n }\n});\naxiosRetry(myAxios, {\n retries: 5, // number of retries\n retryDelay: (retryCount) => {\n console.log(`retry attempt: ${retryCount}`);\n return retryCount * 2000; // time interval between retries\n },\n retryCondition: (error) => {\n var _a, _b, _c, _d;\n // if retry condition is not specified, by default idempotent requests are retried\n return ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 503 || ((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 400 || ((_c = error.response) === null || _c === void 0 ? void 0 : _c.status) === 404 || ((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) === 500;\n },\n});\nconst setupAxiosMiddleware = () => {\n const token = window.token; //(document.getElementById('token') as HTMLInputElement).value;\n myAxios.interceptors.request.use((axiosRequest) => {\n axiosRequest.headers['my-x-12s4'] = token;\n return axiosRequest;\n }, (error) => {\n return Promise.reject(error);\n });\n myAxios.interceptors.response.use((axiosResponse) => {\n if (axiosResponse.status >= 400) {\n throw new Error(axiosResponse.data);\n }\n return axiosResponse;\n }, (error) => {\n if (!error.response) {\n return Promise.reject('Network Error');\n }\n errorHandler(error.response.data);\n return Promise.reject(error.response.data);\n });\n};\nexport { setupAxiosMiddleware, myAxios };\n","import Alpine from 'alpinejs';\nimport TimeAgo from '@marcreichel/alpine-timeago';\nimport AutoAnimate from '@marcreichel/alpine-auto-animate';\nimport Typewriter from '@marcreichel/alpine-typewriter';\nimport Tooltip from '@ryangjchandler/alpine-tooltip';\nimport Toolkit from '@alpine-collective/toolkit';\nimport morph from '@alpinejs/morph';\nimport collapse from '@alpinejs/collapse';\nAlpine.plugin(Tooltip);\nAlpine.plugin(Typewriter);\nAlpine.plugin(TimeAgo);\nAlpine.plugin(Toolkit);\nAlpine.plugin(AutoAnimate);\nAlpine.plugin(morph);\nAlpine.plugin(collapse);\nwindow.Alpine = Alpine;\nexport default Alpine;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nconst layoutComponent = {\n route: {\n url: '',\n name: '',\n },\n isLoading: true,\n openUser: false,\n init() {\n return __awaiter(this, void 0, void 0, function* () {\n this.isLoading = false;\n });\n },\n getRouteUrl() {\n return this.route.url;\n },\n setCurrentRoute(url, name) {\n this.route.url = url;\n this.route.name = name;\n },\n};\nexport default () => layoutComponent;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport Shepherd from 'shepherd.js';\nimport { toastError } from '../config/toastifyConfig';\nimport Hashids from 'hashids';\nconst home = {\n grecaptchaInstance: null,\n otp: null,\n // otp: Array(6).fill(null),\n canCheckNationalId: false,\n nationalId: null,\n hashed: null,\n enableRecaptcha: true,\n // setData() {\n // \t//\n // },\n setCode(code) {\n var _a;\n if (code > 0) {\n this.otp = code; //code.toString().split('').map((x) => parseInt(x));\n }\n (_a = document.getElementById('delete')) === null || _a === void 0 ? void 0 : _a.remove();\n },\n convertToEnglishNumerals(inputValue) {\n const arabicNumerals = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];\n const englishNumerals = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n //console.log(inputValue);\n for (let i = 0; i < arabicNumerals.length; i++) {\n const regex = new RegExp(arabicNumerals[i], 'g');\n inputValue = inputValue.replace(regex, englishNumerals[i]);\n }\n return parseInt(inputValue);\n },\n init() {\n return __awaiter(this, void 0, void 0, function* () {\n this.isLoading = true;\n try {\n // @ts-ignore\n if (!grecaptcha) {\n window.location.reload();\n }\n window.onRecaptchaLoaded = () => {\n // @ts-ignore\n this.grecaptchaInstance = grecaptcha.render('grecaptcha', {\n 'sitekey': '6LcLLawpAAAAAL9-hDR_fZXbBk3dl7PJRNYFdbci'\n });\n };\n }\n catch (e) {\n console.error(e);\n window.location.reload();\n }\n if (window.error) {\n toastError(window.error);\n // refresh the page after 5 seconds\n // setTimeout(() => {\n // window.location.reload();\n // }, 5000);\n }\n this.isLoading = false;\n this.$watch('otp', (newValue) => {\n var _a, _b, _c;\n if (this.nationalId) {\n // replace arabic numbers with english numbers\n this.otp = newValue.map((x) => x === null ? null : x.toString().replace('٠', '0').replace('١', '1').replace('٢', '2').replace('٣', '3').replace('٤', '4').replace('٥', '5').replace('٦', '6').replace('٧', '7').replace('٨', '8').replace('٩', '9'));\n const hashids = new Hashids((_a = this.nationalId) !== null && _a !== void 0 ? _a : '123');\n this.hashed = (_c = hashids === null || hashids === void 0 ? void 0 : hashids.encode((_b = this.otp) !== null && _b !== void 0 ? _b : 0)) !== null && _c !== void 0 ? _c : '';\n }\n });\n this.$watch('nationalId', (newValue) => {\n var _a, _b, _c;\n if (this.otp) {\n // replace arabic numbers with english numbers\n this.nationalId = newValue === null || newValue === void 0 ? void 0 : newValue.replace('٠', '0').replace('١', '1').replace('٢', '2').replace('٣', '3').replace('٤', '4').replace('٥', '5').replace('٦', '6').replace('٧', '7').replace('٨', '8').replace('٩', '9');\n const hashids = new Hashids((_a = this.nationalId) !== null && _a !== void 0 ? _a : '123');\n this.hashed = (_c = hashids === null || hashids === void 0 ? void 0 : hashids.encode((_b = this.otp) !== null && _b !== void 0 ? _b : 0)) !== null && _c !== void 0 ? _c : '';\n }\n });\n this.$watch('nationalId', (value) => {\n if (value) {\n if (this.isValidNationalId() && value.length === 10) {\n this.canCheckNationalId = false;\n }\n else if (!this.isValidNationalId && value.length === 10) {\n this.canCheckNationalId = true;\n }\n }\n });\n // sweet alert show accept terms and conditions\n // const accept = document.cookie.indexOf('accept=true') >= 0;\n // if (!accept) {\n // \tSwal.fire({\n // \t\ttitle: 'الشروط والأحكام',\n // \t\thtml: `\n //

تنبيهات هامة يجب قراءتها:

\n //
    \n //
  1. لا يمكن العودة للأسئلة السابقة، وتنتهي إمكانية الوصول للسؤال بعد الإجابة والضغط على زر (التالي)، \n // وفي حال النقر على (زر العودة) إلى الصفحة السابقة في المتصفح، قد تفقد الاختبار ويتم تسجيل خروجك.
  2. \n //
  3. جميع الأسئلة هي اختيارات متعددة، وهناك اختيار صحيح واحد من بين الاختيارات.
  4. \n //
  5. بعد الانتهاء من الاختبار والضغط على زر (انتهاء الاختبار) سيتم إغلاق الاختبار تلقائياً.
  6. \n //
  7. يجب إنهاء الاختبار والاجابة على جميع الأسئلة قبل انتهاء الوقت المحدد.
  8. \n //
\n // `,\n // \t\tshowCancelButton: false,\n // \t\tconfirmButtonText: 'إغلاق',\n // \t\tconfirmButtonColor: '#28a745',\n // \t\tallowOutsideClick: false\n // \t})\n // \t\t.then((result) => {\n // \t\t\t// set cookie to prevent showing the alert again\n // \t\t\tdocument.cookie = 'accept=true';\n // \t\t})\n // \t;\n // }\n });\n },\n // handleKeydown(event, index) {\n // let key = event.key;\n // let corrected: number | null = null;\n // if ('01234567890٠١٢٣٤٥٦٧٨٩'.indexOf(key) >= 0) corrected = parseInt(key);\n // // check if key is one of ٠١٢٣٤٥٦٧٨٩ related to english numbers 0123456789\n // if (key == \"٠\") {\n // corrected = 0;\n // key = \"0\";\n // }\n // if (key === \"١\") {\n // corrected = 1;\n // key = \"1\";\n // }\n // if (key === \"٢\") {\n // corrected = 2;\n // key = \"2\";\n // }\n // if (key === \"٣\") {\n // corrected = 3;\n // key = \"3\";\n // }\n // if (key === \"٤\") {\n // corrected = 4;\n // key = \"4\";\n // }\n // if (key === \"٥\") {\n // corrected = 5;\n // key = \"5\";\n // }\n // if (key === \"٦\") {\n // corrected = 6;\n // key = \"6\";\n // }\n // if (key === \"٧\") {\n // corrected = 7;\n // key = \"7\";\n // }\n // if (key === \"٨\") {\n // corrected = 8;\n // key = \"8\";\n // }\n // if (key === \"٩\") {\n // corrected = 9;\n // key = \"9\";\n // }\n //\n // const isNumber = parseInt(key) >= 0 && parseInt(key) <= 9;\n // const isLetter = key.length === 1 && key.match(/[a-z]/i);\n //\n // if (key === \"Backspace\") {\n // this.otp[index] = null;\n // if (index !== 0 && this.$refs[`otp${index}`]) {\n // this.$refs[`otp${index}`]?.focus();\n // }\n // } else if (isNumber || isLetter) {\n // this.otp[index] = corrected;\n // if (index !== this.otp.length - 1) {\n // this.$refs[`otp${index + 2}`]?.focus(); // +2 because your ID and array index are off by 1\n // }\n // event.preventDefault();\n // }\n // },\n isValidNationalId() {\n var _a, _b, _c;\n const type = (_a = this.nationalId) === null || _a === void 0 ? void 0 : _a.substr(0, 1);\n let sum = 0;\n const _idLength = 10;\n const _type1 = '1';\n const _type2 = '2';\n this.nationalId = (_c = (_b = this.nationalId) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';\n if (isNaN(parseInt(this.nationalId)) ||\n this.nationalId.length !== _idLength ||\n (type !== _type2 && type !== _type1)) {\n return false;\n }\n for (let num = 0; num < 10; num++) {\n const digit = Number(this.nationalId[num]);\n if (num % 2 === 0) {\n const doubled = digit * 2;\n const ZFOdd = `00${doubled}`.slice(-2);\n sum += Number(ZFOdd[0]) + Number(ZFOdd[1]);\n }\n else {\n sum += digit;\n }\n }\n return sum % 10 !== 0 ? false : true;\n },\n showTour() {\n const tour = new Shepherd.Tour({\n useModalOverlay: true,\n defaultStepOptions: {\n classes: 'shadow-md bg-purple-dark',\n scrollTo: true\n }\n });\n tour.addStep({\n id: 'input-step',\n text: 'اولا اولا ادخل الكود الخاص بالاختبار',\n canClickTarget: false,\n attachTo: {\n element: '#first',\n on: 'top-start'\n },\n buttons: [\n {\n text: 'التالي',\n action: tour.next,\n classes: 'primary-button mx-2'\n },\n {\n text: 'انهاء',\n action: tour.complete,\n classes: 'primary-button mx-2',\n secondary: true\n }\n ]\n });\n tour.addStep({\n id: 'input-step',\n text: 'ثانيا ادخل رقم الهوية الوطنية | الإقامة الخاصة بك',\n canClickTarget: false,\n attachTo: {\n element: '#nationalId',\n on: 'top-start'\n },\n buttons: [\n {\n text: 'التالي',\n action: tour.next,\n classes: 'primary-button mx-2'\n },\n {\n text: 'انهاء',\n action: tour.complete,\n classes: 'primary-button mx-2',\n secondary: true\n }\n ]\n });\n tour.addStep({\n id: 'recaptcha-step',\n text: 'ثالثا اضغط على الريكابتشا لتأكيد انك لست برنامج روبوت',\n canClickTarget: false,\n attachTo: {\n element: '#grecaptcha',\n on: 'bottom'\n },\n modalOverlayOpeningPadding: 10,\n buttons: [\n {\n text: 'التالي',\n action: tour.next,\n classes: 'primary-button'\n }\n ]\n });\n tour.addStep({\n id: 'enter-exam-step',\n text: 'رابعا اضغط على زر الدخول الى الاختبار',\n canClickTarget: false,\n attachTo: {\n element: '#enterExamBtn',\n on: 'bottom'\n },\n buttons: [\n {\n text: 'انهاء',\n action: tour.complete,\n classes: 'primary-button'\n }\n ]\n });\n tour.start();\n },\n enterExam() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (((_a = this.otp) === null || _a === void 0 ? void 0 : _a.toString().length) != 6) {\n toastError('الرجاء ادخال الكود كاملا');\n return;\n }\n if (!this.isValidNationalId()) {\n toastError('الرجاء التحقق من رقم الهوية | الاقامة');\n return;\n }\n if (this.enableRecaptcha) {\n // @ts-ignore\n const response = grecaptcha.getResponse(this.grecaptcha);\n if (!response) {\n toastError('الرجاء التحقق من أنك لست روبوت');\n return;\n }\n }\n // window.location.href = `/exam/${hashed}`;\n this.$refs.startExamForm.submit();\n this.isLoading = true;\n });\n }\n};\nexport default () => home;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nconst exam = {\n init() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.isLoading = false;\n (_a = this.setCurrentRoute) === null || _a === void 0 ? void 0 : _a.call(this, '/exam', 'exam');\n });\n },\n canStart: false,\n exam: null,\n url: '',\n get examLink() {\n if (this.canStart) {\n return `\n
\n

الاختبار قد بدأ

\n

\n يمكنك الدخول الآن من هنا\n

\n
\n`;\n }\n return '';\n },\n setExam(exam) {\n this.exam = exam;\n const script = document.getElementById('delete');\n if (script) {\n script.remove();\n }\n }\n};\nexport default () => exam;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { myAxios } from \"../config/axiosConfig\";\nimport { toastError, toastSucess, toastWarning } from \"../config/toastifyConfig\";\nimport Swal from \"sweetalert2\";\nconst start = {\n canStart: false,\n currentQuestion: '',\n currentQuestionIndex: -1,\n percentage: 0.0,\n isLast: false,\n allAnswered: false,\n showedWarning: false,\n exam: null,\n currentQuestionCounter: 0,\n totalQuestions: 0,\n answers: {},\n myTimer: '',\n slug: '',\n url: '',\n IsSubmitting: false,\n loadFromSession() {\n if (typeof (Storage) === \"undefined\") {\n return null;\n }\n const savedState = sessionStorage.getItem('exam:' + this.slug);\n if (savedState) {\n this.exam = JSON.parse(savedState);\n }\n const answersState = sessionStorage.getItem('answers:' + this.slug);\n if (answersState) {\n this.answers = JSON.parse(answersState);\n if (this.exam && this.answers) {\n this.currentQuestionIndex = Object.keys(this.answers).length - 1;\n this.currentQuestionCounter = Object.keys(this.answers).length;\n }\n }\n const now = new Date();\n if (now.getTime() > this.expire) {\n this.clearSession();\n return null;\n }\n },\n watchDataChanges() {\n this.$watch('exam', (newValue) => {\n if (typeof (Storage) !== \"undefined\") {\n sessionStorage.setItem('exam:' + this.slug, JSON.stringify(newValue));\n }\n });\n this.$watch('answers', (newValue) => {\n if (typeof (Storage) !== \"undefined\") {\n sessionStorage.setItem('answers:' + this.slug, JSON.stringify(newValue));\n }\n });\n },\n clearSession() {\n if (typeof (Storage) !== \"undefined\") {\n sessionStorage.removeItem('exam:' + this.slug);\n sessionStorage.removeItem('answers:' + this.slug);\n }\n },\n init() {\n var _a, _b, _c, _d;\n return __awaiter(this, void 0, void 0, function* () {\n this.isLoading = false;\n (_a = this.setCurrentRoute) === null || _a === void 0 ? void 0 : _a.call(this, '/start', 'exam');\n this.$watch('currentQuestionCounter', (value) => {\n this.percentage = (value / this.totalQuestions) * 100;\n });\n this.totalQuestions = (_d = (_c = (_b = this.exam) === null || _b === void 0 ? void 0 : _b.questions) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;\n document.addEventListener('contextmenu', event => event.preventDefault());\n document.addEventListener(\"copy\", evt => {\n var _a;\n (_a = evt.clipboardData) === null || _a === void 0 ? void 0 : _a.setData(\"text/plain\", \"Copying is not allowed on this webpage\");\n evt.preventDefault();\n }, false);\n window.addEventListener(\"load\", () => {\n document.addEventListener('contextmenu', event => event.preventDefault());\n document.addEventListener(\"copy\", evt => {\n var _a;\n (_a = evt.clipboardData) === null || _a === void 0 ? void 0 : _a.setData(\"text/plain\", \"Copying is not allowed on this webpage\");\n evt.preventDefault();\n }, false);\n document.onkeydown = function (e) {\n e.preventDefault();\n };\n });\n setInterval(() => {\n this.calculateExamDetails();\n }, 1000);\n Swal.fire({\n title: 'الشروط والأحكام',\n html: `\n

تنبيهات هامة يجب قراءتها:

\n
    \n
  1. لا يمكن العودة للأسئلة السابقة، وتنتهي إمكانية الوصول للسؤال بعد الإجابة والضغط على زر (التالي)، \n وفي حال النقر على (زر العودة) إلى الصفحة السابقة في المتصفح، قد تفقد الاختبار ويتم تسجيل خروجك.
  2. \n
  3. جميع الأسئلة هي اختيارات متعددة، وهناك اختيار صحيح واحد من بين الاختيارات.
  4. \n
  5. بعد الانتهاء من الاختبار والضغط على زر (انتهاء الاختبار) سيتم إغلاق الاختبار تلقائياً.
  6. \n
  7. يجب إنهاء الاختبار والاجابة على جميع الأسئلة قبل انتهاء الوقت المحدد.
  8. \n
\n `,\n showCancelButton: false,\n confirmButtonText: 'إغلاق',\n confirmButtonColor: '#28a745',\n allowOutsideClick: false\n });\n });\n },\n back() {\n return __awaiter(this, void 0, void 0, function* () {\n this.currentQuestionCounter = 0;\n this.currentQuestionIndex = -1;\n this.isLast = false;\n this.allAnswered = false;\n yield this.nextQuestion();\n });\n },\n setExam(exam) {\n this.loadFromSession();\n this.watchDataChanges();\n if (!this.exam) {\n this.exam = exam;\n }\n const script = document.getElementById('delete');\n if (script) {\n script.remove();\n }\n },\n get CurrentQuestion() {\n var _a;\n return (_a = this.exam) === null || _a === void 0 ? void 0 : _a.questions[this.currentQuestionIndex];\n },\n nextQuestion() {\n var _a, _b, _c, _d, _e, _f, _g;\n return __awaiter(this, void 0, void 0, function* () {\n window.scrollTo(0, 0);\n if (this.currentQuestionIndex != -1 && !this.answers[(_a = this.CurrentQuestion) === null || _a === void 0 ? void 0 : _a.id]) {\n toastError('يجب الإجابة على السؤال أولاً');\n return;\n }\n else if (this.CurrentQuestion && this.answers[(_b = this.CurrentQuestion) === null || _b === void 0 ? void 0 : _b.id] != -1 || this.answers[(_c = this.CurrentQuestion) === null || _c === void 0 ? void 0 : _c.id] != -1) {\n // this.submit();\n }\n if (this.currentQuestionIndex == ((_f = (_e = (_d = this.exam) === null || _d === void 0 ? void 0 : _d.questions) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 1) - 1) {\n this.isLast = true;\n this.allAnswered = Object.entries(this.answers).filter(s => s[1] !== -1).length === ((_g = this.exam) === null || _g === void 0 ? void 0 : _g.questions.length);\n return;\n }\n this.currentQuestionIndex++;\n this.currentQuestionCounter++;\n if (this.currentQuestionIndex > (this.totalQuestions - 1)) {\n return;\n }\n this.isLast = false;\n });\n },\n lastQuestion() {\n var _a, _b, _c, _d, _e, _f, _g;\n return __awaiter(this, void 0, void 0, function* () {\n window.scrollTo(0, 0);\n if (this.currentQuestionIndex != -1 && this.answers[(_a = this.CurrentQuestion) === null || _a === void 0 ? void 0 : _a.id] == -1) {\n this.showError('يجب الإجابة على السؤال أولاً');\n return;\n }\n else if (this.CurrentQuestion && this.answers[(_b = this.CurrentQuestion) === null || _b === void 0 ? void 0 : _b.id] != -1 || this.answers[(_c = this.CurrentQuestion) === null || _c === void 0 ? void 0 : _c.id] != -1) {\n // this.submit();\n }\n if (this.currentQuestionIndex == ((_f = (_e = (_d = this.exam) === null || _d === void 0 ? void 0 : _d.questions) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 1) - 1) {\n this.isLast = true;\n this.allAnswered = Object.entries(this.answers).filter(s => s[1] !== -1).length === ((_g = this.exam) === null || _g === void 0 ? void 0 : _g.questions.length);\n return;\n }\n this.currentQuestionIndex = (this.totalQuestions - 1);\n this.currentQuestionCounter = (this.totalQuestions);\n if (this.currentQuestionIndex > (this.totalQuestions - 1)) {\n return;\n }\n this.isLast = true;\n });\n },\n prevQuestion() {\n return __awaiter(this, void 0, void 0, function* () {\n window.scrollTo(0, 0);\n if (this.currentQuestionIndex == -1 || this.currentQuestionIndex == 0) {\n return;\n }\n this.currentQuestionIndex--;\n this.currentQuestionCounter--;\n if (this.currentQuestionIndex < (this.totalQuestions - 1)) {\n return;\n }\n // return this.exam?.questions[this.currentQuestionIndex];\n });\n },\n get AllAnswered() {\n var _a;\n return Object.entries(this.answers).filter(s => s[1] !== -1).length === ((_a = this.exam) === null || _a === void 0 ? void 0 : _a.questions.length) && this.isLast;\n },\n // async submit() {\n // // post answers to server\n // try {\n // this.isLoading = true;\n //\n // const res = await myAxios.post(`exam/${this.slug}/submit`, {\n // slug: this.slug,\n // answers: this.answers\n // });\n //\n // if (res.status == 200) {\n // await this.clearSession();\n // window.location.href = \"/exam/finish\";\n // } else {\n // toastError(\"حدث خطأ أثناء تسليم الاختبار . الرجاء المحاولة مرة أخرى\");\n // }\n // } catch (e) {\n // console.log(e);\n // toastError(\"حدث خطأ أثناء تسليم الاختبار . الرجاء المحاولة مرة أخرى\");\n // this.isLoading = false;\n // }\n //\n // },\n submitForm() {\n return __awaiter(this, void 0, void 0, function* () {\n this.isLoading = true;\n this.IsSubmitting = true;\n const maxAttempts = 5;\n const delay = 3000;\n let attempt = 1;\n let success = false;\n while (attempt <= maxAttempts && !success) {\n try {\n //console.log(\"Submitting exam...\", attempt);\n const res = yield myAxios.post(`/exam/${this.url}/submit`, {\n slug: this.slug,\n Answers: this.answers //Object.entries(this.questions).map((q) => q[1])\n });\n //console.log(\"Exam submitted\", res);\n if (res.status == 200) {\n this.clearSession();\n success = res.data.success;\n if (success && !res.data.message) {\n toastSucess(\"تم تسليم الاختبار بنجاح\");\n this.IsSubmitting = false;\n success = true;\n setTimeout(() => {\n window.location.href = `/exam/${this.url}/finish`;\n }, 3000);\n }\n else if (!success && res.data.message) {\n toastError(res.data.message);\n this.IsSubmitting = false;\n success = true;\n setTimeout(() => {\n window.location.href = `/`;\n }, 3000);\n }\n else {\n toastError(res.data.message);\n this.IsSubmitting = false;\n success = true;\n if (res.data.returnUrl) {\n setTimeout(() => {\n window.location.href = res.data.returnUrl;\n }, 3000);\n }\n }\n }\n }\n catch (e) {\n //console.log(`Attempt ${attempt} failed: ${JSON.stringify(e)}`);\n if (attempt < maxAttempts) {\n yield new Promise(resolve => setTimeout(resolve, delay));\n }\n else {\n toastError(\"حدث خطأ أثناء تسليم الاختبار\");\n }\n }\n attempt++;\n }\n // this.isLoading = false;\n });\n },\n calculateExamDetails() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure both startDate and endDate are defined before proceeding\n if (((_a = this.exam) === null || _a === void 0 ? void 0 : _a.startDate) && ((_b = this.exam) === null || _b === void 0 ? void 0 : _b.endDate)) {\n // const examStartTime = new Date(this.exam.startDate); // Exam start date and time\n const examEndTime = new Date(this.exam.endDate); // Exam end date and time\n // // Calculate exam duration in milliseconds\n // const examDurationMs = examEndTime.getTime() - examStartTime.getTime();\n // // Convert exam duration from milliseconds to hours and minutes\n // const examDurationHours = Math.floor(examDurationMs / (1000 * 60 * 60));\n // const examDurationMinutes = Math.floor((examDurationMs % (1000 * 60 * 60)) / (1000 * 60));\n // Calculate remaining time in milliseconds\n const currentTime = new Date(); // Current date and time\n const remainingTimeMs = examEndTime.getTime() - currentTime.getTime();\n // Convert remaining time from milliseconds to hours, minutes, and seconds\n const remainingHours = Math.floor(remainingTimeMs / (1000 * 60 * 60));\n const remainingMinutes = Math.floor((remainingTimeMs % (1000 * 60 * 60)) / (1000 * 60));\n const remainingSeconds = Math.floor((remainingTimeMs % (1000 * 60)) / 1000);\n if (remainingTimeMs <= (1000 * 60 * 2) && !this.showedWarning) {\n toastWarning(\"الاختبار سينتهي خلال دقيقتين\");\n this.showedWarning = true;\n }\n if (remainingTimeMs > 0) {\n this.myTimer = `${(\"0\" + remainingHours).slice(-2)}:${(\"0\" + remainingMinutes).slice(-2)}:${(\"0\" + remainingSeconds).slice(-2)}`;\n }\n else {\n // exam has ended\n yield this.submit();\n }\n }\n else {\n console.log(\"Exam start date or end date is not defined.\");\n }\n });\n }\n};\nexport default () => start;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nconst examFinished = {\n init() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.isLoading = false;\n (_a = this.setCurrentRoute) === null || _a === void 0 ? void 0 : _a.call(this, '/exam', 'exam');\n });\n },\n canStart: false,\n exam: null,\n setExam(exam) {\n this.exam = exam;\n const script = document.getElementById('delete');\n if (script) {\n script.remove();\n }\n }\n};\nexport default () => examFinished;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar _a;\nimport './resources/css/index.css';\nimport { setupAxiosMiddleware } from './config/axiosConfig';\nimport '@purge-icons/generated';\nimport Alpine from './config/alpineConfig';\nimport 'flowbite';\nimport layout from './components/layout';\nimport { toastError } from \"./config/toastifyConfig\";\nimport dayjs from \"dayjs\";\nimport utc from \"dayjs/plugin/utc\";\nimport timezone from \"dayjs/plugin/timezone\";\nimport home from \"./components/Home\";\nimport exam from \"./components/Exam\";\nimport start from \"./components/Start\";\nimport focus from '@alpinejs/focus';\nimport examFinished from \"./components/ExamFinished\";\nAlpine.plugin(focus);\nfunction detectLanguage(text) {\n const arabicPattern = /[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]/;\n const isArabic = arabicPattern.test(text);\n return isArabic ? 'Arabic' : 'English';\n}\n// Register the function as an Alpine.js magic property\ndocument.addEventListener('alpine:init', () => {\n Alpine.magic('detectLang', () => {\n return (text) => detectLanguage(text);\n });\n});\nsetupAxiosMiddleware();\nconst components = [\n ['layout', layout],\n ['home', home],\n ['exam', exam],\n ['start', start],\n ['examFinished', examFinished],\n];\ncomponents.forEach((component) => __awaiter(void 0, void 0, void 0, function* () {\n Alpine.data(`${component[0]}Data`, component[1]);\n}));\ndayjs.locale('ar');\ndayjs.extend(utc);\ndayjs.extend(timezone);\nconst error = document.querySelector('.validation-summary-errors');\nif (error) {\n const errorText = (_a = error.querySelector('ul li')) === null || _a === void 0 ? void 0 : _a.textContent;\n if (errorText) {\n toastError(errorText);\n }\n}\nAlpine.start();\n"],"names":["options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","window","innerWidth","document","documentElement","clientWidth","body","globalStyle","borderRadius","padding","fontSize","globalOptions","duration","gravity","position","loadingHtml","DOMParser","parseFromString","toastError","Object","assign","node","firstChild","style","background","width","height","message","text","showToast","clientErrors","serverErrors","BASE_URL","base_url","myAxios","axios","create","baseURL","headers","retries","retryDelay","retryCount","console","log","retryCondition","error","_a","_b","_c","_d","response","status","plugin","c","Alpine","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","layoutComponent","route","url","name","isLoading","openUser","init","this","getRouteUrl","setCurrentRoute","home","grecaptchaInstance","otp","canCheckNationalId","nationalId","hashed","enableRecaptcha","setCode","code","getElementById","remove","convertToEnglishNumerals","inputValue","arabicNumerals","englishNumerals","i","length","regex","RegExp","replace","parseInt","grecaptcha","location","reload","onRecaptchaLoaded","render","$watch","newValue","map","x","toString","hashids","encode","isValidNationalId","type","substr","sum","trim","isNaN","num","digit","Number","ZFOdd","slice","showTour","tour","Tour","useModalOverlay","defaultStepOptions","classes","scrollTo","addStep","id","canClickTarget","attachTo","element","on","buttons","action","complete","secondary","modalOverlayOpeningPadding","start","enterExam","getResponse","$refs","startExamForm","submit","exam","call","canStart","examLink","setExam","script","currentQuestion","currentQuestionIndex","percentage","isLast","allAnswered","showedWarning","currentQuestionCounter","totalQuestions","answers","myTimer","slug","IsSubmitting","loadFromSession","savedState","sessionStorage","getItem","JSON","parse","answersState","keys","Date","getTime","expire","clearSession","watchDataChanges","setItem","stringify","removeItem","questions","addEventListener","event","preventDefault","evt","clipboardData","setData","onkeydown","setInterval","calculateExamDetails","title","html","showCancelButton","confirmButtonText","confirmButtonColor","allowOutsideClick","back","nextQuestion","CurrentQuestion","_e","_f","_g","entries","filter","s","lastQuestion","showError","prevQuestion","AllAnswered","submitForm","attempt","success","res","post","Answers","data","setTimeout","href","returnUrl","startDate","endDate","examEndTime","currentTime","remainingTimeMs","remainingHours","Math","floor","remainingMinutes","remainingSeconds","examFinished","magic","test","detectLanguage","token","interceptors","request","use","axiosRequest","axiosResponse","Error","validation","errorMessage","serverError","firstKey","errors","firstError","errorHandler","setupAxiosMiddleware","forEach","component","querySelector","errorText","textContent"],"sourceRoot":""}