import { __decorate, __metadata } from "tslib";
import '@material/web/button/elevated-button.js';
import { html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
let OAuth2DecisionErrorPage = class OAuth2DecisionErrorPage extends LitElement {
    constructor() {
        super(...arguments);
        this.data = {};
        this.user = {};
        this.domain = {};
        this.req = {};
        this.redirectURI = '';
        this.transactionID = '';
    }
    render() {
        return html `
      <h2>Application Binding Error</h2>

      <p>Hi ${this.user.name}!</p>
      <p><b>Application Not Found</b></p>
      <p>You better check you give a correct client id (appKey)</p>

      <p>Company: ${this.domain.subdomain}</p>
      <p>Application Client ID : ${this.req.clientID}</p>
      <p>Redirect URI : ${this.redirectURI}</p>
      <p>State : ${this.req.state}</p>

      <form>
        <input name="transaction_id" value="${this.transactionID}" hidden />
        <input name="subdomain" type="text" value="${this.domain.subdomain}" hidden />
        <input name="appKey" value="${this.req.clientID}" hidden />
        <input name="scope" value="${this.req.scope}" hidden />
        <input name="state" type="text" value="${this.req.state}" hidden />
        <input name="email" type="text" value="${this.user.email}" hidden />

        <md-elevated-button raised @click="${() => history.back()}">Move back</md-elevated-button>
      </form>
    `;
    }
    updated(changedProps) {
        if (changedProps.has('data')) {
            this.user = this.data?.oauth2?.user || this.user;
            this.domain = this.data?.domain || this.domain;
            this.req = this.data?.oauth2?.req || this.req;
            this.redirectURI = this.data?.oauth2?.redirectURI || this.redirectURI;
            this.transactionID = this.data?.oauth2?.transactionID || this.transactionID;
        }
    }
};
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "data", void 0);
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "user", void 0);
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "domain", void 0);
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "req", void 0);
__decorate([
    property({ type: String }),
    __metadata("design:type", String)
], OAuth2DecisionErrorPage.prototype, "redirectURI", void 0);
__decorate([
    property({ type: String }),
    __metadata("design:type", String)
], OAuth2DecisionErrorPage.prototype, "transactionID", void 0);
OAuth2DecisionErrorPage = __decorate([
    customElement('oauth2-decision-error')
], OAuth2DecisionErrorPage);
//# sourceMappingURL=oauth2-decision-error-page.js.map