pwaLUPMIS2/dist/assets/ol-ext-BR0zF6aa.js
ekke cfaceb3487 GPS trail recording, SSO auth, account menu, and mobile/UI refinements
Major:
- GPS trail recording: reusable, dependency-free engine in src/geotracker/
  (GeoTracker + geo-utils) with pluggable storage/sync adapters; LUPMIS
  wiring in src/geotracker-lupmis.js. Expandable My Location control
  (Locate Me + Record Trail), live navbar GPS readout, on-map trail/position
  rendering, gps_trails/gps_trail_points SQLocal tables, and store-and-forward
  sync via pushGpsTrail() -> save_gps_trail.php (server side documented, not
  yet built).
- SSO authentication: public/index.php entry point validates the LUSPA SSO
  cookie and injects window.LUPMIS_SESSION; remotedb district_id is now a
  session-resolved getter. Adds public/.htaccess (DirectoryIndex).
- Account menu offcanvas (navbar burger) with sign-in/out states.

UI / fixes:
- LayerSwitcher modernisation; base-map "None" option in picker + settings.
- Mobile drawing toolbar wraps to two rows below 576px and shows only in
  Draw mode; second row right-aligned and clears the Select option bar.
- Safari bottom-dock clipping fixed (app-container 100dvh -> 100svh).
- Rename public/icons -> app-icons to dodge Apache's default /icons/ alias.
- Service Worker bumped to v8 (network-first HTML, per-provider tile clear).

Docs: reusable-mapping and OSM-3D-buildings concept notes; ignore Office
lock files (~$*). Rebuilt dist/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 16:08:37 +02:00

3 lines
117 KiB
JavaScript

import{B as Fe,M as Ue,C as ae,u as j,i as Xe,V as Y,a as je,T as be,I as ze,H as Ke,t as Ee,g as ie,S as re,b as N,L as D,c as Se,P as R,d as Q,e as ve,f as ne,h as U,j as F,F as z,k as ee,l as me,m as Z,n as x,o as I,p as J,R as ue,q as fe,r as te,s as de,v as Ne,w as Ce,x as Je,y as Ye,z as Ze,A as ge,D as K,E as ke,G as We,J as $e,O as Qe,K as et,N as tt}from"./openlayers-CvK8xBSr.js";var it=class extends Fe{constructor(e){e=e||{},super();var t=this.input=e.input;t||(t=this.input=document.createElement("input"),e.type&&t.setAttribute("type",e.type),e.min!==void 0&&t.setAttribute("min",e.min),e.max!==void 0&&t.setAttribute("max",e.max),e.step!==void 0&&t.setAttribute("step",e.step),e.parent&&e.parent.appendChild(t)),e.disabled&&(t.disabled=!0),e.checked!==void 0&&(t.checked=!!e.checked),e.val!==void 0&&(t.value=e.val),e.hidden&&t.classList.add("ol-input-hidden"),t.addEventListener("focus",function(){this.element&&this.element.classList.add("ol-focus")}.bind(this));var i;t.addEventListener("focusout",function(){this.element&&(i&&clearTimeout(i),i=setTimeout(function(){this.element.classList.remove("ol-focus")}.bind(this),0))}.bind(this))}_listenDrag(e,t){var i=function(r){this.moving=!0,this.element.classList.add("ol-moving");var s=function(a){a.type==="pointerup"&&(document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",s),document.removeEventListener("pointercancel",s),setTimeout(function(){this.moving=!1,this.element.classList.remove("ol-moving")}.bind(this))),a.target===e&&t(a),a.stopPropagation(),a.preventDefault()}.bind(this);document.addEventListener("pointermove",s,!1),document.addEventListener("pointerup",s,!1),document.addEventListener("pointercancel",s,!1),r.stopPropagation(),r.preventDefault()}.bind(this);e.addEventListener("mousedown",i,!1),e.addEventListener("touchstart",i,!1)}setValue(e){e!==void 0&&(this.input.value=e),this.input.dispatchEvent(new Event("change"))}getValue(){return this.input.value}getInputElement(){return this.input}},pe=class extends it{constructor(e){e=e||{},super(e);var t=this.element=document.createElement("label");e.html instanceof Element?t.appendChild(e.html):e.html!==void 0&&(t.innerHTML=e.html),t.className=("ol-ext-check ol-ext-checkbox "+(e.className||"")).trim(),this.input.parentNode&&this.input.parentNode.insertBefore(t,this.input),t.appendChild(this.input),t.appendChild(document.createElement("span")),e.after&&t.appendChild(document.createTextNode(e.after)),this.input.addEventListener("change",function(){this.dispatchEvent({type:"check",checked:this.input.checked,value:this.input.value})}.bind(this))}isChecked(){return this.input.checked}},rt=class extends pe{constructor(e){e=e||{},super(e),this.element.className=("ol-ext-toggle-switch "+(e.className||"")).trim()}},st=class extends pe{constructor(e){e=e||{},super(e),this.element.className=("ol-ext-check ol-ext-radio "+(e.className||"")).trim()}},f={};f.create=function(o,e){e=e||{};var t;if(o==="TEXT")t=document.createTextNode(e.html||""),e.parent&&e.parent.appendChild(t);else{t=document.createElement(o.toLowerCase()),/button/i.test(o)&&t.setAttribute("type","button");for(var i in e)switch(i){case"className":{e.className&&e.className.trim&&t.setAttribute("class",e.className.trim());break}case"text":{t.innerText=e.text;break}case"html":{e.html instanceof Element?t.appendChild(e.html):e.html!==void 0&&(t.innerHTML=e.html);break}case"parent":{e.parent&&e.parent.appendChild(t);break}case"options":{if(/select/i.test(o))for(var r in e.options)f.create("OPTION",{html:r,value:e.options[r],parent:t});break}case"style":{f.setStyle(t,e.style);break}case"change":case"click":{f.addListener(t,i,e[i]);break}case"on":{for(var s in e.on)f.addListener(t,s,e.on[s]);break}case"checked":{t.checked=!!e.checked;break}default:{t.setAttribute(i,e[i]);break}}}return t};f.createSwitch=function(o){var e=f.create("INPUT",{type:"checkbox",on:o.on,click:o.click,change:o.change,parent:o.parent}),t=Object.assign({input:e},o||{});return new rt(t),e};f.createCheck=function(o){var e=f.create("INPUT",{name:o.name,type:o.type==="radio"?"radio":"checkbox",on:o.on,parent:o.parent}),t=Object.assign({input:e},o||{});return o.type==="radio"?new st(t):new pe(t),e};f.setHTML=function(o,e){e instanceof Element?o.appendChild(e):e!==void 0&&(o.innerHTML=e)};f.appendText=function(o,e){o.appendChild(document.createTextNode(e||""))};f.addListener=function(o,e,t,i){typeof e=="string"&&(e=e.split(" ")),e.forEach(function(r){o.addEventListener(r,t,i)})};f.removeListener=function(o,e,t){typeof e=="string"&&(e=e.split(" ")),e.forEach(function(i){o.removeEventListener(i,t)})};f.show=function(o){o.style.display=""};f.hide=function(o){o.style.display="none"};f.hidden=function(o){return f.getStyle(o,"display")==="none"};f.toggle=function(o){o.style.display=o.style.display==="none"?"":"none"};f.setStyle=function(o,e){for(var t in e)switch(t){case"top":case"left":case"bottom":case"right":case"minWidth":case"maxWidth":case"width":case"height":{typeof e[t]=="number"?o.style[t]=e[t]+"px":o.style[t]=e[t];break}default:o.style[t]=e[t]}};f.getStyle=function(o,e){var t,i=(o.ownerDocument||document).defaultView;if(i&&i.getComputedStyle)e=e.replace(/([A-Z])/g,"-$1").toLowerCase(),t=i.getComputedStyle(o,null).getPropertyValue(e);else if(o.currentStyle&&(e=e.replace(/-(\w)/g,function(r,s){return s.toUpperCase()}),t=o.currentStyle[e],/^\d+(em|pt|%|ex)?$/i.test(t)))return(function(r){var s=o.style.left,a=o.runtimeStyle.left;return o.runtimeStyle.left=o.currentStyle.left,o.style.left=r||0,r=o.style.pixelLeft+"px",o.style.left=s,o.runtimeStyle.left=a,r})(t);return/px$/.test(t)?parseInt(t):t};f.outerHeight=function(o){return o.offsetHeight+f.getStyle(o,"marginBottom")};f.outerWidth=function(o){return o.offsetWidth+f.getStyle(o,"marginLeft")};f.offsetRect=function(o){var e=o.getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),height:e.height||e.bottom-e.top,width:e.width||e.right-e.left}};f.getFixedOffset=function(o){var e={left:0,top:0},t=function(i){if(!i)return e;if(f.getStyle(i,"position")==="absolute"&&f.getStyle(i,"transform")!=="none"){var r=i.getBoundingClientRect();return e.left+=r.left,e.top+=r.top,e}return t(i.offsetParent)};return t(o.offsetParent)};f.positionRect=function(o,e){var t=0,i=0,r=function(s){if(s)return t+=s.offsetLeft,i+=s.offsetTop,r(s.offsetParent);var a={top:o.offsetTop+i,left:o.offsetLeft+t};return e&&(a.top-=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,a.left-=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),a.bottom=a.top+o.offsetHeight,a.right=a.top+o.offsetWidth,a};return r(o.offsetParent)};f.scrollDiv=function(o,e){e=e||{};var t=!1,i=0,r,s=0,a=typeof e.onmove=="function"?e.onmove:function(){},n=e.vertical?"screenY":"screenX",l=e.vertical?"scrollTop":"scrollLeft",c=!1,g,h,u=0,d=function(){E&&(u++,setTimeout(v))},v=function(){if(E){if(u--,u)return;var m=o.clientHeight,C=o.scrollHeight;g=m/C,E.style.height=g*100+"%",E.style.top=o.scrollTop/C*100+"%",L.style.height=m+"px",m>C-.5?L.classList.add("ol-100pc"):L.classList.remove("ol-100pc")}},_=function(m){m.target.classList.contains("ol-noscroll")||(c=!1,t=m[n],s=new Date,o.classList.add("ol-move"),m.preventDefault(),window.addEventListener("pointermove",y),f.addListener(window,["pointerup","pointercancel"],T))},y=function(m){if(t!==!1){var C=(h?-1/g:1)*(t-m[n]);c=c||Math.round(C),o[l]+=C,r=new Date,r-s&&(i=(i+C/(r-s))/2),t=m[n],s=r,C&&a(!0)}else c=!0},w=function(m){var C=m>0?Math.min(100,m/2):Math.max(-100,m/2);m-=C,o[l]+=C,-1<m&&m<1?(c?setTimeout(function(){o.classList.remove("ol-move")}):o.classList.remove("ol-move"),c=!1,a(!1)):setTimeout(function(){w(m)},40)},L,E;if(e.vertical&&e.minibar){var k=function(m){o.removeEventListener("pointermove",k),o.parentNode.classList.add("ol-miniscroll"),E=f.create("DIV"),L=f.create("DIV",{className:"ol-scroll",html:E}),o.parentNode.insertBefore(L,o),E.addEventListener("pointerdown",function(C){h=!0,_(C)}),e.mousewheel&&(f.addListener(L,["mousewheel","DOMMouseScroll","onmousewheel"],function(C){p(C)}),f.addListener(E,["mousewheel","DOMMouseScroll","onmousewheel"],function(C){p(C)})),o.parentNode.addEventListener("pointerenter",d),window.addEventListener("resize",d),m!==!1&&d()};o.parentNode?k(!1):o.addEventListener("pointermove",k),o.addEventListener("scroll",function(){d()})}o.style["touch-action"]="none",o.style.overflow="hidden",o.classList.add("ol-scrolldiv"),f.addListener(o,["pointerdown"],function(m){h=!1,_(m)}),o.addEventListener("click",function(m){o.classList.contains("ol-move")&&(m.preventDefault(),m.stopPropagation())},!0);var T=function(m){s=new Date-s,s>100||h?i=0:s>0&&(i=((i||0)+(t-m[n])/s)/2),w(e.animate===!1?0:i*200),t=!1,i=0,s=0,o.classList.contains("ol-move")?o.classList.remove("ol-hasClick"):(o.classList.add("ol-hasClick"),setTimeout(function(){o.classList.remove("ol-hasClick")},500)),h=!1,window.removeEventListener("pointermove",y),f.removeListener(window,["pointerup","pointercancel"],T)},p=function(m){var C=Math.max(-1,Math.min(1,m.wheelDelta||-m.detail));return o.classList.add("ol-move"),o[l]-=C*30,o.classList.remove("ol-move"),!1};return e.mousewheel&&f.addListener(o,["mousewheel","DOMMouseScroll","onmousewheel"],p),{refresh:d}};f.dispatchEvent=function(o,e){var t;try{t=new CustomEvent(o)}catch{t=document.createEvent("CustomEvent"),t.initCustomEvent(o,!0,!0,{})}e.dispatchEvent(t)};f.setCursor=function(o,e){o instanceof Ue&&(o=o.getTargetElement()),!("ontouchstart"in window)&&o instanceof Element&&(o.style.cursor=e)};var at=class extends ae{constructor(e){e=e||{};var t=f.create("DIV",{className:e.switcherClass||"ol-layerswitcher"});super({element:t,target:e.target});var i=this;this.dcount=0,this.show_progress=e.show_progress,this.oninfo=typeof e.oninfo=="function"?e.oninfo:null,this.onextent=typeof e.onextent=="function"?e.onextent:null,this.hasextent=e.extent||e.onextent,this.hastrash=e.trash,this.reordering=e.reordering!==!1,this._layers=[],this._layerGroup=e.layerGroup&&e.layerGroup.getLayers?e.layerGroup:null,this.onchangeCheck=typeof e.onchangeCheck=="function"?e.onchangeCheck:null,typeof e.displayInLayerSwitcher=="function"&&(this.displayInLayerSwitcher=e.displayInLayerSwitcher),e.target||(t.classList.add("ol-unselectable"),t.classList.add("ol-control"),t.classList.add(e.collapsed!==!1?"ol-collapsed":"ol-forceopen"),e.counter&&t.classList.add("ol-counter"),this.counter=f.create("SPAN",{class:"ol-counter",text:0,parent:t}),this.button=f.create("BUTTON",{type:"button",parent:t}),this.button.addEventListener("touchstart",function(r){t.classList.toggle("ol-forceopen"),t.classList.add("ol-collapsed"),i.dispatchEvent({type:"toggle",collapsed:t.classList.contains("ol-collapsed")}),r.preventDefault(),i.overflow()}),this.button.addEventListener("click",function(){t.classList.toggle("ol-forceopen"),t.classList.add("ol-collapsed"),i.dispatchEvent({type:"toggle",collapsed:!t.classList.contains("ol-forceopen")}),i.overflow()}),e.mouseover&&(t.addEventListener("mouseleave",function(){t.classList.add("ol-collapsed"),i.dispatchEvent({type:"toggle",collapsed:!0})}),t.addEventListener("mouseover",function(){t.classList.remove("ol-collapsed"),i.dispatchEvent({type:"toggle",collapsed:!1})})),e.minibar&&(e.noScroll=!0),e.noScroll||(this.topv=f.create("DIV",{className:"ol-switchertopdiv",parent:t,click:function(){i.overflow("+50%")}}),this.botv=f.create("DIV",{className:"ol-switcherbottomdiv",parent:t,click:function(){i.overflow("-50%")}})),this._noScroll=e.noScroll),this.panel_=f.create("UL",{className:"panel"}),this.panelContainer_=f.create("DIV",{className:"panel-container",html:this.panel_,parent:t}),!e.target&&!e.noScroll&&f.addListener(this.panel_,"mousewheel DOMMouseScroll onmousewheel",function(r){i.overflow(Math.max(-1,Math.min(1,r.wheelDelta||-r.detail)))&&(r.stopPropagation(),r.preventDefault())}),this.header_=f.create("LI",{className:"ol-header",parent:this.panel_}),this.set("drawDelay",e.drawDelay||0),this.set("selection",e.selection),e.minibar&&setTimeout(function(){var r=f.scrollDiv(this.panelContainer_,{mousewheel:!0,vertical:!0,minibar:!0});this.on(["drawlist","toggle"],function(){r.refresh()})}.bind(this))}displayInLayerSwitcher(e){return e.get("displayInLayerSwitcher")!==!1}setMap(e){if(super.setMap(e),this.drawPanel(),this._listener)for(var t in this._listener)j(this._listener[t]);this._listener=null,e&&(this._listener={moveend:e.on("moveend",this.viewChange.bind(this)),size:e.on("change:size",this.overflow.bind(this))},this._layerGroup?this._listener.change=this._layerGroup.getLayers().on("change:length",this.drawPanel.bind(this)):this._listener.change=e.getLayerGroup().getLayers().on("change:length",this.drawPanel.bind(this)))}show(){this.element.classList.add("ol-forceopen"),this.overflow(),this.dispatchEvent({type:"toggle",collapsed:!1})}hide(){this.element.classList.remove("ol-forceopen"),this.overflow(),this.dispatchEvent({type:"toggle",collapsed:!0})}toggle(){this.element.classList.toggle("ol-forceopen"),this.overflow(),this.dispatchEvent({type:"toggle",collapsed:!this.isOpen()})}isOpen(){return this.element.classList.contains("ol-forceopen")}setHeader(e){f.setHTML(this.header_,e)}overflow(e){if(this.button&&!this._noScroll){if(f.hidden(this.panel_)){f.setStyle(this.element,{height:"auto"});return}var t=f.outerHeight(this.element),i=f.outerHeight(this.panel_),r=this.button.offsetTop+f.outerHeight(this.button),s=this.panel_.offsetTop-r;if(i>t-r){f.setStyle(this.element,{height:"100%"});var a=this.panel_.querySelectorAll("li.ol-visible .li-content")[0],n=a?2*f.getStyle(a,"height"):0;switch(e){case 1:s+=n;break;case-1:s-=n;break;case"+50%":s+=Math.round(t/2);break;case"-50%":s-=Math.round(t/2);break}return s+i<=t-3*r/2?(s=t-3*r/2-i,f.hide(this.botv)):f.show(this.botv),s>=0?(s=0,f.hide(this.topv)):f.show(this.topv),f.setStyle(this.panel_,{top:s+"px"}),!0}else return f.setStyle(this.element,{height:"auto"}),f.setStyle(this.panel_,{top:0}),f.hide(this.botv),f.hide(this.topv),!1}else return!1}_setLayerForLI(e,t){var i=[];t.getLayers&&i.push(t.getLayers().on("change:length",this.drawPanel.bind(this))),e&&(i.push(t.on("change:opacity",(function(){this.setLayerOpacity(t,e)}).bind(this))),i.push(t.on("change:visible",(function(){this.setLayerVisibility(t,e)}).bind(this)))),i.push(t.on("propertychange",(function(r){(r.key==="displayInLayerSwitcher"||r.key==="openInLayerSwitcher"||r.key==="title"||r.key==="name")&&this.drawPanel(r)}).bind(this))),this._layers.push({li:e,layer:t,listeners:i})}setLayerOpacity(e,t){var i=t.querySelector(".layerswitcher-opacity-cursor");i&&(i.style.left=e.getOpacity()*100+"%"),this.dispatchEvent({type:"layer:opacity",layer:e})}setLayerVisibility(e,t){var i=t.querySelector(".ol-visibility");i&&(i.checked=e.getVisible()),e.getVisible()?t.classList.add("ol-visible"):t.classList.remove("ol-visible"),this.dispatchEvent({type:"layer:visible",layer:e})}_clearLayerForLI(){this._layers.forEach(function(e){e.listeners.forEach(function(t){j(t)})}),this._layers=[]}_getLayerForLI(e){for(var t=0,i;i=this._layers[t];t++)if(i.li===e)return i.layer;return null}viewChange(){this.panel_.querySelectorAll("li").forEach(function(e){var t=this._getLayerForLI(e);t&&(this.testLayerVisibility(t)?e.classList.remove("ol-layer-hidden"):e.classList.add("ol-layer-hidden"))}.bind(this))}getPanel(){return this.panelContainer_}drawPanel(){if(this.getMap()){var e=this;this.dcount++,setTimeout(function(){e.drawPanel_()},this.get("drawDelay")||0)}}drawPanel_(){if(!(--this.dcount||this.dragging_)){var e=this.panelContainer_.scrollTop;this._clearLayerForLI(),this.panel_.querySelectorAll("li").forEach(function(t){t.classList.contains("ol-header")||t.remove()}.bind(this)),this._layerGroup?this.drawList(this.panel_,this._layerGroup.getLayers()):this.getMap()&&this.drawList(this.panel_,this.getMap().getLayers()),this.panelContainer_.scrollTop=e,this.counter&&(this.counter.innerHTML=this.panel_.parentNode.querySelectorAll("ul.panel > li:not(.ol-header)").length)}}switchLayerVisibility(e,t){e.get("baseLayer")?(e.getVisible()||e.setVisible(!0),t.forEach(function(i){e!==i&&i.get("baseLayer")&&i.getVisible()&&i.setVisible(!1)})):e.setVisible(!e.getVisible())}testLayerVisibility(e){if(!this.getMap())return!0;var t=this.getMap().getView().getResolution(),i=this.getMap().getView().getZoom();if(e.getMaxResolution()<=t||e.getMinResolution()>=t)return!1;if(e.getMinZoom&&(e.getMinZoom()>=i||e.getMaxZoom()<i))return!1;var r=e.getExtent();if(r){var s=this.getMap().getView().calculateExtent(this.getMap().getSize());return Xe(s,r)}return!0}dragOrdering_(e){e.stopPropagation(),e.preventDefault();var t=this,i=e.currentTarget.parentNode.parentNode,r=!0,s=this.panel_,a,n=e.pageY||e.touches&&e.touches.length&&e.touches[0].pageY||e.changedTouches&&e.changedTouches.length&&e.changedTouches[0].pageY,l,c,g,h;i.parentNode.classList.add("drag");function u(){if(l){var v=g,_=t.getSelection()===v;if(v&&l){var y;h?y=h.getLayers():y=t._layerGroup?t._layerGroup.getLayers():t.getMap().getLayers();for(var w=y.getArray(),L=0;L<w.length;L++)if(w[L]==v){y.removeAt(L);break}for(var E=0;E<w.length;E++)if(w[E]===l){L>E?y.insertAt(E,v):y.insertAt(E+1,v);break}}_&&t.selectLayer(v),t.dispatchEvent({type:"reorder-end",layer:v,group:h})}i.parentNode.querySelectorAll("li").forEach(function(k){k.classList.remove("dropover"),k.classList.remove("dropover-after"),k.classList.remove("dropover-before")}),i.classList.remove("drag"),i.parentNode.classList.remove("drag"),t.element.classList.remove("drag"),c&&c.remove(),f.removeListener(document,"mousemove touchmove",d),f.removeListener(document,"mouseup touchend touchcancel",u)}function d(v){if(a=v.pageY||v.touches&&v.touches.length&&v.touches[0].pageY||v.changedTouches&&v.changedTouches.length&&v.changedTouches[0].pageY,r&&Math.abs(n-a)>2&&(r=!1,i.classList.add("drag"),g=t._getLayerForLI(i),l=!1,h=t._getLayerForLI(i.parentNode.parentNode),c=f.create("LI",{className:"ol-dragover",html:i.innerHTML,style:{position:"absolute","z-index":1e4,left:i.offsetLeft,opacity:.5,width:f.outerWidth(i),height:f.getStyle(i,"height")},parent:s}),t.element.classList.add("drag"),t.dispatchEvent({type:"reorder-start",layer:g,group:h})),!r){v.preventDefault(),v.stopPropagation(),f.setStyle(c,{top:a-f.offsetRect(s).top+s.scrollTop+5});var _;if(!v.touches)_=v.target,v.target.shadowRoot&&(_=v.composedPath()[0]);else for(_=document.elementFromPoint(v.touches[0].clientX,v.touches[0].clientY);_.shadowRoot;)_=_.shadowRoot.elementFromPoint(v.touches[0].clientX,v.touches[0].clientY);for(_.classList.contains("ol-switcherbottomdiv")?t.overflow(-1):_.classList.contains("ol-switchertopdiv")&&t.overflow(1);_&&_.tagName!=="LI";)_=_.parentNode;(!_||!_.classList.contains("dropover"))&&i.parentNode.querySelectorAll("li").forEach(function(y){y.classList.remove("dropover"),y.classList.remove("dropover-after"),y.classList.remove("dropover-before")}),_&&_.parentNode.classList.contains("drag")&&_!==i?(l=t._getLayerForLI(_),l&&!l.get("allwaysOnTop")==!g.get("allwaysOnTop")?(_.classList.add("dropover"),_.classList.add(i.offsetTop<_.offsetTop?"dropover-after":"dropover-before")):l=!1,f.show(c)):(l=!1,_===i?f.hide(c):f.show(c)),l?c.classList.remove("forbidden"):c.classList.add("forbidden")}}f.addListener(document,"mousemove touchmove",d),f.addListener(document,"mouseup touchend touchcancel",u)}dragOpacity_(e){e.stopPropagation(),e.preventDefault();var t=this,i=e.target,r=this._getLayerForLI(i.parentNode.parentNode.parentNode);if(!r)return;var s=e.pageX||e.touches&&e.touches.length&&e.touches[0].pageX||e.changedTouches&&e.changedTouches.length&&e.changedTouches[0].pageX,a=f.getStyle(i,"left")-s;t.dragging_=!0;function n(){f.removeListener(document,"mouseup touchend touchcancel",n),f.removeListener(document,"mousemove touchmove",l),t.dragging_=!1}function l(c){var g=c.pageX||c.touches&&c.touches.length&&c.touches[0].pageX||c.changedTouches&&c.changedTouches.length&&c.changedTouches[0].pageX,h=(a+g)/f.getStyle(i.parentNode,"width"),u=Math.max(0,Math.min(1,h));f.setStyle(i,{left:u*100+"%"}),i.parentNode.nextElementSibling.innerHTML=Math.round(u*100),r.setOpacity(u)}f.addListener(document,"mouseup touchend touchcancel",n),f.addListener(document,"mousemove touchmove",l)}drawList(e,t){var i=this,r=t.getArray(),s=function(h){h.stopPropagation(),h.preventDefault();var u=i._getLayerForLI(this.parentNode.parentNode);i.switchLayerVisibility(u,t),i.get("selection")&&u.getVisible()&&i.selectLayer(u),i.onchangeCheck&&i.onchangeCheck(u)};function a(h){h.stopPropagation(),h.preventDefault();var u=i._getLayerForLI(this.parentNode.parentNode);i.oninfo(u),i.dispatchEvent({type:"info",layer:u})}function n(h){h.stopPropagation(),h.preventDefault();var u=i._getLayerForLI(this.parentNode.parentNode);i.onextent?i.onextent(u):i.getMap().getView().fit(u.getExtent(),i.getMap().getSize()),i.dispatchEvent({type:"extent",layer:u})}function l(h){h.stopPropagation(),h.preventDefault();var u=this.parentNode.parentNode.parentNode.parentNode,d,v=i._getLayerForLI(u);v?(d=i._getLayerForLI(this.parentNode.parentNode),v.getLayers().remove(d),v.getLayers().getLength()==0&&!v.get("noSwitcherDelete")&&l.call(u.querySelectorAll(".layerTrash")[0],h)):(u=this.parentNode.parentNode,i.getMap().removeLayer(i._getLayerForLI(u)))}function c(h){if(!this.displayInLayerSwitcher(h)){this._setLayerForLI(null,h);return}var u=f.create("LI",{className:(h.getVisible()?"ol-visible ":" ")+(h.get("baseLayer")?"baselayer":""),parent:e});this._setLayerForLI(u,h),this._selectedLayer===h&&u.classList.add("ol-layer-select");var d=f.create("DIV",{className:"ol-layerswitcher-buttons",parent:u}),v=f.create("DIV",{className:"li-content",parent:u}),_=f.create("INPUT",{type:h.get("baseLayer")?"radio":"checkbox",className:"ol-visibility",checked:h.getVisible(),click:function(p){s.bind(this)(p),setTimeout(function(){p.target.checked=h.getVisible()})},on:{keydown:function(p){switch(p.key){case"ArrowLeft":case"ArrowRight":{p.preventDefault(),p.stopPropagation();var m=p.key==="ArrowLeft"?-.1:.1,C=Math.min(1,Math.max(0,h.getOpacity()+m));h.setOpacity(C);break}case"Enter":{i.get("selection")&&(p.preventDefault(),p.stopPropagation(),i.selectLayer(h));break}case"-":case"+":h.getLayers&&(this._focus=h,h.set("openInLayerSwitcher",!h.get("openInLayerSwitcher")));case"ArrowUp":case"ArrowDown":{if(p.ctrlKey&&this.reordering){p.preventDefault(),p.stopPropagation();var S=t.getArray().indexOf(h);S>-1&&(p.key==="ArrowDown"?S>0&&(t.remove(h),t.insertAt(S-1,h),i._focus=h,i.dispatchEvent({type:"reorder-end",layer:h})):S<t.getLength()-1&&(t.remove(h),t.insertAt(S+1,h),i._focus=h,i.dispatchEvent({type:"reorder-end",layer:h})))}break}default:{var b=this._getLayerForLI(e.parentNode);this.dispatchEvent({type:"layer:keydown",key:p.key,group:b,li:u,layer:h,originalEvent:p})}}}.bind(this)},parent:v});h===i._focus&&(_.focus(),i.overflow());var y=f.create("LABEL",{title:h.get("title")||h.get("name"),click:s,style:{userSelect:"none"},parent:v});if(y.addEventListener("selectstart",function(){return!1}),f.create("SPAN",{html:h.get("title")||h.get("name"),click:function(p){this.get("selection")&&(p.stopPropagation(),this.selectLayer(h))}.bind(this),parent:y}),this.reordering&&(g<r.length-1&&(h.get("allwaysOnTop")||!r[g+1].get("allwaysOnTop"))||g>0&&(!h.get("allwaysOnTop")||r[g-1].get("allwaysOnTop")))&&f.create("DIV",{className:"layerup ol-noscroll",title:this.tip.up,on:{"mousedown touchstart":function(p){i.dragOrdering_(p)}},parent:d}),h.getLayers){var w=0;h.getLayers().forEach(function(p){i.displayInLayerSwitcher(p)&&w++}),w&&f.create("DIV",{className:h.get("openInLayerSwitcher")?"collapse-layers":"expend-layers",title:this.tip.plus,click:function(){var p=i._getLayerForLI(this.parentNode.parentNode);p.set("openInLayerSwitcher",!p.get("openInLayerSwitcher"))},parent:d})}if(this.oninfo&&f.create("DIV",{className:"layerInfo",title:this.tip.info,click:a,parent:d}),this.hastrash&&!h.get("noSwitcherDelete")&&f.create("DIV",{className:"layerTrash",title:this.tip.trash,click:l,parent:d}),this.hasextent&&r[g].getExtent()){var L=r[g].getExtent();L.length==4&&L[0]<L[2]&&L[1]<L[3]&&f.create("DIV",{className:"layerExtent",title:this.tip.extent,click:n,parent:d})}if(this.show_progress&&h instanceof be){var E=f.create("DIV",{className:"layerswitcher-progress",parent:v});this.setprogress_(h),h.layerswitcher_progress=f.create("DIV",{parent:E})}var k=f.create("DIV",{className:"layerswitcher-opacity",click:function(p){if(p.target===this){p.stopPropagation(),p.preventDefault();var m=Math.max(0,Math.min(1,p.offsetX/f.getStyle(this,"width")));i._getLayerForLI(this.parentNode.parentNode).setOpacity(m),this.parentNode.querySelectorAll(".layerswitcher-opacity-label")[0].innerHTML=Math.round(m*100)}},parent:v});if(f.create("DIV",{className:"layerswitcher-opacity-cursor ol-noscroll",style:{left:h.getOpacity()*100+"%"},on:{"mousedown touchstart":function(p){i.dragOpacity_(p)}},parent:k}),f.create("DIV",{className:"layerswitcher-opacity-label",html:Math.round(h.getOpacity()*100),parent:v}),h.getLayers&&(u.classList.add("ol-layer-group"),h.get("openInLayerSwitcher")===!0)){var T=f.create("UL",{parent:u});this.drawList(T,h.getLayers())}u.classList.add(this.getLayerClass(h)),this.dispatchEvent({type:"drawlist",layer:h,li:u})}for(var g=r.length-1;g>=0;g--)c.call(this,r[g]);this.viewChange(),e===this.panel_&&(this.overflow(""),this._focus=null)}getLayerClass(e){return e?e.getLayers?"ol-layer-group":e instanceof Y?"ol-layer-vector":e instanceof je?"ol-layer-vectortile":e instanceof be?"ol-layer-tile":e instanceof ze?"ol-layer-image":e instanceof Ke?"ol-layer-heatmap":e.getFeatures?"ol-layer-vectorimage":"unknown":"none"}selectLayer(e,t){if(!e){if(!this.getMap())return;e=this.getMap().getLayers().item(this.getMap().getLayers().getLength()-1)}this._selectedLayer=e,this.element.querySelector("input.ol-visibility:focus")&&(this._focus=e),this.drawPanel(),t||this.dispatchEvent({type:"select",layer:e})}getSelection(){return this._selectedLayer}setprogress_(e){if(!e.layerswitcher_progress){var t=0,i=0,r=function(){i===t?(i=t=0,f.setStyle(e.layerswitcher_progress,{width:0})):f.setStyle(e.layerswitcher_progress,{width:(t/i*100).toFixed(1)+"%"})};e.getSource().on("tileloadstart",function(){i++,r()}),e.getSource().on("tileloadend",function(){t++,r()}),e.getSource().on("tileloaderror",function(){t++,r()})}}};at.prototype.tip={up:"up/down",down:"down",info:"informations...",extent:"zoom to extent",trash:"remove layer",plus:"expand/shrink"};var Oe=class extends ae{constructor(e){e=e||{};var t=(e.className||"")+" ol-search"+(e.target?"":" ol-unselectable ol-control"),i=f.create("DIV",{className:t});super({element:i,target:e.target});var r=this;if(e.typing==null&&(e.typing=300),this._classname=e.className||"search",e.collapsed!==!1&&i.classList.add("ol-collapsed"),e.target||(this.button=document.createElement("button"),this.button.setAttribute("type","button"),this.button.setAttribute("title",e.title||e.label||"Search"),this.button.addEventListener("click",function(){if(i.classList.toggle("ol-collapsed"),!i.classList.contains("ol-collapsed")){i.querySelector("input.search").focus();for(var u=i.querySelectorAll("li"),d=0;d<u.length;d++)u[d].classList.remove("select");l.value||r.drawList_()}}),i.appendChild(this.button)),e.inputLabel){var s=document.createElement("LABEL");s.innerText=e.inputLabel,i.appendChild(s)}var a,n="",l=this._input=document.createElement("INPUT");l.setAttribute("type","search"),l.setAttribute("class","search"),l.setAttribute("autocomplete","off"),l.setAttribute("placeholder",e.placeholder||"Search..."),l.addEventListener("change",function(u){r.dispatchEvent({type:"change:input",input:u,value:l.value})});var c=function(u){var d=i.querySelector("ul.autocomplete li.select"),v=l.value;if(u.key=="ArrowDown"||u.key=="ArrowUp"||u.key=="Down"||u.key=="Up")if(d){var _=/Down/.test(u.key)?d.nextElementSibling:d.previousElementSibling;_&&!_.classList.contains("copy")&&(d.classList.remove("select"),_.classList.add("select"),l.value=_.innerText)}else d=i.querySelector("ul.autocomplete li"),d&&(d.classList.add("select"),l.value=d.innerText);else if(u.type=="input")v||setTimeout(function(){r.drawList_()},200),d&&(l.value=v="",d.classList.remove("select"));else if(d&&(u.type==="search"||u.key==="Enter"))i.classList.contains("ol-control")&&l.blur(),d.classList.remove("select"),n=v,r._handleSelect(r._list[d.getAttribute("data-search")]);else if(u.type==="search"||u.key==="Enter"||n!=v&&e.typing>=0)if(n=v,n){a&&clearTimeout(a);var y=r.get("minLength");a=setTimeout(function(){if(n.length>=y){var w=r.autocomplete(n,function(L){r.drawList_(L)});w&&r.drawList_(w)}else r.drawList_()},e.typing)}else r.drawList_();else d=i.querySelector("ul.autocomplete li"),d&&d.classList.remove("select")};if(l.addEventListener("keyup",c),l.addEventListener("search",c),l.addEventListener("cut",c),l.addEventListener("paste",c),l.addEventListener("input",c),e.noCollapse||(l.addEventListener("blur",function(){setTimeout(function(){l!==document.activeElement&&(i.classList.add("ol-collapsed"),this.set("reverse",!1),i.classList.remove("ol-revers"))}.bind(this),200)}.bind(this)),l.addEventListener("focus",function(){this.get("reverse")||(i.classList.remove("ol-collapsed"),i.classList.remove("ol-revers"))}.bind(this)),l.addEventListener("keydown",function(){this.set("reverse",!1),i.classList.remove("ol-collapsed"),i.classList.remove("ol-revers")}.bind(this))),i.appendChild(l),e.reverse){var g=f.create("BUTTON",{type:"button",class:"ol-revers",title:e.reverseTitle||"click on the map",on:{focus:function(){this.get("reverse")?this.set("reverse",!1):(this.set("reverse",!this.get("reverse")),l.focus(),i.classList.add("ol-revers"))}.bind(this)}});i.appendChild(g)}var h=document.createElement("ul");h.classList.add("autocomplete"),i.appendChild(h),typeof e.getTitle=="function"&&(this.getTitle=e.getTitle),typeof e.autocomplete=="function"&&(this.autocomplete=e.autocomplete),this.set("copy",e.copy),this.set("minLength",e.minLength||1),this.set("maxItems",e.maxItems||10),this.set("maxHistory",e.maxHistory||e.maxItems||10),e.onselect&&this.on("select",e.onselect),e.centerOnSelect&&this.on("select",function(u){var d=this.getMap();d&&d.getView().setCenter(u.coordinate)}.bind(this)),e.zoomOnSelect&&this.on("select",function(u){var d=this.getMap();d&&(d.getView().setCenter(u.coordinate),d.getView().getZoom()<e.zoomOnSelect&&d.getView().setZoom(e.zoomOnSelect))}.bind(this)),this.restoreHistory(),this.drawList_()}setMap(e){this._listener&&j(this._listener),this._listener=null,super.setMap(e),e&&(this._listener=e.on("click",this._handleClick.bind(this)))}collapse(e){e===!1?this.element.classList.remove("ol-collapsed"):this.element.classList.add("ol-collapsed")}getInputField(){return this._input}getTitle(e){return e.name||"No title"}_getTitleTxt(e){return f.create("DIV",{html:this.getTitle(e)}).innerText}search(){var e=this.element.querySelector("input.search");this._triggerCustomEvent("search",e)}_handleClick(e){this.get("reverse")&&(document.activeElement.blur(),this.reverseGeocode(e.coordinate))}reverseGeocode(){}_triggerCustomEvent(e,t){f.dispatchEvent(e,t)}setInput(e,t){var i=this.element.querySelector("input.search");i.value=e,t&&this._triggerCustomEvent("keyup",i)}select(e,t,i,r){var s={type:"select",search:e,reverse:!!t,coordinate:i};if(r)for(var a in r)s[a]=r[a];this.dispatchEvent(s)}_handleSelect(e,t,i){if(e){var r=this.get("history"),s;try{var a=JSON.stringify(e);for(s=r.length-1;s>=0;s--)(!r[s]||JSON.stringify(r[s])===a)&&r.splice(s,1)}catch{for(s=r.length-1;s>=0;s--)r[s]===e&&r.splice(s,1)}r.unshift(e);for(var n=Math.max(0,this.get("maxHistory")||10)||0;r.length>n;)r.pop();this.saveHistory(),this.select(e,t,null,i),t&&(this.setInput(this._getTitleTxt(e)),this.drawList_(),setTimeout(function(){this.collapse(!1)}.bind(this),300))}}saveHistory(){try{this.get("maxHistory")>=0?localStorage["ol@search-"+this._classname]=JSON.stringify(this.get("history")):localStorage.removeItem("ol@search-"+this._classname)}catch{console.warn("Failed to access localStorage...")}}restoreHistory(){if(this._history[this._classname])this.set("history",this._history[this._classname]);else try{this._history[this._classname]=JSON.parse(localStorage["ol@search-"+this._classname]),this.set("history",this._history[this._classname])}catch{this.set("history",[])}}clearHistory(){this.set("history",[]),this.saveHistory(),this.drawList_()}getHistory(){return this.get("history")}autocomplete(e,t){return t([]),!1}drawList_(e){var t=this,i=this.element.querySelector("ul.autocomplete");if(i.innerHTML="",this._list=[],e)i.setAttribute("class","autocomplete");else{var r=this.element.querySelector("input.search"),s=r.value;if(!s)e=this.get("history");else return;i.setAttribute("class","autocomplete history")}for(var a,n=Math.min(t.get("maxItems"),e.length),l=0;l<n;l++)if(e[l]&&(!l||!t.equalFeatures(e[l],e[l-1]))){a=document.createElement("LI"),a.setAttribute("data-search",this._list.length),this._list.push(e[l]),a.addEventListener("click",function(g){t._handleSelect(t._list[g.currentTarget.getAttribute("data-search")])});var c=t.getTitle(e[l]);c instanceof Element?a.appendChild(c):a.innerHTML=c,i.appendChild(a)}n&&this.get("copy")&&(a=document.createElement("LI"),a.classList.add("copy"),a.innerHTML=this.get("copy"),i.appendChild(a))}equalFeatures(){return!1}};Oe.prototype._history={};var Ge=class extends Fe{constructor(e){e=e||{},super(),this._auth=e.auth,this.set("dataType",e.dataType||"JSON")}static get(e){var t=new Ge(e);e.success&&t.on("success",function(i){e.success(i.response,i)}),e.error&&t.on("error",function(i){e.error(i)}),t.send(e.url,e.data,e.options)}static getCORS(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.send(),i.onreadystatechange=function(){this.readyState==this.HEADERS_RECEIVED&&t(i.getResponseHeader("Access-Control-Allow-Origin"))}}send(e,t,i){i=i||{};var r=this,s=i.encode!==!1;s&&(e=encodeURI(e));var a="";for(var n in t)t.hasOwnProperty(n)&&t[n]!==void 0&&(a+=(a?"&":"?")+n+"="+(s?encodeURIComponent(t[n]):t[n]));this._request&&i.abort!==!1&&this._request.abort();var l=this._request=new XMLHttpRequest;l.open("GET",e+a,!0),i.timeout&&(l.timeout=i.timeout),this._auth&&l.setRequestHeader("Authorization","Basic "+this._auth),this.dispatchEvent({type:"loadstart"}),l.onload=function(){if(r._request=null,r.dispatchEvent({type:"loadend"}),this.status>=200&&this.status<400){var c;try{switch(r.get("dataType")){case"JSON":{c=JSON.parse(this.response);break}default:c=this.response}}catch(g){r.dispatchEvent({type:"error",status:0,statusText:"parsererror",error:g,options:i,jqXHR:this});return}r.dispatchEvent({type:"success",response:c,status:this.status,statusText:this.statusText,options:i,jqXHR:this})}else r.dispatchEvent({type:"error",status:this.status,statusText:this.statusText,options:i,jqXHR:this})},l.ontimeout=function(){r._request=null,r.dispatchEvent({type:"loadend"}),r.dispatchEvent({type:"error",status:this.status,statusText:"Timeout",options:i,jqXHR:this})},l.onerror=function(){r._request=null,r.dispatchEvent({type:"loadend"}),r.dispatchEvent({type:"error",status:this.status,statusText:this.statusText,options:i,jqXHR:this})},l.send()}},nt=class extends Oe{constructor(e){e=e||{},e.className=e.className||"JSON",delete e.autocomplete,e.minLength=e.minLength||3,e.typing=e.typing||800,super(e);var t=e.url||"";if(window.location.protocol==="https:"){var i=document.createElement("a");i.href=t,i.protocol=window.location.protocol,t=i.href}this.set("url",t),this._ajax=new Ge({dataType:"JSON",auth:e.authentication}),this._ajax.on("success",function(r){r.status>=200&&r.status<400?typeof this._callback=="function"&&this._callback(r.response):(typeof this._callback=="function"&&this._callback(!1,"error"),console.log("AJAX ERROR",arguments))}.bind(this)),this._ajax.on("error",function(){typeof this._callback=="function"&&this._callback(!1,"error"),console.log("AJAX ERROR",arguments)}.bind(this)),this._ajax.on("loadstart",function(){this.element.classList.add("searching")}.bind(this)),this._ajax.on("loadend",function(){this.element.classList.remove("searching")}.bind(this)),typeof e.handleResponse=="function"&&(this.handleResponse=e.handleResponse)}ajax(e,t,i,r){r=r||{},this._callback=i,this._ajax.set("dataType",r.dataType||"JSON"),this._ajax.send(e,t,r)}autocomplete(e,t){var i=this.requestData(e),r=encodeURI(this.get("url"));this.ajax(r,i,function(s){typeof t=="function"&&t(this.handleResponse(s))})}requestData(e){return{q:e}}handleResponse(e){return e}},mt=class extends nt{constructor(e){e=e||{},e.className=e.className||"nominatim",e.typing=e.typing||-1,e.url=e.url||"https://nominatim.openstreetmap.org/search",e.copy='<a href="http://www.openstreetmap.org/copyright" target="new">&copy; OpenStreetMap contributors</a>',super(e),this.set("polygon",e.polygon),this.set("viewbox",e.viewbox),this.set("bounded",e.bounded)}getTitle(e){var t=[];e.class&&t.push(e.class),e.type&&t.push(e.type);var i=e.display_name+(t.length?"<i>"+t.join(" - ")+"</i>":"");return e.icon&&(i="<img src='"+e.icon+"' />"+i),i}requestData(e){var t={format:"json",addressdetails:1,q:e,polygon_geojson:this.get("polygon")?1:0,bounded:this.get("bounded")?1:0,limit:this.get("maxItems")};return this.get("viewbox")&&(t.viewbox=this.get("viewbox")),t}select(e){var t=[Number(e.lon),Number(e.lat)];try{t=Ee(t,"EPSG:4326",this.getMap().getView().getProjection())}catch{}this.dispatchEvent({type:"select",search:e,coordinate:t})}reverseGeocode(e,t){var i=Ee(e,this.getMap().getView().getProjection(),"EPSG:4326");this.ajax(this.get("url").replace("search","reverse"),{lon:i[0],lat:i[1],format:"json"},function(r){t?t.call(this,[r]):r&&!r.error&&this._handleSelect(r,!0)}.bind(this))}handleResponse(e){return e.results||e}},W=class extends ae{constructor(e){e=e||{};var t=document.createElement("div");if(t.classList.add("ol-unselectable","ol-control","ol-bar"),e.className){var i=e.className.split(" ").filter(function(a){return a.length>0});t.classList.add.apply(t.classList,i)}if(e.group&&t.classList.add("ol-group"),super({element:t,target:e.target}),e.id?this.element.setAttribute("id",e.id):this.element.setAttribute("id","ol-bar-"+ie(this)),this.set("toggleOne",e.toggleOne),this.set("autoDeactivate",e.autoDeactivate),this.controls_=[],e.controls instanceof Array)for(var r=0;r<e.controls.length;r++)this.addControl(e.controls[r]);for(var s in e.attributes||{})this.element.setAttribute(s,e.attributes[s])}setVisible(e){e?this.element.style.display="":this.element.style.display="none"}getVisible(){return this.element.style.display!="none"}setMap(e){super.setMap(e);for(var t=0;t<this.controls_.length;t++){var i=this.controls_[t];i.setMap(e)}}getControls(){return this.controls_}setPosition(e){this.element.classList.remove("ol-left","ol-top","ol-bottom","ol-right"),e=e.split("-");for(var t=0;t<e.length;t++)switch(e[t]){case"top":case"left":case"bottom":case"right":this.element.classList.add("ol-"+e[t]);break}}addControl(e){this.controls_.push(e),e.setTarget(this.element),this.getMap()&&this.getMap().addControl(e),e._activateBar&&e.un("change:active",e._activateBar),e._activateBar=function(t){this.onActivateControl_(t,e)}.bind(this),e.on("change:active",e._activateBar),e.getActive&&this.onActivateControl_({target:e,active:e.getActive()},e)}removeControl(e){const t=this.controls_.indexOf(e);t>-1&&(this.controls_.splice(t,1),this.getMap()&&this.getMap().removeControl(e),e._activateBar&&e.un("change:active",e._activateBar),delete e._activateBar)}deactivateControls(e){for(var t=0;t<this.controls_.length;t++)this.controls_[t]!==e&&this.controls_[t].setActive&&this.controls_[t].setActive(!1)}getActiveControls(){for(var e=[],t=0,i;i=this.controls_[t];t++)i.getActive&&i.getActive()&&e.push(i);return e}setActive(e){if(!e&&this.get("autoDeactivate")&&this.deactivateControls(),e)for(var t=this.getControls(),i=0,r;r=t[i];i++)r.get("autoActivate")&&r.setActive(!0)}onActivateControl_(e,t){if(this.get("toggleOne")){if(e.active){var i;for(i=0;i<this.controls_.length&&this.controls_[i]!==t;i++);if(i==this.controls_.length)return;this.deactivateControls(this.controls_[i])}else if(!this.getActiveControls().length){for(var r=0,s;s=this.controls_[r];r++)if(s.get("autoActivate")){s.setActive(!0);break}}}e.type?this.dispatchEvent({type:"control:active",control:t,active:e.active}):this.dispatchEvent({type:"control:add",control:t,active:e.active})}getControlsByName(e){var t=this.getControls();return t.filter(function(i){return i.get("name")===e})}},se=class extends ae{constructor(e){e=e||{};var t=document.createElement("div");t.className=(e.className||"")+" ol-button ol-unselectable ol-control",super({element:t,target:e.target});var i=this,r=this.button_=document.createElement(/ol-text-button/.test(e.className)?"div":"button");e.id?r.setAttribute("id",e.id):r.setAttribute("id","ol-button-"+ie(this)),this.button_.className=e.classButton||"",r.type="button",e.title&&(r.title=e.title),e.name&&(r.name=e.name),e.html instanceof Element?r.appendChild(e.html):r.innerHTML=e.html||"";var s=function(n){n&&n.preventDefault&&(n.preventDefault(),n.stopPropagation()),e.handleClick&&e.handleClick.call(i,n)};r.addEventListener("click",s),t.appendChild(r),!e.title&&r.firstElementChild&&(r.title=r.firstElementChild.title),e.title&&this.set("title",e.title),e.title&&this.set("title",e.title),e.name&&this.set("name",e.name);for(var a in e.attributes||{})this.button_.setAttribute(a,e.attributes[a])}setVisible(e){e?f.show(this.element):f.hide(this.element)}getDisable(){var e=this.element.querySelector("button");return e&&e.disabled}setDisable(e){this.getDisable()!=e&&(this.element.querySelector("button").disabled=e)}setTitle(e){this.button_.setAttribute("title",e)}setHtml(e){f.setHTML(this.button_,e)}getButtonElement(){return this.button_}},G=class extends se{constructor(e){e=e||{},e.toggleFn&&(e.onToggle=e.toggleFn),e.handleClick=function(){t.toggle(),e.onToggle&&e.onToggle.call(t,t.getActive())},e.className=(e.className||"")+" ol-toggle",super(e);var t=this;this.interaction_=e.interaction,this.interaction_&&(this.interaction_.setActive(e.active),this.interaction_.on("change:active",function(){t.setActive(t.interaction_.getActive())})),this.set("title",e.title),this.set("autoActivate",e.autoActivate),e.bar&&this.setSubBar(e.bar),this.setActive(e.active),this.setDisable(e.disable)}setMap(e){!e&&this.getMap()&&(this.interaction_&&this.getMap().removeInteraction(this.interaction_),this.subbar_&&this.getMap().removeControl(this.subbar_)),super.setMap(e),e&&(this.interaction_&&e.addInteraction(this.interaction_),this.subbar_&&e.addControl(this.subbar_))}getSubBar(){return this.subbar_}setSubBar(e){var t=this.getMap();t&&this.subbar_&&t.removeControl(this.subbar_),this.subbar_=e,e&&(this.subbar_.setTarget(this.element),this.subbar_.element.classList.add("ol-option-bar"),t&&t.addControl(this.subbar_),e.element.id&&(this.getButtonElement().setAttribute("aria-controls",e.element.id),e.element.setAttribute("aria-labelledby",this.getButtonElement().id),this.on("change:active",function(i){this.getButtonElement().setAttribute("aria-expanded",!!i.active)}.bind(this))))}getDisable(){var e=this.element.querySelector("button");return e&&e.disabled}setDisable(e){this.getDisable()!=e&&(this.element.querySelector("button").disabled=e,e&&this.getActive()&&this.setActive(!1),this.dispatchEvent({type:"change:disable",key:"disable",oldValue:!e,disable:e}))}getActive(){return this.element.classList.contains("ol-active")}toggle(){this.getActive()?this.setActive(!1):this.setActive(!0)}setActive(e){this.interaction_&&this.interaction_.setActive(e),this.subbar_&&this.subbar_.setActive(e),this.getActive()!==e&&(e?this.element.classList.add("ol-active"):this.element.classList.remove("ol-active"),this.button_.setAttribute("aria-pressed",e),this.dispatchEvent({type:"change:active",key:"active",oldValue:!e,active:e}))}setInteraction(e){this.interaction_=e}getInteraction(){return this.interaction_}},$=class extends se{constructor(e){e=e||{},e.className=(e.className||"")+" ol-text-button",super(e)}},Me=class extends re{constructor(e){super(e),this.on("select",function(t){this.getFeatures().clear(),this.delete(t.selected)}.bind(this))}_getSources(e){if(!this.getMap())return[];e||(e=this.getMap().getLayers());var t=[];return e.forEach(function(i){i.getLayers?t=t.concat(this._getSources(i.getLayers())):i.getSource&&i.getSource()instanceof N&&t.push(i.getSource())}.bind(this)),t}delete(e){if(e&&(e.length||e.getLength())){this.dispatchEvent({type:"deletestart",features:e});var t=[];this._getSources().forEach(function(i){try{e.forEach(function(r){i.removeFeature(r),t.push(r)})}catch{}}),this.dispatchEvent({type:"deleteend",features:t})}}},M=function(o,e){var t=o[0]-e[0],i=o[1]-e[1];return Math.sqrt(t*t+i*i)},P=function(o,e){return o[0]==e[0]&&o[1]==e[1]},xe=function(o,e){var t=[],i=o.length-1,r=i,s,a,n,l,c,g,h,u,d,v,_,y,w,L=P(o[0],o[i]);L||(_=o[0],y=o[1],w=[_[0]+(y[1]-_[1])/M(_,y)*e,_[1]-(y[0]-_[0])/M(_,y)*e],t.push(w),o.push(o[i]),i++,r--);for(var E=0;E<r;E++)_=o[E],y=o[(E+1)%i],w=o[(E+2)%i],s=(y[1]-_[1])/(y[0]-_[0]),a=(w[1]-y[1])/(w[0]-y[0]),Math.abs(s-a)>1e-10&&(n=Math.sqrt((y[0]-_[0])*(y[0]-_[0])+(y[1]-_[1])*(y[1]-_[1])),l=Math.sqrt((w[0]-y[0])*(w[0]-y[0])+(w[1]-y[1])*(w[1]-y[1])),c=_[0]+e*(y[1]-_[1])/n,g=y[0]+e*(w[1]-y[1])/l,h=_[1]-e*(y[0]-_[0])/n,u=y[1]-e*(w[0]-y[0])/l,d=(a*g-s*c+h-u)/(a-s),v=(s*a*(g-c)+a*h-s*u)/(a-s),y[0]-_[0]==0&&(d=y[0]+e*(y[1]-_[1])/Math.abs(y[1]-_[1]),v=a*d-a*g+u),w[0]-y[0]==0&&(d=w[0]+e*(w[1]-y[1])/Math.abs(w[1]-y[1]),v=s*d-s*c+h),t.push([d,v]));return L?t.push(t[0]):(o.pop(),_=o[o.length-1],y=o[o.length-2],w=[_[0]-(y[1]-_[1])/M(_,y)*e,_[1]+(y[0]-_[0])/M(_,y)*e],t.push(w)),t},Te=function(o,e){for(var t=0;t<e.length-1;t++){var i=e[t],r=e[t+1];if(P(o,i)||P(o,r))return{index:1,segment:[i,r]};var s=M(i,r),a=[(r[0]-i[0])/s,(r[1]-i[1])/s],n=M(i,o),l=[(o[0]-i[0])/n,(o[1]-i[1])/n];if(Math.abs(a[0]*l[1]-a[1]*l[0])<1e-10)return{index:1,segment:[i,r]}}return{index:-1}},Re;(function(){function o(t,i){var r;for(let s=t.length-1;s>0;s--)(t[s][0]>i&&t[s-1][0]<i||t[s][0]<i&&t[s-1][0]>i)&&(r=[i,(i-t[s][0])/(t[s-1][0]-t[s][0])*(t[s-1][1]-t[s][1])+t[s][1]],t.splice(s,0,r))}function e(t,i){var r;for(let s=t.length-1;s>0;s--)(t[s][1]>i&&t[s-1][1]<i||t[s][1]<i&&t[s-1][1]>i)&&(r=[(i-t[s][1])/(t[s-1][1]-t[s][1])*(t[s-1][0]-t[s][0])+t[s][0],i],t.splice(s,0,r))}Re=function(t,i){var r=i.getType()==="Polygon";if(!r&&i.getType()!=="MultiPolygon")return null;var s=i.getCoordinates();return r&&(s=[s]),s.forEach(function(a){a.forEach(function(n){o(n,t[0]),o(n,t[2]),e(n,t[1]),e(n,t[3])})}),s.forEach(function(a){a.forEach(function(n){n.forEach(function(l){l[0]<t[0]?l[0]=t[0]:l[0]>t[2]&&(l[0]=t[2]),l[1]<t[1]?l[1]=t[1]:l[1]>t[3]&&(l[1]=t[3])})})}),r?new R(s[0]):new Q(s)}})();var oe=function(o,e,t,i){var r=[];i!==!1&&r.push(o);var s=M(o,e);if(s){var a=Math.round(s/t);if(a>1)for(var n=(e[0]-o[0])/a,l=(e[1]-o[1])/a,c=1;c<a;c++)r.push([o[0]+n*c,o[1]+l*c])}return r.push(e),r};D.prototype.sampleAt=function(o){for(var e=this.getCoordinates(),t=[],i=1;i<e.length;i++)t=t.concat(oe(e[i-1],e[i],o,i===1));return new D(t)};Se.prototype.sampleAt=function(o){var e=this.getCoordinates(),t=[];return e.forEach(function(i){for(var r=[],s=1;s<i.length;s++)r=r.concat(oe(i[s-1],i[s],o,s===1));t.push(r)}),new Se(t)};R.prototype.sampleAt=function(o){var e=this.getCoordinates(),t=[];return e.forEach(function(i){for(var r=[],s=1;s<i.length;s++)r=r.concat(oe(i[s-1],i[s],o,s===1));t.push(r)}),new R(t)};Q.prototype.sampleAt=function(o){var e=this.getCoordinates(),t=[];return e.forEach(function(i){var r=[];t.push(r),i.forEach(function(s){for(var a=[],n=1;n<s.length;n++)a=a.concat(oe(s[n-1],s[n],o,n===1));r.push(a)})}),new Q(t)};ve.prototype.intersection=function(o,e){if(o.sampleAt){var t=ne(this.getCenter().concat(this.getCenter()),this.getRadius());o=Re(t,o),o=o.simplify(e);var i=this.getCenter(),r=this.getRadius(),s=o.sampleAt(e).getCoordinates();switch(o.getType()){case"Polygon":s=[s];case"MultiPolygon":{var a=!1,n=[];return s.forEach(function(l){var c=[];n.push(c),l.forEach(function(g){var h=[];c.push(h),g.forEach(function(u){var d=M(i,u);d>r?(a=!0,h.push([i[0]+r/d*(u[0]-i[0]),i[1]+r/d*(u[1]-i[1])])):h.push(u)})})}),a?o.getType()==="Polygon"?new R(n[0]):new Q(n):o}}}else console.warn("[ol/geom/Circle~intersection] Unsupported geometry type: "+o.getType());return o};var Ve;(function(){var o=[255,255,255,1],e=[0,153,255,1],t=3,i=[new U({stroke:new F({color:o,width:t+2})}),new U({image:new ee({radius:t*2,fill:new z({color:e}),stroke:new F({color:o,width:t/2})}),stroke:new F({color:e,width:t}),fill:new z({color:[255,255,255,.5]})})];Ve=function(r){if(r===!0)return i;r=r||{};var s=new z({color:r.fillColor||"rgba(255,255,255,0.4)"}),a=new F({color:r.color||"#3399CC",width:1.25}),n=new U({image:new ee({fill:s,stroke:a,radius:5}),fill:s,stroke:a});return[n]}})();const qe=Ve;var Pe=class extends me{constructor(e){e=e||{},super({handleDownEvent:function(i){return t.handleDownEvent_(i)},handleDragEvent:function(i){return t.handleDragEvent_(i)},handleMoveEvent:function(i){return t.handleMoveEvent_(i)},handleUpEvent:function(i){return t.handleUpEvent_(i)}});var t=this;this._filter=e.filter,this.features_=e.features,this.layers_=e.layers?e.layers instanceof Array?e.layers:[e.layers]:null,this.set("duplicate",e.duplicate),this.source_=e.source,this._style=typeof e.style=="function"?e.style:function(){return e.style?e.style:qe(!0)},this.previousCursor_=!1}getFeatureAtPixel_(e){var t=this;return this.getMap().forEachFeatureAtPixel(e.pixel,function(i,r){var s;if(t._filter&&!t._filter(i,r))return!1;if(t.layers_){for(var a=0;a<t.layers_.length;a++)if(t.layers_[a]===r){s=i;break}}else t.features_?t.features_.forEach(function(u){u===i&&(s=i)}):s=i;var n=s.getGeometry().getType();if(s&&/Polygon|LineString/.test(n)){if(n==="Polygon"&&s.getGeometry().getCoordinates().length>1)return!1;var l=s.getGeometry().getClosestPoint(e.coordinate),c=l[0]-e.coordinate[0],g=l[1]-e.coordinate[1],h=Math.sqrt(c*c+g*g)/e.frameState.viewState.resolution;return h<5?{feature:s,hit:l,coordinates:s.getGeometry().getCoordinates(),geom:s.getGeometry().clone(),geomType:n}:!1}else return!1},{hitTolerance:5})}handleDownEvent_(e){return this.current_=this.getFeatureAtPixel_(e),this.current_?(this.currentStyle_=this.current_.feature.getStyle(),this.source_&&(this.get("duplicate")||e.originalEvent.ctrlKey)?(this.current_.feature=this.current_.feature.clone(),this.current_.feature.setStyle(this._style(this.current_.feature)),this.source_.addFeature(this.current_.feature)):(this.current_.feature.setStyle(this._style(this.current_.feature)),this._modifystart=!0),this.dispatchEvent({type:"offsetstart",feature:this.current_.feature,offset:0}),!0):!1}handleDragEvent_(e){this._modifystart&&(this.dispatchEvent({type:"modifystart",features:[this.current_.feature]}),this._modifystart=!1);var t=this.current_.geom.getClosestPoint(e.coordinate),i=M(t,e.coordinate),r,s,a,n;switch(this.current_.geomType){case"Polygon":{if(r=Te(t,this.current_.coordinates[0]).segment,r){s=[r[1][0]-r[0][0],r[1][1]-r[0][1]],a=[e.coordinate[0]-t[0],e.coordinate[1]-t[1]],s[0]*a[1]-s[1]*a[0]>0&&(i=-i),n=[];for(var l=0;l<this.current_.coordinates.length;l++)n.push(xe(this.current_.coordinates[l],l==0?i:-i));this.current_.feature.setGeometry(new R(n))}break}case"LineString":{r=Te(t,this.current_.coordinates).segment,r&&(s=[r[1][0]-r[0][0],r[1][1]-r[0][1]],a=[e.coordinate[0]-t[0],e.coordinate[1]-t[1]],s[0]*a[1]-s[1]*a[0]>0&&(i=-i),n=xe(this.current_.coordinates,i),this.current_.feature.setGeometry(new D(n)));break}}this.dispatchEvent({type:"offsetting",feature:this.current_.feature,offset:i,segment:[t,e.coordinate],coordinate:e.coordinate})}handleUpEvent_(e){this._modifystart||this.dispatchEvent({type:"offsetend",feature:this.current_.feature,coordinate:e.coordinate}),this.current_.feature.setStyle(this.currentStyle_),this.current_=!1}handleMoveEvent_(e){var t=this.getFeatureAtPixel_(e);t?(this.previousCursor_===!1&&(this.previousCursor_=e.map.getTargetElement().style.cursor),f.setCursor(e.map,"pointer")):(f.setCursor(e.map,this.previousCursor_),this.previousCursor_=!1)}};D.prototype.splitAt=function(o,e){var t;if(!o)return[this];if(e||(e=1e-10),o.length&&o[0].length){var i=[this];for(t=0;t<o.length;t++){for(var r=[],s=0;s<i.length;s++){var a=i[s].splitAt(o[t],e);r=r.concat(a)}i=r}return i}if(P(o,this.getFirstCoordinate())||P(o,this.getLastCoordinate()))return[this];var n=this.getCoordinates(),l=[n[0]],c=[];for(t=0;t<n.length-1;t++)if(!P(n[t],n[t+1])){if(P(o,n[t+1]))l.push(n[t+1]),c.push(new D(l)),l=[];else if(!P(o,n[t])){var g,h,u=!1;n[t][0]==n[t+1][0]?(g=(n[t][1]-o[1])/(n[t][1]-n[t+1][1]),u=n[t][0]==o[0]&&0<g&&g<=1):n[t][1]==n[t+1][1]?(g=(n[t][0]-o[0])/(n[t][0]-n[t+1][0]),u=n[t][1]==o[1]&&0<g&&g<=1):(g=(n[t][0]-o[0])/(n[t][0]-n[t+1][0]),h=(n[t][1]-o[1])/(n[t][1]-n[t+1][1]),u=Math.abs(g-h)<=e&&0<g&&g<=1),u&&(l.push(o),c.push(new D(l)),l=[o])}l.push(n[t+1])}return l.length>1&&c.push(new D(l)),c.length?c:[this]};var De=class extends Z{constructor(e){e||(e={}),super({handleEvent:function(c){switch(c.type){case"singleclick":return this.handleDownEvent(c);case"pointermove":return this.handleMoveEvent(c);default:return!0}}}),this.snapDistance_=e.snapDistance||25,this.tolerance_=e.tolerance||1e-10,this.cursor_=e.cursor,this.setSources(e.sources),e.features&&(this.sources_||(this.sources_=[]),this.sources_.push(new N({features:e.features}))),this.filterSplit_=e.filter||function(){return!0};var t=[255,255,255,1],i=[0,153,255,1],r=3,s=new z({color:"rgba(255,255,255,0.4)"}),a=new F({color:"#3399CC",width:1.25}),n=[new U({image:new ee({fill:s,stroke:a,radius:5}),fill:s,stroke:a})],l=[new U({stroke:new F({color:t,width:r+2})}),new U({image:new ee({radius:2*r,fill:new z({color:i}),stroke:new F({color:t,width:r/2})}),stroke:new F({color:i,width:r})})];e.sketchStyle&&(n=e.sketchStyle instanceof Array?e.sketchStyle:[e.sketchStyle]),e.featureStyle&&(l=e.featureStyle instanceof Array?e.featureStyle:[e.featureStyle]),this.overlayLayer_=new Y({source:new N({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(c){return c._sketch_?n:l}})}setMap(e){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),super.setMap(e),this.overlayLayer_.setMap(e)}getSources(){if(!this.sources_&&this.getMap()){var e=[],t=function(i){i.forEach(function(r){r.getVisible()&&(r.getSource&&r.getSource()instanceof N?e.unshift(r.getSource()):r.getLayers&&t(r.getLayers()))})};return t(this.getMap().getLayers()),e}return this.sources_||[]}setSources(e){this.sources_=e?e instanceof Array?e||!1:[e]:!1}getClosestFeature(e){var t,i,r,s,a=this.snapDistance_+1;if(this.getSources().forEach(function(c){var g=c.getClosestFeatureToCoordinate(e.coordinate);if(g&&g.getGeometry().splitAt){var h=g.getGeometry().getClosestPoint(e.coordinate),u=new D([e.coordinate,h]),d=u.getLength()/e.frameState.viewState.resolution;d<a&&(t=c,a=d,i=g,s=u,r=h)}}),a>this.snapDistance_)return!1;var n=this.getNearestCoord(r,i.getGeometry().getCoordinates()),l=this.getMap().getPixelFromCoordinate(n);return M(e.pixel,l)<this.snapDistance_&&(r=n),{source:t,feature:i,coord:r,link:s}}getNearestCoord(e,t){for(var i,r=Number.MAX_VALUE,s,a=0;a<t.length;a++)i=M(e,t[a]),i<r&&(r=i,s=t[a]);return s}handleDownEvent(e){var t=this.getClosestFeature(e);if(t){var i=this;i.overlayLayer_.getSource().clear();var r=t.feature.getGeometry().splitAt(t.coord,this.tolerance_),s;if(r.length>1){var a=[];for(s=0;s<r.length;s++){var n=t.feature.clone();n.setGeometry(r[s]),a.push(n)}for(i.dispatchEvent({type:"beforesplit",original:t.feature,features:a}),t.source.dispatchEvent({type:"beforesplit",original:t.feature,features:a}),t.source.removeFeature(t.feature),s=0;s<a.length;s++)t.source.addFeature(a[s]);i.dispatchEvent({type:"aftersplit",original:t.feature,features:a}),t.source.dispatchEvent({type:"aftersplit",original:t.feature,features:a})}}return!1}handleMoveEvent(e){var t=e.map;this.overlayLayer_.getSource().clear();var i=this.getClosestFeature(e);if(i&&this.filterSplit_(i.feature)){var r,s;this.overlayLayer_.getSource().addFeature(i.feature),r=new x(new I(i.coord)),r._sketch_=!0,this.overlayLayer_.getSource().addFeature(r),s=new x(i.link),s._sketch_=!0,this.overlayLayer_.getSource().addFeature(s),this.dispatchEvent({type:"pointermove",coordinate:e.coordinate,frameState:e.frameState,originalEvent:e.originalEvent,map:e.map,pixel:e.pixel,feature:i.feature,linkGeometry:i.link})}else this.dispatchEvent(e);var a=t.getTargetElement();this.cursor_&&(i?a.style.cursor!=this.cursor_&&(this.previousCursor_=a.style.cursor,f.setCursor(a,this.cursor_)):this.previousCursor_!==void 0&&(f.setCursor(a,this.previousCursor_),this.previousCursor_=void 0))}},_e=class extends me{constructor(e){e=e||{},super({handleDownEvent:function(i){return t.handleDownEvent_(i)},handleDragEvent:function(i){return this.handleDragEvent_(i)},handleMoveEvent:function(i){return this.handleMoveEvent_(i)},handleUpEvent:function(i){return this.handleUpEvent_(i)}});var t=this;this.selection_=new J,this.handles_=new J,this.overlayLayer_=new Y({source:new N({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(i){return t.style[(i.get("handle")||"default")+(i.get("constraint")||"")+(i.get("option")||"")]},updateWhileAnimating:!0,updateWhileInteracting:!0}),this.features_=e.features,typeof e.filter=="function"&&(this._filter=e.filter),this.layers_=e.layers?e.layers instanceof Array?e.layers:[e.layers]:null,this._handleEvent=e.condition||function(){return!0},this.addFn_=e.addCondition||function(){return!1},this.setPointRadius(e.pointRadius),this.set("translateFeature",e.translateFeature!==!1),this.set("translate",e.translate!==!1),this.set("translateBBox",e.translateBBox===!0),this.set("stretch",e.stretch!==!1),this.set("scale",e.scale!==!1),this.set("rotate",e.rotate!==!1),this.set("keepAspectRatio",e.keepAspectRatio||function(i){return i.originalEvent.shiftKey}),this.set("modifyCenter",e.modifyCenter||function(i){return i.originalEvent.metaKey||i.originalEvent.ctrlKey}),this.set("noFlip",e.noFlip||!1),this.set("selection",e.selection!==!1),this.set("hitTolerance",e.hitTolerance||0),this.set("enableRotatedTransform",e.enableRotatedTransform||!1),this.set("keepRectangle",e.keepRectangle||!1),this.set("buffer",e.buffer||0),this.on("propertychange",function(){this.drawSketch_()}),this.setDefaultStyle(),e.select?this.on("change:active",function(i){this.getActive()?this.setSelection(e.select.getFeatures().getArray()):(e.select.getFeatures().extend(this.selection_),this.selection_.forEach(function(r){e.select.getFeatures().push(r)}),this.select(null))}.bind(this)):this.on("change:active",function(i){this.select(null)}.bind(this))}setMap(e){var t=this.getMap();t&&(t.removeLayer(this.overlayLayer_),this.previousCursor_&&f.setCursor(t,this.previousCursor_),this.previousCursor_=void 0),super.setMap(e),this.overlayLayer_.setMap(e),e===null&&this.select(null),e!==null&&(this.isTouch=/touch/.test(e.getViewport().className),this.setDefaultStyle())}setActive(e){this.overlayLayer_&&this.overlayLayer_.setVisible(e),super.setActive(e)}setDefaultStyle(e){e=e||{};var t=e.pointStroke||new F({color:[255,0,0,1],width:1}),i=e.stroke||new F({color:[255,0,0,1],width:1,lineDash:[4,4]}),r=e.fill||new z({color:[255,0,0,.01]}),s=e.pointFill||new z({color:[255,255,255,.8]}),a=new ue({fill:s,stroke:t,radius:this.isTouch?12:6,displacement:this.isTouch?[24,-24]:[12,-12],points:15});a.setDisplacement||(a.getAnchor()[0]=this.isTouch?-10:-5);var n=new ue({fill:s,stroke:t,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),l=new ue({fill:s,stroke:t,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function c(g,h,u){return[new U({image:g,stroke:h,fill:u})]}this.style={default:c(n,i,r),translate:c(n,t,s),rotate:c(a,t,s),rotate0:c(n,t,s),scale:c(n,t,s),scale1:c(n,t,s),scale2:c(n,t,s),scale3:c(n,t,s),scalev:c(l,t,s),scaleh1:c(l,t,s),scalev2:c(l,t,s),scaleh3:c(l,t,s)},this.drawSketch_()}setStyle(e,t){if(t){t instanceof Array?this.style[e]=t:this.style[e]=[t];for(var i=0;i<this.style[e].length;i++){var r=this.style[e][i].getImage();r&&(e=="rotate"&&(r.getAnchor()[0]=-5),this.isTouch&&r.setScale(1.8));var s=this.style[e][i].getText();s&&(e=="rotate"&&s.setOffsetX(this.isTouch?14:7),this.isTouch&&s.setScale(1.8))}this.drawSketch_()}}getFeatureAtPixel_(e){var t=this;return this.getMap().forEachFeatureAtPixel(e,function(i,r){var s=!1;if(!r){if(i===t.bbox_)return t.get("translateBBox")?{feature:i,handle:"translate",constraint:"",option:""}:!1;if(t.handles_.forEach(function(n){n===i&&(s=!0)}),s)return{feature:i,handle:i.get("handle"),constraint:i.get("constraint"),option:i.get("option")}}if(!t.get("selection"))return t.selection_.getArray().some(function(n){return i===n})?{feature:i}:null;if(t._filter)return t._filter(i,r)?{feature:i}:null;if(t.layers_){for(var a=0;a<t.layers_.length;a++)if(t.layers_[a]===r)return{feature:i};return null}else return t.features_?(t.features_.forEach(function(n){n===i&&(s=!0)}),s?{feature:i}:null):{feature:i}},{hitTolerance:this.get("hitTolerance")})||{}}getGeometryRotateToZero_(e,t){var i=e.getGeometry(),r=this.getMap().getView().getRotation();if(r===0||!this.get("enableRotatedTransform"))return t?i.clone():i;var s=i.clone();return s.rotate(r*-1,this.getMap().getView().getCenter()),s}_isRectangle(e){if(this.get("keepRectangle")&&e.getType()==="Polygon"){var t=e.getCoordinates()[0];return t.length===5}return!1}drawSketch_(e){var t,i,r,s=this.selection_.item(0)&&this._isRectangle(this.selection_.item(0).getGeometry());if(this.overlayLayer_.getSource().clear(),!!this.selection_.getLength()){var a=this.getMap().getView().getRotation(),n=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent(),l;s&&(l=this.getGeometryRotateToZero_(this.selection_.item(0)).getCoordinates()[0].slice(0,4),l.unshift(l[3])),n=ne(n,this.get("buffer")),this.selection_.forEach(function(_){var y=this.getGeometryRotateToZero_(_).getExtent();fe(n,y)}.bind(this));var c=this.selection_.getLength()===1?this._pointRadius(this.selection_.item(0)):0;if(c&&!(c instanceof Array)&&(c=[c,c]),e===!0)this.ispt_||(this.overlayLayer_.getSource().addFeature(new x({geometry:new I(this.center_),handle:"rotate0"})),r=te(n),this.get("enableRotatedTransform")&&a!==0&&r.rotate(a,this.getMap().getView().getCenter()),i=this.bbox_=new x(r),this.overlayLayer_.getSource().addFeature(i));else{if(this.ispt_){var g=this.getMap().getPixelFromCoordinate(de(n));if(g){var h=c&&c[0]||10,u=c&&c[1]||10;n=Ne([this.getMap().getCoordinateFromPixel([g[0]-h,g[1]-u]),this.getMap().getCoordinateFromPixel([g[0]+h,g[1]+u])])}}r=s?new R([l]):te(n),this.get("enableRotatedTransform")&&a!==0&&r.rotate(a,this.getMap().getView().getCenter()),i=this.bbox_=new x(r);var d=[],v=r.getCoordinates()[0];if(!this.ispt_||c){if(d.push(i),!this.iscircle_&&!this.ispt_&&this.get("stretch")&&this.get("scale"))for(t=0;t<v.length-1;t++)i=new x({geometry:new I([(v[t][0]+v[t+1][0])/2,(v[t][1]+v[t+1][1])/2]),handle:"scale",constraint:t%2?"h":"v",option:t}),d.push(i);if(this.get("scale"))for(t=0;t<v.length-1;t++)i=new x({geometry:new I(v[t]),handle:"scale",option:t}),d.push(i);this.get("translate")&&!this.get("translateFeature")&&(i=new x({geometry:new I([(v[0][0]+v[2][0])/2,(v[0][1]+v[2][1])/2]),handle:"translate"}),d.push(i))}!this.iscircle_&&this.get("rotate")&&(i=new x({geometry:new I(v[3]),handle:"rotate"}),d.push(i)),this.overlayLayer_.getSource().addFeatures(d)}}}select(e,t){if(!e){this.selection_&&(this.selection_.clear(),this.drawSketch_());return}if(!(!e.getGeometry||!e.getGeometry())){if(t)this.selection_.push(e);else{var i=this.selection_.getArray().indexOf(e);this.selection_.removeAt(i)}this.ispt_=this.selection_.getLength()===1?this.selection_.item(0).getGeometry().getType()=="Point":!1,this.iscircle_=this.selection_.getLength()===1?this.selection_.item(0).getGeometry().getType()=="Circle":!1,this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:e,features:this.selection_})}}setSelection(e){this.selection_.clear(),e.forEach(function(t){this.selection_.push(t)}.bind(this)),this.ispt_=this.selection_.getLength()===1?this.selection_.item(0).getGeometry().getType()=="Point":!1,this.iscircle_=this.selection_.getLength()===1?this.selection_.item(0).getGeometry().getType()=="Circle":!1,this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",features:this.selection_})}watchFeatures_(){this._featureListeners&&this._featureListeners.forEach(function(e){j(e)}),this._featureListeners=[],this.selection_.forEach(function(e){this._featureListeners.push(e.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))}handleDownEvent_(e){if(this._handleEvent(e,this.selection_)){var t=this.getFeatureAtPixel_(e.pixel),i=t.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(i)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(t.handle="translate"),t.handle){this.mode_=t.handle,this.opt_=t.option,this.constraint_=t.constraint;var r=this.getMap().getView().getRotation();this.coordinate_=i.get("handle")?i.getGeometry().getCoordinates():e.coordinate,this.pixel_=this.getMap().getCoordinateFromPixel(this.coordinate_),this.geoms_=[],this.rotatedGeoms_=[];var s=Ce(),a=Ce();this.hasChanged_=!1;for(var n=0,l;l=this.selection_.item(n);n++)if(this.geoms_.push(l.getGeometry().clone()),s=fe(s,l.getGeometry().getExtent()),this.get("enableRotatedTransform")&&r!==0){var c=this.getGeometryRotateToZero_(l,!0);this.rotatedGeoms_.push(c),a=fe(a,c.getExtent())}if(this.extent_=te(s).getCoordinates()[0],this.get("enableRotatedTransform")&&r!==0&&(this.rotatedExtent_=te(a).getCoordinates()[0]),this.mode_==="rotate"){this.center_=this.getCenter()||de(s);var g=e.map.getTargetElement();f.setCursor(g,this.Cursors.rotate0),this.previousCursor_=g.style.cursor}else this.center_=de(s);return this.angle_=Math.atan2(this.center_[1]-e.coordinate[1],this.center_[0]-e.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:e.pixel,coordinate:e.coordinate}),!0}else if(this.get("selection")){if(i){this.addFn_(e)||this.selection_.clear();var h=this.selection_.getArray().indexOf(i);h<0?this.selection_.push(i):this.selection_.removeAt(h)}else this.selection_.clear();return this.ispt_=this.selection_.getLength()===1?this.selection_.item(0).getGeometry().getType()=="Point":!1,this.iscircle_=this.selection_.getLength()===1?this.selection_.item(0).getGeometry().getType()=="Circle":!1,this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:i,features:this.selection_,pixel:e.pixel,coordinate:e.coordinate}),!1}}}getCenter(){return this.get("center")}setCenter(e){return this.set("center",e)}handleDragEvent_(e){if(this._handleEvent(e,this.features_)){var t=this.getMap().getView().getRotation(),i,r,s,a,n=[this.coordinate_[0],this.coordinate_[1]],l=[e.coordinate[0],e.coordinate[1]];switch(this.isUpdating_=!0,this.hasChanged_=!0,this.mode_){case"rotate":{var c=Math.atan2(this.center_[1]-l[1],this.center_[0]-l[0]);if(!this.ispt)for(i=0,s;s=this.selection_.item(i);i++)a=this.geoms_[i].clone(),a.rotate(c-this.angle_,this.center_),a.getType()=="Circle"&&a.setCenterAndRadius(a.getCenter(),a.getRadius()),s.setGeometry(a);this.drawSketch_(!0),this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:c-this.angle_,pixel:e.pixel,coordinate:e.coordinate});break}case"translate":{var g=l[0]-n[0],h=l[1]-n[1];for(i=0,s;s=this.selection_.item(i);i++)s.getGeometry().translate(g,h);this.handles_.forEach(function(S){S.getGeometry().translate(g,h)}),this.coordinate_=e.coordinate,this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[g,h],pixel:e.pixel,coordinate:e.coordinate});break}case"scale":{var u=this.center_;if(this.get("modifyCenter")(e)){var d=this.extent_;this.get("enableRotatedTransform")&&t!==0&&(d=this.rotatedExtent_),u=d[(Number(this.opt_)+2)%4]}var v=this.geoms_.length==1&&this._isRectangle(this.geoms_[0]),_=this.constraint_,y=this.opt_,w=this.coordinate_,L=e.coordinate;if(this.get("enableRotatedTransform")&&t!==0){var E=new I(this.coordinate_);E.rotate(t*-1,u),w=E.getCoordinates();var k=new I(e.coordinate);k.rotate(t*-1,u),L=k.getCoordinates()}var T=(L[0]-u[0])/(w[0]-u[0]),p=(L[1]-u[1])/(w[1]-u[1]),m=[L[0]-w[0],L[1]-w[1]];if(this.get("enableRotatedTransform")&&t!==0){var C=new I(u);C.rotate(t*-1,this.getMap().getView().getCenter()),u=C.getCoordinates()}for(this.get("noFlip")&&(T<0&&(T=-T),p<0&&(p=-p)),this.constraint_?this.constraint_=="h"?T=1:p=1:this.get("keepAspectRatio")(e)&&(T=p=Math.min(T,p)),i=0,s;s=this.selection_.item(i);i++)a=t===0||!this.get("enableRotatedTransform")?this.geoms_[i].clone():this.rotatedGeoms_[i].clone(),a.applyTransform(function(S,b,le){if(le<2)return b;if(v){var ce=[[6],[0,8],[2],[4]],O=[S[0],S[1]],V=[S[2],S[3]],X=[S[4],S[5]],q=[S[6],S[7]],he=[S[8],S[9]];if(_){var He=y%2===0?this._countVector(O,V):this._countVector(q,O),we=this._projectVectorOnVector(m,He),Be=y+1<ce.length?y+1:0,Le=[...ce[y],...ce[Be]];for(r=0;r<S.length;r+=le)b[r]=Le.includes(r)?S[r]+we[0]:S[r],b[r+1]=Le.includes(r)?S[r+1]+we[1]:S[r+1]}else{var H,B;switch(y){case 0:m=this._countVector(q,L),H=this._projectVectorOnVector(m,this._countVector(X,q)),B=this._projectVectorOnVector(m,this._countVector(O,q)),[b[0],b[1]]=this._movePoint(O,H),[b[4],b[5]]=this._movePoint(X,B),[b[6],b[7]]=this._movePoint(q,m),[b[8],b[9]]=this._movePoint(he,H);break;case 1:m=this._countVector(O,L),H=this._projectVectorOnVector(m,this._countVector(q,O)),B=this._projectVectorOnVector(m,this._countVector(V,O)),[b[0],b[1]]=this._movePoint(O,m),[b[2],b[3]]=this._movePoint(V,H),[b[6],b[7]]=this._movePoint(q,B),[b[8],b[9]]=this._movePoint(he,m);break;case 2:m=this._countVector(V,L),H=this._projectVectorOnVector(m,this._countVector(O,V)),B=this._projectVectorOnVector(m,this._countVector(X,V)),[b[0],b[1]]=this._movePoint(O,B),[b[2],b[3]]=this._movePoint(V,m),[b[4],b[5]]=this._movePoint(X,H),[b[8],b[9]]=this._movePoint(he,B);break;case 3:m=this._countVector(X,L),H=this._projectVectorOnVector(m,this._countVector(V,X)),B=this._projectVectorOnVector(m,this._countVector(q,X)),[b[2],b[3]]=this._movePoint(V,B),[b[4],b[5]]=this._movePoint(X,m),[b[6],b[7]]=this._movePoint(q,H);break}}}else for(r=0;r<S.length;r+=le)T!=1&&(b[r]=u[0]+(S[r]-u[0])*T),p!=1&&(b[r+1]=u[1]+(S[r+1]-u[1])*p);return a.getType()=="Circle"&&a.setCenterAndRadius(a.getCenter(),a.getRadius()),b}.bind(this)),this.get("enableRotatedTransform")&&t!==0&&a.rotate(t,this.getMap().getView().getCenter()),s.setGeometry(a);this.drawSketch_(),this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[T,p],pixel:e.pixel,coordinate:e.coordinate});break}}this.isUpdating_=!1}}handleMoveEvent_(e){if(this._handleEvent(e,this.features_)&&!this.mode_){var t=this.getFeatureAtPixel_(e.pixel),i=e.map.getTargetElement();if(t.feature){var r=t.handle?this.Cursors[(t.handle||"default")+(t.constraint||"")+(t.option||"")]:this.Cursors.select;this.previousCursor_===void 0&&(this.previousCursor_=i.style.cursor),f.setCursor(i,r)}else this.previousCursor_!==void 0&&f.setCursor(i,this.previousCursor_),this.previousCursor_=void 0}}handleUpEvent_(e){if(this.mode_==="rotate"){var t=e.map.getTargetElement();f.setCursor(t,this.Cursors.default),this.previousCursor_=void 0}return this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_,transformed:this.hasChanged_}),this.drawSketch_(),this.hasChanged_=!1,this.mode_=null,!1}setPointRadius(e){typeof e=="function"?this._pointRadius=e:this._pointRadius=function(){return e}}getFeatures(){return this.selection_}_projectVectorOnVector(e,t){var i=(e[0]*t[0]+e[1]*t[1])/(t[0]*t[0]+t[1]*t[1]);return[t[0]*i,t[1]*i]}_countVector(e,t){return[t[0]-e[0],t[1]-e[1]]}_movePoint(e,t){return[e[0]+t[0],e[1]+t[1]]}};_e.prototype.Cursors={default:"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"};var Ae=class extends Z{constructor(e){e=e||{};var t,i;super({handleEvent:function(s){switch(s.type){case"pointerdown":return t=this.handleDownEvent(s),i=t||this._deleteCondition(s),!t;case"pointerup":return t=!1,this.handleUpEvent(s);case"pointerdrag":return t?this.handleDragEvent(s):!0;case"pointermove":return t?!1:this.handleMoveEvent(s);case"singleclick":case"click":return!i;default:return!0}}}),this.snapDistance_=e.pixelTolerance||10,this.tolerance_=1e-10,this.cursor_=e.cursor,this.sources_=e.sources?e.sources instanceof Array?e.sources:[e.sources]:[],e.source&&this.sources_.push(e.source),e.features&&this.sources_.push(new N({features:e.features})),this.filterSplit_=e.filter||function(){return!0},this._condition=e.condition||Je,this._deleteCondition=e.deleteCondition||Ye,this._insertVertexCondition=e.insertVertexCondition||Ze;var r=function(){return[new U({image:new ee({radius:6,fill:new z({color:[0,153,255,1]}),stroke:new F({color:"#FFF",width:1.25})})})]};e.style&&(typeof e.style=="function"?r=e.style:r=function(){return e.style}),this.overlayLayer_=new Y({source:new N({useSpatialIndex:!1}),name:"Modify overlay",displayInLayerSwitcher:!1,style:r,wrapX:e.wrapX})}setMap(e){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),super.setMap(e),this.overlayLayer_.setMap(e)}setActive(e){super.setActive(e),this.overlayLayer_&&this.overlayLayer_.getSource().clear()}setFilter(e){typeof e=="function"?this.filterSplit_=e:e===void 0&&(this.filterSplit_=function(){return!0})}getClosestFeature(e){for(var t,i,r=this.snapDistance_+1,s=0;s<this.sources_.length;s++){var a=this.sources_[s];if(t=a.getClosestFeatureToCoordinate(e.coordinate),t&&this.filterSplit_(t)){var n=t.getGeometry().getClosestPoint(e.coordinate),l=M(e.coordinate,n)/e.frameState.viewState.resolution;l<r&&(r=l,i=n);break}}if(r>this.snapDistance_)return this.currentFeature&&this.dispatchEvent({type:"select",selected:[],deselected:[this.currentFeature]}),this.currentFeature=null,!1;var c=this.getNearestCoord(i,t.getGeometry());if(c){c=c.coord;var g=this.getMap().getPixelFromCoordinate(c);return M(e.pixel,g)<this.snapDistance_&&(i=c),this.currentFeature!==t&&this.dispatchEvent({type:"select",selected:[t],deselected:[this.currentFeature]}),this.currentFeature=t,{source:a,feature:t,coord:i}}}getNearestCoord(e,t){var i,r,s,a,n;switch(t.getType()){case"Point":return{coord:t.getCoordinates(),dist:M(t.getCoordinates(),e)};case"MultiPoint":return this.getNearestCoord(e,new D(t.getCoordinates()));case"LineString":case"LinearRing":{var l;n=Number.MAX_VALUE;var c=t.getCoordinates();for(i=0;i<c.length;i++)l=M(e,c[i]),l<n&&(n=l,a=c[i]);return{coord:a,dist:n}}case"MultiLineString":{var g=t.getLineStrings();for(a=!1,n=Number.MAX_VALUE,i=0;r=g[i];i++)s=this.getNearestCoord(e,r),s&&s.dist<n&&(a=s,n=s.dist,a.ring=i);return a}case"Polygon":{var h=t.getLinearRings();for(a=!1,n=Number.MAX_VALUE,i=0;r=h[i];i++)s=this.getNearestCoord(e,r),s&&s.dist<n&&(a=s,n=s.dist,a.ring=i);return a}case"MultiPolygon":{var u=t.getPolygons();for(a=!1,n=Number.MAX_VALUE,i=0;r=u[i];i++)s=this.getNearestCoord(e,r),s&&s.dist<n&&(a=s,n=s.dist,a.poly=i);return a}case"GeometryCollection":{var d=t.getGeometries();for(a=!1,n=Number.MAX_VALUE,i=0;r=d[i];i++)s=this.getNearestCoord(e,r),s&&s.dist<n&&(a=s,n=s.dist,a.geom=i);return a}default:return!1}}getArcs(e,t){var i=!1,r,s,a,n,l;switch(e.getType()){case"Point":{P(t,e.getCoordinates())&&(i={geom:e,type:e.getType(),coord1:[],coord2:[],node:!0});break}case"MultiPoint":{for(r=e.getCoordinates(),s=0;s<r.length;s++)if(P(t,r[s])){i={geom:e,type:e.getType(),index:s,coord1:[],coord2:[],node:!0};break}break}case"LinearRing":case"LineString":{var c=e.getClosestPoint(t);if(M(c,t)<1.5*this.tolerance_){var g;if(e.getType()==="LinearRing"?(l=new D(e.getCoordinates()),g=l.splitAt(t,this.tolerance_)):g=e.splitAt(t,this.tolerance_),g.length>2){for(r=g[1].getCoordinates(),s=2;a=g[s];s++){var h=a.getCoordinates();h.shift(),r=r.concat(h)}g=[g[0],new D(r)]}if(g.length===2){var u=g[0].getCoordinates(),d=g[1].getCoordinates(),v=u.length+d.length-1;u.pop(),d.shift(),i={geom:e,type:e.getType(),coord1:u,coord2:d,node:e.getCoordinates().length===v,closed:!1}}else if(g.length===1){a=g[0].getCoordinates();var _=P(a[0],t),y=P(a[a.length-1],t);_?(a.shift(),y&&a.pop(),i={geom:e,type:e.getType(),coord1:[],coord2:a,node:!0,closed:y}):y&&(a.pop(),i={geom:e,type:e.getType(),coord1:a,coord2:[],node:!0,closed:!1})}}break}case"MultiLineString":{var w=e.getLineStrings();for(s=0;n=w[s];s++)if(i=this.getArcs(n,t),i){i.geom=e,i.type=e.getType(),i.lstring=s;break}break}case"Polygon":{var L=e.getLinearRings();for(s=0;n=L[s];s++)if(i=this.getArcs(n,t),i){i.geom=e,i.type=e.getType(),i.index=s;break}break}case"MultiPolygon":{var E=e.getPolygons();for(s=0;n=E[s];s++)if(i=this.getArcs(n,t),i){i.geom=e,i.type=e.getType(),i.poly=s;break}break}case"GeometryCollection":{for(l=e.getGeometries(),s=0;n=l[s];s++)if(i=this.getArcs(n,t),i){i.geom=e,i.g=s,i.typeg=i.type,i.type=e.getType();break}break}default:{console.error("ol/interaction/ModifyFeature "+e.getType()+" not supported!");break}}return i}handleDownEvent(e){if(!this.getActive())return!1;var t=this.getClosestFeature(e);if(t&&(this._condition(e)||this._deleteCondition(e))){var i=[];return this.arcs=[],this.sources_.forEach(function(r){var s=ne(Ne([t.coord]),this.tolerance_);i=i.concat(i,r.getFeaturesInExtent(s))}.bind(this)),this._modifiedFeatures=[],i.forEach(function(r){var s=this.getArcs(r.getGeometry(),t.coord);s&&(this._insertVertexCondition(e)||s.node)&&(s.feature=r,this._modifiedFeatures.push(r),this.arcs.push(s))}.bind(this)),this._modifiedFeatures.length?this._deleteCondition(e)?!this._removePoint(t,e):(this.dispatchEvent({type:"modifystart",coordinate:t.coord,originalEvent:e.originalEvent,features:this._modifiedFeatures}),this.handleDragEvent({coordinate:t.coord,originalEvent:e.originalEvent}),!0):!0}else return!1}getModifiedFeatures(){return this._modifiedFeatures||[]}removePoint(){this._removePoint({},{})}_getModification(e){var t=e.coord1.concat(e.coord2);switch(e.type){case"LineString":{if(e.closed&&t.push(t[0]),t.length>1&&e.geom.getCoordinates().length!=t.length)return e.coords=t,!0;break}case"MultiLineString":{if(e.closed&&t.push(t[0]),t.length>1){var i=e.geom.getCoordinates();if(i[e.lstring].length!=t.length)return i[e.lstring]=t,e.coords=i,!0}break}case"Polygon":{if(e.closed&&t.push(t[0]),t.length>3&&(i=e.geom.getCoordinates(),i[e.index].length!=t.length))return i[e.index]=t,e.coords=i,!0;break}case"MultiPolygon":{if(e.closed&&t.push(t[0]),t.length>3&&(i=e.geom.getCoordinates(),i[e.poly][e.index].length!=t.length))return i[e.poly][e.index]=t,e.coords=i,!0;break}case"GeometryCollection":{e.type=e.typeg;var r=e.geom,s=r.getGeometries();e.geom=s[e.g];var a=this._getModification(e);return r.setGeometries(s),e.geom=r,e.type="GeometryCollection",a}}return!1}_removePoint(e,t){if(!this.arcs)return!1;this.overlayLayer_.getSource().clear();var i=!1;return this.arcs.forEach(function(r){i=i||this._getModification(r)}.bind(this)),i&&(this.dispatchEvent({type:"modifystart",coordinate:e.coord,originalEvent:t.originalEvent,features:this._modifiedFeatures}),this.arcs.forEach(function(r){if(r.geom.getType()==="GeometryCollection"){if(r.coords){var s=r.geom.getGeometries();s[r.g].setCoordinates(r.coords),r.geom.setGeometries(s)}}else r.coords&&r.geom.setCoordinates(r.coords)}.bind(this)),this.dispatchEvent({type:"modifyend",coordinate:e.coord,originalEvent:t.originalEvent,features:this._modifiedFeatures})),this.arcs=[],i}handleUpEvent(e){return this.getActive()?(!this.arcs||!this.arcs.length||(this.overlayLayer_.getSource().clear(),this.dispatchEvent({type:"modifyend",coordinate:e.coordinate,originalEvent:e.originalEvent,features:this._modifiedFeatures}),this.arcs=[]),!0):!1}setArcCoordinates(e,t){var i;switch(e.type){case"Point":{e.geom.setCoordinates(t[0]);break}case"MultiPoint":{i=e.geom.getCoordinates(),i[e.index]=t[0],e.geom.setCoordinates(i);break}case"LineString":{e.geom.setCoordinates(t);break}case"MultiLineString":{i=e.geom.getCoordinates(),i[e.lstring]=t,e.geom.setCoordinates(i);break}case"Polygon":{i=e.geom.getCoordinates(),i[e.index]=t,e.geom.setCoordinates(i);break}case"MultiPolygon":{i=e.geom.getCoordinates(),i[e.poly][e.index]=t,e.geom.setCoordinates(i);break}case"GeometryCollection":{e.type=e.typeg;var r=e.geom,s=r.getGeometries();e.geom=s[e.g],this.setArcCoordinates(e,t),r.setGeometries(s),e.geom=r,e.type="GeometryCollection";break}}}handleDragEvent(e){if(!this.getActive())return!1;if(!this.arcs)return!0;this.overlayLayer_.getSource().clear();var t=new x(new I(e.coordinate));return this.overlayLayer_.getSource().addFeature(t),this.arcs.length&&(this.arcs.forEach(function(i){var r=i.coord1.concat([e.coordinate],i.coord2);i.closed&&r.push(e.coordinate),this.setArcCoordinates(i,r)}.bind(this)),this.dispatchEvent({type:"modifying",coordinate:e.coordinate,originalEvent:e.originalEvent,features:this._modifiedFeatures})),!0}handleMoveEvent(e){if(!this.getActive())return!0;this.overlayLayer_.getSource().clear();var t=this.getClosestFeature(e);if(t){var i=new x(new I(t.coord));this.overlayLayer_.getSource().addFeature(i)}var r=e.map.getTargetElement();return this.cursor_&&(t?r.style.cursor!=this.cursor_&&(this.previousCursor_=r.style.cursor,f.setCursor(r,this.cursor_)):this.previousCursor_!==void 0&&(f.setCursor(r,this.previousCursor_),this.previousCursor_=void 0)),!0}getCurrentFeature(){return this.currentFeature}},ye=class extends Z{constructor(e){e=e||{},super({handleEvent:function(r){return t.handleEvent_(r)}});var t=this;this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.maxCircleCoordinates_=e.maxCircleCoordinates||100,this.features_=e.features,this.source_=e.source,this.conditionFn_=e.condition,this.squareFn_=e.squareCondition,this.centeredFn_=e.centerCondition,this.canRotate_=e.canRotate!==!1,this.geometryName_=e.geometryName||"geometry",this.setSides(e.sides);var i=qe(!0);this.sketch_=new J,this.overlayLayer_=new Y({source:new N({features:this.sketch_,useSpatialIndex:!1}),name:"DrawRegular overlay",displayInLayerSwitcher:!1,style:e.style||i})}setMap(e){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),super.setMap(e),this.overlayLayer_.setMap(e)}setActive(e){this.reset(),super.setActive(e)}reset(){this.overlayLayer_&&this.overlayLayer_.getSource().clear(),this.started_=!1}setSides(e){e=parseInt(e),this.sides_=e>2?e:0}canRotate(e){return(e===!0||e===!1)&&(this.canRotate_=e),this.canRotate_}getSides(){return this.sides_}getGeom_(){if(this.overlayLayer_.getSource().clear(),!this.center_)return!1;var e;if(this.coord_){var t=this.center_,i=this.coord_,r,s,a,n,l;if(!this.sides_&&this.square_&&!this.centered_)return t=[(i[0]+t[0])/2,(i[1]+t[1])/2],r=[i[0]-t[0],i[1]-t[1]],a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),n=new ve(t,a,"XY"),l=this.getMap().getPixelFromCoordinate(t),s=Math.max(100,Math.abs(l[0]-this.coordPx_[0]),Math.abs(l[1]-this.coordPx_[1])),s=Math.min(this.maxCircleCoordinates_,Math.round(s/3)),ge(n,s,0);var c=this.canRotate_&&this.centered_&&this.square_;if(r=[i[0]-t[0],i[1]-t[1]],this.square_&&!c){var g=Math.max(Math.abs(r[0]),Math.abs(r[1]));i=[t[0]+(r[0]>0?g:-g),t[1]+(r[1]>0?g:-g)]}if(a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a>0){n=new ve(t,a,"XY");var h;if(c?h=Math.atan2(r[1],r[0]):h=this.startAngle[this.sides_]||this.startAngle.default,this.sides_?e=ge(n,this.sides_,h):(l=this.getMap().getPixelFromCoordinate(this.center_),s=Math.max(100,Math.abs(l[0]-this.coordPx_[0]),Math.abs(l[1]-this.coordPx_[1])),s=Math.min(this.maxCircleCoordinates_,Math.round(s/(this.centered_?3:5))),e=ge(n,s,0)),c)return e;var u=e.getExtent();this.centered_?t=[2*this.center_[0]-this.coord_[0],2*this.center_[1]-this.coord_[1]]:t=this.center_;var d=(t[0]-i[0])/(u[0]-u[2]),v=(t[1]-i[1])/(u[1]-u[3]);if(this.square_){var _=Math.min(Math.abs(d),Math.abs(v));d=Math.sign(d)*_,v=Math.sign(v)*_}var y=[t[0]-u[0]*d,t[1]-u[1]*v];return e.applyTransform(function(w,L,E){for(var k=0;k<w.length;k+=E)L[k]=w[k]*d+y[0],L[k+1]=w[k+1]*v+y[1];return L}),e}}return new I(this.center_)}drawSketch_(e){if(this.overlayLayer_.getSource().clear(),e){this.square_=this.squareFn_?this.squareFn_(e):e.originalEvent.shiftKey,this.centered_=this.centeredFn_?this.centeredFn_(e):e.originalEvent.metaKey||e.originalEvent.ctrlKey;var t=this.getGeom_();if(t){var i=this.feature_;return t.getType()==="Polygon"&&i.getGeometry().setCoordinates(t.getCoordinates()),this.overlayLayer_.getSource().addFeature(i),this.coord_&&this.square_&&(this.canRotate_&&this.centered_&&this.coord_||!this.sides_&&!this.centered_)&&this.overlayLayer_.getSource().addFeature(new x(new D([this.center_,this.coord_]))),i}}}drawPoint_(e,t){t||this.overlayLayer_.getSource().clear(),this.overlayLayer_.getSource().addFeature(new x(new I(e)))}handleEvent_(e){var t,i;switch(this._eventTime=new Date,e.type){case"pointerdown":{if(this.conditionFn_&&!this.conditionFn_(e))break;this.downPx_=e.pixel,this.start_(e);var r=500;this._longTouch=!1,setTimeout(function(){this._longTouch=new Date-this._eventTime>.9*r,this._longTouch&&this.handleMoveEvent_(e)}.bind(this),r),this.lastEvent=e.type;break}case"pointerup":{this.started_&&this.coord_&&(t=this.downPx_[0]-e.pixel[0],i=this.downPx_[1]-e.pixel[1],t*t+i*i<=this.squaredClickTolerance_&&(this.lastEvent=="pointerdown"||this.lastEvent=="pointermove"||this.lastEvent=="keydown"?this.end_(e):(t=this.upPx_[0]-e.pixel[0],i=this.upPx_[1]-e.pixel[1],t*t+i*i<=this.squaredClickTolerance_?this.end_(e):(this.handleMoveEvent_(e),this.drawPoint_(e.coordinate,!0))))),this.upPx_=e.pixel;break}case"pointerdrag":{if(this.started_){var s=this.getMap().getPixelFromCoordinate(this.center_);t=s[0]-e.pixel[0],i=s[1]-e.pixel[1],t*t+i*i<=this.squaredClickTolerance_&&this.reset()}return!this._longTouch}case"pointermove":{this.started_?(t=this.downPx_[0]-e.pixel[0],i=this.downPx_[1]-e.pixel[1],t*t+i*i>this.squaredClickTolerance_&&(this.handleMoveEvent_(e),this.lastEvent=e.type)):this.drawPoint_(e.coordinate);break}default:{if(this.started_&&(e.type==="click"||e.type==="singleclick"||e.type==="dblclick"))return!1;this.lastEvent=e.type;break}}return!0}finishDrawing(){this.started_&&this.coord_&&this.end_({pixel:this.upPx_,coordinate:this.coord_})}handleMoveEvent_(e){if(this.started_){this.coord_=e.coordinate,this.coordPx_=e.pixel;var t=this.drawSketch_(e);this.dispatchEvent({type:"drawing",feature:t,pixel:e.pixel,startCoordinate:this.center_,coordinate:e.coordinate,square:this.square_,centered:this.centered_})}else this.drawPoint_(e.coordinate)}start_(e){if(this.started_)this.coord_=e.coordinate;else{this.started_=!0,this.center_=e.coordinate,this.coord_=null;var t=this.feature_=new x({});t.setGeometryName(this.geometryName_||"geometry"),t.setGeometry(new R([[e.coordinate,e.coordinate,e.coordinate]])),this.drawSketch_(e),this.dispatchEvent({type:"drawstart",feature:t,pixel:e.pixel,coordinate:e.coordinate})}}end_(e){if(this.coord_=e.coordinate,this.started_=!1,this.coord_&&(this.center_[0]!==this.coord_[0]||this.center_[1]!==this.coord_[1])){var t=this.feature_;t.setGeometry(this.getGeom_()),this.source_?this.source_.addFeature(t):this.features_&&this.features_.push(t),this.dispatchEvent({type:"drawend",feature:t,pixel:e.pixel,coordinate:e.coordinate,square:this.square_,centered:this.centered_})}else this.dispatchEvent({type:"drawcancel",feature:null,pixel:e.pixel,coordinate:e.coordinate,square:this.square_,centered:this.centered_});this.center_=this.coord_=null,this.drawSketch_()}};ye.prototype.startAngle={default:Math.PI/2,3:-Math.PI/2,4:Math.PI/4};var Ie=class extends K{constructor(e){e=e||{};var t=function(s,a){var n=s[0].pop();return(!this.getPolygon()||this.getPolygon().intersectsCoordinate(n))&&(this.lastOKCoord=[n[0],n[1]]),s[0].push([this.lastOKCoord[0],this.lastOKCoord[1]]),a?a.setCoordinates([s[0].concat([s[0][0]])]):a=new R(s),a},i=e.geometryFunction;if(i?e.geometryFunction=function(s,a,n){return a=t.bind(this)(s,a),i.bind(this)(s,a,n)}:e.geometryFunction=t,e.type="Polygon",super(e),this._select=new re({style:e.style}),this._select.setActive(!1),e.layers&&(typeof e.layers=="function"?this.layers_=e.layers:e.layers.indexOf&&(this.layers_=function(s){return e.layers.indexOf(s)>=0})),typeof e.featureFilter=="function")this._features=e.featureFilter;else if(e.featureFilter){var r=e.featureFilter;this._features=function(s){return r.indexOf?!!r[r.indexOf(s)]:!!r.item(r.getArray().indexOf(s))}}else this._features=function(){return!0};this.on("drawstart",this._startDrawing.bind(this)),this.on("drawend",this._finishDrawing.bind(this))}setMap(e){this.getMap()&&this.getMap().removeInteraction(this._select),e&&e.addInteraction(this._select),super.setMap.call(this,e)}setActive(e){this._select&&this._select.getFeatures().clear(),super.setActive.call(this,e)}removeLastPoint(){this._feature&&this._feature.getGeometry().getCoordinates()[0].length>2&&super.removeLastPoint.call(this)}getPolygon(){return this._polygon}_startDrawing(e){var t=this.getMap();this._feature=e.feature;var i=e.feature.getGeometry().getCoordinates()[0][0];this._current=null,t.forEachFeatureAtPixel(t.getPixelFromCoordinate(i),function(r,s){if(!this._current&&this._features(r,s)){var a=r.getGeometry();if(a.getType()==="Polygon"&&a.intersectsCoordinate(i))this._polygonIndex=!1,this._polygon=a,this._current=r;else if(a.getType()==="MultiPolygon"&&a.intersectsCoordinate(i)){for(var n=0,l;l=a.getPolygon(n);n++)if(l.intersectsCoordinate(i)){this._polygonIndex=n,this._polygon=l,this._current=r;break}}}}.bind(this),{layerFilter:this.layers_}),this._select.getFeatures().clear(),this._current?this._select.getFeatures().push(this._current):(this.setActive(!1),this.setActive(!0))}_finishDrawing(e){e.hole=e.feature,e.feature=this._select.getFeatures().item(0),this.dispatchEvent({type:"modifystart",features:[this._current]});var t=e.hole.getGeometry().getCoordinates()[0];if(t.length>3)if(this._polygonIndex!==!1){for(var i=e.feature.getGeometry(),r=new Q([]),s=0,a;a=i.getPolygon(s);s++)s===this._polygonIndex&&a.appendLinearRing(new ke(t)),r.appendPolygon(a);e.feature.setGeometry(r)}else this.getPolygon().appendLinearRing(new ke(t));this.dispatchEvent({type:"modifyend",features:[this._current]}),this._feature=null,this._select.getFeatures().clear()}_geometryFn(e,t){var i=e[0].pop();return(!this.getPolygon()||this.getPolygon().intersectsCoordinate(i))&&(this.lastOKCoord=[i[0],i[1]]),e[0].push([this.lastOKCoord[0],this.lastOKCoord[1]]),t?t.setCoordinates([e[0].concat([e[0][0]])]):t=new R(e),t}},Dt=class extends W{constructor(e){e=e||{},e.interactions=e.interactions||{},super({className:(e.className?e.className+" ":"")+"ol-editbar",toggleOne:!0,target:e.target}),this._source=e.source,this._interactions={},this._setSelectInteraction(e),e.edition!==!1&&this._setEditInteraction(e),this._setModifyInteraction(e)}setMap(e){this.getMap()&&(this._interactions.Delete&&this.getMap().removeInteraction(this._interactions.Delete),this._interactions.ModifySelect&&this.getMap().removeInteraction(this._interactions.ModifySelect)),super.setMap(e),this.getMap()&&(this._interactions.Delete&&this.getMap().addInteraction(this._interactions.Delete),this._interactions.ModifySelect&&this.getMap().addInteraction(this._interactions.ModifySelect))}getInteraction(e){return this._interactions[e]}_getTitle(e){if(e)return e.get?e.get("title"):typeof e=="string"?e:e.title}_setSelectInteraction(e){var t=this,i=new W,r;if(e.interactions.Delete!==!1){e.interactions.Delete instanceof Me?this._interactions.Delete=e.interactions.Delete:this._interactions.Delete=new Me;var s=this._interactions.Delete;s.setActive(!1),this.getMap()&&this.getMap().addInteraction(s),i.addControl(new se({className:"ol-delete",title:this._getTitle(e.interactions.Delete)||"Delete",name:"Delete",handleClick:function(n){s.delete(r.getInteraction().getFeatures());var l={type:"select",selected:[],deselected:r.getInteraction().getFeatures().getArray().slice(),mapBrowserEvent:n.mapBrowserEvent};r.getInteraction().getFeatures().clear(),r.getInteraction().dispatchEvent(l)}}))}if(e.interactions.Info!==!1&&i.addControl(new se({className:"ol-info",name:"Info",title:this._getTitle(e.interactions.Info)||"Show informations",handleClick:function(){t.dispatchEvent({type:"info",features:r.getInteraction().getFeatures()})}})),e.interactions.Select!==!1){e.interactions.Select instanceof re?this._interactions.Select=e.interactions.Select:this._interactions.Select=new re({condition:We});var a=this._interactions.Select;r=new G({className:"ol-selection",name:"Select",title:this._getTitle(e.interactions.Select)||"Select",interaction:a,bar:i.getControls().length?i:void 0,autoActivate:!0,active:!0}),this.addControl(r),a.on("change:active",function(){a.getActive()||a.getFeatures().clear()}.bind(this))}}_setEditInteraction(e){if(e.interactions.DrawPoint!==!1){e.interactions.DrawPoint instanceof K?this._interactions.DrawPoint=e.interactions.DrawPoint:this._interactions.DrawPoint=new K({type:"Point",source:this._source});var t=new G({className:"ol-drawpoint",name:"DrawPoint",title:this._getTitle(e.interactions.DrawPoint)||"Point",interaction:this._interactions.DrawPoint});this.addControl(t)}if(e.interactions.DrawLine!==!1){e.interactions.DrawLine instanceof K?this._interactions.DrawLine=e.interactions.DrawLine:this._interactions.DrawLine=new K({type:"LineString",source:this._source,geometryFunction:function(h,u){return u?u.setCoordinates(h):u=new D(h),this.nbpts=u.getCoordinates().length,u}});var i;e.drawOptions!==!1?i=new G({className:"ol-drawline",title:this._getTitle(e.interactions.DrawLine)||"LineString",name:"DrawLine",interaction:this._interactions.DrawLine,bar:new W({controls:[new $({html:this._getTitle(e.interactions.UndoDraw)||"undo",title:this._getTitle(e.interactions.UndoDraw)||"delete last point",handleClick:function(){i.getInteraction().nbpts>1&&i.getInteraction().removeLastPoint()}}),new $({html:this._getTitle(e.interactions.FinishDraw)||"finish",title:this._getTitle(e.interactions.FinishDraw)||"finish",handleClick:function(){i.getInteraction().nbpts>2&&i.getInteraction().finishDrawing()}})]})}):i=new G({className:"ol-drawline",title:this._getTitle(e.interactions.DrawLine)||"LineString",name:"DrawLine",interaction:this._interactions.DrawLine}),this.addControl(i)}if(e.interactions.DrawPolygon!==!1&&(e.interactions.DrawPolygon instanceof K?this._interactions.DrawPolygon=e.interactions.DrawPolygon:this._interactions.DrawPolygon=new K({type:"Polygon",source:this._source,geometryFunction:function(h,u){return this.nbpts=h[0].length,u?u.setCoordinates([h[0].concat([h[0][0]])]):u=new R(h),u}}),this._setDrawPolygon("ol-drawpolygon",this._interactions.DrawPolygon,this._getTitle(e.interactions.DrawPolygon)||"Polygon","DrawPolygon",e)),e.interactions.DrawHole!==!1&&(e.interactions.DrawHole instanceof Ie?this._interactions.DrawHole=e.interactions.DrawHole:this._interactions.DrawHole=new Ie,this._setDrawPolygon("ol-drawhole",this._interactions.DrawHole,this._getTitle(e.interactions.DrawHole)||"Hole","DrawHole",e)),e.interactions.DrawRegular!==!1){var r={pts:"pts",circle:"circle"};e.interactions.DrawRegular instanceof ye?(this._interactions.DrawRegular=e.interactions.DrawRegular,r.pts=this._interactions.DrawRegular.get("ptsLabel")||r.pts,r.circle=this._interactions.DrawRegular.get("circleLabel")||r.circle):(this._interactions.DrawRegular=new ye({source:this._source,sides:4}),e.interactions.DrawRegular&&(r.pts=e.interactions.DrawRegular.ptsLabel||r.pts,r.circle=e.interactions.DrawRegular.circleLabel||r.circle));var s=this._interactions.DrawRegular,a=document.createElement("div"),n=f.create("DIV",{parent:a});f.addListener(n,["click","touchstart"],function(){var h=s.getSides()-1;h<2&&(h=2),s.setSides(h),l.textContent=h>2?h+" "+r.pts:r.circle}.bind(this));var l=f.create("TEXT",{html:"4 "+r.pts,parent:a}),c=f.create("DIV",{parent:a});f.addListener(c,["click","touchstart"],function(){var h=s.getSides()+1;h<3&&(h=3),s.setSides(h),l.textContent=h+" "+r.pts}.bind(this));var g=new G({className:"ol-drawregular",title:this._getTitle(e.interactions.DrawRegular)||"Regular",name:"DrawRegular",interaction:this._interactions.DrawRegular,bar:new W({controls:[new $({html:a})]})});this.addControl(g)}}_setDrawPolygon(e,t,i,r,s){var a;return s.drawOptions!==!1?a=new G({className:e,name:r,title:i,interaction:t,bar:new W({controls:[new $({html:this._getTitle(s.interactions.UndoDraw)||"undo",title:this._getTitle(s.interactions.UndoDraw)||"undo last point",handleClick:function(){a.getInteraction().nbpts>1&&a.getInteraction().removeLastPoint()}}),new $({html:this._getTitle(s.interactions.FinishDraw)||"finish",title:this._getTitle(s.interactions.FinishDraw)||"finish",handleClick:function(){a.getInteraction().nbpts>3&&a.getInteraction().finishDrawing()}})]})}):a=new G({className:e,name:r,title:i,interaction:t}),this.addControl(a),a}_setModifyInteraction(e){if(e.interactions.ModifySelect!==!1&&e.interactions.Select!==!1&&(e.interactions.ModifySelect instanceof Ae?this._interactions.ModifySelect=e.interactions.ModifySelect:this._interactions.ModifySelect=new Ae({features:this.getInteraction("Select").getFeatures()}),this.getMap()&&this.getMap().addInteraction(this._interactions.ModifySelect),this._interactions.ModifySelect.setActive(this._interactions.Select.getActive()),this._interactions.Select.on("change:active",function(){this._interactions.ModifySelect.setActive(this._interactions.Select.getActive())}.bind(this))),e.interactions.Transform!==!1){e.interactions.Transform instanceof _e?this._interactions.Transform=e.interactions.Transform:(this._interactions.Transform=new _e({select:this._interactions.Select,addCondition:$e}),this._interactions.Select&&this._interactions.Transform.on("change:active",function(){this._interactions.Select.getActive()||this._interactions.Select.getFeatures().clear()}.bind(this)));var t=new G({html:"<i></i>",className:"ol-transform",title:this._getTitle(e.interactions.Transform)||"Transform",name:"Transform",interaction:this._interactions.Transform});this.addControl(t)}if(e.interactions.Split!==!1){e.interactions.Split instanceof De?this._interactions.Split=e.interactions.Split:this._interactions.Split=new De({sources:this._source});var i=new G({className:"ol-split",title:this._getTitle(e.interactions.Split)||"Split",name:"Split",interaction:this._interactions.Split});this.addControl(i)}if(e.interactions.Offset!==!1){e.interactions.Offset instanceof Pe?this._interactions.Offset=e.interactions.Offset:this._interactions.Offset=new Pe({source:this._source});var r=new G({html:"<i></i>",className:"ol-offset",title:this._getTitle(e.interactions.Offset)||"Offset",name:"Offset",interaction:this._interactions.Offset});this.addControl(r)}}},ot=class extends me{constructor(e){e=e||{};var t=e.offset||[0,0],i=e.centerOnClick||!1;super({handleDownEvent:function(r){var s=r.frameState.viewState.resolution,a=[r.coordinate[0]+t[0]*s,r.coordinate[1]-t[1]*s];if(/^(BUTTON|A)$/.test(r.originalEvent.target.tagName))return this._dragging=!1,!0;if(this._dragging){i&&this._dragging.setPosition(a,!0);var n=this._dragging.getPosition();return this._dragging.offsetClick=[a[0]-n[0],a[1]-n[1]],this.dispatchEvent({type:"dragstart",overlay:this._dragging,originalEvent:r.originalEvent,frameState:r.frameState,coordinate:n}),!0}return!1},handleDragEvent:function(r){var s=r.frameState.viewState.resolution,a=[r.coordinate[0]+t[0]*s,r.coordinate[1]-t[1]*s];this._dragging&&(a=[a[0]-this._dragging.offsetClick[0],a[1]-this._dragging.offsetClick[1]],this._dragging.setPosition(a,!0),this.dispatchEvent({type:"dragging",overlay:this._dragging,originalEvent:r.originalEvent,frameState:r.frameState,coordinate:a}))},handleUpEvent:function(r){var s=r.frameState.viewState.resolution,a=[r.coordinate[0]+t[0]*s,r.coordinate[1]-t[1]*s];return this._dragging?(a=[a[0]-this._dragging.offsetClick[0],a[1]-this._dragging.offsetClick[1]],this.dispatchEvent({type:"dragend",overlay:this._dragging,originalEvent:r.originalEvent,frameState:r.frameState,coordinate:a}),this._dragging=!1,!0):!1}}),this._overlays=[],e.overlays instanceof Array||(e.overlays=[e.overlays]),e.overlays.forEach(this.addOverlay.bind(this))}addOverlay(e){for(var t=0,i;i=this._overlays[t];t++)if(i===e)return;var r=e.getElement();if(r.parentElement&&r.parentElement.classList.contains("ol-overlaycontainer-stopevent")){console.warn("[DragOverlay.addOverlay] overlay must be created with stopEvent set to false!");return}var s=function(){this.getMap()===e.getMap()&&(this._dragging=e)}.bind(this);this._overlays.push({overlay:e,listener:s}),r.parentNode.addEventListener("pointerdown",s)}removeOverlay(e){for(var t=0,i;i=this._overlays[t];t++)if(i.overlay===e){var r=this._overlays.splice(t,1)[0];e.getElement().parentNode.removeEventListener("pointerdown",r.listener);break}}},lt=class extends Qe{constructor(e){super(e)}setPosition(e,t){this.getMap()&&e&&(this._pixel=this.getMap().getPixelFromCoordinate(e)),super.setPosition(e),t&&super.updatePixelPosition()}updatePixelPosition(){if(this.getMap()&&this._pixel&&this.getPosition()){var e=this.getMap().getPixelFromCoordinate(this.getPosition());(Math.round(e[0]*1e3)!==Math.round(this._pixel[0]*1e3)||Math.round(e[0]*1e3)!==Math.round(this._pixel[0]*1e3))&&this.setPosition(this.getMap().getCoordinateFromPixel(this._pixel))}}},Nt=class extends ot{constructor(e){e=e||{};var t=new lt({className:("ol-touch-cursor "+(e.className||"")).trim(),positioning:"top-left",element:f.create("DIV",{}),stopEvent:!1});if(super({centerOnClick:!1,overlays:t}),this.overlay=t,this.setAnchor(e.anchor||"left"),this._listeners={},this.ctouch=new Z({handleEvent:function(n){if(!/drag/.test(n.type)&&this.getMap())n.coordinate=this.overlay.getPosition(),n.pixel=this.getMap().getPixelFromCoordinate(n.coordinate),this._lastEvent=n;else{var l=n.frameState.viewState.resolution,c=Math.cos(n.frameState.viewState.rotation),g=Math.sin(n.frameState.viewState.rotation),h=this.getOverlayElement().clientWidth/2,u=getComputedStyle(this.getOverlayElement()),d=[-h-parseInt(u.marginLeft),-h-parseInt(u.marginTop)];this._anchor==="center"&&(d[0]=0),n.coordinate=[n.coordinate[0]+c*d[0]*l+g*d[1]*l,n.coordinate[1]+g*d[0]*l-c*d[1]*l],n.pixel=this.getMap().getPixelFromCoordinate(n.coordinate)}return!0}.bind(this)}),this.ctouch.set("onTop",!0),this.setPosition(e.coordinate,!0),this.set("maxButtons",e.maxButtons||5),e.buttons){e.buttons.length>this.get("maxButtons")&&this.set("maxButtons",e.buttons.length);var i=this.overlay.element,r=e.buttons.length>4?0:1;e.buttons.forEach((function(n,l){l<5&&f.create("DIV",{className:((n.className||"")+" ol-button ol-button-"+(l+r)).trim(),html:f.create("DIV",{html:n.html}),click:n.click,on:n.on,parent:i})}))}var s=!1,a=!1;this.on("dragstart",function(n){return this._pixel=this.getMap().getPixelFromCoordinate(this.overlay.getPosition()),a=n,!n.overlay}),this.on("dragend",function(n){return this._pixel=this.getMap().getPixelFromCoordinate(this.overlay.getPosition()),n.overlay?(s?(this.dispatchEvent({type:"dragend",dragging:s,originalEvent:n.originalEvent,frameState:n.frameState,pixel:this._pixel,coordinate:this.overlay.getPosition()}),s=!1):n.originalEvent.target===this.overlay.element&&this.dispatchEvent({type:"click",dragging:s,originalEvent:n.originalEvent,frameState:n.frameState,pixel:this._pixel,coordinate:this.overlay.getPosition()}),!1):!0}.bind(this)),this.on("dragging",function(n){return this._pixel=this.getMap().getPixelFromCoordinate(this.overlay.getPosition()),n.overlay?(s=!0,a&&(this.dispatchEvent({type:"dragstart",dragging:s,originalEvent:a.originalEvent,frameState:n.frameState,pixel:this._pixel,coordinate:a.coordinate}),a=!1),this.dispatchEvent({type:"dragging",dragging:s,originalEvent:n.originalEvent,frameState:n.frameState,pixel:this._pixel,coordinate:this.overlay.getPosition()}),!1):!0}.bind(this))}setMap(e){this.getMap()&&(this.getMap().removeInteraction(this.ctouch),this.getActive()&&this.getMap().removeOverlay(this.overlay));for(let t in this._listeners)j(this._listeners[t]);this._listeners={},super.setMap(e),e&&(this.getActive()&&(e.addOverlay(this.overlay),setTimeout(function(){this.setPosition(this.getPosition()||e.getView().getCenter())}.bind(this))),e.addInteraction(this.ctouch),this._listeners.addInteraction=e.getInteractions().on("add",function(t){t.element.get("onTop")||(e.removeInteraction(this.ctouch),e.addInteraction(this.ctouch))}.bind(this)))}setAnchor(e){var t=["left","right","center"];t.indexOf(e)>=0&&(t.forEach(function(i){this.getOverlayElement().classList.remove("ol-touch-cursor-"+i)}.bind(this)),this.getOverlayElement().classList.add("ol-touch-cursor-"+e),this._anchor=e)}setActive(e,t){e!==this.getActive()?(this.ctouch&&this.ctouch.setActive(e),e?(this.getMap()&&this.getMap().addOverlay(this.overlay),t?this.setPosition(t):this.getMap()&&this.setPosition(this.getMap().getView().getCenter()),this._activate=setTimeout(function(){this.overlay.element.classList.add("active")}.bind(this),100)):(this.setPosition(),this.overlay.element.classList.remove("active"),this._activate&&clearTimeout(this._activate),this.getMap()&&this.getMap().removeOverlay(this.overlay)),super.setActive(e)):t?this.setPosition(t):this.getMap()&&this.setPosition(this.getMap().getView().getCenter())}setPosition(e){this.overlay.setPosition(e,!0),this.getMap()&&e&&(this._pixel=this.getMap().getPixelFromCoordinate(e))}offsetPosition(e){var t=this.overlay.getPosition();t&&this.overlay.setPosition([t[0]+e[0],t[1]+e[1]])}getPosition(){return this.overlay.getPosition()}getPixel(){if(this.getMap())return this.getMap().getPixelFromCoordinate(this.getPosition())}getOverlay(){return this.overlay}getOverlayElement(){return this.overlay.element}getButtonElement(e){return typeof e=="number"?this.getOverlayElement().getElementsByClassName("ol-button")[e]:this.getOverlayElement().getElementsByClassName(e)[0]}removeButton(e){if(e===void 0)for(var t=this.getOverlayElement().getElementsByClassName("ol-button"),i=t.length-1;i>=0;i--)this.getOverlayElement().removeChild(t[i]);else{var r=this.getButtonElement(e);r&&this.getOverlayElement().removeChild(r)}}addButton(e){var t=this.getOverlayElement().getElementsByClassName("ol-button"),i=this.get("maxButtons")||5;if(t.length>=i){console.error("[ol/interaction/TouchCursor~addButton] too many button on the cursor (max="+i+")...");return}var r=f.create("DIV",{className:((e.className||"")+" ol-button").trim(),html:f.create("DIV",{html:e.html}),click:e.click,on:e.on});!e.before||t.length===0?this.getOverlayElement().appendChild(r):this.getOverlayElement().insertBefore(r,t[0]);var s=t.length>=i?0:1;for(let a=0;a<t.length;a++)t[a].className=t[a].className.replace(/ol-button-\d/g,"").trim()+" ol-button-"+(a+s)}};(function(){var o=N.prototype.clear;N.prototype.clear=function(e){this.dispatchEvent({type:"clearstart"}),o.call(this,e),this.dispatchEvent({type:"clearend"})}})();var A=class extends Z{constructor(e){e=e||{},super({handleEvent:function(){return!0}}),this._layers=e.layers,this._undoStack=new J,this._redoStack=new J,this._undo=[],this._redo=[],this._undoStack.on("add",function(t){t.element.level===void 0?(t.element.level=this._level,t.element.level||(t.element.view={center:this.getMap().getView().getCenter(),zoom:this.getMap().getView().getZoom()},this._undo.push(t.element))):t.element.level||this._undo.push(this._redo.shift()),t.element.level||this.dispatchEvent({type:"stack:add",action:t.element}),this._reduce()}.bind(this)),this._undoStack.on("remove",function(t){t.element.level||(this._doShift?this._undo.shift():this._abort?this._undo.pop():this._undo.length&&this._redo.push(this._undo.pop()),this._doClear||this.dispatchEvent({type:"stack:remove",action:t.element,shift:this._doShift,abort:this._abort}))}.bind(this)),this._block=0,this._level=0,this._doShift=!1,this._record=!0,this._defs={}}define(e,t,i){this._defs[e]={undo:t,redo:i}}length(e){return e==="redo"?this._redo.length:this._undo.length}setMaxLength(e){e=parseInt(e),e&&e<0&&(e=0),this.set("maxLength",e),this._reduce()}size(e){return e==="redo"?this._redoStack.getLength():this._undoStack.getLength()}setMaxSize(e){e=parseInt(e),e&&e<0&&(e=0),this.set("maxSize",e),this._reduce()}_reduce(){if(this.get("maxLength"))for(;this.length()>this.get("maxLength");)this.shift();if(this.get("maxSize"))for(;this.length()>1&&this.size()>this.get("maxSize");)this.shift()}getStack(e){return e==="redo"?this._redo:this._undo}push(e,t,i){return this._defs[e]?(this._undoStack.push({type:e,name:i,custom:!0,prop:t}),!0):(console.warn('[UndoRedoInteraction]: "'+e+'" is not defined.'),!1)}shift(){this._doShift=!0;var e=this._undoStack.removeAt(0);if(this._doShift=!1,e.type==="blockstart")for(e=this._undoStack.item(0);this._undoStack.getLength()&&e.level>0;)this._undoStack.removeAt(0),e=this._undoStack.item(0)}setActive(e){super.setActive(e),this._record=e}setMap(e){this._mapListener&&this._mapListener.forEach(function(t){j(t)}),this._mapListener=[],super.setMap(e),e&&(this._mapListener.push(e.on("undoblockstart",this.blockStart.bind(this))),this._mapListener.push(e.on("undoblockend",this.blockEnd.bind(this)))),this._watchSources(),this._watchInteractions()}_watchSources(){var e=this.getMap();this._sourceListener&&this._sourceListener.forEach(function(s){j(s)}),this._sourceListener=[];var t=this;function i(s,a){return a||(a=[]),s.forEach(function(n){n.getSource&&n.getSource()instanceof N?(!t._layers||t._layers.indexOf(n)>=0)&&a.push(n):n.getLayers&&i(n.getLayers(),a)}),a}if(e){var r=i(e.getLayers());r.forEach((function(s){var a=s.getSource();this._sourceListener.push(a.on(["addfeature","removefeature"],this._onAddRemove.bind(this))),this._sourceListener.push(a.on("clearstart",function(){this.blockStart("clear")}.bind(this))),this._sourceListener.push(a.on("clearend",this.blockEnd.bind(this)))}).bind(this)),this._sourceListener.push(e.getLayers().on(["add","remove"],this._watchSources.bind(this)))}}_watchInteractions(){var e=this.getMap();this._interactionListener&&this._interactionListener.forEach(function(t){j(t)}),this._interactionListener=[],e&&(e.getInteractions().forEach((function(t){this._interactionListener.push(t.on(["setattributestart","modifystart","modifyend","rotatestart","rotateend","translatestart","translateend","scalestart","scaleend","deletestart","deleteend","beforesplit","aftersplit"],this._onInteraction.bind(this)))}).bind(this)),this._interactionListener.push(e.getInteractions().on(["add","remove"],this._watchInteractions.bind(this))))}_onAddRemove(e){this._record&&(this._redoStack.clear(),this._redo.length=0,this._undoStack.push({type:e.type,source:e.target,feature:e.feature}))}_onInteraction(e){var t=this._onInteraction[e.type];t&&t.call(this,e)}blockStart(e){this._redoStack.clear(),this._redo.length=0,this._undoStack.push({type:"blockstart",name:e}),this._level++}blockEnd(){this._undoStack.push({type:"blockend"}),this._level--}_handleDo(e,t){if(this.getActive()){if(this._record=!1,e.custom)this._defs[e.type]?t?this._defs[e.type].undo(e.prop):this._defs[e.type].redo(e.prop):console.warn('[UndoRedoInteraction]: "'+e.type+'" is not defined.');else switch(e.type){case"addfeature":{t?e.source.removeFeature(e.feature):e.source.addFeature(e.feature);break}case"removefeature":{t?e.source.addFeature(e.feature):e.source.removeFeature(e.feature);break}case"changegeometry":{var i=e.feature.getGeometry();e.feature.setGeometry(e.oldGeom),e.oldGeom=i;break}case"changeattribute":{var r=e.newProperties,s=e.oldProperties;for(var a in s)s===void 0?e.feature.unset(a):e.feature.set(a,s[a]);e.oldProperties=r,e.newProperties=s;break}case"blockstart":{this._block+=t?-1:1;break}case"blockend":{this._block+=t?1:-1;break}default:console.warn('[UndoRedoInteraction]: "'+e.type+'" is not defined.')}this._block<0&&(this._block=0),this._block&&(t?this.undo():this.redo()),this._record=!0,this.dispatchEvent({type:t?"undo":"redo",action:e})}}undo(){var e=this._undoStack.item(this._undoStack.getLength()-1);e&&(this._redoStack.push(e),this._undoStack.pop(),this._handleDo(e,!0))}abort(){var e=this._undoStack.item(this._undoStack.getLength()-1);if(e){this._abort=!0;for(var t=this._undoStack.pop();t.level!==0;)t=this._undoStack.pop();this._abort=!1}}redo(){var e=this._redoStack.item(this._redoStack.getLength()-1);e&&(this._undoStack.push(e),this._redoStack.pop(),this._handleDo(e,!1))}clear(){this._doClear=!0,this._undo.length=this._redo.length=0,this._undoStack.clear(),this._redoStack.clear(),this._doClear=!1,this.dispatchEvent({type:"stack:clear"})}hasUndo(){return this._undoStack.getLength()}hasRedo(){return this._redoStack.getLength()}};A.prototype._onInteraction.setattributestart=function(o){this.blockStart(o.target.get("name")||"setattribute");var e=Object.assign({},o.properties);o.features.forEach(function(t){var i={};for(var r in e)i[r]=t.get(r);this._undoStack.push({type:"changeattribute",feature:t,newProperties:e,oldProperties:i})}.bind(this)),this.blockEnd()};A.prototype._onInteraction.rotatestart=A.prototype._onInteraction.translatestart=A.prototype._onInteraction.scalestart=A.prototype._onInteraction.modifystart=function(o){this._modify={coordinate:o.coordinate,blockStart:o.type.replace(/start$/,""),modify:[]},o.features.forEach(function(e){this._modify.modify.push({type:"changegeometry",feature:e,oldGeom:e.getGeometry().clone()})}.bind(this))};A.prototype._onInteraction.translateend=A.prototype._onInteraction.rotateend=A.prototype._onInteraction.scaleend=A.prototype._onInteraction.modifyend=function(o){this._modify&&(o.type==="modifyend"&&(o.transformed=!o.coordinate||!P(this._modify.coordinate,o.coordinate),o.transformed||this._modify.modify.forEach(function(e){e.feature.getGeometry().getFlatCoordinates().length!==e.oldGeom.getFlatCoordinates().length&&(o.transformed=!0),console.log(e.feature.getGeometry().getFlatCoordinates().length,e.oldGeom.getFlatCoordinates().length)})),o.type==="translateend"&&o.coordinate&&(o.transformed=!P(this._modify.coordinate,o.coordinate)),o.transformed&&(this.blockStart(this._modify.blockStart),this._modify.modify.forEach(function(e){this._undoStack.push(e)}.bind(this)),this.blockEnd()),this._modify=null)};A.prototype._onInteraction.beforesplit=function(){var o=this._undoStack.getLength();o>2&&this._undoStack.item(o-1).type==="blockend"&&this._undoStack.item(o-2).type==="changegeometry"?this._undoStack.pop():this.blockStart("split")};A.prototype._onInteraction.deletestart=function(){this.blockStart("delete")};A.prototype._onInteraction.aftersplit=A.prototype._onInteraction.deleteend=A.prototype.blockEnd;et.prototype.getModifiedFeatures=function(){var o={};this.dragSegments_.forEach(function(i){var r=i[0].feature;window&&window.ol&&window.ol.util?o[ie(r)]=r:o[ie(r)]=r});var e=[];for(var t in o)e.push(o[t]);return e};var Rt=class extends Z{constructor(e){e=e||{};function t(a,n){var l=a[1][0]-a[0][0],c=a[1][1]-a[0][1],g=n[1][0]-n[0][0],h=n[1][1]-n[0][1],u=l*h-c*g;if(u!=0){var d=(l*a[0][1]-l*n[0][1]-c*a[0][0]+c*n[0][0])/u;return[n[0][0]+d*g,n[0][1]+d*h]}else return!1}function i(a,n){var l=a[0]-n[0],c=a[1]-n[1];return Math.sqrt(l*l+c*c)}super({handleEvent:function(a){if(this.getActive()){for(var n=this.overlaySource_.getFeatures(),l=null,c=null,g=a.frameState.viewState.resolution,h=0,u;u=n[h];h++){var d=u.getGeometry().getClosestPoint(a.coordinate);if(i(d,a.coordinate)/g<this.snapDistance_){if(l){var v=t(l.getGeometry().getCoordinates(),u.getGeometry().getCoordinates());v&&i(v,a.coordinate)/g<this.snapDistance_&&(c=v)}else c=d;l=u}}c&&(a.coordinate=c)}return!0}}),this.snapDistance_=e.pixelTolerance||10,this.enableInitialGuides_=e.enableInitialGuides||!1;var r=[new U({stroke:new F({color:"#ffcc33",lineDash:[8,5],width:1.25})})];e.style&&(r=e.style instanceof Array?e.style:[e.style]),this.overlaySource_=new N({features:new J,useSpatialIndex:!1});const s=e.vectorClass||Y;this.overlayLayer_=new s({renderMode:"image",source:this.overlaySource_,style:function(){return r},name:"Snap overlay",displayInLayerSwitcher:!1}),this.overlayLayer_.setVisible(this.getActive())}setMap(e){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),super.setMap(e),this.overlayLayer_.setMap(e),e&&(this.projExtent_=e.getView().getProjection().getExtent())}setActive(e){this.overlayLayer_&&this.overlayLayer_.setVisible(e),super.setActive(e)}clearGuides(e){if(!e)this.overlaySource_.clear();else for(var t=0,i;i=e[t];t++)try{this.overlaySource_.removeFeature(i)}catch{}}getGuides(){return this.overlaySource_.getFeaturesCollection()}addGuide(e,t){if(e){var i=this.getMap(),r=i.getView().calculateExtent(i.getSize()),s=Math.max(this.projExtent_[2]-this.projExtent_[0],this.projExtent_[3]-this.projExtent_[1]);r=ne(r,s*1.5),r[0]<this.projExtent_[0]&&(r[0]=this.projExtent_[0]),r[1]<this.projExtent_[1]&&(r[1]=this.projExtent_[1]),r[2]>this.projExtent_[2]&&(r[2]=this.projExtent_[2]),r[3]>this.projExtent_[3]&&(r[3]=this.projExtent_[3]);var a=e[0][0]-e[1][0],n=e[0][1]-e[1][1],l=1/Math.sqrt(a*a+n*n),c=function(u){for(var d,v=[],_=s*u*2,y=0;(u>0?y<_:y>_)&&(t?d=[e[0][0]+n*l*y,e[0][1]-a*l*y]:d=[e[0][0]+a*l*y,e[0][1]+n*l*y],tt(r,d));y+=s*u/100)v.push(d);return new x(new D([v[0],v[v.length-1]]))},g=c(1),h=c(-1);return this.overlaySource_.addFeature(g),this.overlaySource_.addFeature(h),[g,h]}}addOrthoGuide(e){return this.addGuide(e,!0)}setDrawInteraction(e){var t=this,i=0,r=[];function s(a){var n=a.target.getCoordinates(),l=2;switch(a.target.getType()){case"Point":return;case"Polygon":n=n[0].slice(0,-1);break}var c=n.length;if(c===l&&t.enableInitialGuides_){var g=n[0][0],h=n[0][1];n=[[g,h],[g,h-1]]}if(c!=i&&(t.enableInitialGuides_?c>=l:c>l)){t.clearGuides(r);try{var u=n[c-l],d=n[c-l-1];c>l&&!(u[0]===d[0]&&u[1]===d[1])&&(r=t.addOrthoGuide([n[c-l],n[c-l-1]])),r=r.concat(t.addGuide([n[0],n[1]])),r=r.concat(t.addOrthoGuide([n[0],n[1]])),i=c}catch{}}}e.on("drawstart",function(a){a.feature.getGeometry().on("change",s)}),e.on(["drawend","change:active"],function(a){t.clearGuides(r),a.feature&&a.feature.getGeometry().un("change",s),i=0,r=[]})}setModifyInteraction(e){function t(l,c){return(l%c+c)%c}var i=this,r=[];function s(l){var c=l.coordinate;if(!c){var g=l.target.vertexFeature_;if(!g)return;c=g.getGeometry().getCoordinates()}var h=l.target.getModifiedFeatures()[0],u=h.getGeometry(),d=u.getCoordinates();switch(u.getType()){case"Point":return;case"Polygon":d=d[0].slice(0,-1);break}var v=d.findIndex(function(y){return y[0]===c[0]&&y[1]===c[1]}),_=d.length;i.clearGuides(r),r=i.addOrthoGuide([d[t(v-1,_)],d[t(v-2,_)]]),r=r.concat(i.addGuide([d[t(v-1,_)],d[t(v-2,_)]])),r=r.concat(i.addGuide([d[t(v+1,_)],d[t(v+2,_)]])),r=r.concat(i.addOrthoGuide([d[t(v+1,_)],d[t(v+2,_)]]))}function a(l){setTimeout(s,0,l)}function n(){i.clearGuides(r),r=[]}e.on("modifystart",a),e.on("modifyend",n)}};export{mt as a,Ae as b,A as c,Dt as d,W as e,se as f,De as g,G as h,Rt as i,Nt as j,at as o};
//# sourceMappingURL=ol-ext-BR0zF6aa.js.map