"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("../polyfills/tslib.js");
var webmapgl_core_js_1 = require("../webmapgl.core.js");
var chunk_cf921ba9_js_1 = require("./chunk-cf921ba9.js");
var DownloadButton = function () { function e() { } return e.prototype.openPopover = function (e) { return tslib_1.__awaiter(this, void 0, void 0, function () { var n, t; return tslib_1.__generator(this, function (o) { switch (o.label) {
    case 0: return n = { component: document.createElement("gl-download-list"), componentProps: { files: Array.from(this.el.querySelectorAll("gl-download-file")) }, ev: e }, [4, this.popoverCtrl.create(n)];
    case 1: return [4, (t = o.sent()).present()];
    case 2: return o.sent(), [2, t];
} }); }); }, e.prototype.render = function () { var e = this, n = chunk_cf921ba9_js_1.a("webmapgl.download-button.title"); return webmapgl_core_js_1.h("ion-button", { onClick: function (n) { return e.openPopover(n); }, title: n }, webmapgl_core_js_1.h("ion-icon", { slot: "icon-only", name: "download" })); }, Object.defineProperty(e, "is", { get: function () { return "gl-download-button"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(e, "properties", { get: function () { return { el: { elementRef: !0 }, popoverCtrl: { connect: "ion-popover-controller" } }; }, enumerable: !0, configurable: !0 }), e; }(), DownloadList = function () { function e() { } return e.prototype.render = function () { var e = chunk_cf921ba9_js_1.a("webmapgl.download-list.header"), n = this.files.map(function (e) { var n = [e.format, e.size].filter(function (e) { return e; }).join(", "); return n && (n = "(" + n + ")"), webmapgl_core_js_1.h("ion-item", null, webmapgl_core_js_1.h("ion-label", { "text-wrap": !0 }, e.label, " ", n), webmapgl_core_js_1.h("ion-button", { slot: "end", href: e.url, title: chunk_cf921ba9_js_1.a("webmapgl.download-list.download", { file: e.label }) }, webmapgl_core_js_1.h("ion-icon", { slot: "icon-only", name: "download" }))); }); return webmapgl_core_js_1.h("ion-content", null, webmapgl_core_js_1.h("ion-list", null, webmapgl_core_js_1.h("ion-list-header", null, e), n)); }, Object.defineProperty(e, "is", { get: function () { return "gl-download-list"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(e, "properties", { get: function () { return { files: { type: "Any", attr: "files" } }; }, enumerable: !0, configurable: !0 }), e; }();
exports.GlDownloadButton = DownloadButton;
exports.GlDownloadList = DownloadList;
