New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@analytics/activity-utils

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@analytics/activity-utils - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [0.1.13](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-activity/compare/@analytics/activity-utils@0.1.12...@analytics/activity-utils@0.1.13) (2022-03-18)
**Note:** Version bump only for package @analytics/activity-utils
## [0.1.12](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-activity/compare/@analytics/activity-utils@0.1.11...@analytics/activity-utils@0.1.12) (2022-02-05)

@@ -8,0 +16,0 @@

2

dist/analytics-util-activity.js

@@ -1,2 +0,2 @@

var t=require("@analytics/listener-utils"),n=require("analytics-plugin-tab-events");function e(){return(e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}).apply(this,arguments)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(e,r){void 0===r&&(r={});var i=function(t,n){var e=this,o=!1;return function(r){o||(t.call(e,r),o=!0,setTimeout(function(){return o=!1},n))}}(e,r.throttle||1e4),u=[];function a(){var e=n.onTabChange(function(t){t||i({type:"tabVisible"})});return u=[e].concat(o.map(function(n){return t.addListener(document,n,i)})).concat(t.addListener(window,"load",i)).concat(t.addListener(window,"scroll",i,{capture:!0,passive:!0})),c}function c(){u.map(function(t){return t()})}return a(),function(){return c(),a}}function i(t){var n,e,o=t.onIdle,i=t.onWakeUp,a=t.onHeartbeat,c=t.timeout,s=void 0===c?1e4:c,d=t.throttle,l=void 0===d?2e3:d,f=!1,v=!1,p=new Date,h=function(){return clearTimeout(n)};function m(t){h(),a&&!f&&a(u(p),t),i&&f&&(f=!1,i(u(e),t),p=new Date),n=setTimeout(function(){f=!0,o&&(e=new Date,o(u(p),t))},s)}var w=r(m,{throttle:l});return{disable:function(){v=!0,f=!1,h();var t=w();return function(){return v=!1,p=new Date,m({type:"load"}),t()}},getStatus:function(){return{isIdle:f,isDisabled:v,active:f?0:u(p,v),idle:f?u(e,v):0}}}}function u(t,n){return n?0:Math.round((new Date-t)/1e3)}exports.onDomActivity=r,exports.onIdle=function(t,n){return void 0===n&&(n={}),i(e({onIdle:t},n))},exports.onUserActivity=i,exports.onWakeUp=function(t,n){return void 0===n&&(n={}),i(e({onWakeUp:t},n))};
var t=require("@analytics/listener-utils"),n=require("analytics-plugin-tab-events");function e(){return e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},e.apply(this,arguments)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(e,r){void 0===r&&(r={});var i=function(t,n){var e=this,o=!1;return function(r){o||(t.call(e,r),o=!0,setTimeout(function(){return o=!1},n))}}(e,r.throttle||1e4),u=[];function a(){var e=n.onTabChange(function(t){t||i({type:"tabVisible"})});return u=[e].concat(o.map(function(n){return t.addListener(document,n,i)})).concat(t.addListener(window,"load",i)).concat(t.addListener(window,"scroll",i,{capture:!0,passive:!0})),c}function c(){u.map(function(t){return t()})}return a(),function(){return c(),a}}function i(t){var n,e,o=t.onIdle,i=t.onWakeUp,a=t.onHeartbeat,c=t.timeout,s=void 0===c?1e4:c,d=t.throttle,l=void 0===d?2e3:d,f=!1,v=!1,p=new Date,h=function(){return clearTimeout(n)};function m(t){h(),a&&!f&&a(u(p),t),i&&f&&(f=!1,i(u(e),t),p=new Date),n=setTimeout(function(){f=!0,o&&(e=new Date,o(u(p),t))},s)}var w=r(m,{throttle:l});return{disable:function(){v=!0,f=!1,h();var t=w();return function(){return v=!1,p=new Date,m({type:"load"}),t()}},getStatus:function(){return{isIdle:f,isDisabled:v,active:f?0:u(p,v),idle:f?u(e,v):0}}}}function u(t,n){return n?0:Math.round((new Date-t)/1e3)}exports.onDomActivity=r,exports.onIdle=function(t,n){return void 0===n&&(n={}),i(e({onIdle:t},n))},exports.onUserActivity=i,exports.onWakeUp=function(t,n){return void 0===n&&(n={}),i(e({onWakeUp:t},n))};
//# sourceMappingURL=analytics-util-activity.js.map

@@ -1,2 +0,2 @@

import{addListener as t}from"@analytics/listener-utils";import{onTabChange as n}from"analytics-plugin-tab-events";function e(){return(e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}).apply(this,arguments)}const o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(e,r={}){const a=function(t,n){var e=!1;return o=>{e||(t.call(this,o),e=!0,setTimeout(()=>e=!1,n))}}(e,r.throttle||1e4);let c=[];function i(){const e=n(t=>{t||a({type:"tabVisible"})});return c=[e].concat(o.map(n=>t(document,n,a))).concat(t(window,"load",a)).concat(t(window,"scroll",a,{capture:!0,passive:!0})),u}function u(){c.map(t=>t())}return i(),function(){return u(),i}}function a(t,n={}){return i(e({onIdle:t},n))}function c(t,n={}){return i(e({onWakeUp:t},n))}function i({onIdle:t,onWakeUp:n,onHeartbeat:e,timeout:o=1e4,throttle:a=2e3}){let c,i,s=!1,l=!1,f=new Date;const p=()=>clearTimeout(c);function d(r){p(),e&&!s&&e(u(f),r),n&&s&&(s=!1,n(u(i),r),f=new Date),c=setTimeout(function(){s=!0,t&&(i=new Date,t(u(f),r))},o)}const m=r(d,{throttle:a});return{disable:()=>{l=!0,s=!1,p();const t=m();return()=>(l=!1,f=new Date,d({type:"load"}),t())},getStatus:()=>({isIdle:s,isDisabled:l,active:s?0:u(f,l),idle:s?u(i,l):0})}}function u(t,n){return n?0:Math.round((new Date-t)/1e3)}export{r as onDomActivity,a as onIdle,i as onUserActivity,c as onWakeUp};
import{addListener as t}from"@analytics/listener-utils";import{onTabChange as n}from"analytics-plugin-tab-events";function e(){return e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},e.apply(this,arguments)}const o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(e,r={}){const a=function(t,n){var e=!1;return o=>{e||(t.call(this,o),e=!0,setTimeout(()=>e=!1,n))}}(e,r.throttle||1e4);let c=[];function i(){const e=n(t=>{t||a({type:"tabVisible"})});return c=[e].concat(o.map(n=>t(document,n,a))).concat(t(window,"load",a)).concat(t(window,"scroll",a,{capture:!0,passive:!0})),u}function u(){c.map(t=>t())}return i(),function(){return u(),i}}function a(t,n={}){return i(e({onIdle:t},n))}function c(t,n={}){return i(e({onWakeUp:t},n))}function i({onIdle:t,onWakeUp:n,onHeartbeat:e,timeout:o=1e4,throttle:a=2e3}){let c,i,s=!1,l=!1,f=new Date;const p=()=>clearTimeout(c);function d(r){p(),e&&!s&&e(u(f),r),n&&s&&(s=!1,n(u(i),r),f=new Date),c=setTimeout(function(){s=!0,t&&(i=new Date,t(u(f),r))},o)}const m=r(d,{throttle:a});return{disable:()=>{l=!0,s=!1,p();const t=m();return()=>(l=!1,f=new Date,d({type:"load"}),t())},getStatus:()=>({isIdle:s,isDisabled:l,active:s?0:u(f,l),idle:s?u(i,l):0})}}function u(t,n){return n?0:Math.round((new Date-t)/1e3)}export{r as onDomActivity,a as onIdle,i as onUserActivity,c as onWakeUp};
//# sourceMappingURL=analytics-util-activity.modern.js.map

@@ -1,2 +0,2 @@

import{addListener as t}from"@analytics/listener-utils";import{onTabChange as n}from"analytics-plugin-tab-events";function e(){return(e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}).apply(this,arguments)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(e,r){void 0===r&&(r={});var u=function(t,n){var e=this,o=!1;return function(r){o||(t.call(e,r),o=!0,setTimeout(function(){return o=!1},n))}}(e,r.throttle||1e4),i=[];function a(){var e=n(function(t){t||u({type:"tabVisible"})});return i=[e].concat(o.map(function(n){return t(document,n,u)})).concat(t(window,"load",u)).concat(t(window,"scroll",u,{capture:!0,passive:!0})),c}function c(){i.map(function(t){return t()})}return a(),function(){return c(),a}}function u(t,n){return void 0===n&&(n={}),a(e({onIdle:t},n))}function i(t,n){return void 0===n&&(n={}),a(e({onWakeUp:t},n))}function a(t){var n,e,o=t.onIdle,u=t.onWakeUp,i=t.onHeartbeat,a=t.timeout,f=void 0===a?1e4:a,l=t.throttle,s=void 0===l?2e3:l,d=!1,v=!1,p=new Date,m=function(){return clearTimeout(n)};function w(t){m(),i&&!d&&i(c(p),t),u&&d&&(d=!1,u(c(e),t),p=new Date),n=setTimeout(function(){d=!0,o&&(e=new Date,o(c(p),t))},f)}var h=r(w,{throttle:s});return{disable:function(){v=!0,d=!1,m();var t=h();return function(){return v=!1,p=new Date,w({type:"load"}),t()}},getStatus:function(){return{isIdle:d,isDisabled:v,active:d?0:c(p,v),idle:d?c(e,v):0}}}}function c(t,n){return n?0:Math.round((new Date-t)/1e3)}export{r as onDomActivity,u as onIdle,a as onUserActivity,i as onWakeUp};
import{addListener as t}from"@analytics/listener-utils";import{onTabChange as n}from"analytics-plugin-tab-events";function e(){return e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},e.apply(this,arguments)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(e,r){void 0===r&&(r={});var u=function(t,n){var e=this,o=!1;return function(r){o||(t.call(e,r),o=!0,setTimeout(function(){return o=!1},n))}}(e,r.throttle||1e4),i=[];function a(){var e=n(function(t){t||u({type:"tabVisible"})});return i=[e].concat(o.map(function(n){return t(document,n,u)})).concat(t(window,"load",u)).concat(t(window,"scroll",u,{capture:!0,passive:!0})),c}function c(){i.map(function(t){return t()})}return a(),function(){return c(),a}}function u(t,n){return void 0===n&&(n={}),a(e({onIdle:t},n))}function i(t,n){return void 0===n&&(n={}),a(e({onWakeUp:t},n))}function a(t){var n,e,o=t.onIdle,u=t.onWakeUp,i=t.onHeartbeat,a=t.timeout,f=void 0===a?1e4:a,l=t.throttle,s=void 0===l?2e3:l,d=!1,v=!1,p=new Date,m=function(){return clearTimeout(n)};function w(t){m(),i&&!d&&i(c(p),t),u&&d&&(d=!1,u(c(e),t),p=new Date),n=setTimeout(function(){d=!0,o&&(e=new Date,o(c(p),t))},f)}var h=r(w,{throttle:s});return{disable:function(){v=!0,d=!1,m();var t=h();return function(){return v=!1,p=new Date,w({type:"load"}),t()}},getStatus:function(){return{isIdle:d,isDisabled:v,active:d?0:c(p,v),idle:d?c(e,v):0}}}}function c(t,n){return n?0:Math.round((new Date-t)/1e3)}export{r as onDomActivity,u as onIdle,a as onUserActivity,i as onWakeUp};
//# sourceMappingURL=analytics-util-activity.module.js.map

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@analytics/listener-utils"),require("analytics-plugin-tab-events")):"function"==typeof define&&define.amd?define(["exports","@analytics/listener-utils","analytics-plugin-tab-events"],n):n((t||self).utilActivity={},t.listenerUtils,t.analyticsPluginTabEvents)}(this,function(t,n,e){function i(){return(i=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t}).apply(this,arguments)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(t,i){void 0===i&&(i={});var r=function(t,n){var e=this,i=!1;return function(o){i||(t.call(e,o),i=!0,setTimeout(function(){return i=!1},n))}}(t,i.throttle||1e4),u=[];function a(){var t=e.onTabChange(function(t){t||r({type:"tabVisible"})});return u=[t].concat(o.map(function(t){return n.addListener(document,t,r)})).concat(n.addListener(window,"load",r)).concat(n.addListener(window,"scroll",r,{capture:!0,passive:!0})),c}function c(){u.map(function(t){return t()})}return a(),function(){return c(),a}}function u(t){var n,e,i=t.onIdle,o=t.onWakeUp,u=t.onHeartbeat,c=t.timeout,s=void 0===c?1e4:c,l=t.throttle,f=void 0===l?2e3:l,d=!1,v=!1,p=new Date,y=function(){return clearTimeout(n)};function h(t){y(),u&&!d&&u(a(p),t),o&&d&&(d=!1,o(a(e),t),p=new Date),n=setTimeout(function(){d=!0,i&&(e=new Date,i(a(p),t))},s)}var b=r(h,{throttle:f});return{disable:function(){v=!0,d=!1,y();var t=b();return function(){return v=!1,p=new Date,h({type:"load"}),t()}},getStatus:function(){return{isIdle:d,isDisabled:v,active:d?0:a(p,v),idle:d?a(e,v):0}}}}function a(t,n){return n?0:Math.round((new Date-t)/1e3)}t.onDomActivity=r,t.onIdle=function(t,n){return void 0===n&&(n={}),u(i({onIdle:t},n))},t.onUserActivity=u,t.onWakeUp=function(t,n){return void 0===n&&(n={}),u(i({onWakeUp:t},n))}});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@analytics/listener-utils"),require("analytics-plugin-tab-events")):"function"==typeof define&&define.amd?define(["exports","@analytics/listener-utils","analytics-plugin-tab-events"],n):n((t||self).utilActivity={},t.listenerUtils,t.analyticsPluginTabEvents)}(this,function(t,n,e){function i(){return i=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i.apply(this,arguments)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r(t,i){void 0===i&&(i={});var r=function(t,n){var e=this,i=!1;return function(o){i||(t.call(e,o),i=!0,setTimeout(function(){return i=!1},n))}}(t,i.throttle||1e4),u=[];function a(){var t=e.onTabChange(function(t){t||r({type:"tabVisible"})});return u=[t].concat(o.map(function(t){return n.addListener(document,t,r)})).concat(n.addListener(window,"load",r)).concat(n.addListener(window,"scroll",r,{capture:!0,passive:!0})),c}function c(){u.map(function(t){return t()})}return a(),function(){return c(),a}}function u(t){var n,e,i=t.onIdle,o=t.onWakeUp,u=t.onHeartbeat,c=t.timeout,s=void 0===c?1e4:c,l=t.throttle,f=void 0===l?2e3:l,d=!1,v=!1,p=new Date,y=function(){return clearTimeout(n)};function h(t){y(),u&&!d&&u(a(p),t),o&&d&&(d=!1,o(a(e),t),p=new Date),n=setTimeout(function(){d=!0,i&&(e=new Date,i(a(p),t))},s)}var b=r(h,{throttle:f});return{disable:function(){v=!0,d=!1,y();var t=b();return function(){return v=!1,p=new Date,h({type:"load"}),t()}},getStatus:function(){return{isIdle:d,isDisabled:v,active:d?0:a(p,v),idle:d?a(e,v):0}}}}function a(t,n){return n?0:Math.round((new Date-t)/1e3)}t.onDomActivity=r,t.onIdle=function(t,n){return void 0===n&&(n={}),u(i({onIdle:t},n))},t.onUserActivity=u,t.onWakeUp=function(t,n){return void 0===n&&(n={}),u(i({onWakeUp:t},n))}});
//# sourceMappingURL=analytics-util-activity.umd.js.map

@@ -1,2 +0,2 @@

var utilActivity=function(n){function t(){return(t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n}).apply(this,arguments)}var e=function(){};"undefined"==typeof process||process;var r="undefined"!=typeof window;function o(n,t){return typeof t===n}"undefined"!=typeof Deno&&Deno,r&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o.bind(null,"function");var i=o.bind(null,"string");function u(n,t){if(i(n))return t?u(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var e=[],r=n.length>>>0;r--;)e[r]=n[r];return e}return function(n){return"[object Array]"===Object.prototype.toString.call(n)}(n)?n:[n]}function c(n,t){return t&&t.once?function(n,t){var e;return function(){return n&&(e=n.apply(this,arguments),n=null),e}}(n):n}o.bind(null,"undefined"),o.bind(null,"boolean");var a=function(n,t,o,i){var a=o||e;if(!r)return a;var d=i||!1,f=u(t),l=u(n,!0),v=[];if(!l.length)throw new Error("noElements");if(!f.length)throw new Error("noEvent");return function n(t){var e=t?"addEventListener":"removeEventListener";t&&(v=[]);for(var r=0;r<l.length;r++){var o=l[r];v[r]=t?c(a,d):v[r]||a;for(var i=0;i<f.length;i++)o[e]?o[e](f[i],v[r],d):o["on"+f[i]]=t?v[r]:null}return n.bind(null,!t)}("Event")},d="undefined"==typeof window,f="hidden",l=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function v(n,t){void 0===t&&(t={});var e=function(n,t){var e=this,r=!1;return function(o){r||(n.call(e,o),r=!0,setTimeout(function(){return r=!1},t))}}(n,t.throttle||1e4),r=[];function o(){var n=function(n){if(d)return!1;var t=d||f in document?f:["webkit","moz","ms","o"].reduce(function(n,t){var e=t+"Hidden";return!n&&e in document?e:n},null),e="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return n(Boolean(document[t]))},o=function(){return document.addEventListener(e,r)};return o(),function(){return document.removeEventListener(e,r),o}}(function(n){n||e({type:"tabVisible"})});return r=[n].concat(l.map(function(n){return a(document,n,e)})).concat(a(window,"load",e)).concat(a(window,"scroll",e,{capture:!0,passive:!0})),i}function i(){r.map(function(n){return n()})}return o(),function(){return i(),o}}function s(n){var t,e,r=n.onIdle,o=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,d=void 0===a?2e3:a,f=!1,l=!1,s=new Date,m=function(){return clearTimeout(t)};function w(n){m(),i&&!f&&i(p(s),n),o&&f&&(f=!1,o(p(e),n),s=new Date),t=setTimeout(function(){f=!0,r&&(e=new Date,r(p(s),n))},c)}var h=v(w,{throttle:d});return{disable:function(){l=!0,f=!1,m();var n=h();return function(){return l=!1,s=new Date,w({type:"load"}),n()}},getStatus:function(){return{isIdle:f,isDisabled:l,active:f?0:p(s,l),idle:f?p(e,l):0}}}}function p(n,t){return t?0:Math.round((new Date-n)/1e3)}return n.onDomActivity=v,n.onIdle=function(n,e){return void 0===e&&(e={}),s(t({onIdle:n},e))},n.onUserActivity=s,n.onWakeUp=function(n,e){return void 0===e&&(e={}),s(t({onWakeUp:n},e))},n}({});
var utilActivity=function(n){function t(){return t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},t.apply(this,arguments)}var e=function(){};"undefined"==typeof process||process;var r="undefined"!=typeof window;function o(n,t){return t.charAt(0)[n]()+t.slice(1)}"undefined"!=typeof Deno&&Deno,r&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var u=o.bind(null,"toUpperCase"),i=o.bind(null,"toLowerCase");function c(n,t){void 0===t&&(t=!0);var e=function(n){return d(n)?u("null"):"object"==typeof n?function(n){return l(n.constructor)?n.constructor.name:null}(n):Object.prototype.toString.call(n).slice(8,-1)}(n);return t?i(e):e}function a(n,t){return typeof t===n}var l=a.bind(null,"function"),f=a.bind(null,"string");function d(n){return null===n}function s(n,t){if("object"!=typeof t||d(t))return!1;if(t instanceof n)return!0;var e=c(new n(""));if(function(n){return n instanceof Error||f(n.message)&&n.constructor&&function(n){return"number"===c(n)&&!isNaN(n)}(n.constructor.stackTraceLimit)}(t))for(;t;){if(c(t)===e)return!0;t=Object.getPrototypeOf(t)}return!1}function v(n,t){var e=n instanceof Element||n instanceof HTMLDocument;return e&&t?function(n,t){return void 0===t&&(t=""),n&&n.nodeName===t.toUpperCase()}(n,t):e}function p(n){var t=[].slice.call(arguments,1);return function(){return n.apply(void 0,[].slice.call(arguments).concat(t))}}function m(n,t){if(f(n))return t?m(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var e=[],r=n.length>>>0;r--;)e[r]=n[r];return e}return function(n){return n?function(n){return"array"===c(n)}(n)?n:[n]:[]}(n)}function w(n,t){return t&&t.once?function(n,t){var e;return function(){return n&&(e=n.apply(this,arguments),n=null),e}}(n):n}a.bind(null,"undefined"),a.bind(null,"boolean"),a.bind(null,"symbol"),s.bind(null,TypeError),s.bind(null,SyntaxError),p(v,"form"),p(v,"button"),p(v,"input"),p(v,"select");var y=function(n,t,o,u){var i=o||e;if(!r)return i;var c=u||!1,a=m(t),l=m(n,!0),f=[];if(!l.length)throw new Error("noElements");if(!a.length)throw new Error("noEvent");return function n(t){var e=t?"addEventListener":"removeEventListener";t&&(f=[]);for(var r=0;r<l.length;r++){var o=l[r];f[r]=t?w(i,c):f[r]||i;for(var u=0;u<a.length;u++)o[e]?o[e](a[u],f[r],c):o["on"+a[u]]=t?f[r]:null}return n.bind(null,!t)}("Event")};function b(n,t){return r&&l(window[n])?(e=window[n],o=t,void 0===(u=window)&&(u=null),l(e)?function(){e.apply(u,arguments),o.apply(u,arguments)}:o):window[n]=t;var e,o,u}b.bind(null,"onerror"),b.bind(null,"onload");var h="undefined"==typeof window,g="hidden",E=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function D(n,t){void 0===t&&(t={});var e=function(n,t){var e=this,r=!1;return function(o){r||(n.call(e,o),r=!0,setTimeout(function(){return r=!1},t))}}(n,t.throttle||1e4),r=[];function o(){var n=function(n){if(h)return!1;var t=h||g in document?g:["webkit","moz","ms","o"].reduce(function(n,t){var e=t+"Hidden";return!n&&e in document?e:n},null),e="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return n(Boolean(document[t]))},o=function(){return document.addEventListener(e,r)};return o(),function(){return document.removeEventListener(e,r),o}}(function(n){n||e({type:"tabVisible"})});return r=[n].concat(E.map(function(n){return y(document,n,e)})).concat(y(window,"load",e)).concat(y(window,"scroll",e,{capture:!0,passive:!0})),u}function u(){r.map(function(n){return n()})}return o(),function(){return u(),o}}function j(n){var t,e,r=n.onIdle,o=n.onWakeUp,u=n.onHeartbeat,i=n.timeout,c=void 0===i?1e4:i,a=n.throttle,l=void 0===a?2e3:a,f=!1,d=!1,s=new Date,v=function(){return clearTimeout(t)};function p(n){v(),u&&!f&&u(L(s),n),o&&f&&(f=!1,o(L(e),n),s=new Date),t=setTimeout(function(){f=!0,r&&(e=new Date,r(L(s),n))},c)}var m=D(p,{throttle:l});return{disable:function(){d=!0,f=!1,v();var n=m();return function(){return d=!1,s=new Date,p({type:"load"}),n()}},getStatus:function(){return{isIdle:f,isDisabled:d,active:f?0:L(s,d),idle:f?L(e,d):0}}}}function L(n,t){return t?0:Math.round((new Date-n)/1e3)}return n.onDomActivity=D,n.onIdle=function(n,e){return void 0===e&&(e={}),j(t({onIdle:n},e))},n.onUserActivity=j,n.onWakeUp=function(n,e){return void 0===e&&(e={}),j(t({onWakeUp:n},e))},n}({});
//# sourceMappingURL=activity-utils.js.map

@@ -1,2 +0,2 @@

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n||self).utilActivity={})}(this,function(n){function e(){return(e=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n}).apply(this,arguments)}var t=function(){};"undefined"==typeof process||process;var o="undefined"!=typeof window;function r(n,e){return typeof e===n}"undefined"!=typeof Deno&&Deno,o&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),r.bind(null,"function");var i=r.bind(null,"string");function u(n,e){if(i(n))return e?u(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var t=[],o=n.length>>>0;o--;)t[o]=n[o];return t}return function(n){return"[object Array]"===Object.prototype.toString.call(n)}(n)?n:[n]}function c(n,e){return e&&e.once?function(n,e){var t;return function(){return n&&(t=n.apply(this,arguments),n=null),t}}(n):n}r.bind(null,"undefined"),r.bind(null,"boolean");var a=function(n,e,r,i){var a=r||t;if(!o)return a;var f=i||!1,d=u(e),l=u(n,!0),s=[];if(!l.length)throw new Error("noElements");if(!d.length)throw new Error("noEvent");return function n(e){var t=e?"addEventListener":"removeEventListener";e&&(s=[]);for(var o=0;o<l.length;o++){var r=l[o];s[o]=e?c(a,f):s[o]||a;for(var i=0;i<d.length;i++)r[t]?r[t](d[i],s[o],f):r["on"+d[i]]=e?s[o]:null}return n.bind(null,!e)}("Event")},f="undefined"==typeof window,d="hidden",l=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function s(n,e){void 0===e&&(e={});var t=function(n,e){var t=this,o=!1;return function(r){o||(n.call(t,r),o=!0,setTimeout(function(){return o=!1},e))}}(n,e.throttle||1e4),o=[];function r(){var n=function(n){if(f)return!1;var e=f||d in document?d:["webkit","moz","ms","o"].reduce(function(n,e){var t=e+"Hidden";return!n&&t in document?t:n},null),t="".concat(e.replace(/[H|h]idden/,""),"visibilitychange"),o=function(){return n(Boolean(document[e]))},r=function(){return document.addEventListener(t,o)};return r(),function(){return document.removeEventListener(t,o),r}}(function(n){n||t({type:"tabVisible"})});return o=[n].concat(l.map(function(n){return a(document,n,t)})).concat(a(window,"load",t)).concat(a(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){o.map(function(n){return n()})}return r(),function(){return i(),r}}function v(n){var e,t,o=n.onIdle,r=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,f=void 0===a?2e3:a,d=!1,l=!1,v=new Date,m=function(){return clearTimeout(e)};function y(n){m(),i&&!d&&i(p(v),n),r&&d&&(d=!1,r(p(t),n),v=new Date),e=setTimeout(function(){d=!0,o&&(t=new Date,o(p(v),n))},c)}var h=s(y,{throttle:f});return{disable:function(){l=!0,d=!1,m();var n=h();return function(){return l=!1,v=new Date,y({type:"load"}),n()}},getStatus:function(){return{isIdle:d,isDisabled:l,active:d?0:p(v,l),idle:d?p(t,l):0}}}}function p(n,e){return e?0:Math.round((new Date-n)/1e3)}n.onDomActivity=s,n.onIdle=function(n,t){return void 0===t&&(t={}),v(e({onIdle:n},t))},n.onUserActivity=v,n.onWakeUp=function(n,t){return void 0===t&&(t={}),v(e({onWakeUp:n},t))}});
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n||self).utilActivity={})}(this,function(n){function t(){return t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},t.apply(this,arguments)}var e=function(){};"undefined"==typeof process||process;var r="undefined"!=typeof window;function o(n,t){return t.charAt(0)[n]()+t.slice(1)}"undefined"!=typeof Deno&&Deno,r&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var i=o.bind(null,"toUpperCase"),u=o.bind(null,"toLowerCase");function c(n,t){void 0===t&&(t=!0);var e=function(n){return d(n)?i("null"):"object"==typeof n?function(n){return f(n.constructor)?n.constructor.name:null}(n):Object.prototype.toString.call(n).slice(8,-1)}(n);return t?u(e):e}function a(n,t){return typeof t===n}var f=a.bind(null,"function"),l=a.bind(null,"string");function d(n){return null===n}function s(n,t){if("object"!=typeof t||d(t))return!1;if(t instanceof n)return!0;var e=c(new n(""));if(function(n){return n instanceof Error||l(n.message)&&n.constructor&&function(n){return"number"===c(n)&&!isNaN(n)}(n.constructor.stackTraceLimit)}(t))for(;t;){if(c(t)===e)return!0;t=Object.getPrototypeOf(t)}return!1}function v(n,t){var e=n instanceof Element||n instanceof HTMLDocument;return e&&t?function(n,t){return void 0===t&&(t=""),n&&n.nodeName===t.toUpperCase()}(n,t):e}function p(n){var t=[].slice.call(arguments,1);return function(){return n.apply(void 0,[].slice.call(arguments).concat(t))}}function m(n,t){if(l(n))return t?m(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var e=[],r=n.length>>>0;r--;)e[r]=n[r];return e}return function(n){return n?function(n){return"array"===c(n)}(n)?n:[n]:[]}(n)}function y(n,t){return t&&t.once?function(n,t){var e;return function(){return n&&(e=n.apply(this,arguments),n=null),e}}(n):n}a.bind(null,"undefined"),a.bind(null,"boolean"),a.bind(null,"symbol"),s.bind(null,TypeError),s.bind(null,SyntaxError),p(v,"form"),p(v,"button"),p(v,"input"),p(v,"select");var w=function(n,t,o,i){var u=o||e;if(!r)return u;var c=i||!1,a=m(t),f=m(n,!0),l=[];if(!f.length)throw new Error("noElements");if(!a.length)throw new Error("noEvent");return function n(t){var e=t?"addEventListener":"removeEventListener";t&&(l=[]);for(var r=0;r<f.length;r++){var o=f[r];l[r]=t?y(u,c):l[r]||u;for(var i=0;i<a.length;i++)o[e]?o[e](a[i],l[r],c):o["on"+a[i]]=t?l[r]:null}return n.bind(null,!t)}("Event")};function b(n,t){return r&&f(window[n])?(e=window[n],o=t,void 0===(i=window)&&(i=null),f(e)?function(){e.apply(i,arguments),o.apply(i,arguments)}:o):window[n]=t;var e,o,i}b.bind(null,"onerror"),b.bind(null,"onload");var h="undefined"==typeof window,g="hidden",E=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function j(n,t){void 0===t&&(t={});var e=function(n,t){var e=this,r=!1;return function(o){r||(n.call(e,o),r=!0,setTimeout(function(){return r=!1},t))}}(n,t.throttle||1e4),r=[];function o(){var n=function(n){if(h)return!1;var t=h||g in document?g:["webkit","moz","ms","o"].reduce(function(n,t){var e=t+"Hidden";return!n&&e in document?e:n},null),e="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return n(Boolean(document[t]))},o=function(){return document.addEventListener(e,r)};return o(),function(){return document.removeEventListener(e,r),o}}(function(n){n||e({type:"tabVisible"})});return r=[n].concat(E.map(function(n){return w(document,n,e)})).concat(w(window,"load",e)).concat(w(window,"scroll",e,{capture:!0,passive:!0})),i}function i(){r.map(function(n){return n()})}return o(),function(){return i(),o}}function D(n){var t,e,r=n.onIdle,o=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,f=void 0===a?2e3:a,l=!1,d=!1,s=new Date,v=function(){return clearTimeout(t)};function p(n){v(),i&&!l&&i(L(s),n),o&&l&&(l=!1,o(L(e),n),s=new Date),t=setTimeout(function(){l=!0,r&&(e=new Date,r(L(s),n))},c)}var m=j(p,{throttle:f});return{disable:function(){d=!0,l=!1,v();var n=m();return function(){return d=!1,s=new Date,p({type:"load"}),n()}},getStatus:function(){return{isIdle:l,isDisabled:d,active:l?0:L(s,d),idle:l?L(e,d):0}}}}function L(n,t){return t?0:Math.round((new Date-n)/1e3)}n.onDomActivity=j,n.onIdle=function(n,e){return void 0===e&&(e={}),D(t({onIdle:n},e))},n.onUserActivity=D,n.onWakeUp=function(n,e){return void 0===e&&(e={}),D(t({onWakeUp:n},e))}});
//# sourceMappingURL=activity-utils.umd.js.map
{
"name": "@analytics/activity-utils",
"version": "0.1.12",
"version": "0.1.13",
"description": "User activity listener utilities",

@@ -52,6 +52,6 @@ "author": "David Wells",

"dependencies": {
"@analytics/listener-utils": "^0.2.10",
"@analytics/listener-utils": "^0.3.0",
"analytics-plugin-tab-events": "^0.2.1"
},
"gitHead": "104d15e3d891b1560459272443e11bf3b926028b"
"gitHead": "911491fffca5df822a6d8eb5b6255e47983e338c"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc