@cloudcare/browser-rum 3.2.36 → 3.2.38

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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildEnv = void 0;
7
7
  var buildEnv = exports.buildEnv = {
8
- sdkVersion: "3.2.36",
8
+ sdkVersion: "3.2.38",
9
9
  sdkName: 'df_web_rum_sdk'
10
10
  };
11
11
  //# sourceMappingURL=buildEnv.js.map
@@ -85,7 +85,6 @@ function createPreStartStrategy(rumPublicApiOptions, getCommonContext, doStartRu
85
85
 
86
86
  // Expose the initial configuration regardless of initialization success.
87
87
  cachedInitConfiguration = initConfiguration;
88
-
89
88
  // If we are in a Synthetics test configured to automatically inject a RUM instance, we want
90
89
  // to completely discard the customer application RUM instance by ignoring their init() call.
91
90
  // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the
@@ -144,6 +143,14 @@ function createPreStartStrategy(rumPublicApiOptions, getCommonContext, doStartRu
144
143
  });
145
144
  },
146
145
  getViewContext: function getViewContext() {},
146
+ addTypeAction: function addTypeAction(action, type, commonContext) {
147
+ if (commonContext === undefined) {
148
+ commonContext = getCommonContext();
149
+ }
150
+ bufferApiCalls.add(function (startRumResult) {
151
+ startRumResult.addTypeAction(action, type, commonContext);
152
+ });
153
+ },
147
154
  addAction: function addAction(action, commonContext) {
148
155
  if (commonContext === undefined) {
149
156
  commonContext = getCommonContext();
@@ -1 +1 @@
1
- {"version":3,"file":"perStartRum.js","names":["_browserCore","require","_configuration","createPreStartStrategy","rumPublicApiOptions","getCommonContext","doStartRum","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","bufferApiCalls","createBoundedBuffer","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","tryStartRum","initialViewOptions","trackViewsManually","remove","callback","options","startRumResult","drain","doInit","initConfiguration","eventBridgeAvailable","canUseEventBridge","overrideInitConfigurationForBridge","addTelemetryConfiguration","deepClone","displayAlreadyInitializedError","configuration","validateAndBuildRumConfiguration","sessionStoreStrategyType","display","warn","compressIntakeRequests","sendContentTypeByJson","noop","initFetchObservable","subscribe","init","error","willSyntheticsInjectRum","remoteConfiguration","fetchAndApplyRemoteConfiguration","getInitConfiguration","getInternalContext","stopSession","addTiming","name","time","undefined","timeStampNow","add","startView","startClocks","clocksNow","setViewName","setViewContext","context","setViewContextProperty","key","value","getViewContext","addAction","action","commonContext","addError","providedError","_initConfiguration$de","_getEventBridge","assign","applicationId","clientToken","sessionSampleRate","defaultPrivacyLevel","getEventBridge","getPrivacyLevel"],"sources":["../../src/boot/perStartRum.js"],"sourcesContent":["import {\n createBoundedBuffer,\n display,\n canUseEventBridge,\n displayAlreadyInitializedError,\n willSyntheticsInjectRum,\n noop,\n timeStampNow,\n clocksNow,\n assign,\n addTelemetryConfiguration,\n initFetchObservable,\n deepClone,\n fetchAndApplyRemoteConfiguration,\n getEventBridge\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\n\nexport function createPreStartStrategy(\n rumPublicApiOptions,\n getCommonContext,\n doStartRum\n) {\n var ignoreInitIfSyntheticsWillInjectRum =\n rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum\n var startDeflateWorker = rumPublicApiOptions.startDeflateWorker\n var bufferApiCalls = createBoundedBuffer()\n\n var firstStartViewCall\n\n var deflateWorker\n\n var cachedInitConfiguration\n var cachedConfiguration\n\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration) {\n return\n }\n\n var initialViewOptions\n\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback)\n initialViewOptions = firstStartViewCall.options\n }\n\n var startRumResult = doStartRum(\n cachedConfiguration,\n deflateWorker,\n initialViewOptions\n )\n\n bufferApiCalls.drain(startRumResult)\n }\n\n function doInit(initConfiguration) {\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration\n addTelemetryConfiguration(deepClone(initConfiguration))\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n return\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn(\n 'No storage available for session. We will not send any data.'\n )\n return\n }\n\n if (\n configuration.compressIntakeRequests &&\n !configuration.sendContentTypeByJson &&\n !eventBridgeAvailable &&\n startDeflateWorker\n ) {\n deflateWorker = startDeflateWorker(\n configuration,\n 'RUM',\n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop\n )\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return\n }\n }\n\n cachedConfiguration = configuration\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop)\n\n tryStartRum()\n }\n\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration')\n return\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration\n\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return\n }\n if (initConfiguration.remoteConfiguration) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit)\n } else {\n doInit(initConfiguration)\n }\n },\n\n getInitConfiguration: function () {\n return cachedInitConfiguration\n },\n\n getInternalContext: noop,\n\n stopSession: noop,\n\n addTiming: function (name, time) {\n if (time === undefined) {\n time = timeStampNow()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTiming(name, time)\n })\n },\n\n startView: function (options, startClocks) {\n if (startClocks === undefined) {\n startClocks = clocksNow()\n }\n const callback = function (startRumResult) {\n startRumResult.startView(options, startClocks)\n }\n bufferApiCalls.add(callback)\n\n if (!firstStartViewCall) {\n firstStartViewCall = { options: options, callback: callback }\n tryStartRum()\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name))\n },\n\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContext(context)\n )\n },\n\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContextProperty(key, value)\n )\n },\n\n getViewContext: () => {},\n addAction: function (action, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addAction(action, commonContext)\n })\n },\n\n addError: function (providedError, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addError(providedError, commonContext)\n })\n }\n }\n}\n\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel:\n initConfiguration.defaultPrivacyLevel ??\n getEventBridge()?.getPrivacyLevel()\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;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js","names":["_browserCore","require","_configuration","createPreStartStrategy","rumPublicApiOptions","getCommonContext","doStartRum","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","bufferApiCalls","createBoundedBuffer","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","tryStartRum","initialViewOptions","trackViewsManually","remove","callback","options","startRumResult","drain","doInit","initConfiguration","eventBridgeAvailable","canUseEventBridge","overrideInitConfigurationForBridge","addTelemetryConfiguration","deepClone","displayAlreadyInitializedError","configuration","validateAndBuildRumConfiguration","sessionStoreStrategyType","display","warn","compressIntakeRequests","sendContentTypeByJson","noop","initFetchObservable","subscribe","init","error","willSyntheticsInjectRum","remoteConfiguration","fetchAndApplyRemoteConfiguration","getInitConfiguration","getInternalContext","stopSession","addTiming","name","time","undefined","timeStampNow","add","startView","startClocks","clocksNow","setViewName","setViewContext","context","setViewContextProperty","key","value","getViewContext","addTypeAction","action","type","commonContext","addAction","addError","providedError","_initConfiguration$de","_getEventBridge","assign","applicationId","clientToken","sessionSampleRate","defaultPrivacyLevel","getEventBridge","getPrivacyLevel"],"sources":["../../src/boot/perStartRum.js"],"sourcesContent":["import {\n createBoundedBuffer,\n display,\n canUseEventBridge,\n displayAlreadyInitializedError,\n willSyntheticsInjectRum,\n noop,\n timeStampNow,\n clocksNow,\n assign,\n addTelemetryConfiguration,\n initFetchObservable,\n deepClone,\n fetchAndApplyRemoteConfiguration,\n getEventBridge\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\n\nexport function createPreStartStrategy(\n rumPublicApiOptions,\n getCommonContext,\n doStartRum\n) {\n var ignoreInitIfSyntheticsWillInjectRum =\n rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum\n var startDeflateWorker = rumPublicApiOptions.startDeflateWorker\n var bufferApiCalls = createBoundedBuffer()\n\n var firstStartViewCall\n\n var deflateWorker\n\n var cachedInitConfiguration\n var cachedConfiguration\n\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration) {\n return\n }\n\n var initialViewOptions\n\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback)\n initialViewOptions = firstStartViewCall.options\n }\n\n var startRumResult = doStartRum(\n cachedConfiguration,\n deflateWorker,\n initialViewOptions\n )\n\n bufferApiCalls.drain(startRumResult)\n }\n\n function doInit(initConfiguration) {\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration\n addTelemetryConfiguration(deepClone(initConfiguration))\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n return\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn(\n 'No storage available for session. We will not send any data.'\n )\n return\n }\n\n if (\n configuration.compressIntakeRequests &&\n !configuration.sendContentTypeByJson &&\n !eventBridgeAvailable &&\n startDeflateWorker\n ) {\n deflateWorker = startDeflateWorker(\n configuration,\n 'RUM',\n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop\n )\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return\n }\n }\n\n cachedConfiguration = configuration\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop)\n\n tryStartRum()\n }\n\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration')\n return\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return\n }\n if (initConfiguration.remoteConfiguration) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit)\n } else {\n doInit(initConfiguration)\n }\n },\n\n getInitConfiguration: function () {\n return cachedInitConfiguration\n },\n\n getInternalContext: noop,\n\n stopSession: noop,\n\n addTiming: function (name, time) {\n if (time === undefined) {\n time = timeStampNow()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTiming(name, time)\n })\n },\n\n startView: function (options, startClocks) {\n if (startClocks === undefined) {\n startClocks = clocksNow()\n }\n const callback = function (startRumResult) {\n startRumResult.startView(options, startClocks)\n }\n bufferApiCalls.add(callback)\n\n if (!firstStartViewCall) {\n firstStartViewCall = { options: options, callback: callback }\n tryStartRum()\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name))\n },\n\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContext(context)\n )\n },\n\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContextProperty(key, value)\n )\n },\n\n getViewContext: () => {},\n\n addTypeAction: function (action, type, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTypeAction(action, type, commonContext)\n })\n },\n addAction: function (action, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addAction(action, commonContext)\n })\n },\n\n addError: function (providedError, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addError(providedError, commonContext)\n })\n }\n }\n}\n\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel:\n initConfiguration.defaultPrivacyLevel ??\n getEventBridge()?.getPrivacyLevel()\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAgBA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,sBAAsBA,CACpCC,mBAAmB,EACnBC,gBAAgB,EAChBC,UAAU,EACV;EACA,IAAIC,mCAAmC,GACrCH,mBAAmB,CAACG,mCAAmC;EACzD,IAAIC,kBAAkB,GAAGJ,mBAAmB,CAACI,kBAAkB;EAC/D,IAAIC,cAAc,GAAG,IAAAC,gCAAmB,EAAC,CAAC;EAE1C,IAAIC,kBAAkB;EAEtB,IAAIC,aAAa;EAEjB,IAAIC,uBAAuB;EAC3B,IAAIC,mBAAmB;EAEvB,SAASC,WAAWA,CAAA,EAAG;IACrB,IAAI,CAACF,uBAAuB,IAAI,CAACC,mBAAmB,EAAE;MACpD;IACF;IAEA,IAAIE,kBAAkB;IAEtB,IAAIF,mBAAmB,CAACG,kBAAkB,EAAE;MAC1C,IAAI,CAACN,kBAAkB,EAAE;QACvB;MACF;MACA;MACA;MACA;MACA;MACA;MACA;MACAF,cAAc,CAACS,MAAM,CAACP,kBAAkB,CAACQ,QAAQ,CAAC;MAClDH,kBAAkB,GAAGL,kBAAkB,CAACS,OAAO;IACjD;IAEA,IAAIC,cAAc,GAAGf,UAAU,CAC7BQ,mBAAmB,EACnBF,aAAa,EACbI,kBACF,CAAC;IAEDP,cAAc,CAACa,KAAK,CAACD,cAAc,CAAC;EACtC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AEH,aAAa,EAAE;MAChD,IAAIA,aAAa,KAAKhB,SAAS,EAAE;QAC/BgB,aAAa,GAAG/D,gBAAgB,CAAC,CAAC;MACpC;MACAI,cAAc,CAAC6C,GAAG,CAAC,UAAUjC,cAAc,EAAE;QAC3CA,cAAc,CAACiD,QAAQ,CAACC,aAAa,EAAEH,aAAa,CAAC;MACvD,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,SAASzC,kCAAkCA,CAACH,iBAAiB,EAAE;EAAA,IAAAgD,qBAAA,EAAAC,eAAA;EAC7D,OAAO,IAAAC,mBAAM,EAAC,CAAC,CAAC,EAAElD,iBAAiB,EAAE;IACnCmD,aAAa,EAAE,sCAAsC;IACrDC,WAAW,EAAE,OAAO;IACpBC,iBAAiB,EAAE,GAAG;IACtBC,mBAAmB,GAAAN,qBAAA,GACjBhD,iBAAiB,CAACsD,mBAAmB,cAAAN,qBAAA,cAAAA,qBAAA,IAAAC,eAAA,GACrC,IAAAM,2BAAc,EAAC,CAAC,cAAAN,eAAA,uBAAhBA,eAAA,CAAkBO,eAAe,CAAC;EACtC,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -139,6 +139,22 @@ function makeRumPublicApi(startRumImpl, recorderApi, options) {
139
139
  addDebugSession: (0, _browserCore.monitor)(function (id) {}),
140
140
  clearDebugSession: (0, _browserCore.monitor)(function () {}),
141
141
  getDebugSession: (0, _browserCore.monitor)(function () {}),
142
+ addTypeAction: (0, _browserCore.monitor)(function (name, type, context) {
143
+ var handlingStack = (0, _browserCore.createHandlingStack)();
144
+ (0, _browserCore.callMonitored)(function () {
145
+ var sourceType = (0, _browserCore.sanitize)(type);
146
+ strategy.addAction({
147
+ name: (0, _browserCore.sanitize)(name),
148
+ context: (0, _browserCore.sanitize)(context),
149
+ startClocks: (0, _browserCore.clocksNow)(),
150
+ type: (0, _browserCore.getType)(sourceType) === 'string' ? sourceType : _browserCore.ActionType.CUSTOM,
151
+ handlingStack: handlingStack
152
+ });
153
+ (0, _browserCore.addTelemetryUsage)({
154
+ feature: 'add-type-action'
155
+ });
156
+ });
157
+ }),
142
158
  addAction: (0, _browserCore.monitor)(function (name, context) {
143
159
  var handlingStack = (0, _browserCore.createHandlingStack)();
144
160
  (0, _browserCore.callMonitored)(function () {
@@ -1 +1 @@
1
- {"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addAction","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ActionType","CUSTOM","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","startSessionReplayRecording","start","force","stopSessionReplayRecording","stop","preStartStrategy","assign","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n options,\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop)\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration()\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAqBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AACtD,IAAIK,eAAe,GAAG,KAAK;AACpB,SAASC,gBAAgBA,CAACC,YAAY,EAAEC,WAAW,EAAEC,OAAO,EAAE;EACnE,IAAIA,OAAO,KAAKC,SAAS,EAAE;IACzBD,OAAO,GAAG,CAAC,CAAC;EACd;EACA,IAAME,0BAA0B,GAAG,IAAAC,6CAAgC,EACjEC,0CAA6B,CAACC,OAChC,CAAC;EACD,IAAMC,oBAAoB,GAAG,IAAAC,iCAAoB,EAAC,QAAQ,EAAE;IAC1DC,mBAAmB,EAAEN,0BAA0B,CAACO,kBAAkB,CAChEC,6BAAgB,CAACC,aACnB;EACF,CAAC,CAAC;EACF,IAAMC,kBAAkB,GAAG,IAAAL,iCAAoB,EAAC,MAAM,EAAE;IACtDC,mBAAmB,EAAEN,0BAA0B,CAACO,kBAAkB,CAChEC,6BAAgB,CAACG,IACnB,CAAC;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G,OAAO,CAAC;MAC1B,IAAA8C,8BAAiB,EAAC;QAChBC,OAAO,EAAE,gCAAgC;QACzC2D,KAAK,EAAE1G,OAAO,IAAIA,OAAO,CAAC0G;MAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;IACFC,0BAA0B,EAAE,IAAAlE,oBAAO,EAAC1C,WAAW,CAAC6G,IAAI;EACtD,CAAC,CAAC;EACF,OAAO5D,YAAY;AACrB;AACA,SAAST,uBAAuBA,CAACsE,gBAAgB,EAAE9E,cAAc,EAAE;EACjE,OAAO,IAAA+E,mBAAM,EACX;IACE5D,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjC,IAAA4D,2CAA8B,EAAC,cAAc,EAAE5D,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAE0D,gBAAgB,CAACrC,oBAAoB,CAAC;EAC3D,CAAC,EACDzC,cACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addTypeAction","handlingStack","createHandlingStack","callMonitored","sourceType","sanitize","addAction","startClocks","clocksNow","getType","ActionType","CUSTOM","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","startSessionReplayRecording","start","force","stopSessionReplayRecording","stop","preStartStrategy","assign","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n options,\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop)\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration()\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAsBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MA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,CAAC,CAAC;IACF4D,2BAA2B,EAAE,IAAAlE,oBAAO,EAAC,UAAUzC,OAAO,EAAE;MACtDD,WAAW,CAAC6G,KAAK,CAAC5G,OAAO,CAAC;MAC1B,IAAA8C,8BAAiB,EAAC;QAChBC,OAAO,EAAE,gCAAgC;QACzC8D,KAAK,EAAE7G,OAAO,IAAIA,OAAO,CAAC6G;MAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;IACFC,0BAA0B,EAAE,IAAArE,oBAAO,EAAC1C,WAAW,CAACgH,IAAI;EACtD,CAAC,CAAC;EACF,OAAO/D,YAAY;AACrB;AACA,SAAST,uBAAuBA,CAACyE,gBAAgB,EAAEjF,cAAc,EAAE;EACjE,OAAO,IAAAkF,mBAAM,EACX;IACE/D,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjC,IAAA+D,2CAA8B,EAAC,cAAc,EAAE/D,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAE6D,gBAAgB,CAACxC,oBAAoB,CAAC;EAC3D,CAAC,EACDzC,cACF,CAAC;AACH","ignoreList":[]}
@@ -12,7 +12,7 @@ exports.startDeflateWorker = startDeflateWorker;
12
12
  var _browserCore = require("@cloudcare/browser-core");
13
13
  var INITIALIZATION_TIME_OUT_DELAY = exports.INITIALIZATION_TIME_OUT_DELAY = 10 * _browserCore.ONE_SECOND;
14
14
  function createDeflateWorker(configuration) {
15
- return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,\"[object ArrayBuffer]\"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.2.36\"};case\"write\":var n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();"])));
15
+ return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,\"[object ArrayBuffer]\"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.2.38\"};case\"write\":var n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();"])));
16
16
  }
17
17
  /**
18
18
  * In order to be sure that the worker is correctly working, we need a round trip of
@@ -1 +1 @@
1
- {"version":3,"file":"serialize.js","names":["_browserCore","require","_getSelectorsFromElement","_constants","_types","_privacy","_serializationUtils","_resourceUtils","_typeof","o","Symbol","iterator","constructor","prototype","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","toPrimitive","call","TypeError","String","Number","SerializationContextStatus","exports","INITIAL_FULL_SNAPSHOT","SUBSEQUENT_FULL_SNAPSHOT","MUTATION","serializeDocument","document","configuration","serializationContext","serializeNodeWithId","parentNodePrivacyLevel","defaultPrivacyLevel","node","options","serializedNode","serializeNode","id","getSerializedNodeId","generateNextId","serializedNodeWithId","setSerializedNodeId","serializedNodeIds","add","nodeType","DOCUMENT_NODE","serializeDocumentNode","DOCUMENT_FRAGMENT_NODE","serializeDocumentFragmentNode","DOCUMENT_TYPE_NODE","serializeDocumentTypeNode","ELEMENT_NODE","serializeElementNode","TEXT_NODE","serializeTextNode","CDATA_SECTION_NODE","serializeCDataNode","type","NodeType","Document","childNodes","serializeChildNodes","adoptedStyleSheets","serializeStyleSheets","documentType","DocumentType","name","publicId","systemId","element","isShadowRoot","isNodeShadowRoot","shadowRootsController","addShadowRoot","DocumentFragment","undefined","tagName","getValidTagName","isSVG","isSVGElement","nodePrivacyLevel","reducePrivacyLevel","getNodeSelfPrivacyLevel","NodePrivacyLevel","HIDDEN","_boundingClientRect","getBoundingClientRect","width","height","Element","attributes","rr_width","rr_height","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_HIDDEN","IGNORE","getAttributesForPrivacyLevel","hasChildNodes","childNodesSerializationOptions","ignoreWhiteSpace","assign","textNode","textContent","getTextContent","Text","CDATA","result","forEachChildNodes","childNode","serializedChildNode","push","serializeAttribute","attributeName","attributeValue","getAttribute","MASK","STABLE_ATTRIBUTES","includes","actionNameAttribute","CENSORED_STRING_MARK","CENSORED_IMG_MARK","startsWith","isLongDataUrl","sanitizeDataUrl","_nextId","TAG_NAME_REGEX","processedTagName","toLowerCase","trim","test","transformAttribute","doc","absoluteToDoc","getAbsoluteSrcsetString","switchToAbsoluteUrl","getHref","safeAttrs","ownerDocument","length","attribute","item","formValue","getElementInputValue","ALLOW","optionElement","selected","stylesheet","Array","from","styleSheets","find","s","href","cssText","getCssRulesString","_cssText","sheet","inputElement","checked","shouldMaskNode","mediaElement","rr_mediaState","paused","scrollTop","scrollLeft","status","Math","round","elementsScrollPositions","set","has","scroll","get","rr_scrollLeft","rr_scrollTop"],"sources":["../../../../src/domain/replay/record/serialize.js"],"sourcesContent":["import {\n assign,\n startsWith,\n isNodeShadowRoot,\n forEachChildNodes,\n hasChildNodes\n} from '@cloudcare/browser-core'\nimport { STABLE_ATTRIBUTES } from '../../rumEventsCollection/actions/getSelectorsFromElement'\nimport {\n NodePrivacyLevel,\n PRIVACY_ATTR_NAME,\n PRIVACY_ATTR_VALUE_HIDDEN,\n CENSORED_STRING_MARK,\n CENSORED_IMG_MARK\n} from '../../../constants'\n\nimport { NodeType } from '../../../types'\nimport {\n getTextContent,\n shouldMaskNode,\n reducePrivacyLevel,\n getNodeSelfPrivacyLevel\n} from './privacy'\nimport {\n getSerializedNodeId,\n setSerializedNodeId,\n getElementInputValue,\n switchToAbsoluteUrl,\n serializeStyleSheets,\n absoluteToDoc,\n getAbsoluteSrcsetString,\n isSVGElement,\n getHref,\n getCssRulesString\n} from './serializationUtils'\nimport {\n isLongDataUrl,\n sanitizeDataUrl\n} from '../../rumEventsCollection/resource/resourceUtils'\n// Those values are the only one that can be used when inheriting privacy levels from parent to\n// children during serialization, since HIDDEN and IGNORE shouldn't serialize their children. This\n// ensures that no children are serialized when they shouldn't.\n\nexport var SerializationContextStatus = {\n INITIAL_FULL_SNAPSHOT: 0,\n SUBSEQUENT_FULL_SNAPSHOT: 1,\n MUTATION: 2\n}\n\nexport function serializeDocument(\n document,\n configuration,\n serializationContext\n) {\n // We are sure that Documents are never ignored, so this function never returns null\n return serializeNodeWithId(document, {\n serializationContext: serializationContext,\n parentNodePrivacyLevel: configuration.defaultPrivacyLevel,\n configuration: configuration\n })\n}\n\nexport function serializeNodeWithId(node, options) {\n var serializedNode = serializeNode(node, options)\n if (!serializedNode) {\n return null\n }\n\n // Try to reuse the previous id\n var id = getSerializedNodeId(node) || generateNextId()\n var serializedNodeWithId = serializedNode\n serializedNodeWithId.id = id\n setSerializedNodeId(node, id)\n if (options.serializedNodeIds) {\n options.serializedNodeIds.add(id)\n }\n return serializedNodeWithId\n}\n\nfunction serializeNode(node, options) {\n switch (node.nodeType) {\n case node.DOCUMENT_NODE:\n return serializeDocumentNode(node, options)\n case node.DOCUMENT_FRAGMENT_NODE:\n return serializeDocumentFragmentNode(node, options)\n case node.DOCUMENT_TYPE_NODE:\n return serializeDocumentTypeNode(node)\n case node.ELEMENT_NODE:\n return serializeElementNode(node, options)\n case node.TEXT_NODE:\n return serializeTextNode(node, options)\n case node.CDATA_SECTION_NODE:\n return serializeCDataNode()\n }\n}\n\nexport function serializeDocumentNode(document, options) {\n return {\n type: NodeType.Document,\n childNodes: serializeChildNodes(document, options),\n adoptedStyleSheets: serializeStyleSheets(document.adoptedStyleSheets)\n }\n}\n\nfunction serializeDocumentTypeNode(documentType) {\n return {\n type: NodeType.DocumentType,\n name: documentType.name,\n publicId: documentType.publicId,\n systemId: documentType.systemId\n }\n}\n\nfunction serializeDocumentFragmentNode(element, options) {\n var isShadowRoot = isNodeShadowRoot(element)\n if (isShadowRoot) {\n options.serializationContext.shadowRootsController.addShadowRoot(element)\n }\n return {\n type: NodeType.DocumentFragment,\n childNodes: serializeChildNodes(element, options),\n isShadowRoot: isShadowRoot,\n adoptedStyleSheets: isShadowRoot\n ? serializeStyleSheets(element.adoptedStyleSheets)\n : undefined\n }\n}\n\n/**\n * Serializing Element nodes involves capturing:\n * 1. HTML ATTRIBUTES:\n * 2. JS STATE:\n * - scroll offsets\n * - Form fields (input value, checkbox checked, option selection, range)\n * - Canvas state,\n * - Media (video/audio) play mode + currentTime\n * - iframe contents\n * - webcomponents\n * 3. CUSTOM PROPERTIES:\n * - height+width for when `hidden` to cover the element\n * 4. EXCLUDED INTERACTION STATE:\n * - focus (possible, but not worth perf impact)\n * - hover (tracked only via mouse activity)\n * - fullscreen mode\n */\nexport function serializeElementNode(element, options) {\n var tagName = getValidTagName(element.tagName)\n var isSVG = isSVGElement(element) || undefined\n\n // For performance reason, we don't use getNodePrivacyLevel directly: we leverage the\n // parentNodePrivacyLevel option to avoid iterating over all parents\n var nodePrivacyLevel = reducePrivacyLevel(\n getNodeSelfPrivacyLevel(element),\n options.parentNodePrivacyLevel\n )\n\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n var _boundingClientRect = element.getBoundingClientRect()\n var width = _boundingClientRect.width\n var height = _boundingClientRect.height\n return {\n type: NodeType.Element,\n tagName: tagName,\n attributes: {\n rr_width: width + 'px',\n rr_height: height + 'px',\n [PRIVACY_ATTR_NAME]: PRIVACY_ATTR_VALUE_HIDDEN\n },\n childNodes: [],\n isSVG: isSVG\n }\n }\n\n // Ignore Elements like Script and some Link, Metas\n if (nodePrivacyLevel === NodePrivacyLevel.IGNORE) {\n return\n }\n\n var attributes = getAttributesForPrivacyLevel(\n element,\n nodePrivacyLevel,\n options\n )\n\n var childNodes = []\n if (hasChildNodes(element) && tagName !== 'style') {\n // OBJECT POOLING OPTIMIZATION:\n // We should not create a new object systematically as it could impact performances. Try to reuse\n // the same object as much as possible, and clone it only if we need to.\n var childNodesSerializationOptions\n if (\n options.parentNodePrivacyLevel === nodePrivacyLevel &&\n options.ignoreWhiteSpace === (tagName === 'head')\n ) {\n childNodesSerializationOptions = options\n } else {\n childNodesSerializationOptions = assign({}, options, {\n parentNodePrivacyLevel: nodePrivacyLevel,\n ignoreWhiteSpace: tagName === 'head'\n })\n }\n childNodes = serializeChildNodes(element, childNodesSerializationOptions)\n }\n\n // if (isNodeShadowHost(element)) {\n // var shadowRoot = serializeNodeWithId(element.shadowRoot, options)\n // if (shadowRoot !== null) {\n // childNodes.push(shadowRoot)\n // }\n // }\n\n return {\n type: NodeType.Element,\n tagName: tagName,\n attributes: attributes,\n childNodes: childNodes,\n isSVG: isSVG\n }\n}\n\n/**\n * Text Nodes are dependant on Element nodes\n * Privacy levels are set on elements so we check the parentElement of a text node\n * for privacy level.\n */\nfunction serializeTextNode(textNode, options) {\n // The parent node may not be a html element which has a tagName attribute.\n // So just let it be undefined which is ok in this use case.\n // var parentTagName = textNode.parentElement && textNode.parentElement.tagName\n var textContent = getTextContent(\n options.configuration,\n textNode,\n options.ignoreWhiteSpace || false,\n options.parentNodePrivacyLevel\n )\n if (textContent === undefined) {\n return\n }\n return {\n type: NodeType.Text,\n textContent: textContent\n // isStyle: parentTagName === 'STYLE' ? true : undefined\n }\n}\n\nfunction serializeCDataNode() {\n return {\n type: NodeType.CDATA,\n textContent: ''\n }\n}\n\nexport function serializeChildNodes(node, options) {\n var result = []\n forEachChildNodes(node, function (childNode) {\n var serializedChildNode = serializeNodeWithId(childNode, options)\n if (serializedChildNode) {\n result.push(serializedChildNode)\n }\n })\n // node.childNodes.forEach()\n return result\n}\n\nexport function serializeAttribute(\n element,\n nodePrivacyLevel,\n attributeName,\n configuration\n) {\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n // dup condition for direct access case\n return null\n }\n var attributeValue = element.getAttribute(attributeName)\n if (\n nodePrivacyLevel === NodePrivacyLevel.MASK &&\n attributeName !== PRIVACY_ATTR_NAME &&\n !STABLE_ATTRIBUTES.includes(attributeName) &&\n attributeName !== configuration.actionNameAttribute\n ) {\n var tagName = element.tagName\n\n switch (attributeName) {\n // Mask Attribute text content\n case 'title':\n case 'alt':\n case 'placeholder':\n return CENSORED_STRING_MARK\n }\n // mask image URLs\n if (tagName === 'IMG' || tagName === 'SOURCE') {\n if (attributeName === 'src' || attributeName === 'srcset') {\n return CENSORED_IMG_MARK\n } else if (attributeName === 'onerror') {\n return null\n }\n }\n // mask <a> URLs\n if (tagName === 'A' && attributeName === 'href') {\n return CENSORED_STRING_MARK\n }\n\n // mask data-* attributes\n if (attributeValue && startsWith(attributeName, 'data-')) {\n // Exception: it's safe to reveal the `${PRIVACY_ATTR_NAME}` attr\n return CENSORED_STRING_MARK\n }\n // mask iframe srcdoc\n if (tagName === 'IFRAME' && attributeName === 'srcdoc') {\n return CENSORED_STRING_MARK\n }\n }\n\n if (!attributeValue || typeof attributeValue !== 'string') {\n return attributeValue\n }\n\n // Minimum Fix for customer.\n // if (\n // attributeValue.length > MAX_ATTRIBUTE_VALUE_CHAR_LENGTH &&\n // attributeValue.slice(0, 5) === 'data:'\n // ) {\n // return 'data:truncated'\n // }\n if (isLongDataUrl(attributeValue)) {\n return sanitizeDataUrl(attributeValue)\n }\n return attributeValue\n}\n\nvar _nextId = 1\nfunction generateNextId() {\n return _nextId++\n}\n\nvar TAG_NAME_REGEX = /[^a-z1-6-_]/\nfunction getValidTagName(tagName) {\n var processedTagName = (tagName + '').toLowerCase().trim()\n\n if (TAG_NAME_REGEX.test(processedTagName)) {\n // if the tag name is odd and we cannot extract\n // anything from the string, then we return a\n // generic div\n return 'div'\n }\n\n return processedTagName\n}\n\nfunction transformAttribute(doc, tagName, name, value) {\n if (!value) return value\n if (\n name === 'src' ||\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))\n ) {\n return absoluteToDoc(doc, value)\n } else if (name === 'xlink:href' && value[0] !== '#') {\n return absoluteToDoc(doc, value)\n } else if (\n name === 'background' &&\n value &&\n (tagName === 'table' || tagName === 'td' || tagName === 'th')\n ) {\n return absoluteToDoc(doc, value)\n } else if (name === 'srcset') {\n return getAbsoluteSrcsetString(doc, value)\n } else if (name === 'style') {\n return switchToAbsoluteUrl(value, getHref())\n } else if (tagName === 'object' && name === 'data') {\n return absoluteToDoc(doc, value)\n } else {\n return value\n }\n}\n\nfunction getAttributesForPrivacyLevel(element, nodePrivacyLevel, options) {\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n return {}\n }\n var safeAttrs = {}\n var tagName = getValidTagName(element.tagName)\n var doc = element.ownerDocument\n\n for (var i = 0; i < element.attributes.length; i += 1) {\n var attribute = element.attributes.item(i)\n var attributeName = attribute.name\n var attributeValue = serializeAttribute(\n element,\n nodePrivacyLevel,\n attributeName,\n options.configuration\n )\n if (attributeValue !== null) {\n safeAttrs[attributeName] = transformAttribute(\n doc,\n tagName,\n attributeName,\n attributeValue\n )\n }\n }\n\n if (\n element.value &&\n (tagName === 'textarea' ||\n tagName === 'select' ||\n tagName === 'option' ||\n tagName === 'input')\n ) {\n var formValue = getElementInputValue(\n options.configuration,\n element,\n nodePrivacyLevel\n )\n if (formValue !== undefined) {\n safeAttrs.value = formValue\n }\n }\n\n /**\n * <Option> can be selected, which occurs if its `value` matches ancestor `<Select>.value`\n */\n if (tagName === 'option' && nodePrivacyLevel === NodePrivacyLevel.ALLOW) {\n // For privacy=`MASK`, all the values would be the same, so skip.\n var optionElement = element\n if (optionElement.selected) {\n safeAttrs.selected = optionElement.selected\n }\n }\n\n // remote css\n if (tagName === 'link') {\n var stylesheet = Array.from(doc.styleSheets).find(function (s) {\n return s.href === element.href\n })\n var cssText = getCssRulesString(stylesheet)\n\n if (cssText && stylesheet) {\n safeAttrs._cssText = cssText\n }\n }\n\n // dynamic stylesheet\n if (tagName === 'style' && element.sheet) {\n var cssText = getCssRulesString(element.sheet)\n if (cssText) {\n safeAttrs._cssText = cssText\n }\n }\n\n /**\n * Forms: input[type=checkbox,radio]\n * The `checked` property for <input> is a little bit special:\n * 1. el.checked is a setter that returns if truthy.\n * 2. getAttribute returns the string value\n * getAttribute('checked') does not sync with `Element.checked`, so use JS property\n * NOTE: `checked` property exists on `HTMLInputElement`. For serializer assumptions, we check for type=radio|check.\n */\n var inputElement = element\n if (\n tagName === 'input' &&\n (inputElement.type === 'radio' || inputElement.type === 'checkbox')\n ) {\n if (nodePrivacyLevel === NodePrivacyLevel.ALLOW) {\n safeAttrs.checked = !!inputElement.checked\n } else if (\n shouldMaskNode(options.configuration, inputElement, nodePrivacyLevel)\n ) {\n delete safeAttrs.checked\n }\n }\n\n /**\n * Serialize the media playback state\n */\n if (tagName === 'audio' || tagName === 'video') {\n var mediaElement = element\n safeAttrs.rr_mediaState = mediaElement.paused ? 'paused' : 'played'\n }\n\n /**\n * Serialize the scroll state for each element only for full snapshot\n */\n var scrollTop\n var scrollLeft\n var serializationContext = options.serializationContext\n switch (serializationContext.status) {\n case SerializationContextStatus.INITIAL_FULL_SNAPSHOT:\n scrollTop = Math.round(element.scrollTop)\n scrollLeft = Math.round(element.scrollLeft)\n if (scrollTop || scrollLeft) {\n serializationContext.elementsScrollPositions.set(element, {\n scrollTop: scrollTop,\n scrollLeft: scrollLeft\n })\n }\n break\n case SerializationContextStatus.SUBSEQUENT_FULL_SNAPSHOT:\n if (serializationContext.elementsScrollPositions.has(element)) {\n const scroll = serializationContext.elementsScrollPositions.get(element)\n scrollTop = scroll.scrollTop\n scrollLeft = scroll.scrollLeft\n }\n break\n }\n if (scrollLeft) {\n safeAttrs.rr_scrollLeft = scrollLeft\n }\n if (scrollTop) {\n safeAttrs.rr_scrollTop = scrollTop\n }\n\n return safeAttrs\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAQA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,mBAAA,GAAAL,OAAA;AAYA,IAAAM,cAAA,GAAAN,OAAA;AAGyD,SAAAO,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAA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E;IAC9C,IAAIoF,YAAY,GAAG3F,OAAO;IAC1BmE,SAAS,CAACyB,aAAa,GAAGD,YAAY,CAACE,MAAM,GAAG,QAAQ,GAAG,QAAQ;EACrE;;EAEA;AACF;AACA;EACE,IAAIC,SAAS;EACb,IAAIC,UAAU;EACd,IAAIvI,oBAAoB,GAAGK,OAAO,CAACL,oBAAoB;EACvD,QAAQA,oBAAoB,CAACwI,MAAM;IACjC,KAAKhJ,0BAA0B,CAACE,qBAAqB;MACnD4I,SAAS,GAAGG,IAAI,CAACC,KAAK,CAAClG,OAAO,CAAC8F,SAAS,CAAC;MACzCC,UAAU,GAAGE,IAAI,CAACC,KAAK,CAAClG,OAAO,CAAC+F,UAAU,CAAC;MAC3C,IAAID,SAAS,IAAIC,UAAU,EAAE;QAC3BvI,oBAAoB,CAAC2I,uBAAuB,CAACC,GAAG,CAACpG,OAAO,EAAE;UACxD8F,SAAS,EAAEA,SAAS;UACpBC,UAAU,EAAEA;QACd,CAAC,CAAC;MACJ;MACA;IACF,KAAK/I,0BAA0B,CAACG,wBAAwB;MACtD,IAAIK,oBAAoB,CAAC2I,uBAAuB,CAACE,GAAG,CAACrG,OAAO,CAAC,EAAE;QAC7D,IAAMsG,MAAM,GAAG9I,oBAAoB,CAAC2I,uBAAuB,CAACI,GAAG,CAACvG,OAAO,CAAC;QACxE8F,SAAS,GAAGQ,MAAM,CAACR,SAAS;QAC5BC,UAAU,GAAGO,MAAM,CAACP,UAAU;MAChC;MACA;EACJ;EACA,IAAIA,UAAU,EAAE;IACd5B,SAAS,CAACqC,aAAa,GAAGT,UAAU;EACtC;EACA,IAAID,SAAS,EAAE;IACb3B,SAAS,CAACsC,YAAY,GAAGX,SAAS;EACpC;EAEA,OAAO3B,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"serialize.js","names":["_browserCore","require","_getSelectorsFromElement","_constants","_types","_privacy","_serializationUtils","_resourceUtils","_typeof","o","Symbol","iterator","constructor","prototype","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","toPrimitive","call","TypeError","String","Number","SerializationContextStatus","exports","INITIAL_FULL_SNAPSHOT","SUBSEQUENT_FULL_SNAPSHOT","MUTATION","serializeDocument","document","configuration","serializationContext","serializeNodeWithId","parentNodePrivacyLevel","defaultPrivacyLevel","node","options","serializedNode","serializeNode","id","getSerializedNodeId","generateNextId","serializedNodeWithId","setSerializedNodeId","serializedNodeIds","add","nodeType","DOCUMENT_NODE","serializeDocumentNode","DOCUMENT_FRAGMENT_NODE","serializeDocumentFragmentNode","DOCUMENT_TYPE_NODE","serializeDocumentTypeNode","ELEMENT_NODE","serializeElementNode","TEXT_NODE","serializeTextNode","CDATA_SECTION_NODE","serializeCDataNode","type","NodeType","Document","childNodes","serializeChildNodes","adoptedStyleSheets","serializeStyleSheets","documentType","DocumentType","name","publicId","systemId","element","isShadowRoot","isNodeShadowRoot","shadowRootsController","addShadowRoot","DocumentFragment","undefined","tagName","getValidTagName","isSVG","isSVGElement","nodePrivacyLevel","reducePrivacyLevel","getNodeSelfPrivacyLevel","NodePrivacyLevel","HIDDEN","_boundingClientRect","getBoundingClientRect","width","height","Element","attributes","rr_width","rr_height","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_HIDDEN","IGNORE","getAttributesForPrivacyLevel","hasChildNodes","childNodesSerializationOptions","ignoreWhiteSpace","assign","textNode","textContent","getTextContent","Text","CDATA","result","forEachChildNodes","childNode","serializedChildNode","push","serializeAttribute","attributeName","attributeValue","getAttribute","MASK","STABLE_ATTRIBUTES","includes","actionNameAttribute","CENSORED_STRING_MARK","CENSORED_IMG_MARK","startsWith","isLongDataUrl","sanitizeDataUrl","_nextId","TAG_NAME_REGEX","processedTagName","toLowerCase","trim","test","transformAttribute","doc","absoluteToDoc","getAbsoluteSrcsetString","switchToAbsoluteUrl","getHref","safeAttrs","ownerDocument","length","attribute","item","formValue","getElementInputValue","ALLOW","optionElement","selected","stylesheet","Array","from","styleSheets","find","s","href","cssText","getCssRulesString","_cssText","sheet","inputElement","checked","shouldMaskNode","mediaElement","rr_mediaState","paused","scrollTop","scrollLeft","status","Math","round","elementsScrollPositions","set","has","scroll","get","rr_scrollLeft","rr_scrollTop"],"sources":["../../../../src/domain/replay/record/serialize.js"],"sourcesContent":["import {\n assign,\n startsWith,\n isNodeShadowRoot,\n forEachChildNodes,\n hasChildNodes\n} from '@cloudcare/browser-core'\nimport { STABLE_ATTRIBUTES } from '../../rumEventsCollection/actions/getSelectorsFromElement'\nimport {\n NodePrivacyLevel,\n PRIVACY_ATTR_NAME,\n PRIVACY_ATTR_VALUE_HIDDEN,\n CENSORED_STRING_MARK,\n CENSORED_IMG_MARK\n} from '../../../constants'\n\nimport { NodeType } from '../../../types'\nimport {\n getTextContent,\n shouldMaskNode,\n reducePrivacyLevel,\n getNodeSelfPrivacyLevel\n} from './privacy'\nimport {\n getSerializedNodeId,\n setSerializedNodeId,\n getElementInputValue,\n switchToAbsoluteUrl,\n serializeStyleSheets,\n absoluteToDoc,\n getAbsoluteSrcsetString,\n isSVGElement,\n getHref,\n getCssRulesString\n} from './serializationUtils'\nimport {\n isLongDataUrl,\n sanitizeDataUrl\n} from '../../rumEventsCollection/resource/resourceUtils'\n// Those values are the only one that can be used when inheriting privacy levels from parent to\n// children during serialization, since HIDDEN and IGNORE shouldn't serialize their children. This\n// ensures that no children are serialized when they shouldn't.\n\nexport var SerializationContextStatus = {\n INITIAL_FULL_SNAPSHOT: 0,\n SUBSEQUENT_FULL_SNAPSHOT: 1,\n MUTATION: 2\n}\n\nexport function serializeDocument(\n document,\n configuration,\n serializationContext\n) {\n // We are sure that Documents are never ignored, so this function never returns null\n return serializeNodeWithId(document, {\n serializationContext: serializationContext,\n parentNodePrivacyLevel: configuration.defaultPrivacyLevel,\n configuration: configuration\n })\n}\n\nexport function serializeNodeWithId(node, options) {\n var serializedNode = serializeNode(node, options)\n if (!serializedNode) {\n return null\n }\n\n // Try to reuse the previous id\n var id = getSerializedNodeId(node) || generateNextId()\n var serializedNodeWithId = serializedNode\n serializedNodeWithId.id = id\n setSerializedNodeId(node, id)\n if (options.serializedNodeIds) {\n options.serializedNodeIds.add(id)\n }\n return serializedNodeWithId\n}\n\nfunction serializeNode(node, options) {\n switch (node.nodeType) {\n case node.DOCUMENT_NODE:\n return serializeDocumentNode(node, options)\n case node.DOCUMENT_FRAGMENT_NODE:\n return serializeDocumentFragmentNode(node, options)\n case node.DOCUMENT_TYPE_NODE:\n return serializeDocumentTypeNode(node)\n case node.ELEMENT_NODE:\n return serializeElementNode(node, options)\n case node.TEXT_NODE:\n return serializeTextNode(node, options)\n case node.CDATA_SECTION_NODE:\n return serializeCDataNode()\n }\n}\n\nexport function serializeDocumentNode(document, options) {\n return {\n type: NodeType.Document,\n childNodes: serializeChildNodes(document, options),\n adoptedStyleSheets: serializeStyleSheets(document.adoptedStyleSheets)\n }\n}\n\nfunction serializeDocumentTypeNode(documentType) {\n return {\n type: NodeType.DocumentType,\n name: documentType.name,\n publicId: documentType.publicId,\n systemId: documentType.systemId\n }\n}\n\nfunction serializeDocumentFragmentNode(element, options) {\n var isShadowRoot = isNodeShadowRoot(element)\n if (isShadowRoot) {\n options.serializationContext.shadowRootsController.addShadowRoot(element)\n }\n return {\n type: NodeType.DocumentFragment,\n childNodes: serializeChildNodes(element, options),\n isShadowRoot: isShadowRoot,\n adoptedStyleSheets: isShadowRoot\n ? serializeStyleSheets(element.adoptedStyleSheets)\n : undefined\n }\n}\n\n/**\n * Serializing Element nodes involves capturing:\n * 1. HTML ATTRIBUTES:\n * 2. JS STATE:\n * - scroll offsets\n * - Form fields (input value, checkbox checked, option selection, range)\n * - Canvas state,\n * - Media (video/audio) play mode + currentTime\n * - iframe contents\n * - webcomponents\n * 3. CUSTOM PROPERTIES:\n * - height+width for when `hidden` to cover the element\n * 4. EXCLUDED INTERACTION STATE:\n * - focus (possible, but not worth perf impact)\n * - hover (tracked only via mouse activity)\n * - fullscreen mode\n */\nexport function serializeElementNode(element, options) {\n var tagName = getValidTagName(element.tagName)\n var isSVG = isSVGElement(element) || undefined\n\n // For performance reason, we don't use getNodePrivacyLevel directly: we leverage the\n // parentNodePrivacyLevel option to avoid iterating over all parents\n var nodePrivacyLevel = reducePrivacyLevel(\n getNodeSelfPrivacyLevel(element),\n options.parentNodePrivacyLevel\n )\n\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n var _boundingClientRect = element.getBoundingClientRect()\n var width = _boundingClientRect.width\n var height = _boundingClientRect.height\n return {\n type: NodeType.Element,\n tagName: tagName,\n attributes: {\n rr_width: width + 'px',\n rr_height: height + 'px',\n [PRIVACY_ATTR_NAME]: PRIVACY_ATTR_VALUE_HIDDEN\n },\n childNodes: [],\n isSVG: isSVG\n }\n }\n\n // Ignore Elements like Script and some Link, Metas\n if (nodePrivacyLevel === NodePrivacyLevel.IGNORE) {\n return\n }\n\n var attributes = getAttributesForPrivacyLevel(\n element,\n nodePrivacyLevel,\n options\n )\n\n var childNodes = []\n if (hasChildNodes(element) && tagName !== 'style') {\n // OBJECT POOLING OPTIMIZATION:\n // We should not create a new object systematically as it could impact performances. Try to reuse\n // the same object as much as possible, and clone it only if we need to.\n var childNodesSerializationOptions\n if (\n options.parentNodePrivacyLevel === nodePrivacyLevel &&\n options.ignoreWhiteSpace === (tagName === 'head')\n ) {\n childNodesSerializationOptions = options\n } else {\n childNodesSerializationOptions = assign({}, options, {\n parentNodePrivacyLevel: nodePrivacyLevel,\n ignoreWhiteSpace: tagName === 'head'\n })\n }\n childNodes = serializeChildNodes(element, childNodesSerializationOptions)\n }\n\n // if (isNodeShadowHost(element)) {\n // var shadowRoot = serializeNodeWithId(element.shadowRoot, options)\n // if (shadowRoot !== null) {\n // childNodes.push(shadowRoot)\n // }\n // }\n\n return {\n type: NodeType.Element,\n tagName: tagName,\n attributes: attributes,\n childNodes: childNodes,\n isSVG: isSVG\n }\n}\n\n/**\n * Text Nodes are dependant on Element nodes\n * Privacy levels are set on elements so we check the parentElement of a text node\n * for privacy level.\n */\nfunction serializeTextNode(textNode, options) {\n // The parent node may not be a html element which has a tagName attribute.\n // So just let it be undefined which is ok in this use case.\n // var parentTagName = textNode.parentElement && textNode.parentElement.tagName\n var textContent = getTextContent(\n options.configuration,\n textNode,\n options.ignoreWhiteSpace || false,\n options.parentNodePrivacyLevel\n )\n if (textContent === undefined) {\n return\n }\n return {\n type: NodeType.Text,\n textContent: textContent\n // isStyle: parentTagName === 'STYLE' ? true : undefined\n }\n}\n\nfunction serializeCDataNode() {\n return {\n type: NodeType.CDATA,\n textContent: ''\n }\n}\n\nexport function serializeChildNodes(node, options) {\n var result = []\n forEachChildNodes(node, function (childNode) {\n var serializedChildNode = serializeNodeWithId(childNode, options)\n if (serializedChildNode) {\n result.push(serializedChildNode)\n }\n })\n // node.childNodes.forEach()\n return result\n}\n\nexport function serializeAttribute(\n element,\n nodePrivacyLevel,\n attributeName,\n configuration\n) {\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n // dup condition for direct access case\n return null\n }\n var attributeValue = element.getAttribute(attributeName)\n if (\n nodePrivacyLevel === NodePrivacyLevel.MASK &&\n attributeName !== PRIVACY_ATTR_NAME &&\n !STABLE_ATTRIBUTES.includes(attributeName) &&\n attributeName !== configuration.actionNameAttribute\n ) {\n var tagName = element.tagName\n\n switch (attributeName) {\n // Mask Attribute text content\n case 'title':\n case 'alt':\n case 'placeholder':\n return CENSORED_STRING_MARK\n }\n // mask image URLs\n if (tagName === 'IMG' || tagName === 'SOURCE') {\n if (attributeName === 'src' || attributeName === 'srcset') {\n return CENSORED_IMG_MARK\n } else if (attributeName === 'onerror') {\n return null\n }\n }\n // mask <a> URLs\n if (tagName === 'A' && attributeName === 'href') {\n return CENSORED_STRING_MARK\n }\n\n // mask data-* attributes\n if (attributeValue && startsWith(attributeName, 'data-')) {\n // Exception: it's safe to reveal the `${PRIVACY_ATTR_NAME}` attr\n return CENSORED_STRING_MARK\n }\n // mask iframe srcdoc\n if (tagName === 'IFRAME' && attributeName === 'srcdoc') {\n return CENSORED_STRING_MARK\n }\n }\n\n if (!attributeValue || typeof attributeValue !== 'string') {\n return attributeValue\n }\n\n // Minimum Fix for customer.\n // if (\n // attributeValue.length > MAX_ATTRIBUTE_VALUE_CHAR_LENGTH &&\n // attributeValue.slice(0, 5) === 'data:'\n // ) {\n // return 'data:truncated'\n // }\n if (isLongDataUrl(attributeValue)) {\n return sanitizeDataUrl(attributeValue)\n }\n return attributeValue\n}\n\nvar _nextId = 1\nfunction generateNextId() {\n return _nextId++\n}\n\nvar TAG_NAME_REGEX = /[^a-z1-6-_]/\nfunction getValidTagName(tagName) {\n var processedTagName = (tagName + '').toLowerCase().trim()\n\n if (TAG_NAME_REGEX.test(processedTagName)) {\n // if the tag name is odd and we cannot extract\n // anything from the string, then we return a\n // generic div\n return 'div'\n }\n\n return processedTagName\n}\n\nfunction transformAttribute(doc, tagName, name, value) {\n if (!value) return value\n if (\n name === 'src' ||\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))\n ) {\n return absoluteToDoc(doc, value)\n } else if (name === 'xlink:href' && value[0] !== '#') {\n return absoluteToDoc(doc, value)\n } else if (\n name === 'background' &&\n value &&\n (tagName === 'table' || tagName === 'td' || tagName === 'th')\n ) {\n return absoluteToDoc(doc, value)\n } else if (name === 'srcset') {\n return getAbsoluteSrcsetString(doc, value)\n } else if (name === 'style') {\n return switchToAbsoluteUrl(value, getHref())\n } else if (tagName === 'object' && name === 'data') {\n return absoluteToDoc(doc, value)\n } else {\n return value\n }\n}\n\nfunction getAttributesForPrivacyLevel(element, nodePrivacyLevel, options) {\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n return {}\n }\n var safeAttrs = {}\n var tagName = getValidTagName(element.tagName)\n var doc = element.ownerDocument\n\n for (var i = 0; i < element.attributes.length; i += 1) {\n var attribute = element.attributes.item(i)\n var attributeName = attribute.name\n var attributeValue = serializeAttribute(\n element,\n nodePrivacyLevel,\n attributeName,\n options.configuration\n )\n if (attributeValue !== null) {\n safeAttrs[attributeName] = transformAttribute(\n doc,\n tagName,\n attributeName,\n attributeValue\n )\n }\n }\n\n if (\n element.value &&\n (tagName === 'textarea' ||\n tagName === 'select' ||\n tagName === 'option' ||\n tagName === 'input')\n ) {\n var formValue = getElementInputValue(\n options.configuration,\n element,\n nodePrivacyLevel\n )\n if (formValue !== undefined) {\n safeAttrs.value = formValue\n }\n }\n\n /**\n * <Option> can be selected, which occurs if its `value` matches ancestor `<Select>.value`\n */\n if (tagName === 'option' && nodePrivacyLevel === NodePrivacyLevel.ALLOW) {\n // For privacy=`MASK`, all the values would be the same, so skip.\n var optionElement = element\n if (optionElement.selected) {\n safeAttrs.selected = optionElement.selected\n }\n }\n\n // remote css\n if (tagName === 'link') {\n var stylesheet = Array.from(doc.styleSheets).find(function (s) {\n return s.href === element.href\n })\n var cssText = getCssRulesString(stylesheet)\n if (cssText && stylesheet) {\n safeAttrs._cssText = cssText\n }\n }\n\n // dynamic stylesheet\n if (tagName === 'style' && element.sheet) {\n var cssText = getCssRulesString(element.sheet)\n if (cssText) {\n safeAttrs._cssText = cssText\n }\n }\n\n /**\n * Forms: input[type=checkbox,radio]\n * The `checked` property for <input> is a little bit special:\n * 1. el.checked is a setter that returns if truthy.\n * 2. getAttribute returns the string value\n * getAttribute('checked') does not sync with `Element.checked`, so use JS property\n * NOTE: `checked` property exists on `HTMLInputElement`. For serializer assumptions, we check for type=radio|check.\n */\n var inputElement = element\n if (\n tagName === 'input' &&\n (inputElement.type === 'radio' || inputElement.type === 'checkbox')\n ) {\n if (nodePrivacyLevel === NodePrivacyLevel.ALLOW) {\n safeAttrs.checked = !!inputElement.checked\n } else if (\n shouldMaskNode(options.configuration, inputElement, nodePrivacyLevel)\n ) {\n delete safeAttrs.checked\n }\n }\n\n /**\n * Serialize the media playback state\n */\n if (tagName === 'audio' || tagName === 'video') {\n var mediaElement = element\n safeAttrs.rr_mediaState = mediaElement.paused ? 'paused' : 'played'\n }\n\n /**\n * Serialize the scroll state for each element only for full snapshot\n */\n var scrollTop\n var scrollLeft\n var serializationContext = options.serializationContext\n switch (serializationContext.status) {\n case SerializationContextStatus.INITIAL_FULL_SNAPSHOT:\n scrollTop = Math.round(element.scrollTop)\n scrollLeft = Math.round(element.scrollLeft)\n if (scrollTop || scrollLeft) {\n serializationContext.elementsScrollPositions.set(element, {\n scrollTop: scrollTop,\n scrollLeft: scrollLeft\n })\n }\n break\n case SerializationContextStatus.SUBSEQUENT_FULL_SNAPSHOT:\n if (serializationContext.elementsScrollPositions.has(element)) {\n const scroll = serializationContext.elementsScrollPositions.get(element)\n scrollTop = scroll.scrollTop\n scrollLeft = scroll.scrollLeft\n }\n break\n }\n if (scrollLeft) {\n safeAttrs.rr_scrollLeft = scrollLeft\n }\n if (scrollTop) {\n safeAttrs.rr_scrollTop = scrollTop\n }\n\n return safeAttrs\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAQA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,mBAAA,GAAAL,OAAA;AAYA,IAAAM,cAAA,GAAAN,OAAA;AAGyD,SAAAO,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KA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}
@@ -28,6 +28,7 @@ function startActionCollection(lifeCycle, domMutationObservable, configuration,
28
28
  };
29
29
  }
30
30
  function processAction(action, pageStateHistory) {
31
+ var _action$context;
31
32
  var autoActionProperties = isAutoAction(action) ? {
32
33
  action: {
33
34
  error: {
@@ -53,7 +54,7 @@ function processAction(action, pageStateHistory) {
53
54
  }
54
55
  } : {
55
56
  action: {
56
- loadingTime: 0
57
+ loadingTime: ((_action$context = action.context) === null || _action$context === void 0 ? void 0 : _action$context.duration) || 0
57
58
  }
58
59
  };
59
60
  var customerContext = !isAutoAction(action) ? action.context : undefined;
@@ -82,6 +83,7 @@ function processAction(action, pageStateHistory) {
82
83
  };
83
84
  }
84
85
  function isAutoAction(action) {
85
- return action.type !== _browserCore.ActionType.CUSTOM;
86
+ return action.type === _browserCore.ActionType.CLICK;
87
+ // return action.type !== ActionType.CUSTOM
86
88
  }
87
89
  //# sourceMappingURL=actionCollection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actionCollection.js","names":["_browserCore","require","_trackClickActions","_pageStateHistory","startActionCollection","lifeCycle","domMutationObservable","configuration","pageStateHistory","subscribe","LifeCycleEventType","AUTO_ACTION_COMPLETED","action","notify","RAW_RUM_EVENT_COLLECTED","processAction","actionContexts","findActionId","noop","findAllActionId","trackUserInteractions","trackClickActions","addAction","savedCommonContext","extend","autoActionProperties","isAutoAction","error","count","counts","errorCount","id","loadingTime","discardNegativeDuration","toServerDuration","duration","frustration","type","frustrationTypes","long_task","longTaskCount","resource","resourceCount","_gc","target","position","customerContext","context","undefined","actionEvent","extend2Lev","UUID","name","date","startClocks","timeStamp","RumEventType","ACTION","view","in_foreground","wasInPageStateAt","PageState","ACTIVE","relative","rawRumEvent","startTime","domainContext","event","events","ActionType","CUSTOM"],"sources":["../../../../src/domain/rumEventsCollection/actions/actionCollection.js"],"sourcesContent":["import {\n toServerDuration,\n extend,\n extend2Lev,\n ActionType,\n RumEventType,\n LifeCycleEventType,\n UUID,\n noop,\n discardNegativeDuration\n} from '@cloudcare/browser-core'\nimport { trackClickActions } from './trackClickActions'\nimport { PageState } from '../../contexts/pageStateHistory'\nexport function startActionCollection(\n lifeCycle,\n domMutationObservable,\n configuration,\n pageStateHistory\n) {\n lifeCycle.subscribe(\n LifeCycleEventType.AUTO_ACTION_COMPLETED,\n function (action) {\n lifeCycle.notify(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n processAction(action, pageStateHistory)\n )\n }\n )\n\n var actionContexts = { findActionId: noop, findAllActionId: noop }\n if (configuration.trackUserInteractions) {\n actionContexts = trackClickActions(\n lifeCycle,\n domMutationObservable,\n configuration\n ).actionContexts\n }\n return {\n actionContexts: actionContexts,\n addAction: function (action, savedCommonContext) {\n lifeCycle.notify(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n extend(\n { savedCommonContext: savedCommonContext },\n processAction(action, pageStateHistory)\n )\n )\n }\n }\n}\n\nfunction processAction(action, pageStateHistory) {\n var autoActionProperties = isAutoAction(action)\n ? {\n action: {\n error: {\n count: action.counts.errorCount\n },\n id: action.id,\n loadingTime: discardNegativeDuration(\n toServerDuration(action.duration)\n ),\n frustration: {\n type: action.frustrationTypes\n },\n long_task: {\n count: action.counts.longTaskCount\n },\n resource: {\n count: action.counts.resourceCount\n }\n },\n _gc: {\n action: {\n target: action.target,\n position: action.position\n }\n }\n }\n : {\n action: {\n loadingTime: 0\n }\n }\n var customerContext = !isAutoAction(action) ? action.context : undefined\n var actionEvent = extend2Lev(\n {\n action: {\n id: UUID(),\n target: {\n name: action.name\n },\n type: action.type\n },\n date: action.startClocks.timeStamp,\n type: RumEventType.ACTION,\n view: {\n in_foreground: pageStateHistory.wasInPageStateAt(\n PageState.ACTIVE,\n action.startClocks.relative\n )\n }\n },\n autoActionProperties\n )\n\n return {\n customerContext: customerContext,\n rawRumEvent: actionEvent,\n startTime: action.startClocks.relative,\n domainContext: isAutoAction(action)\n ? { event: action.event, events: action.events }\n : {}\n }\n}\n\nfunction isAutoAction(action) {\n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C/B;MAAEuD,KAAK,EAAEvD,MAAM,CAACuD,KAAK;MAAEC,MAAM,EAAExD,MAAM,CAACwD;IAAO,CAAC,GAC9C,CAAC;EACP,CAAC;AACH;AAEA,SAAS1C,YAAYA,CAACd,MAAM,EAAE;EAC5B,OAAOA,MAAM,CAACyB,IAAI,KAAKgC,uBAAU,CAACC,MAAM;AAC1C","ignoreList":[]}
1
+ {"version":3,"file":"actionCollection.js","names":["_browserCore","require","_trackClickActions","_pageStateHistory","startActionCollection","lifeCycle","domMutationObservable","configuration","pageStateHistory","subscribe","LifeCycleEventType","AUTO_ACTION_COMPLETED","action","notify","RAW_RUM_EVENT_COLLECTED","processAction","actionContexts","findActionId","noop","findAllActionId","trackUserInteractions","trackClickActions","addAction","savedCommonContext","extend","_action$context","autoActionProperties","isAutoAction","error","count","counts","errorCount","id","loadingTime","discardNegativeDuration","toServerDuration","duration","frustration","type","frustrationTypes","long_task","longTaskCount","resource","resourceCount","_gc","target","position","context","customerContext","undefined","actionEvent","extend2Lev","UUID","name","date","startClocks","timeStamp","RumEventType","ACTION","view","in_foreground","wasInPageStateAt","PageState","ACTIVE","relative","rawRumEvent","startTime","domainContext","event","events","ActionType","CLICK"],"sources":["../../../../src/domain/rumEventsCollection/actions/actionCollection.js"],"sourcesContent":["import {\n toServerDuration,\n extend,\n extend2Lev,\n ActionType,\n RumEventType,\n LifeCycleEventType,\n UUID,\n noop,\n discardNegativeDuration\n} from '@cloudcare/browser-core'\nimport { trackClickActions } from './trackClickActions'\nimport { PageState } from '../../contexts/pageStateHistory'\nexport function startActionCollection(\n lifeCycle,\n domMutationObservable,\n configuration,\n pageStateHistory\n) {\n lifeCycle.subscribe(\n LifeCycleEventType.AUTO_ACTION_COMPLETED,\n function (action) {\n lifeCycle.notify(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n processAction(action, pageStateHistory)\n )\n }\n )\n\n var actionContexts = { findActionId: noop, findAllActionId: noop }\n if (configuration.trackUserInteractions) {\n actionContexts = trackClickActions(\n lifeCycle,\n domMutationObservable,\n configuration\n ).actionContexts\n }\n return {\n actionContexts: actionContexts,\n addAction: function (action, savedCommonContext) {\n lifeCycle.notify(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n extend(\n { savedCommonContext: savedCommonContext },\n processAction(action, pageStateHistory)\n )\n )\n }\n }\n}\n\nfunction processAction(action, pageStateHistory) {\n var autoActionProperties = isAutoAction(action)\n ? {\n action: {\n error: {\n count: action.counts.errorCount\n },\n id: action.id,\n loadingTime: discardNegativeDuration(\n toServerDuration(action.duration)\n ),\n frustration: {\n type: action.frustrationTypes\n },\n long_task: {\n count: action.counts.longTaskCount\n },\n resource: {\n count: action.counts.resourceCount\n }\n },\n _gc: {\n action: {\n target: action.target,\n position: action.position\n }\n }\n }\n : {\n action: {\n loadingTime: action.context?.duration || 0\n }\n }\n var customerContext = !isAutoAction(action) ? action.context : undefined\n var actionEvent = extend2Lev(\n {\n action: {\n id: UUID(),\n target: {\n name: action.name\n },\n type: action.type\n },\n date: action.startClocks.timeStamp,\n type: RumEventType.ACTION,\n view: {\n in_foreground: pageStateHistory.wasInPageStateAt(\n PageState.ACTIVE,\n action.startClocks.relative\n )\n }\n },\n autoActionProperties\n )\n\n return {\n customerContext: customerContext,\n rawRumEvent: actionEvent,\n startTime: action.startClocks.relative,\n domainContext: isAutoAction(action)\n ? { event: action.event, events: action.events }\n : {}\n }\n}\n\nfunction isAutoAction(action) {\n return action.type === ActionType.CLICK\n // return action.type !== ActionType.CUSTOM\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAWA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACO,SAASG,qBAAqBA,CACnCC,SAAS,EACTC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChB;EACAH,SAAS,CAACI,SAAS,CACjBC,+BAAkB,CAACC,qBAAqB,EACxC,UAAUC,MAAM,EAAE;IAChBP,SAAS,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gC,uBAAU,CAACC,KAAK;EACvC;AACF","ignoreList":[]}
@@ -24,7 +24,11 @@ function initUsrLocalStorage() {
24
24
  return usrCacheId;
25
25
  }
26
26
  var startCacheUsrCache = exports.startCacheUsrCache = function startCacheUsrCache(configuration) {
27
- if (!configuration.sessionStoreStrategyType) return;
27
+ if (!configuration.sessionStoreStrategyType) {
28
+ return {
29
+ getId: _browserCore.noop
30
+ };
31
+ }
28
32
  var usrCacheId;
29
33
  if (configuration.sessionStoreStrategyType.type === _browserCore.SessionPersistence.COOKIE) {
30
34
  usrCacheId = initUsrCookie(configuration.sessionStoreStrategyType.cookieOptions);