@sassoftware/va-report-components
Version:
The SAS Visual Analytics SDK is a set of JavaScript APIs and web components that enable SAS Visual Analytics report content to be easily embedded in a third-party application or web page.
1,655 lines (1,547 loc) • 11.2 MB
JavaScript
import { createElement as e, Fragment as t, useMemo as o, useSyncExternalStore as s, useEffect as r, useState as a, useCallback as l, useRef as n, createContext as c, forwardRef as i, useContext as d, useReducer as h, lazy as p, memo as m, useImperativeHandle as u, Suspense as v, useLayoutEffect as g, Children as f, cloneElement as M, isValidElement as C, createRef as b, startTransition as y, PureComponent as w, Component as x } from "react";
import { createRoot as S } from "react-dom/client";
import { __extends as z, __assign as V, __awaiter as N, __generator as T, __rest as L } from "tslib";
import { BehaviorSubject as H, ReplaySubject as I, Subject as A, combineLatest as k, asyncScheduler as D, using as R, throwError as E, fromEventPattern as B, of as O, merge as F, animationFrameScheduler as _, EMPTY as P, from as j, concat as U, AsyncSubject as Z, firstValueFrom as G, fromEvent as W } from "rxjs";
import { takeUntil as K, filter as Y, take as Q, distinctUntilChanged as J, skip as X, debounceTime as q, map as $, mergeMap as ee, withLatestFrom as te, tap as oe, ignoreElements as se, publish as re, delay as ae, switchMap as le, concatMap as ne, first as ce, shareReplay as ie, share as de, mergeMapTo as he, finalize as pe, startWith as me, endWith as ue, skipWhile as ve, last as ge, find as fe } from "rxjs/operators";
import Me from "i18next";
import { useTranslation as Ce, initReactI18next as be } from "react-i18next";
import { z as ye } from "zod";
import { hsl as we, parseToHsl as xe, opacify as Se, transparentize as ze, rgba as Ve, toColorString as Ne, grayscale as Te, mix as Le, hslToColorString as He, parseToRgb as Ie, rgb as Ae, getContrast as ke, lighten as De, darken as Re } from "polished";
import { createSelector as Ee, defaultMemoize as Be } from "reselect";
import { MotionConfig as Oe, motion as Fe, AnimatePresence as _e, useIsPresent as Pe, useMotionValue as je, useDragControls as Ue, useAnimate as Ze } from "framer-motion";
import { jsx as Ge, jsxs as We, Fragment as Ke } from "react/jsx-runtime";
import Ye, { createPortal as Qe, flushSync as Je } from "react-dom";
import Xe from "classnames";
import { a as qe, c as $e, d as et, e as tt, f as ot, g as st, h as rt, i as at, m as lt, j as nt, k as ct, l as it, n as dt, o as ht, p as pt, q as mt, r as ut, s as vt, t as gt, u as ft, v as Mt, w as Ct, x as bt, y as yt, z as wt, A as xt, B as St, C as zt, D as Vt, E as Nt, F as Tt, G as Lt, H as Ht, I as It, J as At, K as kt, L as Dt, M as Rt, N as Et, O as Bt, P as Ot, Q as Ft, R as _t, S as Pt, T as jt, U as Ut, V as Zt, W as Gt, X as Wt, Y as Kt, Z as Yt, _ as Qt, $ as Jt, a0 as Xt, a1 as qt } from "./i18n/nova_i18n.mjs";
import $t, { FreeFocusInside as eo, AutoFocusInside as to, MoveFocusInside as oo } from "react-focus-lock";
import { usePopper as so } from "react-popper";
import "@popperjs/core";
import ro from "axios";
import { useVirtualizer as ao, defaultRangeExtractor as lo } from "@tanstack/react-virtual";
import no from "cldr-core/supplemental/weekData.json";
import { useCallback as co } from "use-memo-one";
import io from "memoize-one";
import { useQuery as ho, QueryClient as po } from "@tanstack/react-query";
import mo from "react-cropper";
import { ofType as uo, createEpicMiddleware as vo, combineEpics as go } from "redux-observable";
import { combineReducers as fo, createStore as Mo, applyMiddleware as Co, bindActionCreators as bo } from "redux";
import { composeWithDevTools as yo } from "@redux-devtools/extension";
import { connect as wo, shallowEqual as xo } from "react-redux";
let So;
let zo = new Map;
function Vo() {
return So;
}
async function No(e) {
const t = await (e?.importType === "mobile" ? import("./chunk3.mjs").then((e => ({
type: "mobile",
...e
}))) : import("./chunk8.mjs").then((e => ({
type: "dynamic",
...e
}))));
if (e?.initialize) {
await (e?.initialize(t));
}
So = t;
if (zo) {
for (const e of zo.values()) {
e();
}
}
zo = undefined;
}
function To(e, t) {
zo?.set(e, t);
}
function Lo(e) {
zo?.delete(e);
}
let Ho = 0;
function Io() {
return `vaReportComponentContainer${Ho++}`;
}
class Ao extends HTMLElement {
constructor(...o) {
super(...o);
this._validationTimerId = 0;
this._root = void 0;
this._needsUnmount = false;
this._connected = false;
this._render = () => {
if (this._needsUnmount) {
this._root?.unmount();
this._root = undefined;
this._needsUnmount = false;
}
if (this._connected && !this._root) {
this._root = S(this);
}
const o = this._getRenderer();
if (!o) {
if (this._root) {
this._root.render(e(t));
}
return;
}
const s = this._root && this.getRenderProps();
clearTimeout(this._validationTimerId);
this._validationTimerId = 0;
if (s) {
this._root.render(e(o, s));
} else if (this._root) {
this._root.render(e(t));
}
};
}
_getConnected() {
return this._connected;
}
_invalidateProps() {
if (this._getConnected()) {
this._queueRender();
}
}
_queueRender() {
if (this._validationTimerId === 0) {
this._validationTimerId = window.setTimeout((() => {
this._validationTimerId = 0;
this._render();
}), 0);
}
}
connectedCallback() {
this._connected = true;
this._queueRender();
}
disconnectedCallback() {
this._connected = false;
this._needsUnmount = true;
this._queueRender();
}
attributeChangedCallback(e, t, o) {
this._invalidateProps();
}
static get observedAttributes() {
return [];
}
}
function ko(e) {
if (!e) {
return;
}
switch (e.toLowerCase()) {
case "guest":
return "guest";
case "credentials":
return "credentials";
}
}
class Do extends Ao {
constructor(...e) {
super(...e);
this._elementKey = Io();
this._stateRetained = false;
this._initialized = false;
this._menuItemProvider = void 0;
this._contextKey = void 0;
this._refHandle = void 0;
this._isHandleValid = false;
this._handle = void 0;
this._handlePromise = void 0;
this._handlePromiseCallbacks = void 0;
this._setRef = e => {
this._handle = e;
if (e) {
this._acceptHandlePromise();
}
};
}
_acceptHandlePromise() {
this._isHandleValid = true;
if (this._handle) {
this._handlePromiseCallbacks?.accept(this._handle);
this._handlePromiseCallbacks = undefined;
} else {
console.warn("_acceptHandlePromise called when no report handle was available");
}
}
_invalidateHandleRequests(e) {
this._isHandleValid = false;
this._handlePromiseCallbacks?.reject(e);
this._handlePromiseCallbacks = undefined;
this._handlePromise = undefined;
}
getReportHandle() {
if (!this._handlePromise) {
this._handlePromise = this._handle && this._isHandleValid ? Promise.resolve(this._handle) : new Promise(((e, t) => {
this._handlePromiseCallbacks = {
accept: e,
reject: t
};
}));
}
return this._handlePromise;
}
_getContextKey(e) {
return "packageUri" in e ? `${e.packageUri}:${this._elementKey}` : `${e.url}:${e.reportUri}:${this._elementKey}`;
}
_invalidateProps() {
let e = undefined;
const t = this.getRenderProps();
if (t) {
e = this._getContextKey(t);
}
if (this._contextKey !== e) {
this._refHandle = undefined;
this._invalidateHandleRequests("An element attribute was changed and the handle request has been cancelled");
}
this._contextKey = e;
super._invalidateProps();
}
static get observedAttributes() {
return [ ...super.observedAttributes, "url", "reporturi", "authenticationtype", "packageuri", "popoverrootid", "restrictviewportgestures" ];
}
attributeChangedCallback(e, t, o) {
super.attributeChangedCallback(e, t, o);
if (e === "authenticationType" && this.hasAttribute("authenticationType") && !ko(o)) {
console.warn(`Invalid AuthenticationType: ${o}`);
}
}
connectedCallback() {
To(this, (() => {
if (this._initialized) {
return;
}
this._initialized = true;
this._initializeWithImports();
}));
super.connectedCallback();
}
disconnectedCallback() {
if (!this.preserveStateOnUnmount) {
this._invalidateHandleRequests("The element was removed from the DOM and the handle request has been cancelled");
}
if (this._stateRetained) {
Lo(this);
}
super.disconnectedCallback();
}
_initializeWithImports() {
super._invalidateProps();
const e = this._stateRetained;
this._stateRetained = false;
this.preserveStateOnUnmount = e;
}
get preserveStateOnUnmount() {
return this._stateRetained;
}
set preserveStateOnUnmount(e) {
if (this._stateRetained === !!e) {
return;
}
if (!this._stateRetained && !this._getConnected()) {
Lo(this);
}
const {extendStoreLifetime: t, releaseStoreLifetime: o} = this._getDynamicImports() ?? {};
this._stateRetained = !!e;
if (this._stateRetained) {
t?.(this._elementKey);
} else {
o?.(this._elementKey);
if (!this._getConnected()) {
this._invalidateHandleRequests("preserveStateOnUnmount was set to false while the element was removed from the DOM");
}
}
}
_getDynamicImports() {
const e = Vo();
if (e?.type === "dynamic") {
return e;
}
return;
}
getCommonProps() {
if (!this._refHandle) {
this._refHandle = e => this._setRef(e);
}
const e = {
elementKey: this._elementKey,
ref: this._refHandle,
menuItemProvider: this._menuItemProvider,
popoverRootId: this.popoverRootId ?? undefined,
restrictViewportGestures: this.restrictViewportGestures
};
if (this.packageUri) {
return {
...e,
packageUri: this.packageUri
};
} else if (this.reportUri && this.url) {
return {
...e,
authenticationType: this.authenticationType,
reportUri: this.reportUri,
url: this.url
};
}
return null;
}
get url() {
return this.getAttribute("url");
}
set url(e) {
if (e && typeof e === "string") {
this.setAttribute("url", e);
} else {
this.removeAttribute("url");
}
}
get packageUri() {
return this.getAttribute("packageUri");
}
set packageUri(e) {
if (e && typeof e === "string") {
this.setAttribute("packageUri", e);
} else {
this.removeAttribute("packageUri");
}
}
get reportUri() {
return this.getAttribute("reportUri");
}
set reportUri(e) {
if (e && typeof e === "string") {
this.setAttribute("reportUri", e);
} else {
this.removeAttribute("reportUri");
}
}
get authenticationType() {
return ko(this.getAttribute("authenticationType")) || "credentials";
}
set authenticationType(e) {
if (e) {
if (typeof e !== "string" || !ko(e)) {
console.warn(`Invalid AuthenticationType: ${e}`);
this.removeAttribute("authenticationType");
} else {
this.setAttribute("authenticationType", e.toLowerCase());
}
} else {
this.removeAttribute("authenticationType");
}
}
get popoverRootId() {
return this.getAttribute("popoverRootId");
}
set popoverRootId(e) {
if (e && typeof e === "string") {
this.setAttribute("popoverRootId", e);
} else {
this.removeAttribute("popoverRootId");
}
}
get restrictViewportGestures() {
const e = this.getAttribute("restrictViewportGestures");
if (!e) {
return undefined;
}
const t = e.toLowerCase();
if (t === "true") {
return true;
} else if (t === "false") {
return false;
}
return undefined;
}
set restrictViewportGestures(e) {
if (typeof e === "boolean") {
this.setAttribute("restrictViewportGestures", e.toString());
return;
} else if (!e) {
this.removeAttribute("restrictViewportGestures");
} else {
console.warn(`Invalid value for restrictViewportGestures: ${e}`);
this.removeAttribute("restrictViewportGestures");
}
}
_resetElementKey() {
this._invalidateProps();
const e = this._elementKey;
this._elementKey = Io();
if (this._stateRetained) {
const t = this._getDynamicImports();
t?.extendStoreLifetime?.(this._elementKey);
setTimeout((() => t?.releaseStoreLifetime?.(e)), 0);
}
}
set menuItemProvider(e) {
e = e ?? undefined;
if (e === this._menuItemProvider) {
return;
}
this._invalidateProps();
this._menuItemProvider = e;
}
get menuItemProvider() {
return this._menuItemProvider;
}
}
function Ro(e) {
if (e && typeof e === "string") {
const t = e.toLocaleLowerCase();
return [ "true", "false", "auto" ].indexOf(t) > -1;
}
return true;
}
class Eo extends Do {
constructor(...e) {
super(...e);
this._graphCSS = void 0;
this._themeOverrides = null;
this._unprocessedOverrides = void 0;
}
_getRenderer() {
return Vo()?.SASReport;
}
static get observedAttributes() {
return [ ...super.observedAttributes, "hidenavigation" ];
}
attributeChangedCallback(e, t, o) {
super.attributeChangedCallback(e, t, o);
if (e === "hideNavigation" && this.hasAttribute("hideNavigation") && !Ro(o)) {
console.warn(`Invalid value for hideNavigation: ${o}`);
}
}
_initializeWithImports() {
super._initializeWithImports();
if (this._unprocessedOverrides) {
this.unsafe_setCustomReportTheme(this._unprocessedOverrides);
this._unprocessedOverrides = undefined;
}
}
getRenderProps() {
const e = this.getCommonProps();
return e && {
...e,
hideNavigation: this.hideNavigation,
themeOverrides: this._themeOverrides || undefined,
graphCSS: this._graphCSS
};
}
get hideNavigation() {
if (!this.hasAttribute("hideNavigation")) return "auto";
const e = this.getAttribute("hideNavigation");
if (typeof e === "string") {
switch (e.toLocaleLowerCase()) {
case "true":
case "":
return true;
case "false":
return false;
case "auto":
default:
return "auto";
}
}
return true;
}
set hideNavigation(e) {
if (typeof e === "string") {
if (!Ro(e)) {
console.warn(`Invalid value for hideNavigation: ${e}`);
this.removeAttribute("hideNavigation");
} else {
this.setAttribute("hideNavigation", e);
}
} else if (typeof e === "boolean") {
this.setAttribute("hideNavigation", e.toString());
return;
} else if (!e) {
this.removeAttribute("hideNavigation");
} else {
console.warn(`Invalid value for hideNavigation: ${e}`);
this.removeAttribute("hideNavigation");
}
}
unsafe_setCustomReportTheme(e) {
const t = Vo();
if (!t) {
this._unprocessedOverrides = e;
return;
}
if (t.type === "mobile") {
console.error("customReportThemes not supported in this render mode.");
return;
}
let o;
if (typeof e === "object" && e !== null) {
const s = e;
const r = {
baseThemeId: "light",
styleData: {}
};
if (typeof s.baseThemeId === "string") {
r.baseThemeId = s.baseThemeId;
} else {
console.error("Objects passed to unsafe_setCustomReportTheme must have a string for the baseThemeId property");
}
if (typeof s.styleData === "object" && s.styleData !== null) {
r.styleData = s.styleData;
} else {
console.error("Objects passed to unsafe_setCustomReportTheme must have an object for the styleData property");
}
o = t.convertThemeServiceResponseToThemeParameterOverrides(r);
} else if (e === null || e === undefined) {
o = null;
} else {
o = null;
console.error("Invalid value passed to unsafe_setCustomReportTheme: " + e);
}
if (this._themeOverrides === o) {
return;
}
this._themeOverrides = o;
this._invalidateProps();
}
unsafe_setGraphCSS(e) {
let t;
if (typeof e === "string") {
t = e;
} else if (e === null || e === undefined) {
t = undefined;
} else {
t = undefined;
console.error("Invalid value passed to unsafe_setGraphCSS: " + e);
}
if (this._graphCSS === t) {
return;
}
this._graphCSS = t;
this._resetElementKey();
this._invalidateProps();
}
}
function Bo(e) {
if (e && typeof e === "string") {
const t = e.toLocaleLowerCase();
return [ "true", "false" ].indexOf(t) > -1;
}
return true;
}
class Oo extends Do {
constructor(...e) {
super(...e);
this._objectHandlePromise = void 0;
this._rejectObjectHandleCallback = void 0;
}
_getRenderer() {
return Vo()?.SASReportObject;
}
static get observedAttributes() {
return [ ...super.observedAttributes, "objectname", "reportcontextkey", "hideloadimage" ];
}
_getContextKey(e) {
return "packageUri" in e ? `${e.packageUri}:${e.reportContextKey}:${e.objectName}` : `${e.url}:${e.reportUri}:${e.reportContextKey}:${e.objectName}`;
}
getRenderProps() {
const e = this.getCommonProps();
if (e && this.objectName) {
return {
...e,
objectName: this.objectName,
reportContextKey: this.reportContextKey,
hideLoadImage: this.hideLoadImage
};
} else {
return null;
}
}
get objectName() {
return this.getAttribute("objectName");
}
set objectName(e) {
if (e && typeof e === "string") {
this.setAttribute("objectName", e);
} else {
this.removeAttribute("objectName");
}
}
get reportContextKey() {
return this.getAttribute("reportContextKey") || undefined;
}
set reportContextKey(e) {
if (e && typeof e === "string") {
this.setAttribute("reportContextKey", e);
} else {
this.removeAttribute("reportContextKey");
}
}
get hideLoadImage() {
if (!this.hasAttribute("hideLoadImage")) return false;
const e = this.getAttribute("hideLoadImage");
if (typeof e === "string") {
switch (e.toLocaleLowerCase()) {
case "true":
case "":
return true;
case "false":
return false;
default:
return false;
}
}
return true;
}
set hideLoadImage(e) {
if (typeof e === "string") {
if (!Bo(e)) {
console.warn(`Invalid value for hideLoadImage: ${e}`);
this.removeAttribute("hideLoadImage");
} else {
this.setAttribute("hideLoadImage", e);
}
} else if (typeof e === "boolean") {
this.setAttribute("hideLoadImage", e.toString());
return;
} else if (!e) {
this.removeAttribute("hideLoadImage");
} else {
console.warn(`Invalid value for hideLoadImage: ${e}`);
this.removeAttribute("hideLoadImage");
}
}
_invalidateHandleRequests(e) {
super._invalidateHandleRequests(e);
this._rejectObjectHandleCallback?.(e);
this._rejectObjectHandleCallback = undefined;
this._objectHandlePromise = undefined;
}
getObjectHandle() {
const e = this.objectName;
if (!e) {
return Promise.reject("Cannot get an ObjectHandle before setting objectName");
}
if (!this._objectHandlePromise) {
this._objectHandlePromise = Promise.race([ this.getReportHandle().then((t => t.getObjectHandle(e))), new Promise(((e, t) => {
this._rejectObjectHandleCallback = t;
})) ]);
}
return this._objectHandlePromise;
}
}
class Fo extends Do {
_getRenderer() {
return Vo()?.SASReportPage;
}
static get observedAttributes() {
return [ ...super.observedAttributes, "pagename", "pageindex", "reportcontextkey" ];
}
_getContextKey(e) {
if (!e.reportContextKey) {
return super._getContextKey(e);
}
return "packageUri" in e ? `${e.packageUri}:${e.reportContextKey}` : `${e.url}:${e.reportUri}:${e.reportContextKey}`;
}
getRenderProps() {
const e = this.getCommonProps();
if (!e) {
return null;
}
const t = this.pageIndex;
if (this.pageName) {
return {
...e,
pageName: this.pageName,
reportContextKey: this.reportContextKey
};
} else if (t !== null) {
return {
...e,
pageIndex: t,
reportContextKey: this.reportContextKey
};
}
return null;
}
get pageName() {
return this.getAttribute("pageName");
}
set pageName(e) {
if (e && typeof e === "string") {
this.setAttribute("pageName", e);
} else {
this.removeAttribute("pageName");
}
}
get pageIndex() {
const e = this.getAttribute("pageIndex");
return _o(e);
}
set pageIndex(e) {
const t = _o(e);
if (t !== null) {
this.setAttribute("pageIndex", t.toString());
} else {
this.removeAttribute("pageIndex");
}
}
get reportContextKey() {
return this.getAttribute("reportContextKey") || undefined;
}
set reportContextKey(e) {
if (e && typeof e === "string") {
this.setAttribute("reportContextKey", e);
} else {
this.removeAttribute("reportContextKey");
}
}
}
function _o(e) {
if (typeof e === "string" && /^\d+$/.test(e)) {
return Number(e);
} else if (typeof e === "number" && e >= 0 && Number.isSafeInteger(e)) {
return Math.abs(e);
} else {
return null;
}
}
function Po(e) {
No(e);
if (!customElements.get("sas-report")) {
customElements.define("sas-report", Eo);
}
if (!customElements.get("sas-report-object")) {
customElements.define("sas-report-object", Oo);
}
if (!customElements.get("sas-report-page")) {
customElements.define("sas-report-page", Fo);
}
}
function jo(e, t, o, s, r) {
var a = {};
return Object.keys(s).forEach((function(e) {
a[e] = s[e];
})), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0),
a = o.slice().reverse().reduce((function(o, s) {
return s(e, t, o) || o;
}), a), r && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(r) : void 0,
a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(e, t, a),
null) : a;
}
function Uo(e, t, o, s) {
o && Object.defineProperty(e, t, {
enumerable: o.enumerable,
configurable: o.configurable,
writable: o.writable,
value: o.initializer ? o.initializer.call(s) : void 0
});
}
var Zo = globalThis;
Zo.sas = Zo.sas || {};
sas.ltjs = sas.ltjs || {};
sas.ltjslib = sas.ltjslib || {};
sas.ltjslib.ltjs = sas.ltjslib.ltjs || {};
var Go = sas.ltjs;
var Wo = sas.ltjslib.ltjs;
var Ko = /sas\/ltjs\/([^\/]+).*\/([^\/]+)/;
function Yo(e) {
var t = e.match(Ko);
if (t && t.length === 3) {
var o = t[1];
var s = t[2];
return "".concat(o, "::").concat(s);
}
throw new Error("Unexpected LTJS module path structure: ".concat(e));
}
var Qo = function() {
function e() {
this._typeMap = new Map;
this._moduleMap = new Map;
}
e.prototype.initFromModuleTypeMap = function(e) {
var t = e.length;
for (var o = 0; o < t; o++) {
var s = e[o];
if (s) {
var r = s[0], a = s[1];
var l = Yo(r);
this._typeMap.set(o, {
typeId: o,
moduleName: l,
modulePath: r,
parentTypeId: a
});
}
}
};
e.prototype.getTypeEntry = function(e) {
return this._typeMap.get(e);
};
e.prototype.addClassToModuleMap = function(e, t) {
this._moduleMap.set(e, t);
};
e.prototype.getModuleByName = function(e) {
return this._moduleMap.get(e);
};
return e;
}();
var Jo = [ 1, 2, 4, 8, 16, 32, 64, 128 ];
function Xo(e) {
if (e) {
for (var t = 0, o = e.length; t < o; t++) {
e[t] = e[t] >>> 0;
}
}
return e;
}
function qo(e) {
if (e) {
for (var t = 0, o = e.length; t < o; t++) {
e[t] = !!e[t];
}
}
return e;
}
var $o = function() {
function e(e) {
var t = this;
this.wasmCrashed = false;
this.abortCallbacks = [];
this._module = e;
this.runtime.onAborts.push(this.onAbort.bind(this));
if (!this._module.onAbort) {
this._module.onAbort = function() {
for (var e = 0, o = t.runtime.onAborts; e < o.length; e++) {
var s = o[e];
s();
}
};
}
}
Object.defineProperty(e.prototype, "runtime", {
get: function() {
if (!this.module._ltjsRuntime) {
var e = {
ltjsInitialized: false,
wrappersInitialized: false,
wrapperInitFunctions: [],
platformInitialized: false,
onPlatformInitialized: [],
onReadyFunctions: [],
initializeWrappers: function() {
e.wrappersInitialized = true;
for (var t = 0, o = e.wrapperInitFunctions; t < o.length; t++) {
var s = o[t];
s();
}
e.wrapperInitFunctions.length = 0;
},
executeRunWhenInitializedCallbacks: function() {
e.ltjsInitialized = true;
for (var t = 0, o = e.onReadyFunctions; t < o.length; t++) {
var s = o[t];
s();
}
e.onReadyFunctions.length = 0;
},
onAborts: [],
typeMapAvailable: false,
typeMapInitializers: [],
initializedTypemap: function() {
e.typeMapAvailable = true;
for (var t = 0, o = e.typeMapInitializers; t < o.length; t++) {
var s = o[t];
s();
}
e.typeMapInitializers = [];
},
activeVisualizationManagers: new Set,
themeOverrideCallbacks: new Set,
dispatchBridgeMap: new Map
};
this.module._ltjsRuntime = e;
}
return this.module._ltjsRuntime;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "module", {
get: function() {
return this._module;
},
enumerable: false,
configurable: true
});
e.prototype.onAbort = function() {
this.wasmCrashed = true;
for (var e = 0, t = this.abortCallbacks; e < t.length; e++) {
var o = t[e];
o();
}
this.abortCallbacks = [];
};
e.prototype.addAbortCallback = function(e) {
if (this.wasmCrashed) {
e();
} else {
this.abortCallbacks.push(e);
}
};
e.prototype.removeAbortCallback = function(e) {
this.abortCallbacks = this.abortCallbacks.filter((function(t) {
return t !== e;
}));
};
Object.defineProperty(e.prototype, "exports", {
get: function() {
return this._module.exports;
},
enumerable: false,
configurable: true
});
e.prototype.getStringContentsOfFile = function(e) {
return this._module.getStringContentsOfFile(e);
};
e.prototype.writeNLSBundleToFS = function(e, t) {
return this._module.writeNLSBundleToFS(e, t);
};
e.prototype.setInstantiateWasmCallback = function(e) {
this._module.instantiateWasm = e;
};
e.prototype.setMemoryInitializerRequest = function(e) {
this._module.memoryInitializerRequest = e;
};
e.prototype.setUseAsm = function() {
this._module.wasmJSMethod = "asmjs";
};
e.prototype.removeBlockingDependency = function(e) {
if (this._module.removeBlockingDependency) {
this._module.removeBlockingDependency(e);
}
};
Object.defineProperty(e.prototype, "deps", {
set: function(e) {
this._module.deps = e;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "libraryLoadingCompleted", {
set: function(e) {
this._module.libraryLoadingCompleted = e;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "onRuntimeInitialized", {
set: function(e) {
this._module.onRuntimeInitialized = e;
},
enumerable: false,
configurable: true
});
Object.defineProperty(e.prototype, "ltjsRuntimeInitialized", {
set: function(e) {
this._module.ltjsRuntimeInitialized = e;
},
enumerable: false,
configurable: true
});
e.prototype.setIsShuttingDown = function(e) {
if (this._module.setIsShuttingDown) {
this._module.setIsShuttingDown(e);
}
};
e.prototype.getTypeId = function(e) {
return this._module._ltjs_commons_Closet_getTypeID(e);
};
e.prototype.commitStagedObject = function(e) {
return this._module._ltjs_commons_Closet_commitStagedObject(e);
};
e.prototype.discardStagedObject = function(e) {
this._module._ltjs_commons_Closet_discardStagedObject(e);
};
e.prototype.getStagedVectorSize = function(e) {
return this._module._ltjs_commons_Closet_getStagedVectorSize(e);
};
e.prototype.stageObjectAt = function(e) {
return this._module._ltjs_commons_Closet_stageObjectAt(e);
};
e.prototype.discardStagedVector = function(e) {
this._module._ltjs_commons_Closet_discardStagedVector(e);
};
e.prototype._copyValuesIntoCloset = function(e, t, o, s, r) {
if (r === void 0) {
r = false;
}
if (!e || !o || !s) {
return 0;
}
var a = e.length;
var l = this._module._malloc(a * t);
if (r) {
for (var n = 0; n < a; ++n) {
var c = NaN;
var i = e[n];
if (typeof i === "number") {
c = i;
} else if (!isNaN(i)) {
var d = parseFloat(i);
if (!isNaN(d)) {
c = d;
}
}
this._module.setValue(l + n * t, c, o);
}
} else {
for (var n = 0; n < a; ++n) {
this._module.setValue(l + n * t, e[n], o);
}
}
var h = s(a, l);
this._module._free(l);
return h;
};
e.prototype._copyValuesFromCloset = function(e, t, o, s) {
if (s === 0) {
return [];
}
if (!t || e <= 0 || o === 0 || s < 0) {
return null;
}
var r = [];
for (var a = 0; a < s; ++a) {
r[a] = this._module.getValue(o + a * e, t);
}
return r;
};
e.prototype.convertStringToC = function(e) {
if (typeof e !== "string") {
return 0;
}
var t = this._module.stringToNewUTF8(e);
var o = this._module._ltjs_commons_Closet_createString(t);
this._module._free(t);
return o;
};
e.prototype.convertStringFromC = function(e) {
if (!e) {
return null;
}
var t = this._module._ltjs_commons_Closet_getCString(e);
return this._module.UTF8ToString(t);
};
e.prototype.convertStringArrayToC = function(e) {
if (!e) {
return 0;
}
var t = [];
for (var o = 0, s = e.length; o < s; ++o) {
var r = this.convertStringToC(e[o]);
if (r < 0) {
console.error("Conversion error for: " + e[o]);
}
t[o] = r;
}
return this.convertIntArrayToC(t);
};
e.prototype.convertStringArrayFromC = function(e) {
var t = this.convertIntArrayFromC(e);
if (!t) {
return null;
}
var o = [];
var s = t ? t.length : 0;
for (var r = 0; r < s; ++r) {
o[r] = this.convertStringFromC(t[r]);
}
this._module._ltjs_commons_Closet_releaseAllPrimitives(e);
return o;
};
e.prototype.convertIntArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 4, "i32", this._module._ltjs_commons_Closet_createIntVector, true);
};
e.prototype.convertIntArrayFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfIntVector(e), this._module._ltjs_commons_Closet_getSizeOfIntVector(e));
};
e.prototype.convertIntMVectorFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfIntMVector(e), this._module._ltjs_commons_Closet_getSizeOfIntMVector(e));
};
e.prototype.convertUnsignedArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 4, "i32", this._module._ltjs_commons_Closet_createUnsignedVector, true);
};
e.prototype.convertUnsignedArrayFromC = function(e) {
if (!e) {
return null;
}
return Xo(this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfUnsignedVector(e), this._module._ltjs_commons_Closet_getSizeOfUnsignedVector(e)));
};
e.prototype.convertUnsignedMVectorFromC = function(e) {
if (!e) {
return null;
}
return Xo(this._copyValuesFromCloset(4, "i32", this._module._ltjs_commons_Closet_getAddressOfUnsignedMVector(e), this._module._ltjs_commons_Closet_getSizeOfUnsignedMVector(e)));
};
e.prototype.convertDoubleArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 8, "double", this._module._ltjs_commons_Closet_createDoubleVector, true);
};
e.prototype.convertDoubleArrayFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(8, "double", this._module._ltjs_commons_Closet_getAddressOfDoubleVector(e), this._module._ltjs_commons_Closet_getSizeOfDoubleVector(e));
};
e.prototype.convertDoubleMVectorFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(8, "double", this._module._ltjs_commons_Closet_getAddressOfDoubleMVector(e), this._module._ltjs_commons_Closet_getSizeOfDoubleMVector(e));
};
e.prototype.convertFloatArrayToC = function(e) {
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 4, "float", this._module._ltjs_commons_Closet_createFloatVector, true);
};
e.prototype.convertFloatArrayFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "float", this._module._ltjs_commons_Closet_getAddressOfFloatVector(e), this._module._ltjs_commons_Closet_getSizeOfFloatVector(e));
};
e.prototype.convertFloatMVectorFromC = function(e) {
if (!e) {
return null;
}
return this._copyValuesFromCloset(4, "float", this._module._ltjs_commons_Closet_getAddressOfFloatMVector(e), this._module._ltjs_commons_Closet_getSizeOfFloatMVector(e));
};
e.prototype.convertBoolArrayToC = function(e) {
e = qo(e);
if (!e) {
return 0;
}
return this._copyValuesIntoCloset(e, 1, "i8", this._module._ltjs_commons_Closet_createBoolVector);
};
e.prototype.convertBoolArrayFromC = function(e) {
if (!e) {
return null;
}
var t = this._module._ltjs_commons_Closet_getBoolVectorAsBitset(e);
var o = this._module._ltjs_commons_Closet_getAddressOfBitset(t);
var s = this._module._ltjs_commons_PrimitiveCloset_getSizeOfBoolVector(e);
var r = this.convertBitsetToBoolArray(o, s);
this._module._ltjs_commons_Closet_releasePrimitive(t);
return r;
};
e.prototype.convertBoolMVectorFromC = function(e) {
if (!e) {
return null;
}
var t = this._module._ltjs_commons_Closet_getBoolMVectorAsBitset(e);
var o = this._module._ltjs_commons_Closet_getAddressOfBitset(t);
var s = this._module._ltjs_commons_PrimitiveCloset_getSizeOfBoolMVector(e);
var r = this.convertBitsetToBoolArray(o, s);
this._module._ltjs_commons_Closet_releasePrimitive(t);
return r;
};
e.prototype.convertBitsetToBoolArray = function(e, t) {
if (t === 0) {
return [];
}
var o = this._module.HEAP8;
if (!o || e === 0 || t < 0) {
return null;
}
var s = [];
for (var r = 0; r < t; ++r) {
var a = o[e + Math.floor(r / 8)];
s[r] = !!(a & Jo[r % 8]);
}
return s;
};
e.prototype.convertObjectToC = function(e) {
return e ? e.getClosetAddress() : 0;
};
e.prototype.convertObjectArrayToC = function(e) {
if (!e) {
return 0;
}
var t = [];
for (var o = 0, s = e.length; o < s; ++o) {
t[o] = this.convertObjectToC(e[o]);
}
return this.convertIntArrayToC(t);
};
e.prototype.convertGeometryArrayFromC = function(e) {
var t = this.convertIntArrayFromC(e);
if (!t) {
return null;
}
var o = [];
for (var s = 0, r = t.length; s < r; ++s) {
o[s] = this.convertFloatArrayFromC(t[s]);
}
this.releaseAllPrimitives(e);
return o;
};
e.prototype.convertGeometryArrayToC = function(e) {
if (!e) {
return 0;
}
var t = [];
for (var o = 0, s = e.length; o < s; ++o) {
t[o] = this.convertFloatArrayToC(e[o]);
}
return this.convertIntArrayToC(t);
};
e.prototype.getWrappableClosetSize = function() {
return this._module._ltjs_commons_Closet_getWrappableClosetSize();
};
e.prototype.getPrimitiveClosetSize = function() {
return this._module._ltjs_commons_Closet_getPrimitiveClosetSize();
};
e.prototype.releaseWrappable = function(e) {
this._module._ltjs_commons_Closet_releaseWrappable(e);
};
e.prototype.releasePrimitive = function(e) {
this._module._ltjs_commons_Closet_releasePrimitive(e);
};
e.prototype.releaseAllPrimitives = function(e) {
this._module._ltjs_commons_Closet_releaseAllPrimitives(e);
};
e.prototype.releaseAllWrappables = function(e) {
var t = this.convertIntArrayToC(e);
this._module._ltjs_commons_Closet_releaseAllWrappables(t);
};
e.prototype.getClosetKey = function(e) {
return this._module._ltjs_commons_Closet_getAddress(e);
};
e.prototype.closetObjectsEqual = function(e, t) {
return this._module._ltjs_commons_Closet_equals(e, t);
};
e.prototype.getWasmHeapSize = function() {
return this._module._ltjs_commons_Closet_getHeapSize();
};
e.prototype.getWasmHeapSizeFree = function() {
return this._module._ltjs_commons_Closet_getHeapSizeFree();
};
e.prototype.getWasmHeapSizeUsed = function() {
return this._module._ltjs_commons_Closet_getHeapSizeUsed();
};
e.prototype.getHeapBufferSize = function() {
return this._module.HEAP8.length;
};
return e;
}();
var es = new $o(Wo);
var ts = es;
var os = [];
var ss;
var rs = 0;
var as = [];
var ls = new Map;
var ns = new Qo;
if (ts.runtime.typeMapAvailable) {
ns.initFromModuleTypeMap(Wo.typeMap);
} else {
ts.runtime.typeMapInitializers.push((function() {
ns.initFromModuleTypeMap(Wo.typeMap);
}));
}
function cs() {
rs--;
if (rs <= 0) {
es.runtime.executeRunWhenInitializedCallbacks();
}
}
function is() {
es.runtime.initializeWrappers();
var e = as.concat(es.runtime.onPlatformInitialized);
es.runtime.platformInitialized = true;
es.runtime.onPlatformInitialized = [];
as.length = 0;
rs = e.length;
for (var t = 0, o = e; t < o.length; t++) {
var s = o[t];
s(cs);
}
if (rs <= 0) {
es.runtime.executeRunWhenInitializedCallbacks();
}
}
function ds() {
if (!hs()) {
return;
}
if (es.removeBlockingDependency) {
es.removeBlockingDependency("librariesLoaded");
}
es.libraryLoadingCompleted = true;
}
function hs() {
var e = sas.ltjs.loaderRuntime;
var t = sas.ltjs.runtime;
return !e || t === e;
}
function ps(e, t) {
if (e && os.indexOf(e) < 0) {
os.push(e);
}
if (sas.ltjs.registerDependency) {
sas.ltjs.registerDependency(e);
}
ls.set(e, t);
}
function ms() {
return os;
}
function us() {
var e = [];
for (var t = 0, o = os; t < o.length; t++) {
var s = o[t];
var r = ls.get(s);
if (r) {
e = e.concat(r);
}
}
return e;
}
function vs(e) {
if (fs()) {
e();
} else {
es.runtime.onReadyFunctions.push(e);
}
}
function gs() {
if (fs()) {
return Promise.resolve();
} else {
if (!ss) {
ss = new Promise((function(e) {
es.runtime.onReadyFunctions.push(e);
}));
}
return ss;
}
}
function fs() {
return es.runtime.ltjsInitialized || Ms();
}
function Ms() {
return !!sas.ltjs.jest && sas.ltjs.jest.isInitialized;
}
function Cs(e, t) {
if (t === void 0) {
t = false;
}
if (es.runtime.platformInitialized || Ms()) {
e();
} else if (t) {
as.push(e);
} else {
es.runtime.onPlatformInitialized.push(e);
}
}
function bs(e) {
if (es.runtime.wrappersInitialized || Ms()) {
e();
} else {
es.runtime.wrapperInitFunctions.push(e);
}
}
function ys(e) {
var t = ns.getModuleByName(e);
if (t === undefined) {
throw new Error("Module is not defined for name: ".concat(e));
}
return t;
}
function ws(e, t) {
if (t && t.default) {
return t.default;
}
return ys(e);
}
function xs(e) {
return function(e) {
z(t, e);
function t() {
return e !== null && e.apply(this, arguments) || this;
}
return t;
}(e);
}
function Ss(e, t) {
var o = ns.getModuleByName(e);
if (!o) {
o = xs(t);
ns.addClassToModuleMap(e, o);
}
return o;
}
function zs(e, t, o) {
var s = o;
for (var r = 0, a = t; r < a.length; r++) {
var l = a[r];
s = Ss(l, s);
}
return Ss(e, s);
}
function Vs() {
ns.initFromModuleTypeMap(Wo.typeMap);
}
var Ns = Object.freeze({
__proto__: null,
_ltjsModule: ts,
createModule: zs,
currentRuntimeIsLoaderRuntime: hs,
getRegisteredModules: ms,
getRegisteredPortablePackages: us,
initialize: is,
initializeWrapper: bs,
isInitialized: fs,
ltjsModule: es,
moduleLookup: ys,
moduleLookupAsDefault: ws,
registerModule: ps,
reinitializeTypemap: Vs,
runWhenInitialized: vs,
runWhenPlatformInitialized: Cs,
setupLtjsEnvironment: ds,
typeMap: ns,
whenInitialized: gs
});
function Ts(e) {
if (!e) {
return 0;
}
if (!Array.isArray(e)) {
return e.getClosetAddress();
}
return e.map(Ts);
}
function Ls(e) {
if (!e) {
return 0;
}
if (!Array.isArray(e)) {
return es.getClosetKey(e.getClosetAddress());
}
return e.map(Ls);
}
var Hs;
(function(e) {
e[e["IE"] = 1] = "IE";
e[e["EDGE"] = 2] = "EDGE";
e[e["FIREFOX"] = 3] = "FIREFOX";
e[e["CHROME"] = 4] = "CHROME";
e[e["SAFARI"] = 5] = "SAFARI";
e[e["UNKNOWN"] = 6] = "UNKNOWN";
})(Hs || (Hs = {}));
function Is(e) {
if (/Edge\/[\w\.]*/.test(e)) {
return Hs.EDGE;
} else if (/Chrome\/[\w\.]*/.test(e)) {
return Hs.CHROME;
} else if (/Firefox\/[\w\.]*/.test(e)) {
return Hs.FIREFOX;
} else if (/Safari\/[\w\.]*/.test(e)) {
return Hs.SAFARI;
} else if (/MSIE /.test(e) || /Trident\//.test(e)) {
return Hs.IE;
}
return Hs.UNKNOWN;
}
var As = null;
function ks() {
if (As === null) {
As = Is(window.navigator.userAgent);
}
return As;
}
var Ds = sas.ltjs.isOpenUI;
var Rs;
var Es;
function Bs(e) {
if (Os(e)) {
if (Ds) {
return sas.hc.ui.core.util.getProxyUrl(e, false);
}
if (Fs(e)) {
return e;
}
}
if (e.startsWith("http://") || e.startsWith("https://")) {
return e;
}
if (e.startsWith("./resources/")) {
e = e.substring(12);
} else if (e.startsWith("/resources/")) {
e = e.substring(11);
}
if (e.startsWith("/")) {
e = e.substring(1);
}
if (sas.ltjs.getResourceUrl) {
var t = sas.ltjs.getResourceUrl(e);
if (t) {
return t;
}
}
var o;
if (Ds) {
o = jQuery.sap.getResourcePath(e, "");
if (e.endsWith("/") && !o.endsWith("/")) {
o += "/";
}
return o;
}
if (!sas.ltjs.resourceUrl) {
console.warn('sas.ltjs.resourceUrl not configured, defaulting to "/"');
sas.ltjs.resourceUrl = "/";
}
return "".concat(sas.ltjs.resourceUrl).concat(sas.ltjs.resourceUrl.endsWith("/") ? "" : "/").concat(e);
}
function Os(e) {
if (sas.ltjs.node) {
return false;
}
if (Ds) {
return sas.hc.ui.core.util.isUrlCrossDomain(e);
}
if (!Rs) {
Rs = document.createElement("a");
}
try {
Rs.href = e;
} catch (t) {
console.warn("Failed to parse url: ", e);
return true;
}
if (!Rs.protocol) {
return false;
}
if (Rs.protocol !== location.protocol || Rs.hostname !== location.hostname) {
return true;
}
var t = Rs.port === "80" || Rs.port === "443" ? "" : Rs.port;
if (t !== null && t !== location.port || t === null && location.por