@walkeros/web-destination-fullstory 4.7.0 → 4.7.1
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 +11 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/walkerOS.json +10 -10
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @walkeros/web-destination-fullstory
|
|
2
2
|
|
|
3
|
+
## 4.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [91e9aeb]
|
|
8
|
+
- Updated dependencies [0635330]
|
|
9
|
+
- Updated dependencies [91e9aeb]
|
|
10
|
+
- Updated dependencies [0635330]
|
|
11
|
+
- @walkeros/web-core@4.7.1
|
|
12
|
+
- @walkeros/core@4.7.1
|
|
13
|
+
|
|
3
14
|
## 4.7.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var n=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r={};((e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})})(r,{DestinationFullStory:()=>R,default:()=>T,destinationFullStory:()=>$});var i=Object.defineProperty,s=(n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})};function a(n,e){if("collector"===n)return"collector";if(!e)throw new Error(`stepId(${n}) requires an id`);return`${n}.${e}`}s({},{stepId:()=>a});function c(n,e){const t=n.destinations[e];if(!t)throw new Error(`Destination not found: ${e}`);return t}s({},{getDestination:()=>c});s({},{Level:()=>l});var u,l=((u=l||{})[u.ERROR=0]="ERROR",u[u.WARN=1]="WARN",u[u.INFO=2]="INFO",u[u.DEBUG=3]="DEBUG",u);function f(n,e){const t=n.transformers[e];if(!t)throw new Error(`Transformer not found: ${e}`);return t}s({},{getTransformer:()=>f});function d(n,e){const t=n.sources[e];if(!t)throw new Error(`Source not found: ${e}`);return t}s({},{getSource:()=>d});function p(n,e){const t=n.stores[e];if(!t)throw new Error(`Store not found: ${e}`);return t}async function v(n,e){return await n.get(e)}function g(n){return Array.isArray(n)}function w(n){return void 0!==n}function y(n){return"object"==typeof n&&null!==n&&!g(n)&&"[object Object]"===Object.prototype.toString.call(n)}function m(n){return"string"==typeof n}function h(n,e="",t){const o=e.split(".");let r=n;for(let n=0;n<o.length;n++){const e=o[n];if("*"===e&&g(r)){const e=o.slice(n+1).join("."),i=[];for(const n of r){const o=h(n,e,t);i.push(o)}return i}if(r=y(r)||g(r)?r[e]:void 0,void 0===r)break}return w(r)?r:t}function _(n){return function(n){return"boolean"==typeof n}(n)||m(n)||function(n){return"number"==typeof n&&!Number.isNaN(n)}(n)||!w(n)||g(n)&&n.every(_)||y(n)&&Object.values(n).every(_)}function b(n){return _(n)?n:void 0}function O(n,e,t){return async function(...o){try{return await n(...o)}catch(n){if(!e)return;return await e(n)}finally{await(null==t?void 0:t())}}}s({},{getStore:()=>p,getStoreValue:()=>v});var E=class n extends Error{constructor(e,t){super(e,t),this.name="FatalError",Object.setPrototypeOf(this,n.prototype)}};async function S(n,e={},t={}){var o,r;if(!w(n))return;const i=y(n)&&n.consent||t.consent||(null==(o=t.collector)?void 0:o.consent),s=null!=(r=t.event)?r:y(n)?n:{};return F(n,e,{...t,consent:i,event:s})}async function F(n,e={},t={}){var o,r;const i=t.consent||(null==(o=t.collector)?void 0:o.consent),s=null!=(r=t.event)?r:{};if(!t.collector)throw new Error("getMappingValue: context.collector is required");const a={event:s,mapping:e,collector:t.collector,logger:t.collector.logger,consent:i},c=g(e)?e:[e];for(const e of c){const o=await O(I,n=>{if(n instanceof E)throw n;t.collector&&t.collector.status.failed++,a.logger.error("mapping processing failed",{event:s,error:n})})(n,e,{...a,mapping:e});if(w(o))return o}}async function I(n,e,t){return(g(e)?e:[e]).reduce(async(e,o)=>{const r=await e;if(r)return r;const i=m(o)?{key:o}:o;if(!Object.keys(i).length)return;const{condition:s,consent:a,fn:c,key:u,loop:l,map:f,set:d,validate:p,value:v}=i,y={...t,mapping:o};if(s&&!await O(s,n=>{if(n instanceof E)throw n;return y.logger.error("mapping condition failed",{event:y.event,error:n}),!1})(n,y))return;if(a&&!function(n,e={},t={}){const o={...e,...t},r={};let i=!n||0===Object.keys(n).length;return Object.keys(o).forEach(e=>{o[e]&&(r[e]=!0,n&&n[e]&&(i=!0))}),!!i&&r}(a,y.consent))return v;let _=w(v)?v:n;if(l){const[e,t]=l,o="this"===e?[n]:await F(n,e,y);_=g(o)?(await Promise.all(o.map(n=>S(n,t,y)))).filter(w):void 0}else f?_=await Object.entries(f).reduce(async(e,[t,o])=>{const r=await e,i=await F(n,o,y);return w(i)&&(r[t]=i),r},Promise.resolve({})):d?_=await Promise.all(d.map(e=>I(n,e,y))):u?_=h(n,u,v):c&&(_=await O(c,n=>{if(n instanceof E)throw n;y.logger.error("mapping fn failed",{event:y.event,error:n})})(n,y));p&&!await O(p,n=>{if(n instanceof E)throw n;return y.logger.error("mapping validate failed",{event:y.event,error:n}),!1})(_,y)&&(_=void 0);const j=b(_);return w(j)?j:b(v)},Promise.resolve(void 0))}var j,k,P=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.wnd,t=void 0===e?window:e,o=n.injectedNamespace,r=void 0===o?t._fs_namespace:o,i=n.injectedScript,s=void 0===i?t._fs_script:i;!function(n,e,t,o,r,i,s,a){var c,u;t in n&&(n.console&&n.console.log&&n.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'),1)||(s=n[t]=function(){var n=function(n,t,o,r){function i(i,s){e(n,t,o,i,s,r)}r=r||2;var s,a=/Async$/;return a.test(n)?(n=n.replace(a,""),"function"==typeof Promise?new Promise(i):l(i)):e(n,t,o,s,s,r)};function e(e,t,o,r,i,s){return n._api?n._api(e,t,o,r,i,s):(n.q&&n.q.push([e,t,o,r,i,s]),null)}return n.q=[],n}(),a=function(){return function(n){function e(e){"function"==typeof e[4]&&e[4](new Error(n))}var t=s.q;if(t){for(var o=0;o<t.length;o++)e(t[o]);t.length=0,t.push=e}}}(),function(){(i=e.createElement(o)).async=!0,i.crossOrigin="anonymous",i.src="https://"+r,i.onerror=function(){a("Error loading "+r)};var n=e.getElementsByTagName(o)[0];n&&n.parentNode?n.parentNode.insertBefore(i,n):e.head.appendChild(i)}(),function(){function n(){}function e(n,e,t){s(n,e,t,1)}function t(n,t,o){e("setProperties",{type:n,properties:t},o)}function o(n,e){t("user",n,e)}function r(n,e,t){o({uid:n},t),e&&o(e,t)}s.identify=r,s.setUserVars=o,s.identifyAccount=n,s.clearUserCookie=n,s.setVars=t,s.event=function(n,t,o){e("trackEvent",{name:n,properties:t},o)},s.anonymize=function(){r(!1)},s.shutdown=function(){e("shutdown")},s.restart=function(){e("restart")},s.log=function(n,t){e("log",{level:n,msg:t})},s.consent=function(n){e("setIdentity",{consent:!arguments.length||n})}}(),c="fetch",u="XMLHttpRequest",s._w={},s._w[u]=n[u],s._w[c]=n[c],n[c]&&(n[c]=function(){return s._w[c].apply(this,arguments)}),s._v="2.0.0");function l(n){var e,t=[];function o(){e&&(t.forEach(function(n){var t;try{t=n[e[0]]&&n[e[0]](e[1])}catch(e){return void(n[3]&&n[3](e))}t&&t.then?t.then(n[2],n[3]):n[2]&&n[2](t)}),t.length=0)}function r(n){return function(t){e||(e=[n,t],o())}}return n(r(0),r(1)),{then:function(n,e){return l(function(r,i){t.push([n,e,r,i]),o()})}}}}(t,t.document,r,"script",s)},C=(function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.shouldInsertScript,t=void 0===e||e,o=n.globalVar,r=void 0===o?"window":o,i=n.globalNamespace,s=void 0===i?"".concat(r,"['_fs_namespace']"):i,a=n.apiVersion,c=void 0===a?"1.3.0":a;"(function(m,n,e,t,l,o,g,y){\n if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];".concat(t?"\n o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);":"","\n g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n g.anonymize=function(){g.identify(!!0)};\n g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n g.log = function(a,b){g(\"log\",[a,b])};\n g.consent=function(a){g(\"consent\",!arguments.length||a)};\n g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n g.clearUserCookie=function(){};\n g.setVars=function(n, p){g('setVars',[n,p]);};\n g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n g._v=\"").concat(c,'";\n})(').concat(r,",").concat(function(n){return"window"===n?"document":"".concat(n,".document")}(r),",").concat(s,",'script','user');")}(),function(){return C=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C.apply(this,arguments)}),D=function(){if(window._fs_namespace)return window[window._fs_namespace]},M=function(){var n=D();if(!n)throw Error("FullStory is not loaded, please ensure the init function is invoked before calling FullStory API functions");return n},N=function(n,e){var t=C({},n);if(D())console.warn("The FullStory snippet has already been defined elsewhere (likely in the <head> element)");else{t.recordCrossDomainIFrames&&(window._fs_run_in_iframe=!0),t.appHost&&(window._fs_app_host=t.appHost),t.assetMapId&&(window._fs_asset_map_id=t.assetMapId),t.startCaptureManually&&(window._fs_capture_on_startup=!1),t.recordOnlyThisIFrame&&(window._fs_is_outer_script=!0),t.cookieDomain&&(window._fs_cookie_domain=t.cookieDomain),!0===t.debug&&(t.script?console.warn("Ignoring `debug = true` because `script` is set"):t.script="edge.fullstory.com/s/fs-debug.js"),function(n){var e=n.orgId,t=n.namespace,o=void 0===t?"FS":t,r=n.host,i=void 0===r?"fullstory.com":r,s=n.script,a=void 0===s?"edge.fullstory.com/s/fs.js":s;if(!e)throw new Error("FullStory orgId is a required parameter");window._fs_host=i,window._fs_script=a,window._fs_org=e,window._fs_namespace=o,P()}(t);var o=D();if(o){if(t.sessionUid&&o("init",{env:{sessionUid:t.sessionUid}}),e&&o("observe",{type:"start",callback:e}),!0===t.devMode){var r="FullStory was initialized in devMode and will stop recording";o("trackEvent",{name:"FullStory Dev Mode",properties:{message:r}}),o("shutdown"),window._fs_dev_mode=!0,console.warn(r)}}else console.warn("Failed to initialize FS snippet")}},U=(j="FullStory init has already been called once, additional invocations are ignored",function(n,e){window._fs_initialized?j&&console.warn(j):(N(n,e),window._fs_initialized=!0)}),V=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(window._fs_dev_mode){var o="FullStory is in dev mode and is not capturing: ".concat(n," method not executed");return console.warn(o),o}var r=D();return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=M();return n.every(function(n){return t[n]})}(n)&&r?r[n].apply(r,e):(console.warn("FS.".concat(n," not ready")),null)}},q=(k=function(n,e,t){var o=M();if(!window._fs_dev_mode)return o(n,e,t);var r="FullStory is in dev mode and is not capturing: ".concat(n," not executed");console.warn(r)},k.anonymize=V("anonymize"),k.consent=V("consent"),k.disableConsole=V("disableConsole"),k.enableConsole=V("enableConsole"),k.event=V("event"),k.getCurrentSessionURL=V("getCurrentSessionURL"),k.identify=V("identify"),k.log=V("log"),k.restart=V("restart"),k.setUserVars=V("setUserVars"),k.setVars=V("setVars"),k.shutdown=V("shutdown"),k),R={};function z(n){return(null==n?void 0:n.fullstory)?n.fullstory:{init:U,trackEvent:n=>{var e;return q("trackEvent",{name:n.name,properties:null!=(e=n.properties)?e:{}})},setIdentity:n=>q("setIdentity",n),setProperties:n=>q("setProperties",n),shutdown:()=>q("shutdown"),start:()=>q("start")}}var A,$={type:"fullstory",config:{},init({config:n,env:e}){const t=n.settings;if(!(null==t?void 0:t.orgId))return!1;const o=z(e),r={orgId:t.orgId};return void 0!==t.host&&(r.host=t.host),void 0!==t.script&&(r.script=t.script),void 0!==t.cookieDomain&&(r.cookieDomain=t.cookieDomain),void 0!==t.debug&&(r.debug=t.debug),void 0!==t.devMode&&(r.devMode=t.devMode),void 0!==t.startCaptureManually&&(r.startCaptureManually=t.startCaptureManually),void 0!==t.namespace&&(r.namespace=t.namespace),void 0!==t.recordCrossDomainIFrames&&(r.recordCrossDomainIFrames=t.recordCrossDomainIFrames),o.init(r),n},async push(n,{config:e,rule:t,env:o,data:r,collector:i}){var s;const a=z(o),c=e.settings||{},u=(null==t?void 0:t.settings)||{},l=null!=(s=u.identify)?s:c.identify;if(void 0!==l){const e=await S(n,l,{collector:i});if(y(e)){const{uid:n,properties:t}=e;if(m(n)&&n){const e={uid:n};y(t)&&(e.properties=t),a.setIdentity(e)}}}if(void 0!==u.set){const e=await S(n,u.set,{collector:i});if(y(e)){const n=u.setType||"user";a.setProperties({type:n,properties:e})}}if(!0!==(null==t?void 0:t.silent)){const e=m(null==t?void 0:t.name)?t.name:n.name,o=y(r)?r:{};a.trackEvent({name:e,properties:o})}},on(n,e){var t;if("consent"!==n||!e.data)return;const o=z(e.env),r=e.data,i=((null==(t=e.config)?void 0:t.settings)||{}).consent;if(i)for(const[n,e]of Object.entries(i)){if(!(n in r))continue;const t=!0===r[n];"capture"===e?t?o.start():o.shutdown():"consent"===e&&o.setIdentity({consent:t})}}},T=$;return A=r,((r,i,s,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of t(i))o.call(r,c)||c===s||n(r,c,{get:()=>i[c],enumerable:!(a=e(i,c))||a.enumerable});return r})(n({},"__esModule",{value:!0}),A)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var n=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r={};((e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})})(r,{DestinationFullStory:()=>R,default:()=>T,destinationFullStory:()=>$});var i=Object.defineProperty,s=(n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})};function a(n,e){if("collector"===n)return"collector";if(!e)throw new Error(`stepId(${n}) requires an id`);return`${n}.${e}`}s({},{stepId:()=>a});function c(n,e){const t=n.destinations[e];if(!t)throw new Error(`Destination not found: ${e}`);return t}s({},{getDestination:()=>c});s({},{Level:()=>l});var u,l=((u=l||{})[u.ERROR=0]="ERROR",u[u.WARN=1]="WARN",u[u.INFO=2]="INFO",u[u.DEBUG=3]="DEBUG",u);function f(n,e){const t=n.transformers[e];if(!t)throw new Error(`Transformer not found: ${e}`);return t}s({},{getTransformer:()=>f});function d(n,e){const t=n.sources[e];if(!t)throw new Error(`Source not found: ${e}`);return t}s({},{getSource:()=>d});function p(n,e){const t=n.stores[e];if(!t)throw new Error(`Store not found: ${e}`);return t}async function v(n,e){return await n.get(e)}function g(n){return Array.isArray(n)}function w(n){return void 0!==n}function y(n){return"object"==typeof n&&null!==n&&!g(n)&&"[object Object]"===Object.prototype.toString.call(n)}function m(n){return"string"==typeof n}function h(n,e="",t){const o=e.split(".");let r=n;for(let n=0;n<o.length;n++){const e=o[n];if("*"===e&&g(r)){const e=o.slice(n+1).join("."),i=[];for(const n of r){const o=h(n,e,t);i.push(o)}return i}if(r=y(r)||g(r)?r[e]:void 0,void 0===r)break}return w(r)?r:t}function _(n){return function(n){return"boolean"==typeof n}(n)||m(n)||function(n){return"number"==typeof n&&!Number.isNaN(n)}(n)||!w(n)||g(n)&&n.every(_)||y(n)&&Object.values(n).every(_)}function b(n){return _(n)?n:void 0}function O(n,e,t){return async function(...o){try{return await n(...o)}catch(n){if(!e)return;return await e(n)}finally{await(null==t?void 0:t())}}}s({},{getStore:()=>p,getStoreValue:()=>v});var E=class n extends Error{constructor(e,t){super(e,t),this.name="FatalError",Object.setPrototypeOf(this,n.prototype)}};async function S(n,e={},t={}){var o,r;if(!w(n))return;const i=y(n)&&n.consent||t.consent||(null==(o=t.collector)?void 0:o.consent),s=null!=(r=t.event)?r:y(n)?n:{};return F(n,e,{...t,consent:i,event:s})}async function F(n,e={},t={}){var o,r;const i=t.consent||(null==(o=t.collector)?void 0:o.consent),s=null!=(r=t.event)?r:{};if(!t.collector)throw new Error("getMappingValue: context.collector is required");const a={event:s,mapping:e,collector:t.collector,logger:t.collector.logger,consent:i},c=g(e)?e:[e];for(const e of c){const o=await O(I,n=>{if(n instanceof E)throw n;t.collector&&t.collector.status.failed++,a.logger.error("mapping processing failed",{event:s,error:n})})(n,e,{...a,mapping:e});if(w(o))return o}}async function I(n,e,t){return(g(e)?e:[e]).reduce(async(e,o)=>{const r=await e;if(r)return r;const i=m(o)?{key:o}:o;if(!Object.keys(i).length)return;const{condition:s,consent:a,fn:c,key:u,loop:l,map:f,set:d,validate:p,value:v}=i,y={...t,mapping:o};if(s&&!await O(s,n=>{if(n instanceof E)throw n;return y.logger.error("mapping condition failed",{event:y.event,error:n}),!1})(n,y))return;if(a&&!function(n,e={},t={}){const o={...e,...t},r={};let i=!n||0===Object.keys(n).length;return Object.keys(o).forEach(e=>{o[e]&&(r[e]=!0,n&&n[e]&&(i=!0))}),!!i&&r}(a,y.consent))return v;let _=w(v)?v:n;if(l){const[e,t]=l,o="this"===e?[n]:await F(n,e,y);_=g(o)?(await Promise.all(o.map(n=>w(n)?F(n,t,y):void 0))).filter(w):void 0}else f?_=await Object.entries(f).reduce(async(e,[t,o])=>{const r=await e,i=await F(n,o,y);return w(i)&&(r[t]=i),r},Promise.resolve({})):d?_=await Promise.all(d.map(e=>I(n,e,y))):u?_=h(n,u,v):c&&(_=await O(c,n=>{if(n instanceof E)throw n;y.logger.error("mapping fn failed",{event:y.event,error:n})})(n,y));p&&!await O(p,n=>{if(n instanceof E)throw n;return y.logger.error("mapping validate failed",{event:y.event,error:n}),!1})(_,y)&&(_=void 0);const S=b(_);return w(S)?S:b(v)},Promise.resolve(void 0))}var j,k,P=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.wnd,t=void 0===e?window:e,o=n.injectedNamespace,r=void 0===o?t._fs_namespace:o,i=n.injectedScript,s=void 0===i?t._fs_script:i;!function(n,e,t,o,r,i,s,a){var c,u;t in n&&(n.console&&n.console.log&&n.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'),1)||(s=n[t]=function(){var n=function(n,t,o,r){function i(i,s){e(n,t,o,i,s,r)}r=r||2;var s,a=/Async$/;return a.test(n)?(n=n.replace(a,""),"function"==typeof Promise?new Promise(i):l(i)):e(n,t,o,s,s,r)};function e(e,t,o,r,i,s){return n._api?n._api(e,t,o,r,i,s):(n.q&&n.q.push([e,t,o,r,i,s]),null)}return n.q=[],n}(),a=function(){return function(n){function e(e){"function"==typeof e[4]&&e[4](new Error(n))}var t=s.q;if(t){for(var o=0;o<t.length;o++)e(t[o]);t.length=0,t.push=e}}}(),function(){(i=e.createElement(o)).async=!0,i.crossOrigin="anonymous",i.src="https://"+r,i.onerror=function(){a("Error loading "+r)};var n=e.getElementsByTagName(o)[0];n&&n.parentNode?n.parentNode.insertBefore(i,n):e.head.appendChild(i)}(),function(){function n(){}function e(n,e,t){s(n,e,t,1)}function t(n,t,o){e("setProperties",{type:n,properties:t},o)}function o(n,e){t("user",n,e)}function r(n,e,t){o({uid:n},t),e&&o(e,t)}s.identify=r,s.setUserVars=o,s.identifyAccount=n,s.clearUserCookie=n,s.setVars=t,s.event=function(n,t,o){e("trackEvent",{name:n,properties:t},o)},s.anonymize=function(){r(!1)},s.shutdown=function(){e("shutdown")},s.restart=function(){e("restart")},s.log=function(n,t){e("log",{level:n,msg:t})},s.consent=function(n){e("setIdentity",{consent:!arguments.length||n})}}(),c="fetch",u="XMLHttpRequest",s._w={},s._w[u]=n[u],s._w[c]=n[c],n[c]&&(n[c]=function(){return s._w[c].apply(this,arguments)}),s._v="2.0.0");function l(n){var e,t=[];function o(){e&&(t.forEach(function(n){var t;try{t=n[e[0]]&&n[e[0]](e[1])}catch(e){return void(n[3]&&n[3](e))}t&&t.then?t.then(n[2],n[3]):n[2]&&n[2](t)}),t.length=0)}function r(n){return function(t){e||(e=[n,t],o())}}return n(r(0),r(1)),{then:function(n,e){return l(function(r,i){t.push([n,e,r,i]),o()})}}}}(t,t.document,r,"script",s)},C=(function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.shouldInsertScript,t=void 0===e||e,o=n.globalVar,r=void 0===o?"window":o,i=n.globalNamespace,s=void 0===i?"".concat(r,"['_fs_namespace']"):i,a=n.apiVersion,c=void 0===a?"1.3.0":a;"(function(m,n,e,t,l,o,g,y){\n if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];".concat(t?"\n o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);":"","\n g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n g.anonymize=function(){g.identify(!!0)};\n g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n g.log = function(a,b){g(\"log\",[a,b])};\n g.consent=function(a){g(\"consent\",!arguments.length||a)};\n g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n g.clearUserCookie=function(){};\n g.setVars=function(n, p){g('setVars',[n,p]);};\n g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n g._v=\"").concat(c,'";\n})(').concat(r,",").concat(function(n){return"window"===n?"document":"".concat(n,".document")}(r),",").concat(s,",'script','user');")}(),function(){return C=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C.apply(this,arguments)}),D=function(){if(window._fs_namespace)return window[window._fs_namespace]},M=function(){var n=D();if(!n)throw Error("FullStory is not loaded, please ensure the init function is invoked before calling FullStory API functions");return n},N=function(n,e){var t=C({},n);if(D())console.warn("The FullStory snippet has already been defined elsewhere (likely in the <head> element)");else{t.recordCrossDomainIFrames&&(window._fs_run_in_iframe=!0),t.appHost&&(window._fs_app_host=t.appHost),t.assetMapId&&(window._fs_asset_map_id=t.assetMapId),t.startCaptureManually&&(window._fs_capture_on_startup=!1),t.recordOnlyThisIFrame&&(window._fs_is_outer_script=!0),t.cookieDomain&&(window._fs_cookie_domain=t.cookieDomain),!0===t.debug&&(t.script?console.warn("Ignoring `debug = true` because `script` is set"):t.script="edge.fullstory.com/s/fs-debug.js"),function(n){var e=n.orgId,t=n.namespace,o=void 0===t?"FS":t,r=n.host,i=void 0===r?"fullstory.com":r,s=n.script,a=void 0===s?"edge.fullstory.com/s/fs.js":s;if(!e)throw new Error("FullStory orgId is a required parameter");window._fs_host=i,window._fs_script=a,window._fs_org=e,window._fs_namespace=o,P()}(t);var o=D();if(o){if(t.sessionUid&&o("init",{env:{sessionUid:t.sessionUid}}),e&&o("observe",{type:"start",callback:e}),!0===t.devMode){var r="FullStory was initialized in devMode and will stop recording";o("trackEvent",{name:"FullStory Dev Mode",properties:{message:r}}),o("shutdown"),window._fs_dev_mode=!0,console.warn(r)}}else console.warn("Failed to initialize FS snippet")}},U=(j="FullStory init has already been called once, additional invocations are ignored",function(n,e){window._fs_initialized?j&&console.warn(j):(N(n,e),window._fs_initialized=!0)}),V=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(window._fs_dev_mode){var o="FullStory is in dev mode and is not capturing: ".concat(n," method not executed");return console.warn(o),o}var r=D();return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=M();return n.every(function(n){return t[n]})}(n)&&r?r[n].apply(r,e):(console.warn("FS.".concat(n," not ready")),null)}},q=(k=function(n,e,t){var o=M();if(!window._fs_dev_mode)return o(n,e,t);var r="FullStory is in dev mode and is not capturing: ".concat(n," not executed");console.warn(r)},k.anonymize=V("anonymize"),k.consent=V("consent"),k.disableConsole=V("disableConsole"),k.enableConsole=V("enableConsole"),k.event=V("event"),k.getCurrentSessionURL=V("getCurrentSessionURL"),k.identify=V("identify"),k.log=V("log"),k.restart=V("restart"),k.setUserVars=V("setUserVars"),k.setVars=V("setVars"),k.shutdown=V("shutdown"),k),R={};function z(n){return(null==n?void 0:n.fullstory)?n.fullstory:{init:U,trackEvent:n=>{var e;return q("trackEvent",{name:n.name,properties:null!=(e=n.properties)?e:{}})},setIdentity:n=>q("setIdentity",n),setProperties:n=>q("setProperties",n),shutdown:()=>q("shutdown"),start:()=>q("start")}}var A,$={type:"fullstory",config:{},init({config:n,env:e}){const t=n.settings;if(!(null==t?void 0:t.orgId))return!1;const o=z(e),r={orgId:t.orgId};return void 0!==t.host&&(r.host=t.host),void 0!==t.script&&(r.script=t.script),void 0!==t.cookieDomain&&(r.cookieDomain=t.cookieDomain),void 0!==t.debug&&(r.debug=t.debug),void 0!==t.devMode&&(r.devMode=t.devMode),void 0!==t.startCaptureManually&&(r.startCaptureManually=t.startCaptureManually),void 0!==t.namespace&&(r.namespace=t.namespace),void 0!==t.recordCrossDomainIFrames&&(r.recordCrossDomainIFrames=t.recordCrossDomainIFrames),o.init(r),n},async push(n,{config:e,rule:t,env:o,data:r,collector:i}){var s;const a=z(o),c=e.settings||{},u=(null==t?void 0:t.settings)||{},l=null!=(s=u.identify)?s:c.identify;if(void 0!==l){const e=await S(n,l,{collector:i});if(y(e)){const{uid:n,properties:t}=e;if(m(n)&&n){const e={uid:n};y(t)&&(e.properties=t),a.setIdentity(e)}}}if(void 0!==u.set){const e=await S(n,u.set,{collector:i});if(y(e)){const n=u.setType||"user";a.setProperties({type:n,properties:e})}}if(!0!==(null==t?void 0:t.silent)){const e=m(null==t?void 0:t.name)?t.name:n.name,o=y(r)?r:{};a.trackEvent({name:e,properties:o})}},on(n,e){var t;if("consent"!==n||!e.data)return;const o=z(e.env),r=e.data,i=((null==(t=e.config)?void 0:t.settings)||{}).consent;if(i)for(const[n,e]of Object.entries(i)){if(!(n in r))continue;const t=!0===r[n];"capture"===e?t?o.start():o.shutdown():"consent"===e&&o.setIdentity({consent:t})}}},T=$;return A=r,((r,i,s,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of t(i))o.call(r,c)||c===s||n(r,c,{get:()=>i[c],enumerable:!(a=e(i,c))||a.enumerable});return r})(n({},"__esModule",{value:!0}),A)})();
|
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 _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).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 _call_super(e,t,n){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,n||[],_get_prototype_of(e).constructor):t.apply(e,n))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,n){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&_set_prototype_of(o,n.prototype),o},_construct.apply(null,arguments)}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 _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}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 _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}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_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 _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(n,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}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:s(0)}),c(a,"throw",{value:s(1)}),c(a,"return",{value:s(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function s(c){return function(s){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,s])}}}var Destination=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){return Array.isArray(e)},c=function(e){return void 0!==e},s=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!a(e)&&"[object Object]"===Object.prototype.toString.call(e)},u=function(e){return"string"==typeof e},l=function(e){return P(e)?e:void 0},f=function(e,t,n){return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return _async_to_generator(function(){var r;return _ts_generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(o))];case 1:case 3:return[2,i.sent()];case 2:return r=i.sent(),t?[4,t(r)]:[2];case 4:return[4,null==n?void 0:n()];case 5:return i.sent(),[7];case 6:return[2]}})})()}},_=function(e){return _async_to_generator(function(e){var t,n,r,o,i,a,u=arguments;return _ts_generator(this,function(l){return t=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:{},c(e)?(i=s(e)&&e.consent||n.consent||(null===(o=n.collector)||void 0===o?void 0:o.consent),a=null!==(r=n.event)&&void 0!==r?r:s(e)?e:{},[2,p(e,t,_object_spread_props(_object_spread({},n),{consent:i,event:a}))]):[2]})}).apply(this,arguments)},p=function(e){return _async_to_generator(function(e){var t,n,r,o,i,s,u,l,_,p,d,y,v,g,b,h,w=arguments;return _ts_generator(this,function(m){switch(m.label){case 0:if(t=w.length>1&&void 0!==w[1]?w[1]:{},i=(n=w.length>2&&void 0!==w[2]?w[2]:{}).consent||(null===(o=n.collector)||void 0===o?void 0:o.consent),s=null!==(r=n.event)&&void 0!==r?r:{},!n.collector)throw new Error("getMappingValue: context.collector is required");u={event:s,mapping:t,collector:n.collector,logger:n.collector.logger,consent:i},l=a(t)?t:[t],_=!0,p=!1,d=void 0,m.label=1;case 1:m.trys.push([1,6,7,8]),y=l[Symbol.iterator](),m.label=2;case 2:return(_=(v=y.next()).done)?[3,5]:(g=v.value,[4,f(k,function(e){if(_instanceof(e,E))throw e;n.collector&&n.collector.status.failed++,u.logger.error("mapping processing failed",{event:s,error:e})})(e,g,_object_spread_props(_object_spread({},u),{mapping:g}))]);case 3:if(b=m.sent(),c(b))return[2,b];m.label=4;case 4:return _=!0,[3,2];case 5:return[3,8];case 6:return h=m.sent(),p=!0,d=h,[3,8];case 7:try{_||null==y.return||y.return()}finally{if(p)throw d}return[7];case 8:return[2]}})}).apply(this,arguments)},d=function(e){return(null==e?void 0:e.fullstory)?e.fullstory:{init:N,trackEvent:function(e){var t;return T("trackEvent",{name:e.name,properties:null!==(t=e.properties)&&void 0!==t?t:{}})},setIdentity:function(e){return T("setIdentity",e)},setProperties:function(e){return T("setProperties",e)},shutdown:function(){return T("shutdown")},start:function(){return T("start")}}},y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,b=Object.prototype.hasOwnProperty,h={};!function(e,t){for(var n in t)y(e,n,{get:t[n],enumerable:!0})}(h,{DestinationFullStory:function(){return V},default:function(){return z},destinationFullStory:function(){return q}});var w=Object.defineProperty,m=function(e,t){for(var n in t)w(e,n,{get:t[n],enumerable:!0})};m({},{stepId:function(){return e}});m({},{getDestination:function(){return t}});m({},{Level:function(){return j}});var O,j=((O=j||{})[O.ERROR=0]="ERROR",O[O.WARN=1]="WARN",O[O.INFO=2]="INFO",O[O.DEBUG=3]="DEBUG",O);m({},{getTransformer:function(){return n}});m({},{getSource:function(){return r}});function S(e){for(var t=arguments.length>2?arguments[2]:void 0,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),r=e,o=0;o<n.length;o++){var i=n[o];if("*"===i&&a(r)){var u=n.slice(o+1).join("."),l=[],f=!0,_=!1,p=void 0;try{for(var d,y=r[Symbol.iterator]();!(f=(d=y.next()).done);f=!0){var v=S(d.value,u,t);l.push(v)}}catch(e){_=!0,p=e}finally{try{f||null==y.return||y.return()}finally{if(_)throw p}}return l}if(void 0===(r=s(r)||a(r)?r[i]:void 0))break}return c(r)?r:t}function P(e){return function(e){return"boolean"==typeof e}(e)||u(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!c(e)||a(e)&&e.every(P)||s(e)&&Object.values(e).every(P)}m({},{getStore:function(){return o},getStoreValue:function(){return i}});var E=function(){function e(t,n){var r;return _class_call_check(this,e),(r=_call_super(this,e,[t,n])).name="FatalError",Object.setPrototypeOf(r,e.prototype),r}return _inherits(e,_wrap_native_super(Error)),e}();function k(e,t,n){return _async_to_generator(function(){return _ts_generator(this,function(r){return[2,(a(t)?t:[t]).reduce(function(t,r){return _async_to_generator(function(){var o,i,s,d,y,v,g,b,h,w,m,O,j,P,I,F,D,C,M,A,R,x,N,U,T;return _ts_generator(this,function(V){switch(V.label){case 0:return[4,t];case 1:return(o=V.sent())?[2,o]:(i=u(r)?{key:r}:r,Object.keys(i).length?(s=i.condition,d=i.consent,y=i.fn,v=i.key,g=i.loop,b=i.map,h=i.set,w=i.validate,m=i.value,O=_object_spread_props(_object_spread({},n),{mapping:r}),(j=s)?[4,f(s,function(e){if(_instanceof(e,E))throw e;return O.logger.error("mapping condition failed",{event:O.event,error:e}),!1})(e,O)]:[3,3]):[2]);case 2:j=!V.sent(),V.label=3;case 3:return j?[2]:d&&!function(e){var t=_object_spread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),n={},r=!e||0===Object.keys(e).length;return Object.keys(t).forEach(function(o){t[o]&&(n[o]=!0,e&&e[o]&&(r=!0))}),!!r&&n}(d,O.consent)?[2,m]:(P=c(m)?m:e,g?(I=_sliced_to_array(g,2),F=I[0],D=I[1],"this"!==F?[3,4]:(M=[e],[3,6])):[3,10]);case 4:return[4,p(e,F,O)];case 5:M=V.sent(),V.label=6;case 6:return a(C=M)?[4,Promise.all(C.map(function(e){return _(e,D,O)}))]:[3,8];case 7:return A=V.sent().filter(c),[3,9];case 8:A=void 0,V.label=9;case 9:return P=A,[3,21];case 10:return b?[4,Object.entries(b).reduce(function(t,n){var r=_sliced_to_array(n,2),o=r[0],i=r[1];return _async_to_generator(function(){var n,r;return _ts_generator(this,function(a){switch(a.label){case 0:return[4,t];case 1:return n=a.sent(),[4,p(e,i,O)];case 2:return r=a.sent(),[2,(c(r)&&(n[o]=r),n)]}})})()},Promise.resolve({}))]:[3,12];case 11:return P=V.sent(),[3,20];case 12:return h?[4,Promise.all(h.map(function(t){return k(e,t,O)}))]:[3,14];case 13:return R=P=V.sent(),[3,19];case 14:return v?(x=P=S(e,v,m),[3,18]):[3,15];case 15:return(N=y)?[4,f(y,function(e){if(_instanceof(e,E))throw e;O.logger.error("mapping fn failed",{event:O.event,error:e})})(e,O)]:[3,17];case 16:N=P=V.sent(),V.label=17;case 17:x=N,V.label=18;case 18:R=x,V.label=19;case 19:V.label=20;case 20:V.label=21;case 21:return(U=w)?[4,f(w,function(e){if(_instanceof(e,E))throw e;return O.logger.error("mapping validate failed",{event:O.event,error:e}),!1})(P,O)]:[3,23];case 22:U=!V.sent(),V.label=23;case 23:return U&&(P=void 0),T=l(P),[2,c(T)?T:l(m)]}})})()},Promise.resolve(void 0))]})})()}var I,F,D,C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.wnd,n=void 0===t?window:t,r=e.injectedNamespace,o=void 0===r?n._fs_namespace:r,i=e.injectedScript,a=void 0===i?n._fs_script:i;!function(e,t,n,r,o,i,a,c){var s,u;n in e&&(e.console&&e.console.log&&e.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'),1)||(a=e[n]=function(){var e=function(e,n,r,o){function i(i,a){t(e,n,r,i,a,o)}o=o||2;var a,c=/Async$/;return c.test(e)?(e=e.replace(c,""),"function"==typeof Promise?new Promise(i):l(i)):t(e,n,r,a,a,o)};function t(t,n,r,o,i,a){return e._api?e._api(t,n,r,o,i,a):(e.q&&e.q.push([t,n,r,o,i,a]),null)}return e.q=[],e}(),c=function(e){function t(t){"function"==typeof t[4]&&t[4](new Error(e))}var n=a.q;if(n){for(var r=0;r<n.length;r++)t(n[r]);n.length=0,n.push=t}},function(){(i=t.createElement(r)).async=!0,i.crossOrigin="anonymous",i.src="https://"+o,i.onerror=function(){c("Error loading "+o)};var e=t.getElementsByTagName(r)[0];e&&e.parentNode?e.parentNode.insertBefore(i,e):t.head.appendChild(i)}(),function(){function e(){}function t(e,t,n){a(e,t,n,1)}function n(e,n,r){t("setProperties",{type:e,properties:n},r)}function r(e,t){n("user",e,t)}function o(e,t,n){r({uid:e},n),t&&r(t,n)}a.identify=o,a.setUserVars=r,a.identifyAccount=e,a.clearUserCookie=e,a.setVars=n,a.event=function(e,n,r){t("trackEvent",{name:e,properties:n},r)},a.anonymize=function(){o(!1)},a.shutdown=function(){t("shutdown")},a.restart=function(){t("restart")},a.log=function(e,n){t("log",{level:e,msg:n})},a.consent=function(e){t("setIdentity",{consent:!arguments.length||e})}}(),s="fetch",u="XMLHttpRequest",a._w={},a._w[u]=e[u],a._w[s]=e[s],e[s]&&(e[s]=function(){return a._w[s].apply(this,arguments)}),a._v="2.0.0");function l(e){var t,n=[];function r(){t&&(n.forEach(function(e){var n;try{n=e[t[0]]&&e[t[0]](t[1])}catch(t){return void(e[3]&&e[3](t))}n&&n.then?n.then(e[2],e[3]):e[2]&&e[2](n)}),n.length=0)}function o(e){return function(n){t||(t=[e,n],r())}}return e(o(0),o(1)),{then:function(e,t){return l(function(o,i){n.push([e,t,o,i]),r()})}}}}(n,n.document,o,"script",a)},M=(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.shouldInsertScript,n=void 0===t||t,r=e.globalVar,o=void 0===r?"window":r,i=e.globalNamespace,a=void 0===i?"".concat(o,"['_fs_namespace']"):i,c=e.apiVersion,s=void 0===c?"1.3.0":c;"(function(m,n,e,t,l,o,g,y){\n if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];".concat(n?"\n o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);":"","\n g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n g.anonymize=function(){g.identify(!!0)};\n g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n g.log = function(a,b){g(\"log\",[a,b])};\n g.consent=function(a){g(\"consent\",!arguments.length||a)};\n g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n g.clearUserCookie=function(){};\n g.setVars=function(n, p){g('setVars',[n,p]);};\n g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n g._v=\"").concat(s,'";\n})(').concat(o,",").concat(function(e){return"window"===e?"document":"".concat(e,".document")}(o),",").concat(a,",'script','user');")}(),function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)}),A=function(){if(window._fs_namespace)return window[window._fs_namespace]},R=function(){var e=A();if(!e)throw Error("FullStory is not loaded, please ensure the init function is invoked before calling FullStory API functions");return e},x=function(e,t){var n=M({},e);if(A())console.warn("The FullStory snippet has already been defined elsewhere (likely in the <head> element)");else{n.recordCrossDomainIFrames&&(window._fs_run_in_iframe=!0),n.appHost&&(window._fs_app_host=n.appHost),n.assetMapId&&(window._fs_asset_map_id=n.assetMapId),n.startCaptureManually&&(window._fs_capture_on_startup=!1),n.recordOnlyThisIFrame&&(window._fs_is_outer_script=!0),n.cookieDomain&&(window._fs_cookie_domain=n.cookieDomain),!0===n.debug&&(n.script?console.warn("Ignoring `debug = true` because `script` is set"):n.script="edge.fullstory.com/s/fs-debug.js"),function(e){var t=e.orgId,n=e.namespace,r=void 0===n?"FS":n,o=e.host,i=void 0===o?"fullstory.com":o,a=e.script,c=void 0===a?"edge.fullstory.com/s/fs.js":a;if(!t)throw new Error("FullStory orgId is a required parameter");window._fs_host=i,window._fs_script=c,window._fs_org=t,window._fs_namespace=r,C()}(n);var r=A();if(r){if(n.sessionUid&&r("init",{env:{sessionUid:n.sessionUid}}),t&&r("observe",{type:"start",callback:t}),!0===n.devMode){var o="FullStory was initialized in devMode and will stop recording";r("trackEvent",{name:"FullStory Dev Mode",properties:{message:o}}),r("shutdown"),window._fs_dev_mode=!0,console.warn(o)}}else console.warn("Failed to initialize FS snippet")}},N=(I="FullStory init has already been called once, additional invocations are ignored",function(e,t){window._fs_initialized?I&&console.warn(I):(x(e,t),window._fs_initialized=!0)}),U=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(window._fs_dev_mode){var r="FullStory is in dev mode and is not capturing: ".concat(e," method not executed");return console.warn(r),r}var o=A();return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=R();return e.every(function(e){return n[e]})}(e)&&o?o[e].apply(o,t):(console.warn("FS.".concat(e," not ready")),null)}},T=(F=function(e,t,n){var r=R();if(!window._fs_dev_mode)return r(e,t,n);var o="FullStory is in dev mode and is not capturing: ".concat(e," not executed");console.warn(o)},F.anonymize=U("anonymize"),F.consent=U("consent"),F.disableConsole=U("disableConsole"),F.enableConsole=U("enableConsole"),F.event=U("event"),F.getCurrentSessionURL=U("getCurrentSessionURL"),F.identify=U("identify"),F.log=U("log"),F.restart=U("restart"),F.setUserVars=U("setUserVars"),F.setVars=U("setVars"),F.shutdown=U("shutdown"),F),V={},q={type:"fullstory",config:{},init:function(e){var t=e.config,n=e.env,r=t.settings;if(!(null==r?void 0:r.orgId))return!1;var o=d(n),i={orgId:r.orgId};return void 0!==r.host&&(i.host=r.host),void 0!==r.script&&(i.script=r.script),void 0!==r.cookieDomain&&(i.cookieDomain=r.cookieDomain),void 0!==r.debug&&(i.debug=r.debug),void 0!==r.devMode&&(i.devMode=r.devMode),void 0!==r.startCaptureManually&&(i.startCaptureManually=r.startCaptureManually),void 0!==r.namespace&&(i.namespace=r.namespace),void 0!==r.recordCrossDomainIFrames&&(i.recordCrossDomainIFrames=r.recordCrossDomainIFrames),o.init(i),t},push:function(e,t){return _async_to_generator(function(e,t){var n,r,o,i,a,c,l,f,p,y,v,g,b,h,w,m,O,j;return _ts_generator(this,function(S){switch(S.label){case 0:return n=t.config,r=t.rule,o=t.env,i=t.data,a=t.collector,l=d(o),f=n.settings||{},p=(null==r?void 0:r.settings)||{},void 0===(y=null!==(c=p.identify)&&void 0!==c?c:f.identify)?[3,2]:[4,_(e,y,{collector:a})];case 1:v=S.sent(),s(v)&&(g=v.uid,b=v.properties,u(g)&&g&&(h={uid:g},s(b)&&(h.properties=b),l.setIdentity(h))),S.label=2;case 2:return void 0===p.set?[3,4]:[4,_(e,p.set,{collector:a})];case 3:w=S.sent(),s(w)&&(m=p.setType||"user",l.setProperties({type:m,properties:w})),S.label=4;case 4:return!0!==(null==r?void 0:r.silent)&&(O=u(null==r?void 0:r.name)?r.name:e.name,j=s(i)?i:{},l.trackEvent({name:O,properties:j})),[2]}})}).apply(this,arguments)},on:function(e,t){var n;if("consent"===e&&t.data){var r=d(t.env),o=t.data,i=((null===(n=t.config)||void 0===n?void 0:n.settings)||{}).consent;if(i){var a=!0,c=!1,s=void 0;try{for(var u,l=Object.entries(i)[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=_sliced_to_array(u.value,2),_=f[0],p=f[1];if(_ in o){var y=!0===o[_];"capture"===p?y?r.start():r.shutdown():"consent"===p&&r.setIdentity({consent:y})}}}catch(e){c=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(c)throw s}}}}}},z=q;return D=h,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,s=function(){var o=c.value;b.call(e,o)||o===n||y(e,o,{get:function(){return t[o]},enumerable:!(r=v(t,o))||r.enumerable})},u=g(t)[Symbol.iterator]();!(o=(c=u.next()).done);o=!0)s()}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}}return e}(y({},"__esModule",{value:!0}),D)}();
|
|
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 _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).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 _call_super(e,t,n){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,n||[],_get_prototype_of(e).constructor):t.apply(e,n))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,n){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&_set_prototype_of(o,n.prototype),o},_construct.apply(null,arguments)}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 _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}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 _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}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_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 _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(n,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}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:s(0)}),c(a,"throw",{value:s(1)}),c(a,"return",{value:s(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function s(c){return function(s){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,s])}}}var Destination=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){return Array.isArray(e)},c=function(e){return void 0!==e},s=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!a(e)&&"[object Object]"===Object.prototype.toString.call(e)},u=function(e){return"string"==typeof e},l=function(e){return P(e)?e:void 0},f=function(e,t,n){return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return _async_to_generator(function(){var r;return _ts_generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(o))];case 1:case 3:return[2,i.sent()];case 2:return r=i.sent(),t?[4,t(r)]:[2];case 4:return[4,null==n?void 0:n()];case 5:return i.sent(),[7];case 6:return[2]}})})()}},_=function(e){return _async_to_generator(function(e){var t,n,r,o,i,a,u=arguments;return _ts_generator(this,function(l){return t=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:{},c(e)?(i=s(e)&&e.consent||n.consent||(null===(o=n.collector)||void 0===o?void 0:o.consent),a=null!==(r=n.event)&&void 0!==r?r:s(e)?e:{},[2,p(e,t,_object_spread_props(_object_spread({},n),{consent:i,event:a}))]):[2]})}).apply(this,arguments)},p=function(e){return _async_to_generator(function(e){var t,n,r,o,i,s,u,l,_,p,d,y,v,g,b,h,w=arguments;return _ts_generator(this,function(m){switch(m.label){case 0:if(t=w.length>1&&void 0!==w[1]?w[1]:{},i=(n=w.length>2&&void 0!==w[2]?w[2]:{}).consent||(null===(o=n.collector)||void 0===o?void 0:o.consent),s=null!==(r=n.event)&&void 0!==r?r:{},!n.collector)throw new Error("getMappingValue: context.collector is required");u={event:s,mapping:t,collector:n.collector,logger:n.collector.logger,consent:i},l=a(t)?t:[t],_=!0,p=!1,d=void 0,m.label=1;case 1:m.trys.push([1,6,7,8]),y=l[Symbol.iterator](),m.label=2;case 2:return(_=(v=y.next()).done)?[3,5]:(g=v.value,[4,f(k,function(e){if(_instanceof(e,E))throw e;n.collector&&n.collector.status.failed++,u.logger.error("mapping processing failed",{event:s,error:e})})(e,g,_object_spread_props(_object_spread({},u),{mapping:g}))]);case 3:if(b=m.sent(),c(b))return[2,b];m.label=4;case 4:return _=!0,[3,2];case 5:return[3,8];case 6:return h=m.sent(),p=!0,d=h,[3,8];case 7:try{_||null==y.return||y.return()}finally{if(p)throw d}return[7];case 8:return[2]}})}).apply(this,arguments)},d=function(e){return(null==e?void 0:e.fullstory)?e.fullstory:{init:N,trackEvent:function(e){var t;return T("trackEvent",{name:e.name,properties:null!==(t=e.properties)&&void 0!==t?t:{}})},setIdentity:function(e){return T("setIdentity",e)},setProperties:function(e){return T("setProperties",e)},shutdown:function(){return T("shutdown")},start:function(){return T("start")}}},y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,b=Object.prototype.hasOwnProperty,h={};!function(e,t){for(var n in t)y(e,n,{get:t[n],enumerable:!0})}(h,{DestinationFullStory:function(){return V},default:function(){return z},destinationFullStory:function(){return q}});var w=Object.defineProperty,m=function(e,t){for(var n in t)w(e,n,{get:t[n],enumerable:!0})};m({},{stepId:function(){return e}});m({},{getDestination:function(){return t}});m({},{Level:function(){return j}});var O,j=((O=j||{})[O.ERROR=0]="ERROR",O[O.WARN=1]="WARN",O[O.INFO=2]="INFO",O[O.DEBUG=3]="DEBUG",O);m({},{getTransformer:function(){return n}});m({},{getSource:function(){return r}});function S(e){for(var t=arguments.length>2?arguments[2]:void 0,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),r=e,o=0;o<n.length;o++){var i=n[o];if("*"===i&&a(r)){var u=n.slice(o+1).join("."),l=[],f=!0,_=!1,p=void 0;try{for(var d,y=r[Symbol.iterator]();!(f=(d=y.next()).done);f=!0){var v=S(d.value,u,t);l.push(v)}}catch(e){_=!0,p=e}finally{try{f||null==y.return||y.return()}finally{if(_)throw p}}return l}if(void 0===(r=s(r)||a(r)?r[i]:void 0))break}return c(r)?r:t}function P(e){return function(e){return"boolean"==typeof e}(e)||u(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!c(e)||a(e)&&e.every(P)||s(e)&&Object.values(e).every(P)}m({},{getStore:function(){return o},getStoreValue:function(){return i}});var E=function(){function e(t,n){var r;return _class_call_check(this,e),(r=_call_super(this,e,[t,n])).name="FatalError",Object.setPrototypeOf(r,e.prototype),r}return _inherits(e,_wrap_native_super(Error)),e}();function k(e,t,n){return _async_to_generator(function(){return _ts_generator(this,function(r){return[2,(a(t)?t:[t]).reduce(function(t,r){return _async_to_generator(function(){var o,i,s,_,d,y,v,g,b,h,w,m,O,j,P,I,F,D,C,M,A,R,x,N,U;return _ts_generator(this,function(T){switch(T.label){case 0:return[4,t];case 1:return(o=T.sent())?[2,o]:(i=u(r)?{key:r}:r,Object.keys(i).length?(s=i.condition,_=i.consent,d=i.fn,y=i.key,v=i.loop,g=i.map,b=i.set,h=i.validate,w=i.value,m=_object_spread_props(_object_spread({},n),{mapping:r}),(O=s)?[4,f(s,function(e){if(_instanceof(e,E))throw e;return m.logger.error("mapping condition failed",{event:m.event,error:e}),!1})(e,m)]:[3,3]):[2]);case 2:O=!T.sent(),T.label=3;case 3:return O?[2]:_&&!function(e){var t=_object_spread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),n={},r=!e||0===Object.keys(e).length;return Object.keys(t).forEach(function(o){t[o]&&(n[o]=!0,e&&e[o]&&(r=!0))}),!!r&&n}(_,m.consent)?[2,w]:(j=c(w)?w:e,v?(P=_sliced_to_array(v,2),I=P[0],F=P[1],"this"!==I?[3,4]:(C=[e],[3,6])):[3,10]);case 4:return[4,p(e,I,m)];case 5:C=T.sent(),T.label=6;case 6:return a(D=C)?[4,Promise.all(D.map(function(e){return c(e)?p(e,F,m):void 0}))]:[3,8];case 7:return M=T.sent().filter(c),[3,9];case 8:M=void 0,T.label=9;case 9:return j=M,[3,21];case 10:return g?[4,Object.entries(g).reduce(function(t,n){var r=_sliced_to_array(n,2),o=r[0],i=r[1];return _async_to_generator(function(){var n,r;return _ts_generator(this,function(a){switch(a.label){case 0:return[4,t];case 1:return n=a.sent(),[4,p(e,i,m)];case 2:return r=a.sent(),[2,(c(r)&&(n[o]=r),n)]}})})()},Promise.resolve({}))]:[3,12];case 11:return j=T.sent(),[3,20];case 12:return b?[4,Promise.all(b.map(function(t){return k(e,t,m)}))]:[3,14];case 13:return A=j=T.sent(),[3,19];case 14:return y?(R=j=S(e,y,w),[3,18]):[3,15];case 15:return(x=d)?[4,f(d,function(e){if(_instanceof(e,E))throw e;m.logger.error("mapping fn failed",{event:m.event,error:e})})(e,m)]:[3,17];case 16:x=j=T.sent(),T.label=17;case 17:R=x,T.label=18;case 18:A=R,T.label=19;case 19:T.label=20;case 20:T.label=21;case 21:return(N=h)?[4,f(h,function(e){if(_instanceof(e,E))throw e;return m.logger.error("mapping validate failed",{event:m.event,error:e}),!1})(j,m)]:[3,23];case 22:N=!T.sent(),T.label=23;case 23:return N&&(j=void 0),U=l(j),[2,c(U)?U:l(w)]}})})()},Promise.resolve(void 0))]})})()}var I,F,D,C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.wnd,n=void 0===t?window:t,r=e.injectedNamespace,o=void 0===r?n._fs_namespace:r,i=e.injectedScript,a=void 0===i?n._fs_script:i;!function(e,t,n,r,o,i,a,c){var s,u;n in e&&(e.console&&e.console.log&&e.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'),1)||(a=e[n]=function(){var e=function(e,n,r,o){function i(i,a){t(e,n,r,i,a,o)}o=o||2;var a,c=/Async$/;return c.test(e)?(e=e.replace(c,""),"function"==typeof Promise?new Promise(i):l(i)):t(e,n,r,a,a,o)};function t(t,n,r,o,i,a){return e._api?e._api(t,n,r,o,i,a):(e.q&&e.q.push([t,n,r,o,i,a]),null)}return e.q=[],e}(),c=function(e){function t(t){"function"==typeof t[4]&&t[4](new Error(e))}var n=a.q;if(n){for(var r=0;r<n.length;r++)t(n[r]);n.length=0,n.push=t}},function(){(i=t.createElement(r)).async=!0,i.crossOrigin="anonymous",i.src="https://"+o,i.onerror=function(){c("Error loading "+o)};var e=t.getElementsByTagName(r)[0];e&&e.parentNode?e.parentNode.insertBefore(i,e):t.head.appendChild(i)}(),function(){function e(){}function t(e,t,n){a(e,t,n,1)}function n(e,n,r){t("setProperties",{type:e,properties:n},r)}function r(e,t){n("user",e,t)}function o(e,t,n){r({uid:e},n),t&&r(t,n)}a.identify=o,a.setUserVars=r,a.identifyAccount=e,a.clearUserCookie=e,a.setVars=n,a.event=function(e,n,r){t("trackEvent",{name:e,properties:n},r)},a.anonymize=function(){o(!1)},a.shutdown=function(){t("shutdown")},a.restart=function(){t("restart")},a.log=function(e,n){t("log",{level:e,msg:n})},a.consent=function(e){t("setIdentity",{consent:!arguments.length||e})}}(),s="fetch",u="XMLHttpRequest",a._w={},a._w[u]=e[u],a._w[s]=e[s],e[s]&&(e[s]=function(){return a._w[s].apply(this,arguments)}),a._v="2.0.0");function l(e){var t,n=[];function r(){t&&(n.forEach(function(e){var n;try{n=e[t[0]]&&e[t[0]](t[1])}catch(t){return void(e[3]&&e[3](t))}n&&n.then?n.then(e[2],e[3]):e[2]&&e[2](n)}),n.length=0)}function o(e){return function(n){t||(t=[e,n],r())}}return e(o(0),o(1)),{then:function(e,t){return l(function(o,i){n.push([e,t,o,i]),r()})}}}}(n,n.document,o,"script",a)},M=(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.shouldInsertScript,n=void 0===t||t,r=e.globalVar,o=void 0===r?"window":r,i=e.globalNamespace,a=void 0===i?"".concat(o,"['_fs_namespace']"):i,c=e.apiVersion,s=void 0===c?"1.3.0":c;"(function(m,n,e,t,l,o,g,y){\n if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];".concat(n?"\n o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);":"","\n g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n g.anonymize=function(){g.identify(!!0)};\n g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n g.log = function(a,b){g(\"log\",[a,b])};\n g.consent=function(a){g(\"consent\",!arguments.length||a)};\n g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n g.clearUserCookie=function(){};\n g.setVars=function(n, p){g('setVars',[n,p]);};\n g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n g._v=\"").concat(s,'";\n})(').concat(o,",").concat(function(e){return"window"===e?"document":"".concat(e,".document")}(o),",").concat(a,",'script','user');")}(),function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)}),A=function(){if(window._fs_namespace)return window[window._fs_namespace]},R=function(){var e=A();if(!e)throw Error("FullStory is not loaded, please ensure the init function is invoked before calling FullStory API functions");return e},x=function(e,t){var n=M({},e);if(A())console.warn("The FullStory snippet has already been defined elsewhere (likely in the <head> element)");else{n.recordCrossDomainIFrames&&(window._fs_run_in_iframe=!0),n.appHost&&(window._fs_app_host=n.appHost),n.assetMapId&&(window._fs_asset_map_id=n.assetMapId),n.startCaptureManually&&(window._fs_capture_on_startup=!1),n.recordOnlyThisIFrame&&(window._fs_is_outer_script=!0),n.cookieDomain&&(window._fs_cookie_domain=n.cookieDomain),!0===n.debug&&(n.script?console.warn("Ignoring `debug = true` because `script` is set"):n.script="edge.fullstory.com/s/fs-debug.js"),function(e){var t=e.orgId,n=e.namespace,r=void 0===n?"FS":n,o=e.host,i=void 0===o?"fullstory.com":o,a=e.script,c=void 0===a?"edge.fullstory.com/s/fs.js":a;if(!t)throw new Error("FullStory orgId is a required parameter");window._fs_host=i,window._fs_script=c,window._fs_org=t,window._fs_namespace=r,C()}(n);var r=A();if(r){if(n.sessionUid&&r("init",{env:{sessionUid:n.sessionUid}}),t&&r("observe",{type:"start",callback:t}),!0===n.devMode){var o="FullStory was initialized in devMode and will stop recording";r("trackEvent",{name:"FullStory Dev Mode",properties:{message:o}}),r("shutdown"),window._fs_dev_mode=!0,console.warn(o)}}else console.warn("Failed to initialize FS snippet")}},N=(I="FullStory init has already been called once, additional invocations are ignored",function(e,t){window._fs_initialized?I&&console.warn(I):(x(e,t),window._fs_initialized=!0)}),U=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(window._fs_dev_mode){var r="FullStory is in dev mode and is not capturing: ".concat(e," method not executed");return console.warn(r),r}var o=A();return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=R();return e.every(function(e){return n[e]})}(e)&&o?o[e].apply(o,t):(console.warn("FS.".concat(e," not ready")),null)}},T=(F=function(e,t,n){var r=R();if(!window._fs_dev_mode)return r(e,t,n);var o="FullStory is in dev mode and is not capturing: ".concat(e," not executed");console.warn(o)},F.anonymize=U("anonymize"),F.consent=U("consent"),F.disableConsole=U("disableConsole"),F.enableConsole=U("enableConsole"),F.event=U("event"),F.getCurrentSessionURL=U("getCurrentSessionURL"),F.identify=U("identify"),F.log=U("log"),F.restart=U("restart"),F.setUserVars=U("setUserVars"),F.setVars=U("setVars"),F.shutdown=U("shutdown"),F),V={},q={type:"fullstory",config:{},init:function(e){var t=e.config,n=e.env,r=t.settings;if(!(null==r?void 0:r.orgId))return!1;var o=d(n),i={orgId:r.orgId};return void 0!==r.host&&(i.host=r.host),void 0!==r.script&&(i.script=r.script),void 0!==r.cookieDomain&&(i.cookieDomain=r.cookieDomain),void 0!==r.debug&&(i.debug=r.debug),void 0!==r.devMode&&(i.devMode=r.devMode),void 0!==r.startCaptureManually&&(i.startCaptureManually=r.startCaptureManually),void 0!==r.namespace&&(i.namespace=r.namespace),void 0!==r.recordCrossDomainIFrames&&(i.recordCrossDomainIFrames=r.recordCrossDomainIFrames),o.init(i),t},push:function(e,t){return _async_to_generator(function(e,t){var n,r,o,i,a,c,l,f,p,y,v,g,b,h,w,m,O,j;return _ts_generator(this,function(S){switch(S.label){case 0:return n=t.config,r=t.rule,o=t.env,i=t.data,a=t.collector,l=d(o),f=n.settings||{},p=(null==r?void 0:r.settings)||{},void 0===(y=null!==(c=p.identify)&&void 0!==c?c:f.identify)?[3,2]:[4,_(e,y,{collector:a})];case 1:v=S.sent(),s(v)&&(g=v.uid,b=v.properties,u(g)&&g&&(h={uid:g},s(b)&&(h.properties=b),l.setIdentity(h))),S.label=2;case 2:return void 0===p.set?[3,4]:[4,_(e,p.set,{collector:a})];case 3:w=S.sent(),s(w)&&(m=p.setType||"user",l.setProperties({type:m,properties:w})),S.label=4;case 4:return!0!==(null==r?void 0:r.silent)&&(O=u(null==r?void 0:r.name)?r.name:e.name,j=s(i)?i:{},l.trackEvent({name:O,properties:j})),[2]}})}).apply(this,arguments)},on:function(e,t){var n;if("consent"===e&&t.data){var r=d(t.env),o=t.data,i=((null===(n=t.config)||void 0===n?void 0:n.settings)||{}).consent;if(i){var a=!0,c=!1,s=void 0;try{for(var u,l=Object.entries(i)[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=_sliced_to_array(u.value,2),_=f[0],p=f[1];if(_ in o){var y=!0===o[_];"capture"===p?y?r.start():r.shutdown():"consent"===p&&r.setIdentity({consent:y})}}}catch(e){c=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(c)throw s}}}}}},z=q;return D=h,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,s=function(){var o=c.value;b.call(e,o)||o===n||y(e,o,{get:function(){return t[o]},enumerable:!(r=v(t,o))||r.enumerable})},u=g(t)[Symbol.iterator]();!(o=(c=u.next()).done);o=!0)s()}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}}return e}(y({},"__esModule",{value:!0}),D)}();
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-fullstory",
|
|
4
|
-
"version": "4.7.
|
|
4
|
+
"version": "4.7.1",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
"consent": {
|
|
234
234
|
"functional": true
|
|
235
235
|
},
|
|
236
|
-
"id": "
|
|
236
|
+
"id": "2043ebde14bdab64",
|
|
237
237
|
"trigger": "load",
|
|
238
238
|
"entity": "order",
|
|
239
239
|
"action": "complete",
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
"consent": {
|
|
413
413
|
"functional": true
|
|
414
414
|
},
|
|
415
|
-
"id": "
|
|
415
|
+
"id": "2276c7e1f8839ee0",
|
|
416
416
|
"trigger": "load",
|
|
417
417
|
"entity": "product",
|
|
418
418
|
"action": "view",
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
"consent": {
|
|
477
477
|
"functional": true
|
|
478
478
|
},
|
|
479
|
-
"id": "
|
|
479
|
+
"id": "122481dc4420df97",
|
|
480
480
|
"trigger": "load",
|
|
481
481
|
"entity": "page",
|
|
482
482
|
"action": "view",
|
|
@@ -592,7 +592,7 @@
|
|
|
592
592
|
"consent": {
|
|
593
593
|
"functional": true
|
|
594
594
|
},
|
|
595
|
-
"id": "
|
|
595
|
+
"id": "c976bb01dde74e4f",
|
|
596
596
|
"trigger": "load",
|
|
597
597
|
"entity": "order",
|
|
598
598
|
"action": "complete",
|
|
@@ -655,7 +655,7 @@
|
|
|
655
655
|
"consent": {
|
|
656
656
|
"functional": true
|
|
657
657
|
},
|
|
658
|
-
"id": "
|
|
658
|
+
"id": "ec28ed83c2742bf7",
|
|
659
659
|
"trigger": "load",
|
|
660
660
|
"entity": "page",
|
|
661
661
|
"action": "view",
|
|
@@ -771,7 +771,7 @@
|
|
|
771
771
|
"consent": {
|
|
772
772
|
"functional": true
|
|
773
773
|
},
|
|
774
|
-
"id": "
|
|
774
|
+
"id": "aeef07e0f2cd4c12",
|
|
775
775
|
"trigger": "load",
|
|
776
776
|
"entity": "order",
|
|
777
777
|
"action": "complete",
|
|
@@ -851,7 +851,7 @@
|
|
|
851
851
|
"consent": {
|
|
852
852
|
"functional": true
|
|
853
853
|
},
|
|
854
|
-
"id": "
|
|
854
|
+
"id": "0e16e3df58ed0bea",
|
|
855
855
|
"trigger": "test",
|
|
856
856
|
"entity": "user",
|
|
857
857
|
"action": "login",
|
|
@@ -929,7 +929,7 @@
|
|
|
929
929
|
"consent": {
|
|
930
930
|
"functional": true
|
|
931
931
|
},
|
|
932
|
-
"id": "
|
|
932
|
+
"id": "4f0841237e1b5d55",
|
|
933
933
|
"trigger": "test",
|
|
934
934
|
"entity": "user",
|
|
935
935
|
"action": "login",
|
|
@@ -1019,7 +1019,7 @@
|
|
|
1019
1019
|
"consent": {
|
|
1020
1020
|
"functional": true
|
|
1021
1021
|
},
|
|
1022
|
-
"id": "
|
|
1022
|
+
"id": "ce92b930c9493ab0",
|
|
1023
1023
|
"trigger": "test",
|
|
1024
1024
|
"entity": "debug",
|
|
1025
1025
|
"action": "noise",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-fullstory",
|
|
3
3
|
"description": "FullStory web destination for walkerOS (session replay, custom events, user/page properties)",
|
|
4
|
-
"version": "4.7.
|
|
4
|
+
"version": "4.7.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@fullstory/browser": "^2.0.8",
|
|
42
|
-
"@walkeros/core": "4.7.
|
|
43
|
-
"@walkeros/web-core": "4.7.
|
|
42
|
+
"@walkeros/core": "4.7.1",
|
|
43
|
+
"@walkeros/web-core": "4.7.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@walkeros/collector": "4.7.
|
|
46
|
+
"@walkeros/collector": "4.7.1"
|
|
47
47
|
},
|
|
48
48
|
"repository": {
|
|
49
49
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|