import*as tslib_1 from"../polyfills/tslib.js";import{h}from"../webmapgl.core.js";import{a as _t}from"./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=_t("webmapgl.download-button.title");return h("ion-button",{onClick:function(n){return e.openPopover(n)},title:n},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=_t("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+")"),h("ion-item",null,h("ion-label",{"text-wrap":!0},e.label," ",n),h("ion-button",{slot:"end",href:e.url,title:_t("webmapgl.download-list.download",{file:e.label})},h("ion-icon",{slot:"icon-only",name:"download"})))});return h("ion-content",null,h("ion-list",null,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}();export{DownloadButton as GlDownloadButton,DownloadList as GlDownloadList};