"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var webmapgl_core_js_1 = require("../webmapgl.core.js");
var chunk_cf921ba9_js_1 = require("./chunk-cf921ba9.js");
var DrawToolbar = function () { function t() { this.visible = !1, this.featureCount = 0, this.cancelText = chunk_cf921ba9_js_1.a("webmapgl.draw-toolbar.cancel"), this.color = "primary", this.confirmText = chunk_cf921ba9_js_1.a("webmapgl.draw-toolbar.confirm"), this.label = chunk_cf921ba9_js_1.a("webmapgl.draw-toolbar.label"), this.maxFeatures = 1, this.minFeatures = 1; } return t.prototype.handleDrawEnter = function (t) { t.detail.mapId == this.mapId && (this.featureCount = 0, this.visible = !0); }, t.prototype.handleDrawExit = function (t) { t.detail.mapId == this.mapId && (this.visible = !1); }, t.prototype.handleDrawCreate = function (t) { t.detail.mapId == this.mapId && (this.featureCount += 1); }, t.prototype.handleDrawDelete = function (t) { t.detail.mapId == this.mapId && (this.featureCount -= 1); }, t.prototype.cancel = function () { this.glDrawCancel.emit({ mapId: this.mapId }); }, t.prototype.confirm = function () { this.glDrawConfirm.emit({ mapId: this.mapId }); }, t.prototype.render = function () { var t = this; if (this.visible) {
    var e = screen.width <= 640, a = this.featureCount >= this.minFeatures && this.featureCount <= this.maxFeatures;
    return webmapgl_core_js_1.h("ion-toolbar", { color: this.color }, webmapgl_core_js_1.h("ion-title", null, this.label), webmapgl_core_js_1.h("ion-buttons", { slot: "end" }, webmapgl_core_js_1.h("ion-button", { onClick: function () { t.cancel(); } }, webmapgl_core_js_1.h("ion-icon", { slot: e ? "icon-only" : "start", name: "close" }), e ? null : this.cancelText), webmapgl_core_js_1.h("ion-button", { onClick: function () { a && t.confirm(); }, disabled: !a }, webmapgl_core_js_1.h("ion-icon", { slot: e ? "icon-only" : "start", name: "checkmark" }), e ? null : this.confirmText)));
} }, Object.defineProperty(t, "is", { get: function () { return "gl-draw-toolbar"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { cancelText: { type: String, attr: "cancel-text" }, color: { type: String, attr: "color" }, confirmText: { type: String, attr: "confirm-text" }, featureCount: { state: !0 }, label: { type: String, attr: "label" }, mapId: { type: String, attr: "map-id" }, maxFeatures: { type: Number, attr: "max-features" }, minFeatures: { type: Number, attr: "min-features" }, visible: { state: !0 } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "events", { get: function () { return [{ name: "glDrawCancel", method: "glDrawCancel", bubbles: !0, cancelable: !0, composed: !0 }, { name: "glDrawConfirm", method: "glDrawConfirm", bubbles: !0, cancelable: !0, composed: !0 }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "listeners", { get: function () { return [{ name: "body:glDrawEnter", method: "handleDrawEnter" }, { name: "body:glDrawExit", method: "handleDrawExit" }, { name: "body:glDrawCreate", method: "handleDrawCreate" }, { name: "body:glDrawDelete", method: "handleDrawDelete" }]; }, enumerable: !0, configurable: !0 }), t; }();
exports.GlDrawToolbar = DrawToolbar;
