@cloudcare/browser-core 3.1.10 → 3.1.12

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.
Files changed (156) hide show
  1. package/cjs/browser/addEventListener.js.map +1 -1
  2. package/cjs/browser/cookie.js +2 -1
  3. package/cjs/browser/cookie.js.map +1 -1
  4. package/cjs/browser/fetchObservable.js.map +1 -1
  5. package/cjs/browser/htmlDomUtils.js +6 -1
  6. package/cjs/browser/htmlDomUtils.js.map +1 -1
  7. package/cjs/browser/pageExitObservable.js.map +1 -1
  8. package/cjs/browser/runOnReadyState.js.map +1 -1
  9. package/cjs/browser/scroll.js.map +1 -1
  10. package/cjs/browser/xhrObservable.js.map +1 -1
  11. package/cjs/configuration/configuration.js +13 -5
  12. package/cjs/configuration/configuration.js.map +1 -1
  13. package/cjs/configuration/transportConfiguration.js.map +1 -1
  14. package/cjs/console/consoleObservable.js +4 -2
  15. package/cjs/console/consoleObservable.js.map +1 -1
  16. package/cjs/dataMap.js +3 -1
  17. package/cjs/dataMap.js.map +1 -1
  18. package/cjs/error/trackRuntimeError.js.map +1 -1
  19. package/cjs/helper/boundedBuffer.js.map +1 -1
  20. package/cjs/helper/byteUtils.js.map +1 -1
  21. package/cjs/helper/catchUserErrors.js.map +1 -1
  22. package/cjs/helper/contextHistory.js.map +1 -1
  23. package/cjs/helper/createEventRateLimiter.js.map +1 -1
  24. package/cjs/helper/deviceInfo.js.map +1 -1
  25. package/cjs/helper/display.js.map +1 -1
  26. package/cjs/helper/enums.js.map +1 -1
  27. package/cjs/helper/errorTools.js.map +1 -1
  28. package/cjs/helper/eventEmitter.js.map +1 -1
  29. package/cjs/helper/getZoneJsOriginalValue.js.map +1 -1
  30. package/cjs/helper/instrumentMethod.js +7 -6
  31. package/cjs/helper/instrumentMethod.js.map +1 -1
  32. package/cjs/helper/lifeCycle.js +2 -0
  33. package/cjs/helper/lifeCycle.js.map +1 -1
  34. package/cjs/helper/limitModification.js.map +1 -1
  35. package/cjs/helper/mobileUtil.js.map +1 -1
  36. package/cjs/helper/monitor.js.map +1 -1
  37. package/cjs/helper/observable.js.map +1 -1
  38. package/cjs/helper/readBytesFromStream.js.map +1 -1
  39. package/cjs/helper/sanitize.js.map +1 -1
  40. package/cjs/helper/serialisation/contextManager.js.map +1 -1
  41. package/cjs/helper/serialisation/heavyCustomerDataWarning.js.map +1 -1
  42. package/cjs/helper/serialisation/jsonStringify.js.map +1 -1
  43. package/cjs/helper/serialisation/rowData.js.map +1 -1
  44. package/cjs/helper/serialisation/storedContextManager.js.map +1 -1
  45. package/cjs/helper/timer.js.map +1 -1
  46. package/cjs/helper/tools.js.map +1 -1
  47. package/cjs/helper/urlPolyfill.js.map +1 -1
  48. package/cjs/index.js.map +1 -1
  49. package/cjs/init.js.map +1 -1
  50. package/cjs/report/reportObservable.js.map +1 -1
  51. package/cjs/session/sessionConstants.js.map +1 -1
  52. package/cjs/session/sessionCookieStore.js.map +1 -1
  53. package/cjs/session/sessionManagement.js +7 -2
  54. package/cjs/session/sessionManagement.js.map +1 -1
  55. package/cjs/session/sessionStore.js +28 -4
  56. package/cjs/session/sessionStore.js.map +1 -1
  57. package/cjs/synthetics/syntheticsWorkerValues.js.map +1 -1
  58. package/cjs/synthetics/usr.js.map +1 -1
  59. package/cjs/telemetry/telemetry.js.map +1 -1
  60. package/cjs/telemetry/types.js.map +1 -1
  61. package/cjs/tracekit/computeStackTrace.js.map +1 -1
  62. package/cjs/tracekit/index.js.map +1 -1
  63. package/cjs/tracekit/tracekit.js.map +1 -1
  64. package/cjs/transport/batch.js.map +1 -1
  65. package/cjs/transport/eventBridge.js.map +1 -1
  66. package/cjs/transport/flushController.js.map +1 -1
  67. package/cjs/transport/httpRequest.js.map +1 -1
  68. package/cjs/transport/index.js.map +1 -1
  69. package/cjs/transport/sendWithRetryStrategy.js.map +1 -1
  70. package/cjs/transport/startBatchWithReplica.js.map +1 -1
  71. package/cjs/user/index.js.map +1 -1
  72. package/cjs/user/user.js.map +1 -1
  73. package/cjs/worker.js.map +1 -1
  74. package/esm/browser/addEventListener.js.map +1 -1
  75. package/esm/browser/cookie.js +2 -1
  76. package/esm/browser/cookie.js.map +1 -1
  77. package/esm/browser/fetchObservable.js.map +1 -1
  78. package/esm/browser/htmlDomUtils.js +6 -1
  79. package/esm/browser/htmlDomUtils.js.map +1 -1
  80. package/esm/browser/pageExitObservable.js.map +1 -1
  81. package/esm/browser/runOnReadyState.js.map +1 -1
  82. package/esm/browser/scroll.js.map +1 -1
  83. package/esm/browser/xhrObservable.js.map +1 -1
  84. package/esm/configuration/configuration.js +13 -5
  85. package/esm/configuration/configuration.js.map +1 -1
  86. package/esm/configuration/transportConfiguration.js.map +1 -1
  87. package/esm/console/consoleObservable.js +5 -3
  88. package/esm/console/consoleObservable.js.map +1 -1
  89. package/esm/dataMap.js +3 -1
  90. package/esm/dataMap.js.map +1 -1
  91. package/esm/error/trackRuntimeError.js.map +1 -1
  92. package/esm/helper/boundedBuffer.js.map +1 -1
  93. package/esm/helper/byteUtils.js.map +1 -1
  94. package/esm/helper/catchUserErrors.js.map +1 -1
  95. package/esm/helper/contextHistory.js.map +1 -1
  96. package/esm/helper/createEventRateLimiter.js.map +1 -1
  97. package/esm/helper/deviceInfo.js.map +1 -1
  98. package/esm/helper/display.js.map +1 -1
  99. package/esm/helper/enums.js.map +1 -1
  100. package/esm/helper/errorTools.js.map +1 -1
  101. package/esm/helper/eventEmitter.js.map +1 -1
  102. package/esm/helper/getZoneJsOriginalValue.js.map +1 -1
  103. package/esm/helper/instrumentMethod.js +7 -6
  104. package/esm/helper/instrumentMethod.js.map +1 -1
  105. package/esm/helper/lifeCycle.js +2 -0
  106. package/esm/helper/lifeCycle.js.map +1 -1
  107. package/esm/helper/limitModification.js.map +1 -1
  108. package/esm/helper/mobileUtil.js.map +1 -1
  109. package/esm/helper/monitor.js.map +1 -1
  110. package/esm/helper/observable.js.map +1 -1
  111. package/esm/helper/readBytesFromStream.js.map +1 -1
  112. package/esm/helper/sanitize.js.map +1 -1
  113. package/esm/helper/serialisation/contextManager.js.map +1 -1
  114. package/esm/helper/serialisation/heavyCustomerDataWarning.js.map +1 -1
  115. package/esm/helper/serialisation/jsonStringify.js.map +1 -1
  116. package/esm/helper/serialisation/rowData.js.map +1 -1
  117. package/esm/helper/serialisation/storedContextManager.js.map +1 -1
  118. package/esm/helper/timer.js.map +1 -1
  119. package/esm/helper/tools.js.map +1 -1
  120. package/esm/helper/urlPolyfill.js.map +1 -1
  121. package/esm/index.js.map +1 -1
  122. package/esm/init.js.map +1 -1
  123. package/esm/report/reportObservable.js.map +1 -1
  124. package/esm/session/sessionConstants.js.map +1 -1
  125. package/esm/session/sessionCookieStore.js.map +1 -1
  126. package/esm/session/sessionManagement.js +7 -2
  127. package/esm/session/sessionManagement.js.map +1 -1
  128. package/esm/session/sessionStore.js +27 -6
  129. package/esm/session/sessionStore.js.map +1 -1
  130. package/esm/synthetics/syntheticsWorkerValues.js.map +1 -1
  131. package/esm/synthetics/usr.js.map +1 -1
  132. package/esm/telemetry/telemetry.js.map +1 -1
  133. package/esm/telemetry/types.js.map +1 -1
  134. package/esm/tracekit/computeStackTrace.js.map +1 -1
  135. package/esm/tracekit/index.js.map +1 -1
  136. package/esm/tracekit/tracekit.js.map +1 -1
  137. package/esm/transport/batch.js.map +1 -1
  138. package/esm/transport/eventBridge.js.map +1 -1
  139. package/esm/transport/flushController.js.map +1 -1
  140. package/esm/transport/httpRequest.js.map +1 -1
  141. package/esm/transport/index.js.map +1 -1
  142. package/esm/transport/sendWithRetryStrategy.js.map +1 -1
  143. package/esm/transport/startBatchWithReplica.js.map +1 -1
  144. package/esm/user/index.js.map +1 -1
  145. package/esm/user/user.js.map +1 -1
  146. package/esm/worker.js.map +1 -1
  147. package/package.json +2 -2
  148. package/src/browser/cookie.js +3 -1
  149. package/src/browser/htmlDomUtils.js +7 -1
  150. package/src/configuration/configuration.js +17 -9
  151. package/src/console/consoleObservable.js +8 -4
  152. package/src/dataMap.js +3 -1
  153. package/src/helper/instrumentMethod.js +5 -4
  154. package/src/helper/lifeCycle.js +2 -0
  155. package/src/session/sessionManagement.js +7 -2
  156. package/src/session/sessionStore.js +26 -7
@@ -1 +1 @@
1
- {"version":3,"file":"addEventListener.js","names":["_tools","require","_getZoneJsOriginalValue","_monitor","addEventListener","eventTarget","event","listener","options","addEventListeners","eventNames","wrappedListener","monitor","once","stop","passive","capture","add","getZoneJsOriginalValue","each","eventName","call","remove"],"sources":["../../src/browser/addEventListener.js"],"sourcesContent":["import { each } from '../helper/tools'\nimport { getZoneJsOriginalValue } from '../helper/getZoneJsOriginalValue'\nimport { monitor } from '../helper/monitor'\nexport function addEventListener(eventTarget, event, listener, options) {\n return addEventListeners(eventTarget, [event], listener, options)\n}\n\n/**\n * Add event listeners to an event emitter object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by:\n * * using an option object only if needed\n * * emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are\n * listened\n */\n\nexport function addEventListeners(eventTarget, eventNames, listener, options) {\n var wrappedListener = monitor(\n options && options.once\n ? function (event) {\n stop()\n listener(event)\n }\n : listener\n )\n options =\n options && options.passive\n ? { capture: options.capture, passive: options.passive }\n : options && options.capture\n var add = getZoneJsOriginalValue(eventTarget, 'addEventListener')\n\n each(eventNames, function (eventName) {\n add.call(eventTarget, eventName, wrappedListener, options)\n })\n var stop = function () {\n var remove = getZoneJsOriginalValue(eventTarget, 'removeEventListener')\n each(eventNames, function (eventName) {\n remove.call(eventTarget, eventName, wrappedListener, options)\n })\n }\n return {\n stop: stop\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACO,SAASG,gBAAgBA,CAACC,WAAW,EAAEC,KAAK,EAAEC,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1
+ {"version":3,"file":"addEventListener.js","names":["_tools","require","_getZoneJsOriginalValue","_monitor","addEventListener","eventTarget","event","listener","options","addEventListeners","eventNames","wrappedListener","monitor","once","stop","passive","capture","add","getZoneJsOriginalValue","each","eventName","call","remove"],"sources":["../../src/browser/addEventListener.js"],"sourcesContent":["import { each } from '../helper/tools'\nimport { getZoneJsOriginalValue } from '../helper/getZoneJsOriginalValue'\nimport { monitor } from '../helper/monitor'\nexport function addEventListener(eventTarget, event, listener, options) {\n return addEventListeners(eventTarget, [event], listener, options)\n}\n\n/**\n * Add event listeners to an event emitter object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by:\n * * using an option object only if needed\n * * emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are\n * listened\n */\n\nexport function addEventListeners(eventTarget, eventNames, listener, options) {\n var wrappedListener = monitor(\n options && options.once\n ? function (event) {\n stop()\n listener(event)\n }\n : listener\n )\n options =\n options && options.passive\n ? { capture: options.capture, passive: options.passive }\n : options && options.capture\n var add = getZoneJsOriginalValue(eventTarget, 'addEventListener')\n\n each(eventNames, function (eventName) {\n add.call(eventTarget, eventName, wrappedListener, options)\n })\n var stop = function () {\n var remove = getZoneJsOriginalValue(eventTarget, 'removeEventListener')\n each(eventNames, function (eventName) {\n remove.call(eventTarget, eventName, wrappedListener, options)\n })\n }\n return {\n stop: stop\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACO,SAASG,gBAAgBA,CAACC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EACtE,OAAOC,iBAAiB,CAACJ,WAAW,EAAE,CAACC,KAAK,CAAC,EAAEC,QAAQ,EAAEC,OAAO,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASC,iBAAiBA,CAACJ,WAAW,EAAEK,UAAU,EAAEH,QAAQ,EAAEC,OAAO,EAAE;EAC5E,IAAIG,eAAe,GAAG,IAAAC,gBAAO,EAC3BJ,OAAO,IAAIA,OAAO,CAACK,IAAI,GACnB,UAAUP,KAAK,EAAE;IACfQ,IAAI,CAAC,CAAC;IACNP,QAAQ,CAACD,KAAK,CAAC;EACjB,CAAC,GACDC,QACN,CAAC;EACDC,OAAO,GACLA,OAAO,IAAIA,OAAO,CAACO,OAAO,GACtB;IAAEC,OAAO,EAAER,OAAO,CAACQ,OAAO;IAAED,OAAO,EAAEP,OAAO,CAACO;EAAQ,CAAC,GACtDP,OAAO,IAAIA,OAAO,CAACQ,OAAO;EAChC,IAAIC,GAAG,GAAG,IAAAC,8CAAsB,EAACb,WAAW,EAAE,kBAAkB,CAAC;EAEjE,IAAAc,WAAI,EAACT,UAAU,EAAE,UAAUU,SAAS,EAAE;IACpCH,GAAG,CAACI,IAAI,CAAChB,WAAW,EAAEe,SAAS,EAAET,eAAe,EAAEH,OAAO,CAAC;EAC5D,CAAC,CAAC;EACF,IAAIM,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAe;IACrB,IAAIQ,MAAM,GAAG,IAAAJ,8CAAsB,EAACb,WAAW,EAAE,qBAAqB,CAAC;IACvE,IAAAc,WAAI,EAACT,UAAU,EAAE,UAAUU,SAAS,EAAE;MACpCE,MAAM,CAACD,IAAI,CAAChB,WAAW,EAAEe,SAAS,EAAET,eAAe,EAAEH,OAAO,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC;EACD,OAAO;IACLM,IAAI,EAAEA;EACR,CAAC;AACH","ignoreList":[]}
@@ -21,7 +21,8 @@ function setCookie(name, value, expireDelay, options) {
21
21
  var sameSite = options && options.crossSite ? 'none' : 'strict';
22
22
  var domain = options && options.domain ? ';domain=' + options.domain : '';
23
23
  var secure = options && options.secure ? ';secure' : '';
24
- document.cookie = name + '=' + value + ';' + expires + ';path=/;samesite=' + sameSite + domain + secure;
24
+ var partitioned = options && options.partitioned ? ';partitioned' : '';
25
+ document.cookie = name + '=' + value + ';' + expires + ';path=/;samesite=' + sameSite + domain + secure + partitioned;
25
26
  }
26
27
  function getCookie(name) {
27
28
  return (0, _tools.findCommaSeparatedValue)(document.cookie, name);
@@ -1 +1 @@
1
- {"version":3,"file":"cookie.js","names":["_tools","require","COOKIE_ACCESS_DELAY","ONE_SECOND","exports","setCookie","name","value","expireDelay","options","date","Date","setTime","getTime","expires","toUTCString","sameSite","crossSite","domain","secure","document","cookie","getCookie","findCommaSeparatedValue","initCookieParsed","getInitCookie","findCommaSeparatedValues","get","resetInitCookies","undefined","deleteCookie","areCookiesAuthorized","testCookieName","concat","UUID","testCookieValue","error","getCurrentSiteCache","getCurrentSite","domainLevels","window","location","hostname","split","candidateDomain","pop","length"],"sources":["../../src/browser/cookie.js"],"sourcesContent":["import {\n findCommaSeparatedValue,\n UUID,\n ONE_SECOND,\n findCommaSeparatedValues\n} from '../helper/tools'\nexport var COOKIE_ACCESS_DELAY = ONE_SECOND\n\nexport function setCookie(name, value, expireDelay, options) {\n var date = new Date()\n date.setTime(date.getTime() + expireDelay)\n var expires = 'expires=' + date.toUTCString()\n var sameSite = options && options.crossSite ? 'none' : 'strict'\n var domain = options && options.domain ? ';domain=' + options.domain : ''\n var secure = options && options.secure ? ';secure' : ''\n document.cookie =\n name +\n '=' +\n value +\n ';' +\n expires +\n ';path=/;samesite=' +\n sameSite +\n domain +\n secure\n}\n\nexport function getCookie(name) {\n return findCommaSeparatedValue(document.cookie, name)\n}\nvar initCookieParsed\n/**\n * Returns a cached value of the cookie. Use this during SDK initialization (and whenever possible)\n * to avoid accessing document.cookie multiple times.\n */\nexport function getInitCookie(name) {\n if (!initCookieParsed) {\n initCookieParsed = findCommaSeparatedValues(document.cookie)\n }\n return initCookieParsed.get(name)\n}\n\nexport function resetInitCookies() {\n initCookieParsed = undefined\n}\nexport function deleteCookie(name, options) {\n setCookie(name, '', 0, options)\n}\n\nexport function areCookiesAuthorized(options) {\n if (document.cookie === undefined || document.cookie === null) {\n return false\n }\n try {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = `gc_cookie_test_${UUID()}`\n var testCookieValue = 'test'\n setCookie(testCookieName, testCookieValue, ONE_SECOND, options)\n return getCookie(testCookieName) === testCookieValue\n } catch (error) {\n return false\n }\n}\n\n/**\n * No API to retrieve it, number of levels for subdomain and suffix are unknown\n * strategy: find the minimal domain on which cookies are allowed to be set\n * https://web.dev/same-site-same-origin/#site\n */\nvar getCurrentSiteCache\nexport function getCurrentSite() {\n if (getCurrentSiteCache === undefined) {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = `gc_site_test_${UUID()}`\n var testCookieValue = 'test'\n\n var domainLevels = window.location.hostname.split('.')\n var candidateDomain = domainLevels.pop()\n while (domainLevels.length && !getCookie(testCookieName)) {\n candidateDomain = domainLevels.pop() + '.' + candidateDomain\n setCookie(testCookieName, testCookieValue, ONE_SECOND, {\n domain: candidateDomain\n })\n }\n getCurrentSiteCache = candidateDomain\n }\n return getCurrentSiteCache\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMO,IAAIC,mBAAmB,GAAGC,iBAAU;AAAAC,OAAA,CAAAF,mBAAA,GAAAA,mBAAA;AAEpC,SAASG,SAASA,CAACC,IAAI,EAAEC,KAAK,EAAEC,WAAW,EAAEC,OAAO,EAAE;EAC3D,IAAIC,IAAI,GAAG,IAAIC,IAAI,CAAC,CAAC;EACrBD,IAAI,CAACE,OAAO,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,GAAGL,WAAW,CAAC;EAC1C,IAAIM,OAAO,GAAG,UAAU,GAAGJ,IAAI,CAACK,WAAW,CAAC,CAAC;EAC7C,IAAI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IC,eAAe,GAAG,MAAM;IAC5B9B,SAAS,CAAC2B,cAAc,EAAEG,eAAe,EAAEhC,iBAAU,EAAEM,OAAO,CAAC;IAC/D,OAAOa,SAAS,CAACU,cAAc,CAAC,KAAKG,eAAe;EACtD,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAIC,mBAAmB;AAChB,SAASC,cAAcA,CAAA,EAAG;EAC/B,IAAID,mBAAmB,KAAKR,SAAS,EAAE;IACrC;IACA;IACA,IAAIG,cAAc,mBAAAC,MAAA,CAAmB,IAAAC,WAAI,EAAC,CAAC,CAAE;IAC7C,IAAIC,eAAe,GAAG,MAAM;IAE5B,IAAII,YAAY,GAAGC,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC;IACtD,IAAIC,eAAe,GAAGL,YAAY,CAACM,GAAG,CAAC,CAAC;IACxC,OAAON,YAAY,CAACO,MAAM,IAAI,CAACxB,SAAS,CAACU,cAAc,CAAC,EAAE;MACxDY,eAAe,GAAGL,YAAY,CAACM,GAAG,CAAC,CAAC,GAAG,GAAG,GAAGD,eAAe;MAC5DvC,SAAS,CAAC2B,cAAc,EAAEG,eAAe,EAAEhC,iBAAU,EAAE;QACrDe,MAAM,EAAE0B;MACV,CAAC,CAAC;IACJ;IACAP,mBAAmB,GAAGO,eAAe;EACvC;EACA,OAAOP,mBAAmB;AAC5B"}
1
+ {"version":3,"file":"cookie.js","names":["_tools","require","COOKIE_ACCESS_DELAY","ONE_SECOND","exports","setCookie","name","value","expireDelay","options","date","Date","setTime","getTime","expires","toUTCString","sameSite","crossSite","domain","secure","partitioned","document","cookie","getCookie","findCommaSeparatedValue","initCookieParsed","getInitCookie","findCommaSeparatedValues","get","resetInitCookies","undefined","deleteCookie","areCookiesAuthorized","testCookieName","concat","UUID","testCookieValue","error","getCurrentSiteCache","getCurrentSite","domainLevels","window","location","hostname","split","candidateDomain","pop","length"],"sources":["../../src/browser/cookie.js"],"sourcesContent":["import {\n findCommaSeparatedValue,\n UUID,\n ONE_SECOND,\n findCommaSeparatedValues\n} from '../helper/tools'\nexport var COOKIE_ACCESS_DELAY = ONE_SECOND\n\nexport function setCookie(name, value, expireDelay, options) {\n var date = new Date()\n date.setTime(date.getTime() + expireDelay)\n var expires = 'expires=' + date.toUTCString()\n var sameSite = options && options.crossSite ? 'none' : 'strict'\n var domain = options && options.domain ? ';domain=' + options.domain : ''\n var secure = options && options.secure ? ';secure' : ''\n var partitioned = options && options.partitioned ? ';partitioned' : ''\n document.cookie =\n name +\n '=' +\n value +\n ';' +\n expires +\n ';path=/;samesite=' +\n sameSite +\n domain +\n secure +\n partitioned\n}\n\nexport function getCookie(name) {\n return findCommaSeparatedValue(document.cookie, name)\n}\nvar initCookieParsed\n/**\n * Returns a cached value of the cookie. Use this during SDK initialization (and whenever possible)\n * to avoid accessing document.cookie multiple times.\n */\nexport function getInitCookie(name) {\n if (!initCookieParsed) {\n initCookieParsed = findCommaSeparatedValues(document.cookie)\n }\n return initCookieParsed.get(name)\n}\n\nexport function resetInitCookies() {\n initCookieParsed = undefined\n}\nexport function deleteCookie(name, options) {\n setCookie(name, '', 0, options)\n}\n\nexport function areCookiesAuthorized(options) {\n if (document.cookie === undefined || document.cookie === null) {\n return false\n }\n try {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = `gc_cookie_test_${UUID()}`\n var testCookieValue = 'test'\n setCookie(testCookieName, testCookieValue, ONE_SECOND, options)\n return getCookie(testCookieName) === testCookieValue\n } catch (error) {\n return false\n }\n}\n\n/**\n * No API to retrieve it, number of levels for subdomain and suffix are unknown\n * strategy: find the minimal domain on which cookies are allowed to be set\n * https://web.dev/same-site-same-origin/#site\n */\nvar getCurrentSiteCache\nexport function getCurrentSite() {\n if (getCurrentSiteCache === undefined) {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = `gc_site_test_${UUID()}`\n var testCookieValue = 'test'\n\n var domainLevels = window.location.hostname.split('.')\n var candidateDomain = domainLevels.pop()\n while (domainLevels.length && !getCookie(testCookieName)) {\n candidateDomain = domainLevels.pop() + '.' + candidateDomain\n setCookie(testCookieName, testCookieValue, ONE_SECOND, {\n domain: candidateDomain\n })\n }\n getCurrentSiteCache = candidateDomain\n }\n return getCurrentSiteCache\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMO,IAAIC,mBAAmB,GAAGC,iBAAU;AAAAC,OAAA,CAAAF,mBAAA,GAAAA,mBAAA;AAEpC,SAASG,SAASA,CAACC,IAAI,EAAEC,KAAK,EAAEC,WAAW,EAAEC,OAAO,EAAE;EAC3D,IAAIC,IAAI,GAAG,IAAIC,IAAI,CAAC,CAAC;EACrBD,IAAI,CAACE,OAAO,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,GAAGL,WAAW,CAAC;EAC1C,IAAIM,OAAO,GAAG,UAAU,GAAGJ,IAAI,CAACK,WAAW,CAAC,CAAC;EAC7C,IAAIC,QAAQ,GAAGP,OAAO,IAAIA,OAAO,CAACQ,SAAS,GAAG,MAAM,GAAG,QAAQ;EAC/D,IAAIC,MAAM,GAAGT,OAAO,IAAIA,OAAO,CAACS,MAAM,GAAG,UAAU,GAAGT,OAAO,CAACS,MAAM,GAAG,EAAE;EACzE,IAAIC,MAAM,GAAGV,OAAO,IAAIA,OAAO,CAACU,MAAM,GAAG,SAAS,GAAG,EAAE;EACvD,IAAIC,WAAW,GAAGX,OAAO,IAAIA,OAAO,CAACW,WAAW,GAAG,cAAc,GAAG,EAAE;EACtEC,QAAQ,CAACC,MAAM,GACbhB,IAAI,GACJ,GAAG,GACHC,KAAK,GACL,GAAG,GACHO,OAAO,GACP,mBAAmB,GACnBE,QAAQ,GACRE,MAAM,GACNC,MAAM,GACNC,WAAW;AACf;AAEO,SAASG,SAASA,CAACjB,IAAI,EAA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,MAAM;IAE5B,IAAII,YAAY,GAAGC,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC;IACtD,IAAIC,eAAe,GAAGL,YAAY,CAACM,GAAG,CAAC,CAAC;IACxC,OAAON,YAAY,CAACO,MAAM,IAAI,CAACxB,SAAS,CAACU,cAAc,CAAC,EAAE;MACxDY,eAAe,GAAGL,YAAY,CAACM,GAAG,CAAC,CAAC,GAAG,GAAG,GAAGD,eAAe;MAC5DxC,SAAS,CAAC4B,cAAc,EAAEG,eAAe,EAAEjC,iBAAU,EAAE;QACrDe,MAAM,EAAE2B;MACV,CAAC,CAAC;IACJ;IACAP,mBAAmB,GAAGO,eAAe;EACvC;EACA,OAAOP,mBAAmB;AAC5B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"fetchObservable.js","names":["_instrumentMethod","require","_observable","_tools","_monitor","_urlPolyfill","fetchObservable","initFetchObservable","createFetchObservable","Observable","observable","window","fetch","fetchMethod","instrumentMethod","originalFetch","input","init","responsePromise","context","callMonitored","beforeSend","call","afterSend","stop","methodFromParams","method","undefined","Request","String","toUpperCase","url","normalizeUrl","startClocks","clocksNow","state","notify","startContext","reportFetch","response","Error","status","isAborted","DOMException","code","ABORT_ERR","error","responseType","constructor","Response","type","err","then","monitor"],"sources":["../../src/browser/fetchObservable.js"],"sourcesContent":["import { instrumentMethod } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { clocksNow } from '../helper/tools'\nimport { monitor, callMonitored } from '../helper/monitor'\nimport { normalizeUrl } from '../helper/urlPolyfill'\n\nvar fetchObservable\n\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable()\n }\n return fetchObservable\n}\n\nfunction createFetchObservable() {\n return new Observable(function (observable) {\n if (!window.fetch) {\n return\n }\n\n var fetchMethod = instrumentMethod(\n window,\n 'fetch',\n function (originalFetch) {\n return function (input, init) {\n var responsePromise\n var context = callMonitored(beforeSend, null, [\n observable,\n input,\n init\n ])\n if (context) {\n responsePromise = originalFetch.call(\n this,\n context.input,\n context.init\n )\n callMonitored(afterSend, null, [\n observable,\n responsePromise,\n context\n ])\n } else {\n responsePromise = originalFetch.call(this, input, init)\n }\n return responsePromise\n }\n }\n )\n return fetchMethod.stop\n })\n}\n\nfunction beforeSend(observable, input, init) {\n // var method =\n // (init && init.method) || (input instanceof Request && input.method) || 'GET'\n // const methodFromParams =\n // (init && init.method) || (input instanceof Request && input.method)\n // const method = methodFromParams ? methodFromParams.toUpperCase() : 'GET'\n var methodFromParams = init && init.method\n\n if (methodFromParams === undefined && input instanceof Request) {\n methodFromParams = input.method\n }\n\n var method =\n methodFromParams !== undefined\n ? String(methodFromParams).toUpperCase()\n : 'GET'\n var url = input instanceof Request ? input.url : normalizeUrl(String(input))\n\n var startClocks = clocksNow()\n\n var context = {\n state: 'start',\n init: init,\n input: input,\n method: method,\n startClocks: startClocks,\n url: url\n }\n\n observable.notify(context)\n\n return context\n}\n\nfunction afterSend(observable, responsePromise, startContext) {\n var reportFetch = function (response) {\n var context = startContext\n context.state = 'resolve'\n // context.duration = elapsed(context.startClocks.timeStamp, timeStampNow())\n if ('stack' in response || response instanceof Error) {\n context.status = 0\n context.isAborted =\n response instanceof DOMException &&\n response.code === DOMException.ABORT_ERR\n context.error = response\n } else if ('status' in response) {\n context.response = response\n try {\n context.responseType =\n (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response\n } catch (err) {\n context.responseType = ''\n }\n\n context.status = response.status\n context.isAborted = false\n }\n observable.notify(context)\n }\n responsePromise.then(monitor(reportFetch), monitor(reportFetch))\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAIK,eAAe;AAEZ,SAASC,mBAAmBA,C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AE,EAAC;MAC/D,CAAC,CAAC,OAAOC,GAAG,EAAE;QACZhC,OAAO,CAAC4B,YAAY,GAAG,EAAE;MAC3B;MAEA5B,OAAO,CAACsB,MAAM,GAAGF,QAAQ,CAACE,MAAM;MAChCtB,OAAO,CAACuB,SAAS,GAAG,KAAK;IAC3B;IACAhC,UAAU,CAAC0B,MAAM,CAACjB,OAAO,CAAC;EAC5B,CAAC;EACDD,eAAe,CAACkC,IAAI,CAAC,IAAAC,gBAAO,EAACf,WAAW,CAAC,EAAE,IAAAe,gBAAO,EAACf,WAAW,CAAC,CAAC;AAClE"}
1
+ {"version":3,"file":"fetchObservable.js","names":["_instrumentMethod","require","_observable","_tools","_monitor","_urlPolyfill","fetchObservable","initFetchObservable","createFetchObservable","Observable","observable","window","fetch","fetchMethod","instrumentMethod","originalFetch","input","init","responsePromise","context","callMonitored","beforeSend","call","afterSend","stop","methodFromParams","method","undefined","Request","String","toUpperCase","url","normalizeUrl","startClocks","clocksNow","state","notify","startContext","reportFetch","response","Error","status","isAborted","DOMException","code","ABORT_ERR","error","responseType","constructor","Response","type","err","then","monitor"],"sources":["../../src/browser/fetchObservable.js"],"sourcesContent":["import { instrumentMethod } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { clocksNow } from '../helper/tools'\nimport { monitor, callMonitored } from '../helper/monitor'\nimport { normalizeUrl } from '../helper/urlPolyfill'\n\nvar fetchObservable\n\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable()\n }\n return fetchObservable\n}\n\nfunction createFetchObservable() {\n return new Observable(function (observable) {\n if (!window.fetch) {\n return\n }\n\n var fetchMethod = instrumentMethod(\n window,\n 'fetch',\n function (originalFetch) {\n return function (input, init) {\n var responsePromise\n var context = callMonitored(beforeSend, null, [\n observable,\n input,\n init\n ])\n if (context) {\n responsePromise = originalFetch.call(\n this,\n context.input,\n context.init\n )\n callMonitored(afterSend, null, [\n observable,\n responsePromise,\n context\n ])\n } else {\n responsePromise = originalFetch.call(this, input, init)\n }\n return responsePromise\n }\n }\n )\n return fetchMethod.stop\n })\n}\n\nfunction beforeSend(observable, input, init) {\n // var method =\n // (init && init.method) || (input instanceof Request && input.method) || 'GET'\n // const methodFromParams =\n // (init && init.method) || (input instanceof Request && input.method)\n // const method = methodFromParams ? methodFromParams.toUpperCase() : 'GET'\n var methodFromParams = init && init.method\n\n if (methodFromParams === undefined && input instanceof Request) {\n methodFromParams = input.method\n }\n\n var method =\n methodFromParams !== undefined\n ? String(methodFromParams).toUpperCase()\n : 'GET'\n var url = input instanceof Request ? input.url : normalizeUrl(String(input))\n\n var startClocks = clocksNow()\n\n var context = {\n state: 'start',\n init: init,\n input: input,\n method: method,\n startClocks: startClocks,\n url: url\n }\n\n observable.notify(context)\n\n return context\n}\n\nfunction afterSend(observable, responsePromise, startContext) {\n var reportFetch = function (response) {\n var context = startContext\n context.state = 'resolve'\n // context.duration = elapsed(context.startClocks.timeStamp, timeStampNow())\n if ('stack' in response || response instanceof Error) {\n context.status = 0\n context.isAborted =\n response instanceof DOMException &&\n response.code === DOMException.ABORT_ERR\n context.error = response\n } else if ('status' in response) {\n context.response = response\n try {\n context.responseType =\n (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response\n } catch (err) {\n context.responseType = ''\n }\n\n context.status = response.status\n context.isAborted = false\n }\n observable.notify(context)\n }\n responsePromise.then(monitor(reportFetch), monitor(reportFetch))\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAIK,eAAe;AAEZ,SAASC,mBAAmBA,CAAA,EAAG;EACpC,IAAI,CAACD,eAAe,EAAE;IACpBA,eAAe,GAAGE,qBAAqB,CAAC,CAAC;EAC3C;EACA,OAAOF,eAAe;AACxB;AAEA,SAASE,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AGF,QAAQ,CAACE,MAAM;MAChCtB,OAAO,CAACuB,SAAS,GAAG,KAAK;IAC3B;IACAhC,UAAU,CAAC0B,MAAM,CAACjB,OAAO,CAAC;EAC5B,CAAC;EACDD,eAAe,CAACkC,IAAI,CAAC,IAAAC,gBAAO,EAACf,WAAW,CAAC,EAAE,IAAAe,gBAAO,EAACf,WAAW,CAAC,CAAC;AAClE","ignoreList":[]}
@@ -34,7 +34,12 @@ function hasChildNodes(node) {
34
34
  // return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes
35
35
  // }
36
36
  function forEachChildNodes(node, callback) {
37
- node.childNodes.forEach(callback);
37
+ // node.childNodes.forEach(callback)
38
+ var child = node.firstChild;
39
+ while (child) {
40
+ callback(child);
41
+ child = child.nextSibling;
42
+ }
38
43
  if (isNodeShadowHost(node)) {
39
44
  callback(node.shadowRoot);
40
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"htmlDomUtils.js","names":["isTextNode","node","nodeType","Node","TEXT_NODE","isCommentNode","COMMENT_NODE","isElementNode","ELEMENT_NODE","isNodeShadowHost","Boolean","shadowRoot","isNodeShadowRoot","host","DOCUMENT_FRAGMENT_NODE","hasChildNodes","childNodes","length","forEachChildNodes","callback","forEach","getParentNode","parentNode"],"sources":["../../src/browser/htmlDomUtils.js"],"sourcesContent":["export function isTextNode(node) {\n return node.nodeType === Node.TEXT_NODE\n}\n\nexport function isCommentNode(node) {\n return node.nodeType === Node.COMMENT_NODE\n}\n\nexport function isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE\n}\n\nexport function isNodeShadowHost(node) {\n return isElementNode(node) && Boolean(node.shadowRoot)\n}\n\nexport function isNodeShadowRoot(node) {\n var shadowRoot = node\n return (\n !!shadowRoot.host &&\n shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n isElementNode(shadowRoot.host)\n )\n}\nexport function hasChildNodes(node) {\n return node.childNodes.length > 0 || isNodeShadowHost(node)\n}\n// export function getChildNodes(node) {\n// return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes\n// }\nexport function forEachChildNodes(node, callback) {\n node.childNodes.forEach(callback)\n if (isNodeShadowHost(node)) {\n callback(node.shadowRoot)\n }\n}\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node) {\n return isNodeShadowRoot(node) ? node.host : node.parentNode\n}\n"],"mappings":";;;;;;;;;;;;;AAAO,SAASA,UAAUA,CAACC,IAAI,EAAE;EAC/B,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACC,SAAS;AACzC;AAEO,SAASC,aAAaA,CAACJ,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACG,YAAY;AAC5C;AAEO,SAASC,aAAaA,CAACN,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACK,YAAY;AAC5C;AAEO,SAASC,gBAAgBA,CAACR,IAAI,EAAE;EACrC,OAAOM,aAAa,CAACN,IAAI,CAAC,IAAIS,OAAO,CAACT,IAAI,CAACU,UAAU,CAAC;AACxD;AAEO,SAASC,gBAAgBA,CAACX,IAAI,EAAE;EACrC,IAAIU,UAAU,GAAGV,IAAI;EACrB,OACE,CAAC,CAACU,UAAU,CAACE,IAAI,IACjBF,UAAU,CAACT,QAAQ,KAAKC,IAAI,CAACW,sBAAsB,IACnDP,aAAa,CAACI,UAAU,CAACE,IAAI,CAAC;AAElC;AACO,SAASE,aAAaA,CAACd,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACe,UAAU,CAACC,MAAM,GAAG,CAAC,IAAIR,gBAAgB,CAACR,IAAI,CAAC;AAC7D;AACA;AACA;AACA;AACO,SAASiB,iBAAiBA,CAACjB,IAAI,EAAEkB,QAAQ,EAAE;EAChDlB,IAAI,CAACe,UAAU,CAACI,OAAO,CAACD,QAAQ,CAAC;EACjC,IAAIV,gBAAgB,CAACR,IAAI,CAAC,EAAE;IAC1BkB,QAAQ,CAAClB,IAAI,CAACU,UAAU,CAAC;EAC3B;AACF;AACA;AACA;AACA;AACO,SAASU,aAAaA,CAACpB,IAAI,EAAE;EAClC,OAAOW,gBAAgB,CAACX,IAAI,CAAC,GAAGA,IAAI,CAACY,IAAI,GAAGZ,IAAI,CAACqB,UAAU;AAC7D"}
1
+ {"version":3,"file":"htmlDomUtils.js","names":["isTextNode","node","nodeType","Node","TEXT_NODE","isCommentNode","COMMENT_NODE","isElementNode","ELEMENT_NODE","isNodeShadowHost","Boolean","shadowRoot","isNodeShadowRoot","host","DOCUMENT_FRAGMENT_NODE","hasChildNodes","childNodes","length","forEachChildNodes","callback","child","firstChild","nextSibling","getParentNode","parentNode"],"sources":["../../src/browser/htmlDomUtils.js"],"sourcesContent":["export function isTextNode(node) {\n return node.nodeType === Node.TEXT_NODE\n}\n\nexport function isCommentNode(node) {\n return node.nodeType === Node.COMMENT_NODE\n}\n\nexport function isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE\n}\n\nexport function isNodeShadowHost(node) {\n return isElementNode(node) && Boolean(node.shadowRoot)\n}\n\nexport function isNodeShadowRoot(node) {\n var shadowRoot = node\n return (\n !!shadowRoot.host &&\n shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n isElementNode(shadowRoot.host)\n )\n}\nexport function hasChildNodes(node) {\n return node.childNodes.length > 0 || isNodeShadowHost(node)\n}\n// export function getChildNodes(node) {\n// return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes\n// }\nexport function forEachChildNodes(node, callback) {\n // node.childNodes.forEach(callback)\n var child = node.firstChild\n\n while (child) {\n callback(child)\n child = child.nextSibling\n }\n if (isNodeShadowHost(node)) {\n callback(node.shadowRoot)\n }\n}\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node) {\n return isNodeShadowRoot(node) ? node.host : node.parentNode\n}\n"],"mappings":";;;;;;;;;;;;;AAAO,SAASA,UAAUA,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UAAU;AAC7D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"pageExitObservable.js","names":["_observable","require","_tools","_enums","_addEventListener","PageExitReason","HIDDEN","UNLOADING","PAGEHIDE","FROZEN","exports","createPageExitObservable","Observable","observable","visibilityChangeListener","addEventListeners","document","DOM_EVENT","VISIBILITY_CHANGE","FREEZE","PAGE_HIDE","event","type","visibilityState","notify","reason","capture","beforeUnloadListener","addEventListener","window","BEFORE_UNLOAD","stop","isPageExitReason","includes","values"],"sources":["../../src/browser/pageExitObservable.js"],"sourcesContent":["import { Observable } from '../helper/observable'\nimport { includes, values } from '../helper/tools'\nimport { DOM_EVENT } from '../helper/enums'\nimport {\n addEventListener,\n addEventListeners\n} from '../browser/addEventListener'\nexport var PageExitReason = {\n HIDDEN: 'visibility_hidden',\n UNLOADING: 'before_unload',\n PAGEHIDE: 'page_hide',\n FROZEN: 'page_frozen'\n}\n\nexport function createPageExitObservable() {\n return new Observable(function (observable) {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n var visibilityChangeListener = addEventListeners(\n document,\n [DOM_EVENT.VISIBILITY_CHANGE, DOM_EVENT.FREEZE, DOM_EVENT.PAGE_HIDE],\n function (event) {\n if (\n event.type === DOM_EVENT.VISIBILITY_CHANGE &&\n document.visibilityState === 'hidden'\n ) {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n observable.notify({ reason: PageExitReason.HIDDEN })\n } else if (event.type === DOM_EVENT.FREEZE) {\n /**\n * After transitioning in background a tab can be freezed to preserve resources. (cf: https://developer.chrome.com/blog/page-lifecycle-api)\n * Allow to collect events happening between hidden and frozen state.\n */\n observable.notify({ reason: PageExitReason.FROZEN })\n }\n },\n { capture: true }\n )\n\n /**\n * Safari does not support yet to send a request during:\n * - a visibility change during doc unload (cf: https://bugs.webkit.org/show_bug.cgi?id=194897)\n * - a page hide transition (cf: https://bugs.webkit.org/show_bug.cgi?id=188329)\n */\n var beforeUnloadListener = addEventListener(\n window,\n DOM_EVENT.BEFORE_UNLOAD,\n function () {\n observable.notify({ reason: PageExitReason.UNLOADING })\n }\n )\n\n return function () {\n visibilityChangeListener.stop()\n beforeUnloadListener.stop()\n }\n })\n}\n\nexport function isPageExitReason(reason) {\n return includes(values(PageExitReason), reason)\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAIO,IAAII,cAAc,GAAG;EAC1BC,MAAM,EAAE,mBAAmB;EAC3BC,SAAS,EAAE,eAAe;EAC1BC,QAAQ,EAAE,WAAW;EACrBC,MAAM,EAAE;AACV,CAAC;AAAAC,OAAA,CAAAL,cAAA,GAAAA,cAAA;AAEM,SAASM,wBAAwBA,CAAA,EAAG;EACzC,OAAO,IAAIC,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C;AACJ;AACA;AACA;IACI,IAAIC,wBAAwB,GAAG,IAAAC,mCAAiB,EAC9CC,QAAQ,EACR,CAACC,gBAAS,CAACC,iBAAiB,EAAED,gBAAS,CAACE,MAAM,EAAEF,gBAAS,CAACG,SAAS,CAAC,EACpE,UAAUC,KAAK,EAAE;MACf,IACEA,KAAK,CAACC,IAAI,KAAKL,gBAAS,CAACC,iBAAiB,IAC1CF,QAAQ,CAACO,eAAe,KAAK,QAAQ,EACrC;QACA;AACV;AACA;AACA;QACUV,UAAU,CAACW,MAAM,CAAC;UAAEC,MAAM,EAAEpB,cAAc,CAACC;QAAO,CAAC,CAAC;MACtD,CAAC,MAAM,IAAIe,KAAK,CAACC,IAAI,KAAKL,gBAAS,CAACE,MAAM,EAAE;QAC1C;AACV;AACA;AACA;QACUN,UAAU,CAACW,MAAM,CAAC;UAAEC,MAAM,EAAEpB,cAAc,CAACI;QAAO,CAAC,CAAC;MACtD;IACF,CAAC,EACD;MAAEiB,OAAO,EAAE;IAAK,CAClB,CAAC;;IAED;AACJ;AACA;AACA;AACA;IACI,IAAIC,oBAAoB,GAAG,IAAAC,kCAAgB,EACzCC,MAAM,EACNZ,gBAAS,CAACa,aAAa,EACvB,YAAY;MACVjB,UAAU,CAACW,MAAM,CAAC;QAAEC,MAAM,EAAEpB,cAAc,CAACE;MAAU,CAAC,CAAC;IACzD,CACF,CAAC;IAED,OAAO,YAAY;MACjBO,wBAAwB,CAACiB,IAAI,CAAC,CAAC;MAC/BJ,oBAAoB,CAACI,IAAI,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,CAAC;AACJ;AAEO,SAASC,gBAAgBA,CAACP,MAAM,EAAE;EACvC,OAAO,IAAAQ,eAAQ,EAAC,IAAAC,aAAM,EAAC7B,cAAc,CAAC,EAAEoB,MAAM,CAAC;AACjD"}
1
+ {"version":3,"file":"pageExitObservable.js","names":["_observable","require","_tools","_enums","_addEventListener","PageExitReason","HIDDEN","UNLOADING","PAGEHIDE","FROZEN","exports","createPageExitObservable","Observable","observable","visibilityChangeListener","addEventListeners","document","DOM_EVENT","VISIBILITY_CHANGE","FREEZE","PAGE_HIDE","event","type","visibilityState","notify","reason","capture","beforeUnloadListener","addEventListener","window","BEFORE_UNLOAD","stop","isPageExitReason","includes","values"],"sources":["../../src/browser/pageExitObservable.js"],"sourcesContent":["import { Observable } from '../helper/observable'\nimport { includes, values } from '../helper/tools'\nimport { DOM_EVENT } from '../helper/enums'\nimport {\n addEventListener,\n addEventListeners\n} from '../browser/addEventListener'\nexport var PageExitReason = {\n HIDDEN: 'visibility_hidden',\n UNLOADING: 'before_unload',\n PAGEHIDE: 'page_hide',\n FROZEN: 'page_frozen'\n}\n\nexport function createPageExitObservable() {\n return new Observable(function (observable) {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n var visibilityChangeListener = addEventListeners(\n document,\n [DOM_EVENT.VISIBILITY_CHANGE, DOM_EVENT.FREEZE, DOM_EVENT.PAGE_HIDE],\n function (event) {\n if (\n event.type === DOM_EVENT.VISIBILITY_CHANGE &&\n document.visibilityState === 'hidden'\n ) {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n observable.notify({ reason: PageExitReason.HIDDEN })\n } else if (event.type === DOM_EVENT.FREEZE) {\n /**\n * After transitioning in background a tab can be freezed to preserve resources. (cf: https://developer.chrome.com/blog/page-lifecycle-api)\n * Allow to collect events happening between hidden and frozen state.\n */\n observable.notify({ reason: PageExitReason.FROZEN })\n }\n },\n { capture: true }\n )\n\n /**\n * Safari does not support yet to send a request during:\n * - a visibility change during doc unload (cf: https://bugs.webkit.org/show_bug.cgi?id=194897)\n * - a page hide transition (cf: https://bugs.webkit.org/show_bug.cgi?id=188329)\n */\n var beforeUnloadListener = addEventListener(\n window,\n DOM_EVENT.BEFORE_UNLOAD,\n function () {\n observable.notify({ reason: PageExitReason.UNLOADING })\n }\n )\n\n return function () {\n visibilityChangeListener.stop()\n beforeUnloadListener.stop()\n }\n })\n}\n\nexport function isPageExitReason(reason) {\n return includes(values(PageExitReason), reason)\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAIO,IAAII,cAAc,GAAG;EAC1BC,MAAM,EAAE,mBAAmB;EAC3BC,SAAS,EAAE,eAAe;EAC1BC,QAAQ,EAAE,WAAW;EACrBC,MAAM,EAAE;AACV,CAAC;AAAAC,OAAA,CAAAL,cAAA,GAAAA,cAAA;AAEM,SAASM,wBAAwBA,CAAA,EAAG;EACzC,OAAO,IAAIC,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C;AACJ;AACA;AACA;IACI,IAAIC,wBAAwB,GAAG,IAAAC,mCAAiB,EAC9CC,QAAQ,EACR,CAACC,gBAAS,CAACC,iBAAiB,EAAED,gBAAS,CAACE,MAAM,EAAEF,gBAAS,CAACG,SAAS,CAAC,EACpE,UAAUC,KAAK,EAAE;MACf,IACEA,KAAK,CAACC,IAAI,KAAKL,gBAAS,CAACC,iBAAiB,IAC1CF,QAAQ,CAACO,eAAe,KAAK,QAAQ,EACrC;QACA;AACV;AACA;AACA;QACUV,UAAU,CAACW,MAAM,CAAC;UAAEC,MAAM,EAAEpB,cAAc,CAACC;QAAO,CAAC,CAAC;MACtD,CAAC,MAAM,IAAIe,KAAK,CAACC,IAAI,KAAKL,gBAAS,CAACE,MAAM,EAAE;QAC1C;AACV;AACA;AACA;QACUN,UAAU,CAACW,MAAM,CAAC;UAAEC,MAAM,EAAEpB,cAAc,CAACI;QAAO,CAAC,CAAC;MACtD;IACF,CAAC,EACD;MAAEiB,OAAO,EAAE;IAAK,CAClB,CAAC;;IAED;AACJ;AACA;AACA;AACA;IACI,IAAIC,oBAAoB,GAAG,IAAAC,kCAAgB,EACzCC,MAAM,EACNZ,gBAAS,CAACa,aAAa,EACvB,YAAY;MACVjB,UAAU,CAACW,MAAM,CAAC;QAAEC,MAAM,EAAEpB,cAAc,CAACE;MAAU,CAAC,CAAC;IACzD,CACF,CAAC;IAED,OAAO,YAAY;MACjBO,wBAAwB,CAACiB,IAAI,CAAC,CAAC;MAC/BJ,oBAAoB,CAACI,IAAI,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,CAAC;AACJ;AAEO,SAASC,gBAAgBA,CAACP,MAAM,EAAE;EACvC,OAAO,IAAAQ,eAAQ,EAAC,IAAAC,aAAM,EAAC7B,cAAc,CAAC,EAAEoB,MAAM,CAAC;AACjD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"runOnReadyState.js","names":["_addEventListener","require","_enums","runOnReadyState","expectedReadyState","callback","document","readyState","eventName","DOM_EVENT","LOAD","DOM_CONTENT_LOADED","addEventListener","window","once"],"sources":["../../src/browser/runOnReadyState.js"],"sourcesContent":["import { addEventListener } from './addEventListener'\nimport { DOM_EVENT } from '../helper/enums'\nexport function runOnReadyState(expectedReadyState, callback) {\n if (\n document.readyState === expectedReadyState ||\n document.readyState === 'complete'\n ) {\n callback()\n } else {\n var eventName =\n expectedReadyState === 'complete'\n ? DOM_EVENT.LOAD\n : DOM_EVENT.DOM_CONTENT_LOADED\n addEventListener(window, eventName, callback, { once: true })\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACO,SAASE,eAAeA,CAACC,kBAAkB,EAAEC,QAAQ,EAAE;EAC5D,IACEC,QAAQ,CAACC,UAAU,KAAKH,kBAAkB,IAC1CE,QAAQ,CAACC,UAAU,KAAK,UAAU,EAClC;IACAF,QAAQ,CAAC,CAAC;EACZ,CAAC,MAAM;IACL,IAAIG,SAAS,GACXJ,kBAAkB,KAAK,UAAU,GAC7BK,gBAAS,CAACC,IAAI,GACdD,gBAAS,CAACE,kBAAkB;IAClC,IAAAC,kCAAgB,EAACC,MAAM,EAAEL,SAAS,EAAEH,QAAQ,EAAE;MAAES,IAAI,EAAE;IAAK,CAAC,CAAC;EAC/D;AACF"}
1
+ {"version":3,"file":"runOnReadyState.js","names":["_addEventListener","require","_enums","runOnReadyState","expectedReadyState","callback","document","readyState","eventName","DOM_EVENT","LOAD","DOM_CONTENT_LOADED","addEventListener","window","once"],"sources":["../../src/browser/runOnReadyState.js"],"sourcesContent":["import { addEventListener } from './addEventListener'\nimport { DOM_EVENT } from '../helper/enums'\nexport function runOnReadyState(expectedReadyState, callback) {\n if (\n document.readyState === expectedReadyState ||\n document.readyState === 'complete'\n ) {\n callback()\n } else {\n var eventName =\n expectedReadyState === 'complete'\n ? DOM_EVENT.LOAD\n : DOM_EVENT.DOM_CONTENT_LOADED\n addEventListener(window, eventName, callback, { once: true })\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACO,SAASE,eAAeA,CAACC,kBAAkB,EAAEC,QAAQ,EAAE;EAC5D,IACEC,QAAQ,CAACC,UAAU,KAAKH,kBAAkB,IAC1CE,QAAQ,CAACC,UAAU,KAAK,UAAU,EAClC;IACAF,QAAQ,CAAC,CAAC;EACZ,CAAC,MAAM;IACL,IAAIG,SAAS,GACXJ,kBAAkB,KAAK,UAAU,GAC7BK,gBAAS,CAACC,IAAI,GACdD,gBAAS,CAACE,kBAAkB;IAClC,IAAAC,kCAAgB,EAACC,MAAM,EAAEL,SAAS,EAAEH,QAAQ,EAAE;MAAES,IAAI,EAAE;IAAK,CAAC,CAAC;EAC/D;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.js","names":["getScrollX","scrollX","visual","window","visualViewport","pageLeft","offsetLeft","undefined","pageXOffset","Math","round","getScrollY","scrollY","pageTop","offsetTop","pageYOffset"],"sources":["../../src/browser/scroll.js"],"sourcesContent":["export function getScrollX() {\n var scrollX\n var visual = window.visualViewport\n if (visual) {\n scrollX = visual.pageLeft - visual.offsetLeft\n } else if (window.scrollX !== undefined) {\n scrollX = window.scrollX\n } else {\n scrollX = window.pageXOffset || 0\n }\n return Math.round(scrollX)\n}\n\nexport function getScrollY() {\n var scrollY\n var visual = window.visualViewport\n if (visual) {\n scrollY = visual.pageTop - visual.offsetTop\n } else if (window.scrollY !== undefined) {\n scrollY = window.scrollY\n } else {\n scrollY = window.pageYOffset || 0\n }\n return Math.round(scrollY)\n}\n"],"mappings":";;;;;;;AAAO,SAASA,UAAUA,CAAA,EAAG;EAC3B,IAAIC,OAAO;EACX,IAAIC,MAAM,GAAGC,MAAM,CAACC,cAAc;EAClC,IAAIF,MAAM,EAAE;IACVD,OAAO,GAAGC,MAAM,CAACG,QAAQ,GAAGH,MAAM,CAACI,UAAU;EAC/C,CAAC,MAAM,IAAIH,MAAM,CAACF,OAAO,KAAKM,SAAS,EAAE;IACvCN,OAAO,GAAGE,MAAM,CAACF,OAAO;EAC1B,CAAC,MAAM;IACLA,OAAO,GAAGE,MAAM,CAACK,WAAW,IAAI,CAAC;EACnC;EACA,OAAOC,IAAI,CAACC,KAAK,CAACT,OAAO,CAAC;AAC5B;AAEO,SAASU,UAAUA,CAAA,EAAG;EAC3B,IAAIC,OAAO;EACX,IAAIV,MAAM,GAAGC,MAAM,CAACC,cAAc;EAClC,IAAIF,MAAM,EAAE;IACVU,OAAO,GAAGV,MAAM,CAACW,OAAO,GAAGX,MAAM,CAACY,SAAS;EAC7C,CAAC,MAAM,IAAIX,MAAM,CAACS,OAAO,KAAKL,SAAS,EAAE;IACvCK,OAAO,GAAGT,MAAM,CAACS,OAAO;EAC1B,CAAC,MAAM;IACLA,OAAO,GAAGT,MAAM,CAACY,WAAW,IAAI,CAAC;EACnC;EACA,OAAON,IAAI,CAACC,KAAK,CAACE,OAAO,CAAC;AAC5B"}
1
+ {"version":3,"file":"scroll.js","names":["getScrollX","scrollX","visual","window","visualViewport","pageLeft","offsetLeft","undefined","pageXOffset","Math","round","getScrollY","scrollY","pageTop","offsetTop","pageYOffset"],"sources":["../../src/browser/scroll.js"],"sourcesContent":["export function getScrollX() {\n var scrollX\n var visual = window.visualViewport\n if (visual) {\n scrollX = visual.pageLeft - visual.offsetLeft\n } else if (window.scrollX !== undefined) {\n scrollX = window.scrollX\n } else {\n scrollX = window.pageXOffset || 0\n }\n return Math.round(scrollX)\n}\n\nexport function getScrollY() {\n var scrollY\n var visual = window.visualViewport\n if (visual) {\n scrollY = visual.pageTop - visual.offsetTop\n } else if (window.scrollY !== undefined) {\n scrollY = window.scrollY\n } else {\n scrollY = window.pageYOffset || 0\n }\n return Math.round(scrollY)\n}\n"],"mappings":";;;;;;;AAAO,SAASA,UAAUA,CAAA,EAAG;EAC3B,IAAIC,OAAO;EACX,IAAIC,MAAM,GAAGC,MAAM,CAACC,cAAc;EAClC,IAAIF,MAAM,EAAE;IACVD,OAAO,GAAGC,MAAM,CAACG,QAAQ,GAAGH,MAAM,CAACI,UAAU;EAC/C,CAAC,MAAM,IAAIH,MAAM,CAACF,OAAO,KAAKM,SAAS,EAAE;IACvCN,OAAO,GAAGE,MAAM,CAACF,OAAO;EAC1B,CAAC,MAAM;IACLA,OAAO,GAAGE,MAAM,CAACK,WAAW,IAAI,CAAC;EACnC;EACA,OAAOC,IAAI,CAACC,KAAK,CAACT,OAAO,CAAC;AAC5B;AAEO,SAASU,UAAUA,CAAA,EAAG;EAC3B,IAAIC,OAAO;EACX,IAAIV,MAAM,GAAGC,MAAM,CAACC,cAAc;EAClC,IAAIF,MAAM,EAAE;IACVU,OAAO,GAAGV,MAAM,CAACW,OAAO,GAAGX,MAAM,CAACY,SAAS;EAC7C,CAAC,MAAM,IAAIX,MAAM,CAACS,OAAO,KAAKL,SAAS,EAAE;IACvCK,OAAO,GAAGT,MAAM,CAACS,OAAO;EAC1B,CAAC,MAAM;IACLA,OAAO,GAAGT,MAAM,CAACY,WAAW,IAAI,CAAC;EACnC;EACA,OAAON,IAAI,CAACC,KAAK,CAACE,OAAO,CAAC;AAC5B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"xhrObservable.js","names":["_instrumentMethod","require","_observable","_urlPolyfill","_tools","_addEventListener","xhrObservable","xhrContexts","DATA_FLUX_REQUEST_ID_KEY","initXhrObservable","createXhrObservable","Observable","observable","openInstrumentMethod","instrumentMethodAndCallOriginal","XMLHttpRequest","prototype","before","openXhr","sendInstrumentMethod","sendXhr","call","abortInstrumentMethod","abortXhr","stop","method","url","requestUUID","UUID","state","String","toUpperCase","normalizeUrl","context","startContext","startTime","relativeNow","startClocks","clocksNow","isAborted","xhr","hasBeenReported","stopInstrumentingOnReadyStateChange","readyState","DONE","onEnd","unsubscribeLoadEndListener","completeContext","duration","elapsed","timeStamp","timeStampNow","status","notify","shallowClone","clearRequestId","addEventListener"],"sources":["../../src/browser/xhrObservable.js"],"sourcesContent":["import { instrumentMethodAndCallOriginal } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { normalizeUrl } from '../helper/urlPolyfill'\nimport {\n shallowClone,\n elapsed,\n relativeNow,\n clocksNow,\n timeStampNow,\n UUID\n} from '../helper/tools'\nimport { addEventListener } from '../browser/addEventListener'\nvar xhrObservable\nvar xhrContexts = {}\nvar DATA_FLUX_REQUEST_ID_KEY = '_DATAFLUX_REQUEST_UUID'\nexport function initXhrObservable() {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable()\n }\n return xhrObservable\n}\n\nfunction createXhrObservable() {\n return new Observable(function (observable) {\n var openInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'open',\n {\n before: openXhr\n }\n )\n\n var sendInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'send',\n {\n before: function () {\n sendXhr.call(this, observable)\n }\n }\n )\n\n var abortInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'abort',\n {\n before: abortXhr\n }\n )\n\n return function () {\n openInstrumentMethod.stop()\n sendInstrumentMethod.stop()\n abortInstrumentMethod.stop()\n }\n })\n}\n\nfunction openXhr(method, url) {\n var requestUUID = this[DATA_FLUX_REQUEST_ID_KEY] || UUID()\n this[DATA_FLUX_REQUEST_ID_KEY] = requestUUID\n xhrContexts[requestUUID] = {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url))\n }\n}\n\nfunction sendXhr(observable) {\n var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n if (!context) {\n return\n }\n var startContext = context\n startContext.state = 'start'\n startContext.startTime = relativeNow()\n startContext.startClocks = clocksNow()\n startContext.isAborted = false\n startContext.xhr = this\n var hasBeenReported = false\n var stopInstrumentingOnReadyStateChange = instrumentMethodAndCallOriginal(\n this,\n 'onreadystatechange',\n {\n before: function () {\n if (this.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during a onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd.call(this)\n }\n }\n }\n ).stop\n\n var onEnd = function () {\n unsubscribeLoadEndListener()\n stopInstrumentingOnReadyStateChange()\n if (hasBeenReported) {\n return\n }\n hasBeenReported = true\n var completeContext = context\n completeContext.state = 'complete'\n completeContext.duration = elapsed(\n startContext.startClocks.timeStamp,\n timeStampNow()\n )\n completeContext.status = this.status\n observable.notify(shallowClone(completeContext))\n clearRequestId.call(this)\n }\n var unsubscribeLoadEndListener = addEventListener(this, 'loadend', onEnd).stop\n observable.notify(startContext)\n}\nfunction clearRequestId() {\n delete xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n delete this[DATA_FLUX_REQUEST_ID_KEY]\n}\nfunction abortXhr() {\n var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n if (context) {\n context.isAborted = true\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAQA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAIK,aAAa;AACjB,IAAIC,WAAW,GAAG,CAAC,CAAC;AACpB,IAAIC,wBAAwB,GAAG,wBAAwB;AAChD,SAASC,iBAAiBA,CAAA,EAAG;EAClC,IAAI,CAACH,aAAa,EAAE;IAClBA,aAAa,GAAGI,mBAAmB,CAAC,CAAC;EACvC;EACA,OAAOJ,aAAa;AACtB;AAEA,SAASI,mBAAmBA,CAAA,EAAG;EAC7B,OAAO,IAAIC,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C,IAAIC,oBAAoB,GAAG,IAAAC,iDAA+B,EACxDC,cAAc,CAACC,SAAS,EACxB,MAAM,EACN;MACEC,MAAM,EAAEC;IACV,C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AC;AACvC;AACA,SAASe,QAAQA,CAAA,EAAG;EAClB,IAAIU,OAAO,GAAG1B,WAAW,CAAC,IAAI,CAACC,wBAAwB,CAAC,CAAC;EACzD,IAAIyB,OAAO,EAAE;IACXA,OAAO,CAACM,SAAS,GAAG,IAAI;EAC1B;AACF"}
1
+ {"version":3,"file":"xhrObservable.js","names":["_instrumentMethod","require","_observable","_urlPolyfill","_tools","_addEventListener","xhrObservable","xhrContexts","DATA_FLUX_REQUEST_ID_KEY","initXhrObservable","createXhrObservable","Observable","observable","openInstrumentMethod","instrumentMethodAndCallOriginal","XMLHttpRequest","prototype","before","openXhr","sendInstrumentMethod","sendXhr","call","abortInstrumentMethod","abortXhr","stop","method","url","requestUUID","UUID","state","String","toUpperCase","normalizeUrl","context","startContext","startTime","relativeNow","startClocks","clocksNow","isAborted","xhr","hasBeenReported","stopInstrumentingOnReadyStateChange","readyState","DONE","onEnd","unsubscribeLoadEndListener","completeContext","duration","elapsed","timeStamp","timeStampNow","status","notify","shallowClone","clearRequestId","addEventListener"],"sources":["../../src/browser/xhrObservable.js"],"sourcesContent":["import { instrumentMethodAndCallOriginal } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { normalizeUrl } from '../helper/urlPolyfill'\nimport {\n shallowClone,\n elapsed,\n relativeNow,\n clocksNow,\n timeStampNow,\n UUID\n} from '../helper/tools'\nimport { addEventListener } from '../browser/addEventListener'\nvar xhrObservable\nvar xhrContexts = {}\nvar DATA_FLUX_REQUEST_ID_KEY = '_DATAFLUX_REQUEST_UUID'\nexport function initXhrObservable() {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable()\n }\n return xhrObservable\n}\n\nfunction createXhrObservable() {\n return new Observable(function (observable) {\n var openInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'open',\n {\n before: openXhr\n }\n )\n\n var sendInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'send',\n {\n before: function () {\n sendXhr.call(this, observable)\n }\n }\n )\n\n var abortInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'abort',\n {\n before: abortXhr\n }\n )\n\n return function () {\n openInstrumentMethod.stop()\n sendInstrumentMethod.stop()\n abortInstrumentMethod.stop()\n }\n })\n}\n\nfunction openXhr(method, url) {\n var requestUUID = this[DATA_FLUX_REQUEST_ID_KEY] || UUID()\n this[DATA_FLUX_REQUEST_ID_KEY] = requestUUID\n xhrContexts[requestUUID] = {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url))\n }\n}\n\nfunction sendXhr(observable) {\n var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n if (!context) {\n return\n }\n var startContext = context\n startContext.state = 'start'\n startContext.startTime = relativeNow()\n startContext.startClocks = clocksNow()\n startContext.isAborted = false\n startContext.xhr = this\n var hasBeenReported = false\n var stopInstrumentingOnReadyStateChange = instrumentMethodAndCallOriginal(\n this,\n 'onreadystatechange',\n {\n before: function () {\n if (this.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during a onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd.call(this)\n }\n }\n }\n ).stop\n\n var onEnd = function () {\n unsubscribeLoadEndListener()\n stopInstrumentingOnReadyStateChange()\n if (hasBeenReported) {\n return\n }\n hasBeenReported = true\n var completeContext = context\n completeContext.state = 'complete'\n completeContext.duration = elapsed(\n startContext.startClocks.timeStamp,\n timeStampNow()\n )\n completeContext.status = this.status\n observable.notify(shallowClone(completeContext))\n clearRequestId.call(this)\n }\n var unsubscribeLoadEndListener = addEventListener(this, 'loadend', onEnd).stop\n observable.notify(startContext)\n}\nfunction clearRequestId() {\n delete xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n delete this[DATA_FLUX_REQUEST_ID_KEY]\n}\nfunction abortXhr() {\n var context = xhrContexts[this[DATA_FL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IACtB,IAAIM,eAAe,GAAGd,OAAO;IAC7Bc,eAAe,CAAClB,KAAK,GAAG,UAAU;IAClCkB,eAAe,CAACC,QAAQ,GAAG,IAAAC,cAAO,EAChCf,YAAY,CAACG,WAAW,CAACa,SAAS,EAClC,IAAAC,mBAAY,EAAC,CACf,CAAC;IACDJ,eAAe,CAACK,MAAM,GAAG,IAAI,CAACA,MAAM;IACpCxC,UAAU,CAACyC,MAAM,CAAC,IAAAC,mBAAY,EAACP,eAAe,CAAC,CAAC;IAChDQ,cAAc,CAAClC,IAAI,CAAC,IAAI,CAAC;EAC3B,CAAC;EACD,IAAIyB,0BAA0B,GAAG,IAAAU,kCAAgB,EAAC,IAAI,EAAE,SAAS,EAAEX,KAAK,CAAC,CAACrB,IAAI;EAC9EZ,UAAU,CAACyC,MAAM,CAACnB,YAAY,CAAC;AACjC;AACA,SAASqB,cAAcA,CAAA,EAAG;EACxB,OAAOhD,WAAW,CAAC,IAAI,CAACC,wBAAwB,CAAC,CAAC;EAClD,OAAO,IAAI,CAACA,wBAAwB,CAAC;AACvC;AACA,SAASe,QAAQA,CAAA,EAAG;EAClB,IAAIU,OAAO,GAAG1B,WAAW,CAAC,IAAI,CAACC,wBAAwB,CAAC,CAAC;EACzD,IAAIyB,OAAO,EAAE;IACXA,OAAO,CAACM,SAAS,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
@@ -84,14 +84,22 @@ function validatePostRequestRequireParamsConfiguration(initConfiguration) {
84
84
  }
85
85
  function buildCookieOptions(initConfiguration) {
86
86
  var cookieOptions = {};
87
- cookieOptions.secure = mustUseSecureCookie(initConfiguration);
88
- cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie;
87
+
88
+ // cookieOptions.secure = mustUseSecureCookie(initConfiguration)
89
+ // cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie
90
+ cookieOptions.secure = !!initConfiguration.useSecureSessionCookie || !!initConfiguration.usePartitionedCrossSiteSessionCookie || !!initConfiguration.useCrossSiteSessionCookie;
91
+ cookieOptions.crossSite = !!initConfiguration.usePartitionedCrossSiteSessionCookie || !!initConfiguration.useCrossSiteSessionCookie;
92
+ cookieOptions.partitioned = !!initConfiguration.usePartitionedCrossSiteSessionCookie;
89
93
  if (initConfiguration.trackSessionAcrossSubdomains) {
90
94
  cookieOptions.domain = (0, _cookie.getCurrentSite)();
91
95
  }
92
96
  return cookieOptions;
93
97
  }
94
- function mustUseSecureCookie(initConfiguration) {
95
- return !!initConfiguration.useSecureSessionCookie || !!initConfiguration.useCrossSiteSessionCookie;
96
- }
98
+
99
+ // function mustUseSecureCookie(initConfiguration) {
100
+ // return (
101
+ // !!initConfiguration.useSecureSessionCookie ||
102
+ // !!initConfiguration.useCrossSiteSessionCookie
103
+ // )
104
+ // }
97
105
  //# sourceMappingURL=configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","names":["_cookie","require","_catchUserErrors","_display","_tools","_byteUtils","_transportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","exports","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","isPercentage","display","error","sessionSampleRate","telemetrySampleRate","assign","beforeSend","catchUserErrors","cookieOptions","buildCookieOptions","isNullUndefinedDefaultValue","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","ONE_KIBI_BYTE","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","ONE_SECOND","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","sendContentTypeByJson","computeTransportConfiguration","validatePostRequestRequireParamsConfiguration","site","datakitOrigin","datakitUrl","clientToken","secure","mustUseSecureCookie","crossSite","useCrossSiteSessionCookie","trackSessionAcrossSubdomains","domain","getCurrentSite","useSecureSessionCookie"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\nexport function validatePostRequestRequireParamsConfiguration(\n initConfiguration\n) {\n if (\n !initConfiguration.site &&\n !initConfiguration.datakitOrigin &&\n !initConfiguration.datakitUrl\n ) {\n display.error(\n 'datakitOrigin or site is not configured, no RUM data will be collected.'\n )\n return false\n }\n // if (!initConfiguration.datakitUrl && !initConfiguration.datakitOrigin) {\n // display.error(\n // 'datakitOrigin is not configured, no RUM data will be collected.'\n // )\n // return false\n // }\n if (initConfiguration.site && !initConfiguration.clientToken) {\n display.error(\n 'clientToken is not configured, no RUM data will be collected.'\n )\n return false\n }\n return true\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\nfunction mustUseSecureCookie(initConfiguration) {\n return (\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n )\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAEO,IAAIM,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AAAAC,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AACM,SAASK,6BAA6BA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zC;EAEA,OAAO/B,aAAa;AACtB;AAEA,SAAS0B,mBAAmBA,CAACrC,iBAAiB,EAAE;EAC9C,OACE,CAAC,CAACA,iBAAiB,CAAC2C,sBAAsB,IAC1C,CAAC,CAAC3C,iBAAiB,CAACuC,yBAAyB;AAEjD"}
1
+ {"version":3,"file":"configuration.js","names":["_cookie","require","_catchUserErrors","_display","_tools","_byteUtils","_transportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","exports","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","isPercentage","display","error","sessionSampleRate","telemetrySampleRate","assign","beforeSend","catchUserErrors","cookieOptions","buildCookieOptions","isNullUndefinedDefaultValue","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","ONE_KIBI_BYTE","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","ONE_SECOND","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","sendContentTypeByJson","computeTransportConfiguration","validatePostRequestRequireParamsConfiguration","site","datakitOrigin","datakitUrl","clientToken","secure","useSecureSessionCookie","usePartitionedCrossSiteSessionCookie","useCrossSiteSessionCookie","crossSite","partitioned","trackSessionAcrossSubdomains","domain","getCurrentSite"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\nexport function validatePostRequestRequireParamsConfiguration(\n initConfiguration\n) {\n if (\n !initConfiguration.site &&\n !initConfiguration.datakitOrigin &&\n !initConfiguration.datakitUrl\n ) {\n display.error(\n 'datakitOrigin or site is not configured, no RUM data will be collected.'\n )\n return false\n }\n // if (!initConfiguration.datakitUrl && !initConfiguration.datakitOrigin) {\n // display.error(\n // 'datakitOrigin is not configured, no RUM data will be collected.'\n // )\n // return false\n // }\n if (initConfiguration.site && !initConfiguration.clientToken) {\n display.error(\n 'clientToken is not configured, no RUM data will be collected.'\n )\n return false\n }\n return true\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n // cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n // cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.crossSite =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.partitioned =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\n// function mustUseSecureCookie(initConfiguration) {\n// return (\n// !!initConfiguration.useSecureSessionCookie ||\n// !!initConfiguration.useCrossSiteSessionCookie\n// )\n// }\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAEO,IAAIM,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AAAAC,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AACM,SAASK,6BAA6BA,CAACC,iBAAiB,EAAE;EAC/D,IACEA,iBAAiB,CAACC,UAAU,KAAKC,SAAS,IAC1C,CAAC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,CAACzC,iBAAiB,CAACsC,oCAAoC;EAC1D,IAAItC,iBAAiB,CAAC0C,4BAA4B,EAAE;IAClD/B,aAAa,CAACgC,MAAM,GAAG,IAAAC,sBAAc,EAAC,CAAC;EACzC;EAEA,OAAOjC,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"transportConfiguration.js","names":["_tools","require","TRIM_REGIX","typeMap","rum","log","sessionReplay","getEndPointUrl","configuration","type","subUrl","url","datakitOrigin","datakitUrl","site","indexOf","location","origin","trim","endpoint","lastIndexOf","length","clientToken","str","replace","computeTransportConfiguration","initConfiguration","isIntakeUrl","isFunction","isBoolean","isServerError","request","rumEndpoint","logsEndpoint","sessionReplayEndPoint","isIntakeRequest","notTakeRequest","push","some","takeUrl"],"sources":["../../src/configuration/transportConfiguration.js"],"sourcesContent":["import { isFunction, isBoolean, some } from '../helper/tools'\nvar TRIM_REGIX = /^\\s+|\\s+$/g\nvar typeMap = {\n rum: '/rum',\n log: '/logging',\n sessionReplay: '/rum/replay'\n}\nfunction getEndPointUrl(configuration, type) {\n // type: rum, log,replay\n var subUrl = typeMap[type]\n if (!subUrl) return ''\n var url =\n configuration.datakitOrigin ||\n configuration.datakitUrl ||\n configuration.site\n if (url.indexOf('/') === 0) {\n // 绝对路径这种 /xxx\n url = location.origin + trim(url)\n }\n var endpoint = url\n if (url.lastIndexOf('/') === url.length - 1) {\n endpoint = trim(url) + 'v1/write' + subUrl\n } else {\n endpoint = trim(url) + '/v1/write' + subUrl\n }\n if (configuration.site && configuration.clientToken) {\n endpoint =\n endpoint + '?token=' + configuration.clientToken + '&to_headless=true'\n }\n return endpoint\n}\n\nfunction trim(str) {\n return str.replace(TRIM_REGIX, '')\n}\n\nexport function computeTransportConfiguration(initConfiguration) {\n var isIntakeUrl = function (url) {\n return false\n }\n if (\n 'isIntakeUrl' in initConfiguration &&\n isFunction(initConfiguration.isIntakeUrl) &&\n isBoolean(initConfiguration.isIntakeUrl())\n ) {\n isIntakeUrl = initConfiguration.isIntakeUrl\n }\n var isServerError = function (request) {\n return false\n }\n if (\n 'isServerError' in initConfiguration &&\n isFunction(initConfiguration.isServerError) &&\n isBoolean(initConfiguration.isServerError())\n ) {\n isServerError = initConfiguration.isServerError\n }\n return {\n rumEndpoint: getEndPointUrl(initConfiguration, 'rum'),\n logsEndpoint: getEndPointUrl(initConfiguration, 'log'),\n sessionReplayEndPoint: getEndPointUrl(initConfiguration, 'sessionReplay'),\n isIntakeUrl: isIntakeUrl,\n isServerError: isServerError\n }\n}\nexport function isIntakeRequest(url, configuration) {\n var notTakeRequest = [configuration.rumEndpoint]\n if (configuration.logsEndpoint) {\n notTakeRequest.push(configuration.logsEndpoint)\n }\n if (configuration.sessionReplayEndPoint) {\n notTakeRequest.push(configuration.sessionReplayEndPoint)\n }\n // datakit 地址,log 地址,以及客户自定义过滤方法定义url\n return (\n some(notTakeRequest, function (takeUrl) {\n return url.indexOf(takeUrl) === 0\n }) || configuration.isIntakeUrl(url)\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAIC,UAAU,GAAG,YAAY;AAC7B,IAAIC,OAAO,GAAG;EACZC,GAAG,EAAE,MAAM;EACXC,GAAG,EAAE,UAAU;EACfC,aAAa,EAAE;AACjB,CAAC;AACD,SAASC,cAAcA,CAACC,aAAa,EAAEC,IAAI,EAAE;EAC3C;EACA,IAAIC,MAAM,GAAGP,OAAO,CAACM,IAAI,CAAC;EAC1B,IAAI,CAACC,MAAM,EAAE,OAAO,EAAE;EACtB,IAAIC,GAAG,GACLH,aAAa,CAACI,aAAa,IAC3BJ,aAAa,CAACK,UAAU,IACxBL,aAAa,CAACM,IAAI;EACpB,IAAIH,GAAG,CAACI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC1B;IACAJ,GAAG,GAAGK,QAAQ,CAACC,MAAM,GAAGC,IAAI,CAACP,GAAG,CAAC;EAC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ACmB,iBAAiB,EAAE,KAAK,CAAC;IACrDO,YAAY,EAAE1B,cAAc,CAACmB,iBAAiB,EAAE,KAAK,CAAC;IACtDQ,qBAAqB,EAAE3B,cAAc,CAACmB,iBAAiB,EAAE,eAAe,CAAC;IACzEC,WAAW,EAAEA,WAAW;IACxBG,aAAa,EAAEA;EACjB,CAAC;AACH;AACO,SAASK,eAAeA,CAACxB,GAAG,EAAEH,aAAa,EAAE;EAClD,IAAI4B,cAAc,GAAG,CAAC5B,aAAa,CAACwB,WAAW,CAAC;EAChD,IAAIxB,aAAa,CAACyB,YAAY,EAAE;IAC9BG,cAAc,CAACC,IAAI,CAAC7B,aAAa,CAACyB,YAAY,CAAC;EACjD;EACA,IAAIzB,aAAa,CAAC0B,qBAAqB,EAAE;IACvCE,cAAc,CAACC,IAAI,CAAC7B,aAAa,CAAC0B,qBAAqB,CAAC;EAC1D;EACA;EACA,OACE,IAAAI,WAAI,EAACF,cAAc,EAAE,UAAUG,OAAO,EAAE;IACtC,OAAO5B,GAAG,CAACI,OAAO,CAACwB,OAAO,CAAC,KAAK,CAAC;EACnC,CAAC,CAAC,IAAI/B,aAAa,CAACmB,WAAW,CAAChB,GAAG,CAAC;AAExC"}
1
+ {"version":3,"file":"transportConfiguration.js","names":["_tools","require","TRIM_REGIX","typeMap","rum","log","sessionReplay","getEndPointUrl","configuration","type","subUrl","url","datakitOrigin","datakitUrl","site","indexOf","location","origin","trim","endpoint","lastIndexOf","length","clientToken","str","replace","computeTransportConfiguration","initConfiguration","isIntakeUrl","isFunction","isBoolean","isServerError","request","rumEndpoint","logsEndpoint","sessionReplayEndPoint","isIntakeRequest","notTakeRequest","push","some","takeUrl"],"sources":["../../src/configuration/transportConfiguration.js"],"sourcesContent":["import { isFunction, isBoolean, some } from '../helper/tools'\nvar TRIM_REGIX = /^\\s+|\\s+$/g\nvar typeMap = {\n rum: '/rum',\n log: '/logging',\n sessionReplay: '/rum/replay'\n}\nfunction getEndPointUrl(configuration, type) {\n // type: rum, log,replay\n var subUrl = typeMap[type]\n if (!subUrl) return ''\n var url =\n configuration.datakitOrigin ||\n configuration.datakitUrl ||\n configuration.site\n if (url.indexOf('/') === 0) {\n // 绝对路径这种 /xxx\n url = location.origin + trim(url)\n }\n var endpoint = url\n if (url.lastIndexOf('/') === url.length - 1) {\n endpoint = trim(url) + 'v1/write' + subUrl\n } else {\n endpoint = trim(url) + '/v1/write' + subUrl\n }\n if (configuration.site && configuration.clientToken) {\n endpoint =\n endpoint + '?token=' + configuration.clientToken + '&to_headless=true'\n }\n return endpoint\n}\n\nfunction trim(str) {\n return str.replace(TRIM_REGIX, '')\n}\n\nexport function computeTransportConfiguration(initConfiguration) {\n var isIntakeUrl = function (url) {\n return false\n }\n if (\n 'isIntakeUrl' in initConfiguration &&\n isFunction(initConfiguration.isIntakeUrl) &&\n isBoolean(initConfiguration.isIntakeUrl())\n ) {\n isIntakeUrl = initConfiguration.isIntakeUrl\n }\n var isServerError = function (request) {\n return false\n }\n if (\n 'isServerError' in initConfiguration &&\n isFunction(initConfiguration.isServerError) &&\n isBoolean(initConfiguration.isServerError())\n ) {\n isServerError = initConfiguration.isServerError\n }\n return {\n rumEndpoint: getEndPointUrl(initConfiguration, 'rum'),\n logsEndpoint: getEndPointUrl(initConfiguration, 'log'),\n sessionReplayEndPoint: getEndPointUrl(initConfiguration, 'sessionReplay'),\n isIntakeUrl: isIntakeUrl,\n isServerError: isServerError\n }\n}\nexport function isIntakeRequest(url, configuration) {\n var notTakeRequest = [configuration.rumEndpoint]\n if (configuration.logsEndpoint) {\n notTakeRequest.push(configuration.logsEndpoint)\n }\n if (configuration.sessionReplayEndPoint) {\n notTakeRequest.push(configuration.sessionReplayEndPoint)\n }\n // datakit 地址,log 地址,以及客户自定义过滤方法定义url\n return (\n some(notTakeRequest, function (takeUrl) {\n return url.indexOf(takeUrl) === 0\n }) || configuration.isIntakeUrl(url)\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA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Aa,CAACmB,WAAW,CAAChB,GAAG,CAAC;AAExC","ignoreList":[]}
@@ -38,25 +38,27 @@ function createConsoleObservable(api) {
38
38
  console[api] = originalConsoleApi;
39
39
  };
40
40
  });
41
- return observable;
42
41
  }
43
42
  function buildConsoleLog(params, api, handlingStack) {
44
43
  var message = (0, _tools.map)(params, function (param) {
45
44
  return formatConsoleParameters(param);
46
45
  }).join(' ');
47
46
  var stack;
47
+ var causes;
48
48
  if (api === _display.ConsoleApiName.error) {
49
49
  var firstErrorParam = (0, _tools.find)(params, function (param) {
50
50
  return param instanceof Error;
51
51
  });
52
52
  stack = firstErrorParam ? (0, _errorTools.toStackTraceString)((0, _tracekit.computeStackTrace)(firstErrorParam)) : undefined;
53
53
  message = 'console error: ' + message;
54
+ causes = firstErrorParam ? (0, _errorTools.flattenErrorCauses)(firstErrorParam, 'console') : undefined;
54
55
  }
55
56
  return {
56
57
  api: api,
57
58
  message: message,
58
59
  stack: stack,
59
- handlingStack: handlingStack
60
+ handlingStack: handlingStack,
61
+ causes: causes
60
62
  };
61
63
  }
62
64
  function formatConsoleParameters(param) {
@@ -1 +1 @@
1
- {"version":3,"file":"consoleObservable.js","names":["_tracekit","require","_errorTools","_observable","_tools","_jsonStringify","_display","_monitor","consoleObservablesByApi","initConsoleObservable","apis","consoleObservables","map","api","createConsoleObservable","mergeObservables","apply","Observable","observable","originalConsoleApi","console","params","slice","call","arguments","handlingStack","createHandlingStack","callMonitored","notify","buildConsoleLog","message","param","formatConsoleParameters","join","stack","ConsoleApiName","error","firstErrorParam","find","Error","toStackTraceString","computeStackTrace","undefined","formatErrorMessage","jsonStringify"],"sources":["../../src/console/consoleObservable.js"],"sourcesContent":["import { computeStackTrace } from '../tracekit'\nimport {\n createHandlingStack,\n formatErrorMessage,\n toStackTraceString\n} from '../helper/errorTools'\nimport { mergeObservables, Observable } from '../helper/observable'\nimport { find, map } from '../helper/tools'\nimport { jsonStringify } from '../helper/serialisation/jsonStringify'\nimport { ConsoleApiName } from '../helper/display'\nimport { callMonitored } from '../helper/monitor'\nvar consoleObservablesByApi = {}\n\nexport function initConsoleObservable(apis) {\n var consoleObservables = map(apis, function (api) {\n if (!consoleObservablesByApi[api]) {\n consoleObservablesByApi[api] = createConsoleObservable(api)\n }\n return consoleObservablesByApi[api]\n })\n\n return mergeObservables.apply(this, consoleObservables)\n}\n\n/* eslint-disable no-console */\nfunction createConsoleObservable(api) {\n return new Observable(function (observable) {\n var originalConsoleApi = console[api]\n console[api] = function () {\n var params = [].slice.call(arguments)\n originalConsoleApi.apply(console, arguments)\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n observable.notify(buildConsoleLog(params, api, handlingStack))\n })\n }\n return function () {\n console[api] = originalConsoleApi\n }\n })\n return observable\n}\n\nfunction buildConsoleLog(params, api, handlingStack) {\n var message = map(params, function (param) {\n return formatConsoleParameters(param)\n }).join(' ')\n var stack\n\n if (api === ConsoleApiName.error) {\n var firstErrorParam = find(params, function (param) {\n return param instanceof Error\n })\n stack = firstErrorParam\n ? toStackTraceString(computeStackTrace(firstErrorParam))\n : undefined\n message = 'console error: ' + message\n }\n\n return {\n api: api,\n message: message,\n stack: stack,\n handlingStack: handlingStack\n }\n}\n\nfunction formatConsoleParameters(param) {\n if (typeof param === 'string') {\n return param\n }\n if (param instanceof Error) {\n return formatErrorMessage(computeStackTrace(param))\n }\n return jsonStringify(param, undefined, 2)\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAIO,uBAAuB,GAAG,CAAC,CAAC;AAEzB,SAASC,qBAAqBA,CAACC,IAAI,EAAE;EAC1C,IAAIC,kBAAkB,GAAG,IAAAC,UAAG,EAACF,IA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AChC,IAAIC,eAAe,GAAG,IAAAC,WAAI,EAACjB,MAAM,EAAE,UAAUU,KAAK,EAAE;MAClD,OAAOA,KAAK,YAAYQ,KAAK;IAC/B,CAAC,CAAC;IACFL,KAAK,GAAGG,eAAe,GACnB,IAAAG,8BAAkB,EAAC,IAAAC,2BAAiB,EAACJ,eAAe,CAAC,CAAC,GACtDK,SAAS;IACbZ,OAAO,GAAG,iBAAiB,GAAGA,OAAO;EACvC;EAEA,OAAO;IACLjB,GAAG,EAAEA,GAAG;IACRiB,OAAO,EAAEA,OAAO;IAChBI,KAAK,EAAEA,KAAK;IACZT,aAAa,EAAEA;EACjB,CAAC;AACH;AAEA,SAASO,uBAAuBA,CAACD,KAAK,EAAE;EACtC,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EACA,IAAIA,KAAK,YAAYQ,KAAK,EAAE;IAC1B,OAAO,IAAAI,8BAAkB,EAAC,IAAAF,2BAAiB,EAACV,KAAK,CAAC,CAAC;EACrD;EACA,OAAO,IAAAa,4BAAa,EAACb,KAAK,EAAEW,SAAS,EAAE,CAAC,CAAC;AAC3C"}
1
+ {"version":3,"file":"consoleObservable.js","names":["_tracekit","require","_errorTools","_observable","_tools","_jsonStringify","_display","_monitor","consoleObservablesByApi","initConsoleObservable","apis","consoleObservables","map","api","createConsoleObservable","mergeObservables","apply","Observable","observable","originalConsoleApi","console","params","slice","call","arguments","handlingStack","createHandlingStack","callMonitored","notify","buildConsoleLog","message","param","formatConsoleParameters","join","stack","causes","ConsoleApiName","error","firstErrorParam","find","Error","toStackTraceString","computeStackTrace","undefined","flattenErrorCauses","formatErrorMessage","jsonStringify"],"sources":["../../src/console/consoleObservable.js"],"sourcesContent":["import { computeStackTrace } from '../tracekit'\nimport {\n createHandlingStack,\n formatErrorMessage,\n toStackTraceString,\n flattenErrorCauses\n} from '../helper/errorTools'\nimport { mergeObservables, Observable } from '../helper/observable'\nimport { find, map } from '../helper/tools'\nimport { jsonStringify } from '../helper/serialisation/jsonStringify'\nimport { ConsoleApiName } from '../helper/display'\nimport { callMonitored } from '../helper/monitor'\nvar consoleObservablesByApi = {}\n\nexport function initConsoleObservable(apis) {\n var consoleObservables = map(apis, function (api) {\n if (!consoleObservablesByApi[api]) {\n consoleObservablesByApi[api] = createConsoleObservable(api)\n }\n return consoleObservablesByApi[api]\n })\n\n return mergeObservables.apply(this, consoleObservables)\n}\n\n/* eslint-disable no-console */\nfunction createConsoleObservable(api) {\n return new Observable(function (observable) {\n var originalConsoleApi = console[api]\n console[api] = function () {\n var params = [].slice.call(arguments)\n originalConsoleApi.apply(console, arguments)\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n observable.notify(buildConsoleLog(params, api, handlingStack))\n })\n }\n return function () {\n console[api] = originalConsoleApi\n }\n })\n}\n\nfunction buildConsoleLog(params, api, handlingStack) {\n var message = map(params, function (param) {\n return formatConsoleParameters(param)\n }).join(' ')\n var stack\n var causes\n if (api === ConsoleApiName.error) {\n var firstErrorParam = find(params, function (param) {\n return param instanceof Error\n })\n stack = firstErrorParam\n ? toStackTraceString(computeStackTrace(firstErrorParam))\n : undefined\n message = 'console error: ' + message\n causes = firstErrorParam\n ? flattenErrorCauses(firstErrorParam, 'console')\n : undefined\n }\n\n return {\n api: api,\n message: message,\n stack: stack,\n handlingStack: handlingStack,\n causes: causes\n }\n}\n\nfunction formatConsoleParameters(param) {\n if (typeof param === 'string') {\n return param\n }\n if (param instanceof Error) {\n return formatErrorMessage(computeStackTrace(param))\n }\n return jsonStringify(param, undefined, 2)\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAIO,uBAAuB,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CAAC,GAAG,CAAC;EACZ,IAAIC,KAAK;EACT,IAAIC,MAAM;EACV,IAAItB,GAAG,KAAKuB,uBAAc,CAACC,KAAK,EAAE;IAChC,IAAIC,eAAe,GAAG,IAAAC,WAAI,EAAClB,MAAM,EAAE,UAAUU,KAAK,EAAE;MAClD,OAAOA,KAAK,YAAYS,KAAK;IAC/B,CAAC,CAAC;IACFN,KAAK,GAAGI,eAAe,GACnB,IAAAG,8BAAkB,EAAC,IAAAC,2BAAiB,EAACJ,eAAe,CAAC,CAAC,GACtDK,SAAS;IACbb,OAAO,GAAG,iBAAiB,GAAGA,OAAO;IACrCK,MAAM,GAAGG,eAAe,GACpB,IAAAM,8BAAkB,EAACN,eAAe,EAAE,SAAS,CAAC,GAC9CK,SAAS;EACf;EAEA,OAAO;IACL9B,GAAG,EAAEA,GAAG;IACRiB,OAAO,EAAEA,OAAO;IAChBI,KAAK,EAAEA,KAAK;IACZT,aAAa,EAAEA,aAAa;IAC5BU,MAAM,EAAEA;EACV,CAAC;AACH;AAEA,SAASH,uBAAuBA,CAACD,KAAK,EAAE;EACtC,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EACA,IAAIA,KAAK,YAAYS,KAAK,EAAE;IAC1B,OAAO,IAAAK,8BAAkB,EAAC,IAAAH,2BAAiB,EAACX,KAAK,CAAC,CAAC;EACrD;EACA,OAAO,IAAAe,4BAAa,EAACf,KAAK,EAAEY,SAAS,EAAE,CAAC,CAAC;AAC3C","ignoreList":[]}
package/cjs/dataMap.js CHANGED
@@ -113,7 +113,9 @@ var dataMap = {
113
113
  fields: {
114
114
  duration: 'resource.duration',
115
115
  resource_size: 'resource.size',
116
- resource_encode_size: 'resource.encode_size',
116
+ resource_encode_size: 'resource.encoded_body_size',
117
+ resource_decode_size: 'resource.decoded_body_size',
118
+ resource_transfer_size: 'resource.transfer_size',
117
119
  resource_render_blocking_status: 'resource.render_blocking_status',
118
120
  resource_dns: 'resource.dns',
119
121
  resource_tcp: 'resource.tcp',
@@ -1 +1 @@
1
- {"version":3,"file":"dataMap.js","names":["_enums","require","commonTags","sdk_name","sdk_version","app_id","env","service","version","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","exports","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encode_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAA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,CAAC;AAAA5G,OAAA,CAAAY,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"dataMap.js","names":["_enums","require","commonTags","sdk_name","sdk_version","app_id","env","service","version","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","exports","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;E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AgB;MAC3B5B,OAAO,EAAE,SAAS;MAClBsI,MAAM,EAAE;IACV,CAAC;IACDxF,MAAM,EAAE;MACNyF,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC;AAAA9G,OAAA,CAAAY,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"trackRuntimeError.js","names":["_errorTools","require","_tools","_enums","_tracekit","trackRuntimeError","errorObservable","startUnhandledErrorCollection","stackTrace","originalError","notify","computeRawError","startClocks","clocksNow","nonErrorPrefix","NonErrorPrefix","UNCAUGHT","source","ErrorSource","SOURCE","handling","ErrorHandling","UNHANDLED"],"sources":["../../src/error/trackRuntimeError.js"],"sourcesContent":["import { ErrorSource, computeRawError } from '../helper/errorTools'\nimport { clocksNow } from '../helper/tools'\nimport { ErrorHandling, NonErrorPrefix } from '../helper/enums'\nimport { startUnhandledErrorCollection } from '../tracekit'\n\nexport function trackRuntimeError(errorObservable) {\n return startUnhandledErrorCollection(function (stackTrace, originalError) {\n errorObservable.notify(\n computeRawError({\n stackTrace: stackTrace,\n originalError: originalError,\n startClocks: clocksNow(),\n nonErrorPrefix: NonErrorPrefix.UNCAUGHT,\n source: ErrorSource.SOURCE,\n handling: ErrorHandling.UNHANDLED\n })\n )\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAEO,SAASI,iBAAiBA,CAACC,eAAe,EAAE;EACjD,OAAO,IAAAC,uCAA6B,EAAC,UAAUC,UAAU,EAAEC,aAAa,EAAE;IACxEH,eAAe,CAACI,MAAM,CACpB,IAAAC,2BAAe,EAAC;MACdH,UAAU,EAAEA,UAAU;MACtBC,aAAa,EAAEA,aAAa;MAC5BG,WAAW,EAAE,IAAAC,gBAAS,EAAC,CAAC;MACxBC,cAAc,EAAEC,qBAAc,CAACC,QAAQ;MACvCC,MAAM,EAAEC,uBAAW,CAACC,MAAM;MAC1BC,QAAQ,EAAEC,oBAAa,CAACC;IAC1B,CAAC,CACH,CAAC;EACH,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"trackRuntimeError.js","names":["_errorTools","require","_tools","_enums","_tracekit","trackRuntimeError","errorObservable","startUnhandledErrorCollection","stackTrace","originalError","notify","computeRawError","startClocks","clocksNow","nonErrorPrefix","NonErrorPrefix","UNCAUGHT","source","ErrorSource","SOURCE","handling","ErrorHandling","UNHANDLED"],"sources":["../../src/error/trackRuntimeError.js"],"sourcesContent":["import { ErrorSource, computeRawError } from '../helper/errorTools'\nimport { clocksNow } from '../helper/tools'\nimport { ErrorHandling, NonErrorPrefix } from '../helper/enums'\nimport { startUnhandledErrorCollection } from '../tracekit'\n\nexport function trackRuntimeError(errorObservable) {\n return startUnhandledErrorCollection(function (stackTrace, originalError) {\n errorObservable.notify(\n computeRawError({\n stackTrace: stackTrace,\n originalError: originalError,\n startClocks: clocksNow(),\n nonErrorPrefix: NonErrorPrefix.UNCAUGHT,\n source: ErrorSource.SOURCE,\n handling: ErrorHandling.UNHANDLED\n })\n )\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAEO,SAASI,iBAAiBA,CAACC,eAAe,EAAE;EACjD,OAAO,IAAAC,uCAA6B,EAAC,UAAUC,UAAU,EAAEC,aAAa,EAAE;IACxEH,eAAe,CAACI,MAAM,CACpB,IAAAC,2BAAe,EAAC;MACdH,UAAU,EAAEA,UAAU;MACtBC,aAAa,EAAEA,aAAa;MAC5BG,WAAW,EAAE,IAAAC,gBAAS,EAAC,CAAC;MACxBC,cAAc,EAAEC,qBAAc,CAACC,QAAQ;MACvCC,MAAM,EAAEC,uBAAW,CAACC,MAAM;MAC1BC,QAAQ,EAAEC,oBAAa,CAACC;IAC1B,CAAC,CACH,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"boundedBuffer.js","names":["_tools","require","BUFFER_LIMIT","_BoundedBuffer","buffer","prototype","add","callback","length","push","splice","drain","each","BoundedBuffer","exports"],"sources":["../../src/helper/boundedBuffer.js"],"sourcesContent":["import { each } from './tools'\nvar BUFFER_LIMIT = 500\n\nvar _BoundedBuffer = function () {\n this.buffer = []\n}\n_BoundedBuffer.prototype = {\n add: function (callback) {\n var length = this.buffer.push(callback)\n if (length > BUFFER_LIMIT) {\n this.buffer.splice(0, 1)\n }\n },\n\n drain: function () {\n each(this.buffer, function (callback) {\n callback()\n })\n this.buffer.length = 0\n }\n}\nexport var BoundedBuffer = _BoundedBuffer\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAIC,YAAY,GAAG,GAAG;AAEtB,IAAIC,cAAc,GAAG,SAAjBA,cAAcA,CAAA,EAAe;EAC/B,IAAI,CAACC,MAAM,GAAG,EAAE;AAClB,CAAC;AACDD,cAAc,CAACE,SAAS,GAAG;EACzBC,GAAG,EAAE,SAAAA,IAAUC,QAAQ,EAAE;IACvB,IAAIC,MAAM,GAAG,IAAI,CAACJ,MAAM,CAACK,IAAI,CAACF,QAAQ,CAAC;IACvC,IAAIC,MAAM,GAAGN,YAAY,EAAE;MACzB,IAAI,CAACE,MAAM,CAACM,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1B;EACF,CAAC;EAEDC,KAAK,EAAE,SAAAA,MAAA,EAAY;IACjB,IAAAC,WAAI,EAAC,IAAI,CAACR,MAAM,EAAE,UAAUG,QAAQ,EAAE;MACpCA,QAAQ,CAAC,CAAC;IACZ,CAAC,CAAC;IACF,IAAI,CAACH,MAAM,CAACI,MAAM,GAAG,CAAC;EACxB;AACF,CAAC;AACM,IAAIK,aAAa,GAAGV,cAAc;AAAAW,OAAA,CAAAD,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"file":"boundedBuffer.js","names":["_tools","require","BUFFER_LIMIT","_BoundedBuffer","buffer","prototype","add","callback","length","push","splice","drain","each","BoundedBuffer","exports"],"sources":["../../src/helper/boundedBuffer.js"],"sourcesContent":["import { each } from './tools'\nvar BUFFER_LIMIT = 500\n\nvar _BoundedBuffer = function () {\n this.buffer = []\n}\n_BoundedBuffer.prototype = {\n add: function (callback) {\n var length = this.buffer.push(callback)\n if (length > BUFFER_LIMIT) {\n this.buffer.splice(0, 1)\n }\n },\n\n drain: function () {\n each(this.buffer, function (callback) {\n callback()\n })\n this.buffer.length = 0\n }\n}\nexport var BoundedBuffer = _BoundedBuffer\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAIC,YAAY,GAAG,GAAG;AAEtB,IAAIC,cAAc,GAAG,SAAjBA,cAAcA,CAAA,EAAe;EAC/B,IAAI,CAACC,MAAM,GAAG,EAAE;AAClB,CAAC;AACDD,cAAc,CAACE,SAAS,GAAG;EACzBC,GAAG,EAAE,SAAAA,IAAUC,QAAQ,EAAE;IACvB,IAAIC,MAAM,GAAG,IAAI,CAACJ,MAAM,CAACK,IAAI,CAACF,QAAQ,CAAC;IACvC,IAAIC,MAAM,GAAGN,YAAY,EAAE;MACzB,IAAI,CAACE,MAAM,CAACM,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1B;EACF,CAAC;EAEDC,KAAK,EAAE,SAAAA,MAAA,EAAY;IACjB,IAAAC,WAAI,EAAC,IAAI,CAACR,MAAM,EAAE,UAAUG,QAAQ,EAAE;MACpCA,QAAQ,CAAC,CAAC;IACZ,CAAC,CAAC;IACF,IAAI,CAACH,MAAM,CAACI,MAAM,GAAG,CAAC;EACxB;AACF,CAAC;AACM,IAAIK,aAAa,GAAGV,cAAc;AAAAW,OAAA,CAAAD,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"byteUtils.js","names":["ONE_KIBI_BYTE","exports","ONE_MEBI_BYTE","HAS_MULTI_BYTES_CHARACTERS","computeBytesCount","candidate","test","length","window","TextEncoder","undefined","encode","Blob","size","concatBuffers","buffers","reduce","total","buffer","result","Uint8Array","offset","_iterator","_createForOfIteratorHelper","_step","s","n","done","value","set","err","e","f"],"sources":["../../src/helper/byteUtils.js"],"sourcesContent":["export var ONE_KIBI_BYTE = 1024\nexport var ONE_MEBI_BYTE = 1024 * ONE_KIBI_BYTE\n// eslint-disable-next-line no-control-regex\nvar HAS_MULTI_BYTES_CHARACTERS = /[^\\u0000-\\u007F]/\n\nexport function computeBytesCount(candidate) {\n // Accurate bytes count computations can degrade performances when there is a lot of events to process\n if (!HAS_MULTI_BYTES_CHARACTERS.test(candidate)) {\n return candidate.length\n }\n\n if (window.TextEncoder !== undefined) {\n return new TextEncoder().encode(candidate).length\n }\n\n return new Blob([candidate]).size\n}\nexport function concatBuffers(buffers) {\n var length = buffers.reduce(function (total, buffer) {\n return total + buffer.length\n }, 0)\n var result = new Uint8Array(length)\n var offset = 0\n for (var buffer of buffers) {\n result.set(buffer, offset)\n offset += buffer.length\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;AAAO,IAAIA,aAAa,GAAG,IAAI;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA;AACxB,IAAIE,aAAa,GAAG,IAAI,GAAGF,aAAa;AAC/C;AAAAC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AACA,IAAIC,0BAA0B,GAAG,kBAAkB;AAE5C,SAASC,iBAAiBA,CAACC,SAAS,EAAE;EAC3C;EACA,IAAI,CAACF,0BAA0B,CAACG,IAAI,CAACD,SAAS,CAAC,EAAE;IAC/C,OAAOA,SAAS,CAACE,MAAM;EACzB;EAEA,IAAIC,MAAM,CAACC,WAAW,KAAKC,SAAS,EAAE;IACpC,OAAO,IAAID,WAAW,CAAC,CAAC,CAACE,MAAM,CAACN,SAAS,CAAC,CAACE,MAAM;EACnD;EAEA,OAAO,IAAIK,IAAI,CAAC,CAACP,SAAS,CAAC,CAAC,CAACQ,IAAI;AACnC;AACO,SAASC,aAAaA,CAACC,OAAO,EAAE;EACrC,IAAIR,MAAM,GAAGQ,OAAO,CAACC,MAAM,CAAC,UAAUC,KAAK,EAAEC,MAAM,EAAE;IACnD,OAAOD,KAAK,GAAGC,MAAM,CAACX,MAAM;EAC9B,CAAC,EAAE,CAAC,CAAC;EACL,IAAIY,MAAM,GAAG,IAAIC,UAAU,CAACb,MAAM,CAAC;EACnC,IAAIc,MAAM,GAAG,CAAC;EAAA,IAAAC,SAAA,GAAAC,0BAAA,CACKR,OAAO;IAAAS,KAAA;EAAA;IAA1B,KAAAF,SAAA,CAAAG,CAAA,MAAAD,KAAA,GAAAF,SAAA,CAAAI,CAAA,IAAAC,IAAA,GAA4B;MAAA,IAAnBT,MAAM,GAAAM,KAAA,CAAAI,KAAA;MACbT,MAAM,CAACU,GAAG,CAACX,MAAM,EAAEG,MAAM,CAAC;MAC1BA,MAAM,IAAIH,MAAM,CAACX,MAAM;IACzB;EAAC,SAAAuB,GAAA;IAAAR,SAAA,CAAAS,CAAA,CAAAD,GAAA;EAAA;IAAAR,SAAA,CAAAU,CAAA;EAAA;EACD,OAAOb,MAAM;AACf"}
1
+ {"version":3,"file":"byteUtils.js","names":["ONE_KIBI_BYTE","exports","ONE_MEBI_BYTE","HAS_MULTI_BYTES_CHARACTERS","computeBytesCount","candidate","test","length","window","TextEncoder","undefined","encode","Blob","size","concatBuffers","buffers","reduce","total","buffer","result","Uint8Array","offset","_iterator","_createForOfIteratorHelper","_step","s","n","done","value","set","err","e","f"],"sources":["../../src/helper/byteUtils.js"],"sourcesContent":["export var ONE_KIBI_BYTE = 1024\nexport var ONE_MEBI_BYTE = 1024 * ONE_KIBI_BYTE\n// eslint-disable-next-line no-control-regex\nvar HAS_MULTI_BYTES_CHARACTERS = /[^\\u0000-\\u007F]/\n\nexport function computeBytesCount(candidate) {\n // Accurate bytes count computations can degrade performances when there is a lot of events to process\n if (!HAS_MULTI_BYTES_CHARACTERS.test(candidate)) {\n return candidate.length\n }\n\n if (window.TextEncoder !== undefined) {\n return new TextEncoder().encode(candidate).length\n }\n\n return new Blob([candidate]).size\n}\nexport function concatBuffers(buffers) {\n var length = buffers.reduce(function (total, buffer) {\n return total + buffer.length\n }, 0)\n var result = new Uint8Array(length)\n var offset = 0\n for (var buffer of buffers) {\n result.set(buffer, offset)\n offset += buffer.length\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;AAAO,IAAIA,aAAa,GAAG,IAAI;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA;AACxB,IAAIE,aAAa,GAAG,IAAI,GAAGF,aAAa;AAC/C;AAAAC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AACA,IAAIC,0BAA0B,GAAG,kBAAkB;AAE5C,SAASC,iBAAiBA,CAACC,SAAS,EAAE;EAC3C;EACA,IAAI,CAACF,0BAA0B,CAACG,IAAI,CAACD,SAAS,CAAC,EAAE;IAC/C,OAAOA,SAAS,CAACE,MAAM;EACzB;EAEA,IAAIC,MAAM,CAACC,WAAW,KAAKC,SAAS,EAAE;IACpC,OAAO,IAAID,WAAW,CAAC,CAAC,CAACE,MAAM,CAACN,SAAS,CAAC,CAACE,MAAM;EACnD;EAEA,OAAO,IAAIK,IAAI,CAAC,CAACP,SAAS,CAAC,CAAC,CAACQ,IAAI;AACnC;AACO,SAASC,aAAaA,CAACC,OAAO,EAAE;EACrC,IAAIR,MAAM,GAAGQ,OAAO,CAACC,MAAM,CAAC,UAAUC,KAAK,EAAEC,MAAM,EAAE;IACnD,OAAOD,KAAK,GAAGC,MAAM,CAACX,MAAM;EAC9B,CAAC,EAAE,CAAC,CAAC;EACL,IAAIY,MAAM,GAAG,IAAIC,UAAU,CAACb,MAAM,CAAC;EACnC,IAAIc,MAAM,GAAG,CAAC;EAAA,IAAAC,SAAA,GAAAC,0BAAA,CACKR,OAAO;IAAAS,KAAA;EAAA;IAA1B,KAAAF,SAAA,CAAAG,CAAA,MAAAD,KAAA,GAAAF,SAAA,CAAAI,CAAA,IAAAC,IAAA,GAA4B;MAAA,IAAnBT,MAAM,GAAAM,KAAA,CAAAI,KAAA;MACbT,MAAM,CAACU,GAAG,CAACX,MAAM,EAAEG,MAAM,CAAC;MAC1BA,MAAM,IAAIH,MAAM,CAACX,MAAM;IACzB;EAAC,SAAAuB,GAAA;IAAAR,SAAA,CAAAS,CAAA,CAAAD,GAAA;EAAA;IAAAR,SAAA,CAAAU,CAAA;EAAA;EACD,OAAOb,MAAM;AACf","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"catchUserErrors.js","names":["_display","require","catchUserErrors","fn","errorMsg","args","slice","call","arguments","apply","err","display","error"],"sources":["../../src/helper/catchUserErrors.js"],"sourcesContent":["import { display } from './display'\n\nexport function catchUserErrors(fn, errorMsg) {\n return function() {\n var args = [].slice.call(arguments)\n try {\n return fn.apply(this, args)\n } catch (err) {\n display.error(errorMsg, err)\n }\n }\n}"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEO,SAASC,eAAeA,CAACC,EAAE,EAAEC,QAAQ,EAAE;EAC5C,OAAO,YAAW;IAChB,IAAIC,IAAI,GAAG,EAAE,CAACC,KAAK,CAACC,IAAI,CAACC,SAAS,CAAC;IACnC,IAAI;MACF,OAAOL,EAAE,CAACM,KAAK,CAAC,IAAI,EAAEJ,IAAI,CAAC;IAC7B,CAAC,CAAC,OAAOK,GAAG,EAAE;MACZC,gBAAO,CAACC,KAAK,CAACR,QAAQ,EAAEM,GAAG,CAAC;IAC9B;EACF,CAAC;AACH"}
1
+ {"version":3,"file":"catchUserErrors.js","names":["_display","require","catchUserErrors","fn","errorMsg","args","slice","call","arguments","apply","err","display","error"],"sources":["../../src/helper/catchUserErrors.js"],"sourcesContent":["import { display } from './display'\n\nexport function catchUserErrors(fn, errorMsg) {\n return function() {\n var args = [].slice.call(arguments)\n try {\n return fn.apply(this, args)\n } catch (err) {\n display.error(errorMsg, err)\n }\n }\n}"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEO,SAASC,eAAeA,CAACC,EAAE,EAAEC,QAAQ,EAAE;EAC5C,OAAO,YAAW;IAChB,IAAIC,IAAI,GAAG,EAAE,CAACC,KAAK,CAACC,IAAI,CAACC,SAAS,CAAC;IACnC,IAAI;MACF,OAAOL,EAAE,CAACM,KAAK,CAAC,IAAI,EAAEJ,IAAI,CAAC;IAC7B,CAAC,CAAC,OAAOK,GAAG,EAAE;MACZC,gBAAO,CAACC,KAAK,CAACR,QAAQ,EAAEM,GAAG,CAAC;IAC9B;EACF,CAAC;AACH","ignoreList":[]}