import{r as t,f as i,h as s}from"./p-23450e8b.js";import{_ as r}from"./p-9554b2b5.js";import"./p-7183ba4d.js";const h=class{constructor(s){t(this,s);this.glDrawCancel=i(this,"glDrawCancel",7);this.glDrawConfirm=i(this,"glDrawConfirm",7);this.callCancel=()=>this.cancel();this.callConfirm=()=>this.confirm();this.visible=false;this.featureCount=0;this.cancelText=r("webmapgl.draw-toolbar.cancel");this.color="primary";this.confirmText=r("webmapgl.draw-toolbar.confirm");this.label=r("webmapgl.draw-toolbar.label");this.mapId="";this.maxFeatures=1;this.minFeatures=1}handleDrawEnter(t){if(t.detail.mapId!==this.mapId)return;this.featureCount=0;this.visible=true}handleDrawExit(t){if(t.detail.mapId!==this.mapId)return;this.visible=false}handleDrawCreate(t){if(t.detail.mapId!==this.mapId)return;this.featureCount+=1}handleDrawDelete(t){if(t.detail.mapId!==this.mapId)return;this.featureCount-=1}cancel(){this.glDrawCancel.emit({mapId:this.mapId})}confirm(){this.glDrawConfirm.emit({mapId:this.mapId})}render(){if(!this.visible)return;let t=screen.width<=640;let i=this.featureCount>=this.minFeatures&&this.featureCount<=this.maxFeatures;return s("ion-toolbar",{color:this.color},s("ion-title",null,this.label),s("ion-buttons",{slot:"end"},s("ion-button",{onClick:this.callCancel},s("ion-icon",{slot:t?"icon-only":"start",name:"close"}),t?null:this.cancelText),s("ion-button",{onClick:i?this.callConfirm:undefined,disabled:!i},s("ion-icon",{slot:t?"icon-only":"start",name:"checkmark"}),t?null:this.confirmText)))}};export{h as gl_draw_toolbar};
//# sourceMappingURL=p-96e77bf2.entry.js.map