@walkeros/web-source-datalayer 4.2.0-next-1780690800063 → 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-datalayer
2
2
 
3
- ## 4.2.0-next-1780690800063
3
+ ## 4.2.0-next-1780909874350
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -27,8 +27,9 @@
27
27
  - Updated dependencies [654ba38]
28
28
  - Updated dependencies [6a72a32]
29
29
  - Updated dependencies [3eb2467]
30
- - @walkeros/core@4.2.0-next-1780690800063
31
- - @walkeros/collector@4.2.0-next-1780690800063
30
+ - Updated dependencies [7d8ebf9]
31
+ - @walkeros/core@4.2.0-next-1780909874350
32
+ - @walkeros/collector@4.2.0-next-1780909874350
32
33
 
33
34
  ## 4.1.2
34
35
 
@@ -1 +1 @@
1
- "use strict";var Destination=(()=>{var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,e=Object.prototype.hasOwnProperty,o={};((n,t)=>{for(var e in t)r(n,e,{get:t[e],enumerable:!0})})(o,{SourceDataLayer:()=>O,default:()=>j,sourceDataLayer:()=>A});var a=Object.defineProperty,u=(r,n)=>{for(var t in n)a(r,t,{get:n[t],enumerable:!0})};function i(r,n){if("collector"===r)return"collector";if(!n)throw new Error(`stepId(${r}) requires an id`);return`${r}.${n}`}u({},{stepId:()=>i});function f(r,n){const t=r.destinations[n];if(!t)throw new Error(`Destination not found: ${n}`);return t}u({},{getDestination:()=>f});u({},{Level:()=>c});var l,c=((l=c||{})[l.ERROR=0]="ERROR",l[l.WARN=1]="WARN",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l);function s(r,n){const t=r.transformers[n];if(!t)throw new Error(`Transformer not found: ${n}`);return t}u({},{getTransformer:()=>s});function y(r,n){const t=r.sources[n];if(!t)throw new Error(`Source not found: ${n}`);return t}u({},{getSource:()=>y});function d(r,n){const t=r.stores[n];if(!t)throw new Error(`Store not found: ${n}`);return t}function g(r){return Array.isArray(r)}function p(r){return"object"==typeof r&&null!==r&&!g(r)&&"[object Object]"===Object.prototype.toString.call(r)}function b(r){return"string"==typeof r}function m(r,n,t){return function(...e){try{return r(...e)}catch(r){if(!n)return;return n(r)}finally{null==t||t()}}}u({},{getStore:()=>d});var h=!1;function w(r,n={},t){if(n.filter){if(!0===m(()=>n.filter(t),()=>!1)())return}const e=function(r){if(p(r)&&b(r.event)){const{event:n,...t}=r;return{name:n,...t}}if(g(r)&&r.length>=2)return v(r);if(n=r,null!=n&&"object"==typeof n&&"length"in n&&"number"==typeof n.length&&n.length>0){return v(Array.from(r))}var n;return null}(t);if(!e)return;const o=`${n.prefix||"dataLayer"} ${e.name}`,{name:a,...u}=e,i={name:o,data:u};m(()=>r(i),()=>{})()}function v(r){const[n,t,e]=r;if(!b(n))return null;let o,a={};switch(n){case"consent":if(!b(t)||r.length<3)return null;if("default"!==t&&"update"!==t)return null;if(!p(e)||null===e)return null;o=`${n} ${t}`,a={...e};break;case"event":if(!b(t))return null;o=t,p(e)&&(a={...e});break;case"config":if(!b(t))return null;o=`${n} ${t}`,p(e)&&(a={...e});break;case"set":if(b(t))o=`${n} ${t}`,p(e)&&(a={...e});else{if(!p(t))return null;o=`${n} custom`,a={...t}}break;default:return null}return{name:o,...a}}var $,O={},A=async r=>{const{config:n,env:t}=r,{elb:e,window:o}=t,a={name:"dataLayer",prefix:"dataLayer",...null==n?void 0:n.settings},u={settings:a};let i=0;return{type:"dataLayer",config:u,push:e,on:async r=>{if("run"===r&&o&&i>0){!function(r,n,t,e=globalThis.window){const o=n.settings,a=e[(null==o?void 0:o.name)||"dataLayer"];if(Array.isArray(a)&&!h){h=!0;try{const n=null!=t?t:a.length;for(let t=0;t<n;t++)w(r,o,a[t])}finally{h=!1}}}(e,u,i,o),i=0}},init:()=>{if(!o)return;const r=a.name||"dataLayer",n=o[r];i=Array.isArray(n)?n.length:0;!function(r,n,t=globalThis.window){const e=n.settings,o=(null==e?void 0:e.name)||"dataLayer";t[o]||(t[o]=[]);const a=t[o];if(!Array.isArray(a))return;const u=a.push.bind(a);a.push=function(...n){if(h)return u(...n);h=!0;try{for(const t of n)w(r,e,t)}finally{h=!1}return u(...n)}}(e,u,o)},destroy:async()=>{const r=a.name||"dataLayer";o&&o[r]&&Array.isArray(o[r])}}},j=A;return $=o,((o,a,u,i)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let f of t(a))e.call(o,f)||f===u||r(o,f,{get:()=>a[f],enumerable:!(i=n(a,f))||i.enumerable});return o})(r({},"__esModule",{value:!0}),$)})();
1
+ "use strict";var Destination=(()=>{var r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,e=Object.prototype.hasOwnProperty,o={};((t,n)=>{for(var e in n)r(t,e,{get:n[e],enumerable:!0})})(o,{SourceDataLayer:()=>A,default:()=>L,sourceDataLayer:()=>j});var a=Object.defineProperty,u=(r,t)=>{for(var n in t)a(r,n,{get:t[n],enumerable:!0})};function i(r,t){if("collector"===r)return"collector";if(!t)throw new Error(`stepId(${r}) requires an id`);return`${r}.${t}`}u({},{stepId:()=>i});function f(r,t){const n=r.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}u({},{getDestination:()=>f});u({},{Level:()=>c});var l,c=((l=c||{})[l.ERROR=0]="ERROR",l[l.WARN=1]="WARN",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l);function s(r,t){const n=r.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}u({},{getTransformer:()=>s});function y(r,t){const n=r.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}u({},{getSource:()=>y});function d(r,t){const n=r.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(r,t){return await r.get(t)}function p(r){return Array.isArray(r)}function b(r){return"object"==typeof r&&null!==r&&!p(r)&&"[object Object]"===Object.prototype.toString.call(r)}function m(r){return"string"==typeof r}function w(r,t,n){return function(...e){try{return r(...e)}catch(r){if(!t)return;return t(r)}finally{null==n||n()}}}u({},{getStore:()=>d,getStoreValue:()=>g});var h=!1;function v(r,t={},n){if(t.filter){if(!0===w(()=>t.filter(n),()=>!1)())return}const e=function(r){if(b(r)&&m(r.event)){const{event:t,...n}=r;return{name:t,...n}}if(p(r)&&r.length>=2)return $(r);if(t=r,null!=t&&"object"==typeof t&&"length"in t&&"number"==typeof t.length&&t.length>0){return $(Array.from(r))}var t;return null}(n);if(!e)return;const o=`${t.prefix||"dataLayer"} ${e.name}`,{name:a,...u}=e,i={name:o,data:u};w(()=>r(i),()=>{})()}function $(r){const[t,n,e]=r;if(!m(t))return null;let o,a={};switch(t){case"consent":if(!m(n)||r.length<3)return null;if("default"!==n&&"update"!==n)return null;if(!b(e)||null===e)return null;o=`${t} ${n}`,a={...e};break;case"event":if(!m(n))return null;o=n,b(e)&&(a={...e});break;case"config":if(!m(n))return null;o=`${t} ${n}`,b(e)&&(a={...e});break;case"set":if(m(n))o=`${t} ${n}`,b(e)&&(a={...e});else{if(!b(n))return null;o=`${t} custom`,a={...n}}break;default:return null}return{name:o,...a}}var O,A={},j=async r=>{const{config:t,env:n}=r,{elb:e,window:o}=n,a={name:"dataLayer",prefix:"dataLayer",...null==t?void 0:t.settings},u={settings:a};let i=0;return{type:"dataLayer",config:u,push:e,on:async r=>{if("run"===r&&o&&i>0){!function(r,t,n,e=globalThis.window){const o=t.settings,a=e[(null==o?void 0:o.name)||"dataLayer"];if(Array.isArray(a)&&!h){h=!0;try{const t=null!=n?n:a.length;for(let n=0;n<t;n++)v(r,o,a[n])}finally{h=!1}}}(e,u,i,o),i=0}},init:()=>{if(!o)return;const r=a.name||"dataLayer",t=o[r];i=Array.isArray(t)?t.length:0;!function(r,t,n=globalThis.window){const e=t.settings,o=(null==e?void 0:e.name)||"dataLayer";n[o]||(n[o]=[]);const a=n[o];if(!Array.isArray(a))return;const u=a.push.bind(a);a.push=function(...t){if(h)return u(...t);h=!0;try{for(const n of t)v(r,e,n)}finally{h=!1}return u(...t)}}(e,u,o)},destroy:async()=>{const r=a.name||"dataLayer";o&&o[r]&&Array.isArray(o[r])}}},L=j;return O=o,((o,a,u,i)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let f of n(a))e.call(o,f)||f===u||r(o,f,{get:()=>a[f],enumerable:!(i=t(a,f))||i.enumerable});return o})(r({},"__esModule",{value:!0}),O)})();
package/dist/index.es5.js CHANGED
@@ -1 +1 @@
1
- "use strict";function _array_like_to_array(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function _array_with_holes(r){if(Array.isArray(r))return r}function _array_without_holes(r){if(Array.isArray(r))return _array_like_to_array(r)}function asyncGeneratorStep(r,t,e,n,o,a,i){try{var u=r[a](i),l=u.value}catch(r){return void e(r)}u.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var a=r.apply(t,e);function i(r){asyncGeneratorStep(a,n,o,i,u,"next",r)}function u(r){asyncGeneratorStep(a,n,o,i,u,"throw",r)}i(void 0)})}}function _define_property(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function _iterable_to_array(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _iterable_to_array_limit(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,a=[],i=!0,u=!1;try{for(e=e.call(r);!(i=(n=e.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(r){u=!0,o=r}finally{try{i||null==e.return||e.return()}finally{if(u)throw o}}return a}}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(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.forEach(function(t){_define_property(r,t,e[t])})}return r}function _object_without_properties(r,t){if(null==r)return{};var e,n,o,a={};if("undefined"!=typeof Reflect&&Reflect.ownKeys){for(e=Reflect.ownKeys(Object(r)),o=0;o<e.length;o++)n=e[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(r,n)&&(a[n]=r[n]);return a}if(a=_object_without_properties_loose(r,t),Object.getOwnPropertySymbols)for(e=Object.getOwnPropertySymbols(r),o=0;o<e.length;o++)n=e[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(r,n)&&(a[n]=r[n]);return a}function _object_without_properties_loose(r,t){if(null==r)return{};var e,n,o={},a=Object.getOwnPropertyNames(r);for(n=0;n<a.length;n++)e=a[n],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(o[e]=r[e]);return o}function _sliced_to_array(r,t){return _array_with_holes(r)||_iterable_to_array_limit(r,t)||_unsupported_iterable_to_array(r,t)||_non_iterable_rest()}function _to_consumable_array(r){return _array_without_holes(r)||_iterable_to_array(r)||_unsupported_iterable_to_array(r)||_non_iterable_spread()}function _type_of(r){return r&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r}function _unsupported_iterable_to_array(r,t){if(r){if("string"==typeof r)return _array_like_to_array(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_array_like_to_array(r,t):void 0}}function _ts_generator(r,t){var e,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:l(0)}),u(i,"throw",{value:l(1)}),u(i,"return",{value:l(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function l(u){return function(l){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(e=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(r,a)}catch(r){u=[6,r],n=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}var Destination=function(){var r=function(r,t){if("collector"===r)return"collector";if(!t)throw new Error("stepId(".concat(r,") requires an id"));return"".concat(r,".").concat(t)},t=function(r,t){var e=r.destinations[t];if(!e)throw new Error("Destination not found: ".concat(t));return e},e=function(r,t){var e=r.transformers[t];if(!e)throw new Error("Transformer not found: ".concat(t));return e},n=function(r,t){var e=r.sources[t];if(!e)throw new Error("Source not found: ".concat(t));return e},o=function(r,t){var e=r.stores[t];if(!e)throw new Error("Store not found: ".concat(t));return e},a=function(r){return Array.isArray(r)},i=function(r){return"object"==(void 0===r?"undefined":_type_of(r))&&null!==r&&!a(r)&&"[object Object]"===Object.prototype.toString.call(r)},u=function(r){return"string"==typeof r},l=function(r,t,e){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];try{return r.apply(void 0,_to_consumable_array(o))}catch(r){if(!t)return;return t(r)}finally{null==e||e()}}},c=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0;if(t.filter&&!0===l(function(){return t.filter(e)},function(){return!1})())return;var n=f(e);if(n){var o=t.prefix||"dataLayer",a="".concat(o," ").concat(n.name),i=(n.name,{name:a,data:_object_without_properties(n,["name"])});l(function(){return r(i)},function(){})()}},f=function(r){if(i(r)&&u(r.event))return _object_spread({name:r.event},_object_without_properties(r,["event"]));if(a(r)&&r.length>=2)return y(r);if(_(r)){var t=Array.from(r);return y(t)}return null},y=function(r){var t,e=_sliced_to_array(r,3),n=e[0],o=e[1],a=e[2];if(!u(n))return null;var l={};switch(n){case"consent":if(!u(o)||r.length<3)return null;if("default"!==o&&"update"!==o)return null;if(!i(a)||null===a)return null;t="".concat(n," ").concat(o),l=_object_spread({},a);break;case"event":if(!u(o))return null;t=o,i(a)&&(l=_object_spread({},a));break;case"config":if(!u(o))return null;t="".concat(n," ").concat(o),i(a)&&(l=_object_spread({},a));break;case"set":if(u(o))t="".concat(n," ").concat(o),i(a)&&(l=_object_spread({},a));else{if(!i(o))return null;t="".concat(n," custom"),l=_object_spread({},o)}break;default:return null}return _object_spread({name:t},l)},_=function(r){return null!=r&&"object"===(void 0===r?"undefined":_type_of(r))&&"length"in r&&"number"==typeof r.length&&r.length>0},s=Object.defineProperty,p=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,v={};!function(r,t){for(var e in t)s(r,e,{get:t[e],enumerable:!0})}(v,{SourceDataLayer:function(){return S},default:function(){return E},sourceDataLayer:function(){return A}});var h=Object.defineProperty,m=function(r,t){for(var e in t)h(r,e,{get:t[e],enumerable:!0})};m({},{stepId:function(){return r}});m({},{getDestination:function(){return t}});m({},{Level:function(){return w}});var g,w=((g=w||{})[g.ERROR=0]="ERROR",g[g.WARN=1]="WARN",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g);m({},{getTransformer:function(){return e}});m({},{getSource:function(){return n}});m({},{getStore:function(){return o}});var j,O=!1,S={},A=function(r){return _async_to_generator(function(){var t,e,n,o,a,i,u,l,f;return _ts_generator(this,function(y){return t=r.config,e=r.env,n=e.elb,o=e.window,a=_object_spread({name:"dataLayer",prefix:"dataLayer"},null==t?void 0:t.settings),u=0,l=function(){if(o){var r=a.name||"dataLayer",t=o[r];u=Array.isArray(t)?t.length:0,function(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:globalThis.window,n=t.settings,o=(null==n?void 0:n.name)||"dataLayer";e[o]||(e[o]=[]);var a=e[o];if(Array.isArray(a)){var i=a.push.bind(a);a.push=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];if(O)return i.apply(void 0,_to_consumable_array(e));O=!0;try{var a=!0,u=!1,l=void 0;try{for(var f,y=e[Symbol.iterator]();!(a=(f=y.next()).done);a=!0){var _=f.value;c(r,n,_)}}catch(r){u=!0,l=r}finally{try{a||null==y.return||y.return()}finally{if(u)throw l}}}finally{O=!1}return i.apply(void 0,_to_consumable_array(e))}}}(n,i,o)}},f=function(r){return _async_to_generator(function(){return _ts_generator(this,function(t){return"run"===r&&o&&u>0&&(function(r,t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:globalThis.window,o=t.settings,a=n[(null==o?void 0:o.name)||"dataLayer"];if(Array.isArray(a)&&!O){O=!0;try{for(var i=null!=e?e:a.length,u=0;u<i;u++)c(r,o,a[u])}finally{O=!1}}}(n,i,u,o),u=0),[2]})})()},[2,{type:"dataLayer",config:i={settings:a},push:n,on:f,init:l,destroy:function(){return _async_to_generator(function(){var r;return _ts_generator(this,function(t){return r=a.name||"dataLayer",o&&o[r]&&Array.isArray(o[r]),[2]})})()}}]})})()},E=A;return j=v,function(r,t,e,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,a=!1,i=void 0;try{for(var u,l=function(){var o=u.value;d.call(r,o)||o===e||s(r,o,{get:function(){return t[o]},enumerable:!(n=p(t,o))||n.enumerable})},c=b(t)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)l()}catch(r){a=!0,i=r}finally{try{o||null==c.return||c.return()}finally{if(a)throw i}}}return r}(s({},"__esModule",{value:!0}),j)}();
1
+ "use strict";function _array_like_to_array(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function _array_with_holes(r){if(Array.isArray(r))return r}function _array_without_holes(r){if(Array.isArray(r))return _array_like_to_array(r)}function asyncGeneratorStep(r,t,e,n,o,a,i){try{var u=r[a](i),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function _async_to_generator(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var a=r.apply(t,e);function i(r){asyncGeneratorStep(a,n,o,i,u,"next",r)}function u(r){asyncGeneratorStep(a,n,o,i,u,"throw",r)}i(void 0)})}}function _define_property(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function _iterable_to_array(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _iterable_to_array_limit(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,a=[],i=!0,u=!1;try{for(e=e.call(r);!(i=(n=e.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(r){u=!0,o=r}finally{try{i||null==e.return||e.return()}finally{if(u)throw o}}return a}}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(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.forEach(function(t){_define_property(r,t,e[t])})}return r}function _object_without_properties(r,t){if(null==r)return{};var e,n,o,a={};if("undefined"!=typeof Reflect&&Reflect.ownKeys){for(e=Reflect.ownKeys(Object(r)),o=0;o<e.length;o++)n=e[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(r,n)&&(a[n]=r[n]);return a}if(a=_object_without_properties_loose(r,t),Object.getOwnPropertySymbols)for(e=Object.getOwnPropertySymbols(r),o=0;o<e.length;o++)n=e[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(r,n)&&(a[n]=r[n]);return a}function _object_without_properties_loose(r,t){if(null==r)return{};var e,n,o={},a=Object.getOwnPropertyNames(r);for(n=0;n<a.length;n++)e=a[n],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(o[e]=r[e]);return o}function _sliced_to_array(r,t){return _array_with_holes(r)||_iterable_to_array_limit(r,t)||_unsupported_iterable_to_array(r,t)||_non_iterable_rest()}function _to_consumable_array(r){return _array_without_holes(r)||_iterable_to_array(r)||_unsupported_iterable_to_array(r)||_non_iterable_spread()}function _type_of(r){return r&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r}function _unsupported_iterable_to_array(r,t){if(r){if("string"==typeof r)return _array_like_to_array(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_array_like_to_array(r,t):void 0}}function _ts_generator(r,t){var e,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(e=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(r,a)}catch(r){u=[6,r],n=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var Destination=function(){var r=function(r,t){if("collector"===r)return"collector";if(!t)throw new Error("stepId(".concat(r,") requires an id"));return"".concat(r,".").concat(t)},t=function(r,t){var e=r.destinations[t];if(!e)throw new Error("Destination not found: ".concat(t));return e},e=function(r,t){var e=r.transformers[t];if(!e)throw new Error("Transformer not found: ".concat(t));return e},n=function(r,t){var e=r.sources[t];if(!e)throw new Error("Source not found: ".concat(t));return e},o=function(r,t){var e=r.stores[t];if(!e)throw new Error("Store not found: ".concat(t));return e},a=function(r,t){return _async_to_generator(function(){return _ts_generator(this,function(e){switch(e.label){case 0:return[4,r.get(t)];case 1:return[2,e.sent()]}})})()},i=function(r){return Array.isArray(r)},u=function(r){return"object"==(void 0===r?"undefined":_type_of(r))&&null!==r&&!i(r)&&"[object Object]"===Object.prototype.toString.call(r)},c=function(r){return"string"==typeof r},l=function(r,t,e){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];try{return r.apply(void 0,_to_consumable_array(o))}catch(r){if(!t)return;return t(r)}finally{null==e||e()}}},f=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0;if(t.filter&&!0===l(function(){return t.filter(e)},function(){return!1})())return;var n=y(e);if(n){var o=t.prefix||"dataLayer",a="".concat(o," ").concat(n.name),i=(n.name,{name:a,data:_object_without_properties(n,["name"])});l(function(){return r(i)},function(){})()}},y=function(r){if(u(r)&&c(r.event))return _object_spread({name:r.event},_object_without_properties(r,["event"]));if(i(r)&&r.length>=2)return s(r);if(_(r)){var t=Array.from(r);return s(t)}return null},s=function(r){var t,e=_sliced_to_array(r,3),n=e[0],o=e[1],a=e[2];if(!c(n))return null;var i={};switch(n){case"consent":if(!c(o)||r.length<3)return null;if("default"!==o&&"update"!==o)return null;if(!u(a)||null===a)return null;t="".concat(n," ").concat(o),i=_object_spread({},a);break;case"event":if(!c(o))return null;t=o,u(a)&&(i=_object_spread({},a));break;case"config":if(!c(o))return null;t="".concat(n," ").concat(o),u(a)&&(i=_object_spread({},a));break;case"set":if(c(o))t="".concat(n," ").concat(o),u(a)&&(i=_object_spread({},a));else{if(!u(o))return null;t="".concat(n," custom"),i=_object_spread({},o)}break;default:return null}return _object_spread({name:t},i)},_=function(r){return null!=r&&"object"===(void 0===r?"undefined":_type_of(r))&&"length"in r&&"number"==typeof r.length&&r.length>0},p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,v=Object.prototype.hasOwnProperty,h={};!function(r,t){for(var e in t)p(r,e,{get:t[e],enumerable:!0})}(h,{SourceDataLayer:function(){return A},default:function(){return P},sourceDataLayer:function(){return E}});var g=Object.defineProperty,m=function(r,t){for(var e in t)g(r,e,{get:t[e],enumerable:!0})};m({},{stepId:function(){return r}});m({},{getDestination:function(){return t}});m({},{Level:function(){return j}});var w,j=((w=j||{})[w.ERROR=0]="ERROR",w[w.WARN=1]="WARN",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w);m({},{getTransformer:function(){return e}});m({},{getSource:function(){return n}});m({},{getStore:function(){return o},getStoreValue:function(){return a}});var O,S=!1,A={},E=function(r){return _async_to_generator(function(){var t,e,n,o,a,i,u,c,l;return _ts_generator(this,function(y){return t=r.config,e=r.env,n=e.elb,o=e.window,a=_object_spread({name:"dataLayer",prefix:"dataLayer"},null==t?void 0:t.settings),u=0,c=function(){if(o){var r=a.name||"dataLayer",t=o[r];u=Array.isArray(t)?t.length:0,function(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:globalThis.window,n=t.settings,o=(null==n?void 0:n.name)||"dataLayer";e[o]||(e[o]=[]);var a=e[o];if(Array.isArray(a)){var i=a.push.bind(a);a.push=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];if(S)return i.apply(void 0,_to_consumable_array(e));S=!0;try{var a=!0,u=!1,c=void 0;try{for(var l,y=e[Symbol.iterator]();!(a=(l=y.next()).done);a=!0){var s=l.value;f(r,n,s)}}catch(r){u=!0,c=r}finally{try{a||null==y.return||y.return()}finally{if(u)throw c}}}finally{S=!1}return i.apply(void 0,_to_consumable_array(e))}}}(n,i,o)}},l=function(r){return _async_to_generator(function(){return _ts_generator(this,function(t){return"run"===r&&o&&u>0&&(function(r,t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:globalThis.window,o=t.settings,a=n[(null==o?void 0:o.name)||"dataLayer"];if(Array.isArray(a)&&!S){S=!0;try{for(var i=null!=e?e:a.length,u=0;u<i;u++)f(r,o,a[u])}finally{S=!1}}}(n,i,u,o),u=0),[2]})})()},[2,{type:"dataLayer",config:i={settings:a},push:n,on:l,init:c,destroy:function(){return _async_to_generator(function(){var r;return _ts_generator(this,function(t){return r=a.name||"dataLayer",o&&o[r]&&Array.isArray(o[r]),[2]})})()}}]})})()},P=E;return O=h,function(r,t,e,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,a=!1,i=void 0;try{for(var u,c=function(){var o=u.value;v.call(r,o)||o===e||p(r,o,{get:function(){return t[o]},enumerable:!(n=b(t,o))||n.enumerable})},l=d(t)[Symbol.iterator]();!(o=(u=l.next()).done);o=!0)c()}catch(r){a=!0,i=r}finally{try{o||null==l.return||l.return()}finally{if(a)throw i}}}return r}(p({},"__esModule",{value:!0}),O)}();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/web-source-datalayer",
4
- "version": "4.2.0-next-1780690800063",
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-datalayer",
3
3
  "description": "DataLayer source for walkerOS",
4
- "version": "4.2.0-next-1780690800063",
4
+ "version": "4.2.0-next-1780909874350",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -38,8 +38,8 @@
38
38
  "update": "npx npm-check-updates -u && npm update"
39
39
  },
40
40
  "dependencies": {
41
- "@walkeros/core": "4.2.0-next-1780690800063",
42
- "@walkeros/collector": "4.2.0-next-1780690800063"
41
+ "@walkeros/core": "4.2.0-next-1780909874350",
42
+ "@walkeros/collector": "4.2.0-next-1780909874350"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/gtag.js": "^0.0.20"