var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function l(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,l)}u((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};webmapgl.loadBundle("jn6m5yxs",["exports","./chunk-962dfafc.js"],function(e,t){var n=function(){function e(){this.defaultOptions={type:"point",multiple:!1,combine:!1,delete:!1,mode:"draw"}}return e.prototype.create=function(e,n){return __awaiter(this,void 0,void 0,function(){var r,o;return __generator(this,function(i){switch(i.label){case 0:if(!(r=t.getMap(n.mapId)))throw"Draw action map not found";return(o=document.querySelector("gl-draw-toolbar"))&&n.toolbarLabel&&(o.label=n.toolbarLabel),r.drawOptions=this.getControlOptions(n),r.drawing=!0,e&&r.draw.set(e),[4,new Promise(function(e){var t=function(){r.drawing=!1,e(),o.removeEventListener("glDrawCancel",t),o.removeEventListener("glDrawConfirm",n)},n=function(){var t=r.draw.getAll();r.drawing=!1,e(t),o.removeEventListener("glDrawConfirm",n),o.removeEventListener("glDrawConfirm",n)};o.addEventListener("glDrawCancel",t),o.addEventListener("glDrawConfirm",n)})];case 1:return[2,i.sent()]}})})},e.prototype.getControlOptions=function(e){var t=Object.assign({},this.defaultOptions,e||{}),n="simple_select";"direct"===t.mode&&(n="direct_select"),"draw"===t.mode&&("point"===t.type&&(n="draw_point"),"line"===t.type&&(n="draw_line_string"),"polygon"===t.type&&(n="draw_polygon"));var r={controls:{point:t.multiple&&"point"===t.type,line_string:t.multiple&&"line"===t.type,polygon:t.multiple&&"polygon"===t.type,trash:t.delete,combine_features:t.multiple&&t.combine,uncombine_features:t.multiple&&t.combine},defaultMode:n};return t.styles&&(r.styles=t.styles),r},Object.defineProperty(e,"is",{get:function(){return"gl-draw-controller"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{create:{method:!0}}},enumerable:!0,configurable:!0}),e}();e.GlDrawController=n,Object.defineProperty(e,"__esModule",{value:!0})});