@amplitude/plugin-autocapture-browser 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/autocapture/track-action-click.d.ts.map +1 -1
- package/lib/cjs/autocapture/track-action-click.js.map +1 -1
- package/lib/cjs/autocapture/track-change.d.ts +3 -1
- package/lib/cjs/autocapture/track-change.d.ts.map +1 -1
- package/lib/cjs/autocapture/track-change.js +2 -2
- package/lib/cjs/autocapture/track-change.js.map +1 -1
- package/lib/cjs/autocapture/track-click.d.ts +3 -1
- package/lib/cjs/autocapture/track-click.d.ts.map +1 -1
- package/lib/cjs/autocapture/track-click.js +2 -2
- package/lib/cjs/autocapture/track-click.js.map +1 -1
- package/lib/cjs/autocapture-plugin.d.ts +1 -14
- package/lib/cjs/autocapture-plugin.d.ts.map +1 -1
- package/lib/cjs/autocapture-plugin.js +65 -77
- package/lib/cjs/autocapture-plugin.js.map +1 -1
- package/lib/cjs/helpers.d.ts +20 -1
- package/lib/cjs/helpers.d.ts.map +1 -1
- package/lib/cjs/helpers.js +59 -1
- package/lib/cjs/helpers.js.map +1 -1
- package/lib/cjs/observables.d.ts +10 -0
- package/lib/cjs/observables.d.ts.map +1 -0
- package/lib/cjs/observables.js +30 -0
- package/lib/cjs/observables.js.map +1 -0
- package/lib/cjs/pageActions/actions.d.ts +12 -0
- package/lib/cjs/pageActions/actions.d.ts.map +1 -0
- package/lib/cjs/pageActions/actions.js +65 -0
- package/lib/cjs/pageActions/actions.js.map +1 -0
- package/lib/cjs/pageActions/matchEventToFilter.d.ts +10 -0
- package/lib/cjs/pageActions/matchEventToFilter.d.ts.map +1 -0
- package/lib/cjs/pageActions/matchEventToFilter.js +30 -0
- package/lib/cjs/pageActions/matchEventToFilter.js.map +1 -0
- package/lib/cjs/pageActions/triggers.d.ts +20 -0
- package/lib/cjs/pageActions/triggers.d.ts.map +1 -0
- package/lib/cjs/pageActions/triggers.js +133 -0
- package/lib/cjs/pageActions/triggers.js.map +1 -0
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/autocapture/track-action-click.d.ts.map +1 -1
- package/lib/esm/autocapture/track-action-click.js +1 -1
- package/lib/esm/autocapture/track-action-click.js.map +1 -1
- package/lib/esm/autocapture/track-change.d.ts +3 -1
- package/lib/esm/autocapture/track-change.d.ts.map +1 -1
- package/lib/esm/autocapture/track-change.js +3 -3
- package/lib/esm/autocapture/track-change.js.map +1 -1
- package/lib/esm/autocapture/track-click.d.ts +3 -1
- package/lib/esm/autocapture/track-click.d.ts.map +1 -1
- package/lib/esm/autocapture/track-click.js +2 -2
- package/lib/esm/autocapture/track-click.js.map +1 -1
- package/lib/esm/autocapture-plugin.d.ts +1 -14
- package/lib/esm/autocapture-plugin.d.ts.map +1 -1
- package/lib/esm/autocapture-plugin.js +67 -78
- package/lib/esm/autocapture-plugin.js.map +1 -1
- package/lib/esm/helpers.d.ts +20 -1
- package/lib/esm/helpers.d.ts.map +1 -1
- package/lib/esm/helpers.js +55 -0
- package/lib/esm/helpers.js.map +1 -1
- package/lib/esm/observables.d.ts +10 -0
- package/lib/esm/observables.d.ts.map +1 -0
- package/lib/esm/observables.js +25 -0
- package/lib/esm/observables.js.map +1 -0
- package/lib/esm/pageActions/actions.d.ts +12 -0
- package/lib/esm/pageActions/actions.d.ts.map +1 -0
- package/lib/esm/pageActions/actions.js +59 -0
- package/lib/esm/pageActions/actions.js.map +1 -0
- package/lib/esm/pageActions/matchEventToFilter.d.ts +10 -0
- package/lib/esm/pageActions/matchEventToFilter.d.ts.map +1 -0
- package/lib/esm/pageActions/matchEventToFilter.js +26 -0
- package/lib/esm/pageActions/matchEventToFilter.js.map +1 -0
- package/lib/esm/pageActions/triggers.d.ts +20 -0
- package/lib/esm/pageActions/triggers.d.ts.map +1 -0
- package/lib/esm/pageActions/triggers.js +126 -0
- package/lib/esm/pageActions/triggers.js.map +1 -0
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.js.map +1 -1
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/autocapture/track-action-click.d.ts.map +1 -1
- package/lib/scripts/autocapture/track-change.d.ts +3 -1
- package/lib/scripts/autocapture/track-change.d.ts.map +1 -1
- package/lib/scripts/autocapture/track-click.d.ts +3 -1
- package/lib/scripts/autocapture/track-click.d.ts.map +1 -1
- package/lib/scripts/autocapture-plugin.d.ts +1 -14
- package/lib/scripts/autocapture-plugin.d.ts.map +1 -1
- package/lib/scripts/helpers.d.ts +20 -1
- package/lib/scripts/helpers.d.ts.map +1 -1
- package/lib/scripts/observables.d.ts +10 -0
- package/lib/scripts/observables.d.ts.map +1 -0
- package/lib/scripts/pageActions/actions.d.ts +12 -0
- package/lib/scripts/pageActions/actions.d.ts.map +1 -0
- package/lib/scripts/pageActions/matchEventToFilter.d.ts +10 -0
- package/lib/scripts/pageActions/matchEventToFilter.d.ts.map +1 -0
- package/lib/scripts/pageActions/triggers.d.ts +20 -0
- package/lib/scripts/pageActions/triggers.d.ts.map +1 -0
- package/lib/scripts/version.d.ts +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).amplitude={})}(this,(function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function s(t){return this instanceof s?(this.v=t,this):new s(t)}function a(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",(function(t){return function(e){return Promise.resolve(e).then(t,a)}})),r[Symbol.asyncIterator]=function(){return this},r;function u(t,e){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))},e&&(r[t]=e(r[t])))}function c(t,e){try{(n=i[t](e)).value instanceof s?Promise.resolve(n.value.v).then(l,a):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function a(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var d=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],h=["div","span","h1","h2","h3","h4","h5","h6"],p="[Amplitude] Element Clicked",v="[Amplitude] Element Tag",b="[Amplitude] Element Text",y="[Amplitude] Page URL",m="https://app.amplitude.com",g={US:m,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function w(t){return"function"==typeof t}function _(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var x=_((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function A(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var S=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(t){i=t instanceof x?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=u(d),p=h.next();!p.done;p=h.next()){var v=p.value;try{O(v)}catch(t){i=null!=i?i:[],t instanceof x?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new x(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)O(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&A(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&A(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),E=S.EMPTY;function k(t){return t instanceof S||t&&"closed"in t&&w(t.remove)&&w(t.add)&&w(t.unsubscribe)}function O(t){w(t)?t():t.unsubscribe()}var T={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},C=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function I(t){C((function(){throw t}))}function P(){}function j(t){t()}var N=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,k(e)&&e.add(n)):n.destination=R,n}return n(e,t),e.create=function(t,e,n){return new M(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(S),L=Function.prototype.bind;function F(t,e){return L.call(t,e)}var q=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){z(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){z(t)}else z(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){z(t)}},t}(),M=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;w(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&T.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&F(e.next,o),error:e.error&&F(e.error,o),complete:e.complete&&F(e.complete,o)}):i=e;return u.destination=new q(i),u}return n(e,t),e}(N);function z(t){I(t)}var R={closed:!0,next:P,error:function(t){throw t},complete:P},U="function"==typeof Symbol&&Symbol.observable||"@@observable";function V(t){return t}var D=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof N||function(t){return t&&w(t.next)&&w(t.error)&&w(t.complete)}(r)&&k(r)?t:new M(t,e,n);return j((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=H(e))((function(e,r){var i=new M({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[U]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0===(t=e).length?V:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=H(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function H(t){var e;return null!==(e=null!=t?t:T.Promise)&&void 0!==e?e:Promise}function W(t){return w(null==t?void 0:t.lift)}function Y(t){return function(e){if(W(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function B(t,e,n,r,i){return new G(t,e,n,r,i)}var G=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(N);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,W(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new S;var n=this.getSubject();e.add(this.source.subscribe(B(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=S.EMPTY)}return e},e.prototype.refCount=function(){return Y((function(t,e){var n=null;t._refCount++;var r=B(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(D);var J,X={now:function(){return(X.delegate||performance).now()},delegate:void 0},Z={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new S((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Z.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new D((function(t){var e=J||X,n=e.now(),r=0,i=function(){t.closed||(r=Z.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:J?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&Z.cancelAnimationFrame(r)}}));var $=_((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),K=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new Q(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new $},e.prototype.next=function(t){var e=this;j((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;j((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;j((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?E:(this.currentObservers=null,o.push(t),new S((function(){e.currentObservers=null,A(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new D;return t.source=this,t},e.create=function(t,e){return new Q(t,e)},e}(D),Q=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:E},e}(K);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(K);var tt={now:function(){return(tt.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=tt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(K),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(K);var et,nt=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(S),rt=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},it=function(t){return clearInterval(t)},ot=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),rt(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&it(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,A(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(nt),ut=1,ct={};function lt(t){return t in ct&&(delete ct[t],!0)}var st=function(t){var e=ut++;return ct[e]=!0,et||(et=Promise.resolve()),et.then((function(){return lt(e)&&t()})),e},at=function(t){lt(t)},ft={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ft.delegate;return((null==n?void 0:n.setImmediate)||st).apply(void 0,l([],c(t)))},clearImmediate:function(t){return at(t)},delegate:void 0},dt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=ft.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(ft.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(ot),ht=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=tt.now,t}(),pt=function(t){function e(e,n){void 0===n&&(n=ht.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(ht),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(pt);new vt(dt);var bt=new pt(ot),yt=bt,mt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(ot),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(pt);new gt(mt);var wt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Z.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&n===e._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(Z.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ot),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){var e;this._active=!0,t?e=t.id:(e=this._scheduled,this._scheduled=void 0);var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(pt);new _t(wt),function(t){function e(e,n){void 0===e&&(e=xt),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(pt);var xt=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return S.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ot),At=new D((function(t){return t.complete()}));function St(t){return t&&w(t.schedule)}function Et(t){return t[t.length-1]}function kt(t){return St(Et(t))?t.pop():void 0}var Ot=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Tt(t){return w(null==t?void 0:t.then)}function Ct(t){return w(t[U])}function It(t){return Symbol.asyncIterator&&w(null==t?void 0:t[Symbol.asyncIterator])}function Pt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var jt,Nt="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Lt(t){return w(null==t?void 0:t[Nt])}function Ft(t){return a(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,s(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,s(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,s(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function qt(t){return w(null==t?void 0:t.getReader)}function Mt(t){if(t instanceof D)return t;if(null!=t){if(Ct(t))return i=t,new D((function(t){var e=i[U]();if(w(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ot(t))return r=t,new D((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Tt(t))return n=t,new D((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,I)}));if(It(t))return zt(t);if(Lt(t))return e=t,new D((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(qt(t))return zt(Ft(t))}var e,n,r,i;throw Pt(t)}function zt(t){return new D((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Rt(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Ut(t,e){return void 0===e&&(e=0),Y((function(n,r){n.subscribe(B(r,(function(n){return Rt(r,t,(function(){return r.next(n)}),e)}),(function(){return Rt(r,t,(function(){return r.complete()}),e)}),(function(n){return Rt(r,t,(function(){return r.error(n)}),e)})))}))}function Vt(t,e){return void 0===e&&(e=0),Y((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Dt(t,e){if(!t)throw new Error("Iterable cannot be null");return new D((function(n){Rt(n,e,(function(){var r=t[Symbol.asyncIterator]();Rt(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Ht(t,e){if(null!=t){if(Ct(t))return function(t,e){return Mt(t).pipe(Vt(e),Ut(e))}(t,e);if(Ot(t))return function(t,e){return new D((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Tt(t))return function(t,e){return Mt(t).pipe(Vt(e),Ut(e))}(t,e);if(It(t))return Dt(t,e);if(Lt(t))return function(t,e){return new D((function(n){var r;return Rt(n,e,(function(){r=t[Nt](),Rt(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return w(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(qt(t))return function(t,e){return Dt(Ft(t),e)}(t,e)}throw Pt(t)}function Wt(t,e){return e?Ht(t,e):Mt(t)}function Yt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(jt||(jt={})),_((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),_((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),_((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),_((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Bt=_((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Gt(t){throw new Bt(t)}function Jt(t,e){return Y((function(n,r){var i=0;n.subscribe(B(r,(function(n){r.next(t.call(e,n,i++))})))}))}var Xt=Array.isArray;function Zt(t){return Jt((function(e){return function(t,e){return Xt(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function $t(t,e,n){return void 0===n&&(n=1/0),w(e)?$t((function(n,r){return Jt((function(t,i){return e(n,t,r,i)}))(Mt(t(n,r)))}),n):("number"==typeof e&&(n=e),Y((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],s=0,a=0,f=!1,d=function(){!f||l.length||s||e.complete()},h=function(t){return s<r?p(t):l.push(t)},p=function(t){o&&e.next(t),s++;var c=!1;Mt(n(t,a++)).subscribe(B(e,(function(t){null==i||i(t),o?h(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{s--;for(var t=function(){var t=l.shift();u?Rt(e,u,(function(){return p(t)})):p(t)};l.length&&s<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(B(e,h,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function Kt(t){return void 0===t&&(t=1/0),$t(V,t)}function Qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kt(1)(Wt(t,kt(t)))}var te=["addListener","removeListener"],ee=["addEventListener","removeEventListener"],ne=["on","off"];function re(t,e,n,r){if(w(n)&&(r=n,n=void 0),r)return re(t,e,n).pipe(Zt(r));var i=c(function(t){return w(t.addEventListener)&&w(t.removeEventListener)}(t)?ee.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return w(t.addListener)&&w(t.removeListener)}(t)?te.map(ie(t,e)):function(t){return w(t.on)&&w(t.off)}(t)?ne.map(ie(t,e)):[],2),o=i[0],u=i[1];if(!o&&Ot(t))return $t((function(t){return re(t,e,n)}))(Mt(t));if(!o)throw new TypeError("Invalid event target");return new D((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function ie(t,e){return function(n){return function(r){return t[n](e,r)}}}function oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=kt(t),r=function(t,e){return"number"==typeof Et(t)?t.pop():e}(t,1/0),i=t;return i.length?1===i.length?Mt(i[0]):Kt(r)(Wt(i,n)):At}function ue(t,e){return Y((function(n,r){var i=0;n.subscribe(B(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function ce(t){return t<=0?function(){return At}:Y((function(e,n){var r=0;e.subscribe(B(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function le(t,e){return e?function(n){return Qt(e.pipe(ce(1),Y((function(t,e){t.subscribe(B(e,P))}))),n.pipe(le(t)))}:$t((function(e,n){return Mt(t(e,n)).pipe(ce(1),function(t){return Jt((function(){return t}))}(e))}))}function se(t,e){void 0===e&&(e=bt);var n=function(t,e,n){void 0===t&&(t=0),void 0===n&&(n=yt);var r=-1;return null!=e&&(St(e)?n=e:r=e),new D((function(e){var i=Yt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}(t,e);return le((function(){return n}))}function ae(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new K}:e,r=t.resetOnError,i=void 0===r||r,o=t.resetOnComplete,u=void 0===o||o,c=t.resetOnRefCountZero,l=void 0===c||c;return function(t){var e,r,o,c=0,s=!1,a=!1,f=function(){null==r||r.unsubscribe(),r=void 0},d=function(){f(),e=o=void 0,s=a=!1},h=function(){var t=e;d(),null==t||t.unsubscribe()};return Y((function(t,p){c++,a||s||f();var v=o=null!=o?o:n();p.add((function(){0!==--c||a||s||(r=fe(h,l))})),v.subscribe(p),!e&&c>0&&(e=new M({next:function(t){return v.next(t)},error:function(t){a=!0,f(),r=fe(d,i,t),v.error(t)},complete:function(){s=!0,f(),r=fe(d,u),v.complete()}}),Mt(t).subscribe(e))}))(t)}}function fe(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==e){if(!1!==e){var i=new M({next:function(){i.unsubscribe(),t()}});return Mt(e.apply(void 0,l([],c(n)))).subscribe(i)}}else t()}new D(P);var de=["input","select","textarea"],he=function(t,e){return function(n,r){var i,o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,s=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!s)return!1;if(l)return l(n,r);if(!ye(window.location.href,c))return!1;var a=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof a)switch(a.toLowerCase()){case"hidden":case"password":return!1}if(e){var f=e.some((function(t){var e;return!!(null===(e=null==r?void 0:r.matches)||void 0===e?void 0:e.call(r,t))}));if(!f)return!1}switch(s){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},pe=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},ve=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!de.includes(i)&&!o},be=function(t){var e="";return ve(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=be(t),e+=r.split(/(\s+)/).filter(pe).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},ye=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},me=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},ge=function(t){var e,n=t.parentElement;if(!n)return"";try{e=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(t){e=null}if(e){var r=e.textContent||"";return pe(r)?r:""}return ge(n)},we=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:we(null==t?void 0:t.parentElement,e):null},_e=function(t){var e,n,r;if(!t)return{};var i=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((e={})[v]=i,e[b]=be(t),e[y]=window.location.href.split("?")[0],e);return me(o)};var xe=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},Ae=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?m:e,r=this;this.endpoint=m,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===m&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,s,a;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,h=null==d?void 0:d.action;if(h)if("id"in d)null===(s=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===s||s.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===h)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===h){var p=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:_e,isElementSelectable:function(t){return!o||o((null==p?void 0:p.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===h&&(null===(a=null==l?void 0:l.close)||void 0===a||a.call(l))}})),this.notify({action:"page-loaded"})},t}(),Se=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Ee=["type"],ke=["svg","path","g"],Oe=["password","hidden"];var Te=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=Ce(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=String(t.tagName).toLowerCase(),s={tag:l},a=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);a.length&&(s.index=a.indexOf(t),s.indexOfType=a.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(s.prevSib=String(f));var d=t.getAttribute("id");d&&(s.id=String(d));var h=Array.from(t.classList);h.length&&(s.classes=h);var p={},v=Array.from(t.attributes).filter((function(t){return!Se.includes(t.name)})),b=!ve(t);if(!Oe.includes(String(t.getAttribute("type")))&&!ke.includes(l))try{for(var y=u(v),m=y.next();!m.done;m=y.next()){var g=m.value;b&&!Ee.includes(g.name)||(p[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=y.return)&&n.call(y)}finally{if(e)throw e.error}}return Object.keys(p).length&&(s.attrs=p),s}(t)})),1024),e):[]};function Ce(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return Ce(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(Ce(n,!0)),": ").concat(String(Ce(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}var Ie;function Pe(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,s=t.shouldTrackEvent,a=o.clickObservable,f=a.pipe(Y((function(t,e){var n,r=!1;t.subscribe(B(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),ue((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),d=oe(f,a.pipe((e=l.debounceTime,void 0===n&&(n=bt),Y((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(B(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),Jt((function(){return"timeout"}))));return a.pipe(se(0),ue(xe),ue((function(t){return s("click",t.closestTrackedAncestor)})),(r=d,Y((function(t,e){var n=[];return t.subscribe(B(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),Mt(r).subscribe(B(e,(function(){var t=n;n=[],e.next(t)}),P)),function(){n=null}})))).subscribe((function(t){var e,n,r=(t.length,p);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function je(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,s=n.clickObservable,a=n.mutationObservable,f=n.navigateObservable,d=s.pipe(ue((function(t){return!o("click",t.closestTrackedAncestor)})),Jt((function(t){var e=we(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),ue(xe),ue((function(t){return u("click",t.closestTrackedAncestor)}))),h=[a];f&&h.push(f);var v,b,y=oe.apply(void 0,l([],c(h),!1)),m=d.pipe((v=function(t){return y.pipe(ce(1),function(t,e){var n=Yt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Gt:o,c=n.scheduler,l=void 0===c?null!=e?e:bt:c,s=n.meta,a=void 0===s?null:s;if(null==r&&null==i)throw new TypeError("No timeout provided.");return Y((function(t,e){var n,o,c=null,s=0,f=function(t){o=Rt(e,l,(function(){try{n.unsubscribe(),Mt(u({meta:a,lastValue:c,seen:s})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(B(e,(function(t){null==o||o.unsubscribe(),s++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!s&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return At}}),Jt((function(){return t})))},Y((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(B(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;Mt(v(t,u)).subscribe(n=B(e,(function(n){return e.next(b?b(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(p,i("click",t.closestTrackedAncestor))}))}!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ie||(Ie={}));var Ne=function(t){var e,n,s;void 0===t&&(t={});var a=t.dataAttributePrefix,f=void 0===a?"data-amp-track-":a,p=t.visualTaggingOptions,m=void 0===p?{enabled:!0,messenger:new Ae}:p;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:d,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:h,t.debounceTime=null!==(s=t.debounceTime)&&void 0!==s?s:0;var w="@amplitude/plugin-autocapture-browser",_=[],x=function(t,e){var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},c=e.getAttribute("aria-label"),l=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,f),s=ge(e),a=((n={})["[Amplitude] Element ID"]=e.getAttribute("id")||"",n["[Amplitude] Element Class"]=e.getAttribute("class"),n["[Amplitude] Element Hierarchy"]=Te(e),n[v]=o,n[b]=be(e),n["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),n["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),n["[Amplitude] Element Aria Label"]=c,n["[Amplitude] Element Attributes"]=l,n["[Amplitude] Element Parent Label"]=s,n[y]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===o&&"click"===t&&e instanceof HTMLAnchorElement&&(a["[Amplitude] Element Href"]=e.href),me(a)},A=function(e,n){var r={event:e,timestamp:Date.now(),type:n};if(function(t){return"click"===t.type||"change"===t.type}(r)&&null!==r.event.target){var i=we(r.event.target,t.cssSelectorAllowlist);return i&&(r.closestTrackedAncestor=i,r.targetElementProperties=x(r.type,i)),r}return r};return{name:w,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,s,a,f,d,h,p,v,b;return o(this,(function(o){return"undefined"==typeof document||(i=he(t,t.cssSelectorAllowlist),u=he(t,t.actionClickAllowlist),s=function(){var t,e,n=re(document,"click",{capture:!0}).pipe(Jt((function(t){return A(t,"click")})),ae()),r=re(document,"change",{capture:!0}).pipe(Jt((function(t){return A(t,"change")})),ae());window.navigation&&(e=re(window.navigation,"navigate").pipe(Jt((function(t){return A(t,"navigate")})),ae()));var i=new D((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})).pipe(Jt((function(t){return A(t,"mutation")})),ae());return(t={})[Ie.ClickObservable]=n,t[Ie.ChangeObservable]=r,t[Ie.NavigateObservable]=e,t[Ie.MutationObservable]=i,t}(),a=Pe({allObservables:s,options:t,amplitude:n,shouldTrackEvent:i}),_.push(a),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent;return n.changeObservable.pipe(ue(xe),ue((function(t){return i("change",t.closestTrackedAncestor)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:x,amplitude:n,shouldTrackEvent:i}),_.push(f),d=je({allObservables:s,options:t,getEventProperties:x,amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),_.push(d),null===(v=null==e?void 0:e.loggerProvider)||void 0===v||v.log("".concat(w," has been successfully added.")),window.opener&&m.enabled&&(h=t.cssSelectorAllowlist,p=t.actionClickAllowlist,null===(b=m.messenger)||void 0===b||b.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:g[e.serverZone]}),{isElementSelectable:he(t,l(l([],c(h),!1),c(p),!1)),cssSelectorAllowlist:h,actionClickAllowlist:p})))),[2]}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(_),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};t.WindowMessenger=Ae,t.autocapturePlugin=Ne,t.plugin=Ne,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).amplitude={})}(this,(function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function s(t){return this instanceof s?(this.v=t,this):new s(t)}function a(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",(function(t){return function(e){return Promise.resolve(e).then(t,a)}})),r[Symbol.asyncIterator]=function(){return this},r;function u(t,e){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))},e&&(r[t]=e(r[t])))}function c(t,e){try{(n=i[t](e)).value instanceof s?Promise.resolve(n.value.v).then(l,a):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function a(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var d=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],p=["div","span","h1","h2","h3","h4","h5","h6"],v="[Amplitude] Element Clicked",h="[Amplitude] Element Tag",y="[Amplitude] Element Text",b="[Amplitude] Page URL",m="https://app.amplitude.com",g={US:m,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function w(t){return"function"==typeof t}function _(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var x=_((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function A(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var E=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(t){i=t instanceof x?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=u(d),v=p.next();!v.done;v=p.next()){var h=v.value;try{T(h)}catch(t){i=null!=i?i:[],t instanceof x?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}if(i)throw new x(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)T(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&A(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&A(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),S=E.EMPTY;function k(t){return t instanceof E||t&&"closed"in t&&w(t.remove)&&w(t.add)&&w(t.unsubscribe)}function T(t){w(t)?t():t.unsubscribe()}var O={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},C=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function P(t){C((function(){throw t}))}function I(){}function j(t){t()}var L=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,k(e)&&e.add(n)):n.destination=z,n}return n(e,t),e.create=function(t,e,n){return new M(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(E),N=Function.prototype.bind;function q(t,e){return N.call(t,e)}var F=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){R(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){R(t)}else R(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){R(t)}},t}(),M=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;w(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&O.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&q(e.next,o),error:e.error&&q(e.error,o),complete:e.complete&&q(e.complete,o)}):i=e;return u.destination=new F(i),u}return n(e,t),e}(L);function R(t){P(t)}var z={closed:!0,next:I,error:function(t){throw t},complete:I},D="function"==typeof Symbol&&Symbol.observable||"@@observable";function V(t){return t}var U=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof L||function(t){return t&&w(t.next)&&w(t.error)&&w(t.complete)}(r)&&k(r)?t:new M(t,e,n);return j((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=H(e))((function(e,r){var i=new M({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[D]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0===(t=e).length?V:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=H(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function H(t){var e;return null!==(e=null!=t?t:O.Promise)&&void 0!==e?e:Promise}function W(t){return w(null==t?void 0:t.lift)}function Y(t){return function(e){if(W(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function B(t,e,n,r,i){return new X(t,e,n,r,i)}var X=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(L);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,W(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new E;var n=this.getSubject();e.add(this.source.subscribe(B(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=E.EMPTY)}return e},e.prototype.refCount=function(){return Y((function(t,e){var n=null;t._refCount++;var r=B(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(U);var G,J={now:function(){return(J.delegate||performance).now()},delegate:void 0},Z={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new E((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Z.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new U((function(t){var e=G||J,n=e.now(),r=0,i=function(){t.closed||(r=Z.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:G?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&Z.cancelAnimationFrame(r)}}));var $=_((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),K=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new Q(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new $},e.prototype.next=function(t){var e=this;j((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;j((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;j((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?S:(this.currentObservers=null,o.push(t),new E((function(){e.currentObservers=null,A(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new U;return t.source=this,t},e.create=function(t,e){return new Q(t,e)},e}(U),Q=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:S},e}(K);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(K);var tt={now:function(){return(tt.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=tt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(K),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(K);var et,nt=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(E),rt=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},it=function(t){return clearInterval(t)},ot=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),rt(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&it(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,A(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(nt),ut=1,ct={};function lt(t){return t in ct&&(delete ct[t],!0)}var st=function(t){var e=ut++;return ct[e]=!0,et||(et=Promise.resolve()),et.then((function(){return lt(e)&&t()})),e},at=function(t){lt(t)},ft={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ft.delegate;return((null==n?void 0:n.setImmediate)||st).apply(void 0,l([],c(t)))},clearImmediate:function(t){return at(t)},delegate:void 0},dt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=ft.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(ft.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(ot),pt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=tt.now,t}(),vt=function(t){function e(e,n){void 0===n&&(n=pt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(pt),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new ht(dt);var yt=new vt(ot),bt=yt,mt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(ot),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(vt);new gt(mt);var wt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Z.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&n===e._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(Z.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ot),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){var e;this._active=!0,t?e=t.id:(e=this._scheduled,this._scheduled=void 0);var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new _t(wt),function(t){function e(e,n){void 0===e&&(e=xt),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(vt);var xt=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return E.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ot),At=new U((function(t){return t.complete()}));function Et(t){return t&&w(t.schedule)}function St(t){return t[t.length-1]}function kt(t){return Et(St(t))?t.pop():void 0}var Tt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Ot(t){return w(null==t?void 0:t.then)}function Ct(t){return w(t[D])}function Pt(t){return Symbol.asyncIterator&&w(null==t?void 0:t[Symbol.asyncIterator])}function It(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var jt,Lt="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Nt(t){return w(null==t?void 0:t[Lt])}function qt(t){return a(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,s(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,s(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,s(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function Ft(t){return w(null==t?void 0:t.getReader)}function Mt(t){if(t instanceof U)return t;if(null!=t){if(Ct(t))return i=t,new U((function(t){var e=i[D]();if(w(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Tt(t))return r=t,new U((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Ot(t))return n=t,new U((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,P)}));if(Pt(t))return Rt(t);if(Nt(t))return e=t,new U((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(Ft(t))return Rt(qt(t))}var e,n,r,i;throw It(t)}function Rt(t){return new U((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function zt(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Dt(t,e){return void 0===e&&(e=0),Y((function(n,r){n.subscribe(B(r,(function(n){return zt(r,t,(function(){return r.next(n)}),e)}),(function(){return zt(r,t,(function(){return r.complete()}),e)}),(function(n){return zt(r,t,(function(){return r.error(n)}),e)})))}))}function Vt(t,e){return void 0===e&&(e=0),Y((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Ut(t,e){if(!t)throw new Error("Iterable cannot be null");return new U((function(n){zt(n,e,(function(){var r=t[Symbol.asyncIterator]();zt(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Ht(t,e){if(null!=t){if(Ct(t))return function(t,e){return Mt(t).pipe(Vt(e),Dt(e))}(t,e);if(Tt(t))return function(t,e){return new U((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Ot(t))return function(t,e){return Mt(t).pipe(Vt(e),Dt(e))}(t,e);if(Pt(t))return Ut(t,e);if(Nt(t))return function(t,e){return new U((function(n){var r;return zt(n,e,(function(){r=t[Lt](),zt(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return w(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(Ft(t))return function(t,e){return Ut(qt(t),e)}(t,e)}throw It(t)}function Wt(t,e){return e?Ht(t,e):Mt(t)}function Yt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(jt||(jt={})),_((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),_((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),_((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),_((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Bt=_((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Xt(t){throw new Bt(t)}function Gt(t,e){return Y((function(n,r){var i=0;n.subscribe(B(r,(function(n){r.next(t.call(e,n,i++))})))}))}var Jt=Array.isArray;function Zt(t){return Gt((function(e){return function(t,e){return Jt(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function $t(t,e,n){return void 0===n&&(n=1/0),w(e)?$t((function(n,r){return Gt((function(t,i){return e(n,t,r,i)}))(Mt(t(n,r)))}),n):("number"==typeof e&&(n=e),Y((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],s=0,a=0,f=!1,d=function(){!f||l.length||s||e.complete()},p=function(t){return s<r?v(t):l.push(t)},v=function(t){o&&e.next(t),s++;var c=!1;Mt(n(t,a++)).subscribe(B(e,(function(t){null==i||i(t),o?p(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{s--;for(var t=function(){var t=l.shift();u?zt(e,u,(function(){return v(t)})):v(t)};l.length&&s<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(B(e,p,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function Kt(t){return void 0===t&&(t=1/0),$t(V,t)}function Qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kt(1)(Wt(t,kt(t)))}var te=["addListener","removeListener"],ee=["addEventListener","removeEventListener"],ne=["on","off"];function re(t,e,n,r){if(w(n)&&(r=n,n=void 0),r)return re(t,e,n).pipe(Zt(r));var i=c(function(t){return w(t.addEventListener)&&w(t.removeEventListener)}(t)?ee.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return w(t.addListener)&&w(t.removeListener)}(t)?te.map(ie(t,e)):function(t){return w(t.on)&&w(t.off)}(t)?ne.map(ie(t,e)):[],2),o=i[0],u=i[1];if(!o&&Tt(t))return $t((function(t){return re(t,e,n)}))(Mt(t));if(!o)throw new TypeError("Invalid event target");return new U((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function ie(t,e){return function(n){return function(r){return t[n](e,r)}}}function oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=kt(t),r=function(t,e){return"number"==typeof St(t)?t.pop():e}(t,1/0),i=t;return i.length?1===i.length?Mt(i[0]):Kt(r)(Wt(i,n)):At}function ue(t,e){return Y((function(n,r){var i=0;n.subscribe(B(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function ce(t){return t<=0?function(){return At}:Y((function(e,n){var r=0;e.subscribe(B(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function le(t,e){return e?function(n){return Qt(e.pipe(ce(1),Y((function(t,e){t.subscribe(B(e,I))}))),n.pipe(le(t)))}:$t((function(e,n){return Mt(t(e,n)).pipe(ce(1),function(t){return Gt((function(){return t}))}(e))}))}function se(t,e){void 0===e&&(e=yt);var n=function(t,e,n){void 0===t&&(t=0),void 0===n&&(n=bt);var r=-1;return null!=e&&(Et(e)?n=e:r=e),new U((function(e){var i=Yt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}(t,e);return le((function(){return n}))}function ae(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new K}:e,r=t.resetOnError,i=void 0===r||r,o=t.resetOnComplete,u=void 0===o||o,c=t.resetOnRefCountZero,l=void 0===c||c;return function(t){var e,r,o,c=0,s=!1,a=!1,f=function(){null==r||r.unsubscribe(),r=void 0},d=function(){f(),e=o=void 0,s=a=!1},p=function(){var t=e;d(),null==t||t.unsubscribe()};return Y((function(t,v){c++,a||s||f();var h=o=null!=o?o:n();v.add((function(){0!==--c||a||s||(r=fe(p,l))})),h.subscribe(v),!e&&c>0&&(e=new M({next:function(t){return h.next(t)},error:function(t){a=!0,f(),r=fe(d,i,t),h.error(t)},complete:function(){s=!0,f(),r=fe(d,u),h.complete()}}),Mt(t).subscribe(e))}))(t)}}function fe(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==e){if(!1!==e){var i=new M({next:function(){i.unsubscribe(),t()}});return Mt(e.apply(void 0,l([],c(n)))).subscribe(i)}}else t()}new U(I);var de=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],pe=["type"],ve=["svg","path","g"],he=["password","hidden"];var ye=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=be(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=String(t.tagName).toLowerCase(),s={tag:l},a=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);a.length&&(s.index=a.indexOf(t),s.indexOfType=a.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(s.prevSib=String(f));var d=t.getAttribute("id");d&&(s.id=String(d));var p=Array.from(t.classList);p.length&&(s.classes=p);var v={},h=Array.from(t.attributes).filter((function(t){return!de.includes(t.name)})),y=!_e(t);if(!he.includes(String(t.getAttribute("type")))&&!ve.includes(l))try{for(var b=u(h),m=b.next();!m.done;m=b.next()){var g=m.value;y&&!pe.includes(g.name)||(v[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return Object.keys(v).length&&(s.attrs=v),s}(t)})),1024),e):[]};function be(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return be(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(be(n,!0)),": ").concat(String(be(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}var me=["input","select","textarea"],ge=function(t,e){return function(n,r){var i,o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,s=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!s)return!1;if(l)return l(n,r);if(!Ae(window.location.href,c))return!1;var a=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof a)switch(a.toLowerCase()){case"hidden":case"password":return!1}if(e){var f=e.some((function(t){var e;return!!(null===(e=null==r?void 0:r.matches)||void 0===e?void 0:e.call(r,t))}));if(!f)return!1}switch(s){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},we=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},_e=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!me.includes(i)&&!o},xe=function(t){var e="";return _e(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=xe(t),e+=r.split(/(\s+)/).filter(we).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Ae=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},Ee=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},Se=function(t){var e,n=t.parentElement;if(!n)return"";try{e=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(t){e=null}if(e){var r=e.textContent||"";return we(r)?r:""}return Se(n)},ke=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:ke(null==t?void 0:t.parentElement,e):null},Te=function(t){var e,n,r;if(!t)return{};var i=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((e={})[h]=i,e[y]=xe(t),e[b]=window.location.href.split("?")[0],e);return Ee(o)};var Oe=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},Ce=function(t,e,n){var r,i,o,u=null===(o=null===(i=null==e?void 0:e.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),c="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},l=e.getAttribute("aria-label"),s=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,n),a=Se(e),f=((r={})["[Amplitude] Element ID"]=e.getAttribute("id")||"",r["[Amplitude] Element Class"]=e.getAttribute("class"),r["[Amplitude] Element Hierarchy"]=ye(e),r[h]=u,r[y]=xe(e),r["[Amplitude] Element Position Left"]=null==c.left?null:Math.round(c.left),r["[Amplitude] Element Position Top"]=null==c.top?null:Math.round(c.top),r["[Amplitude] Element Aria Label"]=l,r["[Amplitude] Element Attributes"]=s,r["[Amplitude] Element Parent Label"]=a,r[b]=window.location.href.split("?")[0],r["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return"a"===u&&"click"===t&&e instanceof HTMLAnchorElement&&(f["[Amplitude] Element Href"]=e.href),Ee(f)},Pe=function(t,e,n,r){var i={event:t,timestamp:Date.now(),type:e};if(function(t){return"click"===t.type||"change"===t.type}(i)&&null!==i.event.target){var o=ke(i.event.target,n);return o&&(i.closestTrackedAncestor=o,i.targetElementProperties=Ce(i.type,o,r)),i}return i};var Ie=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?m:e,r=this;this.endpoint=m,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===m&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,s,a;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,p=null==d?void 0:d.action;if(p)if("id"in d)null===(s=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===s||s.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===p)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var v=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:Te,isElementSelectable:function(t){return!o||o((null==v?void 0:v.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(a=null==l?void 0:l.close)||void 0===a||a.call(l))}})),this.notify({action:"page-loaded"})},t}();function je(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,s=t.shouldTrackEvent,a=t.evaluateTriggers,f=o.clickObservable,d=f.pipe(Y((function(t,e){var n,r=!1;t.subscribe(B(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),ue((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),p=oe(d,f.pipe((e=l.debounceTime,void 0===n&&(n=yt),Y((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(B(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),Gt((function(){return"timeout"}))));return f.pipe(se(0),ue(Oe),ue((function(t){return s("click",t.closestTrackedAncestor)})),Gt((function(t){return a(t)})),(r=p,Y((function(t,e){var n=[];return t.subscribe(B(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),Mt(r).subscribe(B(e,(function(){var t=n;n=[],e.next(t)}),I)),function(){n=null}})))).subscribe((function(t){var e,n,r=(t.length,v);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function Le(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,s=n.clickObservable,a=n.mutationObservable,f=n.navigateObservable,d=s.pipe(ue((function(t){return!o("click",t.closestTrackedAncestor)})),Gt((function(t){var e=ke(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),ue(Oe),ue((function(t){return u("click",t.closestTrackedAncestor)}))),p=[a];f&&p.push(f);var h,y,b=oe.apply(void 0,l([],c(p),!1)),m=d.pipe((h=function(t){return b.pipe(ce(1),function(t,e){var n=Yt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Xt:o,c=n.scheduler,l=void 0===c?null!=e?e:yt:c,s=n.meta,a=void 0===s?null:s;if(null==r&&null==i)throw new TypeError("No timeout provided.");return Y((function(t,e){var n,o,c=null,s=0,f=function(t){o=zt(e,l,(function(){try{n.unsubscribe(),Mt(u({meta:a,lastValue:c,seen:s})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(B(e,(function(t){null==o||o.unsubscribe(),s++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!s&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return At}}),Gt((function(){return t})))},Y((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(B(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;Mt(h(t,u)).subscribe(n=B(e,(function(n){return e.next(y?y(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(v,i("click",t.closestTrackedAncestor))}))}var Ne,qe=function(t,e){return e.filter((function(e){return e.definition.some((function(e){return e.event_type===t.type&&e.filters.every((function(e){return function(t,e){try{if("[Amplitude] Element Text"===e.subprop_key)return"exact"===e.subprop_op&&e.subprop_value.includes(t.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===e.subprop_key)return"autotrack css match"===e.subprop_op&&!!t.closestTrackedAncestor.closest(e.subprop_value.toString())}catch(t){return console.error("Error matching event to filter",t),!1}return!1}(t,e)}))}))}))},Fe=function(t,e){if("DOM_ELEMENT"===t.sourceType){var n=function(t,e){if("DOM_ELEMENT"===t.sourceType){var n=document.documentElement;return t.scope&&e&&(n=e.closest(t.scope)),n&&t.selector?n.querySelector(t.selector):n}}(t,e);if(!n)return;return"TEXT"===t.elementExtractType?n.textContent:"ATTRIBUTE"===t.elementExtractType&&t.attribute?n.getAttribute(t.attribute):void 0}},Me=function(t,e){t.forEach((function(t){if("string"!=typeof t&&"ATTACH_EVENT_PROPERTY"===t.actionType){var n=Fe(t.dataSource,e.closestTrackedAncestor);e.targetElementProperties[t.destinationKey]=n}}))};!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ne||(Ne={}));var Re=function(t){var e,n,s,a,f,v,h;void 0===t&&(t={});var y=t.dataAttributePrefix,b=void 0===y?"data-amp-track-":y,m=t.visualTaggingOptions,w=void 0===m?{enabled:!0,messenger:new Ie}:m;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:d,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:p,t.debounceTime=null!==(s=t.debounceTime)&&void 0!==s?s:0;var _="@amplitude/plugin-autocapture-browser",x=[],A=function(){var e,n,r=re(document,"click",{capture:!0}).pipe(Gt((function(e){return Pe(e,"click",t.cssSelectorAllowlist,b)})),ae()),i=re(document,"change",{capture:!0}).pipe(Gt((function(e){return Pe(e,"change",t.cssSelectorAllowlist,b)})),ae());window.navigation&&(n=re(window.navigation,"navigate").pipe(Gt((function(e){return Pe(e,"navigate",t.cssSelectorAllowlist,b)})),ae()));var o=new U((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})).pipe(Gt((function(e){return Pe(e,"mutation",t.cssSelectorAllowlist,b)})),ae());return(e={})[Ne.ClickObservable]=r,e[Ne.ChangeObservable]=i,e[Ne.NavigateObservable]=n,e[Ne.MutationObservable]=o,e},E=function(t){var e,n,r,i,o,c={click:new Set,change:new Set};if(!t)return c;try{for(var l=u(t),s=l.next();!s.done;s=l.next()){var a=s.value;try{try{for(var f=(r=void 0,u(a.definition)),d=f.next();!d.done;d=f.next())null===(o=c[d.value.event_type])||void 0===o||o.add(a.id)}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}catch(t){console.warn("Skipping Labeled Event due to malformed definition",null==a?void 0:a.id,t)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return c}(Object.values(null!==(f=null===(a=t.pageActions)||void 0===a?void 0:a.labeledEvents)&&void 0!==f?f:{})),S=function(t){var e,n,r,i,o=new Map;try{for(var c=u(t),l=c.next();!l.done;l=c.next()){var s=l.value;try{for(var a=(r=void 0,u(s.conditions)),f=a.next();!f.done;f=a.next()){var d=f.value;if("LABELED_EVENT"===d.type){var p=d.match.eventId,v=o.get(p);v||(v=[],o.set(p,v)),v.push(s)}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return o}(null!==(h=null===(v=t.pageActions)||void 0===v?void 0:v.triggers)&&void 0!==h?h:[]),k=function(e){var n,r,i=t.pageActions;if(!i)return e;var o=function(t,e){var n,r,i=new Set;try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value,s=e.get(l.id);s&&s.forEach((function(t){return i.add(t)}))}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return Array.from(i)}(qe(e,Array.from(E[e.type]).map((function(t){return i.labeledEvents[t]}))),S);try{for(var c=u(o),l=c.next();!l.done;l=c.next()){var s=l.value;Me(s.actions,e)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e};return{name:_,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,s,a,f,d,p,v,h,y;return o(this,(function(o){return"undefined"==typeof document||(i=ge(t,t.cssSelectorAllowlist),u=ge(t,t.actionClickAllowlist),s=A(),a=je({allObservables:s,options:t,amplitude:n,shouldTrackEvent:i,evaluateTriggers:k}),x.push(a),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent,o=t.evaluateTriggers;return n.changeObservable.pipe(ue(Oe),ue((function(t){return i("change",t.closestTrackedAncestor)})),Gt((function(t){return o(t)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ce.apply(void 0,l(l([],c(t),!1),[b],!1))},amplitude:n,shouldTrackEvent:i,evaluateTriggers:k}),x.push(f),d=Le({allObservables:s,options:t,getEventProperties:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ce.apply(void 0,l(l([],c(t),!1),[b],!1))},amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),x.push(d),null===(h=null==e?void 0:e.loggerProvider)||void 0===h||h.log("".concat(_," has been successfully added.")),window.opener&&w.enabled&&(p=t.cssSelectorAllowlist,v=t.actionClickAllowlist,null===(y=w.messenger)||void 0===y||y.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:g[e.serverZone]}),{isElementSelectable:ge(t,l(l([],c(p),!1),c(v),!1)),cssSelectorAllowlist:p,actionClickAllowlist:v})))),[2]}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(x),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};t.WindowMessenger=Ie,t.autocapturePlugin=Re,t.plugin=Re,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track-action-click.d.ts","sourceRoot":"","sources":["../../../src/autocapture/track-action-click.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"track-action-click.d.ts","sourceRoot":"","sources":["../../../src/autocapture/track-action-click.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAmB,MAAM,wBAAwB,CAAC;AAE/G,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAIL,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAGpB,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,cAAc,EACd,OAAO,EACP,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,EAAE;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,oBAAoB,CAAC;IACrC,OAAO,EAAE,8BAA8B,CAAC;IACxC,kBAAkB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtF,sBAAsB,EAAE,gBAAgB,CAAC;IACzC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,+BAsDA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AllWindowObservables } from 'src/autocapture-plugin';
|
|
2
|
+
import { type evaluateTriggersFn } from 'src/helpers';
|
|
2
3
|
import { BrowserClient, ActionType } from '@amplitude/analytics-core';
|
|
3
4
|
import { shouldTrackEvent } from '../helpers';
|
|
4
|
-
export declare function trackChange({ amplitude, allObservables, getEventProperties, shouldTrackEvent, }: {
|
|
5
|
+
export declare function trackChange({ amplitude, allObservables, getEventProperties, shouldTrackEvent, evaluateTriggers, }: {
|
|
5
6
|
amplitude: BrowserClient;
|
|
6
7
|
allObservables: AllWindowObservables;
|
|
7
8
|
getEventProperties: (actionType: ActionType, element: Element) => Record<string, any>;
|
|
8
9
|
shouldTrackEvent: shouldTrackEvent;
|
|
10
|
+
evaluateTriggers: evaluateTriggersFn;
|
|
9
11
|
}): import("rxjs").Subscription;
|
|
10
12
|
//# sourceMappingURL=track-change.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track-change.d.ts","sourceRoot":"","sources":["../../../src/autocapture/track-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"track-change.d.ts","sourceRoot":"","sources":["../../../src/autocapture/track-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAA+B,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG3E,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,EAAE;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,oBAAoB,CAAC;IACrC,kBAAkB,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtF,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,kBAAkB,CAAC;CACtC,+BAgBA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AllWindowObservables, AutoCaptureOptionsWithDefaults } from 'src/autocapture-plugin';
|
|
2
|
+
import { type evaluateTriggersFn } from 'src/helpers';
|
|
2
3
|
import { BrowserClient } from '@amplitude/analytics-core';
|
|
3
4
|
import { shouldTrackEvent } from '../helpers';
|
|
4
|
-
export declare function trackClicks({ amplitude, allObservables, options, shouldTrackEvent, }: {
|
|
5
|
+
export declare function trackClicks({ amplitude, allObservables, options, shouldTrackEvent, evaluateTriggers, }: {
|
|
5
6
|
amplitude: BrowserClient;
|
|
6
7
|
allObservables: AllWindowObservables;
|
|
7
8
|
options: AutoCaptureOptionsWithDefaults;
|
|
8
9
|
shouldTrackEvent: shouldTrackEvent;
|
|
10
|
+
evaluateTriggers: evaluateTriggersFn;
|
|
9
11
|
}): import("rxjs").Subscription;
|
|
10
12
|
//# sourceMappingURL=track-click.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track-click.d.ts","sourceRoot":"","sources":["../../../src/autocapture/track-click.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"track-click.d.ts","sourceRoot":"","sources":["../../../src/autocapture/track-click.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAA+B,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAK3E,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,gBAAgB,GACjB,EAAE;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,oBAAoB,CAAC;IACrC,OAAO,EAAE,8BAA8B,CAAC;IACxC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,kBAAkB,CAAC;CACtC,+BAgDA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BrowserClient, BrowserConfig, EnrichmentPlugin, ElementInteractionsOptions } from '@amplitude/analytics-core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { ElementBasedTimestampedEvent, TimestampedEvent } from './helpers';
|
|
3
4
|
import { HasEventTargetAddRemove } from 'rxjs/internal/observable/fromEvent';
|
|
4
5
|
declare global {
|
|
5
6
|
interface Window {
|
|
@@ -36,26 +37,12 @@ export declare enum ObservablesEnum {
|
|
|
36
37
|
NavigateObservable = "navigateObservable",
|
|
37
38
|
MutationObservable = "mutationObservable"
|
|
38
39
|
}
|
|
39
|
-
type BaseTimestampedEvent<T> = {
|
|
40
|
-
event: T;
|
|
41
|
-
timestamp: number;
|
|
42
|
-
type: 'rage' | 'click' | 'change' | 'error' | 'navigate' | 'mutation';
|
|
43
|
-
};
|
|
44
|
-
export type ElementBasedEvent = MouseEvent | Event;
|
|
45
|
-
export type ElementBasedTimestampedEvent<T> = BaseTimestampedEvent<T> & {
|
|
46
|
-
event: MouseEvent | Event;
|
|
47
|
-
type: 'click' | 'change';
|
|
48
|
-
closestTrackedAncestor: Element;
|
|
49
|
-
targetElementProperties: Record<string, any>;
|
|
50
|
-
};
|
|
51
|
-
export type TimestampedEvent<T> = BaseTimestampedEvent<T> | ElementBasedTimestampedEvent<T>;
|
|
52
40
|
export interface AllWindowObservables {
|
|
53
41
|
[ObservablesEnum.ClickObservable]: Observable<ElementBasedTimestampedEvent<MouseEvent>>;
|
|
54
42
|
[ObservablesEnum.ChangeObservable]: Observable<ElementBasedTimestampedEvent<Event>>;
|
|
55
43
|
[ObservablesEnum.NavigateObservable]: Observable<TimestampedEvent<NavigateEvent>> | undefined;
|
|
56
44
|
[ObservablesEnum.MutationObservable]: Observable<TimestampedEvent<MutationRecord[]>>;
|
|
57
45
|
}
|
|
58
|
-
export declare function isElementBasedEvent<T>(event: BaseTimestampedEvent<T>): event is ElementBasedTimestampedEvent<T>;
|
|
59
46
|
export declare const autocapturePlugin: (options?: ElementInteractionsOptions) => BrowserEnrichmentPlugin;
|
|
60
47
|
export {};
|
|
61
48
|
//# sourceMappingURL=autocapture-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocapture-plugin.d.ts","sourceRoot":"","sources":["../../src/autocapture-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"autocapture-plugin.d.ts","sourceRoot":"","sources":["../../src/autocapture-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAI3B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAkB,UAAU,EAAuB,MAAM,MAAM,CAAC;AACvE,OAAO,EAIL,4BAA4B,EAC5B,gBAAgB,EAEjB,MAAM,WAAW,CAAC;AAKnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAW7E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC;KAC5C;CACF;AAED,UAAU,aAAc,SAAQ,KAAK;IACnC,QAAQ,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IACpE,QAAQ,CAAC,WAAW,EAAE;QACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAE/B,QAAQ,IAAI,GAAG,CAAC;KACjB,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,2DAA2D;IAC3D,QAAQ,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE9E,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CACnD,IAAI,CAAC,0BAA0B,EAAE,cAAc,GAAG,sBAAsB,GAAG,sBAAsB,CAAC,CACnG,GACC,0BAA0B,CAAC;AAE7B,oBAAY,eAAe;IACzB,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IAErC,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC,CAAC;IACxF,CAAC,eAAe,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,CAAC;IAEpF,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,SAAS,CAAC;IAC9F,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;CACtF;AAED,eAAO,MAAM,iBAAiB,aAAa,0BAA0B,KAAQ,uBAyM5E,CAAC"}
|
package/lib/scripts/helpers.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ElementInteractionsOptions, ActionType } from '@amplitude/analytics-core';
|
|
2
|
-
import { ElementBasedEvent, ElementBasedTimestampedEvent } from './autocapture-plugin';
|
|
3
2
|
export type JSONValue = string | number | boolean | null | {
|
|
4
3
|
[x: string]: JSONValue;
|
|
5
4
|
} | Array<JSONValue>;
|
|
@@ -28,4 +27,24 @@ export declare const getEventTagProps: (element: Element) => {
|
|
|
28
27
|
export declare const asyncLoadScript: (url: string) => Promise<unknown>;
|
|
29
28
|
export declare function generateUniqueId(): string;
|
|
30
29
|
export declare const filterOutNonTrackableEvents: (event: ElementBasedTimestampedEvent<ElementBasedEvent>) => boolean;
|
|
30
|
+
export declare const getEventProperties: (actionType: ActionType, element: Element, dataAttributePrefix: string) => {
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
export type AutoCaptureOptionsWithDefaults = Required<Pick<ElementInteractionsOptions, 'debounceTime' | 'cssSelectorAllowlist' | 'actionClickAllowlist'>> & ElementInteractionsOptions;
|
|
34
|
+
export declare const addAdditionalEventProperties: <T>(event: T, type: "click" | "change" | "rage" | "error" | "navigate" | "mutation", selectorAllowlist: string[], dataAttributePrefix: string) => TimestampedEvent<T>;
|
|
35
|
+
export type BaseTimestampedEvent<T> = {
|
|
36
|
+
event: T;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
type: 'rage' | 'click' | 'change' | 'error' | 'navigate' | 'mutation';
|
|
39
|
+
};
|
|
40
|
+
export type ElementBasedEvent = MouseEvent | Event;
|
|
41
|
+
export type ElementBasedTimestampedEvent<T> = BaseTimestampedEvent<T> & {
|
|
42
|
+
event: MouseEvent | Event;
|
|
43
|
+
type: 'click' | 'change';
|
|
44
|
+
closestTrackedAncestor: Element;
|
|
45
|
+
targetElementProperties: Record<string, any>;
|
|
46
|
+
};
|
|
47
|
+
export type evaluateTriggersFn = <T extends ElementBasedEvent>(event: ElementBasedTimestampedEvent<T>) => ElementBasedTimestampedEvent<T>;
|
|
48
|
+
export type TimestampedEvent<T> = BaseTimestampedEvent<T> | ElementBasedTimestampedEvent<T>;
|
|
49
|
+
export declare function isElementBasedEvent<T>(event: BaseTimestampedEvent<T>): event is ElementBasedTimestampedEvent<T>;
|
|
31
50
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGnF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAIzG,MAAM,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;AAErF,eAAO,MAAM,sBAAsB,uBACb,0BAA0B,aACnC,MAAM,EAAE,KAClB,gBAsDF,CAAC;AAEF,eAAO,MAAM,oBAAoB,SAAU,MAAM,GAAG,IAAI,YAgBvD,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,IAAI,YAEpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,YAAa,OAAO,YAOrD,CAAC;AAGF,eAAO,MAAM,OAAO,YAAa,OAAO,KAAG,MAsB1C,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,MAAM,oBAAoB,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,YAU9F,CAAC;AAEF,eAAO,MAAM,uBAAuB,YAAa,OAAO,UAAU,MAAM;;CAWvE,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,OAAO,YAOrC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;CAQjC,CAAC;AAEF,eAAO,MAAM,eAAe,YAAa,OAAO,KAAG,MAkBlD,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAAU,OAAO,GAAG,QAAQ,aAAa,MAAM,EAAE,KAAG,OAAO,EAchG,CAAC;AAGF,eAAO,MAAM,iBAAiB,YAAa,OAAO,GAAG,IAAI,aAAa,MAAM,EAAE,KAAG,OAAO,GAAG,IAU1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,YAAa,OAAO;;CAahD,CAAC;AAEF,eAAO,MAAM,eAAe,QAAS,MAAM,qBA2B1C,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,eAAO,MAAM,2BAA2B,UAAW,6BAA6B,iBAAiB,CAAC,KAAG,OAQpG,CAAC;AAGF,eAAO,MAAM,kBAAkB,eAAgB,UAAU,WAAW,OAAO,uBAAuB,MAAM;;CA8BvG,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CACnD,IAAI,CAAC,0BAA0B,EAAE,cAAc,GAAG,sBAAsB,GAAG,sBAAsB,CAAC,CACnG,GACC,0BAA0B,CAAC;AAE7B,eAAO,MAAM,4BAA4B,0GAGpB,MAAM,EAAE,uBACN,MAAM,wBAuB5B,CAAC;AAGF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,KAAK,EAAE,CAAC,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CACvE,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,GAAG;IACtE,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC;IAC1B,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,sBAAsB,EAAE,OAAO,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAC3D,KAAK,EAAE,4BAA4B,CAAC,CAAC,CAAC,KACnC,4BAA4B,CAAC,CAAC,CAAC,CAAC;AAGrC,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,GAAG,4BAA4B,CAAC,CAAC,CAAC,CAAC;AAG5F,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,4BAA4B,CAAC,CAAC,CAAC,CAE/G"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an observable that tracks DOM mutations on the document body.
|
|
4
|
+
*/
|
|
5
|
+
export declare const createMutationObservable: () => Observable<MutationRecord[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Creates an observable that tracks click events on the document.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createClickObservable: () => Observable<MouseEvent>;
|
|
10
|
+
//# sourceMappingURL=observables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observables.d.ts","sourceRoot":"","sources":["../../src/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,MAAM,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,WAAW,cAAc,EAAE,CAatE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAAO,WAAW,UAAU,CAE7D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DataSource, PageAction } from '@amplitude/analytics-core/lib/esm/types/element-interactions';
|
|
2
|
+
import { ElementBasedTimestampedEvent, ElementBasedEvent } from 'src/helpers';
|
|
3
|
+
/**
|
|
4
|
+
* Gets the DOM element specified by the data source configuration
|
|
5
|
+
* @param dataSource - Configuration for finding the target element
|
|
6
|
+
* @param contextElement - The element to start searching from
|
|
7
|
+
* @returns The matching DOM element or undefined if not found
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDataSource: (dataSource: DataSource, contextElement: HTMLElement) => Element | null | undefined;
|
|
10
|
+
export declare const extractDataFromDataSource: (dataSource: DataSource, contextElement: HTMLElement) => string | null | undefined;
|
|
11
|
+
export declare const executeActions: (actions: (string | PageAction)[], ev: ElementBasedTimestampedEvent<ElementBasedEvent>) => void;
|
|
12
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/pageActions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG9E;;;;;GAKG;AACH,eAAO,MAAM,aAAa,eAAgB,UAAU,kBAAkB,WAAW,+BAoBhF,CAAC;AAGF,eAAO,MAAM,yBAAyB,eAAgB,UAAU,kBAAkB,WAAW,8BAkB5F,CAAC;AAGF,eAAO,MAAM,cAAc,YAChB,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,MAC5B,6BAA6B,iBAAiB,CAAC,SAepD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Filter } from '@amplitude/analytics-core/lib/esm/types/element-interactions';
|
|
2
|
+
import { ElementBasedTimestampedEvent, ElementBasedEvent } from 'src/helpers';
|
|
3
|
+
/**
|
|
4
|
+
* Matches an event to a single filter
|
|
5
|
+
* @param event - The event to match
|
|
6
|
+
* @param filter - The filter to match against
|
|
7
|
+
* @returns boolean indicating if the event matches the filter
|
|
8
|
+
*/
|
|
9
|
+
export declare const matchEventToFilter: (event: ElementBasedTimestampedEvent<ElementBasedEvent>, filter: Filter) => boolean;
|
|
10
|
+
//# sourceMappingURL=matchEventToFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchEventToFilter.d.ts","sourceRoot":"","sources":["../../../src/pageActions/matchEventToFilter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8DAA8D,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAW,6BAA6B,iBAAiB,CAAC,UAAU,MAAM,YAoBxG,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Trigger } from '@amplitude/analytics-core/lib/esm/types/element-interactions';
|
|
2
|
+
import type { LabeledEvent } from '@amplitude/analytics-core/lib/esm/types/element-interactions';
|
|
3
|
+
import { ElementBasedTimestampedEvent, ElementBasedEvent } from 'src/helpers';
|
|
4
|
+
export declare const groupLabeledEventIdsByEventType: (labeledEvents?: LabeledEvent[] | null) => {
|
|
5
|
+
click: Set<string>;
|
|
6
|
+
change: Set<string>;
|
|
7
|
+
};
|
|
8
|
+
export declare const createLabeledEventToTriggerMap: (triggers: Trigger[]) => Map<string, Trigger[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Matches an event to labeled events based on the event's properties.
|
|
11
|
+
* The logic matches exactly what is supported by the query backend.
|
|
12
|
+
* TODO: later pre-filter the labeled events based on URL first
|
|
13
|
+
*
|
|
14
|
+
* @param event - The event to match against labeled events
|
|
15
|
+
* @param labeledEvents - Array of labeled events to match against
|
|
16
|
+
* @returns Array of matching labeled events
|
|
17
|
+
*/
|
|
18
|
+
export declare const matchEventToLabeledEvents: (event: ElementBasedTimestampedEvent<ElementBasedEvent>, labeledEvents: LabeledEvent[]) => LabeledEvent[];
|
|
19
|
+
export declare const matchLabeledEventsToTriggers: (labeledEvents: LabeledEvent[], leToTriggerMap: Map<string, Trigger[]>) => Trigger[];
|
|
20
|
+
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/pageActions/triggers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8DAA8D,CAAC;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAK9E,eAAO,MAAM,+BAA+B,mBAAoB,YAAY,EAAE,GAAG,IAAI;;;CAoBpF,CAAC;AAGF,eAAO,MAAM,8BAA8B,aAAc,OAAO,EAAE,2BAkBjE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,UAC7B,6BAA6B,iBAAiB,CAAC,iBACvC,YAAY,EAAE,mBAO9B,CAAC;AAEF,eAAO,MAAM,4BAA4B,kBAAmB,YAAY,EAAE,kBAAkB,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC,cASjH,CAAC"}
|
package/lib/scripts/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/plugin-autocapture-browser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Amplitude Inc",
|
|
6
6
|
"homepage": "https://github.com/amplitude/Amplitude-TypeScript",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"build:es5": "tsc -p ./tsconfig.es5.json",
|
|
24
24
|
"build:esm": "tsc -p ./tsconfig.esm.json",
|
|
25
25
|
"watch": "tsc -p ./tsconfig.esm.json --watch",
|
|
26
|
+
"watch-bundle": "NODE_ENV=development yarn bundle --watch",
|
|
26
27
|
"clean": "rimraf node_modules lib coverage",
|
|
27
28
|
"fix": "yarn fix:eslint & yarn fix:prettier",
|
|
28
29
|
"fix:eslint": "eslint '{src,test}/**/*.ts' --fix",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@amplitude/analytics-core": "^2.
|
|
44
|
+
"@amplitude/analytics-core": "^2.13.0",
|
|
44
45
|
"rxjs": "^7.8.1",
|
|
45
46
|
"tslib": "^2.4.1"
|
|
46
47
|
},
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"files": [
|
|
58
59
|
"lib"
|
|
59
60
|
],
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "d299a4334ecb462471860d77f8aaaf6be5b27bdc"
|
|
61
62
|
}
|