text: import{html,Polymer}from"../../../@polymer/polymer/polymer-legacy.js";import"../../../@polymer/paper-toggle-button/paper-toggle-button.js";import"../../../@polymer/paper-card/paper-card.js";import"../../../@polymer/paper-tabs/paper-tabs.js";import"../../../@polymer/paper-tabs/paper-tab.js";import"../../../@polymer/paper-button/paper-button.js";import"../../../@polymer/paper-input/paper-textarea.js";import"../../../@polymer/iron-icons/iron-icons.js";import"../../eco-json-schema-form/eco-json-schema-form.js";import"../../eco-json-schema-form/lib/eco-json-schema-object.js";import"../../code-editor/code-editor.js";import"../../app-datepicker/app-datepicker.js";import"../../simple-picker/simple-picker.js";import"../../simple-icon-picker/simple-icon-picker.js";import"../../simple-colors/lib/simple-colors-picker.js";import"../../paper-input-flagged/paper-input-flagged.js";import"../../simple-colors/simple-colors.js";import"./hax-shared-styles.js";Polymer({_template:html`
      <style include="simple-colors hax-shared-styles">
        :host {
          display: block;
          background-color: #ffffff;
          overflow: hidden;
        }
        paper-card.form-wrapper {
          margin: 0;
          padding: 0 16px 80px 16px;
          width: 100%;
          min-height: 160px;
          background-color: transparent;
          overflow: auto;
          height: 100%;
        }
  
        eco-json-schema-object {
          width: 50%;
        }
        #form {
          --eco-json-schema-object-form: {
            display: block !important;
          }
        }
  
        #modetabs {
          height: 64px;
          padding: 0px;
          margin: 16px 0 0 0;
          box-sizing: content-box;
          color: var(--hax-color-text);
          text-align: center;
          background-color: transparent;
          border-bottom: 1px solid var(--hax-color-border-outline);
          display: block;
          justify-content: space-evenly;
          --paper-tabs-selection-bar-color: var(--hax-color-accent1);
          --paper-tabs: {
            background: transparent;
          }
        }
  
        #modetabs paper-tab {
          display: inline-flex;
          height: 100%;
          --paper-tab-ink: var(--hax-color-accent1);
          --paper-tab: {
            font-size: 16px;
          }
        }
        #modetabs paper-tab paper-button {
          min-width: unset;
          width: 100%;
          background-color: var(--hax-color-accent1);
          color: var(--hax-color-accent1-text);
        }
        eco-json-schema-object {
          color: var(--hax-text-color);
          --eco-json-schema-object-form : {
            -ms-flex: unset;
            -webkit-flex: unset;
            flex: unset;
            -webkit-flex-basis: unset;
            flex-basis: unset;
          }
        }
      </style>
      <paper-tabs
        id="modetabs"
        selected="{{modeTab}}"
        attr-for-selected="data-mode"
      >
        <paper-tab id="configurebutton" data-mode="configure"
          ><paper-button raised="" noink="">Configure</paper-button></paper-tab
        >
        <paper-tab id="advancedbutton" data-mode="advanced"
          ><paper-button raised="" noink="">Advanced</paper-button></paper-tab
        >
      </paper-tabs>
      <paper-card class="form-wrapper">
        <eco-json-schema-object
          id="form"
          schema="[[schema]]"
          value="{{value}}"
        ></eco-json-schema-object>
      </paper-card>
    `,is:"hax-schema-form",properties:{initialValue:{type:Object,notify:!0,value:{},observer:"_valueChanged"},value:{type:Object,notify:!0,value:{}},modeTab:{type:String,observer:"_editorModeChanged"},advancedForm:{type:Boolean,value:!1},canEditSource:{type:Boolean},formKey:{type:String,computed:"_computedFormKey(advancedForm)",observer:"_formKeyChanged"},schema:{type:Object},configureSchema:{type:Object,value:{schema:{}}},advancedSchema:{type:Object,value:{schema:{}}}},_computedFormKey:function(advanced){if(advanced){return"advanced"}else{return"configure"}},_formKeyChanged:function(newValue){if(newValue){if("advanced"===newValue){this.set("schema",this.advancedSchema)}else{this.set("schema",this.configureSchema)}this.notifyPath("schema.*")}},_valueChanged:function(newValue){if(newValue&&this.schema){for(var i in newValue){console.log(this.schema);console.log(i);this.schema[i].value=newValue[i]}}},_editorModeChanged:function(mode){if(mode){if("advanced"===mode){this.advancedForm=!0}else{this.advancedForm=!1}}}});