with its height set to 100vh and measure that since that's what the scrolling is based on anyway and it's not affected by address bar showing/hiding.\n\n _div100vh.style.height = \"100vh\";\n _div100vh.style.position = \"absolute\";\n\n _refresh100vh();\n\n _rafBugFix();\n\n Observer.register(gsap); // isTouch is 0 if no touch, 1 if ONLY touch, and 2 if it can accommodate touch but also other types like mouse/pointer.\n\n ScrollTrigger.isTouch = Observer.isTouch;\n _fixIOSBug = Observer.isTouch && /(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent); // since 2017, iOS has had a bug that causes event.clientX/Y to be inaccurate when a scroll occurs, thus we must alternate ignoring every other touchmove event to work around it. See https://bugs.webkit.org/show_bug.cgi?id=181954 and https://codepen.io/GreenSock/pen/ExbrPNa/087cef197dc35445a0951e8935c41503\n\n _addListener(_win, \"wheel\", _onScroll); // mostly for 3rd party smooth scrolling libraries.\n\n\n _root = [_win, _doc, _docEl, _body];\n\n if (gsap.matchMedia) {\n ScrollTrigger.matchMedia = function (vars) {\n var mm = gsap.matchMedia(),\n p;\n\n for (p in vars) {\n mm.add(p, vars[p]);\n }\n\n return mm;\n };\n\n gsap.addEventListener(\"matchMediaInit\", function () {\n return _revertAll();\n });\n gsap.addEventListener(\"matchMediaRevert\", function () {\n return _revertRecorded();\n });\n gsap.addEventListener(\"matchMedia\", function () {\n _refreshAll(0, 1);\n\n _dispatch(\"matchMedia\");\n });\n gsap.matchMedia(\"(orientation: portrait)\", function () {\n // when orientation changes, we should take new base measurements for the ignoreMobileResize feature.\n _setBaseDimensions();\n\n return _setBaseDimensions;\n });\n } else {\n console.warn(\"Requires GSAP 3.11.0 or later\");\n }\n\n _setBaseDimensions();\n\n _addListener(_doc, \"scroll\", _onScroll); // some browsers (like Chrome), the window stops dispatching scroll events on the window if you scroll really fast, but it's consistent on the document!\n\n\n var bodyStyle = _body.style,\n border = bodyStyle.borderTopStyle,\n AnimationProto = gsap.core.Animation.prototype,\n bounds,\n i;\n AnimationProto.revert || Object.defineProperty(AnimationProto, \"revert\", {\n value: function value() {\n return this.time(-0.01, true);\n }\n }); // only for backwards compatibility (Animation.revert() was added after 3.10.4)\n\n bodyStyle.borderTopStyle = \"solid\"; // works around an issue where a margin of a child element could throw off the bounds of the _body, making it seem like there's a margin when there actually isn't. The border ensures that the bounds are accurate.\n\n bounds = _getBounds(_body);\n _vertical.m = Math.round(bounds.top + _vertical.sc()) || 0; // accommodate the offset of the caused by margins and/or padding\n\n _horizontal.m = Math.round(bounds.left + _horizontal.sc()) || 0;\n border ? bodyStyle.borderTopStyle = border : bodyStyle.removeProperty(\"border-top-style\"); // TODO: (?) maybe move to leveraging the velocity mechanism in Observer and skip intervals.\n\n _syncInterval = setInterval(_sync, 250);\n gsap.delayedCall(0.5, function () {\n return _startup = 0;\n });\n\n _addListener(_doc, \"touchcancel\", _passThrough); // some older Android devices intermittently stop dispatching \"touchmove\" events if we don't listen for \"touchcancel\" on the document.\n\n\n _addListener(_body, \"touchstart\", _passThrough); //works around Safari bug: https://greensock.com/forums/topic/21450-draggable-in-iframe-on-mobile-is-buggy/\n\n\n _multiListener(_addListener, _doc, \"pointerdown,touchstart,mousedown\", _pointerDownHandler);\n\n _multiListener(_addListener, _doc, \"pointerup,touchend,mouseup\", _pointerUpHandler);\n\n _transformProp = gsap.utils.checkPrefix(\"transform\");\n\n _stateProps.push(_transformProp);\n\n _coreInitted = _getTime();\n _resizeDelay = gsap.delayedCall(0.2, _refreshAll).pause();\n _autoRefresh = [_doc, \"visibilitychange\", function () {\n var w = _win.innerWidth,\n h = _win.innerHeight;\n\n if (_doc.hidden) {\n _prevWidth = w;\n _prevHeight = h;\n } else if (_prevWidth !== w || _prevHeight !== h) {\n _onResize();\n }\n }, _doc, \"DOMContentLoaded\", _refreshAll, _win, \"load\", _refreshAll, _win, \"resize\", _onResize];\n\n _iterateAutoRefresh(_addListener);\n\n _triggers.forEach(function (trigger) {\n return trigger.enable(0, 1);\n });\n\n for (i = 0; i < _scrollers.length; i += 3) {\n _wheelListener(_removeListener, _scrollers[i], _scrollers[i + 1]);\n\n _wheelListener(_removeListener, _scrollers[i], _scrollers[i + 2]);\n }\n }\n }\n };\n\n ScrollTrigger.config = function config(vars) {\n \"limitCallbacks\" in vars && (_limitCallbacks = !!vars.limitCallbacks);\n var ms = vars.syncInterval;\n ms && clearInterval(_syncInterval) || (_syncInterval = ms) && setInterval(_sync, ms);\n \"ignoreMobileResize\" in vars && (_ignoreMobileResize = ScrollTrigger.isTouch === 1 && vars.ignoreMobileResize);\n\n if (\"autoRefreshEvents\" in vars) {\n _iterateAutoRefresh(_removeListener) || _iterateAutoRefresh(_addListener, vars.autoRefreshEvents || \"none\");\n _ignoreResize = (vars.autoRefreshEvents + \"\").indexOf(\"resize\") === -1;\n }\n };\n\n ScrollTrigger.scrollerProxy = function scrollerProxy(target, vars) {\n var t = _getTarget(target),\n i = _scrollers.indexOf(t),\n isViewport = _isViewport(t);\n\n if (~i) {\n _scrollers.splice(i, isViewport ? 6 : 2);\n }\n\n if (vars) {\n isViewport ? _proxies.unshift(_win, vars, _body, vars, _docEl, vars) : _proxies.unshift(t, vars);\n }\n };\n\n ScrollTrigger.clearMatchMedia = function clearMatchMedia(query) {\n _triggers.forEach(function (t) {\n return t._ctx && t._ctx.query === query && t._ctx.kill(true, true);\n });\n };\n\n ScrollTrigger.isInViewport = function isInViewport(element, ratio, horizontal) {\n var bounds = (_isString(element) ? _getTarget(element) : element).getBoundingClientRect(),\n offset = bounds[horizontal ? _width : _height] * ratio || 0;\n return horizontal ? bounds.right - offset > 0 && bounds.left + offset < _win.innerWidth : bounds.bottom - offset > 0 && bounds.top + offset < _win.innerHeight;\n };\n\n ScrollTrigger.positionInViewport = function positionInViewport(element, referencePoint, horizontal) {\n _isString(element) && (element = _getTarget(element));\n var bounds = element.getBoundingClientRect(),\n size = bounds[horizontal ? _width : _height],\n offset = referencePoint == null ? size / 2 : referencePoint in _keywords ? _keywords[referencePoint] * size : ~referencePoint.indexOf(\"%\") ? parseFloat(referencePoint) * size / 100 : parseFloat(referencePoint) || 0;\n return horizontal ? (bounds.left + offset) / _win.innerWidth : (bounds.top + offset) / _win.innerHeight;\n };\n\n ScrollTrigger.killAll = function killAll(allowListeners) {\n _triggers.slice(0).forEach(function (t) {\n return t.vars.id !== \"ScrollSmoother\" && t.kill();\n });\n\n if (allowListeners !== true) {\n var listeners = _listeners.killAll || [];\n _listeners = {};\n listeners.forEach(function (f) {\n return f();\n });\n }\n };\n\n return ScrollTrigger;\n}();\nScrollTrigger.version = \"3.12.2\";\n\nScrollTrigger.saveStyles = function (targets) {\n return targets ? _toArray(targets).forEach(function (target) {\n // saved styles are recorded in a consecutive alternating Array, like [element, cssText, transform attribute, cache, matchMedia, ...]\n if (target && target.style) {\n var i = _savedStyles.indexOf(target);\n\n i >= 0 && _savedStyles.splice(i, 5);\n\n _savedStyles.push(target, target.style.cssText, target.getBBox && target.getAttribute(\"transform\"), gsap.core.getCache(target), _context());\n }\n }) : _savedStyles;\n};\n\nScrollTrigger.revert = function (soft, media) {\n return _revertAll(!soft, media);\n};\n\nScrollTrigger.create = function (vars, animation) {\n return new ScrollTrigger(vars, animation);\n};\n\nScrollTrigger.refresh = function (safe) {\n return safe ? _onResize() : (_coreInitted || ScrollTrigger.register()) && _refreshAll(true);\n};\n\nScrollTrigger.update = function (force) {\n return ++_scrollers.cache && _updateAll(force === true ? 2 : 0);\n};\n\nScrollTrigger.clearScrollMemory = _clearScrollMemory;\n\nScrollTrigger.maxScroll = function (element, horizontal) {\n return _maxScroll(element, horizontal ? _horizontal : _vertical);\n};\n\nScrollTrigger.getScrollFunc = function (element, horizontal) {\n return _getScrollFunc(_getTarget(element), horizontal ? _horizontal : _vertical);\n};\n\nScrollTrigger.getById = function (id) {\n return _ids[id];\n};\n\nScrollTrigger.getAll = function () {\n return _triggers.filter(function (t) {\n return t.vars.id !== \"ScrollSmoother\";\n });\n}; // it's common for people to ScrollTrigger.getAll(t => t.kill()) on page routes, for example, and we don't want it to ruin smooth scrolling by killing the main ScrollSmoother one.\n\n\nScrollTrigger.isScrolling = function () {\n return !!_lastScrollTime;\n};\n\nScrollTrigger.snapDirectional = _snapDirectional;\n\nScrollTrigger.addEventListener = function (type, callback) {\n var a = _listeners[type] || (_listeners[type] = []);\n ~a.indexOf(callback) || a.push(callback);\n};\n\nScrollTrigger.removeEventListener = function (type, callback) {\n var a = _listeners[type],\n i = a && a.indexOf(callback);\n i >= 0 && a.splice(i, 1);\n};\n\nScrollTrigger.batch = function (targets, vars) {\n var result = [],\n varsCopy = {},\n interval = vars.interval || 0.016,\n batchMax = vars.batchMax || 1e9,\n proxyCallback = function proxyCallback(type, callback) {\n var elements = [],\n triggers = [],\n delay = gsap.delayedCall(interval, function () {\n callback(elements, triggers);\n elements = [];\n triggers = [];\n }).pause();\n return function (self) {\n elements.length || delay.restart(true);\n elements.push(self.trigger);\n triggers.push(self);\n batchMax <= elements.length && delay.progress(1);\n };\n },\n p;\n\n for (p in vars) {\n varsCopy[p] = p.substr(0, 2) === \"on\" && _isFunction(vars[p]) && p !== \"onRefreshInit\" ? proxyCallback(p, vars[p]) : vars[p];\n }\n\n if (_isFunction(batchMax)) {\n batchMax = batchMax();\n\n _addListener(ScrollTrigger, \"refresh\", function () {\n return batchMax = vars.batchMax();\n });\n }\n\n _toArray(targets).forEach(function (target) {\n var config = {};\n\n for (p in varsCopy) {\n config[p] = varsCopy[p];\n }\n\n config.trigger = target;\n result.push(ScrollTrigger.create(config));\n });\n\n return result;\n}; // to reduce file size. clamps the scroll and also returns a duration multiplier so that if the scroll gets chopped shorter, the duration gets curtailed as well (otherwise if you're very close to the top of the page, for example, and swipe up really fast, it'll suddenly slow down and take a long time to reach the top).\n\n\nvar _clampScrollAndGetDurationMultiplier = function _clampScrollAndGetDurationMultiplier(scrollFunc, current, end, max) {\n current > max ? scrollFunc(max) : current < 0 && scrollFunc(0);\n return end > max ? (max - current) / (end - current) : end < 0 ? current / (current - end) : 1;\n},\n _allowNativePanning = function _allowNativePanning(target, direction) {\n if (direction === true) {\n target.style.removeProperty(\"touch-action\");\n } else {\n target.style.touchAction = direction === true ? \"auto\" : direction ? \"pan-\" + direction + (Observer.isTouch ? \" pinch-zoom\" : \"\") : \"none\"; // note: Firefox doesn't support it pinch-zoom properly, at least in addition to a pan-x or pan-y.\n }\n\n target === _docEl && _allowNativePanning(_body, direction);\n},\n _overflow = {\n auto: 1,\n scroll: 1\n},\n _nestedScroll = function _nestedScroll(_ref5) {\n var event = _ref5.event,\n target = _ref5.target,\n axis = _ref5.axis;\n\n var node = (event.changedTouches ? event.changedTouches[0] : event).target,\n cache = node._gsap || gsap.core.getCache(node),\n time = _getTime(),\n cs;\n\n if (!cache._isScrollT || time - cache._isScrollT > 2000) {\n // cache for 2 seconds to improve performance.\n while (node && node !== _body && (node.scrollHeight <= node.clientHeight && node.scrollWidth <= node.clientWidth || !(_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]))) {\n node = node.parentNode;\n }\n\n cache._isScroll = node && node !== target && !_isViewport(node) && (_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]);\n cache._isScrollT = time;\n }\n\n if (cache._isScroll || axis === \"x\") {\n event.stopPropagation();\n event._gsapAllow = true;\n }\n},\n // capture events on scrollable elements INSIDE the and allow those by calling stopPropagation() when we find a scrollable ancestor\n_inputObserver = function _inputObserver(target, type, inputs, nested) {\n return Observer.create({\n target: target,\n capture: true,\n debounce: false,\n lockAxis: true,\n type: type,\n onWheel: nested = nested && _nestedScroll,\n onPress: nested,\n onDrag: nested,\n onScroll: nested,\n onEnable: function onEnable() {\n return inputs && _addListener(_doc, Observer.eventTypes[0], _captureInputs, false, true);\n },\n onDisable: function onDisable() {\n return _removeListener(_doc, Observer.eventTypes[0], _captureInputs, true);\n }\n });\n},\n _inputExp = /(input|label|select|textarea)/i,\n _inputIsFocused,\n _captureInputs = function _captureInputs(e) {\n var isInput = _inputExp.test(e.target.tagName);\n\n if (isInput || _inputIsFocused) {\n e._gsapAllow = true;\n _inputIsFocused = isInput;\n }\n},\n _getScrollNormalizer = function _getScrollNormalizer(vars) {\n _isObject(vars) || (vars = {});\n vars.preventDefault = vars.isNormalizer = vars.allowClicks = true;\n vars.type || (vars.type = \"wheel,touch\");\n vars.debounce = !!vars.debounce;\n vars.id = vars.id || \"normalizer\";\n\n var _vars2 = vars,\n normalizeScrollX = _vars2.normalizeScrollX,\n momentum = _vars2.momentum,\n allowNestedScroll = _vars2.allowNestedScroll,\n onRelease = _vars2.onRelease,\n self,\n maxY,\n target = _getTarget(vars.target) || _docEl,\n smoother = gsap.core.globals().ScrollSmoother,\n smootherInstance = smoother && smoother.get(),\n content = _fixIOSBug && (vars.content && _getTarget(vars.content) || smootherInstance && vars.content !== false && !smootherInstance.smooth() && smootherInstance.content()),\n scrollFuncY = _getScrollFunc(target, _vertical),\n scrollFuncX = _getScrollFunc(target, _horizontal),\n scale = 1,\n initialScale = (Observer.isTouch && _win.visualViewport ? _win.visualViewport.scale * _win.visualViewport.width : _win.outerWidth) / _win.innerWidth,\n wheelRefresh = 0,\n resolveMomentumDuration = _isFunction(momentum) ? function () {\n return momentum(self);\n } : function () {\n return momentum || 2.8;\n },\n lastRefreshID,\n skipTouchMove,\n inputObserver = _inputObserver(target, vars.type, true, allowNestedScroll),\n resumeTouchMove = function resumeTouchMove() {\n return skipTouchMove = false;\n },\n scrollClampX = _passThrough,\n scrollClampY = _passThrough,\n updateClamps = function updateClamps() {\n maxY = _maxScroll(target, _vertical);\n scrollClampY = _clamp(_fixIOSBug ? 1 : 0, maxY);\n normalizeScrollX && (scrollClampX = _clamp(0, _maxScroll(target, _horizontal)));\n lastRefreshID = _refreshID;\n },\n removeContentOffset = function removeContentOffset() {\n content._gsap.y = _round(parseFloat(content._gsap.y) + scrollFuncY.offset) + \"px\";\n content.style.transform = \"matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, \" + parseFloat(content._gsap.y) + \", 0, 1)\";\n scrollFuncY.offset = scrollFuncY.cacheID = 0;\n },\n ignoreDrag = function ignoreDrag() {\n if (skipTouchMove) {\n requestAnimationFrame(resumeTouchMove);\n\n var offset = _round(self.deltaY / 2),\n scroll = scrollClampY(scrollFuncY.v - offset);\n\n if (content && scroll !== scrollFuncY.v + scrollFuncY.offset) {\n scrollFuncY.offset = scroll - scrollFuncY.v;\n\n var y = _round((parseFloat(content && content._gsap.y) || 0) - scrollFuncY.offset);\n\n content.style.transform = \"matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, \" + y + \", 0, 1)\";\n content._gsap.y = y + \"px\";\n scrollFuncY.cacheID = _scrollers.cache;\n\n _updateAll();\n }\n\n return true;\n }\n\n scrollFuncY.offset && removeContentOffset();\n skipTouchMove = true;\n },\n tween,\n startScrollX,\n startScrollY,\n onStopDelayedCall,\n onResize = function onResize() {\n // if the window resizes, like on an iPhone which Apple FORCES the address bar to show/hide even if we event.preventDefault(), it may be scrolling too far now that the address bar is showing, so we must dynamically adjust the momentum tween.\n updateClamps();\n\n if (tween.isActive() && tween.vars.scrollY > maxY) {\n scrollFuncY() > maxY ? tween.progress(1) && scrollFuncY(maxY) : tween.resetTo(\"scrollY\", maxY);\n }\n };\n\n content && gsap.set(content, {\n y: \"+=0\"\n }); // to ensure there's a cache (element._gsap)\n\n vars.ignoreCheck = function (e) {\n return _fixIOSBug && e.type === \"touchmove\" && ignoreDrag(e) || scale > 1.05 && e.type !== \"touchstart\" || self.isGesturing || e.touches && e.touches.length > 1;\n };\n\n vars.onPress = function () {\n skipTouchMove = false;\n var prevScale = scale;\n scale = _round((_win.visualViewport && _win.visualViewport.scale || 1) / initialScale);\n tween.pause();\n prevScale !== scale && _allowNativePanning(target, scale > 1.01 ? true : normalizeScrollX ? false : \"x\");\n startScrollX = scrollFuncX();\n startScrollY = scrollFuncY();\n updateClamps();\n lastRefreshID = _refreshID;\n };\n\n vars.onRelease = vars.onGestureStart = function (self, wasDragging) {\n scrollFuncY.offset && removeContentOffset();\n\n if (!wasDragging) {\n onStopDelayedCall.restart(true);\n } else {\n _scrollers.cache++; // make sure we're pulling the non-cached value\n // alternate algorithm: durX = Math.min(6, Math.abs(self.velocityX / 800)),\tdur = Math.max(durX, Math.min(6, Math.abs(self.velocityY / 800))); dur = dur * (0.4 + (1 - _power4In(dur / 6)) * 0.6)) * (momentumSpeed || 1)\n\n var dur = resolveMomentumDuration(),\n currentScroll,\n endScroll;\n\n if (normalizeScrollX) {\n currentScroll = scrollFuncX();\n endScroll = currentScroll + dur * 0.05 * -self.velocityX / 0.227; // the constant .227 is from power4(0.05). velocity is inverted because scrolling goes in the opposite direction.\n\n dur *= _clampScrollAndGetDurationMultiplier(scrollFuncX, currentScroll, endScroll, _maxScroll(target, _horizontal));\n tween.vars.scrollX = scrollClampX(endScroll);\n }\n\n currentScroll = scrollFuncY();\n endScroll = currentScroll + dur * 0.05 * -self.velocityY / 0.227; // the constant .227 is from power4(0.05)\n\n dur *= _clampScrollAndGetDurationMultiplier(scrollFuncY, currentScroll, endScroll, _maxScroll(target, _vertical));\n tween.vars.scrollY = scrollClampY(endScroll);\n tween.invalidate().duration(dur).play(0.01);\n\n if (_fixIOSBug && tween.vars.scrollY >= maxY || currentScroll >= maxY - 1) {\n // iOS bug: it'll show the address bar but NOT fire the window \"resize\" event until the animation is done but we must protect against overshoot so we leverage an onUpdate to do so.\n gsap.to({}, {\n onUpdate: onResize,\n duration: dur\n });\n }\n }\n\n onRelease && onRelease(self);\n };\n\n vars.onWheel = function () {\n tween._ts && tween.pause();\n\n if (_getTime() - wheelRefresh > 1000) {\n // after 1 second, refresh the clamps otherwise that'll only happen when ScrollTrigger.refresh() is called or for touch-scrolling.\n lastRefreshID = 0;\n wheelRefresh = _getTime();\n }\n };\n\n vars.onChange = function (self, dx, dy, xArray, yArray) {\n _refreshID !== lastRefreshID && updateClamps();\n dx && normalizeScrollX && scrollFuncX(scrollClampX(xArray[2] === dx ? startScrollX + (self.startX - self.x) : scrollFuncX() + dx - xArray[1])); // for more precision, we track pointer/touch movement from the start, otherwise it'll drift.\n\n if (dy) {\n scrollFuncY.offset && removeContentOffset();\n var isTouch = yArray[2] === dy,\n y = isTouch ? startScrollY + self.startY - self.y : scrollFuncY() + dy - yArray[1],\n yClamped = scrollClampY(y);\n isTouch && y !== yClamped && (startScrollY += yClamped - y);\n scrollFuncY(yClamped);\n }\n\n (dy || dx) && _updateAll();\n };\n\n vars.onEnable = function () {\n _allowNativePanning(target, normalizeScrollX ? false : \"x\");\n\n ScrollTrigger.addEventListener(\"refresh\", onResize);\n\n _addListener(_win, \"resize\", onResize);\n\n if (scrollFuncY.smooth) {\n scrollFuncY.target.style.scrollBehavior = \"auto\";\n scrollFuncY.smooth = scrollFuncX.smooth = false;\n }\n\n inputObserver.enable();\n };\n\n vars.onDisable = function () {\n _allowNativePanning(target, true);\n\n _removeListener(_win, \"resize\", onResize);\n\n ScrollTrigger.removeEventListener(\"refresh\", onResize);\n inputObserver.kill();\n };\n\n vars.lockAxis = vars.lockAxis !== false;\n self = new Observer(vars);\n self.iOS = _fixIOSBug; // used in the Observer getCachedScroll() function to work around an iOS bug that wreaks havoc with TouchEvent.clientY if we allow scroll to go all the way back to 0.\n\n _fixIOSBug && !scrollFuncY() && scrollFuncY(1); // iOS bug causes event.clientY values to freak out (wildly inaccurate) if the scroll position is exactly 0.\n\n _fixIOSBug && gsap.ticker.add(_passThrough); // prevent the ticker from sleeping\n\n onStopDelayedCall = self._dc;\n tween = gsap.to(self, {\n ease: \"power4\",\n paused: true,\n scrollX: normalizeScrollX ? \"+=0.1\" : \"+=0\",\n scrollY: \"+=0.1\",\n modifiers: {\n scrollY: _interruptionTracker(scrollFuncY, scrollFuncY(), function () {\n return tween.pause();\n })\n },\n onUpdate: _updateAll,\n onComplete: onStopDelayedCall.vars.onComplete\n }); // we need the modifier to sense if the scroll position is altered outside of the momentum tween (like with a scrollTo tween) so we can pause() it to prevent conflicts.\n\n return self;\n};\n\nScrollTrigger.sort = function (func) {\n return _triggers.sort(func || function (a, b) {\n return (a.vars.refreshPriority || 0) * -1e6 + a.start - (b.start + (b.vars.refreshPriority || 0) * -1e6);\n });\n};\n\nScrollTrigger.observe = function (vars) {\n return new Observer(vars);\n};\n\nScrollTrigger.normalizeScroll = function (vars) {\n if (typeof vars === \"undefined\") {\n return _normalizer;\n }\n\n if (vars === true && _normalizer) {\n return _normalizer.enable();\n }\n\n if (vars === false) {\n return _normalizer && _normalizer.kill();\n }\n\n var normalizer = vars instanceof Observer ? vars : _getScrollNormalizer(vars);\n _normalizer && _normalizer.target === normalizer.target && _normalizer.kill();\n _isViewport(normalizer.target) && (_normalizer = normalizer);\n return normalizer;\n};\n\nScrollTrigger.core = {\n // smaller file size way to leverage in ScrollSmoother and Observer\n _getVelocityProp: _getVelocityProp,\n _inputObserver: _inputObserver,\n _scrollers: _scrollers,\n _proxies: _proxies,\n bridge: {\n // when normalizeScroll sets the scroll position (ss = setScroll)\n ss: function ss() {\n _lastScrollTime || _dispatch(\"scrollStart\");\n _lastScrollTime = _getTime();\n },\n // a way to get the _refreshing value in Observer\n ref: function ref() {\n return _refreshing;\n }\n }\n};\n_getGSAP() && gsap.registerPlugin(ScrollTrigger);\nexport { ScrollTrigger as default };","import Swiper from 'swiper'\nimport { A11y, EffectFade, Navigation, Pagination } from 'swiper/modules'\nimport { gsap } from 'gsap'\nimport { ScrollTrigger } from 'gsap/ScrollTrigger'\n\ngsap.registerPlugin(ScrollTrigger)\n\nconst setupSlider = (el) => {\n const container = el.querySelector('.swiper')\n\n const swiper = new Swiper(container, {\n modules: [A11y, EffectFade, Navigation, Pagination],\n speed: 500,\n pagination: {\n el: el.querySelector('.slider-pagination'),\n clickable: true,\n },\n effect: 'fade',\n fadeEffect: {\n crossFade: true,\n },\n loop: true,\n breakpoints: {\n 768: {\n enabled: false,\n },\n },\n })\n\n container.querySelectorAll('.slider-button-next').forEach((btn) => {\n btn.addEventListener('click', () => swiper.slideNext())\n })\n}\n\nconst setupScroller = (el) => {\n const contents = el.querySelectorAll('.callout-content')\n\n contents.forEach((content) => {\n const height = content.offsetHeight\n const styles = window.getComputedStyle(content)\n const margin = parseFloat(styles['marginTop'])\n\n content.setAttribute('data-height', height + margin)\n })\n\n gsap.set(contents, { height: 0 })\n\n const timeline = gsap.timeline({\n paused: true,\n scrollTrigger: {\n trigger: el,\n start: 'top center',\n end: 'bottom center',\n scrub: true,\n markers: false,\n },\n })\n\n contents.forEach((content) => {\n const bar = content.closest('.callout-cell').querySelector('.callout-bar')\n const gradient = content.closest('.callout-cell').querySelector('.callout-gradient')\n timeline.to(content, { height: content.dataset.height })\n timeline.to(bar, { backgroundColor: '#009ad0' }, '<')\n timeline.to(gradient, { opacity: 0 }, '<')\n })\n}\n\nexport default {\n init: () => {\n document.querySelectorAll('.callout-blocks').forEach((el) => {\n setupSlider(el)\n\n if (window.matchMedia('(min-width: 768px)').matches) {\n setupScroller(el)\n }\n })\n },\n}\n","// Public: Create a new SelectorSet.\nexport default function SelectorSet() {\n // Construct new SelectorSet if called as a function.\n if (!(this instanceof SelectorSet)) {\n return new SelectorSet();\n }\n\n // Public: Number of selectors added to the set\n this.size = 0;\n\n // Internal: Incrementing ID counter\n this.uid = 0;\n\n // Internal: Array of String selectors in the set\n this.selectors = [];\n\n // Internal: Map of selector ids to objects\n this.selectorObjects = {};\n\n // Internal: All Object index String names mapping to Index objects.\n this.indexes = Object.create(this.indexes);\n\n // Internal: Used Object index String names mapping to Index objects.\n this.activeIndexes = [];\n}\n\n// Detect prefixed Element#matches function.\nvar docElem = window.document.documentElement;\nvar matches =\n docElem.matches ||\n docElem.webkitMatchesSelector ||\n docElem.mozMatchesSelector ||\n docElem.oMatchesSelector ||\n docElem.msMatchesSelector;\n\n// Public: Check if element matches selector.\n//\n// Maybe overridden with custom Element.matches function.\n//\n// el - An Element\n// selector - String CSS selector\n//\n// Returns true or false.\nSelectorSet.prototype.matchesSelector = function(el, selector) {\n return matches.call(el, selector);\n};\n\n// Public: Find all elements in the context that match the selector.\n//\n// Maybe overridden with custom querySelectorAll function.\n//\n// selectors - String CSS selectors.\n// context - Element context\n//\n// Returns non-live list of Elements.\nSelectorSet.prototype.querySelectorAll = function(selectors, context) {\n return context.querySelectorAll(selectors);\n};\n\n// Public: Array of indexes.\n//\n// name - Unique String name\n// selector - Function that takes a String selector and returns a String key\n// or undefined if it can't be used by the index.\n// element - Function that takes an Element and returns an Array of String\n// keys that point to indexed values.\n//\nSelectorSet.prototype.indexes = [];\n\n// Index by element id\nvar idRe = /^#((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)/g;\nSelectorSet.prototype.indexes.push({\n name: 'ID',\n selector: function matchIdSelector(sel) {\n var m;\n if ((m = sel.match(idRe))) {\n return m[0].slice(1);\n }\n },\n element: function getElementId(el) {\n if (el.id) {\n return [el.id];\n }\n }\n});\n\n// Index by all of its class names\nvar classRe = /^\\.((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)/g;\nSelectorSet.prototype.indexes.push({\n name: 'CLASS',\n selector: function matchClassSelector(sel) {\n var m;\n if ((m = sel.match(classRe))) {\n return m[0].slice(1);\n }\n },\n element: function getElementClassNames(el) {\n var className = el.className;\n if (className) {\n if (typeof className === 'string') {\n return className.split(/\\s/);\n } else if (typeof className === 'object' && 'baseVal' in className) {\n // className is a SVGAnimatedString\n // global SVGAnimatedString is not an exposed global in Opera 12\n return className.baseVal.split(/\\s/);\n }\n }\n }\n});\n\n// Index by tag/node name: `DIV`, `FORM`, `A`\nvar tagRe = /^((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)/g;\nSelectorSet.prototype.indexes.push({\n name: 'TAG',\n selector: function matchTagSelector(sel) {\n var m;\n if ((m = sel.match(tagRe))) {\n return m[0].toUpperCase();\n }\n },\n element: function getElementTagName(el) {\n return [el.nodeName.toUpperCase()];\n }\n});\n\n// Default index just contains a single array of elements.\nSelectorSet.prototype.indexes['default'] = {\n name: 'UNIVERSAL',\n selector: function() {\n return true;\n },\n element: function() {\n return [true];\n }\n};\n\n// Use ES Maps when supported\nvar Map;\nif (typeof window.Map === 'function') {\n Map = window.Map;\n} else {\n Map = (function() {\n function Map() {\n this.map = {};\n }\n Map.prototype.get = function(key) {\n return this.map[key + ' '];\n };\n Map.prototype.set = function(key, value) {\n this.map[key + ' '] = value;\n };\n return Map;\n })();\n}\n\n// Regexps adopted from Sizzle\n// https://github.com/jquery/sizzle/blob/1.7/sizzle.js\n//\nvar chunker = /((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^\\[\\]]*\\]|['\"][^'\"]*['\"]|[^\\[\\]'\"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?((?:.|\\r|\\n)*)/g;\n\n// Internal: Get indexes for selector.\n//\n// selector - String CSS selector\n//\n// Returns Array of {index, key}.\nfunction parseSelectorIndexes(allIndexes, selector) {\n allIndexes = allIndexes.slice(0).concat(allIndexes['default']);\n\n var allIndexesLen = allIndexes.length,\n i,\n j,\n m,\n dup,\n rest = selector,\n key,\n index,\n indexes = [];\n\n do {\n chunker.exec('');\n if ((m = chunker.exec(rest))) {\n rest = m[3];\n if (m[2] || !rest) {\n for (i = 0; i < allIndexesLen; i++) {\n index = allIndexes[i];\n if ((key = index.selector(m[1]))) {\n j = indexes.length;\n dup = false;\n while (j--) {\n if (indexes[j].index === index && indexes[j].key === key) {\n dup = true;\n break;\n }\n }\n if (!dup) {\n indexes.push({ index: index, key: key });\n }\n break;\n }\n }\n }\n }\n } while (m);\n\n return indexes;\n}\n\n// Internal: Find first item in Array that is a prototype of `proto`.\n//\n// ary - Array of objects\n// proto - Prototype of expected item in `ary`\n//\n// Returns object from `ary` if found. Otherwise returns undefined.\nfunction findByPrototype(ary, proto) {\n var i, len, item;\n for (i = 0, len = ary.length; i < len; i++) {\n item = ary[i];\n if (proto.isPrototypeOf(item)) {\n return item;\n }\n }\n}\n\n// Public: Log when added selector falls under the default index.\n//\n// This API should not be considered stable. May change between\n// minor versions.\n//\n// obj - {selector, data} Object\n//\n// SelectorSet.prototype.logDefaultIndexUsed = function(obj) {\n// console.warn(obj.selector, \"could not be indexed\");\n// };\n//\n// Returns nothing.\nSelectorSet.prototype.logDefaultIndexUsed = function() {};\n\n// Public: Add selector to set.\n//\n// selector - String CSS selector\n// data - Optional data Object (default: undefined)\n//\n// Returns nothing.\nSelectorSet.prototype.add = function(selector, data) {\n var obj,\n i,\n indexProto,\n key,\n index,\n objs,\n selectorIndexes,\n selectorIndex,\n indexes = this.activeIndexes,\n selectors = this.selectors,\n selectorObjects = this.selectorObjects;\n\n if (typeof selector !== 'string') {\n return;\n }\n\n obj = {\n id: this.uid++,\n selector: selector,\n data: data\n };\n selectorObjects[obj.id] = obj;\n\n selectorIndexes = parseSelectorIndexes(this.indexes, selector);\n for (i = 0; i < selectorIndexes.length; i++) {\n selectorIndex = selectorIndexes[i];\n key = selectorIndex.key;\n indexProto = selectorIndex.index;\n\n index = findByPrototype(indexes, indexProto);\n if (!index) {\n index = Object.create(indexProto);\n index.map = new Map();\n indexes.push(index);\n }\n\n if (indexProto === this.indexes['default']) {\n this.logDefaultIndexUsed(obj);\n }\n objs = index.map.get(key);\n if (!objs) {\n objs = [];\n index.map.set(key, objs);\n }\n objs.push(obj);\n }\n\n this.size++;\n selectors.push(selector);\n};\n\n// Public: Remove selector from set.\n//\n// selector - String CSS selector\n// data - Optional data Object (default: undefined)\n//\n// Returns nothing.\nSelectorSet.prototype.remove = function(selector, data) {\n if (typeof selector !== 'string') {\n return;\n }\n\n var selectorIndexes,\n selectorIndex,\n i,\n j,\n k,\n selIndex,\n objs,\n obj,\n indexes = this.activeIndexes,\n selectors = (this.selectors = []),\n selectorObjects = this.selectorObjects,\n removedIds = {},\n removeAll = arguments.length === 1;\n\n selectorIndexes = parseSelectorIndexes(this.indexes, selector);\n for (i = 0; i < selectorIndexes.length; i++) {\n selectorIndex = selectorIndexes[i];\n\n j = indexes.length;\n while (j--) {\n selIndex = indexes[j];\n if (selectorIndex.index.isPrototypeOf(selIndex)) {\n objs = selIndex.map.get(selectorIndex.key);\n if (objs) {\n k = objs.length;\n while (k--) {\n obj = objs[k];\n if (obj.selector === selector && (removeAll || obj.data === data)) {\n objs.splice(k, 1);\n removedIds[obj.id] = true;\n }\n }\n }\n break;\n }\n }\n }\n\n for (i in removedIds) {\n delete selectorObjects[i];\n this.size--;\n }\n\n for (i in selectorObjects) {\n selectors.push(selectorObjects[i].selector);\n }\n};\n\n// Sort by id property handler.\n//\n// a - Selector obj.\n// b - Selector obj.\n//\n// Returns Number.\nfunction sortById(a, b) {\n return a.id - b.id;\n}\n\n// Public: Find all matching decendants of the context element.\n//\n// context - An Element\n//\n// Returns Array of {selector, data, elements} matches.\nSelectorSet.prototype.queryAll = function(context) {\n if (!this.selectors.length) {\n return [];\n }\n\n var matches = {},\n results = [];\n var els = this.querySelectorAll(this.selectors.join(', '), context);\n\n var i, j, len, len2, el, m, match, obj;\n for (i = 0, len = els.length; i < len; i++) {\n el = els[i];\n m = this.matches(el);\n for (j = 0, len2 = m.length; j < len2; j++) {\n obj = m[j];\n if (!matches[obj.id]) {\n match = {\n id: obj.id,\n selector: obj.selector,\n data: obj.data,\n elements: []\n };\n matches[obj.id] = match;\n results.push(match);\n } else {\n match = matches[obj.id];\n }\n match.elements.push(el);\n }\n }\n\n return results.sort(sortById);\n};\n\n// Public: Match element against all selectors in set.\n//\n// el - An Element\n//\n// Returns Array of {selector, data} matches.\nSelectorSet.prototype.matches = function(el) {\n if (!el) {\n return [];\n }\n\n var i, j, k, len, len2, len3, index, keys, objs, obj, id;\n var indexes = this.activeIndexes,\n matchedIds = {},\n matches = [];\n\n for (i = 0, len = indexes.length; i < len; i++) {\n index = indexes[i];\n keys = index.element(el);\n if (keys) {\n for (j = 0, len2 = keys.length; j < len2; j++) {\n if ((objs = index.map.get(keys[j]))) {\n for (k = 0, len3 = objs.length; k < len3; k++) {\n obj = objs[k];\n id = obj.id;\n if (!matchedIds[id] && this.matchesSelector(el, obj.selector)) {\n matchedIds[id] = true;\n matches.push(obj);\n }\n }\n }\n }\n }\n }\n\n return matches.sort(sortById);\n};\n","import SelectorSet from 'selector-set';\n\nvar bubbleEvents = {};\nvar captureEvents = {};\nvar propagationStopped = new WeakMap();\nvar immediatePropagationStopped = new WeakMap();\nvar currentTargets = new WeakMap();\nvar currentTargetDesc = Object.getOwnPropertyDescriptor(Event.prototype, 'currentTarget');\n\nfunction before(subject, verb, fn) {\n var source = subject[verb];\n\n subject[verb] = function () {\n fn.apply(subject, arguments);\n return source.apply(subject, arguments);\n };\n\n return subject;\n}\n\nfunction matches(selectors, target, reverse) {\n var queue = [];\n var node = target;\n\n do {\n if (node.nodeType !== 1) break;\n\n var _matches = selectors.matches(node);\n\n if (_matches.length) {\n var matched = {\n node: node,\n observers: _matches\n };\n\n if (reverse) {\n queue.unshift(matched);\n } else {\n queue.push(matched);\n }\n }\n } while (node = node.parentElement);\n\n return queue;\n}\n\nfunction trackPropagation() {\n propagationStopped.set(this, true);\n}\n\nfunction trackImmediate() {\n propagationStopped.set(this, true);\n immediatePropagationStopped.set(this, true);\n}\n\nfunction getCurrentTarget() {\n return currentTargets.get(this) || null;\n}\n\nfunction defineCurrentTarget(event, getter) {\n if (!currentTargetDesc) return;\n Object.defineProperty(event, 'currentTarget', {\n configurable: true,\n enumerable: true,\n get: getter || currentTargetDesc.get\n });\n}\n\nfunction canDispatch(event) {\n try {\n event.eventPhase;\n return true;\n } catch (_) {\n return false;\n }\n}\n\nfunction dispatch(event) {\n if (!canDispatch(event)) return;\n var events = event.eventPhase === 1 ? captureEvents : bubbleEvents;\n var selectors = events[event.type];\n if (!selectors) return;\n var queue = matches(selectors, event.target, event.eventPhase === 1);\n if (!queue.length) return;\n before(event, 'stopPropagation', trackPropagation);\n before(event, 'stopImmediatePropagation', trackImmediate);\n defineCurrentTarget(event, getCurrentTarget);\n\n for (var i = 0, len1 = queue.length; i < len1; i++) {\n if (propagationStopped.get(event)) break;\n var matched = queue[i];\n currentTargets.set(event, matched.node);\n\n for (var j = 0, len2 = matched.observers.length; j < len2; j++) {\n if (immediatePropagationStopped.get(event)) break;\n matched.observers[j].data.call(matched.node, event);\n }\n }\n\n currentTargets[\"delete\"](event);\n defineCurrentTarget(event);\n}\n\nfunction on(name, selector, fn) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var capture = options.capture ? true : false;\n var events = capture ? captureEvents : bubbleEvents;\n var selectors = events[name];\n\n if (!selectors) {\n selectors = new SelectorSet();\n events[name] = selectors;\n document.addEventListener(name, dispatch, capture);\n }\n\n selectors.add(selector, fn);\n}\nfunction off(name, selector, fn) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var capture = options.capture ? true : false;\n var events = capture ? captureEvents : bubbleEvents;\n var selectors = events[name];\n if (!selectors) return;\n selectors.remove(selector, fn);\n if (selectors.size) return;\n delete events[name];\n document.removeEventListener(name, dispatch, capture);\n}\nfunction fire(target, name, detail) {\n return target.dispatchEvent(new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: detail\n }));\n}\n\nexport { fire, off, on };\n","export const isTouchDevice = 'ontouchstart' in document.documentElement\n\nexport const isIos =\n /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)\n\nexport const createUrl = (base, formData = {}, append = false) => {\n let data = formData\n\n if (formData instanceof FormData === false) {\n data = new FormData()\n\n for (const [key, value] of Object.entries(formData)) {\n data.append(key, value)\n }\n }\n\n if (typeof base === 'object') {\n const baseUrl = new URL(base)\n\n if (append) {\n const searchParams = baseUrl.searchParams\n\n const params = {}\n\n for (const [key, value] of data) {\n const normalizedKey = key.replace('[]', '')\n\n if (normalizedKey in params) {\n params[normalizedKey].push(value)\n } else {\n params[normalizedKey] = [value]\n }\n }\n\n for (const [key, value] of Object.entries(params)) {\n const _value = value.filter((x) => x)\n\n if (_value.length === 0) {\n searchParams.delete(key)\n } else {\n searchParams.set(key, _value.join(','))\n }\n }\n\n return baseUrl\n } else {\n const params = new URLSearchParams(data)\n\n return new URL(`${base}?${params}`)\n }\n }\n\n if (typeof base === 'string') {\n const params = new URLSearchParams(formData)\n const url = new URL(`${base}?${params}`)\n\n return url\n }\n}\n\nexport const trackGoogleAnalytics = (event) => {\n if (window.dataLayer) {\n window.dataLayer.push(event)\n }\n}\n","import { on } from 'delegated-events'\nimport Swiper from 'swiper'\nimport { A11y, Navigation } from 'swiper/modules'\nimport { isTouchDevice } from '@common/util'\n\nexport default {\n init: () => {\n document.querySelectorAll('.callout-cards').forEach((el) => {\n const container = el.querySelector('.swiper')\n const viewAllToggles = el.querySelectorAll('.view-all-toggle')\n\n const swiper = new Swiper(container, {\n modules: [A11y, Navigation],\n slidesPerView: 1,\n navigation: {\n nextEl: el.querySelector('.slider-button-next'),\n prevEl: el.querySelector('.slider-button-prev'),\n },\n loop: true,\n allowTouchMove: false,\n breakpoints: {\n 768: {\n slidesPerView: 'auto',\n },\n },\n })\n\n if (viewAllToggles.length) {\n viewAllToggles.forEach((button) => {\n button.addEventListener('click', () => {\n el.classList.toggle('is-view-all')\n\n if (el.classList.contains('is-view-all')) {\n swiper.slideTo(0, 0)\n swiper.disable()\n } else {\n swiper.enable()\n }\n })\n })\n }\n })\n\n on('mouseover', '.callout-card:not(.is-active)', (e) => {\n e.currentTarget.classList.add('is-active')\n })\n\n on('mouseout', '.callout-card', (e) => {\n e.currentTarget.classList.remove('is-active')\n })\n\n if (isTouchDevice) {\n on('click', '.callout-card-content', (e) => {\n e.currentTarget.closest('.callout-card').classList.remove('is-active')\n })\n }\n },\n}\n","export const JSON_MIME = \"application/json\";\nexport const CONTENT_TYPE_HEADER = \"Content-Type\";\nexport const FETCH_ERROR = Symbol();\nexport const CATCHER_FALLBACK = Symbol();\n//# sourceMappingURL=constants.js.map","import { CONTENT_TYPE_HEADER } from \"./constants.js\";\nexport function extractContentType(headers = {}) {\n var _a;\n return (_a = Object.entries(headers).find(([k]) => k.toLowerCase() === CONTENT_TYPE_HEADER.toLowerCase())) === null || _a === void 0 ? void 0 : _a[1];\n}\nexport function isLikelyJsonMime(value) {\n return /^application\\/.*json.*/.test(value);\n}\nexport const mix = function (one, two, mergeArrays = false) {\n return Object.entries(two).reduce((acc, [key, newValue]) => {\n const value = one[key];\n if (Array.isArray(value) && Array.isArray(newValue)) {\n acc[key] = mergeArrays ? [...value, ...newValue] : newValue;\n }\n else if (typeof value === \"object\" && typeof newValue === \"object\") {\n acc[key] = mix(value, newValue, mergeArrays);\n }\n else {\n acc[key] = newValue;\n }\n return acc;\n }, { ...one });\n};\n//# sourceMappingURL=utils.js.map","import { mix } from \"./utils.js\";\nconst config = {\n // Default options\n options: {},\n // Error type\n errorType: \"text\",\n // Polyfills\n polyfills: {\n // fetch: null,\n // FormData: null,\n // URLSearchParams: null,\n // performance: null,\n // PerformanceObserver: null,\n // AbortController: null\n },\n polyfill(p, doThrow = true, instance = false, ...args) {\n const res = this.polyfills[p] ||\n (typeof self !== \"undefined\" ? self[p] : null) ||\n (typeof global !== \"undefined\" ? global[p] : null);\n if (doThrow && !res)\n throw new Error(p + \" is not defined\");\n return instance && res ? new res(...args) : res;\n }\n};\n/**\n * Sets the default fetch options that will be stored internally when instantiating wretch objects.\n *\n * ```js\n * import wretch from \"wretch\"\n *\n * wretch.options({ headers: { \"Accept\": \"application/json\" } });\n *\n * // The fetch request is sent with both headers.\n * wretch(\"...\", { headers: { \"X-Custom\": \"Header\" } }).get().res();\n * ```\n *\n * @param options Default options\n * @param replace If true, completely replaces the existing options instead of mixing in\n */\nexport function setOptions(options, replace = false) {\n config.options = replace ? options : mix(config.options, options);\n}\n/**\n * Sets the default polyfills that will be stored internally when instantiating wretch objects.\n * Useful for browserless environments like `node.js`.\n *\n * Needed for libraries like [fetch-ponyfill](https://github.com/qubyte/fetch-ponyfill).\n *\n * ```js\n * import wretch from \"wretch\"\n *\n * wretch.polyfills({\n * fetch: require(\"node-fetch\"),\n * FormData: require(\"form-data\"),\n * URLSearchParams: require(\"url\").URLSearchParams,\n * });\n *\n * // Uses the above polyfills.\n * wretch(\"...\").get().res();\n * ```\n *\n * @param polyfills An object containing the polyfills\n * @param replace If true, replaces the current polyfills instead of mixing in\n */\nexport function setPolyfills(polyfills, replace = false) {\n config.polyfills = replace ? polyfills : mix(config.polyfills, polyfills);\n}\n/**\n * Sets the default method (text, json, …) used to parse the data contained in the response body in case of an HTTP error.\n * As with other static methods, it will affect wretch instances created after calling this function.\n *\n * _Note: if the response Content-Type header is set to \"application/json\", the body will be parsed as json regardless of the errorType._\n *\n * ```js\n * import wretch from \"wretch\"\n *\n * wretch.errorType(\"json\")\n *\n * wretch(\"http://server/which/returns/an/error/with/a/json/body\")\n * .get()\n * .res()\n * .catch(error => {\n * // error[errorType] (here, json) contains the parsed body\n * console.log(error.json)\n * })\n * ```\n *\n * If null, defaults to \"text\".\n */\nexport function setErrorType(errorType) {\n config.errorType = errorType;\n}\nexport default config;\n//# sourceMappingURL=config.js.map","import { middlewareHelper } from \"./middleware.js\";\nimport { mix } from \"./utils.js\";\nimport { FETCH_ERROR, CATCHER_FALLBACK } from \"./constants.js\";\n/**\n * This class inheriting from Error is thrown when the fetch response is not \"ok\".\n * It extends Error and adds status, text and body fields.\n */\nexport class WretchError extends Error {\n}\nexport const resolver = (wretch) => {\n const sharedState = Object.create(null);\n wretch = wretch._addons.reduce((w, addon) => addon.beforeRequest &&\n addon.beforeRequest(w, wretch._options, sharedState)\n || w, wretch);\n const { _url: url, _options: opts, _config: config, _catchers: _catchers, _resolvers: resolvers, _middlewares: middlewares, _addons: addons } = wretch;\n const catchers = new Map(_catchers);\n const finalOptions = mix(config.options, opts);\n // The generated fetch request\n let finalUrl = url;\n const _fetchReq = middlewareHelper(middlewares)((url, options) => {\n finalUrl = url;\n return config.polyfill(\"fetch\")(url, options);\n })(url, finalOptions);\n // Throws on an http error\n const referenceError = new Error();\n const throwingPromise = _fetchReq\n .catch(error => {\n throw { [FETCH_ERROR]: error };\n })\n .then(response => {\n if (!response.ok) {\n const err = new WretchError();\n // Enhance the error object\n err[\"cause\"] = referenceError;\n err.stack = err.stack + \"\\nCAUSE: \" + referenceError.stack;\n err.response = response;\n err.url = finalUrl;\n if (response.type === \"opaque\") {\n throw err;\n }\n return response.text().then((body) => {\n var _a;\n err.message = body;\n if (config.errorType === \"json\" || ((_a = response.headers.get(\"Content-Type\")) === null || _a === void 0 ? void 0 : _a.split(\";\")[0]) === \"application/json\") {\n try {\n err.json = JSON.parse(body);\n }\n catch (e) { /* ignore */ }\n }\n err.text = body;\n err[\"status\"] = response.status;\n throw err;\n });\n }\n return response;\n });\n // Wraps the Promise in order to dispatch the error to a matching catcher\n const catchersWrapper = (promise) => {\n return promise.catch(err => {\n const fetchErrorFlag = err.hasOwnProperty(FETCH_ERROR);\n const error = fetchErrorFlag ? err[FETCH_ERROR] : err;\n const catcher = ((error === null || error === void 0 ? void 0 : error.status) && catchers.get(error.status)) ||\n catchers.get(error === null || error === void 0 ? void 0 : error.name) || (fetchErrorFlag && catchers.has(FETCH_ERROR) && catchers.get(FETCH_ERROR));\n if (catcher)\n return catcher(error, wretch);\n const catcherFallback = catchers.get(CATCHER_FALLBACK);\n if (catcherFallback)\n return catcherFallback(error, wretch);\n throw error;\n });\n };\n const bodyParser = funName => cb => funName ?\n // If a callback is provided, then callback with the body result otherwise return the parsed body itself.\n catchersWrapper(throwingPromise.then(_ => _ && _[funName]()).then(_ => cb ? cb(_) : _)) :\n // No body parsing method - return the response\n catchersWrapper(throwingPromise.then(_ => cb ? cb(_) : _));\n const responseChain = {\n _wretchReq: wretch,\n _fetchReq,\n _sharedState: sharedState,\n res: bodyParser(null),\n json: bodyParser(\"json\"),\n blob: bodyParser(\"blob\"),\n formData: bodyParser(\"formData\"),\n arrayBuffer: bodyParser(\"arrayBuffer\"),\n text: bodyParser(\"text\"),\n error(errorId, cb) {\n catchers.set(errorId, cb);\n return this;\n },\n badRequest(cb) { return this.error(400, cb); },\n unauthorized(cb) { return this.error(401, cb); },\n forbidden(cb) { return this.error(403, cb); },\n notFound(cb) { return this.error(404, cb); },\n timeout(cb) { return this.error(408, cb); },\n internalError(cb) { return this.error(500, cb); },\n fetchError(cb) { return this.error(FETCH_ERROR, cb); },\n };\n const enhancedResponseChain = addons.reduce((chain, addon) => ({\n ...chain,\n ...addon.resolver\n }), responseChain);\n return resolvers.reduce((chain, r) => r(chain, wretch), enhancedResponseChain);\n};\n//# sourceMappingURL=resolver.js.map","/**\n * @private @internal\n */\nexport const middlewareHelper = (middlewares) => (fetchFunction) => {\n return middlewares.reduceRight((acc, curr) => curr(acc), fetchFunction) || fetchFunction;\n};\n//# sourceMappingURL=middleware.js.map","import { mix, extractContentType, isLikelyJsonMime } from \"./utils.js\";\nimport { JSON_MIME, CONTENT_TYPE_HEADER, CATCHER_FALLBACK } from \"./constants.js\";\nimport { resolver } from \"./resolver.js\";\nimport config from \"./config.js\";\nexport const core = {\n _url: \"\",\n _options: {},\n _config: config,\n _catchers: new Map(),\n _resolvers: [],\n _deferred: [],\n _middlewares: [],\n _addons: [],\n addon(addon) {\n return { ...this, _addons: [...this._addons, addon], ...addon.wretch };\n },\n errorType(errorType) {\n return {\n ...this,\n _config: {\n ...this._config,\n errorType\n }\n };\n },\n polyfills(polyfills, replace = false) {\n return {\n ...this,\n _config: {\n ...this._config,\n polyfills: replace ? polyfills : mix(this._config.polyfills, polyfills)\n }\n };\n },\n url(_url, replace = false) {\n if (replace)\n return { ...this, _url };\n const split = this._url.split(\"?\");\n return {\n ...this,\n _url: split.length > 1 ?\n split[0] + _url + \"?\" + split[1] :\n this._url + _url\n };\n },\n options(options, replace = false) {\n return { ...this, _options: replace ? options : mix(this._options, options) };\n },\n headers(headerValues) {\n return { ...this, _options: mix(this._options, { headers: headerValues || {} }) };\n },\n accept(headerValue) {\n return this.headers({ Accept: headerValue });\n },\n content(headerValue) {\n return this.headers({ [CONTENT_TYPE_HEADER]: headerValue });\n },\n auth(headerValue) {\n return this.headers({ Authorization: headerValue });\n },\n catcher(errorId, catcher) {\n const newMap = new Map(this._catchers);\n newMap.set(errorId, catcher);\n return { ...this, _catchers: newMap };\n },\n catcherFallback(catcher) {\n return this.catcher(CATCHER_FALLBACK, catcher);\n },\n resolve(resolver, clear = false) {\n return { ...this, _resolvers: clear ? [resolver] : [...this._resolvers, resolver] };\n },\n defer(callback, clear = false) {\n return {\n ...this,\n _deferred: clear ? [callback] : [...this._deferred, callback]\n };\n },\n middlewares(middlewares, clear = false) {\n return {\n ...this,\n _middlewares: clear ? middlewares : [...this._middlewares, ...middlewares]\n };\n },\n fetch(method = this._options.method, url = \"\", body = null) {\n let base = this.url(url).options({ method });\n // \"Jsonify\" the body if it is an object and if it is likely that the content type targets json.\n const contentType = extractContentType(base._options.headers);\n const jsonify = typeof body === \"object\" && (!base._options.headers || !contentType || isLikelyJsonMime(contentType));\n base =\n !body ? base :\n jsonify ? base.json(body, contentType) :\n base.body(body);\n return resolver(base\n ._deferred\n .reduce((acc, curr) => curr(acc, acc._url, acc._options), base));\n },\n get(url = \"\") {\n return this.fetch(\"GET\", url);\n },\n delete(url = \"\") {\n return this.fetch(\"DELETE\", url);\n },\n put(body, url = \"\") {\n return this.fetch(\"PUT\", url, body);\n },\n post(body, url = \"\") {\n return this.fetch(\"POST\", url, body);\n },\n patch(body, url = \"\") {\n return this.fetch(\"PATCH\", url, body);\n },\n head(url = \"\") {\n return this.fetch(\"HEAD\", url);\n },\n opts(url = \"\") {\n return this.fetch(\"OPTIONS\", url);\n },\n body(contents) {\n return { ...this, _options: { ...this._options, body: contents } };\n },\n json(jsObject, contentType) {\n const currentContentType = extractContentType(this._options.headers);\n return this.content(contentType ||\n isLikelyJsonMime(currentContentType) && currentContentType ||\n JSON_MIME).body(JSON.stringify(jsObject));\n }\n};\n//# sourceMappingURL=core.js.map","import { setOptions, setErrorType, setPolyfills } from \"./config.js\";\nimport { core } from \"./core.js\";\nimport { WretchError } from \"./resolver.js\";\n/**\n * Creates a new wretch instance with a base url and base\n * [fetch options](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch).\n *\n * ```ts\n * import wretch from \"wretch\"\n *\n * // Reusable instance\n * const w = wretch(\"https://domain.com\", { mode: \"cors\" })\n * ```\n *\n * @param _url The base url\n * @param _options The base fetch options\n * @returns A fresh wretch instance\n */\nfunction factory(_url = \"\", _options = {}) {\n return { ...core, _url, _options };\n}\nfactory[\"default\"] = factory;\n/** {@inheritDoc setOptions} */\nfactory.options = setOptions;\n/** {@inheritDoc setErrorType} */\nfactory.errorType = setErrorType;\n/** {@inheritDoc setPolyfills} */\nfactory.polyfills = setPolyfills;\nfactory.WretchError = WretchError;\nexport default factory;\n//# sourceMappingURL=index.js.map","function stringify(value) {\n return typeof value !== \"undefined\" ? value : \"\";\n}\nconst appendQueryParams = (url, qp, replace, config) => {\n let queryString;\n if (typeof qp === \"string\") {\n queryString = qp;\n }\n else {\n const usp = config.polyfill(\"URLSearchParams\", true, true);\n for (const key in qp) {\n const value = qp[key];\n if (qp[key] instanceof Array) {\n for (const val of value)\n usp.append(key, stringify(val));\n }\n else {\n usp.append(key, stringify(value));\n }\n }\n queryString = usp.toString();\n }\n const split = url.split(\"?\");\n if (!queryString)\n return replace ? split[0] : url;\n if (replace || split.length < 2)\n return split[0] + \"?\" + queryString;\n return url + \"&\" + queryString;\n};\n/**\n * Adds the ability to append query parameters from a javascript object.\n *\n * ```js\n * import QueryAddon from \"wretch/addons/queryString\"\n *\n * wretch().addon(QueryAddon)\n * ```\n */\nconst queryString = {\n wretch: {\n query(qp, replace = false) {\n return { ...this, _url: appendQueryParams(this._url, qp, replace, this._config) };\n }\n }\n};\nexport default queryString;\n//# sourceMappingURL=queryString.js.map","import wretch from 'wretch'\nimport QueryStringAddon from 'wretch/addons/queryString'\n\nwretch.options({\n headers: { 'X-Requested-With': 'XMLHttpRequest' },\n})\n\nexport default wretch().addon(QueryStringAddon)\n","const not = {\n inert: ':not([inert]):not([inert] *)',\n negTabIndex: ':not([tabindex^=\"-\"])',\n disabled: ':not(:disabled)',\n};\n\nvar focusableSelectors = [\n `a[href]${not.inert}${not.negTabIndex}`,\n `area[href]${not.inert}${not.negTabIndex}`,\n `input:not([type=\"hidden\"]):not([type=\"radio\"])${not.inert}${not.negTabIndex}${not.disabled}`,\n `input[type=\"radio\"]${not.inert}${not.negTabIndex}${not.disabled}`,\n `select${not.inert}${not.negTabIndex}${not.disabled}`,\n `textarea${not.inert}${not.negTabIndex}${not.disabled}`,\n `button${not.inert}${not.negTabIndex}${not.disabled}`,\n `details${not.inert} > summary:first-of-type${not.negTabIndex}`,\n // Discard until Firefox supports `:has()`\n // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12\n // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,\n `iframe${not.inert}${not.negTabIndex}`,\n `audio[controls]${not.inert}${not.negTabIndex}`,\n `video[controls]${not.inert}${not.negTabIndex}`,\n `[contenteditable]${not.inert}${not.negTabIndex}`,\n `[tabindex]${not.inert}${not.negTabIndex}`,\n];\n\n/**\n * Set the focus to the first element with `autofocus` with the element or the\n * element itself.\n */\nfunction moveFocusToDialog(el) {\n const focused = (el.querySelector('[autofocus]') || el);\n focused.focus();\n}\n/**\n * Get the first and last focusable elements in a given tree.\n */\nfunction getFocusableEdges(el) {\n // Check for a focusable element within the subtree of `el`.\n const first = findFocusableElement(el, true);\n // Only if we find the first element do we need to look for the last one. If\n // there’s no last element, we set `last` as a reference to `first` so that\n // the returned array is always of length 2.\n const last = first ? findFocusableElement(el, false) || first : null;\n return [first, last];\n}\n/**\n * Find the first focusable element inside the given node if `forward` is truthy\n * or the last focusable element otherwise.\n */\nfunction findFocusableElement(node, forward) {\n // If we’re walking forward, check if this node is focusable, and return it\n // immediately if it is.\n if (forward && isFocusable(node))\n return node;\n // We should only search the subtree of this node if it can have focusable\n // children.\n if (canHaveFocusableChildren(node)) {\n // Start walking the DOM tree, looking for focusable elements.\n // Case 1: If this node has a shadow root, search it recursively.\n if (node.shadowRoot) {\n // Descend into this subtree.\n let next = getNextChildEl(node.shadowRoot, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableElement(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n // Case 2: If this node is a slot for a Custom Element, search its assigned\n // nodes recursively.\n else if (node.localName === 'slot') {\n const assignedElements = node.assignedElements({\n flatten: true,\n });\n if (!forward)\n assignedElements.reverse();\n for (const assignedElement of assignedElements) {\n const focusableEl = findFocusableElement(assignedElement, forward);\n if (focusableEl)\n return focusableEl;\n }\n }\n // Case 3: this is a regular Light DOM node. Search its subtree.\n else {\n // Descend into this subtree.\n let next = getNextChildEl(node, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableElement(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n }\n // If we’re walking backward, we want to check the node’s entire subtree\n // before checking the node itself. If this node is focusable, return it.\n if (!forward && isFocusable(node))\n return node;\n return null;\n}\nfunction getNextChildEl(node, forward) {\n return forward ? node.firstElementChild : node.lastElementChild;\n}\nfunction getNextSiblingEl(el, forward) {\n return forward ? el.nextElementSibling : el.previousElementSibling;\n}\n/**\n * Determine if an element is hidden from the user.\n */\nconst isHidden = (el) => {\n // Browsers hide all non-
descendants of closed elements\n // from user interaction, but those non- elements may still match our\n // focusable-selectors and may still have dimensions, so we need a special\n // case to ignore them.\n if (el.matches('details:not([open]) *') &&\n !el.matches('details>summary:first-of-type'))\n return true;\n // If this element has no painted dimensions, it's hidden.\n return !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n};\n/**\n * Determine if an element is focusable and has user-visible painted dimensions.\n */\nconst isFocusable = (el) => {\n // A shadow host that delegates focus will never directly receive focus,\n // even with `tabindex=0`. Consider our custom element, which\n // delegates focus to its shadow button:\n //\n // \n // #shadow-root\n // \n // \n //\n // The browser acts as as if there is only one focusable element – the shadow\n // button. Our library should behave the same way.\n if (el.shadowRoot?.delegatesFocus)\n return false;\n return el.matches(focusableSelectors.join(',')) && !isHidden(el);\n};\n/**\n * Determine if an element can have focusable children. Useful for bailing out\n * early when walking the DOM tree.\n * @example\n * This div is inert, so none of its children can be focused, even though they\n * meet our criteria for what is focusable. Once we check the div, we can skip\n * the rest of the subtree.\n * ```html\n * \n * ```\n */\nfunction canHaveFocusableChildren(el) {\n // The browser will never send focus into a Shadow DOM if the host element\n // has a negative tabindex. This applies to both slotted Light DOM Shadow DOM\n // children\n if (el.shadowRoot && el.getAttribute('tabindex') === '-1')\n return false;\n // Elemments matching this selector are either hidden entirely from the user,\n // or are visible but unavailable for interaction. Their descentants can never\n // receive focus.\n return !el.matches(':disabled,[hidden],[inert]');\n}\n/**\n * Get the active element, accounting for Shadow DOM subtrees.\n * @author Cory LaViska\n * @see: https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/\n */\nfunction getActiveElement(root = document) {\n const activeEl = root.activeElement;\n if (!activeEl)\n return null;\n // If there’s a shadow root, recursively find the active element within it.\n // If the recursive call returns null, return the active element\n // of the top-level Document.\n if (activeEl.shadowRoot)\n return getActiveElement(activeEl.shadowRoot) || document.activeElement;\n // If not, we can just return the active element\n return activeEl;\n}\n/**\n * Trap the focus inside the given element\n */\nfunction trapTabKey(el, event) {\n const [firstFocusableChild, lastFocusableChild] = getFocusableEdges(el);\n // If there are no focusable children in the dialog, prevent the user from\n // tabbing out of it\n if (!firstFocusableChild)\n return event.preventDefault();\n const activeElement = getActiveElement();\n // If the SHIFT key is pressed while tabbing (moving backwards) and the\n // currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && activeElement === firstFocusableChild) {\n // @ts-ignore: we know that `lastFocusableChild` is not null here\n lastFocusableChild.focus();\n event.preventDefault();\n }\n // If the SHIFT key is not pressed (moving forwards) and the currently focused\n // item is the last one, move the focus to the first focusable item from the\n // dialog element\n else if (!event.shiftKey && activeElement === lastFocusableChild) {\n firstFocusableChild.focus();\n event.preventDefault();\n }\n}\n\nclass A11yDialog {\n $el;\n id;\n previouslyFocused;\n shown;\n constructor(element) {\n this.$el = element;\n this.id = this.$el.getAttribute('data-a11y-dialog') || this.$el.id;\n this.previouslyFocused = null;\n this.shown = false;\n this.maintainFocus = this.maintainFocus.bind(this);\n this.bindKeypress = this.bindKeypress.bind(this);\n this.handleTriggerClicks = this.handleTriggerClicks.bind(this);\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n this.$el.setAttribute('aria-hidden', 'true');\n this.$el.setAttribute('aria-modal', 'true');\n this.$el.setAttribute('tabindex', '-1');\n if (!this.$el.hasAttribute('role')) {\n this.$el.setAttribute('role', 'dialog');\n }\n document.addEventListener('click', this.handleTriggerClicks, true);\n }\n /**\n * Destroy the current instance (after making sure the dialog has been hidden)\n * and remove all associated listeners from dialog openers and closers\n */\n destroy() {\n // Hide the dialog to avoid destroying an open instance\n this.hide();\n // Remove the click event delegates for our openers and closers\n document.removeEventListener('click', this.handleTriggerClicks, true);\n // Clone and replace the dialog element to prevent memory leaks caused by\n // event listeners that the author might not have cleaned up.\n this.$el.replaceWith(this.$el.cloneNode(true));\n // Dispatch a `destroy` event\n this.fire('destroy');\n return this;\n }\n /**\n * Show the dialog element, trap the current focus within it, listen for some\n * specific key presses and fire all registered callbacks for `show` event\n */\n show(event) {\n // If the dialog is already open, abort\n if (this.shown)\n return this;\n // Keep a reference to the currently focused element to be able to restore\n // it later\n this.shown = true;\n this.$el.removeAttribute('aria-hidden');\n this.previouslyFocused = getActiveElement();\n // Due to a long lasting bug in Safari, clicking an interactive element\n // (like a ) does *not* move the focus to that element, which means\n // `document.activeElement` is whatever element is currently focused (like\n // an ), or the element otherwise. We can work around that\n // problem by checking whether the focused element is the , and if it,\n // store the click event target.\n // See: https://bugs.webkit.org/show_bug.cgi?id=22261\n if (this.previouslyFocused?.tagName === 'BODY' && event?.target) {\n this.previouslyFocused = event.target;\n }\n // Set the focus to the dialog element\n moveFocusToDialog(this.$el);\n // Bind a focus event listener to the body element to make sure the focus\n // stays trapped inside the dialog while open, and start listening for some\n // specific key presses (TAB and ESC)\n document.body.addEventListener('focus', this.maintainFocus, true);\n this.$el.addEventListener('keydown', this.bindKeypress, true);\n // Dispatch a `show` event\n this.fire('show', event);\n return this;\n }\n /**\n * Hide the dialog element, restore the focus to the previously active\n * element, stop listening for some specific key presses and fire all\n * registered callbacks for `hide` event\n */\n hide(event) {\n // If the dialog is already closed, abort\n if (!this.shown)\n return this;\n this.shown = false;\n this.$el.setAttribute('aria-hidden', 'true');\n this.previouslyFocused?.focus?.();\n // Remove the focus event listener to the body element and stop listening\n // for specific key presses\n document.body.removeEventListener('focus', this.maintainFocus, true);\n this.$el.removeEventListener('keydown', this.bindKeypress, true);\n // Dispatch a `hide` event\n this.fire('hide', event);\n return this;\n }\n /**\n * Register a new callback for the given event type\n */\n on(type, handler, options) {\n this.$el.addEventListener(type, handler, options);\n return this;\n }\n /**\n * Unregister an existing callback for the given event type\n */\n off(type, handler, options) {\n this.$el.removeEventListener(type, handler, options);\n return this;\n }\n /**\n * Dispatch a custom event from the DOM element associated with this dialog.\n * This allows authors to listen for and respond to the events in their own\n * code\n */\n fire(type, event) {\n this.$el.dispatchEvent(new CustomEvent(type, {\n detail: event,\n cancelable: true,\n }));\n }\n /**\n * Add a delegated event listener for when elememts that open or close the\n * dialog are clicked, and call `show` or `hide`, respectively\n */\n handleTriggerClicks(event) {\n const target = event.target;\n // We use `.closest(..)` and not `.matches(..)` here so that clicking\n // an element nested within a dialog opener does cause the dialog to open\n if (target.closest(`[data-a11y-dialog-show=\"${this.id}\"]`)) {\n this.show(event);\n }\n if (target.closest(`[data-a11y-dialog-hide=\"${this.id}\"]`) ||\n (target.closest('[data-a11y-dialog-hide]') &&\n target.closest('[aria-modal=\"true\"]') === this.$el)) {\n this.hide(event);\n }\n }\n /**\n * Private event handler used when listening to some specific key presses\n * (namely ESC and TAB)\n */\n bindKeypress(event) {\n // This is an escape hatch in case there are nested open dialogs, so that\n // only the top most dialog gets interacted with\n if (document.activeElement?.closest('[aria-modal=\"true\"]') !== this.$el) {\n return;\n }\n // If the dialog is shown and the ESC key is pressed, prevent any further\n // effects from the ESC key and hide the dialog, unless its role is\n // `alertdialog`, which should be modal\n if (event.key === 'Escape' &&\n this.$el.getAttribute('role') !== 'alertdialog') {\n event.preventDefault();\n this.hide(event);\n }\n // If the dialog is shown and the TAB key is pressed, make sure the focus\n // stays trapped within the dialog element\n if (event.key === 'Tab') {\n trapTabKey(this.$el, event);\n }\n }\n /**\n * If the dialog is shown and the focus is not within a dialog element (either\n * this one or another one in case of nested dialogs) or attribute, move it\n * back to the dialog container\n * See: https://github.com/KittyGiraudel/a11y-dialog/issues/177\n */\n maintainFocus(event) {\n const target = event.target;\n if (!target.closest('[aria-modal=\"true\"], [data-a11y-dialog-ignore-focus-trap]')) {\n moveFocusToDialog(this.$el);\n }\n }\n}\n\nfunction instantiateDialogs() {\n for (const el of document.querySelectorAll('[data-a11y-dialog]')) {\n new A11yDialog(el);\n }\n}\nif (typeof document !== 'undefined') {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', instantiateDialogs);\n }\n else {\n instantiateDialogs();\n }\n}\n\nexport { A11yDialog as default };\n","import ajax from '@common/ajax'\nimport { on, off } from 'delegated-events'\nimport A11yDialog from 'a11y-dialog'\n\nconst generateTemplate = (id, useDefaultClose = true, useCustomClose = false, title = false) => {\n const role = useDefaultClose ? 'dialog' : 'alertdialog'\n const labeledBy = title ? 'aria-labelledby=\"modal-title\"' : ''\n\n const html = `\n \n
\n\n ${\n useCustomClose === false\n ? '
'\n : ''\n }\n\n
\n \n \n \n
\n
\n `\n\n return html\n}\n\nconst populateModal = async (opts = {}, modalEl) => {\n const type = opts.type\n const title = opts.title ?? ''\n const url = opts.url\n\n let modalContent = ''\n\n if (type === 'video') {\n modalContent = `\n \n
Watch ${title} \n
\n \n
\n
\n `\n\n modalEl.querySelector('.modal-container').innerHTML = modalContent\n }\n\n if (type === 'content') {\n modalContent = await ajax.get(url).text()\n\n modalEl.querySelector('.modal-container').innerHTML = modalContent\n }\n}\n\nconst handleModal = (e) => {\n e.preventDefault()\n\n const triggerEl = e.target.closest('[data-modal]')\n\n openModal({\n type: triggerEl.dataset.modal,\n title: triggerEl.dataset.modalTitle,\n url: triggerEl.href,\n updateUrl: triggerEl.dataset.modalUpdateUrl ?? false,\n useDefaultClose: triggerEl.dataset.modalDisableDefaultClose === undefined,\n useCustomClose: triggerEl.dataset.modalUseCustomClose !== undefined,\n })\n\n return false\n}\n\nconst openModal = (opts = {}) => {\n const type = opts.type\n const title = opts.title ?? false\n const useCustomClose = opts.useCustomClose ?? false\n let useDefaultClose = opts.useDefaultClose ?? true\n\n if (type === 'video') {\n useDefaultClose = false\n }\n\n if (type === 'subscribe') {\n useDefaultClose = false\n }\n\n const id = `modal-${Math.floor(Math.random() * Date.now())}`\n const template = generateTemplate(id, useDefaultClose, useCustomClose, title)\n const node = document.createRange().createContextualFragment(template)\n\n document.body.append(node)\n\n const modalEl = document.getElementById(id)\n const modal = new A11yDialog(modalEl)\n\n const hideModal = () => {\n modal.hide()\n }\n\n if (useCustomClose) {\n on('click', '.modal-custom-close', hideModal)\n }\n\n const currentUrl = opts.defaultUrl ?? window.location.href\n\n modal.on('show', () => {\n document.documentElement.classList.add('has-modal-active')\n\n if (opts.updateUrl !== false) {\n window.history.replaceState({}, '', opts.updateUrl)\n }\n })\n\n modal.on('hide', () => {\n document.documentElement.classList.remove('has-modal-active')\n\n modal.destroy()\n\n if (opts.updateUrl !== false) {\n window.history.replaceState({}, '', currentUrl)\n }\n\n if (useCustomClose) {\n off('click', '.modal-custom-close', hideModal)\n }\n })\n\n modal.on('destroy', (e) => {\n e.target.remove()\n })\n\n modal.show()\n\n populateModal(\n {\n type: type,\n url: opts.url ?? false,\n updateUrl: opts.updateUrl,\n defaultUrl: opts.defaultUrl,\n },\n modalEl\n )\n}\n\nexport default {\n init: () => {\n const clickArgs = ['click', '[data-modal]', handleModal]\n off(...clickArgs)\n on(...clickArgs)\n\n // If we have video modals, load the YouTube API\n if (document.querySelectorAll('[data-modal=\"video\"]').length) {\n const tag = document.createElement('script')\n tag.src = 'https://www.youtube.com/iframe_api'\n\n const firstScriptTag = document.getElementsByTagName('script')[0]\n\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag)\n }\n },\n openModal,\n}\n","/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get (name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n\n if (name === found) {\n break\n }\n } catch (e) {}\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set,\n get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","import { gsap } from 'gsap'\nimport { ScrollTrigger } from 'gsap/ScrollTrigger'\n\ngsap.registerPlugin(ScrollTrigger)\n\nexport default {\n init: () => {\n const variants = {\n 'fade-up': {\n from: { opacity: 0, y: '50%' },\n to: { opacity: 1, y: 0 },\n },\n 'fade-left': {\n from: { opacity: 0, x: '100%' },\n to: { opacity: 1, x: 0 },\n },\n 'fade-right': {\n from: { opacity: 0, x: '-100%' },\n to: { opacity: 1, x: 0 },\n },\n }\n\n const elementSelector = '.element-section:not([data-disable-animations]) [data-sr-group]'\n\n // Handle elements\n for (const [key, opts] of Object.entries(variants)) {\n if (document.querySelectorAll(`${elementSelector} [data-sr=\"${key}\"]`).length) {\n gsap.set(`${elementSelector} [data-sr=\"${key}\"]`, opts.from)\n }\n }\n\n // Handle element content parts\n if (document.querySelectorAll(`${elementSelector} [data-sr=\"fade-content-up\"]`).length) {\n const childrenNotWysiwyg = `${elementSelector} [data-sr=\"fade-content-up\"] > *:not(.wysiwyg)`\n\n if (document.querySelectorAll(childrenNotWysiwyg).length) {\n gsap.set(childrenNotWysiwyg, {\n opacity: 0,\n y: '50%',\n })\n }\n\n const childrenNotChecklist = `${elementSelector} [data-sr=\"fade-content-up\"] > .wysiwyg > *:not([class*=\"as-checklist\"])`\n\n if (document.querySelectorAll(childrenNotChecklist).length) {\n gsap.set(childrenNotChecklist, {\n opacity: 0,\n y: '50%',\n })\n }\n\n const childrenChecklist = `${elementSelector} [data-sr=\"fade-content-up\"] > .wysiwyg > [class*=\"as-checklist\"] li`\n\n if (document.querySelectorAll(childrenChecklist).length) {\n gsap.set(childrenChecklist, {\n opacity: 0,\n y: '50%',\n })\n }\n }\n\n document.querySelectorAll('.element-section:not([data-disable-animations]) [data-sr-group]').forEach((group) => {\n const common = {\n duration: 0.8,\n stagger: 0.3,\n paused: true,\n ease: 'power4',\n scrollTrigger: {\n trigger: group,\n start: 'top 65%',\n markers: false,\n },\n }\n\n for (const [key, opts] of Object.entries(variants)) {\n const els = group.querySelectorAll(`[data-sr=\"${key}\"]`)\n\n if (els.length) {\n gsap.to(els, {\n ...opts.to,\n ...common,\n })\n }\n }\n\n group.querySelectorAll('[data-sr=\"fade-content-up\"]').forEach((content) => {\n gsap.to(content.querySelectorAll('*'), {\n opacity: 1,\n y: 0,\n ...common,\n })\n })\n })\n\n window.addEventListener('beforeprint', () => {\n for (const [key, opts] of Object.entries(variants)) {\n if (document.querySelectorAll(`[data-sr=\"${key}\"]`).length) {\n gsap.set(`[data-sr=\"${key}\"]`, opts.to)\n }\n }\n })\n },\n}\n","// Robert Penner's easeInOutQuad\n\n// find the rest of his easing functions here: http://robertpenner.com/easing/\n// find them exported for ES6 consumption here: https://github.com/jaxgeller/ez.js\n\nvar easeInOutQuad = function easeInOutQuad(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar jumper = function jumper() {\n // private variable cache\n // no variables are created during a jump, preventing memory leaks\n\n var element = void 0; // element to scroll to (node)\n\n var start = void 0; // where scroll starts (px)\n var stop = void 0; // where scroll stops (px)\n\n var offset = void 0; // adjustment from the stop position (px)\n var easing = void 0; // easing function (function)\n var a11y = void 0; // accessibility support flag (boolean)\n\n var distance = void 0; // distance of scroll (px)\n var duration = void 0; // scroll duration (ms)\n\n var timeStart = void 0; // time scroll started (ms)\n var timeElapsed = void 0; // time spent scrolling thus far (ms)\n\n var next = void 0; // next scroll position (px)\n\n var callback = void 0; // to call when done scrolling (function)\n\n // scroll position helper\n\n function location() {\n return window.scrollY || window.pageYOffset;\n }\n\n // element offset helper\n\n function top(element) {\n return element.getBoundingClientRect().top + start;\n }\n\n // rAF loop helper\n\n function loop(timeCurrent) {\n // store time scroll started, if not started already\n if (!timeStart) {\n timeStart = timeCurrent;\n }\n\n // determine time spent scrolling so far\n timeElapsed = timeCurrent - timeStart;\n\n // calculate next scroll position\n next = easing(timeElapsed, start, distance, duration);\n\n // scroll to it\n window.scrollTo(0, next);\n\n // check progress\n timeElapsed < duration ? window.requestAnimationFrame(loop) // continue scroll loop\n : done(); // scrolling is done\n }\n\n // scroll finished helper\n\n function done() {\n // account for rAF time rounding inaccuracies\n window.scrollTo(0, start + distance);\n\n // if scrolling to an element, and accessibility is enabled\n if (element && a11y) {\n // add tabindex indicating programmatic focus\n element.setAttribute('tabindex', '-1');\n\n // focus the element\n element.focus();\n }\n\n // if it exists, fire the callback\n if (typeof callback === 'function') {\n callback();\n }\n\n // reset time for next jump\n timeStart = false;\n }\n\n // API\n\n function jump(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // resolve options, or use defaults\n duration = options.duration || 1000;\n offset = options.offset || 0;\n callback = options.callback; // \"undefined\" is a suitable default, and won't be called\n easing = options.easing || easeInOutQuad;\n a11y = options.a11y || false;\n\n // cache starting position\n start = location();\n\n // resolve target\n switch (typeof target === 'undefined' ? 'undefined' : _typeof(target)) {\n // scroll from current position\n case 'number':\n element = undefined; // no element to scroll to\n a11y = false; // make sure accessibility is off\n stop = start + target;\n break;\n\n // scroll to element (node)\n // bounding rect is relative to the viewport\n case 'object':\n element = target;\n stop = top(element);\n break;\n\n // scroll to element (selector)\n // bounding rect is relative to the viewport\n case 'string':\n element = document.querySelector(target);\n stop = top(element);\n break;\n }\n\n // resolve scroll distance, accounting for offset\n distance = stop - start + offset;\n\n // resolve duration\n switch (_typeof(options.duration)) {\n // number in ms\n case 'number':\n duration = options.duration;\n break;\n\n // function passed the distance of the scroll\n case 'function':\n duration = options.duration(distance);\n break;\n }\n\n // start the loop\n window.requestAnimationFrame(loop);\n }\n\n // expose only the jump method\n return jump;\n};\n\n// export singleton\n\nvar singleton = jumper();\n\nexport default singleton;\n","import jump from 'jump.js'\n\nconst getPageOffset = () => {\n let offset = 0\n\n const siteHeader = document.querySelector('.site-header')\n\n if (siteHeader) {\n offset += siteHeader.offsetHeight\n }\n\n return offset\n}\n\nconst scrollTo = (target, additionalOffset = 0) => {\n const pageOffset = getPageOffset() * -1\n\n if (target.dataset.scrollOffset) {\n additionalOffset = parseInt(target.dataset.scrollOffset)\n }\n\n let offset = pageOffset - additionalOffset\n\n return new Promise((resolve) => {\n jump(target, { duration: 600, offset, callback: resolve })\n })\n}\n\nexport default scrollTo\n","import { on } from 'delegated-events'\nimport scrollTo from '@common/scroll-to'\n\nconst ignorePageTypes = []\n\nconst handleScroll = (event, el) => {\n let targetSelector = null\n\n if (el.dataset.scroll) {\n targetSelector = el.dataset.scroll\n } else if (el.tagName === 'A') {\n targetSelector = el.hash\n } else {\n return\n }\n\n if (targetSelector) {\n const target = document.querySelector(targetSelector)\n let offset = 0\n\n if (target) {\n event.preventDefault()\n\n // Deactivate navigation menu if active\n document.documentElement.classList.remove('js-site-menu-open')\n\n scrollTo(target, offset)\n }\n }\n}\n\nconst handleUrl = () => {\n const shouldIgnore = Array.from(document.body.classList).some((x) => ignorePageTypes.includes(x))\n\n if (shouldIgnore) {\n return\n }\n\n if (window.location.hash) {\n let targetSelector = window.location.hash\n\n let target = document.querySelector(targetSelector)\n\n if (target) {\n setTimeout(() => {\n window.scrollTo(0, 0)\n }, 1)\n\n setTimeout(() => {\n scrollTo(target)\n }, 250)\n }\n }\n}\n\n// Automatically scrolls to the first element with the [data-scrolltome] attribute\nconst handleScrollToMe = () => {\n const target = document.querySelector('[data-scrolltome]')\n\n if (target) {\n setTimeout(() => {\n scrollTo(target)\n }, 250)\n }\n}\n\nexport default {\n init: () => {\n on('click', '[data-scroll]', (event) => {\n const el = event.target.closest('[data-scroll]')\n\n handleScroll(event, el)\n })\n\n // Handle any custom anchor tags\n on('click', '.wysiwyg a[href*=\"#\"]:not(.ignore-scroll)', (event) => {\n const el = event.target.closest('a')\n\n handleScroll(event, el)\n })\n\n handleUrl()\n handleScrollToMe()\n },\n}\n","import { on } from 'delegated-events'\n\nconst topBar = document.querySelector('.site-announcement-bar')\n\nconst handleClose = () => {\n topBar.remove()\n setHeight()\n}\n\nconst setHeight = () => {\n document.documentElement.style.setProperty('--site-announcement-height', `${topBar.offsetHeight}px`)\n}\n\nexport default {\n init: () => {\n if (topBar) {\n on('click', '.site-announcement-bar-close', handleClose)\n\n setHeight()\n window.addEventListener('resize', setHeight)\n }\n },\n}\n","import { on } from 'delegated-events'\n\nconst siteHeader = document.querySelector('.site-header')\nconst siteMenu = document.querySelector('.site-menu')\n\nconst openMenu = () => {\n document.documentElement.classList.add('js-site-menu-open')\n}\n\nconst closeMenu = () => {\n document.documentElement.classList.remove('js-site-menu-open')\n\n if (siteMenu) {\n siteMenu.querySelectorAll('.is-active').forEach((el) => {\n const trigger = el.querySelector('[data-slide-toggle]')\n const target = document.getElementById(trigger.getAttribute('aria-controls'))\n\n target.style = null\n trigger.setAttribute('aria-expanded', 'false')\n el.classList.remove('is-active')\n })\n }\n}\n\nexport default {\n init: () => {\n const scrollPixel = document.querySelector('.scroll-pixel')\n\n if (scrollPixel) {\n const observer = new IntersectionObserver(\n ([e]) => siteHeader.classList.toggle('is-stuck', e.intersectionRatio < 1),\n {\n threshold: [1],\n }\n )\n\n observer.observe(document.querySelector('.scroll-pixel'))\n }\n\n on('click', '.site-menu-open', openMenu)\n on('click', '.site-menu-close', closeMenu)\n on('click', '.site-menu-screen', closeMenu)\n },\n}\n","import Cookies from 'js-cookie'\nimport { on } from 'delegated-events'\n\nconst widget = document.querySelector('.site-widget')\n\nconst setCookie = (state) => {\n Cookies.set('widgetstate', state, {\n expires: 1,\n })\n}\n\nconst handleToggle = () => {\n const offset = widget.querySelector('.site-widget-top').offsetHeight\n\n if (widget.getAttribute('aria-expanded') === 'false') {\n widget.style.transform = 'translate3d(0, 0, 0)'\n widget.setAttribute('aria-expanded', 'true')\n setCookie('active')\n } else {\n widget.style.transform = `translate3d(0, calc(100% - ${offset}px), 0)`\n widget.setAttribute('aria-expanded', 'false')\n setCookie('inactive')\n }\n}\n\nconst handleClose = (e) => {\n e.stopPropagation()\n\n widget.remove()\n}\n\nexport default {\n init: () => {\n if (widget) {\n on('click', '.site-widget-top', handleToggle)\n on('click', '.site-widget-close', handleClose)\n\n const offset = widget.querySelector('.site-widget-top').offsetHeight\n\n if (Cookies.get('widgetstate') === 'inactive') {\n setTimeout(() => {\n widget.style.transform = `translate3d(0, calc(100% - ${offset}px), 0)`\n widget.setAttribute('aria-expanded', 'false')\n }, 25)\n setCookie('inactive')\n } else {\n widget.classList.add('no-animate')\n widget.style.transform = 'translate3d(0, 0, 0)'\n widget.setAttribute('aria-expanded', 'true')\n setCookie('active')\n\n setTimeout(() => {\n widget.classList.remove('no-animate')\n }, 750)\n }\n\n if (widget.classList.contains('has-auto-hide')) {\n setTimeout(() => {\n if (widget.getAttribute('aria-expanded') === 'true') {\n widget.style.transform = `translate3d(0, calc(100% - ${offset}px), 0)`\n widget.setAttribute('aria-expanded', 'false')\n setCookie('inactive')\n }\n }, 5000)\n }\n }\n },\n}\n","const afterNextRepaint = (callback) => {\n return new Promise((resolve) => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n callback(resolve);\n });\n });\n });\n};\nlet defaultOptions = {\n easing: \"ease\",\n duration: 250,\n fill: \"backwards\",\n display: \"block\",\n overflow: \"hidden\"\n};\nlet nonAnimatableOptions = [\"overflow\", \"display\"];\nlet SlideController = (element, options) => {\n let mergedOptions = Object.assign({}, defaultOptions, options);\n let openDisplayValue = mergedOptions.display;\n let closedDisplayValue = \"none\";\n let setDisplay = (value) => element.style.display = value;\n let getHeight = () => element.clientHeight + \"px\";\n let getComputed = () => window.getComputedStyle(element);\n let setOverflow = (set) => element.style.overflow = set ? mergedOptions.overflow : \"\";\n let getAnimations = () => element.getAnimations();\n let createAnimation = (willOpen, lowerBound) => {\n var _a;\n nonAnimatableOptions.forEach((property) => delete mergedOptions[property]);\n let currentHeight = getHeight();\n let frames = [currentHeight, lowerBound].map((height) => ({\n height,\n paddingTop: \"0px\",\n paddingBottom: \"0px\"\n }));\n let { paddingTop, paddingBottom } = getComputed();\n frames[0].paddingTop = paddingTop;\n frames[0].paddingBottom = paddingBottom;\n if (willOpen) {\n frames[0].height = currentHeight;\n frames.reverse();\n }\n if ((_a = window.matchMedia(\"(prefers-reduced-motion: reduce)\")) == null ? void 0 : _a.matches) {\n mergedOptions.duration = 0;\n }\n let animation = element.animate(frames, mergedOptions);\n animation.id = (+willOpen).toString();\n return animation;\n };\n let triggerAnimation = async (willOpen) => {\n let finishedAnimations = getAnimations().map((a) => a.finish());\n await afterNextRepaint(async (resolve) => {\n let currentHeight = willOpen ? getHeight() : \"0px\";\n if (willOpen)\n setDisplay(openDisplayValue);\n setOverflow(true);\n await createAnimation(willOpen, currentHeight).finished;\n setOverflow(false);\n if (!willOpen)\n setDisplay(closedDisplayValue);\n resolve();\n });\n return finishedAnimations.length ? null : willOpen;\n };\n let up2 = async () => triggerAnimation(false);\n let down2 = async () => triggerAnimation(true);\n let toggle2 = async () => {\n var _a;\n let existingAnimationId = (_a = getAnimations()[0]) == null ? void 0 : _a.id;\n let condition = existingAnimationId ? existingAnimationId === \"1\" : element.offsetHeight;\n return (condition ? up2 : down2)();\n };\n return {\n up: up2,\n down: down2,\n toggle: toggle2\n };\n};\nlet down = (element, options = {}) => SlideController(element, options).down();\nlet up = (element, options = {}) => SlideController(element, options).up();\nlet toggle = (element, options = {}) => SlideController(element, options).toggle();\nexport {\n down,\n toggle,\n up\n};\n","import { up, down, toggle } from 'slide-element'\n\nexport const slideUp = (element, duration = 400, display = 'block') => {\n element.classList.add('is-sliding')\n\n const slide = up(element, {\n duration,\n display,\n easing: 'ease-out',\n })\n\n slide.then(() => {\n element.classList.remove('is-sliding')\n })\n\n return slide\n}\n\nexport const slideDown = (element, duration = 400, display = 'block') => {\n element.classList.add('is-sliding')\n\n const slide = down(element, {\n duration,\n display,\n easing: 'ease-out',\n })\n\n slide.then(() => {\n element.classList.remove('is-sliding')\n })\n\n return slide\n}\n\nexport const slideToggle = (element, duration = 400, display = 'block') => {\n element.classList.add('is-sliding')\n\n const slide = toggle(element, {\n duration,\n display,\n easing: 'ease-out',\n })\n\n slide.then(() => {\n element.classList.remove('is-sliding')\n })\n\n return slide\n}\n","import { on, fire } from 'delegated-events'\nimport { slideToggle } from '@common/slide'\nimport scrollTo from '@common/scroll-to'\n\nconst handleToggle = async (e) => {\n if (e.type === 'keyup' && e.keyCode !== 13) {\n return\n }\n\n if (e.target.closest('[data-scroll]')) {\n return\n }\n\n const trigger = e.target.closest('[data-slide-toggle]')\n\n if (!trigger) {\n return\n }\n\n const target = document.getElementById(trigger.getAttribute('aria-controls'))\n\n if (!target) {\n return\n }\n\n const otherTriggers = Array.from(\n document.querySelectorAll(`[data-slide-toggle][aria-controls=\"${trigger.getAttribute('aria-controls')}\"]`)\n ).filter((x) => x !== trigger)\n\n if (trigger.getAttribute('aria-expanded') === 'false') {\n trigger.setAttribute('aria-expanded', 'true')\n otherTriggers.forEach((x) => x.setAttribute('aria-expanded', 'true'))\n\n await slideToggle(target)\n\n fire(document.documentElement, 'slidetoggle:open', { target })\n\n if (trigger.dataset.slideToggle === 'scroll') {\n scrollTo(target)\n }\n\n const holder = trigger.closest('[data-slide-toggle-holder]')\n\n if (holder) {\n holder.classList.add('is-active')\n } else {\n trigger.parentNode.classList.add('is-active')\n otherTriggers.forEach((x) => x.parentNode.classList.add('is-active'))\n }\n } else {\n slideToggle(target)\n trigger.setAttribute('aria-expanded', 'false')\n otherTriggers.forEach((x) => x.setAttribute('aria-expanded', 'false'))\n\n const holder = trigger.closest('[data-slide-toggle-holder]')\n\n if (holder) {\n holder.classList.remove('is-active')\n } else {\n trigger.parentNode.classList.remove('is-active')\n otherTriggers.forEach((x) => x.parentNode.classList.remove('is-active'))\n }\n }\n}\n\nconst handleOpenedDefault = () => {\n document.querySelectorAll('[data-slide-toggle-opened-default]').forEach((el) => {\n const trigger = el.closest('[data-slide-toggle]')\n const target = document.getElementById(trigger.getAttribute('aria-controls'))\n\n if (trigger && target) {\n trigger.setAttribute('aria-expanded', 'true')\n target.classList.remove('hidden')\n }\n })\n}\n\nexport default {\n init: () => {\n const clickArgs = ['click', '[data-slide-toggle]', handleToggle]\n const keyArgs = ['keyup', '[data-slide-toggle]', handleToggle]\n\n on(...clickArgs)\n on(...keyArgs)\n\n handleOpenedDefault()\n },\n}\n","import * as validator from 'validate.js'\nimport scrollTo from '@common/scroll-to'\n\nvalidator.validators.checkboxGroup = function (_, group) {\n if (group) {\n const checked = group.querySelectorAll('input[type=checkbox]:checked')\n\n if (checked.length) {\n return null\n }\n }\n\n return '^Please select one'\n}\n\nconst findFieldWrapper = (el) => {\n if (el) {\n if (el.closest('.form-field-wrapper')) {\n return el.closest('.form-field-wrapper')\n }\n\n if (el.closest('.form-field')) {\n return el.closest('.form-field')\n }\n\n if (el.closest('.middleColumn')) {\n return el.closest('.middleColumn')\n }\n\n if (el.closest('.field')) {\n return el.closest('.field')\n }\n }\n}\n\nexport const handleBlur = (e) => {\n const fieldWrapper = findFieldWrapper(e.target)\n\n if (fieldWrapper) {\n fieldWrapper.classList.remove('has-error')\n\n const existingErrorMessage = fieldWrapper.querySelector('.form-field-message')\n\n if (existingErrorMessage) {\n existingErrorMessage.remove()\n }\n }\n\n if (e.target.classList.contains('has-error')) {\n e.target.classList.remove('has-error')\n }\n}\n\nexport const buildRules = (form) => {\n const rules = {}\n\n form\n .querySelectorAll('[required], input.required-if, .js-dropdown.required-if select, .optionset.required-if input')\n .forEach((field) => {\n // Ignore hidden fields\n if ((findFieldWrapper(field) && findFieldWrapper(field).offsetHeight === 0) || field.getAttribute('readonly')) {\n return\n }\n\n const fieldName = field.dataset.name ? field.dataset.name : field.name\n\n rules[fieldName] = {\n presence: {\n allowEmpty: false,\n message: '^Required',\n },\n }\n\n if (field.type === 'email') {\n rules[field.name].email = true\n }\n })\n\n form.querySelectorAll('[pattern]').forEach((field) => {\n // Ignore hidden fields\n if (findFieldWrapper(field).offsetHeight === 0 || field.readonly) {\n return\n }\n\n rules[field.name] = {\n format: {\n pattern: field.getAttribute('pattern'),\n message: '^Required',\n },\n }\n })\n\n form.querySelectorAll('[min]').forEach((field) => {\n // Ignore hidden fields\n if (findFieldWrapper(field).offsetHeight === 0 || field.readonly) {\n return\n }\n\n rules[field.name] = {\n length: {\n minimum: parseInt(field.min),\n },\n }\n })\n\n form.querySelectorAll('[data-equals]').forEach((field) => {\n // Ignore hidden fields\n if (findFieldWrapper(field).offsetHeight === 0 || field.readonly) {\n return\n }\n\n rules[field.name] = {\n equality: field.dataset.equals,\n }\n })\n\n form.querySelectorAll('[aria-required], [data-required]').forEach((field) => {\n // Ignore hidden fields\n if ((findFieldWrapper(field) && findFieldWrapper(field).offsetHeight === 0) || field.readonly) {\n return\n }\n\n if (field.classList.contains('optionset')) {\n const radio = field.querySelector('input[type=radio]')\n const checkbox = field.querySelector('input[type=checkbox]')\n\n if (radio) {\n rules[radio.name] = {\n presence: {\n message: '^Required',\n },\n }\n }\n\n if (checkbox) {\n rules[checkbox.name] = {\n checkboxGroup: checkbox.closest('.optionset'),\n }\n }\n }\n })\n\n form.querySelectorAll('.requiredcheckboxset').forEach((field) => {\n // Ignore hidden fields\n if ((findFieldWrapper(field) && findFieldWrapper(field).offsetHeight === 0) || field.readonly) {\n return\n }\n\n const checkbox = field.querySelector('input[type=checkbox]')\n\n if (checkbox) {\n rules[checkbox.name] = {\n checkboxGroup: checkbox.closest('.requiredcheckboxset'),\n }\n }\n })\n\n return rules\n}\n\nexport const handleValidation = (form) => {\n const rules = buildRules(form)\n const result = validate(form, rules)\n\n if (result !== undefined) {\n for (const [name, messages] of Object.entries(result)) {\n const field = form.querySelector(`[name=\"${name}\"]`)\n const fieldWrapper = findFieldWrapper(field)\n\n // Place error message\n if (fieldWrapper) {\n const existingErrorMessage = fieldWrapper.querySelector('.form-field-message')\n\n if (existingErrorMessage) {\n existingErrorMessage.remove()\n }\n\n const message = `\n \n ${messages[0]}\n
\n `\n fieldWrapper.insertAdjacentHTML('beforeend', message)\n fieldWrapper.classList.add('has-error')\n }\n\n field.classList.add('has-error')\n }\n\n const shouldScroll = form.dataset.formScroll !== undefined\n\n const firstError = form.querySelector('.has-error')\n\n if (shouldScroll && firstError) {\n scrollTo(firstError, 150, () => {\n setTimeout(() => {\n firstError.querySelector('input') && firstError.querySelector('input').focus()\n }, 0)\n })\n }\n\n return false\n }\n\n return true\n}\n\nexport const validate = validator\n","import { on, fire } from 'delegated-events'\nimport { handleValidation, handleBlur } from '@common/validation'\nimport ajax from '@common/ajax'\nimport scrollTo from '@common/scroll-to'\nimport { trackGoogleAnalytics } from '@common/util'\n\nconst setupMasks = async (form) => {\n const fields = form.querySelectorAll('input[type=\"tel\"], input[data-currency]')\n\n if (!fields.length) {\n return\n }\n\n const { default: IMask } = await import('imask/esm/imask')\n await import('imask/esm/masked/number')\n await import('imask/esm/masked/pattern')\n\n fields.forEach((field) => {\n if (field.type === 'tel') {\n IMask(field, {\n mask: '(000) 000-0000',\n })\n }\n\n if (field.dataset.currency !== undefined) {\n const mask = IMask(field, {\n mask: Number,\n scale: 0,\n thousandsSeparator: ',',\n min: 1,\n })\n\n field.addEventListener('updateValue', (e) => {\n field.value = e.detail\n mask.updateValue()\n field.dispatchEvent(new Event('blur'))\n })\n }\n })\n}\n\nconst setupSpecialFields = (form) => {\n // Setup file inputs\n form.querySelectorAll('input[type=file]').forEach((input) => {\n const placeholder = document.createElement('div')\n placeholder.classList.add('file-input-placeholder')\n\n const additionalPlaceholder = input.dataset.additionalPlaceholder\n\n if (input.value) {\n placeholder.textContent = input.files[0].name\n } else {\n placeholder.innerHTML = `${input.placeholder} `\n\n if (additionalPlaceholder !== undefined) {\n placeholder.innerHTML += additionalPlaceholder\n }\n }\n\n input.parentNode.insertBefore(placeholder, input)\n\n placeholder.addEventListener('click', () => input.click())\n\n input.addEventListener('change', (e) => {\n placeholder.textContent = e.target.files[0].name\n })\n })\n\n form.querySelectorAll('.form-field-wrapper.has-length-limit').forEach((field) => {\n const input = field.querySelector('.has-length-limit')\n\n if (input && input.maxLength) {\n const counter = document.createElement('div')\n counter.classList.add('length-limit-counter')\n\n const count = document.createElement('span')\n count.textContent = `(${input.value.length}/${input.maxLength})`\n\n counter.appendChild(count)\n\n field.querySelector('.form-field').appendChild(counter)\n }\n })\n}\n\nconst handleLengthLimit = (e) => {\n const $input = e.target.closest('.has-length-limit')\n const $field = $input.closest('.field.has-length-limit')\n\n if ($input && $field) {\n const $count = $field.querySelector('.length-limit-counter span')\n $count.textContent = `(${$input.value.length}/${$input.maxLength})`\n }\n}\n\nconst handleToggle = (e) => {\n const form = e.target.closest('form')\n const field = e.target\n const name = e.target.name\n const selectedValue = e.target.value\n\n form.querySelectorAll(`[data-toggle-if^=\"${name}|\"]`).forEach((input) => {\n const toggleGroup = input.closest('.toggle-group')\n let shouldShow = false\n\n if (!toggleGroup) {\n return\n }\n\n if (field.type === 'radio') {\n const targetValues = input.dataset.toggleIf.split('|')\n targetValues.shift()\n shouldShow = targetValues.indexOf(selectedValue) !== -1\n }\n\n if (field.type === 'checkbox') {\n shouldShow = field.checked\n }\n\n if (shouldShow) {\n toggleGroup.classList.remove('hidden')\n } else {\n toggleGroup.classList.add('hidden')\n\n toggleGroup.querySelectorAll('input:not([type=checkbox]):not([type=radio])').forEach((x) => (x.value = null))\n\n toggleGroup.querySelectorAll('input:checked').forEach((x) => {\n if (!toggleGroup.classList.contains('ignore-clear')) {\n x.checked = false\n }\n\n form.querySelectorAll(`[data-toggle-if^=\"${x.name}|\"]`).forEach((input) => {\n const toggleGroup = input.closest('.toggle-group')\n toggleGroup.classList.add('hidden')\n\n toggleGroup.querySelectorAll('input:not([type=checkbox]):not([type=radio])').forEach((x) => (x.value = null))\n })\n })\n }\n })\n}\n\nconst toggleSubmit = (submitButton) => {\n submitButton.disabled = !submitButton.disabled\n submitButton.classList.toggle('btn-loading')\n}\n\nconst showFormMessages = (holder, message, success, autoHide) => {\n holder.style.display = 'block'\n holder.innerHTML = message\n\n if (success) {\n holder.classList.remove('form-message-error')\n } else {\n holder.classList.add('form-message-error')\n }\n\n if (autoHide) {\n setTimeout(() => {\n holder.style.display = 'none'\n }, 5000)\n }\n}\n\nconst handleAjaxSubmit = (e) => {\n e.preventDefault()\n\n const form = e.target\n const isValid = handleValidation(form)\n\n if (isValid) {\n const formMessages = form.querySelector('.form-messages')\n const submitButton = form.querySelector('[type=submit]')\n let autoHideMessage = form.dataset.autoHideMessage ? form.dataset.autoHideMessage === 'true' : true\n toggleSubmit(submitButton)\n\n const formData = new FormData(form)\n\n ajax\n .url(form.action)\n .body(formData)\n .post()\n .json((res) => {\n if (res.success) {\n if (res.ga) {\n res.ga.forEach((event) => trackGoogleAnalytics(event))\n }\n\n form.reset()\n form.querySelectorAll('select').forEach((x) => (x.value = null))\n form.querySelectorAll('.toggle-fields').forEach((x) => x.classList.add('hidden'))\n form.querySelectorAll('.toggle-group').forEach((x) => x.classList.add('hidden'))\n\n if (form.dataset.hideOnSubmit) {\n form.querySelectorAll('.form-content').forEach((x) => x.classList.add('hidden'))\n document.querySelectorAll('.hide-on-form-submit').forEach((x) => x.classList.add('invisible'))\n autoHideMessage = false\n\n const shouldScroll = form.dataset.formScroll !== undefined\n\n if (shouldScroll) {\n scrollTo(form, 32)\n }\n }\n\n // Allow other scripts to hook into this submit\n fire(document.documentElement, 'ajaxform:submit', {\n form: form,\n type: 'post',\n url: new URL(form.action),\n queryParameters: new URLSearchParams(formData).toString(),\n })\n }\n\n if (res.message) {\n showFormMessages(formMessages, res.message, res.success, autoHideMessage)\n }\n })\n .catch(() => {\n showFormMessages(formMessages, 'Sorry, there was a problem with your submission')\n })\n .finally(() => {\n toggleSubmit(submitButton)\n })\n }\n}\n\nconst handleSubmit = (e) => {\n const form = e.target\n const isValid = handleValidation(form)\n const submitButton = form.querySelector('[type=submit]')\n toggleSubmit(submitButton)\n\n if (!isValid) {\n e.preventDefault()\n toggleSubmit(submitButton)\n }\n}\n\nconst setupForm = (form) => {\n if (form) {\n setupMasks(form)\n setupSpecialFields(form)\n }\n}\n\nconst init = () => {\n if (!document.documentElement.classList.contains('did-form-init')) {\n document.querySelectorAll('.styled-form').forEach((form) => {\n setupForm(form)\n })\n\n on('blur', '.has-error', handleBlur, { capture: true })\n on('change', '.has-error', handleBlur, { capture: true })\n on('change', '.has-error blur', handleBlur, {\n capture: true,\n })\n on('submit', '.styled-form[data-form-ajax]', handleAjaxSubmit)\n on('submit', '.styled-form:not([data-form-ajax]):not(.userform)', handleSubmit)\n on('change', 'input[type=radio]', handleToggle)\n on('change', 'input[type=checkbox]', handleToggle)\n on('keyup', 'textarea.has-length-limit', handleLengthLimit, {\n capture: true,\n })\n\n document.documentElement.classList.add('did-form-init')\n }\n}\n\nexport default { init, setupForm }\n","import easydropdown from 'easydropdown-a11y'\nimport { on, fire } from 'delegated-events'\nimport throttle from 'lodash/throttle'\nimport { createUrl } from '@common/util'\nimport scrollTo from '@common/scroll-to'\nimport ajax from '@common/ajax'\n\nconst selectors = {\n pageFilters: '[data-page-filters]',\n pageFiltersClear: '[data-page-filters-clear]',\n}\n\nconst resetForm = (form) => {\n form.querySelectorAll('input').forEach((input) => (input.value = null))\n form.querySelectorAll('select').forEach((select) => (select.selectedIndex = -1))\n}\n\nconst handleClear = (e) => {\n e.preventDefault()\n\n const filters = e.target.closest(selectors.pageFilters)\n\n filters.querySelectorAll('form').forEach((form) => resetForm(form))\n\n window.history.replaceState({}, '', e.target.href)\n\n fire(document.documentElement, 'pagefilters:update', { filtersEl: filters, url: window.location.href, type: 'clear' })\n\n filters.classList.remove('is-filtered')\n}\n\nconst handleFormSubmit = (e) => {\n const form = e.target.closest('form')\n const filters = form.closest(selectors.pageFilters)\n\n // Only one of the filters is active at a time, so clear all the other ones\n if (filters.dataset.pageFilters === 'single') {\n Array.from(filters.querySelectorAll('form'))\n .filter((x) => x !== form)\n .forEach((form) => resetForm(form))\n }\n\n // Fully replace the url with the given value\n if (form.dataset.submit && form.dataset.submit === 'replace') {\n e.preventDefault()\n\n const field = form[0]\n\n if (field) {\n window.history.replaceState({}, '', field.value)\n\n fire(document.documentElement, 'pagefilters:update', {\n filtersEl: filters,\n url: window.location.href,\n type: 'replace',\n data: new FormData(form),\n })\n }\n }\n\n // Fully replace the url with the given value, but as a query param\n if (form.dataset.submit && form.dataset.submit === 'get') {\n e.preventDefault()\n\n const data = new FormData(form)\n const url = createUrl(form.action, data)\n\n window.history.replaceState({}, '', url)\n\n fire(document.documentElement, 'pagefilters:update', { filtersEl: filters, url: window.location.href, type: 'get' })\n }\n\n filters.classList.add('is-filtered')\n scrollTo(filters, 48)\n}\n\nconst handleDropdownChange = (e) => {\n const parentForm = e.target.closest('form')\n\n if (parentForm) {\n if (parentForm.requestSubmit) {\n parentForm.requestSubmit()\n } else {\n parentForm.dispatchEvent(new Event('submit'))\n }\n }\n}\n\nconst handleUpdate = async (e) => {\n const filtersEl = e.detail.filtersEl\n\n if (filtersEl.dataset.pageFiltersUpdate === 'replace') {\n const pageContent = document.querySelector('[data-page-content]')\n\n if (pageContent) {\n pageContent.classList.add('is-loading')\n\n const res = await ajax.get(e.detail.url).text()\n\n pageContent.innerHTML = res\n pageContent.classList.remove('is-loading')\n\n fire(document.documentElement, 'pagecontent:replace')\n }\n\n e.stopPropagation()\n }\n}\n\nconst setupDropdown = (el) => {\n if (el.tagName !== 'SELECT') {\n return\n }\n\n const placeholder = el.querySelector('option[value=\"\"]')\n\n if (placeholder && !placeholder.hasAttribute('data-placeholder')) {\n placeholder.setAttribute('data-placeholder', true)\n }\n\n const opts = {\n behavior: {\n openOnFocus: true,\n maxVisibleItems: 10,\n liveUpdates: true,\n useNativeUiOnMobile: false,\n },\n }\n\n easydropdown(el, opts)\n}\n\nconst setupPageFilters = (el) => {\n el.querySelectorAll('select:not([multiple])').forEach((el) => setupDropdown(el))\n}\n\nexport default {\n init: () => {\n const els = document.querySelectorAll(selectors.pageFilters)\n\n const submitArgs = [\n 'submit',\n `${selectors.pageFilters} form:not([data-submit=\"live\"])`,\n handleFormSubmit,\n { capture: true },\n ]\n const changeArgs = ['change', `${selectors.pageFilters} select`, handleDropdownChange]\n const clearArgs = ['click', selectors.pageFiltersClear, handleClear]\n const updateArgs = ['pagefilters:update', 'html', handleUpdate]\n\n on(...submitArgs)\n on(...changeArgs)\n on(...clearArgs)\n on(...updateArgs)\n\n els.forEach((el) => setupPageFilters(el))\n },\n}\n","import Swiper from 'swiper'\nimport { A11y, Navigation } from 'swiper/modules'\nimport { on } from 'delegated-events'\nimport pageFilters from '@components/page-filters'\n\nconst setupSlider = (el) => {\n if (el.classList.contains('did-init')) {\n return\n }\n\n const container = el.querySelector('.swiper')\n const viewAllToggles = el.querySelectorAll('.view-all-toggle')\n const topViewAllToggle = el.querySelector('.top-view-all-toggle')\n const sliderControls = el.querySelector('.slider-controls')\n\n const swiper = new Swiper(container, {\n modules: [A11y, Navigation],\n slidesPerView: 1,\n navigation: {\n nextEl: el.querySelector('.slider-button-next'),\n prevEl: el.querySelector('.slider-button-prev'),\n },\n watchSlidesProgress: true,\n breakpoints: {\n 768: {\n slidesPerView: 3,\n },\n 1280: {\n slidesPerView: 4,\n },\n },\n on: {\n afterInit: (swiper) => {\n if (topViewAllToggle) {\n if (swiper.isLocked) {\n topViewAllToggle.classList.add('invisible')\n } else {\n topViewAllToggle.classList.remove('invisible')\n }\n }\n\n if (sliderControls) {\n sliderControls.classList.remove('invisible')\n }\n },\n resize: (swiper) => {\n if (topViewAllToggle) {\n if (swiper.isLocked) {\n topViewAllToggle.classList.add('invisible')\n } else {\n topViewAllToggle.classList.remove('invisible')\n }\n }\n },\n },\n })\n\n if (viewAllToggles.length) {\n viewAllToggles.forEach((button) => {\n button.addEventListener('click', () => {\n el.classList.toggle('is-view-all')\n\n if (el.classList.contains('is-view-all')) {\n swiper.slideTo(0, 0)\n swiper.disable()\n } else {\n swiper.enable()\n }\n })\n })\n }\n\n el.classList.add('did-init')\n}\n\nexport default {\n init: () => {\n pageFilters.init()\n\n on('pagecontent:replace', 'html', () => {\n document.querySelectorAll('.portal-slider.is-active').forEach((slider) => {\n setupSlider(slider)\n })\n })\n\n on('slidetoggle:open', 'html', (e) => {\n const categorySlider = e.detail.target.parentNode.querySelector('.category-slider')\n const subCategorySlider = e.detail.target.closest('.portal-slider')\n\n if (categorySlider) {\n setupSlider(categorySlider)\n }\n\n if (subCategorySlider) {\n setupSlider(subCategorySlider)\n }\n })\n },\n}\n","// Thirdparty\nimport 'swiper/css'\nimport 'swiper/css/autoplay'\nimport 'swiper/css/effect-fade'\n\n// Theme\nimport '@styles/index.css'\n\nimport calloutBlocks from '@elements/callout-blocks'\nimport calloutCards from '@elements/callout-cards'\nimport largeSliderCallout from '@elements/large-slider-callout'\nimport mediaContent from '@elements/media-content'\n\nimport mobileBar from '@components/mobile-bar'\nimport modal from '@components/modal'\nimport pageOverlay from '@components/page-overlay'\nimport scrollReveal from '@components/scroll-reveal'\nimport scrollTo from '@components/scroll-to'\nimport siteAnnouncementBar from '@components/site-announcement-bar'\nimport siteHeader from '@components/site-header'\nimport siteWidget from '@components/site-widget'\nimport slideToggle from '@components/slide-toggle'\nimport styledForm from '@components/styled-form'\n\nimport boardPortal from '@sections/board-portal'\nimport security from '@sections/security'\n\ncalloutBlocks.init()\ncalloutCards.init()\nlargeSliderCallout.init()\nmediaContent.init()\n\nmobileBar.init()\nmodal.init()\npageOverlay.init()\nscrollReveal.init()\nscrollTo.init()\nsiteAnnouncementBar.init()\nsiteHeader.init()\nsiteWidget.init()\nslideToggle.init()\nstyledForm.init()\n\nboardPortal.init()\nsecurity.init()\n\ndocument.addEventListener('DOMContentLoaded', () => {\n setTimeout(() => {\n document.documentElement.classList.remove('_preload')\n }, 250)\n})\n","import Swiper from 'swiper'\nimport { A11y, Autoplay, EffectFade, Pagination } from 'swiper/modules'\n\nexport default {\n init: () => {\n document.querySelectorAll('.large-slider-callout').forEach((el) => {\n const container = el.querySelector('.swiper')\n\n new Swiper(container, {\n modules: [A11y, Autoplay, EffectFade, Pagination],\n speed: 1000,\n autoplay: {\n delay: 3000,\n },\n pagination: {\n el: el.querySelector('.slider-pagination'),\n clickable: true,\n },\n effect: 'fade',\n fadeEffect: {\n crossFade: true,\n },\n loop: true,\n })\n })\n },\n}\n","import Swiper from 'swiper'\nimport { A11y, Autoplay, EffectFade, Pagination } from 'swiper/modules'\n\nexport default {\n init: () => {\n document.querySelectorAll('.media-content').forEach((el) => {\n const container = el.querySelector('.swiper')\n\n new Swiper(container, {\n modules: [A11y, Autoplay, EffectFade, Pagination],\n speed: 1000,\n autoplay: {\n delay: 3000,\n },\n pagination: {\n el: el.querySelector('.slider-pagination'),\n clickable: true,\n },\n effect: 'fade',\n fadeEffect: {\n crossFade: true,\n },\n loop: true,\n })\n })\n },\n}\n","export default {\n init: () => {\n const mobileBar = document.querySelector('.mobile-bar')\n\n if (mobileBar) {\n const observer = new IntersectionObserver(([e]) => mobileBar.classList.toggle('is-hidden', !e.isIntersecting))\n\n observer.observe(document.querySelector('.scroll-pixel'))\n }\n },\n}\n","import Cookies from 'js-cookie'\nimport modal from '@components/modal'\n\nexport default {\n init: () => {\n const overlayUrl = document.body.dataset.pageOverlayUrl\n const overlayCookie = document.body.dataset.pageOverlayCookie\n\n if (overlayUrl) {\n modal.openModal({\n type: 'content',\n url: overlayUrl,\n })\n\n if (parseInt(overlayCookie) === 1) {\n Cookies.set('seenpageoverlay', true, { expires: 1 })\n }\n }\n },\n}\n","export default {\n init: () => {\n document.querySelectorAll('.styled-form form').forEach((form) => {\n form.setAttribute('novalidate', true)\n })\n },\n}\n","// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\n(function() {\n if (typeof window === 'undefined') {\n return;\n }\n\n try {\n var ce = new window.CustomEvent('test', { cancelable: true });\n ce.preventDefault();\n if (ce.defaultPrevented !== true) {\n // IE has problems with .preventDefault() on custom events\n // http://stackoverflow.com/questions/23349191\n throw new Error('Could not prevent default');\n }\n } catch (e) {\n var CustomEvent = function(event, params) {\n var evt, origPrevent;\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(\n event,\n params.bubbles,\n params.cancelable,\n params.detail\n );\n origPrevent = evt.preventDefault;\n evt.preventDefault = function() {\n origPrevent.call(this);\n try {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n } catch (e) {\n this.defaultPrevented = true;\n }\n };\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n window.CustomEvent = CustomEvent; // expose definition to window\n }\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar arrow = function (_, classNames) { return \"
\"; };\nexports.default = arrow;\n//# sourceMappingURL=arrow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar composeClassName_1 = require(\"../Shared/Util/composeClassName\");\nvar group_1 = require(\"./group\");\nfunction body(state, classNames) {\n var className = composeClassName_1.default([\n classNames.body,\n [state.isAtTop, classNames.bodyAtTop],\n [state.isAtBottom, classNames.bodyAtBottom],\n [state.isScrollable, classNames.bodyScrollable]\n ]);\n var styleAttr = state.isOpen ?\n \"style=\\\"max-height: \" + state.maxBodyHeight + \"px;\\\"\" : '';\n return (\"\\n \\n
\\n \" + state.groups.map(function (groupState) { return group_1.default(groupState, state, classNames); }).join('') + \"\\n
\\n
\\n
\\n
\\n \");\n}\nexports.default = body;\n//# sourceMappingURL=body.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar composeClassName_1 = require(\"../Shared/Util/composeClassName\");\nvar option_1 = require(\"./option\");\nvar group = function (groupState, state, classNames) {\n var className = composeClassName_1.default([\n classNames.group,\n [groupState.isDisabled, classNames.groupDisabled],\n [groupState.hasLabel, classNames.groupHasLabel]\n ]);\n return (\"\\n \\n \" + (groupState.hasLabel ?\n \"
\" + groupState.label + \"
\" : '') + \"\\n \" + groupState.options.map(function (optionState) { return option_1.default(optionState, state, classNames); }).join('') + \"\\n
\\n \");\n};\nexports.default = group;\n//# sourceMappingURL=group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar arrow_1 = require(\"./arrow\");\nvar value_1 = require(\"./value\");\nvar head = function (state, classNames) { return (\"\\n \\n \" + value_1.default(state, classNames) + \"\\n \" + arrow_1.default(state, classNames) + \"\\n \\n
\\n\"); };\nexports.default = head;\n//# sourceMappingURL=head.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar composeClassName_1 = require(\"../Shared/Util/composeClassName\");\nfunction option(optionState, state, classNames) {\n var isSelected = state.selectedOption === optionState;\n var className = composeClassName_1.default([\n classNames.option,\n [isSelected, classNames.optionSelected],\n [optionState === state.focusedOption, classNames.optionFocused],\n [optionState.isDisabled, classNames.optionDisabled]\n ]);\n return (\"\\n \\n \" + optionState.label + \"\\n
\\n \");\n}\nexports.default = option;\n//# sourceMappingURL=option.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar composeClassName_1 = require(\"../Shared/Util/composeClassName\");\nvar body_1 = require(\"./body\");\nvar head_1 = require(\"./head\");\nvar root = function (state, classNames) {\n var className = composeClassName_1.default([\n classNames.root,\n [state.isDisabled, classNames.rootDisabled],\n [state.isInvalid, classNames.rootInvalid],\n [state.isOpen, classNames.rootOpen],\n [state.isFocused, classNames.rootFocused],\n [state.hasValue, classNames.rootHasValue],\n [state.isOpenAbove, classNames.rootOpenAbove],\n [state.isOpenBelow, classNames.rootOpenBelow],\n [state.isUseNativeMode, classNames.rootNative],\n ]);\n return \"\\n \\n \" + head_1.default(state, classNames) + \"\\n \" + (state.isUseNativeMode ? \"\" : body_1.default(state, classNames)) + \"\\n
\\n \";\n};\nexports.default = root;\n//# sourceMappingURL=root.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar value = function (state, classNames) {\n return (\"\\n \\n \" + state.humanReadableValue + \"\\n
\\n \");\n};\nexports.default = value;\n//# sourceMappingURL=value.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Behavior = /** @class */ (function () {\n function Behavior() {\n this.showPlaceholderWhenOpen = false;\n this.openOnFocus = false;\n this.closeOnSelect = true;\n this.useNativeUiOnMobile = true;\n this.loop = false;\n this.clampMaxVisibleItems = true;\n this.liveUpdates = false;\n this.maxVisibleItems = 15;\n Object.seal(this);\n }\n return Behavior;\n}());\nexports.default = Behavior;\n//# sourceMappingURL=Behavior.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Callbacks = /** @class */ (function () {\n function Callbacks() {\n this.onOpen = null;\n this.onClose = null;\n this.onSelect = null;\n this.onOptionClick = null;\n Object.seal(this);\n }\n return Callbacks;\n}());\nexports.default = Callbacks;\n//# sourceMappingURL=Callbacks.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ClassNames = /** @class */ (function () {\n function ClassNames() {\n this.root = 'edd-root';\n this.rootOpen = 'edd-root-open';\n this.rootOpenAbove = 'edd-root-open-above';\n this.rootOpenBelow = 'edd-root-open-below';\n this.rootDisabled = 'edd-root-disabled';\n this.rootInvalid = 'edd-root-invalid';\n this.rootFocused = 'edd-root-focused';\n this.rootHasValue = 'edd-root-has-value';\n this.rootNative = 'edd-root-native';\n this.gradientTop = 'edd-gradient-top';\n this.gradientBottom = 'edd-gradient-bottom';\n this.head = 'edd-head';\n this.value = 'edd-value';\n this.arrow = 'edd-arrow';\n this.select = 'edd-select';\n this.body = 'edd-body';\n this.bodyScrollable = 'edd-body-scrollable';\n this.bodyAtTop = 'edd-body-at-top';\n this.bodyAtBottom = 'edd-body-at-bottom';\n this.itemsList = 'edd-items-list';\n this.group = 'edd-group';\n this.groupDisabled = 'edd-group-disabled';\n this.groupHasLabel = 'edd-group-has-label';\n this.groupLabel = 'edd-group-label';\n this.option = 'edd-option';\n this.optionDisabled = 'edd-option-disabled';\n this.optionFocused = 'edd-option-focused';\n this.optionSelected = 'edd-option-selected';\n Object.seal(this);\n }\n return ClassNames;\n}());\nexports.default = ClassNames;\n//# sourceMappingURL=ClassNames.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Behavior_1 = require(\"./Behavior\");\nvar Callbacks_1 = require(\"./Callbacks\");\nvar ClassNames_1 = require(\"./ClassNames\");\nvar Config = /** @class */ (function () {\n function Config() {\n this.callbacks = new Callbacks_1.default();\n this.classNames = new ClassNames_1.default();\n this.behavior = new Behavior_1.default();\n Object.seal(this);\n }\n return Config;\n}());\nexports.default = Config;\n//# sourceMappingURL=Config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helpful_merge_1 = require(\"helpful-merge\");\nvar Config_1 = require(\"../Config/Config\");\nvar bindEvents_1 = require(\"../Events/bindEvents\");\nvar Renderer_1 = require(\"../Renderer/Renderer\");\nvar dispatchOpen_1 = require(\"../Shared/Util/dispatchOpen\");\nvar pollForSelectChange_1 = require(\"../Shared/Util/pollForSelectChange\");\nvar pollForSelectMutation_1 = require(\"../Shared/Util/pollForSelectMutation\");\nvar closeOthers_1 = require(\"../State/InjectedActions/closeOthers\");\nvar scrollToView_1 = require(\"../State/InjectedActions/scrollToView\");\nvar StateManager_1 = require(\"../State/StateManager\");\nvar StateMapper_1 = require(\"../State/StateMapper\");\nvar cache_1 = require(\"./cache\");\nvar Timers_1 = require(\"./Timers\");\nvar Easydropdown = /** @class */ (function () {\n function Easydropdown(selectElement, options) {\n this.config = helpful_merge_1.default(new Config_1.default(), options, true);\n this.state = StateMapper_1.default.mapFromSelect(selectElement, this.config);\n this.renderer = new Renderer_1.default(this.config.classNames);\n this.dom = this.renderer.render(this.state, selectElement);\n this.timers = new Timers_1.default();\n this.actions = StateManager_1.default.proxyActions(this.state, {\n closeOthers: closeOthers_1.default.bind(null, this, cache_1.default),\n scrollToView: scrollToView_1.default.bind(null, this.dom, this.timers)\n }, this.handleStateUpdate.bind(this));\n this.eventBindings = bindEvents_1.default({\n actions: this.actions,\n config: this.config,\n dom: this.dom,\n state: this.state,\n timers: this.timers\n });\n this.timers.pollChangeIntervalId = pollForSelectChange_1.default(this.dom.select, this.state, this.actions, this.config);\n if (this.config.behavior.liveUpdates) {\n this.timers.pollMutationIntervalId = pollForSelectMutation_1.default(this.dom.select, this.state, this.refresh.bind(this));\n }\n }\n Object.defineProperty(Easydropdown.prototype, \"selectElement\", {\n get: function () {\n return this.dom.select;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Easydropdown.prototype, \"value\", {\n get: function () {\n return this.state.value;\n },\n set: function (nextValue) {\n if (typeof nextValue !== 'string') {\n throw new TypeError('[EasyDropDown] Provided value not a valid string');\n }\n this.dom.select.value = nextValue;\n },\n enumerable: true,\n configurable: true\n });\n Easydropdown.prototype.open = function () {\n dispatchOpen_1.default(this.actions, this.config, this.dom);\n };\n Easydropdown.prototype.close = function () {\n this.actions.close();\n };\n Easydropdown.prototype.refresh = function () {\n this.state = helpful_merge_1.default(this.state, StateMapper_1.default.mapFromSelect(this.dom.select, this.config));\n this.renderer.update(this.state);\n this.dom.group.length = this.dom.option.length = this.dom.item.length = 0;\n Renderer_1.default.queryDomRefs(this.dom, ['group', 'option', 'item']);\n };\n Easydropdown.prototype.validate = function () {\n if (!this.state.isRequired || this.state.hasValue) {\n return true;\n }\n this.actions.invalidate();\n return false;\n };\n Easydropdown.prototype.destroy = function () {\n this.timers.clear();\n this.eventBindings.forEach(function (binding) { return binding.unbind(); });\n this.renderer.destroy();\n var cacheIndex = cache_1.default.indexOf(this);\n cache_1.default.splice(cacheIndex, 1);\n };\n Easydropdown.prototype.handleStateUpdate = function (state, key) {\n var callbacks = this.config.callbacks;\n this.renderer.update(state, key);\n switch (key) {\n case 'bodyStatus': {\n var cb = void 0;\n if (state.isOpen) {\n cb = callbacks.onOpen;\n }\n else {\n cb = callbacks.onClose;\n }\n if (typeof cb === 'function')\n cb();\n break;\n }\n case 'selectedIndex': {\n var cb = callbacks.onSelect;\n if (typeof cb === 'function')\n cb(state.value);\n break;\n }\n case 'isClickSelecting': {\n var cb = callbacks.onOptionClick;\n if (state[key] === false) {\n var nextValue = state.getOptionFromIndex(state.focusedIndex).value;\n if (typeof cb === 'function')\n cb(nextValue);\n }\n }\n }\n };\n return Easydropdown;\n}());\nexports.default = Easydropdown;\n//# sourceMappingURL=Easydropdown.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EasydropdownFacade = /** @class */ (function () {\n function EasydropdownFacade(implementation) {\n this.open = implementation.open.bind(implementation);\n this.close = implementation.close.bind(implementation);\n this.refresh = implementation.refresh.bind(implementation);\n this.destroy = implementation.destroy.bind(implementation);\n this.validate = implementation.validate.bind(implementation);\n Object.defineProperties(this, {\n value: {\n get: function () { return implementation.value; },\n set: function (nextValue) { return implementation.value = nextValue; }\n }\n });\n }\n return EasydropdownFacade;\n}());\nexports.default = EasydropdownFacade;\n//# sourceMappingURL=EasydropdownFacade.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Timers = /** @class */ (function () {\n function Timers() {\n }\n Timers.prototype.clear = function () {\n var _this = this;\n Object.keys(this).forEach(function (key) { return window.clearInterval(_this[key]); });\n };\n return Timers;\n}());\nexports.default = Timers;\n//# sourceMappingURL=Timers.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cache = [];\nexports.default = cache;\n//# sourceMappingURL=cache.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cache_1 = require(\"./cache\");\nvar Easydropdown_1 = require(\"./Easydropdown\");\nvar EasydropdownFacade_1 = require(\"./EasydropdownFacade\");\nfunction factory(selectElementOrSelector, options) {\n if (options === void 0) { options = {}; }\n var selectElement = selectElementOrSelector;\n if (typeof selectElementOrSelector === 'string') {\n selectElement = document.querySelector(selectElementOrSelector);\n }\n if (!(selectElement instanceof HTMLSelectElement)) {\n throw new TypeError('[EasyDropDown] Invalid select element provided');\n }\n if (selectElement.multiple) {\n throw new Error('[EasyDropDown] EasyDropDown does not support the `multiple`' +\n ' attribute on select elements.');\n }\n for (var _i = 0, cache_2 = cache_1.default; _i < cache_2.length; _i++) {\n var cachedInstance = cache_2[_i];\n if (cachedInstance.selectElement === selectElement) {\n return new EasydropdownFacade_1.default(cachedInstance);\n }\n }\n var instance = new Easydropdown_1.default(selectElement, options);\n // @ts-ignore\n cache_1.default.push(instance);\n return new EasydropdownFacade_1.default(instance);\n}\nfunction decorateFactory(factoryFn) {\n factoryFn.all = function (options) {\n if (options === void 0) { options = {}; }\n var selects = document.querySelectorAll('select');\n Array.prototype.forEach.call(selects, function (select) {\n var instance = factory(select, options);\n return instance;\n });\n };\n factoryFn.destroy = function () {\n var cacheCopy = cache_1.default.slice();\n cacheCopy.forEach(function (instance) { return instance.destroy(); });\n };\n return factoryFn;\n}\nvar decoratedFactory = decorateFactory(factory);\nexports.default = decoratedFactory;\n//# sourceMappingURL=factory.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UP = 38;\nexports.DOWN = 40;\nexports.SPACE = 32;\nexports.ENTER = 13;\nexports.ESC = 27;\n//# sourceMappingURL=KeyCodes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OPTION = '[data-ref~=\"option\"]';\n//# sourceMappingURL=Selectors.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helpful_merge_1 = require(\"helpful-merge\");\nvar EventBinding = /** @class */ (function () {\n function EventBinding(eventBindingRaw) {\n this.type = '';\n this.target = null;\n this.debounce = 0;\n this.throttle = 0;\n this.handler = null;\n this.boundHandler = null;\n this.passive = false;\n helpful_merge_1.default(this, eventBindingRaw);\n Object.seal(this);\n }\n EventBinding.prototype.unbind = function () {\n if (!this.target)\n return;\n this.target.removeEventListener(this.type, this.boundHandler);\n };\n return EventBinding;\n}());\nexports.default = EventBinding;\n//# sourceMappingURL=EventBinding.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar closestParent_1 = require(\"../../Shared/Util/closestParent\");\nvar Selectors = require(\"../Constants/Selectors\");\nfunction handleBodyClick(e, _a) {\n var state = _a.state, actions = _a.actions, dom = _a.dom, config = _a.config;\n e.stopPropagation();\n var option = closestParent_1.default(e.target, Selectors.OPTION, true);\n if (!option)\n return;\n var optionIndex = Array.prototype.indexOf.call(dom.option, option);\n actions.selectOption(optionIndex, config.behavior.closeOnSelect);\n}\nexports.default = handleBodyClick;\n//# sourceMappingURL=handleBodyClick.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar closestParent_1 = require(\"../../Shared/Util/closestParent\");\nvar Selectors = require(\"../Constants/Selectors\");\nfunction handleBodyMousedown(e, _a) {\n var actions = _a.actions;\n e.stopPropagation();\n var option = closestParent_1.default(e.target, Selectors.OPTION, true);\n if (!option)\n return;\n actions.startClickSelecting();\n}\nexports.default = handleBodyMousedown;\n//# sourceMappingURL=handleBodyMousedown.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar closestParent_1 = require(\"../../Shared/Util/closestParent\");\nvar Selectors = require(\"../Constants/Selectors\");\nfunction handleBodyMouseover(e, _a) {\n var state = _a.state, actions = _a.actions, dom = _a.dom;\n e.stopPropagation();\n var option = closestParent_1.default(e.target, Selectors.OPTION, true);\n if (!option || state.isKeying)\n return;\n var optionIndex = Array.prototype.indexOf.call(dom.option, option);\n actions.focusOption(optionIndex);\n}\nexports.default = handleBodyMouseover;\n//# sourceMappingURL=handleBodyMouseover.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dispatchOpen_1 = require(\"../../Shared/Util/dispatchOpen\");\nvar getIsMobilePlatform_1 = require(\"../../Shared/Util/getIsMobilePlatform\");\nfunction handleHeadClick(injectedGetIsMobilePlatform, e, _a) {\n var state = _a.state, actions = _a.actions, dom = _a.dom, config = _a.config;\n if (state.isUseNativeMode)\n return;\n var isMobilePlatform = injectedGetIsMobilePlatform(window.navigator.userAgent);\n e.stopPropagation();\n if (state.isClosed) {\n dispatchOpen_1.default(actions, config, dom);\n if (isMobilePlatform) {\n actions.focus();\n }\n else {\n dom.select.focus();\n }\n }\n else {\n actions.close();\n }\n}\nexports.handleHeadClick = handleHeadClick;\nvar boundHandleHeadClick = handleHeadClick.bind(null, getIsMobilePlatform_1.default);\nexports.default = boundHandleHeadClick;\n//# sourceMappingURL=handleHeadClick.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction handleItemsListScroll(e, _a) {\n var state = _a.state, actions = _a.actions, dom = _a.dom;\n e.stopPropagation();\n var _b = dom.itemsList, offsetHeight = _b.offsetHeight, scrollHeight = _b.scrollHeight, scrollTop = _b.scrollTop;\n if (scrollTop === 0) {\n actions.topOut();\n }\n else if (scrollTop === scrollHeight - offsetHeight) {\n actions.bottomOut();\n }\n else {\n actions.scroll();\n }\n}\nexports.default = handleItemsListScroll;\n//# sourceMappingURL=handleItemsListScroll.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction handleSelectBlur(e, _a) {\n var actions = _a.actions, state = _a.state, config = _a.config;\n if (state.isKeying)\n return;\n actions.blur();\n if (config.behavior.openOnFocus && !state.isClickSelecting)\n actions.close();\n}\nexports.default = handleSelectBlur;\n//# sourceMappingURL=handleSelectBlur.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dispatchOpen_1 = require(\"../../Shared/Util/dispatchOpen\");\nfunction handleSelectFocus(e, _a) {\n var actions = _a.actions, config = _a.config, dom = _a.dom, state = _a.state;\n actions.focus();\n if (config.behavior.openOnFocus && !state.isUseNativeMode) {\n dispatchOpen_1.default(actions, config, dom);\n }\n}\nexports.default = handleSelectFocus;\n//# sourceMappingURL=handleSelectFocus.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction handleSelectInvalid(e, _a) {\n var actions = _a.actions, config = _a.config, dom = _a.dom;\n actions.invalidate();\n}\nexports.default = handleSelectInvalid;\n//# sourceMappingURL=handleSelectInvalid.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dispatchOpen_1 = require(\"../../Shared/Util/dispatchOpen\");\nvar killSelectReaction_1 = require(\"../../Shared/Util/killSelectReaction\");\nvar KeyCodes = require(\"../Constants/KeyCodes\");\nvar handleSelectKeydownDown_1 = require(\"./handleSelectKeydownDown\");\nvar handleSelectKeydownUp_1 = require(\"./handleSelectKeydownUp\");\nfunction handleSelectKeydown(e, handlerParams) {\n var keyCode = e.keyCode, target = e.target;\n var state = handlerParams.state, actions = handlerParams.actions, dom = handlerParams.dom, config = handlerParams.config;\n if (state.isUseNativeMode || state.isDisabled)\n return;\n switch (keyCode) {\n case KeyCodes.DOWN:\n handleSelectKeydownDown_1.default(e, handlerParams);\n break;\n case KeyCodes.UP:\n handleSelectKeydownUp_1.default(e, handlerParams);\n break;\n case KeyCodes.SPACE:\n if (state.isSearching) {\n e.stopPropagation();\n return;\n }\n case KeyCodes.ENTER:\n e.stopPropagation();\n e.preventDefault();\n killSelectReaction_1.default(target, handlerParams);\n if (state.isOpen) {\n actions.selectOption(state.focusedIndex, config.behavior.closeOnSelect);\n }\n else {\n dispatchOpen_1.default(actions, config, dom);\n }\n break;\n case KeyCodes.ESC:\n actions.close();\n break;\n }\n}\nexports.default = handleSelectKeydown;\n//# sourceMappingURL=handleSelectKeydown.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dispatchOpen_1 = require(\"../../Shared/Util/dispatchOpen\");\nvar killSelectReaction_1 = require(\"../../Shared/Util/killSelectReaction\");\nfunction handleSelectKeydownDown(e, handlerParams) {\n var metaKey = e.metaKey, target = e.target;\n var state = handlerParams.state, dom = handlerParams.dom, actions = handlerParams.actions, config = handlerParams.config;\n var focusedIndex = state.focusedIndex > -1 ?\n state.focusedIndex : state.selectedIndex;\n var iterations = 0;\n var incrementAmount = 1;\n e.preventDefault();\n killSelectReaction_1.default(target, handlerParams);\n if (metaKey) {\n incrementAmount = Math.round(Math.max(state.totalOptions / 2, config.behavior.maxVisibleItems));\n }\n do {\n focusedIndex += incrementAmount;\n incrementAmount = 1;\n if (focusedIndex >= state.totalOptions) {\n focusedIndex = config.behavior.loop ? 0 : state.totalOptions - 1;\n }\n actions.focusOption(focusedIndex, true);\n iterations++;\n } while (state.focusedOption &&\n state.focusedOption.isDisabled &&\n iterations <= state.totalOptions);\n if (state.isClosed) {\n dispatchOpen_1.default(actions, config, dom);\n return;\n }\n}\nexports.default = handleSelectKeydownDown;\n//# sourceMappingURL=handleSelectKeydownDown.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dispatchOpen_1 = require(\"../../Shared/Util/dispatchOpen\");\nvar killSelectReaction_1 = require(\"../../Shared/Util/killSelectReaction\");\nfunction handleSelectKeydownUp(e, handlerParams) {\n var metaKey = e.metaKey, target = e.target;\n var state = handlerParams.state, config = handlerParams.config, dom = handlerParams.dom, actions = handlerParams.actions;\n var focusedIndex = state.focusedIndex > -1 ?\n state.focusedIndex : state.selectedIndex;\n var iterations = 0;\n var incrementAmount = 1;\n e.preventDefault();\n killSelectReaction_1.default(target, handlerParams);\n if (metaKey) {\n incrementAmount = Math.round(Math.max(state.totalOptions / 2, config.behavior.maxVisibleItems));\n }\n do {\n focusedIndex -= incrementAmount;\n incrementAmount = 1;\n if (focusedIndex < 0) {\n focusedIndex = config.behavior.loop ? state.totalOptions - 1 : 0;\n }\n actions.focusOption(focusedIndex, true);\n iterations++;\n } while (state.focusedOption &&\n state.focusedOption.isDisabled &&\n iterations < state.totalOptions);\n if (state.isClosed) {\n dispatchOpen_1.default(actions, config, dom);\n }\n}\nexports.default = handleSelectKeydownUp;\n//# sourceMappingURL=handleSelectKeydownUp.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar KeyCodes = require(\"../Constants/KeyCodes\");\nvar SEARCH_RESET_DURATION = 1200;\nfunction handleSelectKeypress(_a, _b, searchResetDuration) {\n var keyCode = _a.keyCode;\n var actions = _b.actions, timers = _b.timers, state = _b.state;\n if (searchResetDuration === void 0) { searchResetDuration = SEARCH_RESET_DURATION; }\n if (state.isUseNativeMode || [KeyCodes.UP, KeyCodes.DOWN].includes(keyCode))\n return;\n window.clearTimeout(timers.searchTimeoutId);\n actions.search();\n timers.searchTimeoutId = window.setTimeout(function () { return actions.resetSearch(); }, searchResetDuration);\n}\nexports.default = handleSelectKeypress;\n//# sourceMappingURL=handleSelectKeypress.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction handleWindowClick(_, _a) {\n var state = _a.state, actions = _a.actions, dom = _a.dom;\n if (!state.isOpen)\n return;\n actions.close();\n dom.select.blur();\n}\nexports.default = handleWindowClick;\n//# sourceMappingURL=handleWindowClick.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar throttle_1 = require(\"../Shared/Util/throttle\");\nvar EventBinding_1 = require(\"./EventBinding\");\nvar getEventsList_1 = require(\"./getEventsList\");\nfunction bindEvent(handlerParams, eventBindingRaw) {\n var eventBinding = new EventBinding_1.default(eventBindingRaw);\n if (!eventBinding.target)\n return eventBinding;\n var boundHandler = function (e) { return eventBinding.handler(e, handlerParams); };\n if (eventBinding.throttle > 0) {\n eventBinding.boundHandler = throttle_1.default(boundHandler, eventBinding.throttle);\n }\n else {\n eventBinding.boundHandler = boundHandler;\n }\n eventBinding.target.addEventListener(eventBinding.type, eventBinding.boundHandler);\n return eventBinding;\n}\nexports.bindEvent = bindEvent;\nfunction bindEvents(handlerParams) {\n return getEventsList_1.default(handlerParams.dom).map(bindEvent.bind(null, handlerParams));\n}\nexports.default = bindEvents;\n//# sourceMappingURL=bindEvents.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar handleBodyClick_1 = require(\"./Handlers/handleBodyClick\");\nvar handleBodyMousedown_1 = require(\"./Handlers/handleBodyMousedown\");\nvar handleBodyMouseover_1 = require(\"./Handlers/handleBodyMouseover\");\nvar handleHeadClick_1 = require(\"./Handlers/handleHeadClick\");\nvar handleItemsListScroll_1 = require(\"./Handlers/handleItemsListScroll\");\nvar handleSelectBlur_1 = require(\"./Handlers/handleSelectBlur\");\nvar handleSelectFocus_1 = require(\"./Handlers/handleSelectFocus\");\nvar handleSelectInvalid_1 = require(\"./Handlers/handleSelectInvalid\");\nvar handleSelectKeydown_1 = require(\"./Handlers/handleSelectKeydown\");\nvar handleSelectKeypress_1 = require(\"./Handlers/handleSelectKeypress\");\nvar handleWindowClick_1 = require(\"./Handlers/handleWindowClick\");\nvar handleWindowClick_2 = require(\"./Handlers/handleWindowClick\");\nvar getEventsList = function (dom) { return [\n {\n target: dom.head,\n type: 'click',\n handler: handleHeadClick_1.default\n },\n {\n target: dom.body,\n type: 'mousedown',\n handler: handleBodyMousedown_1.default\n },\n {\n target: dom.body,\n type: 'click',\n handler: handleBodyClick_1.default\n },\n {\n target: dom.body,\n type: 'mouseover',\n handler: handleBodyMouseover_1.default\n },\n {\n target: dom.itemsList,\n type: 'scroll',\n handler: handleItemsListScroll_1.default\n },\n {\n target: dom.select,\n type: 'keydown',\n handler: handleSelectKeydown_1.default\n },\n {\n target: dom.select,\n type: 'invalid',\n handler: handleSelectInvalid_1.default\n },\n {\n target: dom.select,\n type: 'keypress',\n handler: handleSelectKeypress_1.default\n },\n {\n target: dom.select,\n type: 'focus',\n handler: handleSelectFocus_1.default\n },\n {\n target: dom.select,\n type: 'blur',\n handler: handleSelectBlur_1.default\n },\n {\n target: document.documentElement,\n type: 'click',\n handler: handleWindowClick_1.default\n },\n {\n target: window,\n type: 'resize',\n handler: handleWindowClick_2.default,\n throttle: 100\n }\n]; };\nexports.default = getEventsList;\n//# sourceMappingURL=getEventsList.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AttributeChangeType;\n(function (AttributeChangeType) {\n AttributeChangeType[\"ADD\"] = \"ADD\";\n AttributeChangeType[\"EDIT\"] = \"EDIT\";\n AttributeChangeType[\"REMOVE\"] = \"REMOVE\";\n})(AttributeChangeType || (AttributeChangeType = {}));\nexports.default = AttributeChangeType;\n//# sourceMappingURL=AttributeChangeType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DomChangeType;\n(function (DomChangeType) {\n DomChangeType[\"NONE\"] = \"NONE\";\n DomChangeType[\"FULL\"] = \"FULL\";\n DomChangeType[\"REPLACE\"] = \"REPLACE\";\n DomChangeType[\"INNER\"] = \"INNER\";\n DomChangeType[\"OUTER\"] = \"OUTER\";\n})(DomChangeType = exports.DomChangeType || (exports.DomChangeType = {}));\nexports.default = DomChangeType;\n//# sourceMappingURL=DomChangeType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom = /** @class */ (function () {\n function Dom() {\n this.select = null;\n this.root = null;\n this.head = null;\n this.value = null;\n this.body = null;\n this.arrow = null;\n this.itemsList = null;\n this.item = [];\n this.group = [];\n this.option = [];\n }\n Dom.prototype.sumItemsHeight = function (max) {\n if (max === void 0) { max = Infinity; }\n var totalHeight = 0;\n for (var i = 0, item = void 0; (item = this.item[i]); i++) {\n if (i === max)\n break;\n totalHeight += item.offsetHeight;\n }\n return totalHeight;\n };\n return Dom;\n}());\nexports.default = Dom;\n//# sourceMappingURL=Dom.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PatchCommand = /** @class */ (function () {\n function PatchCommand() {\n this.newNode = null;\n this.newInnerHtml = '';\n this.newTextContent = '';\n this.attributeChanges = [];\n this.childCommands = [];\n this.index = null;\n }\n return PatchCommand;\n}());\nexports.default = PatchCommand;\n//# sourceMappingURL=PatchCommand.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar root_1 = require(\"../Components/root\");\nvar createDomElementFromHtml_1 = require(\"../Shared/Util/createDomElementFromHtml\");\nvar Dom_1 = require(\"./Dom\");\nvar domDiff_1 = require(\"./domDiff\");\nvar domPatch_1 = require(\"./domPatch\");\nvar Renderer = /** @class */ (function () {\n function Renderer(classNames) {\n this.dom = new Dom_1.default();\n this.classNames = classNames;\n }\n Renderer.prototype.render = function (state, selectElement) {\n var html = root_1.default(state, this.classNames);\n var rootElement = createDomElementFromHtml_1.default(html);\n this.dom = new Dom_1.default();\n this.dom.root = rootElement;\n this.dom.option.length = this.dom.group.length = 0;\n Renderer.queryDomRefs(this.dom);\n this.injectSelect(selectElement);\n return this.dom;\n };\n Renderer.prototype.update = function (state, key) {\n var nextHtml = root_1.default(state, this.classNames);\n var nextRoot = createDomElementFromHtml_1.default(nextHtml);\n var diffCommand = domDiff_1.default(this.dom.root, nextRoot);\n domPatch_1.default(this.dom.root, diffCommand);\n if (key === \"selectedIndex\") {\n this.syncSelectWithValue(state.value);\n }\n };\n Renderer.prototype.destroy = function () {\n this.dom.select.classList.remove(this.classNames.select);\n try {\n this.dom.root.parentElement.replaceChild(this.dom.select, this.dom.root);\n }\n catch (err) {\n /**/\n }\n };\n Renderer.prototype.injectSelect = function (selectElement) {\n var parent = selectElement.parentElement;\n var tempSelect = this.dom.select;\n if (!parent)\n throw new Error(\"[EasyDropDown] The provided `` element must exist within a document\");\n parent.replaceChild(this.dom.root, selectElement);\n tempSelect.parentElement.replaceChild(selectElement, tempSelect);\n selectElement.className = this.classNames.select;\n this.dom.select = selectElement;\n };\n Renderer.prototype.syncSelectWithValue = function (value) {\n if (this.dom.select.value === value)\n return;\n var event = new CustomEvent(\"change\", {\n bubbles: true,\n });\n this.dom.select.value = value;\n this.dom.select.dispatchEvent(event);\n };\n Renderer.queryDomRefs = function (dom, keys) {\n if (keys === void 0) { keys = Object.keys(dom); }\n return keys.reduce(function (localDom, ref) {\n var selector = \"[data-ref~=\\\"\" + ref + \"\\\"]\";\n var elements = localDom.root.querySelectorAll(selector);\n if (elements.length < 1 || ref === \"root\")\n return localDom;\n var element = elements[0];\n var value = localDom[ref];\n if (value === null) {\n localDom[ref] = element;\n }\n else if (Array.isArray(value)) {\n Array.prototype.push.apply(value, elements);\n }\n return localDom;\n }, dom);\n };\n return Renderer;\n}());\nexports.default = Renderer;\n//# sourceMappingURL=Renderer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helpful_merge_1 = require(\"helpful-merge\");\nvar AttributeChangeType_1 = require(\"./Constants/AttributeChangeType\");\nvar DomChangeType_1 = require(\"./Constants/DomChangeType\");\nvar PatchCommand_1 = require(\"./PatchCommand\");\nfunction domDiff(prev, next) {\n var totalChildNodes = -1;\n var command = new PatchCommand_1.default();\n if (prev instanceof HTMLSelectElement) {\n command.type = DomChangeType_1.default.NONE;\n return command;\n }\n if (prev instanceof Text && next instanceof Text) {\n if (prev.textContent === next.textContent) {\n command.type = DomChangeType_1.default.NONE;\n }\n else {\n command.type = DomChangeType_1.default.INNER;\n command.newTextContent = next.textContent;\n }\n }\n else if (prev instanceof HTMLElement && next instanceof HTMLElement) {\n if (prev.tagName !== next.tagName) {\n command.type = DomChangeType_1.default.REPLACE;\n command.newNode = next;\n }\n else if (prev.outerHTML === next.outerHTML) {\n command.type = DomChangeType_1.default.NONE;\n }\n else if (prev.innerHTML === next.innerHTML) {\n helpful_merge_1.default(command, diffAttributeChanges(prev, next));\n }\n else {\n helpful_merge_1.default(command, diffAttributeChanges(prev, next));\n if (command.attributeChanges.length > 0) {\n command.type = DomChangeType_1.default.FULL;\n }\n else {\n command.type = DomChangeType_1.default.INNER;\n }\n if ((totalChildNodes = prev.childNodes.length) > 0 && totalChildNodes === next.childNodes.length) {\n for (var i = 0, childNode = void 0; (childNode = prev.childNodes[i]); i++) {\n command.childCommands.push(domDiff(childNode, next.childNodes[i]));\n }\n }\n else {\n command.newInnerHtml = next.innerHTML;\n }\n }\n }\n else {\n command.type = DomChangeType_1.default.REPLACE;\n command.newNode = next;\n }\n return command;\n}\nfunction diffAttributeChanges(prev, next) {\n var totalAttributes = Math.max(prev.attributes.length, next.attributes.length);\n var attributesMap = {};\n var undef = void (0);\n var attributeChanges = [];\n for (var i = 0; i < totalAttributes; i++) {\n var attr1 = prev.attributes[i];\n var attr2 = next.attributes[i];\n if (attr1 && attributesMap[attr1.name] === undef) {\n attributesMap[attr1.name] = [];\n }\n if (attr2 && attributesMap[attr2.name] === undef) {\n attributesMap[attr2.name] = [];\n }\n if (attr1)\n attributesMap[attr1.name][0] = attr1.value;\n if (attr2)\n attributesMap[attr2.name][1] = attr2.value;\n }\n var keys = Object.keys(attributesMap);\n if (keys.length > 1) {\n keys.sort();\n }\n for (var i = 0, key = void 0; (key = keys[i]); i++) {\n var attr = attributesMap[key];\n var change = {\n type: null,\n name: key,\n value: null\n };\n if (attr[0] === attr[1])\n continue;\n if (attr[0] === undef) {\n change.type = AttributeChangeType_1.default.ADD;\n change.value = attr[1];\n }\n else if (attr[1] === undef) {\n change.type = AttributeChangeType_1.default.REMOVE,\n change.value = '';\n }\n else {\n change.type = AttributeChangeType_1.default.EDIT,\n change.value = attr[1];\n }\n attributeChanges.push(change);\n }\n return {\n type: DomChangeType_1.default.OUTER,\n attributeChanges: attributeChanges\n };\n}\nexports.default = domDiff;\n//# sourceMappingURL=domDiff.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AttributeChangeType_1 = require(\"./Constants/AttributeChangeType\");\nvar DomChangeType_1 = require(\"./Constants/DomChangeType\");\nfunction domPatch(node, command) {\n switch (command.type) {\n case DomChangeType_1.default.NONE:\n return node;\n case DomChangeType_1.default.REPLACE:\n node.parentElement.replaceChild(command.newNode, node);\n return command.newNode;\n case DomChangeType_1.default.INNER:\n if (node instanceof Text) {\n node.textContent = command.newTextContent;\n }\n else if (command.childCommands.length > 0) {\n command.childCommands.forEach(function (childCommand, i) { return domPatch(node.childNodes[i], childCommand); });\n }\n else {\n node.innerHTML = command.newInnerHtml;\n }\n return node;\n case DomChangeType_1.default.OUTER:\n patchAttributes(node, command.attributeChanges);\n return node;\n case DomChangeType_1.default.FULL:\n if (command.childCommands.length > 0) {\n command.childCommands.forEach(function (childCommand, i) { return domPatch(node.childNodes[i], childCommand); });\n }\n else {\n node.innerHTML = command.newInnerHtml;\n }\n patchAttributes(node, command.attributeChanges);\n return node;\n }\n}\nfunction patchAttributes(el, attributeChanges) {\n var raf = window.requestAnimationFrame;\n attributeChanges.forEach(function (change) {\n if (raf && ['class', 'style'].indexOf(change.name) > -1) {\n raf(function () { return patchAttribute(el, change); });\n }\n else {\n patchAttribute(el, change);\n }\n });\n}\nfunction patchAttribute(el, change) {\n switch (change.type) {\n case AttributeChangeType_1.default.ADD:\n case AttributeChangeType_1.default.EDIT:\n el.setAttribute(change.name, change.value);\n break;\n case AttributeChangeType_1.default.REMOVE:\n el.removeAttribute(change.name);\n break;\n }\n}\nexports.default = domPatch;\n//# sourceMappingURL=domPatch.js.map","if (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector;\n}\n//# sourceMappingURL=Element.matches.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CollisionType;\n(function (CollisionType) {\n CollisionType[\"NONE\"] = \"NONE\";\n CollisionType[\"TOP\"] = \"TOP\";\n CollisionType[\"BOTTOM\"] = \"BOTTOM\";\n})(CollisionType || (CollisionType = {}));\nexports.default = CollisionType;\n//# sourceMappingURL=CollisionType.js.map","\"use strict\";\n/**\n * Returns the closest parent of a given element matching the\n * provided selector, optionally including the element itself.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction closestParent(el, selector, includeSelf) {\n if (includeSelf === void 0) { includeSelf = false; }\n var parent = el.parentNode;\n if (includeSelf && el.matches(selector)) {\n return el;\n }\n while (parent && parent !== document.body) {\n if (parent.matches && parent.matches(selector)) {\n return parent;\n }\n else if (parent.parentNode) {\n parent = parent.parentNode;\n }\n else {\n return null;\n }\n }\n return null;\n}\nexports.default = closestParent;\n//# sourceMappingURL=closestParent.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction composeClassName(tokens) {\n return tokens\n .reduce(function (classNames, token) {\n if (typeof token === 'string')\n classNames.push(token);\n else {\n var predicate = token[0], className = token[1];\n if (predicate)\n classNames.push(className);\n }\n return classNames;\n }, [])\n .join(' ');\n}\nexports.default = composeClassName;\n//# sourceMappingURL=composeClassName.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction createDomElementFromHtml(html) {\n var temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstElementChild;\n}\nexports.default = createDomElementFromHtml;\n//# sourceMappingURL=createDomElementFromHtml.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CollisionType_1 = require(\"./Constants/CollisionType\");\nvar CLEARSPACE = 10;\nfunction mapCollisionData(deltaTop, deltaBottom, maxHeight, itemHeight) {\n var type = CollisionType_1.default.NONE;\n var maxVisibleItemsOverride = -1;\n if (deltaTop <= maxHeight && deltaBottom <= maxHeight) {\n var largestDelta = Math.max(deltaBottom, deltaTop);\n type = deltaTop < deltaBottom ? CollisionType_1.default.TOP : CollisionType_1.default.BOTTOM;\n maxVisibleItemsOverride = Math.floor(largestDelta / itemHeight);\n }\n else if (deltaTop <= maxHeight) {\n type = CollisionType_1.default.TOP;\n }\n else if (deltaBottom <= maxHeight) {\n type = CollisionType_1.default.BOTTOM;\n }\n return { type: type, maxVisibleItemsOverride: maxVisibleItemsOverride };\n}\nexports.mapCollisionData = mapCollisionData;\nfunction detectBodyCollision(dom, config) {\n var bbHead = dom.head.getBoundingClientRect();\n var wh = window.innerHeight;\n var deltaTop = bbHead.top - CLEARSPACE;\n var deltaBottom = wh - bbHead.bottom - CLEARSPACE;\n if (dom.option.length < 1)\n return {\n type: CollisionType_1.default.NONE,\n maxVisibleItemsOverride: -1\n };\n var maxVisibleItems = Math.min(config.behavior.maxVisibleItems, dom.item.length);\n var maxHeight = dom.sumItemsHeight(maxVisibleItems);\n var itemHeight = dom.sumItemsHeight(1);\n return mapCollisionData(deltaTop, deltaBottom, maxHeight, itemHeight);\n}\nexports.default = detectBodyCollision;\n//# sourceMappingURL=detectBodyCollision.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar detectBodyCollision_1 = require(\"./detectBodyCollision\");\nfunction dispatchOpen(injectedDetectBodyCollision, actions, config, dom) {\n var collisionData = injectedDetectBodyCollision(dom, config);\n var maxVisibleItems = collisionData.maxVisibleItemsOverride > -1 ?\n collisionData.maxVisibleItemsOverride : config.behavior.maxVisibleItems;\n var isScrollable = dom.item.length > maxVisibleItems;\n var maxBodyHeight = dom.sumItemsHeight(maxVisibleItems);\n actions.open(maxBodyHeight, collisionData.type, isScrollable);\n}\nexports.dispatchOpen = dispatchOpen;\nvar boundDispatchOpen = dispatchOpen.bind(null, detectBodyCollision_1.default);\nexports.default = boundDispatchOpen;\n//# sourceMappingURL=dispatchOpen.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getIsMobilePlatform(userAgent) {\n var isIos = /(ipad|iphone|ipod)/gi.test(userAgent);\n var isAndroid = /android/gi.test(userAgent);\n var isOperaMini = /opera mini/gi.test(userAgent);\n var isWindowsPhone = /windows phone/gi.test(userAgent);\n if (isIos || isAndroid || isOperaMini || isWindowsPhone) {\n return true;\n }\n return false;\n}\nexports.default = getIsMobilePlatform;\n//# sourceMappingURL=getIsMobilePlatform.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar killSelectReaction = function (select, _a) {\n var actions = _a.actions, timers = _a.timers;\n var keyingResetDuration = 100;\n window.clearTimeout(timers.keyingTimeoutId);\n actions.keying();\n timers.keyingTimeoutId = window.setTimeout(function () { return actions.resetKeying(); }, keyingResetDuration);\n select.disabled = true;\n setTimeout(function () {\n select.disabled = false;\n select.focus();\n });\n};\nexports.default = killSelectReaction;\n//# sourceMappingURL=killSelectReaction.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar POLL_INTERVAL_DURATION = 100;\nfunction pollForSelectChange(selectElement, state, actions, config) {\n var lastValue = selectElement.value;\n var pollIntervalId = window.setInterval(function () {\n if (selectElement.value !== lastValue) {\n var selectedIndex = state.getOptionIndexFromValue(selectElement.value);\n actions.selectOption(selectedIndex, config.behavior.closeOnSelect);\n actions.focusOption(selectedIndex, true);\n }\n lastValue = selectElement.value;\n }, POLL_INTERVAL_DURATION);\n return pollIntervalId;\n}\nexports.default = pollForSelectChange;\n//# sourceMappingURL=pollForSelectChange.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar POLL_INTERVAL_DURATION = 300;\nfunction pollForSelectMutation(selectElement, state, handleMutation) {\n var lastOuterHtml = selectElement.outerHTML;\n var pollIntervalId = window.setInterval(function () {\n var outerHTML = selectElement.outerHTML;\n if (outerHTML !== lastOuterHtml && !state.isKeying) {\n handleMutation();\n }\n lastOuterHtml = outerHTML;\n }, POLL_INTERVAL_DURATION);\n return pollIntervalId;\n}\nexports.default = pollForSelectMutation;\n//# sourceMappingURL=pollForSelectMutation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction throttle(handler, delay) {\n var timerId = null;\n var last = -Infinity;\n return function () {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var now = Date.now();\n var later = function () {\n timerId = null;\n handler.apply(_this, args);\n last = now;\n };\n var difference = now - last;\n if (difference >= delay) {\n later();\n }\n else {\n clearTimeout(timerId);\n timerId = setTimeout(later, delay - difference);\n }\n };\n}\nexports.default = throttle;\n//# sourceMappingURL=throttle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BodyStatus;\n(function (BodyStatus) {\n BodyStatus[\"CLOSED\"] = \"CLOSED\";\n BodyStatus[\"OPEN_ABOVE\"] = \"OPEN_ABOVE\";\n BodyStatus[\"OPEN_BELOW\"] = \"OPEN_BELOW\";\n})(BodyStatus || (BodyStatus = {}));\nexports.default = BodyStatus;\n//# sourceMappingURL=BodyStatus.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ScrollStatus;\n(function (ScrollStatus) {\n ScrollStatus[\"AT_TOP\"] = \"AT_TOP\";\n ScrollStatus[\"SCROLLED\"] = \"SCROLLED\";\n ScrollStatus[\"AT_BOTTOM\"] = \"AT_BOTTOM\";\n})(ScrollStatus || (ScrollStatus = {}));\nexports.default = ScrollStatus;\n//# sourceMappingURL=ScrollStatus.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Group = /** @class */ (function () {\n function Group() {\n this.label = '';\n this.options = [];\n this.isDisabled = false;\n }\n Object.defineProperty(Group.prototype, \"totalOptions\", {\n get: function () {\n return this.options.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Group.prototype, \"hasLabel\", {\n get: function () {\n return this.label !== '';\n },\n enumerable: true,\n configurable: true\n });\n return Group;\n}());\nexports.default = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction closeOthers(thisInstance, cache) {\n for (var _i = 0, cache_1 = cache; _i < cache_1.length; _i++) {\n var instance = cache_1[_i];\n if (instance !== thisInstance)\n instance.actions.close();\n }\n}\nexports.default = closeOthers;\n//# sourceMappingURL=closeOthers.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getScrollTop(currentScrollTop, optionOffsetTop, optionHeight, bodyHeight, scrollOffset) {\n var max = currentScrollTop + bodyHeight;\n var remainder;\n if (optionOffsetTop < currentScrollTop) {\n return optionOffsetTop - scrollOffset;\n }\n else if ((remainder = (optionOffsetTop + optionHeight) - max) > 0) {\n return currentScrollTop + remainder + scrollOffset;\n }\n return currentScrollTop;\n}\nexports.getScrollTop = getScrollTop;\nfunction scrollToView(dom, timers, state, scrollToMiddle) {\n if (scrollToMiddle === void 0) { scrollToMiddle = false; }\n var index = Math.max(0, state.focusedIndex > -1 ? state.focusedIndex : state.selectedIndex);\n var option = dom.option[index];\n if (!option)\n return;\n var offset = scrollToMiddle ? (state.maxBodyHeight / 2) - (option.offsetHeight / 2) : 0;\n var scrollTop = getScrollTop(dom.itemsList.scrollTop, option.offsetTop, option.offsetHeight, state.maxBodyHeight, offset);\n if (scrollTop === dom.itemsList.scrollTop)\n return;\n dom.itemsList.scrollTop = scrollTop;\n}\nexports.default = scrollToView;\n//# sourceMappingURL=scrollToView.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Option = /** @class */ (function () {\n function Option() {\n this.label = '';\n this.value = '';\n this.isDisabled = false;\n }\n return Option;\n}());\nexports.default = Option;\n//# sourceMappingURL=Option.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helpful_merge_1 = require(\"helpful-merge\");\nvar Config_1 = require(\"../Config/Config\");\nvar BodyStatus_1 = require(\"./Constants/BodyStatus\");\nvar ScrollStatus_1 = require(\"./Constants/ScrollStatus\");\nvar Group_1 = require(\"./Group\");\nvar Option_1 = require(\"./Option\");\nvar State = /** @class */ (function () {\n function State(stateRaw, config) {\n if (stateRaw === void 0) { stateRaw = null; }\n if (config === void 0) { config = new Config_1.default(); }\n this.groups = [];\n this.focusedIndex = -1;\n this.selectedIndex = -1;\n this.maxVisibleItemsOverride = -1;\n this.maxBodyHeight = -1;\n this.name = '';\n this.placeholder = '';\n this.scrollStatus = ScrollStatus_1.default.AT_TOP;\n this.bodyStatus = BodyStatus_1.default.CLOSED;\n this.isDisabled = false;\n this.isRequired = false;\n this.isInvalid = false;\n this.isFocused = false;\n this.isUseNativeMode = false;\n this.isScrollable = false;\n this.isClickSelecting = false;\n this.isSearching = false;\n this.isKeying = false;\n this.config = config;\n if (!stateRaw)\n return;\n helpful_merge_1.default(this, stateRaw);\n this.groups = this.groups.map(function (groupRaw) {\n var group = helpful_merge_1.default(new Group_1.default(), groupRaw);\n group.options = group.options.map(function (optionRaw) { return helpful_merge_1.default(new Option_1.default(), optionRaw); });\n return group;\n });\n }\n Object.defineProperty(State.prototype, \"totalGroups\", {\n get: function () {\n return this.groups.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"lastGroup\", {\n get: function () {\n return this.groups[this.groups.length - 1];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"totalOptions\", {\n get: function () {\n return this.groups.reduce(function (total, group) { return total + group.totalOptions; }, 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"selectedOption\", {\n get: function () {\n return this.getOptionFromIndex(this.selectedIndex);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"focusedOption\", {\n get: function () {\n return this.getOptionFromIndex(this.focusedIndex);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"value\", {\n get: function () {\n return this.selectedOption ? this.selectedOption.value : '';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"humanReadableValue\", {\n get: function () {\n if ((!this.hasValue && this.hasPlaceholder) ||\n (this.config.behavior.showPlaceholderWhenOpen &&\n this.hasPlaceholder &&\n this.isOpen)) {\n return this.placeholder;\n }\n return this.label;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"label\", {\n get: function () {\n return this.selectedOption ? this.selectedOption.label : '';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"hasPlaceholder\", {\n get: function () {\n return this.placeholder !== '';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isPlaceholderShown\", {\n get: function () {\n return this.hasPlaceholder && !this.hasValue;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"hasValue\", {\n get: function () {\n return this.value !== '';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isGrouped\", {\n get: function () {\n return Boolean(this.groups.find(function (group) { return group.hasLabel; }));\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isOpen\", {\n get: function () {\n return this.bodyStatus !== BodyStatus_1.default.CLOSED;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isClosed\", {\n get: function () {\n return this.bodyStatus === BodyStatus_1.default.CLOSED;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isOpenAbove\", {\n get: function () {\n return this.bodyStatus === BodyStatus_1.default.OPEN_ABOVE;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isOpenBelow\", {\n get: function () {\n return this.bodyStatus === BodyStatus_1.default.OPEN_BELOW;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isAtTop\", {\n get: function () {\n return this.scrollStatus === ScrollStatus_1.default.AT_TOP;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"isAtBottom\", {\n get: function () {\n return this.scrollStatus === ScrollStatus_1.default.AT_BOTTOM;\n },\n enumerable: true,\n configurable: true\n });\n State.prototype.getOptionFromIndex = function (index) {\n var groupStartIndex = 0;\n for (var _i = 0, _a = this.groups; _i < _a.length; _i++) {\n var group = _a[_i];\n if (index < 0)\n break;\n var groupEndIndex = Math.max(0, groupStartIndex + group.totalOptions - 1);\n if (index <= groupEndIndex) {\n var option = group.options[index - groupStartIndex];\n return option;\n }\n groupStartIndex += group.totalOptions;\n }\n return null;\n };\n State.prototype.getOptionIndexFromValue = function (value) {\n var index = -1;\n for (var _i = 0, _a = this.groups; _i < _a.length; _i++) {\n var group = _a[_i];\n for (var _b = 0, _c = group.options; _b < _c.length; _b++) {\n var option = _c[_b];\n index++;\n if (option.value === value) {\n return index;\n }\n }\n }\n return -1;\n };\n return State;\n}());\nexports.default = State;\n//# sourceMappingURL=State.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helpful_merge_1 = require(\"helpful-merge\");\nvar resolveActions_1 = require(\"./resolveActions\");\nvar StateManager = /** @class */ (function () {\n function StateManager() {\n }\n StateManager.proxyActions = function (state, injectedActions, onAction) {\n var stateProxy = StateManager.createStateProxy(state, onAction);\n var actions = resolveActions_1.default(stateProxy);\n helpful_merge_1.default(actions, injectedActions);\n return actions;\n };\n StateManager.createStateProxy = function (state, onAction) {\n return Object.seal(StateManager\n .getPropertyDescriptorsFromValue(state, onAction)\n .reduce(function (proxy, _a) {\n var key = _a.key, get = _a.get, set = _a.set;\n return Object.defineProperty(proxy, key, {\n enumerable: true,\n get: get,\n set: set\n });\n }, {}));\n };\n StateManager.getPropertyDescriptorsFromValue = function (state, onAction) {\n var prototype = Object.getPrototypeOf(state);\n var allKeys = Object.keys(state).concat(Object.keys(prototype));\n return allKeys\n .reduce(function (localDescriptors, key) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(state, key) ||\n Object.getOwnPropertyDescriptor(prototype, key);\n var isAccessorProperty = typeof propertyDescriptor.get === 'function';\n localDescriptors.push({\n get: StateManager.readPropertyValue.bind(null, state, key),\n set: isAccessorProperty ?\n void 0 : StateManager.updatePropertyValue.bind(null, state, key, onAction),\n key: key\n });\n return localDescriptors;\n }, []);\n };\n StateManager.readPropertyValue = function (state, key) {\n return state[key];\n };\n StateManager.updatePropertyValue = function (state, key, onAction, value) {\n if (state[key] === value)\n return;\n state[key] = value;\n onAction(state, key);\n };\n return StateManager;\n}());\nexports.default = StateManager;\n//# sourceMappingURL=StateManager.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar helpful_merge_1 = require(\"helpful-merge\");\nvar getIsMobilePlatform_1 = require(\"../Shared/Util/getIsMobilePlatform\");\nvar Group_1 = require(\"./Group\");\nvar Option_1 = require(\"./Option\");\nvar State_1 = require(\"./State\");\nvar StateMapper = /** @class */ (function () {\n function StateMapper() {\n }\n StateMapper.mapFromSelect = function (selectElement, config) {\n var state = new State_1.default(null, config);\n var isWithinGroup = false;\n state.name = selectElement.name;\n state.isDisabled = selectElement.disabled;\n state.isRequired = selectElement.required;\n state.isUseNativeMode = (config.behavior.useNativeUiOnMobile &&\n getIsMobilePlatform_1.default(window.navigator.userAgent));\n for (var i = 0, child = void 0; (child = selectElement.children[i]); i++) {\n if (i === 0 && child.getAttribute('data-placeholder') !== null) {\n state.placeholder = child.textContent;\n child.value = '';\n continue;\n }\n if (child instanceof HTMLOptionElement) {\n if (isWithinGroup === false) {\n state.groups.push(StateMapper.mapGroup());\n isWithinGroup = true;\n }\n state.lastGroup.options.push(StateMapper.mapOption(child));\n if (child.selected)\n state.selectedIndex = state.totalOptions - 1;\n }\n else if (child instanceof HTMLOptGroupElement) {\n isWithinGroup = true;\n state.groups.push(StateMapper.mapGroup(child));\n for (var j = 0, groupChild = void 0; (groupChild = child.children[j]); j++) {\n state.lastGroup.options.push(StateMapper.mapOption(groupChild, child));\n if (groupChild.selected)\n state.selectedIndex = state.totalOptions - 1;\n }\n isWithinGroup = false;\n }\n else {\n throw new TypeError(\"[EasyDropDown] Invalid child tag \\\"\" + child.tagName + \"\\\" found in provided `` element\");\n }\n }\n return Object.seal(state);\n };\n StateMapper.mapGroup = function (group) {\n if (group === void 0) { group = null; }\n return helpful_merge_1.default(new Group_1.default(), {\n label: group ? group.label : '',\n isDisabled: group ? group.disabled : false\n });\n };\n StateMapper.mapOption = function (option, group) {\n if (group === void 0) { group = null; }\n if (!(option instanceof HTMLOptionElement))\n throw new TypeError('[EasyDropDown] Invalid markup structure');\n var isParentGroupDisabled = group !== null && group.disabled;\n return helpful_merge_1.default(new Option_1.default(), {\n label: option.textContent,\n value: option.value,\n isDisabled: option.disabled || isParentGroupDisabled\n });\n };\n return StateMapper;\n}());\nexports.default = StateMapper;\n//# sourceMappingURL=StateMapper.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CollisionType_1 = require(\"../Shared/Util/Constants/CollisionType\");\nvar BodyStatus_1 = require(\"./Constants/BodyStatus\");\nvar ScrollStatus_1 = require(\"./Constants/ScrollStatus\");\nvar resolveActions = function (state) { return ({\n focus: function () {\n state.isFocused = true;\n },\n blur: function () {\n state.isFocused = false;\n },\n invalidate: function () {\n state.isInvalid = true;\n },\n validate: function () {\n state.isInvalid = false;\n },\n topOut: function () {\n state.scrollStatus = ScrollStatus_1.default.AT_TOP;\n },\n bottomOut: function () {\n state.scrollStatus = ScrollStatus_1.default.AT_BOTTOM;\n },\n scroll: function () {\n state.scrollStatus = ScrollStatus_1.default.SCROLLED;\n },\n makeScrollable: function () {\n state.isScrollable = true;\n },\n makeUnscrollable: function () {\n state.isScrollable = false;\n },\n open: function (maxBodyHeight, collisionType, isScrollable) {\n if (state.isDisabled)\n return;\n this.closeOthers();\n switch (collisionType) {\n case CollisionType_1.default.NONE:\n case CollisionType_1.default.TOP:\n state.bodyStatus = BodyStatus_1.default.OPEN_BELOW;\n break;\n case CollisionType_1.default.BOTTOM:\n state.bodyStatus = BodyStatus_1.default.OPEN_ABOVE;\n break;\n }\n state.isScrollable = isScrollable;\n state.maxBodyHeight = maxBodyHeight;\n this.scrollToView(state, true);\n },\n close: function () {\n state.bodyStatus = BodyStatus_1.default.CLOSED;\n state.focusedIndex = -1;\n this.blur();\n },\n startClickSelecting: function () {\n state.isClickSelecting = true;\n },\n selectOption: function (index, close) {\n if (close === void 0) { close = true; }\n var optionAtIndex = state.getOptionFromIndex(index);\n state.isClickSelecting = false;\n if (index > -1 && (!optionAtIndex || optionAtIndex.isDisabled))\n return;\n state.selectedIndex = index;\n if (state.isInvalid && state.hasValue) {\n this.validate();\n }\n if (state.isSearching) {\n this.scrollToView(state);\n }\n else if (close) {\n this.close();\n }\n },\n focusOption: function (index, shouldScrollToView) {\n if (shouldScrollToView === void 0) { shouldScrollToView = false; }\n var scrollToMiddle = Math.abs(index - state.focusedIndex) > 1;\n state.focusedIndex = index;\n if (shouldScrollToView) {\n this.scrollToView(state, scrollToMiddle);\n }\n },\n search: function () {\n state.isSearching = true;\n },\n resetSearch: function () {\n state.isSearching = false;\n },\n keying: function () {\n state.isKeying = true;\n },\n resetKeying: function () {\n state.isKeying = false;\n },\n useNative: function () {\n state.isUseNativeMode = true;\n }\n}); };\nexports.default = resolveActions;\n//# sourceMappingURL=resolveActions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nrequire(\"custom-event-polyfill\");\nrequire(\"./Shared/Polyfills/Element.matches\");\nvar factory_1 = require(\"./Easydropdown/factory\");\nexports.default = factory_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArrayStrategy_1 = require(\"./Constants/ArrayStrategy\");\nvar Messages = require(\"./Messages\");\nvar Config = /** @class */ (function () {\n function Config() {\n this.deep = false;\n this.useReferenceIfTargetUnset = false;\n this.useReferenceIfArray = false;\n this.preserveTypeIfTargetUnset = false;\n this.includeReadOnly = false;\n this.includeNonEmurable = false;\n this.arrayStrategy = ArrayStrategy_1.default.REPLACE;\n this.errorMessage = Messages.MERGE_ERROR;\n Object.seal(this);\n }\n return Config;\n}());\nexports.default = Config;\n//# sourceMappingURL=Config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArrayStrategy;\n(function (ArrayStrategy) {\n ArrayStrategy[\"PUSH\"] = \"PUSH\";\n ArrayStrategy[\"REPLACE\"] = \"REPLACE\";\n})(ArrayStrategy || (ArrayStrategy = {}));\nexports.default = ArrayStrategy;\n//# sourceMappingURL=ArrayStrategy.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar merge_1 = require(\"./merge\");\nvar FluentMerge = /** @class */ (function () {\n function FluentMerge() {\n this.target = null;\n this.sources = [];\n this.config = {};\n }\n /**\n * Supplies a fluent merge instance with a target object to merge into and return.\n */\n FluentMerge.prototype.to = function (target) {\n this.target = target;\n return this;\n };\n /**\n * Supplies a fluent merge instance with one or more source objects to merge from, in right to left order.\n */\n FluentMerge.prototype.from = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n this.sources = sources;\n return this;\n };\n /**\n * Supplies a fluent merge instance with a configuration object of one or more options.\n */\n FluentMerge.prototype.with = function (options) {\n this.config = options;\n return this;\n };\n /**\n * Executes a fluent merge instance, merging all provided sources into the\n * target, as per any provided configuration, and returning a reference to\n * the target.\n */\n FluentMerge.prototype.exec = function () {\n var _this = this;\n return this.sources.reduce(function (target, source) { return merge_1.default(target, source, _this.config); }, this.target || {});\n };\n return FluentMerge;\n}());\nexports.default = FluentMerge;\n//# sourceMappingURL=FluentMerge.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MERGE_ERROR = function (offender, suggestion) {\n if (suggestion === void 0) { suggestion = ''; }\n return \"Unknown property \\\"\" + offender + \"\\\"\" + (suggestion ? \". Did you mean \\\"\" + suggestion + \"\\\"?\" : '');\n};\nexports.TYPE_ERROR_TARGET = function (target) {\n return \"[Helpful Merge] Target \\\"\" + target + \"\\\" must be a valid object\";\n};\nexports.TYPE_ERROR_SOURCE = function (source) {\n return \"[Helpful Merge] Source \\\"\" + source + \"\\\" must be a valid object\";\n};\nexports.INVALID_ARRAY_STRATEGY = function (strategy) {\n return \"[Helpful Merge] Invalid array strategy \\\"\" + strategy + \"\\\"\";\n};\n//# sourceMappingURL=Messages.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction deriveCustoTypeInstance(_a) {\n var constructor = _a.constructor;\n if (typeof constructor === 'function' && constructor !== Object) {\n return new constructor();\n }\n return {};\n}\nexports.default = deriveCustoTypeInstance;\n//# sourceMappingURL=deriveCustomTypeInstance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction handleMergeError(err, target, offendingKey, message) {\n // Rethrow if any of the following:\n // - offending key already exists on target\n // - object not sealed\n // - is extensible\n // - error not a TypeError\n if (Object.hasOwnProperty.call(target, offendingKey) ||\n !Object.isSealed(target) ||\n Object.isExtensible(target) ||\n !(err instanceof TypeError))\n throw err;\n var reducer = reduceBestMatch.bind(null, offendingKey, offendingKey.toLowerCase());\n var primer = { key: '', delta: Infinity, totalMatching: 0 };\n // Iterate through keys in target, for each key, compare with\n // the offending key. Greatest number of matching characters wins.\n var bestMatch = Object.keys(target).reduce(reducer, primer);\n var suggestion = bestMatch && bestMatch.totalMatching > 1 ? bestMatch.key : '';\n throw new TypeError(message(offendingKey, suggestion));\n}\n/**\n * Compares current key with current best match.\n */\nfunction reduceBestMatch(offendingKeyLower, offendingKey, currBestMatch, currKey) {\n var totalMatching = getTotalMatching(currKey.toLowerCase(), offendingKeyLower);\n var delta = Math.abs(currKey.length - offendingKey.length);\n if (totalMatching > currBestMatch.totalMatching ||\n (totalMatching === currBestMatch.totalMatching && delta < currBestMatch.delta)) {\n // If a greater number of matching characters, or the same\n // number, but a lesser delta, usurp the best match\n return { key: currKey, delta: delta, totalMatching: totalMatching };\n }\n return currBestMatch;\n}\n/**\n * Returns the number of common, consecutive characters\n * between two strings.\n */\nfunction getTotalMatching(possibleKey, offendingKey) {\n var longer = possibleKey.length > offendingKey.length ? possibleKey : offendingKey;\n var shorter = longer === possibleKey ? offendingKey : possibleKey;\n var leftPointer = 0;\n var leftInnerPointer = 0;\n var leftTotalMatching = 0;\n var lastCommonIndex = -1;\n for (; leftPointer < longer.length; leftPointer++) {\n while (leftTotalMatching === 0 &&\n longer[leftPointer] !== shorter[leftInnerPointer] &&\n leftInnerPointer < shorter.length) {\n // No match at present, move innerPointer through all possible\n // indices until a match is found\n leftInnerPointer++;\n }\n if (longer[leftPointer] === shorter[leftInnerPointer]) {\n // Match found\n if (lastCommonIndex !== leftPointer - 1) {\n // If beginning of a new match, reset total common\n leftTotalMatching = 0;\n }\n lastCommonIndex = leftPointer;\n leftTotalMatching++;\n leftInnerPointer++;\n // Whole word matched, end\n if (leftTotalMatching === shorter.length)\n break;\n }\n else if (leftTotalMatching > 1) {\n // No match, but at least two common characters found, end\n break;\n }\n else {\n // No match at this index, reset\n leftTotalMatching = leftInnerPointer = 0;\n }\n }\n lastCommonIndex = -1;\n var rightPointer = 0;\n var rightInnerPointer = 0;\n var rightTotalMatching = 0;\n var longerLastIndex = longer.length - 1;\n var shorterLastIndex = shorter.length - 1;\n // As above, but from right to left\n for (; rightPointer < longer.length - leftPointer; rightPointer++) {\n while (rightTotalMatching === 0 &&\n longer[longerLastIndex - rightPointer] !== shorter[shorterLastIndex - rightInnerPointer] &&\n rightInnerPointer < shorter.length) {\n rightInnerPointer++;\n }\n if (longer[longerLastIndex - rightPointer] === shorter[shorterLastIndex - rightInnerPointer]) {\n if (lastCommonIndex !== rightPointer - 1)\n rightTotalMatching = 0;\n lastCommonIndex = rightPointer;\n rightTotalMatching++;\n rightInnerPointer++;\n }\n else if (rightTotalMatching > 1) {\n break;\n }\n else {\n rightTotalMatching = rightInnerPointer = 0;\n }\n }\n return Math.min(shorter.length, leftTotalMatching + rightTotalMatching);\n}\nexports.getTotalMatching = getTotalMatching;\nexports.default = handleMergeError;\n//# sourceMappingURL=handleMergeError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar merge_1 = require(\"./merge\");\nvar ArrayStrategy_1 = require(\"./Constants/ArrayStrategy\");\nexports.ArrayStrategy = ArrayStrategy_1.default;\nexports.default = merge_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Config_1 = require(\"./Config\");\nvar ArrayStrategy_1 = require(\"./Constants/ArrayStrategy\");\nvar deriveCustomTypeInstance_1 = require(\"./deriveCustomTypeInstance\");\nvar FluentMerge_1 = require(\"./FluentMerge\");\nvar handleMergeError_1 = require(\"./handleMergeError\");\nvar Messages = require(\"./Messages\");\nfunction merge(target, source, options) {\n if (options === void 0) { options = null; }\n var isClientSide = typeof window !== 'undefined';\n var sourceKeys = [];\n var config;\n if (options instanceof Config_1.default) {\n config = options;\n }\n else {\n config = new Config_1.default();\n }\n if (typeof options === 'boolean' && options === true) {\n config.deep = true;\n }\n else if (options && config !== options && typeof options === 'object') {\n merge(config, options);\n if ([ArrayStrategy_1.default.PUSH, ArrayStrategy_1.default.REPLACE].indexOf(config.arrayStrategy) < 0) {\n throw RangeError(Messages.INVALID_ARRAY_STRATEGY(config.arrayStrategy));\n }\n }\n if (!target || typeof target !== 'object') {\n throw new TypeError(Messages.TYPE_ERROR_TARGET(target));\n }\n if (!source || typeof source !== 'object') {\n throw new TypeError(Messages.TYPE_ERROR_SOURCE(source));\n }\n if (Array.isArray(source)) {\n if (config.arrayStrategy === ArrayStrategy_1.default.PUSH) {\n // Merge arrays via push()\n target.push.apply(target, source);\n return target;\n }\n for (var i = 0; i < source.length; i++) {\n sourceKeys.push(i.toString());\n }\n }\n else {\n sourceKeys = Object.getOwnPropertyNames(source);\n }\n for (var _i = 0, sourceKeys_1 = sourceKeys; _i < sourceKeys_1.length; _i++) {\n var key = sourceKeys_1[_i];\n var descriptor = Object.getOwnPropertyDescriptor(source, key);\n // Skip read-only properties\n if (typeof descriptor.get === 'function' && !descriptor.set && !config.includeReadOnly)\n continue;\n // Skip non-enumerable properties\n if (!descriptor.enumerable && !config.includeNonEmurable)\n continue;\n if (!config.deep ||\n typeof source[key] !== 'object' ||\n (isClientSide && source[key] instanceof window.Node) ||\n (isClientSide && source[key] === window.document.body) ||\n (isClientSide && source[key] === window.document.documentElement) ||\n source[key] === null ||\n (Array.isArray(source[key]) && config.useReferenceIfArray) ||\n (!target[key] && config.useReferenceIfTargetUnset)) {\n // If:\n // - Shallow merge\n // - All non-object primatives\n // - , , or DOM Nodes\n // - Null pointers\n // - Arrays, if `useReferenceIfArray` set\n // - Target prop null or undefined and `useRererenceIfTargetUnset` set\n try {\n target[key] = source[key];\n }\n catch (err) {\n handleMergeError_1.default(err, target, key, config.errorMessage);\n }\n }\n else {\n // Deep merge objects/arrays\n if (!Object.prototype.hasOwnProperty.call(target, key) || target[key] === null) {\n // If property does not exist on target, instantiate an empty\n // object, custom type or array to merge into\n try {\n target[key] = Array.isArray(source[key]) ?\n [] : config.preserveTypeIfTargetUnset ?\n deriveCustomTypeInstance_1.default(source[key]) : {};\n }\n catch (err) {\n handleMergeError_1.default(err, target, key, config.errorMessage);\n }\n }\n // Recursively deep copy objects or arrays\n merge(target[key], source[key], config);\n }\n }\n return target;\n}\nvar createFluent = function (method) { return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = new FluentMerge_1.default())[method].apply(_a, args);\n var _a;\n}; };\nObject\n .keys(FluentMerge_1.default.prototype)\n .forEach(function (method) { return merge[method] = createFluent(method); });\nexports.default = merge;\n//# sourceMappingURL=merge.js.map","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","/*!\n * validate.js 0.13.1\n *\n * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp\n * Validate.js may be freely distributed under the MIT license.\n * For all details and documentation:\n * http://validatejs.org/\n */\n\n(function(exports, module, define) {\n \"use strict\";\n\n // The main function that calls the validators specified by the constraints.\n // The options are the following:\n // - format (string) - An option that controls how the returned value is formatted\n // * flat - Returns a flat array of just the error messages\n // * grouped - Returns the messages grouped by attribute (default)\n // * detailed - Returns an array of the raw validation data\n // - fullMessages (boolean) - If `true` (default) the attribute name is prepended to the error.\n //\n // Please note that the options are also passed to each validator.\n var validate = function(attributes, constraints, options) {\n options = v.extend({}, v.options, options);\n\n var results = v.runValidations(attributes, constraints, options)\n , attr\n , validator;\n\n if (results.some(function(r) { return v.isPromise(r.error); })) {\n throw new Error(\"Use validate.async if you want support for promises\");\n }\n return validate.processValidationResults(results, options);\n };\n\n var v = validate;\n\n // Copies over attributes from one or more sources to a single destination.\n // Very much similar to underscore's extend.\n // The first argument is the target object and the remaining arguments will be\n // used as sources.\n v.extend = function(obj) {\n [].slice.call(arguments, 1).forEach(function(source) {\n for (var attr in source) {\n obj[attr] = source[attr];\n }\n });\n return obj;\n };\n\n v.extend(validate, {\n // This is the version of the library as a semver.\n // The toString function will allow it to be coerced into a string\n version: {\n major: 0,\n minor: 13,\n patch: 1,\n metadata: null,\n toString: function() {\n var version = v.format(\"%{major}.%{minor}.%{patch}\", v.version);\n if (!v.isEmpty(v.version.metadata)) {\n version += \"+\" + v.version.metadata;\n }\n return version;\n }\n },\n\n // Below is the dependencies that are used in validate.js\n\n // The constructor of the Promise implementation.\n // If you are using Q.js, RSVP or any other A+ compatible implementation\n // override this attribute to be the constructor of that promise.\n // Since jQuery promises aren't A+ compatible they won't work.\n Promise: typeof Promise !== \"undefined\" ? Promise : /* istanbul ignore next */ null,\n\n EMPTY_STRING_REGEXP: /^\\s*$/,\n\n // Runs the validators specified by the constraints object.\n // Will return an array of the format:\n // [{attribute: \"\", error: \"\"}, ...]\n runValidations: function(attributes, constraints, options) {\n var results = []\n , attr\n , validatorName\n , value\n , validators\n , validator\n , validatorOptions\n , error;\n\n if (v.isDomElement(attributes) || v.isJqueryElement(attributes)) {\n attributes = v.collectFormValues(attributes);\n }\n\n // Loops through each constraints, finds the correct validator and run it.\n for (attr in constraints) {\n value = v.getDeepObjectValue(attributes, attr);\n // This allows the constraints for an attribute to be a function.\n // The function will be called with the value, attribute name, the complete dict of\n // attributes as well as the options and constraints passed in.\n // This is useful when you want to have different\n // validations depending on the attribute value.\n validators = v.result(constraints[attr], value, attributes, attr, options, constraints);\n\n for (validatorName in validators) {\n validator = v.validators[validatorName];\n\n if (!validator) {\n error = v.format(\"Unknown validator %{name}\", {name: validatorName});\n throw new Error(error);\n }\n\n validatorOptions = validators[validatorName];\n // This allows the options to be a function. The function will be\n // called with the value, attribute name, the complete dict of\n // attributes as well as the options and constraints passed in.\n // This is useful when you want to have different\n // validations depending on the attribute value.\n validatorOptions = v.result(validatorOptions, value, attributes, attr, options, constraints);\n if (!validatorOptions) {\n continue;\n }\n results.push({\n attribute: attr,\n value: value,\n validator: validatorName,\n globalOptions: options,\n attributes: attributes,\n options: validatorOptions,\n error: validator.call(validator,\n value,\n validatorOptions,\n attr,\n attributes,\n options)\n });\n }\n }\n\n return results;\n },\n\n // Takes the output from runValidations and converts it to the correct\n // output format.\n processValidationResults: function(errors, options) {\n errors = v.pruneEmptyErrors(errors, options);\n errors = v.expandMultipleErrors(errors, options);\n errors = v.convertErrorMessages(errors, options);\n\n var format = options.format || \"grouped\";\n\n if (typeof v.formatters[format] === 'function') {\n errors = v.formatters[format](errors);\n } else {\n throw new Error(v.format(\"Unknown format %{format}\", options));\n }\n\n return v.isEmpty(errors) ? undefined : errors;\n },\n\n // Runs the validations with support for promises.\n // This function will return a promise that is settled when all the\n // validation promises have been completed.\n // It can be called even if no validations returned a promise.\n async: function(attributes, constraints, options) {\n options = v.extend({}, v.async.options, options);\n\n var WrapErrors = options.wrapErrors || function(errors) {\n return errors;\n };\n\n // Removes unknown attributes\n if (options.cleanAttributes !== false) {\n attributes = v.cleanAttributes(attributes, constraints);\n }\n\n var results = v.runValidations(attributes, constraints, options);\n\n return new v.Promise(function(resolve, reject) {\n v.waitForResults(results).then(function() {\n var errors = v.processValidationResults(results, options);\n if (errors) {\n reject(new WrapErrors(errors, options, attributes, constraints));\n } else {\n resolve(attributes);\n }\n }, function(err) {\n reject(err);\n });\n });\n },\n\n single: function(value, constraints, options) {\n options = v.extend({}, v.single.options, options, {\n format: \"flat\",\n fullMessages: false\n });\n return v({single: value}, {single: constraints}, options);\n },\n\n // Returns a promise that is resolved when all promises in the results array\n // are settled. The promise returned from this function is always resolved,\n // never rejected.\n // This function modifies the input argument, it replaces the promises\n // with the value returned from the promise.\n waitForResults: function(results) {\n // Create a sequence of all the results starting with a resolved promise.\n return results.reduce(function(memo, result) {\n // If this result isn't a promise skip it in the sequence.\n if (!v.isPromise(result.error)) {\n return memo;\n }\n\n return memo.then(function() {\n return result.error.then(function(error) {\n result.error = error || null;\n });\n });\n }, new v.Promise(function(r) { r(); })); // A resolved promise\n },\n\n // If the given argument is a call: function the and: function return the value\n // otherwise just return the value. Additional arguments will be passed as\n // arguments to the function.\n // Example:\n // ```\n // result('foo') // 'foo'\n // result(Math.max, 1, 2) // 2\n // ```\n result: function(value) {\n var args = [].slice.call(arguments, 1);\n if (typeof value === 'function') {\n value = value.apply(null, args);\n }\n return value;\n },\n\n // Checks if the value is a number. This function does not consider NaN a\n // number like many other `isNumber` functions do.\n isNumber: function(value) {\n return typeof value === 'number' && !isNaN(value);\n },\n\n // Returns false if the object is not a function\n isFunction: function(value) {\n return typeof value === 'function';\n },\n\n // A simple check to verify that the value is an integer. Uses `isNumber`\n // and a simple modulo check.\n isInteger: function(value) {\n return v.isNumber(value) && value % 1 === 0;\n },\n\n // Checks if the value is a boolean\n isBoolean: function(value) {\n return typeof value === 'boolean';\n },\n\n // Uses the `Object` function to check if the given argument is an object.\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n // Simply checks if the object is an instance of a date\n isDate: function(obj) {\n return obj instanceof Date;\n },\n\n // Returns false if the object is `null` of `undefined`\n isDefined: function(obj) {\n return obj !== null && obj !== undefined;\n },\n\n // Checks if the given argument is a promise. Anything with a `then`\n // function is considered a promise.\n isPromise: function(p) {\n return !!p && v.isFunction(p.then);\n },\n\n isJqueryElement: function(o) {\n return o && v.isString(o.jquery);\n },\n\n isDomElement: function(o) {\n if (!o) {\n return false;\n }\n\n if (!o.querySelectorAll || !o.querySelector) {\n return false;\n }\n\n if (v.isObject(document) && o === document) {\n return true;\n }\n\n // http://stackoverflow.com/a/384380/699304\n /* istanbul ignore else */\n if (typeof HTMLElement === \"object\") {\n return o instanceof HTMLElement;\n } else {\n return o &&\n typeof o === \"object\" &&\n o !== null &&\n o.nodeType === 1 &&\n typeof o.nodeName === \"string\";\n }\n },\n\n isEmpty: function(value) {\n var attr;\n\n // Null and undefined are empty\n if (!v.isDefined(value)) {\n return true;\n }\n\n // functions are non empty\n if (v.isFunction(value)) {\n return false;\n }\n\n // Whitespace only strings are empty\n if (v.isString(value)) {\n return v.EMPTY_STRING_REGEXP.test(value);\n }\n\n // For arrays we use the length property\n if (v.isArray(value)) {\n return value.length === 0;\n }\n\n // Dates have no attributes but aren't empty\n if (v.isDate(value)) {\n return false;\n }\n\n // If we find at least one property we consider it non empty\n if (v.isObject(value)) {\n for (attr in value) {\n return false;\n }\n return true;\n }\n\n return false;\n },\n\n // Formats the specified strings with the given values like so:\n // ```\n // format(\"Foo: %{foo}\", {foo: \"bar\"}) // \"Foo bar\"\n // ```\n // If you want to write %{...} without having it replaced simply\n // prefix it with % like this `Foo: %%{foo}` and it will be returned\n // as `\"Foo: %{foo}\"`\n format: v.extend(function(str, vals) {\n if (!v.isString(str)) {\n return str;\n }\n return str.replace(v.format.FORMAT_REGEXP, function(m0, m1, m2) {\n if (m1 === '%') {\n return \"%{\" + m2 + \"}\";\n } else {\n return String(vals[m2]);\n }\n });\n }, {\n // Finds %{key} style patterns in the given string\n FORMAT_REGEXP: /(%?)%\\{([^\\}]+)\\}/g\n }),\n\n // \"Prettifies\" the given string.\n // Prettifying means replacing [.\\_-] with spaces as well as splitting\n // camel case words.\n prettify: function(str) {\n if (v.isNumber(str)) {\n // If there are more than 2 decimals round it to two\n if ((str * 100) % 1 === 0) {\n return \"\" + str;\n } else {\n return parseFloat(Math.round(str * 100) / 100).toFixed(2);\n }\n }\n\n if (v.isArray(str)) {\n return str.map(function(s) { return v.prettify(s); }).join(\", \");\n }\n\n if (v.isObject(str)) {\n if (!v.isDefined(str.toString)) {\n return JSON.stringify(str);\n }\n\n return str.toString();\n }\n\n // Ensure the string is actually a string\n str = \"\" + str;\n\n return str\n // Splits keys separated by periods\n .replace(/([^\\s])\\.([^\\s])/g, '$1 $2')\n // Removes backslashes\n .replace(/\\\\+/g, '')\n // Replaces - and - with space\n .replace(/[_-]/g, ' ')\n // Splits camel cased words\n .replace(/([a-z])([A-Z])/g, function(m0, m1, m2) {\n return \"\" + m1 + \" \" + m2.toLowerCase();\n })\n .toLowerCase();\n },\n\n stringifyValue: function(value, options) {\n var prettify = options && options.prettify || v.prettify;\n return prettify(value);\n },\n\n isString: function(value) {\n return typeof value === 'string';\n },\n\n isArray: function(value) {\n return {}.toString.call(value) === '[object Array]';\n },\n\n // Checks if the object is a hash, which is equivalent to an object that\n // is neither an array nor a function.\n isHash: function(value) {\n return v.isObject(value) && !v.isArray(value) && !v.isFunction(value);\n },\n\n contains: function(obj, value) {\n if (!v.isDefined(obj)) {\n return false;\n }\n if (v.isArray(obj)) {\n return obj.indexOf(value) !== -1;\n }\n return value in obj;\n },\n\n unique: function(array) {\n if (!v.isArray(array)) {\n return array;\n }\n return array.filter(function(el, index, array) {\n return array.indexOf(el) == index;\n });\n },\n\n forEachKeyInKeypath: function(object, keypath, callback) {\n if (!v.isString(keypath)) {\n return undefined;\n }\n\n var key = \"\"\n , i\n , escape = false;\n\n for (i = 0; i < keypath.length; ++i) {\n switch (keypath[i]) {\n case '.':\n if (escape) {\n escape = false;\n key += '.';\n } else {\n object = callback(object, key, false);\n key = \"\";\n }\n break;\n\n case '\\\\':\n if (escape) {\n escape = false;\n key += '\\\\';\n } else {\n escape = true;\n }\n break;\n\n default:\n escape = false;\n key += keypath[i];\n break;\n }\n }\n\n return callback(object, key, true);\n },\n\n getDeepObjectValue: function(obj, keypath) {\n if (!v.isObject(obj)) {\n return undefined;\n }\n\n return v.forEachKeyInKeypath(obj, keypath, function(obj, key) {\n if (v.isObject(obj)) {\n return obj[key];\n }\n });\n },\n\n // This returns an object with all the values of the form.\n // It uses the input name as key and the value as value\n // So for example this:\n // \n // would return:\n // {email: \"foo@bar.com\"}\n collectFormValues: function(form, options) {\n var values = {}\n , i\n , j\n , input\n , inputs\n , option\n , value;\n\n if (v.isJqueryElement(form)) {\n form = form[0];\n }\n\n if (!form) {\n return values;\n }\n\n options = options || {};\n\n inputs = form.querySelectorAll(\"input[name], textarea[name]\");\n for (i = 0; i < inputs.length; ++i) {\n input = inputs.item(i);\n\n if (v.isDefined(input.getAttribute(\"data-ignored\"))) {\n continue;\n }\n\n var name = input.name.replace(/\\./g, \"\\\\\\\\.\");\n value = v.sanitizeFormValue(input.value, options);\n if (input.type === \"number\") {\n value = value ? +value : null;\n } else if (input.type === \"checkbox\") {\n if (input.attributes.value) {\n if (!input.checked) {\n value = values[name] || null;\n }\n } else {\n value = input.checked;\n }\n } else if (input.type === \"radio\") {\n if (!input.checked) {\n value = values[name] || null;\n }\n }\n values[name] = value;\n }\n\n inputs = form.querySelectorAll(\"select[name]\");\n for (i = 0; i < inputs.length; ++i) {\n input = inputs.item(i);\n if (v.isDefined(input.getAttribute(\"data-ignored\"))) {\n continue;\n }\n\n if (input.multiple) {\n value = [];\n for (j in input.options) {\n option = input.options[j];\n if (option && option.selected) {\n value.push(v.sanitizeFormValue(option.value, options));\n }\n }\n } else {\n var _val = typeof input.options[input.selectedIndex] !== 'undefined' ? input.options[input.selectedIndex].value : /* istanbul ignore next */ '';\n value = v.sanitizeFormValue(_val, options);\n }\n values[input.name] = value;\n }\n\n return values;\n },\n\n sanitizeFormValue: function(value, options) {\n if (options.trim && v.isString(value)) {\n value = value.trim();\n }\n\n if (options.nullify !== false && value === \"\") {\n return null;\n }\n return value;\n },\n\n capitalize: function(str) {\n if (!v.isString(str)) {\n return str;\n }\n return str[0].toUpperCase() + str.slice(1);\n },\n\n // Remove all errors who's error attribute is empty (null or undefined)\n pruneEmptyErrors: function(errors) {\n return errors.filter(function(error) {\n return !v.isEmpty(error.error);\n });\n },\n\n // In\n // [{error: [\"err1\", \"err2\"], ...}]\n // Out\n // [{error: \"err1\", ...}, {error: \"err2\", ...}]\n //\n // All attributes in an error with multiple messages are duplicated\n // when expanding the errors.\n expandMultipleErrors: function(errors) {\n var ret = [];\n errors.forEach(function(error) {\n // Removes errors without a message\n if (v.isArray(error.error)) {\n error.error.forEach(function(msg) {\n ret.push(v.extend({}, error, {error: msg}));\n });\n } else {\n ret.push(error);\n }\n });\n return ret;\n },\n\n // Converts the error mesages by prepending the attribute name unless the\n // message is prefixed by ^\n convertErrorMessages: function(errors, options) {\n options = options || {};\n\n var ret = []\n , prettify = options.prettify || v.prettify;\n errors.forEach(function(errorInfo) {\n var error = v.result(errorInfo.error,\n errorInfo.value,\n errorInfo.attribute,\n errorInfo.options,\n errorInfo.attributes,\n errorInfo.globalOptions);\n\n if (!v.isString(error)) {\n ret.push(errorInfo);\n return;\n }\n\n if (error[0] === '^') {\n error = error.slice(1);\n } else if (options.fullMessages !== false) {\n error = v.capitalize(prettify(errorInfo.attribute)) + \" \" + error;\n }\n error = error.replace(/\\\\\\^/g, \"^\");\n error = v.format(error, {\n value: v.stringifyValue(errorInfo.value, options)\n });\n ret.push(v.extend({}, errorInfo, {error: error}));\n });\n return ret;\n },\n\n // In:\n // [{attribute: \"\", ...}]\n // Out:\n // {\"\": [{attribute: \"\", ...}]}\n groupErrorsByAttribute: function(errors) {\n var ret = {};\n errors.forEach(function(error) {\n var list = ret[error.attribute];\n if (list) {\n list.push(error);\n } else {\n ret[error.attribute] = [error];\n }\n });\n return ret;\n },\n\n // In:\n // [{error: \"\", ...}, {error: \"\", ...}]\n // Out:\n // [\"\", \"\"]\n flattenErrorsToArray: function(errors) {\n return errors\n .map(function(error) { return error.error; })\n .filter(function(value, index, self) {\n return self.indexOf(value) === index;\n });\n },\n\n cleanAttributes: function(attributes, whitelist) {\n function whitelistCreator(obj, key, last) {\n if (v.isObject(obj[key])) {\n return obj[key];\n }\n return (obj[key] = last ? true : {});\n }\n\n function buildObjectWhitelist(whitelist) {\n var ow = {}\n , lastObject\n , attr;\n for (attr in whitelist) {\n if (!whitelist[attr]) {\n continue;\n }\n v.forEachKeyInKeypath(ow, attr, whitelistCreator);\n }\n return ow;\n }\n\n function cleanRecursive(attributes, whitelist) {\n if (!v.isObject(attributes)) {\n return attributes;\n }\n\n var ret = v.extend({}, attributes)\n , w\n , attribute;\n\n for (attribute in attributes) {\n w = whitelist[attribute];\n\n if (v.isObject(w)) {\n ret[attribute] = cleanRecursive(ret[attribute], w);\n } else if (!w) {\n delete ret[attribute];\n }\n }\n return ret;\n }\n\n if (!v.isObject(whitelist) || !v.isObject(attributes)) {\n return {};\n }\n\n whitelist = buildObjectWhitelist(whitelist);\n return cleanRecursive(attributes, whitelist);\n },\n\n exposeModule: function(validate, root, exports, module, define) {\n if (exports) {\n if (module && module.exports) {\n exports = module.exports = validate;\n }\n exports.validate = validate;\n } else {\n root.validate = validate;\n if (validate.isFunction(define) && define.amd) {\n define([], function () { return validate; });\n }\n }\n },\n\n warn: function(msg) {\n if (typeof console !== \"undefined\" && console.warn) {\n console.warn(\"[validate.js] \" + msg);\n }\n },\n\n error: function(msg) {\n if (typeof console !== \"undefined\" && console.error) {\n console.error(\"[validate.js] \" + msg);\n }\n }\n });\n\n validate.validators = {\n // Presence validates that the value isn't empty\n presence: function(value, options) {\n options = v.extend({}, this.options, options);\n if (options.allowEmpty !== false ? !v.isDefined(value) : v.isEmpty(value)) {\n return options.message || this.message || \"can't be blank\";\n }\n },\n length: function(value, options, attribute) {\n // Empty values are allowed\n if (!v.isDefined(value)) {\n return;\n }\n\n options = v.extend({}, this.options, options);\n\n var is = options.is\n , maximum = options.maximum\n , minimum = options.minimum\n , tokenizer = options.tokenizer || function(val) { return val; }\n , err\n , errors = [];\n\n value = tokenizer(value);\n var length = value.length;\n if(!v.isNumber(length)) {\n return options.message || this.notValid || \"has an incorrect length\";\n }\n\n // Is checks\n if (v.isNumber(is) && length !== is) {\n err = options.wrongLength ||\n this.wrongLength ||\n \"is the wrong length (should be %{count} characters)\";\n errors.push(v.format(err, {count: is}));\n }\n\n if (v.isNumber(minimum) && length < minimum) {\n err = options.tooShort ||\n this.tooShort ||\n \"is too short (minimum is %{count} characters)\";\n errors.push(v.format(err, {count: minimum}));\n }\n\n if (v.isNumber(maximum) && length > maximum) {\n err = options.tooLong ||\n this.tooLong ||\n \"is too long (maximum is %{count} characters)\";\n errors.push(v.format(err, {count: maximum}));\n }\n\n if (errors.length > 0) {\n return options.message || errors;\n }\n },\n numericality: function(value, options, attribute, attributes, globalOptions) {\n // Empty values are fine\n if (!v.isDefined(value)) {\n return;\n }\n\n options = v.extend({}, this.options, options);\n\n var errors = []\n , name\n , count\n , checks = {\n greaterThan: function(v, c) { return v > c; },\n greaterThanOrEqualTo: function(v, c) { return v >= c; },\n equalTo: function(v, c) { return v === c; },\n lessThan: function(v, c) { return v < c; },\n lessThanOrEqualTo: function(v, c) { return v <= c; },\n divisibleBy: function(v, c) { return v % c === 0; }\n }\n , prettify = options.prettify ||\n (globalOptions && globalOptions.prettify) ||\n v.prettify;\n\n // Strict will check that it is a valid looking number\n if (v.isString(value) && options.strict) {\n var pattern = \"^-?(0|[1-9]\\\\d*)\";\n if (!options.onlyInteger) {\n pattern += \"(\\\\.\\\\d+)?\";\n }\n pattern += \"$\";\n\n if (!(new RegExp(pattern).test(value))) {\n return options.message ||\n options.notValid ||\n this.notValid ||\n this.message ||\n \"must be a valid number\";\n }\n }\n\n // Coerce the value to a number unless we're being strict.\n if (options.noStrings !== true && v.isString(value) && !v.isEmpty(value)) {\n value = +value;\n }\n\n // If it's not a number we shouldn't continue since it will compare it.\n if (!v.isNumber(value)) {\n return options.message ||\n options.notValid ||\n this.notValid ||\n this.message ||\n \"is not a number\";\n }\n\n // Same logic as above, sort of. Don't bother with comparisons if this\n // doesn't pass.\n if (options.onlyInteger && !v.isInteger(value)) {\n return options.message ||\n options.notInteger ||\n this.notInteger ||\n this.message ||\n \"must be an integer\";\n }\n\n for (name in checks) {\n count = options[name];\n if (v.isNumber(count) && !checks[name](value, count)) {\n // This picks the default message if specified\n // For example the greaterThan check uses the message from\n // this.notGreaterThan so we capitalize the name and prepend \"not\"\n var key = \"not\" + v.capitalize(name);\n var msg = options[key] ||\n this[key] ||\n this.message ||\n \"must be %{type} %{count}\";\n\n errors.push(v.format(msg, {\n count: count,\n type: prettify(name)\n }));\n }\n }\n\n if (options.odd && value % 2 !== 1) {\n errors.push(options.notOdd ||\n this.notOdd ||\n this.message ||\n \"must be odd\");\n }\n if (options.even && value % 2 !== 0) {\n errors.push(options.notEven ||\n this.notEven ||\n this.message ||\n \"must be even\");\n }\n\n if (errors.length) {\n return options.message || errors;\n }\n },\n datetime: v.extend(function(value, options) {\n if (!v.isFunction(this.parse) || !v.isFunction(this.format)) {\n throw new Error(\"Both the parse and format functions needs to be set to use the datetime/date validator\");\n }\n\n // Empty values are fine\n if (!v.isDefined(value)) {\n return;\n }\n\n options = v.extend({}, this.options, options);\n\n var err\n , errors = []\n , earliest = options.earliest ? this.parse(options.earliest, options) : NaN\n , latest = options.latest ? this.parse(options.latest, options) : NaN;\n\n value = this.parse(value, options);\n\n // 86400000 is the number of milliseconds in a day, this is used to remove\n // the time from the date\n if (isNaN(value) || options.dateOnly && value % 86400000 !== 0) {\n err = options.notValid ||\n options.message ||\n this.notValid ||\n \"must be a valid date\";\n return v.format(err, {value: arguments[0]});\n }\n\n if (!isNaN(earliest) && value < earliest) {\n err = options.tooEarly ||\n options.message ||\n this.tooEarly ||\n \"must be no earlier than %{date}\";\n err = v.format(err, {\n value: this.format(value, options),\n date: this.format(earliest, options)\n });\n errors.push(err);\n }\n\n if (!isNaN(latest) && value > latest) {\n err = options.tooLate ||\n options.message ||\n this.tooLate ||\n \"must be no later than %{date}\";\n err = v.format(err, {\n date: this.format(latest, options),\n value: this.format(value, options)\n });\n errors.push(err);\n }\n\n if (errors.length) {\n return v.unique(errors);\n }\n }, {\n parse: null,\n format: null\n }),\n date: function(value, options) {\n options = v.extend({}, options, {dateOnly: true});\n return v.validators.datetime.call(v.validators.datetime, value, options);\n },\n format: function(value, options) {\n if (v.isString(options) || (options instanceof RegExp)) {\n options = {pattern: options};\n }\n\n options = v.extend({}, this.options, options);\n\n var message = options.message || this.message || \"is invalid\"\n , pattern = options.pattern\n , match;\n\n // Empty values are allowed\n if (!v.isDefined(value)) {\n return;\n }\n if (!v.isString(value)) {\n return message;\n }\n\n if (v.isString(pattern)) {\n pattern = new RegExp(options.pattern, options.flags);\n }\n match = pattern.exec(value);\n if (!match || match[0].length != value.length) {\n return message;\n }\n },\n inclusion: function(value, options) {\n // Empty values are fine\n if (!v.isDefined(value)) {\n return;\n }\n if (v.isArray(options)) {\n options = {within: options};\n }\n options = v.extend({}, this.options, options);\n if (v.contains(options.within, value)) {\n return;\n }\n var message = options.message ||\n this.message ||\n \"^%{value} is not included in the list\";\n return v.format(message, {value: value});\n },\n exclusion: function(value, options) {\n // Empty values are fine\n if (!v.isDefined(value)) {\n return;\n }\n if (v.isArray(options)) {\n options = {within: options};\n }\n options = v.extend({}, this.options, options);\n if (!v.contains(options.within, value)) {\n return;\n }\n var message = options.message || this.message || \"^%{value} is restricted\";\n if (v.isString(options.within[value])) {\n value = options.within[value];\n }\n return v.format(message, {value: value});\n },\n email: v.extend(function(value, options) {\n options = v.extend({}, this.options, options);\n var message = options.message || this.message || \"is not a valid email\";\n // Empty values are fine\n if (!v.isDefined(value)) {\n return;\n }\n if (!v.isString(value)) {\n return message;\n }\n if (!this.PATTERN.exec(value)) {\n return message;\n }\n }, {\n PATTERN: /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i\n }),\n equality: function(value, options, attribute, attributes, globalOptions) {\n if (!v.isDefined(value)) {\n return;\n }\n\n if (v.isString(options)) {\n options = {attribute: options};\n }\n options = v.extend({}, this.options, options);\n var message = options.message ||\n this.message ||\n \"is not equal to %{attribute}\";\n\n if (v.isEmpty(options.attribute) || !v.isString(options.attribute)) {\n throw new Error(\"The attribute must be a non empty string\");\n }\n\n var otherValue = v.getDeepObjectValue(attributes, options.attribute)\n , comparator = options.comparator || function(v1, v2) {\n return v1 === v2;\n }\n , prettify = options.prettify ||\n (globalOptions && globalOptions.prettify) ||\n v.prettify;\n\n if (!comparator(value, otherValue, options, attribute, attributes)) {\n return v.format(message, {attribute: prettify(options.attribute)});\n }\n },\n // A URL validator that is used to validate URLs with the ability to\n // restrict schemes and some domains.\n url: function(value, options) {\n if (!v.isDefined(value)) {\n return;\n }\n\n options = v.extend({}, this.options, options);\n\n var message = options.message || this.message || \"is not a valid url\"\n , schemes = options.schemes || this.schemes || ['http', 'https']\n , allowLocal = options.allowLocal || this.allowLocal || false\n , allowDataUrl = options.allowDataUrl || this.allowDataUrl || false;\n if (!v.isString(value)) {\n return message;\n }\n\n // https://gist.github.com/dperini/729294\n var regex =\n \"^\" +\n // protocol identifier\n \"(?:(?:\" + schemes.join(\"|\") + \")://)\" +\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\";\n\n var tld = \"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,}))\";\n\n if (allowLocal) {\n tld += \"?\";\n } else {\n regex +=\n // IP address exclusion\n // private & local networks\n \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" +\n \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" +\n \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\";\n }\n\n regex +=\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)*\" +\n tld +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:[/?#]\\\\S*)?\" +\n \"$\";\n\n if (allowDataUrl) {\n // RFC 2397\n var mediaType = \"\\\\w+\\\\/[-+.\\\\w]+(?:;[\\\\w=]+)*\";\n var urlchar = \"[A-Za-z0-9-_.!~\\\\*'();\\\\/?:@&=+$,%]*\";\n var dataurl = \"data:(?:\"+mediaType+\")?(?:;base64)?,\"+urlchar;\n regex = \"(?:\"+regex+\")|(?:^\"+dataurl+\"$)\";\n }\n\n var PATTERN = new RegExp(regex, 'i');\n if (!PATTERN.exec(value)) {\n return message;\n }\n },\n type: v.extend(function(value, originalOptions, attribute, attributes, globalOptions) {\n if (v.isString(originalOptions)) {\n originalOptions = {type: originalOptions};\n }\n\n if (!v.isDefined(value)) {\n return;\n }\n\n var options = v.extend({}, this.options, originalOptions);\n\n var type = options.type;\n if (!v.isDefined(type)) {\n throw new Error(\"No type was specified\");\n }\n\n var check;\n if (v.isFunction(type)) {\n check = type;\n } else {\n check = this.types[type];\n }\n\n if (!v.isFunction(check)) {\n throw new Error(\"validate.validators.type.types.\" + type + \" must be a function.\");\n }\n\n if (!check(value, options, attribute, attributes, globalOptions)) {\n var message = originalOptions.message ||\n this.messages[type] ||\n this.message ||\n options.message ||\n (v.isFunction(type) ? \"must be of the correct type\" : \"must be of type %{type}\");\n\n if (v.isFunction(message)) {\n message = message(value, originalOptions, attribute, attributes, globalOptions);\n }\n\n return v.format(message, {attribute: v.prettify(attribute), type: type});\n }\n }, {\n types: {\n object: function(value) {\n return v.isObject(value) && !v.isArray(value);\n },\n array: v.isArray,\n integer: v.isInteger,\n number: v.isNumber,\n string: v.isString,\n date: v.isDate,\n boolean: v.isBoolean\n },\n messages: {}\n })\n };\n\n validate.formatters = {\n detailed: function(errors) {return errors;},\n flat: v.flattenErrorsToArray,\n grouped: function(errors) {\n var attr;\n\n errors = v.groupErrorsByAttribute(errors);\n for (attr in errors) {\n errors[attr] = v.flattenErrorsToArray(errors[attr]);\n }\n return errors;\n },\n constraint: function(errors) {\n var attr;\n errors = v.groupErrorsByAttribute(errors);\n for (attr in errors) {\n errors[attr] = errors[attr].map(function(result) {\n return result.validator;\n }).sort();\n }\n return errors;\n }\n };\n\n validate.exposeModule(validate, this, exports, module, define);\n}).call(this,\n typeof exports !== 'undefined' ? /* istanbul ignore next */ exports : null,\n typeof module !== 'undefined' ? /* istanbul ignore next */ module : null,\n typeof define !== 'undefined' ? /* istanbul ignore next */ define : null);\n","import IMask from './holder.js';\n\n/** Provides details of changing model value */\nclass ChangeDetails {\n /** Inserted symbols */\n\n /** Can skip chars */\n\n /** Additional offset if any changes occurred before tail */\n\n /** Raw inserted is used by dynamic mask */\n\n static normalize(prep) {\n return Array.isArray(prep) ? prep : [prep, new ChangeDetails()];\n }\n constructor(details) {\n Object.assign(this, {\n inserted: '',\n rawInserted: '',\n skip: false,\n tailShift: 0\n }, details);\n }\n\n /** Aggregate changes */\n aggregate(details) {\n this.rawInserted += details.rawInserted;\n this.skip = this.skip || details.skip;\n this.inserted += details.inserted;\n this.tailShift += details.tailShift;\n return this;\n }\n\n /** Total offset considering all changes */\n get offset() {\n return this.tailShift + this.inserted.length;\n }\n}\nIMask.ChangeDetails = ChangeDetails;\n\nexport { ChangeDetails as default };\n","/** Provides details of continuous extracted tail */\nclass ContinuousTailDetails {\n /** Tail value as string */\n\n /** Tail start position */\n\n /** Start position */\n\n constructor(value, from, stop) {\n if (value === void 0) {\n value = '';\n }\n if (from === void 0) {\n from = 0;\n }\n this.value = value;\n this.from = from;\n this.stop = stop;\n }\n toString() {\n return this.value;\n }\n extend(tail) {\n this.value += String(tail);\n }\n appendTo(masked) {\n return masked.append(this.toString(), {\n tail: true\n }).aggregate(masked._appendPlaceholder());\n }\n get state() {\n return {\n value: this.value,\n from: this.from,\n stop: this.stop\n };\n }\n set state(state) {\n Object.assign(this, state);\n }\n unshift(beforePos) {\n if (!this.value.length || beforePos != null && this.from >= beforePos) return '';\n const shiftChar = this.value[0];\n this.value = this.value.slice(1);\n return shiftChar;\n }\n shift() {\n if (!this.value.length) return '';\n const shiftChar = this.value[this.value.length - 1];\n this.value = this.value.slice(0, -1);\n return shiftChar;\n }\n}\n\nexport { ContinuousTailDetails as default };\n","/** Applies mask on element */\nfunction IMask(el, opts) {\n // currently available only for input-like elements\n return new IMask.InputMask(el, opts);\n}\n\nexport { IMask as default };\n","/** Checks if value is string */\nfunction isString(str) {\n return typeof str === 'string' || str instanceof String;\n}\n\n/** Checks if value is object */\nfunction isObject(obj) {\n var _obj$constructor;\n return typeof obj === 'object' && obj != null && (obj == null || (_obj$constructor = obj.constructor) == null ? void 0 : _obj$constructor.name) === 'Object';\n}\nfunction pick(obj, keys) {\n if (Array.isArray(keys)) return pick(obj, (_, k) => keys.includes(k));\n return Object.entries(obj).reduce((acc, _ref) => {\n let [k, v] = _ref;\n if (keys(v, k)) acc[k] = v;\n return acc;\n }, {});\n}\n\n/** Direction */\nconst DIRECTION = {\n NONE: 'NONE',\n LEFT: 'LEFT',\n FORCE_LEFT: 'FORCE_LEFT',\n RIGHT: 'RIGHT',\n FORCE_RIGHT: 'FORCE_RIGHT'\n};\n\n/** Direction */\n\nfunction forceDirection(direction) {\n switch (direction) {\n case DIRECTION.LEFT:\n return DIRECTION.FORCE_LEFT;\n case DIRECTION.RIGHT:\n return DIRECTION.FORCE_RIGHT;\n default:\n return direction;\n }\n}\n\n/** Escapes regular expression control chars */\nfunction escapeRegExp(str) {\n return str.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1');\n}\n\n// cloned from https://github.com/epoberezkin/fast-deep-equal with small changes\nfunction objectIncludes(b, a) {\n if (a === b) return true;\n const arrA = Array.isArray(a),\n arrB = Array.isArray(b);\n let i;\n if (arrA && arrB) {\n if (a.length != b.length) return false;\n for (i = 0; i < a.length; i++) if (!objectIncludes(a[i], b[i])) return false;\n return true;\n }\n if (arrA != arrB) return false;\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n const dateA = a instanceof Date,\n dateB = b instanceof Date;\n if (dateA && dateB) return a.getTime() == b.getTime();\n if (dateA != dateB) return false;\n const regexpA = a instanceof RegExp,\n regexpB = b instanceof RegExp;\n if (regexpA && regexpB) return a.toString() == b.toString();\n if (regexpA != regexpB) return false;\n const keys = Object.keys(a);\n // if (keys.length !== Object.keys(b).length) return false;\n\n for (i = 0; i < keys.length; i++) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = 0; i < keys.length; i++) if (!objectIncludes(b[keys[i]], a[keys[i]])) return false;\n return true;\n } else if (a && b && typeof a === 'function' && typeof b === 'function') {\n return a.toString() === b.toString();\n }\n return false;\n}\n\n/** Selection range */\n\nexport { DIRECTION, escapeRegExp, forceDirection, isObject, isString, objectIncludes, pick };\n","import { DIRECTION } from './utils.js';\n\n/** Provides details of changing input */\nclass ActionDetails {\n /** Current input value */\n\n /** Current cursor position */\n\n /** Old input value */\n\n /** Old selection */\n\n constructor(opts) {\n Object.assign(this, opts);\n\n // double check if left part was changed (autofilling, other non-standard input triggers)\n while (this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos)) {\n --this.oldSelection.start;\n }\n }\n\n /** Start changing position */\n get startChangePos() {\n return Math.min(this.cursorPos, this.oldSelection.start);\n }\n\n /** Inserted symbols count */\n get insertedCount() {\n return this.cursorPos - this.startChangePos;\n }\n\n /** Inserted symbols */\n get inserted() {\n return this.value.substr(this.startChangePos, this.insertedCount);\n }\n\n /** Removed symbols count */\n get removedCount() {\n // Math.max for opposite operation\n return Math.max(this.oldSelection.end - this.startChangePos ||\n // for Delete\n this.oldValue.length - this.value.length, 0);\n }\n\n /** Removed symbols */\n get removed() {\n return this.oldValue.substr(this.startChangePos, this.removedCount);\n }\n\n /** Unchanged head symbols */\n get head() {\n return this.value.substring(0, this.startChangePos);\n }\n\n /** Unchanged tail symbols */\n get tail() {\n return this.value.substring(this.startChangePos + this.insertedCount);\n }\n\n /** Remove direction */\n get removeDirection() {\n if (!this.removedCount || this.insertedCount) return DIRECTION.NONE;\n\n // align right if delete at right\n return (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) &&\n // if not range removed (event with backspace)\n this.oldSelection.end === this.oldSelection.start ? DIRECTION.RIGHT : DIRECTION.LEFT;\n }\n}\n\nexport { ActionDetails as default };\n","import IMask from '../core/holder.js';\n\n/** Generic element API to use with mask */\nclass MaskElement {\n /** */\n\n /** */\n\n /** */\n\n /** Safely returns selection start */\n get selectionStart() {\n let start;\n try {\n start = this._unsafeSelectionStart;\n } catch {}\n return start != null ? start : this.value.length;\n }\n\n /** Safely returns selection end */\n get selectionEnd() {\n let end;\n try {\n end = this._unsafeSelectionEnd;\n } catch {}\n return end != null ? end : this.value.length;\n }\n\n /** Safely sets element selection */\n select(start, end) {\n if (start == null || end == null || start === this.selectionStart && end === this.selectionEnd) return;\n try {\n this._unsafeSelect(start, end);\n } catch {}\n }\n\n /** */\n get isActive() {\n return false;\n }\n /** */\n\n /** */\n\n /** */\n}\n\nIMask.MaskElement = MaskElement;\n\nexport { MaskElement as default };\n","import MaskElement from './mask-element.js';\nimport IMask from '../core/holder.js';\n\n/** Bridge between HTMLElement and {@link Masked} */\nclass HTMLMaskElement extends MaskElement {\n /** HTMLElement to use mask on */\n\n constructor(input) {\n super();\n this.input = input;\n this._handlers = {};\n }\n get rootElement() {\n var _this$input$getRootNo, _this$input$getRootNo2, _this$input;\n return (_this$input$getRootNo = (_this$input$getRootNo2 = (_this$input = this.input).getRootNode) == null ? void 0 : _this$input$getRootNo2.call(_this$input)) != null ? _this$input$getRootNo : document;\n }\n\n /**\n Is element in focus\n */\n get isActive() {\n return this.input === this.rootElement.activeElement;\n }\n\n /**\n Binds HTMLElement events to mask internal events\n */\n bindEvents(handlers) {\n Object.keys(handlers).forEach(event => this._toggleEventHandler(HTMLMaskElement.EVENTS_MAP[event], handlers[event]));\n }\n\n /**\n Unbinds HTMLElement events to mask internal events\n */\n unbindEvents() {\n Object.keys(this._handlers).forEach(event => this._toggleEventHandler(event));\n }\n _toggleEventHandler(event, handler) {\n if (this._handlers[event]) {\n this.input.removeEventListener(event, this._handlers[event]);\n delete this._handlers[event];\n }\n if (handler) {\n this.input.addEventListener(event, handler);\n this._handlers[event] = handler;\n }\n }\n}\n/** Mapping between HTMLElement events and mask internal events */\nHTMLMaskElement.EVENTS_MAP = {\n selectionChange: 'keydown',\n input: 'input',\n drop: 'drop',\n click: 'click',\n focus: 'focus',\n commit: 'blur'\n};\nIMask.HTMLMaskElement = HTMLMaskElement;\n\nexport { HTMLMaskElement as default };\n","import HTMLMaskElement from './html-mask-element.js';\nimport IMask from '../core/holder.js';\nimport './mask-element.js';\n\n/** Bridge between InputElement and {@link Masked} */\nclass HTMLInputMaskElement extends HTMLMaskElement {\n /** InputElement to use mask on */\n\n constructor(input) {\n super(input);\n this.input = input;\n this._handlers = {};\n }\n\n /** Returns InputElement selection start */\n get _unsafeSelectionStart() {\n return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;\n }\n\n /** Returns InputElement selection end */\n get _unsafeSelectionEnd() {\n return this.input.selectionEnd;\n }\n\n /** Sets InputElement selection */\n _unsafeSelect(start, end) {\n this.input.setSelectionRange(start, end);\n }\n get value() {\n return this.input.value;\n }\n set value(value) {\n this.input.value = value;\n }\n}\nIMask.HTMLMaskElement = HTMLMaskElement;\n\nexport { HTMLInputMaskElement as default };\n","import HTMLMaskElement from './html-mask-element.js';\nimport IMask from '../core/holder.js';\nimport './mask-element.js';\n\nclass HTMLContenteditableMaskElement extends HTMLMaskElement {\n /** Returns HTMLElement selection start */\n get _unsafeSelectionStart() {\n const root = this.rootElement;\n const selection = root.getSelection && root.getSelection();\n const anchorOffset = selection && selection.anchorOffset;\n const focusOffset = selection && selection.focusOffset;\n if (focusOffset == null || anchorOffset == null || anchorOffset < focusOffset) {\n return anchorOffset;\n }\n return focusOffset;\n }\n\n /** Returns HTMLElement selection end */\n get _unsafeSelectionEnd() {\n const root = this.rootElement;\n const selection = root.getSelection && root.getSelection();\n const anchorOffset = selection && selection.anchorOffset;\n const focusOffset = selection && selection.focusOffset;\n if (focusOffset == null || anchorOffset == null || anchorOffset > focusOffset) {\n return anchorOffset;\n }\n return focusOffset;\n }\n\n /** Sets HTMLElement selection */\n _unsafeSelect(start, end) {\n if (!this.rootElement.createRange) return;\n const range = this.rootElement.createRange();\n range.setStart(this.input.firstChild || this.input, start);\n range.setEnd(this.input.lastChild || this.input, end);\n const root = this.rootElement;\n const selection = root.getSelection && root.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n\n /** HTMLElement value */\n get value() {\n return this.input.textContent || '';\n }\n set value(value) {\n this.input.textContent = value;\n }\n}\nIMask.HTMLContenteditableMaskElement = HTMLContenteditableMaskElement;\n\nexport { HTMLContenteditableMaskElement as default };\n","import { objectIncludes, DIRECTION } from '../core/utils.js';\nimport ActionDetails from '../core/action-details.js';\nimport createMask, { maskedClass } from '../masked/factory.js';\nimport MaskElement from './mask-element.js';\nimport HTMLInputMaskElement from './html-input-mask-element.js';\nimport HTMLContenteditableMaskElement from './html-contenteditable-mask-element.js';\nimport IMask from '../core/holder.js';\nimport './html-mask-element.js';\n\n/** Listens to element events and controls changes between element and {@link Masked} */\nclass InputMask {\n /**\n View element\n */\n\n /** Internal {@link Masked} model */\n\n constructor(el, opts) {\n this.el = el instanceof MaskElement ? el : el.isContentEditable && el.tagName !== 'INPUT' && el.tagName !== 'TEXTAREA' ? new HTMLContenteditableMaskElement(el) : new HTMLInputMaskElement(el);\n this.masked = createMask(opts);\n this._listeners = {};\n this._value = '';\n this._unmaskedValue = '';\n this._saveSelection = this._saveSelection.bind(this);\n this._onInput = this._onInput.bind(this);\n this._onChange = this._onChange.bind(this);\n this._onDrop = this._onDrop.bind(this);\n this._onFocus = this._onFocus.bind(this);\n this._onClick = this._onClick.bind(this);\n this.alignCursor = this.alignCursor.bind(this);\n this.alignCursorFriendly = this.alignCursorFriendly.bind(this);\n this._bindEvents();\n\n // refresh\n this.updateValue();\n this._onChange();\n }\n maskEquals(mask) {\n var _this$masked;\n return mask == null || ((_this$masked = this.masked) == null ? void 0 : _this$masked.maskEquals(mask));\n }\n\n /** Masked */\n get mask() {\n return this.masked.mask;\n }\n set mask(mask) {\n if (this.maskEquals(mask)) return;\n if (!(mask instanceof IMask.Masked) && this.masked.constructor === maskedClass(mask)) {\n // TODO \"any\" no idea\n this.masked.updateOptions({\n mask\n });\n return;\n }\n const masked = mask instanceof IMask.Masked ? mask : createMask({\n mask\n });\n masked.unmaskedValue = this.masked.unmaskedValue;\n this.masked = masked;\n }\n\n /** Raw value */\n get value() {\n return this._value;\n }\n set value(str) {\n if (this.value === str) return;\n this.masked.value = str;\n this.updateControl();\n this.alignCursor();\n }\n\n /** Unmasked value */\n get unmaskedValue() {\n return this._unmaskedValue;\n }\n set unmaskedValue(str) {\n if (this.unmaskedValue === str) return;\n this.masked.unmaskedValue = str;\n this.updateControl();\n this.alignCursor();\n }\n\n /** Typed unmasked value */\n get typedValue() {\n return this.masked.typedValue;\n }\n set typedValue(val) {\n if (this.masked.typedValueEquals(val)) return;\n this.masked.typedValue = val;\n this.updateControl();\n this.alignCursor();\n }\n\n /** Display value */\n get displayValue() {\n return this.masked.displayValue;\n }\n\n /** Starts listening to element events */\n _bindEvents() {\n this.el.bindEvents({\n selectionChange: this._saveSelection,\n input: this._onInput,\n drop: this._onDrop,\n click: this._onClick,\n focus: this._onFocus,\n commit: this._onChange\n });\n }\n\n /** Stops listening to element events */\n _unbindEvents() {\n if (this.el) this.el.unbindEvents();\n }\n\n /** Fires custom event */\n _fireEvent(ev, e) {\n const listeners = this._listeners[ev];\n if (!listeners) return;\n listeners.forEach(l => l(e));\n }\n\n /** Current selection start */\n get selectionStart() {\n return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;\n }\n\n /** Current cursor position */\n get cursorPos() {\n return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;\n }\n set cursorPos(pos) {\n if (!this.el || !this.el.isActive) return;\n this.el.select(pos, pos);\n this._saveSelection();\n }\n\n /** Stores current selection */\n _saveSelection( /* ev */\n ) {\n if (this.displayValue !== this.el.value) {\n console.warn('Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly.'); // eslint-disable-line no-console\n }\n\n this._selection = {\n start: this.selectionStart,\n end: this.cursorPos\n };\n }\n\n /** Syncronizes model value from view */\n updateValue() {\n this.masked.value = this.el.value;\n this._value = this.masked.value;\n }\n\n /** Syncronizes view from model value, fires change events */\n updateControl() {\n const newUnmaskedValue = this.masked.unmaskedValue;\n const newValue = this.masked.value;\n const newDisplayValue = this.displayValue;\n const isChanged = this.unmaskedValue !== newUnmaskedValue || this.value !== newValue;\n this._unmaskedValue = newUnmaskedValue;\n this._value = newValue;\n if (this.el.value !== newDisplayValue) this.el.value = newDisplayValue;\n if (isChanged) this._fireChangeEvents();\n }\n\n /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */\n updateOptions(opts) {\n const {\n mask,\n ...restOpts\n } = opts;\n const updateMask = !this.maskEquals(mask);\n const updateOpts = !objectIncludes(this.masked, restOpts);\n if (updateMask) this.mask = mask;\n if (updateOpts) this.masked.updateOptions(restOpts); // TODO\n\n if (updateMask || updateOpts) this.updateControl();\n }\n\n /** Updates cursor */\n updateCursor(cursorPos) {\n if (cursorPos == null) return;\n this.cursorPos = cursorPos;\n\n // also queue change cursor for mobile browsers\n this._delayUpdateCursor(cursorPos);\n }\n\n /** Delays cursor update to support mobile browsers */\n _delayUpdateCursor(cursorPos) {\n this._abortUpdateCursor();\n this._changingCursorPos = cursorPos;\n this._cursorChanging = setTimeout(() => {\n if (!this.el) return; // if was destroyed\n this.cursorPos = this._changingCursorPos;\n this._abortUpdateCursor();\n }, 10);\n }\n\n /** Fires custom events */\n _fireChangeEvents() {\n this._fireEvent('accept', this._inputEvent);\n if (this.masked.isComplete) this._fireEvent('complete', this._inputEvent);\n }\n\n /** Aborts delayed cursor update */\n _abortUpdateCursor() {\n if (this._cursorChanging) {\n clearTimeout(this._cursorChanging);\n delete this._cursorChanging;\n }\n }\n\n /** Aligns cursor to nearest available position */\n alignCursor() {\n this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, DIRECTION.LEFT));\n }\n\n /** Aligns cursor only if selection is empty */\n alignCursorFriendly() {\n if (this.selectionStart !== this.cursorPos) return; // skip if range is selected\n this.alignCursor();\n }\n\n /** Adds listener on custom event */\n on(ev, handler) {\n if (!this._listeners[ev]) this._listeners[ev] = [];\n this._listeners[ev].push(handler);\n return this;\n }\n\n /** Removes custom event listener */\n off(ev, handler) {\n if (!this._listeners[ev]) return this;\n if (!handler) {\n delete this._listeners[ev];\n return this;\n }\n const hIndex = this._listeners[ev].indexOf(handler);\n if (hIndex >= 0) this._listeners[ev].splice(hIndex, 1);\n return this;\n }\n\n /** Handles view input event */\n _onInput(e) {\n this._inputEvent = e;\n this._abortUpdateCursor();\n\n // fix strange IE behavior\n if (!this._selection) return this.updateValue();\n const details = new ActionDetails({\n // new state\n value: this.el.value,\n cursorPos: this.cursorPos,\n // old state\n oldValue: this.displayValue,\n oldSelection: this._selection\n });\n const oldRawValue = this.masked.rawInputValue;\n const offset = this.masked.splice(details.startChangePos, details.removed.length, details.inserted, details.removeDirection, {\n input: true,\n raw: true\n }).offset;\n\n // force align in remove direction only if no input chars were removed\n // otherwise we still need to align with NONE (to get out from fixed symbols for instance)\n const removeDirection = oldRawValue === this.masked.rawInputValue ? details.removeDirection : DIRECTION.NONE;\n let cursorPos = this.masked.nearestInputPos(details.startChangePos + offset, removeDirection);\n if (removeDirection !== DIRECTION.NONE) cursorPos = this.masked.nearestInputPos(cursorPos, DIRECTION.NONE);\n this.updateControl();\n this.updateCursor(cursorPos);\n delete this._inputEvent;\n }\n\n /** Handles view change event and commits model value */\n _onChange() {\n if (this.displayValue !== this.el.value) {\n this.updateValue();\n }\n this.masked.doCommit();\n this.updateControl();\n this._saveSelection();\n }\n\n /** Handles view drop event, prevents by default */\n _onDrop(ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n /** Restore last selection on focus */\n _onFocus(ev) {\n this.alignCursorFriendly();\n }\n\n /** Restore last selection on focus */\n _onClick(ev) {\n this.alignCursorFriendly();\n }\n\n /** Unbind view events and removes element reference */\n destroy() {\n this._unbindEvents();\n this._listeners.length = 0;\n delete this.el;\n }\n}\nIMask.InputMask = InputMask;\n\nexport { InputMask as default };\n","import ChangeDetails from '../core/change-details.js';\nimport ContinuousTailDetails from '../core/continuous-tail-details.js';\nimport { isString, DIRECTION, forceDirection } from '../core/utils.js';\nimport IMask from '../core/holder.js';\n\n/** Append flags */\n\n/** Extract flags */\n\n// see https://github.com/microsoft/TypeScript/issues/6223\n\n/** Provides common masking stuff */\nclass Masked {\n /** */\n\n /** */\n\n /** Transforms value before mask processing */\n\n /** Transforms each char before mask processing */\n\n /** Validates if value is acceptable */\n\n /** Does additional processing at the end of editing */\n\n /** Format typed value to string */\n\n /** Parse string to get typed value */\n\n /** Enable characters overwriting */\n\n /** */\n\n /** */\n\n /** */\n\n constructor(opts) {\n this._value = '';\n this._update({\n ...Masked.DEFAULTS,\n ...opts\n });\n this._initialized = true;\n }\n\n /** Sets and applies new options */\n updateOptions(opts) {\n if (!Object.keys(opts).length) return;\n this.withValueRefresh(this._update.bind(this, opts));\n }\n\n /** Sets new options */\n _update(opts) {\n Object.assign(this, opts);\n }\n\n /** Mask state */\n get state() {\n return {\n _value: this.value,\n _rawInputValue: this.rawInputValue\n };\n }\n set state(state) {\n this._value = state._value;\n }\n\n /** Resets value */\n reset() {\n this._value = '';\n }\n get value() {\n return this._value;\n }\n set value(value) {\n this.resolve(value, {\n input: true\n });\n }\n\n /** Resolve new value */\n resolve(value, flags) {\n if (flags === void 0) {\n flags = {\n input: true\n };\n }\n this.reset();\n this.append(value, flags, '');\n this.doCommit();\n }\n get unmaskedValue() {\n return this.value;\n }\n set unmaskedValue(value) {\n this.resolve(value, {});\n }\n get typedValue() {\n return this.parse ? this.parse(this.value, this) : this.unmaskedValue;\n }\n set typedValue(value) {\n if (this.format) {\n this.value = this.format(value, this);\n } else {\n this.unmaskedValue = String(value);\n }\n }\n\n /** Value that includes raw user input */\n get rawInputValue() {\n return this.extractInput(0, this.displayValue.length, {\n raw: true\n });\n }\n set rawInputValue(value) {\n this.resolve(value, {\n raw: true\n });\n }\n get displayValue() {\n return this.value;\n }\n get isComplete() {\n return true;\n }\n get isFilled() {\n return this.isComplete;\n }\n\n /** Finds nearest input position in direction */\n nearestInputPos(cursorPos, direction) {\n return cursorPos;\n }\n totalInputPositions(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n return Math.min(this.displayValue.length, toPos - fromPos);\n }\n\n /** Extracts value in range considering flags */\n extractInput(fromPos, toPos, flags) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n return this.displayValue.slice(fromPos, toPos);\n }\n\n /** Extracts tail in range */\n extractTail(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n return new ContinuousTailDetails(this.extractInput(fromPos, toPos), fromPos);\n }\n\n /** Appends tail */\n appendTail(tail) {\n if (isString(tail)) tail = new ContinuousTailDetails(String(tail));\n return tail.appendTo(this);\n }\n\n /** Appends char */\n _appendCharRaw(ch, flags) {\n if (!ch) return new ChangeDetails();\n this._value += ch;\n return new ChangeDetails({\n inserted: ch,\n rawInserted: ch\n });\n }\n\n /** Appends char */\n _appendChar(ch, flags, checkTail) {\n if (flags === void 0) {\n flags = {};\n }\n const consistentState = this.state;\n let details;\n [ch, details] = this.doPrepareChar(ch, flags);\n details = details.aggregate(this._appendCharRaw(ch, flags));\n if (details.inserted) {\n let consistentTail;\n let appended = this.doValidate(flags) !== false;\n if (appended && checkTail != null) {\n // validation ok, check tail\n const beforeTailState = this.state;\n if (this.overwrite === true) {\n consistentTail = checkTail.state;\n checkTail.unshift(this.displayValue.length - details.tailShift);\n }\n let tailDetails = this.appendTail(checkTail);\n appended = tailDetails.rawInserted === checkTail.toString();\n\n // not ok, try shift\n if (!(appended && tailDetails.inserted) && this.overwrite === 'shift') {\n this.state = beforeTailState;\n consistentTail = checkTail.state;\n checkTail.shift();\n tailDetails = this.appendTail(checkTail);\n appended = tailDetails.rawInserted === checkTail.toString();\n }\n\n // if ok, rollback state after tail\n if (appended && tailDetails.inserted) this.state = beforeTailState;\n }\n\n // revert all if something went wrong\n if (!appended) {\n details = new ChangeDetails();\n this.state = consistentState;\n if (checkTail && consistentTail) checkTail.state = consistentTail;\n }\n }\n return details;\n }\n\n /** Appends optional placeholder at the end */\n _appendPlaceholder() {\n return new ChangeDetails();\n }\n\n /** Appends optional eager placeholder at the end */\n _appendEager() {\n return new ChangeDetails();\n }\n\n /** Appends symbols considering flags */\n append(str, flags, tail) {\n if (!isString(str)) throw new Error('value should be string');\n const checkTail = isString(tail) ? new ContinuousTailDetails(String(tail)) : tail;\n if (flags != null && flags.tail) flags._beforeTailState = this.state;\n let details;\n [str, details] = this.doPrepare(str, flags);\n for (let ci = 0; ci < str.length; ++ci) {\n const d = this._appendChar(str[ci], flags, checkTail);\n if (!d.rawInserted && !this.doSkipInvalid(str[ci], flags, checkTail)) break;\n details.aggregate(d);\n }\n if ((this.eager === true || this.eager === 'append') && flags != null && flags.input && str) {\n details.aggregate(this._appendEager());\n }\n\n // append tail but aggregate only tailShift\n if (checkTail != null) {\n details.tailShift += this.appendTail(checkTail).tailShift;\n // TODO it's a good idea to clear state after appending ends\n // but it causes bugs when one append calls another (when dynamic dispatch set rawInputValue)\n // this._resetBeforeTailState();\n }\n\n return details;\n }\n remove(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n this._value = this.displayValue.slice(0, fromPos) + this.displayValue.slice(toPos);\n return new ChangeDetails();\n }\n\n /** Calls function and reapplies current value */\n withValueRefresh(fn) {\n if (this._refreshing || !this._initialized) return fn();\n this._refreshing = true;\n const rawInput = this.rawInputValue;\n const value = this.value;\n const ret = fn();\n this.rawInputValue = rawInput;\n // append lost trailing chars at the end\n if (this.value && this.value !== value && value.indexOf(this.value) === 0) {\n this.append(value.slice(this.displayValue.length), {}, '');\n }\n delete this._refreshing;\n return ret;\n }\n runIsolated(fn) {\n if (this._isolated || !this._initialized) return fn(this);\n this._isolated = true;\n const state = this.state;\n const ret = fn(this);\n this.state = state;\n delete this._isolated;\n return ret;\n }\n doSkipInvalid(ch, flags, checkTail) {\n return Boolean(this.skipInvalid);\n }\n\n /** Prepares string before mask processing */\n doPrepare(str, flags) {\n if (flags === void 0) {\n flags = {};\n }\n return ChangeDetails.normalize(this.prepare ? this.prepare(str, this, flags) : str);\n }\n\n /** Prepares each char before mask processing */\n doPrepareChar(str, flags) {\n if (flags === void 0) {\n flags = {};\n }\n return ChangeDetails.normalize(this.prepareChar ? this.prepareChar(str, this, flags) : str);\n }\n\n /** Validates if value is acceptable */\n doValidate(flags) {\n return (!this.validate || this.validate(this.value, this, flags)) && (!this.parent || this.parent.doValidate(flags));\n }\n\n /** Does additional processing at the end of editing */\n doCommit() {\n if (this.commit) this.commit(this.value, this);\n }\n splice(start, deleteCount, inserted, removeDirection, flags) {\n if (removeDirection === void 0) {\n removeDirection = DIRECTION.NONE;\n }\n if (flags === void 0) {\n flags = {\n input: true\n };\n }\n const tailPos = start + deleteCount;\n const tail = this.extractTail(tailPos);\n const eagerRemove = this.eager === true || this.eager === 'remove';\n let oldRawValue;\n if (eagerRemove) {\n removeDirection = forceDirection(removeDirection);\n oldRawValue = this.extractInput(0, tailPos, {\n raw: true\n });\n }\n let startChangePos = start;\n const details = new ChangeDetails();\n\n // if it is just deletion without insertion\n if (removeDirection !== DIRECTION.NONE) {\n startChangePos = this.nearestInputPos(start, deleteCount > 1 && start !== 0 && !eagerRemove ? DIRECTION.NONE : removeDirection);\n\n // adjust tailShift if start was aligned\n details.tailShift = startChangePos - start;\n }\n details.aggregate(this.remove(startChangePos));\n if (eagerRemove && removeDirection !== DIRECTION.NONE && oldRawValue === this.rawInputValue) {\n if (removeDirection === DIRECTION.FORCE_LEFT) {\n let valLength;\n while (oldRawValue === this.rawInputValue && (valLength = this.displayValue.length)) {\n details.aggregate(new ChangeDetails({\n tailShift: -1\n })).aggregate(this.remove(valLength - 1));\n }\n } else if (removeDirection === DIRECTION.FORCE_RIGHT) {\n tail.unshift();\n }\n }\n return details.aggregate(this.append(inserted, flags, tail));\n }\n maskEquals(mask) {\n return this.mask === mask;\n }\n typedValueEquals(value) {\n const tval = this.typedValue;\n return value === tval || Masked.EMPTY_VALUES.includes(value) && Masked.EMPTY_VALUES.includes(tval) || (this.format ? this.format(value, this) === this.format(this.typedValue, this) : false);\n }\n}\nMasked.DEFAULTS = {\n skipInvalid: true\n};\nMasked.EMPTY_VALUES = [undefined, null, ''];\nIMask.Masked = Masked;\n\nexport { Masked as default };\n","import { isString, isObject, pick } from '../core/utils.js';\nimport IMask from '../core/holder.js';\n\n// TODO can't use overloads here because of https://github.com/microsoft/TypeScript/issues/50754\n// export function maskedClass(mask: string): typeof MaskedPattern;\n// export function maskedClass(mask: DateConstructor): typeof MaskedDate;\n// export function maskedClass(mask: NumberConstructor): typeof MaskedNumber;\n// export function maskedClass(mask: Array | ArrayConstructor): typeof MaskedDynamic;\n// export function maskedClass(mask: MaskedDate): typeof MaskedDate;\n// export function maskedClass(mask: MaskedNumber): typeof MaskedNumber;\n// export function maskedClass(mask: MaskedEnum): typeof MaskedEnum;\n// export function maskedClass(mask: MaskedRange): typeof MaskedRange;\n// export function maskedClass(mask: MaskedRegExp): typeof MaskedRegExp;\n// export function maskedClass(mask: MaskedFunction): typeof MaskedFunction;\n// export function maskedClass(mask: MaskedPattern): typeof MaskedPattern;\n// export function maskedClass(mask: MaskedDynamic): typeof MaskedDynamic;\n// export function maskedClass(mask: Masked): typeof Masked;\n// export function maskedClass(mask: typeof Masked): typeof Masked;\n// export function maskedClass(mask: typeof MaskedDate): typeof MaskedDate;\n// export function maskedClass(mask: typeof MaskedNumber): typeof MaskedNumber;\n// export function maskedClass(mask: typeof MaskedEnum): typeof MaskedEnum;\n// export function maskedClass(mask: typeof MaskedRange): typeof MaskedRange;\n// export function maskedClass(mask: typeof MaskedRegExp): typeof MaskedRegExp;\n// export function maskedClass(mask: typeof MaskedFunction): typeof MaskedFunction;\n// export function maskedClass(mask: typeof MaskedPattern): typeof MaskedPattern;\n// export function maskedClass(mask: typeof MaskedDynamic): typeof MaskedDynamic;\n// export function maskedClass (mask: Mask): Mask;\n// export function maskedClass(mask: RegExp): typeof MaskedRegExp;\n// export function maskedClass(mask: (value: string, ...args: any[]) => boolean): typeof MaskedFunction;\n/** Get Masked class by mask type */\nfunction maskedClass(mask) /* TODO */{\n if (mask == null) throw new Error('mask property should be defined');\n if (mask instanceof RegExp) return IMask.MaskedRegExp;\n if (isString(mask)) return IMask.MaskedPattern;\n if (mask === Date) return IMask.MaskedDate;\n if (mask === Number) return IMask.MaskedNumber;\n if (Array.isArray(mask) || mask === Array) return IMask.MaskedDynamic;\n if (IMask.Masked && mask.prototype instanceof IMask.Masked) return mask;\n if (IMask.Masked && mask instanceof IMask.Masked) return mask.constructor;\n if (mask instanceof Function) return IMask.MaskedFunction;\n console.warn('Mask not found for mask', mask); // eslint-disable-line no-console\n return IMask.Masked;\n}\nfunction normalizeOpts(opts) {\n if (!opts) throw new Error('Options in not defined');\n if (IMask.Masked) {\n if (opts.prototype instanceof IMask.Masked) return {\n mask: opts\n };\n\n /*\n handle cases like:\n 1) opts = Masked\n 2) opts = { mask: Masked, ...instanceOpts }\n */\n const {\n mask = undefined,\n ...instanceOpts\n } = opts instanceof IMask.Masked ? {\n mask: opts\n } : isObject(opts) && opts.mask instanceof IMask.Masked ? opts : {};\n if (mask) {\n const _mask = mask.mask;\n return {\n ...pick(mask, (_, k) => !k.startsWith('_')),\n mask: mask.constructor,\n _mask,\n ...instanceOpts\n };\n }\n }\n if (!isObject(opts)) return {\n mask: opts\n };\n return {\n ...opts\n };\n}\n\n// TODO can't use overloads here because of https://github.com/microsoft/TypeScript/issues/50754\n\n// From masked\n// export default function createMask (opts: Opts): ReturnMasked;\n// // From masked class\n// export default function createMask, ReturnMasked extends Masked=InstanceType> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedDate=MaskedDate> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedNumber=MaskedNumber> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedEnum=MaskedEnum> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedRange=MaskedRange> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedRegExp=MaskedRegExp> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedFunction=MaskedFunction> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedPattern=MaskedPattern> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedDynamic=MaskedDynamic> (opts: Opts): ReturnMasked;\n// // From mask opts\n// export default function createMask, ReturnMasked=Opts extends MaskedOptions ? M : never> (opts: Opts): ReturnMasked;\n// export default function createMask> (opts: Opts): ReturnMasked;\n// export default function createMask> (opts: Opts): ReturnMasked;\n// export default function createMask> (opts: Opts): ReturnMasked;\n// export default function createMask> (opts: Opts): ReturnMasked;\n// export default function createMask> (opts: Opts): ReturnMasked;\n// export default function createMask> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedRegExp=MaskedRegExp> (opts: Opts): ReturnMasked;\n// export default function createMask, ReturnMasked extends MaskedFunction=MaskedFunction> (opts: Opts): ReturnMasked;\n\n/** Creates new {@link Masked} depending on mask type */\nfunction createMask(opts) {\n if (IMask.Masked && opts instanceof IMask.Masked) return opts;\n const nOpts = normalizeOpts(opts);\n const MaskedClass = maskedClass(nOpts.mask);\n if (!MaskedClass) throw new Error('Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.');\n if (nOpts.mask === MaskedClass) delete nOpts.mask;\n if (nOpts._mask) {\n nOpts.mask = nOpts._mask;\n delete nOpts._mask;\n }\n return new MaskedClass(nOpts);\n}\nIMask.createMask = createMask;\n\nexport { createMask as default, maskedClass, normalizeOpts };\n","import { escapeRegExp, DIRECTION } from '../core/utils.js';\nimport ChangeDetails from '../core/change-details.js';\nimport Masked from './base.js';\nimport IMask from '../core/holder.js';\nimport '../core/continuous-tail-details.js';\n\n/** Number mask */\nclass MaskedNumber extends Masked {\n /** Single char */\n\n /** Single char */\n\n /** Array of single chars */\n\n /** */\n\n /** */\n\n /** Digits after point */\n\n /** Flag to remove leading and trailing zeros in the end of editing */\n\n /** Flag to pad trailing zeros after point in the end of editing */\n\n /** Enable characters overwriting */\n\n /** */\n\n /** */\n\n /** Format typed value to string */\n\n /** Parse string to get typed value */\n\n constructor(opts) {\n super({\n ...MaskedNumber.DEFAULTS,\n ...opts\n });\n }\n updateOptions(opts) {\n super.updateOptions(opts);\n }\n _update(opts) {\n super._update(opts);\n this._updateRegExps();\n }\n _updateRegExps() {\n const start = '^' + (this.allowNegative ? '[+|\\\\-]?' : '');\n const mid = '\\\\d*';\n const end = (this.scale ? \"(\" + escapeRegExp(this.radix) + \"\\\\d{0,\" + this.scale + \"})?\" : '') + '$';\n this._numberRegExp = new RegExp(start + mid + end);\n this._mapToRadixRegExp = new RegExp(\"[\" + this.mapToRadix.map(escapeRegExp).join('') + \"]\", 'g');\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(this.thousandsSeparator), 'g');\n }\n _removeThousandsSeparators(value) {\n return value.replace(this._thousandsSeparatorRegExp, '');\n }\n _insertThousandsSeparators(value) {\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\n const parts = value.split(this.radix);\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\n return parts.join(this.radix);\n }\n doPrepareChar(ch, flags) {\n if (flags === void 0) {\n flags = {};\n }\n const [prepCh, details] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && (\n /*\n radix should be mapped when\n 1) input is done from keyboard = flags.input && flags.raw\n 2) unmasked value is set = !flags.input && !flags.raw\n and should not be mapped when\n 1) value is set = flags.input && !flags.raw\n 2) raw value is set = !flags.input && flags.raw\n */\n flags.input && flags.raw || !flags.input && !flags.raw) ? ch.replace(this._mapToRadixRegExp, this.radix) : ch), flags);\n if (ch && !prepCh) details.skip = true;\n if (prepCh && !this.allowPositive && !this.value && prepCh !== '-') details.aggregate(this._appendChar('-'));\n return [prepCh, details];\n }\n _separatorsCount(to, extendOnSeparators) {\n if (extendOnSeparators === void 0) {\n extendOnSeparators = false;\n }\n let count = 0;\n for (let pos = 0; pos < to; ++pos) {\n if (this._value.indexOf(this.thousandsSeparator, pos) === pos) {\n ++count;\n if (extendOnSeparators) to += this.thousandsSeparator.length;\n }\n }\n return count;\n }\n _separatorsCountFromSlice(slice) {\n if (slice === void 0) {\n slice = this._value;\n }\n return this._separatorsCount(this._removeThousandsSeparators(slice).length, true);\n }\n extractInput(fromPos, toPos, flags) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n [fromPos, toPos] = this._adjustRangeWithSeparators(fromPos, toPos);\n return this._removeThousandsSeparators(super.extractInput(fromPos, toPos, flags));\n }\n _appendCharRaw(ch, flags) {\n if (flags === void 0) {\n flags = {};\n }\n if (!this.thousandsSeparator) return super._appendCharRaw(ch, flags);\n const prevBeforeTailValue = flags.tail && flags._beforeTailState ? flags._beforeTailState._value : this._value;\n const prevBeforeTailSeparatorsCount = this._separatorsCountFromSlice(prevBeforeTailValue);\n this._value = this._removeThousandsSeparators(this.value);\n const appendDetails = super._appendCharRaw(ch, flags);\n this._value = this._insertThousandsSeparators(this._value);\n const beforeTailValue = flags.tail && flags._beforeTailState ? flags._beforeTailState._value : this._value;\n const beforeTailSeparatorsCount = this._separatorsCountFromSlice(beforeTailValue);\n appendDetails.tailShift += (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length;\n appendDetails.skip = !appendDetails.rawInserted && ch === this.thousandsSeparator;\n return appendDetails;\n }\n _findSeparatorAround(pos) {\n if (this.thousandsSeparator) {\n const searchFrom = pos - this.thousandsSeparator.length + 1;\n const separatorPos = this.value.indexOf(this.thousandsSeparator, searchFrom);\n if (separatorPos <= pos) return separatorPos;\n }\n return -1;\n }\n _adjustRangeWithSeparators(from, to) {\n const separatorAroundFromPos = this._findSeparatorAround(from);\n if (separatorAroundFromPos >= 0) from = separatorAroundFromPos;\n const separatorAroundToPos = this._findSeparatorAround(to);\n if (separatorAroundToPos >= 0) to = separatorAroundToPos + this.thousandsSeparator.length;\n return [from, to];\n }\n remove(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n [fromPos, toPos] = this._adjustRangeWithSeparators(fromPos, toPos);\n const valueBeforePos = this.value.slice(0, fromPos);\n const valueAfterPos = this.value.slice(toPos);\n const prevBeforeTailSeparatorsCount = this._separatorsCount(valueBeforePos.length);\n this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(valueBeforePos + valueAfterPos));\n const beforeTailSeparatorsCount = this._separatorsCountFromSlice(valueBeforePos);\n return new ChangeDetails({\n tailShift: (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length\n });\n }\n nearestInputPos(cursorPos, direction) {\n if (!this.thousandsSeparator) return cursorPos;\n switch (direction) {\n case DIRECTION.NONE:\n case DIRECTION.LEFT:\n case DIRECTION.FORCE_LEFT:\n {\n const separatorAtLeftPos = this._findSeparatorAround(cursorPos - 1);\n if (separatorAtLeftPos >= 0) {\n const separatorAtLeftEndPos = separatorAtLeftPos + this.thousandsSeparator.length;\n if (cursorPos < separatorAtLeftEndPos || this.value.length <= separatorAtLeftEndPos || direction === DIRECTION.FORCE_LEFT) {\n return separatorAtLeftPos;\n }\n }\n break;\n }\n case DIRECTION.RIGHT:\n case DIRECTION.FORCE_RIGHT:\n {\n const separatorAtRightPos = this._findSeparatorAround(cursorPos);\n if (separatorAtRightPos >= 0) {\n return separatorAtRightPos + this.thousandsSeparator.length;\n }\n }\n }\n return cursorPos;\n }\n doValidate(flags) {\n // validate as string\n let valid = Boolean(this._removeThousandsSeparators(this.value).match(this._numberRegExp));\n if (valid) {\n // validate as number\n const number = this.number;\n valid = valid && !isNaN(number) && (\n // check min bound for negative values\n this.min == null || this.min >= 0 || this.min <= this.number) && (\n // check max bound for positive values\n this.max == null || this.max <= 0 || this.number <= this.max);\n }\n return valid && super.doValidate(flags);\n }\n doCommit() {\n if (this.value) {\n const number = this.number;\n let validnum = number;\n\n // check bounds\n if (this.min != null) validnum = Math.max(validnum, this.min);\n if (this.max != null) validnum = Math.min(validnum, this.max);\n if (validnum !== number) this.unmaskedValue = this.format(validnum, this);\n let formatted = this.value;\n if (this.normalizeZeros) formatted = this._normalizeZeros(formatted);\n if (this.padFractionalZeros && this.scale > 0) formatted = this._padFractionalZeros(formatted);\n this._value = formatted;\n }\n super.doCommit();\n }\n _normalizeZeros(value) {\n const parts = this._removeThousandsSeparators(value).split(this.radix);\n\n // remove leading zeros\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\n // add leading zero\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\n if (parts.length > 1) {\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\n if (!parts[1].length) parts.length = 1; // remove fractional\n }\n\n return this._insertThousandsSeparators(parts.join(this.radix));\n }\n _padFractionalZeros(value) {\n if (!value) return value;\n const parts = value.split(this.radix);\n if (parts.length < 2) parts.push('');\n parts[1] = parts[1].padEnd(this.scale, '0');\n return parts.join(this.radix);\n }\n doSkipInvalid(ch, flags, checkTail) {\n if (flags === void 0) {\n flags = {};\n }\n const dropFractional = this.scale === 0 && ch !== this.thousandsSeparator && (ch === this.radix || ch === MaskedNumber.UNMASKED_RADIX || this.mapToRadix.includes(ch));\n return super.doSkipInvalid(ch, flags, checkTail) && !dropFractional;\n }\n get unmaskedValue() {\n return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, MaskedNumber.UNMASKED_RADIX);\n }\n set unmaskedValue(unmaskedValue) {\n super.unmaskedValue = unmaskedValue;\n }\n get typedValue() {\n return this.parse(this.unmaskedValue, this);\n }\n set typedValue(n) {\n this.rawInputValue = this.format(n, this).replace(MaskedNumber.UNMASKED_RADIX, this.radix);\n }\n\n /** Parsed Number */\n get number() {\n return this.typedValue;\n }\n set number(number) {\n this.typedValue = number;\n }\n\n /**\n Is negative allowed\n */\n get allowNegative() {\n return this.min != null && this.min < 0 || this.max != null && this.max < 0;\n }\n\n /**\n Is positive allowed\n */\n get allowPositive() {\n return this.min != null && this.min > 0 || this.max != null && this.max > 0;\n }\n typedValueEquals(value) {\n // handle 0 -> '' case (typed = 0 even if value = '')\n // for details see https://github.com/uNmAnNeR/imaskjs/issues/134\n return (super.typedValueEquals(value) || MaskedNumber.EMPTY_VALUES.includes(value) && MaskedNumber.EMPTY_VALUES.includes(this.typedValue)) && !(value === 0 && this.value === '');\n }\n}\nMaskedNumber.UNMASKED_RADIX = '.';\nMaskedNumber.EMPTY_VALUES = [...Masked.EMPTY_VALUES, 0];\nMaskedNumber.DEFAULTS = {\n mask: Number,\n radix: ',',\n thousandsSeparator: '',\n mapToRadix: [MaskedNumber.UNMASKED_RADIX],\n min: Number.MIN_SAFE_INTEGER,\n max: Number.MAX_SAFE_INTEGER,\n scale: 2,\n normalizeZeros: true,\n padFractionalZeros: false,\n parse: Number,\n format: n => n.toLocaleString('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20\n })\n};\nIMask.MaskedNumber = MaskedNumber;\n\nexport { MaskedNumber as default };\n","import ChangeDetails from '../../core/change-details.js';\nimport { isString } from '../../core/utils.js';\nimport ContinuousTailDetails from '../../core/continuous-tail-details.js';\nimport IMask from '../../core/holder.js';\n\nclass ChunksTailDetails {\n /** */\n\n constructor(chunks, from) {\n if (chunks === void 0) {\n chunks = [];\n }\n if (from === void 0) {\n from = 0;\n }\n this.chunks = chunks;\n this.from = from;\n }\n toString() {\n return this.chunks.map(String).join('');\n }\n extend(tailChunk) {\n if (!String(tailChunk)) return;\n tailChunk = isString(tailChunk) ? new ContinuousTailDetails(String(tailChunk)) : tailChunk;\n const lastChunk = this.chunks[this.chunks.length - 1];\n const extendLast = lastChunk && (\n // if stops are same or tail has no stop\n lastChunk.stop === tailChunk.stop || tailChunk.stop == null) &&\n // if tail chunk goes just after last chunk\n tailChunk.from === lastChunk.from + lastChunk.toString().length;\n if (tailChunk instanceof ContinuousTailDetails) {\n // check the ability to extend previous chunk\n if (extendLast) {\n // extend previous chunk\n lastChunk.extend(tailChunk.toString());\n } else {\n // append new chunk\n this.chunks.push(tailChunk);\n }\n } else if (tailChunk instanceof ChunksTailDetails) {\n if (tailChunk.stop == null) {\n // unwrap floating chunks to parent, keeping `from` pos\n let firstTailChunk;\n while (tailChunk.chunks.length && tailChunk.chunks[0].stop == null) {\n firstTailChunk = tailChunk.chunks.shift(); // not possible to be `undefined` because length was checked above\n firstTailChunk.from += tailChunk.from;\n this.extend(firstTailChunk);\n }\n }\n\n // if tail chunk still has value\n if (tailChunk.toString()) {\n // if chunks contains stops, then popup stop to container\n tailChunk.stop = tailChunk.blockIndex;\n this.chunks.push(tailChunk);\n }\n }\n }\n appendTo(masked) {\n if (!(masked instanceof IMask.MaskedPattern)) {\n const tail = new ContinuousTailDetails(this.toString());\n return tail.appendTo(masked);\n }\n const details = new ChangeDetails();\n for (let ci = 0; ci < this.chunks.length && !details.skip; ++ci) {\n const chunk = this.chunks[ci];\n const lastBlockIter = masked._mapPosToBlock(masked.displayValue.length);\n const stop = chunk.stop;\n let chunkBlock;\n if (stop != null && (\n // if block not found or stop is behind lastBlock\n !lastBlockIter || lastBlockIter.index <= stop)) {\n if (chunk instanceof ChunksTailDetails ||\n // for continuous block also check if stop is exist\n masked._stops.indexOf(stop) >= 0) {\n const phDetails = masked._appendPlaceholder(stop);\n details.aggregate(phDetails);\n }\n chunkBlock = chunk instanceof ChunksTailDetails && masked._blocks[stop];\n }\n if (chunkBlock) {\n const tailDetails = chunkBlock.appendTail(chunk);\n tailDetails.skip = false; // always ignore skip, it will be set on last\n details.aggregate(tailDetails);\n masked._value += tailDetails.inserted;\n\n // get not inserted chars\n const remainChars = chunk.toString().slice(tailDetails.rawInserted.length);\n if (remainChars) details.aggregate(masked.append(remainChars, {\n tail: true\n }));\n } else {\n details.aggregate(masked.append(chunk.toString(), {\n tail: true\n }));\n }\n }\n return details;\n }\n get state() {\n return {\n chunks: this.chunks.map(c => c.state),\n from: this.from,\n stop: this.stop,\n blockIndex: this.blockIndex\n };\n }\n set state(state) {\n const {\n chunks,\n ...props\n } = state;\n Object.assign(this, props);\n this.chunks = chunks.map(cstate => {\n const chunk = \"chunks\" in cstate ? new ChunksTailDetails() : new ContinuousTailDetails();\n chunk.state = cstate;\n return chunk;\n });\n }\n unshift(beforePos) {\n if (!this.chunks.length || beforePos != null && this.from >= beforePos) return '';\n const chunkShiftPos = beforePos != null ? beforePos - this.from : beforePos;\n let ci = 0;\n while (ci < this.chunks.length) {\n const chunk = this.chunks[ci];\n const shiftChar = chunk.unshift(chunkShiftPos);\n if (chunk.toString()) {\n // chunk still contains value\n // but not shifted - means no more available chars to shift\n if (!shiftChar) break;\n ++ci;\n } else {\n // clean if chunk has no value\n this.chunks.splice(ci, 1);\n }\n if (shiftChar) return shiftChar;\n }\n return '';\n }\n shift() {\n if (!this.chunks.length) return '';\n let ci = this.chunks.length - 1;\n while (0 <= ci) {\n const chunk = this.chunks[ci];\n const shiftChar = chunk.shift();\n if (chunk.toString()) {\n // chunk still contains value\n // but not shifted - means no more available chars to shift\n if (!shiftChar) break;\n --ci;\n } else {\n // clean if chunk has no value\n this.chunks.splice(ci, 1);\n }\n if (shiftChar) return shiftChar;\n }\n return '';\n }\n}\n\nexport { ChunksTailDetails as default };\n","import { DIRECTION } from '../../core/utils.js';\n\nclass PatternCursor {\n constructor(masked, pos) {\n this.masked = masked;\n this._log = [];\n const {\n offset,\n index\n } = masked._mapPosToBlock(pos) || (pos < 0 ?\n // first\n {\n index: 0,\n offset: 0\n } :\n // last\n {\n index: this.masked._blocks.length,\n offset: 0\n });\n this.offset = offset;\n this.index = index;\n this.ok = false;\n }\n get block() {\n return this.masked._blocks[this.index];\n }\n get pos() {\n return this.masked._blockStartPos(this.index) + this.offset;\n }\n get state() {\n return {\n index: this.index,\n offset: this.offset,\n ok: this.ok\n };\n }\n set state(s) {\n Object.assign(this, s);\n }\n pushState() {\n this._log.push(this.state);\n }\n popState() {\n const s = this._log.pop();\n if (s) this.state = s;\n return s;\n }\n bindBlock() {\n if (this.block) return;\n if (this.index < 0) {\n this.index = 0;\n this.offset = 0;\n }\n if (this.index >= this.masked._blocks.length) {\n this.index = this.masked._blocks.length - 1;\n this.offset = this.block.displayValue.length; // TODO this is stupid type error, `block` depends on index that was changed above\n }\n }\n\n _pushLeft(fn) {\n this.pushState();\n for (this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((_this$block = this.block) == null ? void 0 : _this$block.displayValue.length) || 0) {\n var _this$block;\n if (fn()) return this.ok = true;\n }\n return this.ok = false;\n }\n _pushRight(fn) {\n this.pushState();\n for (this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0) {\n if (fn()) return this.ok = true;\n }\n return this.ok = false;\n }\n pushLeftBeforeFilled() {\n return this._pushLeft(() => {\n if (this.block.isFixed || !this.block.value) return;\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.FORCE_LEFT);\n if (this.offset !== 0) return true;\n });\n }\n pushLeftBeforeInput() {\n // cases:\n // filled input: 00|\n // optional empty input: 00[]|\n // nested block: XX<[]>|\n return this._pushLeft(() => {\n if (this.block.isFixed) return;\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.LEFT);\n return true;\n });\n }\n pushLeftBeforeRequired() {\n return this._pushLeft(() => {\n if (this.block.isFixed || this.block.isOptional && !this.block.value) return;\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.LEFT);\n return true;\n });\n }\n pushRightBeforeFilled() {\n return this._pushRight(() => {\n if (this.block.isFixed || !this.block.value) return;\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.FORCE_RIGHT);\n if (this.offset !== this.block.value.length) return true;\n });\n }\n pushRightBeforeInput() {\n return this._pushRight(() => {\n if (this.block.isFixed) return;\n\n // const o = this.offset;\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.NONE);\n // HACK cases like (STILL DOES NOT WORK FOR NESTED)\n // aa|X\n // aaX_ - this will not work\n // if (o && o === this.offset && this.block instanceof PatternInputDefinition) continue;\n return true;\n });\n }\n pushRightBeforeRequired() {\n return this._pushRight(() => {\n if (this.block.isFixed || this.block.isOptional && !this.block.value) return;\n\n // TODO check |[*]XX_\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.NONE);\n return true;\n });\n }\n}\n\nexport { PatternCursor as default };\n","import ChangeDetails from '../../core/change-details.js';\nimport { DIRECTION, isString } from '../../core/utils.js';\nimport ContinuousTailDetails from '../../core/continuous-tail-details.js';\nimport '../../core/holder.js';\n\nclass PatternFixedDefinition {\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n constructor(opts) {\n Object.assign(this, opts);\n this._value = '';\n this.isFixed = true;\n }\n get value() {\n return this._value;\n }\n get unmaskedValue() {\n return this.isUnmasking ? this.value : '';\n }\n get rawInputValue() {\n return this._isRawInput ? this.value : '';\n }\n get displayValue() {\n return this.value;\n }\n reset() {\n this._isRawInput = false;\n this._value = '';\n }\n remove(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this._value.length;\n }\n this._value = this._value.slice(0, fromPos) + this._value.slice(toPos);\n if (!this._value) this._isRawInput = false;\n return new ChangeDetails();\n }\n nearestInputPos(cursorPos, direction) {\n if (direction === void 0) {\n direction = DIRECTION.NONE;\n }\n const minPos = 0;\n const maxPos = this._value.length;\n switch (direction) {\n case DIRECTION.LEFT:\n case DIRECTION.FORCE_LEFT:\n return minPos;\n case DIRECTION.NONE:\n case DIRECTION.RIGHT:\n case DIRECTION.FORCE_RIGHT:\n default:\n return maxPos;\n }\n }\n totalInputPositions(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this._value.length;\n }\n return this._isRawInput ? toPos - fromPos : 0;\n }\n extractInput(fromPos, toPos, flags) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this._value.length;\n }\n if (flags === void 0) {\n flags = {};\n }\n return flags.raw && this._isRawInput && this._value.slice(fromPos, toPos) || '';\n }\n get isComplete() {\n return true;\n }\n get isFilled() {\n return Boolean(this._value);\n }\n _appendChar(ch, flags) {\n if (flags === void 0) {\n flags = {};\n }\n const details = new ChangeDetails();\n if (this.isFilled) return details;\n const appendEager = this.eager === true || this.eager === 'append';\n const appended = this.char === ch;\n const isResolved = appended && (this.isUnmasking || flags.input || flags.raw) && (!flags.raw || !appendEager) && !flags.tail;\n if (isResolved) details.rawInserted = this.char;\n this._value = details.inserted = this.char;\n this._isRawInput = isResolved && (flags.raw || flags.input);\n return details;\n }\n _appendEager() {\n return this._appendChar(this.char, {\n tail: true\n });\n }\n _appendPlaceholder() {\n const details = new ChangeDetails();\n if (this.isFilled) return details;\n this._value = details.inserted = this.char;\n return details;\n }\n extractTail() {\n return new ContinuousTailDetails('');\n }\n appendTail(tail) {\n if (isString(tail)) tail = new ContinuousTailDetails(String(tail));\n return tail.appendTo(this);\n }\n append(str, flags, tail) {\n const details = this._appendChar(str[0], flags);\n if (tail != null) {\n details.tailShift += this.appendTail(tail).tailShift;\n }\n return details;\n }\n doCommit() {}\n get state() {\n return {\n _value: this._value,\n _rawInputValue: this.rawInputValue\n };\n }\n set state(state) {\n this._value = state._value;\n this._isRawInput = Boolean(state._rawInputValue);\n }\n}\n\nexport { PatternFixedDefinition as default };\n","import createMask from '../factory.js';\nimport ChangeDetails from '../../core/change-details.js';\nimport { DIRECTION } from '../../core/utils.js';\nimport '../../core/holder.js';\n\nclass PatternInputDefinition {\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n /** */\n\n constructor(opts) {\n const {\n parent,\n isOptional,\n placeholderChar,\n displayChar,\n lazy,\n eager,\n ...maskOpts\n } = opts;\n this.masked = createMask(maskOpts);\n Object.assign(this, {\n parent,\n isOptional,\n placeholderChar,\n displayChar,\n lazy,\n eager\n });\n }\n reset() {\n this.isFilled = false;\n this.masked.reset();\n }\n remove(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.value.length;\n }\n if (fromPos === 0 && toPos >= 1) {\n this.isFilled = false;\n return this.masked.remove(fromPos, toPos);\n }\n return new ChangeDetails();\n }\n get value() {\n return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : '');\n }\n get unmaskedValue() {\n return this.masked.unmaskedValue;\n }\n get rawInputValue() {\n return this.masked.rawInputValue;\n }\n get displayValue() {\n return this.masked.value && this.displayChar || this.value;\n }\n get isComplete() {\n return Boolean(this.masked.value) || this.isOptional;\n }\n _appendChar(ch, flags) {\n if (flags === void 0) {\n flags = {};\n }\n if (this.isFilled) return new ChangeDetails();\n const state = this.masked.state;\n // simulate input\n const details = this.masked._appendChar(ch, this.currentMaskFlags(flags));\n if (details.inserted && this.doValidate(flags) === false) {\n details.inserted = details.rawInserted = '';\n this.masked.state = state;\n }\n if (!details.inserted && !this.isOptional && !this.lazy && !flags.input) {\n details.inserted = this.placeholderChar;\n }\n details.skip = !details.inserted && !this.isOptional;\n this.isFilled = Boolean(details.inserted);\n return details;\n }\n append(str, flags, tail) {\n // TODO probably should be done via _appendChar\n return this.masked.append(str, this.currentMaskFlags(flags), tail);\n }\n _appendPlaceholder() {\n const details = new ChangeDetails();\n if (this.isFilled || this.isOptional) return details;\n this.isFilled = true;\n details.inserted = this.placeholderChar;\n return details;\n }\n _appendEager() {\n return new ChangeDetails();\n }\n extractTail(fromPos, toPos) {\n return this.masked.extractTail(fromPos, toPos);\n }\n appendTail(tail) {\n return this.masked.appendTail(tail);\n }\n extractInput(fromPos, toPos, flags) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.value.length;\n }\n return this.masked.extractInput(fromPos, toPos, flags);\n }\n nearestInputPos(cursorPos, direction) {\n if (direction === void 0) {\n direction = DIRECTION.NONE;\n }\n const minPos = 0;\n const maxPos = this.value.length;\n const boundPos = Math.min(Math.max(cursorPos, minPos), maxPos);\n switch (direction) {\n case DIRECTION.LEFT:\n case DIRECTION.FORCE_LEFT:\n return this.isComplete ? boundPos : minPos;\n case DIRECTION.RIGHT:\n case DIRECTION.FORCE_RIGHT:\n return this.isComplete ? boundPos : maxPos;\n case DIRECTION.NONE:\n default:\n return boundPos;\n }\n }\n totalInputPositions(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.value.length;\n }\n return this.value.slice(fromPos, toPos).length;\n }\n doValidate(flags) {\n return this.masked.doValidate(this.currentMaskFlags(flags)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(flags)));\n }\n doCommit() {\n this.masked.doCommit();\n }\n get state() {\n return {\n _value: this.value,\n _rawInputValue: this.rawInputValue,\n masked: this.masked.state,\n isFilled: this.isFilled\n };\n }\n set state(state) {\n this.masked.state = state.masked;\n this.isFilled = state.isFilled;\n }\n currentMaskFlags(flags) {\n var _flags$_beforeTailSta;\n return {\n ...flags,\n _beforeTailState: (flags == null || (_flags$_beforeTailSta = flags._beforeTailState) == null ? void 0 : _flags$_beforeTailSta.masked) || (flags == null ? void 0 : flags._beforeTailState)\n };\n }\n}\nPatternInputDefinition.DEFAULT_DEFINITIONS = {\n '0': /\\d/,\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/,\n // http://stackoverflow.com/a/22075070\n '*': /./\n};\n\nexport { PatternInputDefinition as default };\n","import Masked from './base.js';\nimport IMask from '../core/holder.js';\nimport '../core/change-details.js';\nimport '../core/continuous-tail-details.js';\nimport '../core/utils.js';\n\n/** Masking by RegExp */\nclass MaskedRegExp extends Masked {\n /** */\n\n /** Enable characters overwriting */\n\n /** */\n\n /** */\n\n updateOptions(opts) {\n super.updateOptions(opts);\n }\n _update(opts) {\n const mask = opts.mask;\n if (mask) opts.validate = value => value.search(mask) >= 0;\n super._update(opts);\n }\n}\nIMask.MaskedRegExp = MaskedRegExp;\n\nexport { MaskedRegExp as default };\n","import ChangeDetails from '../core/change-details.js';\nimport IMask from '../core/holder.js';\nimport { DIRECTION } from '../core/utils.js';\nimport Masked from './base.js';\nimport createMask, { normalizeOpts } from './factory.js';\nimport ChunksTailDetails from './pattern/chunk-tail-details.js';\nimport PatternCursor from './pattern/cursor.js';\nimport PatternFixedDefinition from './pattern/fixed-definition.js';\nimport PatternInputDefinition from './pattern/input-definition.js';\nimport './regexp.js';\nimport '../core/continuous-tail-details.js';\n\n/** Pattern mask */\nclass MaskedPattern extends Masked {\n /** */\n\n /** */\n\n /** Single char for empty input */\n\n /** Single char for filled input */\n\n /** Show placeholder only when needed */\n\n /** Enable characters overwriting */\n\n /** */\n\n /** */\n\n constructor(opts) {\n super({\n ...MaskedPattern.DEFAULTS,\n ...opts,\n definitions: Object.assign({}, PatternInputDefinition.DEFAULT_DEFINITIONS, opts == null ? void 0 : opts.definitions)\n });\n }\n updateOptions(opts) {\n super.updateOptions(opts);\n }\n _update(opts) {\n opts.definitions = Object.assign({}, this.definitions, opts.definitions);\n super._update(opts);\n this._rebuildMask();\n }\n _rebuildMask() {\n const defs = this.definitions;\n this._blocks = [];\n this.exposeBlock = undefined;\n this._stops = [];\n this._maskedBlocks = {};\n const pattern = this.mask;\n if (!pattern || !defs) return;\n let unmaskingBlock = false;\n let optionalBlock = false;\n for (let i = 0; i < pattern.length; ++i) {\n if (this.blocks) {\n const p = pattern.slice(i);\n const bNames = Object.keys(this.blocks).filter(bName => p.indexOf(bName) === 0);\n // order by key length\n bNames.sort((a, b) => b.length - a.length);\n // use block name with max length\n const bName = bNames[0];\n if (bName) {\n const {\n expose,\n ...blockOpts\n } = normalizeOpts(this.blocks[bName]);\n const maskedBlock = createMask({\n lazy: this.lazy,\n eager: this.eager,\n placeholderChar: this.placeholderChar,\n displayChar: this.displayChar,\n overwrite: this.overwrite,\n ...blockOpts,\n parent: this\n });\n if (maskedBlock) {\n this._blocks.push(maskedBlock);\n if (expose) this.exposeBlock = maskedBlock;\n\n // store block index\n if (!this._maskedBlocks[bName]) this._maskedBlocks[bName] = [];\n this._maskedBlocks[bName].push(this._blocks.length - 1);\n }\n i += bName.length - 1;\n continue;\n }\n }\n let char = pattern[i];\n let isInput = (char in defs);\n if (char === MaskedPattern.STOP_CHAR) {\n this._stops.push(this._blocks.length);\n continue;\n }\n if (char === '{' || char === '}') {\n unmaskingBlock = !unmaskingBlock;\n continue;\n }\n if (char === '[' || char === ']') {\n optionalBlock = !optionalBlock;\n continue;\n }\n if (char === MaskedPattern.ESCAPE_CHAR) {\n ++i;\n char = pattern[i];\n if (!char) break;\n isInput = false;\n }\n const def = isInput ? new PatternInputDefinition({\n isOptional: optionalBlock,\n lazy: this.lazy,\n eager: this.eager,\n placeholderChar: this.placeholderChar,\n displayChar: this.displayChar,\n ...normalizeOpts(defs[char]),\n parent: this\n }) : new PatternFixedDefinition({\n char,\n eager: this.eager,\n isUnmasking: unmaskingBlock\n });\n this._blocks.push(def);\n }\n }\n get state() {\n return {\n ...super.state,\n _blocks: this._blocks.map(b => b.state)\n };\n }\n set state(state) {\n const {\n _blocks,\n ...maskedState\n } = state;\n this._blocks.forEach((b, bi) => b.state = _blocks[bi]);\n super.state = maskedState;\n }\n reset() {\n super.reset();\n this._blocks.forEach(b => b.reset());\n }\n get isComplete() {\n return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every(b => b.isComplete);\n }\n get isFilled() {\n return this._blocks.every(b => b.isFilled);\n }\n get isFixed() {\n return this._blocks.every(b => b.isFixed);\n }\n get isOptional() {\n return this._blocks.every(b => b.isOptional);\n }\n doCommit() {\n this._blocks.forEach(b => b.doCommit());\n super.doCommit();\n }\n get unmaskedValue() {\n return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((str, b) => str += b.unmaskedValue, '');\n }\n set unmaskedValue(unmaskedValue) {\n if (this.exposeBlock) {\n const tail = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);\n this.exposeBlock.unmaskedValue = unmaskedValue;\n this.appendTail(tail);\n this.doCommit();\n } else super.unmaskedValue = unmaskedValue;\n }\n get value() {\n return this.exposeBlock ? this.exposeBlock.value :\n // TODO return _value when not in change?\n this._blocks.reduce((str, b) => str += b.value, '');\n }\n set value(value) {\n if (this.exposeBlock) {\n const tail = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);\n this.exposeBlock.value = value;\n this.appendTail(tail);\n this.doCommit();\n } else super.value = value;\n }\n get typedValue() {\n return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;\n }\n set typedValue(value) {\n if (this.exposeBlock) {\n const tail = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);\n this.exposeBlock.typedValue = value;\n this.appendTail(tail);\n this.doCommit();\n } else super.typedValue = value;\n }\n get displayValue() {\n return this._blocks.reduce((str, b) => str += b.displayValue, '');\n }\n appendTail(tail) {\n return super.appendTail(tail).aggregate(this._appendPlaceholder());\n }\n _appendEager() {\n var _this$_mapPosToBlock;\n const details = new ChangeDetails();\n let startBlockIndex = (_this$_mapPosToBlock = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : _this$_mapPosToBlock.index;\n if (startBlockIndex == null) return details;\n\n // TODO test if it works for nested pattern masks\n if (this._blocks[startBlockIndex].isFilled) ++startBlockIndex;\n for (let bi = startBlockIndex; bi < this._blocks.length; ++bi) {\n const d = this._blocks[bi]._appendEager();\n if (!d.inserted) break;\n details.aggregate(d);\n }\n return details;\n }\n _appendCharRaw(ch, flags) {\n if (flags === void 0) {\n flags = {};\n }\n const blockIter = this._mapPosToBlock(this.displayValue.length);\n const details = new ChangeDetails();\n if (!blockIter) return details;\n for (let bi = blockIter.index;; ++bi) {\n var _flags$_beforeTailSta;\n const block = this._blocks[bi];\n if (!block) break;\n const blockDetails = block._appendChar(ch, {\n ...flags,\n _beforeTailState: (_flags$_beforeTailSta = flags._beforeTailState) == null || (_flags$_beforeTailSta = _flags$_beforeTailSta._blocks) == null ? void 0 : _flags$_beforeTailSta[bi]\n });\n const skip = blockDetails.skip;\n details.aggregate(blockDetails);\n if (skip || blockDetails.rawInserted) break; // go next char\n }\n\n return details;\n }\n extractTail(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n const chunkTail = new ChunksTailDetails();\n if (fromPos === toPos) return chunkTail;\n this._forEachBlocksInRange(fromPos, toPos, (b, bi, bFromPos, bToPos) => {\n const blockChunk = b.extractTail(bFromPos, bToPos);\n blockChunk.stop = this._findStopBefore(bi);\n blockChunk.from = this._blockStartPos(bi);\n if (blockChunk instanceof ChunksTailDetails) blockChunk.blockIndex = bi;\n chunkTail.extend(blockChunk);\n });\n return chunkTail;\n }\n extractInput(fromPos, toPos, flags) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n if (flags === void 0) {\n flags = {};\n }\n if (fromPos === toPos) return '';\n let input = '';\n this._forEachBlocksInRange(fromPos, toPos, (b, _, fromPos, toPos) => {\n input += b.extractInput(fromPos, toPos, flags);\n });\n return input;\n }\n _findStopBefore(blockIndex) {\n let stopBefore;\n for (let si = 0; si < this._stops.length; ++si) {\n const stop = this._stops[si];\n if (stop <= blockIndex) stopBefore = stop;else break;\n }\n return stopBefore;\n }\n\n /** Appends placeholder depending on laziness */\n _appendPlaceholder(toBlockIndex) {\n const details = new ChangeDetails();\n if (this.lazy && toBlockIndex == null) return details;\n const startBlockIter = this._mapPosToBlock(this.displayValue.length);\n if (!startBlockIter) return details;\n const startBlockIndex = startBlockIter.index;\n const endBlockIndex = toBlockIndex != null ? toBlockIndex : this._blocks.length;\n this._blocks.slice(startBlockIndex, endBlockIndex).forEach(b => {\n if (!b.lazy || toBlockIndex != null) {\n var _blocks2;\n const bDetails = b._appendPlaceholder((_blocks2 = b._blocks) == null ? void 0 : _blocks2.length);\n this._value += bDetails.inserted;\n details.aggregate(bDetails);\n }\n });\n return details;\n }\n\n /** Finds block in pos */\n _mapPosToBlock(pos) {\n let accVal = '';\n for (let bi = 0; bi < this._blocks.length; ++bi) {\n const block = this._blocks[bi];\n const blockStartPos = accVal.length;\n accVal += block.displayValue;\n if (pos <= accVal.length) {\n return {\n index: bi,\n offset: pos - blockStartPos\n };\n }\n }\n }\n _blockStartPos(blockIndex) {\n return this._blocks.slice(0, blockIndex).reduce((pos, b) => pos += b.displayValue.length, 0);\n }\n _forEachBlocksInRange(fromPos, toPos, fn) {\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n const fromBlockIter = this._mapPosToBlock(fromPos);\n if (fromBlockIter) {\n const toBlockIter = this._mapPosToBlock(toPos);\n // process first block\n const isSameBlock = toBlockIter && fromBlockIter.index === toBlockIter.index;\n const fromBlockStartPos = fromBlockIter.offset;\n const fromBlockEndPos = toBlockIter && isSameBlock ? toBlockIter.offset : this._blocks[fromBlockIter.index].displayValue.length;\n fn(this._blocks[fromBlockIter.index], fromBlockIter.index, fromBlockStartPos, fromBlockEndPos);\n if (toBlockIter && !isSameBlock) {\n // process intermediate blocks\n for (let bi = fromBlockIter.index + 1; bi < toBlockIter.index; ++bi) {\n fn(this._blocks[bi], bi, 0, this._blocks[bi].displayValue.length);\n }\n\n // process last block\n fn(this._blocks[toBlockIter.index], toBlockIter.index, 0, toBlockIter.offset);\n }\n }\n }\n remove(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n const removeDetails = super.remove(fromPos, toPos);\n this._forEachBlocksInRange(fromPos, toPos, (b, _, bFromPos, bToPos) => {\n removeDetails.aggregate(b.remove(bFromPos, bToPos));\n });\n return removeDetails;\n }\n nearestInputPos(cursorPos, direction) {\n if (direction === void 0) {\n direction = DIRECTION.NONE;\n }\n if (!this._blocks.length) return 0;\n const cursor = new PatternCursor(this, cursorPos);\n if (direction === DIRECTION.NONE) {\n // -------------------------------------------------\n // NONE should only go out from fixed to the right!\n // -------------------------------------------------\n if (cursor.pushRightBeforeInput()) return cursor.pos;\n cursor.popState();\n if (cursor.pushLeftBeforeInput()) return cursor.pos;\n return this.displayValue.length;\n }\n\n // FORCE is only about a|* otherwise is 0\n if (direction === DIRECTION.LEFT || direction === DIRECTION.FORCE_LEFT) {\n // try to break fast when *|a\n if (direction === DIRECTION.LEFT) {\n cursor.pushRightBeforeFilled();\n if (cursor.ok && cursor.pos === cursorPos) return cursorPos;\n cursor.popState();\n }\n\n // forward flow\n cursor.pushLeftBeforeInput();\n cursor.pushLeftBeforeRequired();\n cursor.pushLeftBeforeFilled();\n\n // backward flow\n if (direction === DIRECTION.LEFT) {\n cursor.pushRightBeforeInput();\n cursor.pushRightBeforeRequired();\n if (cursor.ok && cursor.pos <= cursorPos) return cursor.pos;\n cursor.popState();\n if (cursor.ok && cursor.pos <= cursorPos) return cursor.pos;\n cursor.popState();\n }\n if (cursor.ok) return cursor.pos;\n if (direction === DIRECTION.FORCE_LEFT) return 0;\n cursor.popState();\n if (cursor.ok) return cursor.pos;\n cursor.popState();\n if (cursor.ok) return cursor.pos;\n return 0;\n }\n if (direction === DIRECTION.RIGHT || direction === DIRECTION.FORCE_RIGHT) {\n // forward flow\n cursor.pushRightBeforeInput();\n cursor.pushRightBeforeRequired();\n if (cursor.pushRightBeforeFilled()) return cursor.pos;\n if (direction === DIRECTION.FORCE_RIGHT) return this.displayValue.length;\n\n // backward flow\n cursor.popState();\n if (cursor.ok) return cursor.pos;\n cursor.popState();\n if (cursor.ok) return cursor.pos;\n return this.nearestInputPos(cursorPos, DIRECTION.LEFT);\n }\n return cursorPos;\n }\n totalInputPositions(fromPos, toPos) {\n if (fromPos === void 0) {\n fromPos = 0;\n }\n if (toPos === void 0) {\n toPos = this.displayValue.length;\n }\n let total = 0;\n this._forEachBlocksInRange(fromPos, toPos, (b, _, bFromPos, bToPos) => {\n total += b.totalInputPositions(bFromPos, bToPos);\n });\n return total;\n }\n\n /** Get block by name */\n maskedBlock(name) {\n return this.maskedBlocks(name)[0];\n }\n\n /** Get all blocks by name */\n maskedBlocks(name) {\n const indices = this._maskedBlocks[name];\n if (!indices) return [];\n return indices.map(gi => this._blocks[gi]);\n }\n}\nMaskedPattern.DEFAULTS = {\n lazy: true,\n placeholderChar: '_'\n};\nMaskedPattern.STOP_CHAR = '`';\nMaskedPattern.ESCAPE_CHAR = '\\\\';\nMaskedPattern.InputDefinition = PatternInputDefinition;\nMaskedPattern.FixedDefinition = PatternFixedDefinition;\nIMask.MaskedPattern = MaskedPattern;\n\nexport { MaskedPattern as default };\n"],"names":["obj","constructor","Object","extend","target","src","keys","forEach","key","length","ssrDocument","body","addEventListener","removeEventListener","activeElement","blur","nodeName","querySelector","querySelectorAll","getElementById","createEvent","initEvent","createElement","children","childNodes","style","setAttribute","getElementsByTagName","createElementNS","importNode","location","hash","host","hostname","href","origin","pathname","protocol","search","doc","document","ssrWindow","navigator","userAgent","history","replaceState","pushState","go","back","CustomEvent","this","getComputedStyle","getPropertyValue","Image","Date","screen","setTimeout","clearTimeout","matchMedia","requestAnimationFrame","callback","cancelAnimationFrame","id","win","window","delay","now","o","prototype","toString","call","slice","to","arguments","undefined","noExtend","i","nextSource","node","HTMLElement","nodeType","keysArray","filter","indexOf","nextIndex","len","nextKey","desc","getOwnPropertyDescriptor","enumerable","__swiper__","el","varName","varValue","setProperty","animateCSSModeScroll","_ref","swiper","targetPosition","side","startPosition","translate","time","startTime","duration","params","speed","wrapperEl","scrollSnapType","cssModeFrameID","dir","isOutOfBound","current","animate","getTime","progress","Math","max","min","easeProgress","cos","PI","currentPosition","scrollTo","overflow","slideEl","shadowRoot","element","selector","matches","tag","classes","classList","add","Array","isArray","elementStyle","prop","elementIndex","child","previousSibling","parents","parent","parentElement","push","elementOuterSize","size","includeMargins","parseFloat","offsetWidth","support","deviceCached","browser","getSupport","smoothScroll","documentElement","touch","DocumentTouch","calcSupport","eventsEmitter","on","events","handler","priority","self","eventsListeners","destroyed","method","split","event","once","onceHandler","off","__emitterProxy","_len","args","_key","apply","onAny","eventsAnyListeners","offAny","index","splice","eventHandler","emit","data","context","_len2","_key2","unshift","processLazyPreloader","imageEl","closest","isElement","slideClass","lazyEl","lazyPreloaderClass","remove","unlazy","slides","removeAttribute","preload","amount","lazyPreloadPrevNext","slidesPerView","slidesPerViewDynamic","ceil","activeIndex","grid","rows","activeColumn","preloadColumns","from","map","_","includes","column","slideIndexLastInView","rewind","loop","realIndex","update","updateSize","width","height","clientWidth","clientHeight","isHorizontal","isVertical","parseInt","Number","isNaN","assign","updateSlides","getDirectionLabel","property","getDirectionPropertyValue","label","slidesEl","swiperSize","rtlTranslate","rtl","wrongRTL","isVirtual","virtual","enabled","previousSlidesLength","slidesLength","snapGrid","slidesGrid","slidesSizesGrid","offsetBefore","slidesOffsetBefore","offsetAfter","slidesOffsetAfter","previousSnapGridLength","previousSlidesGridLength","spaceBetween","slidePosition","prevSlideSize","replace","virtualSize","marginLeft","marginRight","marginBottom","marginTop","centeredSlides","cssMode","gridEnabled","slideSize","initSlides","shouldResetSlideSize","breakpoints","slide","updateSlide","slideStyles","currentTransform","transform","currentWebKitTransform","webkitTransform","roundLengths","paddingLeft","paddingRight","boxSizing","floor","swiperSlideSize","abs","slidesPerGroup","slidesPerGroupSkip","effect","setWrapperSize","updateWrapperSize","newSlidesGrid","slidesGridItem","groups","slidesBefore","slidesAfter","groupSize","slideIndex","centeredSlidesBounds","allSlidesSize","slideSizeValue","maxSnap","snap","centerInsufficientSlides","allSlidesOffset","snapIndex","addToSnapGrid","addToSlidesGrid","v","watchOverflow","checkOverflow","watchSlidesProgress","updateSlidesOffset","backFaceHiddenClass","containerModifierClass","hasClassBackfaceClassAdded","contains","maxBackfaceHiddenSlides","updateAutoHeight","activeSlides","newHeight","setTransition","getSlideByIndex","getSlideIndexByData","visibleSlides","offsetHeight","minusOffset","offsetLeft","offsetTop","swiperSlideOffset","cssOverflowAdjustment","updateSlidesProgress","offsetCenter","slideVisibleClass","visibleSlidesIndexes","slideOffset","slideProgress","minTranslate","originalSlideProgress","slideBefore","slideAfter","originalProgress","updateProgress","multiplier","translatesDiff","maxTranslate","isBeginning","isEnd","progressLoop","wasBeginning","wasEnd","isBeginningRounded","isEndRounded","firstSlideIndex","lastSlideIndex","firstSlideTranslate","lastSlideTranslate","translateMax","translateAbs","autoHeight","updateSlidesClasses","getFilteredSlide","activeSlide","slideActiveClass","slideNextClass","slidePrevClass","nextSlide","nextEls","nextElementSibling","next","elementNextAll","prevSlide","prevEls","previousElementSibling","prev","elementPrevAll","emitSlidesClasses","updateActiveIndex","newActiveIndex","previousIndex","previousRealIndex","previousSnapIndex","getVirtualRealIndex","aIndex","normalizeSlideIndex","getActiveIndexByTranslate","skip","getAttribute","initialized","runCallbacksOnInit","updateClickedSlide","e","slideFound","clickedSlide","clickedIndex","slideToClickedSlide","transitionEmit","runCallbacks","direction","step","slideTo","internal","initial","animating","preventInteractionOnTransition","normalizedTranslate","normalizedGrid","normalizedGridNext","allowSlideNext","allowSlidePrev","setTranslate","transitionStart","transitionEnd","isH","t","_immediateVirtual","_cssModeVirtualInitialSet","initialSlide","behavior","onSlideToWrapperTransitionEnd","slideToLoop","newIndex","slideNext","perGroup","slidesPerGroupAuto","increment","loopPreventsSliding","loopFix","_clientLeft","clientLeft","slidePrev","normalize","val","normalizedSnapGrid","prevSnap","prevSnapIndex","prevIndex","lastIndex","slideReset","slideToClosest","threshold","currentSnap","slideToIndex","slideSelector","loopedSlides","getSlideIndex","loopCreate","slideRealIndex","_temp","activeSlideIndex","byController","byMousewheel","prependSlidesIndexes","appendSlidesIndexes","isNext","isPrev","slidesPrepended","slidesAppended","swiperLoopMoveDOM","prepend","append","recalcSlides","currentSlideTranslate","diff","touches","touchEventsData","currentTranslate","controller","control","loopParams","c","loopDestroy","newSlidesOrder","swiperSlideIndex","onTouchStart","evCache","simulateTouch","pointerType","originalEvent","targetEl","touchEventsTarget","which","button","isTouched","isMoved","swipingClassHasValue","noSwipingClass","eventPath","composedPath","path","noSwipingSelector","isTargetShadow","noSwiping","base","__closestFrom","assignedSlot","found","getRootNode","closestElement","allowClick","swipeHandler","currentX","pageX","currentY","pageY","startX","startY","edgeSwipeDetection","iOSEdgeSwipeDetection","edgeSwipeThreshold","iOSEdgeSwipeThreshold","innerWidth","preventDefault","allowTouchCallbacks","isScrolling","startMoving","touchStartTime","swipeDirection","allowThresholdMove","focusableElements","shouldPreventDefault","allowTouchMove","touchStartPreventDefault","touchStartForcePreventDefault","isContentEditable","freeMode","onTouchMove","pointerIndex","findIndex","cachedEv","pointerId","targetTouch","preventedByNestedSwiper","prevX","prevY","touchReleaseOnEdges","targetTouches","diffX","diffY","sqrt","touchAngle","atan2","zoom","cancelable","touchMoveStopPropagation","nested","stopPropagation","touchesDiff","previousX","previousY","oneWayMovement","touchRatio","prevTouchesDirection","touchesDirection","isLoop","startTranslate","getTranslate","evt","bubbles","dispatchEvent","allowMomentumBounce","grabCursor","setGrabCursor","loopFixed","disableParentSwiper","resistanceRatio","resistance","followFinger","onTouchEnd","type","isSafari","isWebView","touchEndTime","timeDiff","pathTree","lastClickTime","currentPos","stopIndex","rewindFirstIndex","rewindLastIndex","ratio","longSwipesMs","longSwipes","longSwipesRatio","shortSwipes","navigation","nextEl","prevEl","onResize","setBreakpoint","isVirtualLoop","autoplay","running","paused","resizeTimeout","resume","onClick","preventClicks","preventClicksPropagation","stopImmediatePropagation","onScroll","newProgress","previousTranslate","scrollLeft","scrollTop","onLoad","dummyEventAttached","dummyEventListener","device","capture","domMethod","swiperMethod","passive","updateOnWindowResize","ios","android","isGridEnabled","defaults","init","resizeObserver","createElements","url","virtualTranslate","breakpointsBase","uniqueNavElements","passiveListeners","wrapperClass","_emitClasses","moduleExtendParams","allModulesParams","moduleParamName","moduleParams","auto","prototypes","axis","matrix","curTransform","transformMatrix","curStyle","currentStyle","WebKitCSSMatrix","a","join","MozTransform","OTransform","MsTransform","msTransform","m41","m42","x","y","translateTo","translateBounds","newTranslate","onTranslateToWrapperTransitionEnd","transition","transitionDuration","moving","isLocked","__preventObserver__","cursor","unsetGrabCursor","attachEvents","bind","detachEvents","breakpoint","getBreakpoint","currentBreakpoint","breakpointParams","originalParams","wasMultiRow","isMultiRow","wasEnabled","emitContainerClasses","fill","wasModuleEnabled","isModuleEnabled","disable","enable","directionChanged","needsReLoop","changeDirection","isEnabled","containerEl","currentHeight","innerHeight","points","point","minRatio","substr","value","sort","b","wasLocked","lastSlideRightEdge","addClasses","classNames","suffixes","entries","prefix","resultClasses","item","prepareClasses","removeClasses","extendedDefaults","Swiper","swipers","newParams","overrides","platform","ua","screenWidth","screenHeight","match","ipad","ipod","iphone","windows","macos","os","calcDevice","needPerspectiveFix","toLowerCase","String","major","minor","num","test","calcBrowser","modules","__modules__","mod","extendParams","swiperParams","passedParams","eventName","velocity","trunc","clickTimeout","velocities","imagesToLoad","imagesLoaded","setProgress","cls","className","getSlideClasses","updates","view","exact","spv","breakLoop","translateValue","translated","complete","newDirection","needUpdate","currentDirection","changeLanguageDirection","mount","mounted","parentNode","getWrapperSelector","trim","slideSlots","hostEl","destroy","deleteInstance","cleanStyles","object","deleteProps","extendDefaults","newDefaults","installModule","use","module","m","checkProps","Navigation","hideOnClick","disabledClass","hiddenClass","lockClass","navigationDisabledClass","makeElementsArray","getEl","res","toggleEl","disabled","subEl","tagName","onPrevClick","onNextClick","initButton","destroyButton","_s","pagination","clickable","isHidden","toggle","classesToSelector","Pagination","pfx","bulletSize","bulletElement","renderBullet","renderProgressbar","renderFraction","renderCustom","progressbarOpposite","dynamicBullets","dynamicMainBullets","formatFractionCurrent","number","formatFractionTotal","bulletClass","bulletActiveClass","modifierClass","currentClass","totalClass","progressbarFillClass","progressbarOppositeClass","clickableClass","horizontalClass","verticalClass","paginationDisabledClass","bullets","dynamicBulletIndex","isPaginationDisabled","setSideBullets","bulletEl","position","onBulletClick","newSlideIndex","currentSlideIndex","total","firstIndex","midIndex","classesToRemove","suffix","s","flat","bullet","bulletIndex","firstDisplayedBullet","lastDisplayedBullet","dynamicBulletsLength","bulletsOffset","offsetProp","subElIndex","fractionEl","textContent","totalEl","progressbarDirection","scale","scaleX","scaleY","progressEl","innerHTML","render","paginationHTML","numberOfBullets","A11y","a11y","notificationClass","prevSlideMessage","nextSlideMessage","firstSlideMessage","lastSlideMessage","paginationBulletMessage","slideLabelMessage","containerMessage","containerRoleDescriptionMessage","itemRoleDescriptionMessage","slideRole","clicked","liveRegion","notify","message","notification","makeElFocusable","makeElNotFocusable","addElRole","role","addElRoleDescription","description","addElLabel","disableEl","enableEl","onEnterOrSpaceKey","keyCode","click","hasPagination","hasClickablePagination","initNavEl","wrapperId","controls","addElControls","handlePointerDown","handlePointerUp","handleFocus","isActive","isVisible","sourceCapabilities","firesTouchEvents","repeat","round","random","live","addElLive","updateNavigation","updatePagination","Autoplay","timeout","raf","timeLeft","waitForTransition","disableOnInteraction","stopOnLastSlide","reverseDirection","pauseOnMouseEnter","autoplayTimeLeft","wasPaused","pausedByTouch","touchStartTimeout","slideChanged","pausedByInteraction","autoplayDelayTotal","autoplayDelayCurrent","autoplayStartTime","onTransitionEnd","calcTimeLeft","run","delayForce","currentSlideDelay","activeSlideEl","getSlideDelay","proceed","start","stop","pause","reset","onVisibilityChange","visibilityState","onPointerEnter","onPointerLeave","effectParams","transformEl","backfaceVisibility","EffectFade","fadeEffect","crossFade","overwriteParams","perspective","recreateShadows","getEffectParams","requireUpdateOnVirtual","overwriteParamsResult","slideShadows","shadowEl","tx","ty","slideOpacity","opacity","transformElements","allSlides","transitionEndTarget","eventTriggered","getSlide","fireCallBack","_assertThisInitialized","ReferenceError","_inheritsLoose","subClass","superClass","create","__proto__","prototypeGroup","protoMethod","observer","animationFrame","resizeHandler","orientationChangeHandler","ResizeObserver","newWidth","_ref2","contentBoxSize","contentRect","inlineSize","blockSize","observe","unobserve","observers","attach","options","MutationObserver","WebkitMutationObserver","mutations","observerUpdate","attributes","childList","characterData","observeParents","observeSlideChildren","containerParents","disconnect","_suppressOverwrites","_reverting","_context","_globalTimeline","_win","_coreInitted","_doc","_coreReady","_lastRenderedFrame","_quickTween","_tickerActive","n","n1","easeOut","_config","autoSleep","force3D","nullTargetWarn","units","lineHeight","_defaults","overwrite","_bigNum","_tinyNum","_2PI","_HALF_PI","_gsID","_sqrt","_cos","_sin","sin","_isString","_isFunction","_isNumber","_isUndefined","_isObject","_isNotFalse","_windowExists","_isFuncOrString","_isTypedArray","ArrayBuffer","isView","_isArray","_strictNumExp","_numExp","_numWithUnitExp","_complexStringNumExp","_relExp","_delimitedValueExp","_unitExp","_globals","_installScope","_install","scope","_merge","gsap","_missingPlugin","console","warn","_warn","suppress","_addGlobal","name","_emptyFunc","_startAtRevertConfig","suppressEvents","isStart","kill","_revertConfigNoKill","_revertConfig","_reservedProps","_lazyTweens","_lazyLookup","_plugins","_effects","_nextGCFrame","_harnessPlugins","_callbackNames","_harness","targets","harnessPlugin","_gsap","harness","targetTest","GSCache","_getCache","toArray","_getProperty","_forEachName","names","func","_round","_roundPrecise","_parseRelative","operator","charAt","end","_arrayContainsAny","toSearch","toFind","l","_lazyRender","tween","_lazy","_lazySafeRender","animation","force","_initted","_startAt","_numericIfPossible","_passThrough","p","_setDefaults","toMerge","_mergeDeep","_copyExcluding","excluding","copy","_inheritDefaults","vars","excludeDuration","keyframes","inherit","_dp","_addLinkedListItem","firstProp","lastProp","sortBy","_prev","_next","_removeLinkedListItem","_removeFromParent","onlyIfParentHasAutoRemove","autoRemoveChildren","_act","_uncache","_end","_dur","_start","_dirty","_rewindStartAt","totalTime","revert","immediateRender","autoRevert","_hasNoPausedAncestors","_ts","_elapsedCycleDuration","_repeat","_animationCycle","_tTime","_rDelay","tTime","cycleDuration","whole","_parentToChildTotalTime","parentTime","totalDuration","_tDur","_setEnd","_rts","_alignPlayhead","smoothChildTiming","_time","_postAddChecks","timeline","rawTime","_clamp","_zTime","_addToTimeline","skipChecks","_parsePosition","_delay","timeScale","_sort","_isFromOrFromStart","_recent","_scrollTrigger","trigger","ScrollTrigger","_attemptInitTween","_initTween","_pt","lazy","_ticker","frame","_parentPlayheadIsBeforeStart","_lock","_setDuration","skipUncache","leavePlayhead","dur","totalProgress","_onUpdateTotalDuration","Timeline","_zeroPosition","endTime","percentAnimation","offset","isPercent","labels","recent","clippedDuration","_createTweenType","irVars","isLegacy","varsIndex","runBackwards","startAt","Tween","_conditionalReturn","getUnit","exec","_slice","_isArrayLike","nonEmpty","leaveStrings","_wake","ar","accumulator","_accumulator","_flatten","nativeElement","shuffle","distribute","each","ease","_parseEase","cache","isDecimal","ratios","ratioX","ratioY","center","edges","originX","originY","d","j","wrapAt","distances","getBoundingClientRect","left","u","_invertEase","_roundModifier","pow","raw","snapTo","radius","is2D","values","dx","dy","roundingIncrement","returnFunction","_wrapArray","wrapper","_replaceRandom","nums","mapRange","inMin","inMax","outMin","outMax","inRange","outRange","_getLabelInDirection","fromTime","backward","distance","_callback","executeLazyFirst","result","prevContext","_ctx","callbackScope","_interrupt","scrollTrigger","_registerPluginQueue","_createPlugin","config","isFunc","Plugin","_props","instanceDefaults","_renderPropTweens","_addPropTween","_killPropTweensOf","modifier","_addPluginModifier","rawVars","statics","get","getSetter","_getSetter","aliases","register","toUpperCase","PropTween","_255","_colorLookup","aqua","lime","silver","black","maroon","teal","blue","navy","white","olive","yellow","orange","gray","purple","green","red","pink","cyan","transparent","_hue","h","m1","m2","splitColor","toHSL","forceAlpha","r","g","wasHSL","_colorOrderData","_colorExp","_formatColors","orderMatchData","shell","colors","color","shift","RegExp","_hslExp","_colorStringFilter","combined","_id","_req","_raf","_self","_delta","_i","_getTime","_lagThreshold","_adjustedLag","_startTime","_lastUpdate","_gap","_nextTime","_listeners","_tick","overlap","dispatch","elapsed","manual","tick","deltaRatio","fps","wake","gsapVersions","version","GreenSockGlobals","sleep","f","lagSmoothing","adjustedLag","Infinity","_fps","prioritize","_easeMap","_customEaseExp","_quotesExp","_parseObjectInString","parsedVal","lastIndexOf","_propagateYoyoEase","isYoyo","_first","yoyoEase","_yoyo","_ease","_yEase","defaultEase","open","close","substring","_CE","_configEaseFromString","_insertEase","easeIn","easeInOut","lowercaseName","_easeInOutFromOut","_configElastic","amplitude","period","p1","p2","p3","asin","_configBack","overshoot","power","Linear","easeNone","none","SteppedEase","steps","immediateStart","set","Animation","repeatDelay","yoyo","_proto","_totalTime","_ptLookup","_pTime","iteration","_ps","_recacheAncestors","includeRepeats","wrapRepeats","prevIsReverting","globalTime","_sat","seek","restart","includeDelay","play","reversed","reverse","atTime","invalidate","eventCallback","_onUpdate","then","onFulfilled","Promise","resolve","_resolve","_then","_prom","_Animation","_this","sortChildren","_proto2","fromTo","fromVars","toVars","delayedCall","staggerTo","stagger","onCompleteAll","onCompleteAllParams","onComplete","onCompleteParams","staggerFrom","staggerFromTo","prevPaused","pauseTween","prevStart","prevIteration","prevTime","tDur","crossingStart","rewinding","doesWrap","repeatRefresh","onRepeat","_hasPause","_forcing","_last","_findNextPauseTween","onUpdate","adjustedTime","_this2","addLabel","getChildren","tweens","timelines","ignoreBeforeTime","getById","animations","removeLabel","killTweensOf","_totalTime2","addPause","removePause","props","onlyActive","getTweensOf","_overwritingTween","parsedTargets","isGlobalTime","_targets","tweenTo","initted","tl","_vars","_onStart","onStart","onStartParams","tweenFromTo","fromPosition","toPosition","nextLabel","afterTime","previousLabel","beforeTime","currentLabel","shiftChildren","adjustLabels","soft","clear","includeLabels","updateRoot","_forceAllPropTweens","_addComplexStringPropTween","setter","stringFilter","funcParam","startNums","endNum","chunk","startNum","hasRandom","pt","_renderComplexString","matchIndex","fp","optional","currentValue","parsedStart","_setterFuncWithParam","_setterFunc","_setterPlain","_renderBoolean","_renderPlain","_checkPlugin","plugin","ptLookup","_parseFuncOrString","_processVars","cleanVars","hasPriority","gsData","harnessVars","overwritten","onUpdateParams","prevStartAt","fullTargets","autoOverwrite","_overwrite","_from","_ptCache","_op","_sortPropTweensByPriority","_onInit","_parseKeyframe","allProps","easeEach","_staggerTweenProps","_staggerPropsToSkip","_Animation2","skipInherit","_this3","curTarget","staggerFunc","staggerVarsToMerge","_this3$vars","kf","_proto3","isNegative","prevRatio","_renderZeroDurationTween","resetTo","startIsRelative","rootPT","lookup","ptCache","_updatePropTweens","overwrittenProps","curLookup","curOverwriteProps","killingTargets","propTweenLookup","firstPT","a1","a2","_arraysMatch","propertyAliases","_addAliasesToVars","onReverseComplete","onReverseCompleteParams","_setterAttribute","hasNonDependentRemaining","op","dep","_setterWithModifier","mSet","mt","pt2","first","last","pr","change","renderer","TweenMax","TweenLite","TimelineLite","TimelineMax","_media","_emptyArray","_lastMediaTime","_contextID","_dispatch","_onMediaChange","anyMatch","toggled","queries","conditions","onMatch","Context","_r","isReverted","_proto5","prevSelector","ignore","getTweens","_this4","MatchMedia","contexts","_proto6","mq","active","cond","addListener","registerPlugin","getProperty","unit","uncache","getter","format","quickSetter","setters","quickTo","_merge2","isTweening","registerEffect","_ref3","plugins","extendTimeline","pluginName","registerEase","parseEase","exportRoot","includeDelayedCalls","matchMediaRefresh","utils","wrap","range","wrapYoyo","clamp","pipe","functions","reduce","unitize","interpolate","mutate","interpolators","il","isString","master","install","effects","ticker","globalTimeline","core","globals","getCache","reverting","toAdd","suppressOverwrites","_getPluginPropTween","_buildModifierPlugin","temp","modifiers","_addModifiers","Power0","Power1","Power2","Power3","Power4","Quad","Cubic","Quart","Quint","Strong","Elastic","Back","Bounce","Sine","Expo","Circ","_docElement","_pluginInitted","_tempDiv","_recentSetterPlugin","_supports3D","_transformProps","_RAD2DEG","_DEG2RAD","_atan2","_capsExp","_horizontalExp","_complexExp","_propertyAliases","autoAlpha","alpha","_renderCSSProp","_renderPropWithEnd","_renderCSSPropWithBeginning","_renderRoundedCSSProp","_renderNonTweeningValue","_renderNonTweeningValueOnlyAtEnd","_setterCSSStyle","_setterCSSProp","_setterTransform","_setterScale","_setterScaleWithRender","renderTransform","_setterTransformWithRender","_transformProp","_transformOriginProp","_saveStyle","isNotCSS","tfm","_get","svg","svgo","_removeIndependentTransforms","removeProperty","_revertStyle","_getStyleSaver","properties","saver","save","_createElement","ns","_getComputedProperty","skipPrefixFallback","cs","_checkPropPrefix","_prefixes","preferPrefix","_initCore","cssText","_getBBoxHack","swapIfPossible","bbox","ownerSVGElement","oldParent","oldSibling","nextSibling","oldCSS","appendChild","display","getBBox","_gsapBBox","insertBefore","removeChild","_getAttributeFallbacks","attributesArray","hasAttribute","_getBBox","bounds","error","_isSVG","getCTM","_removeProperty","_addNonTweeningPT","beginning","onlySetAtEnd","_nonConvertibleUnits","deg","rad","turn","_nonStandardLayouts","flex","_convertToUnit","px","isSVG","curValue","curUnit","horizontal","isRootSVG","measureProperty","toPixels","toPercent","_parseTransform","_firstTwoOnly","zOrigin","_specialProps","_tweenComplexCSSString","startValues","startValue","endValue","endUnit","startUnit","_keywordToPercent","top","bottom","right","_renderClearProps","clearTransforms","clearProps","_identity2DMatrix","_rotationalProperties","_isNullTransform","_getComputedTransformMatrixAsArray","matrixString","_getMatrix","force2D","addedToDOM","baseVal","consolidate","offsetParent","_applySVGOrigin","originIsAbsolute","smooth","matrixArray","pluginToAddPropTweensTo","determinant","xOriginOld","xOrigin","yOriginOld","yOrigin","xOffsetOld","xOffset","yOffsetOld","yOffset","originSplit","z","rotation","rotationX","rotationY","skewX","skewY","angle","a12","a22","t1","t2","t3","a13","a23","a33","a42","a43","a32","invertedScaleX","rotate","forceCSS","xPercent","yPercent","transformPerspective","_renderSVGTransforms","_renderCSSTransforms","_renderNon3DTransforms","_addPxTranslate","_zeroDeg","_zeroPx","_endParenthesis","transforms","use3D","a11","a21","tan","_addRotationalPropTween","cap","finalValue","_assign","source","_addRawTransformPTs","endCache","startCache","all","CSSPlugin","specialProp","relative","isTransformRelated","transformPropTween","inlineProps","styles","visibility","parseTransform","smoothOrigin","autoRound","checkPrefix","getStyleSaver","positionAndScale","gsapWithCSS","_defineProperties","descriptor","configurable","writable","defineProperty","_docEl","_body","_isTouch","_pointerType","_root","_normalizer","_eventTypes","_getGSAP","_startup","_observers","_scrollers","_proxies","_bridge","_getProxyProp","_isViewport","_addListener","nonPassive","_removeListener","_scrollLeft","_scrollTop","_onScroll","isPressed","_scrollCacheFunc","doNotCache","cachingFunc","scrollRestoration","isNormalizing","iOS","cacheID","_horizontal","os2","d2","sc","_vertical","pageXOffset","pageYOffset","_getTarget","_getScrollFunc","scrollingElement","_getVelocityProp","minTimeRefresh","useDelta","v1","v2","dropToZeroTime","getVelocity","latestValue","tOld","vOld","_getEvent","_gsapAllow","changedTouches","_getAbsoluteMax","_setScrollTrigger","bridge","scrollers","proxies","_integrate","isTouch","maxTouchPoints","msMaxTouchPoints","eventTypes","Observer","Constructor","protoProps","tolerance","dragMinimum","debounce","onStop","onStopDelay","wheelSpeed","onDragStart","onDragEnd","onDrag","onPress","onRelease","onRight","onLeft","onUp","onDown","onChangeX","onChangeY","onChange","onToggleX","onToggleY","onHover","onHoverEnd","onMove","ignoreCheck","isNormalizer","onGestureStart","onGestureEnd","onWheel","onEnable","onDisable","scrollSpeed","allowClicks","lockAxis","onLockAxis","onStopDelayedCall","dragged","moved","wheeled","locked","prevDeltaX","prevDeltaY","scrollFuncX","scrollFuncY","scrollX","scrollY","limitToTouch","isViewport","ownerDoc","ownerDocument","deltaX","deltaY","onClickTime","clickCapture","_ignoreCheck","isPointerOrTouch","changedX","changedY","onDelta","_vx","_vy","onTouchOrPointerDelta","_onDrag","clientX","clientY","isDragging","_onPress","_onRelease","isTrackingDrag","wasDragging","eventData","defaultPrevented","syntheticEvent","initMouseEvent","screenX","screenY","isGesturing","_onGestureStart","_onGestureEnd","_onWheel","deltaMode","_onMove","_onHover","_onHoverEnd","_onClick","_dc","getAll","_resizeDelay","_toArray","_time2","_syncInterval","_refreshing","_pointerIsDown","_prevWidth","_prevHeight","_autoRefresh","_ignoreResize","_ignoreMobileResize","_baseScreenHeight","_baseScreenWidth","_fixIOSBug","_scrollRestoration","_div100vh","_100vh","_limitCallbacks","_rafID","_refreshingAll","_queueRefreshID","_primary","_time1","_lastScrollTime","_enabled","_parseClamp","_keepClamp","_rafBugFix","_pointerDownHandler","_pointerUpHandler","_getViewportDimension","dimensionProperty","_getBoundsFunc","_winOffsets","_getBounds","_maxScroll","_iterateAutoRefresh","_endAnimation","callbackAnimation","_abs","_left","_right","_bottom","_width","_height","_Right","_Left","_Top","_Bottom","_padding","_margin","_Width","_Height","_px","_getComputedStyle","withoutTransforms","_getSize","_getLabelRatioArray","_snapDirectional","snapIncrementOrArray","snapped","_multiListener","types","_wheelListener","scrollFunc","wheelHandler","_markerDefaults","startColor","endColor","indent","fontSize","fontWeight","toggleActions","anticipatePin","_keywords","_offsetToPx","eqIndex","_createMarker","container","_ref4","matchWidthEl","containerAnimation","useFixedPosition","isScroller","css","_isStart","innerText","_offset","_positionMarker","marker","flipped","oppositeSide","_isFlipped","_triggers","_ids","_sync","_updateAll","_setBaseDimensions","_onResize","fullscreenElement","webkitFullscreenElement","_softRefresh","_refreshAll","_savedStyles","_revertRecorded","media","query","_revertAll","_clearScrollMemory","rec","_refreshID","_refresh100vh","skipRevert","isRefreshing","refreshInits","scrollBehavior","refresh","_subPinOffset","pin","original","adjustPinSpacing","scroller","_dir","_endClamp","setPositions","onRefresh","_lastScroll","_direction","isUpdating","recordVelocity","scroll","_propNamesToCopy","_stateProps","concat","_swapPinIn","spacer","spacerState","swappedIn","spacerStyle","pinStyle","flexBasis","_setState","state","_getState","scrollerSize","markerScroller","scrollerBounds","borderWidth","scrollerMax","clampZeroProp","localOffset","globalOffset","offsets","_caScrollDist","_prefixExp","_reparent","_stOrig","_interruptionTracker","getValueFunc","initialValue","onInterrupt","last1","last2","_shiftMarker","_getTweenCreator","getScroll","getTween","change1","change2","checkForInterruption","pinCache","snapFunc","scroll1","scroll2","markerStart","markerEnd","markerStartTrigger","markerEndTrigger","markerVars","executingOnRefresh","pinOriginalState","pinActiveState","pinState","pinGetter","pinSetter","pinStart","pinChange","spacingStart","markerStartSetter","pinMoves","markerEndSetter","snap1","snap2","scrubTween","scrubSmooth","snapDurClamp","snapDelayedCall","prevScroll","prevAnimProgress","caMarkerSetter","customRevertReturn","toggleClass","onToggle","scrub","pinSpacing","invalidateOnRefresh","onScrubComplete","onSnapComplete","pinReparent","pinSpacer","fastScrollEnd","preventOverlaps","isToggle","scrollerCache","pinType","callbacks","onEnter","onLeave","onEnterBack","onLeaveBack","markers","onRefreshInit","getScrollerSize","_getSizeFunc","getScrollerOffsets","_getOffsetsFunc","lastSnap","lastRefresh","prevProgress","_startClamp","refreshPriority","tweenScroll","scrubDuration","_getClosestLabel","st","directional","refreshedRecently","naturalEnd","inertia","endScroll","_snap","_onInterrupt","_onComplete","stRevert","spacerIsNative","content","oldOnUpdate","oldParams","previous","prevRefreshing","_swapPinOut","pinOffset","override","curTrigger","curPin","oppositeScroll","revertedPins","forcedOverflow","markerStartOffset","markerEndOffset","isFirstRefresh","otherPinOffset","parsedEnd","parsedEndTrigger","endTrigger","pinnedContainer","triggerIndex","_pinPush","omitOffsets","_copyState","_pinOffset","endAnimation","labelToScroll","getTrailing","forceFake","toggleState","action","stateChanged","isAtMax","isTakingAction","clipped","newStart","newEnd","keepClamp","_change","allowAnimation","onKill","updateFunc","_queueRefreshAll","clearInterval","mm","bodyStyle","border","borderTopStyle","AnimationProto","setInterval","w","hidden","limitCallbacks","ms","syncInterval","ignoreMobileResize","autoRefreshEvents","scrollerProxy","clearMatchMedia","isInViewport","positionInViewport","referencePoint","killAll","allowListeners","listeners","saveStyles","safe","clearScrollMemory","maxScroll","getScrollFunc","snapDirectional","batch","varsCopy","interval","batchMax","proxyCallback","elements","triggers","_inputIsFocused","_clampScrollAndGetDurationMultiplier","_allowNativePanning","touchAction","_overflow","_nestedScroll","_ref5","_isScrollT","scrollHeight","scrollWidth","overflowY","overflowX","_isScroll","_inputObserver","inputs","_captureInputs","_inputExp","isInput","normalizeScroll","normalizer","maxY","lastRefreshID","skipTouchMove","startScrollX","startScrollY","_vars2","normalizeScrollX","momentum","allowNestedScroll","smoother","ScrollSmoother","smootherInstance","initialScale","visualViewport","outerWidth","wheelRefresh","resolveMomentumDuration","inputObserver","resumeTouchMove","scrollClampX","scrollClampY","updateClamps","removeContentOffset","ignoreDrag","prevScale","currentScroll","velocityX","velocityY","xArray","yArray","yClamped","_getScrollNormalizer","ss","ref","SelectorSet","uid","selectors","selectorObjects","indexes","activeIndexes","docElem","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","matchesSelector","idRe","sel","classRe","tagRe","Map","chunker","parseSelectorIndexes","allIndexes","dup","allIndexesLen","rest","findByPrototype","ary","proto","isPrototypeOf","sortById","logDefaultIndexUsed","indexProto","objs","selectorIndexes","selectorIndex","k","selIndex","removedIds","removeAll","queryAll","len2","results","els","len3","matchedIds","bubbleEvents","captureEvents","propagationStopped","WeakMap","immediatePropagationStopped","currentTargets","currentTargetDesc","Event","before","subject","verb","fn","trackPropagation","trackImmediate","getCurrentTarget","defineCurrentTarget","eventPhase","canDispatch","queue","_matches","matched","len1","fire","detail","isTouchDevice","viewAllToggles","currentTarget","CONTENT_TYPE_HEADER","FETCH_ERROR","Symbol","CATCHER_FALLBACK","extractContentType","headers","_a","find","isLikelyJsonMime","mix","one","two","mergeArrays","acc","newValue","errorType","polyfills","polyfill","doThrow","instance","global","Error","WretchError","resolver","wretch","sharedState","_addons","addon","beforeRequest","_options","_url","opts","_catchers","_resolvers","resolvers","_middlewares","middlewares","addons","catchers","finalOptions","finalUrl","_fetchReq","fetchFunction","reduceRight","curr","middlewareHelper","referenceError","throwingPromise","catch","response","ok","err","stack","text","json","JSON","parse","status","bodyParser","funName","cb","fetchErrorFlag","hasOwnProperty","catcher","has","catcherFallback","responseChain","_wretchReq","_sharedState","blob","formData","arrayBuffer","errorId","badRequest","unauthorized","forbidden","notFound","internalError","fetchError","enhancedResponseChain","chain","_deferred","headerValues","accept","headerValue","Accept","auth","Authorization","newMap","defer","fetch","contentType","jsonify","put","post","patch","head","contents","jsObject","currentContentType","stringify","factory","appendQueryParams","qp","queryString","usp","QueryStringAddon","not","focusableSelectors","moveFocusToDialog","focus","findFocusableElement","forward","isFocusable","getNextChildEl","focusableEl","getNextSiblingEl","localName","assignedElements","flatten","assignedElement","firstElementChild","lastElementChild","delegatesFocus","getClientRects","getActiveElement","root","activeEl","A11yDialog","$el","previouslyFocused","shown","maintainFocus","bindKeypress","handleTriggerClicks","show","hide","replaceWith","cloneNode","firstFocusableChild","lastFocusableChild","getFocusableEdges","shiftKey","trapTabKey","instantiateDialogs","readyState","handleModal","triggerEl","openModal","dataset","modal","title","modalTitle","updateUrl","modalUpdateUrl","useDefaultClose","modalDisableDefaultClose","useCustomClose","modalUseCustomClose","template","generateTemplate","createRange","createContextualFragment","modalEl","hideModal","currentUrl","defaultUrl","async","modalContent","ajax","populateModal","clickArgs","firstScriptTag","api","converter","defaultAttributes","expires","toUTCString","encodeURIComponent","decodeURIComponent","escape","stringifiedAttributes","attributeName","cookie","write","cookies","jar","parts","read","withAttributes","withConverter","freeze","easeInOutQuad","_typeof","iterator","singleton","easing","timeStart","timeElapsed","timeCurrent","jumper","additionalOffset","pageOffset","getPageOffset","siteHeader","scrollOffset","jump","ignorePageTypes","handleScroll","targetSelector","topBar","handleClose","setHeight","siteMenu","openMenu","closeMenu","widget","setCookie","Cookies","handleToggle","defaultOptions","nonAnimatableOptions","SlideController","mergedOptions","openDisplayValue","setDisplay","getHeight","setOverflow","getAnimations","triggerAnimation","willOpen","finishedAnimations","finish","lowerBound","frames","paddingTop","paddingBottom","createAnimation","finished","up2","down2","up","down","existingAnimationId","slideToggle","otherTriggers","holder","validator","checkboxGroup","group","findFieldWrapper","handleBlur","fieldWrapper","existingErrorMessage","handleValidation","form","rules","field","fieldName","presence","allowEmpty","email","readonly","pattern","minimum","equality","equals","radio","checkbox","buildRules","validate","messages","insertAdjacentHTML","shouldScroll","formScroll","firstError","handleLengthLimit","$input","$field","maxLength","selectedValue","input","toggleGroup","shouldShow","targetValues","toggleIf","checked","toggleSubmit","submitButton","showFormMessages","success","autoHide","handleAjaxSubmit","formMessages","autoHideMessage","FormData","ga","dataLayer","trackGoogleAnalytics","hideOnSubmit","URL","queryParameters","URLSearchParams","finally","handleSubmit","isValid","resetForm","select","selectedIndex","handleClear","filters","filtersEl","handleFormSubmit","pageFilters","submit","baseUrl","searchParams","normalizedKey","_value","delete","createUrl","handleDropdownChange","parentForm","requestSubmit","handleUpdate","pageFiltersUpdate","pageContent","changeArgs","clearArgs","updateArgs","placeholder","easydropdown","openOnFocus","maxVisibleItems","liveUpdates","useNativeUiOnMobile","setupDropdown","setupPageFilters","setupSlider","topViewAllToggle","sliderControls","afterInit","resize","btn","margin","bar","gradient","backgroundColor","setupScroller","calloutCards","mobileBar","IntersectionObserver","isIntersecting","overlayUrl","pageOverlayUrl","overlayCookie","pageOverlayCookie","pageOverlay","variants","elementSelector","childrenNotWysiwyg","childrenNotChecklist","childrenChecklist","common","scrollReveal","handleUrl","some","handleScrollToMe","intersectionRatio","siteWidget","keyArgs","fields","default","IMask","mask","currency","thousandsSeparator","updateValue","setupMasks","additionalPlaceholder","files","counter","count","setupSpecialFields","setupForm","slider","categorySlider","subCategorySlider","ce","origPrevent","initCustomEvent","exports","arrow","composeClassName_1","group_1","isAtTop","bodyAtTop","isAtBottom","bodyAtBottom","isScrollable","bodyScrollable","styleAttr","isOpen","maxBodyHeight","itemsList","groupState","gradientTop","gradientBottom","option_1","isDisabled","groupDisabled","hasLabel","groupHasLabel","groupLabel","optionState","arrow_1","value_1","isSelected","selectedOption","option","optionSelected","focusedOption","optionFocused","optionDisabled","body_1","head_1","rootDisabled","isInvalid","rootInvalid","rootOpen","isFocused","rootFocused","hasValue","rootHasValue","isOpenAbove","rootOpenAbove","isOpenBelow","rootOpenBelow","isUseNativeMode","rootNative","isPlaceholderShown","humanReadableValue","showPlaceholderWhenOpen","closeOnSelect","clampMaxVisibleItems","seal","onOpen","onClose","onSelect","onOptionClick","Behavior_1","Callbacks_1","ClassNames_1","helpful_merge_1","Config_1","bindEvents_1","Renderer_1","dispatchOpen_1","pollForSelectChange_1","pollForSelectMutation_1","closeOthers_1","scrollToView_1","StateManager_1","StateMapper_1","cache_1","Timers_1","Easydropdown","selectElement","mapFromSelect","dom","timers","actions","proxyActions","closeOthers","scrollToView","handleStateUpdate","eventBindings","pollChangeIntervalId","pollMutationIntervalId","nextValue","TypeError","queryDomRefs","isRequired","binding","unbind","cacheIndex","getOptionFromIndex","focusedIndex","implementation","defineProperties","Timers","Easydropdown_1","EasydropdownFacade_1","selectElementOrSelector","HTMLSelectElement","multiple","cache_2","cachedInstance","factoryFn","decoratedFactory","selects","UP","DOWN","SPACE","ENTER","ESC","OPTION","EventBinding","eventBindingRaw","throttle","boundHandler","closestParent_1","Selectors","optionIndex","selectOption","startClickSelecting","isKeying","focusOption","getIsMobilePlatform_1","handleHeadClick","injectedGetIsMobilePlatform","isMobilePlatform","isClosed","boundHandleHeadClick","_b","topOut","bottomOut","isClickSelecting","killSelectReaction_1","KeyCodes","handleSelectKeydownDown_1","handleSelectKeydownUp_1","handlerParams","isSearching","metaKey","iterations","incrementAmount","totalOptions","searchResetDuration","searchTimeoutId","resetSearch","throttle_1","EventBinding_1","getEventsList_1","bindEvent","eventBinding","handleBodyClick_1","handleBodyMousedown_1","handleBodyMouseover_1","handleHeadClick_1","handleItemsListScroll_1","handleSelectBlur_1","handleSelectFocus_1","handleSelectInvalid_1","handleSelectKeydown_1","handleSelectKeypress_1","handleWindowClick_1","handleWindowClick_2","AttributeChangeType","DomChangeType","Dom","sumItemsHeight","totalHeight","newNode","newInnerHtml","newTextContent","attributeChanges","childCommands","root_1","createDomElementFromHtml_1","Dom_1","domDiff_1","domPatch_1","Renderer","html","rootElement","injectSelect","nextHtml","nextRoot","diffCommand","syncSelectWithValue","replaceChild","tempSelect","localDom","AttributeChangeType_1","DomChangeType_1","PatchCommand_1","diffAttributeChanges","totalAttributes","attributesMap","undef","attr1","attr2","attr","ADD","REMOVE","EDIT","OUTER","domDiff","totalChildNodes","command","NONE","Text","INNER","REPLACE","outerHTML","FULL","childNode","patchAttributes","patchAttribute","domPatch","childCommand","Element","CollisionType","includeSelf","tokens","token","predicate","CollisionType_1","mapCollisionData","deltaTop","deltaBottom","maxHeight","itemHeight","maxVisibleItemsOverride","largestDelta","TOP","BOTTOM","bbHead","wh","detectBodyCollision_1","dispatchOpen","injectedDetectBodyCollision","collisionData","boundDispatchOpen","isIos","isAndroid","isOperaMini","isWindowsPhone","keyingTimeoutId","keying","resetKeying","lastValue","getOptionIndexFromValue","handleMutation","lastOuterHtml","timerId","later","difference","BodyStatus","ScrollStatus","Group","thisInstance","getScrollTop","currentScrollTop","optionOffsetTop","optionHeight","bodyHeight","remainder","scrollToMiddle","BodyStatus_1","ScrollStatus_1","Group_1","Option_1","State","stateRaw","scrollStatus","AT_TOP","bodyStatus","CLOSED","groupRaw","optionRaw","hasPlaceholder","Boolean","OPEN_ABOVE","OPEN_BELOW","AT_BOTTOM","groupStartIndex","_c","resolveActions_1","StateManager","injectedActions","onAction","stateProxy","createStateProxy","getPropertyDescriptorsFromValue","proxy","getPrototypeOf","localDescriptors","isAccessorProperty","readPropertyValue","updatePropertyValue","State_1","StateMapper","isWithinGroup","required","HTMLOptionElement","mapGroup","lastGroup","mapOption","selected","HTMLOptGroupElement","groupChild","isParentGroupDisabled","SCROLLED","makeScrollable","makeUnscrollable","collisionType","optionAtIndex","shouldScrollToView","useNative","factory_1","ArrayStrategy_1","Messages","deep","useReferenceIfTargetUnset","useReferenceIfArray","preserveTypeIfTargetUnset","includeReadOnly","includeNonEmurable","arrayStrategy","errorMessage","MERGE_ERROR","ArrayStrategy","merge_1","FluentMerge","sources","with","offender","suggestion","TYPE_ERROR_TARGET","TYPE_ERROR_SOURCE","INVALID_ARRAY_STRATEGY","strategy","reduceBestMatch","offendingKeyLower","offendingKey","currBestMatch","currKey","totalMatching","getTotalMatching","delta","possibleKey","longer","shorter","leftPointer","leftInnerPointer","leftTotalMatching","lastCommonIndex","rightPointer","rightInnerPointer","rightTotalMatching","longerLastIndex","shorterLastIndex","isSealed","isExtensible","reducer","bestMatch","deriveCustomTypeInstance_1","FluentMerge_1","handleMergeError_1","merge","isClientSide","sourceKeys","PUSH","RangeError","getOwnPropertyNames","sourceKeys_1","Node","createFluent","getRawTag","objectToString","symToStringTag","toStringTag","trimmedEndIndex","reTrimStart","string","freeGlobal","objectProto","nativeObjectToString","isOwn","unmasked","freeSelf","Function","reWhitespace","isObject","toNumber","nativeMax","nativeMin","wait","lastArgs","lastThis","maxWait","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","thisArg","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","leadingEdge","cancel","flush","baseGetTag","isObjectLike","baseTrim","isSymbol","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","other","valueOf","isBinary","define","constraints","runValidations","isPromise","processValidationResults","metadata","isEmpty","EMPTY_STRING_REGEXP","validatorName","validators","validatorOptions","isDomElement","isJqueryElement","collectFormValues","getDeepObjectValue","attribute","globalOptions","errors","pruneEmptyErrors","expandMultipleErrors","convertErrorMessages","formatters","WrapErrors","wrapErrors","cleanAttributes","reject","waitForResults","single","fullMessages","memo","isNumber","isFunction","isInteger","isBoolean","isDate","isDefined","jquery","str","vals","FORMAT_REGEXP","m0","prettify","toFixed","stringifyValue","isHash","unique","array","forEachKeyInKeypath","keypath","sanitizeFormValue","_val","nullify","capitalize","ret","msg","errorInfo","groupErrorsByAttribute","list","flattenErrorsToArray","whitelist","whitelistCreator","cleanRecursive","ow","buildObjectWhitelist","exposeModule","amd","is","maximum","tokenizer","wrongLength","tooShort","tooLong","notValid","numericality","checks","greaterThan","greaterThanOrEqualTo","equalTo","lessThan","lessThanOrEqualTo","divisibleBy","strict","onlyInteger","noStrings","notInteger","odd","notOdd","even","notEven","datetime","earliest","NaN","latest","dateOnly","tooEarly","date","tooLate","flags","inclusion","within","exclusion","PATTERN","otherValue","comparator","schemes","allowLocal","allowDataUrl","regex","tld","originalOptions","check","integer","boolean","detailed","grouped","constraint","ChangeDetails","prep","details","inserted","rawInserted","tailShift","aggregate","ContinuousTailDetails","tail","appendTo","masked","_appendPlaceholder","beforePos","shiftChar","InputMask","_obj$constructor","pick","DIRECTION","LEFT","FORCE_LEFT","RIGHT","FORCE_RIGHT","forceDirection","escapeRegExp","objectIncludes","arrA","arrB","dateA","dateB","regexpA","regexpB","ActionDetails","startChangePos","oldValue","oldSelection","cursorPos","insertedCount","removedCount","removed","removeDirection","MaskElement","selectionStart","_unsafeSelectionStart","selectionEnd","_unsafeSelectionEnd","_unsafeSelect","HTMLMaskElement","super","_handlers","_this$input$getRootNo","_this$input$getRootNo2","_this$input","bindEvents","handlers","_toggleEventHandler","EVENTS_MAP","unbindEvents","selectionChange","drop","commit","HTMLInputMaskElement","setSelectionRange","HTMLContenteditableMaskElement","selection","getSelection","anchorOffset","focusOffset","setStart","firstChild","setEnd","lastChild","removeAllRanges","addRange","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_onFocus","alignCursor","alignCursorFriendly","_bindEvents","maskEquals","_this$masked","Masked","updateOptions","unmaskedValue","updateControl","typedValue","typedValueEquals","displayValue","_unbindEvents","_fireEvent","ev","_cursorChanging","_changingCursorPos","pos","_selection","newUnmaskedValue","newDisplayValue","isChanged","_fireChangeEvents","restOpts","updateMask","updateOpts","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_inputEvent","isComplete","nearestInputPos","hIndex","oldRawValue","rawInputValue","doCommit","_update","DEFAULTS","_initialized","withValueRefresh","_rawInputValue","extractInput","isFilled","totalInputPositions","fromPos","toPos","extractTail","appendTail","_appendCharRaw","ch","_appendChar","checkTail","consistentState","doPrepareChar","consistentTail","appended","doValidate","beforeTailState","tailDetails","_appendEager","_beforeTailState","doPrepare","ci","doSkipInvalid","eager","rawInput","runIsolated","_isolated","skipInvalid","prepare","prepareChar","deleteCount","tailPos","eagerRemove","valLength","tval","EMPTY_VALUES","maskedClass","MaskedRegExp","MaskedPattern","MaskedDate","MaskedNumber","MaskedDynamic","MaskedFunction","normalizeOpts","instanceOpts","_mask","startsWith","createMask","nOpts","MaskedClass","_updateRegExps","allowNegative","radix","_numberRegExp","_mapToRadixRegExp","mapToRadix","_thousandsSeparatorRegExp","_removeThousandsSeparators","_insertThousandsSeparators","prepCh","allowPositive","_separatorsCount","extendOnSeparators","_separatorsCountFromSlice","_adjustRangeWithSeparators","prevBeforeTailValue","prevBeforeTailSeparatorsCount","appendDetails","beforeTailValue","beforeTailSeparatorsCount","_findSeparatorAround","searchFrom","separatorPos","separatorAroundFromPos","separatorAroundToPos","valueBeforePos","valueAfterPos","separatorAtLeftPos","separatorAtLeftEndPos","separatorAtRightPos","valid","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","sign","zeros","padEnd","dropFractional","UNMASKED_RADIX","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","toLocaleString","useGrouping","maximumFractionDigits","ChunksTailDetails","chunks","tailChunk","lastChunk","extendLast","firstTailChunk","blockIndex","lastBlockIter","_mapPosToBlock","chunkBlock","_stops","phDetails","_blocks","remainChars","cstate","chunkShiftPos","PatternCursor","_log","block","_blockStartPos","popState","pop","bindBlock","_pushLeft","_this$block","_pushRight","pushLeftBeforeFilled","isFixed","pushLeftBeforeInput","pushLeftBeforeRequired","isOptional","pushRightBeforeFilled","pushRightBeforeInput","pushRightBeforeRequired","PatternFixedDefinition","isUnmasking","_isRawInput","maxPos","appendEager","isResolved","char","PatternInputDefinition","placeholderChar","displayChar","maskOpts","currentMaskFlags","boundPos","_flags$_beforeTailSta","DEFAULT_DEFINITIONS","definitions","_rebuildMask","defs","exposeBlock","_maskedBlocks","unmaskingBlock","optionalBlock","blocks","bNames","bName","expose","blockOpts","maskedBlock","STOP_CHAR","ESCAPE_CHAR","def","maskedState","bi","every","_this$_mapPosToBlock","startBlockIndex","blockIter","blockDetails","chunkTail","_forEachBlocksInRange","bFromPos","bToPos","blockChunk","_findStopBefore","stopBefore","si","toBlockIndex","startBlockIter","endBlockIndex","_blocks2","bDetails","accVal","blockStartPos","fromBlockIter","toBlockIter","isSameBlock","fromBlockStartPos","fromBlockEndPos","removeDetails","maskedBlocks","indices","gi","InputDefinition","FixedDefinition"],"sourceRoot":""}