@sentry/svelte 7.92.0 → 7.93.0

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.
@@ -44,6 +44,7 @@ function trackComponent(options) {
44
44
  }
45
45
 
46
46
  function recordInitSpan(transaction, componentName) {
47
+ // eslint-disable-next-line deprecation/deprecation
47
48
  const initSpan = transaction.startChild({
48
49
  op: constants.UI_SVELTE_INIT,
49
50
  description: componentName,
@@ -72,6 +73,7 @@ function recordUpdateSpans(componentName, initSpan) {
72
73
  const parentSpan =
73
74
  initSpan && !initSpan.endTimestamp && initSpan.transaction === transaction ? initSpan : transaction;
74
75
 
76
+ // eslint-disable-next-line deprecation/deprecation
75
77
  updateSpan = parentSpan.startChild({
76
78
  op: constants.UI_SVELTE_UPDATE,
77
79
  description: componentName,
@@ -89,6 +91,7 @@ function recordUpdateSpans(componentName, initSpan) {
89
91
  }
90
92
 
91
93
  function getActiveTransaction() {
94
+ // eslint-disable-next-line deprecation/deprecation
92
95
  return browser.getCurrentScope().getTransaction();
93
96
  }
94
97
 
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { getCurrentScope } from '@sentry/browser';\nimport type { Span, Transaction } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\n * Alternatively, you can call it yourself if you don't want to use the preprocessor.\n */\nexport function trackComponent(options?: TrackComponentOptions): void {\n const mergedOptions = { ...defaultTrackComponentOptions, ...options };\n\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n const customComponentName = mergedOptions.componentName;\n\n // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(transaction, componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(transaction: Transaction, componentName: string): Span {\n const initSpan = transaction.startChild({\n op: UI_SVELTE_INIT,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n\n onMount(() => {\n initSpan.end();\n });\n\n return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && !initSpan.endTimestamp && initSpan.transaction === transaction ? initSpan : transaction;\n\n updateSpan = parentSpan.startChild({\n op: UI_SVELTE_UPDATE,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n\nfunction getActiveTransaction(): Transaction | undefined {\n return getCurrentScope().getTransaction();\n}\n"],"names":["current_component","DEFAULT_COMPONENT_NAME","UI_SVELTE_INIT","onMount","beforeUpdate","UI_SVELTE_UPDATE","afterUpdate","getCurrentScope"],"mappings":";;;;;;;AAQA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;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,UAAU,CAAA;AAChB,EAAEC,mBAAY,CAAC,MAAM;AACrB;AACA;AACA,IAAI,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC9C,IAAI,IAAI,CAAC,WAAW,EAAE;AACtB,MAAM,OAAM;AACZ,KAAI;AACJ;AACA;AACA;AACA,IAAI,MAAM,UAAW;AACrB,MAAM,QAAS,IAAG,CAAC,QAAQ,CAAC,YAAa,IAAG,QAAQ,CAAC,gBAAgB,WAAA,GAAc,QAAA,GAAW,WAAW,CAAA;AACzG;AACA,IAAI,UAAW,GAAE,UAAU,CAAC,UAAU,CAAC;AACvC,MAAM,EAAE,EAAEC,0BAAgB;AAC1B,MAAM,WAAW,EAAE,aAAa;AAChC,MAAM,MAAM,EAAE,gBAAgB;AAC9B,KAAK,CAAC,CAAA;AACN,GAAG,CAAC,CAAA;AACJ;AACA,EAAEC,kBAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,oBAAoB,GAA4B;AACzD,EAAE,OAAOC,uBAAe,EAAE,CAAC,cAAc,EAAE,CAAA;AAC3C;;;;"}
1
+ {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { getCurrentScope } from '@sentry/browser';\nimport type { Span, Transaction } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\n * Alternatively, you can call it yourself if you don't want to use the preprocessor.\n */\nexport function trackComponent(options?: TrackComponentOptions): void {\n const mergedOptions = { ...defaultTrackComponentOptions, ...options };\n\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n const customComponentName = mergedOptions.componentName;\n\n // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(transaction, componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(transaction: Transaction, componentName: string): Span {\n // eslint-disable-next-line deprecation/deprecation\n const initSpan = transaction.startChild({\n op: UI_SVELTE_INIT,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n\n onMount(() => {\n initSpan.end();\n });\n\n return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && !initSpan.endTimestamp && initSpan.transaction === transaction ? initSpan : transaction;\n\n // eslint-disable-next-line deprecation/deprecation\n updateSpan = parentSpan.startChild({\n op: UI_SVELTE_UPDATE,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n\nfunction getActiveTransaction(): Transaction | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getTransaction();\n}\n"],"names":["current_component","DEFAULT_COMPONENT_NAME","UI_SVELTE_INIT","onMount","beforeUpdate","UI_SVELTE_UPDATE","afterUpdate","getCurrentScope"],"mappings":";;;;;;;AAQA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS,CAAA;AACvE;AACA,EAAE,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC5C,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,mBAAA,GAAsB,aAAa,CAAC,aAAa,CAAA;AACzD;AACA;AACA;AACA,EAAE,MAAM,aAAc,GAAE,CAAC,CAAC,EAAE,mBAAoB,IAAGA,0BAAiB,CAAC,WAAW,CAAC,IAAA,IAAQC,gCAAsB,CAAC,CAAC,CAAC,CAAA;AAClH;AACA,EAAE,IAAI,QAAQ,GAAqB,SAAS,CAAA;AAC5C,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,WAAW,cAAc,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AACzD,GAAE;AACF;AACA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;AAC9C,GAAE;AACF,CAAA;AACA;AACA,SAAS,cAAc,CAAC,WAAW,EAAe,aAAa,EAAgB;AAC/E;AACA,EAAE,MAAM,QAAS,GAAE,WAAW,CAAC,UAAU,CAAC;AAC1C,IAAI,EAAE,EAAEC,wBAAc;AACtB,IAAI,WAAW,EAAE,aAAa;AAC9B,IAAI,MAAM,EAAE,gBAAgB;AAC5B,GAAG,CAAC,CAAA;AACJ;AACA,EAAEC,cAAO,CAAC,MAAM;AAChB,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAA;AAClB,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,OAAO,QAAQ,CAAA;AACjB,CAAA;AACA;AACA,SAAS,iBAAiB,CAAC,aAAa,EAAU,QAAQ,EAAe;AACzE,EAAE,IAAI,UAAU,CAAA;AAChB,EAAEC,mBAAY,CAAC,MAAM;AACrB;AACA;AACA,IAAI,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC9C,IAAI,IAAI,CAAC,WAAW,EAAE;AACtB,MAAM,OAAM;AACZ,KAAI;AACJ;AACA;AACA;AACA,IAAI,MAAM,UAAW;AACrB,MAAM,QAAS,IAAG,CAAC,QAAQ,CAAC,YAAa,IAAG,QAAQ,CAAC,gBAAgB,WAAA,GAAc,QAAA,GAAW,WAAW,CAAA;AACzG;AACA;AACA,IAAI,UAAW,GAAE,UAAU,CAAC,UAAU,CAAC;AACvC,MAAM,EAAE,EAAEC,0BAAgB;AAC1B,MAAM,WAAW,EAAE,aAAa;AAChC,MAAM,MAAM,EAAE,gBAAgB;AAC9B,KAAK,CAAC,CAAA;AACN,GAAG,CAAC,CAAA;AACJ;AACA,EAAEC,kBAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,oBAAoB,GAA4B;AACzD;AACA,EAAE,OAAOC,uBAAe,EAAE,CAAC,cAAc,EAAE,CAAA;AAC3C;;;;"}
@@ -42,6 +42,7 @@ function trackComponent(options) {
42
42
  }
43
43
 
44
44
  function recordInitSpan(transaction, componentName) {
45
+ // eslint-disable-next-line deprecation/deprecation
45
46
  const initSpan = transaction.startChild({
46
47
  op: UI_SVELTE_INIT,
47
48
  description: componentName,
@@ -70,6 +71,7 @@ function recordUpdateSpans(componentName, initSpan) {
70
71
  const parentSpan =
71
72
  initSpan && !initSpan.endTimestamp && initSpan.transaction === transaction ? initSpan : transaction;
72
73
 
74
+ // eslint-disable-next-line deprecation/deprecation
73
75
  updateSpan = parentSpan.startChild({
74
76
  op: UI_SVELTE_UPDATE,
75
77
  description: componentName,
@@ -87,6 +89,7 @@ function recordUpdateSpans(componentName, initSpan) {
87
89
  }
88
90
 
89
91
  function getActiveTransaction() {
92
+ // eslint-disable-next-line deprecation/deprecation
90
93
  return getCurrentScope().getTransaction();
91
94
  }
92
95
 
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { getCurrentScope } from '@sentry/browser';\nimport type { Span, Transaction } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\n * Alternatively, you can call it yourself if you don't want to use the preprocessor.\n */\nexport function trackComponent(options?: TrackComponentOptions): void {\n const mergedOptions = { ...defaultTrackComponentOptions, ...options };\n\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n const customComponentName = mergedOptions.componentName;\n\n // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(transaction, componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(transaction: Transaction, componentName: string): Span {\n const initSpan = transaction.startChild({\n op: UI_SVELTE_INIT,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n\n onMount(() => {\n initSpan.end();\n });\n\n return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && !initSpan.endTimestamp && initSpan.transaction === transaction ? initSpan : transaction;\n\n updateSpan = parentSpan.startChild({\n op: UI_SVELTE_UPDATE,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n\nfunction getActiveTransaction(): Transaction | undefined {\n return getCurrentScope().getTransaction();\n}\n"],"names":[],"mappings":";;;;;AAQA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS,CAAA;AACvE;AACA,EAAE,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC5C,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,mBAAA,GAAsB,aAAa,CAAC,aAAa,CAAA;AACzD;AACA;AACA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AAU,CAAC,UAAU,CAAC;AACvC,MAAM,EAAE,EAAE,gBAAgB;AAC1B,MAAM,WAAW,EAAE,aAAa;AAChC,MAAM,MAAM,EAAE,gBAAgB;AAC9B,KAAK,CAAC,CAAA;AACN,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,WAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,oBAAoB,GAA4B;AACzD,EAAE,OAAO,eAAe,EAAE,CAAC,cAAc,EAAE,CAAA;AAC3C;;;;"}
1
+ {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { getCurrentScope } from '@sentry/browser';\nimport type { Span, Transaction } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\n * Alternatively, you can call it yourself if you don't want to use the preprocessor.\n */\nexport function trackComponent(options?: TrackComponentOptions): void {\n const mergedOptions = { ...defaultTrackComponentOptions, ...options };\n\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n const customComponentName = mergedOptions.componentName;\n\n // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(transaction, componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(transaction: Transaction, componentName: string): Span {\n // eslint-disable-next-line deprecation/deprecation\n const initSpan = transaction.startChild({\n op: UI_SVELTE_INIT,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n\n onMount(() => {\n initSpan.end();\n });\n\n return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && !initSpan.endTimestamp && initSpan.transaction === transaction ? initSpan : transaction;\n\n // eslint-disable-next-line deprecation/deprecation\n updateSpan = parentSpan.startChild({\n op: UI_SVELTE_UPDATE,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n\nfunction getActiveTransaction(): Transaction | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getTransaction();\n}\n"],"names":[],"mappings":";;;;;AAQA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS,CAAA;AACvE;AACA,EAAE,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC5C,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,MAAM,QAAS,IAAG,CAAC,QAAQ,CAAC,YAAa,IAAG,QAAQ,CAAC,gBAAgB,WAAA,GAAc,QAAA,GAAW,WAAW,CAAA;AACzG;AACA;AACA,IAAI,UAAW,GAAE,UAAU,CAAC,UAAU,CAAC;AACvC,MAAM,EAAE,EAAE,gBAAgB;AAC1B,MAAM,WAAW,EAAE,aAAa;AAChC,MAAM,MAAM,EAAE,gBAAgB;AAC9B,KAAK,CAAC,CAAA;AACN,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,WAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,oBAAoB,GAA4B;AACzD;AACA,EAAE,OAAO,eAAe,EAAE,CAAC,cAAc,EAAE,CAAA;AAC3C;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/svelte",
3
- "version": "7.92.0",
3
+ "version": "7.93.0",
4
4
  "description": "Official Sentry SDK for Svelte",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte",
@@ -29,9 +29,9 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@sentry/browser": "7.92.0",
33
- "@sentry/types": "7.92.0",
34
- "@sentry/utils": "7.92.0",
32
+ "@sentry/browser": "7.93.0",
33
+ "@sentry/types": "7.93.0",
34
+ "@sentry/utils": "7.93.0",
35
35
  "magic-string": "^0.30.0"
36
36
  },
37
37
  "peerDependencies": {