@appartmint/util
Advanced tools
Comparing version 0.9.0 to 1.0.0
/** | ||
* A generic item | ||
* @note - this class must be convertable with JSON | ||
* - only add strings, numbers, booleans, arrays, and objects | ||
*/ | ||
export declare class mintItem { | ||
export declare class MintItem { | ||
/** | ||
@@ -10,4 +12,12 @@ * Item settings | ||
priority?: number; | ||
price?: number; | ||
level?: number; | ||
size?: number; | ||
num?: number; | ||
width?: number; | ||
height?: number; | ||
active?: boolean; | ||
centered?: boolean; | ||
disabled?: boolean; | ||
private?: boolean; | ||
/** | ||
@@ -17,2 +27,3 @@ * Item properties | ||
id?: string; | ||
slug?: string; | ||
name?: string; | ||
@@ -22,5 +33,10 @@ title?: string; | ||
description?: string; | ||
category?: string; | ||
type?: string; | ||
unit?: string; | ||
logo?: MintItem; | ||
icon?: string; | ||
position?: string; | ||
transform?: string; | ||
date?: string; | ||
/** | ||
@@ -32,21 +48,32 @@ * Item links | ||
target?: string; | ||
routerLink?: string; | ||
routerLink?: string[]; | ||
/** | ||
* Item data | ||
*/ | ||
queryParams?: { | ||
attr?: { | ||
[key: string]: string; | ||
}; | ||
attributes?: { | ||
params?: { | ||
[key: string]: string; | ||
}; | ||
options?: { | ||
[key: string]: string; | ||
}; | ||
lists?: { | ||
[key: string]: string[]; | ||
}; | ||
/** | ||
* Item lists | ||
*/ | ||
paragraphs?: string[]; | ||
classes?: string[]; | ||
buttons?: mintItem[]; | ||
images?: mintItem[]; | ||
children?: mintItem[]; | ||
items?: MintItem[]; | ||
images?: MintItem[]; | ||
buttons?: MintItem[]; | ||
/** | ||
* Item functions | ||
*/ | ||
click?: Function; | ||
} | ||
export default mintItem; | ||
export default MintItem; | ||
//# sourceMappingURL=item.d.ts.map |
/** | ||
* Imports | ||
*/ | ||
import { EMintSide } from '../enums'; | ||
/** | ||
* Handles the display of elements | ||
*/ | ||
export declare abstract class mintDisplay { | ||
export declare abstract class MintDisplay { | ||
/** | ||
* Sets the element's height to its `innerHeight`, then to `auto` after a delay | ||
* @param el - the element whose height will be set | ||
* @param delay - the amount of time in milliseconds that the show animation will be active | ||
* @param from - the side that the element is animating from | ||
*/ | ||
static show(el?: HTMLElement | null, delay?: number, from?: EMintSide): void; | ||
/** | ||
* Sets the element's height to 0 | ||
* @param el - the element whose height will be set | ||
* @param delay - the amount of time in milliseconds that the show animation will be active | ||
* @param from - the side that the element is animating from | ||
*/ | ||
static hide(el?: HTMLElement | null, delay?: number, from?: EMintSide): void; | ||
} | ||
export default mintDisplay; | ||
export default MintDisplay; | ||
//# sourceMappingURL=display.d.ts.map |
/** | ||
* Event helper functions | ||
*/ | ||
export declare abstract class mintEvent { | ||
export declare abstract class MintEvent { | ||
/** | ||
* Ensures that a function `func` is run only after not being called for `wait` milliseconds | ||
* @param func - the function to debounce | ||
* @param wait - the amount of time to wait before running the function | ||
* @returns - the debounced function | ||
*/ | ||
static debounce(func: Function, wait?: number): Function; | ||
/** | ||
* Ensures that a function `func` is run only after not being called for `wait` milliseconds | ||
* @param func - the function to debounce | ||
* @param wait - the amount of time to wait before running the function | ||
* @returns - the debounced function as an EventListener | ||
*/ | ||
static debounceEvent(func: Function, wait?: number): EventListener; | ||
/** | ||
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls | ||
* @param func - the function to throttle | ||
* @param wait - the amount of time between function calls | ||
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \} | ||
* @returns - the throttled function | ||
*/ | ||
static throttle(func: Function, wait?: number, options?: { | ||
[key: string]: boolean; | ||
}): Function; | ||
/** | ||
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls | ||
* @param func - the function to throttle | ||
* @param wait - the amount of time between function calls | ||
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \} | ||
* @returns - the throttled function as an EventListener | ||
*/ | ||
static throttleEvent(func: Function, wait?: number, options?: { | ||
[key: string]: boolean; | ||
}): EventListener; | ||
} | ||
export default mintEvent; | ||
export default MintEvent; | ||
//# sourceMappingURL=event.d.ts.map |
/** | ||
* Icon helper functions | ||
*/ | ||
export declare abstract class mintIcon { | ||
export declare abstract class MintIcon { | ||
/** | ||
@@ -12,3 +12,3 @@ * Default icons | ||
/** | ||
* Appends the given icon to the given selector | ||
* Appends the given icon to the given selector if there is not already an icon appended | ||
*/ | ||
@@ -23,4 +23,9 @@ static append(icon: string, selector: string): void; | ||
}): void; | ||
/** | ||
* Removes the given icon from the given selector | ||
* @param icon - the icon to remove | ||
*/ | ||
static remove(icon: string, selector: string): void; | ||
} | ||
export default mintIcon; | ||
export default MintIcon; | ||
//# sourceMappingURL=icon.d.ts.map |
/** | ||
* Math functions for the util library | ||
*/ | ||
export declare abstract class mintMath { | ||
export declare abstract class MintMath { | ||
/** | ||
@@ -13,3 +13,3 @@ * Get a random integer between min and max | ||
} | ||
export default mintMath; | ||
export default MintMath; | ||
//# sourceMappingURL=math.d.ts.map |
/** | ||
* Object functions for the util library | ||
*/ | ||
export declare abstract class mintObject { | ||
export declare abstract class MintObject { | ||
/** | ||
@@ -38,4 +38,12 @@ * Returns true if the provided objects have the same entries | ||
*/ | ||
static sort(object: any): Object; | ||
static sort(object: any, compareFn?: (a: string, b: string) => number): any; | ||
/** | ||
* Sorts an object's entries alphabetically by key | ||
*/ | ||
static sortKeys(object: any, compareFn?: (a: string, b: string) => number): any; | ||
/** | ||
* Sorts an object's entries alphabetically by value | ||
*/ | ||
static sortValues(object: any, compareFn: (a: any, b: any) => number): any; | ||
/** | ||
* @alias mintObject.filterKeys | ||
@@ -58,4 +66,20 @@ */ | ||
static filterValues(object: any, values: any[]): Object; | ||
/** | ||
* Update two sets of objects | ||
* @param original - the original object | ||
* @param update - the object to update the original with | ||
* @returns - the original objects with updated data from the update | ||
*/ | ||
static updateArray(original: any[], update?: any[], key?: string): any; | ||
/** | ||
* Get an object's key by value | ||
*/ | ||
static getKeyByValue(object: any, value: any): string | undefined; | ||
/** | ||
* Create a deep copy of an object | ||
* @recursive | ||
*/ | ||
static deepClone(object: any): any; | ||
} | ||
export default mintObject; | ||
export default MintObject; | ||
//# sourceMappingURL=object.d.ts.map |
/** | ||
* Functions for analyzing and manipulating text. | ||
*/ | ||
export declare abstract class mintText { | ||
export declare abstract class MintText { | ||
/** | ||
* Generate a slug from a string | ||
* @param text - The string to slugify | ||
* @returns The slugified string | ||
*/ | ||
static slug(text?: string): string; | ||
/** | ||
* Generate a title from a slug | ||
* @param slug - The slug to generate a title from | ||
* @returns The title | ||
*/ | ||
static unslug(slug: string): string; | ||
/** | ||
* Format a phone number | ||
* @param phone - The phone number to format | ||
* @returns The formatted phone number | ||
*/ | ||
static phone(phone?: string | number): string; | ||
/** | ||
* Pluralize the given word | ||
*/ | ||
static plural(word: string): string; | ||
/** | ||
* Capitalize the first letter of the given word | ||
*/ | ||
static titleCase(text: string): string; | ||
/** | ||
* Copies the provided text to the clipboard | ||
* @param text - the text to copy | ||
* @returns - true if the text was successfully copied to the clipboard; else false | ||
*/ | ||
static copyText(text: string): boolean; | ||
/** | ||
* Tests the validity of an email address | ||
* @see {@link https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression} | ||
* @param text - the string to test | ||
* @returns - true if the given string is an email address; false if not | ||
*/ | ||
static isEmail(text: string): boolean; | ||
} | ||
export default mintText; | ||
export default MintText; | ||
//# sourceMappingURL=text.d.ts.map |
/** | ||
* Functions related to the browser window. | ||
*/ | ||
export declare abstract class mintWindow { | ||
export declare abstract class MintWindow { | ||
/** | ||
* Returns the width of the window, including fractional pixels | ||
* @returns the width of the window | ||
*/ | ||
static width(): number; | ||
} | ||
export default mintWindow; | ||
export default MintWindow; | ||
//# sourceMappingURL=window.d.ts.map |
@@ -9,15 +9,3 @@ /** | ||
*/ | ||
export { mintSide } from './imports/enum'; | ||
export { mintColor } from './imports/models/color'; | ||
export { mintItem } from './imports/models/item'; | ||
export { mintDisplay } from './imports/util/display'; | ||
export { mintEvent } from './imports/util/event'; | ||
export { mintIcon } from './imports/util/icon'; | ||
export { mintMath } from './imports/util/math'; | ||
export { mintObject } from './imports/util/object'; | ||
export { mintText } from './imports/util/text'; | ||
export { mintWindow } from './imports/util/window'; | ||
export { mintSelectors } from './selectors'; | ||
export { mintSettings } from './settings'; | ||
export { mintUtil, default } from './util'; | ||
export * from './imports'; | ||
//# sourceMappingURL=index.d.ts.map |
1315
dist/js/index.js
@@ -15,6 +15,43 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ "./src/ts/imports/enum.ts": | ||
/*!********************************!*\ | ||
!*** ./src/ts/imports/enum.ts ***! | ||
\********************************/ | ||
/***/ "./src/ts/imports/enums/index.ts": | ||
/*!***************************************!*\ | ||
!*** ./src/ts/imports/enums/index.ts ***! | ||
\***************************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __exportStar = this && this.__exportStar || function (m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/** | ||
* Forward all exports from the enums directory | ||
*/ | ||
__exportStar(__webpack_require__(/*! ./side */ "./src/ts/imports/enums/side.ts"), exports); | ||
/***/ }), | ||
/***/ "./src/ts/imports/enums/side.ts": | ||
/*!**************************************!*\ | ||
!*** ./src/ts/imports/enums/side.ts ***! | ||
\**************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
@@ -27,13 +64,13 @@ | ||
})); | ||
exports.mintSide = void 0; | ||
exports.EMintSide = void 0; | ||
/** | ||
* Side Enum | ||
*/ | ||
var mintSide; | ||
(function (mintSide) { | ||
mintSide[mintSide["Top"] = 0] = "Top"; | ||
mintSide[mintSide["Right"] = 1] = "Right"; | ||
mintSide[mintSide["Bottom"] = 2] = "Bottom"; | ||
mintSide[mintSide["Left"] = 3] = "Left"; | ||
})(mintSide = exports.mintSide || (exports.mintSide = {})); | ||
var EMintSide; | ||
(function (EMintSide) { | ||
EMintSide[EMintSide["Top"] = 0] = "Top"; | ||
EMintSide[EMintSide["Right"] = 1] = "Right"; | ||
EMintSide[EMintSide["Bottom"] = 2] = "Bottom"; | ||
EMintSide[EMintSide["Left"] = 3] = "Left"; | ||
})(EMintSide = exports.EMintSide || (exports.EMintSide = {})); | ||
; | ||
@@ -43,2 +80,44 @@ | ||
/***/ "./src/ts/imports/index.ts": | ||
/*!*********************************!*\ | ||
!*** ./src/ts/imports/index.ts ***! | ||
\*********************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
/** | ||
* Forward all imports | ||
*/ | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __exportStar = this && this.__exportStar || function (m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/** | ||
* Exports | ||
*/ | ||
__exportStar(__webpack_require__(/*! ./enums */ "./src/ts/imports/enums/index.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./models */ "./src/ts/imports/models/index.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./util */ "./src/ts/imports/util/index.ts"), exports); | ||
/***/ }), | ||
/***/ "./src/ts/imports/models/color.ts": | ||
@@ -146,2 +225,58 @@ /*!****************************************!*\ | ||
/***/ "./src/ts/imports/models/file.ts": | ||
/*!***************************************!*\ | ||
!*** ./src/ts/imports/models/file.ts ***! | ||
\***************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/***/ }), | ||
/***/ "./src/ts/imports/models/index.ts": | ||
/*!****************************************!*\ | ||
!*** ./src/ts/imports/models/index.ts ***! | ||
\****************************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __exportStar = this && this.__exportStar || function (m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/** | ||
* Forward all exports from the models directory | ||
*/ | ||
__exportStar(__webpack_require__(/*! ./color */ "./src/ts/imports/models/color.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./file */ "./src/ts/imports/models/file.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./item */ "./src/ts/imports/models/item.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./minify */ "./src/ts/imports/models/minify.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./page */ "./src/ts/imports/models/page.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./recaptcha */ "./src/ts/imports/models/recaptcha.ts"), exports); | ||
/***/ }), | ||
/***/ "./src/ts/imports/models/item.ts": | ||
@@ -158,7 +293,9 @@ /*!***************************************!*\ | ||
})); | ||
exports.mintItem = void 0; | ||
exports.MintItem = void 0; | ||
/** | ||
* A generic item | ||
* @note - this class must be convertable with JSON | ||
* - only add strings, numbers, booleans, arrays, and objects | ||
*/ | ||
class mintItem { | ||
class MintItem { | ||
constructor() { | ||
@@ -170,24 +307,107 @@ /** | ||
this.priority = 0; | ||
this.price = 0; | ||
this.level = 0; | ||
this.size = 0; | ||
this.num = 0; | ||
this.width = 0; | ||
this.height = 0; | ||
this.active = false; | ||
this.centered = false; | ||
this.disabled = false; | ||
this.private = false; | ||
/** | ||
* Item data | ||
*/ | ||
this.queryParams = {}; | ||
this.attributes = {}; | ||
this.attr = {}; | ||
this.params = {}; | ||
this.options = {}; | ||
this.lists = {}; | ||
/** | ||
* Item lists | ||
*/ | ||
this.paragraphs = []; | ||
this.classes = []; | ||
this.items = []; | ||
this.images = []; | ||
this.buttons = []; | ||
this.images = []; | ||
this.children = []; | ||
} | ||
} | ||
exports.mintItem = mintItem; | ||
exports.MintItem = MintItem; | ||
; | ||
exports["default"] = mintItem; | ||
exports["default"] = MintItem; | ||
/***/ }), | ||
/***/ "./src/ts/imports/models/minify.ts": | ||
/*!*****************************************!*\ | ||
!*** ./src/ts/imports/models/minify.ts ***! | ||
\*****************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/***/ }), | ||
/***/ "./src/ts/imports/models/page.ts": | ||
/*!***************************************!*\ | ||
!*** ./src/ts/imports/models/page.ts ***! | ||
\***************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/***/ }), | ||
/***/ "./src/ts/imports/models/recaptcha.ts": | ||
/*!********************************************!*\ | ||
!*** ./src/ts/imports/models/recaptcha.ts ***! | ||
\********************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/async.ts": | ||
/*!**************************************!*\ | ||
!*** ./src/ts/imports/util/async.ts ***! | ||
\**************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.MintAsync = void 0; | ||
/** | ||
* Handles asynchronous operations | ||
*/ | ||
class MintAsync { | ||
/** | ||
* Wait n milliseconds | ||
*/ | ||
static wait(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
} | ||
exports.MintAsync = MintAsync; | ||
; | ||
exports["default"] = MintAsync; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/display.ts": | ||
@@ -197,3 +417,3 @@ /*!****************************************!*\ | ||
\****************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | ||
@@ -205,10 +425,77 @@ | ||
})); | ||
exports.mintDisplay = void 0; | ||
exports.MintDisplay = void 0; | ||
/** | ||
* Imports | ||
*/ | ||
const enums_1 = __webpack_require__(/*! ../enums */ "./src/ts/imports/enums/index.ts"); | ||
const settings_1 = __webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"); | ||
/** | ||
* Handles the display of elements | ||
*/ | ||
class mintDisplay {} | ||
exports.mintDisplay = mintDisplay; | ||
class MintDisplay { | ||
/** | ||
* Sets the element's height to its `innerHeight`, then to `auto` after a delay | ||
* @param el - the element whose height will be set | ||
* @param delay - the amount of time in milliseconds that the show animation will be active | ||
* @param from - the side that the element is animating from | ||
*/ | ||
static show(el) { | ||
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default; | ||
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enums_1.EMintSide.Top; | ||
if (el) { | ||
el.style.display = ''; | ||
requestAnimationFrame(() => { | ||
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) { | ||
el.style.height = `${el.scrollHeight}px`; | ||
} else { | ||
el.style.width = `${el.scrollWidth}px`; | ||
} | ||
setTimeout(() => { | ||
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) { | ||
el.style.height = 'auto'; | ||
} else { | ||
el.style.width = 'auto'; | ||
} | ||
}, delay); | ||
}); | ||
} | ||
} | ||
/** | ||
* Sets the element's height to 0 | ||
* @param el - the element whose height will be set | ||
* @param delay - the amount of time in milliseconds that the show animation will be active | ||
* @param from - the side that the element is animating from | ||
*/ | ||
static hide(el) { | ||
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.MintSettings.delay.default; | ||
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enums_1.EMintSide.Top; | ||
if (el) { | ||
let height = el.scrollHeight, | ||
width = el.scrollWidth, | ||
transition = el.style.transition; | ||
el.style.transition = ''; | ||
requestAnimationFrame(() => { | ||
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) { | ||
el.style.height = `${height}px`; | ||
} else { | ||
el.style.width = `${width}px`; | ||
} | ||
el.style.transition = transition; | ||
requestAnimationFrame(() => { | ||
if (from === enums_1.EMintSide.Top || from === enums_1.EMintSide.Bottom) { | ||
el.style.height = '0'; | ||
} else { | ||
el.style.width = '0'; | ||
} | ||
}); | ||
}); | ||
setTimeout(() => { | ||
el.style.display = 'none'; | ||
}, delay); | ||
} | ||
} | ||
} | ||
exports.MintDisplay = MintDisplay; | ||
; | ||
exports["default"] = mintDisplay; | ||
exports["default"] = MintDisplay; | ||
@@ -221,17 +508,110 @@ /***/ }), | ||
\**************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.mintEvent = void 0; | ||
exports.MintEvent = void 0; | ||
const settings_1 = __importDefault(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts")); | ||
/** | ||
* Event helper functions | ||
*/ | ||
class mintEvent {} | ||
exports.mintEvent = mintEvent; | ||
class MintEvent { | ||
/** | ||
* Ensures that a function `func` is run only after not being called for `wait` milliseconds | ||
* @param func - the function to debounce | ||
* @param wait - the amount of time to wait before running the function | ||
* @returns - the debounced function | ||
*/ | ||
static debounce(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let timer; | ||
return function (e) { | ||
if (timer) { | ||
clearTimeout(timer); | ||
} | ||
timer = setTimeout(func, wait, e); | ||
}; | ||
} | ||
/** | ||
* Ensures that a function `func` is run only after not being called for `wait` milliseconds | ||
* @param func - the function to debounce | ||
* @param wait - the amount of time to wait before running the function | ||
* @returns - the debounced function as an EventListener | ||
*/ | ||
static debounceEvent(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
return MintEvent.debounce(func, wait); | ||
} | ||
/** | ||
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls | ||
* @param func - the function to throttle | ||
* @param wait - the amount of time between function calls | ||
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \} | ||
* @returns - the throttled function | ||
*/ | ||
static throttle(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let options = arguments.length > 2 ? arguments[2] : undefined; | ||
let context, | ||
args, | ||
result, | ||
timeout, | ||
previous = 0, | ||
later = function () { | ||
previous = (options === null || options === void 0 ? void 0 : options.leading) === false ? 0 : new Date().getTime(); | ||
timeout = 0; | ||
result = func.apply(context, args); | ||
if (!timeout) { | ||
context = args = null; | ||
} | ||
}, | ||
throttled = function () { | ||
let now = new Date().getTime(); | ||
if (!previous && (options === null || options === void 0 ? void 0 : options.leading) === false) { | ||
previous = now; | ||
} | ||
let remaining = wait - now + previous; | ||
context = this; | ||
args = arguments; | ||
if (remaining <= 0 || remaining > wait) { | ||
if (timeout) { | ||
clearTimeout(timeout); | ||
timeout = 0; | ||
} | ||
previous = now; | ||
result = func.apply(context, args); | ||
if (!timeout) { | ||
context = args = null; | ||
} | ||
} else if (!timeout && (options === null || options === void 0 ? void 0 : options.trailing) !== false) { | ||
timeout = window.setTimeout(later, remaining); | ||
} | ||
return result; | ||
}; | ||
return throttled; | ||
} | ||
/** | ||
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls | ||
* @param func - the function to throttle | ||
* @param wait - the amount of time between function calls | ||
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \} | ||
* @returns - the throttled function as an EventListener | ||
*/ | ||
static throttleEvent(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let options = arguments.length > 2 ? arguments[2] : undefined; | ||
return MintEvent.throttle(func, wait, options); | ||
} | ||
} | ||
exports.MintEvent = MintEvent; | ||
; | ||
exports["default"] = mintEvent; | ||
exports["default"] = MintEvent; | ||
@@ -256,3 +636,3 @@ /***/ }), | ||
})); | ||
exports.mintIcon = void 0; | ||
exports.MintIcon = void 0; | ||
/** | ||
@@ -265,5 +645,5 @@ * Imports | ||
*/ | ||
class mintIcon { | ||
class MintIcon { | ||
/** | ||
* Appends the given icon to the given selector | ||
* Appends the given icon to the given selector if there is not already an icon appended | ||
*/ | ||
@@ -273,10 +653,10 @@ static append(icon, selector) { | ||
items.forEach(item => { | ||
let currentIcon = item.querySelector('i'), | ||
iconElement = document.createElement('i'); | ||
let iconElement = document.createElement('i'); | ||
iconElement.classList.add(...icon.split(' ')); | ||
if (currentIcon) { | ||
item.replaceChild(iconElement, currentIcon); | ||
} else { | ||
if (!item.querySelector('i')) { | ||
item.appendChild(iconElement); | ||
} | ||
if (iconElement.classList.contains('fa-up-right-from-square')) { | ||
item.setAttribute('target', '_blank'); | ||
} | ||
}); | ||
@@ -294,18 +674,135 @@ } | ||
} | ||
/** | ||
* Removes the given icon from the given selector | ||
* @param icon - the icon to remove | ||
*/ | ||
static remove(icon, selector) { | ||
let items = document.querySelectorAll(selector); | ||
items.forEach(item => { | ||
let iconElement = item.querySelector('i'); | ||
if (iconElement) { | ||
iconElement.remove(); | ||
} | ||
}); | ||
} | ||
} | ||
exports.mintIcon = mintIcon; | ||
exports.MintIcon = MintIcon; | ||
/** | ||
* Default icons | ||
*/ | ||
mintIcon.icons = { | ||
'a[href^="http"]': 'fas fa-up-right-from-square', | ||
MintIcon.icons = { | ||
'a[href^="mailto:"]': 'far fa-envelope', | ||
'a[href^="tel:"]': 'fas fa-phone-flip', | ||
'a[href^="sms:"]': 'far fa-message' | ||
'a[href^="sms:"]': 'far fa-message', | ||
'a[href^="https://maps"]': 'fas fa-map-location-dot', | ||
'a[href^="http"]': 'fas fa-up-right-from-square' | ||
}; | ||
; | ||
exports["default"] = mintIcon; | ||
exports["default"] = MintIcon; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/index.ts": | ||
/*!**************************************!*\ | ||
!*** ./src/ts/imports/util/index.ts ***! | ||
\**************************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __exportStar = this && this.__exportStar || function (m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/** | ||
* Forward all exports from the util directory | ||
*/ | ||
__exportStar(__webpack_require__(/*! ./async */ "./src/ts/imports/util/async.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./display */ "./src/ts/imports/util/display.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./icon */ "./src/ts/imports/util/icon.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./list */ "./src/ts/imports/util/list.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./math */ "./src/ts/imports/util/math.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./object */ "./src/ts/imports/util/object.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./scroll */ "./src/ts/imports/util/scroll.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./selectors */ "./src/ts/imports/util/selectors.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./settings */ "./src/ts/imports/util/settings.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./text */ "./src/ts/imports/util/text.ts"), exports); | ||
__exportStar(__webpack_require__(/*! ./window */ "./src/ts/imports/util/window.ts"), exports); | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/list.ts": | ||
/*!*************************************!*\ | ||
!*** ./src/ts/imports/util/list.ts ***! | ||
\*************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.MintList = void 0; | ||
/** | ||
* List functions for the util library | ||
*/ | ||
class MintList { | ||
/** | ||
* Returns a copy of the provided list with the items in random order | ||
* @param list - the list to shuffle | ||
* @returns - the shuffled list | ||
*/ | ||
static shuffleCopy(list) { | ||
let copy = [...list]; | ||
for (let i = copy.length - 1; i > 0; i--) { | ||
const j = Math.floor(Math.random() * (i + 1)); | ||
[copy[i], copy[j]] = [copy[j], copy[i]]; | ||
} | ||
return copy; | ||
} | ||
/** | ||
* Filters the array in place based on a test condition and returns the filtered array. | ||
* This method modifies the original array by removing elements that do not pass the test implemented by the provided function. | ||
* | ||
* @template T The type of elements in the array. | ||
* @param {T[]} list The array to filter, which will be modified in place. | ||
* @param {(item: T) => boolean} test A function that tests each element of the array. Return `true` to keep the element, `false` otherwise. | ||
* @returns {T[]} The original array with only the elements that passed the test. | ||
*/ | ||
static filter(list, test) { | ||
let newLength = 0; | ||
for (let i = 0; i < list.length; i++) { | ||
if (test(list[i])) { | ||
list[newLength++] = list[i]; | ||
} | ||
} | ||
list.length = newLength; | ||
return list; | ||
} | ||
} | ||
exports.MintList = MintList; | ||
; | ||
exports["default"] = MintList; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/math.ts": | ||
@@ -322,7 +819,7 @@ /*!*************************************!*\ | ||
})); | ||
exports.mintMath = void 0; | ||
exports.MintMath = void 0; | ||
/** | ||
* Math functions for the util library | ||
*/ | ||
class mintMath { | ||
class MintMath { | ||
/** | ||
@@ -341,5 +838,5 @@ * Get a random integer between min and max | ||
} | ||
exports.mintMath = mintMath; | ||
exports.MintMath = MintMath; | ||
; | ||
exports["default"] = mintMath; | ||
exports["default"] = MintMath; | ||
@@ -359,7 +856,7 @@ /***/ }), | ||
})); | ||
exports.mintObject = void 0; | ||
exports.MintObject = void 0; | ||
/** | ||
* Object functions for the util library | ||
*/ | ||
class mintObject { | ||
class MintObject { | ||
/** | ||
@@ -373,8 +870,9 @@ * Returns true if the provided objects have the same entries | ||
} | ||
let isSimilar = true; | ||
keys.forEach(key => { | ||
if (obj1[key] !== obj2[key]) { | ||
return false; | ||
isSimilar = false; | ||
} | ||
}); | ||
return true; | ||
return isSimilar; | ||
} | ||
@@ -411,3 +909,3 @@ /** | ||
Object.keys(subset).forEach(key => { | ||
isSuperset = isSuperset && mintObject.isSuperset(superset[key], subset[key]); | ||
isSuperset = isSuperset && MintObject.isSuperset(superset[key], subset[key]); | ||
}); | ||
@@ -452,4 +950,10 @@ return isSuperset; | ||
*/ | ||
static sort(object) { | ||
return Object.keys(object).sort().reduce((obj, key) => { | ||
static sort(object, compareFn) { | ||
return this.sortKeys(object, compareFn); | ||
} | ||
/** | ||
* Sorts an object's entries alphabetically by key | ||
*/ | ||
static sortKeys(object, compareFn) { | ||
return Object.keys(object).sort(compareFn).reduce((obj, key) => { | ||
obj[key] = object[key]; | ||
@@ -460,2 +964,11 @@ return obj; | ||
/** | ||
* Sorts an object's entries alphabetically by value | ||
*/ | ||
static sortValues(object, compareFn) { | ||
return Object.keys(object).sort((a, b) => compareFn(object[a], object[b])).reduce((obj, key) => { | ||
obj[key] = object[key]; | ||
return obj; | ||
}, {}); | ||
} | ||
/** | ||
* @alias mintObject.filterKeys | ||
@@ -492,57 +1005,83 @@ */ | ||
} | ||
/** | ||
* Update two sets of objects | ||
* @param original - the original object | ||
* @param update - the object to update the original with | ||
* @returns - the original objects with updated data from the update | ||
*/ | ||
static updateArray(original, update) { | ||
let key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id'; | ||
// If there are no originals, push the updates | ||
if (!(update === null || update === void 0 ? void 0 : update.length)) { | ||
update === null || update === void 0 ? void 0 : update.forEach(object => original.push(object)); | ||
// If there are existing objects | ||
} else { | ||
// Create a dictionary of the updated objects | ||
const updateObjects = update.reduce((objects, object) => { | ||
var _a; | ||
return Object.assign(Object.assign({}, objects), { | ||
[(_a = object === null || object === void 0 ? void 0 : object[key]) !== null && _a !== void 0 ? _a : '']: object | ||
}); | ||
}, {}); | ||
// Remove any objects that aren't in the updated objects | ||
const missingObjects = original.filter(object => { | ||
var _a; | ||
return !updateObjects[(_a = object === null || object === void 0 ? void 0 : object[key]) !== null && _a !== void 0 ? _a : '']; | ||
}); | ||
missingObjects === null || missingObjects === void 0 ? void 0 : missingObjects.forEach(object => { | ||
const index = original.indexOf(object); | ||
if (typeof index == 'number' && index !== -1) { | ||
original.splice(index, 1); | ||
} | ||
}); | ||
// Update the existing objects with updates | ||
original.forEach(object => { | ||
var _a, _b; | ||
if (updateObjects[(_a = object === null || object === void 0 ? void 0 : object[key]) !== null && _a !== void 0 ? _a : '']) { | ||
Object.assign(object, updateObjects[(_b = object === null || object === void 0 ? void 0 : object[key]) !== null && _b !== void 0 ? _b : '']); | ||
} | ||
}); | ||
} | ||
// Push any new objects | ||
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]))); | ||
newObjects === null || newObjects === void 0 ? void 0 : newObjects.forEach(newObject => original.push(newObject)); | ||
} | ||
/** | ||
* Get an object's key by value | ||
*/ | ||
static getKeyByValue(object, value) { | ||
return Object.keys(object).find(key => object[key] === value); | ||
} | ||
/** | ||
* Create a deep copy of an object | ||
* @recursive | ||
*/ | ||
static deepClone(object) { | ||
// Clone every property | ||
const clone = {}; | ||
for (const key in object) { | ||
// Functions | ||
if (typeof object[key] === 'function') { | ||
clone[key] = object[key].bind(clone); | ||
// Objects | ||
} else if (object[key] && typeof object[key] === 'object') { | ||
clone[key] = this.deepClone(object[key]); | ||
// Primitives | ||
} else { | ||
clone[key] = object[key]; | ||
} | ||
} | ||
return clone; | ||
} | ||
} | ||
exports.mintObject = mintObject; | ||
exports.MintObject = MintObject; | ||
; | ||
exports["default"] = mintObject; | ||
exports["default"] = MintObject; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/text.ts": | ||
/*!*************************************!*\ | ||
!*** ./src/ts/imports/util/text.ts ***! | ||
\*************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.mintText = void 0; | ||
/** | ||
* Functions for analyzing and manipulating text. | ||
*/ | ||
class mintText {} | ||
exports.mintText = mintText; | ||
; | ||
exports["default"] = mintText; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/window.ts": | ||
/***/ "./src/ts/imports/util/scroll.ts": | ||
/*!***************************************!*\ | ||
!*** ./src/ts/imports/util/window.ts ***! | ||
!*** ./src/ts/imports/util/scroll.ts ***! | ||
\***************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.mintWindow = void 0; | ||
/** | ||
* Functions related to the browser window. | ||
*/ | ||
class mintWindow {} | ||
exports.mintWindow = mintWindow; | ||
; | ||
exports["default"] = mintWindow; | ||
/***/ }), | ||
/***/ "./src/ts/index.ts": | ||
/*!*************************!*\ | ||
!*** ./src/ts/index.ts ***! | ||
\*************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
@@ -552,7 +1091,2 @@ | ||
/** | ||
* A utility library for web applications. | ||
* | ||
* @packageDocumentation | ||
*/ | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
@@ -566,110 +1100,61 @@ return mod && mod.__esModule ? mod : { | ||
})); | ||
exports["default"] = exports.mintUtil = exports.mintSettings = exports.mintSelectors = exports.mintWindow = exports.mintText = exports.mintObject = exports.mintMath = exports.mintIcon = exports.mintEvent = exports.mintDisplay = exports.mintItem = exports.mintColor = exports.mintSide = void 0; | ||
exports.MintScroll = void 0; | ||
/** | ||
* Exports | ||
* Imports | ||
*/ | ||
var enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts"); | ||
Object.defineProperty(exports, "mintSide", ({ | ||
enumerable: true, | ||
get: function () { | ||
return enum_1.mintSide; | ||
const event_1 = __importDefault(__webpack_require__(/*! ./event */ "./src/ts/imports/util/event.ts")); | ||
/** | ||
* Scroll functions | ||
*/ | ||
class MintScroll { | ||
/** | ||
* Scroll to the top of the page | ||
*/ | ||
static toTop() { | ||
window.scrollTo(0, 0); | ||
} | ||
})); | ||
var color_1 = __webpack_require__(/*! ./imports/models/color */ "./src/ts/imports/models/color.ts"); | ||
Object.defineProperty(exports, "mintColor", ({ | ||
enumerable: true, | ||
get: function () { | ||
return color_1.mintColor; | ||
/** | ||
* Scroll to the bottom of the page | ||
*/ | ||
static toBottom() { | ||
window.scrollTo(0, document.body.scrollHeight); | ||
} | ||
})); | ||
var item_1 = __webpack_require__(/*! ./imports/models/item */ "./src/ts/imports/models/item.ts"); | ||
Object.defineProperty(exports, "mintItem", ({ | ||
enumerable: true, | ||
get: function () { | ||
return item_1.mintItem; | ||
/** | ||
* Show visible elements | ||
*/ | ||
static showElements() { | ||
requestAnimationFrame(() => { | ||
let elements = document.querySelectorAll('.mint-fall-in:not(.mint-show)'), | ||
elementsToShow = []; | ||
for (let i = 0; i < elements.length; i++) { | ||
if (elements[i].getBoundingClientRect().top < 0) { | ||
elements[i].classList.add('mint-show'); | ||
} else if (elements[i].getBoundingClientRect().top < window.innerHeight * 3 / 4) { | ||
elementsToShow.push(elements[i]); | ||
} | ||
} | ||
for (let i = 0; i < elementsToShow.length; i++) { | ||
setTimeout(() => { | ||
elementsToShow[i].classList.add('mint-show'); | ||
}, i * 100); | ||
} | ||
}); | ||
} | ||
})); | ||
var display_1 = __webpack_require__(/*! ./imports/util/display */ "./src/ts/imports/util/display.ts"); | ||
Object.defineProperty(exports, "mintDisplay", ({ | ||
enumerable: true, | ||
get: function () { | ||
return display_1.mintDisplay; | ||
/** | ||
* Show visible elements on scroll | ||
*/ | ||
static showElementsOnScroll() { | ||
window.addEventListener('scroll', event_1.default.throttleEvent(this.showElements, 200)); | ||
} | ||
})); | ||
var event_1 = __webpack_require__(/*! ./imports/util/event */ "./src/ts/imports/util/event.ts"); | ||
Object.defineProperty(exports, "mintEvent", ({ | ||
enumerable: true, | ||
get: function () { | ||
return event_1.mintEvent; | ||
} | ||
})); | ||
var icon_1 = __webpack_require__(/*! ./imports/util/icon */ "./src/ts/imports/util/icon.ts"); | ||
Object.defineProperty(exports, "mintIcon", ({ | ||
enumerable: true, | ||
get: function () { | ||
return icon_1.mintIcon; | ||
} | ||
})); | ||
var math_1 = __webpack_require__(/*! ./imports/util/math */ "./src/ts/imports/util/math.ts"); | ||
Object.defineProperty(exports, "mintMath", ({ | ||
enumerable: true, | ||
get: function () { | ||
return math_1.mintMath; | ||
} | ||
})); | ||
var object_1 = __webpack_require__(/*! ./imports/util/object */ "./src/ts/imports/util/object.ts"); | ||
Object.defineProperty(exports, "mintObject", ({ | ||
enumerable: true, | ||
get: function () { | ||
return object_1.mintObject; | ||
} | ||
})); | ||
var text_1 = __webpack_require__(/*! ./imports/util/text */ "./src/ts/imports/util/text.ts"); | ||
Object.defineProperty(exports, "mintText", ({ | ||
enumerable: true, | ||
get: function () { | ||
return text_1.mintText; | ||
} | ||
})); | ||
var window_1 = __webpack_require__(/*! ./imports/util/window */ "./src/ts/imports/util/window.ts"); | ||
Object.defineProperty(exports, "mintWindow", ({ | ||
enumerable: true, | ||
get: function () { | ||
return window_1.mintWindow; | ||
} | ||
})); | ||
var selectors_1 = __webpack_require__(/*! ./selectors */ "./src/ts/selectors.ts"); | ||
Object.defineProperty(exports, "mintSelectors", ({ | ||
enumerable: true, | ||
get: function () { | ||
return selectors_1.mintSelectors; | ||
} | ||
})); | ||
var settings_1 = __webpack_require__(/*! ./settings */ "./src/ts/settings.ts"); | ||
Object.defineProperty(exports, "mintSettings", ({ | ||
enumerable: true, | ||
get: function () { | ||
return settings_1.mintSettings; | ||
} | ||
})); | ||
var util_1 = __webpack_require__(/*! ./util */ "./src/ts/util.ts"); | ||
Object.defineProperty(exports, "mintUtil", ({ | ||
enumerable: true, | ||
get: function () { | ||
return util_1.mintUtil; | ||
} | ||
})); | ||
Object.defineProperty(exports, "default", ({ | ||
enumerable: true, | ||
get: function () { | ||
return __importDefault(util_1).default; | ||
} | ||
})); | ||
} | ||
exports.MintScroll = MintScroll; | ||
; | ||
exports["default"] = MintScroll; | ||
/***/ }), | ||
/***/ "./src/ts/selectors.ts": | ||
/*!*****************************!*\ | ||
!*** ./src/ts/selectors.ts ***! | ||
\*****************************/ | ||
/***/ "./src/ts/imports/util/selectors.ts": | ||
/*!******************************************!*\ | ||
!*** ./src/ts/imports/util/selectors.ts ***! | ||
\******************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
@@ -683,3 +1168,3 @@ | ||
})); | ||
exports.mintSelectors = void 0; | ||
exports.MintSelectors = void 0; | ||
/** | ||
@@ -689,3 +1174,3 @@ * CSS-selector helpers | ||
*/ | ||
class mintSelectors { | ||
class MintSelectors { | ||
/** | ||
@@ -757,20 +1242,2 @@ * Adds the library prefix to the beginning of the provided string | ||
/** | ||
* Returns the id of the requested element | ||
*/ | ||
static getId(id) { | ||
var _b; | ||
return (_b = this.ids[id !== null && id !== void 0 ? id : -1]) !== null && _b !== void 0 ? _b : ''; | ||
} | ||
/** | ||
* Returns the class of the requested element | ||
*/ | ||
static getClass(className, classGroup) { | ||
var _b, _c; | ||
if (classGroup) { | ||
let group = this.classes[classGroup]; | ||
return (_b = group[className !== null && className !== void 0 ? className : -1]) !== null && _b !== void 0 ? _b : ''; | ||
} | ||
return (_c = this.classes[className !== null && className !== void 0 ? className : -1]) !== null && _c !== void 0 ? _c : ''; | ||
} | ||
/** | ||
* Returns a NodeList of HTMLElements within the given element that are focusable | ||
@@ -783,5 +1250,5 @@ * @param el - the element whose focusable children will be returned | ||
if (el) { | ||
focusables = [...el.querySelectorAll(this.focusable)]; | ||
focusables = Array.from(el.querySelectorAll(this.focusable)); | ||
} else { | ||
focusables = [...document.querySelectorAll(this.focusable)]; | ||
focusables = Array.from(document.querySelectorAll(this.focusable)); | ||
} | ||
@@ -808,48 +1275,48 @@ return focusables.filter(el => this.isFocusable(el)); | ||
} | ||
exports.mintSelectors = mintSelectors; | ||
_a = mintSelectors; | ||
exports.MintSelectors = MintSelectors; | ||
_a = MintSelectors; | ||
/** | ||
* The library name that will be added as a prefix | ||
*/ | ||
mintSelectors.lib = 'mint'; | ||
MintSelectors.lib = 'mint'; | ||
/** | ||
* The prefix built from the library name | ||
*/ | ||
mintSelectors.pre = `${_a.lib}-`; | ||
MintSelectors.pre = `${_a.lib}-`; | ||
/** | ||
* CSS-selector for disabled elements | ||
*/ | ||
mintSelectors.disabled = '[disabled]'; | ||
MintSelectors.disabled = '[disabled]'; | ||
/** | ||
* CSS-selector for elements with an aria-controls attribute | ||
*/ | ||
mintSelectors.hasControls = '[aria-controls]'; | ||
MintSelectors.hasControls = '[aria-controls]'; | ||
/** | ||
* CSS-selector for elements with an aria-expanded attribute | ||
*/ | ||
mintSelectors.hasExpanded = '[aria-expanded]'; | ||
MintSelectors.hasExpanded = '[aria-expanded]'; | ||
/** | ||
* CSS-selector for elements with an href attribute | ||
*/ | ||
mintSelectors.hasLink = '[href]'; | ||
MintSelectors.hasLink = '[href]'; | ||
/** | ||
* CSS-selector for elements with a routerLink attribute | ||
*/ | ||
mintSelectors.hasRouterLink = '[routerLink]'; | ||
MintSelectors.hasRouterLink = '[routerLink]'; | ||
/** | ||
* CSS-selector for elements with an id attribute | ||
*/ | ||
mintSelectors.hasId = '[id]'; | ||
MintSelectors.hasId = '[id]'; | ||
/** | ||
* CSS-selector for elements that aren't tabbable (i.e. tabindex is negative) | ||
*/ | ||
mintSelectors.notTabbable = '[tabindex^="-"]'; | ||
MintSelectors.notTabbable = '[tabindex^="-"]'; | ||
/** | ||
* CSS-selector for elements that are tabbable (i.e. tabindex isn't negative) | ||
*/ | ||
mintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`; | ||
MintSelectors.tabbable = `[tabindex]${_a.neg(_a.notTabbable)}`; | ||
/** | ||
* CSS-selector for elements that can receive focus | ||
*/ | ||
mintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)}, | ||
MintSelectors.focusable = `input${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)}, | ||
select${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)}, | ||
@@ -863,20 +1330,18 @@ textarea${_a.neg(_a.disabled)}${_a.neg(_a.notTabbable)}, | ||
/** | ||
* Classes | ||
* CSS-selector for submenu buttons | ||
*/ | ||
mintSelectors.classes = { | ||
sides: { | ||
top: _a.prefix('top'), | ||
right: _a.prefix('right'), | ||
bottom: _a.prefix('bottom'), | ||
left: _a.prefix('left') | ||
} | ||
}; | ||
exports["default"] = mintSelectors; | ||
MintSelectors.subMenuButtons = `button${_a.hasControls}`; | ||
/** | ||
* CSS-selector for submenus | ||
*/ | ||
MintSelectors.subMenu = `${_a.subMenuButtons} + ul${_a.hasId}`; | ||
; | ||
exports["default"] = MintSelectors; | ||
/***/ }), | ||
/***/ "./src/ts/settings.ts": | ||
/*!****************************!*\ | ||
!*** ./src/ts/settings.ts ***! | ||
\****************************/ | ||
/***/ "./src/ts/imports/util/settings.ts": | ||
/*!*****************************************!*\ | ||
!*** ./src/ts/imports/util/settings.ts ***! | ||
\*****************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
@@ -890,3 +1355,3 @@ | ||
})); | ||
exports.mintSettings = void 0; | ||
exports.MintSettings = void 0; | ||
/** | ||
@@ -896,3 +1361,3 @@ * Settings management | ||
*/ | ||
class mintSettings { | ||
class MintSettings { | ||
/** | ||
@@ -920,2 +1385,7 @@ * Update the provided settings variables | ||
} | ||
if (settings.break && Object.keys(settings.break).length) { | ||
if (Object.values(settings.break).reduce((prev, next) => prev && typeof next === 'number', true)) { | ||
this.break = Object.assign(Object.assign({}, this.break), settings.break); | ||
} | ||
} | ||
} | ||
@@ -936,16 +1406,16 @@ /** | ||
} | ||
exports.mintSettings = mintSettings; | ||
_a = mintSettings; | ||
exports.MintSettings = MintSettings; | ||
_a = MintSettings; | ||
/** | ||
* Value added to all delay variables | ||
*/ | ||
mintSettings.delayBase = 0; | ||
MintSettings.delayBase = 0; | ||
/** | ||
* Value multiplied by delay variable index | ||
*/ | ||
mintSettings.delayStep = 100; | ||
MintSettings.delayStep = 100; | ||
/** | ||
* Delay variables | ||
*/ | ||
mintSettings.delay = { | ||
MintSettings.delay = { | ||
instant: _a.delayBase + _a.delayStep * 0, | ||
@@ -958,189 +1428,116 @@ fast: _a.delayBase + _a.delayStep * 1, | ||
}; | ||
/** | ||
* Breakpoint variables | ||
*/ | ||
MintSettings.break = { | ||
z: 0, | ||
xs: 480, | ||
sm: 768, | ||
md: 1024, | ||
lg: 1200, | ||
xl: 1440 | ||
}; | ||
; | ||
exports["default"] = mintSettings; | ||
exports["default"] = MintSettings; | ||
/***/ }), | ||
/***/ "./src/ts/util.ts": | ||
/*!************************!*\ | ||
!*** ./src/ts/util.ts ***! | ||
\************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
/***/ "./src/ts/imports/util/text.ts": | ||
/*!*************************************!*\ | ||
!*** ./src/ts/imports/util/text.ts ***! | ||
\*************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.mintUtil = void 0; | ||
exports.MintText = void 0; | ||
/** | ||
* Imports | ||
* Functions for analyzing and manipulating text. | ||
*/ | ||
const enum_1 = __webpack_require__(/*! ./imports/enum */ "./src/ts/imports/enum.ts"); | ||
const settings_1 = __importDefault(__webpack_require__(/*! ./settings */ "./src/ts/settings.ts")); | ||
/** | ||
* Utility functions | ||
* @public | ||
*/ | ||
class mintUtil { | ||
class MintText { | ||
/** | ||
* Returns the width of the window, including fractional pixels | ||
* @returns the width of the window | ||
* Generate a slug from a string | ||
* @param text - The string to slugify | ||
* @returns The slugified string | ||
*/ | ||
static windowWidth() { | ||
let body = document.getElementsByTagName('body')[0], | ||
decimal = body.getBoundingClientRect().width % 1; | ||
return window.innerWidth + decimal; | ||
static slug(text) { | ||
var _a; | ||
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 : ''; | ||
} | ||
/** | ||
* Ensures that a function `func` is run only after not being called for `wait` milliseconds | ||
* @param func - the function to debounce | ||
* @param wait - the amount of time to wait before running the function | ||
* @returns - the debounced function | ||
* Generate a title from a slug | ||
* @param slug - The slug to generate a title from | ||
* @returns The title | ||
*/ | ||
static debounce(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let timer; | ||
return function (e) { | ||
if (timer) { | ||
clearTimeout(timer); | ||
} | ||
timer = setTimeout(func, wait, e); | ||
}; | ||
static unslug(slug) { | ||
return this.titleCase(slug.replace(/[-/]+/g, ' ')); | ||
} | ||
/** | ||
* Ensures that a function `func` is run only after not being called for `wait` milliseconds | ||
* @param func - the function to debounce | ||
* @param wait - the amount of time to wait before running the function | ||
* @returns - the debounced function as an EventListener | ||
* Format a phone number | ||
* @param phone - The phone number to format | ||
* @returns The formatted phone number | ||
*/ | ||
static debounceEvent(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
return mintUtil.debounce(func, wait); | ||
} | ||
/** | ||
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls | ||
* @param func - the function to throttle | ||
* @param wait - the amount of time between function calls | ||
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \} | ||
* @returns - the throttled function | ||
*/ | ||
static throttle(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let options = arguments.length > 2 ? arguments[2] : undefined; | ||
let context, | ||
args, | ||
result, | ||
timeout, | ||
previous = 0, | ||
later = function () { | ||
previous = (options === null || options === void 0 ? void 0 : options.leading) === false ? 0 : new Date().getTime(); | ||
timeout = 0; | ||
result = func.apply(context, args); | ||
if (!timeout) { | ||
context = args = null; | ||
static phone(phone) { | ||
var _a, _b; | ||
const given = (_a = phone === null || phone === void 0 ? void 0 : phone.toString().trim()) !== null && _a !== void 0 ? _a : ''; | ||
if (given === '(' || given === '') { | ||
return given; | ||
} | ||
let numbers = (_b = given.replace(/\D/g, '')) !== null && _b !== void 0 ? _b : '', | ||
formatted = ''; | ||
if (numbers.length > 10) { | ||
formatted += `+${numbers.slice(0, numbers.length - 10)} `; | ||
numbers = numbers.slice(numbers.length - 10); | ||
} | ||
for (var i = 0; i < numbers.length; i++) { | ||
switch (i) { | ||
case 0: | ||
formatted += '('; | ||
break; | ||
case 3: | ||
formatted += ') '; | ||
break; | ||
case 6: | ||
formatted += '-'; | ||
break; | ||
} | ||
formatted += numbers[i]; | ||
} | ||
switch (given[given.length - 1]) { | ||
case ')': | ||
if (i === 3) { | ||
formatted += ') '; | ||
} | ||
}, | ||
throttled = function () { | ||
let now = new Date().getTime(); | ||
if (!previous && (options === null || options === void 0 ? void 0 : options.leading) === false) { | ||
previous = now; | ||
break; | ||
case '-': | ||
if (i === 6) { | ||
formatted += '-'; | ||
} | ||
let remaining = wait - now + previous; | ||
context = this; | ||
args = arguments; | ||
if (remaining <= 0 || remaining > wait) { | ||
if (timeout) { | ||
clearTimeout(timeout); | ||
timeout = 0; | ||
} | ||
previous = now; | ||
result = func.apply(context, args); | ||
if (!timeout) { | ||
context = args = null; | ||
} | ||
} else if (!timeout && (options === null || options === void 0 ? void 0 : options.trailing) !== false) { | ||
timeout = window.setTimeout(later, remaining); | ||
} | ||
return result; | ||
}; | ||
return throttled; | ||
break; | ||
} | ||
return formatted; | ||
} | ||
/** | ||
* Ensures that a function `func` is called at most every `wait` milliseconds with optional leading and trailing calls | ||
* @param func - the function to throttle | ||
* @param wait - the amount of time between function calls | ||
* @param options - leading and trailing options: default = \{ leading: true, trailing, true \} | ||
* @returns - the throttled function as an EventListener | ||
* Pluralize the given word | ||
*/ | ||
static throttleEvent(func) { | ||
let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let options = arguments.length > 2 ? arguments[2] : undefined; | ||
return mintUtil.throttle(func, wait, options); | ||
} | ||
/** | ||
* Sets the element's height to its `innerHeight`, then to `auto` after a delay | ||
* @param el - the element whose height will be set | ||
* @param delay - the amount of time in milliseconds that the show animation will be active | ||
* @param from - the side that the element is animating from | ||
*/ | ||
static show(el) { | ||
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enum_1.mintSide.Top; | ||
if (el) { | ||
el.style.display = ''; | ||
requestAnimationFrame(() => { | ||
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) { | ||
el.style.height = `${el.scrollHeight}px`; | ||
} else { | ||
el.style.width = `${el.scrollWidth}px`; | ||
} | ||
setTimeout(() => { | ||
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) { | ||
el.style.height = 'auto'; | ||
} else { | ||
el.style.width = 'auto'; | ||
} | ||
}, delay); | ||
}); | ||
static plural(word) { | ||
if (word.endsWith('ies') || word.endsWith('es') || word.endsWith('s') && !word.endsWith('us') && !word.endsWith('is') && !word.endsWith('ss')) { | ||
return word; | ||
} | ||
if (word.endsWith('y') && !['a', 'e', 'i', 'o', 'u'].includes(word.charAt(word.length - 2))) { | ||
return word.slice(0, -1) + 'ies'; | ||
} | ||
if (word.endsWith('s') || word.endsWith('sh') || word.endsWith('ch') || word.endsWith('x') || word.endsWith('z')) { | ||
return word + 'es'; | ||
} | ||
return word + 's'; | ||
} | ||
/** | ||
* Sets the element's height to 0 | ||
* @param el - the element whose height will be set | ||
* @param delay - the amount of time in milliseconds that the show animation will be active | ||
* @param from - the side that the element is animating from | ||
* Capitalize the first letter of the given word | ||
*/ | ||
static hide(el) { | ||
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : settings_1.default.delay.default; | ||
let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : enum_1.mintSide.Top; | ||
if (el) { | ||
let height = el.scrollHeight, | ||
width = el.scrollWidth, | ||
transition = el.style.transition; | ||
el.style.transition = ''; | ||
requestAnimationFrame(() => { | ||
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) { | ||
el.style.height = `${height}px`; | ||
} else { | ||
el.style.width = `${width}px`; | ||
} | ||
el.style.transition = transition; | ||
requestAnimationFrame(() => { | ||
if (from === enum_1.mintSide.Top || from === enum_1.mintSide.Bottom) { | ||
el.style.height = '0'; | ||
} else { | ||
el.style.width = '0'; | ||
} | ||
}); | ||
}); | ||
setTimeout(() => { | ||
el.style.display = 'none'; | ||
}, delay); | ||
} | ||
static titleCase(text) { | ||
return text.toLowerCase().replace(/(?:^|\s)\S/g, a => a.toUpperCase()); | ||
} | ||
@@ -1183,5 +1580,79 @@ /** | ||
} | ||
exports.mintUtil = mintUtil; | ||
exports["default"] = mintUtil; | ||
exports.MintText = MintText; | ||
; | ||
exports["default"] = MintText; | ||
/***/ }), | ||
/***/ "./src/ts/imports/util/window.ts": | ||
/*!***************************************!*\ | ||
!*** ./src/ts/imports/util/window.ts ***! | ||
\***************************************/ | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.MintWindow = void 0; | ||
/** | ||
* Functions related to the browser window. | ||
*/ | ||
class MintWindow { | ||
/** | ||
* Returns the width of the window, including fractional pixels | ||
* @returns the width of the window | ||
*/ | ||
static width() { | ||
const decimal = document.body.getBoundingClientRect().width % 1; | ||
return window.innerWidth + decimal; | ||
} | ||
} | ||
exports.MintWindow = MintWindow; | ||
; | ||
exports["default"] = MintWindow; | ||
/***/ }), | ||
/***/ "./src/ts/index.ts": | ||
/*!*************************!*\ | ||
!*** ./src/ts/index.ts ***! | ||
\*************************/ | ||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { | ||
/** | ||
* A utility library for web applications. | ||
* | ||
* @packageDocumentation | ||
*/ | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __exportStar = this && this.__exportStar || function (m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
/** | ||
* Exports | ||
*/ | ||
__exportStar(__webpack_require__(/*! ./imports */ "./src/ts/imports/index.ts"), exports); | ||
/***/ }) | ||
@@ -1188,0 +1659,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mint=t():e.mint=t()}(self,(()=>(()=>{"use strict";var e={64:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.mintSide=void 0,(i=t.mintSide||(t.mintSide={}))[i.Top=0]="Top",i[i.Right=1]="Right",i[i.Bottom=2]="Bottom",i[i.Left=3]="Left"},54:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintColor=void 0;class i{constructor(e){this.r="number"==typeof e.r?Math.max(Math.min(e.r,i.hexBase**2-1),0):0,this.g="number"==typeof e.g?Math.max(Math.min(e.g,i.hexBase**2-1),0):0,this.b="number"==typeof e.b?Math.max(Math.min(e.b,i.hexBase**2-1),0):0,this.a="number"==typeof e.a?Math.max(Math.min(e.a,1),0):1,"string"==typeof e.color&&this.stringConstructor(e.color)}stringConstructor(e){e.startsWith("#")?this.hexConstructor(e):(~e.indexOf("linear-gradient")&&(e=e.substring(e.indexOf("linear-gradient"),e.length)),this.rgbConstructor(e))}hexConstructor(e){switch(e.length){case 1:case 5:case 6:return;case 2:e="#"+e[1]+e[1]+e[1]+e[1]+e[1]+e[1]+i.hexMax;break;case 3:e="#"+e[1]+e[1]+e[1]+e[2]+e[2]+e[2]+i.hexMax;break;case 4:e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+i.hexMax;break;case 7:e+=i.hexMax;break;case 8:e+=e[e.length-1];break;default:e=e.substring(0,9)}this.r=parseInt(e.substring(1,3),i.hexBase),this.g=parseInt(e.substring(3,5),i.hexBase),this.b=parseInt(e.substring(5,7),i.hexBase),this.a=parseInt(e.substring(7,9),i.hexBase)/i.hexBase**2}rgbConstructor(e){let t=e.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);t&&(this.r=parseInt(t[1]),this.g=parseInt(t[2]),this.b=parseInt(t[3]),this.a=parseFloat(t[4]))}getBrightness(){return 0===this.a?262:isNaN(this.r)||isNaN(this.g)||isNaN(this.b)?-1:Math.round((299*this.r+587*this.g+144*this.b)/1e3)}}t.mintColor=i,i.hexBase=16,i.hexMax="FF",t.default=i},708:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintItem=void 0;class i{constructor(){this.version=0,this.priority=0,this.centered=!1,this.disabled=!1,this.queryParams={},this.attributes={},this.classes=[],this.buttons=[],this.images=[],this.children=[]}}t.mintItem=i,t.default=i},139:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintDisplay=void 0;class i{}t.mintDisplay=i,t.default=i},376:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintEvent=void 0;class i{}t.mintEvent=i,t.default=i},4:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mintIcon=void 0;const a=n(i(982));class r{static append(e,t){document.querySelectorAll(t).forEach((t=>{let i=t.querySelector("i"),n=document.createElement("i");n.classList.add(...e.split(" ")),i?t.replaceChild(n,i):t.appendChild(n)}))}static update(e){let t=a.default.removeValues(Object.assign(Object.assign({},this.icons),e),[!1]);Object.keys(t).forEach((e=>{this.append(t[e],e)}))}}t.mintIcon=r,r.icons={'a[href^="http"]':"fas fa-up-right-from-square",'a[href^="mailto:"]':"far fa-envelope",'a[href^="tel:"]':"fas fa-phone-flip",'a[href^="sms:"]':"far fa-message"},t.default=r},683:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintMath=void 0;class i{static randomInt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t)+t)}}t.mintMath=i,t.default=i},982:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintObject=void 0;class i{static isSimilar(e,t){let i=Object.keys(e);return i.length===Object.keys(t).length&&(i.forEach((i=>{if(e[i]!==t[i])return!1})),!0)}static isSuperset(e,t){let n=!0;if(e===t)return n;try{if(0===Object.keys(t).length)return!n}catch(e){return!n}return Object.keys(t).forEach((a=>{n=n&&i.isSuperset(e[a],t[a])})),n}static remove(e,t){return this.removeKeys(e,t)}static removeKeys(e,t){return Object.keys(e).reduce(((i,n)=>(t.includes(n)||(i[n]=e[n]),i)),{})}static removeValues(e,t){return Object.keys(e).reduce(((i,n)=>(t.includes(e[n])||(i[n]=e[n]),i)),{})}static sort(e){return Object.keys(e).sort().reduce(((t,i)=>(t[i]=e[i],t)),{})}static filter(e,t){return this.filterKeys(e,t)}static filterKeys(e,t){return t.reduce(((t,i)=>(t[i]=e[i],t)),{})}static filterValues(e,t){return Object.keys(e).reduce(((i,n)=>(t.includes(e[n])&&(i[n]=e[n]),i)),{})}}t.mintObject=i,t.default=i},226:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintText=void 0;class i{}t.mintText=i,t.default=i},505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintWindow=void 0;class i{}t.mintWindow=i,t.default=i},491:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.mintUtil=t.mintSettings=t.mintSelectors=t.mintWindow=t.mintText=t.mintObject=t.mintMath=t.mintIcon=t.mintEvent=t.mintDisplay=t.mintItem=t.mintColor=t.mintSide=void 0;var a=i(64);Object.defineProperty(t,"mintSide",{enumerable:!0,get:function(){return a.mintSide}});var r=i(54);Object.defineProperty(t,"mintColor",{enumerable:!0,get:function(){return r.mintColor}});var s=i(708);Object.defineProperty(t,"mintItem",{enumerable:!0,get:function(){return s.mintItem}});var l=i(139);Object.defineProperty(t,"mintDisplay",{enumerable:!0,get:function(){return l.mintDisplay}});var o=i(376);Object.defineProperty(t,"mintEvent",{enumerable:!0,get:function(){return o.mintEvent}});var d=i(4);Object.defineProperty(t,"mintIcon",{enumerable:!0,get:function(){return d.mintIcon}});var u=i(683);Object.defineProperty(t,"mintMath",{enumerable:!0,get:function(){return u.mintMath}});var c=i(982);Object.defineProperty(t,"mintObject",{enumerable:!0,get:function(){return c.mintObject}});var h=i(226);Object.defineProperty(t,"mintText",{enumerable:!0,get:function(){return h.mintText}});var m=i(505);Object.defineProperty(t,"mintWindow",{enumerable:!0,get:function(){return m.mintWindow}});var f=i(565);Object.defineProperty(t,"mintSelectors",{enumerable:!0,get:function(){return f.mintSelectors}});var b=i(750);Object.defineProperty(t,"mintSettings",{enumerable:!0,get:function(){return b.mintSettings}});var p=i(427);Object.defineProperty(t,"mintUtil",{enumerable:!0,get:function(){return p.mintUtil}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(p).default}})},565:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.mintSelectors=void 0;class n{static prefix(e){return(e=e.toLowerCase()).startsWith(this.pre)?e:`${this.pre}${e}`}static cssPrefix(e){return`--${this.prefix(e.replace(/^-+/,""))}`}static cssVar(e){return`var(${this.cssPrefix(e)})`}static neg(e){return`:not(${e})`}static class(e){return`.${this.prefix(e)}`}static id(e){return`#${this.prefix(e)}`}static controls(e){return e?`[aria-controls="${this.prefix(e)}"]`:this.hasControls}static expanded(e){return"boolean"==typeof e?`[aria-expanded="${e}"]`:this.hasExpanded}static getId(e){var t;return null!==(t=this.ids[null!=e?e:-1])&&void 0!==t?t:""}static getClass(e,t){var i,n;return t?null!==(i=this.classes[t][null!=e?e:-1])&&void 0!==i?i:"":null!==(n=this.classes[null!=e?e:-1])&&void 0!==n?n:""}static getFocusables(e){let t;return t=e?[...e.querySelectorAll(this.focusable)]:[...document.querySelectorAll(this.focusable)],t.filter((e=>this.isFocusable(e)))}static isFocusable(e){let t=e;do{if("none"===window.getComputedStyle(t).getPropertyValue("display").toLowerCase())return!1;t=t.parentElement}while(t);return!0}}t.mintSelectors=n,i=n,n.lib="mint",n.pre=`${i.lib}-`,n.disabled="[disabled]",n.hasControls="[aria-controls]",n.hasExpanded="[aria-expanded]",n.hasLink="[href]",n.hasRouterLink="[routerLink]",n.hasId="[id]",n.notTabbable='[tabindex^="-"]',n.tabbable=`[tabindex]${i.neg(i.notTabbable)}`,n.focusable=`input${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n select${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n textarea${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n button${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n object${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n a${i.hasLink}, a${i.hasRouterLink},\n area${i.hasLink},\n ${i.tabbable}`.replace(/\s/g,""),n.classes={sides:{top:i.prefix("top"),right:i.prefix("right"),bottom:i.prefix("bottom"),left:i.prefix("left")}},t.default=n},750:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.mintSettings=void 0;class n{static set(e){let t=!1;"number"==typeof e.delayBase&&(this.delayBase=e.delayBase,t=!0),"number"==typeof e.delayStep&&(this.delayStep=e.delayStep,t=!0),t&&this.setDelay(),e.delay&&Object.keys(e.delay).length&&Object.values(e.delay).reduce(((e,t)=>e&&"number"==typeof t),!0)&&(this.delay=Object.assign(Object.assign({},this.delay),e.delay))}static setDelay(){this.delay={instant:this.delayBase+0*this.delayStep,fast:this.delayBase+1*this.delayStep,medFast:this.delayBase+2*this.delayStep,default:this.delayBase+3*this.delayStep,medSlow:this.delayBase+4*this.delayStep,slow:this.delayBase+5*this.delayStep}}}t.mintSettings=n,i=n,n.delayBase=0,n.delayStep=100,n.delay={instant:i.delayBase+0*i.delayStep,fast:i.delayBase+1*i.delayStep,medFast:i.delayBase+2*i.delayStep,default:i.delayBase+3*i.delayStep,medSlow:i.delayBase+4*i.delayStep,slow:i.delayBase+5*i.delayStep},t.default=n},427:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mintUtil=void 0;const a=i(64),r=n(i(750));class s{static windowWidth(){let e=document.getElementsByTagName("body")[0].getBoundingClientRect().width%1;return window.innerWidth+e}static debounce(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default.delay.default;return function(n){t&&clearTimeout(t),t=setTimeout(e,i,n)}}static debounceEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default.delay.default;return s.debounce(e,t)}static throttle(e){let t,i,n,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default.delay.default,l=arguments.length>2?arguments[2]:void 0,o=0,d=function(){o=!1===(null==l?void 0:l.leading)?0:(new Date).getTime(),a=0,n=e.apply(t,i),a||(t=i=null)};return function(){let r=(new Date).getTime();o||!1!==(null==l?void 0:l.leading)||(o=r);let u=s-r+o;return t=this,i=arguments,u<=0||u>s?(a&&(clearTimeout(a),a=0),o=r,n=e.apply(t,i),a||(t=i=null)):a||!1===(null==l?void 0:l.trailing)||(a=window.setTimeout(d,u)),n}}static throttleEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default.delay.default,i=arguments.length>2?arguments[2]:void 0;return s.throttle(e,t,i)}static show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default.delay.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.mintSide.Top;e&&(e.style.display="",requestAnimationFrame((()=>{i===a.mintSide.Top||i===a.mintSide.Bottom?e.style.height=`${e.scrollHeight}px`:e.style.width=`${e.scrollWidth}px`,setTimeout((()=>{i===a.mintSide.Top||i===a.mintSide.Bottom?e.style.height="auto":e.style.width="auto"}),t)})))}static hide(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default.delay.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.mintSide.Top;if(e){let n=e.scrollHeight,r=e.scrollWidth,s=e.style.transition;e.style.transition="",requestAnimationFrame((()=>{i===a.mintSide.Top||i===a.mintSide.Bottom?e.style.height=`${n}px`:e.style.width=`${r}px`,e.style.transition=s,requestAnimationFrame((()=>{i===a.mintSide.Top||i===a.mintSide.Bottom?e.style.height="0":e.style.width="0"}))})),setTimeout((()=>{e.style.display="none"}),t)}}static copyText(e){let t=document.createElement("textarea");return!(!e||!t||(t.value=e,t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n transform: translate(-100%, -100%);\n opacity: 0;\n z-index: -1;\n ",document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value),document.body.removeChild(t),0))}static isEmail(e){return null!==e.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])+)\])/)}}t.mintUtil=s,t.default=s}},t={};return function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,i),r.exports}(491)})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mint=t():e.mint=t()}(self,(()=>(()=>{"use strict";var e={573:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,a)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),a(i(22),t)},22:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.EMintSide=void 0,(i=t.EMintSide||(t.EMintSide={}))[i.Top=0]="Top",i[i.Right=1]="Right",i[i.Bottom=2]="Bottom",i[i.Left=3]="Left"},709:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,a)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),a(i(573),t),a(i(231),t),a(i(17),t)},54:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mintColor=void 0;class i{constructor(e){this.r="number"==typeof e.r?Math.max(Math.min(e.r,i.hexBase**2-1),0):0,this.g="number"==typeof e.g?Math.max(Math.min(e.g,i.hexBase**2-1),0):0,this.b="number"==typeof e.b?Math.max(Math.min(e.b,i.hexBase**2-1),0):0,this.a="number"==typeof e.a?Math.max(Math.min(e.a,1),0):1,"string"==typeof e.color&&this.stringConstructor(e.color)}stringConstructor(e){e.startsWith("#")?this.hexConstructor(e):(~e.indexOf("linear-gradient")&&(e=e.substring(e.indexOf("linear-gradient"),e.length)),this.rgbConstructor(e))}hexConstructor(e){switch(e.length){case 1:case 5:case 6:return;case 2:e="#"+e[1]+e[1]+e[1]+e[1]+e[1]+e[1]+i.hexMax;break;case 3:e="#"+e[1]+e[1]+e[1]+e[2]+e[2]+e[2]+i.hexMax;break;case 4:e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+i.hexMax;break;case 7:e+=i.hexMax;break;case 8:e+=e[e.length-1];break;default:e=e.substring(0,9)}this.r=parseInt(e.substring(1,3),i.hexBase),this.g=parseInt(e.substring(3,5),i.hexBase),this.b=parseInt(e.substring(5,7),i.hexBase),this.a=parseInt(e.substring(7,9),i.hexBase)/i.hexBase**2}rgbConstructor(e){let t=e.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);t&&(this.r=parseInt(t[1]),this.g=parseInt(t[2]),this.b=parseInt(t[3]),this.a=parseFloat(t[4]))}getBrightness(){return 0===this.a?262:isNaN(this.r)||isNaN(this.g)||isNaN(this.b)?-1:Math.round((299*this.r+587*this.g+144*this.b)/1e3)}}t.mintColor=i,i.hexBase=16,i.hexMax="FF",t.default=i},822:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},231:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,a)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),a(i(54),t),a(i(822),t),a(i(708),t),a(i(753),t),a(i(871),t),a(i(13),t)},708:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintItem=void 0;class i{constructor(){this.version=0,this.priority=0,this.price=0,this.level=0,this.size=0,this.num=0,this.width=0,this.height=0,this.active=!1,this.centered=!1,this.disabled=!1,this.private=!1,this.attr={},this.params={},this.options={},this.lists={},this.paragraphs=[],this.classes=[],this.items=[],this.images=[],this.buttons=[]}}t.MintItem=i,t.default=i},753:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},13:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},261:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintAsync=void 0;class i{static wait(e){return new Promise((t=>setTimeout(t,e)))}}t.MintAsync=i,t.default=i},139:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintDisplay=void 0;const s=i(573),a=i(110);class n{static show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.MintSettings.delay.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.EMintSide.Top;e&&(e.style.display="",requestAnimationFrame((()=>{i===s.EMintSide.Top||i===s.EMintSide.Bottom?e.style.height=`${e.scrollHeight}px`:e.style.width=`${e.scrollWidth}px`,setTimeout((()=>{i===s.EMintSide.Top||i===s.EMintSide.Bottom?e.style.height="auto":e.style.width="auto"}),t)})))}static hide(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.MintSettings.delay.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.EMintSide.Top;if(e){let a=e.scrollHeight,n=e.scrollWidth,r=e.style.transition;e.style.transition="",requestAnimationFrame((()=>{i===s.EMintSide.Top||i===s.EMintSide.Bottom?e.style.height=`${a}px`:e.style.width=`${n}px`,e.style.transition=r,requestAnimationFrame((()=>{i===s.EMintSide.Top||i===s.EMintSide.Bottom?e.style.height="0":e.style.width="0"}))})),setTimeout((()=>{e.style.display="none"}),t)}}}t.MintDisplay=n,t.default=n},376:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MintEvent=void 0;const a=s(i(110));class n{static debounce(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default.delay.default;return function(s){t&&clearTimeout(t),t=setTimeout(e,i,s)}}static debounceEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default.delay.default;return n.debounce(e,t)}static throttle(e){let t,i,s,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default.delay.default,l=arguments.length>2?arguments[2]:void 0,o=0,d=function(){o=!1===(null==l?void 0:l.leading)?0:(new Date).getTime(),n=0,s=e.apply(t,i),n||(t=i=null)};return function(){let a=(new Date).getTime();o||!1!==(null==l?void 0:l.leading)||(o=a);let c=r-a+o;return t=this,i=arguments,c<=0||c>r?(n&&(clearTimeout(n),n=0),o=a,s=e.apply(t,i),n||(t=i=null)):n||!1===(null==l?void 0:l.trailing)||(n=window.setTimeout(d,c)),s}}static throttleEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default.delay.default,i=arguments.length>2?arguments[2]:void 0;return n.throttle(e,t,i)}}t.MintEvent=n,t.default=n},4:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MintIcon=void 0;const a=s(i(982));class n{static append(e,t){document.querySelectorAll(t).forEach((t=>{let i=document.createElement("i");i.classList.add(...e.split(" ")),t.querySelector("i")||t.appendChild(i),i.classList.contains("fa-up-right-from-square")&&t.setAttribute("target","_blank")}))}static update(e){let t=a.default.removeValues(Object.assign(Object.assign({},this.icons),e),[!1]);Object.keys(t).forEach((e=>{this.append(t[e],e)}))}static remove(e,t){document.querySelectorAll(t).forEach((e=>{let t=e.querySelector("i");t&&t.remove()}))}}t.MintIcon=n,n.icons={'a[href^="mailto:"]':"far fa-envelope",'a[href^="tel:"]':"fas fa-phone-flip",'a[href^="sms:"]':"far fa-message",'a[href^="https://maps"]':"fas fa-map-location-dot",'a[href^="http"]':"fas fa-up-right-from-square"},t.default=n},17:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,a)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),a(i(261),t),a(i(139),t),a(i(376),t),a(i(4),t),a(i(718),t),a(i(683),t),a(i(982),t),a(i(85),t),a(i(378),t),a(i(110),t),a(i(226),t),a(i(505),t)},718:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintList=void 0;class i{static shuffleCopy(e){let t=[...e];for(let e=t.length-1;e>0;e--){const i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}return t}static filter(e,t){let i=0;for(let s=0;s<e.length;s++)t(e[s])&&(e[i++]=e[s]);return e.length=i,e}}t.MintList=i,t.default=i},683:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintMath=void 0;class i{static randomInt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t)+t)}}t.MintMath=i,t.default=i},982:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintObject=void 0;class i{static isSimilar(e,t){let i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;let s=!0;return i.forEach((i=>{e[i]!==t[i]&&(s=!1)})),s}static isSuperset(e,t){let s=!0;if(e===t)return s;try{if(0===Object.keys(t).length)return!s}catch(e){return!s}return Object.keys(t).forEach((a=>{s=s&&i.isSuperset(e[a],t[a])})),s}static remove(e,t){return this.removeKeys(e,t)}static removeKeys(e,t){return Object.keys(e).reduce(((i,s)=>(t.includes(s)||(i[s]=e[s]),i)),{})}static removeValues(e,t){return Object.keys(e).reduce(((i,s)=>(t.includes(e[s])||(i[s]=e[s]),i)),{})}static sort(e,t){return this.sortKeys(e,t)}static sortKeys(e,t){return Object.keys(e).sort(t).reduce(((t,i)=>(t[i]=e[i],t)),{})}static sortValues(e,t){return Object.keys(e).sort(((i,s)=>t(e[i],e[s]))).reduce(((t,i)=>(t[i]=e[i],t)),{})}static filter(e,t){return this.filterKeys(e,t)}static filterKeys(e,t){return t.reduce(((t,i)=>(t[i]=e[i],t)),{})}static filterValues(e,t){return Object.keys(e).reduce(((i,s)=>(t.includes(e[s])&&(i[s]=e[s]),i)),{})}static updateArray(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";if(null==t?void 0:t.length){const s=t.reduce(((e,t)=>{var s;return Object.assign(Object.assign({},e),{[null!==(s=null==t?void 0:t[i])&&void 0!==s?s:""]:t})}),{}),a=e.filter((e=>{var t;return!s[null!==(t=null==e?void 0:e[i])&&void 0!==t?t:""]}));null==a||a.forEach((t=>{const i=e.indexOf(t);"number"==typeof i&&-1!==i&&e.splice(i,1)})),e.forEach((e=>{var t,a;s[null!==(t=null==e?void 0:e[i])&&void 0!==t?t:""]&&Object.assign(e,s[null!==(a=null==e?void 0:e[i])&&void 0!==a?a:""])}))}else null==t||t.forEach((t=>e.push(t)));const s=null==t?void 0:t.filter((t=>!e.some((e=>(null==e?void 0:e[i])===(null==t?void 0:t[i])))));null==s||s.forEach((t=>e.push(t)))}static getKeyByValue(e,t){return Object.keys(e).find((i=>e[i]===t))}static deepClone(e){const t={};for(const i in e)"function"==typeof e[i]?t[i]=e[i].bind(t):e[i]&&"object"==typeof e[i]?t[i]=this.deepClone(e[i]):t[i]=e[i];return t}}t.MintObject=i,t.default=i},85:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MintScroll=void 0;const a=s(i(376));class n{static toTop(){window.scrollTo(0,0)}static toBottom(){window.scrollTo(0,document.body.scrollHeight)}static showElements(){requestAnimationFrame((()=>{let e=document.querySelectorAll(".mint-fall-in:not(.mint-show)"),t=[];for(let i=0;i<e.length;i++)e[i].getBoundingClientRect().top<0?e[i].classList.add("mint-show"):e[i].getBoundingClientRect().top<3*window.innerHeight/4&&t.push(e[i]);for(let e=0;e<t.length;e++)setTimeout((()=>{t[e].classList.add("mint-show")}),100*e)}))}static showElementsOnScroll(){window.addEventListener("scroll",a.default.throttleEvent(this.showElements,200))}}t.MintScroll=n,t.default=n},378:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.MintSelectors=void 0;class s{static prefix(e){return(e=e.toLowerCase()).startsWith(this.pre)?e:`${this.pre}${e}`}static cssPrefix(e){return`--${this.prefix(e.replace(/^-+/,""))}`}static cssVar(e){return`var(${this.cssPrefix(e)})`}static neg(e){return`:not(${e})`}static class(e){return`.${this.prefix(e)}`}static id(e){return`#${this.prefix(e)}`}static controls(e){return e?`[aria-controls="${this.prefix(e)}"]`:this.hasControls}static expanded(e){return"boolean"==typeof e?`[aria-expanded="${e}"]`:this.hasExpanded}static getFocusables(e){let t;return t=e?Array.from(e.querySelectorAll(this.focusable)):Array.from(document.querySelectorAll(this.focusable)),t.filter((e=>this.isFocusable(e)))}static isFocusable(e){let t=e;do{if("none"===window.getComputedStyle(t).getPropertyValue("display").toLowerCase())return!1;t=t.parentElement}while(t);return!0}}t.MintSelectors=s,i=s,s.lib="mint",s.pre=`${i.lib}-`,s.disabled="[disabled]",s.hasControls="[aria-controls]",s.hasExpanded="[aria-expanded]",s.hasLink="[href]",s.hasRouterLink="[routerLink]",s.hasId="[id]",s.notTabbable='[tabindex^="-"]',s.tabbable=`[tabindex]${i.neg(i.notTabbable)}`,s.focusable=`input${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n select${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n textarea${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n button${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n object${i.neg(i.disabled)}${i.neg(i.notTabbable)},\n a${i.hasLink}, a${i.hasRouterLink},\n area${i.hasLink},\n ${i.tabbable}`.replace(/\s/g,""),s.subMenuButtons=`button${i.hasControls}`,s.subMenu=`${i.subMenuButtons} + ul${i.hasId}`,t.default=s},110:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.MintSettings=void 0;class s{static set(e){let t=!1;"number"==typeof e.delayBase&&(this.delayBase=e.delayBase,t=!0),"number"==typeof e.delayStep&&(this.delayStep=e.delayStep,t=!0),t&&this.setDelay(),e.delay&&Object.keys(e.delay).length&&Object.values(e.delay).reduce(((e,t)=>e&&"number"==typeof t),!0)&&(this.delay=Object.assign(Object.assign({},this.delay),e.delay)),e.break&&Object.keys(e.break).length&&Object.values(e.break).reduce(((e,t)=>e&&"number"==typeof t),!0)&&(this.break=Object.assign(Object.assign({},this.break),e.break))}static setDelay(){this.delay={instant:this.delayBase+0*this.delayStep,fast:this.delayBase+1*this.delayStep,medFast:this.delayBase+2*this.delayStep,default:this.delayBase+3*this.delayStep,medSlow:this.delayBase+4*this.delayStep,slow:this.delayBase+5*this.delayStep}}}t.MintSettings=s,i=s,s.delayBase=0,s.delayStep=100,s.delay={instant:i.delayBase+0*i.delayStep,fast:i.delayBase+1*i.delayStep,medFast:i.delayBase+2*i.delayStep,default:i.delayBase+3*i.delayStep,medSlow:i.delayBase+4*i.delayStep,slow:i.delayBase+5*i.delayStep},s.break={z:0,xs:480,sm:768,md:1024,lg:1200,xl:1440},t.default=s},226:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintText=void 0;class i{static slug(e){var t;return null!==(t=null==e?void 0:e.trim().toLowerCase().replace(/'/g,"").replace(/[^\w/-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^\/+|\/+$/g,""))&&void 0!==t?t:""}static unslug(e){return this.titleCase(e.replace(/[-/]+/g," "))}static phone(e){var t,i;const s=null!==(t=null==e?void 0:e.toString().trim())&&void 0!==t?t:"";if("("===s||""===s)return s;let a=null!==(i=s.replace(/\D/g,""))&&void 0!==i?i:"",n="";a.length>10&&(n+=`+${a.slice(0,a.length-10)} `,a=a.slice(a.length-10));for(var r=0;r<a.length;r++){switch(r){case 0:n+="(";break;case 3:n+=") ";break;case 6:n+="-"}n+=a[r]}switch(s[s.length-1]){case")":3===r&&(n+=") ");break;case"-":6===r&&(n+="-")}return n}static plural(e){return e.endsWith("ies")||e.endsWith("es")||e.endsWith("s")&&!e.endsWith("us")&&!e.endsWith("is")&&!e.endsWith("ss")?e:e.endsWith("y")&&!["a","e","i","o","u"].includes(e.charAt(e.length-2))?e.slice(0,-1)+"ies":e.endsWith("s")||e.endsWith("sh")||e.endsWith("ch")||e.endsWith("x")||e.endsWith("z")?e+"es":e+"s"}static titleCase(e){return e.toLowerCase().replace(/(?:^|\s)\S/g,(e=>e.toUpperCase()))}static copyText(e){let t=document.createElement("textarea");return!(!e||!t||(t.value=e,t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n transform: translate(-100%, -100%);\n opacity: 0;\n z-index: -1;\n ",document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),navigator.clipboard.writeText(t.value),document.body.removeChild(t),0))}static isEmail(e){return null!==e.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])+)\])/)}}t.MintText=i,t.default=i},505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MintWindow=void 0;class i{static width(){const e=document.body.getBoundingClientRect().width%1;return window.innerWidth+e}}t.MintWindow=i,t.default=i},491:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,a)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),a(i(709),t)}},t={};return function i(s){var a=t[s];if(void 0!==a)return a.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}(491)})())); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@appartmint/util", | ||
"author": "App/Art Mint", | ||
"version": "0.9.0", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
@@ -23,7 +23,8 @@ "description": "App/Art Mint Utility Functions", | ||
}, | ||
"main": "src/ts/index.ts", | ||
"main": "dist/js/index.min.js", | ||
"types": "dist/js/index.d.ts", | ||
"type": "module", | ||
"files": [ | ||
"dist/**/*.{css,js,d.ts,map}", | ||
"src/**/*.{ts,scss}" | ||
"src/scss/**/*.scss", | ||
"dist/**/*.{css,js,d.ts,map}" | ||
], | ||
@@ -49,6 +50,6 @@ "directories": { | ||
"scripts": { | ||
"upgrade": "npm up -D @appartmint/config && mint-config", | ||
"upgrade": "npm i -D @appartmint/config@latest && mint-config", | ||
"prepare": "npm-run-all clean bundle", | ||
"preversion": "npm i && npm run test", | ||
"version": "npm publish && git add -A", | ||
"version": "git add -A", | ||
"postversion": "git push && git push --tags && npm run endversion --if-present", | ||
@@ -65,3 +66,3 @@ "clean": "cross-var rimraf $npm_package_config_dirs_dist $npm_package_config_dirs_doc", | ||
"build:tsdoc": "typedoc", | ||
"build:sassdoc": "cross-var sassdoc $npm_package_config_dirs_src/$npm_package_config_dirs_scss -p > $npm_package_config_dirs_doc/sassdoc.json", | ||
"build:sassdoc": "cross-var \"sassdoc $npm_package_config_dirs_src/$npm_package_config_dirs_scss -p > $npm_package_config_dirs_doc/sassdoc.json\"", | ||
"serve": "cross-var webpack serve --config $npm_package_config_webpack", | ||
@@ -76,3 +77,3 @@ "watch": "npm run build -- --watch", | ||
"devDependencies": { | ||
"@appartmint/config": "^0.7.0", | ||
"@appartmint/config": "^1.0.1", | ||
"@babel/core": "^7.19.6", | ||
@@ -79,0 +80,0 @@ "@babel/preset-env": "^7.19.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
267838
56
2282
1