@lwrjs/client-modules 0.12.0-alpha.1 → 0.12.0-alpha.11
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.
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
// Polyfill the Declarative ShadowDOM spec - call this function AFTER the DOM has been parsed and BEFORE hydrateComponent() is invoked
|
|
2
2
|
// See https://github.com/salesforce/lwc-rfcs/blob/master/text/0129-declarative-shadow-dom-polyfill.md#single-loop-script-shadow-root-attachment-reference
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// Note we handle both the old (Chrome-only) `shadowroot` attribute as well as the standard `shadowrootmode` attribute.
|
|
4
|
+
// As of this writing, Chrome supports both formats but Safari only supports the standard format.
|
|
5
|
+
function applyShadowRoots(node, attributeName) {
|
|
5
6
|
// if this browser DOES NOT support Declarative ShadowDOM
|
|
6
|
-
node.querySelectorAll(
|
|
7
|
-
const mode = template.getAttribute(
|
|
7
|
+
node.querySelectorAll(`template[${attributeName}]`).forEach(template => {
|
|
8
|
+
const mode = template.getAttribute(attributeName) || 'open';
|
|
8
9
|
const shadowRoot = template.parentNode?.attachShadow({
|
|
9
10
|
mode
|
|
10
11
|
});
|
|
11
12
|
shadowRoot.appendChild(template.content);
|
|
12
13
|
template.remove();
|
|
13
|
-
applyShadowRoots(shadowRoot);
|
|
14
|
+
applyShadowRoots(shadowRoot, attributeName);
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
17
|
export function polyfillDeclarativeShadowDom(node = document) {
|
|
18
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
19
|
+
if (!HTMLTemplateElement.prototype.hasOwnProperty('shadowRootMode')) {
|
|
20
|
+
// this browser does not support the standard format
|
|
21
|
+
applyShadowRoots(node, 'shadowrootmode');
|
|
22
|
+
}
|
|
17
23
|
// eslint-disable-next-line no-prototype-builtins
|
|
18
24
|
if (!HTMLTemplateElement.prototype.hasOwnProperty('shadowRoot')) {
|
|
19
|
-
//
|
|
20
|
-
applyShadowRoots(node);
|
|
25
|
+
// this browser does not support the non-standard format
|
|
26
|
+
applyShadowRoots(node, 'shadowroot');
|
|
21
27
|
}
|
|
22
28
|
}
|
|
@@ -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.
|
|
1456
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
2115
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
2174
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
3860
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
4109
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
4307
|
+
/*! version: 0.21.0 */
|
|
4308
4308
|
|
|
4309
4309
|
/*!
|
|
4310
4310
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -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 =
|
|
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.
|
|
@@ -6741,6 +6748,7 @@ function initDistortionElementSetHTML$LWS({
|
|
|
6741
6748
|
// istanbul ignore next: only runs in browsers without property
|
|
6742
6749
|
return noop$LWS$1;
|
|
6743
6750
|
}
|
|
6751
|
+
// istanbul ignore next: Element.prototype.setHTML is not supported in any browser yet
|
|
6744
6752
|
return function distortionElementSetHTML$LWS({
|
|
6745
6753
|
key: key$LWS
|
|
6746
6754
|
}) {
|
|
@@ -7211,7 +7219,7 @@ function initDistortionHTMLIFrameElementSrcSetter$LWS({
|
|
|
7211
7219
|
};
|
|
7212
7220
|
}
|
|
7213
7221
|
const importRegExp$LWS = /import/i;
|
|
7214
|
-
const WARN_MESSAGE$LWS = 'HTMLLinkElement does not allow setting "rel" property to "import" value.';
|
|
7222
|
+
const WARN_MESSAGE$LWS = 'Lightning Web Security: HTMLLinkElement does not allow setting "rel" property to "import" value.';
|
|
7215
7223
|
function isValidRelValue$LWS(value$LWS) {
|
|
7216
7224
|
return typeof value$LWS !== 'string' || !ReflectApply$LWS$1(RegExpProtoTest$LWS$1, importRegExp$LWS, [value$LWS]);
|
|
7217
7225
|
}
|
|
@@ -7997,7 +8005,7 @@ function initDistortionPerformanceMeasure$LWS({
|
|
|
7997
8005
|
throw error;
|
|
7998
8006
|
}
|
|
7999
8007
|
}];
|
|
8000
|
-
return function
|
|
8008
|
+
return function distortionPerformanceMeasure$LWS() {
|
|
8001
8009
|
return distortionEntry$LWS;
|
|
8002
8010
|
};
|
|
8003
8011
|
}
|
|
@@ -9865,6 +9873,7 @@ initDistortionElementAfter$LWS, initDistortionElementAppend$LWS, initDistortionE
|
|
|
9865
9873
|
// initDistortionNodeAppendChild,
|
|
9866
9874
|
initDistortionNodeInsertBefore$LWS]);
|
|
9867
9875
|
const externalKeyedDistortionFactoryInitializers$LWS = internalKeyedDistortionFactoryInitializers$LWS;
|
|
9876
|
+
toSafeMap$LWS$1(new MapCtor$LWS$1([[initDistortionDocumentCookieGetter$LWS, 'documentCookie'], [initDistortionDocumentCookieSetter$LWS, 'documentCookie']]));
|
|
9868
9877
|
const DocumentBlockedProperties$LWS = ['createProcessingInstruction', 'exitFullscreen', 'fullscreen', 'fullscreenElement', 'fullscreenEnabled', 'mozCancelFullScreen', 'mozFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'onfullscreenchange', 'onfullscreenerror', 'onmozfullscreenchange', 'onmozfullscreenerror', 'onrejectionhandled', 'onunhandledrejection', 'releaseCapture', 'releaseEvents', 'webkitFullScreenKeyboardInputAllowed', 'write', 'writeln'];
|
|
9869
9878
|
const ElementBlockedProperties$LWS = ['mozRequestFullScreen', 'onfullscreenchange', 'onfullscreenerror', 'requestFullscreen', 'webkitRequestFullScreen', 'webkitRequestFullscreen'];
|
|
9870
9879
|
const EventBlockedProperties$LWS = ['originalTarget', 'explicitOriginalTarget'];
|
|
@@ -9878,16 +9887,40 @@ const HTMLIFrameElementBlockedProperties$LWS = ['getSVGDocument', 'srcdoc'];
|
|
|
9878
9887
|
const HTMLObjectElementBlockedProperties$LWS = ['getSVGDocument'];
|
|
9879
9888
|
const HTMLScriptElementBlockedAttributes$LWS = ['nonce'];
|
|
9880
9889
|
const HTMLScriptElementBlockedProperties$LWS = ['nonce'];
|
|
9890
|
+
const LightningWebSecurity$LWS = {
|
|
9891
|
+
__proto__: null
|
|
9892
|
+
};
|
|
9893
|
+
const distortions$LWS = {
|
|
9894
|
+
__proto__: null,
|
|
9895
|
+
documentCookie: true
|
|
9896
|
+
};
|
|
9897
|
+
ReflectDefineProperty$LWS$1(LightningWebSecurity$LWS, 'distortions', {
|
|
9898
|
+
__proto__: null,
|
|
9899
|
+
enumerable: false,
|
|
9900
|
+
configurable: false,
|
|
9901
|
+
writable: false,
|
|
9902
|
+
value: distortions$LWS
|
|
9903
|
+
});
|
|
9904
|
+
ReflectDefineProperty$LWS$1(window, '$LWS', {
|
|
9905
|
+
__proto__: null,
|
|
9906
|
+
enumerable: false,
|
|
9907
|
+
configurable: false,
|
|
9908
|
+
writable: false,
|
|
9909
|
+
value: LightningWebSecurity$LWS
|
|
9910
|
+
});
|
|
9911
|
+
ObjectFreeze$LWS$1(LightningWebSecurity$LWS);
|
|
9912
|
+
ObjectPreventExtensions$LWS(distortions$LWS);
|
|
9881
9913
|
const SVGElementBlockedAttributes$LWS = ['nonce'];
|
|
9882
9914
|
const SVGElementBlockedProperties$LWS = ['nonce'];
|
|
9883
9915
|
const UIEventBlockedProperties$LWS = ['rangeParent'];
|
|
9884
9916
|
const WindowBlockedProperties$LWS = ['find'];
|
|
9885
9917
|
const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
|
|
9886
|
-
/*! version: 0.
|
|
9918
|
+
/*! version: 0.21.0 */
|
|
9887
9919
|
|
|
9888
9920
|
/*!
|
|
9889
9921
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
9890
9922
|
*/
|
|
9923
|
+
const distortionFactoryToggleSwitchesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
9891
9924
|
const distortionFactoriesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
9892
9925
|
const opaqueWindowPostMessageDistortionFactoryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
9893
9926
|
// WebKit based browsers have a bug that prematurely removes distortion entries
|
|
@@ -9906,7 +9939,9 @@ function createDistortionEntries$LWS(record$LWS, factories$LWS) {
|
|
|
9906
9939
|
1: distortedValue$LWS
|
|
9907
9940
|
} = entry$LWS;
|
|
9908
9941
|
if (typeof originalValue$LWS === 'function') {
|
|
9909
|
-
|
|
9942
|
+
const proxyMaskedFunctionDistortion$LWS = proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS);
|
|
9943
|
+
distortionFactoryToggleSwitchesCache$LWS.get(factory$LWS);
|
|
9944
|
+
entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskedFunctionDistortion$LWS];
|
|
9910
9945
|
} else {
|
|
9911
9946
|
// istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
|
|
9912
9947
|
if (typeof originalValue$LWS === 'object' && originalValue$LWS !== null) {
|
|
@@ -13596,7 +13631,11 @@ function createMembraneMarshall$LWS(globalObject$LWS) {
|
|
|
13596
13631
|
selectedTarget$LWS = undefined;
|
|
13597
13632
|
let proto$LWS;
|
|
13598
13633
|
if (typeof protoPointerOrNull$LWS === 'function') {
|
|
13599
|
-
protoPointerOrNull
|
|
13634
|
+
// Instead of calling `protoPointerOrNull()` directly we use
|
|
13635
|
+
// `ReflectApply` to avoid a Maglev (https://v8.dev/blog/maglev)
|
|
13636
|
+
// optimizing JIT bug in Chrome >= 117:
|
|
13637
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1494060
|
|
13638
|
+
ReflectApply$LWS(protoPointerOrNull$LWS, undefined, []);
|
|
13600
13639
|
proto$LWS = selectedTarget$LWS;
|
|
13601
13640
|
selectedTarget$LWS = undefined;
|
|
13602
13641
|
} else {
|
|
@@ -14870,6 +14909,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14870
14909
|
const forOfStateCache$LWS = toSafeMap$LWS$1(new MapCtor$LWS$1());
|
|
14871
14910
|
const resourcePromiseCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
14872
14911
|
const resourceStatusCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
14912
|
+
const scriptSrcGetterDistortion$LWS = distortions$LWS.get(isRootRecord$LWS ? HTMLScriptElementProtoSrcGetter$LWS : ObjectLookupOwnGetter$LWS$1(HTMLScriptElementProto$LWS, 'src'));
|
|
14873
14913
|
const scriptSrcSetterDistortion$LWS = distortions$LWS.get(isRootRecord$LWS ? HTMLScriptElementProtoSrcSetter$LWS : ObjectLookupOwnSetter$LWS(HTMLScriptElementProto$LWS, 'src'));
|
|
14874
14914
|
// istanbul ignore next: deprecated code path unreachable via tests
|
|
14875
14915
|
function genStep$LWS(resolve$LWS, reject$LWS, next$LWS, thrower$LWS, genMethodWrapper$LWS, arg$LWS) {
|
|
@@ -14889,25 +14929,19 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14889
14929
|
}
|
|
14890
14930
|
}
|
|
14891
14931
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
14892
|
-
function loadPromise$LWS(element$LWS,
|
|
14893
|
-
const isLinkTag$LWS = tagName$LWS === 'LINK';
|
|
14932
|
+
function loadPromise$LWS(element$LWS, urlAsString$LWS) {
|
|
14894
14933
|
const promise$LWS = new PromiseCtor$LWS((resolve$LWS, reject$LWS) => {
|
|
14895
14934
|
function onerror$LWS(event$LWS) {
|
|
14896
14935
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['error', onerror$LWS]);
|
|
14897
14936
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['load', onload$LWS]);
|
|
14898
14937
|
ReflectApply$LWS$1(EventProtoStopPropagation$LWS, event$LWS, []);
|
|
14899
|
-
|
|
14900
|
-
resourceStatusCache$LWS.set(element$LWS, 1 /* ResourceLoaderStatus.Errored */);
|
|
14901
|
-
}
|
|
14902
|
-
|
|
14938
|
+
resourceStatusCache$LWS.set(element$LWS, 1 /* ResourceLoaderStatus.Errored */);
|
|
14903
14939
|
reject$LWS(createResourceLoadError$LWS(urlAsString$LWS));
|
|
14904
14940
|
}
|
|
14905
14941
|
function onload$LWS() {
|
|
14906
14942
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['error', onerror$LWS]);
|
|
14907
14943
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['load', onload$LWS]);
|
|
14908
|
-
|
|
14909
|
-
resourceStatusCache$LWS.set(element$LWS, 3 /* ResourceLoaderStatus.Loaded */);
|
|
14910
|
-
}
|
|
14944
|
+
resourceStatusCache$LWS.set(element$LWS, 3 /* ResourceLoaderStatus.Loaded */);
|
|
14911
14945
|
// platformResourceLoader and ltng:require have to be synchronized in terms of
|
|
14912
14946
|
// creating and loading scripts. This expando is used by ltng:require to know if a
|
|
14913
14947
|
// script has been loaded by it or not. See W-13034908.
|
|
@@ -14920,10 +14954,8 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14920
14954
|
ReflectApply$LWS$1(EventTargetProtoAddEventListener$LWS, element$LWS, ['error', onerror$LWS]);
|
|
14921
14955
|
ReflectApply$LWS$1(EventTargetProtoAddEventListener$LWS, element$LWS, ['load', onload$LWS]);
|
|
14922
14956
|
});
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
resourcePromiseCache$LWS.set(element$LWS, promise$LWS);
|
|
14926
|
-
}
|
|
14957
|
+
resourceStatusCache$LWS.set(element$LWS, 2 /* ResourceLoaderStatus.Loading */);
|
|
14958
|
+
resourcePromiseCache$LWS.set(element$LWS, promise$LWS);
|
|
14927
14959
|
ReflectApply$LWS$1(NodeProtoAppendChild$LWS$1, head$LWS, [element$LWS]);
|
|
14928
14960
|
return promise$LWS;
|
|
14929
14961
|
}
|
|
@@ -14997,6 +15029,31 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14997
15029
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
14998
15030
|
function loadScript$LWS(_thisArg$LWS, url$LWS) {
|
|
14999
15031
|
const urlAsString$LWS = toString$LWS(url$LWS);
|
|
15032
|
+
const resolvedURL$LWS = resolveURL$LWS(urlAsString$LWS);
|
|
15033
|
+
const scripts$LWS = ReflectApply$LWS$1(ElementProtoQuerySelectorAll$LWS, head$LWS, ['script']);
|
|
15034
|
+
for (let i$LWS = 0, {
|
|
15035
|
+
length: length$LWS
|
|
15036
|
+
} = scripts$LWS; i$LWS < length$LWS; i$LWS += 1) {
|
|
15037
|
+
var _resourceStatusCache$$LWS;
|
|
15038
|
+
const script$LWS = scripts$LWS[i$LWS];
|
|
15039
|
+
// Ensure that this <script> is actually in the resource cache for this sandbox.
|
|
15040
|
+
// Previously this check only looked at the <script>'s src, which would give a
|
|
15041
|
+
// false positive if more than one sandbox had loaded this resource.
|
|
15042
|
+
const status$LWS = (_resourceStatusCache$$LWS = resourceStatusCache$LWS.get(script$LWS)) != null ? _resourceStatusCache$$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
15043
|
+
// istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
|
|
15044
|
+
if (status$LWS && ReflectApply$LWS$1(scriptSrcGetterDistortion$LWS, script$LWS, []) === resolvedURL$LWS) {
|
|
15045
|
+
if (status$LWS === 3 /* ResourceLoaderStatus.Loaded */) {
|
|
15046
|
+
return PromiseResolve$LWS(undefined);
|
|
15047
|
+
}
|
|
15048
|
+
// istanbul ignore if: this status cannot be tested without navigating the page itself during the execution of the request.
|
|
15049
|
+
if (status$LWS === 1 /* ResourceLoaderStatus.Errored */) {
|
|
15050
|
+
return PromiseReject$LWS(createResourceLoadError$LWS(urlAsString$LWS));
|
|
15051
|
+
}
|
|
15052
|
+
if (status$LWS === 2 /* ResourceLoaderStatus.Loading */) {
|
|
15053
|
+
return resourcePromiseCache$LWS.get(script$LWS);
|
|
15054
|
+
}
|
|
15055
|
+
}
|
|
15056
|
+
}
|
|
15000
15057
|
const script$LWS = ReflectApply$LWS$1(DocumentProtoCreateElement$LWS$1, document$LWS, ['script']);
|
|
15001
15058
|
script$LWS.type = 'text/javascript';
|
|
15002
15059
|
// platformResourceLoader and ltng:require have to be synchronized in terms of creating
|
|
@@ -15005,7 +15062,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15005
15062
|
// eslint-disable-next-line no-underscore-dangle
|
|
15006
15063
|
script$LWS._ltngRequireCreated = true;
|
|
15007
15064
|
ReflectApply$LWS$1(scriptSrcSetterDistortion$LWS, script$LWS, [urlAsString$LWS]);
|
|
15008
|
-
return loadPromise$LWS(script$LWS,
|
|
15065
|
+
return loadPromise$LWS(script$LWS, urlAsString$LWS);
|
|
15009
15066
|
},
|
|
15010
15067
|
// Functionality based on platformResourceLoader#loadStyle (http://sfdc.co/bIpMYB) but
|
|
15011
15068
|
// adjusted for multiple sandboxes. This loadStyle will create one <link> element in the DOM
|
|
@@ -15015,8 +15072,8 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15015
15072
|
const urlAsString$LWS = toString$LWS(url$LWS);
|
|
15016
15073
|
let link$LWS = ReflectApply$LWS$1(ElementProtoQuerySelector$LWS, head$LWS, [`link[href=${enquote$LWS(urlAsString$LWS)}]`]);
|
|
15017
15074
|
if (link$LWS) {
|
|
15018
|
-
var _resourceStatusCache
|
|
15019
|
-
const status$LWS = (_resourceStatusCache
|
|
15075
|
+
var _resourceStatusCache$2$LWS;
|
|
15076
|
+
const status$LWS = (_resourceStatusCache$2$LWS = resourceStatusCache$LWS.get(link$LWS)) != null ? _resourceStatusCache$2$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
15020
15077
|
if (status$LWS === 0 /* ResourceLoaderStatus.None */ || status$LWS === 3 /* ResourceLoaderStatus.Loaded */) {
|
|
15021
15078
|
return PromiseResolve$LWS(undefined);
|
|
15022
15079
|
}
|
|
@@ -15031,7 +15088,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15031
15088
|
link$LWS.type = 'text/css';
|
|
15032
15089
|
link$LWS.rel = 'stylesheet';
|
|
15033
15090
|
link$LWS.href = urlAsString$LWS;
|
|
15034
|
-
return loadPromise$LWS(link$LWS,
|
|
15091
|
+
return loadPromise$LWS(link$LWS, urlAsString$LWS);
|
|
15035
15092
|
}];
|
|
15036
15093
|
}
|
|
15037
15094
|
function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
@@ -15044,7 +15101,7 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
|
15044
15101
|
// tools from mistaking the regexp or the replacement string for an
|
|
15045
15102
|
// actual source mapping URL.
|
|
15046
15103
|
/\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
|
|
15047
|
-
sourceText$LWS = `\n//# LWS Version = "0.
|
|
15104
|
+
sourceText$LWS = `\n//# LWS Version = "0.21.0"\n${sourceText$LWS}`;
|
|
15048
15105
|
return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
|
|
15049
15106
|
// Append "'use strict'" to the extracted function body so it is
|
|
15050
15107
|
// evaluated in strict mode.
|
|
@@ -15739,7 +15796,7 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
|
|
|
15739
15796
|
depRegistry$LWS.set(dep$LWS, secureDep$LWS);
|
|
15740
15797
|
return secureDep$LWS;
|
|
15741
15798
|
}
|
|
15742
|
-
/*! version: 0.
|
|
15799
|
+
/*! version: 0.21.0 */
|
|
15743
15800
|
|
|
15744
15801
|
const loaderDefine = globalThis.LWR.define;
|
|
15745
15802
|
|
|
@@ -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.
|
|
1456
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
2115
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
2174
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
3860
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
4109
|
+
/*! version: 0.21.0 */
|
|
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.
|
|
4307
|
+
/*! version: 0.21.0 */
|
|
4308
4308
|
|
|
4309
4309
|
/*!
|
|
4310
4310
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -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 =
|
|
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.
|
|
@@ -6741,6 +6748,7 @@ function initDistortionElementSetHTML$LWS({
|
|
|
6741
6748
|
// istanbul ignore next: only runs in browsers without property
|
|
6742
6749
|
return noop$LWS$1;
|
|
6743
6750
|
}
|
|
6751
|
+
// istanbul ignore next: Element.prototype.setHTML is not supported in any browser yet
|
|
6744
6752
|
return function distortionElementSetHTML$LWS({
|
|
6745
6753
|
key: key$LWS
|
|
6746
6754
|
}) {
|
|
@@ -7211,7 +7219,7 @@ function initDistortionHTMLIFrameElementSrcSetter$LWS({
|
|
|
7211
7219
|
};
|
|
7212
7220
|
}
|
|
7213
7221
|
const importRegExp$LWS = /import/i;
|
|
7214
|
-
const WARN_MESSAGE$LWS = 'HTMLLinkElement does not allow setting "rel" property to "import" value.';
|
|
7222
|
+
const WARN_MESSAGE$LWS = 'Lightning Web Security: HTMLLinkElement does not allow setting "rel" property to "import" value.';
|
|
7215
7223
|
function isValidRelValue$LWS(value$LWS) {
|
|
7216
7224
|
return typeof value$LWS !== 'string' || !ReflectApply$LWS$1(RegExpProtoTest$LWS$1, importRegExp$LWS, [value$LWS]);
|
|
7217
7225
|
}
|
|
@@ -7997,7 +8005,7 @@ function initDistortionPerformanceMeasure$LWS({
|
|
|
7997
8005
|
throw error;
|
|
7998
8006
|
}
|
|
7999
8007
|
}];
|
|
8000
|
-
return function
|
|
8008
|
+
return function distortionPerformanceMeasure$LWS() {
|
|
8001
8009
|
return distortionEntry$LWS;
|
|
8002
8010
|
};
|
|
8003
8011
|
}
|
|
@@ -9865,6 +9873,7 @@ initDistortionElementAfter$LWS, initDistortionElementAppend$LWS, initDistortionE
|
|
|
9865
9873
|
// initDistortionNodeAppendChild,
|
|
9866
9874
|
initDistortionNodeInsertBefore$LWS]);
|
|
9867
9875
|
const externalKeyedDistortionFactoryInitializers$LWS = internalKeyedDistortionFactoryInitializers$LWS;
|
|
9876
|
+
toSafeMap$LWS$1(new MapCtor$LWS$1([[initDistortionDocumentCookieGetter$LWS, 'documentCookie'], [initDistortionDocumentCookieSetter$LWS, 'documentCookie']]));
|
|
9868
9877
|
const DocumentBlockedProperties$LWS = ['createProcessingInstruction', 'exitFullscreen', 'fullscreen', 'fullscreenElement', 'fullscreenEnabled', 'mozCancelFullScreen', 'mozFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'onfullscreenchange', 'onfullscreenerror', 'onmozfullscreenchange', 'onmozfullscreenerror', 'onrejectionhandled', 'onunhandledrejection', 'releaseCapture', 'releaseEvents', 'webkitFullScreenKeyboardInputAllowed', 'write', 'writeln'];
|
|
9869
9878
|
const ElementBlockedProperties$LWS = ['mozRequestFullScreen', 'onfullscreenchange', 'onfullscreenerror', 'requestFullscreen', 'webkitRequestFullScreen', 'webkitRequestFullscreen'];
|
|
9870
9879
|
const EventBlockedProperties$LWS = ['originalTarget', 'explicitOriginalTarget'];
|
|
@@ -9878,16 +9887,40 @@ const HTMLIFrameElementBlockedProperties$LWS = ['getSVGDocument', 'srcdoc'];
|
|
|
9878
9887
|
const HTMLObjectElementBlockedProperties$LWS = ['getSVGDocument'];
|
|
9879
9888
|
const HTMLScriptElementBlockedAttributes$LWS = ['nonce'];
|
|
9880
9889
|
const HTMLScriptElementBlockedProperties$LWS = ['nonce'];
|
|
9890
|
+
const LightningWebSecurity$LWS = {
|
|
9891
|
+
__proto__: null
|
|
9892
|
+
};
|
|
9893
|
+
const distortions$LWS = {
|
|
9894
|
+
__proto__: null,
|
|
9895
|
+
documentCookie: true
|
|
9896
|
+
};
|
|
9897
|
+
ReflectDefineProperty$LWS$1(LightningWebSecurity$LWS, 'distortions', {
|
|
9898
|
+
__proto__: null,
|
|
9899
|
+
enumerable: false,
|
|
9900
|
+
configurable: false,
|
|
9901
|
+
writable: false,
|
|
9902
|
+
value: distortions$LWS
|
|
9903
|
+
});
|
|
9904
|
+
ReflectDefineProperty$LWS$1(window, '$LWS', {
|
|
9905
|
+
__proto__: null,
|
|
9906
|
+
enumerable: false,
|
|
9907
|
+
configurable: false,
|
|
9908
|
+
writable: false,
|
|
9909
|
+
value: LightningWebSecurity$LWS
|
|
9910
|
+
});
|
|
9911
|
+
ObjectFreeze$LWS$1(LightningWebSecurity$LWS);
|
|
9912
|
+
ObjectPreventExtensions$LWS(distortions$LWS);
|
|
9881
9913
|
const SVGElementBlockedAttributes$LWS = ['nonce'];
|
|
9882
9914
|
const SVGElementBlockedProperties$LWS = ['nonce'];
|
|
9883
9915
|
const UIEventBlockedProperties$LWS = ['rangeParent'];
|
|
9884
9916
|
const WindowBlockedProperties$LWS = ['find'];
|
|
9885
9917
|
const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
|
|
9886
|
-
/*! version: 0.
|
|
9918
|
+
/*! version: 0.21.0 */
|
|
9887
9919
|
|
|
9888
9920
|
/*!
|
|
9889
9921
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
9890
9922
|
*/
|
|
9923
|
+
const distortionFactoryToggleSwitchesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
9891
9924
|
const distortionFactoriesCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
9892
9925
|
const opaqueWindowPostMessageDistortionFactoryCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
9893
9926
|
// WebKit based browsers have a bug that prematurely removes distortion entries
|
|
@@ -9906,7 +9939,9 @@ function createDistortionEntries$LWS(record$LWS, factories$LWS) {
|
|
|
9906
9939
|
1: distortedValue$LWS
|
|
9907
9940
|
} = entry$LWS;
|
|
9908
9941
|
if (typeof originalValue$LWS === 'function') {
|
|
9909
|
-
|
|
9942
|
+
const proxyMaskedFunctionDistortion$LWS = proxyMaskFunctionDistortion$LWS(record$LWS, factory$LWS, distortedValue$LWS, originalValue$LWS);
|
|
9943
|
+
distortionFactoryToggleSwitchesCache$LWS.get(factory$LWS);
|
|
9944
|
+
entries$LWS[entries$LWS.length] = [originalValue$LWS, proxyMaskedFunctionDistortion$LWS];
|
|
9910
9945
|
} else {
|
|
9911
9946
|
// istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
|
|
9912
9947
|
if (typeof originalValue$LWS === 'object' && originalValue$LWS !== null) {
|
|
@@ -13596,7 +13631,11 @@ function createMembraneMarshall$LWS(globalObject$LWS) {
|
|
|
13596
13631
|
selectedTarget$LWS = undefined;
|
|
13597
13632
|
let proto$LWS;
|
|
13598
13633
|
if (typeof protoPointerOrNull$LWS === 'function') {
|
|
13599
|
-
protoPointerOrNull
|
|
13634
|
+
// Instead of calling `protoPointerOrNull()` directly we use
|
|
13635
|
+
// `ReflectApply` to avoid a Maglev (https://v8.dev/blog/maglev)
|
|
13636
|
+
// optimizing JIT bug in Chrome >= 117:
|
|
13637
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1494060
|
|
13638
|
+
ReflectApply$LWS(protoPointerOrNull$LWS, undefined, []);
|
|
13600
13639
|
proto$LWS = selectedTarget$LWS;
|
|
13601
13640
|
selectedTarget$LWS = undefined;
|
|
13602
13641
|
} else {
|
|
@@ -14870,6 +14909,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14870
14909
|
const forOfStateCache$LWS = toSafeMap$LWS$1(new MapCtor$LWS$1());
|
|
14871
14910
|
const resourcePromiseCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
14872
14911
|
const resourceStatusCache$LWS = toSafeWeakMap$LWS$1(new WeakMapCtor$LWS$1());
|
|
14912
|
+
const scriptSrcGetterDistortion$LWS = distortions$LWS.get(isRootRecord$LWS ? HTMLScriptElementProtoSrcGetter$LWS : ObjectLookupOwnGetter$LWS$1(HTMLScriptElementProto$LWS, 'src'));
|
|
14873
14913
|
const scriptSrcSetterDistortion$LWS = distortions$LWS.get(isRootRecord$LWS ? HTMLScriptElementProtoSrcSetter$LWS : ObjectLookupOwnSetter$LWS(HTMLScriptElementProto$LWS, 'src'));
|
|
14874
14914
|
// istanbul ignore next: deprecated code path unreachable via tests
|
|
14875
14915
|
function genStep$LWS(resolve$LWS, reject$LWS, next$LWS, thrower$LWS, genMethodWrapper$LWS, arg$LWS) {
|
|
@@ -14889,25 +14929,19 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14889
14929
|
}
|
|
14890
14930
|
}
|
|
14891
14931
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
14892
|
-
function loadPromise$LWS(element$LWS,
|
|
14893
|
-
const isLinkTag$LWS = tagName$LWS === 'LINK';
|
|
14932
|
+
function loadPromise$LWS(element$LWS, urlAsString$LWS) {
|
|
14894
14933
|
const promise$LWS = new PromiseCtor$LWS((resolve$LWS, reject$LWS) => {
|
|
14895
14934
|
function onerror$LWS(event$LWS) {
|
|
14896
14935
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['error', onerror$LWS]);
|
|
14897
14936
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['load', onload$LWS]);
|
|
14898
14937
|
ReflectApply$LWS$1(EventProtoStopPropagation$LWS, event$LWS, []);
|
|
14899
|
-
|
|
14900
|
-
resourceStatusCache$LWS.set(element$LWS, 1 /* ResourceLoaderStatus.Errored */);
|
|
14901
|
-
}
|
|
14902
|
-
|
|
14938
|
+
resourceStatusCache$LWS.set(element$LWS, 1 /* ResourceLoaderStatus.Errored */);
|
|
14903
14939
|
reject$LWS(createResourceLoadError$LWS(urlAsString$LWS));
|
|
14904
14940
|
}
|
|
14905
14941
|
function onload$LWS() {
|
|
14906
14942
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['error', onerror$LWS]);
|
|
14907
14943
|
ReflectApply$LWS$1(EventTargetProtoRemoveEventListener$LWS, element$LWS, ['load', onload$LWS]);
|
|
14908
|
-
|
|
14909
|
-
resourceStatusCache$LWS.set(element$LWS, 3 /* ResourceLoaderStatus.Loaded */);
|
|
14910
|
-
}
|
|
14944
|
+
resourceStatusCache$LWS.set(element$LWS, 3 /* ResourceLoaderStatus.Loaded */);
|
|
14911
14945
|
// platformResourceLoader and ltng:require have to be synchronized in terms of
|
|
14912
14946
|
// creating and loading scripts. This expando is used by ltng:require to know if a
|
|
14913
14947
|
// script has been loaded by it or not. See W-13034908.
|
|
@@ -14920,10 +14954,8 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14920
14954
|
ReflectApply$LWS$1(EventTargetProtoAddEventListener$LWS, element$LWS, ['error', onerror$LWS]);
|
|
14921
14955
|
ReflectApply$LWS$1(EventTargetProtoAddEventListener$LWS, element$LWS, ['load', onload$LWS]);
|
|
14922
14956
|
});
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
resourcePromiseCache$LWS.set(element$LWS, promise$LWS);
|
|
14926
|
-
}
|
|
14957
|
+
resourceStatusCache$LWS.set(element$LWS, 2 /* ResourceLoaderStatus.Loading */);
|
|
14958
|
+
resourcePromiseCache$LWS.set(element$LWS, promise$LWS);
|
|
14927
14959
|
ReflectApply$LWS$1(NodeProtoAppendChild$LWS$1, head$LWS, [element$LWS]);
|
|
14928
14960
|
return promise$LWS;
|
|
14929
14961
|
}
|
|
@@ -14997,6 +15029,31 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
14997
15029
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
14998
15030
|
function loadScript$LWS(_thisArg$LWS, url$LWS) {
|
|
14999
15031
|
const urlAsString$LWS = toString$LWS(url$LWS);
|
|
15032
|
+
const resolvedURL$LWS = resolveURL$LWS(urlAsString$LWS);
|
|
15033
|
+
const scripts$LWS = ReflectApply$LWS$1(ElementProtoQuerySelectorAll$LWS, head$LWS, ['script']);
|
|
15034
|
+
for (let i$LWS = 0, {
|
|
15035
|
+
length: length$LWS
|
|
15036
|
+
} = scripts$LWS; i$LWS < length$LWS; i$LWS += 1) {
|
|
15037
|
+
var _resourceStatusCache$$LWS;
|
|
15038
|
+
const script$LWS = scripts$LWS[i$LWS];
|
|
15039
|
+
// Ensure that this <script> is actually in the resource cache for this sandbox.
|
|
15040
|
+
// Previously this check only looked at the <script>'s src, which would give a
|
|
15041
|
+
// false positive if more than one sandbox had loaded this resource.
|
|
15042
|
+
const status$LWS = (_resourceStatusCache$$LWS = resourceStatusCache$LWS.get(script$LWS)) != null ? _resourceStatusCache$$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
15043
|
+
// istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
|
|
15044
|
+
if (status$LWS && ReflectApply$LWS$1(scriptSrcGetterDistortion$LWS, script$LWS, []) === resolvedURL$LWS) {
|
|
15045
|
+
if (status$LWS === 3 /* ResourceLoaderStatus.Loaded */) {
|
|
15046
|
+
return PromiseResolve$LWS(undefined);
|
|
15047
|
+
}
|
|
15048
|
+
// istanbul ignore if: this status cannot be tested without navigating the page itself during the execution of the request.
|
|
15049
|
+
if (status$LWS === 1 /* ResourceLoaderStatus.Errored */) {
|
|
15050
|
+
return PromiseReject$LWS(createResourceLoadError$LWS(urlAsString$LWS));
|
|
15051
|
+
}
|
|
15052
|
+
if (status$LWS === 2 /* ResourceLoaderStatus.Loading */) {
|
|
15053
|
+
return resourcePromiseCache$LWS.get(script$LWS);
|
|
15054
|
+
}
|
|
15055
|
+
}
|
|
15056
|
+
}
|
|
15000
15057
|
const script$LWS = ReflectApply$LWS$1(DocumentProtoCreateElement$LWS$1, document$LWS, ['script']);
|
|
15001
15058
|
script$LWS.type = 'text/javascript';
|
|
15002
15059
|
// platformResourceLoader and ltng:require have to be synchronized in terms of creating
|
|
@@ -15005,7 +15062,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15005
15062
|
// eslint-disable-next-line no-underscore-dangle
|
|
15006
15063
|
script$LWS._ltngRequireCreated = true;
|
|
15007
15064
|
ReflectApply$LWS$1(scriptSrcSetterDistortion$LWS, script$LWS, [urlAsString$LWS]);
|
|
15008
|
-
return loadPromise$LWS(script$LWS,
|
|
15065
|
+
return loadPromise$LWS(script$LWS, urlAsString$LWS);
|
|
15009
15066
|
},
|
|
15010
15067
|
// Functionality based on platformResourceLoader#loadStyle (http://sfdc.co/bIpMYB) but
|
|
15011
15068
|
// adjusted for multiple sandboxes. This loadStyle will create one <link> element in the DOM
|
|
@@ -15015,8 +15072,8 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15015
15072
|
const urlAsString$LWS = toString$LWS(url$LWS);
|
|
15016
15073
|
let link$LWS = ReflectApply$LWS$1(ElementProtoQuerySelector$LWS, head$LWS, [`link[href=${enquote$LWS(urlAsString$LWS)}]`]);
|
|
15017
15074
|
if (link$LWS) {
|
|
15018
|
-
var _resourceStatusCache
|
|
15019
|
-
const status$LWS = (_resourceStatusCache
|
|
15075
|
+
var _resourceStatusCache$2$LWS;
|
|
15076
|
+
const status$LWS = (_resourceStatusCache$2$LWS = resourceStatusCache$LWS.get(link$LWS)) != null ? _resourceStatusCache$2$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
15020
15077
|
if (status$LWS === 0 /* ResourceLoaderStatus.None */ || status$LWS === 3 /* ResourceLoaderStatus.Loaded */) {
|
|
15021
15078
|
return PromiseResolve$LWS(undefined);
|
|
15022
15079
|
}
|
|
@@ -15031,7 +15088,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15031
15088
|
link$LWS.type = 'text/css';
|
|
15032
15089
|
link$LWS.rel = 'stylesheet';
|
|
15033
15090
|
link$LWS.href = urlAsString$LWS;
|
|
15034
|
-
return loadPromise$LWS(link$LWS,
|
|
15091
|
+
return loadPromise$LWS(link$LWS, urlAsString$LWS);
|
|
15035
15092
|
}];
|
|
15036
15093
|
}
|
|
15037
15094
|
function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
@@ -15044,7 +15101,7 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
|
15044
15101
|
// tools from mistaking the regexp or the replacement string for an
|
|
15045
15102
|
// actual source mapping URL.
|
|
15046
15103
|
/\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
|
|
15047
|
-
sourceText$LWS = `\n//# LWS Version = "0.
|
|
15104
|
+
sourceText$LWS = `\n//# LWS Version = "0.21.0"\n${sourceText$LWS}`;
|
|
15048
15105
|
return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
|
|
15049
15106
|
// Append "'use strict'" to the extracted function body so it is
|
|
15050
15107
|
// evaluated in strict mode.
|
|
@@ -15769,7 +15826,7 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
|
|
|
15769
15826
|
depRegistry$LWS.set(dep$LWS, secureDep$LWS);
|
|
15770
15827
|
return secureDep$LWS;
|
|
15771
15828
|
}
|
|
15772
|
-
/*! version: 0.
|
|
15829
|
+
/*! version: 0.21.0 */
|
|
15773
15830
|
|
|
15774
15831
|
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 };
|
|
15775
15832
|
//# sourceMappingURL=lockerSandbox.js.map
|