PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.8
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / assets / js / dist / admin / admin-orders.js

admin-orders.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.8, at assets/js/dist/admin/admin-orders.js

1,603 lines 54.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./assets/src/js/admin/orders/export-orders.js"
5 /*!*****************************************************!*\
6 !*** ./assets/src/js/admin/orders/export-orders.js ***!
7 \*****************************************************/
8 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ ExportOrdersToCSV: () => (/* binding */ ExportOrdersToCSV)
14 /* harmony export */ });
15 /* harmony import */ var lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lpAssetsJsPath/utils.js */ "./assets/src/js/utils.js");
16 /* harmony import */ var lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lpAssetsJsPath/lpToastify */ "./assets/src/js/lpToastify.js");
17
18
19 const ExportOrdersToCSV = () => {
20 const handleExport = args => {
21 const {
22 e,
23 target
24 } = args;
25 e.preventDefault();
26 lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(target, true);
27 let dataSend = JSON.parse(target.dataset.send);
28 const callBack = {
29 success: response => {
30 const {
31 message,
32 status,
33 data
34 } = response;
35 if (status === 'success') {
36 const maxPage = data?.max_page;
37 const nextPage = data?.next_page;
38 const done = data?.done;
39 const downloadUrl = data?.download_url;
40 if (!!maxPage && !!nextPage && nextPage <= maxPage) {
41 dataSend = {
42 ...dataSend,
43 paged: nextPage
44 };
45 window.lpAJAXG.fetchAJAX(dataSend, callBack);
46 } else if (!!done) {
47 lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__.show(message, 'success');
48 const link = document.createElement('a');
49 link.href = downloadUrl;
50 link.target = '_self';
51 document.body.appendChild(link);
52 link.click();
53 document.body.removeChild(link);
54 }
55 } else {
56 throw message;
57 }
58 },
59 error: error => {
60 lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__.show(error, 'error');
61 },
62 completed: () => {
63 lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(target, false);
64 }
65 };
66 window.lpAJAXG.fetchAJAX(dataSend, callBack);
67 };
68 lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.eventHandlers('click', [{
69 selector: '.lp-btn-export-order-to-csv',
70 class: undefined,
71 callBack: handleExport
72 }]);
73 };
74
75 /***/ },
76
77 /***/ "./assets/src/js/lpToastify.js"
78 /*!*************************************!*\
79 !*** ./assets/src/js/lpToastify.js ***!
80 \*************************************/
81 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
82
83 "use strict";
84 __webpack_require__.r(__webpack_exports__);
85 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
86 /* harmony export */ show: () => (/* binding */ show)
87 /* harmony export */ });
88 /* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! toastify-js */ "./node_modules/toastify-js/src/toastify.js");
89 /* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(toastify_js__WEBPACK_IMPORTED_MODULE_0__);
90 /* harmony import */ var toastify_js_src_toastify_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! toastify-js/src/toastify.css */ "./node_modules/toastify-js/src/toastify.css");
91 /**
92 * Utils functions
93 *
94 * @param url
95 * @param data
96 * @param functions
97 * @since 4.3.0
98 * @version 1.0.0
99 */
100
101
102 const argsToastify = {
103 text: '',
104 gravity: lpData.toast.gravity,
105 // `top` or `bottom`
106 position: lpData.toast.position,
107 // `left`, `center` or `right`
108 className: `${lpData.toast.classPrefix}`,
109 close: lpData.toast.close == 1,
110 stopOnFocus: lpData.toast.stopOnFocus == 1,
111 duration: lpData.toast.duration
112 };
113 const show = (message, status = 'success', argsCustom) => {
114 let args = argsToastify;
115 if (argsCustom) {
116 args = {
117 ...args,
118 ...argsCustom
119 };
120 }
121 const toastify = new (toastify_js__WEBPACK_IMPORTED_MODULE_0___default())({
122 ...args,
123 text: message,
124 className: `${lpData.toast.classPrefix} ${status}`
125 });
126 toastify.showToast();
127 };
128
129 /***/ },
130
131 /***/ "./assets/src/js/utils.js"
132 /*!********************************!*\
133 !*** ./assets/src/js/utils.js ***!
134 \********************************/
135 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
136
137 "use strict";
138 __webpack_require__.r(__webpack_exports__);
139 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
140 /* harmony export */ debounce: () => (/* binding */ debounce),
141 /* harmony export */ eventHandlers: () => (/* binding */ eventHandlers),
142 /* harmony export */ getDataOfForm: () => (/* binding */ getDataOfForm),
143 /* harmony export */ getFieldKeysOfForm: () => (/* binding */ getFieldKeysOfForm),
144 /* harmony export */ listenElementCreated: () => (/* binding */ listenElementCreated),
145 /* harmony export */ listenElementViewed: () => (/* binding */ listenElementViewed),
146 /* harmony export */ lpAddQueryArgs: () => (/* binding */ lpAddQueryArgs),
147 /* harmony export */ lpAjaxParseJsonOld: () => (/* binding */ lpAjaxParseJsonOld),
148 /* harmony export */ lpClassName: () => (/* binding */ lpClassName),
149 /* harmony export */ lpFetchAPI: () => (/* binding */ lpFetchAPI),
150 /* harmony export */ lpGetCurrentURLNoParam: () => (/* binding */ lpGetCurrentURLNoParam),
151 /* harmony export */ lpOnElementReady: () => (/* binding */ lpOnElementReady),
152 /* harmony export */ lpSetLoadingEl: () => (/* binding */ lpSetLoadingEl),
153 /* harmony export */ lpShowHideEl: () => (/* binding */ lpShowHideEl),
154 /* harmony export */ mergeDataWithDatForm: () => (/* binding */ mergeDataWithDatForm),
155 /* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse)
156 /* harmony export */ });
157 /**
158 * Utils functions
159 *
160 * @param url
161 * @param data
162 * @param functions
163 * @since 4.2.5.1
164 * @version 1.0.6
165 */
166 const lpClassName = {
167 hidden: 'lp-hidden',
168 loading: 'loading',
169 elCollapse: 'lp-collapse',
170 elSectionToggle: '.lp-section-toggle',
171 elTriggerToggle: '.lp-trigger-toggle'
172 };
173 const lpFetchAPI = (url, data = {}, functions = {}) => {
174 if ('function' === typeof functions.before) {
175 functions.before();
176 }
177 fetch(url, {
178 method: 'GET',
179 ...data
180 }).then(response => response.json()).then(response => {
181 if ('function' === typeof functions.success) {
182 functions.success(response);
183 }
184 }).catch(err => {
185 if ('function' === typeof functions.error) {
186 functions.error(err);
187 }
188 }).finally(() => {
189 if ('function' === typeof functions.completed) {
190 functions.completed();
191 }
192 });
193 };
194
195 /**
196 * Get current URL without params.
197 *
198 * @since 4.2.5.1
199 */
200 const lpGetCurrentURLNoParam = () => {
201 let currentUrl = window.location.href;
202 const hasParams = currentUrl.includes('?');
203 if (hasParams) {
204 currentUrl = currentUrl.split('?')[0];
205 }
206 return currentUrl;
207 };
208 const lpAddQueryArgs = (endpoint, args) => {
209 const url = new URL(endpoint);
210 Object.keys(args).forEach(arg => {
211 url.searchParams.set(arg, args[arg]);
212 });
213 return url;
214 };
215
216 /**
217 * Listen element viewed.
218 *
219 * @param el
220 * @param callback
221 * @since 4.2.5.8
222 */
223 const listenElementViewed = (el, callback) => {
224 const observerSeeItem = new IntersectionObserver(function (entries) {
225 for (const entry of entries) {
226 if (entry.isIntersecting) {
227 callback(entry);
228 }
229 }
230 });
231 observerSeeItem.observe(el);
232 };
233
234 /**
235 * Listen element created.
236 *
237 * @param callback
238 * @since 4.2.5.8
239 */
240 const listenElementCreated = callback => {
241 const observerCreateItem = new MutationObserver(function (mutations) {
242 mutations.forEach(function (mutation) {
243 if (mutation.addedNodes) {
244 mutation.addedNodes.forEach(function (node) {
245 if (node.nodeType === 1) {
246 callback(node);
247 }
248 });
249 }
250 });
251 });
252 observerCreateItem.observe(document, {
253 childList: true,
254 subtree: true
255 });
256 // End.
257 };
258
259 /**
260 * Listen element created.
261 *
262 * @param selector
263 * @param callback
264 * @since 4.2.7.1
265 */
266 const lpOnElementReady = (selector, callback) => {
267 const element = document.querySelector(selector);
268 if (element) {
269 callback(element);
270 return;
271 }
272 const observer = new MutationObserver((mutations, obs) => {
273 const element = document.querySelector(selector);
274 if (element) {
275 obs.disconnect();
276 callback(element);
277 }
278 });
279 observer.observe(document.documentElement, {
280 childList: true,
281 subtree: true
282 });
283 };
284
285 // Parse JSON from string with content include LP_AJAX_START.
286 const lpAjaxParseJsonOld = data => {
287 if (typeof data !== 'string') {
288 return data;
289 }
290 const m = String.raw({
291 raw: data
292 }).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s);
293 try {
294 if (m) {
295 data = JSON.parse(m[1].replace(/(?:\r\n|\r|\n)/g, ''));
296 } else {
297 data = JSON.parse(data);
298 }
299 } catch (e) {
300 data = {};
301 }
302 return data;
303 };
304
305 // status 0: hide, 1: show
306 const lpShowHideEl = (el, status = 0) => {
307 if (!el) {
308 return;
309 }
310 if (!status) {
311 el.classList.add(lpClassName.hidden);
312 } else {
313 el.classList.remove(lpClassName.hidden);
314 }
315 };
316
317 // status 0: hide, 1: show
318 const lpSetLoadingEl = (el, status) => {
319 if (!el) {
320 return;
321 }
322 if (!status) {
323 el.classList.remove(lpClassName.loading);
324 } else {
325 el.classList.add(lpClassName.loading);
326 }
327 };
328
329 // Toggle collapse section
330 const toggleCollapse = (e, target, elTriggerClassName = '', elsExclude = [], callback) => {
331 if (!elTriggerClassName) {
332 elTriggerClassName = lpClassName.elTriggerToggle;
333 }
334
335 // Exclude elements, which should not trigger the collapse toggle
336 if (elsExclude && elsExclude.length > 0) {
337 for (const elExclude of elsExclude) {
338 if (target.closest(elExclude)) {
339 return;
340 }
341 }
342 }
343 const elTrigger = target.closest(elTriggerClassName);
344 if (!elTrigger) {
345 return;
346 }
347
348 //console.log( 'elTrigger', elTrigger );
349
350 const elSectionToggle = elTrigger.closest(`${lpClassName.elSectionToggle}`);
351 if (!elSectionToggle) {
352 return;
353 }
354 elSectionToggle.classList.toggle(`${lpClassName.elCollapse}`);
355 if ('function' === typeof callback) {
356 callback(elSectionToggle);
357 }
358 };
359
360 // Get data of form
361 const getDataOfForm = form => {
362 const dataSend = {};
363 const formData = new FormData(form);
364 for (const pair of formData.entries()) {
365 const key = pair[0];
366 const value = formData.getAll(key);
367 if (!dataSend.hasOwnProperty(key)) {
368 // Convert value array to string.
369 dataSend[key] = value.join(',');
370 }
371 }
372 return dataSend;
373 };
374
375 // Get field keys of form
376 const getFieldKeysOfForm = form => {
377 const keys = [];
378 const elements = form.elements;
379 for (let i = 0; i < elements.length; i++) {
380 const name = elements[i].name;
381 if (name && !keys.includes(name)) {
382 keys.push(name);
383 }
384 }
385 return keys;
386 };
387
388 // Merge data handle with data form.
389 const mergeDataWithDatForm = (elForm, dataHandle) => {
390 const dataForm = getDataOfForm(elForm);
391 const keys = getFieldKeysOfForm(elForm);
392 keys.forEach(key => {
393 if (!dataForm.hasOwnProperty(key)) {
394 delete dataHandle[key];
395 } else if (dataForm[key][0] === '') {
396 delete dataForm[key];
397 delete dataHandle[key];
398 }
399 });
400 dataHandle = {
401 ...dataHandle,
402 ...dataForm
403 };
404 return dataHandle;
405 };
406
407 /**
408 * Event trigger
409 * For each list of event handlers, listen event on document.
410 *
411 * eventName: 'click', 'change', ...
412 * eventHandlers = [ { selector: '.lp-button', callBack: function(){}, class: object } ]
413 *
414 * @param eventName
415 * @param eventHandlers
416 */
417 const eventHandlers = (eventName, eventHandlers) => {
418 document.addEventListener(eventName, e => {
419 const target = e.target;
420 let args = {
421 e,
422 target
423 };
424 eventHandlers.forEach(eventHandler => {
425 args = {
426 ...args,
427 ...eventHandler
428 };
429
430 //console.log( args );
431
432 // Check condition before call back
433 if (eventHandler.conditionBeforeCallBack) {
434 if (eventHandler.conditionBeforeCallBack(args) !== true) {
435 return;
436 }
437 }
438
439 // Special check for keydown event with checkIsEventEnter = true
440 if (eventName === 'keydown' && eventHandler.checkIsEventEnter) {
441 if (e.key !== 'Enter') {
442 return;
443 }
444 }
445 if (target.closest(eventHandler.selector)) {
446 if (eventHandler.class) {
447 // Call method of class, function callBack will understand exactly {this} is class object.
448 eventHandler.class[eventHandler.callBack](args);
449 } else {
450 // For send args is objected, {this} is eventHandler object, not class object.
451 eventHandler.callBack(args);
452 }
453 }
454 });
455 });
456 };
457
458 /**
459 * Debounce - delays function execution until after `wait` ms of inactivity.
460 *
461 * Each call resets the timer. Only the last call in a burst executes.
462 *
463 * USE CASES:
464 * - Search inputs, form validation, window resize
465 * - Multiple elements need independent timers
466 * - When you need to call with different arguments
467 *
468 * EXAMPLES:
469 * const debouncedSearch = debounce( (query) => fetchResults(query), 300 );
470 * searchInput.addEventListener('input', (e) => debouncedSearch(e.target.value));
471 *
472 * const debouncedResize = debounce( recalculateLayout, 250 );
473 * window.addEventListener('resize', debouncedResize);
474 *
475 * ⚠️ Create ONCE outside event handlers, not inside.
476 *
477 * @param {Function} func - Function to debounce (can be anonymous)
478 * @param {number} wait - Milliseconds to wait (default: 500)
479 * @return {Function} Debounced wrapper function
480 * @since 4.3.7
481 * @version 1.0.0
482 */
483 const debounce = (func, wait = 500) => {
484 let timer;
485 return args => {
486 clearTimeout(timer);
487 timer = setTimeout(() => func(args), wait);
488 };
489 };
490
491 /***/ },
492
493 /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css"
494 /*!*****************************************************************************************!*\
495 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css ***!
496 \*****************************************************************************************/
497 (module, __webpack_exports__, __webpack_require__) {
498
499 "use strict";
500 __webpack_require__.r(__webpack_exports__);
501 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
502 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
503 /* harmony export */ });
504 /* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
505 /* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
506 /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
507 /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
508 // Imports
509
510
511 var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
512 // Module
513 ___CSS_LOADER_EXPORT___.push([module.id, `/*!
514 * Toastify js 1.12.0
515 * https://github.com/apvarun/toastify-js
516 * @license MIT licensed
517 *
518 * Copyright (C) 2018 Varun A P
519 */
520
521 .toastify {
522 padding: 12px 20px;
523 color: #ffffff;
524 display: inline-block;
525 box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);
526 background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);
527 background: linear-gradient(135deg, #73a5ff, #5477f5);
528 position: fixed;
529 opacity: 0;
530 transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
531 border-radius: 2px;
532 cursor: pointer;
533 text-decoration: none;
534 max-width: calc(50% - 20px);
535 z-index: 2147483647;
536 }
537
538 .toastify.on {
539 opacity: 1;
540 }
541
542 .toast-close {
543 background: transparent;
544 border: 0;
545 color: white;
546 cursor: pointer;
547 font-family: inherit;
548 font-size: 1em;
549 opacity: 0.4;
550 padding: 0 5px;
551 }
552
553 .toastify-right {
554 right: 15px;
555 }
556
557 .toastify-left {
558 left: 15px;
559 }
560
561 .toastify-top {
562 top: -150px;
563 }
564
565 .toastify-bottom {
566 bottom: -150px;
567 }
568
569 .toastify-rounded {
570 border-radius: 25px;
571 }
572
573 .toastify-avatar {
574 width: 1.5em;
575 height: 1.5em;
576 margin: -7px 5px;
577 border-radius: 2px;
578 }
579
580 .toastify-center {
581 margin-left: auto;
582 margin-right: auto;
583 left: 0;
584 right: 0;
585 max-width: fit-content;
586 max-width: -moz-fit-content;
587 }
588
589 @media only screen and (max-width: 360px) {
590 .toastify-right, .toastify-left {
591 margin-left: auto;
592 margin-right: auto;
593 left: 0;
594 right: 0;
595 max-width: fit-content;
596 }
597 }
598 `, "",{"version":3,"sources":["webpack://./node_modules/toastify-js/src/toastify.css"],"names":[],"mappings":"AAAA;;;;;;EAME;;AAEF;IACI,kBAAkB;IAClB,cAAc;IACd,qBAAqB;IACrB,uFAAuF;IACvF,6DAA6D;IAC7D,qDAAqD;IACrD,eAAe;IACf,UAAU;IACV,wDAAwD;IACxD,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,2BAA2B;IAC3B,mBAAmB;AACvB;;AAEA;IACI,UAAU;AACd;;AAEA;IACI,uBAAuB;IACvB,SAAS;IACT,YAAY;IACZ,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,YAAY;IACZ,cAAc;AAClB;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,UAAU;AACd;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,kBAAkB;AACtB;;AAEA;IACI,iBAAiB;IACjB,kBAAkB;IAClB,OAAO;IACP,QAAQ;IACR,sBAAsB;IACtB,2BAA2B;AAC/B;;AAEA;IACI;QACI,iBAAiB;QACjB,kBAAkB;QAClB,OAAO;QACP,QAAQ;QACR,sBAAsB;IAC1B;AACJ","sourcesContent":["/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n\n.toastify {\n padding: 12px 20px;\n color: #ffffff;\n display: inline-block;\n box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);\n background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);\n background: linear-gradient(135deg, #73a5ff, #5477f5);\n position: fixed;\n opacity: 0;\n transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);\n border-radius: 2px;\n cursor: pointer;\n text-decoration: none;\n max-width: calc(50% - 20px);\n z-index: 2147483647;\n}\n\n.toastify.on {\n opacity: 1;\n}\n\n.toast-close {\n background: transparent;\n border: 0;\n color: white;\n cursor: pointer;\n font-family: inherit;\n font-size: 1em;\n opacity: 0.4;\n padding: 0 5px;\n}\n\n.toastify-right {\n right: 15px;\n}\n\n.toastify-left {\n left: 15px;\n}\n\n.toastify-top {\n top: -150px;\n}\n\n.toastify-bottom {\n bottom: -150px;\n}\n\n.toastify-rounded {\n border-radius: 25px;\n}\n\n.toastify-avatar {\n width: 1.5em;\n height: 1.5em;\n margin: -7px 5px;\n border-radius: 2px;\n}\n\n.toastify-center {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n max-width: -moz-fit-content;\n}\n\n@media only screen and (max-width: 360px) {\n .toastify-right, .toastify-left {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n }\n}\n"],"sourceRoot":""}]);
599 // Exports
600 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
601
602
603 /***/ },
604
605 /***/ "./node_modules/css-loader/dist/runtime/api.js"
606 /*!*****************************************************!*\
607 !*** ./node_modules/css-loader/dist/runtime/api.js ***!
608 \*****************************************************/
609 (module) {
610
611 "use strict";
612
613
614 /*
615 MIT License http://www.opensource.org/licenses/mit-license.php
616 Author Tobias Koppers @sokra
617 */
618 module.exports = function (cssWithMappingToString) {
619 var list = [];
620
621 // return the list of modules as css string
622 list.toString = function toString() {
623 return this.map(function (item) {
624 var content = "";
625 var needLayer = typeof item[5] !== "undefined";
626 if (item[4]) {
627 content += "@supports (".concat(item[4], ") {");
628 }
629 if (item[2]) {
630 content += "@media ".concat(item[2], " {");
631 }
632 if (needLayer) {
633 content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
634 }
635 content += cssWithMappingToString(item);
636 if (needLayer) {
637 content += "}";
638 }
639 if (item[2]) {
640 content += "}";
641 }
642 if (item[4]) {
643 content += "}";
644 }
645 return content;
646 }).join("");
647 };
648
649 // import a list of modules into the list
650 list.i = function i(modules, media, dedupe, supports, layer) {
651 if (typeof modules === "string") {
652 modules = [[null, modules, undefined]];
653 }
654 var alreadyImportedModules = {};
655 if (dedupe) {
656 for (var k = 0; k < this.length; k++) {
657 var id = this[k][0];
658 if (id != null) {
659 alreadyImportedModules[id] = true;
660 }
661 }
662 }
663 for (var _k = 0; _k < modules.length; _k++) {
664 var item = [].concat(modules[_k]);
665 if (dedupe && alreadyImportedModules[item[0]]) {
666 continue;
667 }
668 if (typeof layer !== "undefined") {
669 if (typeof item[5] === "undefined") {
670 item[5] = layer;
671 } else {
672 item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
673 item[5] = layer;
674 }
675 }
676 if (media) {
677 if (!item[2]) {
678 item[2] = media;
679 } else {
680 item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
681 item[2] = media;
682 }
683 }
684 if (supports) {
685 if (!item[4]) {
686 item[4] = "".concat(supports);
687 } else {
688 item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
689 item[4] = supports;
690 }
691 }
692 list.push(item);
693 }
694 };
695 return list;
696 };
697
698 /***/ },
699
700 /***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js"
701 /*!************************************************************!*\
702 !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
703 \************************************************************/
704 (module) {
705
706 "use strict";
707
708
709 module.exports = function (item) {
710 var content = item[1];
711 var cssMapping = item[3];
712 if (!cssMapping) {
713 return content;
714 }
715 if (typeof btoa === "function") {
716 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
717 var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
718 var sourceMapping = "/*# ".concat(data, " */");
719 return [content].concat([sourceMapping]).join("\n");
720 }
721 return [content].join("\n");
722 };
723
724 /***/ },
725
726 /***/ "./node_modules/toastify-js/src/toastify.css"
727 /*!***************************************************!*\
728 !*** ./node_modules/toastify-js/src/toastify.css ***!
729 \***************************************************/
730 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
731
732 "use strict";
733 __webpack_require__.r(__webpack_exports__);
734 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
735 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
736 /* harmony export */ });
737 /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
738 /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
739 /* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
740 /* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
741 /* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
742 /* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
743 /* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
744 /* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
745 /* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
746 /* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
747 /* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
748 /* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
749 /* harmony import */ var _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../css-loader/dist/cjs.js!./toastify.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css");
750
751
752
753
754
755
756
757
758
759
760
761 var options = {};
762
763 options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
764 options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
765
766 options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
767
768 options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
769 options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
770
771 var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
772
773
774
775
776 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
777
778
779 /***/ },
780
781 /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
782 /*!****************************************************************************!*\
783 !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
784 \****************************************************************************/
785 (module) {
786
787 "use strict";
788
789
790 var stylesInDOM = [];
791 function getIndexByIdentifier(identifier) {
792 var result = -1;
793 for (var i = 0; i < stylesInDOM.length; i++) {
794 if (stylesInDOM[i].identifier === identifier) {
795 result = i;
796 break;
797 }
798 }
799 return result;
800 }
801 function modulesToDom(list, options) {
802 var idCountMap = {};
803 var identifiers = [];
804 for (var i = 0; i < list.length; i++) {
805 var item = list[i];
806 var id = options.base ? item[0] + options.base : item[0];
807 var count = idCountMap[id] || 0;
808 var identifier = "".concat(id, " ").concat(count);
809 idCountMap[id] = count + 1;
810 var indexByIdentifier = getIndexByIdentifier(identifier);
811 var obj = {
812 css: item[1],
813 media: item[2],
814 sourceMap: item[3],
815 supports: item[4],
816 layer: item[5]
817 };
818 if (indexByIdentifier !== -1) {
819 stylesInDOM[indexByIdentifier].references++;
820 stylesInDOM[indexByIdentifier].updater(obj);
821 } else {
822 var updater = addElementStyle(obj, options);
823 options.byIndex = i;
824 stylesInDOM.splice(i, 0, {
825 identifier: identifier,
826 updater: updater,
827 references: 1
828 });
829 }
830 identifiers.push(identifier);
831 }
832 return identifiers;
833 }
834 function addElementStyle(obj, options) {
835 var api = options.domAPI(options);
836 api.update(obj);
837 var updater = function updater(newObj) {
838 if (newObj) {
839 if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
840 return;
841 }
842 api.update(obj = newObj);
843 } else {
844 api.remove();
845 }
846 };
847 return updater;
848 }
849 module.exports = function (list, options) {
850 options = options || {};
851 list = list || [];
852 var lastIdentifiers = modulesToDom(list, options);
853 return function update(newList) {
854 newList = newList || [];
855 for (var i = 0; i < lastIdentifiers.length; i++) {
856 var identifier = lastIdentifiers[i];
857 var index = getIndexByIdentifier(identifier);
858 stylesInDOM[index].references--;
859 }
860 var newLastIdentifiers = modulesToDom(newList, options);
861 for (var _i = 0; _i < lastIdentifiers.length; _i++) {
862 var _identifier = lastIdentifiers[_i];
863 var _index = getIndexByIdentifier(_identifier);
864 if (stylesInDOM[_index].references === 0) {
865 stylesInDOM[_index].updater();
866 stylesInDOM.splice(_index, 1);
867 }
868 }
869 lastIdentifiers = newLastIdentifiers;
870 };
871 };
872
873 /***/ },
874
875 /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js"
876 /*!********************************************************************!*\
877 !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
878 \********************************************************************/
879 (module) {
880
881 "use strict";
882
883
884 var memo = {};
885
886 /* istanbul ignore next */
887 function getTarget(target) {
888 if (typeof memo[target] === "undefined") {
889 var styleTarget = document.querySelector(target);
890
891 // Special case to return head of iframe instead of iframe itself
892 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
893 try {
894 // This will throw an exception if access to iframe is blocked
895 // due to cross-origin restrictions
896 styleTarget = styleTarget.contentDocument.head;
897 } catch (e) {
898 // istanbul ignore next
899 styleTarget = null;
900 }
901 }
902 memo[target] = styleTarget;
903 }
904 return memo[target];
905 }
906
907 /* istanbul ignore next */
908 function insertBySelector(insert, style) {
909 var target = getTarget(insert);
910 if (!target) {
911 throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
912 }
913 target.appendChild(style);
914 }
915 module.exports = insertBySelector;
916
917 /***/ },
918
919 /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js"
920 /*!**********************************************************************!*\
921 !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
922 \**********************************************************************/
923 (module) {
924
925 "use strict";
926
927
928 /* istanbul ignore next */
929 function insertStyleElement(options) {
930 var element = document.createElement("style");
931 options.setAttributes(element, options.attributes);
932 options.insert(element, options.options);
933 return element;
934 }
935 module.exports = insertStyleElement;
936
937 /***/ },
938
939 /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
940 /*!**********************************************************************************!*\
941 !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
942 \**********************************************************************************/
943 (module, __unused_webpack_exports, __webpack_require__) {
944
945 "use strict";
946
947
948 /* istanbul ignore next */
949 function setAttributesWithoutAttributes(styleElement) {
950 var nonce = true ? __webpack_require__.nc : 0;
951 if (nonce) {
952 styleElement.setAttribute("nonce", nonce);
953 }
954 }
955 module.exports = setAttributesWithoutAttributes;
956
957 /***/ },
958
959 /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js"
960 /*!***************************************************************!*\
961 !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
962 \***************************************************************/
963 (module) {
964
965 "use strict";
966
967
968 /* istanbul ignore next */
969 function apply(styleElement, options, obj) {
970 var css = "";
971 if (obj.supports) {
972 css += "@supports (".concat(obj.supports, ") {");
973 }
974 if (obj.media) {
975 css += "@media ".concat(obj.media, " {");
976 }
977 var needLayer = typeof obj.layer !== "undefined";
978 if (needLayer) {
979 css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
980 }
981 css += obj.css;
982 if (needLayer) {
983 css += "}";
984 }
985 if (obj.media) {
986 css += "}";
987 }
988 if (obj.supports) {
989 css += "}";
990 }
991 var sourceMap = obj.sourceMap;
992 if (sourceMap && typeof btoa !== "undefined") {
993 css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
994 }
995
996 // For old IE
997 /* istanbul ignore if */
998 options.styleTagTransform(css, styleElement, options.options);
999 }
1000 function removeStyleElement(styleElement) {
1001 // istanbul ignore if
1002 if (styleElement.parentNode === null) {
1003 return false;
1004 }
1005 styleElement.parentNode.removeChild(styleElement);
1006 }
1007
1008 /* istanbul ignore next */
1009 function domAPI(options) {
1010 if (typeof document === "undefined") {
1011 return {
1012 update: function update() {},
1013 remove: function remove() {}
1014 };
1015 }
1016 var styleElement = options.insertStyleElement(options);
1017 return {
1018 update: function update(obj) {
1019 apply(styleElement, options, obj);
1020 },
1021 remove: function remove() {
1022 removeStyleElement(styleElement);
1023 }
1024 };
1025 }
1026 module.exports = domAPI;
1027
1028 /***/ },
1029
1030 /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js"
1031 /*!*********************************************************************!*\
1032 !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
1033 \*********************************************************************/
1034 (module) {
1035
1036 "use strict";
1037
1038
1039 /* istanbul ignore next */
1040 function styleTagTransform(css, styleElement) {
1041 if (styleElement.styleSheet) {
1042 styleElement.styleSheet.cssText = css;
1043 } else {
1044 while (styleElement.firstChild) {
1045 styleElement.removeChild(styleElement.firstChild);
1046 }
1047 styleElement.appendChild(document.createTextNode(css));
1048 }
1049 }
1050 module.exports = styleTagTransform;
1051
1052 /***/ },
1053
1054 /***/ "./node_modules/toastify-js/src/toastify.js"
1055 /*!**************************************************!*\
1056 !*** ./node_modules/toastify-js/src/toastify.js ***!
1057 \**************************************************/
1058 (module) {
1059
1060 /*!
1061 * Toastify js 1.12.0
1062 * https://github.com/apvarun/toastify-js
1063 * @license MIT licensed
1064 *
1065 * Copyright (C) 2018 Varun A P
1066 */
1067 (function(root, factory) {
1068 if ( true && module.exports) {
1069 module.exports = factory();
1070 } else {
1071 root.Toastify = factory();
1072 }
1073 })(this, function(global) {
1074 // Object initialization
1075 var Toastify = function(options) {
1076 // Returning a new init object
1077 return new Toastify.lib.init(options);
1078 },
1079 // Library version
1080 version = "1.12.0";
1081
1082 // Set the default global options
1083 Toastify.defaults = {
1084 oldestFirst: true,
1085 text: "Toastify is awesome!",
1086 node: undefined,
1087 duration: 3000,
1088 selector: undefined,
1089 callback: function () {
1090 },
1091 destination: undefined,
1092 newWindow: false,
1093 close: false,
1094 gravity: "toastify-top",
1095 positionLeft: false,
1096 position: '',
1097 backgroundColor: '',
1098 avatar: "",
1099 className: "",
1100 stopOnFocus: true,
1101 onClick: function () {
1102 },
1103 offset: {x: 0, y: 0},
1104 escapeMarkup: true,
1105 ariaLive: 'polite',
1106 style: {background: ''}
1107 };
1108
1109 // Defining the prototype of the object
1110 Toastify.lib = Toastify.prototype = {
1111 toastify: version,
1112
1113 constructor: Toastify,
1114
1115 // Initializing the object with required parameters
1116 init: function(options) {
1117 // Verifying and validating the input object
1118 if (!options) {
1119 options = {};
1120 }
1121
1122 // Creating the options object
1123 this.options = {};
1124
1125 this.toastElement = null;
1126
1127 // Validating the options
1128 this.options.text = options.text || Toastify.defaults.text; // Display message
1129 this.options.node = options.node || Toastify.defaults.node; // Display content as node
1130 this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
1131 this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
1132 this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
1133 this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
1134 this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
1135 this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
1136 this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
1137 this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
1138 this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
1139 this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
1140 this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
1141 this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
1142 this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
1143 this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
1144 this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
1145 this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
1146 this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
1147 this.options.style = options.style || Toastify.defaults.style;
1148 if(options.backgroundColor) {
1149 this.options.style.background = options.backgroundColor;
1150 }
1151
1152 // Returning the current object for chaining functions
1153 return this;
1154 },
1155
1156 // Building the DOM element
1157 buildToast: function() {
1158 // Validating if the options are defined
1159 if (!this.options) {
1160 throw "Toastify is not initialized";
1161 }
1162
1163 // Creating the DOM object
1164 var divElement = document.createElement("div");
1165 divElement.className = "toastify on " + this.options.className;
1166
1167 // Positioning toast to left or right or center
1168 if (!!this.options.position) {
1169 divElement.className += " toastify-" + this.options.position;
1170 } else {
1171 // To be depreciated in further versions
1172 if (this.options.positionLeft === true) {
1173 divElement.className += " toastify-left";
1174 console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')
1175 } else {
1176 // Default position
1177 divElement.className += " toastify-right";
1178 }
1179 }
1180
1181 // Assigning gravity of element
1182 divElement.className += " " + this.options.gravity;
1183
1184 if (this.options.backgroundColor) {
1185 // This is being deprecated in favor of using the style HTML DOM property
1186 console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
1187 }
1188
1189 // Loop through our style object and apply styles to divElement
1190 for (var property in this.options.style) {
1191 divElement.style[property] = this.options.style[property];
1192 }
1193
1194 // Announce the toast to screen readers
1195 if (this.options.ariaLive) {
1196 divElement.setAttribute('aria-live', this.options.ariaLive)
1197 }
1198
1199 // Adding the toast message/node
1200 if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
1201 // If we have a valid node, we insert it
1202 divElement.appendChild(this.options.node)
1203 } else {
1204 if (this.options.escapeMarkup) {
1205 divElement.innerText = this.options.text;
1206 } else {
1207 divElement.innerHTML = this.options.text;
1208 }
1209
1210 if (this.options.avatar !== "") {
1211 var avatarElement = document.createElement("img");
1212 avatarElement.src = this.options.avatar;
1213
1214 avatarElement.className = "toastify-avatar";
1215
1216 if (this.options.position == "left" || this.options.positionLeft === true) {
1217 // Adding close icon on the left of content
1218 divElement.appendChild(avatarElement);
1219 } else {
1220 // Adding close icon on the right of content
1221 divElement.insertAdjacentElement("afterbegin", avatarElement);
1222 }
1223 }
1224 }
1225
1226 // Adding a close icon to the toast
1227 if (this.options.close === true) {
1228 // Create a span for close element
1229 var closeElement = document.createElement("button");
1230 closeElement.type = "button";
1231 closeElement.setAttribute("aria-label", "Close");
1232 closeElement.className = "toast-close";
1233 closeElement.innerHTML = "&#10006;";
1234
1235 // Triggering the removal of toast from DOM on close click
1236 closeElement.addEventListener(
1237 "click",
1238 function(event) {
1239 event.stopPropagation();
1240 this.removeElement(this.toastElement);
1241 window.clearTimeout(this.toastElement.timeOutValue);
1242 }.bind(this)
1243 );
1244
1245 //Calculating screen width
1246 var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
1247
1248 // Adding the close icon to the toast element
1249 // Display on the right if screen width is less than or equal to 360px
1250 if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
1251 // Adding close icon on the left of content
1252 divElement.insertAdjacentElement("afterbegin", closeElement);
1253 } else {
1254 // Adding close icon on the right of content
1255 divElement.appendChild(closeElement);
1256 }
1257 }
1258
1259 // Clear timeout while toast is focused
1260 if (this.options.stopOnFocus && this.options.duration > 0) {
1261 var self = this;
1262 // stop countdown
1263 divElement.addEventListener(
1264 "mouseover",
1265 function(event) {
1266 window.clearTimeout(divElement.timeOutValue);
1267 }
1268 )
1269 // add back the timeout
1270 divElement.addEventListener(
1271 "mouseleave",
1272 function() {
1273 divElement.timeOutValue = window.setTimeout(
1274 function() {
1275 // Remove the toast from DOM
1276 self.removeElement(divElement);
1277 },
1278 self.options.duration
1279 )
1280 }
1281 )
1282 }
1283
1284 // Adding an on-click destination path
1285 if (typeof this.options.destination !== "undefined") {
1286 divElement.addEventListener(
1287 "click",
1288 function(event) {
1289 event.stopPropagation();
1290 if (this.options.newWindow === true) {
1291 window.open(this.options.destination, "_blank");
1292 } else {
1293 window.location = this.options.destination;
1294 }
1295 }.bind(this)
1296 );
1297 }
1298
1299 if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
1300 divElement.addEventListener(
1301 "click",
1302 function(event) {
1303 event.stopPropagation();
1304 this.options.onClick();
1305 }.bind(this)
1306 );
1307 }
1308
1309 // Adding offset
1310 if(typeof this.options.offset === "object") {
1311
1312 var x = getAxisOffsetAValue("x", this.options);
1313 var y = getAxisOffsetAValue("y", this.options);
1314
1315 var xOffset = this.options.position == "left" ? x : "-" + x;
1316 var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
1317
1318 divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
1319
1320 }
1321
1322 // Returning the generated element
1323 return divElement;
1324 },
1325
1326 // Displaying the toast
1327 showToast: function() {
1328 // Creating the DOM object for the toast
1329 this.toastElement = this.buildToast();
1330
1331 // Getting the root element to with the toast needs to be added
1332 var rootElement;
1333 if (typeof this.options.selector === "string") {
1334 rootElement = document.getElementById(this.options.selector);
1335 } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {
1336 rootElement = this.options.selector;
1337 } else {
1338 rootElement = document.body;
1339 }
1340
1341 // Validating if root element is present in DOM
1342 if (!rootElement) {
1343 throw "Root element is not defined";
1344 }
1345
1346 // Adding the DOM element
1347 var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
1348 rootElement.insertBefore(this.toastElement, elementToInsert);
1349
1350 // Repositioning the toasts in case multiple toasts are present
1351 Toastify.reposition();
1352
1353 if (this.options.duration > 0) {
1354 this.toastElement.timeOutValue = window.setTimeout(
1355 function() {
1356 // Remove the toast from DOM
1357 this.removeElement(this.toastElement);
1358 }.bind(this),
1359 this.options.duration
1360 ); // Binding `this` for function invocation
1361 }
1362
1363 // Supporting function chaining
1364 return this;
1365 },
1366
1367 hideToast: function() {
1368 if (this.toastElement.timeOutValue) {
1369 clearTimeout(this.toastElement.timeOutValue);
1370 }
1371 this.removeElement(this.toastElement);
1372 },
1373
1374 // Removing the element from the DOM
1375 removeElement: function(toastElement) {
1376 // Hiding the element
1377 // toastElement.classList.remove("on");
1378 toastElement.className = toastElement.className.replace(" on", "");
1379
1380 // Removing the element from DOM after transition end
1381 window.setTimeout(
1382 function() {
1383 // remove options node if any
1384 if (this.options.node && this.options.node.parentNode) {
1385 this.options.node.parentNode.removeChild(this.options.node);
1386 }
1387
1388 // Remove the element from the DOM, only when the parent node was not removed before.
1389 if (toastElement.parentNode) {
1390 toastElement.parentNode.removeChild(toastElement);
1391 }
1392
1393 // Calling the callback function
1394 this.options.callback.call(toastElement);
1395
1396 // Repositioning the toasts again
1397 Toastify.reposition();
1398 }.bind(this),
1399 400
1400 ); // Binding `this` for function invocation
1401 },
1402 };
1403
1404 // Positioning the toasts on the DOM
1405 Toastify.reposition = function() {
1406
1407 // Top margins with gravity
1408 var topLeftOffsetSize = {
1409 top: 15,
1410 bottom: 15,
1411 };
1412 var topRightOffsetSize = {
1413 top: 15,
1414 bottom: 15,
1415 };
1416 var offsetSize = {
1417 top: 15,
1418 bottom: 15,
1419 };
1420
1421 // Get all toast messages on the DOM
1422 var allToasts = document.getElementsByClassName("toastify");
1423
1424 var classUsed;
1425
1426 // Modifying the position of each toast element
1427 for (var i = 0; i < allToasts.length; i++) {
1428 // Getting the applied gravity
1429 if (containsClass(allToasts[i], "toastify-top") === true) {
1430 classUsed = "toastify-top";
1431 } else {
1432 classUsed = "toastify-bottom";
1433 }
1434
1435 var height = allToasts[i].offsetHeight;
1436 classUsed = classUsed.substr(9, classUsed.length-1)
1437 // Spacing between toasts
1438 var offset = 15;
1439
1440 var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
1441
1442 // Show toast in center if screen with less than or equal to 360px
1443 if (width <= 360) {
1444 // Setting the position
1445 allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
1446
1447 offsetSize[classUsed] += height + offset;
1448 } else {
1449 if (containsClass(allToasts[i], "toastify-left") === true) {
1450 // Setting the position
1451 allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
1452
1453 topLeftOffsetSize[classUsed] += height + offset;
1454 } else {
1455 // Setting the position
1456 allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
1457
1458 topRightOffsetSize[classUsed] += height + offset;
1459 }
1460 }
1461 }
1462
1463 // Supporting function chaining
1464 return this;
1465 };
1466
1467 // Helper function to get offset.
1468 function getAxisOffsetAValue(axis, options) {
1469
1470 if(options.offset[axis]) {
1471 if(isNaN(options.offset[axis])) {
1472 return options.offset[axis];
1473 }
1474 else {
1475 return options.offset[axis] + 'px';
1476 }
1477 }
1478
1479 return '0px';
1480
1481 }
1482
1483 function containsClass(elem, yourClass) {
1484 if (!elem || typeof yourClass !== "string") {
1485 return false;
1486 } else if (
1487 elem.className &&
1488 elem.className
1489 .trim()
1490 .split(/\s+/gi)
1491 .indexOf(yourClass) > -1
1492 ) {
1493 return true;
1494 } else {
1495 return false;
1496 }
1497 }
1498
1499 // Setting up the prototype for the init object
1500 Toastify.lib.init.prototype = Toastify.lib;
1501
1502 // Returning the Toastify function to be assigned to the window object/module
1503 return Toastify;
1504 });
1505
1506
1507 /***/ }
1508
1509 /******/ });
1510 /************************************************************************/
1511 /******/ // The module cache
1512 /******/ var __webpack_module_cache__ = {};
1513 /******/
1514 /******/ // The require function
1515 /******/ function __webpack_require__(moduleId) {
1516 /******/ // Check if module is in cache
1517 /******/ var cachedModule = __webpack_module_cache__[moduleId];
1518 /******/ if (cachedModule !== undefined) {
1519 /******/ return cachedModule.exports;
1520 /******/ }
1521 /******/ // Create a new module (and put it into the cache)
1522 /******/ var module = __webpack_module_cache__[moduleId] = {
1523 /******/ id: moduleId,
1524 /******/ // no module.loaded needed
1525 /******/ exports: {}
1526 /******/ };
1527 /******/
1528 /******/ // Execute the module function
1529 /******/ if (!(moduleId in __webpack_modules__)) {
1530 /******/ delete __webpack_module_cache__[moduleId];
1531 /******/ var e = new Error("Cannot find module '" + moduleId + "'");
1532 /******/ e.code = 'MODULE_NOT_FOUND';
1533 /******/ throw e;
1534 /******/ }
1535 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1536 /******/
1537 /******/ // Return the exports of the module
1538 /******/ return module.exports;
1539 /******/ }
1540 /******/
1541 /************************************************************************/
1542 /******/ /* webpack/runtime/compat get default export */
1543 /******/ (() => {
1544 /******/ // getDefaultExport function for compatibility with non-harmony modules
1545 /******/ __webpack_require__.n = (module) => {
1546 /******/ var getter = module && module.__esModule ?
1547 /******/ () => (module['default']) :
1548 /******/ () => (module);
1549 /******/ __webpack_require__.d(getter, { a: getter });
1550 /******/ return getter;
1551 /******/ };
1552 /******/ })();
1553 /******/
1554 /******/ /* webpack/runtime/define property getters */
1555 /******/ (() => {
1556 /******/ // define getter functions for harmony exports
1557 /******/ __webpack_require__.d = (exports, definition) => {
1558 /******/ for(var key in definition) {
1559 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1560 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1561 /******/ }
1562 /******/ }
1563 /******/ };
1564 /******/ })();
1565 /******/
1566 /******/ /* webpack/runtime/hasOwnProperty shorthand */
1567 /******/ (() => {
1568 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1569 /******/ })();
1570 /******/
1571 /******/ /* webpack/runtime/make namespace object */
1572 /******/ (() => {
1573 /******/ // define __esModule on exports
1574 /******/ __webpack_require__.r = (exports) => {
1575 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1576 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1577 /******/ }
1578 /******/ Object.defineProperty(exports, '__esModule', { value: true });
1579 /******/ };
1580 /******/ })();
1581 /******/
1582 /******/ /* webpack/runtime/nonce */
1583 /******/ (() => {
1584 /******/ __webpack_require__.nc = undefined;
1585 /******/ })();
1586 /******/
1587 /************************************************************************/
1588 var __webpack_exports__ = {};
1589 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
1590 (() => {
1591 "use strict";
1592 /*!*********************************************!*\
1593 !*** ./assets/src/js/admin/admin-orders.js ***!
1594 \*********************************************/
1595 __webpack_require__.r(__webpack_exports__);
1596 /* harmony import */ var _orders_export_orders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./orders/export-orders */ "./assets/src/js/admin/orders/export-orders.js");
1597
1598 (0,_orders_export_orders__WEBPACK_IMPORTED_MODULE_0__.ExportOrdersToCSV)();
1599 })();
1600
1601 /******/ })()
1602 ;
1603 //# sourceMappingURL=admin-orders.js.map