UNPKG

@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,678 lines (1,569 loc) 11.4 MB
import e, { createElement as t, Fragment as o, useState as s, useEffect as a, useMemo as r, useCallback as n, createContext as l, useContext as c, useRef as i, useSyncExternalStore as d, useLayoutEffect as h, forwardRef as p, useReducer as m, lazy as u, memo as g, useImperativeHandle as v, Suspense as f, cloneElement as M, Children as y, isValidElement as x, createRef as z, startTransition as C, PureComponent as b, Component as S } from "react"; import { createRoot as w } from "react-dom/client"; import { __extends as V, __assign as N, __awaiter as H, __generator as L, __rest as T } from "tslib"; import { BehaviorSubject as A, ReplaySubject as I, Subject as k, from as D, EMPTY as F, combineLatest as E, asyncScheduler as R, using as B, throwError as O, fromEventPattern as _, of as P, merge as j, animationFrameScheduler as U, concat as G, AsyncSubject as W, firstValueFrom as Z } from "rxjs"; import { takeUntil as K, filter as Y, take as Q, distinct as J, share as X, mergeMap as q, catchError as $, scan as ee, distinctUntilChanged as te, skip as oe, debounceTime as se, map as ae, withLatestFrom as re, tap as ne, ignoreElements as le, publish as ce, delay as ie, switchMap as de, concatMap as he, first as pe, shareReplay as me, mergeMapTo as ue, finalize as ge, startWith as ve, endWith as fe, skipWhile as Me, last as ye, find as xe } from "rxjs/operators"; import ze from "i18next"; import { useTranslation as Ce, initReactI18next as be } from "react-i18next"; import Se, { createPortal as we } from "react-dom"; import Ve, { FreeFocusInside as Ne, AutoFocusInside as He, MoveFocusInside as Le } from "react-focus-lock"; import Te from "classnames"; import { MotionConfig as Ae, AnimatePresence as Ie, motion as ke, useMotionValue as De, useDragControls as Fe, useAnimate as Ee } from "framer-motion"; import { hsl as Re, parseToHsl as Be, opacify as Oe, transparentize as _e, rgba as Pe, toColorString as je, hslToColorString as Ue, grayscale as Ge, mix as We, parseToRgb as Ze, rgb as Ke, getContrast as Ye, lighten as Qe, darken as Je } from "polished"; import { jsx as Xe, jsxs as qe } from "react/jsx-runtime"; import $e from "axios"; import { createSelector as et, defaultMemoize as tt } from "reselect"; import { b as ot, a as st, c as at, d as rt, e as nt, f as lt, g as ct, h as it, i as dt, j as ht, k as pt, l as mt, m as ut, n as gt, o as vt, p as ft, q as Mt, r as yt, s as xt, t as zt, u as Ct, v as bt, w as St, x as wt, y as Vt, z as Nt, A as Ht, B as Lt, C as Tt, D as At, E as It, F as kt, G as Dt, H as Ft, I as Et, J as Rt, K as Bt, L as Ot, M as _t, N as Pt, O as jt, P as Ut, Q as Gt, R as Wt, S as Zt, T as Kt, U as Yt, V as Qt, W as Jt, X as Xt, Y as qt, Z as $t, _ as eo, $ as to, a0 as oo, a1 as so } from "./i18n/nova_i18n.mjs"; import { usePopper as ao } from "react-popper"; import "@popperjs/core"; import ro from "memoize-one"; import "handlebars"; import { z as no } from "zod"; import { useCallback as lo } from "use-memo-one"; import { useQuery as co, QueryClient as io } from "@tanstack/react-query"; import ho from "react-cropper"; import { ofType as po, createEpicMiddleware as mo, combineEpics as uo } from "redux-observable"; import { combineReducers as go, createStore as vo, applyMiddleware as fo, bindActionCreators as Mo } from "redux"; import { composeWithDevTools as yo } from "@redux-devtools/extension"; import { connect as xo, shallowEqual as zo } from "react-redux"; let Co; let bo = new Map; function So() { return Co; } async function wo(e) { const t = await (e?.importType === "mobile" ? import("./chunk2.mjs").then((e => ({ type: "mobile", ...e }))) : import("./chunk7.mjs").then((e => ({ type: "dynamic", ...e })))); if (e?.initialize) { await (e?.initialize(t)); } Co = t; if (bo) { for (const e of bo.values()) { e(); } } bo = undefined; } function Vo(e, t) { bo?.set(e, t); } function No(e) { bo?.delete(e); } let Ho = 0; function Lo() { return `vaReportComponentContainer${Ho++}`; } class To extends HTMLElement { constructor(...e) { super(...e); 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 = w(this); } const e = this._getRenderer(); if (!e) { if (this._root) { this._root.render(t(o)); } return; } const s = this._root && this.getRenderProps(); clearTimeout(this._validationTimerId); this._validationTimerId = 0; if (s) { this._root.render(t(e, s)); } else if (this._root) { this._root.render(t(o)); } }; } _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 Ao(e) { if (!e) { return; } switch (e.toLowerCase()) { case "guest": return "guest"; case "credentials": return "credentials"; } } class Io extends To { constructor(...e) { super(...e); this._elementKey = Lo(); 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 "url" in e ? `${e.url}:${e.reportUri}:${this._elementKey}` : `${e.packageUri}:${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") && !Ao(o)) { console.warn(`Invalid AuthenticationType: ${o}`); } } connectedCallback() { Vo(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) { No(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()) { No(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 = So(); 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.reportUri && this.url) { return { ...e, authenticationType: this.authenticationType, reportUri: this.reportUri, url: this.url }; } else if (this.packageUri) { return { ...e, packageUri: this.packageUri }; } 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 Ao(this.getAttribute("authenticationType")) || "credentials"; } set authenticationType(e) { if (e) { if (typeof e !== "string" || !Ao(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 = Lo(); 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 ko(e) { if (e && typeof e === "string") { const t = e.toLocaleLowerCase(); return [ "true", "false", "auto" ].indexOf(t) > -1; } return true; } class Do extends Io { constructor(...e) { super(...e); this._graphCSS = void 0; this._themeOverrides = null; this._unprocessedOverrides = void 0; } _getRenderer() { return So()?.SASReport; } static get observedAttributes() { return [ ...super.observedAttributes, "hidenavigation" ]; } attributeChangedCallback(e, t, o) { super.attributeChangedCallback(e, t, o); if (e === "hideNavigation" && this.hasAttribute("hideNavigation") && !ko(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 (!ko(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 = So(); 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 a = { baseThemeId: "light", styleData: {} }; if (typeof s.baseThemeId === "string") { a.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) { a.styleData = s.styleData; } else { console.error("Objects passed to unsafe_setCustomReportTheme must have an object for the styleData property"); } o = t.convertThemeServiceResponseToThemeParameterOverrides(a); } 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 Fo(e) { if (e && typeof e === "string") { const t = e.toLocaleLowerCase(); return [ "true", "false" ].indexOf(t) > -1; } return true; } class Eo extends Io { constructor(...e) { super(...e); this._objectHandlePromise = void 0; this._rejectObjectHandleCallback = void 0; } _getRenderer() { return So()?.SASReportObject; } static get observedAttributes() { return [ ...super.observedAttributes, "objectname", "reportcontextkey", "hideloadimage" ]; } _getContextKey(e) { return "url" in e ? `${e.url}:${e.reportUri}:${e.reportContextKey}:${e.objectName}` : `${e.packageUri}:${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 (!Fo(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 Ro extends Io { _getRenderer() { return So()?.SASReportPage; } static get observedAttributes() { return [ ...super.observedAttributes, "pagename", "pageindex", "reportcontextkey" ]; } _getContextKey(e) { if (!e.reportContextKey) { return super._getContextKey(e); } return "url" in e ? `${e.url}:${e.reportUri}:${e.reportContextKey}` : `${e.packageUri}:${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 Bo(e); } set pageIndex(e) { const t = Bo(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 Bo(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 Oo(e) { wo(e); if (!customElements.get("sas-report")) { customElements.define("sas-report", Do); } if (!customElements.get("sas-report-object")) { customElements.define("sas-report-object", Eo); } if (!customElements.get("sas-report-page")) { customElements.define("sas-report-page", Ro); } } function _o() { _o = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var o = arguments[t]; for (var s in o) { if (Object.prototype.hasOwnProperty.call(o, s)) { e[s] = o[s]; } } } return e; }; return _o.apply(this, arguments); } function Po(e, t, o, s) { if (!o) return; Object.defineProperty(e, t, { enumerable: o.enumerable, configurable: o.configurable, writable: o.writable, value: o.initializer ? o.initializer.call(s) : void 0 }); } function jo(e, t, o, s, a) { var r = {}; Object.keys(s).forEach((function(e) { r[e] = s[e]; })); r.enumerable = !!r.enumerable; r.configurable = !!r.configurable; if ("value" in r || r.initializer) { r.writable = true; } r = o.slice().reverse().reduce((function(o, s) { return s(e, t, o) || o; }), r); if (a && r.initializer !== void 0) { r.value = r.initializer ? r.initializer.call(a) : void 0; r.initializer = undefined; } if (r.initializer === void 0) { Object.defineProperty(e, t, r); r = null; } return r; } var Uo = globalThis; Uo.sas = Uo.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 Zo = /sas\/ltjs\/([^\/]+).*\/([^\/]+)/; function Ko(e) { var t = e.match(Zo); 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 Yo = 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 a = s[0], r = s[1]; var n = Ko(a); this._typeMap.set(o, { typeId: o, moduleName: n, modulePath: a, parentTypeId: r }); } } }; 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 Qo = [ 1, 2, 4, 8, 16, 32, 64, 128 ]; function Jo(e) { if (e) { for (var t = 0, o = e.length; t < o; t++) { e[t] = e[t] >>> 0; } } return e; } function Xo(e) { if (e) { for (var t = 0, o = e.length; t < o; t++) { e[t] = !!e[t]; } } return e; } var qo = 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, a) { if (a === void 0) { a = false; } if (!e || !o || !s) { return 0; } var r = e.length; var n = this._module._malloc(r * t); if (a) { for (var l = 0; l < r; ++l) { var c = NaN; var i = e[l]; if (typeof i === "number") { c = i; } else if (!isNaN(i)) { var d = parseFloat(i); if (!isNaN(d)) { c = d; } } this._module.setValue(n + l * t, c, o); } } else { for (var l = 0; l < r; ++l) { this._module.setValue(n + l * t, e[l], o); } } var h = s(r, n); this._module._free(n); 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 a = []; for (var r = 0; r < s; ++r) { a[r] = this._module.getValue(o + r * e, t); } return a; }; 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 a = this.convertStringToC(e[o]); if (a < 0) { console.error("Conversion error for: " + e[o]); } t[o] = a; } 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 a = 0; a < s; ++a) { o[a] = this.convertStringFromC(t[a]); } 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 Jo(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 Jo(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 = Xo(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 a = this.convertBitsetToBoolArray(o, s); this._module._ltjs_commons_Closet_releasePrimitive(t); return a; }; 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 a = this.convertBitsetToBoolArray(o, s); this._module._ltjs_commons_Closet_releasePrimitive(t); return a; }; 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 a = 0; a < t; ++a) { var r = o[e + Math.floor(a / 8)]; s[a] = !!(r & Qo[a % 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, a = t.length; s < a; ++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); }; return e; }(); var $o = new qo(Wo); var es = $o; var ts = []; var os; var ss = 0; var as = []; var rs = new Map; var ns = new Yo; if (es.runtime.typeMapAvailable) { ns.initFromModuleTypeMap(Wo.typeMap); } else { es.runtime.typeMapInitializers.push((function() { ns.initFromModuleTypeMap(Wo.typeMap); })); } function ls() { ss--; if (ss <= 0) { $o.runtime.executeRunWhenInitializedCallbacks(); } } function cs() { $o.runtime.initializeWrappers(); var e = as.concat($o.runtime.onPlatformInitialized); $o.runtime.platformInitialized = true; $o.runtime.onPlatformInitialized = []; as.length = 0; ss = e.length; for (var t = 0, o = e; t < o.length; t++) { var s = o[t]; s(ls); } if (ss <= 0) { $o.runtime.executeRunWhenInitializedCallbacks(); } } function is() { if (!ds()) { return; } if ($o.removeBlockingDependency) { $o.removeBlockingDependency("librariesLoaded"); } $o.libraryLoadingCompleted = true; } function ds() { var e = sas.ltjs.loaderRuntime; var t = sas.ltjs.runtime; return !e || t === e; } function hs(e, t) { if (e && ts.indexOf(e) < 0) { ts.push(e); } if (sas.ltjs.registerDependency) { sas.ltjs.registerDependency(e); } rs.set(e, t); } function ps() { return ts; } function ms() { var e = []; for (var t = 0, o = ts; t < o.length; t++) { var s = o[t]; var a = rs.get(s); if (a) { e = e.concat(a); } } return e; } function us(e) { if (vs()) { e(); } else { $o.runtime.onReadyFunctions.push(e); } } function gs() { if (vs()) { return Promise.resolve(); } else { if (!os) { os = new Promise((function(e) { $o.runtime.onReadyFunctions.push(e); })); } return os; } } function vs() { return $o.runtime.ltjsInitialized || fs(); } function fs() { return !!sas.ltjs.jest && sas.ltjs.jest.isInitialized; } function Ms(e, t) { if (t === void 0) { t = false; } if ($o.runtime.platformInitialized || fs()) { e(); } else if (t) { as.push(e); } else { $o.runtime.onPlatformInitialized.push(e); } } function ys(e) { if ($o.runtime.wrappersInitialized || fs()) { e(); } else { $o.runtime.wrapperInitFunctions.push(e); } } function xs(e) { var t = ns.getModuleByName(e); if (t === undefined) { throw new Error("Module is not defined for name: ".concat(e)); } return t; } function zs(e, t) { if (t && t.default) { return t.default; } return xs(e); } function Cs(e) { return function(e) { V(t, e); function t() { return e !== null && e.apply(this, arguments) || this; } return t; }(e); } function bs(e, t) { var o = ns.getModuleByName(e); if (!o) { o = Cs(t); ns.addClassToModuleMap(e, o); } return o; } function Ss(e, t, o) { var s = o; for (var a = 0, r = t; a < r.length; a++) { var n = r[a]; s = bs(n, s); } return bs(e, s); } function ws() { ns.initFromModuleTypeMap(Wo.typeMap); } var Vs = Object.freeze({ __proto__: null, _ltjsModule: es, createModule: Ss, currentRuntimeIsLoaderRuntime: ds, getRegisteredModules: ps, getRegisteredPortablePackages: ms, initialize: cs, initializeWrapper: ys, isInitialized: vs, ltjsModule: $o, moduleLookup: xs, moduleLookupAsDefault: zs, registerModule: hs, reinitializeTypemap: ws, runWhenInitialized: us, runWhenPlatformInitialized: Ms, setupLtjsEnvironment: is, typeMap: ns, whenInitialized: gs }); function Ns(e) { if (!e) { return 0; } if (!Array.isArray(e)) { return e.getClosetAddress(); } return e.map(Ns); } function Hs(e) { if (!e) { return 0; } if (!Array.isArray(e)) { return $o.getClosetKey(e.getClosetAddress()); } return e.map(Hs); } var Ls; (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"; })(Ls || (Ls = {})); function Ts(e) { if (/Edge\/[\w\.]*/.test(e)) { return Ls.EDGE; } else if (/Chrome\/[\w\.]*/.test(e)) { return Ls.CHROME; } else if (/Firefox\/[\w\.]*/.test(e)) { return Ls.FIREFOX; } else if (/Safari\/[\w\.]*/.test(e)) { return Ls.SAFARI; } else if (/MSIE /.test(e) || /Trident\//.test(e)) { return Ls.IE; } return Ls.UNKNOWN; } var As = null; function Is() { if (As === null) { As = Ts(window.navigator.userAgent); } return As; } var ks = sas.ltjs.isOpenUI; var Ds; var Fs; function Es(e) { if (Rs(e)) { if (ks) { return sas.hc.ui.core.util.getProxyUrl(e, false); } if (Bs(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 (ks) { 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 Rs(e) { if (sas.ltjs.node) { return false; } if (ks) { return sas.hc.ui.core.util.isUrlCrossDomain(e); } if (!Ds) { Ds = document.createElement("a"); } try { Ds.href = e; } catch (t) { console.warn("Failed to parse url: ", e); return true; } if (!Ds.protocol) { return false; } if (Ds.protocol !== location.protocol || Ds.hostname !== location.hostname) { return true; } var t = Ds.port === "80" || Ds.port === "443" ? "" : Ds.port; if (t !== null && t !== location.port || t === null && location.port !== "") { return true; } return false; } function Bs(e) { try { new URL(e); return true