const e=window.webmapgl.h;import{a as t}from"./chunk-cf921ba9.js";class a{getBasemapStyles(){return Array.from(document.querySelectorAll("gl-style")).filter(e=>e.basemap)}setBasemap(e){this.getBasemapStyles().forEach(t=>t.enabled=t.url===e)}render(){const a=t("webmapgl.basemap-switcher.header");let n=this.getBasemapStyles().map(t=>e("ion-item",null,t.thumbnail?e("ion-thumbnail",{slot:"start"},e("img",{src:t.thumbnail,alt:t.name})):null,e("ion-label",{"text-wrap":!0},t.name),e("ion-radio",{checked:t.enabled,value:t.url})));return e("ion-content",null,e("ion-list",null,e("ion-radio-group",{onIonChange:e=>this.setBasemap(e.detail.value)},e("ion-list-header",null,a),n)))}static get is(){return"gl-basemap-switcher"}}class n{async openPopover(e){const t={component:document.createElement("gl-basemap-switcher"),ev:e},a=await this.popoverCtrl.create(t);return await a.present(),a}render(){let a=t("webmapgl.basemaps.title");return e("ion-button",{onClick:e=>this.openPopover(e),title:a},e("ion-icon",{slot:"icon-only",name:"globe"}))}static get is(){return"gl-basemaps"}static get properties(){return{el:{elementRef:!0},popoverCtrl:{connect:"ion-popover-controller"}}}}export{a as GlBasemapSwitcher,n as GlBasemaps};