Commit 3a84cbd5 authored by Ahmet Turan Koçak's avatar Ahmet Turan Koçak
Browse files

Initial commit

parents
{"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oBAAY,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,CAAC"}
\ No newline at end of file
import { Logger, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from "@azure/msal-common";
import { CryptoOptions } from "../config/Configuration";
export declare class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {
private browserCrypto;
private guidGenerator;
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, cryptoOptions: CryptoOptions);
startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;
generateId(): string;
private getPageVisibility;
/**
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
* Also captures browser page visibilityState.
*
* @param {PerformanceEvents} measureName
* @param {?string} [correlationId]
* @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
*/
startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent;
}
//# sourceMappingURL=BrowserPerformanceClient.d.ts.map
\ No newline at end of file
{"version":3,"file":"BrowserPerformanceClient.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAoB,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnM,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,qBAAa,wBAAyB,SAAQ,iBAAkB,YAAW,kBAAkB;IACzF,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa;IAMtL,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,uBAAuB;IAIjG,UAAU,IAAK,MAAM;IAIrB,OAAO,CAAC,iBAAiB;IAIzB;;;;;;;OAOG;IACH,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,0BAA0B;CAiBvG"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __extends, __assign } from '../_virtual/_tslib.js';
import { PerformanceClient } from '@azure/msal-common';
import { BrowserCrypto } from '../crypto/BrowserCrypto.js';
import { GuidGenerator } from '../crypto/GuidGenerator.js';
import { BrowserPerformanceMeasurement } from './BrowserPerformanceMeasurement.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var BrowserPerformanceClient = /** @class */ (function (_super) {
__extends(BrowserPerformanceClient, _super);
function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {
var _this = _super.call(this, clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) || this;
_this.browserCrypto = new BrowserCrypto(_this.logger, cryptoOptions);
_this.guidGenerator = new GuidGenerator(_this.browserCrypto);
return _this;
}
BrowserPerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {
return new BrowserPerformanceMeasurement(measureName, correlationId);
};
BrowserPerformanceClient.prototype.generateId = function () {
return this.guidGenerator.generateGuid();
};
BrowserPerformanceClient.prototype.getPageVisibility = function () {
var _a;
return ((_a = document.visibilityState) === null || _a === void 0 ? void 0 : _a.toString()) || null;
};
/**
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
* Also captures browser page visibilityState.
*
* @param {PerformanceEvents} measureName
* @param {?string} [correlationId]
* @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
*/
BrowserPerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {
var _this = this;
// Capture page visibilityState and then invoke start/end measurement
var startPageVisibility = this.getPageVisibility();
var inProgressEvent = _super.prototype.startMeasurement.call(this, measureName, correlationId);
return __assign(__assign({}, inProgressEvent), { endMeasurement: function (event) {
return inProgressEvent.endMeasurement(__assign({ startPageVisibility: startPageVisibility, endPageVisibility: _this.getPageVisibility() }, event));
} });
};
return BrowserPerformanceClient;
}(PerformanceClient));
export { BrowserPerformanceClient };
//# sourceMappingURL=BrowserPerformanceClient.js.map
{"version":3,"file":"BrowserPerformanceClient.js","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger, PerformanceEvent, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { CryptoOptions } from \"../config/Configuration\";\nimport { BrowserCrypto } from \"../crypto/BrowserCrypto\";\nimport { GuidGenerator } from \"../crypto/GuidGenerator\";\nimport { BrowserPerformanceMeasurement } from \"./BrowserPerformanceMeasurement\";\n\nexport class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {\n private browserCrypto: BrowserCrypto;\n private guidGenerator: GuidGenerator;\n \n constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, cryptoOptions: CryptoOptions) {\n super(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry);\n this.browserCrypto = new BrowserCrypto(this.logger, cryptoOptions);\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\n }\n \n startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement {\n return new BrowserPerformanceMeasurement(measureName, correlationId);\n }\n\n generateId() : string {\n return this.guidGenerator.generateGuid();\n }\n\n private getPageVisibility(): string | null {\n return document.visibilityState?.toString() || null;\n }\n \n /**\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\n * Also captures browser page visibilityState.\n *\n * @param {PerformanceEvents} measureName\n * @param {?string} [correlationId]\n * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}\n */\n startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent {\n // Capture page visibilityState and then invoke start/end measurement\n const startPageVisibility = this.getPageVisibility();\n \n const inProgressEvent = super.startMeasurement(measureName, correlationId);\n\n return {\n ...inProgressEvent,\n endMeasurement: (event?: Partial<PerformanceEvent>): PerformanceEvent | null => {\n return inProgressEvent.endMeasurement({\n startPageVisibility,\n endPageVisibility: this.getPageVisibility(),\n ...event\n });\n }\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAW8C,4CAAiB;IAI3D,kCAAY,QAAgB,EAAE,SAAiB,EAAE,MAAc,EAAE,WAAmB,EAAE,cAAsB,EAAE,oBAA0C,EAAE,aAA4B;QAAtL,YACI,kBAAM,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,CAAC,SAGxF;QAFG,KAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACnE,KAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;;KAC9D;IAED,+DAA4B,GAA5B,UAA6B,WAAmB,EAAE,aAAqB;QACnE,OAAO,IAAI,6BAA6B,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;KACxE;IAED,6CAAU,GAAV;QACI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;KAC5C;IAEO,oDAAiB,GAAzB;;QACI,OAAO,OAAA,QAAQ,CAAC,eAAe,0CAAE,QAAQ,OAAM,IAAI,CAAC;KACvD;;;;;;;;;IAUD,mDAAgB,GAAhB,UAAiB,WAA8B,EAAE,aAAsB;QAAvE,iBAgBC;;QAdG,IAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAErD,IAAM,eAAe,GAAG,iBAAM,gBAAgB,YAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAE3E,6BACO,eAAe,KAClB,cAAc,EAAE,UAAC,KAAiC;gBAC9C,OAAO,eAAe,CAAC,cAAc,YACjC,mBAAmB,qBAAA,EACnB,iBAAiB,EAAE,KAAI,CAAC,iBAAiB,EAAE,IACxC,KAAK,EACV,CAAC;aACN,IACH;KACL;IACL,+BAAC;AAAD,CA/CA,CAA8C,iBAAiB;;;;"}
\ No newline at end of file
import { IPerformanceMeasurement } from "@azure/msal-common";
export declare class BrowserPerformanceMeasurement implements IPerformanceMeasurement {
private measureName;
private correlationId;
private startMark;
private endMark;
constructor(name: string, correlationId: string);
static supportsBrowserPerformance(): boolean;
startMeasurement(): void;
endMeasurement(): void;
flushMeasurement(): number | null;
}
//# sourceMappingURL=BrowserPerformanceMeasurement.d.ts.map
\ No newline at end of file
{"version":3,"file":"BrowserPerformanceMeasurement.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceMeasurement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,qBAAa,6BAA8B,YAAW,uBAAuB;IACzE,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;gBAEZ,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAO/C,MAAM,CAAC,0BAA0B,IAAI,OAAO;IAU5C,gBAAgB,IAAI,IAAI;IAUxB,cAAc,IAAG,IAAI;IAWrB,gBAAgB,IAAI,MAAM,GAAG,IAAI;CAiBpC"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var BrowserPerformanceMeasurement = /** @class */ (function () {
function BrowserPerformanceMeasurement(name, correlationId) {
this.correlationId = correlationId;
this.measureName = "msal.measure." + name + "." + this.correlationId;
this.startMark = "msal.start." + name + "." + this.correlationId;
this.endMark = "msal.end." + name + "." + this.correlationId;
}
BrowserPerformanceMeasurement.supportsBrowserPerformance = function () {
return typeof window !== "undefined" &&
typeof window.performance !== "undefined" &&
typeof window.performance.mark === "function" &&
typeof window.performance.measure === "function" &&
typeof window.performance.clearMarks === "function" &&
typeof window.performance.clearMeasures === "function" &&
typeof window.performance.getEntriesByName === "function";
};
BrowserPerformanceMeasurement.prototype.startMeasurement = function () {
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
try {
window.performance.mark(this.startMark);
}
catch (e) {
// Silently catch
}
}
};
BrowserPerformanceMeasurement.prototype.endMeasurement = function () {
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
try {
window.performance.mark(this.endMark);
window.performance.measure(this.measureName, this.startMark, this.endMark);
}
catch (e) {
// Silently catch
}
}
};
BrowserPerformanceMeasurement.prototype.flushMeasurement = function () {
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
try {
var entriesForMeasurement = window.performance.getEntriesByName(this.measureName, "measure");
if (entriesForMeasurement.length > 0) {
var durationMs = entriesForMeasurement[0].duration;
window.performance.clearMeasures(this.measureName);
window.performance.clearMarks(this.startMark);
window.performance.clearMarks(this.endMark);
return durationMs;
}
}
catch (e) {
// Silently catch and return null
}
}
return null;
};
return BrowserPerformanceMeasurement;
}());
export { BrowserPerformanceMeasurement };
//# sourceMappingURL=BrowserPerformanceMeasurement.js.map
{"version":3,"file":"BrowserPerformanceMeasurement.js","sources":["../../src/telemetry/BrowserPerformanceMeasurement.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IPerformanceMeasurement } from \"@azure/msal-common\";\n\nexport class BrowserPerformanceMeasurement implements IPerformanceMeasurement {\n private measureName: string;\n private correlationId: string;\n private startMark: string;\n private endMark: string;\n\n constructor(name: string, correlationId: string) {\n this.correlationId = correlationId;\n this.measureName = `msal.measure.${name}.${this.correlationId}`;\n this.startMark = `msal.start.${name}.${this.correlationId}`;\n this.endMark = `msal.end.${name}.${this.correlationId}`;\n }\n\n static supportsBrowserPerformance(): boolean {\n return typeof window !== \"undefined\" &&\n typeof window.performance !== \"undefined\" &&\n typeof window.performance.mark === \"function\" && \n typeof window.performance.measure === \"function\" &&\n typeof window.performance.clearMarks === \"function\" &&\n typeof window.performance.clearMeasures === \"function\" &&\n typeof window.performance.getEntriesByName === \"function\";\n }\n\n startMeasurement(): void {\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\n try {\n window.performance.mark(this.startMark);\n } catch (e) {\n // Silently catch\n }\n }\n }\n\n endMeasurement():void {\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\n try {\n window.performance.mark(this.endMark);\n window.performance.measure(this.measureName, this.startMark, this.endMark);\n } catch (e) {\n // Silently catch\n }\n }\n }\n\n flushMeasurement(): number | null {\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\n try {\n const entriesForMeasurement = window.performance.getEntriesByName(this.measureName, \"measure\");\n if (entriesForMeasurement.length > 0) {\n const durationMs = entriesForMeasurement[0].duration;\n window.performance.clearMeasures(this.measureName);\n window.performance.clearMarks(this.startMark);\n window.performance.clearMarks(this.endMark);\n return durationMs;\n }\n } catch (e) {\n // Silently catch and return null\n }\n }\n return null;\n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EX;SACJ;KACJ;IAED,wDAAgB,GAAhB;QACI,IAAI,6BAA6B,CAAC,0BAA0B,EAAE,EAAE;YAC5D,IAAI;gBACA,IAAM,qBAAqB,GAAG,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;gBAC/F,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE;oBAClC,IAAM,UAAU,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;oBACrD,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBACnD,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBAC9C,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC5C,OAAO,UAAU,CAAC;iBACrB;aACJ;YAAC,OAAO,CAAC,EAAE;;aAEX;SACJ;QACD,OAAO,IAAI,CAAC;KACf;IACL,oCAAC;AAAD,CAAC;;;;"}
\ No newline at end of file
import { PopupRequest } from "../request/PopupRequest";
import { RedirectRequest } from "../request/RedirectRequest";
/**
* Constants
*/
export declare const BrowserConstants: {
/**
* Interaction in progress cache value
*/
INTERACTION_IN_PROGRESS_VALUE: string;
/**
* Invalid grant error code
*/
INVALID_GRANT_ERROR: string;
/**
* Default popup window width
*/
POPUP_WIDTH: number;
/**
* Default popup window height
*/
POPUP_HEIGHT: number;
/**
* Name of the popup window starts with
*/
POPUP_NAME_PREFIX: string;
/**
* Default popup monitor poll interval in milliseconds
*/
DEFAULT_POLL_INTERVAL_MS: number;
/**
* Msal-browser SKU
*/
MSAL_SKU: string;
};
export declare const NativeConstants: {
CHANNEL_ID: string;
PREFERRED_EXTENSION_ID: string;
MATS_TELEMETRY: string;
};
export declare enum NativeExtensionMethod {
HandshakeRequest = "Handshake",
HandshakeResponse = "HandshakeResponse",
GetToken = "GetToken",
Response = "Response"
}
export declare enum BrowserCacheLocation {
LocalStorage = "localStorage",
SessionStorage = "sessionStorage",
MemoryStorage = "memoryStorage"
}
/**
* HTTP Request types supported by MSAL.
*/
export declare enum HTTP_REQUEST_TYPE {
GET = "GET",
POST = "POST"
}
/**
* Temporary cache keys for MSAL, deleted after any request.
*/
export declare enum TemporaryCacheKeys {
AUTHORITY = "authority",
ACQUIRE_TOKEN_ACCOUNT = "acquireToken.account",
SESSION_STATE = "session.state",
REQUEST_STATE = "request.state",
NONCE_IDTOKEN = "nonce.id_token",
ORIGIN_URI = "request.origin",
RENEW_STATUS = "token.renew.status",
URL_HASH = "urlHash",
REQUEST_PARAMS = "request.params",
SCOPES = "scopes",
INTERACTION_STATUS_KEY = "interaction.status",
CCS_CREDENTIAL = "ccs.credential",
CORRELATION_ID = "request.correlationId",
NATIVE_REQUEST = "request.native",
REDIRECT_CONTEXT = "request.redirect.context"
}
/**
* Cache keys stored in-memory
*/
export declare enum InMemoryCacheKeys {
WRAPPER_SKU = "wrapper.sku",
WRAPPER_VER = "wrapper.version"
}
/**
* API Codes for Telemetry purposes.
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
* 0-99 Silent Flow
* 800-899 Auth Code Flow
*/
export declare enum ApiId {
acquireTokenRedirect = 861,
acquireTokenPopup = 862,
ssoSilent = 863,
acquireTokenSilent_authCode = 864,
handleRedirectPromise = 865,
acquireTokenByCode = 866,
acquireTokenSilent_silentFlow = 61,
logout = 961,
logoutPopup = 962
}
export declare enum InteractionType {
Redirect = "redirect",
Popup = "popup",
Silent = "silent",
None = "none"
}
/**
* Types of interaction currently in progress.
* Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
*/
export declare enum InteractionStatus {
/**
* Initial status before interaction occurs
*/
Startup = "startup",
/**
* Status set when all login calls occuring
*/
Login = "login",
/**
* Status set when logout call occuring
*/
Logout = "logout",
/**
* Status set for acquireToken calls
*/
AcquireToken = "acquireToken",
/**
* Status set for ssoSilent calls
*/
SsoSilent = "ssoSilent",
/**
* Status set when handleRedirect in progress
*/
HandleRedirect = "handleRedirect",
/**
* Status set when interaction is complete
*/
None = "none"
}
export declare const DEFAULT_REQUEST: RedirectRequest | PopupRequest;
/**
* JWK Key Format string (Type MUST be defined for window crypto APIs)
*/
export declare const KEY_FORMAT_JWK = "jwk";
export declare enum WrapperSKU {
React = "@azure/msal-react",
Angular = "@azure/msal-angular"
}
export declare const DB_NAME = "msal.db";
export declare const DB_VERSION = 1;
export declare const DB_TABLE_NAME: string;
export declare enum CacheLookupPolicy {
Default = 0,
AccessToken = 1,
AccessTokenAndRefreshToken = 2,
RefreshToken = 3,
RefreshTokenAndNetwork = 4,
Skip = 5
}
//# sourceMappingURL=BrowserConstants.d.ts.map
\ No newline at end of file
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AAEF,oBAAY,qBAAqB;IAC7B,gBAAgB,cAAc;IAC9B,iBAAiB,sBAAsB;IACvC,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACxB;AAED,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,SAAS,cAAc;IACvB,qBAAqB,yBAAyB;IAC9C,a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,OAAO,IAAI;IAKX,WAAW,IAAI;IAMf,0BAA0B,IAAI;IAM9B,YAAY,IAAI;IAMhB,sBAAsB,IAAI;IAK1B,IAAI,IAAI;CACX"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Constants
*/
var BrowserConstants = {
/**
* Interaction in progress cache value
*/
INTERACTION_IN_PROGRESS_VALUE: "interaction_in_progress",
/**
* Invalid grant error code
*/
INVALID_GRANT_ERROR: "invalid_grant",
/**
* Default popup window width
*/
POPUP_WIDTH: 483,
/**
* Default popup window height
*/
POPUP_HEIGHT: 600,
/**
* Name of the popup window starts with
*/
POPUP_NAME_PREFIX: "msal",
/**
* Default popup monitor poll interval in milliseconds
*/
DEFAULT_POLL_INTERVAL_MS: 30,
/**
* Msal-browser SKU
*/
MSAL_SKU: "msal.js.browser",
};
var NativeConstants = {
CHANNEL_ID: "53ee284d-920a-4b59-9d30-a60315b26836",
PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
MATS_TELEMETRY: "MATS"
};
var NativeExtensionMethod;
(function (NativeExtensionMethod) {
NativeExtensionMethod["HandshakeRequest"] = "Handshake";
NativeExtensionMethod["HandshakeResponse"] = "HandshakeResponse";
NativeExtensionMethod["GetToken"] = "GetToken";
NativeExtensionMethod["Response"] = "Response";
})(NativeExtensionMethod || (NativeExtensionMethod = {}));
var BrowserCacheLocation;
(function (BrowserCacheLocation) {
BrowserCacheLocation["LocalStorage"] = "localStorage";
BrowserCacheLocation["SessionStorage"] = "sessionStorage";
BrowserCacheLocation["MemoryStorage"] = "memoryStorage";
})(BrowserCacheLocation || (BrowserCacheLocation = {}));
/**
* HTTP Request types supported by MSAL.
*/
var HTTP_REQUEST_TYPE;
(function (HTTP_REQUEST_TYPE) {
HTTP_REQUEST_TYPE["GET"] = "GET";
HTTP_REQUEST_TYPE["POST"] = "POST";
})(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));
/**
* Temporary cache keys for MSAL, deleted after any request.
*/
var TemporaryCacheKeys;
(function (TemporaryCacheKeys) {
TemporaryCacheKeys["AUTHORITY"] = "authority";
TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
TemporaryCacheKeys["SESSION_STATE"] = "session.state";
TemporaryCacheKeys["REQUEST_STATE"] = "request.state";
TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.id_token";
TemporaryCacheKeys["ORIGIN_URI"] = "request.origin";
TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status";
TemporaryCacheKeys["URL_HASH"] = "urlHash";
TemporaryCacheKeys["REQUEST_PARAMS"] = "request.params";
TemporaryCacheKeys["SCOPES"] = "scopes";
TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
/**
* Cache keys stored in-memory
*/
var InMemoryCacheKeys;
(function (InMemoryCacheKeys) {
InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
})(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
/**
* API Codes for Telemetry purposes.
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
* 0-99 Silent Flow
* 800-899 Auth Code Flow
*/
var ApiId;
(function (ApiId) {
ApiId[ApiId["acquireTokenRedirect"] = 861] = "acquireTokenRedirect";
ApiId[ApiId["acquireTokenPopup"] = 862] = "acquireTokenPopup";
ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
ApiId[ApiId["logout"] = 961] = "logout";
ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
})(ApiId || (ApiId = {}));
/*
* Interaction type of the API - used for state and telemetry
*/
var InteractionType;
(function (InteractionType) {
InteractionType["Redirect"] = "redirect";
InteractionType["Popup"] = "popup";
InteractionType["Silent"] = "silent";
InteractionType["None"] = "none";
})(InteractionType || (InteractionType = {}));
/**
* Types of interaction currently in progress.
* Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
*/
var InteractionStatus;
(function (InteractionStatus) {
/**
* Initial status before interaction occurs
*/
InteractionStatus["Startup"] = "startup";
/**
* Status set when all login calls occuring
*/
InteractionStatus["Login"] = "login";
/**
* Status set when logout call occuring
*/
InteractionStatus["Logout"] = "logout";
/**
* Status set for acquireToken calls
*/
InteractionStatus["AcquireToken"] = "acquireToken";
/**
* Status set for ssoSilent calls
*/
InteractionStatus["SsoSilent"] = "ssoSilent";
/**
* Status set when handleRedirect in progress
*/
InteractionStatus["HandleRedirect"] = "handleRedirect";
/**
* Status set when interaction is complete
*/
InteractionStatus["None"] = "none";
})(InteractionStatus || (InteractionStatus = {}));
var DEFAULT_REQUEST = {
scopes: OIDC_DEFAULT_SCOPES
};
/**
* JWK Key Format string (Type MUST be defined for window crypto APIs)
*/
var KEY_FORMAT_JWK = "jwk";
// Supported wrapper SKUs
var WrapperSKU;
(function (WrapperSKU) {
WrapperSKU["React"] = "@azure/msal-react";
WrapperSKU["Angular"] = "@azure/msal-angular";
})(WrapperSKU || (WrapperSKU = {}));
// DatabaseStorage Constants
var DB_NAME = "msal.db";
var DB_VERSION = 1;
var DB_TABLE_NAME = DB_NAME + ".keys";
var CacheLookupPolicy;
(function (CacheLookupPolicy) {
/*
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
* or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
* is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
*/
CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
/*
* acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
* refresh tokens.
*/
CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
/*
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
* cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
* will not be renewed and acquireTokenSilent will fail.
*/
CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
/*
* acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
* exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
* renewed and acquireTokenSilent will fail.
*/
CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
/*
* acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
* cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
* setting "forceRefresh: true".
*/
CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
/*
* acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
* always fail if 3rd party cookies are blocked by the browser.
*/
CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
})(CacheLookupPolicy || (CacheLookupPolicy = {}));
export { ApiId, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, TemporaryCacheKeys, WrapperSKU };
//# sourceMappingURL=BrowserConstants.js.map
{"version":3,"file":"BrowserConstants.js","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OIDC_DEFAULT_SCOPES } from \"@azure/msal-common\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\n/**\n * Constants\n */\nexport const BrowserConstants = {\n /**\n * Interaction in progress cache value\n */\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\n /**\n * Invalid grant error code\n */\n INVALID_GRANT_ERROR: \"invalid_grant\",\n /**\n * Default popup window width\n */\n POPUP_WIDTH: 483,\n /**\n * Default popup window height\n */\n POPUP_HEIGHT: 600,\n /**\n * Name of the popup window starts with\n */\n POPUP_NAME_PREFIX: \"msal\",\n /**\n * Default popup monitor poll interval in milliseconds\n */\n DEFAULT_POLL_INTERVAL_MS: 30,\n /**\n * Msal-browser SKU\n */\n MSAL_SKU: \"msal.js.browser\",\n};\n\nexport const NativeConstants = {\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\n MATS_TELEMETRY: \"MATS\"\n};\n\nexport enum NativeExtensionMethod {\n HandshakeRequest = \"Handshake\",\n HandshakeResponse = \"HandshakeResponse\",\n GetToken = \"GetToken\",\n Response = \"Response\"\n}\n\nexport enum BrowserCacheLocation {\n LocalStorage = \"localStorage\",\n SessionStorage = \"sessionStorage\",\n MemoryStorage = \"memoryStorage\"\n}\n\n/**\n * HTTP Request types supported by MSAL.\n */\nexport enum HTTP_REQUEST_TYPE {\n GET = \"GET\",\n POST = \"POST\"\n}\n\n/**\n * Temporary cache keys for MSAL, deleted after any request.\n */\nexport enum TemporaryCacheKeys {\n AUTHORITY = \"authority\",\n ACQUIRE_TOKEN_ACCOUNT = \"acquireToken.account\",\n SESSION_STATE = \"session.state\",\n REQUEST_STATE = \"request.state\",\n NONCE_IDTOKEN = \"nonce.id_token\",\n ORIGIN_URI = \"request.origin\",\n RENEW_STATUS = \"token.renew.status\",\n URL_HASH = \"urlHash\",\n REQUEST_PARAMS = \"request.params\",\n SCOPES = \"scopes\",\n INTERACTION_STATUS_KEY = \"interaction.status\",\n CCS_CREDENTIAL = \"ccs.credential\",\n CORRELATION_ID = \"request.correlationId\",\n NATIVE_REQUEST = \"request.native\",\n REDIRECT_CONTEXT = \"request.redirect.context\"\n}\n\n/**\n * Cache keys stored in-memory\n */\nexport enum InMemoryCacheKeys {\n WRAPPER_SKU = \"wrapper.sku\",\n WRAPPER_VER = \"wrapper.version\"\n}\n\n/**\n * API Codes for Telemetry purposes. \n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\n * 0-99 Silent Flow\n * 800-899 Auth Code Flow\n */\nexport enum ApiId {\n acquireTokenRedirect = 861,\n acquireTokenPopup = 862,\n ssoSilent = 863,\n acquireTokenSilent_authCode = 864,\n handleRedirectPromise = 865,\n acquireTokenByCode = 866,\n acquireTokenSilent_silentFlow = 61,\n logout = 961,\n logoutPopup = 962\n}\n\n/*\n * Interaction type of the API - used for state and telemetry\n */\nexport enum InteractionType {\n Redirect = \"redirect\",\n Popup = \"popup\",\n Silent = \"silent\",\n None = \"none\"\n}\n\n/**\n * Types of interaction currently in progress.\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\n */\nexport enum InteractionStatus {\n /**\n * Initial status before interaction occurs\n */\n Startup = \"startup\",\n /**\n * Status set when all login calls occuring\n */\n Login = \"login\",\n /**\n * Status set when logout call occuring\n */ \n Logout = \"logout\",\n /**\n * Status set for acquireToken calls\n */\n AcquireToken = \"acquireToken\",\n /**\n * Status set for ssoSilent calls\n */\n SsoSilent = \"ssoSilent\",\n /**\n * Status set when handleRedirect in progress\n */\n HandleRedirect = \"handleRedirect\",\n /**\n * Status set when interaction is complete\n */\n None = \"none\"\n}\n\nexport const DEFAULT_REQUEST: RedirectRequest|PopupRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n};\n\n/**\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\n */\nexport const KEY_FORMAT_JWK = \"jwk\";\n\n// Supported wrapper SKUs\nexport enum WrapperSKU {\n React = \"@azure/msal-react\",\n Angular = \"@azure/msal-angular\"\n}\n\n// DatabaseStorage Constants\nexport const DB_NAME = \"msal.db\";\nexport const DB_VERSION = 1;\nexport const DB_TABLE_NAME = `${DB_NAME}.keys`;\n\nexport enum CacheLookupPolicy {\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired\n * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token\n * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.\n */\n Default = 0, // 0 is falsy, is equivalent to not passing in a CacheLookupPolicy\n /*\n * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or\n * refresh tokens.\n */\n AccessToken = 1,\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or\n * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it\n * will not be renewed and acquireTokenSilent will fail.\n */\n AccessTokenAndRefreshToken = 2,\n /*\n * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to\n * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be\n * renewed and acquireTokenSilent will fail.\n */\n RefreshToken = 3,\n /*\n * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the\n * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to\n * setting \"forceRefresh: true\".\n */\n RefreshTokenAndNetwork = 4,\n /*\n * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will\n * always fail if 3rd party cookies are blocked by the browser.\n */\n Skip = 5,\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;IAGa,gBAAgB,GAAG;;;;IAI5B,6BAA6B,EAAE,yBAAy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from "./BrowserConstants";
import { ICrypto, ServerAuthorizationCodeResponse } from "@azure/msal-common";
export declare type BrowserStateObject = {
interactionType: InteractionType;
};
export declare class BrowserProtocolUtils {
/**
* Extracts the BrowserStateObject from the state string.
* @param browserCrypto
* @param state
*/
static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null;
/**
* Parses properties of server response from url hash
* @param locationHash Hash from url
*/
static parseServerResponseFromHash(locationHash: string): ServerAuthorizationCodeResponse;
}
//# sourceMappingURL=BrowserProtocolUtils.d.ts.map
\ No newline at end of file
{"version":3,"file":"BrowserProtocolUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserProtocolUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAgC,OAAO,EAAqC,+BAA+B,EAAa,MAAM,oBAAoB,CAAC;AAE1J,oBAAY,kBAAkB,GAAG;IAC7B,eAAe,EAAE,eAAe,CAAA;CACnC,CAAC;AAEF,qBAAa,oBAAoB;IAE7B;;;;OAIG;IACH,MAAM,CAAC,0BAA0B,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI;IAanG;;;OAGG;IACH,MAAM,CAAC,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,+BAA+B;CAQ5F"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { StringUtils, ProtocolUtils, ClientAuthError, UrlString } from '@azure/msal-common';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var BrowserProtocolUtils = /** @class */ (function () {
function BrowserProtocolUtils() {
}
/**
* Extracts the BrowserStateObject from the state string.
* @param browserCrypto
* @param state
*/
BrowserProtocolUtils.extractBrowserRequestState = function (browserCrypto, state) {
if (StringUtils.isEmpty(state)) {
return null;
}
try {
var requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);
return requestStateObj.libraryState.meta;
}
catch (e) {
throw ClientAuthError.createInvalidStateError(state, e);
}
};
/**
* Parses properties of server response from url hash
* @param locationHash Hash from url
*/
BrowserProtocolUtils.parseServerResponseFromHash = function (locationHash) {
if (!locationHash) {
return {};
}
var hashUrlString = new UrlString(locationHash);
return UrlString.getDeserializedHash(hashUrlString.getHash());
};
return BrowserProtocolUtils;
}());
export { BrowserProtocolUtils };
//# sourceMappingURL=BrowserProtocolUtils.js.map
{"version":3,"file":"BrowserProtocolUtils.js","sources":["../../src/utils/BrowserProtocolUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { InteractionType } from \"./BrowserConstants\";\nimport { StringUtils, ClientAuthError, ICrypto, RequestStateObject, ProtocolUtils, ServerAuthorizationCodeResponse, UrlString } from \"@azure/msal-common\";\n\nexport type BrowserStateObject = {\n interactionType: InteractionType\n};\n\nexport class BrowserProtocolUtils {\n\n /**\n * Extracts the BrowserStateObject from the state string.\n * @param browserCrypto \n * @param state \n */\n static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null {\n if (StringUtils.isEmpty(state)) {\n return null;\n }\n\n try {\n const requestStateObj: RequestStateObject = ProtocolUtils.parseRequestState(browserCrypto, state);\n return requestStateObj.libraryState.meta as BrowserStateObject;\n } catch (e) {\n throw ClientAuthError.createInvalidStateError(state, e);\n }\n }\n\n /**\n * Parses properties of server response from url hash\n * @param locationHash Hash from url\n */\n static parseServerResponseFromHash(locationHash: string): ServerAuthorizationCodeResponse {\n if (!locationHash) {\n return {};\n }\n \n const hashUrlString = new UrlString(locationHash);\n return UrlString.getDeserializedHash(hashUrlString.getHash());\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;;IAYA;KAgCC;;;;;;IAzBU,+CAA0B,GAAjC,UAAkC,aAAsB,EAAE,KAAa;QACnE,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC;SACf;QAED,IAAI;YACA,IAAM,eAAe,GAAuB,aAAa,CAAC,iBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;YAClG,OAAO,eAAe,CAAC,YAAY,CAAC,IAA0B,CAAC;SAClE;QAAC,OAAO,CAAC,EAAE;YACR,MAAM,eAAe,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC3D;KACJ;;;;;IAMM,gDAA2B,GAAlC,UAAmC,YAAoB;QACnD,IAAI,CAAC,YAAY,EAAE;YACf,OAAO,EAAE,CAAC;SACb;QAED,IAAM,aAAa,GAAG,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;QAClD,OAAO,SAAS,CAAC,mBAAmB,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;KACjE;IACL,2BAAC;AAAD,CAAC;;;;"}
\ No newline at end of file
/**
* Utility functions for strings in a browser. See here for implementation details:
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
*/
export declare class BrowserStringUtils {
/**
* Converts string to Uint8Array
* @param sDOMStr
*/
static stringToUtf8Arr(sDOMStr: string): Uint8Array;
/**
* Converst string to ArrayBuffer
* @param dataString
*/
static stringToArrayBuffer(dataString: string): ArrayBuffer;
/**
* Converts Uint8Array to a string
* @param aBytes
*/
static utf8ArrToString(aBytes: Uint8Array): string;
/**
* Returns stringified jwk.
* @param jwk
*/
static getSortedObjectString(obj: object): string;
}
//# sourceMappingURL=BrowserStringUtils.d.ts.map
\ No newline at end of file
{"version":3,"file":"BrowserStringUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserStringUtils.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,qBAAa,kBAAkB;IAE3B;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAE,OAAO,EAAE,MAAM,GAAG,UAAU;IAuDpD;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW;IAS3D;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAE,MAAM,EAAE,UAAU,GAAG,MAAM;IAuBnD;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAGpD"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { Constants } from '@azure/msal-common';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Utility functions for strings in a browser. See here for implementation details:
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
*/
var BrowserStringUtils = /** @class */ (function () {
function BrowserStringUtils() {
}
/**
* Converts string to Uint8Array
* @param sDOMStr
*/
BrowserStringUtils.stringToUtf8Arr = function (sDOMStr) {
var nChr;
var nArrLen = 0;
var nStrLen = sDOMStr.length;
/* mapping... */
for (var nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {
nChr = sDOMStr.charCodeAt(nMapIdx);
nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3 : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;
}
var aBytes = new Uint8Array(nArrLen);
/* transcription... */
for (var nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {
nChr = sDOMStr.charCodeAt(nChrIdx);
if (nChr < 128) {
/* one byte */
aBytes[nIdx++] = nChr;
}
else if (nChr < 0x800) {
/* two bytes */
aBytes[nIdx++] = 192 + (nChr >>> 6);
aBytes[nIdx++] = 128 + (nChr & 63);
}
else if (nChr < 0x10000) {
/* three bytes */
aBytes[nIdx++] = 224 + (nChr >>> 12);
aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
aBytes[nIdx++] = 128 + (nChr & 63);
}
else if (nChr < 0x200000) {
/* four bytes */
aBytes[nIdx++] = 240 + (nChr >>> 18);
aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
aBytes[nIdx++] = 128 + (nChr & 63);
}
else if (nChr < 0x4000000) {
/* five bytes */
aBytes[nIdx++] = 248 + (nChr >>> 24);
aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);
aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
aBytes[nIdx++] = 128 + (nChr & 63);
}
else /* if (nChr <= 0x7fffffff) */ {
/* six bytes */
aBytes[nIdx++] = 252 + (nChr >>> 30);
aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);
aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);
aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
aBytes[nIdx++] = 128 + (nChr & 63);
}
}
return aBytes;
};
/**
* Converst string to ArrayBuffer
* @param dataString
*/
BrowserStringUtils.stringToArrayBuffer = function (dataString) {
var data = new ArrayBuffer(dataString.length);
var dataView = new Uint8Array(data);
for (var i = 0; i < dataString.length; i++) {
dataView[i] = dataString.charCodeAt(i);
}
return data;
};
/**
* Converts Uint8Array to a string
* @param aBytes
*/
BrowserStringUtils.utf8ArrToString = function (aBytes) {
var sView = Constants.EMPTY_STRING;
for (var nPart = void 0, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {
nPart = aBytes[nIdx];
sView += String.fromCharCode(nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */
/* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */
(nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
: nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */
(nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
: nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */
(nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
: nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */
(nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128
: nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */
(nPart - 192 << 6) + aBytes[++nIdx] - 128
: /* nPart < 127 ? */ /* one byte */
nPart);
}
return sView;
};
/**
* Returns stringified jwk.
* @param jwk
*/
BrowserStringUtils.getSortedObjectString = function (obj) {
return JSON.stringify(obj, Object.keys(obj).sort());
};
return BrowserStringUtils;
}());
export { BrowserStringUtils };
//# sourceMappingURL=BrowserStringUtils.js.map
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment