{"version":3,"file":"tibco-spotfire-wrapper.mjs","sources":["../../../projects/spotfire-wrapper/src/lib/lazy-loading-library.service.ts","../../../projects/spotfire-wrapper/src/lib/spotfire-webplayer.ts","../../../projects/spotfire-wrapper/src/lib/document.service.ts","../../../projects/spotfire-wrapper/src/lib/spotfire-customization.ts","../../../projects/spotfire-wrapper/src/lib/spotfire-server.service.ts","../../../projects/spotfire-wrapper/src/lib/viewer/spotfire-viewer.component.ts","../../../projects/spotfire-wrapper/src/lib/viewer/spotfire-viewer.component.html","../../../projects/spotfire-wrapper/src/lib/viewer/spotfire-viewer.module.ts","../../../projects/spotfire-wrapper/src/public_api.ts","../../../projects/spotfire-wrapper/src/tibco-spotfire-wrapper.ts"],"sourcesContent":["/*\n* Copyright (c) 2019-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\n\nimport { DOCUMENT } from '@angular/common';\nimport { Inject, Injectable } from '@angular/core';\n\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class LazyLoadingLibraryService {\n  private loadedLibraries: { [url: string]: ReplaySubject<any>; } = {};\n\n  constructor(@Inject(DOCUMENT) private readonly document: any) { }\n\n  loadJs(url: string): Observable<any> {\n    if (this.loadedLibraries[url]) {\n      return this.loadedLibraries[url].asObservable();\n    }\n\n    this.loadedLibraries[url] = new ReplaySubject();\n\n    const script = this.document.createElement('script');\n    script.type = 'text/javascript';\n    script.src = url;\n    script.onload = () => {\n      this.loadedLibraries[url].next('');\n      this.loadedLibraries[url].complete();\n    };\n    script.onerror = () => {\n      console.error(`Library ${url} is not loaded !`);\n      this.loadedLibraries[url].error(`Cannot load Spotfire JS library from ${url}. Check the URL !`);\n    };\n\n    this.document.body.appendChild(script);\n    return this.loadedLibraries[url].asObservable();\n  }\n}\n","/*\n* Copyright (c) 2019-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\n\nimport {forkJoin, of as observableOf, throwError, zip, BehaviorSubject, Observable, TimeoutError} from 'rxjs';\nimport {catchError, filter, map, mergeMap, pluck, tap, timeout} from 'rxjs/operators';\n\nimport {SpotfireCustomization as Customization, SpotfireFilter} from './spotfire-customization';\n\ndeclare let spotfire: any;\n\nconst doConsole = (...args: any[]) => {\n    console.log('[SPOTFIRE-WEBPLAYER]', ...args);\n};\n\nclass PageState {\n    index: number;\n    pageTitle: string;\n}\n\nclass DataTable {\n    dataTableName: string;\n}\n\nclass DataColumn {\n    dataColumnName: string;\n    dataTableName: string;\n    dataType: string;\n    values: any;\n}\n\nclass DistinctValues {\n    count: number;\n    values: string[];\n}\n\nexport class SpotfireMarking {\n    constructor(public _marking) {\n    }\n\n    getMarkingNames$ = () => doCall<string[]>(this._marking, 'getMarkingNames');\n    onChanged$ = (m, t, c, n) => doCall(this._marking, 'onChanged', m, t, c, n);\n}\n\n/**\n * @description\n * Class holder to provide filtering features outside of the dashboard.\n * On Angular side, the onFiltering output parameter has to be set like this:\n *    <spotfire-wrapper\n *       (filtering)=\"onFiltering($event)\"\n *       ...\n *    </spotfire-wrapper>\n *    ...\n *    import { SpotfireFiltering } from '@tibco/spotfire-wrapper';\n *    ...\n *    filtering: SpotfireFiltering = null;\n *    onFiltering = (e: SpotfireFiltering) => this.filtering = e;\n *    getSchemes = () => this.filtering.getFilteringSchemes$()\n *         .subscribe(schemes => console.log('My Schemes', schemes));\n */\nexport class SpotfireFiltering {\n    constructor(private _filtering) {\n    }\n\n    setFilters = (flts) => this._filtering.setFilters(flts, spotfire.webPlayer.filteringOperation.REPLACE);\n    resetAllFilters = () => this._filtering.resetAllFilters();\n    getAllModifiedFilterColumns$ = () => doCall<SpotfireFilter[]>(\n        this._filtering, 'getAllModifiedFilterColumns',\n        spotfire.webPlayer.includedFilterSettings.ALL_WITH_CHECKED_HIERARCHY_NODES\n    );\n    getFilteringScheme$ = (filteringSchemeName: string) => doCall<FillteringScheme>(\n        this._filtering, 'getFilteringScheme', filteringSchemeName);\n    getFilteringSchemes$ = () => doCall<FillteringScheme>(\n        this._filtering, 'getFilteringSchemes');\n    getActiveFilteringScheme$ = () => doCall<FillteringScheme[]>(\n        this._filtering, 'getActiveFilteringScheme');\n}\n\nclass FillteringScheme {\n    filteringSchemeName: string;\n    dataTables: DataTable[];\n}\n\nexport class SpotfireParameters {\n    url: string;\n    path: string;\n    page: string | number;\n    domid: string;\n    externalDomIds: string[];\n    sid: string;\n    customization: Customization;\n    version = '7.14'; // Nominal fall back value\n    debug = false;\n    reloadAnalysisInstance = false;\n    document: SpotfireDocument;\n    app: any;\n    _parameters: string;\n\n    constructor(vars?: any) {\n        if (vars) {\n            Object.keys(vars).forEach(key => this[key] = vars[key]);\n        }\n        // Create a Unique ID for this Spotfire dashboard\n        //\n        this.domid = this.domid ? this.domid : this.sid ? `${this.sid}` : `${new Date().getTime()}`;\n    }\n}\n\nexport class SpotfireData {\n    allTables = {};\n\n    constructor(private _data) {\n    }\n\n    getTables$ = () => this.getDataTables$().pipe(\n        mergeMap(tables => {\n            const obs = [];\n            tables.forEach(table => obs.push(this.getDataTableColNames$(table.dataTableName)));\n            return forkJoin(obs);\n        }),\n        map(k => {\n            let z = {};\n            k.forEach((p: any) => z = {...z, ...p});\n            return z;\n        })\n    );\n    getAllTables$ = () => this.getDataTables$().pipe(\n        mergeMap(tables => {\n            const obs = [];\n            tables.forEach(table => obs.push(this.getDataTable$(table.dataTableName)));\n            return forkJoin(obs);\n        }), map(tables => {\n            const dataTables = [];\n            (tables[0] as []).forEach(columns => {\n                const tname = columns['tabName'];\n                if (!dataTables[tname]) {\n                    dataTables[tname] = {};\n                }\n                dataTables[tname][columns['colName']] = columns['vals'];\n            });\n            return dataTables;\n        }));\n\n    // A Spotfire analysis contains one or more data tables, retrieved by the getDataTable,\n    // getActiveDataTable and getDataTables methods.\n    private getDataTables$ = () => doCall<DataTable[]>(this._data, 'getDataTables');\n\n    private getDataTableColNames$ = (t) => doCall<DataTable>(this._data, 'getDataTable', t)\n        .pipe(mergeMap(f => this.getDataColumns$(f)), map(d => ({[t]: d})));\n\n    private getDataTable$ = (t) => doCall<DataTable>(this._data, 'getDataTable', t)\n        .pipe(mergeMap(f => this.getDataColumns$(f)));\n\n    // Each data table contains one or more data columns, retrieved by the getDataColumn,\n    // getDataColumns and searchDataColumns.\n    private getDataColumns$ = (t) => doCall<DataColumn[]>(t, 'getDataColumns').pipe(\n        mergeMap(columns => {\n            const obs = [];\n            columns.forEach((col: DataColumn) => obs.push(zip(...[observableOf(col)], (a: DataColumn, b) => a.dataColumnName)));\n            return forkJoin(obs);\n        })\n    );\n\n    // From the DataColumn class it is possible to retrieve metadata, such as column name and data type.\n    // It is also possible to get a list of the unique values in the data column with the getDistinctValues method.\n    private getDistinctValues$ = (t: DataColumn) => doCall<DistinctValues>(t, 'getDistinctValues', 0, 20).pipe(\n        tap(g => doConsole('Data.DistinctValues$', t, g, g.count > 0 && g.count < 25)),\n        // filter(g => g.count > 0 && g.count < 25),\n        //  tap(g => doConsole('[OBS]', 'DistinctValues filtres', g)),\n        pluck('values'));\n}\n\nexport class SpotfireDocumentMetadata {\n    size: number;\n    sizeUnit = 'B';\n    /** Gets the content size in bytes of this item. */\n    contentSize: number;\n    /** Gets a DateTime describing when this item was created in the library. */\n    created: Date;\n    /** Gets the description of this item. */\n    description: string;\n    /** Gets a DateTime describing when the last modification of this item was made in the library. */\n    lastModified: Date;\n    /** Gets the path of this item, or null if the path was not retrieved from the library when this item was created. */\n    path: string;\n    /** Gets the title of this item. */\n    title: string;\n\n    constructor(p?) {\n        if (p) {\n            this.contentSize = parseInt(p['contentSize'], 10);\n            if (this.contentSize > (1024 * 1024)) {\n                this.size = this.contentSize / (1024 * 1024);\n                this.sizeUnit = 'MB';\n            } else if (this.contentSize > 1024) {\n                this.size = this.contentSize / 1024;\n                this.sizeUnit = 'KB';\n            }\n            this.created = new Date(p.created);\n            this.lastModified = new Date(p.lastModified);\n            this.description = p.description;\n            this.path = p.path;\n            this.title = p.title;\n        }\n    }\n}\n\nexport class SpotfireProperty {\n    /** The name of the property. */\n    name: string;\n    /** The value of the property as a formatted string or an array of formatted strings, in the users locale. */\n    value: string | string[];\n}\n\nexport class SpotfireDocument {\n    private _doc;\n    private marking: SpotfireMarking;\n    private filtering: SpotfireFiltering;\n    private data: SpotfireData;\n    private readonly mainId: string;\n    // Used to store alternative spotfire view windows\n    private alternativeViewWindows = {};\n    constructor(app, ids, page, custo) {\n        // this._doc = app.openDocument(id, page, custo);\n        if (ids.length > 0) {\n            this.mainId = ids[0];\n            // Open the main ID\n            this._doc = app.openDocument(this.mainId, page, custo);\n        }\n        // Keep i at 1 to skip the first element\n        for (let i = 1; i < ids.length; i++) {\n            this.alternativeViewWindows[ids[i]] = {};\n            this.alternativeViewWindows[ids[i]] = app.openDocument(ids[i], page, custo);\n        }\n        app.onOpened$().subscribe(doc => {\n            doConsole(`Document.onOpened$: page is now opened:`, doc);\n            if(doc.elementId === this.mainId) {\n                this._doc = doc;\n            }\n            // Register event handler for page change events.\n            this.onActivePageChanged$().subscribe(this.onActivePageChangedCallback);\n            this.marking = new SpotfireMarking(this._doc.marking);\n            this.filtering = new SpotfireFiltering(this._doc.filtering);\n            this.data = new SpotfireData(this._doc.data);\n        });\n    }\n    init$(app): Observable<SpotfireDocument> {\n        return app.onOpened$().pipe(map((doc: SpotfireDocument) => {\n            this.alternativeViewWindows[doc['elementId']] = doc;\n            if (doc['elementId'] === this.mainId) {\n                this._doc = doc;\n                // Register event handler for page change events.\n                this.onActivePageChanged$().subscribe(this.onActivePageChangedCallback);\n                this.marking = new SpotfireMarking(this._doc.marking);\n                this.filtering = new SpotfireFiltering(this._doc.filtering);\n                this.data = new SpotfireData(this._doc.data);\n            }\n            return this;\n        }));\n    }\n    getData() {\n        if (!this.data) {\n            this.marking = new SpotfireMarking(this._doc.marking);\n            this.filtering = new SpotfireFiltering(this._doc.filtering);\n            this.data = new SpotfireData(this._doc.data);\n        }\n        doConsole(`Document.getData: b)`, JSON.stringify(this.data));\n        return this.data;\n    }\n    getDocumentMetadata$ = (): Observable<SpotfireDocumentMetadata> =>\n        this.do<SpotfireDocumentMetadata>('getDocumentMetadata').pipe(map(g => new SpotfireDocumentMetadata(g)));\n    /** Get a list of the pages in the current document. */\n    getPages$ = () => this.do('getPages').pipe(map(m => Object.keys(m).map(f => m[f].pageTitle)));\n    /** Get a list of all the properties in the document. */\n    getDocumentProperties$ = () => this.do<SpotfireProperty[]>('getDocumentProperties');\n    /** Get the information about the property with given name. */\n    getDocumentProperty$ = (propertyName: string) => doCall<SpotfireProperty>(this._doc, 'getDocumentProperty', propertyName);\n    setDocumentProperty = (propertyName: string, value: string | string[]) => this._doc.setDocumentProperty(propertyName, value);\n    // getBookmarks$ = () => this.do('getBookmarks');\n    // getBookmarkNames$ = () => this.do('getBookmarkNames');\n    // getReports$ = () => this.do('getReports');\n    /** Get the information about the active page. */\n    getActivePage$ = (id?: string) => {\n        if (id) {\n            return new Observable<PageState>(observer => {\n                if (this.alternativeViewWindows[id]) {\n                    this.alternativeViewWindows[id].getActivePage(page => {\n                        observer.next(page);\n                    });\n                } else {\n                    observer.complete();\n                }\n            });\n        } else {\n            return this.do<PageState>('getActivePage');\n        }\n    };\n    /** Change the active page. */\n    setActivePage = (p: string | number, id?: string) => {\n        if (id) {\n            // Setting active page on alternative id\n            if (this.alternativeViewWindows[id]) {\n                this.alternativeViewWindows[id].setActivePage(p);\n            }\n        } else {\n            this._doc.setActivePage(p);\n        }\n    };\n    // getData = () => this.data;\n    getMarking = () => this.marking;\n    getFiltering = () => this.filtering;\n    _d = () => this._doc ? this._doc : null;\n    /** Event raised, when the document switches to the ready state (the round icon in the status bar becomes green). */\n    onDocumentReady$ = () => this.do('onDocumentReady');\n    close = () => this._doc ? this._doc.close() : null;\n    private onActivePageChangedCallback = (pageState) => doConsole('onActivePageChangedCallback', pageState);\n    private do = <T>(m: string) => doCall<T>(this._doc, m);\n    private onActivePageChanged$ = () => this.do('onActivePageChanged');\n}\n\n/**\n * @description\n * Class holder to provide export features outside of the dashboard.\n * On Angular side, the onReporting output parameter has to be set like this:\n *    <spotfire-wrapper\n *       (reporting)=\"onReporting($event)\"\n *       ...\n *    </spotfire-wrapper>\n *    ...\n *    import { SpotfireReporting } from '@tibco/spotfire-wrapper';\n *    ...\n *    reporting: SpotfireReporting = null;\n *    onReporting = (e: SpotfireReporting) => this.reporting = e;\n *    exportAsImage = () => this.reporting.exportActiveVisualAsImage();\n */\nexport class SpotfireReporting {\n    private exp;\n\n    constructor(doc: SpotfireDocument) {\n        this.exp = doc._d();\n    }\n\n    /** Launch the print wizard. */\n    print = () => this.exp.print();\n    /** Launch the export to PowerPoint wizard. */\n    exportToPowerPoint = () => this.exp.exportToPowerPoint();\n    /** Launch the export to Pdf wizard. */\n    exportToPdf = () => this.exp.exportToPdf();\n    /** Exports the report, specified by name, to PDF. */\n    exportReport = (reportName: string) => this.exp.exportReport(reportName);\n    /** Get the names of the reports in the analysis. */\n    getReports = (callback) => this.exp.getReports(callback);\n    /** Export the active visual as image. The image will be opened in a new browser tab or window. */\n    exportActiveVisualAsImage = (width = 800, height = 600) => this.exp.exportActiveVisualAsImage(width, height);\n}\n\n/**\n * @description\n * An observable object that decribes the status of the TIBCO Spotfire Server.\n */\nexport class SpotfireServer {\n    statusMessage: string;\n\n    constructor(public serverUrl: string, public isOnline: boolean) {\n    }\n}\n\n/**\n * @description\n * Turn async calls into Observables.\n *\n * For methods which name starts with 'on', the observable continues providing data it's received.\n * Otherwise the observable stops sending data at first buffer received.\n * An error is raised when the 50min timeout expires.\n *\n * @param obj the object against we call method\n * @param m the name of method\n * @param ...a list of arguments to be sent along with the method\n *\n * @return Observable<T> an observable that corresponds to the original callback\n *\n */\nconst doCall = <T>(obj, m: string, ...a: any[]): Observable<T> => {\n    doConsole('doCall -->', obj, m, a);\n    return new Observable<T>(observer => {\n        const oneShot = ['onDocumentReady'];\n        // doConsole('[OBS]', 'doCall obj=', obj, ', m=', m, ', arg=', args, typeof obj);\n        if (typeof obj[m] !== 'function' || !obj) {\n            console.error('[OBS]', `function '${m}' does not exist on `, obj);\n            observer.error(`function '${m}' does not exist on objet ${JSON.stringify(obj)}`);\n        }\n        try {\n            // doConsole('[OBS]', `Call ${m}(${a.join(',')})`, a.length);\n            const q = (g: T) => observer.next(g);\n            const p = (g: T) => {\n                observer.next(g);\n                observer.complete();\n            };\n            return m.startsWith('on') && oneShot.indexOf(m) === -1 ? obj[m](...a, q) : obj[m](...a, p);\n        } catch (err) {\n            console.warn('[OBS]', 'doCall erreur: ', err);\n            observer.error(err);\n        }\n    }).pipe(\n        timeout(3001000),\n        catchError(e => {\n            if (e instanceof TimeoutError) {\n                console.error(`[SPOTFIRE-WEBPLAYER] The call ${m}(${a.join(',')}) does not answer after 3001sec on ${JSON.stringify(obj)}`);\n            } else {\n                console.error('[SPOTFIRE-WEBPLAYER] ERROR on doCall', e);\n            }\n            return throwError(e);\n        }));\n};\n\nexport class SpotfireApplication {\n    readonly onApplicationReady$: Observable<boolean>;\n    private readySubject = new BehaviorSubject<boolean>(false);\n    private _app: any;\n\n    constructor(\n        public url: string,\n        public customization: Customization,\n        public path: string,\n        public parameters: string,\n        public reloadAnalysisInstance: boolean,\n        public version: string,\n        public onCreateLoginElement) {\n        this.onApplicationReady$ = this.readySubject.asObservable().pipe(filter(d => d));\n        this._app = new spotfire.webPlayer.createApplication(this.url,\n            this.customization, this.path, this.parameters, this.reloadAnalysisInstance,\n            this.version, this.onReadyCallback, this.onCreateLoginElement);\n    }\n\n    onOpened$ = () => doCall(this._app, 'onOpened');\n    getDocument$ = (id: string[], page: string | number, custo?: Customization): Observable<SpotfireDocument> => {\n        const doc = new SpotfireDocument(this, id, page, custo ? custo : this.customization);\n        return doc.init$(this);\n    };\n    openDocument = (id: string, page: string | number, custo: Customization) => this._app.openDocument(id, page, custo);\n\n    private onReadyCallback = (response, newApp: SpotfireApplication) => {\n        if (!!response && !!newApp) { // ignore undefined response\n            doConsole('Application.onReadyCallback', response, newApp);\n            this._app = newApp;\n            // Register an error handler to catch errors.\n            this._app?.onError(this.onErrorCallback);\n            if (response.status === 'OK') {\n                // The application is ready, meaning that the api is loaded and that the analysis path\n                // is validated for the current session(anonymous or logg ed in user)\n                this.readySubject.next(true);\n                this.readySubject.complete();\n            } else {\n                const errMsg = `Status not OK. ${response.status}: ${response.message}`;\n                console.error('[SPOTFIRE-WEBPLAYER] Application.onReadyCallback', errMsg, response);\n                this.readySubject.error(errMsg);\n            }\n        }\n    };\n    // Displays an error message if something goes wrong in the Web Player.\n    private onErrorCallback = (errCode: string, desc: string) => console.error(`[SPOTFIRE-WEBPLAYER] ${errCode}: ${desc}`);\n}\n","/*\n* Copyright (c) 2019-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\n\nimport { Injectable } from '@angular/core';\n\nimport { forkJoin, Observable } from 'rxjs';\nimport { delay, map, mergeMap, tap } from 'rxjs/operators';\n\nimport { LazyLoadingLibraryService } from './lazy-loading-library.service';\nimport { SpotfireCustomization } from './spotfire-customization';\nimport { SpotfireApplication, SpotfireDocument, SpotfireParameters } from './spotfire-webplayer';\n\ndeclare let spotfire: any;\n\n@Injectable({ providedIn: 'root' })\nexport class DocumentService {\n  debug = false;\n  constructor(private lazySvc: LazyLoadingLibraryService) { }\n\n  // eslint-disable-next-line no-console\n  doConsole = (...args: any[]) => this.debug && console.log('[DOCUMENT-SERVICE]', ...args);\n\n  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n  //\n  getMetadata$ = (params: SpotfireParameters): Observable<any> =>\n    this.openWebPlayer$(params).pipe(\n      mergeMap(doc => forkJoin([\n        doc.getDocumentMetadata$(),\n        doc.getData().getTables$(),\n        doc.getMarking().getMarkingNames$()])),\n      map(([metadata, tables, markings]) => ({ metadata, tables, markings })));\n\n  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n  //\n  openWebPlayer$(params: SpotfireParameters): Observable<SpotfireDocument> {\n    this.doConsole(`openWebPlayer(${params.domid}, ${params.url})`, params);\n\n    // lazy load the spotfire js API\n    //\n    const sfLoaderUrl = `${params.url}/spotfire/js-api/loader.js`;\n    return this.lazySvc.loadJs(sfLoaderUrl).pipe(\n      delay(1000),\n      tap(f => this.doConsole(`Spotfire ${sfLoaderUrl} is LOADED !!!`, params.domid, f, spotfire, params.page, params.customization)),\n      mergeMap(_ => this.openPath$(params)));\n  }\n\n  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n  //\n  openPath$(params: SpotfireParameters): Observable<SpotfireDocument> {\n    this.doConsole(`openPath(${params.path})`, params);\n    if (params.document) {\n      params.document.close();\n    }\n    // FIXTHIS, we might need to wait for onClosed callback\n    params.document = null;\n\n    // Prepare Spotfire app with path/page/customization\n    //\n    params.app = new SpotfireApplication(\n      params.url,\n      params.customization,\n      params.path,\n      params._parameters,\n      params.reloadAnalysisInstance,\n      params.version,\n      this.onCreateLoginElement);\n    /**\n     * Callback played once Spotfire API responds to Application creation\n     *\n     * Will open the target page\n     */\n    return params.app.onApplicationReady$.pipe(\n      tap(f => this.doConsole('onApplicationReady$ is done')),\n      mergeMap(_ => this.openPage$(params)));\n  }\n\n  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n  //\n  openPage$(params: SpotfireParameters, id?: string): Observable<SpotfireDocument> {\n\n    this.doConsole(`openPage(${params.page})`, params);\n\n    // Ask Spotfire library to display this path/page (with optional customization)\n    //\n    if (!params.app || !(params.app instanceof SpotfireApplication)) {\n      throw new Error('Spotfire webapp is not created yet');\n    }\n    //    const idDom = `is${new Date().getTime()}`;\n\n    this.doConsole('getDocument$', params.domid, `cnf=${params.page}`, params.app, params.document, params.customization);\n    // Here is the call to 'spotfire.webPlayer.createApplication'\n    //\n    if (params.document) {\n      this.doConsole(`SpotfireViewerComponent setActivePage(${params.page})`);\n      params.document.setActivePage(params.page, id);\n      return new Observable<SpotfireDocument>(o => {\n        o.next(params.document as SpotfireDocument);\n        o.complete();\n      });\n    }\n    return params.app.getDocument$([params.domid, ...params.externalDomIds], params.page, params.customization as SpotfireCustomization)\n      .pipe(\n        tap(doc => params.document = doc),\n        mergeMap(doc => doc.onDocumentReady$().pipe(\n          map(() => params.document as SpotfireDocument),\n          tap(f => this.doConsole('onDocumentReady$ is done', f)))\n        ));\n  }\n  /**\n   * @description\n   * Callback played if Spotfire requires some login\n   *\n   */\n\n  private onCreateLoginElement = () => {\n    this.doConsole('Creating the login element');\n    // Optionally create and return a div to host the login button\n    console.warn(`Cannot login`);\n    return null;\n  };\n\n  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n}\n","/*\n* Copyright (c) 2019-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\n\nexport class SpotfireCustomization {\n  showAbout = false;\n  showAnalysisInformationTool = false;\n  showAuthor = false; // this enable 'edit' button.\n  showClose = false;\n  showCustomizableHeader = false;\n  showDodPanel = false; // Details-on-Demand panel\n  showExportFile = false;\n  // showExportVisualization = false; marked as obsolete since Spotfire X\n  showFilterPanel = false;\n  showHelp = false;\n  showLogout = false;\n  showPageNavigation = false;\n  // showAnalysisInfo = false;  marked as obsolete since Spotfire X\n  /* showReloadAnalysis = false; marked as obsolete */\n  showStatusBar = false;\n  showToolBar = false;\n  showUndoRedo = false;\n  constructor(vars?: any) {\n    if (vars) {\n      Object.keys(vars).forEach(key => this[key] = vars[key]);\n    }\n  }\n}\n\nexport class SpotfireFilterSetting {\n  values: string[] = [];\n  lowValue = null;\n  highValue = null;\n  includeEmpty = true;\n  searchPattern = null;\n  hierarchyPaths = [];\n  constructor(vars?: any) {\n    if (vars) {\n      Object.keys(vars).forEach(key => this[key] = vars[key]);\n    }\n  }\n}\n\nexport class SpotfireFilter {\n  filteringSchemeName: string;\n  dataTableName: string;\n  dataColumnName: string;\n  filterType: string | any;\n  filterSettings: SpotfireFilterSetting | SpotfireFilterSetting[];\n  constructor(vars?: any) {\n    if (vars) {\n      Object.keys(vars).forEach(key => this[key] = vars[key]);\n    }\n  }\n  /*\n  setFilterType(s) {\n    console.log('ON SET LE TYPER', this.filterType);\n    if (this.filterType === 'ListBoxFilter') {\n      this.filterType = s.webPlayer.filterType.LIST_BOX_FILTER;\n      console.log('ON SET LE TYPE a ', s.webPlayer.filterType.LIST_BOX_FILTER);\n    }\n  }\n  */\n}\n","/*\n* Copyright (c) 2020-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { throwError, timer, Observable, Subject } from 'rxjs';\nimport { catchError, map, tap } from 'rxjs/operators';\n\nimport { SpotfireServer } from './spotfire-webplayer';\n\n@Injectable({\n  providedIn: 'root'\n})\n/**\n * @description\n * Provide a means to monitor the TIBCO Spotfire Server. This checks the server's status API to ensure the server is running.\n * An informative message may be presented using the results.\n */\nexport class SpotfireServerService {\n  spotfireServer: SpotfireServer = new SpotfireServer('', false);\n  monitoring = false;\n  debug = false;\n\n  /**\n   * @description\n   * An event emitted for subscribers to receive.\n   */\n  serverStatusEvent = new Subject<SpotfireServer>();\n\n  constructor(private http: HttpClient) { }\n\n  // eslint-disable-next-line no-console\n  doConsole = (...args: any[]) => this.debug && console.log('[SPOTFIRE-SERVER-SERVICE]', ...args);\n\n  isSpotfireServerOnline = () => this.spotfireServer.isOnline;\n\n  monitorSpotfireServerStatus(url: string) {\n    if (!this.monitoring) {\n      this.monitoring = true;\n      timer(0, 60000).pipe(map(() => this.getSpotfireServerStatus(url).subscribe())).subscribe();\n    }\n  }\n\n  getSpotfireServerStatus(url: string): Observable<SpotfireServer> {\n    this.spotfireServer.statusMessage = 'Attempting to determine server status.';\n    this.spotfireServer.serverUrl = url;\n    const statusUrl = this.getStatusUrl(url);\n    this.doConsole('getting spotfire server status from ' + statusUrl);\n    let headers = new HttpHeaders();\n    headers = headers.set('Content-Type', 'text/plain');\n    headers = headers.set('Accept', 'application/json');\n\n    return this.http.get<any>(statusUrl, { headers }).pipe(\n      catchError(err => this.handleError(err)),\n      tap(resp => {\n        this.doConsole('received response', resp, JSON.stringify(resp));\n        this.spotfireServer.isOnline = true;\n        this.getStatus(resp);\n        this.doConsole('emit success', JSON.stringify(this.spotfireServer));\n        this.serverStatusEvent.next(this.spotfireServer);\n      }),\n      map(r => {\n        this.doConsole('returning the object', this.spotfireServer);\n        return this.spotfireServer;\n      })\n    );\n  }\n\n  private getStatus(resp: any) {\n    this.doConsole('Trying to get the status from ', resp);\n    this.spotfireServer.statusMessage = `Server status received ${resp}`;\n    this.doConsole('spotfire server status ', resp.status, resp.status === 200, JSON.stringify(this.spotfireServer));\n  }\n\n  private handleError(err: any): Observable<any> {\n    this.doConsole('caught an error' + JSON.stringify(err));\n    this.spotfireServer.isOnline = false;\n    if (err.status === 0) {\n      this.spotfireServer.statusMessage = 'Status code zero returned. Possible untrusted access.';\n    } else {\n      this.spotfireServer.statusMessage = 'An error occurred checking TIBCO Spotfire Server status';\n    }\n    this.serverStatusEvent.next(this.spotfireServer);\n    return throwError('an error');\n  }\n\n  private getStatusUrl = (url: string) => `${url}/spotfire/rest/status/getStatus`;\n}\n","/*\n* Copyright (c) 2019-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\nimport {\n  Component, ElementRef, EventEmitter, Input,\n  OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation\n} from '@angular/core';\n\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { debounceTime, tap } from 'rxjs/operators';\n\nimport { DocumentService } from '../document.service';\nimport { SpotfireCustomization, SpotfireFilter } from '../spotfire-customization';\nimport { SpotfireServerService } from '../spotfire-server.service';\nimport {\n  SpotfireDocument, SpotfireDocumentMetadata, SpotfireFiltering, SpotfireParameters, SpotfireReporting, SpotfireServer\n} from '../spotfire-webplayer';\n\n// https://community.tibco.com/wiki/tibco-spotfire-javascript-api-overview\n// https://community.tibco.com/wiki/mashup-example-multiple-views-using-tibco-spotfire-javascript-api\n\ndeclare let spotfire: any;\nconst DEFAULT_VERSION = '7.14';\n\n@Component({\n  selector: 'spotfire-viewer',\n  exportAs: 'spotfireViewer',\n  templateUrl: 'spotfire-viewer.component.html',\n  encapsulation: ViewEncapsulation.None\n})\n\nexport class SpotfireViewerComponent implements OnChanges, OnInit {\n  /**\n   * @description\n   * Optional. Load parameters for the analysis.\n   */\n  @Input() parameters: string;\n\n  /**\n   * @description\n   * print debug logs to JS console. Default to false\n   */\n  @Input() debug = false;\n\n  /**\n   * @description\n   * The URL to the Web Player server\n   */\n  @Input() url: string;\n\n  /**\n   * @description\n   * The path in the library to the analysis to open.\n   */\n  @Input() path: string;\n\n  /**\n   * @description\n   * Optional initial page. The page can either be expressed\n   * as an integer (0-based page index) or as a string (page name).\n   */\n  @Input() page: string;\n\n  /**\n   * @description\n   * Optional unique id to read/write settings from local storage\n   */\n  @Input() sid: string;\n\n  /**\n   * @description\n   * Optional version to customize the version used when requesting the Spotfire JavaScript API.\n   * Defaults to 7.14.\n   */\n\n  @Input() version = DEFAULT_VERSION;\n\n  /**\n   * @description\n   * Optional instance of a Customization instance.\n   * If set, this will override the customizationInfo instance held by the application.\n   */\n  @Input() customization: SpotfireCustomization | string;\n\n  /**\n   * @description\n   * Optional. Array of filters that will be applied once page is loaded.\n   */\n\n  @Input() markingOn: any | string;\n  @Input() maxRows = 10;\n\n  /**\n   * @description\n   * Optional; an array of element id's (div id's), where the spotfire report will be displayed on as well.\n   * If set, the report is displayed multiple times and the reports are linked.\n   */\n  @Input() linkedReportIds: string[];\n\n  @ViewChild('spot', { static: true, read: ElementRef }) spot: ElementRef;\n\n  /**\n   * @description\n   * Optional. emit filters set by user in dashboard\n   */\n  @Output() filteringEvent: EventEmitter<any> = new EventEmitter(false);\n  /**\n   * @description\n   * Optional. emit marking set by user in dashboard\n   */\n  @Output() markingEvent: EventEmitter<any> = new EventEmitter(false);\n\n  /**\n   * @description\n   * Optional. emit an instance of a SpotfireReporting whenever a new page it ready\n   * Following methods are available based on returned instance:\n   *  - print()\n   *  - exportToPowerPoint()\n   *  - exportToPdf()\n   *  - exportReport(reportName)\n   *  - getReports(callback)\n   *  - exportActiveVisualAsImage(width, height)\n   */\n  @Output() reporting: EventEmitter<SpotfireReporting> = new EventEmitter();\n\n  /**\n   * @description\n   * Optional. emit an instance of a Filtering whenever a new page it ready\n   * Following methods are available based on returned instance:\n   *  - getFilteringScheme(filteringSchemeName)\n   *  - getFilteringSchemes()\n   *  - getActiveFilteringScheme()\n   */\n  @Output() filtering: EventEmitter<SpotfireFiltering> = new EventEmitter();\n  @Output() document: EventEmitter<SpotfireDocument> = new EventEmitter();\n\n  /**\n   * @description\n   * Optional. Emit an instance of a SpotfireServer whenever TIBCO Spotfire Server status is available.\n   */\n  @Output() serverStatusEvent: EventEmitter<SpotfireServer> = new EventEmitter();\n\n  /** List of error messages seen so far */\n  errorMessages = [];\n\n  /* metadata contains Information about the Spotfire analysis */\n  metadata: SpotfireDocumentMetadata;\n  edit = false;\n\n  view: any;\n  longTime = false;\n\n  readonly filter$: Observable<any[]>;\n  readonly marker$: Observable<any>;\n\n  protected spotParams: SpotfireParameters = new SpotfireParameters();\n  private _filters: SpotfireFilter[];\n  private _document: SpotfireDocument;\n  /* Filtering observables, emitter and subject*/\n  private filterSubject = new BehaviorSubject<any[]>([]);\n\n  /* Marking observables, emitter and subject*/\n  private markerSubject = new BehaviorSubject<any>({});\n  private markedRows = {};\n\n  constructor(public docSvc: DocumentService, private spotfireServerSvc: SpotfireServerService) {\n    this.filter$ = this.filterSubject.asObservable();\n    this.marker$ = this.markerSubject.asObservable();\n    this.doConsole('Welcome to Wrapper for TIBCO Spotfire(R)!');\n    setTimeout(() => this.longTime = true, 6000);\n  }\n\n  @Input() set filters(value: SpotfireFilter[] | string) {\n    if (typeof value === 'string') {\n      const allFilters: SpotfireFilter[] = [];\n      JSON.parse(value).forEach((m: SpotfireFilter) => allFilters.push(new SpotfireFilter(m)));\n      this._filters = allFilters;\n    } else {\n      this._filters = value as SpotfireFilter[];\n    }\n    this.setFilters();\n  }\n\n  ngOnInit(): void {\n    if (!this.version || this.version === '') {\n      this.version = DEFAULT_VERSION;\n    }\n    // this.doConsole('OnInit', this.url, this.path, this.version);\n    // this.display();\n  }\n\n  ngOnChanges(changes: SimpleChanges) {\n    if (changes?.debug) {\n      this.docSvc.debug = this.debug;\n      this.spotfireServerSvc.debug = this.debug;\n    }\n    if (!!changes) {\n      this.display(changes);\n    }\n  }\n\n  // eslint-disable-next-line no-console\n  doConsole = (...args: any[]) => this.debug && console.log('[SPOTFIRE-VIEWER]', ...args);\n\n  /**\n   * @description\n   * Redraw the dashboard.\n   * Depending on nature of change (url/path/page) the dashboard is fully refreshed or adjusted accordingly\n   * @param changes The list of changes to apply\n   */\n\n  display(changes?: SimpleChanges) {\n    this.doConsole('Display', changes);\n    if (this.isMonitorWiredUp) {\n      this.doConsole('Listen for Spotfire Server status changes');\n      this.spotfireServerSvc.monitorSpotfireServerStatus(this.url);\n      this.spotfireServerSvc.serverStatusEvent.subscribe((e: SpotfireServer) => {\n        this.doConsole('SPOTFIRE-SERVER-SERVICE received event ' + JSON.stringify(e));\n        this.serverStatusEvent.emit(e);\n      });\n    }\n\n    if (typeof this.customization === 'string') {\n      this.customization = new SpotfireCustomization(JSON.parse(this.customization));\n    } else {\n      this.customization = new SpotfireCustomization(this.customization);\n    }\n\n    if (typeof this._filters === 'string') {\n      const allFilters: SpotfireFilter[] = [];\n      JSON.parse(this._filters).forEach((m: SpotfireFilter) => allFilters.push(new SpotfireFilter(m)));\n      this._filters = allFilters;\n    }\n    if (typeof this.markingOn === 'string' && this.markingOn !== '*') {\n      this.markingOn = JSON.parse(this.markingOn);\n    }\n\n    this.doConsole('display', changes, this.url, this.version, this.path, this.page, this.customization, this.maxRows, this.markingOn);\n\n    if (!changes || !!changes.url) {\n      this.openWebPlayer(this.url, this.path, this.customization);\n    } else if (this.spotParams?.app && !!changes.path) {\n      this.openPath(this.path);\n    } else if (this.spotParams?.app && !!changes.page) {\n      this.openPage(this.page);\n    } else {\n      this.doConsole(`The Url attribute is not provided, flip the dashboard and display form!`);\n      this.edit = true;\n      this.metadata = new SpotfireDocumentMetadata();\n    }\n  }\n\n  stopPropagation = (e: Event) => e.stopPropagation();\n\n  /**\n   * @description\n   * Open the Document page\n   *\n   * @param page the document page that will be displayed\n   */\n  openPage(page: string, id?: string) {\n    this.displayInfoMessage(`${this.url}/${this.path}/${page ? page : ''}...`);\n    this.doConsole(`SpotfireViewerComponent openPage(${page})`);\n    this.page = page;\n    this.spotParams = { ...this.spotParams, page };\n    const p = this.spotParams;\n    if (this.parameters !== '') {\n      this.spotParams._parameters = this.parameters;\n    }\n    this.docSvc.openPage$(p, id).subscribe((doc) => {\n      if (!id) {\n        this.afterDisplay(doc);\n      }\n    });\n  }\n\n  /**\n   * @description\n   * Get Spotfire JavaScript API (webPlayer) from url\n   *\n   * When a componenet is initiated or url is updated, it lazy loads the library\n   * Once loaded it opens the path.\n   *\n   * @param url the webPlayer server url\n   * @param path the path to the page\n   * @param custo the initial customization info\n   */\n  protected openWebPlayer(url: string, path: string, customization: SpotfireCustomization) {\n    this.edit = false;\n    this.url = url;\n    this.path = path;\n    this.customization = customization;\n    if (!this.linkedReportIds) {\n      this.linkedReportIds = [];\n    }\n    this.doConsole(`SpotfireViewerComponent openWebPlayer(${url})`);\n\n    this.displayInfoMessage(`${this.url}...`);\n\n    // Create a Unique ID for this Spotfire dashboard\n    //\n    this.spot.nativeElement.id = this.sid ? this.sid : new Date().getTime();\n    this.spotParams = {\n      ...this.spotParams,\n      path, url,\n      customization,\n      version: this.version,\n      domid: this.spot.nativeElement.id,\n      externalDomIds: this.linkedReportIds,\n      page: this.page,\n      _parameters: this.parameters\n    };\n\n    this.docSvc.openWebPlayer$(this.spotParams).subscribe(\n      doc => this.afterDisplay(doc),\n      err => this.displayErrorMessage(err));\n\n  }\n\n  /**\n   * @description\n   * Open the path using JavaScript API (spotfire.webPlayer.createApplication)\n   *\n   * @param path the absolute analysis path\n   */\n  protected openPath(path: string) {\n    this.path = path;\n    this.displayInfoMessage(`${this.url}/${path}...`);\n    this.doConsole(`SpotfireViewerComponent openPath(${path})`, this.sid);\n    this.spotParams = { ...this.spotParams, path, domid: this.spot.nativeElement.id };\n\n    if (this.parameters !== '') {\n      this.spotParams._parameters = this.parameters;\n    }\n\n    this.docSvc.openPath$(this.spotParams).subscribe(\n      doc => this.afterDisplay(doc),\n      err => this.displayErrorMessage(err));\n  }\n\n  /**\n   * @description\n   * Display error message in the DOM content of the spotfire-wrapper\n   * This function can be overriden\n   * @param message error message to be displayed\n   */\n  protected displayErrorMessage = (message: string) => {\n    console.error('ERROR:', message);\n    this.errorMessages.push(message);\n    if (!this.spotParams.document) {\n      // Do not display the info Message when document is running\n      this.spot.nativeElement.style.fontFamily = 'monospace';\n      this.spot.nativeElement.style.color = '#e82127';\n      this.spot.nativeElement.style.textAlign = 'center';\n      this.spot.nativeElement.style.padding = '30px';\n      this.spot.nativeElement.textContent = this.errorMessages.join('<br>');\n    }\n  };\n\n  /**\n   * @description\n   * Display info message if debug mode is set in the DOM content of the spotfire-wrapper\n   * This function can be overriden\n   * @param message INfo message to be displayed\n   */\n  protected displayInfoMessage = (message: string) => {\n    // console.log(message);\n    if (!this.spotParams.document && this.debug) {\n      // Do not display the info Message when document is running\n      this.spot.nativeElement.style.fontFamily = 'monospace';\n      this.spot.nativeElement.style.color = 'black';\n      this.spot.nativeElement.style.textAlign = 'center';\n      this.spot.nativeElement.textContent = message;\n    }\n  };\n\n  private isMarkingWiredUp = () => this.markingEvent.observers.length > 0;\n  private isFiltingWiredUp = () => this.filteringEvent.observers.length > 0;\n  private isFilteringWiredUp = () => this.filtering.observers.length > 0;\n  private isReportingWiredUp = () => this.reporting.observers.length > 0;\n  private isDocumentWiredUp = () => this.document.observers.length > 0;\n  private isMonitorWiredUp = () => this.serverStatusEvent.observers.length > 0;\n\n  private afterDisplay = (doc: SpotfireDocument) => {\n    this.doConsole(`SpotfireViewerComponent afterDisplay`, doc, ', filters:', this._filters, ', markingON', this.markingOn);\n    this._document = doc;\n    this.setFilters();\n\n    if (this.isReportingWiredUp()) {\n      this.doConsole(`we have observers for reportingEvent`);\n      const report = new SpotfireReporting(this._document);\n      this.reporting.emit(report);\n    }\n    if (this.isDocumentWiredUp()) {\n      this.doConsole(`we have observers for document`);\n      if (this._document) {\n        this.document.emit(this._document);\n      }\n    }\n    if (this.isFilteringWiredUp()) {\n      this.doConsole('we have observers for filtering');\n      this.filtering.emit(this._document.getFiltering());\n    }\n\n    if (this.markingOn) {\n      // Clear marking\n      this.markerSubject.next({});\n      this.doConsole(`SpotfireViewerComponent afterDisplay has markingOn=`, this.markingOn);\n      const data = this._document.getData();\n      if (data === undefined) {\n        console.warn('[SpotfireViewerComponent] document getData() contains', data);\n      } else {\n        data.getTables$()\n          .pipe(tap(allTableNames => this.doConsole(`All tables and column names:`, allTableNames)))\n          .subscribe(allTableNames => this._document.getMarking().getMarkingNames$()\n            .pipe(tap(markingNames => this.doConsole(`All marking names:`, markingNames)))\n            .subscribe(markingNames => markingNames.forEach(markingName => {\n              const tableNames = this.markingOn === '*' ? allTableNames : this.markingOn;\n              Object.keys(tableNames).forEach(tName => {\n                let columnNames: string[] = this.markingOn === '*' ? allTableNames[tName] : tableNames[tName];\n                if (columnNames.length === 1 && columnNames[0] === '*') {\n                  columnNames = allTableNames[tName];\n                }\n                this.doConsole(`marking.onChanged(${markingName}, ${tName}, ${JSON.stringify(columnNames)}, ${this.maxRows})`);\n                this._document.getMarking().onChanged$(markingName, tName, columnNames, this.maxRows)\n                  .subscribe(f => this.updateMarking(tName, markingName, f));\n              });\n            })));\n      }\n    }\n    if (this.isFiltingWiredUp()) {\n      this.doConsole('we have observers for filteringEvent');\n      // Subscribe to filteringEvent and emit the result to the Output if filter panel is displayed\n      //\n      this.filter$.pipe(debounceTime(500), tap(f => this.doConsole('Emit filteringEvent', f)))\n        .subscribe(f => this.filteringEvent.emit(f));\n    }\n\n    if (this.isMarkingWiredUp()) {\n      this.doConsole('we have observers for markingEvent');\n      // Subscribe to markingEvent and emit the result to the Output\n      //\n      this.marker$.pipe(debounceTime(500), tap(f => this.doConsole('Emit markingEvent', f)))\n        .subscribe(f => this.markingEvent.emit(f));\n    }\n    // console.log('YES loadFilters');\n    // setInterval(() => this.loadFilters(), 3000);\n\n  };\n\n  private setFilters() {\n    if (this._document && this._filters && this._document.getFiltering()) {\n      const flt = this._document.getFiltering();\n      flt.resetAllFilters();\n      flt.setFilters(this._filters);\n      this.loadFilters();\n      this.doConsole('setFilters', this._filters);\n    }\n  }\n\n  /**\n   * @description\n   * Callback method played when marking changes are detected.\n   *\n   * Will gather all marking and emit an event back to caller.\n   *\n   * @param tName Table name\n   * @param mName Maring name\n   * @param res marked rows returned by Spotfire\n   */\n  private updateMarking = (tName: string, mName: string, res: any) => {\n    if (Object.keys(res).length > 0) {\n      this.doConsole(`We have marked rows on marking '${mName}' for table '${tName}':`, res);\n      // update the marked row if partial selection\n      //\n      if (!this.markedRows[mName]) {\n        this.markedRows[mName] = {};\n      }\n      if (!this.markedRows[mName][tName]) {\n        this.markedRows[mName][tName] = res;\n      } else {\n        this.markedRows[mName][tName] = Object.assign(this.markedRows[mName][tName], res);\n      }\n      //   this.doConsole('[MARKING] on publie', this.markedRows);\n      this.markerSubject.next(this.markedRows);\n    } else if (this.markedRows[mName] && this.markedRows[mName][tName]) {\n      // remove the marked row if no marking\n      //\n      delete this.markedRows[mName][tName];\n      if (Object.keys(this.markedRows[mName]).length === 0) {\n        delete this.markedRows[mName];\n      }\n      this.markerSubject.next(this.markedRows);\n    } else {\n      //  this.doConsole(`No rows are marked on marking '${mName}' for table '${tName}'`);\n    }\n    this.loadFilters();\n  };\n\n  /**\n   * @description\n   * Emit to caller the filters\n   */\n  private loadFilters() {\n    //  console.log('AA Nicolas loadFilters BLOUP ! (19 juin 2019)');\n    if (this.isFiltingWiredUp()) {\n      this._document.getFiltering().getAllModifiedFilterColumns$()\n        .subscribe(fs => this.filterSubject.next(fs));\n    }\n    //    this.document.getFiltering().getAllModifiedFilterColumns()\n    //      .subscribe(fs => console.log('les FILTERS:', fs));\n  }\n}\n","<!--\n  Copyright (c) 2019. TIBCO Software Inc.\n  This file is subject to the license terms contained\n  in the license file that is distributed with this file.\n-->\n<div style='height:100%' #spot></div>","/*\n* Copyright (c) 2019-2020. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\n\n// https://medium.com/@tomsu/how-to-build-a-library-for-angular-apps-4f9b38b0ed11\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\n\nimport { SpotfireViewerComponent } from './spotfire-viewer.component';\n\n@NgModule({\n  imports: [CommonModule, HttpClientModule],\n  declarations: [SpotfireViewerComponent],\n  exports: [SpotfireViewerComponent]\n})\nexport class SpotfireViewerModule { }\n","/*\n* Copyright (c) 2019-2021. TIBCO Software Inc.\n* This file is subject to the license terms contained\n* in the license file that is distributed with this file.\n*/\n\n/*\n * Public API Surface of spotfire-wrapper\n */\n\nimport {SpotfireFilter, SpotfireFilterSetting} from './lib/spotfire-customization';\n\nexport * from './lib/viewer/spotfire-viewer.component';\nexport * from './lib/viewer/spotfire-viewer.module';\nexport { DocumentService } from './lib/document.service';\nexport {\n  SpotfireApplication,\n  SpotfireDocument,\n  SpotfireDocumentMetadata,\n  SpotfireFiltering,\n  SpotfireParameters,\n  SpotfireProperty,\n  SpotfireReporting,\n  SpotfireServer\n} from './lib/spotfire-webplayer';\nexport { SpotfireFilterSetting, SpotfireFilter, SpotfireCustomization } from './lib/spotfire-customization';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["observableOf","i1.LazyLoadingLibraryService","i1.DocumentService","i2.SpotfireServerService"],"mappings":";;;;;;;;AAAA;;;;AAIE;MAUW,yBAAyB,CAAA;AAGpC,IAAA,WAAA,CAA+C,QAAa,EAAA;QAAb,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAK;QAFpD,IAAe,CAAA,eAAA,GAA2C,EAAE,CAAC;KAEJ;AAEjE,IAAA,MAAM,CAAC,GAAW,EAAA;AAChB,QAAA,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE;YAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC;AACjD,SAAA;QAED,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,IAAI,aAAa,EAAE,CAAC;QAEhD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACrD,QAAA,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC;AAChC,QAAA,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;AACjB,QAAA,MAAM,CAAC,MAAM,GAAG,MAAK;YACnB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;AACvC,SAAC,CAAC;AACF,QAAA,MAAM,CAAC,OAAO,GAAG,MAAK;AACpB,YAAA,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,CAAA,gBAAA,CAAkB,CAAC,CAAC;AAChD,YAAA,IAAI,CAAC,eAAe,CAAC,G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