@walkeros/web-source-browser 4.2.0-next-1780704768738 → 4.2.0-next-1780909874350

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @walkeros/web-source-browser
2
2
 
3
- ## 4.2.0-next-1780704768738
3
+ ## 4.2.0-next-1780909874350
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -30,9 +30,10 @@
30
30
  - Updated dependencies [654ba38]
31
31
  - Updated dependencies [6a72a32]
32
32
  - Updated dependencies [3eb2467]
33
- - @walkeros/core@4.2.0-next-1780704768738
34
- - @walkeros/collector@4.2.0-next-1780704768738
35
- - @walkeros/web-core@4.2.0-next-1780704768738
33
+ - Updated dependencies [7d8ebf9]
34
+ - @walkeros/core@4.2.0-next-1780909874350
35
+ - @walkeros/collector@4.2.0-next-1780909874350
36
+ - @walkeros/web-core@4.2.0-next-1780909874350
36
37
 
37
38
  ## 4.1.2
38
39
 
@@ -1 +1 @@
1
- "use strict";var Source=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(o,{SourceBrowser:()=>xe,__resetInstanceCountForTests:()=>Ae,createTagger:()=>Oe,default:()=>De,getAllEvents:()=>S,getElbAttributeName:()=>A,getElbValues:()=>$,getEvents:()=>D,getGlobals:()=>L,sourceBrowser:()=>Se});var i=Object.defineProperty,s=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})};function c(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}s({},{stepId:()=>c});function a(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}s({},{getDestination:()=>a});s({},{Level:()=>u});var l,u=((l=u||{})[l.ERROR=0]="ERROR",l[l.WARN=1]="WARN",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l);function f(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}s({},{getTransformer:()=>f});function d(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}s({},{getSource:()=>d});function m(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}s({},{getStore:()=>m});var g={merge:!0,shallow:!0,extend:!0};function p(e,t={},n={}){n={...g,...n};const r=Object.entries(t).reduce((t,[r,o])=>{const i=e[r];return n.merge&&Array.isArray(i)&&Array.isArray(o)?t[r]=o.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||r in e)&&(t[r]=o),t},{});return n.shallow?{...e,...r}:(Object.assign(e,r),e)}function h(e){return Array.isArray(e)}function b(e){return void 0!==e}function y(e){return!(!e||"object"!=typeof e)&&("body"in e||"tagName"in e)}function w(e){return"object"==typeof e&&null!==e&&!h(e)&&"[object Object]"===Object.prototype.toString.call(e)}function v(e){return"string"==typeof e}function k(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return e==t&&""!==e?t:String(e)}function E(e,t,n){return function(...r){try{return e(...r)}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}}function C(e){return e?e.trim().replace(/^'|'$/g,"").trim():""}var x={Commands:{Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Scoped:"_",Session:"session",Shutdown:"shutdown",User:"user",Walker:"walker"},Utils:{Storage:{Cookie:"cookie",Local:"local",Session:"session"}}};x.Commands.Consent,x.Commands.User,x.Commands.Globals,x.Commands.Custom,Object.freeze({batched:!0});function O(e,t){return(e.getAttribute(t)||"").trim()}function j(e,t,n){const r=t.getComputedStyle(e);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(r.opacity&&Number(r.opacity)<.1)return!1;let o;const i=t.innerHeight,s=e.getBoundingClientRect(),c=s.height,a=s.y,l=a+c,u={x:s.x+e.offsetWidth/2,y:s.y+e.offsetHeight/2};if(c<=i){if(e.offsetWidth+s.width===0||e.offsetHeight+s.height===0)return!1;if(u.x<0)return!1;if(u.x>(n.documentElement.clientWidth||t.innerWidth))return!1;if(u.y<0)return!1;if(u.y>(n.documentElement.clientHeight||t.innerHeight))return!1;o=n.elementFromPoint(u.x,u.y)}else{const e=i/2;if(a<0&&l<e)return!1;if(l>i&&a>e)return!1;o=n.elementFromPoint(u.x,i/2)}if(o)do{if(o===e)return!0}while(o=o.parentElement);return!1}function A(e,t,n=!0){return e+(t=null!=t?(n?"-":"")+t:"")}function $(e,t,n,r=!0){return H(O(t,A(e,n,r))||"").reduce((e,n)=>{let[r,o]=M(n);if(!r)return e;if(o||(r.endsWith(":")&&(r=r.slice(0,-1)),o=""),o.startsWith("#")){o=o.slice(1);try{let e=t[o];e||"selected"!==o||(e=t.options[t.selectedIndex].text),o=String(e)}catch(e){o=""}}return r.endsWith("[]")?(r=r.slice(0,-2),h(e[r])||(e[r]=[]),e[r].push(k(o))):e[r]=k(o),e},{})}function S(e,t=x.Commands.Prefix){var n;const r=e;if(!r)return[];let o=[];const i=x.Commands.Action,s=`[${A(t,i,!1)}]`,c=e=>{Object.keys($(t,e,i,!1)).forEach(n=>{o=o.concat(D(e,n,t))})};return r!==(r.ownerDocument||r)&&(null==(n=r.matches)?void 0:n.call(r,s))&&c(r),V(r,s,c),o}function D(e,t,n=x.Commands.Prefix){const r=[],{actions:o,nearestOnly:i}=function(e,t,n){let r=t;for(;r;){const t=O(r,A(e,x.Commands.Actions,!1));if(t){const e=R(t);if(e[n])return{actions:e[n],nearestOnly:!1}}const o=O(r,A(e,x.Commands.Action,!1));if(o){const e=R(o);if(e[n]||"click"!==n)return{actions:e[n]||[],nearestOnly:!0}}r=W(e,r)}return{actions:[],nearestOnly:!1}}(n,e,t);return o.length?(o.forEach(o=>{const s=H(o.actionParams||"",",").reduce((e,t)=>(e[C(t)]=!0,e),{}),c=P(n,e,s,i);if(!c.length){const t="page",r=`[${A(n,t)}]`,[o,i]=I(e,r,n,t);c.push({entity:t,data:o,nested:[],context:i})}c.forEach(e=>{var n;r.push({entity:e.entity,action:o.action,data:e.data,trigger:t,context:e.context,nested:null!=(n=e.nested)?n:[]})})}),r):r}function L(e=x.Commands.Prefix,t){if(!t)return{};const n=A(e,x.Commands.Globals,!1);let r={};return N(t,`[${n}]`,t=>{r=p(r,$(e,t,x.Commands.Globals,!1))}),r}function R(e){const t={};return H(e).forEach(e=>{const[n,r]=M(e),[o,i]=G(n);if(!o)return;let[s,c]=G(r||"");s=s||o,t[o]||(t[o]=[]),t[o].push({trigger:o,triggerParams:i,action:s,actionParams:c})}),t}function P(e,t,n,r=!1){const o=[];let i=t;for(n=0!==Object.keys(n||{}).length?n:void 0;i;){const s=T(e,i,t,n);if(s&&(o.push(s),r))break;i=W(e,i)}return o}function T(e,t,n,r){const o=O(t,A(e));if(!o||r&&!r[o])return null;const i=[t],s=`[${A(e,o)}],[${A(e,"")}]`,c=A(e,x.Commands.Link,!1);let a={};const l=[],[u,f]=I(n||t,s,e,o,!0);V(t,`[${c}]`,n=>{const[r,o]=M(O(n,c));"parent"===o&&V(t.ownerDocument.body,`[${c}="${r}:child"]`,t=>{i.push(t);const n=T(e,t);n&&l.push(n)})});const d=[];i.forEach(e=>{e.matches(s)&&d.push(e),V(e,s,e=>d.push(e))});let m={};return d.forEach(t=>{m=p(m,$(e,t,"")),a=p(a,$(e,t,o))}),a=p(p(m,a),u),i.forEach(t=>{V(t,`[${A(e)}]`,t=>{const n=T(e,t);n&&l.push(n)})}),{entity:o,data:a,context:f,nested:l}}function W(e,t){const n=A(e,x.Commands.Link,!1);if(t.matches(`[${n}]`)){const[e,r]=M(O(t,n));if("child"===r){const r=t.ownerDocument;let o=null;return N(r,`[${n}="${e}:parent"]`,e=>{o||(o=e)}),o}}const r=t.ownerDocument.defaultView;return!t.parentElement&&t.getRootNode&&t.getRootNode()instanceof r.ShadowRoot?t.getRootNode().host:t.parentElement}function I(e,t,n,r,o=!1){let i={};const s={};let c=e;const a=`[${A(n,x.Commands.Context,!1)}]`,l=x.Commands.Scoped,u=`[${A(n,l,!1)}]`;let f=0;for(;c;)o&&l&&c.matches(u)&&(i=p($(n,c,l,!1),i)),c.matches(t)&&(i=p($(n,c,""),i),i=p($(n,c,r),i)),c.matches(a)&&(Object.entries($(n,c,x.Commands.Context,!1)).forEach(([e,t])=>{t&&!s[e]&&(s[e]=[t,f])}),++f),c=W(n,c);return[i,s]}function N(e,t,n){e.querySelectorAll(t).forEach(n)}function V(e,t,n){e.querySelectorAll(t).forEach(n);e instanceof(e.ownerDocument||e).defaultView.Element&&e.shadowRoot&&V(e.shadowRoot,t,n),e.querySelectorAll("*").forEach(e=>{e.shadowRoot&&V(e.shadowRoot,t,n)})}function H(e,t=";"){if(!e)return[];const n=new RegExp(`(?:[^${t}']+|'[^']*')+`,"ig");return e.match(n)||[]}function M(e){const[t,n]=e.split(/:(.+)/,2);return[C(t),C(n)]}function G(e){const[t,n]=e.split("(",2);return[t,n?n.slice(0,-1):""]}var q=new WeakMap,B=new WeakMap,F=new WeakMap;function U(e){const t=Date.now();let n=B.get(e);if(!n||t-n.lastChecked>500){n={isVisible:j(e,e.ownerDocument.defaultView,e.ownerDocument),lastChecked:t},B.set(e,n)}return n.isVisible}function _(e){const t=(e.ownerDocument||e).defaultView;if(t&&t.IntersectionObserver)return E(()=>new t.IntersectionObserver(t=>{t.forEach(t=>{!function(e,t){var n,r;const o=t.target,i=F.get(e);if(!i)return;const s=i.timers.get(o);if(t.intersectionRatio>0){const r=Date.now();let c=q.get(o);if(!c||r-c.lastChecked>1e3){const e=o.ownerDocument.defaultView;c={isLarge:o.offsetHeight>e.innerHeight,lastChecked:r},q.set(o,c)}if(t.intersectionRatio>=.5||c.isLarge&&U(o)){const t=null==(n=i.elementConfigs)?void 0:n.get(o);if((null==t?void 0:t.multiple)&&t.blocked)return;if(!s){const t=o.ownerDocument.defaultView.setTimeout(async()=>{var t,n;if(U(o)){const r=null==(t=i.elementConfigs)?void 0:t.get(o);(null==r?void 0:r.context)&&await pe(r.context,o,r.trigger);const s=null==(n=i.elementConfigs)?void 0:n.get(o);(null==s?void 0:s.multiple)?s.blocked=!0:function(e,t){const n=F.get(e);if(!n)return;n.observer&&n.observer.unobserve(t);const r=n.timers.get(t);r&&(clearTimeout(r),n.timers.delete(t)),q.delete(t),B.delete(t)}(e,o)}},i.duration);i.timers.set(o,t)}return}}s&&(clearTimeout(s),i.timers.delete(o));const c=null==(r=i.elementConfigs)?void 0:r.get(o);(null==c?void 0:c.multiple)&&(c.blocked=!1)}(e,t)})},{rootMargin:"0px",threshold:[0,.5]}),()=>{})()}function z(e,t,n={multiple:!1}){var r;const o=e.settings.scope;if(!o)return;const i=F.get(o);(null==i?void 0:i.observer)&&t&&(i.elementConfigs||(i.elementConfigs=new WeakMap),i.elementConfigs.set(t,{multiple:null!=(r=n.multiple)&&r,blocked:!1,context:e,trigger:n.multiple?"visible":"impression"}),i.observer.observe(t))}function Y(e){if(!e)return;const t=F.get(e);t&&(t.observer&&t.observer.disconnect(),F.delete(e))}function J(e,t,n,r,o,i,s){const{elb:c,settings:a}=e;if(v(t)&&t.startsWith("walker ")){if("walker init"===t&&e.initScope){const t=function(e,t){if(Q(e))return[e];if(Array.isArray(e)){const t=[];for(const n of e)Q(n)&&t.push(n);return t}if(void 0===e){const e=t.scope;if(Q(e))return[e];if(void 0!==globalThis.document)return[globalThis.document]}return[]}(n,a);for(const n of t)e.initScope(e,{...a,scope:n});return Promise.resolve(function(e){return{ok:!(null==e?void 0:e.failed),...e}}({ok:!0}))}return c(t,n)}if(w(t)){const e=t;if(!e.source&&a.scope){const t=a.scope.ownerDocument||a.scope,n=t.defaultView;e.source=K(n,t)}return!e.globals&&a.scope&&(e.globals=L(a.prefix,a.scope)),c(e)}const[l]=String(w(t)?t.name:t).split(" ");let u,f=w(n)?n:{},d={},m=!1;if(y(n)&&(u=n,m=!0),y(o)?u=o:w(o)&&Object.keys(o).length&&(d=o),u){const e=P(a.prefix||"data-elb",u).find(e=>e.entity===l);e&&(m&&(f=e.data),e.context&&(d=e.context))}const g=a.scope?a.scope.ownerDocument||a.scope:void 0,p=null==g?void 0:g.defaultView;"page"===l&&p&&(f.id=f.id||p.location.pathname);const h=L(a.prefix,a.scope);return c({name:String(t||""),data:f,context:d,globals:h,nested:i,custom:s,trigger:v(r)?r:"",source:p&&g?K(p,g):void 0})}function K(e,t){return{type:"browser",platform:"web",url:e.location.href,referrer:t.referrer}}function Q(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof Element&&e instanceof Element)return!0;if("undefined"!=typeof Document&&e instanceof Document)return!0;if("nodeType"in e){const t=e.nodeType;return 1===t||9===t}return!1}var X,Z,ee=[],te=[],ne=[];function re(){return Z||(Z=new AbortController),Z}var oe="click",ie="hover",se="load",ce="pulse",ae="scroll",le="submit",ue="impression",fe="visible",de="wait";function me(e,t){if(!t.scope)return;!function(e,t){const n=t.scope;if(!n)return;Z&&Z.abort();Z=new AbortController;const{signal:r}=Z;n.addEventListener("click",E(function(t){ye.call(this,e,t)}),{signal:r}),n.addEventListener("submit",E(function(t){we.call(this,e,t)}),{signal:r})}(e,t)}function ge(e,t){const n=t.scope;ee=[];const r=n;if(!r)return;Y(r),function(e,t=1e3){F.has(e)||F.set(e,{observer:_(e),timers:new WeakMap,duration:t})}(r,1e3);const o=A(t.prefix,x.Commands.Action,!1);r!==(r.ownerDocument||r)&&he(e,r,o,t),V(r,`[${o}]`,n=>{he(e,n,o,t)}),ee.length&&function(e,t){const n=t.ownerDocument||t,r=n.defaultView,o=(e,t)=>e.filter(([e,n])=>{const o=r.scrollY+r.innerHeight,i=e.offsetTop;if(o<i)return!0;const s=e.clientHeight;return!(100*(1-(i+s-o)/(s||1))>=n)||(pe(t,e,ae),!1)});X||(X=function(e,t=1e3){const{wait:n}=function(e,t){var n;return"number"==typeof e?{wait:e}:e?{wait:null!=(n=e.wait)?n:t,size:e.size,age:e.age}:{wait:t}}(t,1e3);let r=null;return function(...t){if(null===r)return r=setTimeout(()=>{r=null},n),e(...t)}}(function(){ee=o.call(t,ee,e)}),t.addEventListener("scroll",X,{signal:re().signal}))}(e,r)}async function pe(e,t,n){const r=D(t,n,e.settings.prefix);return Promise.all(r.map(t=>J(e,{name:`${t.entity} ${t.action}`,...t,trigger:n})))}function he(e,t,n,r){const o=O(t,n);o&&Object.values(R(o)).forEach(n=>n.forEach(n=>{switch(n.trigger){case ie:!function(e,t){t.addEventListener("mouseenter",E(function(t){const n=be(t);n&&pe(e,n,ie)}),{signal:re().signal})}(e,t);break;case se:!function(e,t){pe(e,t,se)}(e,t);break;case ce:!function(e,t,n=""){const r=t.ownerDocument,o=setInterval(()=>{r.hidden||pe(e,t,ce)},parseInt(n||"")||15e3);te.push(o)}(e,t,n.triggerParams);break;case ae:!function(e,t=""){const n=parseInt(t||"")||50;if(n<0||n>100)return;ee.push([e,n])}(t,n.triggerParams);break;case ue:z(e,t);break;case fe:z(e,t,{multiple:!0});break;case de:!function(e,t,n=""){const r=setTimeout(()=>pe(e,t,de),parseInt(n||"")||15e3);ne.push(r)}(e,t,n.triggerParams)}}))}function be(e){var t;const n=null==(t=e.composedPath)?void 0:t.call(e),r=(null==n?void 0:n.length)?n[0]:e.target;if(r&&"object"==typeof r&&"tagName"in r)return r}function ye(e,t){const n=be(t);n&&pe(e,n,oe)}function we(e,t){const n=be(t);n&&pe(e,n,le)}function ve(e,t={}){var n;const r=t.name||"elbLayer",o=t.window,i=t.logger;if(!o)return;const s=o;s[r]||(s[r]=[]);const c=s[r],a=o.document;null==i||i.debug("initElbLayer enter",{layerName:r,queuedItems:c.length}),c.push=function(...n){if(Ce(n[0])){const r=[...Array.from(n[0])],o=Array.prototype.push.apply(this,[r]);return Ee(e,t.prefix,r,a,i),o}const r=Array.prototype.push.apply(this,n);return n.forEach(n=>{Ee(e,t.prefix,n,a,i)}),r},Array.isArray(c)&&c.length>0&&(null==i||i.debug("initElbLayer drain walker commands",{count:c.length}),function(e,t,n,r,o){const i="walker ",s=[...n],c=new Set;s.forEach((n,s)=>{const a=ke(n);if(!a)return;const l=a[0];!w(l)&&v(l)&&l.startsWith(i)&&(c.add(s),Ee(e,t,a,r,o))});const a=[...c].sort((e,t)=>t-e);for(const e of a)n.splice(e,1);null==o||o.debug("drainWalkerCommands done",{consumed:c.size,remaining:n.length})}(e,null!=(n=t.prefix)?n:"data-elb",c,a,i))}function ke(e){const t=Ce(e)?[...Array.from(e)]:null!=(n=e)&&"object"==typeof n&&"length"in n&&"number"==typeof n.length?Array.from(e):[e];var n;if(!Array.isArray(t)||0===t.length)return null;if(1===t.length&&!t[0])return null;const r=t[0];return w(r)&&0===Object.keys(r).length||!w(r)&&v(r)&&""===r.trim()?null:t}function Ee(e,t="data-elb",n,r,o){E(()=>{if(Array.isArray(n)){const[i,...s]=n;if(!i||v(i)&&""===i.trim())return void(null==o||o.debug("pushCommand skipped (empty/invalid action)",{item:n}));if(v(i)&&i.startsWith("walker "))return null==o||o.debug("pushCommand walker command",{action:i,data:s[0]}),void e(i,s[0]);null==o||o.debug("pushCommand event (translated)",{action:i,rest:s}),J({elb:e,settings:{prefix:t,scope:r,pageview:!1,elb:"",elbLayer:!1}},i,...s)}else if(n&&"object"==typeof n){if(0===Object.keys(n).length)return void(null==o||o.debug("pushCommand skipped (empty object)"));null==o||o.debug("pushCommand object event",{item:n}),e(n)}},e=>{null==o||o.warn("pushCommand failed",{error:e,item:n})})()}function Ce(e){return null!=e&&"object"==typeof e&&"[object Arguments]"===Object.prototype.toString.call(e)}var xe={};function Oe(e={}){const t=e.prefix||"data-elb";return function(e){let n,r=e;const o={},i={},s={},c={},a={},l={};function u(e){return Object.entries(e).map(([e,t])=>`${e}:${function(e){if(!b(e)||null===e)return"undefined";let t=String(e);return t=t.replace(/\\/g,"\\\\"),t=t.replace(/;/g,"\\;"),t=t.replace(/:/g,"\\:"),t=t.replace(/'/g,"\\'"),t}(t)}`).join(";")}const f={entity:e=>(n=e,r=e,f),data(e,t){const n=null!=r?r:"";return o[n]||(o[n]={}),v(e)?o[n][e]=t:Object.assign(o[n],e),f},action(e,t){if(v(e))if(b(t))i[e]=t;else if(e.includes(":")){const[t,n]=e.split(":",2);i[t]=n}else i[e]=e;else Object.assign(i,e);return f},actions(e,t){if(v(e))if(b(t))s[e]=t;else if(e.includes(":")){const[t,n]=e.split(":",2);s[t]=n}else s[e]=e;else Object.assign(s,e);return f},context:(e,t)=>(v(e)?c[e]=t:Object.assign(c,e),f),globals:(e,t)=>(v(e)?a[e]=t:Object.assign(a,e),f),link:(e,t)=>(v(e)?l[e]=t:Object.assign(l,e),f),get(){const e={};return n&&(e[t]=n),Object.entries(o).forEach(([n,r])=>{if(Object.keys(r).length>0){e[n?`${t}-${n}`:`${t}-`]=u(r)}}),Object.keys(i).length>0&&(e[`${t}action`]=u(i)),Object.keys(s).length>0&&(e[`${t}actions`]=u(s)),Object.keys(c).length>0&&(e[`${t}context`]=u(c)),Object.keys(a).length>0&&(e[`${t}globals`]=u(a)),Object.keys(l).length>0&&(e[`${t}link`]=u(l)),e}};return f}}var je=0;function Ae(){je=0}var $e,Se=async e=>{if(je>0&&void 0!==globalThis.window)throw new Error("walker.js browser source is single-instance per window. See packages/web/sources/browser/src/trigger.ts for the invariant note.");je+=1;const{config:t,env:n,logger:r}=e,{elb:o,command:i,window:s,document:c}=n,a=(null==t?void 0:t.settings)||{},l=s||(void 0!==globalThis.window?globalThis.window:void 0),u=c||(void 0!==globalThis.document?globalThis.document:void 0),f=function(e={},t){return{prefix:"data-elb",pageview:!0,elb:"elb",elbLayer:"elbLayer",scope:t||void 0,...e}}(a,u),d={elb:o,settings:f,initScope:ge},m=e=>{if(!e.pageview)return;const[t,n]=function(e,t){const n=t.ownerDocument||t,r=n.defaultView.location,o="page",i="body"in t?t.body:t,[s,c]=I(i,`[${A(e,o)}]`,e,o);return s.domain=r.hostname,s.title=n.title,s.referrer=n.referrer,r.search&&(s.search=r.search),r.hash&&(s.hash=r.hash),[s,c]}(e.prefix||"data-elb",e.scope);J(d,"page view",t,"load",n)};return{type:"browser",config:{settings:f},push:(...e)=>{const[t,n,r,o,i,s]=e;return J(d,t,n,r,o,i,s)},on:async e=>{if("run"===e)u&&l&&(!function(e,t){if(!t.scope)return;ge(e,t)}(d,f),function(e,t,n,r){const o=v(t.elbLayer)?t.elbLayer:"elbLayer",i=t.prefix||"data-elb",s=n[o];if(!Array.isArray(s))return;const c=n.document;let a=-1;s.forEach((e,t)=>{const n=ke(e);n&&v(n[0])&&"walker run"===n[0]&&(a=t)});const l=[];for(let e=a+1;e<s.length;e++){const t=ke(s[e]);t&&l.push(t)}s.length=a+1,null==r||r.debug("drainNonWalkerEvents",{anchor:a,drained:l.length}),l.forEach(t=>Ee(e,i,t,c,r))}(o,f,l,r),m(f))},init:async()=>{l&&u&&(!1!==f.elbLayer&&o&&ve(o,{name:v(f.elbLayer)?f.elbLayer:"elbLayer",prefix:f.prefix,window:l,logger:r}),await async function(e,t,n){const r=()=>{e(t,n)},o=n.scope;if(!o)return void r();const i=o.ownerDocument||o;"loading"!==i.readyState?r():i.addEventListener("DOMContentLoaded",r)}(me,d,f),v(f.elb)&&f.elb&&(l[f.elb]=(...e)=>{const[t,n,r,o,i,s]=e;return J(d,t,n,r,o,i,s)}))},destroy:async()=>{Z&&(Z.abort(),Z=void 0),X=void 0,ee=[],te.forEach(e=>clearInterval(e)),te=[],ne.forEach(e=>clearTimeout(e)),ne=[],u&&Y(f.scope||u)}}},De=Se;return $e=o,((o,i,s,c)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let a of n(i))r.call(o,a)||a===s||e(o,a,{get:()=>i[a],enumerable:!(c=t(i,a))||c.enumerable});return o})(e({},"__esModule",{value:!0}),$e)})();
1
+ "use strict";var Source=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(o,{SourceBrowser:()=>Oe,__resetInstanceCountForTests:()=>$e,createTagger:()=>je,default:()=>Le,getAllEvents:()=>D,getElbAttributeName:()=>$,getElbValues:()=>S,getEvents:()=>L,getGlobals:()=>R,sourceBrowser:()=>De});var i=Object.defineProperty,s=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})};function c(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}s({},{stepId:()=>c});function a(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}s({},{getDestination:()=>a});s({},{Level:()=>u});var l,u=((l=u||{})[l.ERROR=0]="ERROR",l[l.WARN=1]="WARN",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l);function f(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}s({},{getTransformer:()=>f});function d(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}s({},{getSource:()=>d});function g(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function m(e,t){return await e.get(t)}s({},{getStore:()=>g,getStoreValue:()=>m});var p={merge:!0,shallow:!0,extend:!0};function h(e,t={},n={}){n={...p,...n};const r=Object.entries(t).reduce((t,[r,o])=>{const i=e[r];return n.merge&&Array.isArray(i)&&Array.isArray(o)?t[r]=o.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||r in e)&&(t[r]=o),t},{});return n.shallow?{...e,...r}:(Object.assign(e,r),e)}function b(e){return Array.isArray(e)}function y(e){return void 0!==e}function w(e){return!(!e||"object"!=typeof e)&&("body"in e||"tagName"in e)}function v(e){return"object"==typeof e&&null!==e&&!b(e)&&"[object Object]"===Object.prototype.toString.call(e)}function k(e){return"string"==typeof e}function E(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return e==t&&""!==e?t:String(e)}function C(e,t,n){return function(...r){try{return e(...r)}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}}function x(e){return e?e.trim().replace(/^'|'$/g,"").trim():""}var O={Commands:{Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Scoped:"_",Session:"session",Shutdown:"shutdown",User:"user",Walker:"walker"},Utils:{Storage:{Cookie:"cookie",Local:"local",Session:"session"}}};O.Commands.Consent,O.Commands.User,O.Commands.Globals,O.Commands.Custom,Object.freeze({batched:!0});function j(e,t){return(e.getAttribute(t)||"").trim()}function A(e,t,n){const r=t.getComputedStyle(e);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(r.opacity&&Number(r.opacity)<.1)return!1;let o;const i=t.innerHeight,s=e.getBoundingClientRect(),c=s.height,a=s.y,l=a+c,u={x:s.x+e.offsetWidth/2,y:s.y+e.offsetHeight/2};if(c<=i){if(e.offsetWidth+s.width===0||e.offsetHeight+s.height===0)return!1;if(u.x<0)return!1;if(u.x>(n.documentElement.clientWidth||t.innerWidth))return!1;if(u.y<0)return!1;if(u.y>(n.documentElement.clientHeight||t.innerHeight))return!1;o=n.elementFromPoint(u.x,u.y)}else{const e=i/2;if(a<0&&l<e)return!1;if(l>i&&a>e)return!1;o=n.elementFromPoint(u.x,i/2)}if(o)do{if(o===e)return!0}while(o=o.parentElement);return!1}function $(e,t,n=!0){return e+(t=null!=t?(n?"-":"")+t:"")}function S(e,t,n,r=!0){return M(j(t,$(e,n,r))||"").reduce((e,n)=>{let[r,o]=G(n);if(!r)return e;if(o||(r.endsWith(":")&&(r=r.slice(0,-1)),o=""),o.startsWith("#")){o=o.slice(1);try{let e=t[o];e||"selected"!==o||(e=t.options[t.selectedIndex].text),o=String(e)}catch(e){o=""}}return r.endsWith("[]")?(r=r.slice(0,-2),b(e[r])||(e[r]=[]),e[r].push(E(o))):e[r]=E(o),e},{})}function D(e,t=O.Commands.Prefix){var n;const r=e;if(!r)return[];let o=[];const i=O.Commands.Action,s=`[${$(t,i,!1)}]`,c=e=>{Object.keys(S(t,e,i,!1)).forEach(n=>{o=o.concat(L(e,n,t))})};return r!==(r.ownerDocument||r)&&(null==(n=r.matches)?void 0:n.call(r,s))&&c(r),H(r,s,c),o}function L(e,t,n=O.Commands.Prefix){const r=[],{actions:o,nearestOnly:i}=function(e,t,n){let r=t;for(;r;){const t=j(r,$(e,O.Commands.Actions,!1));if(t){const e=P(t);if(e[n])return{actions:e[n],nearestOnly:!1}}const o=j(r,$(e,O.Commands.Action,!1));if(o){const e=P(o);if(e[n]||"click"!==n)return{actions:e[n]||[],nearestOnly:!0}}r=I(e,r)}return{actions:[],nearestOnly:!1}}(n,e,t);return o.length?(o.forEach(o=>{const s=M(o.actionParams||"",",").reduce((e,t)=>(e[x(t)]=!0,e),{}),c=T(n,e,s,i);if(!c.length){const t="page",r=`[${$(n,t)}]`,[o,i]=N(e,r,n,t);c.push({entity:t,data:o,nested:[],context:i})}c.forEach(e=>{var n;r.push({entity:e.entity,action:o.action,data:e.data,trigger:t,context:e.context,nested:null!=(n=e.nested)?n:[]})})}),r):r}function R(e=O.Commands.Prefix,t){if(!t)return{};const n=$(e,O.Commands.Globals,!1);let r={};return V(t,`[${n}]`,t=>{r=h(r,S(e,t,O.Commands.Globals,!1))}),r}function P(e){const t={};return M(e).forEach(e=>{const[n,r]=G(e),[o,i]=q(n);if(!o)return;let[s,c]=q(r||"");s=s||o,t[o]||(t[o]=[]),t[o].push({trigger:o,triggerParams:i,action:s,actionParams:c})}),t}function T(e,t,n,r=!1){const o=[];let i=t;for(n=0!==Object.keys(n||{}).length?n:void 0;i;){const s=W(e,i,t,n);if(s&&(o.push(s),r))break;i=I(e,i)}return o}function W(e,t,n,r){const o=j(t,$(e));if(!o||r&&!r[o])return null;const i=[t],s=`[${$(e,o)}],[${$(e,"")}]`,c=$(e,O.Commands.Link,!1);let a={};const l=[],[u,f]=N(n||t,s,e,o,!0);H(t,`[${c}]`,n=>{const[r,o]=G(j(n,c));"parent"===o&&H(t.ownerDocument.body,`[${c}="${r}:child"]`,t=>{i.push(t);const n=W(e,t);n&&l.push(n)})});const d=[];i.forEach(e=>{e.matches(s)&&d.push(e),H(e,s,e=>d.push(e))});let g={};return d.forEach(t=>{g=h(g,S(e,t,"")),a=h(a,S(e,t,o))}),a=h(h(g,a),u),i.forEach(t=>{H(t,`[${$(e)}]`,t=>{const n=W(e,t);n&&l.push(n)})}),{entity:o,data:a,context:f,nested:l}}function I(e,t){const n=$(e,O.Commands.Link,!1);if(t.matches(`[${n}]`)){const[e,r]=G(j(t,n));if("child"===r){const r=t.ownerDocument;let o=null;return V(r,`[${n}="${e}:parent"]`,e=>{o||(o=e)}),o}}const r=t.ownerDocument.defaultView;return!t.parentElement&&t.getRootNode&&t.getRootNode()instanceof r.ShadowRoot?t.getRootNode().host:t.parentElement}function N(e,t,n,r,o=!1){let i={};const s={};let c=e;const a=`[${$(n,O.Commands.Context,!1)}]`,l=O.Commands.Scoped,u=`[${$(n,l,!1)}]`;let f=0;for(;c;)o&&l&&c.matches(u)&&(i=h(S(n,c,l,!1),i)),c.matches(t)&&(i=h(S(n,c,""),i),i=h(S(n,c,r),i)),c.matches(a)&&(Object.entries(S(n,c,O.Commands.Context,!1)).forEach(([e,t])=>{t&&!s[e]&&(s[e]=[t,f])}),++f),c=I(n,c);return[i,s]}function V(e,t,n){e.querySelectorAll(t).forEach(n)}function H(e,t,n){e.querySelectorAll(t).forEach(n);e instanceof(e.ownerDocument||e).defaultView.Element&&e.shadowRoot&&H(e.shadowRoot,t,n),e.querySelectorAll("*").forEach(e=>{e.shadowRoot&&H(e.shadowRoot,t,n)})}function M(e,t=";"){if(!e)return[];const n=new RegExp(`(?:[^${t}']+|'[^']*')+`,"ig");return e.match(n)||[]}function G(e){const[t,n]=e.split(/:(.+)/,2);return[x(t),x(n)]}function q(e){const[t,n]=e.split("(",2);return[t,n?n.slice(0,-1):""]}var B=new WeakMap,F=new WeakMap,U=new WeakMap;function _(e){const t=Date.now();let n=F.get(e);if(!n||t-n.lastChecked>500){n={isVisible:A(e,e.ownerDocument.defaultView,e.ownerDocument),lastChecked:t},F.set(e,n)}return n.isVisible}function z(e){const t=(e.ownerDocument||e).defaultView;if(t&&t.IntersectionObserver)return C(()=>new t.IntersectionObserver(t=>{t.forEach(t=>{!function(e,t){var n,r;const o=t.target,i=U.get(e);if(!i)return;const s=i.timers.get(o);if(t.intersectionRatio>0){const r=Date.now();let c=B.get(o);if(!c||r-c.lastChecked>1e3){const e=o.ownerDocument.defaultView;c={isLarge:o.offsetHeight>e.innerHeight,lastChecked:r},B.set(o,c)}if(t.intersectionRatio>=.5||c.isLarge&&_(o)){const t=null==(n=i.elementConfigs)?void 0:n.get(o);if((null==t?void 0:t.multiple)&&t.blocked)return;if(!s){const t=o.ownerDocument.defaultView.setTimeout(async()=>{var t,n;if(_(o)){const r=null==(t=i.elementConfigs)?void 0:t.get(o);(null==r?void 0:r.context)&&await he(r.context,o,r.trigger);const s=null==(n=i.elementConfigs)?void 0:n.get(o);(null==s?void 0:s.multiple)?s.blocked=!0:function(e,t){const n=U.get(e);if(!n)return;n.observer&&n.observer.unobserve(t);const r=n.timers.get(t);r&&(clearTimeout(r),n.timers.delete(t)),B.delete(t),F.delete(t)}(e,o)}},i.duration);i.timers.set(o,t)}return}}s&&(clearTimeout(s),i.timers.delete(o));const c=null==(r=i.elementConfigs)?void 0:r.get(o);(null==c?void 0:c.multiple)&&(c.blocked=!1)}(e,t)})},{rootMargin:"0px",threshold:[0,.5]}),()=>{})()}function Y(e,t,n={multiple:!1}){var r;const o=e.settings.scope;if(!o)return;const i=U.get(o);(null==i?void 0:i.observer)&&t&&(i.elementConfigs||(i.elementConfigs=new WeakMap),i.elementConfigs.set(t,{multiple:null!=(r=n.multiple)&&r,blocked:!1,context:e,trigger:n.multiple?"visible":"impression"}),i.observer.observe(t))}function J(e){if(!e)return;const t=U.get(e);t&&(t.observer&&t.observer.disconnect(),U.delete(e))}function K(e,t,n,r,o,i,s){const{elb:c,settings:a}=e;if(k(t)&&t.startsWith("walker ")){if("walker init"===t&&e.initScope){const t=function(e,t){if(X(e))return[e];if(Array.isArray(e)){const t=[];for(const n of e)X(n)&&t.push(n);return t}if(void 0===e){const e=t.scope;if(X(e))return[e];if(void 0!==globalThis.document)return[globalThis.document]}return[]}(n,a);for(const n of t)e.initScope(e,{...a,scope:n});return Promise.resolve(function(e){return{ok:!(null==e?void 0:e.failed),...e}}({ok:!0}))}return c(t,n)}if(v(t)){const e=t;if(!e.source&&a.scope){const t=a.scope.ownerDocument||a.scope,n=t.defaultView;e.source=Q(n,t)}return!e.globals&&a.scope&&(e.globals=R(a.prefix,a.scope)),c(e)}const[l]=String(v(t)?t.name:t).split(" ");let u,f=v(n)?n:{},d={},g=!1;if(w(n)&&(u=n,g=!0),w(o)?u=o:v(o)&&Object.keys(o).length&&(d=o),u){const e=T(a.prefix||"data-elb",u).find(e=>e.entity===l);e&&(g&&(f=e.data),e.context&&(d=e.context))}const m=a.scope?a.scope.ownerDocument||a.scope:void 0,p=null==m?void 0:m.defaultView;"page"===l&&p&&(f.id=f.id||p.location.pathname);const h=R(a.prefix,a.scope);return c({name:String(t||""),data:f,context:d,globals:h,nested:i,custom:s,trigger:k(r)?r:"",source:p&&m?Q(p,m):void 0})}function Q(e,t){return{type:"browser",platform:"web",url:e.location.href,referrer:t.referrer}}function X(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof Element&&e instanceof Element)return!0;if("undefined"!=typeof Document&&e instanceof Document)return!0;if("nodeType"in e){const t=e.nodeType;return 1===t||9===t}return!1}var Z,ee,te=[],ne=[],re=[];function oe(){return ee||(ee=new AbortController),ee}var ie="click",se="hover",ce="load",ae="pulse",le="scroll",ue="submit",fe="impression",de="visible",ge="wait";function me(e,t){if(!t.scope)return;!function(e,t){const n=t.scope;if(!n)return;ee&&ee.abort();ee=new AbortController;const{signal:r}=ee;n.addEventListener("click",C(function(t){we.call(this,e,t)}),{signal:r}),n.addEventListener("submit",C(function(t){ve.call(this,e,t)}),{signal:r})}(e,t)}function pe(e,t){const n=t.scope;te=[];const r=n;if(!r)return;J(r),function(e,t=1e3){U.has(e)||U.set(e,{observer:z(e),timers:new WeakMap,duration:t})}(r,1e3);const o=$(t.prefix,O.Commands.Action,!1);r!==(r.ownerDocument||r)&&be(e,r,o,t),H(r,`[${o}]`,n=>{be(e,n,o,t)}),te.length&&function(e,t){const n=t.ownerDocument||t,r=n.defaultView,o=(e,t)=>e.filter(([e,n])=>{const o=r.scrollY+r.innerHeight,i=e.offsetTop;if(o<i)return!0;const s=e.clientHeight;return!(100*(1-(i+s-o)/(s||1))>=n)||(he(t,e,le),!1)});Z||(Z=function(e,t=1e3){const{wait:n}=function(e,t){var n;return"number"==typeof e?{wait:e}:e?{wait:null!=(n=e.wait)?n:t,size:e.size,age:e.age}:{wait:t}}(t,1e3);let r=null;return function(...t){if(null===r)return r=setTimeout(()=>{r=null},n),e(...t)}}(function(){te=o.call(t,te,e)}),t.addEventListener("scroll",Z,{signal:oe().signal}))}(e,r)}async function he(e,t,n){const r=L(t,n,e.settings.prefix);return Promise.all(r.map(t=>K(e,{name:`${t.entity} ${t.action}`,...t,trigger:n})))}function be(e,t,n,r){const o=j(t,n);o&&Object.values(P(o)).forEach(n=>n.forEach(n=>{switch(n.trigger){case se:!function(e,t){t.addEventListener("mouseenter",C(function(t){const n=ye(t);n&&he(e,n,se)}),{signal:oe().signal})}(e,t);break;case ce:!function(e,t){he(e,t,ce)}(e,t);break;case ae:!function(e,t,n=""){const r=t.ownerDocument,o=setInterval(()=>{r.hidden||he(e,t,ae)},parseInt(n||"")||15e3);ne.push(o)}(e,t,n.triggerParams);break;case le:!function(e,t=""){const n=parseInt(t||"")||50;if(n<0||n>100)return;te.push([e,n])}(t,n.triggerParams);break;case fe:Y(e,t);break;case de:Y(e,t,{multiple:!0});break;case ge:!function(e,t,n=""){const r=setTimeout(()=>he(e,t,ge),parseInt(n||"")||15e3);re.push(r)}(e,t,n.triggerParams)}}))}function ye(e){var t;const n=null==(t=e.composedPath)?void 0:t.call(e),r=(null==n?void 0:n.length)?n[0]:e.target;if(r&&"object"==typeof r&&"tagName"in r)return r}function we(e,t){const n=ye(t);n&&he(e,n,ie)}function ve(e,t){const n=ye(t);n&&he(e,n,ue)}function ke(e,t={}){var n;const r=t.name||"elbLayer",o=t.window,i=t.logger;if(!o)return;const s=o;s[r]||(s[r]=[]);const c=s[r],a=o.document;null==i||i.debug("initElbLayer enter",{layerName:r,queuedItems:c.length}),c.push=function(...n){if(xe(n[0])){const r=[...Array.from(n[0])],o=Array.prototype.push.apply(this,[r]);return Ce(e,t.prefix,r,a,i),o}const r=Array.prototype.push.apply(this,n);return n.forEach(n=>{Ce(e,t.prefix,n,a,i)}),r},Array.isArray(c)&&c.length>0&&(null==i||i.debug("initElbLayer drain walker commands",{count:c.length}),function(e,t,n,r,o){const i="walker ",s=[...n],c=new Set;s.forEach((n,s)=>{const a=Ee(n);if(!a)return;const l=a[0];!v(l)&&k(l)&&l.startsWith(i)&&(c.add(s),Ce(e,t,a,r,o))});const a=[...c].sort((e,t)=>t-e);for(const e of a)n.splice(e,1);null==o||o.debug("drainWalkerCommands done",{consumed:c.size,remaining:n.length})}(e,null!=(n=t.prefix)?n:"data-elb",c,a,i))}function Ee(e){const t=xe(e)?[...Array.from(e)]:null!=(n=e)&&"object"==typeof n&&"length"in n&&"number"==typeof n.length?Array.from(e):[e];var n;if(!Array.isArray(t)||0===t.length)return null;if(1===t.length&&!t[0])return null;const r=t[0];return v(r)&&0===Object.keys(r).length||!v(r)&&k(r)&&""===r.trim()?null:t}function Ce(e,t="data-elb",n,r,o){C(()=>{if(Array.isArray(n)){const[i,...s]=n;if(!i||k(i)&&""===i.trim())return void(null==o||o.debug("pushCommand skipped (empty/invalid action)",{item:n}));if(k(i)&&i.startsWith("walker "))return null==o||o.debug("pushCommand walker command",{action:i,data:s[0]}),void e(i,s[0]);null==o||o.debug("pushCommand event (translated)",{action:i,rest:s}),K({elb:e,settings:{prefix:t,scope:r,pageview:!1,elb:"",elbLayer:!1}},i,...s)}else if(n&&"object"==typeof n){if(0===Object.keys(n).length)return void(null==o||o.debug("pushCommand skipped (empty object)"));null==o||o.debug("pushCommand object event",{item:n}),e(n)}},e=>{null==o||o.warn("pushCommand failed",{error:e,item:n})})()}function xe(e){return null!=e&&"object"==typeof e&&"[object Arguments]"===Object.prototype.toString.call(e)}var Oe={};function je(e={}){const t=e.prefix||"data-elb";return function(e){let n,r=e;const o={},i={},s={},c={},a={},l={};function u(e){return Object.entries(e).map(([e,t])=>`${e}:${function(e){if(!y(e)||null===e)return"undefined";let t=String(e);return t=t.replace(/\\/g,"\\\\"),t=t.replace(/;/g,"\\;"),t=t.replace(/:/g,"\\:"),t=t.replace(/'/g,"\\'"),t}(t)}`).join(";")}const f={entity:e=>(n=e,r=e,f),data(e,t){const n=null!=r?r:"";return o[n]||(o[n]={}),k(e)?o[n][e]=t:Object.assign(o[n],e),f},action(e,t){if(k(e))if(y(t))i[e]=t;else if(e.includes(":")){const[t,n]=e.split(":",2);i[t]=n}else i[e]=e;else Object.assign(i,e);return f},actions(e,t){if(k(e))if(y(t))s[e]=t;else if(e.includes(":")){const[t,n]=e.split(":",2);s[t]=n}else s[e]=e;else Object.assign(s,e);return f},context:(e,t)=>(k(e)?c[e]=t:Object.assign(c,e),f),globals:(e,t)=>(k(e)?a[e]=t:Object.assign(a,e),f),link:(e,t)=>(k(e)?l[e]=t:Object.assign(l,e),f),get(){const e={};return n&&(e[t]=n),Object.entries(o).forEach(([n,r])=>{if(Object.keys(r).length>0){e[n?`${t}-${n}`:`${t}-`]=u(r)}}),Object.keys(i).length>0&&(e[`${t}action`]=u(i)),Object.keys(s).length>0&&(e[`${t}actions`]=u(s)),Object.keys(c).length>0&&(e[`${t}context`]=u(c)),Object.keys(a).length>0&&(e[`${t}globals`]=u(a)),Object.keys(l).length>0&&(e[`${t}link`]=u(l)),e}};return f}}var Ae=0;function $e(){Ae=0}var Se,De=async e=>{if(Ae>0&&void 0!==globalThis.window)throw new Error("walker.js browser source is single-instance per window. See packages/web/sources/browser/src/trigger.ts for the invariant note.");Ae+=1;const{config:t,env:n,logger:r}=e,{elb:o,command:i,window:s,document:c}=n,a=(null==t?void 0:t.settings)||{},l=s||(void 0!==globalThis.window?globalThis.window:void 0),u=c||(void 0!==globalThis.document?globalThis.document:void 0),f=function(e={},t){return{prefix:"data-elb",pageview:!0,elb:"elb",elbLayer:"elbLayer",scope:t||void 0,...e}}(a,u),d={elb:o,settings:f,initScope:pe},g=e=>{if(!e.pageview)return;const[t,n]=function(e,t){const n=t.ownerDocument||t,r=n.defaultView.location,o="page",i="body"in t?t.body:t,[s,c]=N(i,`[${$(e,o)}]`,e,o);return s.domain=r.hostname,s.title=n.title,s.referrer=n.referrer,r.search&&(s.search=r.search),r.hash&&(s.hash=r.hash),[s,c]}(e.prefix||"data-elb",e.scope);K(d,"page view",t,"load",n)};return{type:"browser",config:{settings:f},push:(...e)=>{const[t,n,r,o,i,s]=e;return K(d,t,n,r,o,i,s)},on:async e=>{if("run"===e)u&&l&&(!function(e,t){if(!t.scope)return;pe(e,t)}(d,f),function(e,t,n,r){const o=k(t.elbLayer)?t.elbLayer:"elbLayer",i=t.prefix||"data-elb",s=n[o];if(!Array.isArray(s))return;const c=n.document;let a=-1;s.forEach((e,t)=>{const n=Ee(e);n&&k(n[0])&&"walker run"===n[0]&&(a=t)});const l=[];for(let e=a+1;e<s.length;e++){const t=Ee(s[e]);t&&l.push(t)}s.length=a+1,null==r||r.debug("drainNonWalkerEvents",{anchor:a,drained:l.length}),l.forEach(t=>Ce(e,i,t,c,r))}(o,f,l,r),g(f))},init:async()=>{l&&u&&(!1!==f.elbLayer&&o&&ke(o,{name:k(f.elbLayer)?f.elbLayer:"elbLayer",prefix:f.prefix,window:l,logger:r}),await async function(e,t,n){const r=()=>{e(t,n)},o=n.scope;if(!o)return void r();const i=o.ownerDocument||o;"loading"!==i.readyState?r():i.addEventListener("DOMContentLoaded",r)}(me,d,f),k(f.elb)&&f.elb&&(l[f.elb]=(...e)=>{const[t,n,r,o,i,s]=e;return K(d,t,n,r,o,i,s)}))},destroy:async()=>{ee&&(ee.abort(),ee=void 0),Z=void 0,te=[],ne.forEach(e=>clearInterval(e)),ne=[],re.forEach(e=>clearTimeout(e)),re=[],u&&J(f.scope||u)}}},Le=De;return Se=o,((o,i,s,c)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let a of n(i))r.call(o,a)||a===s||e(o,a,{get:()=>i[a],enumerable:!(c=t(i,a))||c.enumerable});return o})(e({},"__esModule",{value:!0}),Se)})();
package/dist/index.es5.js CHANGED
@@ -1 +1 @@
1
- "use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _async_to_generator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){asyncGeneratorStep(i,r,o,a,c,"next",e)}function c(e){asyncGeneratorStep(i,r,o,a,c,"throw",e)}a(void 0)})}}function _define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){_define_property(e,t,n[t])})}return e}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_array(e){return _array_with_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(e,t):void 0}}function _ts_generator(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var Source=function(){var e=function(e,t){if("collector"===e)return"collector";if(!t)throw new Error("stepId(".concat(e,") requires an id"));return"".concat(e,".").concat(t)},t=function(e,t){var n=e.destinations[t];if(!n)throw new Error("Destination not found: ".concat(t));return n},n=function(e,t){var n=e.transformers[t];if(!n)throw new Error("Transformer not found: ".concat(t));return n},r=function(e,t){var n=e.sources[t];if(!n)throw new Error("Source not found: ".concat(t));return n},o=function(e,t){var n=e.stores[t];if(!n)throw new Error("Store not found: ".concat(t));return n},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=_object_spread({},pe,n);var r=Object.entries(t).reduce(function(t,r){var o=_sliced_to_array(r,2),i=o[0],a=o[1],c=e[i];return n.merge&&Array.isArray(c)&&Array.isArray(a)?t[i]=a.reduce(function(e,t){return e.includes(t)?e:_to_consumable_array(e).concat([t])},_to_consumable_array(c)):(n.extend||i in e)&&(t[i]=a),t},{});return n.shallow?_object_spread({},e,r):(Object.assign(e,r),e)},a=function(e){return Array.isArray(e)},c=function(e){return void 0!==e},u=function(e){return!(!e||"object"!=(void 0===e?"undefined":_type_of(e)))&&("body"in e||"tagName"in e)},l=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!a(e)&&"[object Object]"===Object.prototype.toString.call(e)},s=function(e){return"string"==typeof e},f=function(e){if("true"===e)return!0;if("false"===e)return!1;var t=Number(e);return e==t&&""!==e?t:String(e)},d=function(e,t,n){return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];try{return e.apply(void 0,_to_consumable_array(o))}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}},v=function(e){return e?e.trim().replace(/^'|'$/g,"").trim():""},y=function(e,t){return(e.getAttribute(t)||"").trim()},_=function(e,t,n){var r,o=t.getComputedStyle(e);if("none"===o.display)return!1;if("visible"!==o.visibility)return!1;if(o.opacity&&Number(o.opacity)<.1)return!1;var i=t.innerHeight,a=e.getBoundingClientRect(),c=a.height,u=a.y,l=u+c,s={x:a.x+e.offsetWidth/2,y:a.y+e.offsetHeight/2};if(c<=i){if(e.offsetWidth+a.width===0||e.offsetHeight+a.height===0)return!1;if(s.x<0)return!1;if(s.x>(n.documentElement.clientWidth||t.innerWidth))return!1;if(s.y<0)return!1;if(s.y>(n.documentElement.clientHeight||t.innerHeight))return!1;r=n.elementFromPoint(s.x,s.y)}else{var f=i/2;if(u<0&&l<f)return!1;if(l>i&&u>f)return!1;r=n.elementFromPoint(s.x,i/2)}if(r)do{if(r===e)return!0}while(r=r.parentElement);return!1},b=function(e,t){return e+(t=null!=t?(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?"-":"")+t:"")},p=function(e,t,n){var r=y(t,b(e,n,!(arguments.length>3&&void 0!==arguments[3])||arguments[3]))||"";return x(r).reduce(function(e,n){var r=_sliced_to_array(C(n),2),o=r[0],i=r[1];if(!o)return e;if(i||(o.endsWith(":")&&(o=o.slice(0,-1)),i=""),i.startsWith("#")){i=i.slice(1);try{var c=t[i];c||"selected"!==i||(c=t.options[t.selectedIndex].text),i=String(c)}catch(e){i=""}}return o.endsWith("[]")?(o=o.slice(0,-2),a(e[o])||(e[o]=[]),e[o].push(f(i))):e[o]=f(i),e},{})},g=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ge.Commands.Prefix,r=e;if(!r)return[];var o=[],i=ge.Commands.Action,a="[".concat(b(n,i,!1),"]"),c=function(e){Object.keys(p(n,e,i,!1)).forEach(function(t){o=o.concat(m(e,t,n))})};return r!==(r.ownerDocument||r)&&(null===(t=r.matches)||void 0===t?void 0:t.call(r,a))&&c(r),he(r,a,c),o},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ge.Commands.Prefix,r=[],o=E(n,e,t),i=o.actions,a=o.nearestOnly;return i.length?(i.forEach(function(o){var i=x(o.actionParams||"",",").reduce(function(e,t){return e[v(t)]=!0,e},{}),c=j(n,e,i,a);if(!c.length){var u="page",l="[".concat(b(n,u),"]"),s=_sliced_to_array(k(e,l,n,u),2),f=s[0],d=s[1];c.push({entity:u,data:f,nested:[],context:d})}c.forEach(function(e){var n;r.push({entity:e.entity,action:o.action,data:e.data,trigger:t,context:e.context,nested:null!==(n=e.nested)&&void 0!==n?n:[]})})}),r):r},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge.Commands.Prefix,t=arguments.length>1?arguments[1]:void 0;if(!t)return{};var n=b(e,ge.Commands.Globals,!1),r="[".concat(n,"]"),o={};return S(t,r,function(t){o=i(o,p(e,t,ge.Commands.Globals,!1))}),o},w=function(e){var t={};return x(e).forEach(function(e){var n=_sliced_to_array(C(e),2),r=n[0],o=n[1],i=_sliced_to_array(A(r),2),a=i[0],c=i[1];if(a){var u=_sliced_to_array(A(o||""),2),l=u[0],s=u[1];l=l||a,t[a]||(t[a]=[]),t[a].push({trigger:a,triggerParams:c,action:l,actionParams:s})}}),t},j=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[],i=t;for(n=0!==Object.keys(n||{}).length?n:void 0;i;){var a=me(e,i,t,n);if(a&&(o.push(a),r))break;i=O(e,i)}return o},O=function(e,t){var n=b(e,ge.Commands.Link,!1);if(t.matches("[".concat(n,"]"))){var r=_sliced_to_array(C(y(t,n)),2),o=r[0];if("child"===r[1]){var i=t.ownerDocument,a=null;return S(i,"[".concat(n,'="').concat(o,':parent"]'),function(e){a||(a=e)}),a}}var c=t.ownerDocument.defaultView;return!t.parentElement&&t.getRootNode&&_instanceof(t.getRootNode(),c.ShadowRoot)?t.getRootNode().host:t.parentElement},k=function(e,t,n,r){for(var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={},c={},u=e,l="[".concat(b(n,ge.Commands.Context,!1),"]"),s=ge.Commands.Scoped,f="[".concat(b(n,s,!1),"]"),d=0;u;)o&&s&&u.matches(f)&&(a=i(p(n,u,s,!1),a)),u.matches(t)&&(a=i(p(n,u,""),a),a=i(p(n,u,r),a)),u.matches(l)&&(Object.entries(p(n,u,ge.Commands.Context,!1)).forEach(function(e){var t=_sliced_to_array(e,2),n=t[0],r=t[1];r&&!c[n]&&(c[n]=[r,d])}),++d),u=O(n,u);return[a,c]},S=function(e,t,n){e.querySelectorAll(t).forEach(n)},E=function(e,t,n){for(var r=t;r;){var o=y(r,b(e,ge.Commands.Actions,!1));if(o){var i=w(o);if(i[n])return{actions:i[n],nearestOnly:!1}}var a=y(r,b(e,ge.Commands.Action,!1));if(a){var c=w(a);if(c[n]||"click"!==n)return{actions:c[n]||[],nearestOnly:!0}}r=O(e,r)}return{actions:[],nearestOnly:!1}},x=function(e){if(!e)return[];var t=new RegExp("(?:[^".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:";","']+|'[^']*')+"),"ig");return e.match(t)||[]},C=function(e){var t=_sliced_to_array(e.split(/:(.+)/,2),2),n=t[0],r=t[1];return[v(n),v(r)]},A=function(e){var t=_sliced_to_array(e.split("(",2),2),n=t[0],r=t[1];return[n,r?r.slice(0,-1):""]},P=function(e){var t=Date.now(),n=Se.get(e);if(!n||t-n.lastChecked>500){var r=e.ownerDocument.defaultView,o=e.ownerDocument;n={isVisible:_(e,r,o),lastChecked:t},Se.set(e,n)}return n.isVisible},D=function(e){var t=(e.ownerDocument||e).defaultView;if(t&&t.IntersectionObserver)return d(function(){return new t.IntersectionObserver(function(t){t.forEach(function(t){L(e,t)})},{rootMargin:"0px",threshold:[0,.5]})},function(){})()},L=function(e,t){var n,r=t.target,o=Ee.get(e);if(o){var i=o.timers.get(r);if(t.intersectionRatio>0){var a=Date.now(),c=ke.get(r);if(!c||a-c.lastChecked>1e3){var u=r.ownerDocument.defaultView;c={isLarge:r.offsetHeight>u.innerHeight,lastChecked:a},ke.set(r,c)}if(t.intersectionRatio>=.5||c.isLarge&&P(r)){var l,s=null===(l=o.elementConfigs)||void 0===l?void 0:l.get(r);if((null==s?void 0:s.multiple)&&s.blocked)return;if(!i){var f=r.ownerDocument.defaultView.setTimeout(function(){return _async_to_generator(function(){var t,n,i,a;return _ts_generator(this,function(c){switch(c.label){case 0:return P(r)?(null==(i=null===(t=o.elementConfigs)||void 0===t?void 0:t.get(r))?void 0:i.context)?[4,B(i.context,r,i.trigger)]:[3,2]:[3,3];case 1:c.sent(),c.label=2;case 2:(null==(a=null===(n=o.elementConfigs)||void 0===n?void 0:n.get(r))?void 0:a.multiple)?a.blocked=!0:function(e,t){var n=Ee.get(e);if(n){n.observer&&n.observer.unobserve(t);var r=n.timers.get(t);r&&(clearTimeout(r),n.timers.delete(t)),ke.delete(t),Se.delete(t)}}(e,r),c.label=3;case 3:return[2]}})})()},o.duration);o.timers.set(r,f)}return}}i&&(clearTimeout(i),o.timers.delete(r));var d=null===(n=o.elementConfigs)||void 0===n?void 0:n.get(r);(null==d?void 0:d.multiple)&&(d.blocked=!1)}},I=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{multiple:!1},r=e.settings.scope;if(r){var o,i=Ee.get(r);if((null==i?void 0:i.observer)&&t)i.elementConfigs||(i.elementConfigs=new WeakMap),i.elementConfigs.set(t,{multiple:null!==(o=n.multiple)&&void 0!==o&&o,blocked:!1,context:e,trigger:n.multiple?"visible":"impression"}),i.observer.observe(t)}},T=function(e){if(e){var t=Ee.get(e);t&&(t.observer&&t.observer.disconnect(),Ee.delete(e))}},W=function(e,t,n,r,o,i,a){var c,f=e.elb,d=e.settings;if(s(t)&&t.startsWith("walker ")){if("walker init"===t&&e.initScope){var v=V(n,d),y=!0,_=!1,b=void 0;try{for(var p,g=v[Symbol.iterator]();!(y=(p=g.next()).done);y=!0){var m=p.value;e.initScope(e,_object_spread_props(_object_spread({},d),{scope:m}))}}catch(e){_=!0,b=e}finally{try{y||null==g.return||g.return()}finally{if(_)throw b}}return Promise.resolve(_object_spread({ok:!(null==(c={ok:!0})?void 0:c.failed)},c))}return f(t,n)}if(l(t)){var w=t;if(!w.source&&d.scope){var O=d.scope.ownerDocument||d.scope,k=O.defaultView;w.source=R(k,O)}return!w.globals&&d.scope&&(w.globals=h(d.prefix,d.scope)),f(w)}var S,E=_sliced_to_array(String(l(t)?t.name:t).split(" "),1)[0],x=l(n)?n:{},C={},A=!1;if(u(n)&&(S=n,A=!0),u(o)?S=o:l(o)&&Object.keys(o).length&&(C=o),S){var P=j(d.prefix||"data-elb",S).find(function(e){return e.entity===E});P&&(A&&(x=P.data),P.context&&(C=P.context))}var D=d.scope?d.scope.ownerDocument||d.scope:void 0,L=null==D?void 0:D.defaultView;"page"===E&&L&&(x.id=x.id||L.location.pathname);var I=h(d.prefix,d.scope);return f({name:String(t||""),data:x,context:C,globals:I,nested:i,custom:a,trigger:s(r)?r:"",source:L&&D?R(L,D):void 0})},R=function(e,t){return{type:"browser",platform:"web",url:e.location.href,referrer:t.referrer}},N=function(e){if(!e||"object"!==(void 0===e?"undefined":_type_of(e)))return!1;if("undefined"!=typeof Element&&_instanceof(e,Element))return!0;if("undefined"!=typeof Document&&_instanceof(e,Document))return!0;if("nodeType"in e){var t=e.nodeType;return 1===t||9===t}return!1},V=function(e,t){if(N(e))return[e];if(Array.isArray(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0){var u=a.value;N(u)&&n.push(u)}}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}if(void 0===e){var l=t.scope;if(N(l))return[l];if(void 0!==globalThis.document)return[globalThis.document]}return[]},H=function(){return je||(je=new AbortController),je},G=function(e,t,n){return _async_to_generator(function(){var r,o,i;return _ts_generator(this,function(a){return r=function(){e(t,n)},(o=n.scope)?("loading"!==(i=o.ownerDocument||o).readyState?r():i.addEventListener("DOMContentLoaded",r),[2]):(r(),[2])})})()},M=function(e,t){t.scope&&U(e,t)},U=function(e,t){var n=t.scope;if(n){je&&je.abort();var r=(je=new AbortController).signal;n.addEventListener("click",d(function(t){K.call(this,e,t)}),{signal:r}),n.addEventListener("submit",d(function(t){X.call(this,e,t)}),{signal:r})}},q=function(e,t){var n=t.scope;xe=[];var r=n;if(r){T(r),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;Ee.has(e)||Ee.set(e,{observer:D(e),timers:new WeakMap,duration:t})}(r,1e3);var o=b(t.prefix,ge.Commands.Action,!1);r!==(r.ownerDocument||r)&&F(e,r,o,t),he(r,"[".concat(o,"]"),function(n){F(e,n,o,t)}),xe.length&&ee(e,r,t)}},B=function(e,t,n){return _async_to_generator(function(){var r;return _ts_generator(this,function(o){return r=m(t,n,e.settings.prefix),[2,Promise.all(r.map(function(t){return W(e,_object_spread_props(_object_spread({name:"".concat(t.entity," ").concat(t.action)},t),{trigger:n}))}))]})})()},F=function(e,t,n,r){var o=y(t,n);o&&Object.values(w(o)).forEach(function(n){return n.forEach(function(n){switch(n.trigger){case Pe.Hover:$(e,t);break;case Pe.Load:Y(e,t);break;case Pe.Pulse:J(e,t,n.triggerParams);break;case Pe.Scroll:Q(t,n.triggerParams);break;case Pe.Impression:I(e,t);break;case Pe.Visible:I(e,t,{multiple:!0});break;case Pe.Wait:Z(e,t,n.triggerParams)}})})},z=function(e){var t,n=null===(t=e.composedPath)||void 0===t?void 0:t.call(e),r=(null==n?void 0:n.length)?n[0]:e.target;if(r&&"object"===(void 0===r?"undefined":_type_of(r))&&"tagName"in r)return r},K=function(e,t){var n=z(t);n&&B(e,n,Pe.Click)},$=function(e,t){t.addEventListener("mouseenter",d(function(t){var n=z(t);n&&B(e,n,Pe.Hover)}),{signal:H().signal})},Y=function(e,t){B(e,t,Pe.Load)},J=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=t.ownerDocument,o=setInterval(function(){r.hidden||B(e,t,Pe.Pulse)},parseInt(n||"")||15e3);Ce.push(o)},Q=function(e){var t=parseInt((arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")||"")||50;t<0||t>100||xe.push([e,t])},X=function(e,t){var n=z(t);n&&B(e,n,Pe.Submit)},Z=function(e,t){var n=setTimeout(function(){return B(e,t,Pe.Wait)},parseInt((arguments.length>2&&void 0!==arguments[2]?arguments[2]:"")||"")||15e3);Ae.push(n)},ee=function(e,t,n){var r=(t.ownerDocument||t).defaultView,o=function(e,t){return e.filter(function(e){var n=_sliced_to_array(e,2),o=n[0],i=n[1],a=r.scrollY+r.innerHeight,c=o.offsetTop;if(a<c)return!0;var u=o.clientHeight;return!(100*(1-(c+u-a)/(u||1))>=i)||(B(t,o,Pe.Scroll),!1)})};we||(we=function(e){var t=function(e,t){var n;return"number"==typeof e?{wait:e}:e?{wait:null!==(n=e.wait)&&void 0!==n?n:t,size:e.size,age:e.age}:{wait:t}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,1e3),n=t.wait,r=null;return function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];if(null===r)return r=setTimeout(function(){r=null},n),e.apply(void 0,_to_consumable_array(o))}}(function(){xe=o.call(t,xe,e)}),t.addEventListener("scroll",we,{signal:H().signal}))},te=function(e,t,n,r,o){var i=_to_consumable_array(n),a=new Set;i.forEach(function(n,i){var c=ne(n);if(c){var u=c[0];!l(u)&&s(u)&&u.startsWith("walker ")&&(a.add(i),re(e,t,c,r,o))}});var c=_to_consumable_array(a).sort(function(e,t){return t-e}),u=!0,f=!1,d=void 0;try{for(var v,y=c[Symbol.iterator]();!(u=(v=y.next()).done);u=!0){var _=v.value;n.splice(_,1)}}catch(e){f=!0,d=e}finally{try{u||null==y.return||y.return()}finally{if(f)throw d}}null==o||o.debug("drainWalkerCommands done",{consumed:a.size,remaining:n.length})},ne=function(e){var t=oe(e)?_to_consumable_array(Array.from(e)):ie(e)?Array.from(e):[e];if(!Array.isArray(t)||0===t.length)return null;if(1===t.length&&!t[0])return null;var n=t[0];return l(n)&&0===Object.keys(n).length||!l(n)&&s(n)&&""===n.trim()?null:t},re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"data-elb",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;d(function(){if(Array.isArray(n)){var i=_to_array(n),a=i[0],c=i.slice(1);if(!a||s(a)&&""===a.trim())return void(null==o||o.debug("pushCommand skipped (empty/invalid action)",{item:n}));if(s(a)&&a.startsWith("walker "))return null==o||o.debug("pushCommand walker command",{action:a,data:c[0]}),void e(a,c[0]);null==o||o.debug("pushCommand event (translated)",{action:a,rest:c}),W.apply(void 0,[{elb:e,settings:{prefix:t,scope:r,pageview:!1,elb:"",elbLayer:!1}},a].concat(_to_consumable_array(c)))}else if(n&&"object"===(void 0===n?"undefined":_type_of(n))){if(0===Object.keys(n).length)return void(null==o||o.debug("pushCommand skipped (empty object)"));null==o||o.debug("pushCommand object event",{item:n}),e(n)}},function(e){null==o||o.warn("pushCommand failed",{error:e,item:n})})()},oe=function(e){return null!=e&&"object"===(void 0===e?"undefined":_type_of(e))&&"[object Arguments]"===Object.prototype.toString.call(e)},ie=function(e){return null!=e&&"object"===(void 0===e?"undefined":_type_of(e))&&"length"in e&&"number"==typeof e.length},ae=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).prefix||"data-elb";return function(t){var n=void 0,r=t,o={},i={},a={},u={},l={},f={};function d(e){return Object.entries(e).map(function(e){var t=_sliced_to_array(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(function(e){if(!c(e)||null===e)return"undefined";var t=String(e);return(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/;/g,"\\;")).replace(/:/g,"\\:")).replace(/'/g,"\\'")}(r))}).join(";")}var v={entity:function(e){return n=e,r=e,v},data:function(e,t){var n=null!=r?r:"";return o[n]||(o[n]={}),s(e)?o[n][e]=t:Object.assign(o[n],e),v},action:function(e,t){if(s(e))if(c(t))i[e]=t;else if(e.includes(":")){var n=_sliced_to_array(e.split(":",2),2),r=n[0],o=n[1];i[r]=o}else i[e]=e;else Object.assign(i,e);return v},actions:function(e,t){if(s(e))if(c(t))a[e]=t;else if(e.includes(":")){var n=_sliced_to_array(e.split(":",2),2),r=n[0],o=n[1];a[r]=o}else a[e]=e;else Object.assign(a,e);return v},context:function(e,t){return s(e)?u[e]=t:Object.assign(u,e),v},globals:function(e,t){return s(e)?l[e]=t:Object.assign(l,e),v},link:function(e,t){return s(e)?f[e]=t:Object.assign(f,e),v},get:function(){var t={};return n&&(t[e]=n),Object.entries(o).forEach(function(n){var r=_sliced_to_array(n,2),o=r[0],i=r[1];if(Object.keys(i).length>0){var a=o?"".concat(e,"-").concat(o):"".concat(e,"-");t[a]=d(i)}}),Object.keys(i).length>0&&(t["".concat(e,"action")]=d(i)),Object.keys(a).length>0&&(t["".concat(e,"actions")]=d(a)),Object.keys(u).length>0&&(t["".concat(e,"context")]=d(u)),Object.keys(l).length>0&&(t["".concat(e,"globals")]=d(l)),Object.keys(f).length>0&&(t["".concat(e,"link")]=d(f)),t}};return v}},ce=function(){Le=0},ue=Object.defineProperty,le=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,fe=Object.prototype.hasOwnProperty,de={};!function(e,t){for(var n in t)ue(e,n,{get:t[n],enumerable:!0})}(de,{SourceBrowser:function(){return De},__resetInstanceCountForTests:function(){return ce},createTagger:function(){return ae},default:function(){return Te},getAllEvents:function(){return g},getElbAttributeName:function(){return b},getElbValues:function(){return p},getEvents:function(){return m},getGlobals:function(){return h},sourceBrowser:function(){return Ie}});var ve=Object.defineProperty,ye=function(e,t){for(var n in t)ve(e,n,{get:t[n],enumerable:!0})};ye({},{stepId:function(){return e}});ye({},{getDestination:function(){return t}});ye({},{Level:function(){return be}});var _e,be=((_e=be||{})[_e.ERROR=0]="ERROR",_e[_e.WARN=1]="WARN",_e[_e.INFO=2]="INFO",_e[_e.DEBUG=3]="DEBUG",_e);ye({},{getTransformer:function(){return n}});ye({},{getSource:function(){return r}});ye({},{getStore:function(){return o}});var pe={merge:!0,shallow:!0,extend:!0},ge={Commands:{Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Scoped:"_",Session:"session",Shutdown:"shutdown",User:"user",Walker:"walker"},Utils:{Storage:{Cookie:"cookie",Local:"local",Session:"session"}}};ge.Commands.Consent,ge.Commands.User,ge.Commands.Globals,ge.Commands.Custom,Object.freeze({batched:!0});function me(e,t,n,r){var o=y(t,b(e));if(!o||r&&!r[o])return null;var a=[t],c="[".concat(b(e,o),"],[").concat(b(e,""),"]"),u=b(e,ge.Commands.Link,!1),l={},s=[],f=_sliced_to_array(k(n||t,c,e,o,!0),2),d=f[0],v=f[1];he(t,"[".concat(u,"]"),function(n){var r=_sliced_to_array(C(y(n,u)),2),o=r[0];"parent"===r[1]&&he(t.ownerDocument.body,"[".concat(u,'="').concat(o,':child"]'),function(t){a.push(t);var n=me(e,t);n&&s.push(n)})});var _=[];a.forEach(function(e){e.matches(c)&&_.push(e),he(e,c,function(e){return _.push(e)})});var g={};return _.forEach(function(t){g=i(g,p(e,t,"")),l=i(l,p(e,t,o))}),l=i(i(g,l),d),a.forEach(function(t){he(t,"[".concat(b(e),"]"),function(t){var n=me(e,t);n&&s.push(n)})}),{entity:o,data:l,context:v,nested:s}}function he(e,t,n){e.querySelectorAll(t).forEach(n),_instanceof(e,(e.ownerDocument||e).defaultView.Element)&&e.shadowRoot&&he(e.shadowRoot,t,n),e.querySelectorAll("*").forEach(function(e){e.shadowRoot&&he(e.shadowRoot,t,n)})}var we,je,Oe,ke=new WeakMap,Se=new WeakMap,Ee=new WeakMap,xe=[],Ce=[],Ae=[],Pe={Click:"click",Custom:"custom",Hover:"hover",Load:"load",Pulse:"pulse",Scroll:"scroll",Submit:"submit",Impression:"impression",Visible:"visible",Wait:"wait"},De={},Le=0,Ie=function(e){return _async_to_generator(function(){var t,n,r,o,i,a,c,u,l,f,d,v,y,_,p;return _ts_generator(this,function(g){if(Le>0&&void 0!==globalThis.window)throw new Error("walker.js browser source is single-instance per window. See packages/web/sources/browser/src/trigger.ts for the invariant note.");return Le+=1,t=e.config,n=e.env,r=e.logger,o=n.elb,n.command,i=n.window,a=n.document,c=(null==t?void 0:t.settings)||{},u=i||(void 0!==globalThis.window?globalThis.window:void 0),l=a||(void 0!==globalThis.document?globalThis.document:void 0),f=function(){return _object_spread({prefix:"data-elb",pageview:!0,elb:"elb",elbLayer:"elbLayer",scope:(arguments.length>1?arguments[1]:void 0)||void 0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}(c,l),d={elb:o,settings:f,initScope:q},v=function(e){if(e.pageview){var t=_sliced_to_array(function(e,t){var n=t.ownerDocument||t,r=n.defaultView.location,o="page",i="body"in t?t.body:t,a=_sliced_to_array(k(i,"[".concat(b(e,o),"]"),e,o),2),c=a[0],u=a[1];return c.domain=r.hostname,c.title=n.title,c.referrer=n.referrer,r.search&&(c.search=r.search),r.hash&&(c.hash=r.hash),[c,u]}(e.prefix||"data-elb",e.scope),2),n=t[0],r=t[1];W(d,"page view",n,"load",r)}},y=function(){return _async_to_generator(function(){return _ts_generator(this,function(e){switch(e.label){case 0:return u&&l?(!1!==f.elbLayer&&o&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name||"elbLayer",r=t.window,o=t.logger;if(r){var i=r;i[n]||(i[n]=[]);var a,c=i[n],u=r.document;null==o||o.debug("initElbLayer enter",{layerName:n,queuedItems:c.length}),c.push=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(oe(r[0])){var a=_to_consumable_array(Array.from(r[0])),c=Array.prototype.push.apply(this,[a]);return re(e,t.prefix,a,u,o),c}var l=Array.prototype.push.apply(this,r);return r.forEach(function(n){re(e,t.prefix,n,u,o)}),l},Array.isArray(c)&&c.length>0&&(null==o||o.debug("initElbLayer drain walker commands",{count:c.length}),te(e,null!==(a=t.prefix)&&void 0!==a?a:"data-elb",c,u,o))}}(o,{name:s(f.elbLayer)?f.elbLayer:"elbLayer",prefix:f.prefix,window:u,logger:r}),[4,G(M,d,f)]):[2];case 1:return e.sent(),s(f.elb)&&f.elb&&(u[f.elb]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=_sliced_to_array(t,6),o=r[0],i=r[1],a=r[2],c=r[3],u=r[4],l=r[5];return W(d,o,i,a,c,u,l)}),[2]}})})()},_=function(e){return _async_to_generator(function(){return _ts_generator(this,function(t){if("run"===e)l&&u&&(!function(e,t){t.scope&&q(e,t)}(d,f),function(e,t,n,r){var o=s(t.elbLayer)?t.elbLayer:"elbLayer",i=t.prefix||"data-elb",a=n[o];if(Array.isArray(a)){var c=n.document,u=-1;a.forEach(function(e,t){var n=ne(e);n&&s(n[0])&&"walker run"===n[0]&&(u=t)});for(var l=[],f=u+1;f<a.length;f++){var d=ne(a[f]);d&&l.push(d)}a.length=u+1,null==r||r.debug("drainNonWalkerEvents",{anchor:u,drained:l.length}),l.forEach(function(t){return re(e,i,t,c,r)})}}(o,f,u,r),v(f));return[2]})})()},p=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=_sliced_to_array(t,6),o=r[0],i=r[1],a=r[2],c=r[3],u=r[4],l=r[5];return W(d,o,i,a,c,u,l)},[2,{type:"browser",config:{settings:f},push:p,on:_,init:y,destroy:function(){return _async_to_generator(function(){return _ts_generator(this,function(e){return je&&(je.abort(),je=void 0),we=void 0,xe=[],Ce.forEach(function(e){return clearInterval(e)}),Ce=[],Ae.forEach(function(e){return clearTimeout(e)}),Ae=[],l&&T(f.scope||l),[2]})})()}}]})})()},Te=Ie;return Oe=de,function(e,t,n,r){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,i=!1,a=void 0;try{for(var c,u=function(){var o=c.value;fe.call(e,o)||o===n||ue(e,o,{get:function(){return t[o]},enumerable:!(r=le(t,o))||r.enumerable})},l=se(t)[Symbol.iterator]();!(o=(c=l.next()).done);o=!0)u()}catch(e){i=!0,a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}}return e}(ue({},"__esModule",{value:!0}),Oe)}();
1
+ "use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _async_to_generator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){asyncGeneratorStep(i,r,o,a,c,"next",e)}function c(e){asyncGeneratorStep(i,r,o,a,c,"throw",e)}a(void 0)})}}function _define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){_define_property(e,t,n[t])})}return e}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_array(e){return _array_with_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(e,t):void 0}}function _ts_generator(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var Source=function(){var e=function(e,t){if("collector"===e)return"collector";if(!t)throw new Error("stepId(".concat(e,") requires an id"));return"".concat(e,".").concat(t)},t=function(e,t){var n=e.destinations[t];if(!n)throw new Error("Destination not found: ".concat(t));return n},n=function(e,t){var n=e.transformers[t];if(!n)throw new Error("Transformer not found: ".concat(t));return n},r=function(e,t){var n=e.sources[t];if(!n)throw new Error("Source not found: ".concat(t));return n},o=function(e,t){var n=e.stores[t];if(!n)throw new Error("Store not found: ".concat(t));return n},i=function(e,t){return _async_to_generator(function(){return _ts_generator(this,function(n){switch(n.label){case 0:return[4,e.get(t)];case 1:return[2,n.sent()]}})})()},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=_object_spread({},ge,n);var r=Object.entries(t).reduce(function(t,r){var o=_sliced_to_array(r,2),i=o[0],a=o[1],c=e[i];return n.merge&&Array.isArray(c)&&Array.isArray(a)?t[i]=a.reduce(function(e,t){return e.includes(t)?e:_to_consumable_array(e).concat([t])},_to_consumable_array(c)):(n.extend||i in e)&&(t[i]=a),t},{});return n.shallow?_object_spread({},e,r):(Object.assign(e,r),e)},c=function(e){return Array.isArray(e)},u=function(e){return void 0!==e},l=function(e){return!(!e||"object"!=(void 0===e?"undefined":_type_of(e)))&&("body"in e||"tagName"in e)},s=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!c(e)&&"[object Object]"===Object.prototype.toString.call(e)},f=function(e){return"string"==typeof e},d=function(e){if("true"===e)return!0;if("false"===e)return!1;var t=Number(e);return e==t&&""!==e?t:String(e)},v=function(e,t,n){return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];try{return e.apply(void 0,_to_consumable_array(o))}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}},y=function(e){return e?e.trim().replace(/^'|'$/g,"").trim():""},_=function(e,t){return(e.getAttribute(t)||"").trim()},b=function(e,t,n){var r,o=t.getComputedStyle(e);if("none"===o.display)return!1;if("visible"!==o.visibility)return!1;if(o.opacity&&Number(o.opacity)<.1)return!1;var i=t.innerHeight,a=e.getBoundingClientRect(),c=a.height,u=a.y,l=u+c,s={x:a.x+e.offsetWidth/2,y:a.y+e.offsetHeight/2};if(c<=i){if(e.offsetWidth+a.width===0||e.offsetHeight+a.height===0)return!1;if(s.x<0)return!1;if(s.x>(n.documentElement.clientWidth||t.innerWidth))return!1;if(s.y<0)return!1;if(s.y>(n.documentElement.clientHeight||t.innerHeight))return!1;r=n.elementFromPoint(s.x,s.y)}else{var f=i/2;if(u<0&&l<f)return!1;if(l>i&&u>f)return!1;r=n.elementFromPoint(s.x,i/2)}if(r)do{if(r===e)return!0}while(r=r.parentElement);return!1},p=function(e,t){return e+(t=null!=t?(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?"-":"")+t:"")},g=function(e,t,n){var r=_(t,p(e,n,!(arguments.length>3&&void 0!==arguments[3])||arguments[3]))||"";return C(r).reduce(function(e,n){var r=_sliced_to_array(A(n),2),o=r[0],i=r[1];if(!o)return e;if(i||(o.endsWith(":")&&(o=o.slice(0,-1)),i=""),i.startsWith("#")){i=i.slice(1);try{var a=t[i];a||"selected"!==i||(a=t.options[t.selectedIndex].text),i=String(a)}catch(e){i=""}}return o.endsWith("[]")?(o=o.slice(0,-2),c(e[o])||(e[o]=[]),e[o].push(d(i))):e[o]=d(i),e},{})},h=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:he.Commands.Prefix,r=e;if(!r)return[];var o=[],i=he.Commands.Action,a="[".concat(p(n,i,!1),"]"),c=function(e){Object.keys(g(n,e,i,!1)).forEach(function(t){o=o.concat(m(e,t,n))})};return r!==(r.ownerDocument||r)&&(null===(t=r.matches)||void 0===t?void 0:t.call(r,a))&&c(r),we(r,a,c),o},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:he.Commands.Prefix,r=[],o=x(n,e,t),i=o.actions,a=o.nearestOnly;return i.length?(i.forEach(function(o){var i=C(o.actionParams||"",",").reduce(function(e,t){return e[y(t)]=!0,e},{}),c=O(n,e,i,a);if(!c.length){var u="page",l="[".concat(p(n,u),"]"),s=_sliced_to_array(S(e,l,n,u),2),f=s[0],d=s[1];c.push({entity:u,data:f,nested:[],context:d})}c.forEach(function(e){var n;r.push({entity:e.entity,action:o.action,data:e.data,trigger:t,context:e.context,nested:null!==(n=e.nested)&&void 0!==n?n:[]})})}),r):r},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:he.Commands.Prefix,t=arguments.length>1?arguments[1]:void 0;if(!t)return{};var n=p(e,he.Commands.Globals,!1),r="[".concat(n,"]"),o={};return E(t,r,function(t){o=a(o,g(e,t,he.Commands.Globals,!1))}),o},j=function(e){var t={};return C(e).forEach(function(e){var n=_sliced_to_array(A(e),2),r=n[0],o=n[1],i=_sliced_to_array(P(r),2),a=i[0],c=i[1];if(a){var u=_sliced_to_array(P(o||""),2),l=u[0],s=u[1];l=l||a,t[a]||(t[a]=[]),t[a].push({trigger:a,triggerParams:c,action:l,actionParams:s})}}),t},O=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[],i=t;for(n=0!==Object.keys(n||{}).length?n:void 0;i;){var a=me(e,i,t,n);if(a&&(o.push(a),r))break;i=k(e,i)}return o},k=function(e,t){var n=p(e,he.Commands.Link,!1);if(t.matches("[".concat(n,"]"))){var r=_sliced_to_array(A(_(t,n)),2),o=r[0];if("child"===r[1]){var i=t.ownerDocument,a=null;return E(i,"[".concat(n,'="').concat(o,':parent"]'),function(e){a||(a=e)}),a}}var c=t.ownerDocument.defaultView;return!t.parentElement&&t.getRootNode&&_instanceof(t.getRootNode(),c.ShadowRoot)?t.getRootNode().host:t.parentElement},S=function(e,t,n,r){for(var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={},c={},u=e,l="[".concat(p(n,he.Commands.Context,!1),"]"),s=he.Commands.Scoped,f="[".concat(p(n,s,!1),"]"),d=0;u;)o&&s&&u.matches(f)&&(i=a(g(n,u,s,!1),i)),u.matches(t)&&(i=a(g(n,u,""),i),i=a(g(n,u,r),i)),u.matches(l)&&(Object.entries(g(n,u,he.Commands.Context,!1)).forEach(function(e){var t=_sliced_to_array(e,2),n=t[0],r=t[1];r&&!c[n]&&(c[n]=[r,d])}),++d),u=k(n,u);return[i,c]},E=function(e,t,n){e.querySelectorAll(t).forEach(n)},x=function(e,t,n){for(var r=t;r;){var o=_(r,p(e,he.Commands.Actions,!1));if(o){var i=j(o);if(i[n])return{actions:i[n],nearestOnly:!1}}var a=_(r,p(e,he.Commands.Action,!1));if(a){var c=j(a);if(c[n]||"click"!==n)return{actions:c[n]||[],nearestOnly:!0}}r=k(e,r)}return{actions:[],nearestOnly:!1}},C=function(e){if(!e)return[];var t=new RegExp("(?:[^".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:";","']+|'[^']*')+"),"ig");return e.match(t)||[]},A=function(e){var t=_sliced_to_array(e.split(/:(.+)/,2),2),n=t[0],r=t[1];return[y(n),y(r)]},P=function(e){var t=_sliced_to_array(e.split("(",2),2),n=t[0],r=t[1];return[n,r?r.slice(0,-1):""]},D=function(e){var t=Date.now(),n=Ee.get(e);if(!n||t-n.lastChecked>500){var r=e.ownerDocument.defaultView,o=e.ownerDocument;n={isVisible:b(e,r,o),lastChecked:t},Ee.set(e,n)}return n.isVisible},L=function(e){var t=(e.ownerDocument||e).defaultView;if(t&&t.IntersectionObserver)return v(function(){return new t.IntersectionObserver(function(t){t.forEach(function(t){I(e,t)})},{rootMargin:"0px",threshold:[0,.5]})},function(){})()},I=function(e,t){var n,r=t.target,o=xe.get(e);if(o){var i=o.timers.get(r);if(t.intersectionRatio>0){var a=Date.now(),c=Se.get(r);if(!c||a-c.lastChecked>1e3){var u=r.ownerDocument.defaultView;c={isLarge:r.offsetHeight>u.innerHeight,lastChecked:a},Se.set(r,c)}if(t.intersectionRatio>=.5||c.isLarge&&D(r)){var l,s=null===(l=o.elementConfigs)||void 0===l?void 0:l.get(r);if((null==s?void 0:s.multiple)&&s.blocked)return;if(!i){var f=r.ownerDocument.defaultView.setTimeout(function(){return _async_to_generator(function(){var t,n,i,a;return _ts_generator(this,function(c){switch(c.label){case 0:return D(r)?(null==(i=null===(t=o.elementConfigs)||void 0===t?void 0:t.get(r))?void 0:i.context)?[4,F(i.context,r,i.trigger)]:[3,2]:[3,3];case 1:c.sent(),c.label=2;case 2:(null==(a=null===(n=o.elementConfigs)||void 0===n?void 0:n.get(r))?void 0:a.multiple)?a.blocked=!0:function(e,t){var n=xe.get(e);if(n){n.observer&&n.observer.unobserve(t);var r=n.timers.get(t);r&&(clearTimeout(r),n.timers.delete(t)),Se.delete(t),Ee.delete(t)}}(e,r),c.label=3;case 3:return[2]}})})()},o.duration);o.timers.set(r,f)}return}}i&&(clearTimeout(i),o.timers.delete(r));var d=null===(n=o.elementConfigs)||void 0===n?void 0:n.get(r);(null==d?void 0:d.multiple)&&(d.blocked=!1)}},T=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{multiple:!1},r=e.settings.scope;if(r){var o,i=xe.get(r);if((null==i?void 0:i.observer)&&t)i.elementConfigs||(i.elementConfigs=new WeakMap),i.elementConfigs.set(t,{multiple:null!==(o=n.multiple)&&void 0!==o&&o,blocked:!1,context:e,trigger:n.multiple?"visible":"impression"}),i.observer.observe(t)}},W=function(e){if(e){var t=xe.get(e);t&&(t.observer&&t.observer.disconnect(),xe.delete(e))}},R=function(e,t,n,r,o,i,a){var c,u=e.elb,d=e.settings;if(f(t)&&t.startsWith("walker ")){if("walker init"===t&&e.initScope){var v=H(n,d),y=!0,_=!1,b=void 0;try{for(var p,g=v[Symbol.iterator]();!(y=(p=g.next()).done);y=!0){var h=p.value;e.initScope(e,_object_spread_props(_object_spread({},d),{scope:h}))}}catch(e){_=!0,b=e}finally{try{y||null==g.return||g.return()}finally{if(_)throw b}}return Promise.resolve(_object_spread({ok:!(null==(c={ok:!0})?void 0:c.failed)},c))}return u(t,n)}if(s(t)){var m=t;if(!m.source&&d.scope){var j=d.scope.ownerDocument||d.scope,k=j.defaultView;m.source=V(k,j)}return!m.globals&&d.scope&&(m.globals=w(d.prefix,d.scope)),u(m)}var S,E=_sliced_to_array(String(s(t)?t.name:t).split(" "),1)[0],x=s(n)?n:{},C={},A=!1;if(l(n)&&(S=n,A=!0),l(o)?S=o:s(o)&&Object.keys(o).length&&(C=o),S){var P=O(d.prefix||"data-elb",S).find(function(e){return e.entity===E});P&&(A&&(x=P.data),P.context&&(C=P.context))}var D=d.scope?d.scope.ownerDocument||d.scope:void 0,L=null==D?void 0:D.defaultView;"page"===E&&L&&(x.id=x.id||L.location.pathname);var I=w(d.prefix,d.scope);return u({name:String(t||""),data:x,context:C,globals:I,nested:i,custom:a,trigger:f(r)?r:"",source:L&&D?V(L,D):void 0})},V=function(e,t){return{type:"browser",platform:"web",url:e.location.href,referrer:t.referrer}},N=function(e){if(!e||"object"!==(void 0===e?"undefined":_type_of(e)))return!1;if("undefined"!=typeof Element&&_instanceof(e,Element))return!0;if("undefined"!=typeof Document&&_instanceof(e,Document))return!0;if("nodeType"in e){var t=e.nodeType;return 1===t||9===t}return!1},H=function(e,t){if(N(e))return[e];if(Array.isArray(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0){var u=a.value;N(u)&&n.push(u)}}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}if(void 0===e){var l=t.scope;if(N(l))return[l];if(void 0!==globalThis.document)return[globalThis.document]}return[]},G=function(){return Oe||(Oe=new AbortController),Oe},M=function(e,t,n){return _async_to_generator(function(){var r,o,i;return _ts_generator(this,function(a){return r=function(){e(t,n)},(o=n.scope)?("loading"!==(i=o.ownerDocument||o).readyState?r():i.addEventListener("DOMContentLoaded",r),[2]):(r(),[2])})})()},U=function(e,t){t.scope&&q(e,t)},q=function(e,t){var n=t.scope;if(n){Oe&&Oe.abort();var r=(Oe=new AbortController).signal;n.addEventListener("click",v(function(t){$.call(this,e,t)}),{signal:r}),n.addEventListener("submit",v(function(t){Z.call(this,e,t)}),{signal:r})}},B=function(e,t){var n=t.scope;Ce=[];var r=n;if(r){W(r),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;xe.has(e)||xe.set(e,{observer:L(e),timers:new WeakMap,duration:t})}(r,1e3);var o=p(t.prefix,he.Commands.Action,!1);r!==(r.ownerDocument||r)&&z(e,r,o,t),we(r,"[".concat(o,"]"),function(n){z(e,n,o,t)}),Ce.length&&te(e,r,t)}},F=function(e,t,n){return _async_to_generator(function(){var r;return _ts_generator(this,function(o){return r=m(t,n,e.settings.prefix),[2,Promise.all(r.map(function(t){return R(e,_object_spread_props(_object_spread({name:"".concat(t.entity," ").concat(t.action)},t),{trigger:n}))}))]})})()},z=function(e,t,n,r){var o=_(t,n);o&&Object.values(j(o)).forEach(function(n){return n.forEach(function(n){switch(n.trigger){case De.Hover:Y(e,t);break;case De.Load:J(e,t);break;case De.Pulse:Q(e,t,n.triggerParams);break;case De.Scroll:X(t,n.triggerParams);break;case De.Impression:T(e,t);break;case De.Visible:T(e,t,{multiple:!0});break;case De.Wait:ee(e,t,n.triggerParams)}})})},K=function(e){var t,n=null===(t=e.composedPath)||void 0===t?void 0:t.call(e),r=(null==n?void 0:n.length)?n[0]:e.target;if(r&&"object"===(void 0===r?"undefined":_type_of(r))&&"tagName"in r)return r},$=function(e,t){var n=K(t);n&&F(e,n,De.Click)},Y=function(e,t){t.addEventListener("mouseenter",v(function(t){var n=K(t);n&&F(e,n,De.Hover)}),{signal:G().signal})},J=function(e,t){F(e,t,De.Load)},Q=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=t.ownerDocument,o=setInterval(function(){r.hidden||F(e,t,De.Pulse)},parseInt(n||"")||15e3);Ae.push(o)},X=function(e){var t=parseInt((arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")||"")||50;t<0||t>100||Ce.push([e,t])},Z=function(e,t){var n=K(t);n&&F(e,n,De.Submit)},ee=function(e,t){var n=setTimeout(function(){return F(e,t,De.Wait)},parseInt((arguments.length>2&&void 0!==arguments[2]?arguments[2]:"")||"")||15e3);Pe.push(n)},te=function(e,t,n){var r=(t.ownerDocument||t).defaultView,o=function(e,t){return e.filter(function(e){var n=_sliced_to_array(e,2),o=n[0],i=n[1],a=r.scrollY+r.innerHeight,c=o.offsetTop;if(a<c)return!0;var u=o.clientHeight;return!(100*(1-(c+u-a)/(u||1))>=i)||(F(t,o,De.Scroll),!1)})};je||(je=function(e){var t=function(e,t){var n;return"number"==typeof e?{wait:e}:e?{wait:null!==(n=e.wait)&&void 0!==n?n:t,size:e.size,age:e.age}:{wait:t}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,1e3),n=t.wait,r=null;return function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];if(null===r)return r=setTimeout(function(){r=null},n),e.apply(void 0,_to_consumable_array(o))}}(function(){Ce=o.call(t,Ce,e)}),t.addEventListener("scroll",je,{signal:G().signal}))},ne=function(e,t,n,r,o){var i=_to_consumable_array(n),a=new Set;i.forEach(function(n,i){var c=re(n);if(c){var u=c[0];!s(u)&&f(u)&&u.startsWith("walker ")&&(a.add(i),oe(e,t,c,r,o))}});var c=_to_consumable_array(a).sort(function(e,t){return t-e}),u=!0,l=!1,d=void 0;try{for(var v,y=c[Symbol.iterator]();!(u=(v=y.next()).done);u=!0){var _=v.value;n.splice(_,1)}}catch(e){l=!0,d=e}finally{try{u||null==y.return||y.return()}finally{if(l)throw d}}null==o||o.debug("drainWalkerCommands done",{consumed:a.size,remaining:n.length})},re=function(e){var t=ie(e)?_to_consumable_array(Array.from(e)):ae(e)?Array.from(e):[e];if(!Array.isArray(t)||0===t.length)return null;if(1===t.length&&!t[0])return null;var n=t[0];return s(n)&&0===Object.keys(n).length||!s(n)&&f(n)&&""===n.trim()?null:t},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"data-elb",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;v(function(){if(Array.isArray(n)){var i=_to_array(n),a=i[0],c=i.slice(1);if(!a||f(a)&&""===a.trim())return void(null==o||o.debug("pushCommand skipped (empty/invalid action)",{item:n}));if(f(a)&&a.startsWith("walker "))return null==o||o.debug("pushCommand walker command",{action:a,data:c[0]}),void e(a,c[0]);null==o||o.debug("pushCommand event (translated)",{action:a,rest:c}),R.apply(void 0,[{elb:e,settings:{prefix:t,scope:r,pageview:!1,elb:"",elbLayer:!1}},a].concat(_to_consumable_array(c)))}else if(n&&"object"===(void 0===n?"undefined":_type_of(n))){if(0===Object.keys(n).length)return void(null==o||o.debug("pushCommand skipped (empty object)"));null==o||o.debug("pushCommand object event",{item:n}),e(n)}},function(e){null==o||o.warn("pushCommand failed",{error:e,item:n})})()},ie=function(e){return null!=e&&"object"===(void 0===e?"undefined":_type_of(e))&&"[object Arguments]"===Object.prototype.toString.call(e)},ae=function(e){return null!=e&&"object"===(void 0===e?"undefined":_type_of(e))&&"length"in e&&"number"==typeof e.length},ce=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).prefix||"data-elb";return function(t){var n=void 0,r=t,o={},i={},a={},c={},l={},s={};function d(e){return Object.entries(e).map(function(e){var t=_sliced_to_array(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(function(e){if(!u(e)||null===e)return"undefined";var t=String(e);return(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/;/g,"\\;")).replace(/:/g,"\\:")).replace(/'/g,"\\'")}(r))}).join(";")}var v={entity:function(e){return n=e,r=e,v},data:function(e,t){var n=null!=r?r:"";return o[n]||(o[n]={}),f(e)?o[n][e]=t:Object.assign(o[n],e),v},action:function(e,t){if(f(e))if(u(t))i[e]=t;else if(e.includes(":")){var n=_sliced_to_array(e.split(":",2),2),r=n[0],o=n[1];i[r]=o}else i[e]=e;else Object.assign(i,e);return v},actions:function(e,t){if(f(e))if(u(t))a[e]=t;else if(e.includes(":")){var n=_sliced_to_array(e.split(":",2),2),r=n[0],o=n[1];a[r]=o}else a[e]=e;else Object.assign(a,e);return v},context:function(e,t){return f(e)?c[e]=t:Object.assign(c,e),v},globals:function(e,t){return f(e)?l[e]=t:Object.assign(l,e),v},link:function(e,t){return f(e)?s[e]=t:Object.assign(s,e),v},get:function(){var t={};return n&&(t[e]=n),Object.entries(o).forEach(function(n){var r=_sliced_to_array(n,2),o=r[0],i=r[1];if(Object.keys(i).length>0){var a=o?"".concat(e,"-").concat(o):"".concat(e,"-");t[a]=d(i)}}),Object.keys(i).length>0&&(t["".concat(e,"action")]=d(i)),Object.keys(a).length>0&&(t["".concat(e,"actions")]=d(a)),Object.keys(c).length>0&&(t["".concat(e,"context")]=d(c)),Object.keys(l).length>0&&(t["".concat(e,"globals")]=d(l)),Object.keys(s).length>0&&(t["".concat(e,"link")]=d(s)),t}};return v}},ue=function(){Ie=0},le=Object.defineProperty,se=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyNames,de=Object.prototype.hasOwnProperty,ve={};!function(e,t){for(var n in t)le(e,n,{get:t[n],enumerable:!0})}(ve,{SourceBrowser:function(){return Le},__resetInstanceCountForTests:function(){return ue},createTagger:function(){return ce},default:function(){return We},getAllEvents:function(){return h},getElbAttributeName:function(){return p},getElbValues:function(){return g},getEvents:function(){return m},getGlobals:function(){return w},sourceBrowser:function(){return Te}});var ye=Object.defineProperty,_e=function(e,t){for(var n in t)ye(e,n,{get:t[n],enumerable:!0})};_e({},{stepId:function(){return e}});_e({},{getDestination:function(){return t}});_e({},{Level:function(){return pe}});var be,pe=((be=pe||{})[be.ERROR=0]="ERROR",be[be.WARN=1]="WARN",be[be.INFO=2]="INFO",be[be.DEBUG=3]="DEBUG",be);_e({},{getTransformer:function(){return n}});_e({},{getSource:function(){return r}});_e({},{getStore:function(){return o},getStoreValue:function(){return i}});var ge={merge:!0,shallow:!0,extend:!0},he={Commands:{Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Scoped:"_",Session:"session",Shutdown:"shutdown",User:"user",Walker:"walker"},Utils:{Storage:{Cookie:"cookie",Local:"local",Session:"session"}}};he.Commands.Consent,he.Commands.User,he.Commands.Globals,he.Commands.Custom,Object.freeze({batched:!0});function me(e,t,n,r){var o=_(t,p(e));if(!o||r&&!r[o])return null;var i=[t],c="[".concat(p(e,o),"],[").concat(p(e,""),"]"),u=p(e,he.Commands.Link,!1),l={},s=[],f=_sliced_to_array(S(n||t,c,e,o,!0),2),d=f[0],v=f[1];we(t,"[".concat(u,"]"),function(n){var r=_sliced_to_array(A(_(n,u)),2),o=r[0];"parent"===r[1]&&we(t.ownerDocument.body,"[".concat(u,'="').concat(o,':child"]'),function(t){i.push(t);var n=me(e,t);n&&s.push(n)})});var y=[];i.forEach(function(e){e.matches(c)&&y.push(e),we(e,c,function(e){return y.push(e)})});var b={};return y.forEach(function(t){b=a(b,g(e,t,"")),l=a(l,g(e,t,o))}),l=a(a(b,l),d),i.forEach(function(t){we(t,"[".concat(p(e),"]"),function(t){var n=me(e,t);n&&s.push(n)})}),{entity:o,data:l,context:v,nested:s}}function we(e,t,n){e.querySelectorAll(t).forEach(n),_instanceof(e,(e.ownerDocument||e).defaultView.Element)&&e.shadowRoot&&we(e.shadowRoot,t,n),e.querySelectorAll("*").forEach(function(e){e.shadowRoot&&we(e.shadowRoot,t,n)})}var je,Oe,ke,Se=new WeakMap,Ee=new WeakMap,xe=new WeakMap,Ce=[],Ae=[],Pe=[],De={Click:"click",Custom:"custom",Hover:"hover",Load:"load",Pulse:"pulse",Scroll:"scroll",Submit:"submit",Impression:"impression",Visible:"visible",Wait:"wait"},Le={},Ie=0,Te=function(e){return _async_to_generator(function(){var t,n,r,o,i,a,c,u,l,s,d,v,y,_,b;return _ts_generator(this,function(g){if(Ie>0&&void 0!==globalThis.window)throw new Error("walker.js browser source is single-instance per window. See packages/web/sources/browser/src/trigger.ts for the invariant note.");return Ie+=1,t=e.config,n=e.env,r=e.logger,o=n.elb,n.command,i=n.window,a=n.document,c=(null==t?void 0:t.settings)||{},u=i||(void 0!==globalThis.window?globalThis.window:void 0),l=a||(void 0!==globalThis.document?globalThis.document:void 0),s=function(){return _object_spread({prefix:"data-elb",pageview:!0,elb:"elb",elbLayer:"elbLayer",scope:(arguments.length>1?arguments[1]:void 0)||void 0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}(c,l),d={elb:o,settings:s,initScope:B},v=function(e){if(e.pageview){var t=_sliced_to_array(function(e,t){var n=t.ownerDocument||t,r=n.defaultView.location,o="page",i="body"in t?t.body:t,a=_sliced_to_array(S(i,"[".concat(p(e,o),"]"),e,o),2),c=a[0],u=a[1];return c.domain=r.hostname,c.title=n.title,c.referrer=n.referrer,r.search&&(c.search=r.search),r.hash&&(c.hash=r.hash),[c,u]}(e.prefix||"data-elb",e.scope),2),n=t[0],r=t[1];R(d,"page view",n,"load",r)}},y=function(){return _async_to_generator(function(){return _ts_generator(this,function(e){switch(e.label){case 0:return u&&l?(!1!==s.elbLayer&&o&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name||"elbLayer",r=t.window,o=t.logger;if(r){var i=r;i[n]||(i[n]=[]);var a,c=i[n],u=r.document;null==o||o.debug("initElbLayer enter",{layerName:n,queuedItems:c.length}),c.push=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(ie(r[0])){var a=_to_consumable_array(Array.from(r[0])),c=Array.prototype.push.apply(this,[a]);return oe(e,t.prefix,a,u,o),c}var l=Array.prototype.push.apply(this,r);return r.forEach(function(n){oe(e,t.prefix,n,u,o)}),l},Array.isArray(c)&&c.length>0&&(null==o||o.debug("initElbLayer drain walker commands",{count:c.length}),ne(e,null!==(a=t.prefix)&&void 0!==a?a:"data-elb",c,u,o))}}(o,{name:f(s.elbLayer)?s.elbLayer:"elbLayer",prefix:s.prefix,window:u,logger:r}),[4,M(U,d,s)]):[2];case 1:return e.sent(),f(s.elb)&&s.elb&&(u[s.elb]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=_sliced_to_array(t,6),o=r[0],i=r[1],a=r[2],c=r[3],u=r[4],l=r[5];return R(d,o,i,a,c,u,l)}),[2]}})})()},_=function(e){return _async_to_generator(function(){return _ts_generator(this,function(t){if("run"===e)l&&u&&(!function(e,t){t.scope&&B(e,t)}(d,s),function(e,t,n,r){var o=f(t.elbLayer)?t.elbLayer:"elbLayer",i=t.prefix||"data-elb",a=n[o];if(Array.isArray(a)){var c=n.document,u=-1;a.forEach(function(e,t){var n=re(e);n&&f(n[0])&&"walker run"===n[0]&&(u=t)});for(var l=[],s=u+1;s<a.length;s++){var d=re(a[s]);d&&l.push(d)}a.length=u+1,null==r||r.debug("drainNonWalkerEvents",{anchor:u,drained:l.length}),l.forEach(function(t){return oe(e,i,t,c,r)})}}(o,s,u,r),v(s));return[2]})})()},b=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=_sliced_to_array(t,6),o=r[0],i=r[1],a=r[2],c=r[3],u=r[4],l=r[5];return R(d,o,i,a,c,u,l)},[2,{type:"browser",config:{settings:s},push:b,on:_,init:y,destroy:function(){return _async_to_generator(function(){return _ts_generator(this,function(e){return Oe&&(Oe.abort(),Oe=void 0),je=void 0,Ce=[],Ae.forEach(function(e){return clearInterval(e)}),Ae=[],Pe.forEach(function(e){return clearTimeout(e)}),Pe=[],l&&W(s.scope||l),[2]})})()}}]})})()},We=Te;return ke=ve,function(e,t,n,r){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,i=!1,a=void 0;try{for(var c,u=function(){var o=c.value;de.call(e,o)||o===n||le(e,o,{get:function(){return t[o]},enumerable:!(r=se(t,o))||r.enumerable})},l=fe(t)[Symbol.iterator]();!(o=(c=l.next()).done);o=!0)u()}catch(e){i=!0,a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}}return e}(le({},"__esModule",{value:!0}),ke)}();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/web-source-browser",
4
- "version": "4.2.0-next-1780704768738",
4
+ "version": "4.2.0-next-1780909874350",
5
5
  "type": "source",
6
6
  "platform": [
7
7
  "web"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/web-source-browser",
3
3
  "description": "Browser DOM source for walkerOS",
4
- "version": "4.2.0-next-1780704768738",
4
+ "version": "4.2.0-next-1780909874350",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -33,9 +33,9 @@
33
33
  "update": "npx npm-check-updates -u && npm update"
34
34
  },
35
35
  "dependencies": {
36
- "@walkeros/collector": "4.2.0-next-1780704768738",
37
- "@walkeros/core": "4.2.0-next-1780704768738",
38
- "@walkeros/web-core": "4.2.0-next-1780704768738"
36
+ "@walkeros/collector": "4.2.0-next-1780909874350",
37
+ "@walkeros/core": "4.2.0-next-1780909874350",
38
+ "@walkeros/web-core": "4.2.0-next-1780909874350"
39
39
  },
40
40
  "repository": {
41
41
  "url": "git+https://github.com/elbwalker/walkerOS.git",