'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-1276587e.js');

const img = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik00MjQsNjRIODhjLTI2LjYsMC00OCwyMS42LTQ4LDQ4djI4OGMwLDI2LjQsMjEuNCw0OCw0OCw0OGgzMzZjMjYuNCwwLDQ4LTIxLjYsNDgtNDhWMTEyQzQ3Miw4NS42LDQ1MC42LDY0LDQyNCw2NHoKCSBNNDI0LDQwMEg4OFYxNzZoMzM2VjQwMHoiLz4KPHBhdGggZD0iTTIwMi42LDI4Ni40bC01OC4zLDU4LjNjLTIuOCwyLjgtNy40LDIuOC0xMC4yLDBsLTYuOC02LjhjLTIuOC0yLjgtMi44LTcuNCwwLTEwLjJsNDYuMi00Ni40bC00Ni4yLTQ2LjQKCWMtMi44LTIuOC0yLjgtNy40LDAtMTAuMmw2LjgtNi44YzIuOC0yLjgsNy40LTIuOCwxMC4yLDBsNTguMyw1OC4zQzIwNS40LDI3OSwyMDUuNCwyODMuNiwyMDIuNiwyODYuNHogTTM0My4yLDM0MS4zdi05LjYKCWMwLTQtMy4y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ii8+PC9nPjxnPjxwYXRoIGQ9Ik0zMiA5NmgyNzJ2MzJIMzJ6TTQwMCA5Nmg4MHYzMmgtODB6TTM4NCAxNTkuNWMwIDE3Ljk0OS0xNC4zMjcgMzIuNS0zMiAzMi41LTE3LjY3MyAwLTMyLTE0LjU1MS0zMi0zMi41di05NWMwLTE3Ljk0OSAxNC4zMjctMzIuNSAzMi0zMi41IDE3LjY3MyAwIDMyIDE0LjU1MSAzMiAzMi41djk1eiIvPjwvZz48L3N2Zz4=';

const img$3 = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNNDAzLjAwMiAyMTcuMDAxQzM4OC45OTggMTQ4LjAwMiAzMjguOTk4IDk2IDI1NiA5NmMtNTcuOTk4IDAtMTA3Ljk5OCAzMi45OTgtMTMyLjk5OCA4MS4wMDFDNjMuMDAyIDE4My4wMDIgMTYgMjMzLjk5OCAxNiAyOTZjMCA2NS45OTYgNTMuOTk5IDEyMCAxMjAgMTIwaDI2MGM1NSAwIDEwMC00NSAxMDAtMTAwIDAtNTIuOTk4LTQwLjk5Ni05Ni4wMDEtOTIuOTk4LTk4Ljk5OXpNMjg4IDI3NnY3NmgtNjR2LTc2aC02OGwxMDAtMTAwIDEwMCAxMDBoLTY4eiIvPjwvc3ZnPg==';

const Scroll = (props, children) => (core.h("div", { style: {
        "overflow-y": "auto",
        width: "100%",
        "min-height": "0",
        "max-height": "100%",
        height: props.height
    } }, children));

var console = "Console";
var graph = "Nodes";
var settings = "Settings";
var src = "Source";
const i18n = {
	console: console,
	graph: graph,
	settings: settings,
	src: src
};

const AlSettings = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this._contentStrings = i18n;
        this.angles = null;
        this.consoleTabEnabled = true;
        this.edges = null;
        this.graphTabEnabled = true;
        this.nodes = null;
        this.selected = null;
        this.settingsTabEnabled = true;
        this.srcTabEnabled = true;
        this.tabContentHeight = null;
        this.url = null;
        this.urls = null;
    }
    _getGraphJson() {
        if (this.nodes && this.edges && this.angles) {
            const graph = {
                nodes: Array.from(this.nodes),
                edges: Array.from(this.edges),
                angles: Array.from(this.angles)
            };
            return JSON.stringify(graph);
        }
        return "";
    }
    render() {
        const tabContentHeight = this.tabContentHeight || this.el.parentElement.clientHeight + "px";
        const numTabsEnabled = [
            this.consoleTabEnabled,
            this.graphTabEnabled,
            this.settingsTabEnabled,
            this.srcTabEnabled
        ].filter(Boolean).length;
        return (core.h("ion-app", null, core.h("al-tabs", null, numTabsEnabled > 1 ? (core.h("ion-tab-bar", null, this.srcTabEnabled ? (core.h("ion-tab-button", { tab: "src" }, core.h("ion-icon", { src: img$3 }), core.h("ion-label", null, this._contentStrings.src))) : null, this.settingsTabEnabled ? (core.h("ion-tab-button", { tab: "settings" }, core.h("ion-icon", { src: img$2 }), core.h("ion-label", null, this._contentStrings.settings))) : null, this.graphTabEnabled ? (core.h("ion-tab-button", { tab: "graph" }, core.h("ion-icon", { src: img$1 }), core.h("ion-label", null, this._contentStrings.graph))) : null, this.consoleTabEnabled ? (core.h("ion-tab-button", { tab: "console" }, core.h("ion-icon", { src: img }), core.h("ion-label", null, this._contentStrings.console))) : null)) : null, this.srcTabEnabled ? (core.h("ion-tab", { tab: "src" }, core.h("al-url-picker", { urls: this.urls, url: this.url }))) : null, this.settingsTabEnabled ? (core.h("ion-tab", { tab: "settings" }, core.h(Scroll, { height: tabContentHeight }, core.h("al-settings", { "bounding-box-enabled": this.boundingBoxEnabled, "controls-type": this.controlsType, "display-mode": this.displayMode, "graph-enabled": this.graphEnabled, "graph-visible": this.graphTabEnabled, orientation: this.orientation, "slices-index": this.slicesIndex, "slices-max-index": this.slicesMaxIndex, "slices-brightness": this.slicesBrightness, "slices-contrast": this.slicesContrast, "volume-brightness": this.volumeBrightness, "volume-contrast": this.volumeContrast, "volume-steps": this.volumeSteps, "volume-steps-high-enabled": this.volumeStepsHighEnabled, units: this.units })))) : null, this.graphTabEnabled ? (core.h("ion-tab", { tab: "graph" }, core.h(Scroll, { height: tabContentHeight }, core.h("al-graph-editor", { selected: this.selected, nodes: this.nodes, angles: this.angles, edges: this.edges })))) : null, this.consoleTabEnabled ? (core.h("ion-tab", { tab: "console" }, core.h(Scroll, { height: tabContentHeight }, core.h("al-console", { graph: this._getGraphJson() })))) : null)));
    }
    get el() { return core.getElement(this); }
    static get style() { return "al-tabs {\n  --ion-tab-bar-border-color: var(--al-item-border-color);\n}"; }
};

exports.al_control_panel = AlSettings;
