@appartmint/mint 1.3.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/index.js CHANGED
@@ -1,416 +1,372 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["mint"] = factory();
8
- else
9
- root["mint"] = factory();
10
- })(self, () => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
1
+ /******/ var __webpack_modules__ = ({
14
2
 
15
3
  /***/ "./src/ts/imports/components/header.ts":
16
4
  /*!*********************************************!*\
17
5
  !*** ./src/ts/imports/components/header.ts ***!
18
6
  \*********************************************/
19
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20
-
21
-
22
-
23
- Object.defineProperty(exports, "__esModule", ({
24
- value: true
25
- }));
26
- exports.MintHeader = void 0;
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+ __webpack_require__.r(__webpack_exports__);
10
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
+ /* harmony export */ MintHeader: () => (/* binding */ MintHeader),
12
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13
+ /* harmony export */ });
14
+ /* harmony import */ var _enums_side__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/side */ "./src/ts/imports/enums/side.ts");
15
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ "./src/ts/imports/util/index.ts");
27
16
  /**
28
17
  * Imports
29
18
  */
30
- const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts");
31
- const util_1 = __webpack_require__(/*! ../util */ "./src/ts/imports/util/index.ts");
19
+
20
+
32
21
  /**
33
22
  * Main header functionality
34
23
  * @public
35
24
  */
36
25
  class MintHeader {
37
- /**
38
- * Initializes and closes the menu
39
- */
40
- constructor(settings) {
41
26
  /**
42
27
  * Navbar settings
43
28
  */
44
- this.settings = {
45
- from: enums_1.EMintSide.Top,
46
- fixed: true
29
+ settings = {
30
+ from: _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top,
31
+ fixed: true
47
32
  };
48
33
  /**
49
34
  * Frequently-referenced elements
50
35
  */
51
- this.el = {};
52
- this.settings = Object.assign(Object.assign({}, this.settings), settings);
53
- this.attachElements();
54
- this.attachEvents();
55
- this.addClasses();
56
- }
57
- /**
58
- * Adds elements to {@link el | `this.el`}
59
- */
60
- attachElements() {
61
- var _a;
62
- this.el.html = document.querySelector('html');
63
- this.el.body = document.querySelector('body');
64
- this.el.header = document.getElementById('mint-header');
65
- this.el.mobileButton = ((_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelector(util_1.MintSelectors.controls('mint-wrapper'))) || null;
66
- this.el.wrapper = document.getElementById('mint-wrapper');
67
- }
68
- /**
69
- * Adds events to the dom
70
- */
71
- attachEvents() {
72
- var _a, _b, _c, _d;
73
- window.addEventListener('resize', util_1.MintEvent.throttleEvent(this.eHandleResize.bind(this), util_1.MintSettings.delay.default));
74
- window.addEventListener('scroll', util_1.MintEvent.throttleEvent(this.eHandleScroll.bind(this), util_1.MintSettings.delay.default, {
75
- trailing: false
76
- }));
77
- let focusables = (_a = this.el.header) === null || _a === void 0 ? void 0 : _a.querySelectorAll(util_1.MintSelectors.focusable),
78
- lastFocusable = focusables === null || focusables === void 0 ? void 0 : focusables[(focusables === null || focusables === void 0 ? void 0 : focusables.length) - 1];
79
- lastFocusable === null || lastFocusable === void 0 ? void 0 : lastFocusable.addEventListener('keydown', util_1.MintEvent.throttleEvent(this.eWrapTab.bind(this)));
80
- focusables === null || focusables === void 0 ? void 0 : focusables.forEach(focusable => {
81
- focusable.addEventListener('keydown', util_1.MintEvent.throttleEvent(this.eHandleKeypress.bind(this)));
82
- });
83
- let menuButtons = (_b = this.el.wrapper) === null || _b === void 0 ? void 0 : _b.querySelectorAll(util_1.MintSelectors.controls());
84
- menuButtons === null || menuButtons === void 0 ? void 0 : menuButtons.forEach(menuButton => {
85
- menuButton.addEventListener('click', util_1.MintEvent.throttleEvent(this.eToggleMenu.bind(this), util_1.MintSettings.delay.slow, {
86
- trailing: false
87
- }));
88
- });
89
- (_c = this.el.mobileButton) === null || _c === void 0 ? void 0 : _c.addEventListener('click', util_1.MintEvent.throttleEvent(this.eToggleMobileMenu.bind(this), util_1.MintSettings.delay.slow, {
90
- trailing: false
91
- }));
92
- (_d = this.el.wrapper) === null || _d === void 0 ? void 0 : _d.addEventListener('transitionend', this.eTransitionEnd.bind(this));
93
- }
94
- /**
95
- * Adds classes that inform the styles based on settings
96
- */
97
- addClasses() {
98
- var _a, _b, _c, _d, _e;
99
- (_a = this.el.header) === null || _a === void 0 ? void 0 : _a.classList.remove('mint-top', 'mint-right', 'mint-bottom', 'mint-left');
100
- (_b = this.el.header) === null || _b === void 0 ? void 0 : _b.classList.add(`mint-${enums_1.EMintSide[(_c = this.settings.from) !== null && _c !== void 0 ? _c : 0].toLowerCase()}`);
101
- if (this.settings.fixed) {
102
- (_d = this.el.body) === null || _d === void 0 ? void 0 : _d.classList.add('mint-fixed');
103
- }
104
- if (this.settings.tray) {
105
- (_e = this.el.header) === null || _e === void 0 ? void 0 : _e.classList.add('mint-tray');
106
- }
107
- }
108
- /**
109
- * Sets the state of the mobile menu
110
- * @param open - `true` to open the menu or `false` to close it
111
- */
112
- setMobileMenu() {
113
- let open = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
114
- var _a;
115
- let ariaExpanded = open ? 'true' : 'false',
116
- ariaLabel = open ? 'close menu' : 'open menu';
117
- (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', ariaExpanded);
118
- setTimeout(() => {
119
- var _a;
120
- (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-label', ariaLabel);
121
- }, util_1.MintSettings.delay.fast);
122
- if (open) {
123
- if (this.settings.fixed !== true) {
124
- window.scroll({
125
- top: 0,
126
- left: 0,
127
- behavior: 'smooth'
36
+ el = {};
37
+ /**
38
+ * Initializes and closes the menu
39
+ */
40
+ constructor(settings) {
41
+ this.settings = { ...this.settings, ...settings };
42
+ this.attachElements();
43
+ this.attachEvents();
44
+ this.addClasses();
45
+ }
46
+ /**
47
+ * Adds elements to {@link el | `this.el`}
48
+ */
49
+ attachElements() {
50
+ this.el.html = document.querySelector('html');
51
+ this.el.body = document.querySelector('body');
52
+ this.el.header = document.getElementById('mint-header');
53
+ this.el.mobileButton = this.el.header?.querySelector(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.controls('mint-wrapper')) || null;
54
+ this.el.wrapper = document.getElementById('mint-wrapper');
55
+ }
56
+ /**
57
+ * Adds events to the dom
58
+ */
59
+ attachEvents() {
60
+ window.addEventListener('resize', _util__WEBPACK_IMPORTED_MODULE_1__.MintEvent.throttleEvent(this.eHandleResize.bind(this), _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.default));
61
+ window.addEventListener('scroll', _util__WEBPACK_IMPORTED_MODULE_1__.MintEvent.throttleEvent(this.eHandleScroll.bind(this), _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.default, { trailing: false }));
62
+ let focusables = this.el.header?.querySelectorAll(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.focusable), lastFocusable = focusables?.[focusables?.length - 1];
63
+ lastFocusable?.addEventListener('keydown', _util__WEBPACK_IMPORTED_MODULE_1__.MintEvent.throttleEvent(this.eWrapTab.bind(this)));
64
+ focusables?.forEach((focusable) => {
65
+ focusable.addEventListener('keydown', _util__WEBPACK_IMPORTED_MODULE_1__.MintEvent.throttleEvent(this.eHandleKeypress.bind(this)));
66
+ });
67
+ let menuButtons = this.el.wrapper?.querySelectorAll(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.controls());
68
+ menuButtons?.forEach((menuButton) => {
69
+ menuButton.addEventListener('click', _util__WEBPACK_IMPORTED_MODULE_1__.MintEvent.throttleEvent(this.eToggleMenu.bind(this), _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.slow, { trailing: false }));
70
+ });
71
+ this.el.mobileButton?.addEventListener('click', _util__WEBPACK_IMPORTED_MODULE_1__.MintEvent.throttleEvent(this.eToggleMobileMenu.bind(this), _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.slow, { trailing: false }));
72
+ this.el.wrapper?.addEventListener('transitionend', this.eTransitionEnd.bind(this));
73
+ }
74
+ /**
75
+ * Adds classes that inform the styles based on settings
76
+ */
77
+ addClasses() {
78
+ this.el.header?.classList.remove('mint-top', 'mint-right', 'mint-bottom', 'mint-left');
79
+ this.el.header?.classList.add(`mint-${_enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide[this.settings.from ?? 0].toLowerCase()}`);
80
+ if (this.settings.fixed) {
81
+ this.el.body?.classList.add('mint-fixed');
82
+ }
83
+ if (this.settings.tray) {
84
+ this.el.header?.classList.add('mint-tray');
85
+ }
86
+ }
87
+ /**
88
+ * Sets the state of the mobile menu
89
+ * @param open - `true` to open the menu or `false` to close it
90
+ */
91
+ setMobileMenu(open = false) {
92
+ let ariaExpanded = open ? 'true' : 'false', ariaLabel = open ? 'close menu' : 'open menu';
93
+ this.el.mobileButton?.setAttribute('aria-expanded', ariaExpanded);
94
+ setTimeout(() => {
95
+ this.el.mobileButton?.setAttribute('aria-label', ariaLabel);
96
+ }, _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.fast);
97
+ if (open) {
98
+ if (this.settings.fixed !== true) {
99
+ window.scroll({
100
+ top: 0,
101
+ left: 0,
102
+ behavior: 'smooth'
103
+ });
104
+ }
105
+ setTimeout(() => {
106
+ if (this.el.html) {
107
+ let isMobile = _util__WEBPACK_IMPORTED_MODULE_1__.MintWindow.width() <= _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.break.sm, overflow = 'auto';
108
+ if (this.settings.tray) {
109
+ if (isMobile) {
110
+ overflow = 'hidden';
111
+ }
112
+ }
113
+ else {
114
+ overflow = 'hidden';
115
+ }
116
+ this.el.html.style.overflow = overflow;
117
+ }
118
+ }, this.settings.from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Left ? _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.default : _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.instant);
119
+ if (this.el.wrapper) {
120
+ this.el.wrapper.style.display = 'flex';
121
+ }
122
+ requestAnimationFrame(() => {
123
+ this.el.wrapper?.classList.add('mint-open');
124
+ });
125
+ }
126
+ else {
127
+ if (this.el.html) {
128
+ this.el.html.style.overflow = 'auto';
129
+ }
130
+ requestAnimationFrame(() => {
131
+ this.el.wrapper?.classList.remove('mint-open');
132
+ });
133
+ this.closeAllMenus();
134
+ }
135
+ }
136
+ /**
137
+ * Toggles the state of the mobile menu
138
+ */
139
+ toggleMobileMenu() {
140
+ this.setMobileMenu(this.el.mobileButton?.getAttribute('aria-expanded')?.toLowerCase() === 'false');
141
+ }
142
+ /**
143
+ * Sets the state of the provided button's menu
144
+ * @param button - Button element to set
145
+ * @param open - `true` to open the menu or `false` to close it
146
+ */
147
+ setMenu(button, open = false) {
148
+ let ariaExpanded = open ? 'true' : 'false', menu = button?.nextElementSibling;
149
+ if (button && menu) {
150
+ button.setAttribute('aria-expanded', ariaExpanded);
151
+ if (open) {
152
+ _util__WEBPACK_IMPORTED_MODULE_1__.MintDisplay.show(menu);
153
+ }
154
+ else {
155
+ _util__WEBPACK_IMPORTED_MODULE_1__.MintDisplay.hide(menu);
156
+ this.closeSubMenus(button);
157
+ }
158
+ }
159
+ }
160
+ /**
161
+ * Toggles the state of the provided button's menu
162
+ * @param button - Button element to toggle
163
+ */
164
+ toggleMenu(button) {
165
+ this.setMenu(button, button?.getAttribute('aria-expanded')?.toLowerCase() !== 'true');
166
+ }
167
+ /**
168
+ * Closes all submenus of the provided button's menu
169
+ * @param button - Button element of the parent menu
170
+ */
171
+ closeSubMenus(button) {
172
+ let menu = button?.nextElementSibling, subMenus = menu?.querySelectorAll(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.subMenuButtons);
173
+ subMenus.forEach((child) => {
174
+ // setMenu calls this function, so ignore subsub menus
175
+ if (child.parentElement?.parentElement === menu) {
176
+ this.setMenu(child);
177
+ }
178
+ });
179
+ }
180
+ /**
181
+ * Closes all sibling menus of the provided button's menu
182
+ * @param button - Button element of the sibling menus
183
+ */
184
+ closeSiblingMenus(button) {
185
+ let menu = button?.parentElement, siblingMenus = menu?.parentElement?.querySelectorAll(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.subMenuButtons);
186
+ siblingMenus.forEach((child) => {
187
+ if (child !== button) {
188
+ this.setMenu(child);
189
+ }
190
+ });
191
+ }
192
+ /**
193
+ * Closes all submenus of the n4vbar
194
+ */
195
+ closeAllMenus() {
196
+ let menuButtons = this.el.wrapper?.querySelectorAll(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.subMenuButtons);
197
+ menuButtons?.forEach((menuButton) => {
198
+ this.setMenu(menuButton);
128
199
  });
129
- }
130
- setTimeout(() => {
200
+ }
201
+ /**
202
+ * Opens the menu closest to the document's focus
203
+ */
204
+ openClosestMenu() {
205
+ let activeButton = document.activeElement, activeMenu = activeButton?.nextElementSibling, showing = activeButton?.getAttribute('aria-expanded')?.toLowerCase() === 'true';
206
+ if (activeButton?.getAttribute('aria-controls') === 'mint-wrapper') {
207
+ activeMenu = this.el.wrapper;
208
+ }
209
+ if (activeButton?.getAttribute('aria-controls') && activeMenu && !showing) {
210
+ activeButton.click();
211
+ let firstFocusable = activeMenu.querySelector(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.focusable);
212
+ firstFocusable?.focus();
213
+ }
214
+ }
215
+ /**
216
+ * Closes the menu closest to the document's focus
217
+ */
218
+ closeClosestMenu() {
219
+ let activeElement = document.activeElement, activeMenu = activeElement?.closest(_util__WEBPACK_IMPORTED_MODULE_1__.MintSelectors.subMenu), activeButton = activeMenu?.previousElementSibling ? activeMenu.previousElementSibling : this.el.mobileButton;
220
+ if (activeElement?.getAttribute('aria-controls') && activeElement?.getAttribute('aria-expanded')?.toLowerCase() === 'true') {
221
+ activeButton = activeElement;
222
+ }
223
+ if (activeButton?.getAttribute('aria-expanded')?.toLowerCase() === 'true') {
224
+ activeButton?.click();
225
+ activeButton?.focus();
226
+ }
227
+ }
228
+ /**
229
+ * Toggles the menu closest to the document's focus
230
+ */
231
+ toggleClosestMenu() {
232
+ if (document.activeElement?.getAttribute('aria-expanded')?.toLowerCase() === 'true') {
233
+ this.closeClosestMenu();
234
+ }
235
+ else {
236
+ this.openClosestMenu();
237
+ }
238
+ }
239
+ /**
240
+ * Closes the mobile menu when the window resizes
241
+ */
242
+ eHandleResize() {
243
+ let isOpen = this.el.mobileButton?.getAttribute('aria-expanded')?.toLowerCase() === 'true', isMobile = _util__WEBPACK_IMPORTED_MODULE_1__.MintWindow.width() <= _util__WEBPACK_IMPORTED_MODULE_1__.MintSettings.break.sm, overflow = 'auto';
244
+ if (isOpen) {
245
+ if (this.settings.tray) {
246
+ if (isMobile) {
247
+ overflow = 'hidden';
248
+ }
249
+ }
250
+ else {
251
+ overflow = 'hidden';
252
+ }
253
+ }
131
254
  if (this.el.html) {
132
- let isMobile = util_1.MintWindow.width() <= util_1.MintSettings.break.sm,
133
- overflow = 'auto';
134
- if (this.settings.tray) {
135
- if (isMobile) {
136
- overflow = 'hidden';
255
+ this.el.html.style.overflow = overflow;
256
+ }
257
+ }
258
+ /**
259
+ * Closes all submenus when the page is scrolled
260
+ */
261
+ eHandleScroll() {
262
+ this.closeAllMenus();
263
+ }
264
+ /**
265
+ * Sends the focus to the menu button after tabbing past the last menu item
266
+ * @param e - Keyboard event
267
+ */
268
+ eWrapTab(e) {
269
+ if (e.key.toLowerCase() === 'tab' && !e.shiftKey) {
270
+ this.el.mobileButton?.focus();
271
+ if (document.activeElement === this.el.mobileButton) {
272
+ e.preventDefault();
137
273
  }
138
- } else {
139
- overflow = 'hidden';
140
- }
141
- this.el.html.style.overflow = overflow;
142
274
  }
143
- }, this.settings.from === enums_1.EMintSide.Left ? util_1.MintSettings.delay.default : util_1.MintSettings.delay.instant);
144
- if (this.el.wrapper) {
145
- this.el.wrapper.style.display = 'flex';
146
- }
147
- requestAnimationFrame(() => {
148
- var _a;
149
- (_a = this.el.wrapper) === null || _a === void 0 ? void 0 : _a.classList.add('mint-open');
150
- });
151
- } else {
152
- if (this.el.html) {
153
- this.el.html.style.overflow = 'auto';
154
- }
155
- requestAnimationFrame(() => {
156
- var _a;
157
- (_a = this.el.wrapper) === null || _a === void 0 ? void 0 : _a.classList.remove('mint-open');
158
- });
159
- this.closeAllMenus();
160
- }
161
- }
162
- /**
163
- * Toggles the state of the mobile menu
164
- */
165
- toggleMobileMenu() {
166
- var _a, _b;
167
- this.setMobileMenu(((_b = (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'false');
168
- }
169
- /**
170
- * Sets the state of the provided button's menu
171
- * @param button - Button element to set
172
- * @param open - `true` to open the menu or `false` to close it
173
- */
174
- setMenu(button) {
175
- let open = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
176
- let ariaExpanded = open ? 'true' : 'false',
177
- menu = button === null || button === void 0 ? void 0 : button.nextElementSibling;
178
- if (button && menu) {
179
- button.setAttribute('aria-expanded', ariaExpanded);
180
- if (open) {
181
- util_1.MintDisplay.show(menu);
182
- } else {
183
- util_1.MintDisplay.hide(menu);
184
- this.closeSubMenus(button);
185
- }
186
- }
187
- }
188
- /**
189
- * Toggles the state of the provided button's menu
190
- * @param button - Button element to toggle
191
- */
192
- toggleMenu(button) {
193
- var _a;
194
- this.setMenu(button, ((_a = button === null || button === void 0 ? void 0 : button.getAttribute('aria-expanded')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'true');
195
- }
196
- /**
197
- * Closes all submenus of the provided button's menu
198
- * @param button - Button element of the parent menu
199
- */
200
- closeSubMenus(button) {
201
- let menu = button === null || button === void 0 ? void 0 : button.nextElementSibling,
202
- subMenus = menu === null || menu === void 0 ? void 0 : menu.querySelectorAll(util_1.MintSelectors.subMenuButtons);
203
- subMenus.forEach(child => {
204
- var _a;
205
- // setMenu calls this function, so ignore subsub menus
206
- if (((_a = child.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === menu) {
207
- this.setMenu(child);
208
- }
209
- });
210
- }
211
- /**
212
- * Closes all sibling menus of the provided button's menu
213
- * @param button - Button element of the sibling menus
214
- */
215
- closeSiblingMenus(button) {
216
- var _a;
217
- let menu = button === null || button === void 0 ? void 0 : button.parentElement,
218
- siblingMenus = (_a = menu === null || menu === void 0 ? void 0 : menu.parentElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll(util_1.MintSelectors.subMenuButtons);
219
- siblingMenus.forEach(child => {
220
- if (child !== button) {
221
- this.setMenu(child);
222
- }
223
- });
224
- }
225
- /**
226
- * Closes all submenus of the n4vbar
227
- */
228
- closeAllMenus() {
229
- var _a;
230
- let menuButtons = (_a = this.el.wrapper) === null || _a === void 0 ? void 0 : _a.querySelectorAll(util_1.MintSelectors.subMenuButtons);
231
- menuButtons === null || menuButtons === void 0 ? void 0 : menuButtons.forEach(menuButton => {
232
- this.setMenu(menuButton);
233
- });
234
- }
235
- /**
236
- * Opens the menu closest to the document's focus
237
- */
238
- openClosestMenu() {
239
- var _a;
240
- let activeButton = document.activeElement,
241
- activeMenu = activeButton === null || activeButton === void 0 ? void 0 : activeButton.nextElementSibling,
242
- showing = ((_a = activeButton === null || activeButton === void 0 ? void 0 : activeButton.getAttribute('aria-expanded')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'true';
243
- if ((activeButton === null || activeButton === void 0 ? void 0 : activeButton.getAttribute('aria-controls')) === 'mint-wrapper') {
244
- activeMenu = this.el.wrapper;
245
- }
246
- if ((activeButton === null || activeButton === void 0 ? void 0 : activeButton.getAttribute('aria-controls')) && activeMenu && !showing) {
247
- activeButton.click();
248
- let firstFocusable = activeMenu.querySelector(util_1.MintSelectors.focusable);
249
- firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
250
- }
251
- }
252
- /**
253
- * Closes the menu closest to the document's focus
254
- */
255
- closeClosestMenu() {
256
- var _a, _b;
257
- let activeElement = document.activeElement,
258
- activeMenu = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest(util_1.MintSelectors.subMenu),
259
- activeButton = (activeMenu === null || activeMenu === void 0 ? void 0 : activeMenu.previousElementSibling) ? activeMenu.previousElementSibling : this.el.mobileButton;
260
- if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute('aria-controls')) && ((_a = activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute('aria-expanded')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'true') {
261
- activeButton = activeElement;
262
- }
263
- if (((_b = activeButton === null || activeButton === void 0 ? void 0 : activeButton.getAttribute('aria-expanded')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'true') {
264
- activeButton === null || activeButton === void 0 ? void 0 : activeButton.click();
265
- activeButton === null || activeButton === void 0 ? void 0 : activeButton.focus();
266
- }
267
- }
268
- /**
269
- * Toggles the menu closest to the document's focus
270
- */
271
- toggleClosestMenu() {
272
- var _a, _b;
273
- if (((_b = (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'true') {
274
- this.closeClosestMenu();
275
- } else {
276
- this.openClosestMenu();
277
- }
278
- }
279
- /**
280
- * Closes the mobile menu when the window resizes
281
- */
282
- eHandleResize() {
283
- var _a, _b;
284
- let isOpen = ((_b = (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'true',
285
- isMobile = util_1.MintWindow.width() <= util_1.MintSettings.break.sm,
286
- overflow = 'auto';
287
- if (isOpen) {
288
- if (this.settings.tray) {
289
- if (isMobile) {
290
- overflow = 'hidden';
275
+ }
276
+ /**
277
+ * Handles keypresses on n4vbar buttons
278
+ * @param e - Keyboard event
279
+ */
280
+ eHandleButtonKeypress(e) {
281
+ let target = e.target, subMenu = target?.closest('li');
282
+ switch (e.key.toLowerCase()) {
283
+ case 'escape':
284
+ if (subMenu?.classList.contains('mint-open')) {
285
+ this.setMenu(subMenu);
286
+ }
287
+ else {
288
+ this.setMobileMenu();
289
+ this.el.menuButton?.focus();
290
+ }
291
+ break;
292
+ case 'arrowleft':
293
+ this.closeClosestMenu();
294
+ break;
295
+ case 'arrowright':
296
+ this.openClosestMenu();
297
+ break;
298
+ case 'enter':
299
+ case 'space':
300
+ target?.click();
301
+ break;
302
+ }
303
+ }
304
+ /**
305
+ * Handles keypresses on n4vbar links
306
+ * @param e - Keyboard event
307
+ */
308
+ eHandleLinkKeypress(e) {
309
+ let target = e.target;
310
+ switch (e.key.toLowerCase()) {
311
+ case 'escape':
312
+ case 'arrowleft':
313
+ this.closeClosestMenu();
314
+ break;
315
+ case 'arrowright':
316
+ this.openClosestMenu();
317
+ break;
318
+ case 'enter':
319
+ case 'space':
320
+ target?.click();
321
+ break;
322
+ }
323
+ }
324
+ /**
325
+ * Handles keypresses on the n4vbar
326
+ * @param e - Keyboard event
327
+ */
328
+ eHandleKeypress(e) {
329
+ if (e.key.toLowerCase() !== 'tab') {
330
+ e.preventDefault();
331
+ }
332
+ const target = e.target;
333
+ switch (target?.tagName.toLowerCase()) {
334
+ case 'a':
335
+ this.eHandleLinkKeypress(e);
336
+ break;
337
+ case 'button':
338
+ this.eHandleButtonKeypress(e);
339
+ break;
291
340
  }
292
- } else {
293
- overflow = 'hidden';
294
- }
295
- }
296
- if (this.el.html) {
297
- this.el.html.style.overflow = overflow;
298
- }
299
- }
300
- /**
301
- * Closes all submenus when the page is scrolled
302
- */
303
- eHandleScroll() {
304
- this.closeAllMenus();
305
- }
306
- /**
307
- * Sends the focus to the menu button after tabbing past the last menu item
308
- * @param e - Keyboard event
309
- */
310
- eWrapTab(e) {
311
- var _a;
312
- if (e.key.toLowerCase() === 'tab' && !e.shiftKey) {
313
- (_a = this.el.mobileButton) === null || _a === void 0 ? void 0 : _a.focus();
314
- if (document.activeElement === this.el.mobileButton) {
315
- e.preventDefault();
316
- }
317
- }
318
- }
319
- /**
320
- * Handles keypresses on n4vbar buttons
321
- * @param e - Keyboard event
322
- */
323
- eHandleButtonKeypress(e) {
324
- var _a;
325
- let target = e.target,
326
- subMenu = target === null || target === void 0 ? void 0 : target.closest('li');
327
- switch (e.key.toLowerCase()) {
328
- case 'escape':
329
- if (subMenu === null || subMenu === void 0 ? void 0 : subMenu.classList.contains('mint-open')) {
330
- this.setMenu(subMenu);
331
- } else {
332
- this.setMobileMenu();
333
- (_a = this.el.menuButton) === null || _a === void 0 ? void 0 : _a.focus();
341
+ }
342
+ /**
343
+ * Toggles the mobile menu
344
+ */
345
+ eToggleMobileMenu() {
346
+ this.toggleMobileMenu();
347
+ }
348
+ /**
349
+ * Toggles the clicked submenu
350
+ * @param e - Mouse event
351
+ */
352
+ eToggleMenu(e) {
353
+ let target = e.target;
354
+ this.closeSiblingMenus(target);
355
+ this.toggleMenu(target);
356
+ }
357
+ /**
358
+ * Runs after the mobile menu transitions
359
+ */
360
+ eTransitionEnd() {
361
+ if (this.el.wrapper?.classList.contains('mint-open') === false) {
362
+ this.el.wrapper.style.display = 'none';
334
363
  }
335
- break;
336
- case 'arrowleft':
337
- this.closeClosestMenu();
338
- break;
339
- case 'arrowright':
340
- this.openClosestMenu();
341
- break;
342
- case 'enter':
343
- case 'space':
344
- target === null || target === void 0 ? void 0 : target.click();
345
- break;
346
- }
347
- }
348
- /**
349
- * Handles keypresses on n4vbar links
350
- * @param e - Keyboard event
351
- */
352
- eHandleLinkKeypress(e) {
353
- let target = e.target;
354
- switch (e.key.toLowerCase()) {
355
- case 'escape':
356
- case 'arrowleft':
357
- this.closeClosestMenu();
358
- break;
359
- case 'arrowright':
360
- this.openClosestMenu();
361
- break;
362
- case 'enter':
363
- case 'space':
364
- target === null || target === void 0 ? void 0 : target.click();
365
- break;
366
- }
367
- }
368
- /**
369
- * Handles keypresses on the n4vbar
370
- * @param e - Keyboard event
371
- */
372
- eHandleKeypress(e) {
373
- if (e.key.toLowerCase() !== 'tab') {
374
- e.preventDefault();
375
- }
376
- const target = e.target;
377
- switch (target === null || target === void 0 ? void 0 : target.tagName.toLowerCase()) {
378
- case 'a':
379
- this.eHandleLinkKeypress(e);
380
- break;
381
- case 'button':
382
- this.eHandleButtonKeypress(e);
383
- break;
384
- }
385
- }
386
- /**
387
- * Toggles the mobile menu
388
- */
389
- eToggleMobileMenu() {
390
- this.toggleMobileMenu();
391
- }
392
- /**
393
- * Toggles the clicked submenu
394
- * @param e - Mouse event
395
- */
396
- eToggleMenu(e) {
397
- let target = e.target;
398
- this.closeSiblingMenus(target);
399
- this.toggleMenu(target);
400
- }
401
- /**
402
- * Runs after the mobile menu transitions
403
- */
404
- eTransitionEnd() {
405
- var _a;
406
- if (((_a = this.el.wrapper) === null || _a === void 0 ? void 0 : _a.classList.contains('mint-open')) === false) {
407
- this.el.wrapper.style.display = 'none';
408
- }
409
- }
364
+ }
365
+ ;
410
366
  }
411
- exports.MintHeader = MintHeader;
412
367
  ;
413
- exports["default"] = MintHeader;
368
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintHeader);
369
+
414
370
 
415
371
  /***/ }),
416
372
 
@@ -418,36 +374,18 @@ exports["default"] = MintHeader;
418
374
  /*!********************************************!*\
419
375
  !*** ./src/ts/imports/components/index.ts ***!
420
376
  \********************************************/
421
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
422
-
377
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
423
378
 
424
-
425
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
426
- if (k2 === undefined) k2 = k;
427
- var desc = Object.getOwnPropertyDescriptor(m, k);
428
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
429
- desc = {
430
- enumerable: true,
431
- get: function () {
432
- return m[k];
433
- }
434
- };
435
- }
436
- Object.defineProperty(o, k2, desc);
437
- } : function (o, m, k, k2) {
438
- if (k2 === undefined) k2 = k;
439
- o[k2] = m[k];
440
- });
441
- var __exportStar = this && this.__exportStar || function (m, exports) {
442
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
443
- };
444
- Object.defineProperty(exports, "__esModule", ({
445
- value: true
446
- }));
379
+ __webpack_require__.r(__webpack_exports__);
380
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
381
+ /* harmony export */ MintHeader: () => (/* reexport safe */ _header__WEBPACK_IMPORTED_MODULE_0__.MintHeader)
382
+ /* harmony export */ });
383
+ /* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./header */ "./src/ts/imports/components/header.ts");
447
384
  /**
448
385
  * Forward all exports from the components directory
449
386
  */
450
- __exportStar(__webpack_require__(/*! ./header */ "./src/ts/imports/components/header.ts"), exports);
387
+
388
+
451
389
 
452
390
  /***/ }),
453
391
 
@@ -455,36 +393,18 @@ __exportStar(__webpack_require__(/*! ./header */ "./src/ts/imports/components/he
455
393
  /*!***************************************!*\
456
394
  !*** ./src/ts/imports/enums/index.ts ***!
457
395
  \***************************************/
458
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
459
-
460
-
396
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
461
397
 
462
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
463
- if (k2 === undefined) k2 = k;
464
- var desc = Object.getOwnPropertyDescriptor(m, k);
465
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
466
- desc = {
467
- enumerable: true,
468
- get: function () {
469
- return m[k];
470
- }
471
- };
472
- }
473
- Object.defineProperty(o, k2, desc);
474
- } : function (o, m, k, k2) {
475
- if (k2 === undefined) k2 = k;
476
- o[k2] = m[k];
477
- });
478
- var __exportStar = this && this.__exportStar || function (m, exports) {
479
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
480
- };
481
- Object.defineProperty(exports, "__esModule", ({
482
- value: true
483
- }));
398
+ __webpack_require__.r(__webpack_exports__);
399
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
400
+ /* harmony export */ EMintSide: () => (/* reexport safe */ _side__WEBPACK_IMPORTED_MODULE_0__.EMintSide)
401
+ /* harmony export */ });
402
+ /* harmony import */ var _side__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./side */ "./src/ts/imports/enums/side.ts");
484
403
  /**
485
404
  * Forward all exports from the enums directory
486
405
  */
487
- __exportStar(__webpack_require__(/*! ./side */ "./src/ts/imports/enums/side.ts"), exports);
406
+
407
+
488
408
 
489
409
  /***/ }),
490
410
 
@@ -492,65 +412,64 @@ __exportStar(__webpack_require__(/*! ./side */ "./src/ts/imports/enums/side.ts")
492
412
  /*!**************************************!*\
493
413
  !*** ./src/ts/imports/enums/side.ts ***!
494
414
  \**************************************/
495
- /***/ ((__unused_webpack_module, exports) => {
496
-
415
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
497
416
 
498
-
499
- Object.defineProperty(exports, "__esModule", ({
500
- value: true
501
- }));
502
- exports.EMintSide = void 0;
417
+ __webpack_require__.r(__webpack_exports__);
418
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
419
+ /* harmony export */ EMintSide: () => (/* binding */ EMintSide)
420
+ /* harmony export */ });
503
421
  /**
504
422
  * Side Enum
505
423
  */
506
424
  var EMintSide;
507
425
  (function (EMintSide) {
508
- EMintSide[EMintSide["Top"] = 0] = "Top";
509
- EMintSide[EMintSide["Right"] = 1] = "Right";
510
- EMintSide[EMintSide["Bottom"] = 2] = "Bottom";
511
- EMintSide[EMintSide["Left"] = 3] = "Left";
512
- })(EMintSide = exports.EMintSide || (exports.EMintSide = {}));
426
+ EMintSide[EMintSide["Top"] = 0] = "Top";
427
+ EMintSide[EMintSide["Right"] = 1] = "Right";
428
+ EMintSide[EMintSide["Bottom"] = 2] = "Bottom";
429
+ EMintSide[EMintSide["Left"] = 3] = "Left";
430
+ })(EMintSide || (EMintSide = {}));
513
431
  ;
514
432
 
433
+
515
434
  /***/ }),
516
435
 
517
436
  /***/ "./src/ts/imports/index.ts":
518
437
  /*!*********************************!*\
519
438
  !*** ./src/ts/imports/index.ts ***!
520
439
  \*********************************/
521
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
522
-
523
-
524
-
525
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
526
- if (k2 === undefined) k2 = k;
527
- var desc = Object.getOwnPropertyDescriptor(m, k);
528
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
529
- desc = {
530
- enumerable: true,
531
- get: function () {
532
- return m[k];
533
- }
534
- };
535
- }
536
- Object.defineProperty(o, k2, desc);
537
- } : function (o, m, k, k2) {
538
- if (k2 === undefined) k2 = k;
539
- o[k2] = m[k];
540
- });
541
- var __exportStar = this && this.__exportStar || function (m, exports) {
542
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
543
- };
544
- Object.defineProperty(exports, "__esModule", ({
545
- value: true
546
- }));
440
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
441
+
442
+ __webpack_require__.r(__webpack_exports__);
443
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
444
+ /* harmony export */ EMintSide: () => (/* reexport safe */ _enums__WEBPACK_IMPORTED_MODULE_1__.EMintSide),
445
+ /* harmony export */ MintAsync: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintAsync),
446
+ /* harmony export */ MintDisplay: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintDisplay),
447
+ /* harmony export */ MintEvent: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintEvent),
448
+ /* harmony export */ MintHeader: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.MintHeader),
449
+ /* harmony export */ MintIcon: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintIcon),
450
+ /* harmony export */ MintItem: () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_2__.MintItem),
451
+ /* harmony export */ MintList: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintList),
452
+ /* harmony export */ MintMath: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintMath),
453
+ /* harmony export */ MintObject: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintObject),
454
+ /* harmony export */ MintScroll: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintScroll),
455
+ /* harmony export */ MintSelectors: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintSelectors),
456
+ /* harmony export */ MintSettings: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintSettings),
457
+ /* harmony export */ MintText: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintText),
458
+ /* harmony export */ MintWindow: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_3__.MintWindow),
459
+ /* harmony export */ mintColor: () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_2__.mintColor)
460
+ /* harmony export */ });
461
+ /* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components */ "./src/ts/imports/components/index.ts");
462
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enums */ "./src/ts/imports/enums/index.ts");
463
+ /* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./models */ "./src/ts/imports/models/index.ts");
464
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ "./src/ts/imports/util/index.ts");
547
465
  /**
548
466
  * Forward all exports from the imports directory
549
467
  */
550
- __exportStar(__webpack_require__(/*! ./components */ "./src/ts/imports/components/index.ts"), exports);
551
- __exportStar(__webpack_require__(/*! ./enums */ "./src/ts/imports/enums/index.ts"), exports);
552
- __exportStar(__webpack_require__(/*! ./models */ "./src/ts/imports/models/index.ts"), exports);
553
- __exportStar(__webpack_require__(/*! ./util */ "./src/ts/imports/util/index.ts"), exports);
468
+
469
+
470
+
471
+
472
+
554
473
 
555
474
  /***/ }),
556
475
 
@@ -558,101 +477,105 @@ __exportStar(__webpack_require__(/*! ./util */ "./src/ts/imports/util/index.ts")
558
477
  /*!****************************************!*\
559
478
  !*** ./src/ts/imports/models/color.ts ***!
560
479
  \****************************************/
561
- /***/ ((__unused_webpack_module, exports) => {
562
-
480
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
563
481
 
564
-
565
- Object.defineProperty(exports, "__esModule", ({
566
- value: true
567
- }));
568
- exports.mintColor = void 0;
482
+ __webpack_require__.r(__webpack_exports__);
483
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
484
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
485
+ /* harmony export */ mintColor: () => (/* binding */ mintColor)
486
+ /* harmony export */ });
569
487
  /**
570
488
  * Color
571
489
  */
572
490
  class mintColor {
573
- constructor(args) {
574
- this.r = typeof args.r === 'number' ? Math.max(Math.min(args.r, mintColor.hexBase ** 2 - 1), 0) : 0;
575
- this.g = typeof args.g === 'number' ? Math.max(Math.min(args.g, mintColor.hexBase ** 2 - 1), 0) : 0;
576
- this.b = typeof args.b === 'number' ? Math.max(Math.min(args.b, mintColor.hexBase ** 2 - 1), 0) : 0;
577
- this.a = typeof args.a === 'number' ? Math.max(Math.min(args.a, 1), 0) : 1;
578
- if (typeof args.color === 'string') {
579
- this.stringConstructor(args.color);
580
- }
581
- }
582
- /**
583
- * Constructor from a string argument
584
- */
585
- stringConstructor(str) {
586
- if (str.startsWith('#')) {
587
- this.hexConstructor(str);
588
- } else {
589
- if (~str.indexOf('linear-gradient')) {
590
- str = str.substring(str.indexOf('linear-gradient'), str.length);
591
- }
592
- this.rgbConstructor(str);
593
- }
594
- }
595
- /**
596
- * Constructor from a hex argument
597
- */
598
- hexConstructor(hex) {
599
- switch (hex.length) {
600
- case 1:
601
- case 5:
602
- case 6:
603
- return;
604
- case 2:
605
- hex = '#' + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + mintColor.hexMax;
606
- break;
607
- case 3:
608
- hex = '#' + hex[1] + hex[1] + hex[1] + hex[2] + hex[2] + hex[2] + mintColor.hexMax;
609
- break;
610
- case 4:
611
- hex = '#' + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3] + mintColor.hexMax;
612
- break;
613
- case 7:
614
- hex += mintColor.hexMax;
615
- break;
616
- case 8:
617
- hex += hex[hex.length - 1];
618
- break;
619
- default:
620
- hex = hex.substring(0, 9);
621
- }
622
- this.r = parseInt(hex.substring(1, 3), mintColor.hexBase);
623
- this.g = parseInt(hex.substring(3, 5), mintColor.hexBase);
624
- this.b = parseInt(hex.substring(5, 7), mintColor.hexBase);
625
- this.a = parseInt(hex.substring(7, 9), mintColor.hexBase) / mintColor.hexBase ** 2;
626
- }
627
- /**
628
- * Constructor from an rgba argument
629
- */
630
- rgbConstructor(rgb) {
631
- let match = rgb.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);
632
- if (match) {
633
- this.r = parseInt(match[1]);
634
- this.g = parseInt(match[2]);
635
- this.b = parseInt(match[3]);
636
- this.a = parseFloat(match[4]);
637
- }
638
- }
639
- /**
640
- * Returns the perceived brightness of the color
641
- */
642
- getBrightness() {
643
- if (this.a === 0) {
644
- return 262;
645
- }
646
- if (!isNaN(this.r) && !isNaN(this.g) && !isNaN(this.b)) {
647
- return Math.round((this.r * 299 + this.g * 587 + this.b * 144) / 1000);
648
- }
649
- return -1;
650
- }
491
+ static hexBase = 16;
492
+ static hexMax = 'FF';
493
+ r;
494
+ g;
495
+ b;
496
+ a;
497
+ constructor(args) {
498
+ this.r = typeof args.r === 'number' ? Math.max(Math.min(args.r, mintColor.hexBase ** 2 - 1), 0) : 0;
499
+ this.g = typeof args.g === 'number' ? Math.max(Math.min(args.g, mintColor.hexBase ** 2 - 1), 0) : 0;
500
+ this.b = typeof args.b === 'number' ? Math.max(Math.min(args.b, mintColor.hexBase ** 2 - 1), 0) : 0;
501
+ this.a = typeof args.a === 'number' ? Math.max(Math.min(args.a, 1), 0) : 1;
502
+ if (typeof args.color === 'string') {
503
+ this.stringConstructor(args.color);
504
+ }
505
+ }
506
+ /**
507
+ * Constructor from a string argument
508
+ */
509
+ stringConstructor(str) {
510
+ if (str.startsWith('#')) {
511
+ this.hexConstructor(str);
512
+ }
513
+ else {
514
+ if (~str.indexOf('linear-gradient')) {
515
+ str = str.substring(str.indexOf('linear-gradient'), str.length);
516
+ }
517
+ this.rgbConstructor(str);
518
+ }
519
+ }
520
+ /**
521
+ * Constructor from a hex argument
522
+ */
523
+ hexConstructor(hex) {
524
+ switch (hex.length) {
525
+ case 1:
526
+ case 5:
527
+ case 6:
528
+ return;
529
+ case 2:
530
+ hex = '#' + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + mintColor.hexMax;
531
+ break;
532
+ case 3:
533
+ hex = '#' + hex[1] + hex[1] + hex[1] + hex[2] + hex[2] + hex[2] + mintColor.hexMax;
534
+ break;
535
+ case 4:
536
+ hex = '#' + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3] + mintColor.hexMax;
537
+ break;
538
+ case 7:
539
+ hex += mintColor.hexMax;
540
+ break;
541
+ case 8:
542
+ hex += hex[hex.length - 1];
543
+ break;
544
+ default:
545
+ hex = hex.substring(0, 9);
546
+ }
547
+ this.r = parseInt(hex.substring(1, 3), mintColor.hexBase);
548
+ this.g = parseInt(hex.substring(3, 5), mintColor.hexBase);
549
+ this.b = parseInt(hex.substring(5, 7), mintColor.hexBase);
550
+ this.a = parseInt(hex.substring(7, 9), mintColor.hexBase) / mintColor.hexBase ** 2;
551
+ }
552
+ /**
553
+ * Constructor from an rgba argument
554
+ */
555
+ rgbConstructor(rgb) {
556
+ let match = rgb.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);
557
+ if (match) {
558
+ this.r = parseInt(match[1]);
559
+ this.g = parseInt(match[2]);
560
+ this.b = parseInt(match[3]);
561
+ this.a = parseFloat(match[4]);
562
+ }
563
+ }
564
+ /**
565
+ * Returns the perceived brightness of the color
566
+ */
567
+ getBrightness() {
568
+ if (this.a === 0) {
569
+ return 262;
570
+ }
571
+ if (!isNaN(this.r) && !isNaN(this.g) && !isNaN(this.b)) {
572
+ return Math.round((this.r * 299 + this.g * 587 + this.b * 144) / 1000);
573
+ }
574
+ return -1;
575
+ }
651
576
  }
652
- exports.mintColor = mintColor;
653
- mintColor.hexBase = 16;
654
- mintColor.hexMax = 'FF';
655
- exports["default"] = mintColor;
577
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mintColor);
578
+
656
579
 
657
580
  /***/ }),
658
581
 
@@ -660,13 +583,11 @@ exports["default"] = mintColor;
660
583
  /*!***************************************!*\
661
584
  !*** ./src/ts/imports/models/file.ts ***!
662
585
  \***************************************/
663
- /***/ ((__unused_webpack_module, exports) => {
586
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
664
587
 
588
+ __webpack_require__.r(__webpack_exports__);
665
589
 
666
590
 
667
- Object.defineProperty(exports, "__esModule", ({
668
- value: true
669
- }));
670
591
 
671
592
  /***/ }),
672
593
 
@@ -674,41 +595,29 @@ Object.defineProperty(exports, "__esModule", ({
674
595
  /*!****************************************!*\
675
596
  !*** ./src/ts/imports/models/index.ts ***!
676
597
  \****************************************/
677
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
678
-
679
-
680
-
681
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
682
- if (k2 === undefined) k2 = k;
683
- var desc = Object.getOwnPropertyDescriptor(m, k);
684
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
685
- desc = {
686
- enumerable: true,
687
- get: function () {
688
- return m[k];
689
- }
690
- };
691
- }
692
- Object.defineProperty(o, k2, desc);
693
- } : function (o, m, k, k2) {
694
- if (k2 === undefined) k2 = k;
695
- o[k2] = m[k];
696
- });
697
- var __exportStar = this && this.__exportStar || function (m, exports) {
698
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
699
- };
700
- Object.defineProperty(exports, "__esModule", ({
701
- value: true
702
- }));
598
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
599
+
600
+ __webpack_require__.r(__webpack_exports__);
601
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
602
+ /* harmony export */ MintItem: () => (/* reexport safe */ _item__WEBPACK_IMPORTED_MODULE_2__.MintItem),
603
+ /* harmony export */ mintColor: () => (/* reexport safe */ _color__WEBPACK_IMPORTED_MODULE_0__.mintColor)
604
+ /* harmony export */ });
605
+ /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color */ "./src/ts/imports/models/color.ts");
606
+ /* harmony import */ var _file__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./file */ "./src/ts/imports/models/file.ts");
607
+ /* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ "./src/ts/imports/models/item.ts");
608
+ /* harmony import */ var _minify__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./minify */ "./src/ts/imports/models/minify.ts");
609
+ /* harmony import */ var _page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./page */ "./src/ts/imports/models/page.ts");
610
+ /* harmony import */ var _recaptcha__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./recaptcha */ "./src/ts/imports/models/recaptcha.ts");
703
611
  /**
704
612
  * Forward all exports from the models directory
705
613
  */
706
- __exportStar(__webpack_require__(/*! ./color */ "./src/ts/imports/models/color.ts"), exports);
707
- __exportStar(__webpack_require__(/*! ./file */ "./src/ts/imports/models/file.ts"), exports);
708
- __exportStar(__webpack_require__(/*! ./item */ "./src/ts/imports/models/item.ts"), exports);
709
- __exportStar(__webpack_require__(/*! ./minify */ "./src/ts/imports/models/minify.ts"), exports);
710
- __exportStar(__webpack_require__(/*! ./page */ "./src/ts/imports/models/page.ts"), exports);
711
- __exportStar(__webpack_require__(/*! ./recaptcha */ "./src/ts/imports/models/recaptcha.ts"), exports);
614
+
615
+
616
+
617
+
618
+
619
+
620
+
712
621
 
713
622
  /***/ }),
714
623
 
@@ -716,56 +625,83 @@ __exportStar(__webpack_require__(/*! ./recaptcha */ "./src/ts/imports/models/rec
716
625
  /*!***************************************!*\
717
626
  !*** ./src/ts/imports/models/item.ts ***!
718
627
  \***************************************/
719
- /***/ ((__unused_webpack_module, exports) => {
720
-
721
-
628
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
722
629
 
723
- Object.defineProperty(exports, "__esModule", ({
724
- value: true
725
- }));
726
- exports.MintItem = void 0;
630
+ __webpack_require__.r(__webpack_exports__);
631
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
632
+ /* harmony export */ MintItem: () => (/* binding */ MintItem),
633
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
634
+ /* harmony export */ });
727
635
  /**
728
636
  * A generic item
729
- * @note - this class must be convertable with JSON
730
- * - only add strings, numbers, booleans, arrays, and objects
637
+ *
638
+ * @remarks
639
+ * - this class must be convertable with JSON
640
+ * - only add strings, numbers, booleans, arrays, and objects
731
641
  */
732
642
  class MintItem {
733
- constructor() {
734
643
  /**
735
644
  * Item settings
736
645
  */
737
- this.version = 0;
738
- this.priority = 0;
739
- this.price = 0;
740
- this.level = 0;
741
- this.size = 0;
742
- this.num = 0;
743
- this.width = 0;
744
- this.height = 0;
745
- this.active = false;
746
- this.centered = false;
747
- this.disabled = false;
748
- this.private = false;
646
+ version = 0;
647
+ priority = 0;
648
+ price = 0;
649
+ level = 0;
650
+ size = 0;
651
+ num = 0;
652
+ width = 0;
653
+ height = 0;
654
+ active = false;
655
+ centered = false;
656
+ disabled = false;
657
+ private = false;
658
+ /**
659
+ * Item properties
660
+ */
661
+ id;
662
+ slug;
663
+ name;
664
+ title;
665
+ subtitle;
666
+ description;
667
+ category;
668
+ type;
669
+ unit;
670
+ logo;
671
+ icon;
672
+ position;
673
+ transform;
674
+ date;
675
+ /**
676
+ * Item links
677
+ */
678
+ src;
679
+ href;
680
+ target;
681
+ routerLink;
749
682
  /**
750
683
  * Item data
751
684
  */
752
- this.attr = {};
753
- this.params = {};
754
- this.options = {};
755
- this.lists = {};
685
+ attr = {};
686
+ params = {};
687
+ options = {};
688
+ lists = {};
756
689
  /**
757
690
  * Item lists
758
691
  */
759
- this.paragraphs = [];
760
- this.classes = [];
761
- this.items = [];
762
- this.images = [];
763
- this.buttons = [];
764
- }
692
+ paragraphs = [];
693
+ classes = [];
694
+ items = [];
695
+ images = [];
696
+ buttons = [];
697
+ /**
698
+ * Item functions
699
+ */
700
+ click;
765
701
  }
766
- exports.MintItem = MintItem;
767
702
  ;
768
- exports["default"] = MintItem;
703
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintItem);
704
+
769
705
 
770
706
  /***/ }),
771
707
 
@@ -773,13 +709,11 @@ exports["default"] = MintItem;
773
709
  /*!*****************************************!*\
774
710
  !*** ./src/ts/imports/models/minify.ts ***!
775
711
  \*****************************************/
776
- /***/ ((__unused_webpack_module, exports) => {
712
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
777
713
 
714
+ __webpack_require__.r(__webpack_exports__);
778
715
 
779
716
 
780
- Object.defineProperty(exports, "__esModule", ({
781
- value: true
782
- }));
783
717
 
784
718
  /***/ }),
785
719
 
@@ -787,13 +721,11 @@ Object.defineProperty(exports, "__esModule", ({
787
721
  /*!***************************************!*\
788
722
  !*** ./src/ts/imports/models/page.ts ***!
789
723
  \***************************************/
790
- /***/ ((__unused_webpack_module, exports) => {
724
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
791
725
 
726
+ __webpack_require__.r(__webpack_exports__);
792
727
 
793
728
 
794
- Object.defineProperty(exports, "__esModule", ({
795
- value: true
796
- }));
797
729
 
798
730
  /***/ }),
799
731
 
@@ -801,14 +733,12 @@ Object.defineProperty(exports, "__esModule", ({
801
733
  /*!********************************************!*\
802
734
  !*** ./src/ts/imports/models/recaptcha.ts ***!
803
735
  \********************************************/
804
- /***/ ((__unused_webpack_module, exports) => {
736
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
805
737
 
738
+ __webpack_require__.r(__webpack_exports__);
739
+ ;
806
740
 
807
741
 
808
- Object.defineProperty(exports, "__esModule", ({
809
- value: true
810
- }));
811
- ;
812
742
 
813
743
  /***/ }),
814
744
 
@@ -816,28 +746,27 @@ Object.defineProperty(exports, "__esModule", ({
816
746
  /*!**************************************!*\
817
747
  !*** ./src/ts/imports/util/async.ts ***!
818
748
  \**************************************/
819
- /***/ ((__unused_webpack_module, exports) => {
820
-
821
-
749
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
822
750
 
823
- Object.defineProperty(exports, "__esModule", ({
824
- value: true
825
- }));
826
- exports.MintAsync = void 0;
751
+ __webpack_require__.r(__webpack_exports__);
752
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
753
+ /* harmony export */ MintAsync: () => (/* binding */ MintAsync),
754
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
755
+ /* harmony export */ });
827
756
  /**
828
757
  * Handles asynchronous operations
829
758
  */
830
759
  class MintAsync {
831
- /**
832
- * Wait n milliseconds
833
- */
834
- static wait(ms) {
835
- return new Promise(resolve => setTimeout(resolve, ms));
836
- }
760
+ /**
761
+ * Wait n milliseconds
762
+ */
763
+ static wait(ms) {
764
+ return new Promise((resolve) => setTimeout(resolve, ms));
765
+ }
837
766
  }
838
- exports.MintAsync = MintAsync;
839
767
  ;
840
- exports["default"] = MintAsync;
768
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintAsync);
769
+
841
770
 
842
771
  /***/ }),
843
772
 
@@ -845,88 +774,87 @@ exports["default"] = MintAsync;
845
774
  /*!****************************************!*\
846
775
  !*** ./src/ts/imports/util/display.ts ***!
847
776
  \****************************************/
848
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
849
-
850
-
851
-
852
- Object.defineProperty(exports, "__esModule", ({
853
- value: true
854
- }));
855
- exports.MintDisplay = void 0;
777
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
778
+
779
+ __webpack_require__.r(__webpack_exports__);
780
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
781
+ /* harmony export */ MintDisplay: () => (/* binding */ MintDisplay),
782
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
783
+ /* harmony export */ });
784
+ /* harmony import */ var _enums_side__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/side */ "./src/ts/imports/enums/side.ts");
785
+ /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts");
856
786
  /**
857
787
  * Imports
858
788
  */
859
- const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts");
860
- const settings_1 = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts");
789
+
790
+
861
791
  /**
862
792
  * Handles the display of elements
863
793
  */
864
794
  class MintDisplay {
865
- /**
866
- * Sets the element's height to its `innerHeight`, then to `auto` after a delay
867
- * @param el - the element whose height will be set
868
- * @param delay - the amount of time in milliseconds that the show animation will be active
869
- * @param from - the side that the element is animating from
870
- */
871
- static show(el) {
872
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default;
873
- let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enums_1.EMintSide.Top;
874
- if (el) {
875
- el.style.display = '';
876
- requestAnimationFrame(() => {
877
- if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
878
- el.style.height = `${el.scrollHeight}px`;
879
- } else {
880
- el.style.width = `${el.scrollWidth}px`;
795
+ /**
796
+ * Sets the element's height to its `innerHeight`, then to `auto` after a delay
797
+ * @param el - the element whose height will be set
798
+ * @param delay - the amount of time in milliseconds that the show animation will be active
799
+ * @param from - the side that the element is animating from
800
+ */
801
+ static show(el, delay = _settings__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.default, from = _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top) {
802
+ if (el) {
803
+ el.style.display = '';
804
+ requestAnimationFrame(() => {
805
+ if (from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top || from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Bottom) {
806
+ el.style.height = `${el.scrollHeight}px`;
807
+ }
808
+ else {
809
+ el.style.width = `${el.scrollWidth}px`;
810
+ }
811
+ setTimeout(() => {
812
+ if (from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top || from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Bottom) {
813
+ el.style.height = 'auto';
814
+ }
815
+ else {
816
+ el.style.width = 'auto';
817
+ }
818
+ }, delay);
819
+ });
881
820
  }
882
- setTimeout(() => {
883
- if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
884
- el.style.height = 'auto';
885
- } else {
886
- el.style.width = 'auto';
887
- }
888
- }, delay);
889
- });
890
- }
891
- }
892
- /**
893
- * Sets the element's height to 0
894
- * @param el - the element whose height will be set
895
- * @param delay - the amount of time in milliseconds that the show animation will be active
896
- * @param from - the side that the element is animating from
897
- */
898
- static hide(el) {
899
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default;
900
- let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enums_1.EMintSide.Top;
901
- if (el) {
902
- let height = el.scrollHeight,
903
- width = el.scrollWidth,
904
- transition = el.style.transition;
905
- el.style.transition = '';
906
- requestAnimationFrame(() => {
907
- if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
908
- el.style.height = `${height}px`;
909
- } else {
910
- el.style.width = `${width}px`;
821
+ }
822
+ /**
823
+ * Sets the element's height to 0
824
+ * @param el - the element whose height will be set
825
+ * @param delay - the amount of time in milliseconds that the show animation will be active
826
+ * @param from - the side that the element is animating from
827
+ */
828
+ static hide(el, delay = _settings__WEBPACK_IMPORTED_MODULE_1__.MintSettings.delay.default, from = _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top) {
829
+ if (el) {
830
+ let height = el.scrollHeight, width = el.scrollWidth, transition = el.style.transition;
831
+ el.style.transition = '';
832
+ requestAnimationFrame(() => {
833
+ if (from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top || from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Bottom) {
834
+ el.style.height = `${height}px`;
835
+ }
836
+ else {
837
+ el.style.width = `${width}px`;
838
+ }
839
+ el.style.transition = transition;
840
+ requestAnimationFrame(() => {
841
+ if (from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Top || from === _enums_side__WEBPACK_IMPORTED_MODULE_0__.EMintSide.Bottom) {
842
+ el.style.height = '0';
843
+ }
844
+ else {
845
+ el.style.width = '0';
846
+ }
847
+ });
848
+ });
849
+ setTimeout(() => {
850
+ el.style.display = 'none';
851
+ }, delay);
911
852
  }
912
- el.style.transition = transition;
913
- requestAnimationFrame(() => {
914
- if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) {
915
- el.style.height = '0';
916
- } else {
917
- el.style.width = '0';
918
- }
919
- });
920
- });
921
- setTimeout(() => {
922
- el.style.display = 'none';
923
- }, delay);
924
853
  }
925
- }
926
854
  }
927
- exports.MintDisplay = MintDisplay;
928
855
  ;
929
- exports["default"] = MintDisplay;
856
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintDisplay);
857
+
930
858
 
931
859
  /***/ }),
932
860
 
@@ -934,114 +862,98 @@ exports["default"] = MintDisplay;
934
862
  /*!**************************************!*\
935
863
  !*** ./src/ts/imports/util/event.ts ***!
936
864
  \**************************************/
937
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
865
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
938
866
 
867
+ __webpack_require__.r(__webpack_exports__);
868
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
869
+ /* harmony export */ MintEvent: () => (/* binding */ MintEvent),
870
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
871
+ /* harmony export */ });
872
+ /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts");
939
873
 
940
-
941
- var __importDefault = this && this.__importDefault || function (mod) {
942
- return mod && mod.__esModule ? mod : {
943
- "default": mod
944
- };
945
- };
946
- Object.defineProperty(exports, "__esModule", ({
947
- value: true
948
- }));
949
- exports.MintEvent = void 0;
950
- const settings_1 = __importDefault(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"));
951
874
  /**
952
875
  * Event helper functions
953
876
  */
954
877
  class MintEvent {
955
- /**
956
- * Ensures that a function `func` is run only after not being called for `wait` milliseconds
957
- * @param func - the function to debounce
958
- * @param wait - the amount of time to wait before running the function
959
- * @returns - the debounced function
960
- */
961
- static debounce(func) {
962
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
963
- let timer;
964
- return function (e) {
965
- if (timer) {
966
- clearTimeout(timer);
967
- }
968
- timer = setTimeout(func, wait, e);
969
- };
970
- }
971
- /**
972
- * Ensures that a function `func` is run only after not being called for `wait` milliseconds
973
- * @param func - the function to debounce
974
- * @param wait - the amount of time to wait before running the function
975
- * @returns - the debounced function as an EventListener
976
- */
977
- static debounceEvent(func) {
978
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
979
- return MintEvent.debounce(func, wait);
980
- }
981
- /**
982
- * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
983
- * @param func - the function to throttle
984
- * @param wait - the amount of time between function calls
985
- * @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
986
- * @returns - the throttled function
987
- */
988
- static throttle(func) {
989
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
990
- let options = arguments.length > 2 ? arguments[2] : undefined;
991
- let context,
992
- args,
993
- result,
994
- timeout,
995
- previous = 0,
996
- later = function () {
997
- previous = (options === null || options === void 0 ? void 0 : options.leading) === false ? 0 : new Date().getTime();
998
- timeout = 0;
999
- result = func.apply(context, args);
1000
- if (!timeout) {
1001
- context = args = null;
1002
- }
1003
- },
1004
- throttled = function () {
1005
- let now = new Date().getTime();
1006
- if (!previous && (options === null || options === void 0 ? void 0 : options.leading) === false) {
1007
- previous = now;
1008
- }
1009
- let remaining = wait - now + previous;
1010
- context = this;
1011
- args = arguments;
1012
- if (remaining <= 0 || remaining > wait) {
1013
- if (timeout) {
1014
- clearTimeout(timeout);
878
+ /**
879
+ * Ensures that a function `func` is run only after not being called for `wait` milliseconds
880
+ * @param func - the function to debounce
881
+ * @param wait - the amount of time to wait before running the function
882
+ * @returns - the debounced function
883
+ */
884
+ static debounce(func, wait = _settings__WEBPACK_IMPORTED_MODULE_0__["default"].delay.default) {
885
+ let timer;
886
+ return function (e) {
887
+ if (timer) {
888
+ clearTimeout(timer);
889
+ }
890
+ timer = setTimeout(func, wait, e);
891
+ };
892
+ }
893
+ /**
894
+ * Ensures that a function `func` is run only after not being called for `wait` milliseconds
895
+ * @param func - the function to debounce
896
+ * @param wait - the amount of time to wait before running the function
897
+ * @returns - the debounced function as an EventListener
898
+ */
899
+ static debounceEvent(func, wait = _settings__WEBPACK_IMPORTED_MODULE_0__["default"].delay.default) {
900
+ return MintEvent.debounce(func, wait);
901
+ }
902
+ /**
903
+ * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
904
+ * @param func - the function to throttle
905
+ * @param wait - the amount of time between function calls
906
+ * @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
907
+ * @returns - the throttled function
908
+ */
909
+ static throttle(func, wait = _settings__WEBPACK_IMPORTED_MODULE_0__["default"].delay.default, options) {
910
+ let context, args, result, timeout, previous = 0, later = function () {
911
+ previous = options?.leading === false ? 0 : new Date().getTime();
1015
912
  timeout = 0;
1016
- }
1017
- previous = now;
1018
- result = func.apply(context, args);
1019
- if (!timeout) {
1020
- context = args = null;
1021
- }
1022
- } else if (!timeout && (options === null || options === void 0 ? void 0 : options.trailing) !== false) {
1023
- timeout = window.setTimeout(later, remaining);
1024
- }
1025
- return result;
1026
- };
1027
- return throttled;
1028
- }
1029
- /**
1030
- * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
1031
- * @param func - the function to throttle
1032
- * @param wait - the amount of time between function calls
1033
- * @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
1034
- * @returns - the throttled function as an EventListener
1035
- */
1036
- static throttleEvent(func) {
1037
- let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default;
1038
- let options = arguments.length > 2 ? arguments[2] : undefined;
1039
- return MintEvent.throttle(func, wait, options);
1040
- }
913
+ result = func.apply(context, args);
914
+ if (!timeout) {
915
+ context = args = null;
916
+ }
917
+ }, throttled = function () {
918
+ let now = new Date().getTime();
919
+ if (!previous && options?.leading === false) {
920
+ previous = now;
921
+ }
922
+ let remaining = wait - now + previous;
923
+ context = this;
924
+ args = arguments;
925
+ if (remaining <= 0 || remaining > wait) {
926
+ if (timeout) {
927
+ clearTimeout(timeout);
928
+ timeout = 0;
929
+ }
930
+ previous = now;
931
+ result = func.apply(context, args);
932
+ if (!timeout) {
933
+ context = args = null;
934
+ }
935
+ }
936
+ else if (!timeout && options?.trailing !== false) {
937
+ timeout = window.setTimeout(later, remaining);
938
+ }
939
+ return result;
940
+ };
941
+ return throttled;
942
+ }
943
+ /**
944
+ * Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls
945
+ * @param func - the function to throttle
946
+ * @param wait - the amount of time between function calls
947
+ * @param options - leading and trailing options: default = \{ leading: true, trailing, true \}
948
+ * @returns - the throttled function as an EventListener
949
+ */
950
+ static throttleEvent(func, wait = _settings__WEBPACK_IMPORTED_MODULE_0__["default"].delay.default, options) {
951
+ return MintEvent.throttle(func, wait, options);
952
+ }
1041
953
  }
1042
- exports.MintEvent = MintEvent;
1043
954
  ;
1044
- exports["default"] = MintEvent;
955
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintEvent);
956
+
1045
957
 
1046
958
  /***/ }),
1047
959
 
@@ -1049,80 +961,78 @@ exports["default"] = MintEvent;
1049
961
  /*!*************************************!*\
1050
962
  !*** ./src/ts/imports/util/icon.ts ***!
1051
963
  \*************************************/
1052
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1053
-
1054
-
1055
-
1056
- var __importDefault = this && this.__importDefault || function (mod) {
1057
- return mod && mod.__esModule ? mod : {
1058
- "default": mod
1059
- };
1060
- };
1061
- Object.defineProperty(exports, "__esModule", ({
1062
- value: true
1063
- }));
1064
- exports.MintIcon = void 0;
964
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
965
+
966
+ __webpack_require__.r(__webpack_exports__);
967
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
968
+ /* harmony export */ MintIcon: () => (/* binding */ MintIcon),
969
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
970
+ /* harmony export */ });
971
+ /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts");
1065
972
  /**
1066
973
  * Imports
1067
974
  */
1068
- const object_1 = __importDefault(__webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts"));
975
+
1069
976
  /**
1070
977
  * Icon helper functions
1071
978
  */
1072
979
  class MintIcon {
1073
- /**
1074
- * Appends the given icon to the given selector if there is not already an icon appended
1075
- */
1076
- static append(icon, selector) {
1077
- let items = document.querySelectorAll(selector);
1078
- items.forEach(item => {
1079
- let iconElement = document.createElement('i');
1080
- iconElement.classList.add(...icon.split(' '));
1081
- if (!item.querySelector('i')) {
1082
- item.appendChild(iconElement);
1083
- }
1084
- if (iconElement.classList.contains('fa-up-right-from-square')) {
1085
- item.setAttribute('target', '_blank');
1086
- }
1087
- });
1088
- }
1089
- /**
1090
- * Updates the icons
1091
- * @param icons - the icons to update
1092
- */
1093
- static update(icons) {
1094
- let activeIcons = object_1.default.removeValues(Object.assign(Object.assign({}, this.icons), icons), [false]);
1095
- Object.keys(activeIcons).forEach(selector => {
1096
- this.append(activeIcons[selector], selector);
1097
- });
1098
- }
1099
- /**
1100
- * Removes the given icon from the given selector
1101
- * @param icon - the icon to remove
1102
- */
1103
- static remove(icon, selector) {
1104
- let items = document.querySelectorAll(selector);
1105
- items.forEach(item => {
1106
- let iconElement = item.querySelector('i');
1107
- if (iconElement) {
1108
- iconElement.remove();
1109
- }
1110
- });
1111
- }
980
+ /**
981
+ * Default icons
982
+ */
983
+ static icons = {
984
+ 'a[href^="mailto:"]': 'far fa-envelope',
985
+ 'a[href^="tel:"]': 'fas fa-phone-flip',
986
+ 'a[href^="sms:"]': 'far fa-message',
987
+ 'a[href^="https://maps"]': 'fas fa-map-location-dot',
988
+ 'a[href^="http"]': 'fas fa-up-right-from-square'
989
+ };
990
+ /**
991
+ * Appends the given icon to the given selector if there is not already an icon appended
992
+ */
993
+ static append(icon, selector) {
994
+ let items = document.querySelectorAll(selector);
995
+ items.forEach((item) => {
996
+ let iconElement = document.createElement('i');
997
+ iconElement.classList.add(...icon.split(' '));
998
+ if (!item.querySelector('i')) {
999
+ item.appendChild(iconElement);
1000
+ }
1001
+ if (iconElement.classList.contains('fa-up-right-from-square')) {
1002
+ item.setAttribute('target', '_blank');
1003
+ }
1004
+ });
1005
+ }
1006
+ /**
1007
+ * Updates the icons
1008
+ * @param icons - the icons to update
1009
+ */
1010
+ static update(icons) {
1011
+ let activeIcons = _object__WEBPACK_IMPORTED_MODULE_0__["default"].removeValues({
1012
+ ...this.icons,
1013
+ ...icons
1014
+ }, [false]);
1015
+ Object.keys(activeIcons).forEach((selector) => {
1016
+ this.append(activeIcons[selector], selector);
1017
+ });
1018
+ }
1019
+ /**
1020
+ * Removes the given icon from the given selector
1021
+ * @param icon - the icon to remove
1022
+ */
1023
+ static remove(icon, selector) {
1024
+ let items = document.querySelectorAll(selector);
1025
+ items.forEach((item) => {
1026
+ let iconElement = item.querySelector('i');
1027
+ if (iconElement) {
1028
+ iconElement.remove();
1029
+ }
1030
+ });
1031
+ }
1112
1032
  }
1113
- exports.MintIcon = MintIcon;
1114
- /**
1115
- * Default icons
1116
- */
1117
- MintIcon.icons = {
1118
- 'a[href^="mailto:"]': 'far fa-envelope',
1119
- 'a[href^="tel:"]': 'fas fa-phone-flip',
1120
- 'a[href^="sms:"]': 'far fa-message',
1121
- 'a[href^="https://maps"]': 'fas fa-map-location-dot',
1122
- 'a[href^="http"]': 'fas fa-up-right-from-square'
1123
- };
1124
1033
  ;
1125
- exports["default"] = MintIcon;
1034
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintIcon);
1035
+
1126
1036
 
1127
1037
  /***/ }),
1128
1038
 
@@ -1130,102 +1040,105 @@ exports["default"] = MintIcon;
1130
1040
  /*!**************************************!*\
1131
1041
  !*** ./src/ts/imports/util/index.ts ***!
1132
1042
  \**************************************/
1133
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1134
-
1135
-
1136
-
1137
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1138
- if (k2 === undefined) k2 = k;
1139
- var desc = Object.getOwnPropertyDescriptor(m, k);
1140
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1141
- desc = {
1142
- enumerable: true,
1143
- get: function () {
1144
- return m[k];
1145
- }
1146
- };
1147
- }
1148
- Object.defineProperty(o, k2, desc);
1149
- } : function (o, m, k, k2) {
1150
- if (k2 === undefined) k2 = k;
1151
- o[k2] = m[k];
1152
- });
1153
- var __exportStar = this && this.__exportStar || function (m, exports) {
1154
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1155
- };
1156
- Object.defineProperty(exports, "__esModule", ({
1157
- value: true
1158
- }));
1043
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1044
+
1045
+ __webpack_require__.r(__webpack_exports__);
1046
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1047
+ /* harmony export */ MintAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.MintAsync),
1048
+ /* harmony export */ MintDisplay: () => (/* reexport safe */ _display__WEBPACK_IMPORTED_MODULE_1__.MintDisplay),
1049
+ /* harmony export */ MintEvent: () => (/* reexport safe */ _event__WEBPACK_IMPORTED_MODULE_2__.MintEvent),
1050
+ /* harmony export */ MintIcon: () => (/* reexport safe */ _icon__WEBPACK_IMPORTED_MODULE_3__.MintIcon),
1051
+ /* harmony export */ MintList: () => (/* reexport safe */ _list__WEBPACK_IMPORTED_MODULE_4__.MintList),
1052
+ /* harmony export */ MintMath: () => (/* reexport safe */ _math__WEBPACK_IMPORTED_MODULE_5__.MintMath),
1053
+ /* harmony export */ MintObject: () => (/* reexport safe */ _object__WEBPACK_IMPORTED_MODULE_6__.MintObject),
1054
+ /* harmony export */ MintScroll: () => (/* reexport safe */ _scroll__WEBPACK_IMPORTED_MODULE_7__.MintScroll),
1055
+ /* harmony export */ MintSelectors: () => (/* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_8__.MintSelectors),
1056
+ /* harmony export */ MintSettings: () => (/* reexport safe */ _settings__WEBPACK_IMPORTED_MODULE_9__.MintSettings),
1057
+ /* harmony export */ MintText: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_10__.MintText),
1058
+ /* harmony export */ MintWindow: () => (/* reexport safe */ _window__WEBPACK_IMPORTED_MODULE_11__.MintWindow)
1059
+ /* harmony export */ });
1060
+ /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async */ "./src/ts/imports/util/async.ts");
1061
+ /* harmony import */ var _display__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./display */ "./src/ts/imports/util/display.ts");
1062
+ /* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts");
1063
+ /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon */ "./src/ts/imports/util/icon.ts");
1064
+ /* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./list */ "./src/ts/imports/util/list.ts");
1065
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math */ "./src/ts/imports/util/math.ts");
1066
+ /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts");
1067
+ /* harmony import */ var _scroll__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./scroll */ "./src/ts/imports/util/scroll.ts");
1068
+ /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./selectors */ "./src/ts/imports/util/selectors.ts");
1069
+ /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts");
1070
+ /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./src/ts/imports/util/text.ts");
1071
+ /* harmony import */ var _window__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./window */ "./src/ts/imports/util/window.ts");
1159
1072
  /**
1160
1073
  * Forward all exports from the util directory
1161
1074
  */
1162
- __exportStar(__webpack_require__(/*! ./async */ "./src/ts/imports/util/async.ts"), exports);
1163
- __exportStar(__webpack_require__(/*! ./display */ "./src/ts/imports/util/display.ts"), exports);
1164
- __exportStar(__webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts"), exports);
1165
- __exportStar(__webpack_require__(/*! ./icon */ "./src/ts/imports/util/icon.ts"), exports);
1166
- __exportStar(__webpack_require__(/*! ./list */ "./src/ts/imports/util/list.ts"), exports);
1167
- __exportStar(__webpack_require__(/*! ./math */ "./src/ts/imports/util/math.ts"), exports);
1168
- __exportStar(__webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts"), exports);
1169
- __exportStar(__webpack_require__(/*! ./scroll */ "./src/ts/imports/util/scroll.ts"), exports);
1170
- __exportStar(__webpack_require__(/*! ./selectors */ "./src/ts/imports/util/selectors.ts"), exports);
1171
- __exportStar(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"), exports);
1172
- __exportStar(__webpack_require__(/*! ./text */ "./src/ts/imports/util/text.ts"), exports);
1173
- __exportStar(__webpack_require__(/*! ./window */ "./src/ts/imports/util/window.ts"), exports);
1174
1075
 
1175
- /***/ }),
1176
1076
 
1177
- /***/ "./src/ts/imports/util/list.ts":
1178
- /*!*************************************!*\
1179
- !*** ./src/ts/imports/util/list.ts ***!
1180
- \*************************************/
1181
- /***/ ((__unused_webpack_module, exports) => {
1182
1077
 
1183
1078
 
1184
1079
 
1185
- Object.defineProperty(exports, "__esModule", ({
1186
- value: true
1187
- }));
1188
- exports.MintList = void 0;
1189
- /**
1190
- * List functions for the util library
1191
- */
1192
- class MintList {
1193
- /**
1194
- * Returns a copy of the provided list with the items in random order
1195
- * @param list - the list to shuffle
1196
- * @returns - the shuffled list
1197
- */
1198
- static shuffleCopy(list) {
1199
- let copy = [...list];
1200
- for (let i = copy.length - 1; i > 0; i--) {
1201
- const j = Math.floor(Math.random() * (i + 1));
1202
- [copy[i], copy[j]] = [copy[j], copy[i]];
1203
- }
1204
- return copy;
1205
- }
1206
- /**
1207
- * Filters the array in place based on a test condition and returns the filtered array.
1208
- * This method modifies the original array by removing elements that do not pass the test implemented by the provided function.
1209
- *
1210
- * @template T The type of elements in the array.
1211
- * @param {T[]} list The array to filter, which will be modified in place.
1212
- * @param {(item: T) => boolean} test A function that tests each element of the array. Return `true` to keep the element, `false` otherwise.
1213
- * @returns {T[]} The original array with only the elements that passed the test.
1214
- */
1215
- static filter(list, test) {
1216
- let newLength = 0;
1217
- for (let i = 0; i < list.length; i++) {
1218
- if (test(list[i])) {
1219
- list[newLength++] = list[i];
1220
- }
1221
- }
1222
- list.length = newLength;
1223
- return list;
1224
- }
1225
- }
1226
- exports.MintList = MintList;
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+
1089
+ /***/ }),
1090
+
1091
+ /***/ "./src/ts/imports/util/list.ts":
1092
+ /*!*************************************!*\
1093
+ !*** ./src/ts/imports/util/list.ts ***!
1094
+ \*************************************/
1095
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1096
+
1097
+ __webpack_require__.r(__webpack_exports__);
1098
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1099
+ /* harmony export */ MintList: () => (/* binding */ MintList),
1100
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1101
+ /* harmony export */ });
1102
+ /**
1103
+ * List functions for the util library
1104
+ */
1105
+ class MintList {
1106
+ /**
1107
+ * Returns a copy of the provided list with the items in random order
1108
+ * @param list - the list to shuffle
1109
+ * @returns - the shuffled list
1110
+ */
1111
+ static shuffleCopy(list) {
1112
+ let copy = [...list];
1113
+ for (let i = copy.length - 1; i > 0; i--) {
1114
+ const j = Math.floor(Math.random() * (i + 1));
1115
+ [copy[i], copy[j]] = [copy[j], copy[i]];
1116
+ }
1117
+ return copy;
1118
+ }
1119
+ /**
1120
+ * Filters the array in place based on a test condition and returns the filtered array.
1121
+ * This method modifies the original array by removing elements that do not pass the test implemented by the provided function.
1122
+ *
1123
+ * @template T The type of elements in the array.
1124
+ * @param {T[]} list The array to filter, which will be modified in place.
1125
+ * @param {(item: T) => boolean} test A function that tests each element of the array. Return `true` to keep the element, `false` otherwise.
1126
+ * @returns {T[]} The original array with only the elements that passed the test.
1127
+ */
1128
+ static filter(list, test) {
1129
+ let newLength = 0;
1130
+ for (let i = 0; i < list.length; i++) {
1131
+ if (test(list[i])) {
1132
+ list[newLength++] = list[i];
1133
+ }
1134
+ }
1135
+ list.length = newLength;
1136
+ return list;
1137
+ }
1138
+ }
1227
1139
  ;
1228
- exports["default"] = MintList;
1140
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintList);
1141
+
1229
1142
 
1230
1143
  /***/ }),
1231
1144
 
@@ -1233,34 +1146,32 @@ exports["default"] = MintList;
1233
1146
  /*!*************************************!*\
1234
1147
  !*** ./src/ts/imports/util/math.ts ***!
1235
1148
  \*************************************/
1236
- /***/ ((__unused_webpack_module, exports) => {
1237
-
1238
-
1149
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1239
1150
 
1240
- Object.defineProperty(exports, "__esModule", ({
1241
- value: true
1242
- }));
1243
- exports.MintMath = void 0;
1151
+ __webpack_require__.r(__webpack_exports__);
1152
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1153
+ /* harmony export */ MintMath: () => (/* binding */ MintMath),
1154
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1155
+ /* harmony export */ });
1244
1156
  /**
1245
1157
  * Math functions for the util library
1246
1158
  */
1247
1159
  class MintMath {
1248
- /**
1249
- * Get a random integer between min and max
1250
- * @param max Maximum value to return
1251
- * @param min Minimum value to return (default is 0)
1252
- * @returns a random integer between min and max
1253
- */
1254
- static randomInt(max) {
1255
- let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1256
- min = Math.ceil(min);
1257
- max = Math.floor(max);
1258
- return Math.floor(Math.random() * (max - min) + min);
1259
- }
1160
+ /**
1161
+ * Get a random integer between min and max
1162
+ * @param max Maximum value to return
1163
+ * @param min Minimum value to return (default is 0)
1164
+ * @returns a random integer between min and max
1165
+ */
1166
+ static randomInt(max, min = 0) {
1167
+ min = Math.ceil(min);
1168
+ max = Math.floor(max);
1169
+ return Math.floor(Math.random() * (max - min) + min);
1170
+ }
1260
1171
  }
1261
- exports.MintMath = MintMath;
1262
1172
  ;
1263
- exports["default"] = MintMath;
1173
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintMath);
1174
+
1264
1175
 
1265
1176
  /***/ }),
1266
1177
 
@@ -1268,231 +1179,224 @@ exports["default"] = MintMath;
1268
1179
  /*!***************************************!*\
1269
1180
  !*** ./src/ts/imports/util/object.ts ***!
1270
1181
  \***************************************/
1271
- /***/ ((__unused_webpack_module, exports) => {
1182
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1272
1183
 
1273
-
1274
-
1275
- Object.defineProperty(exports, "__esModule", ({
1276
- value: true
1277
- }));
1278
- exports.MintObject = void 0;
1184
+ __webpack_require__.r(__webpack_exports__);
1185
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1186
+ /* harmony export */ MintObject: () => (/* binding */ MintObject),
1187
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1188
+ /* harmony export */ });
1279
1189
  /**
1280
1190
  * Object functions for the util library
1281
1191
  */
1282
1192
  class MintObject {
1283
- /**
1284
- * Returns true if the provided objects have the same entries
1285
- */
1286
- static isSimilar(obj1, obj2) {
1287
- let keys = Object.keys(obj1);
1288
- if (keys.length !== Object.keys(obj2).length) {
1289
- return false;
1290
- }
1291
- let isSimilar = true;
1292
- keys.forEach(key => {
1293
- if (obj1[key] !== obj2[key]) {
1294
- isSimilar = false;
1295
- }
1296
- });
1297
- return isSimilar;
1298
- }
1299
- /**
1300
- * Returns true if the first object has at least the same
1301
- * entries as the second object
1302
- * @param superset - the object to check
1303
- * @param subset - the object whose entries are required
1304
- * @returns - true if the first object is a superset of the second
1305
- * @recursive
1306
- */
1307
- static isSuperset(superset, subset) {
1308
- let isSuperset = true;
1309
- // Base case - if the objects are equal, it is a superset
1310
- if (superset === subset) {
1311
- return isSuperset;
1312
- }
1313
- // If the subset isn't an object or array, and doesn't
1314
- // satisfy the base case, it isn't a superset
1315
- try {
1316
- if (Object.keys(subset).length === 0) {
1317
- return !isSuperset;
1318
- }
1319
- }
1320
- // If the subset is null or undefined, and doesn't satisfy
1321
- // the base case, it isn't a superset
1322
- // TODO: Check if other exceptions could occur
1323
- catch (e) {
1324
- return !isSuperset;
1325
- }
1326
- // If the children of the subset are subsets of the
1327
- // respective children of the superset, it is a superset
1328
- Object.keys(subset).forEach(key => {
1329
- isSuperset = isSuperset && MintObject.isSuperset(superset[key], subset[key]);
1330
- });
1331
- return isSuperset;
1332
- }
1333
- /**
1334
- * Removes object entries by key
1335
- * @alias mintObject.removeKeys
1336
- * @param object - the object to remove entries from
1337
- * @param keys - the keys to remove
1338
- */
1339
- static remove(object, keys) {
1340
- return this.removeKeys(object, keys);
1341
- }
1342
- /**
1343
- * Removes object entries by key
1344
- * @param object - the object to remove entries from
1345
- * @param keys - the keys to remove
1346
- */
1347
- static removeKeys(object, keys) {
1348
- return Object.keys(object).reduce((obj, key) => {
1349
- if (!keys.includes(key)) {
1350
- obj[key] = object[key];
1351
- }
1352
- return obj;
1353
- }, {});
1354
- }
1355
- /**
1356
- * Removes object entries by value
1357
- */
1358
- static removeValues(object, values) {
1359
- return Object.keys(object).reduce((obj, key) => {
1360
- if (!values.includes(object[key])) {
1361
- obj[key] = object[key];
1362
- }
1363
- return obj;
1364
- }, {});
1365
- }
1366
- /**
1367
- * Sorts an object's entries alphabetically by key
1368
- */
1369
- static sort(object, compareFn) {
1370
- return this.sortKeys(object, compareFn);
1371
- }
1372
- /**
1373
- * Sorts an object's entries alphabetically by key
1374
- */
1375
- static sortKeys(object, compareFn) {
1376
- return Object.keys(object).sort(compareFn).reduce((obj, key) => {
1377
- obj[key] = object[key];
1378
- return obj;
1379
- }, {});
1380
- }
1381
- /**
1382
- * Sorts an object's entries alphabetically by value
1383
- */
1384
- static sortValues(object, compareFn) {
1385
- return Object.keys(object).sort((a, b) => compareFn(object[a], object[b])).reduce((obj, key) => {
1386
- obj[key] = object[key];
1387
- return obj;
1388
- }, {});
1389
- }
1390
- /**
1391
- * @alias mintObject.filterKeys
1392
- */
1393
- static filter(object, keys) {
1394
- return this.filterKeys(object, keys);
1395
- }
1396
- /**
1397
- * Filters an object by its keys
1398
- * @param object - the object to filter
1399
- * @param keys - the keys to keep
1400
- * @returns - the filtered object
1401
- */
1402
- static filterKeys(object, keys) {
1403
- return keys.reduce((obj, key) => {
1404
- obj[key] = object[key];
1405
- return obj;
1406
- }, {});
1407
- }
1408
- /**
1409
- * Filters an object by its values
1410
- * @param object - the object to filter
1411
- * @param values - the values to keep
1412
- * @returns - the filtered object
1413
- */
1414
- static filterValues(object, values) {
1415
- return Object.keys(object).reduce((obj, key) => {
1416
- if (values.includes(object[key])) {
1417
- obj[key] = object[key];
1418
- }
1419
- return obj;
1420
- }, {});
1421
- }
1422
- /**
1423
- * Update two sets of objects
1424
- * @param original - the original object
1425
- * @param update - the object to update the original with
1426
- * @returns - the original objects with updated data from the update
1427
- */
1428
- static updateArray(original, update) {
1429
- let key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
1430
- // If there are no originals, push the updates
1431
- if (!(update === null || update === void 0 ? void 0 : update.length)) {
1432
- update === null || update === void 0 ? void 0 : update.forEach(object => original.push(object));
1433
- // If there are existing objects
1434
- } else {
1435
- // Create a dictionary of the updated objects
1436
- const updateObjects = update.reduce((objects, object) => {
1437
- var _a;
1438
- return Object.assign(Object.assign({}, objects), {
1439
- [(_a = object === null || object === void 0 ? void 0 : object[key]) !== null && _a !== void 0 ? _a : '']: object
1193
+ /**
1194
+ * Returns true if the provided objects have the same entries
1195
+ */
1196
+ static isSimilar(obj1, obj2) {
1197
+ let keys = Object.keys(obj1);
1198
+ if (keys.length !== Object.keys(obj2).length) {
1199
+ return false;
1200
+ }
1201
+ let isSimilar = true;
1202
+ keys.forEach((key) => {
1203
+ if (obj1[key] !== obj2[key]) {
1204
+ isSimilar = false;
1205
+ }
1440
1206
  });
1441
- }, {});
1442
- // Remove any objects that aren't in the updated objects
1443
- const missingObjects = original.filter(object => {
1444
- var _a;
1445
- return !updateObjects[(_a = object === null || object === void 0 ? void 0 : object[key]) !== null && _a !== void 0 ? _a : ''];
1446
- });
1447
- missingObjects === null || missingObjects === void 0 ? void 0 : missingObjects.forEach(object => {
1448
- const index = original.indexOf(object);
1449
- if (typeof index == 'number' && index !== -1) {
1450
- original.splice(index, 1);
1207
+ return isSimilar;
1208
+ }
1209
+ /**
1210
+ * Returns true if the first object has at least the same
1211
+ * entries as the second object
1212
+ * @param superset - the object to check
1213
+ * @param subset - the object whose entries are required
1214
+ * @returns - true if the first object is a superset of the second
1215
+ */
1216
+ static isSuperset(superset, subset) {
1217
+ let isSuperset = true;
1218
+ // Base case - if the objects are equal, it is a superset
1219
+ if (superset === subset) {
1220
+ return isSuperset;
1221
+ }
1222
+ // If the subset isn't an object or array, and doesn't
1223
+ // satisfy the base case, it isn't a superset
1224
+ try {
1225
+ if (Object.keys(subset).length === 0) {
1226
+ return !isSuperset;
1227
+ }
1228
+ }
1229
+ // If the subset is null or undefined, and doesn't satisfy
1230
+ // the base case, it isn't a superset
1231
+ // TODO: Check if other exceptions could occur
1232
+ catch (e) {
1233
+ return !isSuperset;
1234
+ }
1235
+ // If the children of the subset are subsets of the
1236
+ // respective children of the superset, it is a superset
1237
+ Object.keys(subset).forEach((key) => {
1238
+ isSuperset = isSuperset && MintObject.isSuperset(superset[key], subset[key]);
1239
+ });
1240
+ return isSuperset;
1241
+ }
1242
+ /**
1243
+ * Removes object entries by key
1244
+ * @see mintObject.removeKeys
1245
+ * @param object - the object to remove entries from
1246
+ * @param keys - the keys to remove
1247
+ */
1248
+ static remove(object, keys) {
1249
+ return this.removeKeys(object, keys);
1250
+ }
1251
+ /**
1252
+ * Removes object entries by key
1253
+ * @param object - the object to remove entries from
1254
+ * @param keys - the keys to remove
1255
+ */
1256
+ static removeKeys(object, keys) {
1257
+ return Object.keys(object).reduce((obj, key) => {
1258
+ if (!keys.includes(key)) {
1259
+ obj[key] = object[key];
1260
+ }
1261
+ return obj;
1262
+ }, {});
1263
+ }
1264
+ /**
1265
+ * Removes object entries by value
1266
+ */
1267
+ static removeValues(object, values) {
1268
+ return Object.keys(object).reduce((obj, key) => {
1269
+ if (!values.includes(object[key])) {
1270
+ obj[key] = object[key];
1271
+ }
1272
+ return obj;
1273
+ }, {});
1274
+ }
1275
+ /**
1276
+ * Sorts an object's entries alphabetically by key
1277
+ */
1278
+ static sort(object, compareFn) {
1279
+ return this.sortKeys(object, compareFn);
1280
+ }
1281
+ /**
1282
+ * Sorts an object's entries alphabetically by key
1283
+ */
1284
+ static sortKeys(object, compareFn) {
1285
+ return Object.keys(object).sort(compareFn).reduce((obj, key) => {
1286
+ obj[key] = object[key];
1287
+ return obj;
1288
+ }, {});
1289
+ }
1290
+ /**
1291
+ * Sorts an object's entries alphabetically by value
1292
+ */
1293
+ static sortValues(object, compareFn) {
1294
+ return Object.keys(object).sort((a, b) => compareFn(object[a], object[b])).reduce((obj, key) => {
1295
+ obj[key] = object[key];
1296
+ return obj;
1297
+ }, {});
1298
+ }
1299
+ /**
1300
+ * @see mintObject.filterKeys
1301
+ */
1302
+ static filter(object, keys) {
1303
+ return this.filterKeys(object, keys);
1304
+ }
1305
+ /**
1306
+ * Filters an object by its keys
1307
+ * @param object - the object to filter
1308
+ * @param keys - the keys to keep
1309
+ * @returns - the filtered object
1310
+ */
1311
+ static filterKeys(object, keys) {
1312
+ return keys.reduce((obj, key) => {
1313
+ obj[key] = object[key];
1314
+ return obj;
1315
+ }, {});
1316
+ }
1317
+ /**
1318
+ * Filters an object by its values
1319
+ * @param object - the object to filter
1320
+ * @param values - the values to keep
1321
+ * @returns - the filtered object
1322
+ */
1323
+ static filterValues(object, values) {
1324
+ return Object.keys(object).reduce((obj, key) => {
1325
+ if (values.includes(object[key])) {
1326
+ obj[key] = object[key];
1327
+ }
1328
+ return obj;
1329
+ }, {});
1330
+ }
1331
+ /**
1332
+ * Update two sets of objects
1333
+ * @param original - the original object
1334
+ * @param update - the object to update the original with
1335
+ * @returns - the original objects with updated data from the update
1336
+ */
1337
+ static updateArray(original, update, key = 'id') {
1338
+ // If there are no originals, push the updates
1339
+ if (!update?.length) {
1340
+ update?.forEach((object) => original.push(object));
1341
+ // If there are existing objects
1451
1342
  }
1452
- });
1453
- // Update the existing objects with updates
1454
- original.forEach(object => {
1455
- var _a, _b;
1456
- if (updateObjects[(_a = object === null || object === void 0 ? void 0 : object[key]) !== null && _a !== void 0 ? _a : '']) {
1457
- Object.assign(object, updateObjects[(_b = object === null || object === void 0 ? void 0 : object[key]) !== null && _b !== void 0 ? _b : '']);
1343
+ else {
1344
+ // Create a dictionary of the updated objects
1345
+ const updateObjects = update.reduce((objects, object) => ({
1346
+ ...objects,
1347
+ [object?.[key] ?? '']: object
1348
+ }), {});
1349
+ // Remove any objects that aren't in the updated objects
1350
+ const missingObjects = original.filter((object) => !updateObjects[object?.[key] ?? '']);
1351
+ missingObjects?.forEach((object) => {
1352
+ const index = original.indexOf(object);
1353
+ if (typeof index == 'number' && index !== -1) {
1354
+ original.splice(index, 1);
1355
+ }
1356
+ });
1357
+ // Update the existing objects with updates
1358
+ original.forEach((object) => {
1359
+ if (updateObjects[object?.[key] ?? '']) {
1360
+ Object.assign(object, updateObjects[object?.[key] ?? '']);
1361
+ }
1362
+ });
1458
1363
  }
1459
- });
1460
- }
1461
- // Push any new objects
1462
- const newObjects = update === null || update === void 0 ? void 0 : update.filter(object => !original.some(existingObject => (existingObject === null || existingObject === void 0 ? void 0 : existingObject[key]) === (object === null || object === void 0 ? void 0 : object[key])));
1463
- newObjects === null || newObjects === void 0 ? void 0 : newObjects.forEach(newObject => original.push(newObject));
1464
- }
1465
- /**
1466
- * Get an object's key by value
1467
- */
1468
- static getKeyByValue(object, value) {
1469
- return Object.keys(object).find(key => object[key] === value);
1470
- }
1471
- /**
1472
- * Create a deep copy of an object
1473
- * @recursive
1474
- */
1475
- static deepClone(object) {
1476
- // Clone every property
1477
- const clone = {};
1478
- for (const key in object) {
1479
- // Functions
1480
- if (typeof object[key] === 'function') {
1481
- clone[key] = object[key].bind(clone);
1482
- // Objects
1483
- } else if (object[key] && typeof object[key] === 'object') {
1484
- clone[key] = this.deepClone(object[key]);
1485
- // Primitives
1486
- } else {
1487
- clone[key] = object[key];
1488
- }
1489
- }
1490
- return clone;
1491
- }
1364
+ // Push any new objects
1365
+ const newObjects = update?.filter((object) => !original.some((existingObject) => existingObject?.[key] === object?.[key]));
1366
+ newObjects?.forEach(newObject => original.push(newObject));
1367
+ }
1368
+ /**
1369
+ * Get an object's key by value
1370
+ */
1371
+ static getKeyByValue(object, value) {
1372
+ return Object.keys(object).find((key) => object[key] === value);
1373
+ }
1374
+ /**
1375
+ * Create a deep copy of an object
1376
+ */
1377
+ static deepClone(object) {
1378
+ // Clone every property
1379
+ const clone = {};
1380
+ for (const key in object) {
1381
+ // Functions
1382
+ if (typeof object[key] === 'function') {
1383
+ clone[key] = object[key].bind(clone);
1384
+ // Objects
1385
+ }
1386
+ else if (object[key] && typeof object[key] === 'object') {
1387
+ clone[key] = this.deepClone(object[key]);
1388
+ // Primitives
1389
+ }
1390
+ else {
1391
+ clone[key] = object[key];
1392
+ }
1393
+ }
1394
+ return clone;
1395
+ }
1492
1396
  }
1493
- exports.MintObject = MintObject;
1494
1397
  ;
1495
- exports["default"] = MintObject;
1398
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintObject);
1399
+
1496
1400
 
1497
1401
  /***/ }),
1498
1402
 
@@ -1500,70 +1404,67 @@ exports["default"] = MintObject;
1500
1404
  /*!***************************************!*\
1501
1405
  !*** ./src/ts/imports/util/scroll.ts ***!
1502
1406
  \***************************************/
1503
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1504
-
1505
-
1506
-
1507
- var __importDefault = this && this.__importDefault || function (mod) {
1508
- return mod && mod.__esModule ? mod : {
1509
- "default": mod
1510
- };
1511
- };
1512
- Object.defineProperty(exports, "__esModule", ({
1513
- value: true
1514
- }));
1515
- exports.MintScroll = void 0;
1407
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1408
+
1409
+ __webpack_require__.r(__webpack_exports__);
1410
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1411
+ /* harmony export */ MintScroll: () => (/* binding */ MintScroll),
1412
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1413
+ /* harmony export */ });
1414
+ /* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts");
1516
1415
  /**
1517
1416
  * Imports
1518
1417
  */
1519
- const event_1 = __importDefault(__webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts"));
1418
+
1520
1419
  /**
1521
1420
  * Scroll functions
1522
1421
  */
1523
1422
  class MintScroll {
1524
- /**
1525
- * Scroll to the top of the page
1526
- */
1527
- static toTop() {
1528
- window.scrollTo(0, 0);
1529
- }
1530
- /**
1531
- * Scroll to the bottom of the page
1532
- */
1533
- static toBottom() {
1534
- window.scrollTo(0, document.body.scrollHeight);
1535
- }
1536
- /**
1537
- * Show visible elements
1538
- */
1539
- static showElements() {
1540
- requestAnimationFrame(() => {
1541
- let elements = document.querySelectorAll('.mint-fall-in:not(.mint-show)'),
1542
- elementsToShow = [];
1543
- for (let i = 0; i < elements.length; i++) {
1544
- if (elements[i].getBoundingClientRect().top < 0) {
1545
- elements[i].classList.add('mint-show');
1546
- } else if (elements[i].getBoundingClientRect().top < window.innerHeight * 3 / 4) {
1547
- elementsToShow.push(elements[i]);
1548
- }
1549
- }
1550
- for (let i = 0; i < elementsToShow.length; i++) {
1551
- setTimeout(() => {
1552
- elementsToShow[i].classList.add('mint-show');
1553
- }, i * 100);
1554
- }
1555
- });
1556
- }
1557
- /**
1558
- * Show visible elements on scroll
1559
- */
1560
- static showElementsOnScroll() {
1561
- window.addEventListener('scroll', event_1.default.throttleEvent(this.showElements, 200));
1562
- }
1423
+ /**
1424
+ * Scroll to the top of the page
1425
+ */
1426
+ static toTop() {
1427
+ window.scrollTo(0, 0);
1428
+ }
1429
+ ;
1430
+ /**
1431
+ * Scroll to the bottom of the page
1432
+ */
1433
+ static toBottom() {
1434
+ window.scrollTo(0, document.body.scrollHeight);
1435
+ }
1436
+ ;
1437
+ /**
1438
+ * Show visible elements
1439
+ */
1440
+ static showElements() {
1441
+ requestAnimationFrame(() => {
1442
+ let elements = document.querySelectorAll('.mint-fall-in:not(.mint-show)'), elementsToShow = [];
1443
+ for (let i = 0; i < elements.length; i++) {
1444
+ if (elements[i].getBoundingClientRect().top < 0) {
1445
+ elements[i].classList.add('mint-show');
1446
+ }
1447
+ else if (elements[i].getBoundingClientRect().top < window.innerHeight * 3 / 4) {
1448
+ elementsToShow.push(elements[i]);
1449
+ }
1450
+ }
1451
+ for (let i = 0; i < elementsToShow.length; i++) {
1452
+ setTimeout(() => {
1453
+ elementsToShow[i].classList.add('mint-show');
1454
+ }, i * 100);
1455
+ }
1456
+ });
1457
+ }
1458
+ /**
1459
+ * Show visible elements on scroll
1460
+ */
1461
+ static showElementsOnScroll() {
1462
+ window.addEventListener('scroll', _event__WEBPACK_IMPORTED_MODULE_0__["default"].throttleEvent(this.showElements, 200));
1463
+ }
1563
1464
  }
1564
- exports.MintScroll = MintScroll;
1565
1465
  ;
1566
- exports["default"] = MintScroll;
1466
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintScroll);
1467
+
1567
1468
 
1568
1469
  /***/ }),
1569
1470
 
@@ -1571,180 +1472,178 @@ exports["default"] = MintScroll;
1571
1472
  /*!******************************************!*\
1572
1473
  !*** ./src/ts/imports/util/selectors.ts ***!
1573
1474
  \******************************************/
1574
- /***/ ((__unused_webpack_module, exports) => {
1575
-
1576
-
1475
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1577
1476
 
1578
- var _a;
1579
- Object.defineProperty(exports, "__esModule", ({
1580
- value: true
1581
- }));
1582
- exports.MintSelectors = void 0;
1477
+ __webpack_require__.r(__webpack_exports__);
1478
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1479
+ /* harmony export */ MintSelectors: () => (/* binding */ MintSelectors),
1480
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1481
+ /* harmony export */ });
1583
1482
  /**
1584
1483
  * CSS-selector helpers
1585
1484
  * @public
1586
1485
  */
1587
1486
  class MintSelectors {
1588
- /**
1589
- * Adds the library prefix to the beginning of the provided string
1590
- * @param base - the string to be prefixed
1591
- * @returns - the provided string prefixed with the library name
1592
- */
1593
- static prefix(base) {
1594
- base = base.toLowerCase();
1595
- return base.startsWith(this.pre) ? base : `${this.pre}${base}`;
1596
- }
1597
- /**
1598
- * Adds two dashes to the beginning of the provided string
1599
- * @param base - the string to be prefixed
1600
- * @returns - the provided string prefixed with two dashes
1601
- */
1602
- static cssPrefix(base) {
1603
- return `--${this.prefix(base.replace(/^-+/, ''))}`;
1604
- }
1605
- /**
1606
- * Turns the provided string into a CSS variable call
1607
- * @param base - the name of the CSS variable to call
1608
- * @returns - the CSS variable call for the provided string
1609
- */
1610
- static cssVar(base) {
1611
- return `var(${this.cssPrefix(base)})`;
1612
- }
1613
- /**
1614
- * Negates the provided CSS selector
1615
- * @param base - the CSS selector to negate
1616
- * @returns - the negated CSS selector
1617
- */
1618
- static neg(base) {
1619
- return `:not(${base})`;
1620
- }
1621
- /**
1622
- * Generates a class CSS selector
1623
- * @param base - the name of the class to generate
1624
- * @returns - the generated CSS selector
1625
- */
1626
- static class(base) {
1627
- return `.${this.prefix(base)}`;
1628
- }
1629
- /**
1630
- * Generates an id CSS selector
1631
- * @param base - the name of the id to generate
1632
- * @returns - the generated CSS selector
1633
- */
1634
- static id(base) {
1635
- return `#${this.prefix(base)}`;
1636
- }
1637
- /**
1638
- * Generates an aria-controls CSS selector
1639
- * @param id - the id of the controlled element
1640
- * @returns - the generated CSS selector
1641
- */
1642
- static controls(id) {
1643
- return id ? `[aria-controls="${this.prefix(id)}"]` : this.hasControls;
1644
- }
1645
- /**
1646
- * Generates an aria-expanded CSS selector
1647
- * @param bool - whether the element is expanded or not
1648
- * @returns - the generated CSS selector
1649
- */
1650
- static expanded(bool) {
1651
- return typeof bool === 'boolean' ? `[aria-expanded="${bool}"]` : this.hasExpanded;
1652
- }
1653
- /**
1654
- * Returns a NodeList of HTMLElements within the given element that are focusable
1655
- * @param el - the element whose focusable children will be returned
1656
- * @returns - the elements within the given element that are focusable
1657
- */
1658
- static getFocusables(el) {
1659
- let focusables;
1660
- if (el) {
1661
- focusables = Array.from(el.querySelectorAll(this.focusable));
1662
- } else {
1663
- focusables = Array.from(document.querySelectorAll(this.focusable));
1664
- }
1665
- return focusables.filter(el => this.isFocusable(el));
1666
- }
1667
- /**
1668
- * Returns true if an element is focusable and false if not,
1669
- * based on styles (i.e. a parent has display: none;)
1670
- * NOTE: Still need to determine what other styles may make an element un-focusable
1671
- * @param el - the element
1672
- * @returns - true if the element is focusable; false if not
1673
- */
1674
- static isFocusable(el) {
1675
- let current = el;
1676
- do {
1677
- if (window.getComputedStyle(current).getPropertyValue('display').toLowerCase() === 'none') {
1678
- return false;
1679
- }
1680
- current = current.parentElement;
1681
- } while (current);
1682
- return true;
1683
- }
1487
+ /**
1488
+ * The library name that will be added as a prefix
1489
+ */
1490
+ static lib = 'mint';
1491
+ /**
1492
+ * The prefix built from the library name
1493
+ */
1494
+ static pre = `${this.lib}-`;
1495
+ /**
1496
+ * CSS-selector for disabled elements
1497
+ */
1498
+ static disabled = '[disabled]';
1499
+ /**
1500
+ * CSS-selector for elements with an aria-controls attribute
1501
+ */
1502
+ static hasControls = '[aria-controls]';
1503
+ /**
1504
+ * CSS-selector for elements with an aria-expanded attribute
1505
+ */
1506
+ static hasExpanded = '[aria-expanded]';
1507
+ /**
1508
+ * CSS-selector for elements with an href attribute
1509
+ */
1510
+ static hasLink = '[href]';
1511
+ /**
1512
+ * CSS-selector for elements with a routerLink attribute
1513
+ */
1514
+ static hasRouterLink = '[routerLink]';
1515
+ /**
1516
+ * CSS-selector for elements with an id attribute
1517
+ */
1518
+ static hasId = '[id]';
1519
+ /**
1520
+ * CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
1521
+ */
1522
+ static notTabbable = '[tabindex^="-"]';
1523
+ /**
1524
+ * CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
1525
+ */
1526
+ static tabbable = `[tabindex]${this.neg(this.notTabbable)}`;
1527
+ /**
1528
+ * CSS-selector for elements that can receive focus
1529
+ */
1530
+ static focusable = `input${this.neg(this.disabled)}${this.neg(this.notTabbable)},
1531
+ select${this.neg(this.disabled)}${this.neg(this.notTabbable)},
1532
+ textarea${this.neg(this.disabled)}${this.neg(this.notTabbable)},
1533
+ button${this.neg(this.disabled)}${this.neg(this.notTabbable)},
1534
+ object${this.neg(this.disabled)}${this.neg(this.notTabbable)},
1535
+ a${this.hasLink}, a${this.hasRouterLink},
1536
+ area${this.hasLink},
1537
+ ${this.tabbable}`.replace(/\s/g, '');
1538
+ /**
1539
+ * CSS-selector for submenu buttons
1540
+ */
1541
+ static subMenuButtons = `button${this.hasControls}`;
1542
+ /**
1543
+ * CSS-selector for submenus
1544
+ */
1545
+ static subMenu = `${this.subMenuButtons} + ul${this.hasId}`;
1546
+ /**
1547
+ * Adds the library prefix to the beginning of the provided string
1548
+ * @param base - the string to be prefixed
1549
+ * @returns - the provided string prefixed with the library name
1550
+ */
1551
+ static prefix(base) {
1552
+ base = base.toLowerCase();
1553
+ return base.startsWith(this.pre) ? base : `${this.pre}${base}`;
1554
+ }
1555
+ /**
1556
+ * Adds two dashes to the beginning of the provided string
1557
+ * @param base - the string to be prefixed
1558
+ * @returns - the provided string prefixed with two dashes
1559
+ */
1560
+ static cssPrefix(base) {
1561
+ return `--${this.prefix(base.replace(/^-+/, ''))}`;
1562
+ }
1563
+ /**
1564
+ * Turns the provided string into a CSS variable call
1565
+ * @param base - the name of the CSS variable to call
1566
+ * @returns - the CSS variable call for the provided string
1567
+ */
1568
+ static cssVar(base) {
1569
+ return `var(${this.cssPrefix(base)})`;
1570
+ }
1571
+ /**
1572
+ * Negates the provided CSS selector
1573
+ * @param base - the CSS selector to negate
1574
+ * @returns - the negated CSS selector
1575
+ */
1576
+ static neg(base) {
1577
+ return `:not(${base})`;
1578
+ }
1579
+ /**
1580
+ * Generates a class CSS selector
1581
+ * @param base - the name of the class to generate
1582
+ * @returns - the generated CSS selector
1583
+ */
1584
+ static class(base) {
1585
+ return `.${this.prefix(base)}`;
1586
+ }
1587
+ /**
1588
+ * Generates an id CSS selector
1589
+ * @param base - the name of the id to generate
1590
+ * @returns - the generated CSS selector
1591
+ */
1592
+ static id(base) {
1593
+ return `#${this.prefix(base)}`;
1594
+ }
1595
+ /**
1596
+ * Generates an aria-controls CSS selector
1597
+ * @param id - the id of the controlled element
1598
+ * @returns - the generated CSS selector
1599
+ */
1600
+ static controls(id) {
1601
+ return id ? `[aria-controls="${this.prefix(id)}"]` : this.hasControls;
1602
+ }
1603
+ /**
1604
+ * Generates an aria-expanded CSS selector
1605
+ * @param bool - whether the element is expanded or not
1606
+ * @returns - the generated CSS selector
1607
+ */
1608
+ static expanded(bool) {
1609
+ return typeof bool === 'boolean' ? `[aria-expanded="${bool}"]` : this.hasExpanded;
1610
+ }
1611
+ /**
1612
+ * Returns a NodeList of HTMLElements within the given element that are focusable
1613
+ * @param el - the element whose focusable children will be returned
1614
+ * @returns - the elements within the given element that are focusable
1615
+ */
1616
+ static getFocusables(el) {
1617
+ let focusables;
1618
+ if (el) {
1619
+ focusables = Array.from(el.querySelectorAll(this.focusable));
1620
+ }
1621
+ else {
1622
+ focusables = Array.from(document.querySelectorAll(this.focusable));
1623
+ }
1624
+ return focusables.filter((el) => this.isFocusable(el));
1625
+ }
1626
+ /**
1627
+ * Returns true if an element is focusable and false if not,
1628
+ * based on styles (i.e. a parent has display: none;)
1629
+ * NOTE: Still need to determine what other styles may make an element un-focusable
1630
+ * @param el - the element
1631
+ * @returns - true if the element is focusable; false if not
1632
+ */
1633
+ static isFocusable(el) {
1634
+ let current = el;
1635
+ do {
1636
+ if (window.getComputedStyle(current).getPropertyValue('display').toLowerCase() === 'none') {
1637
+ return false;
1638
+ }
1639
+ current = current.parentElement;
1640
+ } while (current);
1641
+ return true;
1642
+ }
1684
1643
  }
1685
- exports.MintSelectors = MintSelectors;
1686
- _a = MintSelectors;
1687
- /**
1688
- * The library name that will be added as a prefix
1689
- */
1690
- MintSelectors.lib = 'mint';
1691
- /**
1692
- * The prefix built from the library name
1693
- */
1694
- MintSelectors.pre = `${_a.lib}-`;
1695
- /**
1696
- * CSS-selector for disabled elements
1697
- */
1698
- MintSelectors.disabled = '[disabled]';
1699
- /**
1700
- * CSS-selector for elements with an aria-controls attribute
1701
- */
1702
- MintSelectors.hasControls = '[aria-controls]';
1703
- /**
1704
- * CSS-selector for elements with an aria-expanded attribute
1705
- */
1706
- MintSelectors.hasExpanded = '[aria-expanded]';
1707
- /**
1708
- * CSS-selector for elements with an href attribute
1709
- */
1710
- MintSelectors.hasLink = '[href]';
1711
- /**
1712
- * CSS-selector for elements with a routerLink attribute
1713
- */
1714
- MintSelectors.hasRouterLink = '[routerLink]';
1715
- /**
1716
- * CSS-selector for elements with an id attribute
1717
- */
1718
- MintSelectors.hasId = '[id]';
1719
- /**
1720
- * CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
1721
- */
1722
- MintSelectors.notTabbable = '[tabindex^="-"]';
1723
- /**
1724
- * CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
1725
- */
1726
- MintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`;
1727
- /**
1728
- * CSS-selector for elements that can receive focus
1729
- */
1730
- MintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
1731
- select${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
1732
- textarea${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
1733
- button${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
1734
- object${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)},
1735
- a${_a.hasLink}, a${_a.hasRouterLink},
1736
- area${_a.hasLink},
1737
- ${_a.tabbable}`.replace(/\s/g, '');
1738
- /**
1739
- * CSS-selector for submenu buttons
1740
- */
1741
- MintSelectors.subMenuButtons = `button${_a.hasControls}`;
1742
- /**
1743
- * CSS-selector for submenus
1744
- */
1745
- MintSelectors.subMenu = `${_a.subMenuButtons} + ul${_a.hasId}`;
1746
1644
  ;
1747
- exports["default"] = MintSelectors;
1645
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintSelectors);
1646
+
1748
1647
 
1749
1648
  /***/ }),
1750
1649
 
@@ -1752,96 +1651,93 @@ exports["default"] = MintSelectors;
1752
1651
  /*!*****************************************!*\
1753
1652
  !*** ./src/ts/imports/util/settings.ts ***!
1754
1653
  \*****************************************/
1755
- /***/ ((__unused_webpack_module, exports) => {
1756
-
1757
-
1654
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1758
1655
 
1759
- var _a;
1760
- Object.defineProperty(exports, "__esModule", ({
1761
- value: true
1762
- }));
1763
- exports.MintSettings = void 0;
1656
+ __webpack_require__.r(__webpack_exports__);
1657
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1658
+ /* harmony export */ MintSettings: () => (/* binding */ MintSettings),
1659
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1660
+ /* harmony export */ });
1764
1661
  /**
1765
1662
  * Settings management
1766
1663
  * @public
1767
1664
  */
1768
1665
  class MintSettings {
1769
- /**
1770
- * Update the provided settings variables
1771
- * @param settings - Object of settings variables to update
1772
- */
1773
- static set(settings) {
1774
- let newDelay = false;
1775
- if (typeof settings.delayBase === 'number') {
1776
- this.delayBase = settings.delayBase;
1777
- newDelay = true;
1778
- }
1779
- if (typeof settings.delayStep === 'number') {
1780
- this.delayStep = settings.delayStep;
1781
- newDelay = true;
1782
- }
1783
- if (newDelay) {
1784
- this.setDelay();
1785
- }
1786
- if (settings.delay && Object.keys(settings.delay).length) {
1787
- if (Object.values(settings.delay).reduce((prev, next) => prev && typeof next === 'number', true)) {
1788
- this.delay = Object.assign(Object.assign({}, this.delay), settings.delay);
1789
- }
1790
- }
1791
- if (settings.break && Object.keys(settings.break).length) {
1792
- if (Object.values(settings.break).reduce((prev, next) => prev && typeof next === 'number', true)) {
1793
- this.break = Object.assign(Object.assign({}, this.break), settings.break);
1794
- }
1795
- }
1796
- }
1797
- /**
1798
- * Updates the delay variables based on `this.delayBase` and `this.delayStep`
1799
- */
1800
- static setDelay() {
1801
- this.delay = {
1802
- instant: this.delayBase + this.delayStep * 0,
1803
- fast: this.delayBase + this.delayStep * 1,
1804
- medFast: this.delayBase + this.delayStep * 2,
1805
- default: this.delayBase + this.delayStep * 3,
1806
- medSlow: this.delayBase + this.delayStep * 4,
1807
- slow: this.delayBase + this.delayStep * 5
1666
+ /**
1667
+ * Value added to all delay variables
1668
+ */
1669
+ static delayBase = 0;
1670
+ /**
1671
+ * Value multiplied by delay variable index
1672
+ */
1673
+ static delayStep = 100;
1674
+ /**
1675
+ * Delay variables
1676
+ */
1677
+ static delay = {
1678
+ instant: this.delayBase + this.delayStep * 0,
1679
+ fast: this.delayBase + this.delayStep * 1,
1680
+ medFast: this.delayBase + this.delayStep * 2,
1681
+ default: this.delayBase + this.delayStep * 3,
1682
+ medSlow: this.delayBase + this.delayStep * 4,
1683
+ slow: this.delayBase + this.delayStep * 5
1684
+ };
1685
+ /**
1686
+ * Breakpoint variables
1687
+ */
1688
+ static break = {
1689
+ z: 0,
1690
+ xs: 480,
1691
+ sm: 768,
1692
+ md: 1024,
1693
+ lg: 1200,
1694
+ xl: 1440
1808
1695
  };
1809
- }
1696
+ /**
1697
+ * Update the provided settings variables
1698
+ * @param settings - Object of settings variables to update
1699
+ */
1700
+ static set(settings) {
1701
+ let newDelay = false;
1702
+ if (typeof settings.delayBase === 'number') {
1703
+ this.delayBase = settings.delayBase;
1704
+ newDelay = true;
1705
+ }
1706
+ if (typeof settings.delayStep === 'number') {
1707
+ this.delayStep = settings.delayStep;
1708
+ newDelay = true;
1709
+ }
1710
+ if (newDelay) {
1711
+ this.setDelay();
1712
+ }
1713
+ if (settings.delay && Object.keys(settings.delay).length) {
1714
+ if (Object.values(settings.delay).reduce((prev, next) => prev && typeof next === 'number', true)) {
1715
+ this.delay = { ...this.delay, ...settings.delay };
1716
+ }
1717
+ }
1718
+ if (settings.break && Object.keys(settings.break).length) {
1719
+ if (Object.values(settings.break).reduce((prev, next) => prev && typeof next === 'number', true)) {
1720
+ this.break = { ...this.break, ...settings.break };
1721
+ }
1722
+ }
1723
+ }
1724
+ /**
1725
+ * Updates the delay variables based on `this.delayBase` and `this.delayStep`
1726
+ */
1727
+ static setDelay() {
1728
+ this.delay = {
1729
+ instant: this.delayBase + this.delayStep * 0,
1730
+ fast: this.delayBase + this.delayStep * 1,
1731
+ medFast: this.delayBase + this.delayStep * 2,
1732
+ default: this.delayBase + this.delayStep * 3,
1733
+ medSlow: this.delayBase + this.delayStep * 4,
1734
+ slow: this.delayBase + this.delayStep * 5
1735
+ };
1736
+ }
1810
1737
  }
1811
- exports.MintSettings = MintSettings;
1812
- _a = MintSettings;
1813
- /**
1814
- * Value added to all delay variables
1815
- */
1816
- MintSettings.delayBase = 0;
1817
- /**
1818
- * Value multiplied by delay variable index
1819
- */
1820
- MintSettings.delayStep = 100;
1821
- /**
1822
- * Delay variables
1823
- */
1824
- MintSettings.delay = {
1825
- instant: _a.delayBase + _a.delayStep * 0,
1826
- fast: _a.delayBase + _a.delayStep * 1,
1827
- medFast: _a.delayBase + _a.delayStep * 2,
1828
- default: _a.delayBase + _a.delayStep * 3,
1829
- medSlow: _a.delayBase + _a.delayStep * 4,
1830
- slow: _a.delayBase + _a.delayStep * 5
1831
- };
1832
- /**
1833
- * Breakpoint variables
1834
- */
1835
- MintSettings.break = {
1836
- z: 0,
1837
- xs: 480,
1838
- sm: 768,
1839
- md: 1024,
1840
- lg: 1200,
1841
- xl: 1440
1842
- };
1843
1738
  ;
1844
- exports["default"] = MintSettings;
1739
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintSettings);
1740
+
1845
1741
 
1846
1742
  /***/ }),
1847
1743
 
@@ -1849,113 +1745,119 @@ exports["default"] = MintSettings;
1849
1745
  /*!*************************************!*\
1850
1746
  !*** ./src/ts/imports/util/text.ts ***!
1851
1747
  \*************************************/
1852
- /***/ ((__unused_webpack_module, exports) => {
1853
-
1748
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1854
1749
 
1855
-
1856
- Object.defineProperty(exports, "__esModule", ({
1857
- value: true
1858
- }));
1859
- exports.MintText = void 0;
1750
+ __webpack_require__.r(__webpack_exports__);
1751
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1752
+ /* harmony export */ MintText: () => (/* binding */ MintText),
1753
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1754
+ /* harmony export */ });
1860
1755
  /**
1861
1756
  * Functions for analyzing and manipulating text.
1862
1757
  */
1863
1758
  class MintText {
1864
- /**
1865
- * Generate a slug from a string
1866
- * @param text - The string to slugify
1867
- * @returns The slugified string
1868
- */
1869
- static slug(text) {
1870
- var _a;
1871
- return (_a = text === null || text === void 0 ? void 0 : text.trim().toLowerCase().replace(/'/g, '').replace(/[^\w/-]+/g, '-').replace(/-+/g, '-').replace(/^-+|-+$/g, '').replace(/^\/+|\/+$/g, '')) !== null && _a !== void 0 ? _a : '';
1872
- }
1873
- /**
1874
- * Generate a title from a slug
1875
- * @param slug - The slug to generate a title from
1876
- * @returns The title
1877
- */
1878
- static unslug(slug) {
1879
- return this.titleCase(slug.replace(/[-/]+/g, ' '));
1880
- }
1881
- /**
1882
- * Format a phone number
1883
- * @param phone - The phone number to format
1884
- * @returns The formatted phone number
1885
- */
1886
- static phone(phone) {
1887
- var _a, _b;
1888
- const given = (_a = phone === null || phone === void 0 ? void 0 : phone.toString().trim()) !== null && _a !== void 0 ? _a : '';
1889
- if (given === '(' || given === '') {
1890
- return given;
1891
- }
1892
- let numbers = (_b = given.replace(/\D/g, '')) !== null && _b !== void 0 ? _b : '',
1893
- formatted = '';
1894
- if (numbers.length > 10) {
1895
- formatted += `+${numbers.slice(0, numbers.length - 10)} `;
1896
- numbers = numbers.slice(numbers.length - 10);
1897
- }
1898
- for (var i = 0; i < numbers.length; i++) {
1899
- switch (i) {
1900
- case 0:
1901
- formatted += '(';
1902
- break;
1903
- case 3:
1904
- formatted += ') ';
1905
- break;
1906
- case 6:
1907
- formatted += '-';
1908
- break;
1909
- }
1910
- formatted += numbers[i];
1911
- }
1912
- switch (given[given.length - 1]) {
1913
- case ')':
1914
- if (i === 3) {
1915
- formatted += ') ';
1759
+ /**
1760
+ * Generate a slug from a string
1761
+ * @param text - The string to slugify
1762
+ * @returns The slugified string
1763
+ */
1764
+ static slug(text) {
1765
+ return text?.trim()
1766
+ .toLowerCase()
1767
+ .replace(/'/g, '')
1768
+ .replace(/[^\w/-]+/g, '-')
1769
+ .replace(/-+/g, '-')
1770
+ .replace(/^-+|-+$/g, '')
1771
+ .replace(/^\/+|\/+$/g, '') ?? '';
1772
+ }
1773
+ /**
1774
+ * Generate a title from a slug
1775
+ * @param slug - The slug to generate a title from
1776
+ * @returns The title
1777
+ */
1778
+ static unslug(slug) {
1779
+ return this.titleCase(slug.replace(/[-/]+/g, ' '));
1780
+ }
1781
+ /**
1782
+ * Format a phone number
1783
+ * @param phone - The phone number to format
1784
+ * @returns The formatted phone number
1785
+ */
1786
+ static phone(phone) {
1787
+ const given = phone?.toString().trim() ?? '';
1788
+ if (given === '(' || given === '') {
1789
+ return given;
1790
+ }
1791
+ let numbers = given.replace(/\D/g, '') ?? '', formatted = '';
1792
+ if (numbers.length > 10) {
1793
+ formatted += `+${numbers.slice(0, numbers.length - 10)} `;
1794
+ numbers = numbers.slice(numbers.length - 10);
1795
+ }
1796
+ for (var i = 0; i < numbers.length; i++) {
1797
+ switch (i) {
1798
+ case 0:
1799
+ formatted += '(';
1800
+ break;
1801
+ case 3:
1802
+ formatted += ') ';
1803
+ break;
1804
+ case 6:
1805
+ formatted += '-';
1806
+ break;
1807
+ }
1808
+ formatted += numbers[i];
1809
+ }
1810
+ switch (given[given.length - 1]) {
1811
+ case ')':
1812
+ if (i === 3) {
1813
+ formatted += ') ';
1814
+ }
1815
+ break;
1816
+ case '-':
1817
+ if (i === 6) {
1818
+ formatted += '-';
1819
+ }
1820
+ break;
1821
+ }
1822
+ return formatted;
1823
+ }
1824
+ /**
1825
+ * Pluralize the given word
1826
+ */
1827
+ static plural(word) {
1828
+ if (word.endsWith('ies') ||
1829
+ word.endsWith('es') ||
1830
+ (word.endsWith('s') && !word.endsWith('us') && !word.endsWith('is') && !word.endsWith('ss'))) {
1831
+ return word;
1832
+ }
1833
+ if (word.endsWith('y') && !['a', 'e', 'i', 'o', 'u'].includes(word.charAt(word.length - 2))) {
1834
+ return word.slice(0, -1) + 'ies';
1916
1835
  }
1917
- break;
1918
- case '-':
1919
- if (i === 6) {
1920
- formatted += '-';
1836
+ if (word.endsWith('s') || word.endsWith('sh') || word.endsWith('ch') || word.endsWith('x') || word.endsWith('z')) {
1837
+ return word + 'es';
1921
1838
  }
1922
- break;
1923
- }
1924
- return formatted;
1925
- }
1926
- /**
1927
- * Pluralize the given word
1928
- */
1929
- static plural(word) {
1930
- if (word.endsWith('ies') || word.endsWith('es') || word.endsWith('s') && !word.endsWith('us') && !word.endsWith('is') && !word.endsWith('ss')) {
1931
- return word;
1932
- }
1933
- if (word.endsWith('y') && !['a', 'e', 'i', 'o', 'u'].includes(word.charAt(word.length - 2))) {
1934
- return word.slice(0, -1) + 'ies';
1935
- }
1936
- if (word.endsWith('s') || word.endsWith('sh') || word.endsWith('ch') || word.endsWith('x') || word.endsWith('z')) {
1937
- return word + 'es';
1938
- }
1939
- return word + 's';
1940
- }
1941
- /**
1942
- * Capitalize the first letter of the given word
1943
- */
1944
- static titleCase(text) {
1945
- return text.toLowerCase().replace(/(?:^|\s)\S/g, a => a.toUpperCase());
1946
- }
1947
- /**
1948
- * Copies the provided text to the clipboard
1949
- * @param text - the text to copy
1950
- * @returns - true if the text was successfully copied to the clipboard; else false
1951
- */
1952
- static copyText(text) {
1953
- let textArea = document.createElement('textarea');
1954
- if (!text || !textArea) {
1955
- return false;
1956
- }
1957
- textArea.value = text;
1958
- textArea.style.cssText = `
1839
+ return word + 's';
1840
+ }
1841
+ /**
1842
+ * Capitalize the first letter of the given word
1843
+ */
1844
+ static titleCase(text) {
1845
+ return text
1846
+ .toLowerCase()
1847
+ .replace(/(?:^|\s)\S/g, a => a.toUpperCase());
1848
+ }
1849
+ /**
1850
+ * Copies the provided text to the clipboard
1851
+ * @param text - the text to copy
1852
+ * @returns - true if the text was successfully copied to the clipboard; else false
1853
+ */
1854
+ static copyText(text) {
1855
+ let textArea = document.createElement('textarea');
1856
+ if (!text || !textArea) {
1857
+ return false;
1858
+ }
1859
+ textArea.value = text;
1860
+ textArea.style.cssText = `
1959
1861
  position: fixed;
1960
1862
  top: 0;
1961
1863
  left: 0;
@@ -1963,26 +1865,26 @@ class MintText {
1963
1865
  opacity: 0;
1964
1866
  z-index: -1;
1965
1867
  `;
1966
- document.body.appendChild(textArea);
1967
- textArea.select();
1968
- textArea.setSelectionRange(0, 99999);
1969
- navigator.clipboard.writeText(textArea.value);
1970
- document.body.removeChild(textArea);
1971
- return true;
1972
- }
1973
- /**
1974
- * Tests the validity of an email address
1975
- * @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
1976
- * @param text - the string to test
1977
- * @returns - true if the given string is an email address; false if not
1978
- */
1979
- static isEmail(text) {
1980
- return null !== text.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/);
1981
- }
1868
+ document.body.appendChild(textArea);
1869
+ textArea.select();
1870
+ textArea.setSelectionRange(0, 99999);
1871
+ navigator.clipboard.writeText(textArea.value);
1872
+ document.body.removeChild(textArea);
1873
+ return true;
1874
+ }
1875
+ /**
1876
+ * Tests the validity of an email address
1877
+ * @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression}
1878
+ * @param text - the string to test
1879
+ * @returns - true if the given string is an email address; false if not
1880
+ */
1881
+ static isEmail(text) {
1882
+ return null !== text.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/);
1883
+ }
1982
1884
  }
1983
- exports.MintText = MintText;
1984
1885
  ;
1985
- exports["default"] = MintText;
1886
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintText);
1887
+
1986
1888
 
1987
1889
  /***/ }),
1988
1890
 
@@ -1990,110 +1892,142 @@ exports["default"] = MintText;
1990
1892
  /*!***************************************!*\
1991
1893
  !*** ./src/ts/imports/util/window.ts ***!
1992
1894
  \***************************************/
1993
- /***/ ((__unused_webpack_module, exports) => {
1994
-
1895
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1995
1896
 
1996
-
1997
- Object.defineProperty(exports, "__esModule", ({
1998
- value: true
1999
- }));
2000
- exports.MintWindow = void 0;
1897
+ __webpack_require__.r(__webpack_exports__);
1898
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1899
+ /* harmony export */ MintWindow: () => (/* binding */ MintWindow),
1900
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1901
+ /* harmony export */ });
2001
1902
  /**
2002
1903
  * Functions related to the browser window.
2003
1904
  */
2004
1905
  class MintWindow {
2005
- /**
2006
- * Returns the width of the window, including fractional pixels
2007
- * @returns the width of the window
2008
- */
2009
- static width() {
2010
- const decimal = document.body.getBoundingClientRect().width % 1;
2011
- return window.innerWidth + decimal;
2012
- }
1906
+ /**
1907
+ * Returns the width of the window, including fractional pixels
1908
+ * @returns the width of the window
1909
+ */
1910
+ static width() {
1911
+ const decimal = document.body.getBoundingClientRect().width % 1;
1912
+ return window.innerWidth + decimal;
1913
+ }
2013
1914
  }
2014
- exports.MintWindow = MintWindow;
2015
1915
  ;
2016
- exports["default"] = MintWindow;
1916
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MintWindow);
2017
1917
 
2018
- /***/ }),
2019
1918
 
2020
- /***/ "./src/ts/index.ts":
1919
+ /***/ })
1920
+
1921
+ /******/ });
1922
+ /************************************************************************/
1923
+ /******/ // The module cache
1924
+ /******/ var __webpack_module_cache__ = {};
1925
+ /******/
1926
+ /******/ // The require function
1927
+ /******/ function __webpack_require__(moduleId) {
1928
+ /******/ // Check if module is in cache
1929
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1930
+ /******/ if (cachedModule !== undefined) {
1931
+ /******/ return cachedModule.exports;
1932
+ /******/ }
1933
+ /******/ // Create a new module (and put it into the cache)
1934
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1935
+ /******/ // no module.id needed
1936
+ /******/ // no module.loaded needed
1937
+ /******/ exports: {}
1938
+ /******/ };
1939
+ /******/
1940
+ /******/ // Execute the module function
1941
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1942
+ /******/
1943
+ /******/ // Return the exports of the module
1944
+ /******/ return module.exports;
1945
+ /******/ }
1946
+ /******/
1947
+ /************************************************************************/
1948
+ /******/ /* webpack/runtime/define property getters */
1949
+ /******/ (() => {
1950
+ /******/ // define getter functions for harmony exports
1951
+ /******/ __webpack_require__.d = (exports, definition) => {
1952
+ /******/ for(var key in definition) {
1953
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1954
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1955
+ /******/ }
1956
+ /******/ }
1957
+ /******/ };
1958
+ /******/ })();
1959
+ /******/
1960
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1961
+ /******/ (() => {
1962
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1963
+ /******/ })();
1964
+ /******/
1965
+ /******/ /* webpack/runtime/make namespace object */
1966
+ /******/ (() => {
1967
+ /******/ // define __esModule on exports
1968
+ /******/ __webpack_require__.r = (exports) => {
1969
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1970
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1971
+ /******/ }
1972
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
1973
+ /******/ };
1974
+ /******/ })();
1975
+ /******/
1976
+ /************************************************************************/
1977
+ var __webpack_exports__ = {};
1978
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
1979
+ (() => {
2021
1980
  /*!*************************!*\
2022
1981
  !*** ./src/ts/index.ts ***!
2023
1982
  \*************************/
2024
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2025
-
2026
-
2027
-
1983
+ __webpack_require__.r(__webpack_exports__);
1984
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1985
+ /* harmony export */ EMintSide: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.EMintSide),
1986
+ /* harmony export */ MintAsync: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintAsync),
1987
+ /* harmony export */ MintDisplay: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintDisplay),
1988
+ /* harmony export */ MintEvent: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintEvent),
1989
+ /* harmony export */ MintHeader: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintHeader),
1990
+ /* harmony export */ MintIcon: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintIcon),
1991
+ /* harmony export */ MintItem: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintItem),
1992
+ /* harmony export */ MintList: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintList),
1993
+ /* harmony export */ MintMath: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintMath),
1994
+ /* harmony export */ MintObject: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintObject),
1995
+ /* harmony export */ MintScroll: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintScroll),
1996
+ /* harmony export */ MintSelectors: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintSelectors),
1997
+ /* harmony export */ MintSettings: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintSettings),
1998
+ /* harmony export */ MintText: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintText),
1999
+ /* harmony export */ MintWindow: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.MintWindow),
2000
+ /* harmony export */ mintColor: () => (/* reexport safe */ _imports__WEBPACK_IMPORTED_MODULE_0__.mintColor)
2001
+ /* harmony export */ });
2002
+ /* harmony import */ var _imports__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./imports */ "./src/ts/imports/index.ts");
2028
2003
  /**
2029
2004
  * A library for building responsive web applications.
2030
2005
  *
2031
2006
  * @packageDocumentation
2032
2007
  */
2033
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
2034
- if (k2 === undefined) k2 = k;
2035
- var desc = Object.getOwnPropertyDescriptor(m, k);
2036
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2037
- desc = {
2038
- enumerable: true,
2039
- get: function () {
2040
- return m[k];
2041
- }
2042
- };
2043
- }
2044
- Object.defineProperty(o, k2, desc);
2045
- } : function (o, m, k, k2) {
2046
- if (k2 === undefined) k2 = k;
2047
- o[k2] = m[k];
2048
- });
2049
- var __exportStar = this && this.__exportStar || function (m, exports) {
2050
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2051
- };
2052
- Object.defineProperty(exports, "__esModule", ({
2053
- value: true
2054
- }));
2055
2008
  /**
2056
2009
  * Exports
2057
2010
  */
2058
- __exportStar(__webpack_require__(/*! ./imports */ "./src/ts/imports/index.ts"), exports);
2059
2011
 
2060
- /***/ })
2061
2012
 
2062
- /******/ });
2063
- /************************************************************************/
2064
- /******/ // The module cache
2065
- /******/ var __webpack_module_cache__ = {};
2066
- /******/
2067
- /******/ // The require function
2068
- /******/ function __webpack_require__(moduleId) {
2069
- /******/ // Check if module is in cache
2070
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
2071
- /******/ if (cachedModule !== undefined) {
2072
- /******/ return cachedModule.exports;
2073
- /******/ }
2074
- /******/ // Create a new module (and put it into the cache)
2075
- /******/ var module = __webpack_module_cache__[moduleId] = {
2076
- /******/ // no module.id needed
2077
- /******/ // no module.loaded needed
2078
- /******/ exports: {}
2079
- /******/ };
2080
- /******/
2081
- /******/ // Execute the module function
2082
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
2083
- /******/
2084
- /******/ // Return the exports of the module
2085
- /******/ return module.exports;
2086
- /******/ }
2087
- /******/
2088
- /************************************************************************/
2089
- /******/
2090
- /******/ // startup
2091
- /******/ // Load entry module and return exports
2092
- /******/ // This entry module is referenced by other modules so it can't be inlined
2093
- /******/ var __webpack_exports__ = __webpack_require__("./src/ts/index.ts");
2094
- /******/
2095
- /******/ return __webpack_exports__;
2096
- /******/ })()
2097
- ;
2098
- });
2013
+ })();
2014
+
2015
+ var __webpack_exports__EMintSide = __webpack_exports__.EMintSide;
2016
+ var __webpack_exports__MintAsync = __webpack_exports__.MintAsync;
2017
+ var __webpack_exports__MintDisplay = __webpack_exports__.MintDisplay;
2018
+ var __webpack_exports__MintEvent = __webpack_exports__.MintEvent;
2019
+ var __webpack_exports__MintHeader = __webpack_exports__.MintHeader;
2020
+ var __webpack_exports__MintIcon = __webpack_exports__.MintIcon;
2021
+ var __webpack_exports__MintItem = __webpack_exports__.MintItem;
2022
+ var __webpack_exports__MintList = __webpack_exports__.MintList;
2023
+ var __webpack_exports__MintMath = __webpack_exports__.MintMath;
2024
+ var __webpack_exports__MintObject = __webpack_exports__.MintObject;
2025
+ var __webpack_exports__MintScroll = __webpack_exports__.MintScroll;
2026
+ var __webpack_exports__MintSelectors = __webpack_exports__.MintSelectors;
2027
+ var __webpack_exports__MintSettings = __webpack_exports__.MintSettings;
2028
+ var __webpack_exports__MintText = __webpack_exports__.MintText;
2029
+ var __webpack_exports__MintWindow = __webpack_exports__.MintWindow;
2030
+ var __webpack_exports__mintColor = __webpack_exports__.mintColor;
2031
+ export { __webpack_exports__EMintSide as EMintSide, __webpack_exports__MintAsync as MintAsync, __webpack_exports__MintDisplay as MintDisplay, __webpack_exports__MintEvent as MintEvent, __webpack_exports__MintHeader as MintHeader, __webpack_exports__MintIcon as MintIcon, __webpack_exports__MintItem as MintItem, __webpack_exports__MintList as MintList, __webpack_exports__MintMath as MintMath, __webpack_exports__MintObject as MintObject, __webpack_exports__MintScroll as MintScroll, __webpack_exports__MintSelectors as MintSelectors, __webpack_exports__MintSettings as MintSettings, __webpack_exports__MintText as MintText, __webpack_exports__MintWindow as MintWindow, __webpack_exports__mintColor as mintColor };
2032
+
2099
2033
  //# sourceMappingURL=index.js.map