diff --git a/Gruntfile.js b/Gruntfile.js index 1c38169a79..81489bcad9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -137,11 +137,14 @@ module.exports = function(grunt) { prod_min: Object.assign({}, webpackConfig, { mode: 'production', devtool: 'source-map', + optimization: { + minimize: true + }, output: { filename: 'materialize.min.js', path: path.resolve(__dirname, 'dist/js'), - libraryTarget: 'umd', - globalObject: 'this' + libraryTarget: 'umd', + globalObject: 'this' } }), }, diff --git a/dist/js/materialize.min.js b/dist/js/materialize.min.js index d23a7a3b03..06659674e9 100644 --- a/dist/js/materialize.min.js +++ b/dist/js/materialize.min.js @@ -3,9059 +3,5 @@ * Copyright 2014-2023 Materialize * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE) */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else { - var a = factory(); - for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; - } -})(this, () => { -return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ 30: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* - * anime.js v3.2.1 - * (c) 2020 Julian Garnier - * Released under the MIT license - * animejs.com - */ - -// Defaults - -var defaultInstanceSettings = { - update: null, - begin: null, - loopBegin: null, - changeBegin: null, - change: null, - changeComplete: null, - loopComplete: null, - complete: null, - loop: 1, - direction: 'normal', - autoplay: true, - timelineOffset: 0 -}; - -var defaultTweenSettings = { - duration: 1000, - delay: 0, - endDelay: 0, - easing: 'easeOutElastic(1, .5)', - round: 0 -}; - -var validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d']; - -// Caching - -var cache = { - CSS: {}, - springs: {} -}; - -// Utils - -function minMax(val, min, max) { - return Math.min(Math.max(val, min), max); -} - -function stringContains(str, text) { - return str.indexOf(text) > -1; -} - -function applyArguments(func, args) { - return func.apply(null, args); -} - -var is = { - arr: function (a) { return Array.isArray(a); }, - obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); }, - pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); }, - svg: function (a) { return a instanceof SVGElement; }, - inp: function (a) { return a instanceof HTMLInputElement; }, - dom: function (a) { return a.nodeType || is.svg(a); }, - str: function (a) { return typeof a === 'string'; }, - fnc: function (a) { return typeof a === 'function'; }, - und: function (a) { return typeof a === 'undefined'; }, - nil: function (a) { return is.und(a) || a === null; }, - hex: function (a) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); }, - rgb: function (a) { return /^rgb/.test(a); }, - hsl: function (a) { return /^hsl/.test(a); }, - col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); }, - key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; }, -}; - -// Easings - -function parseEasingParameters(string) { - var match = /\(([^)]+)\)/.exec(string); - return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : []; -} - -// Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js - -function spring(string, duration) { - - var params = parseEasingParameters(string); - var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100); - var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100); - var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100); - var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100); - var w0 = Math.sqrt(stiffness / mass); - var zeta = damping / (2 * Math.sqrt(stiffness * mass)); - var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0; - var a = 1; - var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0; - - function solver(t) { - var progress = duration ? (duration * t) / 1000 : t; - if (zeta < 1) { - progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress)); - } else { - progress = (a + b * progress) * Math.exp(-progress * w0); - } - if (t === 0 || t === 1) { return t; } - return 1 - progress; - } - - function getDuration() { - var cached = cache.springs[string]; - if (cached) { return cached; } - var frame = 1/6; - var elapsed = 0; - var rest = 0; - while(true) { - elapsed += frame; - if (solver(elapsed) === 1) { - rest++; - if (rest >= 16) { break; } - } else { - rest = 0; - } - } - var duration = elapsed * frame * 1000; - cache.springs[string] = duration; - return duration; - } - - return duration ? solver : getDuration; - -} - -// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function - -function steps(steps) { - if ( steps === void 0 ) steps = 10; - - return function (t) { return Math.ceil((minMax(t, 0.000001, 1)) * steps) * (1 / steps); }; -} - -// BezierEasing https://github.com/gre/bezier-easing - -var bezier = (function () { - - var kSplineTableSize = 11; - var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); - - function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 } - function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 } - function C(aA1) { return 3.0 * aA1 } - - function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT } - function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) } - - function binarySubdivide(aX, aA, aB, mX1, mX2) { - var currentX, currentT, i = 0; - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { aB = currentT; } else { aA = currentT; } - } while (Math.abs(currentX) > 0.0000001 && ++i < 10); - return currentT; - } - - function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { - for (var i = 0; i < 4; ++i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0.0) { return aGuessT; } - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - return aGuessT; - } - - function bezier(mX1, mY1, mX2, mY2) { - - if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; } - var sampleValues = new Float32Array(kSplineTableSize); - - if (mX1 !== mY1 || mX2 !== mY2) { - for (var i = 0; i < kSplineTableSize; ++i) { - sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); - } - } - - function getTForX(aX) { - - var intervalStart = 0; - var currentSample = 1; - var lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - - --currentSample; - - var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); - var guessForT = intervalStart + dist * kSampleStepSize; - var initialSlope = getSlope(guessForT, mX1, mX2); - - if (initialSlope >= 0.001) { - return newtonRaphsonIterate(aX, guessForT, mX1, mX2); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); - } - - } - - return function (x) { - if (mX1 === mY1 && mX2 === mY2) { return x; } - if (x === 0 || x === 1) { return x; } - return calcBezier(getTForX(x), mY1, mY2); - } - - } - - return bezier; - -})(); - -var penner = (function () { - - // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing) - - var eases = { linear: function () { return function (t) { return t; }; } }; - - var functionEasings = { - Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; }, - Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; }, - Back: function () { return function (t) { return t * t * (3 * t - 2); }; }, - Bounce: function () { return function (t) { - var pow2, b = 4; - while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {} - return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2) - }; }, - Elastic: function (amplitude, period) { - if ( amplitude === void 0 ) amplitude = 1; - if ( period === void 0 ) period = .5; - - var a = minMax(amplitude, 1, 10); - var p = minMax(period, .1, 2); - return function (t) { - return (t === 0 || t === 1) ? t : - -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p); - } - } - }; - - var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo']; - - baseEasings.forEach(function (name, i) { - functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; }; - }); - - Object.keys(functionEasings).forEach(function (name) { - var easeIn = functionEasings[name]; - eases['easeIn' + name] = easeIn; - eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; }; - eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 : - 1 - easeIn(a, b)(t * -2 + 2) / 2; }; }; - eases['easeOutIn' + name] = function (a, b) { return function (t) { return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 : - (easeIn(a, b)(t * 2 - 1) + 1) / 2; }; }; - }); - - return eases; - -})(); - -function parseEasings(easing, duration) { - if (is.fnc(easing)) { return easing; } - var name = easing.split('(')[0]; - var ease = penner[name]; - var args = parseEasingParameters(easing); - switch (name) { - case 'spring' : return spring(easing, duration); - case 'cubicBezier' : return applyArguments(bezier, args); - case 'steps' : return applyArguments(steps, args); - default : return applyArguments(ease, args); - } -} - -// Strings - -function selectString(str) { - try { - var nodes = document.querySelectorAll(str); - return nodes; - } catch(e) { - return; - } -} - -// Arrays - -function filterArray(arr, callback) { - var len = arr.length; - var thisArg = arguments.length >= 2 ? arguments[1] : void 0; - var result = []; - for (var i = 0; i < len; i++) { - if (i in arr) { - var val = arr[i]; - if (callback.call(thisArg, val, i, arr)) { - result.push(val); - } - } - } - return result; -} - -function flattenArray(arr) { - return arr.reduce(function (a, b) { return a.concat(is.arr(b) ? flattenArray(b) : b); }, []); -} - -function toArray(o) { - if (is.arr(o)) { return o; } - if (is.str(o)) { o = selectString(o) || o; } - if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); } - return [o]; -} - -function arrayContains(arr, val) { - return arr.some(function (a) { return a === val; }); -} - -// Objects - -function cloneObject(o) { - var clone = {}; - for (var p in o) { clone[p] = o[p]; } - return clone; -} - -function replaceObjectProps(o1, o2) { - var o = cloneObject(o1); - for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; } - return o; -} - -function mergeObjects(o1, o2) { - var o = cloneObject(o1); - for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; } - return o; -} - -// Colors - -function rgbToRgba(rgbValue) { - var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue); - return rgb ? ("rgba(" + (rgb[1]) + ",1)") : rgbValue; -} - -function hexToRgba(hexValue) { - var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; - var hex = hexValue.replace(rgx, function (m, r, g, b) { return r + r + g + g + b + b; } ); - var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - var r = parseInt(rgb[1], 16); - var g = parseInt(rgb[2], 16); - var b = parseInt(rgb[3], 16); - return ("rgba(" + r + "," + g + "," + b + ",1)"); -} - -function hslToRgba(hslValue) { - var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue); - var h = parseInt(hsl[1], 10) / 360; - var s = parseInt(hsl[2], 10) / 100; - var l = parseInt(hsl[3], 10) / 100; - var a = hsl[4] || 1; - function hue2rgb(p, q, t) { - if (t < 0) { t += 1; } - if (t > 1) { t -= 1; } - if (t < 1/6) { return p + (q - p) * 6 * t; } - if (t < 1/2) { return q; } - if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; } - return p; - } - var r, g, b; - if (s == 0) { - r = g = b = l; - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hue2rgb(p, q, h + 1/3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - 1/3); - } - return ("rgba(" + (r * 255) + "," + (g * 255) + "," + (b * 255) + "," + a + ")"); -} - -function colorToRgb(val) { - if (is.rgb(val)) { return rgbToRgba(val); } - if (is.hex(val)) { return hexToRgba(val); } - if (is.hsl(val)) { return hslToRgba(val); } -} - -// Units - -function getUnit(val) { - var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val); - if (split) { return split[1]; } -} - -function getTransformUnit(propName) { - if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; } - if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; } -} - -// Values - -function getFunctionValue(val, animatable) { - if (!is.fnc(val)) { return val; } - return val(animatable.target, animatable.id, animatable.total); -} - -function getAttribute(el, prop) { - return el.getAttribute(prop); -} - -function convertPxToUnit(el, value, unit) { - var valueUnit = getUnit(value); - if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; } - var cached = cache.CSS[value + unit]; - if (!is.und(cached)) { return cached; } - var baseline = 100; - var tempEl = document.createElement(el.tagName); - var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body; - parentEl.appendChild(tempEl); - tempEl.style.position = 'absolute'; - tempEl.style.width = baseline + unit; - var factor = baseline / tempEl.offsetWidth; - parentEl.removeChild(tempEl); - var convertedUnit = factor * parseFloat(value); - cache.CSS[value + unit] = convertedUnit; - return convertedUnit; -} - -function getCSSValue(el, prop, unit) { - if (prop in el.style) { - var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); - var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0'; - return unit ? convertPxToUnit(el, value, unit) : value; - } -} - -function getAnimationType(el, prop) { - if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || (is.svg(el) && el[prop]))) { return 'attribute'; } - if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; } - if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; } - if (el[prop] != null) { return 'object'; } -} - -function getElementTransforms(el) { - if (!is.dom(el)) { return; } - var str = el.style.transform || ''; - var reg = /(\w+)\(([^)]*)\)/g; - var transforms = new Map(); - var m; while (m = reg.exec(str)) { transforms.set(m[1], m[2]); } - return transforms; -} - -function getTransformValue(el, propName, animatable, unit) { - var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName); - var value = getElementTransforms(el).get(propName) || defaultVal; - if (animatable) { - animatable.transforms.list.set(propName, value); - animatable.transforms['last'] = propName; - } - return unit ? convertPxToUnit(el, value, unit) : value; -} - -function getOriginalTargetValue(target, propName, unit, animatable) { - switch (getAnimationType(target, propName)) { - case 'transform': return getTransformValue(target, propName, animatable, unit); - case 'css': return getCSSValue(target, propName, unit); - case 'attribute': return getAttribute(target, propName); - default: return target[propName] || 0; - } -} - -function getRelativeValue(to, from) { - var operator = /^(\*=|\+=|-=)/.exec(to); - if (!operator) { return to; } - var u = getUnit(to) || 0; - var x = parseFloat(from); - var y = parseFloat(to.replace(operator[0], '')); - switch (operator[0][0]) { - case '+': return x + y + u; - case '-': return x - y + u; - case '*': return x * y + u; - } -} - -function validateValue(val, unit) { - if (is.col(val)) { return colorToRgb(val); } - if (/\s/g.test(val)) { return val; } - var originalUnit = getUnit(val); - var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val; - if (unit) { return unitLess + unit; } - return unitLess; -} - -// getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes -// adapted from https://gist.github.com/SebLambla/3e0550c496c236709744 - -function getDistance(p1, p2) { - return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); -} - -function getCircleLength(el) { - return Math.PI * 2 * getAttribute(el, 'r'); -} - -function getRectLength(el) { - return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2); -} - -function getLineLength(el) { - return getDistance( - {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')}, - {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')} - ); -} - -function getPolylineLength(el) { - var points = el.points; - var totalLength = 0; - var previousPos; - for (var i = 0 ; i < points.numberOfItems; i++) { - var currentPos = points.getItem(i); - if (i > 0) { totalLength += getDistance(previousPos, currentPos); } - previousPos = currentPos; - } - return totalLength; -} - -function getPolygonLength(el) { - var points = el.points; - return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0)); -} - -// Path animation - -function getTotalLength(el) { - if (el.getTotalLength) { return el.getTotalLength(); } - switch(el.tagName.toLowerCase()) { - case 'circle': return getCircleLength(el); - case 'rect': return getRectLength(el); - case 'line': return getLineLength(el); - case 'polyline': return getPolylineLength(el); - case 'polygon': return getPolygonLength(el); - } -} - -function setDashoffset(el) { - var pathLength = getTotalLength(el); - el.setAttribute('stroke-dasharray', pathLength); - return pathLength; -} - -// Motion path - -function getParentSvgEl(el) { - var parentEl = el.parentNode; - while (is.svg(parentEl)) { - if (!is.svg(parentEl.parentNode)) { break; } - parentEl = parentEl.parentNode; - } - return parentEl; -} - -function getParentSvg(pathEl, svgData) { - var svg = svgData || {}; - var parentSvgEl = svg.el || getParentSvgEl(pathEl); - var rect = parentSvgEl.getBoundingClientRect(); - var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox'); - var width = rect.width; - var height = rect.height; - var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]); - return { - el: parentSvgEl, - viewBox: viewBox, - x: viewBox[0] / 1, - y: viewBox[1] / 1, - w: width, - h: height, - vW: viewBox[2], - vH: viewBox[3] - } -} - -function getPath(path, percent) { - var pathEl = is.str(path) ? selectString(path)[0] : path; - var p = percent || 100; - return function(property) { - return { - property: property, - el: pathEl, - svg: getParentSvg(pathEl), - totalLength: getTotalLength(pathEl) * (p / 100) - } - } -} - -function getPathProgress(path, progress, isPathTargetInsideSVG) { - function point(offset) { - if ( offset === void 0 ) offset = 0; - - var l = progress + offset >= 1 ? progress + offset : 0; - return path.el.getPointAtLength(l); - } - var svg = getParentSvg(path.el, path.svg); - var p = point(); - var p0 = point(-1); - var p1 = point(+1); - var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW; - var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH; - switch (path.property) { - case 'x': return (p.x - svg.x) * scaleX; - case 'y': return (p.y - svg.y) * scaleY; - case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI; - } -} - -// Decompose value - -function decomposeValue(val, unit) { - // const rgx = /-?\d*\.?\d+/g; // handles basic numbers - // const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation - var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation - var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + ''; - return { - original: value, - numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0], - strings: (is.str(val) || unit) ? value.split(rgx) : [] - } -} - -// Animatables - -function parseTargets(targets) { - var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : []; - return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; }); -} - -function getAnimatables(targets) { - var parsed = parseTargets(targets); - return parsed.map(function (t, i) { - return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } }; - }); -} - -// Properties - -function normalizePropertyTweens(prop, tweenSettings) { - var settings = cloneObject(tweenSettings); - // Override duration if easing is a spring - if (/^spring/.test(settings.easing)) { settings.duration = spring(settings.easing); } - if (is.arr(prop)) { - var l = prop.length; - var isFromTo = (l === 2 && !is.obj(prop[0])); - if (!isFromTo) { - // Duration divided by the number of tweens - if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; } - } else { - // Transform [from, to] values shorthand to a valid tween value - prop = {value: prop}; - } - } - var propArray = is.arr(prop) ? prop : [prop]; - return propArray.map(function (v, i) { - var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v}; - // Default delay value should only be applied to the first tween - if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; } - // Default endDelay value should only be applied to the last tween - if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; } - return obj; - }).map(function (k) { return mergeObjects(k, settings); }); -} - - -function flattenKeyframes(keyframes) { - var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); }) - .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []); - var properties = {}; - var loop = function ( i ) { - var propName = propertyNames[i]; - properties[propName] = keyframes.map(function (key) { - var newKey = {}; - for (var p in key) { - if (is.key(p)) { - if (p == propName) { newKey.value = key[p]; } - } else { - newKey[p] = key[p]; - } - } - return newKey; - }); - }; - - for (var i = 0; i < propertyNames.length; i++) loop( i ); - return properties; -} - -function getProperties(tweenSettings, params) { - var properties = []; - var keyframes = params.keyframes; - if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); } - for (var p in params) { - if (is.key(p)) { - properties.push({ - name: p, - tweens: normalizePropertyTweens(params[p], tweenSettings) - }); - } - } - return properties; -} - -// Tweens - -function normalizeTweenValues(tween, animatable) { - var t = {}; - for (var p in tween) { - var value = getFunctionValue(tween[p], animatable); - if (is.arr(value)) { - value = value.map(function (v) { return getFunctionValue(v, animatable); }); - if (value.length === 1) { value = value[0]; } - } - t[p] = value; - } - t.duration = parseFloat(t.duration); - t.delay = parseFloat(t.delay); - return t; -} - -function normalizeTweens(prop, animatable) { - var previousTween; - return prop.tweens.map(function (t) { - var tween = normalizeTweenValues(t, animatable); - var tweenValue = tween.value; - var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue; - var toUnit = getUnit(to); - var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable); - var previousValue = previousTween ? previousTween.to.original : originalValue; - var from = is.arr(tweenValue) ? tweenValue[0] : previousValue; - var fromUnit = getUnit(from) || getUnit(originalValue); - var unit = toUnit || fromUnit; - if (is.und(to)) { to = previousValue; } - tween.from = decomposeValue(from, unit); - tween.to = decomposeValue(getRelativeValue(to, from), unit); - tween.start = previousTween ? previousTween.end : 0; - tween.end = tween.start + tween.delay + tween.duration + tween.endDelay; - tween.easing = parseEasings(tween.easing, tween.duration); - tween.isPath = is.pth(tweenValue); - tween.isPathTargetInsideSVG = tween.isPath && is.svg(animatable.target); - tween.isColor = is.col(tween.from.original); - if (tween.isColor) { tween.round = 1; } - previousTween = tween; - return tween; - }); -} - -// Tween progress - -var setProgressValue = { - css: function (t, p, v) { return t.style[p] = v; }, - attribute: function (t, p, v) { return t.setAttribute(p, v); }, - object: function (t, p, v) { return t[p] = v; }, - transform: function (t, p, v, transforms, manual) { - transforms.list.set(p, v); - if (p === transforms.last || manual) { - var str = ''; - transforms.list.forEach(function (value, prop) { str += prop + "(" + value + ") "; }); - t.style.transform = str; - } - } -}; - -// Set Value helper - -function setTargetsValue(targets, properties) { - var animatables = getAnimatables(targets); - animatables.forEach(function (animatable) { - for (var property in properties) { - var value = getFunctionValue(properties[property], animatable); - var target = animatable.target; - var valueUnit = getUnit(value); - var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable); - var unit = valueUnit || getUnit(originalValue); - var to = getRelativeValue(validateValue(value, unit), originalValue); - var animType = getAnimationType(target, property); - setProgressValue[animType](target, property, to, animatable.transforms, true); - } - }); -} - -// Animations - -function createAnimation(animatable, prop) { - var animType = getAnimationType(animatable.target, prop.name); - if (animType) { - var tweens = normalizeTweens(prop, animatable); - var lastTween = tweens[tweens.length - 1]; - return { - type: animType, - property: prop.name, - animatable: animatable, - tweens: tweens, - duration: lastTween.end, - delay: tweens[0].delay, - endDelay: lastTween.endDelay - } - } -} - -function getAnimations(animatables, properties) { - return filterArray(flattenArray(animatables.map(function (animatable) { - return properties.map(function (prop) { - return createAnimation(animatable, prop); - }); - })), function (a) { return !is.und(a); }); -} - -// Create Instance - -function getInstanceTimings(animations, tweenSettings) { - var animLength = animations.length; - var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; }; - var timings = {}; - timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration; - timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay; - timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay; - return timings; -} - -var instanceID = 0; - -function createNewInstance(params) { - var instanceSettings = replaceObjectProps(defaultInstanceSettings, params); - var tweenSettings = replaceObjectProps(defaultTweenSettings, params); - var properties = getProperties(tweenSettings, params); - var animatables = getAnimatables(params.targets); - var animations = getAnimations(animatables, properties); - var timings = getInstanceTimings(animations, tweenSettings); - var id = instanceID; - instanceID++; - return mergeObjects(instanceSettings, { - id: id, - children: [], - animatables: animatables, - animations: animations, - duration: timings.duration, - delay: timings.delay, - endDelay: timings.endDelay - }); -} - -// Core - -var activeInstances = []; - -var engine = (function () { - var raf; - - function play() { - if (!raf && (!isDocumentHidden() || !anime.suspendWhenDocumentHidden) && activeInstances.length > 0) { - raf = requestAnimationFrame(step); - } - } - function step(t) { - // memo on algorithm issue: - // dangerous iteration over mutable `activeInstances` - // (that collection may be updated from within callbacks of `tick`-ed animation instances) - var activeInstancesLength = activeInstances.length; - var i = 0; - while (i < activeInstancesLength) { - var activeInstance = activeInstances[i]; - if (!activeInstance.paused) { - activeInstance.tick(t); - i++; - } else { - activeInstances.splice(i, 1); - activeInstancesLength--; - } - } - raf = i > 0 ? requestAnimationFrame(step) : undefined; - } - - function handleVisibilityChange() { - if (!anime.suspendWhenDocumentHidden) { return; } - - if (isDocumentHidden()) { - // suspend ticks - raf = cancelAnimationFrame(raf); - } else { // is back to active tab - // first adjust animations to consider the time that ticks were suspended - activeInstances.forEach( - function (instance) { return instance ._onDocumentVisibility(); } - ); - engine(); - } - } - if (typeof document !== 'undefined') { - document.addEventListener('visibilitychange', handleVisibilityChange); - } - - return play; -})(); - -function isDocumentHidden() { - return !!document && document.hidden; -} - -// Public Instance - -function anime(params) { - if ( params === void 0 ) params = {}; - - - var startTime = 0, lastTime = 0, now = 0; - var children, childrenLength = 0; - var resolve = null; - - function makePromise(instance) { - var promise = window.Promise && new Promise(function (_resolve) { return resolve = _resolve; }); - instance.finished = promise; - return promise; - } - - var instance = createNewInstance(params); - var promise = makePromise(instance); - - function toggleInstanceDirection() { - var direction = instance.direction; - if (direction !== 'alternate') { - instance.direction = direction !== 'normal' ? 'normal' : 'reverse'; - } - instance.reversed = !instance.reversed; - children.forEach(function (child) { return child.reversed = instance.reversed; }); - } - - function adjustTime(time) { - return instance.reversed ? instance.duration - time : time; - } - - function resetTime() { - startTime = 0; - lastTime = adjustTime(instance.currentTime) * (1 / anime.speed); - } - - function seekChild(time, child) { - if (child) { child.seek(time - child.timelineOffset); } - } - - function syncInstanceChildren(time) { - if (!instance.reversePlayback) { - for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); } - } else { - for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); } - } - } - - function setAnimationsProgress(insTime) { - var i = 0; - var animations = instance.animations; - var animationsLength = animations.length; - while (i < animationsLength) { - var anim = animations[i]; - var animatable = anim.animatable; - var tweens = anim.tweens; - var tweenLength = tweens.length - 1; - var tween = tweens[tweenLength]; - // Only check for keyframes if there is more than one tween - if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; } - var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration; - var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed); - var strings = tween.to.strings; - var round = tween.round; - var numbers = []; - var toNumbersLength = tween.to.numbers.length; - var progress = (void 0); - for (var n = 0; n < toNumbersLength; n++) { - var value = (void 0); - var toNumber = tween.to.numbers[n]; - var fromNumber = tween.from.numbers[n] || 0; - if (!tween.isPath) { - value = fromNumber + (eased * (toNumber - fromNumber)); - } else { - value = getPathProgress(tween.value, eased * toNumber, tween.isPathTargetInsideSVG); - } - if (round) { - if (!(tween.isColor && n > 2)) { - value = Math.round(value * round) / round; - } - } - numbers.push(value); - } - // Manual Array.reduce for better performances - var stringsLength = strings.length; - if (!stringsLength) { - progress = numbers[0]; - } else { - progress = strings[0]; - for (var s = 0; s < stringsLength; s++) { - var a = strings[s]; - var b = strings[s + 1]; - var n$1 = numbers[s]; - if (!isNaN(n$1)) { - if (!b) { - progress += n$1 + ' '; - } else { - progress += n$1 + b; - } - } - } - } - setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms); - anim.currentValue = progress; - i++; - } - } - - function setCallback(cb) { - if (instance[cb] && !instance.passThrough) { instance[cb](instance); } - } - - function countIteration() { - if (instance.remaining && instance.remaining !== true) { - instance.remaining--; - } - } - - function setInstanceProgress(engineTime) { - var insDuration = instance.duration; - var insDelay = instance.delay; - var insEndDelay = insDuration - instance.endDelay; - var insTime = adjustTime(engineTime); - instance.progress = minMax((insTime / insDuration) * 100, 0, 100); - instance.reversePlayback = insTime < instance.currentTime; - if (children) { syncInstanceChildren(insTime); } - if (!instance.began && instance.currentTime > 0) { - instance.began = true; - setCallback('begin'); - } - if (!instance.loopBegan && instance.currentTime > 0) { - instance.loopBegan = true; - setCallback('loopBegin'); - } - if (insTime <= insDelay && instance.currentTime !== 0) { - setAnimationsProgress(0); - } - if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) { - setAnimationsProgress(insDuration); - } - if (insTime > insDelay && insTime < insEndDelay) { - if (!instance.changeBegan) { - instance.changeBegan = true; - instance.changeCompleted = false; - setCallback('changeBegin'); - } - setCallback('change'); - setAnimationsProgress(insTime); - } else { - if (instance.changeBegan) { - instance.changeCompleted = true; - instance.changeBegan = false; - setCallback('changeComplete'); - } - } - instance.currentTime = minMax(insTime, 0, insDuration); - if (instance.began) { setCallback('update'); } - if (engineTime >= insDuration) { - lastTime = 0; - countIteration(); - if (!instance.remaining) { - instance.paused = true; - if (!instance.completed) { - instance.completed = true; - setCallback('loopComplete'); - setCallback('complete'); - if (!instance.passThrough && 'Promise' in window) { - resolve(); - promise = makePromise(instance); - } - } - } else { - startTime = now; - setCallback('loopComplete'); - instance.loopBegan = false; - if (instance.direction === 'alternate') { - toggleInstanceDirection(); - } - } - } - } - - instance.reset = function() { - var direction = instance.direction; - instance.passThrough = false; - instance.currentTime = 0; - instance.progress = 0; - instance.paused = true; - instance.began = false; - instance.loopBegan = false; - instance.changeBegan = false; - instance.completed = false; - instance.changeCompleted = false; - instance.reversePlayback = false; - instance.reversed = direction === 'reverse'; - instance.remaining = instance.loop; - children = instance.children; - childrenLength = children.length; - for (var i = childrenLength; i--;) { instance.children[i].reset(); } - if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; } - setAnimationsProgress(instance.reversed ? instance.duration : 0); - }; - - // internal method (for engine) to adjust animation timings before restoring engine ticks (rAF) - instance._onDocumentVisibility = resetTime; - - // Set Value helper - - instance.set = function(targets, properties) { - setTargetsValue(targets, properties); - return instance; - }; - - instance.tick = function(t) { - now = t; - if (!startTime) { startTime = now; } - setInstanceProgress((now + (lastTime - startTime)) * anime.speed); - }; - - instance.seek = function(time) { - setInstanceProgress(adjustTime(time)); - }; - - instance.pause = function() { - instance.paused = true; - resetTime(); - }; - - instance.play = function() { - if (!instance.paused) { return; } - if (instance.completed) { instance.reset(); } - instance.paused = false; - activeInstances.push(instance); - resetTime(); - engine(); - }; - - instance.reverse = function() { - toggleInstanceDirection(); - instance.completed = instance.reversed ? false : true; - resetTime(); - }; - - instance.restart = function() { - instance.reset(); - instance.play(); - }; - - instance.remove = function(targets) { - var targetsArray = parseTargets(targets); - removeTargetsFromInstance(targetsArray, instance); - }; - - instance.reset(); - - if (instance.autoplay) { instance.play(); } - - return instance; - -} - -// Remove targets from animation - -function removeTargetsFromAnimations(targetsArray, animations) { - for (var a = animations.length; a--;) { - if (arrayContains(targetsArray, animations[a].animatable.target)) { - animations.splice(a, 1); - } - } -} - -function removeTargetsFromInstance(targetsArray, instance) { - var animations = instance.animations; - var children = instance.children; - removeTargetsFromAnimations(targetsArray, animations); - for (var c = children.length; c--;) { - var child = children[c]; - var childAnimations = child.animations; - removeTargetsFromAnimations(targetsArray, childAnimations); - if (!childAnimations.length && !child.children.length) { children.splice(c, 1); } - } - if (!animations.length && !children.length) { instance.pause(); } -} - -function removeTargetsFromActiveInstances(targets) { - var targetsArray = parseTargets(targets); - for (var i = activeInstances.length; i--;) { - var instance = activeInstances[i]; - removeTargetsFromInstance(targetsArray, instance); - } -} - -// Stagger helpers - -function stagger(val, params) { - if ( params === void 0 ) params = {}; - - var direction = params.direction || 'normal'; - var easing = params.easing ? parseEasings(params.easing) : null; - var grid = params.grid; - var axis = params.axis; - var fromIndex = params.from || 0; - var fromFirst = fromIndex === 'first'; - var fromCenter = fromIndex === 'center'; - var fromLast = fromIndex === 'last'; - var isRange = is.arr(val); - var val1 = isRange ? parseFloat(val[0]) : parseFloat(val); - var val2 = isRange ? parseFloat(val[1]) : 0; - var unit = getUnit(isRange ? val[1] : val) || 0; - var start = params.start || 0 + (isRange ? val1 : 0); - var values = []; - var maxValue = 0; - return function (el, i, t) { - if (fromFirst) { fromIndex = 0; } - if (fromCenter) { fromIndex = (t - 1) / 2; } - if (fromLast) { fromIndex = t - 1; } - if (!values.length) { - for (var index = 0; index < t; index++) { - if (!grid) { - values.push(Math.abs(fromIndex - index)); - } else { - var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2; - var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2; - var toX = index%grid[0]; - var toY = Math.floor(index/grid[0]); - var distanceX = fromX - toX; - var distanceY = fromY - toY; - var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY); - if (axis === 'x') { value = -distanceX; } - if (axis === 'y') { value = -distanceY; } - values.push(value); - } - maxValue = Math.max.apply(Math, values); - } - if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); } - if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); } - } - var spacing = isRange ? (val2 - val1) / maxValue : val1; - return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit; - } -} - -// Timeline - -function timeline(params) { - if ( params === void 0 ) params = {}; - - var tl = anime(params); - tl.duration = 0; - tl.add = function(instanceParams, timelineOffset) { - var tlIndex = activeInstances.indexOf(tl); - var children = tl.children; - if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); } - function passThrough(ins) { ins.passThrough = true; } - for (var i = 0; i < children.length; i++) { passThrough(children[i]); } - var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params)); - insParams.targets = insParams.targets || params.targets; - var tlDuration = tl.duration; - insParams.autoplay = false; - insParams.direction = tl.direction; - insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration); - passThrough(tl); - tl.seek(insParams.timelineOffset); - var ins = anime(insParams); - passThrough(ins); - children.push(ins); - var timings = getInstanceTimings(children, params); - tl.delay = timings.delay; - tl.endDelay = timings.endDelay; - tl.duration = timings.duration; - tl.seek(0); - tl.reset(); - if (tl.autoplay) { tl.play(); } - return tl; - }; - return tl; -} - -anime.version = '3.2.1'; -anime.speed = 1; -// TODO:#review: naming, documentation -anime.suspendWhenDocumentHidden = true; -anime.running = activeInstances; -anime.remove = removeTargetsFromActiveInstances; -anime.get = getOriginalTargetValue; -anime.set = setTargetsValue; -anime.convertPx = convertPxToUnit; -anime.path = getPath; -anime.setDashoffset = setDashoffset; -anime.stagger = stagger; -anime.timeline = timeline; -anime.easing = parseEasings; -anime.penner = penner; -anime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }; - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (anime); - - -/***/ }), - -/***/ 357: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Autocomplete = void 0; -const utils_1 = __webpack_require__(593); -const dropdown_1 = __webpack_require__(123); -const component_1 = __webpack_require__(999); -; -let _defaults = { - data: [], - onAutocomplete: null, - dropdownOptions: { - // Default dropdown options - autoFocus: false, - closeOnClick: false, - coverTrigger: false - }, - minLength: 1, - isMultiSelect: false, - onSearch: (text, autocomplete) => { - const normSearch = text.toLocaleLowerCase(); - autocomplete.setMenuItems(autocomplete.options.data.filter((option) => { - var _a; - return option.id.toString().toLocaleLowerCase().includes(normSearch) - || ((_a = option.text) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase().includes(normSearch)); - })); - }, - maxDropDownHeight: '300px', - allowUnsafeHTML: false -}; -class Autocomplete extends component_1.Component { - constructor(el, options) { - super(el, options, Autocomplete); - this._handleInputBlur = () => { - if (!this._mousedown) { - this.close(); - this._resetAutocomplete(); - } - }; - this._handleInputKeyupAndFocus = (e) => { - if (e.type === 'keyup') - Autocomplete._keydown = false; - this.count = 0; - const actualValue = this.el.value.toLocaleLowerCase(); - // Don't capture enter or arrow key usage. - if (utils_1.Utils.keys.ENTER.includes(e.key) || utils_1.Utils.keys.ARROW_UP.includes(e.key) || utils_1.Utils.keys.ARROW_DOWN.includes(e.key)) - return; - // Check if the input isn't empty - // Check if focus triggered by tab - if (this.oldVal !== actualValue && (utils_1.Utils.tabPressed || e.type !== 'focus')) { - this.open(); - } - // Value has changed! - if (this.oldVal !== actualValue) { - this._setStatusLoading(); - this.options.onSearch(this.el.value, this); - } - // Reset Single-Select when Input cleared - if (!this.options.isMultiSelect && this.el.value.length === 0) { - this.selectedValues = []; - this._triggerChanged(); - } - this.oldVal = actualValue; - }; - this._handleInputKeydown = (e) => { - var _a, _b; - Autocomplete._keydown = true; - // Arrow keys and enter key usage - const numItems = this.container.querySelectorAll('li').length; - // select element on Enter - if (utils_1.Utils.keys.ENTER.includes(e.key) && this.activeIndex >= 0) { - const liElement = this.container.querySelectorAll('li')[this.activeIndex]; - if (liElement) { - this.selectOption(liElement.getAttribute('data-id')); - e.preventDefault(); - } - return; - } - // Capture up and down key - if (utils_1.Utils.keys.ARROW_UP.includes(e.key) || utils_1.Utils.keys.ARROW_DOWN.includes(e.key)) { - e.preventDefault(); - if (utils_1.Utils.keys.ARROW_UP.includes(e.key) && this.activeIndex > 0) - this.activeIndex--; - if (utils_1.Utils.keys.ARROW_DOWN.includes(e.key) && this.activeIndex < numItems - 1) - this.activeIndex++; - (_a = this.$active) === null || _a === void 0 ? void 0 : _a.classList.remove('active'); - if (this.activeIndex >= 0) { - this.$active = this.container.querySelectorAll('li')[this.activeIndex]; - (_b = this.$active) === null || _b === void 0 ? void 0 : _b.classList.add('active'); - // Focus selected - this.container.children[this.activeIndex].scrollIntoView({ - behavior: 'smooth', - block: 'nearest', - inline: 'nearest' - }); - } - } - }; - this._handleInputClick = () => { - this.open(); - }; - this._handleContainerMousedownAndTouchstart = () => { - this._mousedown = true; - }; - this._handleContainerMouseupAndTouchend = () => { - this._mousedown = false; - }; - /** - * Show autocomplete. - */ - this.open = () => { - const inputText = this.el.value.toLocaleLowerCase(); - this._resetAutocomplete(); - if (inputText.length >= this.options.minLength) { - this.isOpen = true; - this._renderDropdown(); - } - // Open dropdown - if (!this.dropdown.isOpen) { - setTimeout(() => { - this.dropdown.open(); - }, 100); - } - else - this.dropdown.recalculateDimensions(); // Recalculate dropdown when its already open - }; - /** - * Hide autocomplete. - */ - this.close = () => { - this.dropdown.close(); - }; - this.el.M_Autocomplete = this; - this.options = Object.assign(Object.assign({}, Autocomplete.defaults), options); - this.isOpen = false; - this.count = 0; - this.activeIndex = -1; - this.oldVal = ""; - this.selectedValues = []; - this.menuItems = []; - this.$active = null; - this._mousedown = false; - this._setupDropdown(); - this._setupEventHandlers(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Autocomplete. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Autocomplete); - } - static getInstance(el) { - return el.M_Autocomplete; - } - destroy() { - this._removeEventHandlers(); - this._removeDropdown(); - this.el.M_Autocomplete = undefined; - } - _setupEventHandlers() { - this.el.addEventListener('blur', this._handleInputBlur); - this.el.addEventListener('keyup', this._handleInputKeyupAndFocus); - this.el.addEventListener('focus', this._handleInputKeyupAndFocus); - this.el.addEventListener('keydown', this._handleInputKeydown); - this.el.addEventListener('click', this._handleInputClick); - this.container.addEventListener('mousedown', this._handleContainerMousedownAndTouchstart); - this.container.addEventListener('mouseup', this._handleContainerMouseupAndTouchend); - if (typeof window.ontouchstart !== 'undefined') { - this.container.addEventListener('touchstart', this._handleContainerMousedownAndTouchstart); - this.container.addEventListener('touchend', this._handleContainerMouseupAndTouchend); - } - } - _removeEventHandlers() { - this.el.removeEventListener('blur', this._handleInputBlur); - this.el.removeEventListener('keyup', this._handleInputKeyupAndFocus); - this.el.removeEventListener('focus', this._handleInputKeyupAndFocus); - this.el.removeEventListener('keydown', this._handleInputKeydown); - this.el.removeEventListener('click', this._handleInputClick); - this.container.removeEventListener('mousedown', this._handleContainerMousedownAndTouchstart); - this.container.removeEventListener('mouseup', this._handleContainerMouseupAndTouchend); - if (typeof window.ontouchstart !== 'undefined') { - this.container.removeEventListener('touchstart', this._handleContainerMousedownAndTouchstart); - this.container.removeEventListener('touchend', this._handleContainerMouseupAndTouchend); - } - } - _setupDropdown() { - this.container = document.createElement('ul'); - this.container.style.maxHeight = this.options.maxDropDownHeight; - this.container.id = `autocomplete-options-${utils_1.Utils.guid()}`; - this.container.classList.add('autocomplete-content', 'dropdown-content'); - this.el.setAttribute('data-target', this.container.id); - // ! Issue in Component Dropdown: _placeDropdown moves dom-position - this.el.parentElement.appendChild(this.container); - // Initialize dropdown - let dropdownOptions = Object.assign(Object.assign({}, Autocomplete.defaults.dropdownOptions), this.options.dropdownOptions); - let userOnItemClick = dropdownOptions.onItemClick; - // Ensuring the select Option call when user passes custom onItemClick function to dropdown - dropdownOptions.onItemClick = (li) => { - if (!li) - return; - const entryID = li.getAttribute('data-id'); - this.selectOption(entryID); - // Handle user declared onItemClick if needed - if (userOnItemClick && typeof userOnItemClick === 'function') - userOnItemClick.call(this.dropdown, this.el); - }; - this.dropdown = dropdown_1.Dropdown.init(this.el, dropdownOptions); - // ! Workaround for Label: move label up again - // TODO: Just use PopperJS in future! - const label = this.el.parentElement.querySelector('label'); - if (label) - this.el.after(label); - // Sketchy removal of dropdown click handler - this.el.removeEventListener('click', this.dropdown._handleClick); - // Set Value if already set in HTML - if (this.el.value) - this.selectOption(this.el.value); - // Add StatusInfo - const div = document.createElement('div'); - div.classList.add('status-info'); - div.setAttribute('style', 'position: absolute;right:0;top:0;'); - this.el.parentElement.appendChild(div); - this._updateSelectedInfo(); - } - _removeDropdown() { - this.container.parentNode.removeChild(this.container); - } - _resetCurrentElementPosition() { - var _a; - this.activeIndex = -1; - (_a = this.$active) === null || _a === void 0 ? void 0 : _a.classList.remove('active'); - } - _resetAutocomplete() { - this.container.replaceChildren(); - this._resetCurrentElementPosition(); - this.oldVal = null; - this.isOpen = false; - this._mousedown = false; - } - _highlightPartialText(input, label) { - const start = label.toLocaleLowerCase().indexOf('' + input.toLocaleLowerCase() + ''); - const end = start + input.length - 1; - //custom filters may return results where the string does not match any part - if (start == -1 || end == -1) { - return [label, '', '']; - } - return [label.slice(0, start), label.slice(start, end + 1), label.slice(end + 1)]; - } - _createDropdownItem(entry) { - const item = document.createElement('li'); - item.setAttribute('data-id', entry.id); - item.setAttribute('style', 'display:grid; grid-auto-flow: column; user-select: none; align-items: center;'); - // Checkbox - if (this.options.isMultiSelect) { - item.innerHTML = ` -
- sel.id === entry.id) ? ' checked="checked"' : ''}> -
`; - } - // Image - if (entry.image) { - const img = document.createElement('img'); - img.classList.add('circle'); - img.src = entry.image; - item.appendChild(img); - } - // Text - const inputText = this.el.value.toLocaleLowerCase(); - const parts = this._highlightPartialText(inputText, (entry.text || entry.id).toString()); - const div = document.createElement('div'); - div.setAttribute('style', 'line-height:1.2;font-weight:500;'); - if (this.options.allowUnsafeHTML) { - div.innerHTML = parts[0] + '' + parts[1] + '' + parts[2]; - } - else { - div.appendChild(document.createTextNode(parts[0])); - if (parts[1]) { - const highlight = document.createElement('span'); - highlight.textContent = parts[1]; - highlight.classList.add('highlight'); - div.appendChild(highlight); - div.appendChild(document.createTextNode(parts[2])); - } - } - const itemText = document.createElement('div'); - itemText.classList.add('item-text'); - itemText.setAttribute('style', 'padding:5px;overflow:hidden;'); - item.appendChild(itemText); - item.querySelector('.item-text').appendChild(div); - // Description - if (typeof entry.description === 'string' || (typeof entry.description === 'number' && !isNaN(entry.description))) { - const description = document.createElement('small'); - description.setAttribute('style', 'line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;'); - description.innerText = entry.description; - item.querySelector('.item-text').appendChild(description); - } - // Set Grid - const getGridConfig = () => { - if (this.options.isMultiSelect) { - if (entry.image) - return '40px min-content auto'; // cb-img-txt - return '40px auto'; // cb-txt - } - if (entry.image) - return 'min-content auto'; // img-txt - return 'auto'; // txt - }; - item.style.gridTemplateColumns = getGridConfig(); - return item; - } - _renderDropdown() { - this._resetAutocomplete(); - // Check if Data is empty - if (this.menuItems.length === 0) { - this.menuItems = this.selectedValues; // Show selected Items - } - for (let i = 0; i < this.menuItems.length; i++) { - const item = this._createDropdownItem(this.menuItems[i]); - this.container.append(item); - } - } - _setStatusLoading() { - this.el.parentElement.querySelector('.status-info').innerHTML = `
- - - -
`; - } - _updateSelectedInfo() { - const statusElement = this.el.parentElement.querySelector('.status-info'); - if (statusElement) { - if (this.options.isMultiSelect) - statusElement.innerHTML = this.selectedValues.length.toString(); - else - statusElement.innerHTML = ''; - } - } - _refreshInputText() { - if (this.selectedValues.length === 1) { - const entry = this.selectedValues[0]; - this.el.value = entry.text || entry.id; // Write Text to Input - } - } - _triggerChanged() { - this.el.dispatchEvent(new Event('change')); - // Trigger Autocomplete Event - if (typeof this.options.onAutocomplete === 'function') - this.options.onAutocomplete.call(this, this.selectedValues); - } - /** - * Updates the visible or selectable items shown in the menu. - * @param menuItems Items to be available. - */ - setMenuItems(menuItems) { - this.menuItems = menuItems; - this.open(); - this._updateSelectedInfo(); - } - /** - * Sets selected values. - * @param entries - */ - setValues(entries) { - this.selectedValues = entries; - this._updateSelectedInfo(); - if (!this.options.isMultiSelect) { - this._refreshInputText(); - } - this._triggerChanged(); - } - /** - * Select a specific autocomplete option via id-property. - * @param id The id of a data-entry. - */ - selectOption(id) { - const entry = this.menuItems.find((item) => item.id == id); - if (!entry) - return; - // Toggle Checkbox - const li = this.container.querySelector('li[data-id="' + id + '"]'); - if (!li) - return; - if (this.options.isMultiSelect) { - const checkbox = li.querySelector('input[type="checkbox"]'); - checkbox.checked = !checkbox.checked; - if (checkbox.checked) - this.selectedValues.push(entry); - else - this.selectedValues = this.selectedValues.filter((selectedEntry) => selectedEntry.id !== entry.id); - this.el.focus(); - } - else { - // Single-Select - this.selectedValues = [entry]; - this._refreshInputText(); - this._resetAutocomplete(); - this.close(); - } - this._updateSelectedInfo(); - this._triggerChanged(); - } -} -exports.Autocomplete = Autocomplete; - - -/***/ }), - -/***/ 379: -/***/ (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.FloatingActionButton = void 0; -const animejs_1 = __importDefault(__webpack_require__(30)); -const component_1 = __webpack_require__(999); -; -let _defaults = { - direction: 'top', - hoverEnabled: true, - toolbarEnabled: false -}; -class FloatingActionButton extends component_1.Component { - constructor(el, options) { - super(el, options, FloatingActionButton); - this._handleFABClick = () => { - if (this.isOpen) { - this.close(); - } - else { - this.open(); - } - }; - this._handleDocumentClick = (e) => { - const elem = e.target; - if (elem !== this._menu) - this.close; - }; - /** - * Open FAB. - */ - this.open = () => { - if (this.isOpen) - return; - if (this.options.toolbarEnabled) - this._animateInToolbar(); - else - this._animateInFAB(); - this.isOpen = true; - }; - /** - * Close FAB. - */ - this.close = () => { - if (!this.isOpen) - return; - if (this.options.toolbarEnabled) { - window.removeEventListener('scroll', this.close, true); - document.body.removeEventListener('click', this._handleDocumentClick, true); - } - else { - this._animateOutFAB(); - } - this.isOpen = false; - }; - this.el.M_FloatingActionButton = this; - this.options = Object.assign(Object.assign({}, FloatingActionButton.defaults), options); - this.isOpen = false; - this._anchor = this.el.querySelector('a'); - this._menu = this.el.querySelector('ul'); - this._floatingBtns = Array.from(this.el.querySelectorAll('ul .btn-floating')); - this._floatingBtnsReverse = this._floatingBtns.reverse(); - this.offsetY = 0; - this.offsetX = 0; - this.el.classList.add(`direction-${this.options.direction}`); - if (this.options.direction === 'top') - this.offsetY = 40; - else if (this.options.direction === 'right') - this.offsetX = -40; - else if (this.options.direction === 'bottom') - this.offsetY = -40; - else - this.offsetX = 40; - this._setupEventHandlers(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of FloatingActionButton. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, FloatingActionButton); - } - static getInstance(el) { - return el.M_FloatingActionButton; - } - destroy() { - this._removeEventHandlers(); - this.el.M_FloatingActionButton = undefined; - } - _setupEventHandlers() { - if (this.options.hoverEnabled && !this.options.toolbarEnabled) { - this.el.addEventListener('mouseenter', this.open); - this.el.addEventListener('mouseleave', this.close); - } - else { - this.el.addEventListener('click', this._handleFABClick); - } - } - _removeEventHandlers() { - if (this.options.hoverEnabled && !this.options.toolbarEnabled) { - this.el.removeEventListener('mouseenter', this.open); - this.el.removeEventListener('mouseleave', this.close); - } - else { - this.el.removeEventListener('click', this._handleFABClick); - } - } - _animateInFAB() { - this.el.classList.add('active'); - let time = 0; - this._floatingBtnsReverse.forEach((el) => { - (0, animejs_1.default)({ - targets: el, - opacity: 1, - scale: [0.4, 1], - translateY: [this.offsetY, 0], - translateX: [this.offsetX, 0], - duration: 275, - delay: time, - easing: 'easeInOutQuad' - }); - time += 40; - }); - } - _animateOutFAB() { - this._floatingBtnsReverse.forEach((el) => { - animejs_1.default.remove(el); - (0, animejs_1.default)({ - targets: el, - opacity: 0, - scale: 0.4, - translateY: this.offsetY, - translateX: this.offsetX, - duration: 175, - easing: 'easeOutQuad', - complete: () => { - this.el.classList.remove('active'); - } - }); - }); - } - _animateInToolbar() { - let scaleFactor; - let windowWidth = window.innerWidth; - let windowHeight = window.innerHeight; - let btnRect = this.el.getBoundingClientRect(); - const backdrop = document.createElement('div'); - backdrop.classList.add('fab-backdrop'); // $('
'); - const fabColor = getComputedStyle(this._anchor).backgroundColor; // css('background-color'); - this._anchor.append(backdrop); - this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2; - this.offsetY = windowHeight - btnRect.bottom; - scaleFactor = windowWidth / backdrop[0].clientWidth; - this.btnBottom = btnRect.bottom; - this.btnLeft = btnRect.left; - this.btnWidth = btnRect.width; - // Set initial state - this.el.classList.add('active'); - this.el.style.textAlign = 'center'; - this.el.style.width = '100%'; - this.el.style.bottom = '0'; - this.el.style.left = '0'; - this.el.style.transform = 'translateX(' + this.offsetX + 'px)'; - this.el.style.transition = 'none'; - this._anchor.style.transform = `translateY(${this.offsetY}px`; - this._anchor.style.transition = 'none'; - backdrop.style.backgroundColor = fabColor; - setTimeout(() => { - this.el.style.transform = ''; - this.el.style.transition = 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'; - this._anchor.style.overflow = 'visible'; - this._anchor.style.transform = ''; - this._anchor.style.transition = 'transform .2s'; - setTimeout(() => { - this.el.style.overflow = 'hidden'; - this.el.style.backgroundColor = fabColor; - backdrop.style.transform = 'scale(' + scaleFactor + ')'; - backdrop.style.transition = 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'; - this._menu.querySelectorAll('li > a').forEach((a) => a.style.opacity = '1'); - // Scroll to close. - window.addEventListener('scroll', this.close, true); - document.body.addEventListener('click', this._handleDocumentClick, true); - }, 100); - }, 0); - } -} -exports.FloatingActionButton = FloatingActionButton; - - -/***/ }), - -/***/ 137: -/***/ (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.Cards = void 0; -const animejs_1 = __importDefault(__webpack_require__(30)); -class Cards { - static Init() { - document.addEventListener("DOMContentLoaded", () => { - document.body.addEventListener('click', e => { - const trigger = e.target; - const card = trigger.closest('.card'); - if (!card) - return; - const cardReveal = Array.from(card.children).find(elem => elem.classList.contains('card-reveal')); - if (!cardReveal) - return; - const initialOverflow = getComputedStyle(card).overflow; - // Close Card - const closeArea = cardReveal.querySelector('.card-reveal .card-title'); - if (trigger === closeArea || closeArea.contains(trigger)) { - (0, animejs_1.default)({ - targets: cardReveal, - translateY: 0, - duration: 225, - easing: 'easeInOutQuad', - complete: (anim) => { - cardReveal.style.display = 'none'; - card.style.overflow = initialOverflow; - } - }); - } - ; - // Reveal Card - const activators = card.querySelectorAll('.activator'); - activators.forEach(activator => { - if (trigger === activator || activator.contains(trigger)) { - card.style.overflow = 'hidden'; - cardReveal.style.display = 'block'; - (0, animejs_1.default)({ - targets: cardReveal, - translateY: '-100%', - duration: 300, - easing: 'easeInOutQuad' - }); - } - }); - }); - }); - } -} -exports.Cards = Cards; - - -/***/ }), - -/***/ 476: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Carousel = void 0; -const utils_1 = __webpack_require__(593); -const component_1 = __webpack_require__(999); -let _defaults = { - duration: 200, - dist: -100, - shift: 0, - padding: 0, - numVisible: 5, - fullWidth: false, - indicators: false, - noWrap: false, - onCycleTo: null // Callback for when a new slide is cycled to. -}; -class Carousel extends component_1.Component { - constructor(el, options) { - var _a; - super(el, options, Carousel); - /** The index of the center carousel item. */ - this.center = 0; - this._handleThrottledResize = utils_1.Utils.throttle(function () { this._handleResize(); }, 200, null).bind(this); - this._handleCarouselTap = (e) => { - // Fixes firefox draggable image bug - if (e.type === 'mousedown' && e.target.tagName === 'IMG') { - e.preventDefault(); - } - this.pressed = true; - this.dragged = false; - this.verticalDragged = false; - this.reference = this._xpos(e); - this.referenceY = this._ypos(e); - this.velocity = this.amplitude = 0; - this.frame = this.offset; - this.timestamp = Date.now(); - clearInterval(this.ticker); - this.ticker = setInterval(this._track, 100); - }; - this._handleCarouselDrag = (e) => { - let x, y, delta, deltaY; - if (this.pressed) { - x = this._xpos(e); - y = this._ypos(e); - delta = this.reference - x; - deltaY = Math.abs(this.referenceY - y); - if (deltaY < 30 && !this.verticalDragged) { - // If vertical scrolling don't allow dragging. - if (delta > 2 || delta < -2) { - this.dragged = true; - this.reference = x; - this._scroll(this.offset + delta); - } - } - else if (this.dragged) { - // If dragging don't allow vertical scroll. - e.preventDefault(); - e.stopPropagation(); - return false; - } - else { - // Vertical scrolling. - this.verticalDragged = true; - } - } - if (this.dragged) { - // If dragging don't allow vertical scroll. - e.preventDefault(); - e.stopPropagation(); - return false; - } - }; - this._handleCarouselRelease = (e) => { - if (this.pressed) { - this.pressed = false; - } - else { - return; - } - clearInterval(this.ticker); - this.target = this.offset; - if (this.velocity > 10 || this.velocity < -10) { - this.amplitude = 0.9 * this.velocity; - this.target = this.offset + this.amplitude; - } - this.target = Math.round(this.target / this.dim) * this.dim; - // No wrap of items. - if (this.noWrap) { - if (this.target >= this.dim * (this.count - 1)) { - this.target = this.dim * (this.count - 1); - } - else if (this.target < 0) { - this.target = 0; - } - } - this.amplitude = this.target - this.offset; - this.timestamp = Date.now(); - requestAnimationFrame(this._autoScroll); - if (this.dragged) { - e.preventDefault(); - e.stopPropagation(); - } - return false; - }; - this._handleCarouselClick = (e) => { - // Disable clicks if carousel was dragged. - if (this.dragged) { - e.preventDefault(); - e.stopPropagation(); - return false; - } - else if (!this.options.fullWidth) { - const clickedElem = e.target.closest('.carousel-item'); - if (!clickedElem) - return; - const clickedIndex = [...clickedElem.parentNode.children].indexOf(clickedElem); - const diff = this._wrap(this.center) - clickedIndex; - // Disable clicks if carousel was shifted by click - if (diff !== 0) { - e.preventDefault(); - e.stopPropagation(); - } - // fixes https://github.com/materializecss/materialize/issues/180 - if (clickedIndex < 0) { - // relative X position > center of carousel = clicked at the right part of the carousel - if (e.clientX - e.target.getBoundingClientRect().left > this.el.clientWidth / 2) { - this.next(); - } - else { - this.prev(); - } - } - else { - this._cycleTo(clickedIndex); - } - } - }; - this._handleIndicatorClick = (e) => { - e.stopPropagation(); - const indicator = e.target.closest('.indicator-item'); - if (indicator) { - const index = [...indicator.parentNode.children].indexOf(indicator); - this._cycleTo(index); - } - }; - this._handleResize = () => { - if (this.options.fullWidth) { - this.itemWidth = this.el.querySelector('.carousel-item').clientWidth; - this.imageHeight = this.el.querySelector('.carousel-item.active').clientHeight; - this.dim = this.itemWidth * 2 + this.options.padding; - this.offset = this.center * 2 * this.itemWidth; - this.target = this.offset; - this._setCarouselHeight(true); - } - else { - this._scroll(); - } - }; - this._track = () => { - let now, elapsed, delta, v; - now = Date.now(); - elapsed = now - this.timestamp; - this.timestamp = now; - delta = this.offset - this.frame; - this.frame = this.offset; - v = (1000 * delta) / (1 + elapsed); - this.velocity = 0.8 * v + 0.2 * this.velocity; - }; - this._autoScroll = () => { - let elapsed, delta; - if (this.amplitude) { - elapsed = Date.now() - this.timestamp; - delta = this.amplitude * Math.exp(-elapsed / this.options.duration); - if (delta > 2 || delta < -2) { - this._scroll(this.target - delta); - requestAnimationFrame(this._autoScroll); - } - else { - this._scroll(this.target); - } - } - }; - this.el.M_Carousel = this; - this.options = Object.assign(Object.assign({}, Carousel.defaults), options); - // Setup - this.hasMultipleSlides = this.el.querySelectorAll('.carousel-item').length > 1; - this.showIndicators = this.options.indicators && this.hasMultipleSlides; - this.noWrap = this.options.noWrap || !this.hasMultipleSlides; - this.pressed = false; - this.dragged = false; - this.offset = this.target = 0; - this.images = []; - this.itemWidth = this.el.querySelector('.carousel-item').clientWidth; - this.itemHeight = this.el.querySelector('.carousel-item').clientHeight; - this.dim = this.itemWidth * 2 + this.options.padding || 1; // Make sure dim is non zero for divisions. - // Full Width carousel setup - if (this.options.fullWidth) { - this.options.dist = 0; - this._setCarouselHeight(); - // Offset fixed items when indicators. - if (this.showIndicators) { - (_a = this.el.querySelector('.carousel-fixed-item')) === null || _a === void 0 ? void 0 : _a.classList.add('with-indicators'); - } - } - // Iterate through slides - this._indicators = document.createElement('ul'); - this._indicators.classList.add('indicators'); - this.el.querySelectorAll('.carousel-item').forEach((item, i) => { - this.images.push(item); - if (this.showIndicators) { - const indicator = document.createElement('li'); - indicator.classList.add('indicator-item'); - if (i === 0) { - indicator.classList.add('active'); - } - this._indicators.appendChild(indicator); - } - }); - if (this.showIndicators) - this.el.appendChild(this._indicators); - this.count = this.images.length; - // Cap numVisible at count - this.options.numVisible = Math.min(this.count, this.options.numVisible); - // Setup cross browser string - this.xform = 'transform'; - ['webkit', 'Moz', 'O', 'ms'].every((prefix) => { - var e = prefix + 'Transform'; - if (typeof document.body.style[e] !== 'undefined') { - this.xform = e; - return false; - } - return true; - }); - this._setupEventHandlers(); - this._scroll(this.offset); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Carousel. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Carousel); - } - static getInstance(el) { - return el.M_Carousel; - } - destroy() { - this._removeEventHandlers(); - this.el.M_Carousel = undefined; - } - _setupEventHandlers() { - if (typeof window.ontouchstart !== 'undefined') { - this.el.addEventListener('touchstart', this._handleCarouselTap); - this.el.addEventListener('touchmove', this._handleCarouselDrag); - this.el.addEventListener('touchend', this._handleCarouselRelease); - } - this.el.addEventListener('mousedown', this._handleCarouselTap); - this.el.addEventListener('mousemove', this._handleCarouselDrag); - this.el.addEventListener('mouseup', this._handleCarouselRelease); - this.el.addEventListener('mouseleave', this._handleCarouselRelease); - this.el.addEventListener('click', this._handleCarouselClick); - if (this.showIndicators && this._indicators) { - this._indicators.querySelectorAll('.indicator-item').forEach((el) => { - el.addEventListener('click', this._handleIndicatorClick); - }); - } - // Resize - window.addEventListener('resize', this._handleThrottledResize); - } - _removeEventHandlers() { - if (typeof window.ontouchstart !== 'undefined') { - this.el.removeEventListener('touchstart', this._handleCarouselTap); - this.el.removeEventListener('touchmove', this._handleCarouselDrag); - this.el.removeEventListener('touchend', this._handleCarouselRelease); - } - this.el.removeEventListener('mousedown', this._handleCarouselTap); - this.el.removeEventListener('mousemove', this._handleCarouselDrag); - this.el.removeEventListener('mouseup', this._handleCarouselRelease); - this.el.removeEventListener('mouseleave', this._handleCarouselRelease); - this.el.removeEventListener('click', this._handleCarouselClick); - if (this.showIndicators && this._indicators) { - this._indicators.querySelectorAll('.indicator-item').forEach((el) => { - el.removeEventListener('click', this._handleIndicatorClick); - }); - } - window.removeEventListener('resize', this._handleThrottledResize); - } - _setCarouselHeight(imageOnly = false) { - const firstSlide = this.el.querySelector('.carousel-item.active') - ? this.el.querySelector('.carousel-item.active') - : this.el.querySelector('.carousel-item'); - const firstImage = firstSlide.querySelector('img'); - if (firstImage) { - if (firstImage.complete) { - // If image won't trigger the load event - const imageHeight = firstImage.clientHeight; - if (imageHeight > 0) { - this.el.style.height = imageHeight + 'px'; - } - else { - // If image still has no height, use the natural dimensions to calculate - const naturalWidth = firstImage.naturalWidth; - const naturalHeight = firstImage.naturalHeight; - const adjustedHeight = (this.el.clientWidth / naturalWidth) * naturalHeight; - this.el.style.height = adjustedHeight + 'px'; - } - } - else { - // Get height when image is loaded normally - firstImage.addEventListener('load', () => { - this.el.style.height = firstImage.offsetHeight + 'px'; - }); - } - } - else if (!imageOnly) { - const slideHeight = firstSlide.clientHeight; - this.el.style.height = slideHeight + 'px'; - } - } - _xpos(e) { - // touch event - if (e.type.startsWith("touch") && e.targetTouches.length >= 1) { - return e.targetTouches[0].clientX; - } - // mouse event - return e.clientX; - } - _ypos(e) { - // touch event - if (e.type.startsWith("touch") && e.targetTouches.length >= 1) { - return e.targetTouches[0].clientY; - } - // mouse event - return e.clientY; - } - _wrap(x) { - return x >= this.count - ? x % this.count - : x < 0 - ? this._wrap(this.count + (x % this.count)) - : x; - } - _scroll(x = 0) { - // Track scrolling state - if (!this.el.classList.contains('scrolling')) { - this.el.classList.add('scrolling'); - } - if (this.scrollingTimeout != null) { - window.clearTimeout(this.scrollingTimeout); - } - this.scrollingTimeout = window.setTimeout(() => { - this.el.classList.remove('scrolling'); - }, this.options.duration); - // Start actual scroll - let i, half, delta, dir, tween, el, alignment, zTranslation, tweenedOpacity, centerTweenedOpacity; - let lastCenter = this.center; - let numVisibleOffset = 1 / this.options.numVisible; - this.offset = typeof x === 'number' ? x : this.offset; - this.center = Math.floor((this.offset + this.dim / 2) / this.dim); - delta = this.offset - this.center * this.dim; - dir = delta < 0 ? 1 : -1; - tween = (-dir * delta * 2) / this.dim; - half = this.count >> 1; - if (this.options.fullWidth) { - alignment = 'translateX(0)'; - centerTweenedOpacity = 1; - } - else { - alignment = 'translateX(' + (this.el.clientWidth - this.itemWidth) / 2 + 'px) '; - alignment += 'translateY(' + (this.el.clientHeight - this.itemHeight) / 2 + 'px)'; - centerTweenedOpacity = 1 - numVisibleOffset * tween; - } - // Set indicator active - if (this.showIndicators) { - const diff = this.center % this.count; - const activeIndicator = this._indicators.querySelector('.indicator-item.active'); - const activeIndicatorIndex = [...activeIndicator.parentNode.children].indexOf(activeIndicator); - if (activeIndicatorIndex !== diff) { - activeIndicator.classList.remove('active'); - const pos = diff < 0 ? this.count + diff : diff; - this._indicators.querySelectorAll('.indicator-item')[pos].classList.add('active'); - } - } - // center - // Don't show wrapped items. - if (!this.noWrap || (this.center >= 0 && this.center < this.count)) { - el = this.images[this._wrap(this.center)]; - // Add active class to center item. - if (!el.classList.contains('active')) { - this.el.querySelector('.carousel-item').classList.remove('active'); - el.classList.add('active'); - } - let transformString = `${alignment} translateX(${-delta / 2}px) translateX(${dir * - this.options.shift * - tween * - i}px) translateZ(${this.options.dist * tween}px)`; - this._updateItemStyle(el, centerTweenedOpacity, 0, transformString); - } - for (i = 1; i <= half; ++i) { - // right side - if (this.options.fullWidth) { - zTranslation = this.options.dist; - tweenedOpacity = i === half && delta < 0 ? 1 - tween : 1; - } - else { - zTranslation = this.options.dist * (i * 2 + tween * dir); - tweenedOpacity = 1 - numVisibleOffset * (i * 2 + tween * dir); - } - // Don't show wrapped items. - if (!this.noWrap || this.center + i < this.count) { - el = this.images[this._wrap(this.center + i)]; - let transformString = `${alignment} translateX(${this.options.shift + - (this.dim * i - delta) / 2}px) translateZ(${zTranslation}px)`; - this._updateItemStyle(el, tweenedOpacity, -i, transformString); - } - // left side - if (this.options.fullWidth) { - zTranslation = this.options.dist; - tweenedOpacity = i === half && delta > 0 ? 1 - tween : 1; - } - else { - zTranslation = this.options.dist * (i * 2 - tween * dir); - tweenedOpacity = 1 - numVisibleOffset * (i * 2 - tween * dir); - } - // Don't show wrapped items. - if (!this.noWrap || this.center - i >= 0) { - el = this.images[this._wrap(this.center - i)]; - let transformString = `${alignment} translateX(${-this.options.shift + - (-this.dim * i - delta) / 2}px) translateZ(${zTranslation}px)`; - this._updateItemStyle(el, tweenedOpacity, -i, transformString); - } - } - // center - // Don't show wrapped items. - if (!this.noWrap || (this.center >= 0 && this.center < this.count)) { - el = this.images[this._wrap(this.center)]; - let transformString = `${alignment} translateX(${-delta / 2}px) translateX(${dir * - this.options.shift * - tween}px) translateZ(${this.options.dist * tween}px)`; - this._updateItemStyle(el, centerTweenedOpacity, 0, transformString); - } - // onCycleTo callback - const _currItem = this.el.querySelectorAll('.carousel-item')[this._wrap(this.center)]; - if (lastCenter !== this.center && typeof this.options.onCycleTo === 'function') { - this.options.onCycleTo.call(this, _currItem, this.dragged); - } - // One time callback - if (typeof this.oneTimeCallback === 'function') { - this.oneTimeCallback.call(this, _currItem, this.dragged); - this.oneTimeCallback = null; - } - } - _updateItemStyle(el, opacity, zIndex, transform) { - el.style[this.xform] = transform; - el.style.zIndex = zIndex.toString(); - el.style.opacity = opacity.toString(); - el.style.visibility = 'visible'; - } - _cycleTo(n, callback = null) { - let diff = (this.center % this.count) - n; - // Account for wraparound. - if (!this.noWrap) { - if (diff < 0) { - if (Math.abs(diff + this.count) < Math.abs(diff)) { - diff += this.count; - } - } - else if (diff > 0) { - if (Math.abs(diff - this.count) < diff) { - diff -= this.count; - } - } - } - this.target = this.dim * Math.round(this.offset / this.dim); - // Next - if (diff < 0) { - this.target += this.dim * Math.abs(diff); - } // Prev - else if (diff > 0) { - this.target -= this.dim * diff; - } - // Set one time callback - if (typeof callback === 'function') { - this.oneTimeCallback = callback; - } - // Scroll - if (this.offset !== this.target) { - this.amplitude = this.target - this.offset; - this.timestamp = Date.now(); - requestAnimationFrame(this._autoScroll); - } - } - /** - * Move carousel to next slide or go forward a given amount of slides. - * @param n How many times the carousel slides. - */ - next(n = 1) { - if (n === undefined || isNaN(n)) { - n = 1; - } - let index = this.center + n; - if (index >= this.count || index < 0) { - if (this.noWrap) - return; - index = this._wrap(index); - } - this._cycleTo(index); - } - /** - * Move carousel to previous slide or go back a given amount of slides. - * @param n How many times the carousel slides. - */ - prev(n = 1) { - if (n === undefined || isNaN(n)) { - n = 1; - } - let index = this.center - n; - if (index >= this.count || index < 0) { - if (this.noWrap) - return; - index = this._wrap(index); - } - this._cycleTo(index); - } - /** - * Move carousel to nth slide. - * @param n Index of slide. - * @param callback "onCycleTo" optional callback. - */ - set(n, callback) { - if (n === undefined || isNaN(n)) { - n = 0; - } - if (n > this.count || n < 0) { - if (this.noWrap) - return; - n = this._wrap(n); - } - this._cycleTo(n, callback); - } -} -exports.Carousel = Carousel; - - -/***/ }), - -/***/ 283: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CharacterCounter = void 0; -const component_1 = __webpack_require__(999); -; -const _defaults = Object.freeze({}); -class CharacterCounter extends component_1.Component { - constructor(el, options) { - super(el, {}, CharacterCounter); - this.updateCounter = () => { - let maxLength = parseInt(this.el.getAttribute('maxlength')), actualLength = this.el.value.length; - this.isValidLength = actualLength <= maxLength; - let counterString = actualLength.toString(); - if (maxLength) { - counterString += '/' + maxLength; - this._validateInput(); - } - this.counterEl.innerHTML = counterString; - }; - this.el.M_CharacterCounter = this; - this.options = Object.assign(Object.assign({}, CharacterCounter.defaults), options); - this.isInvalid = false; - this.isValidLength = false; - this._setupCounter(); - this._setupEventHandlers(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of CharacterCounter. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, CharacterCounter); - } - static getInstance(el) { - return el.M_CharacterCounter; - } - destroy() { - this._removeEventHandlers(); - this.el.CharacterCounter = undefined; - this._removeCounter(); - } - _setupEventHandlers() { - this.el.addEventListener('focus', this.updateCounter, true); - this.el.addEventListener('input', this.updateCounter, true); - } - _removeEventHandlers() { - this.el.removeEventListener('focus', this.updateCounter, true); - this.el.removeEventListener('input', this.updateCounter, true); - } - _setupCounter() { - this.counterEl = document.createElement('span'); - this.counterEl.classList.add('character-counter'); - this.counterEl.style.float = 'right'; - this.counterEl.style.fontSize = '12px'; - this.counterEl.style.height = '1'; - this.el.parentElement.appendChild(this.counterEl); - } - _removeCounter() { - this.counterEl.remove(); - } - _validateInput() { - if (this.isValidLength && this.isInvalid) { - this.isInvalid = false; - this.el.classList.remove('invalid'); - } - else if (!this.isValidLength && !this.isInvalid) { - this.isInvalid = true; - this.el.classList.remove('valid'); - this.el.classList.add('invalid'); - } - } -} -exports.CharacterCounter = CharacterCounter; - - -/***/ }), - -/***/ 359: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Chips = void 0; -const utils_1 = __webpack_require__(593); -const autocomplete_1 = __webpack_require__(357); -const component_1 = __webpack_require__(999); -let _defaults = { - data: [], - placeholder: '', - secondaryPlaceholder: '', - closeIconClass: 'material-icons', - autocompleteOptions: {}, - autocompleteOnly: false, - limit: Infinity, - onChipAdd: null, - onChipSelect: null, - onChipDelete: null -}; -function gGetIndex(el) { - return [...el.parentNode.children].indexOf(el); -} -class Chips extends component_1.Component { - constructor(el, options) { - super(el, options, Chips); - this._handleChipClick = (e) => { - const _chip = e.target.closest('.chip'); - const clickedClose = e.target.classList.contains('close'); - if (_chip) { - const index = [..._chip.parentNode.children].indexOf(_chip); - if (clickedClose) { - this.deleteChip(index); - this._input.focus(); - } - else { - this.selectChip(index); - } - // Default handle click to focus on input - } - else { - this._input.focus(); - } - }; - this._handleInputFocus = () => { - this.el.classList.add('focus'); - }; - this._handleInputBlur = () => { - this.el.classList.remove('focus'); - }; - this._handleInputKeydown = (e) => { - Chips._keydown = true; - if (utils_1.Utils.keys.ENTER.includes(e.key)) { - // Override enter if autocompleting. - if (this.hasAutocomplete && this.autocomplete && this.autocomplete.isOpen) { - return; - } - e.preventDefault(); - if (!this.hasAutocomplete || (this.hasAutocomplete && !this.options.autocompleteOnly)) { - this.addChip({ id: this._input.value }); - } - this._input.value = ''; - } - else if ((utils_1.Utils.keys.BACKSPACE.includes(e.key) || utils_1.Utils.keys.ARROW_LEFT.includes(e.key)) && - this._input.value === '' && - this.chipsData.length) { - e.preventDefault(); - this.selectChip(this.chipsData.length - 1); - } - }; - this.el.M_Chips = this; - this.options = Object.assign(Object.assign({}, Chips.defaults), options); - this.el.classList.add('chips', 'input-field'); - this.chipsData = []; - this._chips = []; - this._setupInput(); - this.hasAutocomplete = Object.keys(this.options.autocompleteOptions).length > 0; - // Set input id - if (!this._input.getAttribute('id')) - this._input.setAttribute('id', utils_1.Utils.guid()); - // Render initial chips - if (this.options.data.length) { - this.chipsData = this.options.data; - this._renderChips(); - } - // Setup autocomplete if needed - if (this.hasAutocomplete) - this._setupAutocomplete(); - this._setPlaceholder(); - this._setupLabel(); - this._setupEventHandlers(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Chips. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Chips); - } - static getInstance(el) { - return el.M_Chips; - } - getData() { - return this.chipsData; - } - destroy() { - this._removeEventHandlers(); - this._chips.forEach(c => c.remove()); - this._chips = []; - this.el.M_Chips = undefined; - } - _setupEventHandlers() { - this.el.addEventListener('click', this._handleChipClick); - document.addEventListener('keydown', Chips._handleChipsKeydown); - document.addEventListener('keyup', Chips._handleChipsKeyup); - this.el.addEventListener('blur', Chips._handleChipsBlur, true); - this._input.addEventListener('focus', this._handleInputFocus); - this._input.addEventListener('blur', this._handleInputBlur); - this._input.addEventListener('keydown', this._handleInputKeydown); - } - _removeEventHandlers() { - this.el.removeEventListener('click', this._handleChipClick); - document.removeEventListener('keydown', Chips._handleChipsKeydown); - document.removeEventListener('keyup', Chips._handleChipsKeyup); - this.el.removeEventListener('blur', Chips._handleChipsBlur, true); - this._input.removeEventListener('focus', this._handleInputFocus); - this._input.removeEventListener('blur', this._handleInputBlur); - this._input.removeEventListener('keydown', this._handleInputKeydown); - } - static _handleChipsKeydown(e) { - Chips._keydown = true; - const chips = e.target.closest('.chips'); - const chipsKeydown = e.target && chips; - // Don't handle keydown inputs on input and textarea - const tag = e.target.tagName; - if (tag === 'INPUT' || tag === 'TEXTAREA' || !chipsKeydown) - return; - const currChips = chips.M_Chips; - if (utils_1.Utils.keys.BACKSPACE.includes(e.key) || utils_1.Utils.keys.DELETE.includes(e.key)) { - e.preventDefault(); - let selectIndex = currChips.chipsData.length; - if (currChips._selectedChip) { - const index = gGetIndex(currChips._selectedChip); - currChips.deleteChip(index); - currChips._selectedChip = null; - // Make sure selectIndex doesn't go negative - selectIndex = Math.max(index - 1, 0); - } - if (currChips.chipsData.length) - currChips.selectChip(selectIndex); - else - currChips._input.focus(); - } - else if (utils_1.Utils.keys.ARROW_LEFT.includes(e.key)) { - if (currChips._selectedChip) { - const selectIndex = gGetIndex(currChips._selectedChip) - 1; - if (selectIndex < 0) - return; - currChips.selectChip(selectIndex); - } - } - else if (utils_1.Utils.keys.ARROW_RIGHT.includes(e.key)) { - if (currChips._selectedChip) { - const selectIndex = gGetIndex(currChips._selectedChip) + 1; - if (selectIndex >= currChips.chipsData.length) - currChips._input.focus(); - else - currChips.selectChip(selectIndex); - } - } - } - static _handleChipsKeyup(e) { - Chips._keydown = false; - } - static _handleChipsBlur(e) { - if (!Chips._keydown && document.hidden) { - const chips = e.target.closest('.chips'); - const currChips = chips.M_Chips; - currChips._selectedChip = null; - } - } - _renderChip(chip) { - if (!chip.id) - return; - const renderedChip = document.createElement('div'); - renderedChip.classList.add('chip'); - renderedChip.innerText = chip.text || chip.id; - renderedChip.setAttribute('tabindex', "0"); - const closeIcon = document.createElement('i'); - closeIcon.classList.add(this.options.closeIconClass, 'close'); - closeIcon.innerText = 'close'; - // attach image if needed - if (chip.image) { - const img = document.createElement('img'); - img.setAttribute('src', chip.image); - renderedChip.insertBefore(img, renderedChip.firstChild); - } - renderedChip.appendChild(closeIcon); - return renderedChip; - } - _renderChips() { - this._chips = []; //.remove(); - for (let i = 0; i < this.chipsData.length; i++) { - const chipElem = this._renderChip(this.chipsData[i]); - this.el.appendChild(chipElem); - this._chips.push(chipElem); - } - // move input to end - this.el.append(this._input); - } - _setupAutocomplete() { - this.options.autocompleteOptions.onAutocomplete = (items) => { - if (items.length > 0) - this.addChip({ - id: items[0].id, - text: items[0].text, - image: items[0].image - }); - this._input.value = ''; - this._input.focus(); - }; - this.autocomplete = autocomplete_1.Autocomplete.init(this._input, this.options.autocompleteOptions); - } - _setupInput() { - this._input = this.el.querySelector('input'); - if (!this._input) { - this._input = document.createElement('input'); - this.el.append(this._input); - } - this._input.classList.add('input'); - } - _setupLabel() { - this._label = this.el.querySelector('label'); - if (this._label) - this._label.setAttribute('for', this._input.getAttribute('id')); - } - _setPlaceholder() { - if (this.chipsData !== undefined && !this.chipsData.length && this.options.placeholder) { - this._input.placeholder = this.options.placeholder; - } - else if ((this.chipsData === undefined || !!this.chipsData.length) && - this.options.secondaryPlaceholder) { - this._input.placeholder = this.options.secondaryPlaceholder; - } - } - _isValidAndNotExist(chip) { - const isValid = !!chip.id; - const doesNotExist = !this.chipsData.some(item => item.id == chip.id); - return isValid && doesNotExist; - } - /** - * Add chip to input. - * @param chip Chip data object - */ - addChip(chip) { - if (!this._isValidAndNotExist(chip) || this.chipsData.length >= this.options.limit) - return; - const renderedChip = this._renderChip(chip); - this._chips.push(renderedChip); - this.chipsData.push(chip); - //$(this._input).before(renderedChip); - this._input.before(renderedChip); - this._setPlaceholder(); - // fire chipAdd callback - if (typeof this.options.onChipAdd === 'function') { - this.options.onChipAdd(this.el, renderedChip); - } - } - /** - * Delete nth chip. - * @param chipIndex Index of chip - */ - deleteChip(chipIndex) { - const chip = this._chips[chipIndex]; - this._chips[chipIndex].remove(); - this._chips.splice(chipIndex, 1); - this.chipsData.splice(chipIndex, 1); - this._setPlaceholder(); - // fire chipDelete callback - if (typeof this.options.onChipDelete === 'function') { - this.options.onChipDelete(this.el, chip); - } - } - /** - * Select nth chip. - * @param chipIndex Index of chip - */ - selectChip(chipIndex) { - const chip = this._chips[chipIndex]; - this._selectedChip = chip; - chip.focus(); - // fire chipSelect callback - if (typeof this.options.onChipSelect === 'function') { - this.options.onChipSelect(this.el, chip); - } - } - static Init() { - document.addEventListener("DOMContentLoaded", () => { - // Handle removal of static chips. - document.body.addEventListener('click', e => { - if (e.target.closest('.chip .close')) { - const chips = e.target.closest('.chips'); - if (chips && chips.M_Chips == undefined) - return; - e.target.closest('.chip').remove(); - } - }); - }); - } -} -exports.Chips = Chips; -(() => { - Chips._keydown = false; -})(); - - -/***/ }), - -/***/ 995: -/***/ (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.Collapsible = void 0; -const animejs_1 = __importDefault(__webpack_require__(30)); -const utils_1 = __webpack_require__(593); -const component_1 = __webpack_require__(999); -const _defaults = { - accordion: true, - onOpenStart: null, - onOpenEnd: null, - onCloseStart: null, - onCloseEnd: null, - inDuration: 300, - outDuration: 300 -}; -class Collapsible extends component_1.Component { - constructor(el, options) { - super(el, options, Collapsible); - this._handleCollapsibleClick = (e) => { - const header = e.target.closest('.collapsible-header'); - if (e.target && header) { - const collapsible = header.closest('.collapsible'); - if (collapsible !== this.el) - return; - const li = header.closest('li'); - const isActive = li.classList.contains('active'); - const index = [...li.parentNode.children].indexOf(li); - if (isActive) - this.close(index); - else - this.open(index); - } - }; - this._handleCollapsibleKeydown = (e) => { - if (utils_1.Utils.keys.ENTER.includes(e.key)) { - this._handleCollapsibleClick(e); - } - }; - /** - * Open collapsible section. - * @param n Nth section to open. - */ - this.open = (index) => { - const listItems = Array.from(this.el.children).filter(c => c.tagName === 'LI'); - const li = listItems[index]; - if (li && !li.classList.contains('active')) { - // onOpenStart callback - if (typeof this.options.onOpenStart === 'function') { - this.options.onOpenStart.call(this, li); - } - // Handle accordion behavior - if (this.options.accordion) { - const activeLis = listItems.filter(li => li.classList.contains('active')); - activeLis.forEach(activeLi => { - const index = listItems.indexOf(activeLi); - this.close(index); - }); - } - // Animate in - li.classList.add('active'); - this._animateIn(index); - } - }; - /** - * Close collapsible section. - * @param n Nth section to close. - */ - this.close = (index) => { - const li = Array.from(this.el.children).filter(c => c.tagName === 'LI')[index]; - if (li && li.classList.contains('active')) { - // onCloseStart callback - if (typeof this.options.onCloseStart === 'function') { - this.options.onCloseStart.call(this, li); - } - // Animate out - li.classList.remove('active'); - this._animateOut(index); - } - }; - this.el.M_Collapsible = this; - this.options = Object.assign(Object.assign({}, Collapsible.defaults), options); - // Setup tab indices - this._headers = Array.from(this.el.querySelectorAll('li > .collapsible-header')); - this._headers.forEach(el => el.tabIndex = 0); - this._setupEventHandlers(); - // Open first active - const activeBodies = Array.from(this.el.querySelectorAll('li.active > .collapsible-body')); - if (this.options.accordion) - if (activeBodies.length > 0) - activeBodies[0].style.display = 'block'; // Accordion - else - activeBodies.forEach(el => el.style.display = 'block'); // Expandables - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Collapsible. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Collapsible); - } - static getInstance(el) { - return el.M_Collapsible; - } - destroy() { - this._removeEventHandlers(); - this.el.M_Collapsible = undefined; - } - _setupEventHandlers() { - this.el.addEventListener('click', this._handleCollapsibleClick); - this._headers.forEach(header => header.addEventListener('keydown', this._handleCollapsibleKeydown)); - } - _removeEventHandlers() { - this.el.removeEventListener('click', this._handleCollapsibleClick); - this._headers.forEach(header => header.removeEventListener('keydown', this._handleCollapsibleKeydown)); - } - _animateIn(index) { - const li = this.el.children[index]; - if (!li) - return; - const body = li.querySelector('.collapsible-body'); - animejs_1.default.remove(body); - body.style.display = 'block'; - body.style.overflow = 'hidden'; - body.style.height = '0'; - body.style.paddingTop = ''; - body.style.paddingBottom = ''; - const pTop = getComputedStyle(body).paddingTop; // . css('padding-top'); - const pBottom = getComputedStyle(body).paddingBottom; //body.css('padding-bottom'); - const finalHeight = body.scrollHeight; - body.style.paddingTop = '0'; - body.style.paddingBottom = '0'; - (0, animejs_1.default)({ - targets: body, - height: finalHeight, - paddingTop: pTop, - paddingBottom: pBottom, - duration: this.options.inDuration, - easing: 'easeInOutCubic', - complete: (anim) => { - body.style.overflow = ''; - body.style.height = ''; - body.style.paddingTop = ''; - body.style.paddingBottom = ''; - // onOpenEnd callback - if (typeof this.options.onOpenEnd === 'function') { - this.options.onOpenEnd.call(this, li); - } - } - }); - } - _animateOut(index) { - const li = this.el.children[index]; - if (!li) - return; - const body = li.querySelector('.collapsible-body'); - animejs_1.default.remove(body); - body.style.overflow = 'hidden'; - (0, animejs_1.default)({ - targets: body, - height: 0, - paddingTop: 0, - paddingBottom: 0, - duration: this.options.outDuration, - easing: 'easeInOutCubic', - complete: () => { - body.style.overflow = ''; - body.style.height = ''; - body.style.padding = ''; - body.style.display = ''; - // onCloseEnd callback - if (typeof this.options.onCloseEnd === 'function') { - this.options.onCloseEnd.call(this, li); - } - } - }); - } -} -exports.Collapsible = Collapsible; - - -/***/ }), - -/***/ 999: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Component = void 0; -; -; -/** - * Base class implementation for Materialize components. - */ -class Component { - /** - * Constructs component instance and set everything up. - */ - constructor(el, options, classDef) { - // Display error if el is not a valid HTML Element - if (!(el instanceof HTMLElement)) { - console.error(Error(el + ' is not an HTML Element')); - } - // If exists, destroy and reinitialize in child - let ins = classDef.getInstance(el); - if (!!ins) { - ins.destroy(); - } - this.el = el; - } - /** - * Initializes component instances. - * @param els HTML elements. - * @param options Component options. - * @param classDef Class definition. - */ - static init(els, options, classDef) { - let instances = null; - if (els instanceof Element) { - instances = new classDef(els, options); - } - else if (!!els && els.length) { - instances = []; - for (let i = 0; i < els.length; i++) { - instances.push(new classDef(els[i], options)); - } - } - return instances; - } - /** - * @returns default options for component instance. - */ - static get defaults() { return {}; } - /** - * Retrieves component instance for the given element. - * @param el Associated HTML Element. - */ - static getInstance(el) { - throw new Error("This method must be implemented."); - } - /** - * Destroy plugin instance and teardown. - */ - destroy() { throw new Error("This method must be implemented."); } -} -exports.Component = Component; - - -/***/ }), - -/***/ 457: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Datepicker = void 0; -const modal_1 = __webpack_require__(799); -const utils_1 = __webpack_require__(593); -const select_1 = __webpack_require__(375); -const component_1 = __webpack_require__(999); -; -let _defaults = { - // Close when date is selected - autoClose: false, - // the default output format for the input field value - format: 'mmm dd, yyyy', - // Used to create date object from current input string - parse: null, - // The initial date to view when first opened - defaultDate: null, - // Make the `defaultDate` the initial selected value - setDefaultDate: false, - disableWeekends: false, - disableDayFn: null, - // First day of week (0: Sunday, 1: Monday etc) - firstDay: 0, - // The earliest date that can be selected - minDate: null, - // Thelatest date that can be selected - maxDate: null, - // Number of years either side, or array of upper/lower range - yearRange: 10, - // used internally (don't config outside) - minYear: 0, - maxYear: 9999, - minMonth: undefined, - maxMonth: undefined, - startRange: null, - endRange: null, - isRTL: false, - yearRangeReverse: false, - // Render the month after year in the calendar title - showMonthAfterYear: false, - // Render days of the calendar grid that fall in the next or previous month - showDaysInNextAndPreviousMonths: false, - // Specify a DOM element to render the calendar in - container: null, - // Show clear button - showClearBtn: false, - // internationalization - i18n: { - cancel: 'Cancel', - clear: 'Clear', - done: 'Ok', - previousMonth: '‹', - nextMonth: '›', - months: [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December' - ], - monthsShort: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'May', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Oct', - 'Nov', - 'Dec' - ], - weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - weekdaysAbbrev: ['S', 'M', 'T', 'W', 'T', 'F', 'S'] - }, - // events array - events: [], - // callback function - onSelect: null, - onOpen: null, - onClose: null, - onDraw: null -}; -class Datepicker extends component_1.Component { - constructor(el, options) { - super(el, options, Datepicker); - this._handleInputClick = () => { - this.open(); - }; - this._handleInputKeydown = (e) => { - if (utils_1.Utils.keys.ENTER.includes(e.key)) { - e.preventDefault(); - this.open(); - } - }; - this._handleCalendarClick = (e) => { - if (!this.isOpen) - return; - const target = (e.target); - if (!target.classList.contains('is-disabled')) { - if (target.classList.contains('datepicker-day-button') && - !target.classList.contains('is-empty') && - !target.parentElement.classList.contains('is-disabled')) { - this.setDate(new Date(e.target.getAttribute('data-year'), e.target.getAttribute('data-month'), e.target.getAttribute('data-day'))); - if (this.options.autoClose) { - this._finishSelection(); - } - } - else if (target.closest('.month-prev')) { - this.prevMonth(); - } - else if (target.closest('.month-next')) { - this.nextMonth(); - } - } - }; - this._handleClearClick = () => { - this.date = null; - this.setInputValue(); - this.close(); - }; - this._handleMonthChange = (e) => { - this.gotoMonth(e.target.value); - }; - this._handleYearChange = (e) => { - this.gotoYear(e.target.value); - }; - this._handleInputChange = (e) => { - var _a; - let date; - // Prevent change event from being fired when triggered by the plugin - if (((_a = e['detail']) === null || _a === void 0 ? void 0 : _a.firedBy) === this) - return; - if (this.options.parse) { - date = this.options.parse(this.el.value, typeof this.options.format === "function" - ? this.options.format(new Date(this.el.value)) - : this.options.format); - } - else { - date = new Date(Date.parse(this.el.value)); - } - if (Datepicker._isDate(date)) - this.setDate(date); - }; - // Set input value to the selected date and close Datepicker - this._finishSelection = () => { - this.setInputValue(); - this.close(); - }; - /** - * Open datepicker. - */ - this.open = () => { - if (this.isOpen) - return; - this.isOpen = true; - if (typeof this.options.onOpen === 'function') { - this.options.onOpen.call(this); - } - this.draw(); - this.modal.open(undefined); - return this; - }; - /** - * Close datepicker. - */ - this.close = () => { - if (!this.isOpen) - return; - this.isOpen = false; - if (typeof this.options.onClose === 'function') { - this.options.onClose.call(this); - } - this.modal.close(); - return this; - }; - this.el.M_Datepicker = this; - this.options = Object.assign(Object.assign({}, Datepicker.defaults), options); - // make sure i18n defaults are not lost when only few i18n option properties are passed - if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') { - this.options.i18n = Object.assign(Object.assign({}, Datepicker.defaults.i18n), options.i18n); - } - // Remove time component from minDate and maxDate options - if (this.options.minDate) - this.options.minDate.setHours(0, 0, 0, 0); - if (this.options.maxDate) - this.options.maxDate.setHours(0, 0, 0, 0); - this.id = utils_1.Utils.guid(); - this._setupVariables(); - this._insertHTMLIntoDOM(); - this._setupModal(); - this._setupEventHandlers(); - if (!this.options.defaultDate) { - this.options.defaultDate = new Date(Date.parse(this.el.value)); - } - let defDate = this.options.defaultDate; - if (Datepicker._isDate(defDate)) { - if (this.options.setDefaultDate) { - this.setDate(defDate, true); - this.setInputValue(); - } - else { - this.gotoDate(defDate); - } - } - else { - this.gotoDate(new Date()); - } - this.isOpen = false; - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Datepicker. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Datepicker); - } - static _isDate(obj) { - return /Date/.test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()); - } - static _isWeekend(date) { - let day = date.getDay(); - return day === 0 || day === 6; - } - static _setToStartOfDay(date) { - if (Datepicker._isDate(date)) - date.setHours(0, 0, 0, 0); - } - static _getDaysInMonth(year, month) { - return [31, Datepicker._isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; - } - static _isLeapYear(year) { - // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - static _compareDates(a, b) { - // weak date comparison (use setToStartOfDay(date) to ensure correct result) - return a.getTime() === b.getTime(); - } - static getInstance(el) { - return el.M_Datepicker; - } - destroy() { - this._removeEventHandlers(); - this.modal.destroy(); - this.modalEl.remove(); - this.destroySelects(); - this.el.M_Datepicker = undefined; - } - destroySelects() { - let oldYearSelect = this.calendarEl.querySelector('.orig-select-year'); - if (oldYearSelect) { - select_1.FormSelect.getInstance(oldYearSelect).destroy(); - } - let oldMonthSelect = this.calendarEl.querySelector('.orig-select-month'); - if (oldMonthSelect) { - select_1.FormSelect.getInstance(oldMonthSelect).destroy(); - } - } - _insertHTMLIntoDOM() { - if (this.options.showClearBtn) { - this.clearBtn.style.visibility = ''; - this.clearBtn.innerText = this.options.i18n.clear; - } - this.doneBtn.innerText = this.options.i18n.done; - this.cancelBtn.innerText = this.options.i18n.cancel; - if (this.options.container) { - const optEl = this.options.container; - this.options.container = - optEl instanceof HTMLElement ? optEl : document.querySelector(optEl); - this.options.container.append(this.modalEl); - } - else { - //this.modalEl.before(this.el); - this.el.parentElement.appendChild(this.modalEl); - } - } - _setupModal() { - this.modalEl.id = 'modal-' + this.id; - this.modal = modal_1.Modal.init(this.modalEl, { - onCloseEnd: () => { - this.isOpen = false; - } - }); - } - /** - * Gets a string representation of the selected date. - */ - toString(format = null) { - format = format || this.options.format; - if (typeof format === 'function') - return format(this.date); - if (!Datepicker._isDate(this.date)) - return ''; - // String Format - const formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g); - const formattedDate = formatArray - .map(label => this.formats[label] ? this.formats[label]() : label) - .join(''); - return formattedDate; - } - /** - * Set a date on the datepicker. - * @param date Date to set on the datepicker. - * @param preventOnSelect Undocumented as of 5 March 2018. - */ - setDate(date = null, preventOnSelect = false) { - if (!date) { - this.date = null; - this._renderDateDisplay(); - return this.draw(); - } - if (typeof date === 'string') { - date = new Date(Date.parse(date)); - } - if (!Datepicker._isDate(date)) { - return; - } - let min = this.options.minDate, max = this.options.maxDate; - if (Datepicker._isDate(min) && date < min) { - date = min; - } - else if (Datepicker._isDate(max) && date > max) { - date = max; - } - this.date = new Date(date.getTime()); - this._renderDateDisplay(); - Datepicker._setToStartOfDay(this.date); - this.gotoDate(this.date); - if (!preventOnSelect && typeof this.options.onSelect === 'function') { - this.options.onSelect.call(this, this.date); - } - } - /** - * Sets current date as the input value. - */ - setInputValue() { - this.el.value = this.toString(); - this.el.dispatchEvent(new CustomEvent('change', { detail: { firedBy: this } })); - } - _renderDateDisplay() { - let displayDate = Datepicker._isDate(this.date) ? this.date : new Date(); - let i18n = this.options.i18n; - let day = i18n.weekdaysShort[displayDate.getDay()]; - let month = i18n.monthsShort[displayDate.getMonth()]; - let date = displayDate.getDate(); - this.yearTextEl.innerHTML = displayDate.getFullYear().toString(); - this.dateTextEl.innerHTML = `${day}, ${month} ${date}`; - } - /** - * Change date view to a specific date on the datepicker. - * @param date Date to show on the datepicker. - */ - gotoDate(date) { - let newCalendar = true; - if (!Datepicker._isDate(date)) { - return; - } - if (this.calendars) { - let firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), lastVisibleDate = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), visibleDate = date.getTime(); - // get the end of the month - lastVisibleDate.setMonth(lastVisibleDate.getMonth() + 1); - lastVisibleDate.setDate(lastVisibleDate.getDate() - 1); - newCalendar = - visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate; - } - if (newCalendar) { - this.calendars = [ - { - month: date.getMonth(), - year: date.getFullYear() - } - ]; - } - this.adjustCalendars(); - } - adjustCalendars() { - this.calendars[0] = this.adjustCalendar(this.calendars[0]); - this.draw(); - } - adjustCalendar(calendar) { - if (calendar.month < 0) { - calendar.year -= Math.ceil(Math.abs(calendar.month) / 12); - calendar.month += 12; - } - if (calendar.month > 11) { - calendar.year += Math.floor(Math.abs(calendar.month) / 12); - calendar.month -= 12; - } - return calendar; - } - nextMonth() { - this.calendars[0].month++; - this.adjustCalendars(); - } - prevMonth() { - this.calendars[0].month--; - this.adjustCalendars(); - } - render(year, month, randId) { - let opts = this.options, now = new Date(), days = Datepicker._getDaysInMonth(year, month), before = new Date(year, month, 1).getDay(), data = [], row = []; - Datepicker._setToStartOfDay(now); - if (opts.firstDay > 0) { - before -= opts.firstDay; - if (before < 0) { - before += 7; - } - } - let previousMonth = month === 0 ? 11 : month - 1, nextMonth = month === 11 ? 0 : month + 1, yearOfPreviousMonth = month === 0 ? year - 1 : year, yearOfNextMonth = month === 11 ? year + 1 : year, daysInPreviousMonth = Datepicker._getDaysInMonth(yearOfPreviousMonth, previousMonth); - let cells = days + before, after = cells; - while (after > 7) { - after -= 7; - } - cells += 7 - after; - let isWeekSelected = false; - for (let i = 0, r = 0; i < cells; i++) { - let day = new Date(year, month, 1 + (i - before)), isSelected = Datepicker._isDate(this.date) - ? Datepicker._compareDates(day, this.date) - : false, isToday = Datepicker._compareDates(day, now), hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false, isEmpty = i < before || i >= days + before, dayNumber = 1 + (i - before), monthNumber = month, yearNumber = year, isStartRange = opts.startRange && Datepicker._compareDates(opts.startRange, day), isEndRange = opts.endRange && Datepicker._compareDates(opts.endRange, day), isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, isDisabled = (opts.minDate && day < opts.minDate) || - (opts.maxDate && day > opts.maxDate) || - (opts.disableWeekends && Datepicker._isWeekend(day)) || - (opts.disableDayFn && opts.disableDayFn(day)); - if (isEmpty) { - if (i < before) { - dayNumber = daysInPreviousMonth + dayNumber; - monthNumber = previousMonth; - yearNumber = yearOfPreviousMonth; - } - else { - dayNumber = dayNumber - days; - monthNumber = nextMonth; - yearNumber = yearOfNextMonth; - } - } - let dayConfig = { - day: dayNumber, - month: monthNumber, - year: yearNumber, - hasEvent: hasEvent, - isSelected: isSelected, - isToday: isToday, - isDisabled: isDisabled, - isEmpty: isEmpty, - isStartRange: isStartRange, - isEndRange: isEndRange, - isInRange: isInRange, - showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths - }; - row.push(this.renderDay(dayConfig)); - if (++r === 7) { - data.push(this.renderRow(row, opts.isRTL, isWeekSelected)); - row = []; - r = 0; - isWeekSelected = false; - } - } - return this.renderTable(opts, data, randId); - } - renderDay(opts) { - let arr = []; - let ariaSelected = 'false'; - if (opts.isEmpty) { - if (opts.showDaysInNextAndPreviousMonths) { - arr.push('is-outside-current-month'); - arr.push('is-selection-disabled'); - } - else { - return ''; - } - } - if (opts.isDisabled) { - arr.push('is-disabled'); - } - if (opts.isToday) { - arr.push('is-today'); - } - if (opts.isSelected) { - arr.push('is-selected'); - ariaSelected = 'true'; - } - if (opts.hasEvent) { - arr.push('has-event'); - } - if (opts.isInRange) { - arr.push('is-inrange'); - } - if (opts.isStartRange) { - arr.push('is-startrange'); - } - if (opts.isEndRange) { - arr.push('is-endrange'); - } - return (`` + - `` + - ''); - } - renderRow(days, isRTL, isRowSelected) { - return ('' + - (isRTL ? days.reverse() : days).join('') + - ''); - } - renderTable(opts, data, randId) { - return ('
' + - this.renderHead(opts) + - this.renderBody(data) + - '
'); - } - renderHead(opts) { - let i, arr = []; - for (i = 0; i < 7; i++) { - arr.push(`${this.renderDayName(opts, i, true)}`); - } - return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; - } - renderBody(rows) { - return '' + rows.join('') + ''; - } - renderTitle(instance, c, year, month, refYear, randId) { - let i, j, arr, opts = this.options, isMinYear = year === opts.minYear, isMaxYear = year === opts.maxYear, html = '
', monthHtml, yearHtml, prev = true, next = true; - for (arr = [], i = 0; i < 12; i++) { - arr.push(''); - } - monthHtml = ''; - if (Array.isArray(opts.yearRange)) { - i = opts.yearRange[0]; - j = opts.yearRange[1] + 1; - } - else { - i = year - opts.yearRange; - j = 1 + year + opts.yearRange; - } - for (arr = []; i < j && i <= opts.maxYear; i++) { - if (i >= opts.minYear) { - arr.push(``); - } - } - if (opts.yearRangeReverse) - arr.reverse(); - yearHtml = ``; - let leftArrow = ''; - html += ``; - html += '
'; - if (opts.showMonthAfterYear) { - html += yearHtml + monthHtml; - } - else { - html += monthHtml + yearHtml; - } - html += '
'; - if (isMinYear && (month === 0 || opts.minMonth >= month)) { - prev = false; - } - if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { - next = false; - } - let rightArrow = ''; - html += ``; - return (html += '
'); - } - // refresh HTML - draw(force = false) { - if (!this.isOpen && !force) - return; - let opts = this.options, minYear = opts.minYear, maxYear = opts.maxYear, minMonth = opts.minMonth, maxMonth = opts.maxMonth, html = '', randId; - if (this._y <= minYear) { - this._y = minYear; - if (!isNaN(minMonth) && this._m < minMonth) { - this._m = minMonth; - } - } - if (this._y >= maxYear) { - this._y = maxYear; - if (!isNaN(maxMonth) && this._m > maxMonth) { - this._m = maxMonth; - } - } - randId = - 'datepicker-title-' + - Math.random() - .toString(36) - .replace(/[^a-z]+/g, '') - .substr(0, 2); - for (let c = 0; c < 1; c++) { - this._renderDateDisplay(); - html += - this.renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId); - } - this.destroySelects(); - this.calendarEl.innerHTML = html; - // Init Materialize Select - let yearSelect = this.calendarEl.querySelector('.orig-select-year'); - let monthSelect = this.calendarEl.querySelector('.orig-select-month'); - select_1.FormSelect.init(yearSelect, { - classes: 'select-year', - dropdownOptions: { container: document.body, constrainWidth: false } - }); - select_1.FormSelect.init(monthSelect, { - classes: 'select-month', - dropdownOptions: { container: document.body, constrainWidth: false } - }); - // Add change handlers for select - yearSelect.addEventListener('change', () => this._handleYearChange); - monthSelect.addEventListener('change', () => this._handleMonthChange); - if (typeof this.options.onDraw === 'function') { - this.options.onDraw.call(this); - } - } - _setupEventHandlers() { - this.el.addEventListener('click', this._handleInputClick); - this.el.addEventListener('keydown', this._handleInputKeydown); - this.el.addEventListener('change', this._handleInputChange); - this.calendarEl.addEventListener('click', this._handleCalendarClick); - this.doneBtn.addEventListener('click', this._finishSelection); - this.cancelBtn.addEventListener('click', this.close); - if (this.options.showClearBtn) { - this.clearBtn.addEventListener('click', this._handleClearClick); - } - } - _setupVariables() { - const template = document.createElement('template'); - template.innerHTML = Datepicker._template.trim(); - this.modalEl = template.content.firstChild; - this.calendarEl = this.modalEl.querySelector('.datepicker-calendar'); - this.yearTextEl = this.modalEl.querySelector('.year-text'); - this.dateTextEl = this.modalEl.querySelector('.date-text'); - if (this.options.showClearBtn) { - this.clearBtn = this.modalEl.querySelector('.datepicker-clear'); - } - this.doneBtn = this.modalEl.querySelector('.datepicker-done'); - this.cancelBtn = this.modalEl.querySelector('.datepicker-cancel'); - this.formats = { - d: () => { - return this.date.getDate(); - }, - dd: () => { - let d = this.date.getDate(); - return (d < 10 ? '0' : '') + d; - }, - ddd: () => { - return this.options.i18n.weekdaysShort[this.date.getDay()]; - }, - dddd: () => { - return this.options.i18n.weekdays[this.date.getDay()]; - }, - m: () => { - return this.date.getMonth() + 1; - }, - mm: () => { - let m = this.date.getMonth() + 1; - return (m < 10 ? '0' : '') + m; - }, - mmm: () => { - return this.options.i18n.monthsShort[this.date.getMonth()]; - }, - mmmm: () => { - return this.options.i18n.months[this.date.getMonth()]; - }, - yy: () => { - return ('' + this.date.getFullYear()).slice(2); - }, - yyyy: () => { - return this.date.getFullYear(); - } - }; - } - _removeEventHandlers() { - this.el.removeEventListener('click', this._handleInputClick); - this.el.removeEventListener('keydown', this._handleInputKeydown); - this.el.removeEventListener('change', this._handleInputChange); - this.calendarEl.removeEventListener('click', this._handleCalendarClick); - } - // change view to a specific month (zero-index, e.g. 0: January) - gotoMonth(month) { - if (!isNaN(month)) { - this.calendars[0].month = parseInt(month, 10); - this.adjustCalendars(); - } - } - // change view to a specific full year (e.g. "2012") - gotoYear(year) { - if (!isNaN(year)) { - this.calendars[0].year = parseInt(year, 10); - this.adjustCalendars(); - } - } - renderDayName(opts, day, abbr = false) { - day += opts.firstDay; - while (day >= 7) { - day -= 7; - } - return abbr ? opts.i18n.weekdaysAbbrev[day] : opts.i18n.weekdays[day]; - } -} -exports.Datepicker = Datepicker; -(() => { - Datepicker._template = ` - `; -})(); - - -/***/ }), - -/***/ 123: -/***/ (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.Dropdown = void 0; -const animejs_1 = __importDefault(__webpack_require__(30)); -const utils_1 = __webpack_require__(593); -const component_1 = __webpack_require__(999); -; -const _defaults = { - alignment: 'left', - autoFocus: true, - constrainWidth: true, - container: null, - coverTrigger: true, - closeOnClick: true, - hover: false, - inDuration: 150, - outDuration: 250, - onOpenStart: null, - onOpenEnd: null, - onCloseStart: null, - onCloseEnd: null, - onItemClick: null -}; -class Dropdown extends component_1.Component { - constructor(el, options) { - super(el, options, Dropdown); - this._handleClick = (e) => { - e.preventDefault(); - this.open(); - }; - this._handleMouseEnter = () => { - this.open(); - }; - this._handleMouseLeave = (e) => { - const toEl = e.relatedTarget; - const leaveToDropdownContent = !!toEl.closest('.dropdown-content'); - let leaveToActiveDropdownTrigger = false; - const closestTrigger = toEl.closest('.dropdown-trigger'); - if (closestTrigger && - !!closestTrigger.M_Dropdown && - closestTrigger.M_Dropdown.isOpen) { - leaveToActiveDropdownTrigger = true; - } - // Close hover dropdown if mouse did not leave to either active dropdown-trigger or dropdown-content - if (!leaveToActiveDropdownTrigger && !leaveToDropdownContent) { - this.close(); - } - }; - this._handleDocumentClick = (e) => { - const target = e.target; - if (this.options.closeOnClick && - target.closest('.dropdown-content') && - !this.isTouchMoving) { - // isTouchMoving to check if scrolling on mobile. - //setTimeout(() => { - this.close(); - //}, 0); - } - else if (target.closest('.dropdown-trigger') || - !target.closest('.dropdown-content')) { - //setTimeout(() => { - this.close(); - //}, 0); - } - this.isTouchMoving = false; - }; - this._handleTriggerKeydown = (e) => { - // ARROW DOWN OR ENTER WHEN SELECT IS CLOSED - open Dropdown - const arrowDownOrEnter = utils_1.Utils.keys.ARROW_DOWN.includes(e.key) || utils_1.Utils.keys.ENTER.includes(e.key); - if (arrowDownOrEnter && !this.isOpen) { - e.preventDefault(); - this.open(); - } - }; - this._handleDocumentTouchmove = (e) => { - const target = e.target; - if (target.closest('.dropdown-content')) { - this.isTouchMoving = true; - } - }; - this._handleDropdownClick = (e) => { - // onItemClick callback - if (typeof this.options.onItemClick === 'function') { - const itemEl = e.target.closest('li'); - this.options.onItemClick.call(this, itemEl); - } - }; - this._handleDropdownKeydown = (e) => { - const arrowUpOrDown = utils_1.Utils.keys.ARROW_DOWN.includes(e.key) || utils_1.Utils.keys.ARROW_UP.includes(e.key); - if (utils_1.Utils.keys.TAB.includes(e.key)) { - e.preventDefault(); - this.close(); - } - // Navigate down dropdown list - else if (arrowUpOrDown && this.isOpen) { - e.preventDefault(); - const direction = utils_1.Utils.keys.ARROW_DOWN.includes(e.key) ? 1 : -1; - let newFocusedIndex = this.focusedIndex; - let hasFoundNewIndex = false; - do { - newFocusedIndex = newFocusedIndex + direction; - if (!!this.dropdownEl.children[newFocusedIndex] && - this.dropdownEl.children[newFocusedIndex].tabIndex !== -1) { - hasFoundNewIndex = true; - break; - } - } while (newFocusedIndex < this.dropdownEl.children.length && newFocusedIndex >= 0); - if (hasFoundNewIndex) { - // Remove active class from old element - if (this.focusedIndex >= 0) - this.dropdownEl.children[this.focusedIndex].classList.remove('active'); - this.focusedIndex = newFocusedIndex; - this._focusFocusedItem(); - } - } - // ENTER selects choice on focused item - else if (utils_1.Utils.keys.ENTER.includes(e.key) && this.isOpen) { - // Search for and `; - arrLi.push(li); - ul.append(li); - }); - this.el.append(ul); - this._indicators = arrLi; - } - } - _removeIndicators() { - this.el.querySelector('ul.indicators').remove(); //find('ul.indicators').remove(); - } - set(index) { - // Wrap around indices. - if (index >= this._slides.length) - index = 0; - else if (index < 0) - index = this._slides.length - 1; - // Only do if index changes - if (this.activeIndex === index) - return; - this._activeSlide = this._slides[this.activeIndex]; - const _caption = this._activeSlide.querySelector('.caption'); - this._activeSlide.classList.remove('active'); - // Enables every slide - this._slides.forEach(slide => slide.style.visibility = 'visible'); - //--- Hide active Slide + Caption - // TODO: What does this do? - (0, animejs_1.default)({ - targets: this._activeSlide, - opacity: 0, - duration: this.options.duration, - easing: 'easeOutQuad', - complete: () => { - this._slides.forEach(el => { - if (el.classList.contains('active')) - return; - (0, animejs_1.default)({ - targets: el, - opacity: 0, - translateX: 0, - translateY: 0, - duration: 0, - easing: 'easeOutQuad' - }); - // Disables invisible slides (for assistive technologies) - el.style.visibility = 'hidden'; - }); - } - }); - // Hide active Caption - //this._animateCaptionIn(_caption, this.options.duration); - _caption.style.opacity = '0'; - // Update indicators - if (this.options.indicators) { - const activeIndicator = this._indicators[this.activeIndex].children[0]; - const nextIndicator = this._indicators[index].children[0]; - activeIndicator.classList.remove('active'); - nextIndicator.classList.add('active'); - if (typeof this.options.indicatorLabelFunc === "function") { - activeIndicator.ariaLabel = this.options.indicatorLabelFunc.call(this, this.activeIndex, false); - nextIndicator.ariaLabel = this.options.indicatorLabelFunc.call(this, index, true); - } - } - //--- Show new Slide + Caption - this._animateSlide(this._slides[index], true); - this._slides[index].classList.add('active'); - // TODO: Why focus? => causes uncontrollable page scroll - /* - if (this._focusCurrent) { - this._slides[index].focus(); - this._focusCurrent = false; - } - */ - this.activeIndex = index; - // Reset interval, if allowed. This check prevents autostart - // when slider is paused, since it can be changed though indicators. - if (this.interval != null) { - this.start(); - } - } - _pause(fromEvent) { - clearInterval(this.interval); - this.eventPause = fromEvent; - this.interval = null; - } -} -exports.Slider = Slider; - - -/***/ }), - -/***/ 649: -/***/ (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.Tabs = void 0; -const animejs_1 = __importDefault(__webpack_require__(30)); -const carousel_1 = __webpack_require__(476); -const component_1 = __webpack_require__(999); -; -let _defaults = { - duration: 300, - onShow: null, - swipeable: false, - responsiveThreshold: Infinity // breakpoint for swipeable -}; -class Tabs extends component_1.Component { - constructor(el, options) { - super(el, options, Tabs); - this._handleWindowResize = () => { - this._setTabsAndTabWidth(); - if (this._tabWidth !== 0 && this._tabsWidth !== 0) { - this._indicator.style.left = this._calcLeftPos(this._activeTabLink) + 'px'; - this._indicator.style.right = this._calcRightPos(this._activeTabLink) + 'px'; - } - }; - this._handleTabClick = (e) => { - const tabLink = e.target; - const tab = tabLink.parentElement; - // Handle click on tab link only - if (!tabLink || !tab.classList.contains('tab')) - return; - // is disabled? - if (tab.classList.contains('disabled')) { - e.preventDefault(); - return; - } - // Act as regular link if target attribute is specified. - if (tabLink.hasAttribute('target')) - return; - // Make the old tab inactive. - this._activeTabLink.classList.remove('active'); - const _oldContent = this._content; - // Update the variables with the new link and content - this._activeTabLink = tabLink; - if (tabLink.hash) - this._content = document.querySelector(tabLink.hash); - this._tabLinks = this.el.querySelectorAll('li.tab > a'); - // Make the tab active - this._activeTabLink.classList.add('active'); - const prevIndex = this._index; - this._index = Math.max(Array.from(this._tabLinks).indexOf(tabLink), 0); - // Swap content - if (this.options.swipeable) { - if (this._tabsCarousel) { - this._tabsCarousel.set(this._index, () => { - if (typeof this.options.onShow === 'function') - this.options.onShow.call(this, this._content); - }); - } - } - else { - if (this._content) { - this._content.style.display = 'block'; - this._content.classList.add('active'); - if (typeof this.options.onShow === 'function') - this.options.onShow.call(this, this._content); - if (_oldContent && _oldContent !== this._content) { - _oldContent.style.display = 'none'; - _oldContent.classList.remove('active'); - } - } - } - // Update widths after content is swapped (scrollbar bugfix) - this._setTabsAndTabWidth(); - this._animateIndicator(prevIndex); - e.preventDefault(); - }; - this.el.M_Tabs = this; - this.options = Object.assign(Object.assign({}, Tabs.defaults), options); - this._tabLinks = this.el.querySelectorAll('li.tab > a'); - this._index = 0; - this._setupActiveTabLink(); - if (this.options.swipeable) { - this._setupSwipeableTabs(); - } - else { - this._setupNormalTabs(); - } - // Setup tabs indicator after content to ensure accurate widths - this._setTabsAndTabWidth(); - this._createIndicator(); - this._setupEventHandlers(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Tabs. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Tabs); - } - static getInstance(el) { - return el.M_Tabs; - } - destroy() { - this._removeEventHandlers(); - this._indicator.parentNode.removeChild(this._indicator); - if (this.options.swipeable) { - this._teardownSwipeableTabs(); - } - else { - this._teardownNormalTabs(); - } - this.el.M_Tabs = undefined; - } - /** - * The index of tab that is currently shown. - */ - get index() { return this._index; } - _setupEventHandlers() { - window.addEventListener('resize', this._handleWindowResize); - this.el.addEventListener('click', this._handleTabClick); - } - _removeEventHandlers() { - window.removeEventListener('resize', this._handleWindowResize); - this.el.removeEventListener('click', this._handleTabClick); - } - _createIndicator() { - const indicator = document.createElement('li'); - indicator.classList.add('indicator'); - this.el.appendChild(indicator); - this._indicator = indicator; - this._indicator.style.left = this._calcLeftPos(this._activeTabLink) + 'px'; - this._indicator.style.right = this._calcRightPos(this._activeTabLink) + 'px'; - } - _setupActiveTabLink() { - // If the location.hash matches one of the links, use that as the active tab. - this._activeTabLink = Array.from(this._tabLinks).find((a) => a.getAttribute('href') === location.hash); - // If no match is found, use the first link or any with class 'active' as the initial active tab. - if (!this._activeTabLink) { - this._activeTabLink = this.el.querySelector('li.tab a.active'); - } - if (this._activeTabLink.length === 0) { - this._activeTabLink = this.el.querySelector('li.tab a'); - } - Array.from(this._tabLinks).forEach((a) => a.classList.remove('active')); - this._activeTabLink.classList.add('active'); - this._index = Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink), 0); - if (this._activeTabLink && this._activeTabLink.hash) { - this._content = document.querySelector(this._activeTabLink.hash); - this._content.classList.add('active'); - } - } - _setupSwipeableTabs() { - // Change swipeable according to responsive threshold - if (window.innerWidth > this.options.responsiveThreshold) - this.options.swipeable = false; - const tabsContent = []; - this._tabLinks.forEach(a => { - if (a.hash) { - const currContent = document.querySelector(a.hash); - currContent.classList.add('carousel-item'); - tabsContent.push(currContent); - } - }); - // Create Carousel-Wrapper around Tab-Contents - const tabsWrapper = document.createElement('div'); - tabsWrapper.classList.add('tabs-content', 'carousel', 'carousel-slider'); - // Wrap around - tabsContent[0].parentElement.insertBefore(tabsWrapper, tabsContent[0]); - tabsContent.forEach(tabContent => { - tabsWrapper.appendChild(tabContent); - tabContent.style.display = ''; - }); - // Keep active tab index to set initial carousel slide - const tab = this._activeTabLink.parentElement; - const activeTabIndex = Array.from(tab.parentNode.children).indexOf(tab); - this._tabsCarousel = carousel_1.Carousel.init(tabsWrapper, { - fullWidth: true, - noWrap: true, - onCycleTo: (item) => { - const prevIndex = this._index; - this._index = Array.from(item.parentNode.children).indexOf(item); - this._activeTabLink.classList.remove('active'); - this._activeTabLink = Array.from(this._tabLinks)[this._index]; - this._activeTabLink.classList.add('active'); - this._animateIndicator(prevIndex); - if (typeof this.options.onShow === 'function') - this.options.onShow.call(this, this._content); - } - }); - // Set initial carousel slide to active tab - this._tabsCarousel.set(activeTabIndex); - } - _teardownSwipeableTabs() { - const tabsWrapper = this._tabsCarousel.el; - this._tabsCarousel.destroy(); - // Unwrap - tabsWrapper.after(tabsWrapper.children); - tabsWrapper.remove(); - } - _setupNormalTabs() { - // Hide Tabs Content - Array.from(this._tabLinks).forEach((a) => { - if (a === this._activeTabLink) - return; - if (a.hash) { - const currContent = document.querySelector(a.hash); - if (currContent) - currContent.style.display = 'none'; - } - }); - } - _teardownNormalTabs() { - // show Tabs Content - this._tabLinks.forEach((a) => { - if (a.hash) { - const currContent = document.querySelector(a.hash); - if (currContent) - currContent.style.display = ''; - } - }); - } - _setTabsAndTabWidth() { - this._tabsWidth = this.el.getBoundingClientRect().width; - this._tabWidth = Math.max(this._tabsWidth, this.el.scrollWidth) / this._tabLinks.length; - } - _calcRightPos(el) { - return Math.ceil(this._tabsWidth - el.offsetLeft - el.getBoundingClientRect().width); - } - _calcLeftPos(el) { - return Math.floor(el.offsetLeft); - } - /** - * Recalculate tab indicator position. This is useful when - * the indicator position is not correct. - */ - updateTabIndicator() { - this._setTabsAndTabWidth(); - this._animateIndicator(this._index); - } - _animateIndicator(prevIndex) { - let leftDelay = 0, rightDelay = 0; - if (this._index - prevIndex >= 0) - leftDelay = 90; - else - rightDelay = 90; - const animOptions = { - targets: this._indicator, - left: { - value: this._calcLeftPos(this._activeTabLink), - delay: leftDelay - }, - right: { - value: this._calcRightPos(this._activeTabLink), - delay: rightDelay - }, - duration: this.options.duration, - easing: 'easeOutQuad' - }; - animejs_1.default.remove(this._indicator); - (0, animejs_1.default)(animOptions); - } - /** - * Show tab content that corresponds to the tab with the id. - * @param tabId The id of the tab that you want to switch to. - */ - select(tabId) { - const tab = Array.from(this._tabLinks).find((a) => a.getAttribute('href') === '#' + tabId); - if (tab) - tab.click(); - } -} -exports.Tabs = Tabs; - - -/***/ }), - -/***/ 968: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TapTarget = void 0; -const utils_1 = __webpack_require__(593); -const component_1 = __webpack_require__(999); -; -let _defaults = { - onOpen: null, - onClose: null -}; -class TapTarget extends component_1.Component { - constructor(el, options) { - super(el, options, TapTarget); - this._handleThrottledResize = utils_1.Utils.throttle(function () { this._handleResize(); }, 200).bind(this); - this._handleTargetClick = () => { - this.open(); - }; - this._handleOriginClick = () => { - this.close(); - }; - this._handleResize = () => { - this._calculatePositioning(); - }; - this._handleDocumentClick = (e) => { - if (!e.target.closest('.tap-target-wrapper')) { - this.close(); - e.preventDefault(); - e.stopPropagation(); - } - }; - /** - * Open Tap Target. - */ - this.open = () => { - if (this.isOpen) - return; - // onOpen callback - if (typeof this.options.onOpen === 'function') { - this.options.onOpen.call(this, this._origin); - } - this.isOpen = true; - this.wrapper.classList.add('open'); - document.body.addEventListener('click', this._handleDocumentClick, true); - document.body.addEventListener('touchend', this._handleDocumentClick); - }; - /** - * Close Tap Target. - */ - this.close = () => { - if (!this.isOpen) - return; - // onClose callback - if (typeof this.options.onClose === 'function') { - this.options.onClose.call(this, this._origin); - } - this.isOpen = false; - this.wrapper.classList.remove('open'); - document.body.removeEventListener('click', this._handleDocumentClick, true); - document.body.removeEventListener('touchend', this._handleDocumentClick); - }; - this.el.M_TapTarget = this; - this.options = Object.assign(Object.assign({}, TapTarget.defaults), options); - this.isOpen = false; - // setup - this._origin = document.querySelector(`#${el.dataset.target}`); - this._setup(); - this._calculatePositioning(); - this._setupEventHandlers(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of TapTarget. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, TapTarget); - } - static getInstance(el) { - return el.M_TapTarget; - } - destroy() { - this._removeEventHandlers(); - this.el.TapTarget = undefined; - } - _setupEventHandlers() { - this.el.addEventListener('click', this._handleTargetClick); - this.originEl.addEventListener('click', this._handleOriginClick); - // Resize - window.addEventListener('resize', this._handleThrottledResize); - } - _removeEventHandlers() { - this.el.removeEventListener('click', this._handleTargetClick); - this.originEl.removeEventListener('click', this._handleOriginClick); - window.removeEventListener('resize', this._handleThrottledResize); - } - _setup() { - // Creating tap target - this.wrapper = this.el.parentElement; - this.waveEl = this.wrapper.querySelector('.tap-target-wave'); - this.originEl = this.wrapper.querySelector('.tap-target-origin'); - this.contentEl = this.el.querySelector('.tap-target-content'); - // Creating wrapper - if (!this.wrapper.classList.contains('.tap-target-wrapper')) { - this.wrapper = document.createElement('div'); - this.wrapper.classList.add('tap-target-wrapper'); - this.el.before(this.wrapper); - this.wrapper.append(this.el); - } - // Creating content - if (!this.contentEl) { - this.contentEl = document.createElement('div'); - this.contentEl.classList.add('tap-target-content'); - this.el.append(this.contentEl); - } - // Creating foreground wave - if (!this.waveEl) { - this.waveEl = document.createElement('div'); - this.waveEl.classList.add('tap-target-wave'); - // Creating origin - if (!this.originEl) { - this.originEl = this._origin.cloneNode(true); // .clone(true, true); - this.originEl.classList.add('tap-target-origin'); - this.originEl.removeAttribute('id'); - this.originEl.removeAttribute('style'); - this.waveEl.append(this.originEl); - } - this.wrapper.append(this.waveEl); - } - } - _offset(el) { - const box = el.getBoundingClientRect(); - const docElem = document.documentElement; - return { - top: box.top + window.pageYOffset - docElem.clientTop, - left: box.left + window.pageXOffset - docElem.clientLeft - }; - } - _calculatePositioning() { - // Element or parent is fixed position? - let isFixed = getComputedStyle(this._origin).position === 'fixed'; - if (!isFixed) { - let currentElem = this._origin; - const parents = []; - while ((currentElem = currentElem.parentNode) && currentElem !== document) - parents.push(currentElem); - for (let i = 0; i < parents.length; i++) { - isFixed = getComputedStyle(parents[i]).position === 'fixed'; - if (isFixed) - break; - } - } - // Calculating origin - const originWidth = this._origin.offsetWidth; - const originHeight = this._origin.offsetHeight; - const originTop = isFixed ? this._offset(this._origin).top - utils_1.Utils.getDocumentScrollTop() : this._offset(this._origin).top; - const originLeft = isFixed ? this._offset(this._origin).left - utils_1.Utils.getDocumentScrollLeft() : this._offset(this._origin).left; - // Calculating screen - const windowWidth = window.innerWidth; - const windowHeight = window.innerHeight; - const scrollBarWidth = windowWidth - document.documentElement.clientWidth; - const centerX = windowWidth / 2; - const centerY = windowHeight / 2; - const isLeft = originLeft <= centerX; - const isRight = originLeft > centerX; - const isTop = originTop <= centerY; - const isBottom = originTop > centerY; - const isCenterX = originLeft >= windowWidth * 0.25 && originLeft <= windowWidth * 0.75; - // Calculating tap target - const tapTargetWidth = this.el.offsetWidth; - const tapTargetHeight = this.el.offsetHeight; - const tapTargetTop = originTop + originHeight / 2 - tapTargetHeight / 2; - const tapTargetLeft = originLeft + originWidth / 2 - tapTargetWidth / 2; - const tapTargetPosition = isFixed ? 'fixed' : 'absolute'; - // Calculating content - const tapTargetTextWidth = isCenterX ? tapTargetWidth : tapTargetWidth / 2 + originWidth; - const tapTargetTextHeight = tapTargetHeight / 2; - const tapTargetTextTop = isTop ? tapTargetHeight / 2 : 0; - const tapTargetTextBottom = 0; - const tapTargetTextLeft = isLeft && !isCenterX ? tapTargetWidth / 2 - originWidth : 0; - const tapTargetTextRight = 0; - const tapTargetTextPadding = originWidth; - const tapTargetTextAlign = isBottom ? 'bottom' : 'top'; - // Calculating wave - const tapTargetWaveWidth = originWidth > originHeight ? originWidth * 2 : originWidth * 2; - const tapTargetWaveHeight = tapTargetWaveWidth; - const tapTargetWaveTop = tapTargetHeight / 2 - tapTargetWaveHeight / 2; - const tapTargetWaveLeft = tapTargetWidth / 2 - tapTargetWaveWidth / 2; - // Setting tap target - this.wrapper.style.top = isTop ? tapTargetTop + 'px' : ''; - this.wrapper.style.right = isRight ? windowWidth - tapTargetLeft - tapTargetWidth - scrollBarWidth + 'px' : ''; - this.wrapper.style.bottom = isBottom ? windowHeight - tapTargetTop - tapTargetHeight + 'px' : ''; - this.wrapper.style.left = isLeft ? tapTargetLeft + 'px' : ''; - this.wrapper.style.position = tapTargetPosition; - // Setting content - this.contentEl.style.width = tapTargetTextWidth + 'px'; - this.contentEl.style.height = tapTargetTextHeight + 'px'; - this.contentEl.style.top = tapTargetTextTop + 'px'; - this.contentEl.style.right = tapTargetTextRight + 'px'; - this.contentEl.style.bottom = tapTargetTextBottom + 'px'; - this.contentEl.style.left = tapTargetTextLeft + 'px'; - this.contentEl.style.padding = tapTargetTextPadding + 'px'; - this.contentEl.style.verticalAlign = tapTargetTextAlign; - // Setting wave - this.waveEl.style.top = tapTargetWaveTop + 'px'; - this.waveEl.style.left = tapTargetWaveLeft + 'px'; - this.waveEl.style.width = tapTargetWaveWidth + 'px'; - this.waveEl.style.height = tapTargetWaveHeight + 'px'; - } -} -exports.TapTarget = TapTarget; - - -/***/ }), - -/***/ 707: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Timepicker = void 0; -const modal_1 = __webpack_require__(799); -const utils_1 = __webpack_require__(593); -const component_1 = __webpack_require__(999); -let _defaults = { - dialRadius: 135, - outerRadius: 105, - innerRadius: 70, - tickRadius: 20, - duration: 350, - container: null, - defaultTime: 'now', - fromNow: 0, - showClearBtn: false, - // internationalization - i18n: { - cancel: 'Cancel', - clear: 'Clear', - done: 'Ok' - }, - autoClose: false, - twelveHour: true, - vibrate: true, - // Callbacks - onOpenStart: null, - onOpenEnd: null, - onCloseStart: null, - onCloseEnd: null, - onSelect: null -}; -class Timepicker extends component_1.Component { - constructor(el, options) { - super(el, options, Timepicker); - this._handleInputClick = () => { - this.open(); - }; - this._handleInputKeydown = (e) => { - if (utils_1.Utils.keys.ENTER.includes(e.key)) { - e.preventDefault(); - this.open(); - } - }; - this._handleTimeInputEnterKey = (e) => { - if (utils_1.Utils.keys.ENTER.includes(e.key)) { - e.preventDefault(); - this._inputFromTextField(); - } - }; - this._handleClockClickStart = (e) => { - e.preventDefault(); - let clockPlateBR = this.plate.getBoundingClientRect(); - let offset = { x: clockPlateBR.left, y: clockPlateBR.top }; - this.x0 = offset.x + this.options.dialRadius; - this.y0 = offset.y + this.options.dialRadius; - this.moved = false; - let clickPos = Timepicker._Pos(e); - this.dx = clickPos.x - this.x0; - this.dy = clickPos.y - this.y0; - // Set clock hands - this.setHand(this.dx, this.dy, false); - // Mousemove on document - document.addEventListener('mousemove', this._handleDocumentClickMove); - document.addEventListener('touchmove', this._handleDocumentClickMove); - // Mouseup on document - document.addEventListener('mouseup', this._handleDocumentClickEnd); - document.addEventListener('touchend', this._handleDocumentClickEnd); - }; - this._handleDocumentClickMove = (e) => { - e.preventDefault(); - let clickPos = Timepicker._Pos(e); - let x = clickPos.x - this.x0; - let y = clickPos.y - this.y0; - this.moved = true; - this.setHand(x, y, false); - }; - this._handleDocumentClickEnd = (e) => { - e.preventDefault(); - document.removeEventListener('mouseup', this._handleDocumentClickEnd); - document.removeEventListener('touchend', this._handleDocumentClickEnd); - let clickPos = Timepicker._Pos(e); - let x = clickPos.x - this.x0; - let y = clickPos.y - this.y0; - if (this.moved && x === this.dx && y === this.dy) { - this.setHand(x, y); - } - if (this.currentView === 'hours') { - this.showView('minutes', this.options.duration / 2); - } - else if (this.options.autoClose) { - this.minutesView.classList.add('timepicker-dial-out'); - setTimeout(() => { - this.done(); - }, this.options.duration / 2); - } - if (typeof this.options.onSelect === 'function') { - this.options.onSelect.call(this, this.hours, this.minutes); - } - // Unbind mousemove event - document.removeEventListener('mousemove', this._handleDocumentClickMove); - document.removeEventListener('touchmove', this._handleDocumentClickMove); - }; - this._handleAmPmClick = (e) => { - const btnClicked = e.target; - this.amOrPm = btnClicked.classList.contains('am-btn') ? 'AM' : 'PM'; - this._updateAmPmView(); - }; - /** - * Show hours or minutes view on timepicker. - * @param view The name of the view you want to switch to, 'hours' or 'minutes'. - */ - this.showView = (view, delay = null) => { - if (view === 'minutes' && getComputedStyle(this.hoursView).visibility === 'visible') { - // raiseCallback(this.options.beforeHourSelect); - } - let isHours = view === 'hours', nextView = isHours ? this.hoursView : this.minutesView, hideView = isHours ? this.minutesView : this.hoursView; - this.currentView = view; - if (isHours) { - this.inputHours.classList.add('text-primary'); - this.inputMinutes.classList.remove('text-primary'); - } - else { - this.inputHours.classList.remove('text-primary'); - this.inputMinutes.classList.add('text-primary'); - } - // Transition view - hideView.classList.add('timepicker-dial-out'); - nextView.style.visibility = 'visible'; - nextView.classList.remove('timepicker-dial-out'); - // Reset clock hand - this.resetClock(delay); - // After transitions ended - clearTimeout(this.toggleViewTimer); - this.toggleViewTimer = setTimeout(() => { - hideView.style.visibility = 'hidden'; - }, this.options.duration); - }; - this._inputFromTextField = () => { - const isHours = this.currentView === 'hours'; - if (isHours) { - const value = parseInt(this.inputHours.value); - if (value > 0 && value < 13) { - this.drawClockFromTimeInput(value, isHours); - this.showView('minutes', this.options.duration / 2); - this.hours = value; - this.inputMinutes.focus(); - } - else { - const hour = new Date().getHours(); - this.inputHours.value = (hour % 12).toString(); - } - } - else { - const value = parseInt(this.inputMinutes.value); - if (value >= 0 && value < 60) { - this.inputMinutes.value = Timepicker._addLeadingZero(value); - this.drawClockFromTimeInput(value, isHours); - this.minutes = value; - this.modalEl.querySelector('.confirmation-btns :nth-child(2)').focus(); - } - else { - const minutes = new Date().getMinutes(); - this.inputMinutes.value = Timepicker._addLeadingZero(minutes); - } - } - }; - /** - * Open timepicker. - */ - this.open = () => { - if (this.isOpen) - return; - this.isOpen = true; - this._updateTimeFromInput(); - this.showView('hours'); - this.modal.open(undefined); - }; - /** - * Close timepicker. - */ - this.close = () => { - if (!this.isOpen) - return; - this.isOpen = false; - this.modal.close(); - }; - this.done = (e = null, clearValue = null) => { - // Set input value - let last = this.el.value; - let value = clearValue - ? '' - : Timepicker._addLeadingZero(this.hours) + ':' + Timepicker._addLeadingZero(this.minutes); - this.time = value; - if (!clearValue && this.options.twelveHour) { - value = `${value} ${this.amOrPm}`; - } - this.el.value = value; - // Trigger change event - if (value !== last) { - this.el.dispatchEvent(new Event('change')); - } - this.close(); - this.el.focus(); - }; - this.clear = () => { - this.done(null, true); - }; - this.el.M_Timepicker = this; - this.options = Object.assign(Object.assign({}, Timepicker.defaults), options); - this.id = utils_1.Utils.guid(); - this._insertHTMLIntoDOM(); - this._setupModal(); - this._setupVariables(); - this._setupEventHandlers(); - this._clockSetup(); - this._pickerSetup(); - } - static get defaults() { - return _defaults; - } - /** - * Initializes instances of Timepicker. - * @param els HTML elements. - * @param options Component options. - */ - static init(els, options = {}) { - return super.init(els, options, Timepicker); - } - static _addLeadingZero(num) { - return (num < 10 ? '0' : '') + num; - } - static _createSVGEl(name) { - let svgNS = 'http://www.w3.org/2000/svg'; - return document.createElementNS(svgNS, name); - } - static _Pos(e) { - if (e.type.startsWith("touch") && e.targetTouches.length >= 1) { - return { x: e.targetTouches[0].clientX, y: e.targetTouches[0].clientY }; - } - // mouse event - return { x: e.clientX, y: e.clientY }; - } - static getInstance(el) { - return el.M_Timepicker; - } - destroy() { - this._removeEventHandlers(); - this.modal.destroy(); - this.modalEl.remove(); - this.el.M_Timepicker = undefined; - } - _setupEventHandlers() { - this.el.addEventListener('click', this._handleInputClick); - this.el.addEventListener('keydown', this._handleInputKeydown); - this.plate.addEventListener('mousedown', this._handleClockClickStart); - this.plate.addEventListener('touchstart', this._handleClockClickStart); - this.digitalClock.addEventListener('keyup', this._inputFromTextField); - this.inputHours.addEventListener('click', () => this.showView('hours')); - this.inputMinutes.addEventListener('click', () => this.showView('minutes')); - } - _removeEventHandlers() { - this.el.removeEventListener('click', this._handleInputClick); - this.el.removeEventListener('keydown', this._handleInputKeydown); - } - _insertHTMLIntoDOM() { - const template = document.createElement('template'); - template.innerHTML = Timepicker._template.trim(); - this.modalEl = template.content.firstChild; - this.modalEl.id = 'modal-' + this.id; - // Append popover to input by default - const optEl = this.options.container; - const containerEl = optEl instanceof HTMLElement ? optEl : document.querySelector(optEl); - if (this.options.container && !!containerEl) { - containerEl.append(this.modalEl); - } - else { - this.el.parentElement.appendChild(this.modalEl); - } - } - _setupModal() { - this.modal = modal_1.Modal.init(this.modalEl, { - onOpenStart: this.options.onOpenStart, - onOpenEnd: this.options.onOpenEnd, - onCloseStart: this.options.onCloseStart, - onCloseEnd: () => { - if (typeof this.options.onCloseEnd === 'function') { - this.options.onCloseEnd.call(this); - } - this.isOpen = false; - } - }); - } - _setupVariables() { - this.currentView = 'hours'; - this.vibrate = navigator.vibrate - ? 'vibrate' - : navigator.webkitVibrate - ? 'webkitVibrate' - : null; - this._canvas = this.modalEl.querySelector('.timepicker-canvas'); - this.plate = this.modalEl.querySelector('.timepicker-plate'); - this.digitalClock = this.modalEl.querySelector('.timepicker-display-column'); - this.hoursView = this.modalEl.querySelector('.timepicker-hours'); - this.minutesView = this.modalEl.querySelector('.timepicker-minutes'); - this.inputHours = this.modalEl.querySelector('.timepicker-input-hours'); - this.inputMinutes = this.modalEl.querySelector('.timepicker-input-minutes'); - this.spanAmPm = this.modalEl.querySelector('.timepicker-span-am-pm'); - this.footer = this.modalEl.querySelector('.timepicker-footer'); - this.amOrPm = 'PM'; - } - _createButton(text, visibility) { - const button = document.createElement('button'); - button.classList.add('btn-flat', 'waves-effect'); - button.style.visibility = visibility; - button.type = 'button'; - button.tabIndex = this.options.twelveHour ? 3 : 1; - button.innerText = text; - return button; - } - _pickerSetup() { - const clearButton = this._createButton(this.options.i18n.clear, this.options.showClearBtn ? '' : 'hidden'); - clearButton.classList.add('timepicker-clear'); - clearButton.addEventListener('click', this.clear); - this.footer.appendChild(clearButton); - const confirmationBtnsContainer = document.createElement('div'); - confirmationBtnsContainer.classList.add('confirmation-btns'); - this.footer.append(confirmationBtnsContainer); - const cancelButton = this._createButton(this.options.i18n.cancel, ''); - cancelButton.classList.add('timepicker-close'); - cancelButton.addEventListener('click', this.close); - confirmationBtnsContainer.appendChild(cancelButton); - const doneButton = this._createButton(this.options.i18n.done, ''); - doneButton.classList.add('timepicker-close'); - doneButton.addEventListener('click', this.done); - confirmationBtnsContainer.appendChild(doneButton); - } - _clockSetup() { - if (this.options.twelveHour) { - // AM Button - this._amBtn = document.createElement('div'); - this._amBtn.classList.add('am-btn'); - this._amBtn.innerText = 'AM'; - this._amBtn.addEventListener('click', this._handleAmPmClick); - this.spanAmPm.appendChild(this._amBtn); - // PM Button - this._pmBtn = document.createElement('div'); - this._pmBtn.classList.add('pm-btn'); - this._pmBtn.innerText = 'PM'; - this._pmBtn.addEventListener('click', this._handleAmPmClick); - this.spanAmPm.appendChild(this._pmBtn); - } - this._buildHoursView(); - this._buildMinutesView(); - this._buildSVGClock(); - } - _buildSVGClock() { - // Draw clock hands and others - let dialRadius = this.options.dialRadius; - let tickRadius = this.options.tickRadius; - let diameter = dialRadius * 2; - let svg = Timepicker._createSVGEl('svg'); - svg.setAttribute('class', 'timepicker-svg'); - svg.setAttribute('width', diameter.toString()); - svg.setAttribute('height', diameter.toString()); - let g = Timepicker._createSVGEl('g'); - g.setAttribute('transform', 'translate(' + dialRadius + ',' + dialRadius + ')'); - let bearing = Timepicker._createSVGEl('circle'); - bearing.setAttribute('class', 'timepicker-canvas-bearing'); - bearing.setAttribute('cx', '0'); - bearing.setAttribute('cy', '0'); - bearing.setAttribute('r', '4'); - let hand = Timepicker._createSVGEl('line'); - hand.setAttribute('x1', '0'); - hand.setAttribute('y1', '0'); - let bg = Timepicker._createSVGEl('circle'); - bg.setAttribute('class', 'timepicker-canvas-bg'); - bg.setAttribute('r', tickRadius.toString()); - g.appendChild(hand); - g.appendChild(bg); - g.appendChild(bearing); - svg.appendChild(g); - this._canvas.appendChild(svg); - this.hand = hand; - this.bg = bg; - this.bearing = bearing; - this.g = g; - } - _buildHoursView() { - const $tick = document.createElement('div'); - $tick.classList.add('timepicker-tick'); - // Hours view - if (this.options.twelveHour) { - for (let i = 1; i < 13; i += 1) { - const tick = $tick.cloneNode(true); - const radian = (i / 6) * Math.PI; - const radius = this.options.outerRadius; - tick.style.left = this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + 'px'; - tick.style.top = this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + 'px'; - tick.innerHTML = i === 0 ? '00' : i.toString(); - this.hoursView.appendChild(tick); - // tick.on(mousedownEvent, mousedown); - } - } - else { - for (let i = 0; i < 24; i += 1) { - const tick = $tick.cloneNode(true); - const radian = (i / 6) * Math.PI; - const inner = i > 0 && i < 13; - const radius = inner ? this.options.innerRadius : this.options.outerRadius; - tick.style.left = this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + 'px'; - tick.style.top = this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + 'px'; - tick.innerHTML = i === 0 ? '00' : i.toString(); - this.hoursView.appendChild(tick); - // tick.on(mousedownEvent, mousedown); - } - } - } - _buildMinutesView() { - const _tick = document.createElement('div'); - _tick.classList.add('timepicker-tick'); - // Minutes view - for (let i = 0; i < 60; i += 5) { - const tick = _tick.cloneNode(true); - const radian = (i / 30) * Math.PI; - tick.style.left = - this.options.dialRadius + - Math.sin(radian) * this.options.outerRadius - - this.options.tickRadius + - 'px'; - tick.style.top = - this.options.dialRadius - - Math.cos(radian) * this.options.outerRadius - - this.options.tickRadius + - 'px'; - tick.innerHTML = Timepicker._addLeadingZero(i); - this.minutesView.appendChild(tick); - } - } - _updateAmPmView() { - if (this.options.twelveHour) { - if (this.amOrPm === 'PM') { - this._amBtn.classList.remove('text-primary'); - this._pmBtn.classList.add('text-primary'); - } - else if (this.amOrPm === 'AM') { - this._amBtn.classList.add('text-primary'); - this._pmBtn.classList.remove('text-primary'); - } - } - } - _updateTimeFromInput() { - // Get the time - let value = ((this.el.value || this.options.defaultTime || '') + '').split(':'); - if (this.options.twelveHour && !(typeof value[1] === 'undefined')) { - if (value[1].toUpperCase().indexOf('AM') > 0) { - this.amOrPm = 'AM'; - } - else { - this.amOrPm = 'PM'; - } - value[1] = value[1].replace('AM', '').replace('PM', ''); - } - if (value[0] === 'now') { - let now = new Date(+new Date() + this.options.fromNow); - value = [now.getHours().toString(), now.getMinutes().toString()]; - if (this.options.twelveHour) { - this.amOrPm = parseInt(value[0]) >= 12 && parseInt(value[0]) < 24 ? 'PM' : 'AM'; - } - } - this.hours = +value[0] || 0; - this.minutes = +value[1] || 0; - this.inputHours.value = this.hours; - this.inputMinutes.value = Timepicker._addLeadingZero(this.minutes); - this._updateAmPmView(); - } - resetClock(delay) { - var _a; - let view = this.currentView, value = this[view], isHours = view === 'hours', unit = Math.PI / (isHours ? 6 : 30), radian = value * unit, radius = isHours && value > 0 && value < 13 ? this.options.innerRadius : this.options.outerRadius, x = Math.sin(radian) * radius, y = -Math.cos(radian) * radius, self = this; - if (delay) { - (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.classList.add('timepicker-canvas-out'); - setTimeout(() => { - var _a; - (_a = self.canvas) === null || _a === void 0 ? void 0 : _a.classList.remove('timepicker-canvas-out'); - self.setHand(x, y); - }, delay); - } - else { - this.setHand(x, y); - } - } - drawClockFromTimeInput(value, isHours) { - const unit = Math.PI / (isHours ? 6 : 30); - const radian = value * unit; - let radius; - if (this.options.twelveHour) { - radius = this.options.outerRadius; - } - let cx1 = Math.sin(radian) * (radius - this.options.tickRadius), cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), cx2 = Math.sin(radian) * radius, cy2 = -Math.cos(radian) * radius; - this.hand.setAttribute('x2', cx1.toString()); - this.hand.setAttribute('y2', cy1.toString()); - this.bg.setAttribute('cx', cx2.toString()); - this.bg.setAttribute('cy', cy2.toString()); - } - setHand(x, y, roundBy5 = false) { - let radian = Math.atan2(x, -y), isHours = this.currentView === 'hours', unit = Math.PI / (isHours || roundBy5 ? 6 : 30), z = Math.sqrt(x * x + y * y), inner = isHours && z < (this.options.outerRadius + this.options.innerRadius) / 2, radius = inner ? this.options.innerRadius : this.options.outerRadius; - if (this.options.twelveHour) { - radius = this.options.outerRadius; - } - // Radian should in range [0, 2PI] - if (radian < 0) { - radian = Math.PI * 2 + radian; - } - // Get the round value - let value = Math.round(radian / unit); - // Get the round radian - radian = value * unit; - // Correct the hours or minutes - if (this.options.twelveHour) { - if (isHours) { - if (value === 0) - value = 12; - } - else { - if (roundBy5) - value *= 5; - if (value === 60) - value = 0; - } - } - else { - if (isHours) { - if (value === 12) { - value = 0; - } - value = inner ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12; - } - else { - if (roundBy5) { - value *= 5; - } - if (value === 60) { - value = 0; - } - } - } - // Once hours or minutes changed, vibrate the device - if (this[this.currentView] !== value) { - if (this.vibrate && this.options.vibrate) { - // Do not vibrate too frequently - if (!this.vibrateTimer) { - navigator[this.vibrate](10); - this.vibrateTimer = setTimeout(() => { - this.vibrateTimer = null; - }, 100); - } - } - } - this[this.currentView] = value; - if (isHours) { - this.inputHours.value = value.toString(); - } - else { - this.inputMinutes.value = Timepicker._addLeadingZero(value); - } - // Set clock hand and others' position - let cx1 = Math.sin(radian) * (radius - this.options.tickRadius), cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), cx2 = Math.sin(radian) * radius, cy2 = -Math.cos(radian) * radius; - this.hand.setAttribute('x2', cx1.toString()); - this.hand.setAttribute('y2', cy1.toString()); - this.bg.setAttribute('cx', cx2.toString()); - this.bg.setAttribute('cy', cy2.toString()); - } -} -exports.Timepicker = Timepicker; -(() => { - Timepicker._template = ` - '}_updateSelectedInfo(){const t=this.el.parentElement.querySelector(".status-info");t&&(this.options.isMultiSelect?t.innerHTML=this.selectedValues.length.toString():t.innerHTML="")}_refreshInputText(){if(1===this.selectedValues.length){const t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change")),"function"==typeof this.options.onAutocomplete&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t){this.menuItems=t,this.open(),this._updateSelectedInfo()}setValues(t){this.selectedValues=t,this._updateSelectedInfo(),this.options.isMultiSelect||this._refreshInputText(),this._triggerChanged()}selectOption(t){const e=this.menuItems.find((e=>e.id==t));if(!e)return;const i=this.container.querySelector('li[data-id="'+t+'"]');if(i){if(this.options.isMultiSelect){const t=i.querySelector('input[type="checkbox"]');t.checked=!t.checked,t.checked?this.selectedValues.push(e):this.selectedValues=this.selectedValues.filter((t=>t.id!==e.id)),this.el.focus()}else this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close();this._updateSelectedInfo(),this._triggerChanged()}}}e.Autocomplete=l},379:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FloatingActionButton=void 0;const n=s(i(30)),o=i(999);let a={direction:"top",hoverEnabled:!0,toolbarEnabled:!1};class l extends o.Component{constructor(t,e){super(t,e,l),this._handleFABClick=()=>{this.isOpen?this.close():this.open()},this._handleDocumentClick=t=>{t.target!==this._menu&&this.close},this.open=()=>{this.isOpen||(this.options.toolbarEnabled?this._animateInToolbar():this._animateInFAB(),this.isOpen=!0)},this.close=()=>{this.isOpen&&(this.options.toolbarEnabled?(window.removeEventListener("scroll",this.close,!0),document.body.removeEventListener("click",this._handleDocumentClick,!0)):this._animateOutFAB(),this.isOpen=!1)},this.el.M_FloatingActionButton=this,this.options=Object.assign(Object.assign({},l.defaults),e),this.isOpen=!1,this._anchor=this.el.querySelector("a"),this._menu=this.el.querySelector("ul"),this._floatingBtns=Array.from(this.el.querySelectorAll("ul .btn-floating")),this._floatingBtnsReverse=this._floatingBtns.reverse(),this.offsetY=0,this.offsetX=0,this.el.classList.add(`direction-${this.options.direction}`),"top"===this.options.direction?this.offsetY=40:"right"===this.options.direction?this.offsetX=-40:"bottom"===this.options.direction?this.offsetY=-40:this.offsetX=40,this._setupEventHandlers()}static get defaults(){return a}static init(t,e={}){return super.init(t,e,l)}static getInstance(t){return t.M_FloatingActionButton}destroy(){this._removeEventHandlers(),this.el.M_FloatingActionButton=void 0}_setupEventHandlers(){this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.addEventListener("mouseenter",this.open),this.el.addEventListener("mouseleave",this.close)):this.el.addEventListener("click",this._handleFABClick)}_removeEventHandlers(){this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.removeEventListener("mouseenter",this.open),this.el.removeEventListener("mouseleave",this.close)):this.el.removeEventListener("click",this._handleFABClick)}_animateInFAB(){this.el.classList.add("active");let t=0;this._floatingBtnsReverse.forEach((e=>{(0,n.default)({targets:e,opacity:1,scale:[.4,1],translateY:[this.offsetY,0],translateX:[this.offsetX,0],duration:275,delay:t,easing:"easeInOutQuad"}),t+=40}))}_animateOutFAB(){this._floatingBtnsReverse.forEach((t=>{n.default.remove(t),(0,n.default)({targets:t,opacity:0,scale:.4,translateY:this.offsetY,translateX:this.offsetX,duration:175,easing:"easeOutQuad",complete:()=>{this.el.classList.remove("active")}})}))}_animateInToolbar(){let t,e=window.innerWidth,i=window.innerHeight,s=this.el.getBoundingClientRect();const n=document.createElement("div");n.classList.add("fab-backdrop");const o=getComputedStyle(this._anchor).backgroundColor;this._anchor.append(n),this.offsetX=s.left-e/2+s.width/2,this.offsetY=i-s.bottom,t=e/n[0].clientWidth,this.btnBottom=s.bottom,this.btnLeft=s.left,this.btnWidth=s.width,this.el.classList.add("active"),this.el.style.textAlign="center",this.el.style.width="100%",this.el.style.bottom="0",this.el.style.left="0",this.el.style.transform="translateX("+this.offsetX+"px)",this.el.style.transition="none",this._anchor.style.transform=`translateY(${this.offsetY}px`,this._anchor.style.transition="none",n.style.backgroundColor=o,setTimeout((()=>{this.el.style.transform="",this.el.style.transition="transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s",this._anchor.style.overflow="visible",this._anchor.style.transform="",this._anchor.style.transition="transform .2s",setTimeout((()=>{this.el.style.overflow="hidden",this.el.style.backgroundColor=o,n.style.transform="scale("+t+")",n.style.transition="transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)",this._menu.querySelectorAll("li > a").forEach((t=>t.style.opacity="1")),window.addEventListener("scroll",this.close,!0),document.body.addEventListener("click",this._handleDocumentClick,!0)}),100)}),0)}}e.FloatingActionButton=l},137:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Cards=void 0;const n=s(i(30));e.Cards=class{static Init(){document.addEventListener("DOMContentLoaded",(()=>{document.body.addEventListener("click",(t=>{const e=t.target,i=e.closest(".card");if(!i)return;const s=Array.from(i.children).find((t=>t.classList.contains("card-reveal")));if(!s)return;const o=getComputedStyle(i).overflow,a=s.querySelector(".card-reveal .card-title");(e===a||a.contains(e))&&(0,n.default)({targets:s,translateY:0,duration:225,easing:"easeInOutQuad",complete:t=>{s.style.display="none",i.style.overflow=o}}),i.querySelectorAll(".activator").forEach((t=>{(e===t||t.contains(e))&&(i.style.overflow="hidden",s.style.display="block",(0,n.default)({targets:s,translateY:"-100%",duration:300,easing:"easeInOutQuad"}))}))}))}))}}},476:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Carousel=void 0;const s=i(593),n=i(999);let o={duration:200,dist:-100,shift:0,padding:0,numVisible:5,fullWidth:!1,indicators:!1,noWrap:!1,onCycleTo:null};class a extends n.Component{constructor(t,e){var i;super(t,e,a),this.center=0,this._handleThrottledResize=s.Utils.throttle((function(){this._handleResize()}),200,null).bind(this),this._handleCarouselTap=t=>{"mousedown"===t.type&&"IMG"===t.target.tagName&&t.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=this._xpos(t),this.referenceY=this._ypos(t),this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now(),clearInterval(this.ticker),this.ticker=setInterval(this._track,100)},this._handleCarouselDrag=t=>{let e,i,s,n;if(this.pressed)if(e=this._xpos(t),i=this._ypos(t),s=this.reference-e,n=Math.abs(this.referenceY-i),n<30&&!this.verticalDragged)(s>2||s<-2)&&(this.dragged=!0,this.reference=e,this._scroll(this.offset+s));else{if(this.dragged)return t.preventDefault(),t.stopPropagation(),!1;this.verticalDragged=!0}if(this.dragged)return t.preventDefault(),t.stopPropagation(),!1},this._handleCarouselRelease=t=>{if(this.pressed)return this.pressed=!1,clearInterval(this.ticker),this.target=this.offset,(this.velocity>10||this.velocity<-10)&&(this.amplitude=.9*this.velocity,this.target=this.offset+this.amplitude),this.target=Math.round(this.target/this.dim)*this.dim,this.noWrap&&(this.target>=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScroll),this.dragged&&(t.preventDefault(),t.stopPropagation()),!1},this._handleCarouselClick=t=>{if(this.dragged)return t.preventDefault(),t.stopPropagation(),!1;if(!this.options.fullWidth){const e=t.target.closest(".carousel-item");if(!e)return;const i=[...e.parentNode.children].indexOf(e);0!=this._wrap(this.center)-i&&(t.preventDefault(),t.stopPropagation()),i<0?t.clientX-t.target.getBoundingClientRect().left>this.el.clientWidth/2?this.next():this.prev():this._cycleTo(i)}},this._handleIndicatorClick=t=>{t.stopPropagation();const e=t.target.closest(".indicator-item");if(e){const t=[...e.parentNode.children].indexOf(e);this._cycleTo(t)}},this._handleResize=()=>{this.options.fullWidth?(this.itemWidth=this.el.querySelector(".carousel-item").clientWidth,this.imageHeight=this.el.querySelector(".carousel-item.active").clientHeight,this.dim=2*this.itemWidth+this.options.padding,this.offset=2*this.center*this.itemWidth,this.target=this.offset,this._setCarouselHeight(!0)):this._scroll()},this._track=()=>{let t,e,i,s;t=Date.now(),e=t-this.timestamp,this.timestamp=t,i=this.offset-this.frame,this.frame=this.offset,s=1e3*i/(1+e),this.velocity=.8*s+.2*this.velocity},this._autoScroll=()=>{let t,e;this.amplitude&&(t=Date.now()-this.timestamp,e=this.amplitude*Math.exp(-t/this.options.duration),e>2||e<-2?(this._scroll(this.target-e),requestAnimationFrame(this._autoScroll)):this._scroll(this.target))},this.el.M_Carousel=this,this.options=Object.assign(Object.assign({},a.defaults),e),this.hasMultipleSlides=this.el.querySelectorAll(".carousel-item").length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.noWrap=this.options.noWrap||!this.hasMultipleSlides,this.pressed=!1,this.dragged=!1,this.offset=this.target=0,this.images=[],this.itemWidth=this.el.querySelector(".carousel-item").clientWidth,this.itemHeight=this.el.querySelector(".carousel-item").clientHeight,this.dim=2*this.itemWidth+this.options.padding||1,this.options.fullWidth&&(this.options.dist=0,this._setCarouselHeight(),this.showIndicators&&(null===(i=this.el.querySelector(".carousel-fixed-item"))||void 0===i||i.classList.add("with-indicators"))),this._indicators=document.createElement("ul"),this._indicators.classList.add("indicators"),this.el.querySelectorAll(".carousel-item").forEach(((t,e)=>{if(this.images.push(t),this.showIndicators){const t=document.createElement("li");t.classList.add("indicator-item"),0===e&&t.classList.add("active"),this._indicators.appendChild(t)}})),this.showIndicators&&this.el.appendChild(this._indicators),this.count=this.images.length,this.options.numVisible=Math.min(this.count,this.options.numVisible),this.xform="transform",["webkit","Moz","O","ms"].every((t=>{var e=t+"Transform";return void 0===document.body.style[e]||(this.xform=e,!1)})),this._setupEventHandlers(),this._scroll(this.offset)}static get defaults(){return o}static init(t,e={}){return super.init(t,e,a)}static getInstance(t){return t.M_Carousel}destroy(){this._removeEventHandlers(),this.el.M_Carousel=void 0}_setupEventHandlers(){void 0!==window.ontouchstart&&(this.el.addEventListener("touchstart",this._handleCarouselTap),this.el.addEventListener("touchmove",this._handleCarouselDrag),this.el.addEventListener("touchend",this._handleCarouselRelease)),this.el.addEventListener("mousedown",this._handleCarouselTap),this.el.addEventListener("mousemove",this._handleCarouselDrag),this.el.addEventListener("mouseup",this._handleCarouselRelease),this.el.addEventListener("mouseleave",this._handleCarouselRelease),this.el.addEventListener("click",this._handleCarouselClick),this.showIndicators&&this._indicators&&this._indicators.querySelectorAll(".indicator-item").forEach((t=>{t.addEventListener("click",this._handleIndicatorClick)})),window.addEventListener("resize",this._handleThrottledResize)}_removeEventHandlers(){void 0!==window.ontouchstart&&(this.el.removeEventListener("touchstart",this._handleCarouselTap),this.el.removeEventListener("touchmove",this._handleCarouselDrag),this.el.removeEventListener("touchend",this._handleCarouselRelease)),this.el.removeEventListener("mousedown",this._handleCarouselTap),this.el.removeEventListener("mousemove",this._handleCarouselDrag),this.el.removeEventListener("mouseup",this._handleCarouselRelease),this.el.removeEventListener("mouseleave",this._handleCarouselRelease),this.el.removeEventListener("click",this._handleCarouselClick),this.showIndicators&&this._indicators&&this._indicators.querySelectorAll(".indicator-item").forEach((t=>{t.removeEventListener("click",this._handleIndicatorClick)})),window.removeEventListener("resize",this._handleThrottledResize)}_setCarouselHeight(t=!1){const e=this.el.querySelector(".carousel-item.active")?this.el.querySelector(".carousel-item.active"):this.el.querySelector(".carousel-item"),i=e.querySelector("img");if(i)if(i.complete){const t=i.clientHeight;if(t>0)this.el.style.height=t+"px";else{const t=i.naturalWidth,e=i.naturalHeight,s=this.el.clientWidth/t*e;this.el.style.height=s+"px"}}else i.addEventListener("load",(()=>{this.el.style.height=i.offsetHeight+"px"}));else if(!t){const t=e.clientHeight;this.el.style.height=t+"px"}}_xpos(t){return t.type.startsWith("touch")&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}_ypos(t){return t.type.startsWith("touch")&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}_wrap(t){return t>=this.count?t%this.count:t<0?this._wrap(this.count+t%this.count):t}_scroll(t=0){let e,i,s,n,o,a,l,r,h,d;this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),null!=this.scrollingTimeout&&window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=window.setTimeout((()=>{this.el.classList.remove("scrolling")}),this.options.duration);let c=this.center,u=1/this.options.numVisible;if(this.offset="number"==typeof t?t:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim),s=this.offset-this.center*this.dim,n=s<0?1:-1,o=-n*s*2/this.dim,i=this.count>>1,this.options.fullWidth?(l="translateX(0)",d=1):(l="translateX("+(this.el.clientWidth-this.itemWidth)/2+"px) ",l+="translateY("+(this.el.clientHeight-this.itemHeight)/2+"px)",d=1-u*o),this.showIndicators){const t=this.center%this.count,e=this._indicators.querySelector(".indicator-item.active");if([...e.parentNode.children].indexOf(e)!==t){e.classList.remove("active");const i=t<0?this.count+t:t;this._indicators.querySelectorAll(".indicator-item")[i].classList.add("active")}}if(!this.noWrap||this.center>=0&&this.center0?1-o:1):(r=this.options.dist*(2*e-o*n),h=1-u*(2*e-o*n)),!this.noWrap||this.center-e>=0){a=this.images[this._wrap(this.center-e)];let t=`${l} translateX(${-this.options.shift+(-this.dim*e-s)/2}px) translateZ(${r}px)`;this._updateItemStyle(a,h,-e,t)}}if(!this.noWrap||this.center>=0&&this.center0&&Math.abs(i-this.count)0&&(this.target-=this.dim*i),"function"==typeof e&&(this.oneTimeCallback=e),this.offset!==this.target&&(this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScroll))}next(t=1){(void 0===t||isNaN(t))&&(t=1);let e=this.center+t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}prev(t=1){(void 0===t||isNaN(t))&&(t=1);let e=this.center-t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}set(t,e){if((void 0===t||isNaN(t))&&(t=0),t>this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t,e)}}e.Carousel=a},283:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CharacterCounter=void 0;const s=i(999),n=Object.freeze({});class o extends s.Component{constructor(t,e){super(t,{},o),this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.innerHTML=i},this.el.M_CharacterCounter=this,this.options=Object.assign(Object.assign({},o.defaults),e),this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return n}static init(t,e={}){return super.init(t,e,o)}static getInstance(t){return t.M_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):this.isValidLength||this.isInvalid||(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}}e.CharacterCounter=o},359:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Chips=void 0;const s=i(593),n=i(357),o=i(999);let a={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-icons",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,onChipAdd:null,onChipSelect:null,onChipDelete:null};function l(t){return[...t.parentNode.children].indexOf(t)}class r extends o.Component{constructor(t,e){super(t,e,r),this._handleChipClick=t=>{const e=t.target.closest(".chip"),i=t.target.classList.contains("close");if(e){const t=[...e.parentNode.children].indexOf(e);i?(this.deleteChip(t),this._input.focus()):this.selectChip(t)}else this._input.focus()},this._handleInputFocus=()=>{this.el.classList.add("focus")},this._handleInputBlur=()=>{this.el.classList.remove("focus")},this._handleInputKeydown=t=>{if(r._keydown=!0,s.Utils.keys.ENTER.includes(t.key)){if(this.hasAutocomplete&&this.autocomplete&&this.autocomplete.isOpen)return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(s.Utils.keys.BACKSPACE.includes(t.key)||s.Utils.keys.ARROW_LEFT.includes(t.key))&&""===this._input.value&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))},this.el.M_Chips=this,this.options=Object.assign(Object.assign({},r.defaults),e),this.el.classList.add("chips","input-field"),this.chipsData=[],this._chips=[],this._setupInput(),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this._input.getAttribute("id")||this._input.setAttribute("id",s.Utils.guid()),this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._setupLabel(),this._setupEventHandlers()}static get defaults(){return a}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Chips}getData(){return this.chipsData}destroy(){this._removeEventHandlers(),this._chips.forEach((t=>t.remove())),this._chips=[],this.el.M_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),document.addEventListener("keydown",r._handleChipsKeydown),document.addEventListener("keyup",r._handleChipsKeyup),this.el.addEventListener("blur",r._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),document.removeEventListener("keydown",r._handleChipsKeydown),document.removeEventListener("keyup",r._handleChipsKeyup),this.el.removeEventListener("blur",r._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){r._keydown=!0;const e=t.target.closest(".chips"),i=t.target&&e,n=t.target.tagName;if("INPUT"===n||"TEXTAREA"===n||!i)return;const o=e.M_Chips;if(s.Utils.keys.BACKSPACE.includes(t.key)||s.Utils.keys.DELETE.includes(t.key)){t.preventDefault();let e=o.chipsData.length;if(o._selectedChip){const t=l(o._selectedChip);o.deleteChip(t),o._selectedChip=null,e=Math.max(t-1,0)}o.chipsData.length?o.selectChip(e):o._input.focus()}else if(s.Utils.keys.ARROW_LEFT.includes(t.key)){if(o._selectedChip){const t=l(o._selectedChip)-1;if(t<0)return;o.selectChip(t)}}else if(s.Utils.keys.ARROW_RIGHT.includes(t.key)&&o._selectedChip){const t=l(o._selectedChip)+1;t>=o.chipsData.length?o._input.focus():o.selectChip(t)}}static _handleChipsKeyup(t){r._keydown=!1}static _handleChipsBlur(t){!r._keydown&&document.hidden&&(t.target.closest(".chips").M_Chips._selectedChip=null)}_renderChip(t){if(!t.id)return;const e=document.createElement("div");e.classList.add("chip"),e.innerText=t.text||t.id,e.setAttribute("tabindex","0");const i=document.createElement("i");if(i.classList.add(this.options.closeIconClass,"close"),i.innerText="close",t.image){const i=document.createElement("img");i.setAttribute("src",t.image),e.insertBefore(i,e.firstChild)}return e.appendChild(i),e}_renderChips(){this._chips=[];for(let t=0;t{t.length>0&&this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus()},this.autocomplete=n.Autocomplete.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input")}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){void 0!==this.chipsData&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(void 0===this.chipsData||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder)}_isValidAndNotExist(t){const e=!!t.id,i=!this.chipsData.some((e=>e.id==t.id));return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;const e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input.before(e),this._setPlaceholder(),"function"==typeof this.options.onChipAdd&&this.options.onChipAdd(this.el,e)}deleteChip(t){const e=this._chips[t];this._chips[t].remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder(),"function"==typeof this.options.onChipDelete&&this.options.onChipDelete(this.el,e)}selectChip(t){const e=this._chips[t];this._selectedChip=e,e.focus(),"function"==typeof this.options.onChipSelect&&this.options.onChipSelect(this.el,e)}static Init(){document.addEventListener("DOMContentLoaded",(()=>{document.body.addEventListener("click",(t=>{if(t.target.closest(".chip .close")){const e=t.target.closest(".chips");if(e&&null==e.M_Chips)return;t.target.closest(".chip").remove()}}))}))}}e.Chips=r,r._keydown=!1},995:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Collapsible=void 0;const n=s(i(30)),o=i(593),a=i(999),l={accordion:!0,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,inDuration:300,outDuration:300};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleCollapsibleClick=t=>{const e=t.target.closest(".collapsible-header");if(t.target&&e){if(e.closest(".collapsible")!==this.el)return;const t=e.closest("li"),i=t.classList.contains("active"),s=[...t.parentNode.children].indexOf(t);i?this.close(s):this.open(s)}},this._handleCollapsibleKeydown=t=>{o.Utils.keys.ENTER.includes(t.key)&&this._handleCollapsibleClick(t)},this.open=t=>{const e=Array.from(this.el.children).filter((t=>"LI"===t.tagName)),i=e[t];if(i&&!i.classList.contains("active")){if("function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,i),this.options.accordion){const t=e.filter((t=>t.classList.contains("active")));t.forEach((t=>{const i=e.indexOf(t);this.close(i)}))}i.classList.add("active"),this._animateIn(t)}},this.close=t=>{const e=Array.from(this.el.children).filter((t=>"LI"===t.tagName))[t];e&&e.classList.contains("active")&&("function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,e),e.classList.remove("active"),this._animateOut(t))},this.el.M_Collapsible=this,this.options=Object.assign(Object.assign({},r.defaults),e),this._headers=Array.from(this.el.querySelectorAll("li > .collapsible-header")),this._headers.forEach((t=>t.tabIndex=0)),this._setupEventHandlers();const i=Array.from(this.el.querySelectorAll("li.active > .collapsible-body"));this.options.accordion&&(i.length>0?i[0].style.display="block":i.forEach((t=>t.style.display="block")))}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Collapsible}destroy(){this._removeEventHandlers(),this.el.M_Collapsible=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleCollapsibleClick),this._headers.forEach((t=>t.addEventListener("keydown",this._handleCollapsibleKeydown)))}_removeEventHandlers(){this.el.removeEventListener("click",this._handleCollapsibleClick),this._headers.forEach((t=>t.removeEventListener("keydown",this._handleCollapsibleKeydown)))}_animateIn(t){const e=this.el.children[t];if(!e)return;const i=e.querySelector(".collapsible-body");n.default.remove(i),i.style.display="block",i.style.overflow="hidden",i.style.height="0",i.style.paddingTop="",i.style.paddingBottom="";const s=getComputedStyle(i).paddingTop,o=getComputedStyle(i).paddingBottom,a=i.scrollHeight;i.style.paddingTop="0",i.style.paddingBottom="0",(0,n.default)({targets:i,height:a,paddingTop:s,paddingBottom:o,duration:this.options.inDuration,easing:"easeInOutCubic",complete:t=>{i.style.overflow="",i.style.height="",i.style.paddingTop="",i.style.paddingBottom="","function"==typeof this.options.onOpenEnd&&this.options.onOpenEnd.call(this,e)}})}_animateOut(t){const e=this.el.children[t];if(!e)return;const i=e.querySelector(".collapsible-body");n.default.remove(i),i.style.overflow="hidden",(0,n.default)({targets:i,height:0,paddingTop:0,paddingBottom:0,duration:this.options.outDuration,easing:"easeInOutCubic",complete:()=>{i.style.overflow="",i.style.height="",i.style.padding="",i.style.display="","function"==typeof this.options.onCloseEnd&&this.options.onCloseEnd.call(this,e)}})}}e.Collapsible=r},999:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0,e.Component=class{constructor(t,e,i){t instanceof HTMLElement||console.error(Error(t+" is not an HTML Element"));let s=i.getInstance(t);s&&s.destroy(),this.el=t}static init(t,e,i){let s=null;if(t instanceof Element)s=new i(t,e);else if(t&&t.length){s=[];for(let n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.Datepicker=void 0;const s=i(799),n=i(593),o=i(375),a=i(999);let l={autoClose:!1,format:"mmm dd, yyyy",parse:null,defaultDate:null,setDefaultDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,container:null,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"‹",nextMonth:"›",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleInputClick=()=>{this.open()},this._handleInputKeydown=t=>{n.Utils.keys.ENTER.includes(t.key)&&(t.preventDefault(),this.open())},this._handleCalendarClick=t=>{if(!this.isOpen)return;const e=t.target;e.classList.contains("is-disabled")||(!e.classList.contains("datepicker-day-button")||e.classList.contains("is-empty")||e.parentElement.classList.contains("is-disabled")?e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth():(this.setDate(new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"))),this.options.autoClose&&this._finishSelection()))},this._handleClearClick=()=>{this.date=null,this.setInputValue(),this.close()},this._handleMonthChange=t=>{this.gotoMonth(t.target.value)},this._handleYearChange=t=>{this.gotoYear(t.target.value)},this._handleInputChange=t=>{var e;let i;(null===(e=t.detail)||void 0===e?void 0:e.firedBy)!==this&&(i=this.options.parse?this.options.parse(this.el.value,"function"==typeof this.options.format?this.options.format(new Date(this.el.value)):this.options.format):new Date(Date.parse(this.el.value)),r._isDate(i)&&this.setDate(i))},this._finishSelection=()=>{this.setInputValue(),this.close()},this.open=()=>{if(!this.isOpen)return this.isOpen=!0,"function"==typeof this.options.onOpen&&this.options.onOpen.call(this),this.draw(),this.modal.open(void 0),this},this.close=()=>{if(this.isOpen)return this.isOpen=!1,"function"==typeof this.options.onClose&&this.options.onClose.call(this),this.modal.close(),this},this.el.M_Datepicker=this,this.options=Object.assign(Object.assign({},r.defaults),e),e&&e.hasOwnProperty("i18n")&&"object"==typeof e.i18n&&(this.options.i18n=Object.assign(Object.assign({},r.defaults.i18n),e.i18n)),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=n.Utils.guid(),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupModal(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=new Date(Date.parse(this.el.value)));let i=this.options.defaultDate;r._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue()):this.gotoDate(i):this.gotoDate(new Date),this.isOpen=!1}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _isWeekend(t){let e=t.getDay();return 0===e||6===e}static _setToStartOfDay(t){r._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,r._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static _compareDates(t,e){return t.getTime()===e.getTime()}static getInstance(t){return t.M_Datepicker}destroy(){this._removeEventHandlers(),this.modal.destroy(),this.modalEl.remove(),this.destroySelects(),this.el.M_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&o.FormSelect.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&o.FormSelect.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.options.showClearBtn&&(this.clearBtn.style.visibility="",this.clearBtn.innerText=this.options.i18n.clear),this.doneBtn.innerText=this.options.i18n.done,this.cancelBtn.innerText=this.options.i18n.cancel,this.options.container){const t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.modalEl)}else this.el.parentElement.appendChild(this.modalEl)}_setupModal(){this.modalEl.id="modal-"+this.id,this.modal=s.Modal.init(this.modalEl,{onCloseEnd:()=>{this.isOpen=!1}})}toString(t=null){return"function"==typeof(t=t||this.options.format)?t(this.date):r._isDate(this.date)?t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map((t=>this.formats[t]?this.formats[t]():t)).join(""):""}setDate(t=null,e=!1){if(!t)return this.date=null,this._renderDateDisplay(),this.draw();if("string"==typeof t&&(t=new Date(Date.parse(t))),!r._isDate(t))return;let i=this.options.minDate,s=this.options.maxDate;r._isDate(i)&&ts&&(t=s),this.date=new Date(t.getTime()),this._renderDateDisplay(),r._setToStartOfDay(this.date),this.gotoDate(this.date),e||"function"!=typeof this.options.onSelect||this.options.onSelect.call(this,this.date)}setInputValue(){this.el.value=this.toString(),this.el.dispatchEvent(new CustomEvent("change",{detail:{firedBy:this}}))}_renderDateDisplay(){let t=r._isDate(this.date)?this.date:new Date,e=this.options.i18n,i=e.weekdaysShort[t.getDay()],s=e.monthsShort[t.getMonth()],n=t.getDate();this.yearTextEl.innerHTML=t.getFullYear().toString(),this.dateTextEl.innerHTML=`${i}, ${s} ${n}`}gotoDate(t){let e=!0;if(r._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),n=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=n11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=this.options,n=new Date,o=r._getDaysInMonth(t,e),a=new Date(t,e,1).getDay(),l=[],h=[];r._setToStartOfDay(n),s.firstDay>0&&(a-=s.firstDay,a<0&&(a+=7));let d=0===e?11:e-1,c=11===e?0:e+1,u=0===e?t-1:t,p=11===e?t+1:t,m=r._getDaysInMonth(u,d),v=o+a,g=v;for(;g>7;)g-=7;v+=7-g;let _=!1;for(let i=0,g=0;i=o+a,E=i-a+1,L=e,C=t,k=s.startRange&&r._compareDates(s.startRange,v),T=s.endRange&&r._compareDates(s.endRange,v),O=s.startRange&&s.endRange&&s.startRanges.maxDate||s.disableWeekends&&r._isWeekend(v)||s.disableDayFn&&s.disableDayFn(v),isEmpty:b,isStartRange:k,isEndRange:T,isInRange:O,showDaysInNextAndPreviousMonths:s.showDaysInNextAndPreviousMonths};h.push(this.renderDay(x)),7==++g&&(l.push(this.renderRow(h,s.isRTL,_)),h=[],g=0,_=!1)}return this.renderTable(s,l,i)}renderDay(t){let e=[],i="false";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'';e.push("is-outside-current-month"),e.push("is-selection-disabled")}return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),i="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),``}renderRow(t,e,i){return''+(e?t.reverse():t).join("")+""}renderTable(t,e,i){return'
'+this.renderHead(t)+this.renderBody(e)+"
"}renderHead(t){let e,i=[];for(e=0;e<7;e++)i.push(`${this.renderDayName(t,e,!0)}`);return""+(t.isRTL?i.reverse():i).join("")+""}renderBody(t){return""+t.join("")+""}renderTitle(t,e,i,s,n,o){let a,l,r,h,d,c=this.options,u=i===c.minYear,p=i===c.maxYear,m='
',v=!0,g=!0;for(r=[],a=0;a<12;a++)r.push('");for(h='",Array.isArray(c.yearRange)?(a=c.yearRange[0],l=c.yearRange[1]+1):(a=i-c.yearRange,l=1+i+c.yearRange),r=[];a=c.minYear&&r.push(``);return c.yearRangeReverse&&r.reverse(),d=``,m+=``,m+='
',c.showMonthAfterYear?m+=d+h:m+=h+d,m+="
",u&&(0===s||c.minMonth>=s)&&(v=!1),p&&(11===s||c.maxMonth<=s)&&(g=!1),m+=``,m+"
"}draw(t=!1){if(!this.isOpen&&!t)return;let e,i=this.options,s=i.minYear,n=i.maxYear,a=i.minMonth,l=i.maxMonth,r="";this._y<=s&&(this._y=s,!isNaN(a)&&this._m=n&&(this._y=n,!isNaN(l)&&this._m>l&&(this._m=l)),e="datepicker-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(let t=0;t<1;t++)this._renderDateDisplay(),r+=this.renderTitle(this,t,this.calendars[t].year,this.calendars[t].month,this.calendars[0].year,e)+this.render(this.calendars[t].year,this.calendars[t].month,e);this.destroySelects(),this.calendarEl.innerHTML=r;let h=this.calendarEl.querySelector(".orig-select-year"),d=this.calendarEl.querySelector(".orig-select-month");o.FormSelect.init(h,{classes:"select-year",dropdownOptions:{container:document.body,constrainWidth:!1}}),o.FormSelect.init(d,{classes:"select-month",dropdownOptions:{container:document.body,constrainWidth:!1}}),h.addEventListener("change",(()=>this._handleYearChange)),d.addEventListener("change",(()=>this._handleMonthChange)),"function"==typeof this.options.onDraw&&this.options.onDraw.call(this)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick),this.doneBtn.addEventListener("click",this._finishSelection),this.cancelBtn.addEventListener("click",this.close),this.options.showClearBtn&&this.clearBtn.addEventListener("click",this._handleClearClick)}_setupVariables(){const t=document.createElement("template");t.innerHTML=r._template.trim(),this.modalEl=t.content.firstChild,this.calendarEl=this.modalEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.modalEl.querySelector(".year-text"),this.dateTextEl=this.modalEl.querySelector(".date-text"),this.options.showClearBtn&&(this.clearBtn=this.modalEl.querySelector(".datepicker-clear")),this.doneBtn=this.modalEl.querySelector(".datepicker-done"),this.cancelBtn=this.modalEl.querySelector(".datepicker-cancel"),this.formats={d:()=>this.date.getDate(),dd:()=>{let t=this.date.getDate();return(t<10?"0":"")+t},ddd:()=>this.options.i18n.weekdaysShort[this.date.getDay()],dddd:()=>this.options.i18n.weekdays[this.date.getDay()],m:()=>this.date.getMonth()+1,mm:()=>{let t=this.date.getMonth()+1;return(t<10?"0":"")+t},mmm:()=>this.options.i18n.monthsShort[this.date.getMonth()],mmmm:()=>this.options.i18n.months[this.date.getMonth()],yy:()=>(""+this.date.getFullYear()).slice(2),yyyy:()=>this.date.getFullYear()}}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("change",this._handleInputChange),this.calendarEl.removeEventListener("click",this._handleCalendarClick)}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}}e.Datepicker=r,r._template='\n '},123:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Dropdown=void 0;const n=s(i(30)),o=i(593),a=i(999),l={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!0,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleClick=t=>{t.preventDefault(),this.open()},this._handleMouseEnter=()=>{this.open()},this._handleMouseLeave=t=>{const e=t.relatedTarget,i=!!e.closest(".dropdown-content");let s=!1;const n=e.closest(".dropdown-trigger");n&&n.M_Dropdown&&n.M_Dropdown.isOpen&&(s=!0),s||i||this.close()},this._handleDocumentClick=t=>{const e=t.target;this.options.closeOnClick&&e.closest(".dropdown-content")&&!this.isTouchMoving?this.close():!e.closest(".dropdown-trigger")&&e.closest(".dropdown-content")||this.close(),this.isTouchMoving=!1},this._handleTriggerKeydown=t=>{(o.Utils.keys.ARROW_DOWN.includes(t.key)||o.Utils.keys.ENTER.includes(t.key))&&!this.isOpen&&(t.preventDefault(),this.open())},this._handleDocumentTouchmove=t=>{t.target.closest(".dropdown-content")&&(this.isTouchMoving=!0)},this._handleDropdownClick=t=>{if("function"==typeof this.options.onItemClick){const e=t.target.closest("li");this.options.onItemClick.call(this,e)}},this._handleDropdownKeydown=t=>{const e=o.Utils.keys.ARROW_DOWN.includes(t.key)||o.Utils.keys.ARROW_UP.includes(t.key);if(o.Utils.keys.TAB.includes(t.key))t.preventDefault(),this.close();else if(e&&this.isOpen){t.preventDefault();const e=o.Utils.keys.ARROW_DOWN.includes(t.key)?1:-1;let i=this.focusedIndex,s=!1;do{if(i+=e,this.dropdownEl.children[i]&&-1!==this.dropdownEl.children[i].tabIndex){s=!0;break}}while(i=0);s&&(this.focusedIndex>=0&&this.dropdownEl.children[this.focusedIndex].classList.remove("active"),this.focusedIndex=i,this._focusFocusedItem())}else if(o.Utils.keys.ENTER.includes(t.key)&&this.isOpen){const t=this.dropdownEl.children[this.focusedIndex],e=t.querySelector("a, button");e?e.click():t&&t instanceof HTMLElement&&t.click()}else o.Utils.keys.ESC.includes(t.key)&&this.isOpen&&(t.preventDefault(),this.close());const i=t.key.toLowerCase(),s=/[a-zA-Z0-9-_]/.test(i),n=[...o.Utils.keys.ARROW_DOWN,...o.Utils.keys.ARROW_UP,...o.Utils.keys.ENTER,...o.Utils.keys.ESC,...o.Utils.keys.TAB];if(s&&!n.includes(t.key)){this.filterQuery.push(i);const t=this.filterQuery.join(""),e=Array.from(this.dropdownEl.querySelectorAll("li")).find((e=>0===e.innerText.toLowerCase().indexOf(t)));e&&(this.focusedIndex=[...e.parentNode.children].indexOf(e),this._focusFocusedItem())}this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)},this._resetFilterQuery=()=>{this.filterQuery=[]},this.open=()=>{this.isOpen||(this.isOpen=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this._resetDropdownStyles(),this.dropdownEl.style.display="block",this._placeDropdown(),this._animateIn(),this._setupTemporaryEventHandlers())},this.close=()=>{this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this._animateOut(),this._removeTemporaryEventHandlers(),this.options.autoFocus&&this.el.focus())},this.recalculateDimensions=()=>{this.isOpen&&(this.dropdownEl.style.width="",this.dropdownEl.style.height="",this.dropdownEl.style.left="",this.dropdownEl.style.top="",this.dropdownEl.style.transformOrigin="",this._placeDropdown())},this.el.M_Dropdown=this,r._dropdowns.push(this),this.id=o.Utils.getIdFromTrigger(t),this.dropdownEl=document.getElementById(this.id),this.options=Object.assign(Object.assign({},r.defaults),e),this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this._moveDropdown(),this._makeDropdownFocusable(),this._setupEventHandlers()}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Dropdown}destroy(){this._resetDropdownStyles(),this._removeEventHandlers(),r._dropdowns.splice(r._dropdowns.indexOf(this),1),this.el.M_Dropdown=void 0}_setupEventHandlers(){var t;this.el.addEventListener("keydown",this._handleTriggerKeydown),null===(t=this.dropdownEl)||void 0===t||t.addEventListener("click",this._handleDropdownClick),this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.dropdownEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.dropdownEl.removeEventListener("click",this._handleDropdownClick),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.dropdownEl.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick,!0),document.body.addEventListener("touchmove",this._handleDocumentTouchmove),this.dropdownEl.addEventListener("keydown",this._handleDropdownKeydown)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick,!0),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.dropdownEl.removeEventListener("keydown",this._handleDropdownKeydown)}_resetDropdownStyles(){this.dropdownEl.style.display="",this.dropdownEl.style.width="",this.dropdownEl.style.height="",this.dropdownEl.style.left="",this.dropdownEl.style.top="",this.dropdownEl.style.transformOrigin="",this.dropdownEl.style.transform="",this.dropdownEl.style.opacity=""}_moveDropdown(t=null){this.options.container?this.options.container.append(this.dropdownEl):t?t.contains(this.dropdownEl)||t.append(this.dropdownEl):this.el.after(this.dropdownEl)}_makeDropdownFocusable(){this.dropdownEl&&(this.dropdownEl.tabIndex=0,Array.from(this.dropdownEl.children).forEach((t=>{t.getAttribute("tabindex")||t.setAttribute("tabindex","0")})))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndexh.spaceOnBottom?(d="bottom",s+=h.spaceOnTop,l-=this.options.coverTrigger?h.spaceOnTop-20:h.spaceOnTop-20+e.height):s+=h.spaceOnBottom)),!h[c]){const t="left"===c?"right":"left";h[t]?c=t:h.spaceOnLeft>h.spaceOnRight?(c="right",n+=h.spaceOnLeft,a-=h.spaceOnLeft):(c="left",n+=h.spaceOnRight)}return"bottom"===d&&(l=l-i.height+(this.options.coverTrigger?e.height:0)),"right"===c&&(a=a-i.width+e.width),{x:a,y:l,verticalAlignment:d,horizontalAlignment:c,height:s,width:n}}_animateIn(){n.default.remove(this.dropdownEl),(0,n.default)({targets:this.dropdownEl,opacity:{value:[0,1],easing:"easeOutQuad"},scaleX:[.3,1],scaleY:[.3,1],duration:this.options.inDuration,easing:"easeOutQuint",complete:t=>{this.options.autoFocus&&this.dropdownEl.focus(),"function"==typeof this.options.onOpenEnd&&this.options.onOpenEnd.call(this,this.el)}})}_animateOut(){n.default.remove(this.dropdownEl),(0,n.default)({targets:this.dropdownEl,opacity:{value:0,easing:"easeOutQuint"},scaleX:.3,scaleY:.3,duration:this.options.outDuration,easing:"easeOutQuint",complete:t=>{this._resetDropdownStyles(),"function"==typeof this.options.onCloseEnd&&this.options.onCloseEnd.call(this,this.el)}})}_getClosestAncestor(t,e){let i=t.parentNode;for(;null!==i&&i!==document;){if(e(i))return i;i=i.parentElement}return null}_placeDropdown(){let t=this._getClosestAncestor(this.dropdownEl,(t=>!["HTML","BODY"].includes(t.tagName)&&"visible"!==getComputedStyle(t).overflow));t||(t=this.dropdownEl.offsetParent?this.dropdownEl.offsetParent:this.dropdownEl.parentNode),"static"===getComputedStyle(t).position&&(t.style.position="relative"),this._moveDropdown(t);const e=this.options.constrainWidth?this.el.getBoundingClientRect().width:this.dropdownEl.getBoundingClientRect().width;this.dropdownEl.style.width=e+"px";const i=this._getDropdownPosition(t);this.dropdownEl.style.left=i.x+"px",this.dropdownEl.style.top=i.y+"px",this.dropdownEl.style.height=i.height+"px",this.dropdownEl.style.width=i.width+"px",this.dropdownEl.style.transformOrigin=`${"left"===i.horizontalAlignment?"0":"100%"} ${"top"===i.verticalAlignment?"0":"100%"}`}}e.Dropdown=r,r._dropdowns=[],r._dropdowns=[]},241:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Forms=void 0;const s=i(593);class n{static textareaAutoResize(t){if(!t)return void console.error("No textarea element found");let e=document.querySelector(".hiddendiv");e||(e=document.createElement("div"),e.classList.add("hiddendiv","common"),document.body.append(e));const i=getComputedStyle(t),s=i.fontFamily,n=i.fontSize,o=i.lineHeight,a=i.paddingTop,l=i.paddingRight,r=i.paddingBottom,h=i.paddingLeft;n&&(e.style.fontSize=n),s&&(e.style.fontFamily=s),o&&(e.style.lineHeight=o),a&&(e.style.paddingTop=a),l&&(e.style.paddingRight=l),r&&(e.style.paddingBottom=r),h&&(e.style.paddingLeft=h),t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString()),"off"===t.getAttribute("wrap")&&(e.style.overflowWrap="normal",e.style.whiteSpace="pre"),e.innerText=t.value+"\n";const d=e.innerHTML.replace(/\n/g,"
");e.innerHTML=d,t.offsetWidth>0&&t.offsetHeight>0?e.style.width=t.getBoundingClientRect().width+"px":e.style.width=window.innerWidth/2+"px";const c=parseInt(t.getAttribute("original-height")),u=parseInt(t.getAttribute("previous-length"));isNaN(c)||(c<=e.clientHeight?t.style.height=e.clientHeight+"px":t.value.length{document.addEventListener("keyup",(t=>{const e=t.target;e instanceof HTMLInputElement&&["radio","checkbox"].includes(e.type)&&s.Utils.keys.TAB.includes(t.key)&&(e.classList.add("tabbed"),e.addEventListener("blur",(t=>e.classList.remove("tabbed")),{once:!0}))})),document.querySelectorAll(".materialize-textarea").forEach((t=>{t.setAttribute("original-height",t.getBoundingClientRect().height.toString()),t.setAttribute("previous-length",t.value.length.toString()),n.textareaAutoResize(t),t.addEventListener("keyup",(e=>n.textareaAutoResize(t))),t.addEventListener("keydown",(e=>n.textareaAutoResize(t)))})),document.querySelectorAll('.file-field input[type="file"]').forEach((t=>{t.addEventListener("change",(e=>{const i=t.closest(".file-field").querySelector("input.file-path"),s=t.files,n=[];for(let t=0;t{!1===this.doneAnimating||this.overlayActive&&this.doneAnimating?this.close():this.open()},this._handleWindowScroll=()=>{this.overlayActive&&this.close()},this._handleWindowResize=()=>{this.overlayActive&&this.close()},this._handleWindowEscape=t=>{o.Utils.keys.ESC.includes(t.key)&&this.doneAnimating&&this.overlayActive&&this.close()},this.open=()=>{this._updateVars(),this.originalWidth=this.el.getBoundingClientRect().width,this.originalHeight=this.el.getBoundingClientRect().height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this.placeholder.style.width=this.placeholder.getBoundingClientRect().width+"px",this.placeholder.style.height=this.placeholder.getBoundingClientRect().height+"px",this.placeholder.style.position="relative",this.placeholder.style.top="0",this.placeholder.style.left="0",this._makeAncestorsOverflowVisible(),this.el.style.position="absolute",this.el.style.zIndex="1000",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.width=this.attrHeight+"px",this.el.removeAttribute("height")),this._overlay=document.createElement("div"),this._overlay.id="materialbox-overlay",this._overlay.style.opacity="0",this._overlay.addEventListener("click",(t=>{this.doneAnimating&&this.close()}),{once:!0}),this.el.before(this._overlay);const t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",n.default.remove(this.el),n.default.remove(this._overlay),(0,n.default)({targets:this._overlay,opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}),""!==this.caption&&(this._photoCaption&&n.default.remove(this._photoCaption),this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("materialbox-caption"),this._photoCaption.innerText=this.caption,document.body.append(this._photoCaption),this._photoCaption.style.display="inline",(0,n.default)({targets:this._photoCaption,opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}));const e=this.originalWidth/this.windowWidth,i=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,e>i){const t=this.originalHeight/this.originalWidth;this.newWidth=.9*this.windowWidth,this.newHeight=.9*this.windowWidth*t}else{const t=this.originalWidth/this.originalHeight;this.newWidth=.9*this.windowHeight*t,this.newHeight=.9*this.windowHeight}this._animateImageIn(),window.addEventListener("scroll",this._handleWindowScroll),window.addEventListener("resize",this._handleWindowResize),window.addEventListener("keyup",this._handleWindowEscape)},this.close=()=>{this._updateVars(),this.doneAnimating=!1,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),n.default.remove(this.el),n.default.remove(this._overlay),""!==this.caption&&n.default.remove(this._photoCaption),window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),(0,n.default)({targets:this._overlay,opacity:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:()=>{this.overlayActive=!1,this._overlay.remove()}}),this._animateImageOut(),""!==this.caption&&(0,n.default)({targets:this._photoCaption,opacity:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:()=>{this._photoCaption.remove()}})},this.el.M_Materialbox=this,this.options=Object.assign(Object.assign({},r.defaults),e),this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Materialbox}destroy(){this._removeEventHandlers(),this.el.M_Materialbox=void 0,this.placeholder.remove(),this.el.removeAttribute("style")}_setupEventHandlers(){this.el.addEventListener("click",this._handleMaterialboxClick)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleMaterialboxClick)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;null!==t&&t!==document;){const e=t;"visible"!==e.style.overflow&&(e.style.overflow="visible",this._changedAncestorList.push(e)),t=t.parentNode}}_offset(t){const e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.pageYOffset-i.clientTop,left:e.left+window.pageXOffset-i.clientLeft}}_animateImageIn(){this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";const t={targets:this.el,height:[this.originalHeight,this.newHeight],width:[this.originalWidth,this.newWidth],left:o.Utils.getDocumentScrollLeft()+this.windowWidth/2-this._offset(this.placeholder).left-this.newWidth/2,top:o.Utils.getDocumentScrollTop()+this.windowHeight/2-this._offset(this.placeholder).top-this.newHeight/2,duration:this.options.inDuration,easing:"easeOutQuad",complete:()=>{this.doneAnimating=!0,"function"==typeof this.options.onOpenEnd&&this.options.onOpenEnd.call(this,this.el)}};(0,n.default)(t)}_animateImageOut(){const t={targets:this.el,width:this.originalWidth,height:this.originalHeight,left:0,top:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:()=>{this.placeholder.style.height="",this.placeholder.style.width="",this.placeholder.style.position="",this.placeholder.style.top="",this.placeholder.style.left="",this.attrWidth&&this.el.setAttribute("width",this.attrWidth.toString()),this.attrHeight&&this.el.setAttribute("height",this.attrHeight.toString()),this.el.removeAttribute("style"),this.originInlineStyles&&this.el.setAttribute("style",this.originInlineStyles),this.el.classList.remove("active"),this.doneAnimating=!0,this._changedAncestorList.forEach((t=>t.style.overflow="")),"function"==typeof this.options.onCloseEnd&&this.options.onCloseEnd.call(this,this.el)}};(0,n.default)(t)}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}}e.Materialbox=r},799:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Modal=void 0;const n=s(i(30)),o=i(593),a=i(999),l={opacity:.5,inDuration:250,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,preventScrolling:!0,dismissible:!0,startingTop:"4%",endingTop:"10%"};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleTriggerClick=t=>{const e=t.target.closest(".modal-trigger");if(!e)return;const i=o.Utils.getIdFromTrigger(e),s=document.getElementById(i).M_Modal;s&&s.open(e),t.preventDefault()},this._handleOverlayClick=()=>{this.options.dismissible&&this.close()},this._handleModalCloseClick=t=>{t.target.closest(".modal-close")&&this.close()},this._handleKeydown=t=>{o.Utils.keys.ESC.includes(t.key)&&this.options.dismissible&&this.close()},this._handleFocus=t=>{this.el.contains(t.target)||this._nthModalOpened!==r._modalsOpen||this.el.focus()},this.open=t=>{if(!this.isOpen)return this.isOpen=!0,r._modalsOpen++,this._nthModalOpened=r._modalsOpen,this._overlay.style.zIndex=(1e3+2*r._modalsOpen).toString(),this.el.style.zIndex=(1e3+2*r._modalsOpen+1).toString(),this._openingTrigger=t||void 0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el,this._openingTrigger),this.options.preventScrolling&&(document.body.style.overflow="hidden"),this.el.classList.add("open"),this.el.insertAdjacentElement("afterend",this._overlay),this.options.dismissible&&(document.addEventListener("keydown",this._handleKeydown),document.addEventListener("focus",this._handleFocus,!0)),n.default.remove(this.el),n.default.remove(this._overlay),this._animateIn(),this.el.focus(),this},this.close=()=>{if(this.isOpen)return this.isOpen=!1,r._modalsOpen--,this._nthModalOpened=0,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this.el.classList.remove("open"),0===r._modalsOpen&&(document.body.style.overflow=""),this.options.dismissible&&(document.removeEventListener("keydown",this._handleKeydown),document.removeEventListener("focus",this._handleFocus,!0)),n.default.remove(this.el),n.default.remove(this._overlay),this._animateOut(),this},this.el.M_Modal=this,this.options=Object.assign(Object.assign({},r.defaults),e),this.isOpen=!1,this.id=this.el.id,this._openingTrigger=void 0,this._overlay=document.createElement("div"),this._overlay.classList.add("modal-overlay"),this.el.tabIndex=0,this._nthModalOpened=0,r._count++,this._setupEventHandlers()}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Modal}destroy(){r._count--,this._removeEventHandlers(),this.el.removeAttribute("style"),this._overlay.remove(),this.el.M_Modal=void 0}_setupEventHandlers(){1===r._count&&document.body.addEventListener("click",this._handleTriggerClick),this._overlay.addEventListener("click",this._handleOverlayClick),this.el.addEventListener("click",this._handleModalCloseClick)}_removeEventHandlers(){0===r._count&&document.body.removeEventListener("click",this._handleTriggerClick),this._overlay.removeEventListener("click",this._handleOverlayClick),this.el.removeEventListener("click",this._handleModalCloseClick)}_animateIn(){this.el.style.display="block",this.el.style.opacity="0",this._overlay.style.display="block",this._overlay.style.opacity="0",(0,n.default)({targets:this._overlay,opacity:this.options.opacity,duration:this.options.inDuration,easing:"easeOutQuad"});const t={targets:this.el,duration:this.options.inDuration,easing:"easeOutCubic",complete:()=>{"function"==typeof this.options.onOpenEnd&&this.options.onOpenEnd.call(this,this.el,this._openingTrigger)}};this.el.classList.contains("bottom-sheet")?(t.bottom=0,t.opacity=1):(t.top=[this.options.startingTop,this.options.endingTop],t.opacity=1,t.scaleX=[.8,1],t.scaleY=[.8,1]),(0,n.default)(t)}_animateOut(){(0,n.default)({targets:this._overlay,opacity:0,duration:this.options.outDuration,easing:"easeOutQuart"});const t={targets:this.el,duration:this.options.outDuration,easing:"easeOutCubic",complete:()=>{this.el.style.display="none",this._overlay.remove(),"function"==typeof this.options.onCloseEnd&&this.options.onCloseEnd.call(this,this.el)}};this.el.classList.contains("bottom-sheet")?(t.bottom="-100%",t.opacity=0):(t.top=[this.options.endingTop,this.options.startingTop],t.opacity=0,t.scaleX=.8,t.scaleY=.8),(0,n.default)(t)}}e.Modal=r,r._modalsOpen=0,r._count=0},324:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Parallax=void 0;const s=i(593),n=i(999);let o={responsiveThreshold:0};class a extends n.Component{constructor(t,e){super(t,e,a),this._handleImageLoad=()=>{this._updateParallax()},this.el.M_Parallax=this,this.options=Object.assign(Object.assign({},a.defaults),e),this._enabled=window.innerWidth>this.options.responsiveThreshold,this._img=this.el.querySelector("img"),this._updateParallax(),this._setupEventHandlers(),this._setupStyles(),a._parallaxes.push(this)}static get defaults(){return o}static init(t,e={}){return super.init(t,e,a)}static getInstance(t){return t.M_Parallax}destroy(){a._parallaxes.splice(a._parallaxes.indexOf(this),1),this._img.style.transform="",this._removeEventHandlers(),this.el.M_Parallax=void 0}static _handleScroll(){for(let t=0;te.options.responsiveThreshold}}_setupEventHandlers(){this._img.addEventListener("load",this._handleImageLoad),0===a._parallaxes.length&&(a._handleScrollThrottled||(a._handleScrollThrottled=s.Utils.throttle(a._handleScroll,5)),a._handleWindowResizeThrottled||(a._handleWindowResizeThrottled=s.Utils.throttle(a._handleWindowResize,5)),window.addEventListener("scroll",a._handleScrollThrottled),window.addEventListener("resize",a._handleWindowResizeThrottled))}_removeEventHandlers(){this._img.removeEventListener("load",this._handleImageLoad),0===a._parallaxes.length&&(window.removeEventListener("scroll",a._handleScrollThrottled),window.removeEventListener("resize",a._handleWindowResizeThrottled))}_setupStyles(){this._img.style.opacity="1"}_offset(t){const e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.pageYOffset-i.clientTop,left:e.left+window.pageXOffset-i.clientLeft}}_updateParallax(){const t=this.el.getBoundingClientRect().height>0?this.el.parentNode.offsetHeight:500,e=this._img.offsetHeight-t,i=this._offset(this.el).top+t,n=this._offset(this.el).top,o=s.Utils.getDocumentScrollTop(),a=window.innerHeight,l=e*((o+a-n)/(t+a));this._enabled?i>o&&n{Object.defineProperty(e,"__esModule",{value:!0}),e.Pushpin=void 0;const s=i(593),n=i(999);let o={top:0,bottom:1/0,offset:0,onPositionChange:null};class a extends n.Component{constructor(t,e){super(t,e,a),this.el.M_Pushpin=this,this.options=Object.assign(Object.assign({},a.defaults),e),this.originalOffset=this.el.offsetTop,a._pushpins.push(this),this._setupEventHandlers(),this._updatePosition()}static get defaults(){return o}static init(t,e={}){return super.init(t,e,a)}static getInstance(t){return t.M_Pushpin}destroy(){this.el.style.top=null,this._removePinClasses();let t=a._pushpins.indexOf(this);a._pushpins.splice(t,1),0===a._pushpins.length&&this._removeEventHandlers(),this.el.M_Pushpin=void 0}static _updateElements(){for(let t in a._pushpins)a._pushpins[t]._updatePosition()}_setupEventHandlers(){document.addEventListener("scroll",a._updateElements)}_removeEventHandlers(){document.removeEventListener("scroll",a._updateElements)}_updatePosition(){let t=s.Utils.getDocumentScrollTop()+this.options.offset;this.options.top<=t&&this.options.bottom>=t&&!this.el.classList.contains("pinned")&&(this._removePinClasses(),this.el.style.top=`${this.options.offset}px`,this.el.classList.add("pinned"),"function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pinned")),tthis.options.bottom&&!this.el.classList.contains("pin-bottom")&&(this._removePinClasses(),this.el.classList.add("pin-bottom"),this.el.style.top=this.options.bottom-this.originalOffset+"px","function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pin-bottom"))}_removePinClasses(){this.el.classList.remove("pin-top"),this.el.classList.remove("pinned"),this.el.classList.remove("pin-bottom")}}e.Pushpin=a,a._pushpins=[]},745:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Range=void 0;const n=s(i(30)),o=i(999),a={};class l extends o.Component{constructor(t,e){super(t,e,l),this._handleRangeChange=()=>{this.value.innerHTML=this.el.value,this.thumb.classList.contains("active")||this._showRangeBubble();const t=this._calcRangeOffset();this.thumb.classList.add("active"),this.thumb.style.left=t+"px"},this._handleRangeMousedownTouchstart=t=>{if(this.value.innerHTML=this.el.value,this._mousedown=!0,this.el.classList.add("active"),this.thumb.classList.contains("active")||this._showRangeBubble(),"input"!==t.type){const t=this._calcRangeOffset();this.thumb.classList.add("active"),this.thumb.style.left=t+"px"}},this._handleRangeInputMousemoveTouchmove=()=>{if(this._mousedown){this.thumb.classList.contains("active")||this._showRangeBubble();const t=this._calcRangeOffset();this.thumb.classList.add("active"),this.thumb.style.left=t+"px",this.value.innerHTML=this.el.value}},this._handleRangeMouseupTouchend=()=>{this._mousedown=!1,this.el.classList.remove("active")},this._handleRangeBlurMouseoutTouchleave=()=>{if(!this._mousedown){const t=7+parseInt(getComputedStyle(this.el).paddingLeft)+"px";this.thumb.classList.contains("active")&&(n.default.remove(this.thumb),(0,n.default)({targets:this.thumb,height:0,width:0,top:10,easing:"easeOutQuad",marginLeft:t,duration:100})),this.thumb.classList.remove("active")}},this.el.M_Range=this,this.options=Object.assign(Object.assign({},l.defaults),e),this._mousedown=!1,this._setupThumb(),this._setupEventHandlers()}static get defaults(){return a}static init(t,e={}){return super.init(t,e,l)}static getInstance(t){return t.M_Range}destroy(){this._removeEventHandlers(),this._removeThumb(),this.el.M_Range=void 0}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("mousedown",this._handleRangeMousedownTouchstart),this.el.addEventListener("touchstart",this._handleRangeMousedownTouchstart),this.el.addEventListener("input",this._handleRangeInputMousemoveTouchmove),this.el.addEventListener("mousemove",this._handleRangeInputMousemoveTouchmove),this.el.addEventListener("touchmove",this._handleRangeInputMousemoveTouchmove),this.el.addEventListener("mouseup",this._handleRangeMouseupTouchend),this.el.addEventListener("touchend",this._handleRangeMouseupTouchend),this.el.addEventListener("blur",this._handleRangeBlurMouseoutTouchleave),this.el.addEventListener("mouseout",this._handleRangeBlurMouseoutTouchleave),this.el.addEventListener("touchleave",this._handleRangeBlurMouseoutTouchleave)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("mousedown",this._handleRangeMousedownTouchstart),this.el.removeEventListener("touchstart",this._handleRangeMousedownTouchstart),this.el.removeEventListener("input",this._handleRangeInputMousemoveTouchmove),this.el.removeEventListener("mousemove",this._handleRangeInputMousemoveTouchmove),this.el.removeEventListener("touchmove",this._handleRangeInputMousemoveTouchmove),this.el.removeEventListener("mouseup",this._handleRangeMouseupTouchend),this.el.removeEventListener("touchend",this._handleRangeMouseupTouchend),this.el.removeEventListener("blur",this._handleRangeBlurMouseoutTouchleave),this.el.removeEventListener("mouseout",this._handleRangeBlurMouseoutTouchleave),this.el.removeEventListener("touchleave",this._handleRangeBlurMouseoutTouchleave)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_showRangeBubble(){const t=-7+parseInt(getComputedStyle(this.thumb.parentElement).paddingLeft)+"px";n.default.remove(this.thumb),(0,n.default)({targets:this.thumb,height:30,width:30,top:-30,marginLeft:t,duration:300,easing:"easeOutQuint"})}_calcRangeOffset(){const t=this.el.getBoundingClientRect().width-15,e=parseFloat(this.el.getAttribute("max"))||100,i=parseFloat(this.el.getAttribute("min"))||0;return(parseFloat(this.el.value)-i)/(e-i)*t}static Init(){l.init(document.querySelectorAll("input[type=range]"),{})}}e.Range=l},185:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ScrollSpy=void 0;const n=s(i(30)),o=i(593),a=i(999);let l={throttle:100,scrollOffset:200,activeClass:"active",getActiveElement:t=>'a[href="#'+t+'"]'};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleThrottledResize=o.Utils.throttle((function(){this._handleWindowScroll()}),200).bind(this),this._handleTriggerClick=t=>{const e=t.target;for(let i=r._elements.length-1;i>=0;i--){const s=r._elements[i];if(e===document.querySelector('a[href="#'+s.el.id+'"]')){t.preventDefault();const e=r._offset(s.el).top+1;(0,n.default)({targets:[document.documentElement,document.body],scrollTop:e-s.options.scrollOffset,duration:400,easing:"easeOutCubic"});break}}},this._handleWindowScroll=()=>{r._ticks++;let t=o.Utils.getDocumentScrollTop(),e=o.Utils.getDocumentScrollLeft(),i=e+window.innerWidth,s=t+window.innerHeight,n=r._findElements(t,i,s,e);for(let t=0;t=0&&i!==r._ticks&&(e._exit(),e.tickId=-1)}r._elementsInView=n},this.el.M_ScrollSpy=this,this.options=Object.assign(Object.assign({},r.defaults),e),r._elements.push(this),r._count++,r._increment++,this.tickId=-1,this.id=r._increment,this._setupEventHandlers(),this._handleWindowScroll()}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_ScrollSpy}destroy(){r._elements.splice(r._elements.indexOf(this),1),r._elementsInView.splice(r._elementsInView.indexOf(this),1),r._visibleElements.splice(r._visibleElements.indexOf(this.el),1),r._count--,this._removeEventHandlers(),document.querySelector(this.options.getActiveElement(this.el.id)).classList.remove(this.options.activeClass),this.el.M_ScrollSpy=void 0}_setupEventHandlers(){1===r._count&&(window.addEventListener("scroll",this._handleWindowScroll),window.addEventListener("resize",this._handleThrottledResize),document.body.addEventListener("click",this._handleTriggerClick))}_removeEventHandlers(){0===r._count&&(window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleThrottledResize),document.body.removeEventListener("click",this._handleTriggerClick))}static _offset(t){const e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.pageYOffset-i.clientTop,left:e.left+window.pageXOffset-i.clientLeft}}static _findElements(t,e,i,s){let n=[];for(let o=0;o0){let t=r._offset(a.el).top,o=r._offset(a.el).left,h=o+a.el.getBoundingClientRect().width,d=t+a.el.getBoundingClientRect().height;!(o>e||hi||d0!==t.getBoundingClientRect().height)),r._visibleElements[0]){const t=document.querySelector(this.options.getActiveElement(r._visibleElements[0].id));null==t||t.classList.remove(this.options.activeClass),r._visibleElements[0].M_ScrollSpy&&this.id0!==t.getBoundingClientRect().height)),r._visibleElements[0]){const e=document.querySelector(this.options.getActiveElement(r._visibleElements[0].id));if(null==e||e.classList.remove(this.options.activeClass),r._visibleElements=r._visibleElements.filter((t=>t.id!=this.el.id)),r._visibleElements[0]){const e=this.options.getActiveElement(r._visibleElements[0].id);null===(t=document.querySelector(e))||void 0===t||t.classList.add(this.options.activeClass)}}}}e.ScrollSpy=r,r._elements=[],r._elementsInView=[],r._visibleElements=[],r._count=0,r._increment=0,r._ticks=0},375:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FormSelect=void 0;const s=i(593),n=i(123),o=i(999);let a={classes:"",dropdownOptions:{}};class l extends o.Component{constructor(t,e){super(t,e,l),this._handleSelectChange=()=>{this._setValueToInput()},this._handleOptionClick=t=>{t.preventDefault();const e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()},this._handleInputClick=()=>{this.dropdown&&this.dropdown.isOpen&&(this._setValueToInput(),this._setSelectedStates())},this.el.classList.contains("browser-default")||(this.el.M_FormSelect=this,this.options=Object.assign(Object.assign({},l.defaults),e),this.isMultiple=this.el.multiple,this.el.tabIndex=-1,this._values=[],this._setupDropdown(),this._setupEventHandlers())}static get defaults(){return a}static init(t,e={}){return super.init(t,e,l)}static getInstance(t){return t.M_FormSelect}destroy(){this._removeEventHandlers(),this._removeDropdown(),this.el.M_FormSelect=void 0}_setupEventHandlers(){this.dropdownOptions.querySelectorAll("li:not(.optgroup)").forEach((t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",(t=>{" "!==t.key&&"Enter"!==t.key||this._handleOptionClick(t)}))})),this.el.addEventListener("change",this._handleSelectChange),this.input.addEventListener("click",this._handleInputClick)}_removeEventHandlers(){this.dropdownOptions.querySelectorAll("li:not(.optgroup)").forEach((t=>{t.removeEventListener("click",this._handleOptionClick)})),this.el.removeEventListener("change",this._handleSelectChange),this.input.removeEventListener("click",this._handleInputClick)}_arraysEqual(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;for(let i=0;ie.optionEl===t)),i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._setValueToInput();const s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change"))}this.isMultiple||this.dropdown.close()}_setupDropdown(){this.labelEl=this.el.parentElement.querySelector("label"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("select-wrapper","input-field"),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ")),this.el.before(this.wrapper);const t=document.createElement("div");t.classList.add("hide-select"),this.wrapper.append(t),t.appendChild(this.el),this.el.disabled&&this.wrapper.classList.add("disabled"),this.selectOptions=Array.from(this.el.children).filter((t=>["OPTION","OPTGROUP"].includes(t.tagName))),this.dropdownOptions=document.createElement("ul"),this.dropdownOptions.id=`select-options-${s.Utils.guid()}`,this.dropdownOptions.classList.add("dropdown-content","select-dropdown"),this.dropdownOptions.setAttribute("role","listbox"),this.dropdownOptions.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.dropdownOptions.classList.add("multiple-select-dropdown"),this.selectOptions.length>0&&this.selectOptions.forEach((t=>{if("OPTION"===t.tagName){const e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if("OPTGROUP"===t.tagName){const e="opt-group-"+s.Utils.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e),i.innerHTML=`${t.getAttribute("label")}`,this.dropdownOptions.append(i);const n=[];Array.from(t.children).filter((t=>"OPTION"===t.tagName)).forEach((t=>{const e=this._createAndAppendOptionWithIcon(t,"optgroup-option"),i="opt-child-"+s.Utils.guid();e.id=i,n.push(i),this._addOptionToValues(t,e)})),i.setAttribute("aria-owns",n.join(" "))}})),this.wrapper.append(this.dropdownOptions),this.input=document.createElement("input"),this.input.id="m_select-input-"+s.Utils.guid(),this.input.classList.add("select-dropdown","dropdown-trigger"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.dropdownOptions.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.el.disabled&&(this.input.disabled=!0),this.labelEl&&(this.input.after(this.labelEl),this.labelEl.setAttribute("for",this.input.id),this.labelEl.id="m_select-label-"+s.Utils.guid(),this.dropdownOptions.setAttribute("aria-labelledby",this.labelEl.id));const e=this.el.attributes;for(let t=0;t{const i=this.dropdownOptions.querySelector(".selected");if(i&&(s.Utils.keyDown=!0,this.dropdown.focusedIndex=[...i.parentNode.children].indexOf(i),this.dropdown._focusFocusedItem(),s.Utils.keyDown=!1,this.dropdown.isScrollable)){let t=i.getBoundingClientRect().top-this.dropdownOptions.getBoundingClientRect().top;t-=this.dropdownOptions.clientHeight/2,this.dropdownOptions.scrollTop=t}this.input.ariaExpanded="true",e&&"function"==typeof e&&e.call(this.dropdown,this.el)},t.onCloseEnd=t=>{this.input.ariaExpanded="false",i&&"function"==typeof i&&i.call(this.dropdown,this.el)},t.closeOnClick=!1,this.dropdown=n.Dropdown.init(this.input,t)}this._setSelectedStates(),this.labelEl&&this.input.after(this.labelEl)}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeDropdown(){this.wrapper.querySelector(".caret").remove(),this.input.remove(),this.dropdownOptions.remove(),this.wrapper.before(this.el),this.wrapper.remove()}_createAndAppendOptionWithIcon(t,e){var i;const s=document.createElement("li");s.setAttribute("role","option"),t.disabled&&(s.classList.add("disabled"),s.ariaDisabled="true"),"optgroup-option"===e&&s.classList.add(e);const n=document.createElement("span");this.isMultiple?n.innerHTML=``:n.innerHTML=t.innerHTML,s.appendChild(n);const o=t.getAttribute("data-icon"),a=null===(i=t.getAttribute("class"))||void 0===i?void 0:i.split();if(o){const t=document.createElement("img");a&&t.classList.add(a),t.src=o,t.ariaHidden="true",s.prepend(t)}return this.dropdownOptions.append(s),s}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";const e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";const e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach((t=>this._deselectValue(t)))}_isValueSelected(t){return this.getSelectedValues().some((e=>e===t.el.value))}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,(t=>t))}_setValueToInput(){const t=this._getSelectedOptions(),e=this._values.filter((e=>t.indexOf(e.el)>=0)).map((t=>t.optionEl.querySelector("span").innerText.trim()));if(0===e.length){const t=this.el.querySelector("option:disabled");if(t&&""===t.value)return void(this.input.value=t.innerText)}this.input.value=e.join(", ")}_setSelectedStates(){this._values.forEach((t=>{const e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.dropdownOptions,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")}))}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach((t=>t.classList.remove("selected"))),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map((t=>t.value))}}e.FormSelect=l},288:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Sidenav=void 0;const n=s(i(30)),o=i(593),a=i(999),l={edge:"left",draggable:!0,dragTargetWidth:"10px",inDuration:250,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,preventScrolling:!0};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleDragTargetDrag=t=>{if(!this.options.draggable||this._isCurrentlyFixed()||this._verticallyScrolling)return;this.isDragged||this._startDrag(t),this._dragMoveUpdate(t);let e=this._xPos-this._startingXpos;const i=e>0?"right":"left";e=Math.min(this._width,Math.abs(e)),this.options.edge===i&&(e=0);let s=e,n="translateX(-100%)";"right"===this.options.edge&&(n="translateX(100%)",s=-s),this.percentOpen=Math.min(1,e/this._width),this.el.style.transform=`${n} translateX(${s}px)`,this._overlay.style.opacity=this.percentOpen.toString()},this._handleDragTargetRelease=()=>{this.isDragged&&(this.percentOpen>.2?this.open():this._animateOut(),this.isDragged=!1,this._verticallyScrolling=!1)},this._handleCloseDrag=t=>{if(this.isOpen){if(!this.options.draggable||this._isCurrentlyFixed()||this._verticallyScrolling)return;this.isDragged||this._startDrag(t),this._dragMoveUpdate(t);let e=this._xPos-this._startingXpos,i=e>0?"right":"left";e=Math.min(this._width,Math.abs(e)),this.options.edge!==i&&(e=0);let s=-e;"right"===this.options.edge&&(s=-s),this.percentOpen=Math.min(1,1-e/this._width),this.el.style.transform=`translateX(${s}px)`,this._overlay.style.opacity=this.percentOpen.toString()}},this._handleCloseRelease=()=>{this.isOpen&&this.isDragged&&(this.percentOpen>.8?this._animateIn():this.close(),this.isDragged=!1,this._verticallyScrolling=!1)},this._handleCloseTriggerClick=t=>{t.target.closest(".sidenav-close")&&!this._isCurrentlyFixed()&&this.close()},this._handleWindowResize=()=>{this.lastWindowWidth!==window.innerWidth&&(window.innerWidth>992?this.open():this.close()),this.lastWindowWidth=window.innerWidth,this.lastWindowHeight=window.innerHeight},this.open=()=>{!0!==this.isOpen&&(this.isOpen=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this._isCurrentlyFixed()?(n.default.remove(this.el),(0,n.default)({targets:this.el,translateX:0,duration:0,easing:"easeOutQuad"}),this._enableBodyScrolling(),this._overlay.style.display="none"):(this.options.preventScrolling&&this._preventBodyScrolling(),this.isDragged&&1==this.percentOpen||this._animateIn()))},this.close=()=>{if(!1!==this.isOpen)if(this.isOpen=!1,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this._isCurrentlyFixed()){const t="left"===this.options.edge?"-105%":"105%";this.el.style.transform=`translateX(${t})`}else this._enableBodyScrolling(),this.isDragged&&0==this.percentOpen?this._overlay.style.display="none":this._animateOut()},this.el.M_Sidenav=this,this.options=Object.assign(Object.assign({},r.defaults),e),this.id=this.el.id,this.isOpen=!1,this.isFixed=this.el.classList.contains("sidenav-fixed"),this.isDragged=!1,this.lastWindowWidth=window.innerWidth,this.lastWindowHeight=window.innerHeight,this._createOverlay(),this._createDragTarget(),this._setupEventHandlers(),this._setupClasses(),this._setupFixed(),r._sidenavs.push(this)}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Sidenav}destroy(){this._removeEventHandlers(),this._enableBodyScrolling(),this._overlay.parentNode.removeChild(this._overlay),this.dragTarget.parentNode.removeChild(this.dragTarget),this.el.M_Sidenav=void 0,this.el.style.transform="";const t=r._sidenavs.indexOf(this);t>=0&&r._sidenavs.splice(t,1)}_createOverlay(){this._overlay=document.createElement("div"),this._overlay.classList.add("sidenav-overlay"),this._overlay.addEventListener("click",this.close),document.body.appendChild(this._overlay)}_setupEventHandlers(){0===r._sidenavs.length&&document.body.addEventListener("click",this._handleTriggerClick);var t=null;this.dragTarget.addEventListener("touchmove",this._handleDragTargetDrag,t),this.dragTarget.addEventListener("touchend",this._handleDragTargetRelease),this._overlay.addEventListener("touchmove",this._handleCloseDrag,t),this._overlay.addEventListener("touchend",this._handleCloseRelease),this.el.addEventListener("touchmove",this._handleCloseDrag,t),this.el.addEventListener("touchend",this._handleCloseRelease),this.el.addEventListener("click",this._handleCloseTriggerClick),this.isFixed&&window.addEventListener("resize",this._handleWindowResize)}_removeEventHandlers(){1===r._sidenavs.length&&document.body.removeEventListener("click",this._handleTriggerClick),this.dragTarget.removeEventListener("touchmove",this._handleDragTargetDrag),this.dragTarget.removeEventListener("touchend",this._handleDragTargetRelease),this._overlay.removeEventListener("touchmove",this._handleCloseDrag),this._overlay.removeEventListener("touchend",this._handleCloseRelease),this.el.removeEventListener("touchmove",this._handleCloseDrag),this.el.removeEventListener("touchend",this._handleCloseRelease),this.el.removeEventListener("click",this._handleCloseTriggerClick),this.isFixed&&window.removeEventListener("resize",this._handleWindowResize)}_handleTriggerClick(t){const e=t.target.closest(".sidenav-trigger");if(t.target&&e){const i=o.Utils.getIdFromTrigger(e),s=document.getElementById(i).M_Sidenav;s&&s.open(e),t.preventDefault()}}_startDrag(t){const e=t.targetTouches[0].clientX;this.isDragged=!0,this._startingXpos=e,this._xPos=this._startingXpos,this._time=Date.now(),this._width=this.el.getBoundingClientRect().width,this._overlay.style.display="block",this._initialScrollTop=this.isOpen?this.el.scrollTop:o.Utils.getDocumentScrollTop(),this._verticallyScrolling=!1,n.default.remove(this.el),n.default.remove(this._overlay)}_dragMoveUpdate(t){const e=t.targetTouches[0].clientX,i=this.isOpen?this.el.scrollTop:o.Utils.getDocumentScrollTop();this.deltaX=Math.abs(this._xPos-e),this._xPos=e,this.velocityX=this.deltaX/(Date.now()-this._time),this._time=Date.now(),this._initialScrollTop!==i&&(this._verticallyScrolling=!0)}_setupClasses(){"right"===this.options.edge&&(this.el.classList.add("right-aligned"),this.dragTarget.classList.add("right-aligned"))}_removeClasses(){this.el.classList.remove("right-aligned"),this.dragTarget.classList.remove("right-aligned")}_setupFixed(){this._isCurrentlyFixed()&&this.open()}_isCurrentlyFixed(){return this.isFixed&&window.innerWidth>992}_createDragTarget(){const t=document.createElement("div");t.classList.add("drag-target"),t.style.width=this.options.dragTargetWidth,document.body.appendChild(t),this.dragTarget=t}_preventBodyScrolling(){document.body.style.overflow="hidden"}_enableBodyScrolling(){document.body.style.overflow=""}_animateIn(){this._animateSidenavIn(),this._animateOverlayIn()}_animateSidenavIn(){let t="left"===this.options.edge?-1:1;this.isDragged&&(t="left"===this.options.edge?t+this.percentOpen:t-this.percentOpen),n.default.remove(this.el),(0,n.default)({targets:this.el,translateX:[100*t+"%",0],duration:this.options.inDuration,easing:"easeOutQuad",complete:()=>{"function"==typeof this.options.onOpenEnd&&this.options.onOpenEnd.call(this,this.el)}})}_animateOverlayIn(){let t=0;this.isDragged?t=this.percentOpen:this._overlay.style.display="block",n.default.remove(this._overlay),(0,n.default)({targets:this._overlay,opacity:[t,1],duration:this.options.inDuration,easing:"easeOutQuad"})}_animateOut(){this._animateSidenavOut(),this._animateOverlayOut()}_animateSidenavOut(){const t="left"===this.options.edge?-1:1;let e=0;this.isDragged&&(e="left"===this.options.edge?t+this.percentOpen:t-this.percentOpen),n.default.remove(this.el),(0,n.default)({targets:this.el,translateX:[100*e+"%",105*t+"%"],duration:this.options.outDuration,easing:"easeOutQuad",complete:()=>{"function"==typeof this.options.onCloseEnd&&this.options.onCloseEnd.call(this,this.el)}})}_animateOverlayOut(){n.default.remove(this._overlay),(0,n.default)({targets:this._overlay,opacity:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:()=>{this._overlay.style.display="none"}})}}e.Sidenav=r,r._sidenavs=[]},943:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Slider=void 0;const n=s(i(30)),o=i(593),a=i(999);let l={indicators:!0,height:400,duration:500,interval:6e3,pauseOnFocus:!0,pauseOnHover:!0,indicatorLabelFunc:null};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleIndicatorClick=t=>{const e=t.target.parentElement,i=[...e.parentNode.children].indexOf(e);this._focusCurrent=!0,this.set(i)},this._handleAutoPauseHover=()=>{this._hovered=!0,null!=this.interval&&this._pause(!0)},this._handleAutoPauseFocus=()=>{this._focused=!0,null!=this.interval&&this._pause(!0)},this._handleAutoStartHover=()=>{this._hovered=!1,this.options.pauseOnFocus&&this._focused||!this.eventPause||this.start()},this._handleAutoStartFocus=()=>{this._focused=!1,this.options.pauseOnHover&&this._hovered||!this.eventPause||this.start()},this._handleInterval=()=>{const t=this._slider.querySelector(".active");let e=[...t.parentNode.children].indexOf(t);this._slides.length===e+1?e=0:e+=1,this.set(e)},this.pause=()=>{this._pause(!1)},this.start=()=>{clearInterval(this.interval),this.interval=setInterval(this._handleInterval,this.options.duration+this.options.interval),this.eventPause=!1},this.next=()=>{let t=this.activeIndex+1;t>=this._slides.length?t=0:t<0&&(t=this._slides.length-1),this.set(t)},this.prev=()=>{let t=this.activeIndex-1;t>=this._slides.length?t=0:t<0&&(t=this._slides.length-1),this.set(t)},this.el.M_Slider=this,this.options=Object.assign(Object.assign({},r.defaults),e),this.interval=null,this.eventPause=!1,this._hovered=!1,this._focused=!1,this._focusCurrent=!1,this._slider=this.el.querySelector(".slides"),this._slides=Array.from(this._slider.querySelectorAll("li")),this.activeIndex=this._slides.findIndex((t=>t.classList.contains("active"))),-1!==this.activeIndex&&(this._activeSlide=this._slides[this.activeIndex]),this._setSliderHeight(),this._slider.hasAttribute("id")?this._sliderId=this._slider.getAttribute("id"):(this._sliderId="slider-"+o.Utils.guid(),this._slider.setAttribute("id",this._sliderId));const i="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";this._slides.forEach((t=>{const e=t.querySelector("img");e&&e.src!==i&&(e.style.backgroundImage="url("+e.src+")",e.src=i),t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.style.visibility="hidden"})),this._setupIndicators(),this._activeSlide?(this._activeSlide.style.display="block",this._activeSlide.style.visibility="visible"):(this.activeIndex=0,this._slides[0].classList.add("active"),this._slides[0].style.visibility="visible",this._activeSlide=this._slides[0],this._animateSlide(this._slides[0],!0),this.options.indicators&&this._indicators[this.activeIndex].children[0].classList.add("active")),this._setupEventHandlers(),this.start()}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Slider}destroy(){this.pause(),this._removeIndicators(),this._removeEventHandlers(),this.el.M_Slider=void 0}_setupEventHandlers(){this.options.pauseOnFocus&&(this.el.addEventListener("focusin",this._handleAutoPauseFocus),this.el.addEventListener("focusout",this._handleAutoStartFocus)),this.options.pauseOnHover&&(this.el.addEventListener("mouseenter",this._handleAutoPauseHover),this.el.addEventListener("mouseleave",this._handleAutoStartHover)),this.options.indicators&&this._indicators.forEach((t=>{t.addEventListener("click",this._handleIndicatorClick)}))}_removeEventHandlers(){this.options.pauseOnFocus&&(this.el.removeEventListener("focusin",this._handleAutoPauseFocus),this.el.removeEventListener("focusout",this._handleAutoStartFocus)),this.options.pauseOnHover&&(this.el.removeEventListener("mouseenter",this._handleAutoPauseHover),this.el.removeEventListener("mouseleave",this._handleAutoStartHover)),this.options.indicators&&this._indicators.forEach((t=>{t.removeEventListener("click",this._handleIndicatorClick)}))}_animateSlide(t,e){let i=0,s=0;(0,n.default)({targets:t,opacity:e?[0,1]:[1,0],duration:this.options.duration,easing:"easeOutQuad"});const o=t.querySelector(".caption");o&&(o.classList.contains("center-align")?s=-100:o.classList.contains("right-align")?i=100:o.classList.contains("left-align")&&(i=-100),(0,n.default)({targets:o,opacity:e?[0,1]:[1,0],translateX:e?[i,0]:[0,i],translateY:e?[s,0]:[0,s],duration:this.options.duration,delay:this.options.duration,easing:"easeOutQuad"}))}_setSliderHeight(){this.el.classList.contains("fullscreen")||(this.options.indicators?this.el.style.height=this.options.height+40+"px":this.el.style.height=this.options.height+"px",this._slider.style.height=this.options.height+"px")}_setupIndicators(){if(this.options.indicators){const t=document.createElement("ul");t.classList.add("indicators");const e=[];this._slides.forEach(((i,s)=>{const n=this.options.indicatorLabelFunc?this.options.indicatorLabelFunc.call(this,s+1,0===s):`${s+1}`,o=document.createElement("li");o.classList.add("indicator-item"),o.innerHTML=``,e.push(o),t.append(o)})),this.el.append(t),this._indicators=e}}_removeIndicators(){this.el.querySelector("ul.indicators").remove()}set(t){if(t>=this._slides.length?t=0:t<0&&(t=this._slides.length-1),this.activeIndex===t)return;this._activeSlide=this._slides[this.activeIndex];const e=this._activeSlide.querySelector(".caption");if(this._activeSlide.classList.remove("active"),this._slides.forEach((t=>t.style.visibility="visible")),(0,n.default)({targets:this._activeSlide,opacity:0,duration:this.options.duration,easing:"easeOutQuad",complete:()=>{this._slides.forEach((t=>{t.classList.contains("active")||((0,n.default)({targets:t,opacity:0,translateX:0,translateY:0,duration:0,easing:"easeOutQuad"}),t.style.visibility="hidden")}))}}),e.style.opacity="0",this.options.indicators){const e=this._indicators[this.activeIndex].children[0],i=this._indicators[t].children[0];e.classList.remove("active"),i.classList.add("active"),"function"==typeof this.options.indicatorLabelFunc&&(e.ariaLabel=this.options.indicatorLabelFunc.call(this,this.activeIndex,!1),i.ariaLabel=this.options.indicatorLabelFunc.call(this,t,!0))}this._animateSlide(this._slides[t],!0),this._slides[t].classList.add("active"),this.activeIndex=t,null!=this.interval&&this.start()}_pause(t){clearInterval(this.interval),this.eventPause=t,this.interval=null}}e.Slider=r},649:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tabs=void 0;const n=s(i(30)),o=i(476),a=i(999);let l={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0};class r extends a.Component{constructor(t,e){super(t,e,r),this._handleWindowResize=()=>{this._setTabsAndTabWidth(),0!==this._tabWidth&&0!==this._tabsWidth&&(this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px")},this._handleTabClick=t=>{const e=t.target,i=e.parentElement;if(!e||!i.classList.contains("tab"))return;if(i.classList.contains("disabled"))return void t.preventDefault();if(e.hasAttribute("target"))return;this._activeTabLink.classList.remove("active");const s=this._content;this._activeTabLink=e,e.hash&&(this._content=document.querySelector(e.hash)),this._tabLinks=this.el.querySelectorAll("li.tab > a"),this._activeTabLink.classList.add("active");const n=this._index;this._index=Math.max(Array.from(this._tabLinks).indexOf(e),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this._index,(()=>{"function"==typeof this.options.onShow&&this.options.onShow.call(this,this._content)})):this._content&&(this._content.style.display="block",this._content.classList.add("active"),"function"==typeof this.options.onShow&&this.options.onShow.call(this,this._content),s&&s!==this._content&&(s.style.display="none",s.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(n),t.preventDefault()},this.el.M_Tabs=this,this.options=Object.assign(Object.assign({},r.defaults),e),this._tabLinks=this.el.querySelectorAll("li.tab > a"),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return l}static init(t,e={}){return super.init(t,e,r)}static getInstance(t){return t.M_Tabs}destroy(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.el.M_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_createIndicator(){const t=document.createElement("li");t.classList.add("indicator"),this.el.appendChild(t),this._indicator=t,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setupActiveTabLink(){this._activeTabLink=Array.from(this._tabLinks).find((t=>t.getAttribute("href")===location.hash)),this._activeTabLink||(this._activeTabLink=this.el.querySelector("li.tab a.active")),0===this._activeTabLink.length&&(this._activeTabLink=this.el.querySelector("li.tab a")),Array.from(this._tabLinks).forEach((t=>t.classList.remove("active"))),this._activeTabLink.classList.add("active"),this._index=Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink),0),this._activeTabLink&&this._activeTabLink.hash&&(this._content=document.querySelector(this._activeTabLink.hash),this._content.classList.add("active"))}_setupSwipeableTabs(){window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);const t=[];this._tabLinks.forEach((e=>{if(e.hash){const i=document.querySelector(e.hash);i.classList.add("carousel-item"),t.push(i)}}));const e=document.createElement("div");e.classList.add("tabs-content","carousel","carousel-slider"),t[0].parentElement.insertBefore(e,t[0]),t.forEach((t=>{e.appendChild(t),t.style.display=""}));const i=this._activeTabLink.parentElement,s=Array.from(i.parentNode.children).indexOf(i);this._tabsCarousel=o.Carousel.init(e,{fullWidth:!0,noWrap:!0,onCycleTo:t=>{const e=this._index;this._index=Array.from(t.parentNode.children).indexOf(t),this._activeTabLink.classList.remove("active"),this._activeTabLink=Array.from(this._tabLinks)[this._index],this._activeTabLink.classList.add("active"),this._animateIndicator(e),"function"==typeof this.options.onShow&&this.options.onShow.call(this,this._content)}}),this._tabsCarousel.set(s)}_teardownSwipeableTabs(){const t=this._tabsCarousel.el;this._tabsCarousel.destroy(),t.after(t.children),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach((t=>{if(t!==this._activeTabLink&&t.hash){const e=document.querySelector(t.hash);e&&(e.style.display="none")}}))}_teardownNormalTabs(){this._tabLinks.forEach((t=>{if(t.hash){const e=document.querySelector(t.hash);e&&(e.style.display="")}}))}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90;const s={targets:this._indicator,left:{value:this._calcLeftPos(this._activeTabLink),delay:e},right:{value:this._calcRightPos(this._activeTabLink),delay:i},duration:this.options.duration,easing:"easeOutQuad"};n.default.remove(this._indicator),(0,n.default)(s)}select(t){const e=Array.from(this._tabLinks).find((e=>e.getAttribute("href")==="#"+t));e&&e.click()}}e.Tabs=r},968:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TapTarget=void 0;const s=i(593),n=i(999);let o={onOpen:null,onClose:null};class a extends n.Component{constructor(t,e){super(t,e,a),this._handleThrottledResize=s.Utils.throttle((function(){this._handleResize()}),200).bind(this),this._handleTargetClick=()=>{this.open()},this._handleOriginClick=()=>{this.close()},this._handleResize=()=>{this._calculatePositioning()},this._handleDocumentClick=t=>{t.target.closest(".tap-target-wrapper")||(this.close(),t.preventDefault(),t.stopPropagation())},this.open=()=>{this.isOpen||("function"==typeof this.options.onOpen&&this.options.onOpen.call(this,this._origin),this.isOpen=!0,this.wrapper.classList.add("open"),document.body.addEventListener("click",this._handleDocumentClick,!0),document.body.addEventListener("touchend",this._handleDocumentClick))},this.close=()=>{this.isOpen&&("function"==typeof this.options.onClose&&this.options.onClose.call(this,this._origin),this.isOpen=!1,this.wrapper.classList.remove("open"),document.body.removeEventListener("click",this._handleDocumentClick,!0),document.body.removeEventListener("touchend",this._handleDocumentClick))},this.el.M_TapTarget=this,this.options=Object.assign(Object.assign({},a.defaults),e),this.isOpen=!1,this._origin=document.querySelector(`#${t.dataset.target}`),this._setup(),this._calculatePositioning(),this._setupEventHandlers()}static get defaults(){return o}static init(t,e={}){return super.init(t,e,a)}static getInstance(t){return t.M_TapTarget}destroy(){this._removeEventHandlers(),this.el.TapTarget=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleTargetClick),this.originEl.addEventListener("click",this._handleOriginClick),window.addEventListener("resize",this._handleThrottledResize)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleTargetClick),this.originEl.removeEventListener("click",this._handleOriginClick),window.removeEventListener("resize",this._handleThrottledResize)}_setup(){this.wrapper=this.el.parentElement,this.waveEl=this.wrapper.querySelector(".tap-target-wave"),this.originEl=this.wrapper.querySelector(".tap-target-origin"),this.contentEl=this.el.querySelector(".tap-target-content"),this.wrapper.classList.contains(".tap-target-wrapper")||(this.wrapper=document.createElement("div"),this.wrapper.classList.add("tap-target-wrapper"),this.el.before(this.wrapper),this.wrapper.append(this.el)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.classList.add("tap-target-content"),this.el.append(this.contentEl)),this.waveEl||(this.waveEl=document.createElement("div"),this.waveEl.classList.add("tap-target-wave"),this.originEl||(this.originEl=this._origin.cloneNode(!0),this.originEl.classList.add("tap-target-origin"),this.originEl.removeAttribute("id"),this.originEl.removeAttribute("style"),this.waveEl.append(this.originEl)),this.wrapper.append(this.waveEl))}_offset(t){const e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.pageYOffset-i.clientTop,left:e.left+window.pageXOffset-i.clientLeft}}_calculatePositioning(){let t="fixed"===getComputedStyle(this._origin).position;if(!t){let e=this._origin;const i=[];for(;(e=e.parentNode)&&e!==document;)i.push(e);for(let e=0;eh,p=n<=d,m=n>d,v=o>=.25*a&&o<=.75*a,g=this.el.offsetWidth,_=this.el.offsetHeight,f=n+i/2-_/2,y=o+e/2-g/2,w=t?"fixed":"absolute",b=v?g:g/2+e,E=_/2,L=p?_/2:0,C=c&&!v?g/2-e:0,k=e,T=m?"bottom":"top",O=2*e,x=O,S=_/2-x/2,M=g/2-O/2;this.wrapper.style.top=p?f+"px":"",this.wrapper.style.right=u?a-y-g-r+"px":"",this.wrapper.style.bottom=m?l-f-_+"px":"",this.wrapper.style.left=c?y+"px":"",this.wrapper.style.position=w,this.contentEl.style.width=b+"px",this.contentEl.style.height=E+"px",this.contentEl.style.top=L+"px",this.contentEl.style.right="0px",this.contentEl.style.bottom="0px",this.contentEl.style.left=C+"px",this.contentEl.style.padding=k+"px",this.contentEl.style.verticalAlign=T,this.waveEl.style.top=S+"px",this.waveEl.style.left=M+"px",this.waveEl.style.width=O+"px",this.waveEl.style.height=x+"px"}}e.TapTarget=a},707:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Timepicker=void 0;const s=i(799),n=i(593),o=i(999);let a={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},autoClose:!1,twelveHour:!0,vibrate:!0,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onSelect:null};class l extends o.Component{constructor(t,e){super(t,e,l),this._handleInputClick=()=>{this.open()},this._handleInputKeydown=t=>{n.Utils.keys.ENTER.includes(t.key)&&(t.preventDefault(),this.open())},this._handleTimeInputEnterKey=t=>{n.Utils.keys.ENTER.includes(t.key)&&(t.preventDefault(),this._inputFromTextField())},this._handleClockClickStart=t=>{t.preventDefault();let e=this.plate.getBoundingClientRect(),i=e.left,s=e.top;this.x0=i+this.options.dialRadius,this.y0=s+this.options.dialRadius,this.moved=!1;let n=l._Pos(t);this.dx=n.x-this.x0,this.dy=n.y-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("mousemove",this._handleDocumentClickMove),document.addEventListener("touchmove",this._handleDocumentClickMove),document.addEventListener("mouseup",this._handleDocumentClickEnd),document.addEventListener("touchend",this._handleDocumentClickEnd)},this._handleDocumentClickMove=t=>{t.preventDefault();let e=l._Pos(t),i=e.x-this.x0,s=e.y-this.y0;this.moved=!0,this.setHand(i,s,!1)},this._handleDocumentClickEnd=t=>{t.preventDefault(),document.removeEventListener("mouseup",this._handleDocumentClickEnd),document.removeEventListener("touchend",this._handleDocumentClickEnd);let e=l._Pos(t),i=e.x-this.x0,s=e.y-this.y0;this.moved&&i===this.dx&&s===this.dy&&this.setHand(i,s),"hours"===this.currentView?this.showView("minutes",this.options.duration/2):this.options.autoClose&&(this.minutesView.classList.add("timepicker-dial-out"),setTimeout((()=>{this.done()}),this.options.duration/2)),"function"==typeof this.options.onSelect&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("mousemove",this._handleDocumentClickMove),document.removeEventListener("touchmove",this._handleDocumentClickMove)},this._handleAmPmClick=t=>{const e=t.target;this.amOrPm=e.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()},this.showView=(t,e=null)=>{"minutes"===t&&getComputedStyle(this.hoursView).visibility;let i="hours"===t,s=i?this.hoursView:this.minutesView,n=i?this.minutesView:this.hoursView;this.currentView=t,i?(this.inputHours.classList.add("text-primary"),this.inputMinutes.classList.remove("text-primary")):(this.inputHours.classList.remove("text-primary"),this.inputMinutes.classList.add("text-primary")),n.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout((()=>{n.style.visibility="hidden"}),this.options.duration)},this._inputFromTextField=()=>{const t="hours"===this.currentView;if(t){const e=parseInt(this.inputHours.value);if(e>0&&e<13)this.drawClockFromTimeInput(e,t),this.showView("minutes",this.options.duration/2),this.hours=e,this.inputMinutes.focus();else{const t=(new Date).getHours();this.inputHours.value=(t%12).toString()}}else{const e=parseInt(this.inputMinutes.value);if(e>=0&&e<60)this.inputMinutes.value=l._addLeadingZero(e),this.drawClockFromTimeInput(e,t),this.minutes=e,this.modalEl.querySelector(".confirmation-btns :nth-child(2)").focus();else{const t=(new Date).getMinutes();this.inputMinutes.value=l._addLeadingZero(t)}}},this.open=()=>{this.isOpen||(this.isOpen=!0,this._updateTimeFromInput(),this.showView("hours"),this.modal.open(void 0))},this.close=()=>{this.isOpen&&(this.isOpen=!1,this.modal.close())},this.done=(t=null,e=null)=>{let i=this.el.value,s=e?"":l._addLeadingZero(this.hours)+":"+l._addLeadingZero(this.minutes);this.time=s,!e&&this.options.twelveHour&&(s=`${s} ${this.amOrPm}`),this.el.value=s,s!==i&&this.el.dispatchEvent(new Event("change")),this.close(),this.el.focus()},this.clear=()=>{this.done(null,!0)},this.el.M_Timepicker=this,this.options=Object.assign(Object.assign({},l.defaults),e),this.id=n.Utils.guid(),this._insertHTMLIntoDOM(),this._setupModal(),this._setupVariables(),this._setupEventHandlers(),this._clockSetup(),this._pickerSetup()}static get defaults(){return a}static init(t,e={}){return super.init(t,e,l)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static _Pos(t){return t.type.startsWith("touch")&&t.targetTouches.length>=1?{x:t.targetTouches[0].clientX,y:t.targetTouches[0].clientY}:{x:t.clientX,y:t.clientY}}static getInstance(t){return t.M_Timepicker}destroy(){this._removeEventHandlers(),this.modal.destroy(),this.modalEl.remove(),this.el.M_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("mousedown",this._handleClockClickStart),this.plate.addEventListener("touchstart",this._handleClockClickStart),this.digitalClock.addEventListener("keyup",this._inputFromTextField),this.inputHours.addEventListener("click",(()=>this.showView("hours"))),this.inputMinutes.addEventListener("click",(()=>this.showView("minutes")))}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown)}_insertHTMLIntoDOM(){const t=document.createElement("template");t.innerHTML=l._template.trim(),this.modalEl=t.content.firstChild,this.modalEl.id="modal-"+this.id;const e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.modalEl):this.el.parentElement.appendChild(this.modalEl)}_setupModal(){this.modal=s.Modal.init(this.modalEl,{onOpenStart:this.options.onOpenStart,onOpenEnd:this.options.onOpenEnd,onCloseStart:this.options.onCloseStart,onCloseEnd:()=>{"function"==typeof this.options.onCloseEnd&&this.options.onCloseEnd.call(this),this.isOpen=!1}})}_setupVariables(){this.currentView="hours",this.vibrate=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,this._canvas=this.modalEl.querySelector(".timepicker-canvas"),this.plate=this.modalEl.querySelector(".timepicker-plate"),this.digitalClock=this.modalEl.querySelector(".timepicker-display-column"),this.hoursView=this.modalEl.querySelector(".timepicker-hours"),this.minutesView=this.modalEl.querySelector(".timepicker-minutes"),this.inputHours=this.modalEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.modalEl.querySelector(".timepicker-input-minutes"),this.spanAmPm=this.modalEl.querySelector(".timepicker-span-am-pm"),this.footer=this.modalEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_createButton(t,e){const i=document.createElement("button");return i.classList.add("btn-flat","waves-effect"),i.style.visibility=e,i.type="button",i.tabIndex=this.options.twelveHour?3:1,i.innerText=t,i}_pickerSetup(){const t=this._createButton(this.options.i18n.clear,this.options.showClearBtn?"":"hidden");t.classList.add("timepicker-clear"),t.addEventListener("click",this.clear),this.footer.appendChild(t);const e=document.createElement("div");e.classList.add("confirmation-btns"),this.footer.append(e);const i=this._createButton(this.options.i18n.cancel,"");i.classList.add("timepicker-close"),i.addEventListener("click",this.close),e.appendChild(i);const s=this._createButton(this.options.i18n.done,"");s.classList.add("timepicker-close"),s.addEventListener("click",this.done),e.appendChild(s)}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("div"),this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("div"),this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=2*t,s=l._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let n=l._createSVGEl("g");n.setAttribute("transform","translate("+t+","+t+")");let o=l._createSVGEl("circle");o.setAttribute("class","timepicker-canvas-bearing"),o.setAttribute("cx","0"),o.setAttribute("cy","0"),o.setAttribute("r","4");let a=l._createSVGEl("line");a.setAttribute("x1","0"),a.setAttribute("y1","0");let r=l._createSVGEl("circle");r.setAttribute("class","timepicker-canvas-bg"),r.setAttribute("r",e.toString()),n.appendChild(a),n.appendChild(r),n.appendChild(o),s.appendChild(n),this._canvas.appendChild(s),this.hand=a,this.bg=r,this.bearing=o,this.g=n}_buildHoursView(){const t=document.createElement("div");if(t.classList.add("timepicker-tick"),this.options.twelveHour)for(let e=1;e<13;e+=1){const i=t.cloneNode(!0),s=e/6*Math.PI,n=this.options.outerRadius;i.style.left=this.options.dialRadius+Math.sin(s)*n-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*n-this.options.tickRadius+"px",i.innerHTML=0===e?"00":e.toString(),this.hoursView.appendChild(i)}else for(let e=0;e<24;e+=1){const i=t.cloneNode(!0),s=e/6*Math.PI,n=e>0&&e<13?this.options.innerRadius:this.options.outerRadius;i.style.left=this.options.dialRadius+Math.sin(s)*n-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*n-this.options.tickRadius+"px",i.innerHTML=0===e?"00":e.toString(),this.hoursView.appendChild(i)}}_buildMinutesView(){const t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){const i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.innerHTML=l._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){this.options.twelveHour&&("PM"===this.amOrPm?(this._amBtn.classList.remove("text-primary"),this._pmBtn.classList.add("text-primary")):"AM"===this.amOrPm&&(this._amBtn.classList.add("text-primary"),this._pmBtn.classList.remove("text-primary")))}_updateTimeFromInput(){let t=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&void 0!==t[1]&&(t[1].toUpperCase().indexOf("AM")>0?this.amOrPm="AM":this.amOrPm="PM",t[1]=t[1].replace("AM","").replace("PM","")),"now"===t[0]){let e=new Date(+new Date+this.options.fromNow);t=[e.getHours().toString(),e.getMinutes().toString()],this.options.twelveHour&&(this.amOrPm=parseInt(t[0])>=12&&parseInt(t[0])<24?"PM":"AM")}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.inputHours.value=this.hours,this.inputMinutes.value=l._addLeadingZero(this.minutes),this._updateAmPmView()}resetClock(t){var e;let i=this.currentView,s=this[i],n="hours"===i,o=s*(Math.PI/(n?6:30)),a=n&&s>0&&s<13?this.options.innerRadius:this.options.outerRadius,l=Math.sin(o)*a,r=-Math.cos(o)*a,h=this;t?(null===(e=this.canvas)||void 0===e||e.classList.add("timepicker-canvas-out"),setTimeout((()=>{var t;null===(t=h.canvas)||void 0===t||t.classList.remove("timepicker-canvas-out"),h.setHand(l,r)}),t)):this.setHand(l,r)}drawClockFromTimeInput(t,e){const i=t*(Math.PI/(e?6:30));let s;this.options.twelveHour&&(s=this.options.outerRadius);let n=Math.sin(i)*(s-this.options.tickRadius),o=-Math.cos(i)*(s-this.options.tickRadius),a=Math.sin(i)*s,l=-Math.cos(i)*s;this.hand.setAttribute("x2",n.toString()),this.hand.setAttribute("y2",o.toString()),this.bg.setAttribute("cx",a.toString()),this.bg.setAttribute("cy",l.toString())}setHand(t,e,i=!1){let s=Math.atan2(t,-e),n="hours"===this.currentView,o=Math.PI/(n||i?6:30),a=Math.sqrt(t*t+e*e),r=n&&a<(this.options.outerRadius+this.options.innerRadius)/2,h=r?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(h=this.options.outerRadius),s<0&&(s=2*Math.PI+s);let d=Math.round(s/o);s=d*o,this.options.twelveHour?n?0===d&&(d=12):(i&&(d*=5),60===d&&(d=0)):n?(12===d&&(d=0),d=r?0===d?12:d:0===d?0:d+12):(i&&(d*=5),60===d&&(d=0)),this[this.currentView]!==d&&this.vibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator[this.vibrate](10),this.vibrateTimer=setTimeout((()=>{this.vibrateTimer=null}),100))),this[this.currentView]=d,n?this.inputHours.value=d.toString():this.inputMinutes.value=l._addLeadingZero(d);let c=Math.sin(s)*(h-this.options.tickRadius),u=-Math.cos(s)*(h-this.options.tickRadius),p=Math.sin(s)*h,m=-Math.cos(s)*h;this.hand.setAttribute("x2",c.toString()),this.hand.setAttribute("y2",u.toString()),this.bg.setAttribute("cx",p.toString()),this.bg.setAttribute("cy",m.toString())}}e.Timepicker=l,l._template='\n