var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, Host, Element, h, Event, Prop, Watch, State } from '@stencil/core';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, } from 'vega-slimmer/core';
import { TranslationSlimmer } from '../../../../../helpers/slimmers/translation';
import { sanitizeVegaComponent } from '../../../../../utils/component';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../../../../helpers/slimmers/component-usage-runtime-metrics';
import { VegaRichTextTablePropertiesRenderer } from './slimmers/renderers/vega-rich-text-table-properties-form-renderer';
import { ChildNodesEventPreventSlimmer } from '../../../../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
import { VegaChange } from '../../../../../helpers/event-manager/event-id/vega-event-id';
import { TableColorController } from './slimmers/controllers/vega-rich-text-table-properties-color-controller';
import { VegaRichTextTablePropertiesFormFieldRenderer } from './slimmers/renderers/vega-rich-text-table-properties-form-field-renderer';
import { VegaRichTextCellPropertiesFormFieldRenderer } from './slimmers/renderers/vega-rich-text-cell-properties-form-field-renderer';
import { VegaInternalThemeManager } from '../../../../../helpers/theme/internal-theme-manager';
import { DarkModeStateControllerSlimmer } from '../../../../../helpers/slimmers/dark-mode-state-controller-slimmer';
/**
 * @vegaVersion 2.79.0
 */
export class VegaRichTextTableProperties {
  constructor() {
    this.globalSlimmers = {};
    this.translationSlimmer = new TranslationSlimmer();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    this.renderer = new VegaRichTextTablePropertiesRenderer();
    this.tableFormRenderer = new VegaRichTextTablePropertiesFormFieldRenderer();
    this.cellFormRenderer = new VegaRichTextCellPropertiesFormFieldRenderer();
    this.controller = new TableColorController();
    this.darkModeStateSlimmer = new DarkModeStateControllerSlimmer();
    this.changeEventPreventSlimmer = new ChildNodesEventPreventSlimmer([VegaChange], () => this.renderer.getFormRef());
    this.isInDarkMode = VegaInternalThemeManager.isDarkMode();
    /**
     * @vegaVersion 2.79.0
     */
    this.type = 'TABLE';
    /**
     * @vegaVersion 2.79.0
     */
    this.colors = [];
  }
  watchDefaultValueChange(newValue) {
    methodPlaceholder(newValue);
  }
  render() {
    return sanitizeVegaComponent(h(Host, null, this.renderer.render()), this.host);
  }
  static get is() { return "vega-rich-text-table-properties"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-rich-text-table-properties.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-rich-text-table-properties.css"]
  }; }
  static get properties() { return {
    "defaultValue": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "RTETablePropertiesType",
        "resolved": "{ width?: string; height?: string; borderStyle?: string; borderColor?: string; borderWidth?: string; textAlign?: \"left\" | \"right\" | \"center\" | \"justify\"; backgroundColor?: string; verticalAlign?: \"top\" | \"bottom\" | \"middle\"; padding?: string; }",
        "references": {
          "RTETablePropertiesType": {
            "location": "import",
            "path": "../../../interface"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": ""
      }
    },
    "styleMap": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "TableCellStylePropertiesMap",
        "resolved": "{ [x: string]: RTETablePropertiesType; }",
        "references": {
          "TableCellStylePropertiesMap": {
            "location": "import",
            "path": "../../../interface"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": "The origin style map for multiple selected blocks.\nThe key is the block ID, and the value is the style object for that block."
      }
    },
    "type": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "'TABLE' | 'CELL'",
        "resolved": "\"CELL\" | \"TABLE\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": ""
      },
      "attribute": "type",
      "reflect": true,
      "defaultValue": "'TABLE'"
    },
    "colors": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "VegaRTEColorSchema[]",
        "resolved": "VegaRTEColorSchema[]",
        "references": {
          "VegaRTEColorSchema": {
            "location": "import",
            "path": "../../../interface"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": ""
      },
      "defaultValue": "[]"
    }
  }; }
  static get states() { return {
    "isInDarkMode": {}
  }; }
  static get events() { return [{
      "method": "vegaChange",
      "name": "vegaChange",
      "bubbles": false,
      "cancelable": true,
      "composed": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": ""
      },
      "complexType": {
        "original": "RTETablePropertiesType",
        "resolved": "{ width?: string; height?: string; borderStyle?: string; borderColor?: string; borderWidth?: string; textAlign?: \"left\" | \"right\" | \"center\" | \"justify\"; backgroundColor?: string; verticalAlign?: \"top\" | \"bottom\" | \"middle\"; padding?: string; }",
        "references": {
          "RTETablePropertiesType": {
            "location": "import",
            "path": "../../../interface"
          }
        }
      }
    }, {
      "method": "vegaCancel",
      "name": "vegaCancel",
      "bubbles": false,
      "cancelable": true,
      "composed": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": ""
      },
      "complexType": {
        "original": "RTETablePropertiesType",
        "resolved": "{ width?: string; height?: string; borderStyle?: string; borderColor?: string; borderWidth?: string; textAlign?: \"left\" | \"right\" | \"center\" | \"justify\"; backgroundColor?: string; verticalAlign?: \"top\" | \"bottom\" | \"middle\"; padding?: string; }",
        "references": {
          "RTETablePropertiesType": {
            "location": "import",
            "path": "../../../interface"
          }
        }
      }
    }, {
      "method": "vegaSave",
      "name": "vegaSave",
      "bubbles": false,
      "cancelable": true,
      "composed": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.79.0"
          }],
        "text": ""
      },
      "complexType": {
        "original": "unknown",
        "resolved": "unknown",
        "references": {}
      }
    }]; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "defaultValue",
      "methodName": "watchDefaultValueChange"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaRichTextTableProperties.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "translationSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "tableFormRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "cellFormRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "controller", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "darkModeStateSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextTableProperties.prototype, "changeEventPreventSlimmer", void 0);
