@lwrjs/client-modules 0.12.0-alpha.2 → 0.12.0-alpha.21

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.
@@ -699,24 +699,24 @@ const {
699
699
  delete: SetProtoDelete$LWS,
700
700
  entries: SetProtoEntries$LWS,
701
701
  forEach: SetProtoForEach$LWS,
702
- has: SetProtoHas$LWS,
702
+ has: SetProtoHas$LWS$1,
703
703
  keys: SetProtoKeys$LWS,
704
704
  [SymbolIterator$LWS$1]: SetProtoSymbolIterator$LWS,
705
705
  [SymbolToStringTag$LWS$1]: SetProtoSymbolToStringTag$LWS
706
706
  } = SetProto$LWS$1;
707
707
  const {
708
- add: SetProtoAdd$LWS,
709
- values: SetProtoValues$LWS
708
+ add: SetProtoAdd$LWS$1,
709
+ values: SetProtoValues$LWS$1
710
710
  } = SetProto$LWS$1;
711
711
  const SetProtoSizeGetter$LWS = ObjectLookupOwnGetter$LWS$1(SetProto$LWS$1, 'size');
712
712
  function toSafeSet$LWS(set$LWS) {
713
713
  ReflectSetPrototypeOf$LWS$1(set$LWS, null);
714
- set$LWS.add = SetProtoAdd$LWS;
714
+ set$LWS.add = SetProtoAdd$LWS$1;
715
715
  set$LWS.clear = SetProtoClear$LWS;
716
716
  set$LWS.delete = SetProtoDelete$LWS;
717
717
  set$LWS.entries = SetProtoEntries$LWS;
718
718
  set$LWS.forEach = SetProtoForEach$LWS;
719
- set$LWS.has = SetProtoHas$LWS;
719
+ set$LWS.has = SetProtoHas$LWS$1;
720
720
  set$LWS.keys = SetProtoKeys$LWS;
721
721
  ReflectDefineProperty$LWS$1(set$LWS, 'size', {
722
722
  __proto__: null,
@@ -725,7 +725,7 @@ function toSafeSet$LWS(set$LWS) {
725
725
  get: SetProtoSizeGetter$LWS,
726
726
  set: undefined
727
727
  });
728
- set$LWS.values = SetProtoValues$LWS;
728
+ set$LWS.values = SetProtoValues$LWS$1;
729
729
  set$LWS[SymbolIterator$LWS$1] = SetProtoSymbolIterator$LWS;
730
730
  set$LWS[SymbolToStringTag$LWS$1] = SetProtoSymbolToStringTag$LWS;
731
731
  ReflectSetPrototypeOf$LWS$1(set$LWS, SetProto$LWS$1);
@@ -1073,7 +1073,7 @@ function cloneSet$LWS(set$LWS, queue$LWS) {
1073
1073
  // Step 26.2.1: Let copiedList be a new empty List.
1074
1074
  const clone$LWS = new SetCtor$LWS$1();
1075
1075
  // Step 26.2.2: For each entry of value.[[SetData]]...
1076
- const valuesIterable$LWS = ReflectApply$LWS$1(SetProtoValues$LWS, set$LWS, []);
1076
+ const valuesIterable$LWS = ReflectApply$LWS$1(SetProtoValues$LWS$1, set$LWS, []);
1077
1077
  // Step 26.2.3: For each entry of copiedList:
1078
1078
  let {
1079
1079
  length: queueOffset$LWS
@@ -1089,7 +1089,7 @@ function cloneSet$LWS(set$LWS, queue$LWS) {
1089
1089
  }
1090
1090
  // Step 26.2.3.1: Let serializedEntry be ? StructuredSerializeInternal(entry, forStorage, memory).
1091
1091
  queue$LWS[queueOffset$LWS++] = [subCloneValue$LWS => {
1092
- ReflectApply$LWS$1(SetProtoAdd$LWS, clone$LWS, [subCloneValue$LWS]);
1092
+ ReflectApply$LWS$1(SetProtoAdd$LWS$1, clone$LWS, [subCloneValue$LWS]);
1093
1093
  }, subValue$LWS];
1094
1094
  }
1095
1095
  return clone$LWS;
@@ -1453,7 +1453,7 @@ const {
1453
1453
  } = PromiseCtor$LWS.prototype;
1454
1454
  const PromiseResolve$LWS = PromiseCtor$LWS.resolve.bind(PromiseCtor$LWS);
1455
1455
  const PromiseReject$LWS = PromiseCtor$LWS.reject.bind(PromiseCtor$LWS);
1456
- /*! version: 0.20.8 */
1456
+ /*! version: 0.21.3 */
1457
1457
 
1458
1458
  /*!
1459
1459
  * Copyright (C) 2019 salesforce.com, inc.
@@ -2112,7 +2112,7 @@ const {
2112
2112
  const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'responseText');
2113
2113
  const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'status');
2114
2114
  ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
2115
- /*! version: 0.20.8 */
2115
+ /*! version: 0.21.3 */
2116
2116
 
2117
2117
  /*!
2118
2118
  * Copyright (C) 2019 salesforce.com, inc.
@@ -2171,7 +2171,7 @@ function sanitizeURLForElement$LWS(url$LWS) {
2171
2171
  function sanitizeURLString$LWS(urlString$LWS) {
2172
2172
  return urlString$LWS === '' ? urlString$LWS : ReflectApply$LWS$1(StringProtoReplace$LWS, urlString$LWS, [newlinesAndTabsRegExp$LWS, '']);
2173
2173
  }
2174
- /*! version: 0.20.8 */
2174
+ /*! version: 0.21.3 */
2175
2175
 
2176
2176
  /*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */
2177
2177
 
@@ -3857,7 +3857,7 @@ try {
3857
3857
  // swallow
3858
3858
  }
3859
3859
  const trusted = createPolicy('trusted', policyOptions);
3860
- /*! version: 0.20.8 */
3860
+ /*! version: 0.21.3 */
3861
3861
 
3862
3862
  /*!
3863
3863
  * Copyright (C) 2019 salesforce.com, inc.
@@ -4106,7 +4106,7 @@ function blobSanitizer$LWS(sandboxKey$LWS) {
4106
4106
  }
4107
4107
  return getSanitizerForConfig$LWS(sandboxKey$LWS, 'STRING_BLOB_HTML');
4108
4108
  }
4109
- /*! version: 0.20.8 */
4109
+ /*! version: 0.21.3 */
4110
4110
 
4111
4111
  /*!
4112
4112
  * Copyright (C) 2023 salesforce.com, inc.
@@ -4304,7 +4304,7 @@ function encloseSrcSetter$LWS(targetElement$LWS) {
4304
4304
  ReflectApply$LWS$1(ElementProtoSetAttributeNS$LWS, targetElement$LWS, [attributeNamespaceURI$LWS, attributeName$LWS, src$LWS]);
4305
4305
  };
4306
4306
  }
4307
- /*! version: 0.20.8 */
4307
+ /*! version: 0.21.3 */
4308
4308
 
4309
4309
  /*!
4310
4310
  * Copyright (C) 2019 salesforce.com, inc.
@@ -5887,7 +5887,7 @@ function initDistortionDocumentExecCommand$LWS({
5887
5887
  if (length$LWS >= 1) {
5888
5888
  const command$LWS = toString$LWS(args$LWS[0]);
5889
5889
  const loweredCommand$LWS = ReflectApply$LWS$1(StringProtoToLowerCase$LWS, command$LWS, []);
5890
- if (length$LWS === 1 && loweredCommand$LWS === 'selectall' && this === rootDocument$LWS) {
5890
+ if (loweredCommand$LWS === 'selectall' && this === rootDocument$LWS) {
5891
5891
  throwLockerSecurityError$LWS(command$LWS, this);
5892
5892
  }
5893
5893
  if (length$LWS > 2) {
@@ -6106,6 +6106,7 @@ function initDistortionElementAppend$LWS({
6106
6106
  return distortionEntry$LWS;
6107
6107
  };
6108
6108
  }
6109
+ const FORCED_MODE$LWS = 'closed';
6109
6110
  function initDistortionElementAttachShadow$LWS({
6110
6111
  globalObject: {
6111
6112
  Element: {
@@ -6125,8 +6126,14 @@ function initDistortionElementAttachShadow$LWS({
6125
6126
  if (originalShadowRootInit$LWS !== null && originalShadowRootInit$LWS !== undefined) {
6126
6127
  // Snapshot shadowRootInit to avoid getter poisoning.
6127
6128
  const clonedShadowRootInit$LWS = shallowCloneOptions$LWS(originalShadowRootInit$LWS);
6129
+ if (clonedShadowRootInit$LWS.mode !== FORCED_MODE$LWS) {
6130
+ const {
6131
+ mode: mode$LWS
6132
+ } = clonedShadowRootInit$LWS;
6133
+ consoleWarn$LWS(`Lightning Web Security: changing shadow root's mode from '${mode$LWS}' to '${FORCED_MODE$LWS}'`);
6134
+ }
6128
6135
  // Override the user defined shadowRoot mode to ensure that it is always closed
6129
- clonedShadowRootInit$LWS.mode = 'closed';
6136
+ clonedShadowRootInit$LWS.mode = FORCED_MODE$LWS;
6130
6137
  // Set the prototype of shadowRootInit after assignment
6131
6138
  // of mode to avoid complications with inherited
6132
6139
  // non-configurable/non-writable mode properties.
@@ -6234,6 +6241,13 @@ function initDistortionElementGetInnerHTML$LWS({
6234
6241
  const clonedOptions$LWS = shallowCloneOptions$LWS(options$LWS);
6235
6242
  clonedOptions$LWS.includeShadowRoots = false;
6236
6243
  args$LWS[0] = clonedOptions$LWS;
6244
+ } else {
6245
+ // If there was an argument, but it wasn't "object like",
6246
+ // it is considered invalid, so override it.
6247
+ args$LWS[0] = {
6248
+ __proto__: null,
6249
+ includeShadowRoots: false
6250
+ };
6237
6251
  }
6238
6252
  } else {
6239
6253
  args$LWS[0] = {
@@ -6741,6 +6755,7 @@ function initDistortionElementSetHTML$LWS({
6741
6755
  // istanbul ignore next: only runs in browsers without property
6742
6756
  return noop$LWS$1;
6743
6757
  }
6758
+ // istanbul ignore next: Element.prototype.setHTML is not supported in any browser yet
6744
6759
  return function distortionElementSetHTML$LWS({
6745
6760
  key: key$LWS
6746
6761
  }) {
@@ -7211,7 +7226,7 @@ function initDistortionHTMLIFrameElementSrcSetter$LWS({
7211
7226
  };
7212
7227
  }
7213
7228
  const importRegExp$LWS = /import/i;
7214
- const WARN_MESSAGE$LWS = 'HTMLLinkElement does not allow setting "rel" property to "import" value.';
7229
+ const WARN_MESSAGE$LWS = 'Lightning Web Security: HTMLLinkElement does not allow setting "rel" property to "import" value.';
7215
7230
  function isValidRelValue$LWS(value$LWS) {
7216
7231
  return typeof value$LWS !== 'string' || !ReflectApply$LWS$1(RegExpProtoTest$LWS$1, importRegExp$LWS, [value$LWS]);
7217
7232
  }
@@ -7997,7 +8012,7 @@ function initDistortionPerformanceMeasure$LWS({
7997
8012
  throw error;
7998
8013
  }
7999
8014
  }];
8000
- return function distortionPerformanceMark$LWS() {
8015
+ return function distortionPerformanceMeasure$LWS() {
8001
8016
  return distortionEntry$LWS;
8002
8017
  };
8003
8018
  }
@@ -9865,6 +9880,7 @@ initDistortionElementAfter$LWS, initDistortionElementAppend$LWS, initDistortionE
9865
9880
  // initDistortionNodeAppendChild,
9866
9881
  initDistortionNodeInsertBefore$LWS]);
9867
9882
  const externalKeyedDistortionFactoryInitializers$LWS = internalKeyedDistortionFactoryInitializers$LWS;
9883
+ toSafeMap$LWS$1(new MapCtor$LWS$1([[initDistortionCacheStorageDelete$LWS, 'caches'], [initDistortionCacheStorageHas$LWS, 'caches'], [initDistortionCacheStorageKeys$LWS, 'caches'], [initDistortionCacheStorageMatch$LWS, 'caches'], [initDistortionCacheStorageOpen$LWS, 'caches'], [initDistortionCookieStoreDelete$LWS, 'cookieStore'], [initDistortionCookieStoreGet$LWS, 'cookieStore'], [initDistortionCookieStoreGetAll$LWS, 'cookieStore'], [initDistortionCookieStoreOnChange$LWS, 'cookieStore'], [initDistortionCookieStoreSet$LWS, 'cookieStore'], [initDistortionCSSStyleRuleStyleGetter$LWS, 'style'], [initDistortionCustomElementRegistryDefine$LWS, 'customElements'], [initDistortionCustomElementRegistryGet$LWS, 'customElements'], [initDistortionCustomElementRegistryUpgrade$LWS, 'customElements'], [initDistortionCustomElementRegistryWhenDefined$LWS, 'customElements'], [initDistortionDocumentCookieGetter$LWS, 'documentCookie'], [initDistortionDocumentCookieSetter$LWS, 'documentCookie'], [initDistortionDocumentDomainSetter$LWS, 'documentDomain'], [initDistortionDocumentExecCommand$LWS, 'documentExecCommand'], [initDistortionElementAfter$LWS, 'element'], [initDistortionElementAppend$LWS, 'element'], [initDistortionElementAttributesGetter$LWS, 'attributes'], [initDistortionElementBefore$LWS, 'element'], [initDistortionElementGetInnerHTML$LWS, 'innerHTML'], [initDistortionElementInnerHTMLSetter$LWS, 'innerHTML'], [initDistortionElementInsertAdjacentElement$LWS, 'element'], [initDistortionElementInsertAdjacentHTML$LWS, 'element'], [initDistortionElementOuterHTMLSetter$LWS, 'element'], [initDistortionElementPrepend$LWS, 'element'], [initDistortionElementRemove$LWS, 'element'], [initDistortionElementReplaceChildren$LWS, 'element'], [initDistortionElementReplaceWith$LWS, 'element'], [initDistortionElementSetAttribute$LWS, 'attributes'], [initDistortionElementSetAttributeNode$LWS, 'attributes'], [initDistortionElementSetAttributeNodeNS$LWS, 'attributes'], [initDistortionElementSetAttributeNS$LWS, 'attributes'], [initDistortionElementSetHTML$LWS, 'element'], [initDistortionElementToggleAttribute$LWS, 'attributes'], [initDistortionIDBObjectStoreAdd$LWS, 'indexedDB'], [initDistortionIDBObjectStorePut$LWS, 'indexedDB'], [initDistortionLocalStorage$LWS, 'storage'], [initDistortionMessagePortPostMessage$LWS, 'postMessage'], [initDistortionNamedNodeMapSetNamedItem$LWS, 'attributes'], [initDistortionNamedNodeMapSetNamedItemNS$LWS, 'attributes'], [initDistortionNavigatorSendBeacon$LWS, 'navigatorSendBeacon'], [initDistortionNodeInsertBefore$LWS, 'node'], [initDistortionNodeRemoveChild$LWS, 'node'], [initDistortionNodeReplaceChild$LWS, 'node'], [initDistortionNodeTextContentGetter$LWS, 'node'], [initDistortionNodeTextContentSetter$LWS, 'node'], [initDistortionNodeValueSetter$LWS, 'node'], [initDistortionPerformanceMark$LWS, 'performance'], [initDistortionPerformanceMarkCtor$LWS, 'performance'], [initDistortionPerformanceMeasure$LWS, 'performance'], [initDistortionRangeCreateContextualFragment$LWS, 'range'], [initDistortionRangeDeleteContents$LWS, 'range'], [initDistortionRangeExtractContents$LWS, 'range'], [initDistortionRangeInsertNode$LWS, 'range'], [initDistortionRangeSelectNode$LWS, 'range'], [initDistortionRangeSelectNodeContents$LWS, 'range'], [initDistortionRangeSetEnd$LWS, 'range'], [initDistortionRangeSetEndAfter$LWS, 'range'], [initDistortionRangeSetEndBefore$LWS, 'range'], [initDistortionRangeSetStart$LWS, 'range'], [initDistortionRangeSetStartAfter$LWS, 'range'], [initDistortionRangeSetStartBefore$LWS, 'range'], [initDistortionRangeSurroundContents$LWS, 'range'], [initDistortionSelectionCollapse$LWS, 'selection'], [initDistortionSelectionExtend$LWS, 'selection'], [initDistortionSelectionSelectAllChildren$LWS, 'selection'], [initDistortionSelectionSetBaseAndExtent$LWS, 'selection'], [initDistortionSelectionSetPosition$LWS, 'selection'], [initDistortionSessionStorage$LWS, 'storage'], [initDistortionShadowRootInnerHTMLSetter$LWS, 'innerHTML'], [initDistortionStorage$LWS, 'storage'], [initDistortionStorageClear$LWS, 'storage'], [initDistortionStorageGetItem$LWS, 'storage'], [initDistortionStorageKey$LWS, 'storage'], [initDistortionStorageLength$LWS, 'storage'], [initDistortionStorageRemoveItem$LWS, 'storage'], [initDistortionStorageSetItem$LWS, 'storage'], [initDistortionWindowPostMessage$LWS, 'postMessage'], [initDistortionWindowSetInterval$LWS, 'setInterval'], [initDistortionWindowSetTimeout$LWS, 'setTimeout']]));
9868
9884
  const DocumentBlockedProperties$LWS = ['createProcessingInstruction', 'exitFullscreen', 'fullscreen', 'fullscreenElement', 'fullscreenEnabled', 'mozCancelFullScreen', 'mozFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'onfullscreenchange', 'onfullscreenerror', 'onmozfullscreenchange', 'onmozfullscreenerror', 'onrejectionhandled', 'onunhandledrejection', 'releaseCapture', 'releaseEvents', 'webkitFullScreenKeyboardInputAllowed', 'write', 'writeln'];
9869
9885
  const ElementBlockedProperties$LWS = ['mozRequestFullScreen', 'onfullscreenchange', 'onfullscreenerror', 'requestFullscreen', 'webkitRequestFullScreen', 'webkitRequestFullscreen'];
9870
9886
  const EventBlockedProperties$LWS = ['originalTarget', 'explicitOriginalTarget'];
@@ -9883,17 +9899,57 @@ const SVGElementBlockedProperties$LWS = ['nonce'];
9883
9899
  const UIEventBlockedProperties$LWS = ['rangeParent'];
9884
9900
  const WindowBlockedProperties$LWS = ['find'];
9885
9901
  const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
9886
- /*! version: 0.20.8 */
9902
+ /*! version: 0.21.3 */
9887
9903
 
9888
9904
  /*!
9889
9905
  * Copyright (C) 2019 salesforce.com, inc.
9890
9906
  */
9907
+ const rootSandboxRegistry$LWS = {
9908
+ __proto__: null
9909
+ };
9910
+ const documentSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1([[rootDocument$LWS, rootSandboxRegistry$LWS]]));
9911
+ const opaqueWindowSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9912
+ function getOpaqueSandboxRegistry$LWS(globalObject$LWS) {
9913
+ // Use the `document` as the key because a window object maintains its
9914
+ // identity continuity when its location changes and while the
9915
+ // non-configurable document property does not.
9916
+ let sandboxRegistry$LWS = opaqueWindowSandboxRegistryCache$LWS.get(globalObject$LWS);
9917
+ // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
9918
+ if (sandboxRegistry$LWS === undefined) {
9919
+ sandboxRegistry$LWS = {
9920
+ __proto__: null
9921
+ };
9922
+ opaqueWindowSandboxRegistryCache$LWS.set(globalObject$LWS, sandboxRegistry$LWS);
9923
+ }
9924
+ return sandboxRegistry$LWS;
9925
+ }
9926
+ function getSandboxRegistry$LWS(document$LWS) {
9927
+ // Use the `document` as the key because a window object maintains its
9928
+ // identity continuity when its location changes and while the
9929
+ // non-configurable document property does not.
9930
+ let sandboxRegistry$LWS = documentSandboxRegistryCache$LWS.get(document$LWS);
9931
+ if (sandboxRegistry$LWS === undefined) {
9932
+ sandboxRegistry$LWS = {
9933
+ __proto__: null
9934
+ };
9935
+ documentSandboxRegistryCache$LWS.set(document$LWS, sandboxRegistry$LWS);
9936
+ }
9937
+ return sandboxRegistry$LWS;
9938
+ }
9939
+ const LightningWebSecurity$LWS = {
9940
+ __proto__: null
9941
+ };
9942
+ toSafeMap$LWS$1(new MapCtor$LWS$1());
9943
+ ObjectFreeze$LWS$1(LightningWebSecurity$LWS);
9944
+ // If ENABLE_DISTORTION_TOGGLE_SWITCHES = false, this will just be undefined
9945
+ const $LWS = window.$LWS;
9891
9946
  const distortionFactoriesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9892
9947
  const opaqueWindowPostMessageDistortionFactoryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
9893
9948
  // WebKit based browsers have a bug that prematurely removes distortion entries
9894
9949
  // from the distortions weak map.
9895
9950
  const SUPPORTS_DISTORTIONS_WEAK_MAP$LWS = !IS_WEBKIT_BROWSER$LWS;
9896
9951
  function createDistortionEntries$LWS(record$LWS, factories$LWS) {
9952
+ toSafeMap$LWS$1(new MapCtor$LWS$1());
9897
9953
  const entries$LWS = [];
9898
9954
  for (let i$LWS = 0, {
9899
9955
  length: length$LWS
@@ -9906,10 +9962,13 @@ function createDistortionEntries$LWS(record$LWS, factories$LWS) {
9906
9962
  1: distortedValue$LWS
9907
9963
  } = entry$LWS;
9908
9964
  if (typeof originalValue$LWS === 'function') {
9909
- entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS)];
9965
+ const proxyMaskedFunctionDistortion$LWS = proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS);
9966
+ entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskedFunctionDistortion$LWS];
9910
9967
  } else {
9911
9968
  // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
9912
9969
  if (typeof originalValue$LWS === 'object' && originalValue$LWS !== null) {
9970
+ // TODO: we may need to make this assigned value a proxy when ENABLE_DISTORTION_TOGGLE_SWITCHES is true,
9971
+ // allowing us to change which value is provided for the distortion.
9913
9972
  entries$LWS[entries$LWS.length] = entry$LWS;
9914
9973
  }
9915
9974
  }
@@ -9993,18 +10052,13 @@ function getOpaqueWindowPostMessageDistortionFactory$LWS(record$LWS) {
9993
10052
  return opaqueWindowPostMessageDistortionFactory$LWS;
9994
10053
  }
9995
10054
  function proxyMaskFunctionDistortion$LWS({
9996
- BASIC_INSTRUMENTATION_DATA: BASIC_INSTRUMENTATION_DATA$LWS,
9997
10055
  LOCKER_VERBOSE_INSTRUMENTATION_FLAG: LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS,
9998
10056
  instrumentation: instrumentation$LWS,
9999
10057
  key: sandboxKey$LWS
10000
10058
  }, distortionFactory$LWS, distortionFunc$LWS, maskFunc$LWS) {
10001
10059
  let activityName$LWS;
10002
- let startActivity$LWS;
10003
10060
  // istanbul ignore if: this is a safety precaution that is unreachable via tests
10004
10061
  if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10005
- ({
10006
- startActivity: startActivity$LWS
10007
- } = instrumentation$LWS);
10008
10062
  const {
10009
10063
  name: factoryName$LWS
10010
10064
  } = distortionFactory$LWS;
@@ -10012,51 +10066,33 @@ function proxyMaskFunctionDistortion$LWS({
10012
10066
  }
10013
10067
  return maskFunction$LWS(distortionFunc$LWS, maskFunc$LWS, {
10014
10068
  apply: function (target$LWS, thisArg$LWS, args$LWS) {
10015
- let activity$LWS;
10016
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10017
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10018
- activity$LWS = startActivity$LWS(activityName$LWS, BASIC_INSTRUMENTATION_DATA$LWS);
10019
- }
10069
+ const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
10020
10070
  try {
10021
10071
  return ReflectApply$LWS$1(target$LWS, thisArg$LWS, args$LWS);
10022
10072
  } catch (error) {
10023
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10024
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10025
- activity$LWS.error({
10026
- sandboxKey: sandboxKey$LWS,
10027
- error
10028
- });
10029
- }
10073
+ activity$LWS == null || activity$LWS.error({
10074
+ sandboxKey: sandboxKey$LWS,
10075
+ error
10076
+ });
10077
+ activity$LWS == null || activity$LWS.stop();
10030
10078
  throw error;
10031
10079
  } finally {
10032
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10033
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10034
- activity$LWS.stop();
10035
- }
10080
+ activity$LWS == null || activity$LWS.stop();
10036
10081
  }
10037
10082
  },
10038
10083
  construct: function (target$LWS, args$LWS, newTarget$LWS) {
10039
- let activity$LWS;
10040
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10041
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10042
- activity$LWS = startActivity$LWS(activityName$LWS, BASIC_INSTRUMENTATION_DATA$LWS);
10043
- }
10084
+ const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
10044
10085
  try {
10045
10086
  return ReflectConstruct$LWS(target$LWS, args$LWS, newTarget$LWS);
10046
10087
  } catch (error) {
10047
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10048
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10049
- activity$LWS.error({
10050
- sandboxKey: sandboxKey$LWS,
10051
- error
10052
- });
10053
- }
10088
+ activity$LWS == null || activity$LWS.error({
10089
+ sandboxKey: sandboxKey$LWS,
10090
+ error
10091
+ });
10092
+ activity$LWS == null || activity$LWS.stop();
10054
10093
  throw error;
10055
10094
  } finally {
10056
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
10057
- if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
10058
- activity$LWS.stop();
10059
- }
10095
+ activity$LWS == null || activity$LWS.stop();
10060
10096
  }
10061
10097
  }
10062
10098
  });
@@ -10331,6 +10367,11 @@ const SetCtor$LWS = Set;
10331
10367
  const {
10332
10368
  prototype: SetProto$LWS
10333
10369
  } = SetCtor$LWS;
10370
+ const {
10371
+ add: SetProtoAdd$LWS,
10372
+ has: SetProtoHas$LWS,
10373
+ values: SetProtoValues$LWS
10374
+ } = SetProto$LWS;
10334
10375
  ObjectLookupOwnGetter$LWS(SetProto$LWS, 'size');
10335
10376
  const StringCtor$LWS = String;
10336
10377
  const {
@@ -13596,7 +13637,11 @@ function createMembraneMarshall$LWS(globalObject$LWS) {
13596
13637
  selectedTarget$LWS = undefined;
13597
13638
  let proto$LWS;
13598
13639
  if (typeof protoPointerOrNull$LWS === 'function') {
13599
- protoPointerOrNull$LWS();
13640
+ // Instead of calling `protoPointerOrNull()` directly we use
13641
+ // `ReflectApply` to avoid a Maglev (https://v8.dev/blog/maglev)
13642
+ // optimizing JIT bug in Chrome >= 117:
13643
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1494060
13644
+ ReflectApply$LWS(protoPointerOrNull$LWS, undefined, []);
13600
13645
  proto$LWS = selectedTarget$LWS;
13601
13646
  selectedTarget$LWS = undefined;
13602
13647
  } else {
@@ -14378,66 +14423,61 @@ class VirtualEnvironment$LWS {
14378
14423
  * problematic, and requires a lot more work to guarantee that objects from both sides
14379
14424
  * can be considered equivalents (without identity discontinuity).
14380
14425
  */
14381
- const ESGlobalKeys$LWS = [
14382
- // *** 19.1 Value Properties of the Global Object
14383
- 'globalThis', 'Infinity', 'NaN', 'undefined',
14384
- // *** 19.2 Function Properties of the Global Object
14385
- // 'eval', // dangerous & Reflective
14386
- 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
14387
- // *** 19.3 Constructor Properties of the Global Object
14388
- // 'AggregateError', // Reflective
14389
- // 'Array', // Reflective
14390
- // 'ArrayBuffer', // Remapped
14391
- 'BigInt',
14392
- // 'BigInt64Array', // Remapped
14393
- // 'BigUint64Array', // Remapped
14394
- 'Boolean',
14395
- // 'DataView', // Remapped
14396
- // 'Date', // Remapped
14397
- // 'Error', // Reflective
14398
- // 'EvalError', // Reflective
14399
- 'FinalizationRegistry',
14400
- // 'Float32Array', // Remapped
14401
- // 'Float64Array', // Remapped
14402
- // 'Function', // dangerous & Reflective
14403
- // 'Int8Array', // Remapped
14404
- // 'Int16Array', // Remapped
14405
- // 'Int32Array', // Remapped
14406
- // 'Map', // Remapped
14407
- 'Number',
14408
- // 'Object', // Reflective
14409
- // Allow blue `Promise` constructor to overwrite the Red one so that promises
14410
- // created by the `Promise` constructor or APIs like `fetch` will work.
14411
- // 'Promise', // Remapped
14412
- // 'Proxy', // Reflective
14413
- // 'RangeError', // Reflective
14414
- // 'ReferenceError', // Reflective
14415
- 'RegExp',
14416
- // 'Set', // Remapped
14417
- // 'SharedArrayBuffer', // Remapped
14418
- 'String', 'Symbol',
14419
- // 'SyntaxError', // Reflective
14420
- // 'TypeError', // Reflective
14421
- // 'Uint8Array', // Remapped
14422
- // 'Uint8ClampedArray', // Remapped
14423
- // 'Uint16Array', // Remapped
14424
- // 'Uint32Array', // Remapped
14425
- // 'URIError', // Reflective
14426
- // 'WeakMap', // Remapped
14427
- // 'WeakSet', // Remapped
14428
- 'WeakRef',
14429
- // *** 18.4 Other Properties of the Global Object
14430
- // 'Atomics', // Remapped
14431
- 'JSON', 'Math', 'Reflect',
14432
- // *** Annex B
14433
- 'escape', 'unescape'
14434
- // *** ECMA-402
14435
- // 'Intl', // Remapped
14436
- ];
14426
+ function getESGlobalKeys$LWS(remapTypedArrays$LWS = true) {
14427
+ const ESGlobalKeys$LWS = [
14428
+ // *** 19.1 Value Properties of the Global Object
14429
+ 'globalThis', 'Infinity', 'NaN', 'undefined',
14430
+ // *** 19.2 Function Properties of the Global Object
14431
+ // 'eval', // dangerous & Reflective
14432
+ 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
14433
+ // *** 19.3 Constructor Properties of the Global Object
14434
+ // 'AggregateError', // Reflective
14435
+ // 'Array', // Reflective
14436
+ 'BigInt', 'Boolean',
14437
+ // 'Date', // Remapped
14438
+ // 'Error', // Reflective
14439
+ // 'EvalError', // Reflective
14440
+ 'FinalizationRegistry',
14441
+ // 'Function', // dangerous & Reflective
14442
+ // 'Map', // Remapped
14443
+ 'Number',
14444
+ // 'Object', // Reflective
14445
+ // Allow blue `Promise` constructor to overwrite the Red one so that promises
14446
+ // created by the `Promise` constructor or APIs like `fetch` will work.
14447
+ // 'Promise', // Remapped
14448
+ // 'Proxy', // Reflective
14449
+ // 'RangeError', // Reflective
14450
+ // 'ReferenceError', // Reflective
14451
+ 'RegExp',
14452
+ // 'Set', // Remapped
14453
+ 'String', 'Symbol',
14454
+ // 'SyntaxError', // Reflective
14455
+ // 'TypeError', // Reflective
14456
+ // 'URIError', // Reflective
14457
+ // 'WeakMap', // Remapped
14458
+ // 'WeakSet', // Remapped
14459
+ 'WeakRef',
14460
+ // *** 18.4 Other Properties of the Global Object
14461
+ // 'Atomics', // Remapped
14462
+ 'JSON', 'Math', 'Reflect',
14463
+ // *** Annex B
14464
+ 'escape', 'unescape'
14465
+ // *** ECMA-402
14466
+ // 'Intl', // Remapped
14467
+ ];
14468
+
14469
+ if (remapTypedArrays$LWS === false) {
14470
+ ESGlobalKeys$LWS.push('ArrayBuffer', 'BigInt64Array', 'BigUint64Array', 'DataView', 'Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'SharedArrayBuffer', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array');
14471
+ }
14472
+ return ESGlobalKeys$LWS;
14473
+ }
14437
14474
  // These are foundational things that should never be wrapped but are equivalent
14438
14475
  // @TODO: Revisit this list.
14439
14476
  const ReflectiveIntrinsicObjectNames$LWS = ['AggregateError', 'Array', 'Error', 'EvalError', 'Function', 'Object', 'Proxy', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'eval', 'globalThis'];
14440
- const ESGlobalsAndReflectiveIntrinsicObjectNames$LWS = toSafeArray$LWS([...ESGlobalKeys$LWS, ...ReflectiveIntrinsicObjectNames$LWS]);
14477
+ function getESGlobalsAndReflectiveIntrinsicObjectNames$LWS(remapTypedArrays$LWS = true) {
14478
+ const ESGlobalKeys$LWS = getESGlobalKeys$LWS(remapTypedArrays$LWS);
14479
+ return toSafeArray$LWS([...ESGlobalKeys$LWS, ...ReflectiveIntrinsicObjectNames$LWS]);
14480
+ }
14441
14481
  function getGlobalObjectOwnKeys$LWS(source$LWS) {
14442
14482
  const ownKeys$LWS = ReflectOwnKeys$LWS(source$LWS);
14443
14483
  // WKWebView incorrectly excludes the 'webkit' own property of the global
@@ -14448,8 +14488,9 @@ function getGlobalObjectOwnKeys$LWS(source$LWS) {
14448
14488
  }
14449
14489
  return ownKeys$LWS;
14450
14490
  }
14451
- function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(descs$LWS, source$LWS) {
14491
+ function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(descs$LWS, source$LWS, includeTypedArrays$LWS) {
14452
14492
  const ownKeys$LWS = getGlobalObjectOwnKeys$LWS(source$LWS);
14493
+ const ESGlobalsAndReflectiveIntrinsicObjectNames$LWS = getESGlobalsAndReflectiveIntrinsicObjectNames$LWS(includeTypedArrays$LWS);
14453
14494
  for (let i$LWS = 0, {
14454
14495
  length: length$LWS
14455
14496
  } = ownKeys$LWS; i$LWS < length$LWS; i$LWS += 1) {
@@ -14472,10 +14513,11 @@ function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(descs$LWS,
14472
14513
  }
14473
14514
  return descs$LWS;
14474
14515
  }
14475
- function getFilteredGlobalOwnKeys$LWS(source$LWS) {
14516
+ function getFilteredGlobalOwnKeys$LWS(source$LWS, includeTypedArrays$LWS) {
14476
14517
  const result$LWS = [];
14477
14518
  let resultOffset$LWS = 0;
14478
14519
  const ownKeys$LWS = getGlobalObjectOwnKeys$LWS(source$LWS);
14520
+ const ESGlobalsAndReflectiveIntrinsicObjectNames$LWS = getESGlobalsAndReflectiveIntrinsicObjectNames$LWS(includeTypedArrays$LWS);
14479
14521
  for (let i$LWS = 0, {
14480
14522
  length: length$LWS
14481
14523
  } = ownKeys$LWS; i$LWS < length$LWS; i$LWS += 1) {
@@ -14549,20 +14591,24 @@ function getCachedGlobalObjectReferences$LWS(globalObject$LWS) {
14549
14591
  blueDocumentToRecordMap$LWS.set(document$LWS, record$LWS);
14550
14592
  return record$LWS;
14551
14593
  }
14552
- function filterWindowKeys$LWS(keys$LWS) {
14594
+ function filterWindowKeys$LWS(keys$LWS, remapTypedArrays$LWS) {
14595
+ const excludedKeys$LWS = new SetCtor$LWS(['document', 'location', 'top', 'window']);
14596
+ // Crypto and typed arrays must be from the same global object
14597
+ if (remapTypedArrays$LWS === false) {
14598
+ excludedKeys$LWS.add('crypto');
14599
+ excludedKeys$LWS.add('Crypto');
14600
+ excludedKeys$LWS.add('SubtleCrypto');
14601
+ }
14553
14602
  const result$LWS = [];
14554
14603
  let resultOffset$LWS = 0;
14555
14604
  for (let i$LWS = 0, {
14556
14605
  length: length$LWS
14557
14606
  } = keys$LWS; i$LWS < length$LWS; i$LWS += 1) {
14558
14607
  const key$LWS = keys$LWS[i$LWS];
14559
- if (
14560
- // Filter out unforgeable property keys that cannot be installed.
14561
- key$LWS !== 'document' && key$LWS !== 'location ' && key$LWS !== 'top' && key$LWS !== 'window' &&
14562
- // Remove other browser specific unforgeables.
14563
- key$LWS !== 'chrome') {
14564
- result$LWS[resultOffset$LWS++] = key$LWS;
14608
+ if (ReflectApply$LWS(SetProtoHas$LWS, excludedKeys$LWS, [key$LWS])) {
14609
+ continue;
14565
14610
  }
14611
+ result$LWS[resultOffset$LWS++] = key$LWS;
14566
14612
  }
14567
14613
  return result$LWS;
14568
14614
  }
@@ -14593,7 +14639,7 @@ function filterWindowKeys$LWS(keys$LWS) {
14593
14639
  * that will be installed (via the membrane) as global descriptors in
14594
14640
  * the red realm.
14595
14641
  */
14596
- function removeWindowDescriptors$LWS(unsafeDescs$LWS) {
14642
+ function removeWindowDescriptors$LWS(unsafeDescs$LWS, remapTypedArrays$LWS) {
14597
14643
  // Remove unforgeable descriptors that cannot be installed.
14598
14644
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'document');
14599
14645
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'location');
@@ -14601,6 +14647,12 @@ function removeWindowDescriptors$LWS(unsafeDescs$LWS) {
14601
14647
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'window');
14602
14648
  // Remove other browser specific unforgeables.
14603
14649
  ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'chrome');
14650
+ // Crypto and typed arrays must be from the same global object
14651
+ if (remapTypedArrays$LWS === false) {
14652
+ ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'crypto');
14653
+ ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'Crypto');
14654
+ ReflectDeleteProperty$LWS(unsafeDescs$LWS, 'SubtleCrypto');
14655
+ }
14604
14656
  return unsafeDescs$LWS;
14605
14657
  }
14606
14658
  /**
@@ -14613,7 +14665,6 @@ getCachedGlobalObjectReferences$LWS(rootWindow$LWS);
14613
14665
  const IFRAME_SANDBOX_ATTRIBUTE_VALUE$LWS = 'allow-same-origin allow-scripts';
14614
14666
  const revoked$LWS = toSafeWeakSet$LWS(new WeakSetCtor$LWS());
14615
14667
  const blueCreateHooksCallbackCache$LWS = toSafeWeakMap$LWS(new WeakMapCtor$LWS());
14616
- let defaultGlobalOwnKeys$LWS = null;
14617
14668
  function createDetachableIframe$LWS(doc$LWS) {
14618
14669
  var _ReflectApply$LWS;
14619
14670
  const iframe$LWS = ReflectApply$LWS(DocumentProtoCreateElement$LWS, doc$LWS, ['iframe']);
@@ -14642,6 +14693,7 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14642
14693
  instrumentation: instrumentation$LWS,
14643
14694
  keepAlive: keepAlive$LWS = true,
14644
14695
  liveTargetCallback: liveTargetCallback$LWS,
14696
+ remapTypedArrays: remapTypedArrays$LWS = true,
14645
14697
  signSourceCallback: signSourceCallback$LWS
14646
14698
  // eslint-disable-next-line prefer-object-spread
14647
14699
  } = ObjectAssign$LWS({
@@ -14650,9 +14702,7 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14650
14702
  const iframe$LWS = createDetachableIframe$LWS(blueRefs$LWS.document);
14651
14703
  const redWindow$LWS = ReflectApply$LWS(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, []);
14652
14704
  const shouldUseDefaultGlobalOwnKeys$LWS = typeof globalObjectShape$LWS !== 'object' || globalObjectShape$LWS === null;
14653
- if (shouldUseDefaultGlobalOwnKeys$LWS && defaultGlobalOwnKeys$LWS === null) {
14654
- defaultGlobalOwnKeys$LWS = filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(redWindow$LWS));
14655
- }
14705
+ const defaultGlobalOwnKeys$LWS = filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(redWindow$LWS, remapTypedArrays$LWS), remapTypedArrays$LWS);
14656
14706
  let blueConnector$LWS = blueCreateHooksCallbackCache$LWS.get(blueRefs$LWS.document);
14657
14707
  if (blueConnector$LWS === undefined) {
14658
14708
  blueConnector$LWS = createBlueConnector$LWS(globalObject$LWS);
@@ -14693,7 +14743,7 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14693
14743
  // window.__proto__.__proto__.__proto__ (aka EventTarget.prototype)
14694
14744
  env$LWS.link('__proto__', '__proto__', '__proto__');
14695
14745
  env$LWS.remapProto(blueRefs$LWS.document, blueRefs$LWS.DocumentProto);
14696
- env$LWS.lazyRemapProperties(blueRefs$LWS.window, shouldUseDefaultGlobalOwnKeys$LWS ? defaultGlobalOwnKeys$LWS : filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(globalObjectShape$LWS)),
14746
+ env$LWS.lazyRemapProperties(blueRefs$LWS.window, shouldUseDefaultGlobalOwnKeys$LWS ? defaultGlobalOwnKeys$LWS : filterWindowKeys$LWS(getFilteredGlobalOwnKeys$LWS(globalObjectShape$LWS), remapTypedArrays$LWS),
14697
14747
  // Chromium based browsers have a bug that nulls the result of `window`
14698
14748
  // getters in detached iframes when the property descriptor of `window.window`
14699
14749
  // is retrieved.
@@ -14701,8 +14751,8 @@ function createIframeVirtualEnvironment$LWS(globalObject$LWS, providedOptions$LW
14701
14751
  keepAlive$LWS ? undefined : unforgeablePoisonedWindowKeys$LWS);
14702
14752
  if (endowments$LWS) {
14703
14753
  const filteredEndowments$LWS = {};
14704
- assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(filteredEndowments$LWS, endowments$LWS);
14705
- removeWindowDescriptors$LWS(filteredEndowments$LWS);
14754
+ assignFilteredGlobalDescriptorsFromPropertyDescriptorMap$LWS(filteredEndowments$LWS, endowments$LWS, remapTypedArrays$LWS);
14755
+ removeWindowDescriptors$LWS(filteredEndowments$LWS, remapTypedArrays$LWS);
14706
14756
  env$LWS.remapProperties(blueRefs$LWS.window, filteredEndowments$LWS);
14707
14757
  }
14708
14758
  // We intentionally skip remapping Window.prototype because there is nothing
@@ -15062,44 +15112,12 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
15062
15112
  // tools from mistaking the regexp or the replacement string for an
15063
15113
  // actual source mapping URL.
15064
15114
  /\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
15065
- sourceText$LWS = `\n//# LWS Version = "0.20.8"\n${sourceText$LWS}`;
15115
+ sourceText$LWS = `\n//# LWS Version = "0.21.3"\n${sourceText$LWS}`;
15066
15116
  return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
15067
15117
  // Append "'use strict'" to the extracted function body so it is
15068
15118
  // evaluated in strict mode.
15069
15119
  `'use strict';${sourceText$LWS}` : sourceText$LWS;
15070
15120
  }
15071
- const rootSandboxRegistry$LWS = {
15072
- __proto__: null
15073
- };
15074
- const documentSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1([[rootDocument$LWS, rootSandboxRegistry$LWS]]));
15075
- const opaqueWindowSandboxRegistryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
15076
- function getOpaqueSandboxRegistry$LWS(globalObject$LWS) {
15077
- // Use the `document` as the key because a window object maintains its
15078
- // identity continuity when its location changes and while the
15079
- // non-configurable document property does not.
15080
- let sandboxRegistry$LWS = opaqueWindowSandboxRegistryCache$LWS.get(globalObject$LWS);
15081
- // istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
15082
- if (sandboxRegistry$LWS === undefined) {
15083
- sandboxRegistry$LWS = {
15084
- __proto__: null
15085
- };
15086
- opaqueWindowSandboxRegistryCache$LWS.set(globalObject$LWS, sandboxRegistry$LWS);
15087
- }
15088
- return sandboxRegistry$LWS;
15089
- }
15090
- function getSandboxRegistry$LWS(document$LWS) {
15091
- // Use the `document` as the key because a window object maintains its
15092
- // identity continuity when its location changes and while the
15093
- // non-configurable document property does not.
15094
- let sandboxRegistry$LWS = documentSandboxRegistryCache$LWS.get(document$LWS);
15095
- if (sandboxRegistry$LWS === undefined) {
15096
- sandboxRegistry$LWS = {
15097
- __proto__: null
15098
- };
15099
- documentSandboxRegistryCache$LWS.set(document$LWS, sandboxRegistry$LWS);
15100
- }
15101
- return sandboxRegistry$LWS;
15102
- }
15103
15121
 
15104
15122
  // Flag whether the iframe should remain connected to the DOM.
15105
15123
  const IFRAME_KEEP_ALIVE_FLAG$LWS = LOCKER_UNMINIFIED_FLAG$LWS$1 && !false;
@@ -15177,7 +15195,6 @@ function createSandboxEvaluator$LWS({
15177
15195
  }
15178
15196
  function createVirtualEnvironment$LWS(record$LWS) {
15179
15197
  const {
15180
- LOCKER_VERBOSE_INSTRUMENTATION_FLAG: verboseInstrumentation$LWS,
15181
15198
  endowments: endowments$LWS,
15182
15199
  globalObject: globalObject$LWS,
15183
15200
  instrumentation: instrumentation$LWS,
@@ -15188,6 +15205,13 @@ function createVirtualEnvironment$LWS(record$LWS) {
15188
15205
  },
15189
15206
  type: type$LWS
15190
15207
  } = record$LWS;
15208
+ // only Omnistudio test namespaces 'devopsimpkg*' or exact 'omnistudio' name
15209
+ let remapTypedArrays$LWS = true;
15210
+ if (key$LWS === 'omnistudio') {
15211
+ remapTypedArrays$LWS = false;
15212
+ } else if (ReflectApply$LWS$1(StringProtoStartsWith$LWS, key$LWS, ['devopsimpkg'])) {
15213
+ remapTypedArrays$LWS = false;
15214
+ }
15191
15215
  return createIframeVirtualEnvironment$LWS(globalObject$LWS, {
15192
15216
  defaultPolicy: {
15193
15217
  createScript:
@@ -15276,7 +15300,8 @@ function createVirtualEnvironment$LWS(record$LWS) {
15276
15300
  // and the default endowments descriptors so they can be
15277
15301
  // accessible from inside the sandbox.
15278
15302
  ObjectAssign$LWS$1({}, DEFAULT_ENDOWMENTS_DESCRIPTOR_MAP$LWS, ObjectGetOwnPropertyDescriptors$LWS(endowments$LWS)) : DEFAULT_ENDOWMENTS_DESCRIPTOR_MAP$LWS,
15279
- instrumentation: verboseInstrumentation$LWS ? instrumentation$LWS : undefined,
15303
+ instrumentation: instrumentation$LWS,
15304
+ remapTypedArrays: remapTypedArrays$LWS,
15280
15305
  keepAlive: IFRAME_KEEP_ALIVE_FLAG$LWS,
15281
15306
  liveTargetCallback: isTargetLive$LWS,
15282
15307
  signSourceCallback: sourceText$LWS => trusted.createScript(sourceText$LWS)
@@ -15583,7 +15608,6 @@ function internalEvaluateInSandbox$LWS(evaluateOptions$LWS) {
15583
15608
  throw new LockerSecurityError$LWS(ERR_INVALID_SANDBOX_KEY$LWS);
15584
15609
  }
15585
15610
  const {
15586
- BASIC_INSTRUMENTATION_DATA: BASIC_INSTRUMENTATION_DATA$LWS,
15587
15611
  LOCKER_INSTRUMENTATION_FLAG: LOCKER_INSTRUMENTATION_FLAG$LWS,
15588
15612
  helpers: helpers$LWS,
15589
15613
  virtualEnvironmentEvaluator: virtualEnvironmentEvaluator$LWS
@@ -15611,33 +15635,25 @@ function internalEvaluateInSandbox$LWS(evaluateOptions$LWS) {
15611
15635
  }
15612
15636
  let result$LWS;
15613
15637
  const sourceText$LWS = toSourceText$LWS(source$LWS, sourceType$LWS);
15614
- const startActivity$LWS = LOCKER_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS.startActivity : undefined;
15615
- let activity$LWS;
15616
- // istanbul ignore else: this is a safety precaution that is unreachable via tests
15617
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15618
- activity$LWS = startActivity$LWS('evaluateInSandbox', BASIC_INSTRUMENTATION_DATA$LWS);
15619
- }
15638
+ const activity$LWS = LOCKER_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null ? void 0 : instrumentation$LWS.startActivity('lws.evaluate') : undefined;
15620
15639
  try {
15621
15640
  // Protecting against errors during evaluation can guarantee the state
15622
15641
  // of the EvalContext to avoid leaking context values
15623
15642
  result$LWS = virtualEnvironmentEvaluator$LWS(sourceText$LWS);
15643
+ instrumentation$LWS == null || instrumentation$LWS.incrementCounter == null || instrumentation$LWS.incrementCounter('lws.evaluate', 1, false);
15624
15644
  } catch (error) {
15625
- // istanbul ignore if: this is a safety precaution that is unreachable via tests
15626
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15627
- activity$LWS.error({
15628
- sandboxKey: key$LWS,
15629
- error
15630
- });
15631
- }
15645
+ instrumentation$LWS == null || instrumentation$LWS.incrementCounter == null || instrumentation$LWS.incrementCounter('lws.evaluate', 1, true);
15646
+ activity$LWS == null || activity$LWS.error({
15647
+ sandboxKey: key$LWS,
15648
+ error
15649
+ });
15650
+ activity$LWS == null || activity$LWS.stop();
15632
15651
  throw error;
15633
15652
  } finally {
15634
15653
  clearEvalContext$LWS();
15635
15654
  clearEvalHelpers$LWS();
15636
15655
  }
15637
- // istanbul ignore else: this is a safety precaution that is unreachable via tests
15638
- if (LOCKER_INSTRUMENTATION_FLAG$LWS) {
15639
- activity$LWS.stop();
15640
- }
15656
+ activity$LWS == null || activity$LWS.stop();
15641
15657
  return result$LWS;
15642
15658
  }
15643
15659
 
@@ -15787,7 +15803,7 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
15787
15803
  depRegistry$LWS.set(dep$LWS, secureDep$LWS);
15788
15804
  return secureDep$LWS;
15789
15805
  }
15790
- /*! version: 0.20.8 */
15806
+ /*! version: 0.21.3 */
15791
15807
 
15792
- export { CORE_SANDBOX_KEY$LWS as CORE_SANDBOX_KEY, createRootWindowSandboxRecord$LWS as createRootWindowSandboxRecord, evaluateFunction$LWS as evaluateFunction, evaluateInCoreSandbox$LWS as evaluateInCoreSandbox, evaluateInSandbox$LWS as evaluateInSandbox, trusted, wrapDependency$LWS as wrapDependency };
15808
+ export { $LWS, CORE_SANDBOX_KEY$LWS as CORE_SANDBOX_KEY, createRootWindowSandboxRecord$LWS as createRootWindowSandboxRecord, evaluateFunction$LWS as evaluateFunction, evaluateInCoreSandbox$LWS as evaluateInCoreSandbox, evaluateInSandbox$LWS as evaluateInSandbox, trusted, wrapDependency$LWS as wrapDependency };
15793
15809
  //# sourceMappingURL=lockerSandbox.js.map