@florasync/leaflet-geokit 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +684 -64
  3. package/dist/django/index.js +2871 -2253
  4. package/dist/django/index.js.map +1 -1
  5. package/dist/leaflet-geokit.es.js +2928 -2325
  6. package/dist/leaflet-geokit.es.js.map +1 -1
  7. package/dist/leaflet-geokit.external.es.js +2636 -0
  8. package/dist/leaflet-geokit.external.es.js.map +1 -0
  9. package/dist/leaflet-geokit.umd.js +69 -16
  10. package/dist/leaflet-geokit.umd.js.map +1 -1
  11. package/dist/preact/index-D8EjMf-1.js +2623 -0
  12. package/dist/preact/index-D8EjMf-1.js.map +1 -0
  13. package/dist/preact/index.js +109 -0
  14. package/dist/preact/index.js.map +1 -0
  15. package/dist/preact-bundled/index.js +9931 -0
  16. package/dist/preact-bundled/index.js.map +1 -0
  17. package/dist/react/index-D8EjMf-1.js +2623 -0
  18. package/dist/react/index-D8EjMf-1.js.map +1 -0
  19. package/dist/react/index.js +109 -0
  20. package/dist/react/index.js.map +1 -0
  21. package/dist/react-bundled/index.js +9931 -0
  22. package/dist/react-bundled/index.js.map +1 -0
  23. package/dist/types/e2e/component.spec.d.ts +1 -0
  24. package/dist/types/e2e/dummy.spec.d.ts +1 -0
  25. package/dist/types/src/components/LeafletDrawMapElement.d.ts +94 -0
  26. package/dist/types/src/django/index.d.ts +35 -0
  27. package/dist/types/src/external.d.ts +4 -0
  28. package/dist/types/src/index.d.ts +4 -0
  29. package/dist/types/src/lib/FeatureStore.d.ts +48 -0
  30. package/dist/types/src/lib/MapController.d.ts +121 -0
  31. package/dist/types/src/lib/draw/L.Draw.Cake.d.ts +9 -0
  32. package/dist/types/src/lib/draw/L.Draw.Move.d.ts +49 -0
  33. package/dist/types/src/lib/draw/toolbar-patch.d.ts +2 -0
  34. package/dist/types/src/lib/layer-cake/CakeBaker.d.ts +12 -0
  35. package/dist/types/src/lib/layer-cake/LayerCakeManager.d.ts +29 -0
  36. package/dist/types/src/lib/layer-cake/bindCakeControls.d.ts +8 -0
  37. package/dist/types/src/lib/layer-cake/ensureCircleEditable.d.ts +2 -0
  38. package/dist/types/src/lib/leaflet-assets.d.ts +23 -0
  39. package/dist/types/src/preact/core.d.ts +36 -0
  40. package/dist/types/src/preact/index.d.ts +8 -0
  41. package/dist/types/src/preact-bundled/index.d.ts +9 -0
  42. package/dist/types/src/react/core.d.ts +36 -0
  43. package/dist/types/src/react/index.d.ts +7 -0
  44. package/dist/types/src/react-bundled/index.d.ts +8 -0
  45. package/dist/types/src/shims/ensure-element.d.ts +2 -0
  46. package/dist/types/src/state/types.d.ts +7 -0
  47. package/dist/types/src/types/events.d.ts +71 -0
  48. package/dist/types/src/types/public.d.ts +108 -0
  49. package/dist/types/src/utils/geodesic.d.ts +8 -0
  50. package/dist/types/src/utils/geojson.d.ts +70 -0
  51. package/dist/types/src/utils/leaflet-guards.d.ts +9 -0
  52. package/dist/types/src/utils/logger.d.ts +12 -0
  53. package/dist/types/src/utils/ruler.d.ts +31 -0
  54. package/dist/types/tests/bbox-more.spec.d.ts +1 -0
  55. package/dist/types/tests/component-api-more.spec.d.ts +1 -0
  56. package/dist/types/tests/component-delegation.spec.d.ts +1 -0
  57. package/dist/types/tests/component-events.spec.d.ts +1 -0
  58. package/dist/types/tests/component-io.spec.d.ts +1 -0
  59. package/dist/types/tests/django-shim.spec.d.ts +1 -0
  60. package/dist/types/tests/draw-cake.spec.d.ts +1 -0
  61. package/dist/types/tests/draw-move.spec.d.ts +1 -0
  62. package/dist/types/tests/eachcoord.spec.d.ts +1 -0
  63. package/dist/types/tests/element.spec.d.ts +1 -0
  64. package/dist/types/tests/ensure-element.spec.d.ts +1 -0
  65. package/dist/types/tests/external-entry.spec.d.ts +1 -0
  66. package/dist/types/tests/featureStore-more.spec.d.ts +1 -0
  67. package/dist/types/tests/featureStore.spec.d.ts +1 -0
  68. package/dist/types/tests/framework-runtime-externalization.spec.d.ts +1 -0
  69. package/dist/types/tests/geodesic.spec.d.ts +1 -0
  70. package/dist/types/tests/geojson-merge.spec.d.ts +1 -0
  71. package/dist/types/tests/geojson-more.spec.d.ts +1 -0
  72. package/dist/types/tests/geojson.spec.d.ts +1 -0
  73. package/dist/types/tests/layer-cake-baker.spec.d.ts +1 -0
  74. package/dist/types/tests/layer-cake-controls.spec.d.ts +1 -0
  75. package/dist/types/tests/layer-cake-editing.spec.d.ts +1 -0
  76. package/dist/types/tests/layer-cake-manager.spec.d.ts +1 -0
  77. package/dist/types/tests/leaflet-assets.spec.d.ts +1 -0
  78. package/dist/types/tests/leaflet-draw-circle-resize-patch.spec.d.ts +1 -0
  79. package/dist/types/tests/leaflet-guards.spec.d.ts +1 -0
  80. package/dist/types/tests/logger-more.spec.d.ts +1 -0
  81. package/dist/types/tests/logger.spec.d.ts +1 -0
  82. package/dist/types/tests/map-controller.spec.d.ts +1 -0
  83. package/dist/types/tests/mapcontroller-merge.spec.d.ts +1 -0
  84. package/dist/types/tests/preact-bundled-shim.spec.d.ts +1 -0
  85. package/dist/types/tests/preact-shim.spec.d.ts +1 -0
  86. package/dist/types/tests/react-bundled-shim.spec.d.ts +1 -0
  87. package/dist/types/tests/react-shim.spec.d.ts +1 -0
  88. package/dist/types/tests/ruler.spec.d.ts +1 -0
  89. package/dist/types/vite.config.d.ts +2 -0
  90. package/dist/types/vite.config.external.d.ts +2 -0
  91. package/dist/types/vite.config.preact-bundled.d.ts +2 -0
  92. package/dist/types/vite.config.preact.d.ts +2 -0
  93. package/dist/types/vite.config.react-bundled.d.ts +2 -0
  94. package/dist/types/vite.config.react.d.ts +2 -0
  95. package/package.json +59 -5
@@ -0,0 +1,2623 @@
1
+ var fe = Object.defineProperty;
2
+ var ge = (s, t, e) => t in s ? fe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var h = (s, t, e) => ge(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import * as k from "leaflet";
5
+ import "leaflet-draw";
6
+ import "leaflet-ruler";
7
+ const X = {
8
+ trace: 10,
9
+ debug: 20,
10
+ info: 30,
11
+ warn: 40,
12
+ error: 50
13
+ };
14
+ function me(s, t) {
15
+ return s === "silent" ? !1 : X[t] >= X[s];
16
+ }
17
+ function Ae() {
18
+ try {
19
+ return (/* @__PURE__ */ new Date()).toISOString();
20
+ } catch {
21
+ return "";
22
+ }
23
+ }
24
+ function T(s, t = "debug", e = console) {
25
+ let o = t;
26
+ const a = (r) => (...i) => {
27
+ try {
28
+ if (!me(o, r)) return;
29
+ const l = `[${Ae()}][${s}][${r.toUpperCase()}]`, c = e[r];
30
+ typeof c == "function" ? c(l, ...i) : e.log(l, ...i);
31
+ } catch {
32
+ }
33
+ };
34
+ return {
35
+ get level() {
36
+ return o;
37
+ },
38
+ setLevel(r) {
39
+ o = r;
40
+ },
41
+ trace: a("trace"),
42
+ debug: a("debug"),
43
+ info: a("info"),
44
+ warn: a("warn"),
45
+ error: a("error"),
46
+ child(r) {
47
+ return T(`${s}:${r}`, o, e);
48
+ }
49
+ };
50
+ }
51
+ const ye = '.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FN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xkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}', be = `.leaflet-draw-section{position:relative}.leaflet-draw-toolbar{margin-top:12px}.leaflet-draw-toolbar-top{margin-top:0}.leaflet-draw-toolbar-notop a:first-child{border-top-right-radius:0}.leaflet-draw-toolbar-nobottom a:last-child{border-bottom-right-radius:0}.leaflet-draw-toolbar a{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAAeCAYAAACWuCNnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAG7AAABuwBHnU4NQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAbvSURBVHic7dtdbBxXFQfw/9nZ3SRKwAP7UFFUQOoHqGnUoEAoNghX9tyxVcpD1X0J+WgiUQmpfUB5ACSgG1qJIKASqBIUIauqAbWseIlqb+bOWHVR6y0FKZBEqdIUQROIREGRx3FFvR/38ODZst3a3nE8Ywfv+T2t7hzdM3fle/bOnWtACCGEEEIIIYQQQgghhBBCCCGEEEIIIcRa0EbfgBDdFItFKwzDAa3175LuWylVAvBIR/MxrXUp6Vxx9dp4VyObVEdKKW591lonXgiVUg6AHzPzk9ls9meVSmUh6RzXkz179uQKhcIgM+8CACI6U6vVnp+enm6knXt4ePiuTCbzWQAwxlSDIHg57ZwroDAMnwKwz3XdBzzPG08hxzsTNprQG2lTjtd13WFmfghAP4A+AJcATFiW9YNKpfL3uP0kUliiX4SG1pqUUpx0wXJd9/PMXAGwPWq6yMyPz8/P/7xarf4nyVwt7QV4JWkU52i8YwBu6bh0wRhzJAiCF5POCQCDg4N2Pp//NYDRjkuTxph9QRCESeYrFov5ubm5R5n5AIAPtV1aYOb7BgYGTpZKJeO67lFmPsbM9/i+/8Ja8y6zylhOYquPXhsvAJRKpczMzMwTAIaJ6LFGo+HNzs5eKRQKNxPRA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1BKfbd9X7RTGIaHmPlcnPNYsVZYSikOw7AB4CAzj/f19e1fjwOMnueVEeMxJJfLbYqCNT093TDGHAGw0qHYBQBH0vj+Pc+bYOb3HFRk5nHf9yeTzgfgMhF9uEvMTQD+71/vR3pqvJOTk28AeBJAeXR09P1LxbiuuxfA9wB8LU6fsVdYrUOhtm0fTusxcAlMRN+KziUt5SqAM3v37r00OZnGfFp/QRC86DjOUCaTGWPm2zoun8fiIbuZtPLX6/UH8/n8rQDuippertfrD6aRKyqOR5VS81ji8Z+IbmfmgwB+mEb+9dZr4wWA/v7+R6rV6k+azeYpx3EezeVyJ7dv335lfn7+lkajcZCZDzPzYd/3/xSnv9gFq3UuaR2LFQDA87xAKVUB8BEAZ6N9nrNEdEZr/TcArLVOPG8aJ9jj8n3/pcHBwZ1btmx5519zmPl0vV5/Ie2V7fT09Nujo6Nus9kcA4CtW7ce1lq/nUYu27a/Mzs7CyI6gMVX/u/CzJeZ+Ue2bcc9pb1aXc8lJZms18YLANE2wkOu694N4OFGo3E8DMMPAHiDiCaY+ZOb4YCsEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhEjYfwGO+b5dFNs4OgAAAABJRU5ErkJggg==);background-image:linear-gradient(transparent,transparent),url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20viewBox='0%200%20600%2060'%20height='60'%20width='600'%20id='svg4225'%20version='1.1'%20inkscape:version='0.91%20r13725'%20sodipodi:docname='spritesheet.svg'%20inkscape:export-filename='/home/fpuga/development/upstream/icarto.Leaflet.draw/src/images/spritesheet-2x.png'%20inkscape:export-xdpi='90'%20inkscape:export-ydpi='90'%3e%3cmetadata%20id='metadata4258'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%20/%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4256'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1056'%20id='namedview4254'%20showgrid='false'%20inkscape:zoom='1.3101852'%20inkscape:cx='237.56928'%20inkscape:cy='7.2419621'%20inkscape:window-x='1920'%20inkscape:window-y='24'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg4225'%20/%3e%3cg%20id='enabled'%20style='fill:%23464646;fill-opacity:1'%3e%3cg%20id='polyline'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%2018,36%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4229'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2036,18%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4231'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2023.142,39.145%20-2.285,-2.29%2016,-15.998%202.285,2.285%20z'%20id='path4233'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20id='polygon'%20d='M%20100,24.565%2097.904,39.395%2083.07,42%2076,28.773%2086.463,18%20Z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='rectangle'%20d='m%20140,20%2020,0%200,20%20-20,0%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='circle'%20d='m%20221,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='marker'%20d='m%20270,19%20c%20-4.971,0%20-9,4.029%20-9,9%200,4.971%205.001,12%209,14%204.001,-2%209,-9.029%209,-14%200,-4.971%20-4.029,-9%20-9,-9%20z%20m%200,12.5%20c%20-2.484,0%20-4.5,-2.014%20-4.5,-4.5%200,-2.484%202.016,-4.5%204.5,-4.5%202.485,0%204.5,2.016%204.5,4.5%200,2.486%20-2.015,4.5%20-4.5,4.5%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cg%20id='edit'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20337,30.156%200,0.407%200,5.604%20c%200,1.658%20-1.344,3%20-3,3%20l%20-10,0%20c%20-1.655,0%20-3,-1.342%20-3,-3%20l%200,-10%20c%200,-1.657%201.345,-3%203,-3%20l%206.345,0%203.19,-3.17%20-9.535,0%20c%20-3.313,0%20-6,2.687%20-6,6%20l%200,10%20c%200,3.313%202.687,6%206,6%20l%2010,0%20c%203.314,0%206,-2.687%206,-6%20l%200,-8.809%20-3,2.968'%20id='path4240'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.72,24.637%20-8.892,8.892%20-2.828,0%200,-2.829%208.89,-8.89%20z'%20id='path4242'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.697,17.826%204,0%200,4%20-4,0%20z'%20transform='matrix(-0.70698336,-0.70723018,0.70723018,-0.70698336,567.55917,274.78273)'%20id='path4244'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cg%20id='remove'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20381,42%2018,0%200,-18%20-18,0%200,18%20z%20m%2014,-16%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z'%20id='path4247'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20395,20%200,-4%20-10,0%200,4%20-6,0%200,2%2022,0%200,-2%20-6,0%20z%20m%20-2,0%20-6,0%200,-2%206,0%200,2%20z'%20id='path4249'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cg%20id='disabled'%20transform='translate(120,0)'%20style='fill:%23bbbbbb'%3e%3cuse%20xlink:href='%23edit'%20id='edit-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3cuse%20xlink:href='%23remove'%20id='remove-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3c/g%3e%3cpath%20style='fill:none;stroke:%23464646;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1'%20id='circle-3'%20d='m%20581.65725,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20/%3e%3c/svg%3e");background-repeat:no-repeat;background-size:300px 30px;background-clip:padding-box}.leaflet-retina .leaflet-draw-toolbar a{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAA8CAYAAAC6nMS5AAAABHNCSVQ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zGt3r5zGRwc7FPV3ap6y0L7ishPAHx63bp1e/bt2xenkQ8LLEuMMZtE5JCqfhfAMwCeSZLkO2vWrDk+NjbGyZHUFjzP2yginwcAVX1fVi99Vo2OjnaeP3/+3SLydgBvBNBd56GXAHxXVR/s7e3dm9YJOg0rqQNm+y5dFtp3HmKM2QxgF8qr9b8GwA0AzgH4MYBjIjJ28eLFkFeOiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIhWgv8Hnffz4dmwY9cAAAAASUVORK5CYII=);background-image:linear-gradient(transparent,transparent),url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20viewBox='0%200%20600%2060'%20height='60'%20width='600'%20id='svg4225'%20version='1.1'%20inkscape:version='0.91%20r13725'%20sodipodi:docname='spritesheet.svg'%20inkscape:export-filename='/home/fpuga/development/upstream/icarto.Leaflet.draw/src/images/spritesheet-2x.png'%20inkscape:export-xdpi='90'%20inkscape:export-ydpi='90'%3e%3cmetadata%20id='metadata4258'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%20/%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4256'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1056'%20id='namedview4254'%20showgrid='false'%20inkscape:zoom='1.3101852'%20inkscape:cx='237.56928'%20inkscape:cy='7.2419621'%20inkscape:window-x='1920'%20inkscape:window-y='24'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg4225'%20/%3e%3cg%20id='enabled'%20style='fill:%23464646;fill-opacity:1'%3e%3cg%20id='polyline'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%2018,36%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4229'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2036,18%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4231'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2023.142,39.145%20-2.285,-2.29%2016,-15.998%202.285,2.285%20z'%20id='path4233'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20id='polygon'%20d='M%20100,24.565%2097.904,39.395%2083.07,42%2076,28.773%2086.463,18%20Z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='rectangle'%20d='m%20140,20%2020,0%200,20%20-20,0%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='circle'%20d='m%20221,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='marker'%20d='m%20270,19%20c%20-4.971,0%20-9,4.029%20-9,9%200,4.971%205.001,12%209,14%204.001,-2%209,-9.029%209,-14%200,-4.971%20-4.029,-9%20-9,-9%20z%20m%200,12.5%20c%20-2.484,0%20-4.5,-2.014%20-4.5,-4.5%200,-2.484%202.016,-4.5%204.5,-4.5%202.485,0%204.5,2.016%204.5,4.5%200,2.486%20-2.015,4.5%20-4.5,4.5%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cg%20id='edit'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20337,30.156%200,0.407%200,5.604%20c%200,1.658%20-1.344,3%20-3,3%20l%20-10,0%20c%20-1.655,0%20-3,-1.342%20-3,-3%20l%200,-10%20c%200,-1.657%201.345,-3%203,-3%20l%206.345,0%203.19,-3.17%20-9.535,0%20c%20-3.313,0%20-6,2.687%20-6,6%20l%200,10%20c%200,3.313%202.687,6%206,6%20l%2010,0%20c%203.314,0%206,-2.687%206,-6%20l%200,-8.809%20-3,2.968'%20id='path4240'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.72,24.637%20-8.892,8.892%20-2.828,0%200,-2.829%208.89,-8.89%20z'%20id='path4242'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.697,17.826%204,0%200,4%20-4,0%20z'%20transform='matrix(-0.70698336,-0.70723018,0.70723018,-0.70698336,567.55917,274.78273)'%20id='path4244'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cg%20id='remove'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20381,42%2018,0%200,-18%20-18,0%200,18%20z%20m%2014,-16%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z'%20id='path4247'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20395,20%200,-4%20-10,0%200,4%20-6,0%200,2%2022,0%200,-2%20-6,0%20z%20m%20-2,0%20-6,0%200,-2%206,0%200,2%20z'%20id='path4249'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cg%20id='disabled'%20transform='translate(120,0)'%20style='fill:%23bbbbbb'%3e%3cuse%20xlink:href='%23edit'%20id='edit-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3cuse%20xlink:href='%23remove'%20id='remove-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3c/g%3e%3cpath%20style='fill:none;stroke:%23464646;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1'%20id='circle-3'%20d='m%20581.65725,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20/%3e%3c/svg%3e")}.leaflet-draw a{display:block;text-align:center;text-decoration:none}.leaflet-draw a .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.leaflet-draw-actions{display:none;list-style:none;margin:0;padding:0;position:absolute;left:26px;top:0;white-space:nowrap}.leaflet-touch .leaflet-draw-actions{left:32px}.leaflet-right .leaflet-draw-actions{right:26px;left:auto}.leaflet-touch .leaflet-right .leaflet-draw-actions{right:32px;left:auto}.leaflet-draw-actions li{display:inline-block}.leaflet-draw-actions li:first-child a{border-left:0}.leaflet-draw-actions li:last-child a{-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.leaflet-right .leaflet-draw-actions li:last-child a{-webkit-border-radius:0;border-radius:0}.leaflet-right .leaflet-draw-actions li:first-child a{-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.leaflet-draw-actions a{background-color:#919187;border-left:1px solid #AAA;color:#fff;font:11px/19px Helvetica Neue,Arial,Helvetica,sans-serif;line-height:28px;text-decoration:none;padding-left:10px;padding-right:10px;height:28px}.leaflet-touch .leaflet-draw-actions a{font-size:12px;line-height:30px;height:30px}.leaflet-draw-actions-bottom{margin-top:0}.leaflet-draw-actions-top{margin-top:1px}.leaflet-draw-actions-top a,.leaflet-draw-actions-bottom a{height:27px;line-height:27px}.leaflet-draw-actions a:hover{background-color:#a0a098}.leaflet-draw-actions-top.leaflet-draw-actions-bottom a{height:26px;line-height:26px}.leaflet-draw-toolbar .leaflet-draw-draw-polyline{background-position:-2px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polyline{background-position:0 -1px}.leaflet-draw-toolbar .leaflet-draw-draw-polygon{background-position:-31px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polygon{background-position:-29px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-rectangle{background-position:-62px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-rectangle{background-position:-60px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-circle{background-position:-92px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circle{background-position:-90px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-marker{background-position:-122px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-marker{background-position:-120px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-circlemarker{background-position:-273px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circlemarker{background-position:-271px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-edit{background-position:-152px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit{background-position:-150px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-remove{background-position:-182px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove{background-position:-180px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled{background-position:-212px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled{background-position:-210px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled{background-position:-242px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled{background-position:-240px -2px}.leaflet-mouse-marker{background-color:#fff;cursor:crosshair}.leaflet-draw-tooltip{background:#363636;background:#00000080;border:1px solid transparent;-webkit-border-radius:4px;border-radius:4px;color:#fff;font:12px/18px Helvetica Neue,Arial,Helvetica,sans-serif;margin-left:20px;margin-top:-21px;padding:4px 8px;position:absolute;visibility:hidden;white-space:nowrap;z-index:6}.leaflet-draw-tooltip:before{border-right:6px solid black;border-right-color:#00000080;border-top:6px solid transparent;border-bottom:6px solid transparent;content:"";position:absolute;top:7px;left:-7px}.leaflet-error-draw-tooltip{background-color:#f2dede;border:1px solid #e6b6bd;color:#b94a48}.leaflet-error-draw-tooltip:before{border-right-color:#e6b6bd}.leaflet-draw-tooltip-single{margin-top:-12px}.leaflet-draw-tooltip-subtext{color:#f8d5e4}.leaflet-draw-guide-dash{font-size:1%;opacity:.6;position:absolute;width:5px;height:5px}.leaflet-edit-marker-selected{background-color:#fe57a11a;border:4px dashed rgba(254,87,161,.6);-webkit-border-radius:4px;border-radius:4px;box-sizing:content-box}.leaflet-edit-move{cursor:move}.leaflet-edit-resize{cursor:pointer}.leaflet-oldie .leaflet-draw-toolbar{border:1px solid #999}`, we = ".leaflet-ruler{height:35px;width:35px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfhBQoMHg6McuYvAAABwklEQVQ4y43TP0jUYRgH8M/daQpqdujhnwShGiwyipCIoIgWxyIwrqEhnCQoGqKhpoYMg1qCQjg8TC2JCtSkjCgaKisIhyQUwpJssD9KZWRZg6d450/yGV54n/fzfd53eUOCaoNa5QpNGNPr9cKjUAatdsB++co0G1XiiHd+uqnTq8VzI874o9s2Ic1iiEpii9tmnJOdfkOldt/dU+HYolHnjdmpRNzbuVaNL86m4sXqNOrz3kMXHFKYMqd8VREGBToMifqLgwY1yNZirya5knaBqH16fJjNJiWEFSlxy4g980+pMuZkir/UJjLbrvNRPnINaLUygK/yQpuImHp47LOjuKJPOJA/1y4iZsAlyozLs8IO42L/4QlhGrSCy5oCeKH+dM59vVbL9sn6AP5MRzpnVKtN1viRxit1WRvEmVKFrQbTpoddNR3E+aYKuw1lPOapa0GcEf22KzOtejmcG1rkYdjEAn59KU5cDzjt+HI4BSZtVJTazfIsMQOmFAusLr/E53lniickJYIDNcaUL+JhMZPWBUdOeCCaweGOw5k0lFrv2uyRuBxPlLpoBtTK0p3mh+f+dKl6jX6LapRj6XrzD+1bmkFA/dTVAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTA1LTEwVDEyOjMwOjE0KzAyOjAwUNH5TAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wNS0xMFQxMjozMDoxNCswMjowMCGMQfAAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:center}.leaflet-ruler:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAACmAAAApgHdff84AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAn9QTFRF////AAAAAAAAAAAAAAAAAAAzABcXABQUABIkDhwrAA0aAAwYABUgABQ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70CA+s2NPoLgMUlciddvnLl3PbslMysmi2ngXKTc/iA4uwRC1dfudRT76UtJy5lMHvHlSsni82ZgBLWbZdOHCuPlARpForvBYszA9ky1WeunC8y5YCI9125cqrEnJlbnoHBZ/6mK+0eTAjxUgtmbl99Bt6Ksxd2pXGDxRPg4kZMDIqxV6406cDFT8PEGRwnHLlYJQwSTwSJ51tCxRmiVuw7VAsRP7zkIEKcofnAlb0hEPWXls9AiDNUHriyMxwoPgVoToEVQpwhdNHuY/2imOIMZq1nr2QUgsVtkMUZZOOuXOmYiinOwF63/8QVsDgLd0wnFwMCOM3dBhK3ZeGOXjzLHklCIu8oRDxs8eaNXYJIMuplJ0HigYs3b906UwFJgtGzxY6FLWDe0mXLli3wVoEAaZAMjxoLA6eDu5urq4uziTEEqAIAvamx163e5EoAAAAASUVORK5CYII=)}.leaflet-ruler-clicked{height:35px;width:35px;background-repeat:no-repeat;background-position:center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAACmAAAApgHdff84AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAn9QTFRF////AAAAAAAAAAAAAAAAAAAzABcXABQUABIkDhwrAA0aAAwYABUgABQfABIbABAZAA8fABUcABMaABMfABIeABEcABAbABQeABMdABIdABEbABIbABIbABEdABEcABIcBxsoABEdABIdABIdABEcABMbABMdFBwgERofAhIbEhsfAhIdBxUeEhsgEBofAhMbAhMdBRMdAhIbAhIdAhMdCRceARIcDBgfDBgfDBcfDBcfFhwgDBceDBceCxceFCs5HTdGAxMcDxofGTFAHDRDHDVDHDVEHTZFDRkfEBofERogCh0oERsgARIcEhsfEhsgCh4pDCEsDRkfDRkfEBofBhQdDSMvDRgfDBgfCBUeBxUeDyUyECYzUDktPTAqCRceCRYeChYeDxkfEBkgLCgmWj4wCBYdW0AwGh4hHCAiHSAiTDctBhUdBxYdEBkfL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HigYs3b906UwFJgtGzxY6FLWDe0mXLli3wVoEAaZAMjxoLA6eDu5urq4uziTEEqAIAvamx163e5EoAAAAASUVORK5CYII=);border-color:#7fff00!important}.leaflet-bar{background-color:#fff}.leaflet-control{cursor:pointer}.result-tooltip{background-color:#fff;border-width:medium;border-color:#de0000;font-size:smaller}.moving-tooltip{background-color:#ffffffb3;background-clip:padding-box;opacity:.5;border:dotted;border-color:red;font-size:smaller}.plus-length{padding-left:45px}", xe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndE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+dfNbM+GgIwYdwAAAAASUVORK5CYII=", ve = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC", Me = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='430'%20height='430'%20style='width:100%25;height:100%25;transform:translate3d(0,0,0);content-visibility:visible'%20viewBox='0%200%20430%20430'%3e%3cdefs%3e%3cclipPath%20id='i'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='s'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='e'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='p'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='f'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='m'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='g'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='j'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='h'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cfilter%20id='t'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'/%3e%3c/filter%3e%3cfilter%20id='r'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'%20stdDeviation='52.5%2052.5'/%3e%3c/filter%3e%3cfilter%20id='n'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'/%3e%3c/filter%3e%3cfilter%20id='k'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'/%3e%3c/filter%3e%3cmask%20id='u'%20mask-type='alpha'%3e%3cuse%20xmlns:ns1='http://www.w3.org/1999/xlink'%20ns1:href='%23a'/%3e%3c/mask%3e%3cmask%20id='q'%20mask-type='alpha'%3e%3cuse%20xmlns:ns2='http://www.w3.org/1999/xlink'%20ns2:href='%23b'/%3e%3c/mask%3e%3cmask%20id='o'%20mask-type='alpha'%3e%3cuse%20xmlns:ns3='http://www.w3.org/1999/xlink'%20ns3:href='%23c'/%3e%3c/mask%3e%3cmask%20id='l'%20mask-type='alpha'%3e%3cuse%20xmlns:ns4='http://www.w3.org/1999/xlink'%20ns4:href='%23d'/%3e%3c/mask%3e%3cg%20id='a'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20clip-path='url(%23e)'%20style='display:none'%3e%3cpath%20class='secondary'%20style='display:none'/%3e%3cpath%20class='primary'%20style='display:none'/%3e%3c/g%3e%3cg%20id='b'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='12'%20clip-path='url(%23f)'%20style='display:block'%3e%3cpath%20stroke='%2308A88A'%20d='M44.446-66.518a79.998%2079.998%200%200%200-101.012%209.952A79.998%2079.998%200%201%200%2056.569%2056.569%2080.005%2080.005%200%200%200%2073.91-30.615a80.001%2080.001%200%200%200-29.464-35.903z'%20class='secondary'%20style='display:block'%20transform='translate(215%20214)'/%3e%3cpath%20stroke='%23121331'%20d='m141.409%2025.241%208.727%205.041s0%200%200%200a22.3%2022.3%200%200%201%2010.411%2013.542%2022.32%2022.32%200%200%201-2.221%2016.937l-26.515%2045.924a22.325%2022.325%200%200%201-30.497%208.172l-8.754-5.059a143.414%20143.414%200%200%201-43.718%2025.286v10.108a22.302%2022.302%200%200%201-13.778%2020.612%2022.303%2022.303%200%200%201-8.539%201.696h-53.029a22.303%2022.303%200%200%201-15.779-6.531%2022.302%2022.302%200%200%201-6.537-15.777v-10.073a143.416%20143.416%200%200%201-43.719-25.285l-8.754%205.059a22.325%2022.325%200%200%201-30.497-8.172l-26.523-45.924a22.315%2022.315%200%200%201-2.238-16.943A22.31%2022.31%200%200%201-150.142%2030.3l8.727-5.041a145.097%20145.097%200%200%201%200-50.518l-8.727-5.041a22.294%2022.294%200%200%201-10.409-13.554%2022.306%2022.306%200%200%201%202.238-16.943l26.514-45.924a22.325%2022.325%200%200%201%2030.497-8.172l8.754%205.059a143.416%20143.416%200%200%201%2043.719-25.285v-10.073a22.302%2022.302%200%200%201%206.537-15.777%2022.3%2022.3%200%200%201%2015.779-6.531h53.02a22.307%2022.307%200%200%201%2022.317%2022.308v10.037a143.41%20143.41%200%200%201%2043.718%2025.285l8.754-5.059a22.325%2022.325%200%200%201%2030.497%208.172l26.515%2045.942a22.313%2022.313%200%200%201-1.618%2024.757%2022.294%2022.294%200%200%201-6.554%205.74l-8.727%205.041a145.097%20145.097%200%200%201%200%2050.518z'%20class='primary'%20style='display:block'%20transform='rotate(-120%20169.576%2045.095)'/%3e%3c/g%3e%3cg%20id='c'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20clip-path='url(%23g)'%20style='display:none'%3e%3cpath%20class='secondary'%20style='display:none'/%3e%3cpath%20class='primary'%20style='display:none'/%3e%3c/g%3e%3cg%20id='d'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20clip-path='url(%23h)'%20style='display:none'%3e%3cpath%20class='secondary'%20style='display:none'/%3e%3cpath%20class='primary'%20style='display:none'/%3e%3c/g%3e%3c/defs%3e%3cg%20clip-path='url(%23i)'%3e%3cg%20clip-path='url(%23j)'%20filter='url(%23k)'%20mask='url(%23l)'%20style='display:none'%3e%3cg%20class='design'%3e%3cpath%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3cg%20clip-path='url(%23m)'%20filter='url(%23n)'%20mask='url(%23o)'%20style='display:none'%3e%3cg%20class='design'%3e%3cpath%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3cg%20clip-path='url(%23p)'%20mask='url(%23q)'%20style='display:block'%3e%3cg%20filter='url(%23r)'%20transform='rotate(-94%20238.762%20-16.565)%20scale(2.4)'%3e%3cg%20class='design'%3e%3cpath%20fill='%234BE1EC'%20d='M0-250c137.975%200%20250%20112.025%20250%20250S137.975%20250%200%20250-250%20137.975-250%200-137.975-250%200-250z'%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20fill='%23CB5EEE'%20d='M113.242-295.384c97.478%200%20176.5%2079.022%20176.5%20176.5s-79.022%20176.5-176.5%20176.5c-43.948%200-74.396-34.057-105.29-60.631-37.631-32.369-71.21-62.338-71.21-115.869%200-97.478%2079.022-176.5%20176.5-176.5z'%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20clip-path='url(%23s)'%20filter='url(%23t)'%20mask='url(%23u)'%20style='display:none'%3e%3cg%20class='design'%3e%3cpath%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ie = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-1.67%2047.336%2047.336'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group_42'%20data-name='Group%2042'%20transform='translate(-172.455%20-364.36)'%3e%3cpath%20id='Rectangle_17'%20data-name='Rectangle%2017'%20d='M4.351,0H40.984a4.351,4.351,0,0,1,4.351,4.351V22.117a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z'%20transform='translate(173.455%20384.243)'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cpath%20id='Path_90'%20data-name='Path%2090'%20d='M218.79,390.249a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.778,3.778,0,0,1-3.777-3.778'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cg%20id='Group_41'%20data-name='Group%2041'%3e%3cpath%20id='Rectangle_18'%20data-name='Rectangle%2018'%20d='M4.351,0H26.473a4.351,4.351,0,0,1,4.351,4.351V17.883a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z'%20transform='translate(180.71%20365.36)'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cpath%20id='Path_91'%20data-name='Path%2091'%20d='M211.234,370.794a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfhBQoMHg6McuYvAAABwklEQVQ4y43TP0jUYRgH8M/daQpqdujhnwShGiwyipCIoIgWxyIwrqEhnCQoGqKhpoYMg1qCQjg8TC2JCtSkjCgaKisIhyQUwpJssD9KZWRZg6d450/yGV54n/fzfd53eUOCaoNa5QpNGNPr9cKjUAatdsB++co0G1XiiHd+uqnTq8VzI874o9s2Ic1iiEpii9tmnJOdfkOldt/dU+HYolHnjdmpRNzbuVaNL86m4sXqNOrz3kMXHFKYMqd8VREGBToMifqLgwY1yNZirya5knaBqH16fJjNJiWEFSlxy4g980+pMuZkir/UJjLbrvNRPnINaLUygK/yQpuImHp47LOjuKJPOJA/1y4iZsAlyozLs8IO42L/4QlhGrSCy5oCeKH+dM59vVbL9sn6AP5MRzpnVKtN1viRxit1WRvEmVKFrQbTpoddNR3E+aYKuw1lPOapa0GcEf22KzOtejmcG1rkYdjEAn59KU5cDzjt+HI4BSZtVJTazfIsMQOmFAusLr/E53lniickJYIDNcaUL+JhMZPWBUdOeCCaweGOw5k0lFrv2uyRuBxPlLpoBtTK0p3mh+f+dKl6jX6LapRj6XrzD+1bmkFA/dTVAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTA1LTEwVDEyOjMwOjE0KzAyOjAwUNH5TAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wNS0xMFQxMjozMDoxNCswMjowMCGMQfAAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC", Ee = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAACmAAAApgHdff84AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAn9QTFRF////AAAAAAAAAAAAAAAAAAAzABcXABQUABIkDhwrAA0aAAwYABUgABQfABIbABAZAA8fABUcABMaABMfABIeABEcABAbABQeABMdABIdABEbABIbABIbABEdABEcABIcBxsoABEdABIdABIdABEcABMbABMdFBwgERofAhIbEhsfAhIdBxUeEhsgEBofAhMbAhMdBRMdAhIbAhIdAhMdCRceARIcDBgfDBgfDBcfDBcfFhwgDBceDBceCxceFCs5HTdGAxMcDxofGTFAHDRDHDVDHDVEHTZFDRkfEBofERogCh0oERsgARIcEhsfEhsgCh4pDCEsDRkfDRkfEBofBhQdDSMvDRgfDBgfCBUeBxUeDyUyECYzUD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OmYiinOwF63/8QVsDgLd0wnFwMCOM3dBhK3ZeGOXjzLHklCIu8oRDxs8eaNXYJIMuplJ0HigYs3b906UwFJgtGzxY6FLWDe0mXLli3wVoEAaZAMjxoLA6eDu5urq4uziTEEqAIAvamx163e5EoAAAAASUVORK5CYII=";
52
+ function Ce(s) {
53
+ const t = "data-leaflet-styles";
54
+ if (s.querySelector(`style[${t}]`)) return;
55
+ const e = document.createElement("style");
56
+ e.setAttribute(t, "true"), e.textContent = `
57
+ /* --- Leaflet core CSS --- */
58
+ ${ye}
59
+
60
+ /* --- Leaflet.draw CSS --- */
61
+ ${be}
62
+
63
+ /* --- Leaflet.ruler CSS --- */
64
+ ${we}
65
+
66
+ /* --- Fix Leaflet.ruler icons (broken relative paths in inlined CSS) --- */
67
+ .leaflet-ruler {
68
+ width: 30px !important; /* Match Leaflet Draw default size approx */
69
+ height: 30px !important;
70
+ background-color: #fff; /* Ensure visibility */
71
+ background-image: url(${Le}) !important;
72
+ background-size: 16px 16px; /* Scale icon to fit */
73
+ }
74
+ .leaflet-ruler:hover,
75
+ .leaflet-ruler-clicked {
76
+ background-image: url(${Ee}) !important;
77
+ }
78
+
79
+ /* --- Custom overrides for marker/handle sizes --- */
80
+ .leaflet-draw-handle,
81
+ .leaflet-editing-icon,
82
+ .leaflet-draw-marker-icon {
83
+ width: 12px !important;
84
+ height: 12px !important;
85
+ margin-left: -6px !important;
86
+ margin-top: -6px !important;
87
+ }
88
+
89
+ /* --- Ruler settings control --- */
90
+ .leaflet-ruler-settings-control {
91
+ display: flex;
92
+ flex-direction: column;
93
+ }
94
+ .leaflet-ruler-settings-button {
95
+ width: 30px;
96
+ height: 30px;
97
+ border: none;
98
+ background-color: #fff;
99
+ background-repeat: no-repeat;
100
+ background-position: center;
101
+ background-size: 22px 22px;
102
+ cursor: pointer;
103
+ padding: 0;
104
+ border-radius: 4px;
105
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
106
+ background-image: url(${Me});
107
+ transition: background-color 0.15s ease, box-shadow 0.15s ease;
108
+ }
109
+ .leaflet-ruler-settings-button:hover {
110
+ background-color: #f4f4f4;
111
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
112
+ }
113
+ .leaflet-ruler-settings-button:focus-visible {
114
+ outline: 2px solid #2c7be5;
115
+ outline-offset: 2px;
116
+ }
117
+
118
+ /* --- Measurement modal --- */
119
+ .leaflet-ruler-modal-overlay {
120
+ position: absolute;
121
+ inset: 0;
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ background: rgba(0, 0, 0, 0.4);
126
+ z-index: 500;
127
+ opacity: 0;
128
+ pointer-events: none;
129
+ transition: opacity 0.2s ease;
130
+ padding: 16px;
131
+ }
132
+ .leaflet-ruler-modal-overlay.is-open {
133
+ opacity: 1;
134
+ pointer-events: auto;
135
+ }
136
+ .leaflet-ruler-modal {
137
+ background: #fff;
138
+ border-radius: 8px;
139
+ width: min(320px, 100%);
140
+ padding: 16px;
141
+ box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
142
+ }
143
+ .leaflet-ruler-modal-title {
144
+ margin: 0 0 8px;
145
+ font-size: 16px;
146
+ font-weight: 600;
147
+ }
148
+ .leaflet-ruler-modal-description {
149
+ margin: 0 0 12px;
150
+ font-size: 13px;
151
+ color: #444;
152
+ }
153
+ .leaflet-ruler-modal-options {
154
+ display: flex;
155
+ flex-direction: column;
156
+ gap: 8px;
157
+ }
158
+ .leaflet-ruler-modal-option {
159
+ display: flex;
160
+ gap: 8px;
161
+ align-items: flex-start;
162
+ font-size: 14px;
163
+ }
164
+ .leaflet-ruler-modal-option input[type="radio"] {
165
+ margin-top: 4px;
166
+ }
167
+ .leaflet-ruler-modal-option span {
168
+ line-height: 1.25;
169
+ }
170
+ .leaflet-ruler-modal-actions {
171
+ margin-top: 16px;
172
+ display: flex;
173
+ justify-content: flex-end;
174
+ }
175
+ .leaflet-ruler-modal-close {
176
+ border: none;
177
+ background: #2c7be5;
178
+ color: #fff;
179
+ border-radius: 4px;
180
+ padding: 6px 12px;
181
+ cursor: pointer;
182
+ font-size: 14px;
183
+ }
184
+ .leaflet-ruler-modal-close:hover {
185
+ background: #1a56c2;
186
+ }
187
+
188
+ /* --- Layer Cake draw tool icon + manager UI --- */
189
+ .leaflet-draw-toolbar a.leaflet-draw-draw-cake {
190
+ background-image: url(${ie}) !important;
191
+ background-size: 18px 18px !important;
192
+ background-position: 50% 50% !important;
193
+ background-repeat: no-repeat !important;
194
+ background-color: #fff;
195
+ }
196
+
197
+ .layer-cake-controls__container {
198
+ display: flex;
199
+ gap: 6px;
200
+ background: white;
201
+ padding: 5px;
202
+ border-radius: 4px;
203
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
204
+ }
205
+
206
+ .layer-cake-controls button {
207
+ border: 1px solid #ccc;
208
+ background: white;
209
+ padding: 4px 8px;
210
+ border-radius: 3px;
211
+ font-size: 12px;
212
+ cursor: pointer;
213
+ }
214
+
215
+ .layer-cake-controls button:hover {
216
+ background: #f4f4f4;
217
+ }
218
+
219
+ /* --- Layer Cake measurement tooltips --- */
220
+ .cake-label {
221
+ background-color: rgba(255, 255, 255, 0.95) !important;
222
+ border: 2px solid #8A2BE2 !important;
223
+ border-radius: 4px !important;
224
+ color: #333 !important;
225
+ font-size: 13px !important;
226
+ font-weight: 600 !important;
227
+ padding: 4px 8px !important;
228
+ white-space: nowrap !important;
229
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
230
+ }
231
+
232
+ .cake-label::before {
233
+ border-right-color: #8A2BE2 !important;
234
+ }
235
+
236
+ /* --- Move tool mode cursor styles --- */
237
+ .leaflet-draw-move-mode {
238
+ cursor: default !important;
239
+ }
240
+
241
+ .leaflet-draw-move-mode .leaflet-interactive {
242
+ cursor: grab !important;
243
+ }
244
+
245
+ .leaflet-draw-move-mode .leaflet-interactive:active {
246
+ cursor: grabbing !important;
247
+ }
248
+ `, s.appendChild(e);
249
+ }
250
+ function Ie(s) {
251
+ const t = "data-leaflet-custom-styles";
252
+ if (s.querySelector(`style[${t}]`)) return;
253
+ const e = document.createElement("style");
254
+ e.setAttribute(t, "true"), e.textContent = `
255
+ /* Ensure Layer Cake toolbar icon uses project asset instead of draw sprite sheet */
256
+ .leaflet-draw-toolbar a.leaflet-draw-draw-cake {
257
+ background-image: url(${ie}) !important;
258
+ background-size: 18px 18px !important;
259
+ background-position: 50% 50% !important;
260
+ background-repeat: no-repeat !important;
261
+ background-color: #fff;
262
+ }
263
+ `, s.appendChild(e);
264
+ }
265
+ function Be() {
266
+ var s, t;
267
+ (t = (s = k.Icon.Default).mergeOptions) == null || t.call(s, {
268
+ iconRetinaUrl: xe,
269
+ iconUrl: ke,
270
+ shadowUrl: ve
271
+ });
272
+ }
273
+ function Se(s) {
274
+ const { root: t, skipStyles: e } = s;
275
+ try {
276
+ e || (Ce(t), Be()), Ie(t);
277
+ } catch {
278
+ }
279
+ }
280
+ let R;
281
+ const ze = new Uint8Array(16);
282
+ function Oe() {
283
+ if (!R && (R = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !R))
284
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
285
+ return R(ze);
286
+ }
287
+ const E = [];
288
+ for (let s = 0; s < 256; ++s)
289
+ E.push((s + 256).toString(16).slice(1));
290
+ function _e(s, t = 0) {
291
+ return E[s[t + 0]] + E[s[t + 1]] + E[s[t + 2]] + E[s[t + 3]] + "-" + E[s[t + 4]] + E[s[t + 5]] + "-" + E[s[t + 6]] + E[s[t + 7]] + "-" + E[s[t + 8]] + E[s[t + 9]] + "-" + E[s[t + 10]] + E[s[t + 11]] + E[s[t + 12]] + E[s[t + 13]] + E[s[t + 14]] + E[s[t + 15]];
292
+ }
293
+ const Re = typeof crypto != "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto), W = {
294
+ randomUUID: Re
295
+ };
296
+ function q(s, t, e) {
297
+ if (W.randomUUID && !s)
298
+ return W.randomUUID();
299
+ s = s || {};
300
+ const o = s.random || (s.rng || Oe)();
301
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, _e(o);
302
+ }
303
+ function De(s) {
304
+ var e, o;
305
+ const t = (o = s.id) != null ? o : (e = s.properties) == null ? void 0 : e.id;
306
+ if (t != null)
307
+ return String(t);
308
+ }
309
+ function Ue(s, t) {
310
+ const e = (o) => {
311
+ switch (o.type) {
312
+ case "Point":
313
+ t(o.coordinates);
314
+ break;
315
+ case "MultiPoint":
316
+ case "LineString":
317
+ for (const a of o.coordinates) t(a);
318
+ break;
319
+ case "MultiLineString":
320
+ case "Polygon":
321
+ for (const a of o.coordinates)
322
+ for (const n of a) t(n);
323
+ break;
324
+ case "MultiPolygon":
325
+ for (const a of o.coordinates)
326
+ for (const n of a)
327
+ for (const r of n) t(r);
328
+ break;
329
+ case "GeometryCollection":
330
+ for (const a of o.geometries) e(a);
331
+ break;
332
+ }
333
+ };
334
+ e(s);
335
+ }
336
+ function Ne(s) {
337
+ const t = s.geometry;
338
+ if (!t) return null;
339
+ let e = 1 / 0, o = 1 / 0, a = -1 / 0, n = -1 / 0, r = !1;
340
+ return Ue(t, (i) => {
341
+ const [l, c] = i;
342
+ typeof l != "number" || typeof c != "number" || (r = !0, l < e && (e = l), c < o && (o = c), l > a && (a = l), c > n && (n = c));
343
+ }), r ? [e, o, a, n] : null;
344
+ }
345
+ function Pe(s) {
346
+ let t = 1 / 0, e = 1 / 0, o = -1 / 0, a = -1 / 0, n = !1;
347
+ for (const r of s.features) {
348
+ const i = Ne(r);
349
+ i && (n = !0, t = Math.min(t, i[0]), e = Math.min(e, i[1]), o = Math.max(o, i[2]), a = Math.max(a, i[3]));
350
+ }
351
+ return n ? [t, e, o, a] : null;
352
+ }
353
+ function Te(s) {
354
+ const [t, e, o, a] = s;
355
+ return [
356
+ [e, t],
357
+ [a, o]
358
+ ];
359
+ }
360
+ function $(s) {
361
+ var e;
362
+ const t = [];
363
+ for (const o of s.features) {
364
+ if (!o || o.type !== "Feature") continue;
365
+ const a = (e = o.properties) != null ? e : {}, n = o.geometry;
366
+ if (n)
367
+ switch (n.type) {
368
+ case "MultiPolygon":
369
+ for (const r of n.coordinates)
370
+ t.push({
371
+ type: "Feature",
372
+ properties: { ...a },
373
+ geometry: { type: "Polygon", coordinates: r }
374
+ });
375
+ break;
376
+ case "MultiLineString":
377
+ for (const r of n.coordinates)
378
+ t.push({
379
+ type: "Feature",
380
+ properties: { ...a },
381
+ geometry: { type: "LineString", coordinates: r }
382
+ });
383
+ break;
384
+ case "MultiPoint":
385
+ for (const r of n.coordinates)
386
+ t.push({
387
+ type: "Feature",
388
+ properties: { ...a },
389
+ geometry: { type: "Point", coordinates: r }
390
+ });
391
+ break;
392
+ case "GeometryCollection":
393
+ for (const r of n.geometries)
394
+ t.push({
395
+ type: "Feature",
396
+ properties: { ...a },
397
+ geometry: r
398
+ });
399
+ break;
400
+ default:
401
+ t.push(o);
402
+ break;
403
+ }
404
+ }
405
+ return { type: "FeatureCollection", features: t };
406
+ }
407
+ function se(s) {
408
+ return (s == null ? void 0 : s.type) === "Polygon";
409
+ }
410
+ function le(s) {
411
+ return (s == null ? void 0 : s.type) === "MultiPolygon";
412
+ }
413
+ function Fe(s) {
414
+ const t = s.geometry;
415
+ return t ? se(t) ? [t.coordinates] : le(t) ? t.coordinates : [] : [];
416
+ }
417
+ function He(s, t) {
418
+ var a, n;
419
+ const e = [];
420
+ for (const r of s) {
421
+ const i = Fe(r);
422
+ i.length > 0 && e.push(...i);
423
+ }
424
+ if (e.length === 0) return null;
425
+ const o = (n = t != null ? t : (a = s[0]) == null ? void 0 : a.properties) != null ? n : {};
426
+ return e.length === 1 ? {
427
+ type: "Feature",
428
+ properties: { ...o },
429
+ geometry: {
430
+ type: "Polygon",
431
+ coordinates: e[0]
432
+ }
433
+ } : {
434
+ type: "Feature",
435
+ properties: { ...o },
436
+ geometry: {
437
+ type: "MultiPolygon",
438
+ coordinates: e
439
+ }
440
+ };
441
+ }
442
+ class Ve {
443
+ constructor(t = T("feature-store", "debug")) {
444
+ h(this, "log");
445
+ h(this, "features");
446
+ this.log = t, this.features = /* @__PURE__ */ new Map();
447
+ }
448
+ size() {
449
+ return this.features.size;
450
+ }
451
+ has(t) {
452
+ return this.features.has(t);
453
+ }
454
+ get(t) {
455
+ return this.features.get(t);
456
+ }
457
+ /**
458
+ * Add features to the store; returns the assigned/normalized ids in order.
459
+ */
460
+ add(t) {
461
+ var n, r, i, l;
462
+ const e = [], o = (r = (n = performance.now) == null ? void 0 : n.call(performance)) != null ? r : Date.now();
463
+ for (const c of t.features) {
464
+ const d = this.ensureId(c), p = { ...c, id: d };
465
+ this.features.set(d, p), e.push(d);
466
+ }
467
+ const a = ((l = (i = performance.now) == null ? void 0 : i.call(performance)) != null ? l : Date.now()) - o;
468
+ return this.log.debug("add", {
469
+ count: t.features.length,
470
+ ids: e,
471
+ elapsedMs: Math.round(a)
472
+ }), e;
473
+ }
474
+ /**
475
+ * Update a feature by id. If the feature does not exist, this is a no-op.
476
+ * The provided feature will overwrite the stored one with the given id.
477
+ */
478
+ update(t, e) {
479
+ if (!this.features.has(t)) {
480
+ this.log.warn("update:missing", { id: t });
481
+ return;
482
+ }
483
+ const o = { ...e, id: t };
484
+ this.features.set(t, o), this.log.debug("update", { id: t });
485
+ }
486
+ /**
487
+ * Remove a feature by id. No-op if missing.
488
+ */
489
+ remove(t) {
490
+ this.features.delete(t) ? this.log.debug("remove", { id: t }) : this.log.warn("remove:missing", { id: t });
491
+ }
492
+ /**
493
+ * Clear all features.
494
+ */
495
+ clear() {
496
+ const t = this.features.size;
497
+ this.features.clear(), this.log.debug("clear", { count: t });
498
+ }
499
+ /**
500
+ * Export snapshot as FeatureCollection.
501
+ */
502
+ toFeatureCollection() {
503
+ return {
504
+ type: "FeatureCollection",
505
+ features: Array.from(this.features.values())
506
+ };
507
+ }
508
+ /**
509
+ * Compute bounds for current data as [[south, west], [north, east]] or null if empty.
510
+ */
511
+ bounds() {
512
+ const t = this.toFeatureCollection();
513
+ if (t.features.length === 0) return null;
514
+ const e = Pe(t);
515
+ return e ? Te(e) : null;
516
+ }
517
+ /**
518
+ * Ensure the feature has an id; returns the resolved id.
519
+ */
520
+ ensureId(t) {
521
+ const e = De(t);
522
+ if (e) return String(e);
523
+ const o = q();
524
+ return t.id = o, t.properties && typeof t.properties == "object" && (t.properties.id = o), o;
525
+ }
526
+ }
527
+ const ee = /* @__PURE__ */ new WeakSet();
528
+ function Ge(s = k) {
529
+ var o;
530
+ if (ee.has(s)) return;
531
+ const t = s.DrawToolbar;
532
+ if (!((o = t == null ? void 0 : t.prototype) != null && o.getModeHandlers)) return;
533
+ const e = t.prototype.getModeHandlers;
534
+ t.prototype.getModeHandlers = function(a) {
535
+ var r, i, l, c;
536
+ const n = e.call(this, a);
537
+ if ((r = this.options) != null && r.cake) {
538
+ const d = (i = s.Draw) == null ? void 0 : i.Cake;
539
+ if (!d) return n;
540
+ n.push({
541
+ enabled: !0,
542
+ handler: new d(a, this.options.cake),
543
+ title: "Draw Layer Cake (Subtractive Zones)"
544
+ });
545
+ }
546
+ if ((l = this.options) != null && l.move) {
547
+ const d = (c = s.Draw) == null ? void 0 : c.Move;
548
+ if (!d) return n;
549
+ n.push({
550
+ enabled: !0,
551
+ handler: new d(a, this.options.move),
552
+ title: "Move/Translate Features"
553
+ });
554
+ }
555
+ return n;
556
+ }, ee.add(s);
557
+ }
558
+ const N = class N extends k.Draw.Circle {
559
+ constructor(t, e) {
560
+ super(t, e), this.type = N.TYPE;
561
+ }
562
+ addHooks() {
563
+ super.addHooks();
564
+ const t = this._tooltip;
565
+ t != null && t.updateContent && t.updateContent({
566
+ text: "Click and drag to draw the Layer Cake base",
567
+ subtext: "Release mouse to finish base layer"
568
+ });
569
+ }
570
+ };
571
+ h(N, "TYPE", "cake");
572
+ let D = N;
573
+ k.Draw.Cake = D;
574
+ function Je(s) {
575
+ const t = s.Draw;
576
+ if (!t || t.Cake) return;
577
+ const o = class o extends t.Circle {
578
+ constructor(n, r) {
579
+ super(n, r), this.type = o.TYPE;
580
+ }
581
+ addHooks() {
582
+ super.addHooks();
583
+ const n = this._tooltip;
584
+ n != null && n.updateContent && n.updateContent({
585
+ text: "Click and drag to draw the Layer Cake base",
586
+ subtext: "Release mouse to finish base layer"
587
+ });
588
+ }
589
+ };
590
+ h(o, "TYPE", "cake");
591
+ let e = o;
592
+ t.Cake = e;
593
+ }
594
+ const P = class P extends k.Draw.Feature {
595
+ constructor(e, o) {
596
+ super(e, o);
597
+ h(this, "_featureGroup");
598
+ h(this, "_selectedLayer", null);
599
+ h(this, "_originalLatLngs", null);
600
+ h(this, "_dragStartLatLng", null);
601
+ h(this, "_isDragging", !1);
602
+ h(this, "_pendingMove", null);
603
+ this.type = P.TYPE, this._featureGroup = (o == null ? void 0 : o.featureGroup) || new k.FeatureGroup();
604
+ }
605
+ enable() {
606
+ this._enabled || super.enable();
607
+ }
608
+ disable() {
609
+ this._enabled && (this._cleanupDragging(), super.disable());
610
+ }
611
+ addHooks() {
612
+ const e = this._map;
613
+ if (!e) return;
614
+ k.DomUtil.addClass(e.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((a) => {
615
+ this._enableLayerHover(a);
616
+ });
617
+ const o = this._tooltip;
618
+ o != null && o.updateContent && o.updateContent({
619
+ text: "Click and drag a feature to move it",
620
+ subtext: ""
621
+ });
622
+ }
623
+ removeHooks() {
624
+ const e = this._map;
625
+ e && (k.DomUtil.removeClass(e.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((o) => {
626
+ this._disableLayerHover(o);
627
+ }), this._cleanupDragging());
628
+ }
629
+ _enableLayerHover(e) {
630
+ e.on && (e.on("mouseover", this._onLayerMouseOver, this), e.on("mouseout", this._onLayerMouseOut, this), e.on("mousedown", this._onLayerMouseDown, this));
631
+ }
632
+ _disableLayerHover(e) {
633
+ e.off && (e.off("mouseover", this._onLayerMouseOver, this), e.off("mouseout", this._onLayerMouseOut, this), e.off("mousedown", this._onLayerMouseDown, this));
634
+ }
635
+ _onLayerMouseOver(e) {
636
+ if (this._isDragging) return;
637
+ const o = e.target;
638
+ if (o.getElement) {
639
+ const a = o.getElement();
640
+ a && (a.style.cursor = "grab");
641
+ } else o._path && (o._path.style.cursor = "grab");
642
+ }
643
+ _onLayerMouseOut(e) {
644
+ if (this._isDragging) return;
645
+ const o = e.target;
646
+ if (o.getElement) {
647
+ const a = o.getElement();
648
+ a && (a.style.cursor = "");
649
+ } else o._path && (o._path.style.cursor = "");
650
+ }
651
+ _onLayerMouseDown(e) {
652
+ if (this._isDragging) return;
653
+ k.DomEvent.stopPropagation(e.originalEvent), k.DomEvent.preventDefault(e.originalEvent);
654
+ const o = e.target;
655
+ if (this._selectedLayer = o, this._isDragging = !0, this._dragStartLatLng = e.latlng, this._storeOriginalLatLngs(o), o.getElement) {
656
+ const n = o.getElement();
657
+ n && (n.style.cursor = "grabbing");
658
+ } else o._path && (o._path.style.cursor = "grabbing");
659
+ this._map.on("mousemove", this._onMouseMove, this), this._map.on("mouseup", this._onMouseUp, this);
660
+ const a = o.toGeoJSON();
661
+ this._pendingMove = {
662
+ layer: o,
663
+ originalGeoJSON: a,
664
+ newGeoJSON: a
665
+ // Will be updated on mouseup
666
+ };
667
+ }
668
+ _storeOriginalLatLngs(e) {
669
+ e.getLatLng ? this._originalLatLngs = e.getLatLng() : e.getLatLngs && (this._originalLatLngs = JSON.parse(
670
+ JSON.stringify(e.getLatLngs())
671
+ ));
672
+ }
673
+ _onMouseMove(e) {
674
+ if (!this._isDragging || !this._selectedLayer || !this._dragStartLatLng)
675
+ return;
676
+ const o = this._selectedLayer, a = {
677
+ lat: e.latlng.lat - this._dragStartLatLng.lat,
678
+ lng: e.latlng.lng - this._dragStartLatLng.lng
679
+ };
680
+ if (o.setLatLng) {
681
+ const n = k.latLng(
682
+ this._originalLatLngs.lat + a.lat,
683
+ this._originalLatLngs.lng + a.lng
684
+ );
685
+ o.setLatLng(n);
686
+ } else if (o.setLatLngs) {
687
+ const n = this._offsetLatLngs(this._originalLatLngs, a);
688
+ o.setLatLngs(n);
689
+ }
690
+ }
691
+ _offsetLatLngs(e, o) {
692
+ return e instanceof k.LatLng || e.lat !== void 0 && e.lng !== void 0 ? k.latLng(e.lat + o.lat, e.lng + o.lng) : Array.isArray(e) ? e.map((a) => this._offsetLatLngs(a, o)) : e;
693
+ }
694
+ _onMouseUp(e) {
695
+ var a, n;
696
+ if (!this._isDragging || !this._selectedLayer) return;
697
+ this._pendingMove && (this._pendingMove.newGeoJSON = this._selectedLayer.toGeoJSON());
698
+ const o = this._selectedLayer;
699
+ if (o.getElement) {
700
+ const r = o.getElement();
701
+ r && (r.style.cursor = "grab");
702
+ } else o._path && (o._path.style.cursor = "grab");
703
+ this._map.fire("draw:moveend", {
704
+ layer: this._selectedLayer,
705
+ originalGeoJSON: (a = this._pendingMove) == null ? void 0 : a.originalGeoJSON,
706
+ newGeoJSON: (n = this._pendingMove) == null ? void 0 : n.newGeoJSON
707
+ }), this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._isDragging = !1;
708
+ }
709
+ _cleanupDragging() {
710
+ if (this._selectedLayer) {
711
+ const e = this._selectedLayer;
712
+ if (e.getElement) {
713
+ const o = e.getElement();
714
+ o && (o.style.cursor = "");
715
+ } else e._path && (e._path.style.cursor = "");
716
+ }
717
+ this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._selectedLayer = null, this._originalLatLngs = null, this._dragStartLatLng = null, this._isDragging = !1, this._pendingMove = null;
718
+ }
719
+ /**
720
+ * Confirm the pending move and dispatch the final event.
721
+ */
722
+ confirmMove() {
723
+ this._pendingMove && (this._map.fire("draw:moveconfirmed", {
724
+ layer: this._pendingMove.layer,
725
+ originalGeoJSON: this._pendingMove.originalGeoJSON,
726
+ newGeoJSON: this._pendingMove.newGeoJSON
727
+ }), this._cleanupDragging());
728
+ }
729
+ /**
730
+ * Cancel the pending move and revert the layer to its original position.
731
+ */
732
+ cancelMove() {
733
+ if (!this._pendingMove) return;
734
+ const e = this._pendingMove.layer;
735
+ e.setLatLng && this._originalLatLngs ? e.setLatLng(this._originalLatLngs) : e.setLatLngs && this._originalLatLngs && e.setLatLngs(this._originalLatLngs), this._cleanupDragging();
736
+ }
737
+ /**
738
+ * Check if there's a pending move awaiting confirmation.
739
+ */
740
+ hasPendingMove() {
741
+ return this._pendingMove !== null;
742
+ }
743
+ };
744
+ h(P, "TYPE", "move");
745
+ let G = P;
746
+ k.Draw.Move = G;
747
+ function Ze(s) {
748
+ const t = s.Draw;
749
+ if (!t || t.Move) return;
750
+ const o = class o extends t.Feature {
751
+ constructor(r, i) {
752
+ super(r, i);
753
+ h(this, "_featureGroup");
754
+ h(this, "_selectedLayer", null);
755
+ h(this, "_originalLatLngs", null);
756
+ h(this, "_dragStartLatLng", null);
757
+ h(this, "_isDragging", !1);
758
+ h(this, "_pendingMove", null);
759
+ this.type = o.TYPE, this._featureGroup = (i == null ? void 0 : i.featureGroup) || new k.FeatureGroup();
760
+ }
761
+ enable() {
762
+ this._enabled || super.enable();
763
+ }
764
+ disable() {
765
+ this._enabled && (this._cleanupDragging(), super.disable());
766
+ }
767
+ addHooks() {
768
+ const r = this._map;
769
+ if (!r) return;
770
+ s.DomUtil.addClass(r.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((l) => {
771
+ this._enableLayerHover(l);
772
+ });
773
+ const i = this._tooltip;
774
+ i != null && i.updateContent && i.updateContent({
775
+ text: "Click and drag a feature to move it",
776
+ subtext: ""
777
+ });
778
+ }
779
+ removeHooks() {
780
+ const r = this._map;
781
+ r && (s.DomUtil.removeClass(r.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((i) => {
782
+ this._disableLayerHover(i);
783
+ }), this._cleanupDragging());
784
+ }
785
+ _enableLayerHover(r) {
786
+ r.on && (r.on("mouseover", this._onLayerMouseOver, this), r.on("mouseout", this._onLayerMouseOut, this), r.on("mousedown", this._onLayerMouseDown, this));
787
+ }
788
+ _disableLayerHover(r) {
789
+ r.off && (r.off("mouseover", this._onLayerMouseOver, this), r.off("mouseout", this._onLayerMouseOut, this), r.off("mousedown", this._onLayerMouseDown, this));
790
+ }
791
+ _onLayerMouseOver(r) {
792
+ if (this._isDragging) return;
793
+ const i = r.target;
794
+ if (i.getElement) {
795
+ const l = i.getElement();
796
+ l && (l.style.cursor = "grab");
797
+ } else i._path && (i._path.style.cursor = "grab");
798
+ }
799
+ _onLayerMouseOut(r) {
800
+ if (this._isDragging) return;
801
+ const i = r.target;
802
+ if (i.getElement) {
803
+ const l = i.getElement();
804
+ l && (l.style.cursor = "");
805
+ } else i._path && (i._path.style.cursor = "");
806
+ }
807
+ _onLayerMouseDown(r) {
808
+ if (this._isDragging) return;
809
+ s.DomEvent.stopPropagation(r.originalEvent), s.DomEvent.preventDefault(r.originalEvent);
810
+ const i = r.target;
811
+ if (this._selectedLayer = i, this._isDragging = !0, this._dragStartLatLng = r.latlng, this._storeOriginalLatLngs(i), i.getElement) {
812
+ const c = i.getElement();
813
+ c && (c.style.cursor = "grabbing");
814
+ } else i._path && (i._path.style.cursor = "grabbing");
815
+ this._map.on("mousemove", this._onMouseMove, this), this._map.on("mouseup", this._onMouseUp, this);
816
+ const l = i.toGeoJSON();
817
+ this._pendingMove = {
818
+ layer: i,
819
+ originalGeoJSON: l,
820
+ newGeoJSON: l
821
+ };
822
+ }
823
+ _storeOriginalLatLngs(r) {
824
+ r.getLatLng ? this._originalLatLngs = r.getLatLng() : r.getLatLngs && (this._originalLatLngs = JSON.parse(
825
+ JSON.stringify(r.getLatLngs())
826
+ ));
827
+ }
828
+ _onMouseMove(r) {
829
+ if (!this._isDragging || !this._selectedLayer || !this._dragStartLatLng)
830
+ return;
831
+ const i = this._selectedLayer, l = {
832
+ lat: r.latlng.lat - this._dragStartLatLng.lat,
833
+ lng: r.latlng.lng - this._dragStartLatLng.lng
834
+ };
835
+ if (i.setLatLng) {
836
+ const c = s.latLng(
837
+ this._originalLatLngs.lat + l.lat,
838
+ this._originalLatLngs.lng + l.lng
839
+ );
840
+ i.setLatLng(c);
841
+ } else if (i.setLatLngs) {
842
+ const c = this._offsetLatLngs(this._originalLatLngs, l);
843
+ i.setLatLngs(c);
844
+ }
845
+ }
846
+ _offsetLatLngs(r, i) {
847
+ return r instanceof s.LatLng || r.lat !== void 0 && r.lng !== void 0 ? s.latLng(r.lat + i.lat, r.lng + i.lng) : Array.isArray(r) ? r.map((l) => this._offsetLatLngs(l, i)) : r;
848
+ }
849
+ _onMouseUp(r) {
850
+ var l, c;
851
+ if (!this._isDragging || !this._selectedLayer) return;
852
+ this._pendingMove && (this._pendingMove.newGeoJSON = this._selectedLayer.toGeoJSON());
853
+ const i = this._selectedLayer;
854
+ if (i.getElement) {
855
+ const d = i.getElement();
856
+ d && (d.style.cursor = "grab");
857
+ } else i._path && (i._path.style.cursor = "grab");
858
+ this._map.fire("draw:moveend", {
859
+ layer: this._selectedLayer,
860
+ originalGeoJSON: (l = this._pendingMove) == null ? void 0 : l.originalGeoJSON,
861
+ newGeoJSON: (c = this._pendingMove) == null ? void 0 : c.newGeoJSON
862
+ }), this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._isDragging = !1;
863
+ }
864
+ _cleanupDragging() {
865
+ if (this._selectedLayer) {
866
+ const r = this._selectedLayer;
867
+ if (r.getElement) {
868
+ const i = r.getElement();
869
+ i && (i.style.cursor = "");
870
+ } else r._path && (r._path.style.cursor = "");
871
+ }
872
+ this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._selectedLayer = null, this._originalLatLngs = null, this._dragStartLatLng = null, this._isDragging = !1, this._pendingMove = null;
873
+ }
874
+ confirmMove() {
875
+ this._pendingMove && (this._map.fire("draw:moveconfirmed", {
876
+ layer: this._pendingMove.layer,
877
+ originalGeoJSON: this._pendingMove.originalGeoJSON,
878
+ newGeoJSON: this._pendingMove.newGeoJSON
879
+ }), this._cleanupDragging());
880
+ }
881
+ cancelMove() {
882
+ if (!this._pendingMove) return;
883
+ const r = this._pendingMove.layer;
884
+ r.setLatLng && this._originalLatLngs ? r.setLatLng(this._originalLatLngs) : r.setLatLngs && this._originalLatLngs && r.setLatLngs(this._originalLatLngs), this._cleanupDragging();
885
+ }
886
+ hasPendingMove() {
887
+ return this._pendingMove !== null;
888
+ }
889
+ };
890
+ h(o, "TYPE", "move");
891
+ let e = o;
892
+ t.Move = e;
893
+ }
894
+ const Ye = 63710088e-1;
895
+ function H(s) {
896
+ return s * Math.PI / 180;
897
+ }
898
+ function te(s) {
899
+ return s * 180 / Math.PI;
900
+ }
901
+ function je(s, t, e) {
902
+ const o = t / Ye, a = H(e), n = H(s.lat), r = H(s.lng), i = Math.sin(n), l = Math.cos(n), c = Math.sin(o), d = Math.cos(o), p = i * d + l * c * Math.cos(a), u = Math.asin(p), f = Math.sin(a) * c * l, g = d - i * p, A = r + Math.atan2(f, g);
903
+ return { lat: te(u), lng: te(A) };
904
+ }
905
+ function qe(s) {
906
+ let t = 0;
907
+ for (let e = 0; e < s.length - 1; e++) {
908
+ const [o, a] = s[e], [n, r] = s[e + 1];
909
+ t += o * r - n * a;
910
+ }
911
+ return t / 2;
912
+ }
913
+ function J(s) {
914
+ const t = s[0], e = s.at(-1);
915
+ return !t || !e || t[0] === e[0] && t[1] === e[1] ? s : [...s, t];
916
+ }
917
+ function Z(s, t) {
918
+ const e = J(s);
919
+ if (qe(e) < 0 === t) return e;
920
+ const n = [...e].reverse();
921
+ return J(n);
922
+ }
923
+ function Y(s, t, e) {
924
+ if (e < 4) throw new Error("steps must be >= 4");
925
+ const o = [];
926
+ for (let a = 0; a < e; a++) {
927
+ const n = a / e * 360, r = je(s, t, n);
928
+ o.push([r.lng, r.lat]);
929
+ }
930
+ return J(o);
931
+ }
932
+ function Qe(s) {
933
+ const { id: t, center: e, radiusMeters: o, layerIndex: a, steps: n } = s, r = Z(Y(e, o, n), !1);
934
+ return {
935
+ type: "Feature",
936
+ properties: {
937
+ id: t,
938
+ layer_index: a,
939
+ radius_outer: o,
940
+ type: "core",
941
+ _meta: {
942
+ lat: e.lat,
943
+ lng: e.lng,
944
+ radius: o
945
+ }
946
+ },
947
+ geometry: { type: "Polygon", coordinates: [r] }
948
+ };
949
+ }
950
+ function Ke(s) {
951
+ const {
952
+ id: t,
953
+ center: e,
954
+ radiusOuterMeters: o,
955
+ radiusInnerMeters: a,
956
+ layerIndex: n,
957
+ steps: r
958
+ } = s, i = Z(
959
+ Y(e, o, r),
960
+ !1
961
+ ), l = Z(
962
+ Y(e, a, r),
963
+ !0
964
+ );
965
+ return {
966
+ type: "Feature",
967
+ properties: {
968
+ id: t,
969
+ layer_index: n,
970
+ radius_outer: o,
971
+ type: "ring",
972
+ _meta: {
973
+ lat: e.lat,
974
+ lng: e.lng,
975
+ radius: o
976
+ }
977
+ },
978
+ geometry: { type: "Polygon", coordinates: [i, l] }
979
+ };
980
+ }
981
+ function Xe(s) {
982
+ const { circles: t, steps: e = 64 } = s, o = [...t].sort((n, r) => n.getRadius() - r.getRadius()), a = [];
983
+ return o.forEach((n, r) => {
984
+ const i = n.getLatLng(), l = n.getRadius(), c = q();
985
+ if (r === 0) {
986
+ a.push(
987
+ Qe({ id: c, center: i, radiusMeters: l, layerIndex: r, steps: e })
988
+ );
989
+ return;
990
+ }
991
+ const p = o[r - 1].getRadius();
992
+ a.push(
993
+ Ke({
994
+ id: c,
995
+ center: i,
996
+ radiusOuterMeters: l,
997
+ radiusInnerMeters: p,
998
+ layerIndex: r,
999
+ steps: e
1000
+ })
1001
+ );
1002
+ }), { type: "FeatureCollection", features: a };
1003
+ }
1004
+ function z(s) {
1005
+ s.preventDefault(), s.stopPropagation();
1006
+ }
1007
+ function We(s) {
1008
+ var c, d;
1009
+ const { root: t, addButtonId: e, saveButtonId: o, onAddRing: a, onSave: n } = s, r = (c = t.querySelector) == null ? void 0 : c.call(t, `#${e}`), i = (d = t.querySelector) == null ? void 0 : d.call(t, `#${o}`);
1010
+ if (!r || !i) return;
1011
+ const l = "data-cake-controls-bound";
1012
+ if (!(r.hasAttribute(l) || i.hasAttribute(l))) {
1013
+ r.setAttribute(l, "true"), i.setAttribute(l, "true");
1014
+ for (const p of [r, i])
1015
+ p.addEventListener("pointerdown", z), p.addEventListener("mousedown", z), p.addEventListener("touchstart", z);
1016
+ r.addEventListener("click", (p) => {
1017
+ z(p), a();
1018
+ }), i.addEventListener("click", (p) => {
1019
+ z(p), n();
1020
+ });
1021
+ }
1022
+ }
1023
+ function $e(s) {
1024
+ var e;
1025
+ const t = (e = s.options) != null ? e : {};
1026
+ t.original || (t.original = { ...t }), t.editing || (t.editing = { ...t });
1027
+ }
1028
+ function O(s, t) {
1029
+ if (t === "imperial") {
1030
+ const e = s * 3.28084;
1031
+ return e >= 5280 ? `${(e / 5280).toFixed(2)} mi` : `${Math.round(e)} ft`;
1032
+ }
1033
+ return s >= 1e3 ? `${(s / 1e3).toFixed(2)} km` : `${Math.round(s)} m`;
1034
+ }
1035
+ class et {
1036
+ constructor(t, e, o, a = "metric") {
1037
+ h(this, "map");
1038
+ h(this, "layers", []);
1039
+ h(this, "controlsGroup");
1040
+ h(this, "onSave");
1041
+ h(this, "sessionId", q().slice(0, 8));
1042
+ h(this, "baseCircleOptions");
1043
+ h(this, "detachMapListeners", []);
1044
+ h(this, "renderScheduled", !1);
1045
+ h(this, "measurementSystem");
1046
+ this.map = t, this.onSave = o, this.measurementSystem = a, this.controlsGroup = k.layerGroup().addTo(t), this.baseCircleOptions = { ...e.options }, delete this.baseCircleOptions.editing, delete this.baseCircleOptions.original, this.addLayer(e), this.installEditEventBridges(), this.renderControls();
1047
+ }
1048
+ installEditEventBridges() {
1049
+ var d, p, u, f, g, A, w, b;
1050
+ const t = k, e = (p = (d = t == null ? void 0 : t.Draw) == null ? void 0 : d.Event) == null ? void 0 : p.EDITMOVE, o = (f = (u = t == null ? void 0 : t.Draw) == null ? void 0 : u.Event) == null ? void 0 : f.EDITRESIZE, a = (A = (g = t == null ? void 0 : t.Draw) == null ? void 0 : g.Event) == null ? void 0 : A.EDITSTART, n = (b = (w = t == null ? void 0 : t.Draw) == null ? void 0 : w.Event) == null ? void 0 : b.EDITSTOP;
1051
+ if (!e || !o) return;
1052
+ const r = (m) => {
1053
+ const y = m == null ? void 0 : m.layer;
1054
+ y && this.layers.includes(y) && this.syncCenters(y);
1055
+ }, i = (m) => {
1056
+ const y = m == null ? void 0 : m.layer;
1057
+ y && this.layers.includes(y) && (this.updateLabels(y), this.requestRenderControls());
1058
+ }, l = (m) => {
1059
+ var v;
1060
+ const y = m == null ? void 0 : m.layer;
1061
+ if (!y || !this.layers.includes(y)) return;
1062
+ const x = y;
1063
+ ((v = x.getTooltip) == null ? void 0 : v.call(x)) && this.updateLabels(x);
1064
+ }, c = () => {
1065
+ this.layers.forEach((m) => {
1066
+ var x;
1067
+ const y = (x = m.getTooltip) == null ? void 0 : x.call(m);
1068
+ y && (m.setTooltipContent(
1069
+ O(m.getRadius(), this.measurementSystem)
1070
+ ), y.options.offset = [10, 0], y.options.direction = "right", m.closeTooltip(), m.openTooltip());
1071
+ });
1072
+ };
1073
+ this.map.on(e, r), this.map.on(o, i), a && (this.map.on(a, l), this.detachMapListeners.push(() => this.map.off(a, l))), n && (this.map.on(n, c), this.detachMapListeners.push(() => this.map.off(n, c))), this.detachMapListeners.push(() => this.map.off(e, r)), this.detachMapListeners.push(() => this.map.off(o, i));
1074
+ }
1075
+ requestRenderControls() {
1076
+ if (this.renderScheduled) return;
1077
+ this.renderScheduled = !0, (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (e) => setTimeout(() => e(0), 0))(() => {
1078
+ this.renderScheduled = !1, this.renderControls();
1079
+ });
1080
+ }
1081
+ addLayer(t) {
1082
+ this.layers.push(t), t.addTo(this.map), t.bindTooltip(
1083
+ O(t.getRadius(), this.measurementSystem),
1084
+ {
1085
+ permanent: !0,
1086
+ direction: "right",
1087
+ className: "cake-label",
1088
+ offset: [10, 0]
1089
+ }
1090
+ );
1091
+ const e = t.editing;
1092
+ setTimeout(() => {
1093
+ var o, a, n, r, i;
1094
+ try {
1095
+ if ((o = t.redraw) == null || o.call(t), $e(t), (a = e == null ? void 0 : e.enabled) != null && a.call(e)) {
1096
+ (n = e.updateMarkers) == null || n.call(e), this.requestRenderControls();
1097
+ return;
1098
+ }
1099
+ (r = e == null ? void 0 : e.enable) == null || r.call(e), (i = e == null ? void 0 : e.updateMarkers) == null || i.call(e), this.requestRenderControls();
1100
+ } catch {
1101
+ }
1102
+ }, 0);
1103
+ }
1104
+ addRing() {
1105
+ if (this.layers.length >= 10) return;
1106
+ const t = this.getLargestCircle();
1107
+ if (!t) return;
1108
+ const e = t.getRadius() * 1.5, o = k.circle(t.getLatLng(), {
1109
+ ...this.baseCircleOptions,
1110
+ radius: e
1111
+ });
1112
+ this.addLayer(o), this.renderControls();
1113
+ }
1114
+ save() {
1115
+ const t = Xe({ circles: this.layers });
1116
+ this.onSave(t), this.destroy();
1117
+ }
1118
+ getLargestCircle() {
1119
+ return this.layers.length === 0 ? null : this.layers.reduce(
1120
+ (t, e) => t.getRadius() > e.getRadius() ? t : e
1121
+ );
1122
+ }
1123
+ syncCenters(t) {
1124
+ const e = t.getLatLng();
1125
+ this.layers.forEach((o) => {
1126
+ var a, n, r;
1127
+ o !== t && (o.setLatLng(e), (a = o.redraw) == null || a.call(o), (r = (n = o.editing) == null ? void 0 : n.updateMarkers) == null || r.call(n));
1128
+ }), this.requestRenderControls();
1129
+ }
1130
+ /**
1131
+ * Update the label for the active circle being resized.
1132
+ * Shows both total radius and delta (ring width) from the next smaller circle.
1133
+ * Positions the tooltip on the left side to avoid toolbar interference.
1134
+ */
1135
+ updateLabels(t) {
1136
+ var r;
1137
+ const e = t.getRadius();
1138
+ let o = O(e, this.measurementSystem);
1139
+ const a = this.layers.filter(
1140
+ (i) => i !== t && i.getRadius() < e
1141
+ );
1142
+ if (a.length > 0) {
1143
+ const i = a.reduce(
1144
+ (d, p) => d.getRadius() > p.getRadius() ? d : p
1145
+ ), l = e - i.getRadius(), c = O(l, this.measurementSystem);
1146
+ o = `${O(e, this.measurementSystem)} (+${c})`;
1147
+ }
1148
+ const n = (r = t.getTooltip) == null ? void 0 : r.call(t);
1149
+ if (n) {
1150
+ t.setTooltipContent(o);
1151
+ const l = t.getBounds().getSouthWest();
1152
+ l.lat = t.getLatLng().lat, n.options.direction = "left", n.options.offset = [-10, 0], n.setLatLng(l), t.closeTooltip(), t.openTooltip();
1153
+ }
1154
+ }
1155
+ renderControls() {
1156
+ this.controlsGroup.clearLayers();
1157
+ const t = this.getLargestCircle();
1158
+ if (!t) return;
1159
+ const o = t.getBounds().getNorthEast(), a = `cake-add-${this.sessionId}`, n = `cake-save-${this.sessionId}`, r = k.divIcon({
1160
+ className: "layer-cake-controls",
1161
+ html: `
1162
+ <div class="layer-cake-controls__container">
1163
+ <button id="${a}" type="button">➕ Ring</button>
1164
+ <button id="${n}" type="button" class="layer-cake-controls__save">💾 Save</button>
1165
+ </div>
1166
+ `,
1167
+ iconSize: [140, 40],
1168
+ iconAnchor: [-10, 20]
1169
+ });
1170
+ k.marker(o, {
1171
+ icon: r,
1172
+ interactive: !0,
1173
+ keyboard: !1,
1174
+ bubblingMouseEvents: !1
1175
+ }).addTo(this.controlsGroup), setTimeout(() => {
1176
+ const i = this.map.getContainer();
1177
+ We({
1178
+ root: i,
1179
+ addButtonId: a,
1180
+ saveButtonId: n,
1181
+ onAddRing: () => this.addRing(),
1182
+ onSave: () => this.save()
1183
+ });
1184
+ }, 0);
1185
+ }
1186
+ destroy() {
1187
+ this.detachMapListeners.forEach((t) => {
1188
+ try {
1189
+ t();
1190
+ } catch {
1191
+ }
1192
+ }), this.detachMapListeners = [], this.layers.forEach((t) => this.map.removeLayer(t)), this.layers = [], this.controlsGroup.clearLayers(), this.map.removeLayer(this.controlsGroup);
1193
+ }
1194
+ }
1195
+ const tt = `<?xml version="1.0" encoding="utf-8"?>
1196
+ \r<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
1197
+ <svg width="800px" height="800px" viewBox="0 -1.67 47.336 47.336" xmlns="http://www.w3.org/2000/svg">\r
1198
+ <g id="Group_42" data-name="Group 42" transform="translate(-172.455 -364.36)">\r
1199
+ <path id="Rectangle_17" data-name="Rectangle 17" d="M4.351,0H40.984a4.351,4.351,0,0,1,4.351,4.351V22.117a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z" transform="translate(173.455 384.243)" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1200
+ <path id="Path_90" data-name="Path 90" d="M218.79,390.249a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.778,3.778,0,0,1-3.777-3.778" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1201
+ <g id="Group_41" data-name="Group 41">\r
1202
+ <path id="Rectangle_18" data-name="Rectangle 18" d="M4.351,0H26.473a4.351,4.351,0,0,1,4.351,4.351V17.883a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z" transform="translate(180.71 365.36)" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1203
+ <path id="Path_91" data-name="Path 91" d="M211.234,370.794a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1204
+ </g>\r
1205
+ </g>\r
1206
+ </svg>`, ot = `<?xml version="1.0" encoding="utf-8"?>
1207
+ <!-- Four-way directional arrow icon for move tool -->
1208
+ <svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
1209
+ <g fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
1210
+ <!-- Up arrow -->
1211
+ <path d="M12 2 L12 22"/>
1212
+ <path d="M12 2 L9 5"/>
1213
+ <path d="M12 2 L15 5"/>
1214
+ <!-- Down arrow -->
1215
+ <path d="M12 22 L9 19"/>
1216
+ <path d="M12 22 L15 19"/>
1217
+ <!-- Left arrow -->
1218
+ <path d="M2 12 L22 12"/>
1219
+ <path d="M2 12 L5 9"/>
1220
+ <path d="M2 12 L5 15"/>
1221
+ <!-- Right arrow -->
1222
+ <path d="M22 12 L19 9"/>
1223
+ <path d="M22 12 L19 15"/>
1224
+ </g>
1225
+ </svg>
1226
+ `, ce = 6378137, B = 6356752314245e-6, C = 1 / 298.257223563, at = Math.PI / 180, rt = 180 / Math.PI, U = 1e9;
1227
+ function nt(s) {
1228
+ const t = BigInt(Math.round(s * U));
1229
+ return Number(t) / U;
1230
+ }
1231
+ function S(s) {
1232
+ return nt(s) * at;
1233
+ }
1234
+ function oe(s) {
1235
+ const t = s * rt % 360;
1236
+ return t < 0 ? t + 360 : t;
1237
+ }
1238
+ function j(s) {
1239
+ const t = BigInt(Math.round(s * U));
1240
+ return Number(t) / U;
1241
+ }
1242
+ function it(s, t, e, o) {
1243
+ const a = st(s, t, e, o);
1244
+ if (a.converged)
1245
+ return {
1246
+ meters: j(a.distanceMeters),
1247
+ bearingDegrees: oe(a.bearingRad),
1248
+ algorithm: "vincenty",
1249
+ iterations: a.iterations
1250
+ };
1251
+ const n = lt(s, t, e, o);
1252
+ return {
1253
+ meters: j(n.distanceMeters),
1254
+ bearingDegrees: oe(n.bearingRad),
1255
+ algorithm: "karney",
1256
+ iterations: a.iterations
1257
+ };
1258
+ }
1259
+ function st(s, t, e, o) {
1260
+ const a = S(s), n = S(e), r = S(o - t), i = Math.atan((1 - C) * Math.tan(a)), l = Math.atan((1 - C) * Math.tan(n)), c = Math.sin(i), d = Math.cos(i), p = Math.sin(l), u = Math.cos(l);
1261
+ let f = r, g = 0, A = 0;
1262
+ const w = 200;
1263
+ let b = 0, m = 0, y = 0, x = 0, L = 0, v = 0;
1264
+ for (; Math.abs(f - g) > 1e-12 && A < w; ) {
1265
+ const Q = Math.sin(f), K = Math.cos(f);
1266
+ if (b = Math.sqrt(
1267
+ (u * Q) ** 2 + (d * p - c * u * K) ** 2
1268
+ ), b === 0)
1269
+ return {
1270
+ distanceMeters: 0,
1271
+ bearingRad: 0,
1272
+ iterations: A,
1273
+ converged: !0
1274
+ };
1275
+ m = c * p + d * u * K, y = Math.atan2(b, m), x = d * u * Q / b, L = 1 - x ** 2, v = L === 0 ? 0 : m - 2 * c * p / L;
1276
+ const F = C / 16 * L * (4 + C * (4 - 3 * L));
1277
+ g = f, f = r + (1 - F) * C * x * (y + F * b * (v + F * m * (-1 + 2 * v ** 2))), A += 1;
1278
+ }
1279
+ if (A >= w)
1280
+ return {
1281
+ distanceMeters: Number.NaN,
1282
+ bearingRad: 0,
1283
+ iterations: A,
1284
+ converged: !1
1285
+ };
1286
+ const M = (ce ** 2 - B ** 2) / B ** 2 * L, I = 1 + M / 16384 * (4096 + M * (-768 + M * (320 - 175 * M))), _ = M / 1024 * (256 + M * (-128 + M * (74 - 47 * M))), he = _ * b * (v + _ / 4 * (m * (-1 + 2 * v ** 2) - _ / 6 * v * (-3 + 4 * b ** 2) * (-3 + 4 * v ** 2))), pe = B * I * (y - he), ue = Math.atan2(
1287
+ u * Math.sin(f),
1288
+ d * p - c * u * Math.cos(f)
1289
+ );
1290
+ return {
1291
+ distanceMeters: pe,
1292
+ bearingRad: ue,
1293
+ iterations: A,
1294
+ converged: !0
1295
+ };
1296
+ }
1297
+ function lt(s, t, e, o) {
1298
+ const a = S(s), n = S(e), r = S(o - t), i = Math.atan((1 - C) * Math.tan(a)), l = Math.atan((1 - C) * Math.tan(n)), c = Math.sin(i), d = Math.cos(i), p = Math.sin(l), u = Math.cos(l), f = Math.sqrt(
1299
+ (u * Math.sin(r)) ** 2 + (d * p - c * u * Math.cos(r)) ** 2
1300
+ ), g = c * p + d * u * Math.cos(r), A = Math.atan2(f, g);
1301
+ if (A === 0)
1302
+ return { distanceMeters: 0, bearingRad: 0 };
1303
+ const b = 1 - (d * u * Math.sin(r) / Math.sin(A)) ** 2, m = b === 0 ? 0 : g - 2 * c * p / b, y = (ce ** 2 - B ** 2) / B ** 2 * b, x = 1 + y / 16384 * (4096 + y * (-768 + y * (320 - 175 * y))), L = y / 1024 * (256 + y * (-128 + y * (74 - 47 * y))), v = L * f * (m + L / 4 * (g * (-1 + 2 * m ** 2) - L / 6 * m * (-3 + 4 * f ** 2) * (-3 + 4 * m ** 2))), M = B * x * (A - v), I = Math.atan2(
1304
+ u * Math.sin(r),
1305
+ d * p - c * u * Math.cos(r)
1306
+ );
1307
+ return { distanceMeters: M, bearingRad: I };
1308
+ }
1309
+ const ct = {
1310
+ position: "topleft",
1311
+ circleMarker: {
1312
+ color: "red",
1313
+ radius: 2
1314
+ },
1315
+ lineStyle: {
1316
+ color: "red",
1317
+ dashArray: "1,6"
1318
+ },
1319
+ angleUnit: {
1320
+ display: "°",
1321
+ decimal: 2,
1322
+ factor: null,
1323
+ label: "Bearing:"
1324
+ }
1325
+ }, dt = {
1326
+ display: "km",
1327
+ decimal: 2,
1328
+ factor: null,
1329
+ label: "Distance (km):"
1330
+ }, ht = {
1331
+ display: "mi",
1332
+ decimal: 2,
1333
+ factor: 0.621371,
1334
+ label: "Distance (mi):"
1335
+ };
1336
+ function pt(s) {
1337
+ const t = s === "imperial" ? { ...ht } : { ...dt };
1338
+ return {
1339
+ ...ct,
1340
+ lengthUnit: t
1341
+ };
1342
+ }
1343
+ const ut = {
1344
+ metric: "Meters / Kilometers",
1345
+ imperial: "Feet / Miles"
1346
+ };
1347
+ function V(s, t = {}) {
1348
+ var n, r;
1349
+ const e = !!((n = s == null ? void 0 : s.Control) != null && n.Draw), o = !!s.draw, a = e && o;
1350
+ return a || (r = t.onError) == null || r.call(
1351
+ t,
1352
+ "Leaflet.draw is not available on the provided Leaflet instance"
1353
+ ), a;
1354
+ }
1355
+ let ae = !1;
1356
+ class ft {
1357
+ constructor(t) {
1358
+ h(this, "container");
1359
+ h(this, "logger");
1360
+ h(this, "options");
1361
+ // Active Leaflet namespace (injected or bundled fallback)
1362
+ h(this, "L");
1363
+ // Data store (id-centric)
1364
+ h(this, "store");
1365
+ // Leaflet entities
1366
+ h(this, "map", null);
1367
+ h(this, "drawnItems", null);
1368
+ // Keep 'any' here to avoid type friction across different @types/leaflet-draw versions
1369
+ h(this, "drawControl", null);
1370
+ h(this, "rulerControl", null);
1371
+ h(this, "measurementControl", null);
1372
+ h(this, "measurementSystem", "metric");
1373
+ h(this, "measurementModalOverlay", null);
1374
+ h(this, "measurementModalDialog", null);
1375
+ h(this, "measurementModalRadios", {});
1376
+ h(this, "measurementModalKeydownHandler", null);
1377
+ // Detacher for our polygon close-on-first-vertex patch
1378
+ h(this, "detachPolygonFinishPatch", null);
1379
+ // Context menu for vertex deletion
1380
+ h(this, "vertexMenuEl", null);
1381
+ h(this, "vertexMenuCleanup", null);
1382
+ h(this, "activeCakeSession", null);
1383
+ // Move tool UI elements
1384
+ h(this, "moveConfirmationUI", null);
1385
+ h(this, "activeMoveHandler", null);
1386
+ var e;
1387
+ this.options = t, this.container = t.container, this.logger = ((e = t.logger) != null ? e : T("controller", "debug")).child(
1388
+ "map"
1389
+ ), this.L = this.resolveLeaflet(t), this.store = new Ve(this.logger.child("store")), this.logger.debug("ctor", {
1390
+ config: t.map,
1391
+ controls: t.controls,
1392
+ readOnly: t.readOnly,
1393
+ useExternalLeaflet: t.useExternalLeaflet
1394
+ }), Je(this.L), Ze(this.L), Ge(this.L);
1395
+ }
1396
+ resolveLeaflet(t) {
1397
+ if (!t.useExternalLeaflet)
1398
+ return k;
1399
+ if (t.leaflet && V(t.leaflet))
1400
+ return this.logger.debug("leaflet-runtime:external-injected"), t.leaflet;
1401
+ const o = globalThis.L;
1402
+ return o && V(o) ? (this.logger.debug("leaflet-runtime:external-global"), o) : (this.logger.warn("leaflet-runtime:external-fallback-bundled", {
1403
+ message: "External Leaflet requested but Draw APIs were missing; falling back to bundled Leaflet/Draw"
1404
+ }), k);
1405
+ }
1406
+ // ---------------- Lifecycle ----------------
1407
+ async init() {
1408
+ var e, o, a, n, r, i;
1409
+ const t = (o = (e = performance.now) == null ? void 0 : e.call(performance)) != null ? o : Date.now();
1410
+ try {
1411
+ await this.destroy();
1412
+ const {
1413
+ latitude: l,
1414
+ longitude: c,
1415
+ zoom: d,
1416
+ minZoom: p,
1417
+ maxZoom: u,
1418
+ tileUrl: f,
1419
+ tileAttribution: g,
1420
+ preferCanvas: A = !0,
1421
+ // Default to Canvas rendering for better performance
1422
+ useExternalLeaflet: w
1423
+ } = this.options.map, b = [l, c], m = this.L;
1424
+ w && V(m, {
1425
+ onError: (M) => this.logger.warn("external-leaflet-missing-draw", { message: M })
1426
+ }), this.map = m.map(this.container, {
1427
+ zoomControl: !0,
1428
+ preferCanvas: A
1429
+ }).setView(b, d), m.tileLayer(f, {
1430
+ attribution: g,
1431
+ minZoom: p,
1432
+ maxZoom: u
1433
+ }).addTo(this.map), this.drawnItems = m.featureGroup().addTo(this.map);
1434
+ const y = this.buildDrawOptions(
1435
+ this.options.controls,
1436
+ !!this.options.readOnly
1437
+ ), x = m.Control.Draw;
1438
+ this.drawControl = new x(y), this.map.addControl(this.drawControl), this.applyLayerCakeToolbarIcon(), this.applyMoveToolbarIcon(), this.options.controls.ruler && (this.logger.debug("init:ruler", {
1439
+ available: typeof m.control.ruler == "function"
1440
+ }), typeof m.control.ruler == "function" ? (this.addRulerControl(), this.installMeasurementSettingsControl()) : this.logger.warn("init:ruler:missing", {
1441
+ msg: "L.control.ruler is not defined"
1442
+ })), this.patchLeafletDrawBugs(), this.installPolygonFinishPatch(), this.map.invalidateSize(), setTimeout(() => {
1443
+ var M;
1444
+ try {
1445
+ (M = this.map) == null || M.invalidateSize();
1446
+ } catch {
1447
+ }
1448
+ }, 0), this.bindDrawEvents();
1449
+ const L = ((n = (a = performance.now) == null ? void 0 : a.call(performance)) != null ? n : Date.now()) - t;
1450
+ this.logger.debug("init:ready", { elapsedMs: Math.round(L) });
1451
+ const v = this.store.bounds();
1452
+ (i = (r = this.options.callbacks) == null ? void 0 : r.onReady) == null || i.call(r, v ? { bounds: v } : {});
1453
+ } catch (l) {
1454
+ this._error("Failed to initialize Leaflet map", l);
1455
+ }
1456
+ }
1457
+ async destroy() {
1458
+ var t, e, o;
1459
+ try {
1460
+ this.map && (this.map.off(), this.map.remove());
1461
+ } catch (a) {
1462
+ this._error("Failed to remove Leaflet map", a);
1463
+ }
1464
+ try {
1465
+ (t = this.detachPolygonFinishPatch) == null || t.call(this);
1466
+ } catch {
1467
+ }
1468
+ this.detachPolygonFinishPatch = null;
1469
+ try {
1470
+ (e = this.vertexMenuCleanup) == null || e.call(this);
1471
+ } catch {
1472
+ }
1473
+ this.vertexMenuEl = null, this.vertexMenuCleanup = null;
1474
+ try {
1475
+ this.hideMoveConfirmationUI();
1476
+ } catch {
1477
+ }
1478
+ this.drawControl = null, this.rulerControl = null, this.measurementControl = null, this.removeMeasurementModal(), this.drawnItems = null;
1479
+ try {
1480
+ (o = this.activeCakeSession) == null || o.destroy();
1481
+ } catch {
1482
+ }
1483
+ this.activeCakeSession = null, this.map = null;
1484
+ }
1485
+ // ---------------- Public API (data) ----------------
1486
+ async getGeoJSON() {
1487
+ return this.store.toFeatureCollection();
1488
+ }
1489
+ async loadGeoJSON(t, e = !1) {
1490
+ if (!this.map || !this.drawnItems) return;
1491
+ await this.clearLayers();
1492
+ const o = $(t), a = this.store.add(o), n = this.L.geoJSON(o);
1493
+ let r = 0;
1494
+ n.eachLayer((i) => {
1495
+ var l;
1496
+ i._fid = (l = a[r]) != null ? l : a[a.length - 1], this.drawnItems.addLayer(i), this.installVertexContextMenu(i), r++;
1497
+ }), this.logger.debug("loadGeoJSON", {
1498
+ count: o.features.length,
1499
+ ids: a
1500
+ }), e && await this.fitBoundsToData();
1501
+ }
1502
+ async clearLayers() {
1503
+ this.drawnItems && this.drawnItems.clearLayers(), this.store.clear();
1504
+ }
1505
+ async addFeatures(t) {
1506
+ if (!this.map || !this.drawnItems) return [];
1507
+ const e = $(t), o = this.store.add(e), a = this.L.geoJSON(e);
1508
+ let n = 0;
1509
+ return a.eachLayer((r) => {
1510
+ var i;
1511
+ r._fid = (i = o[n]) != null ? i : o[o.length - 1], this.drawnItems.addLayer(r), this.installVertexContextMenu(r), n++;
1512
+ }), o;
1513
+ }
1514
+ async updateFeature(t, e) {
1515
+ this.store.update(t, e);
1516
+ }
1517
+ async removeFeature(t) {
1518
+ this.drawnItems && this.drawnItems.eachLayer((e) => {
1519
+ e._fid === t && this.drawnItems.removeLayer(e);
1520
+ }), this.store.remove(t);
1521
+ }
1522
+ // ---------------- Public API (map) ----------------
1523
+ async fitBoundsToData(t = 0.05) {
1524
+ if (!this.map) return;
1525
+ const e = this.store.bounds();
1526
+ if (!e) return;
1527
+ const o = e, a = this.L.latLngBounds(o);
1528
+ if (t > 0) {
1529
+ const n = a.getSouthWest(), r = a.getNorthEast(), i = (r.lat - n.lat) * t, l = (r.lng - n.lng) * t, c = this.L.latLngBounds(
1530
+ this.L.latLng(n.lat - i, n.lng - l),
1531
+ this.L.latLng(r.lat + i, r.lng + l)
1532
+ );
1533
+ this.map.fitBounds(c);
1534
+ } else
1535
+ this.map.fitBounds(a);
1536
+ }
1537
+ async fitBounds(t, e = 0.05) {
1538
+ if (!this.map) return;
1539
+ const o = this.L.latLngBounds(t);
1540
+ if (e > 0) {
1541
+ const a = o.getSouthWest(), n = o.getNorthEast(), r = (n.lat - a.lat) * e, i = (n.lng - a.lng) * e, l = this.L.latLngBounds(
1542
+ this.L.latLng(a.lat - r, a.lng - i),
1543
+ this.L.latLng(n.lat + r, n.lng + i)
1544
+ );
1545
+ this.map.fitBounds(l);
1546
+ } else
1547
+ this.map.fitBounds(o);
1548
+ }
1549
+ async setView(t, e, o) {
1550
+ this.map && this.map.setView([t, e], o != null ? o : this.map.getZoom());
1551
+ }
1552
+ /**
1553
+ * Merge all visible polygon features into a single polygon feature.
1554
+ * This removes the original features and adds a new feature with the merged geometry.
1555
+ *
1556
+ * @param options Optional configuration for the merge operation
1557
+ * @returns The ID of the newly created merged feature, or null if no polygons to merge
1558
+ */
1559
+ async mergeVisiblePolygons(t) {
1560
+ if (!this.map || !this.drawnItems) return null;
1561
+ const o = (await this.getGeoJSON()).features.filter((i) => {
1562
+ const l = i.geometry;
1563
+ return l && (se(l) || le(l));
1564
+ });
1565
+ if (o.length <= 1) {
1566
+ if (o.length === 1) {
1567
+ const i = o[0].id;
1568
+ return i ? String(i) : null;
1569
+ }
1570
+ return null;
1571
+ }
1572
+ const a = He(o, t == null ? void 0 : t.properties);
1573
+ if (!a) return null;
1574
+ const n = [];
1575
+ for (const i of o) {
1576
+ const l = i.id;
1577
+ l && n.push(String(l));
1578
+ }
1579
+ for (const i of n)
1580
+ await this.removeFeature(i);
1581
+ const [r] = await this.addFeatures({
1582
+ type: "FeatureCollection",
1583
+ features: [a]
1584
+ });
1585
+ return r || null;
1586
+ }
1587
+ setRulerUnits(t) {
1588
+ this.measurementSystem !== t && (this.measurementSystem = t, this.logger.debug("ruler:units", { system: t }), this.syncMeasurementModalState(), this.rebuildRulerControl());
1589
+ }
1590
+ // ---------------- Internals ----------------
1591
+ buildDrawOptions(t, e) {
1592
+ var n;
1593
+ const o = {
1594
+ polygon: t.polygon ? {
1595
+ allowIntersection: (n = this.options.map.polygonAllowIntersection) != null ? n : !1,
1596
+ // Disallow self-intersections by default
1597
+ showArea: !0,
1598
+ // Display area tooltip while drawing
1599
+ shapeOptions: {
1600
+ color: "#3388ff"
1601
+ // Default shape color
1602
+ }
1603
+ } : !1,
1604
+ polyline: t.polyline ? {
1605
+ shapeOptions: {
1606
+ color: "#3388ff"
1607
+ }
1608
+ } : !1,
1609
+ rectangle: t.rectangle ? {
1610
+ shapeOptions: {
1611
+ color: "#3388ff"
1612
+ }
1613
+ } : !1,
1614
+ circle: t.circle ? {
1615
+ shapeOptions: {
1616
+ color: "#3388ff"
1617
+ }
1618
+ } : !1,
1619
+ cake: t.cake ? {
1620
+ shapeOptions: {
1621
+ color: "#8A2BE2",
1622
+ // Violet color for distinction
1623
+ fillOpacity: 0.2
1624
+ }
1625
+ } : !1,
1626
+ marker: t.marker ? {} : !1,
1627
+ move: t.move ? {
1628
+ featureGroup: this.drawnItems
1629
+ } : !1
1630
+ };
1631
+ let a = {
1632
+ featureGroup: this.drawnItems
1633
+ };
1634
+ return t.edit ? t.delete === !1 && (a.remove = !1) : a = !1, e ? {
1635
+ draw: !1,
1636
+ edit: !1
1637
+ } : { draw: o, edit: a };
1638
+ }
1639
+ applyLayerCakeToolbarIcon() {
1640
+ if (!this.container) return;
1641
+ const t = () => {
1642
+ const e = this.container.querySelector(
1643
+ "a.leaflet-draw-draw-cake"
1644
+ );
1645
+ if (!e) return;
1646
+ e.style.setProperty("background-image", "none", "important"), e.style.setProperty("background-color", "#fff", "important"), e.style.setProperty("position", "relative", "important");
1647
+ let o = e.querySelector(
1648
+ ".leaflet-geokit-cake-icon"
1649
+ );
1650
+ o || (o = document.createElement("span"), o.className = "leaflet-geokit-cake-icon", o.setAttribute("aria-hidden", "true"), e.appendChild(o)), o.style.setProperty("position", "absolute", "important"), o.style.setProperty("display", "block", "important"), o.style.setProperty("left", "50%", "important"), o.style.setProperty("top", "50%", "important"), o.style.setProperty("width", "18px", "important"), o.style.setProperty("height", "18px", "important"), o.style.setProperty("transform", "translate(-50%, -50%)", "important"), o.style.setProperty("pointer-events", "none", "important"), o.firstElementChild || (o.innerHTML = tt);
1651
+ const a = o.firstElementChild;
1652
+ a && (a.style.setProperty("width", "100%", "important"), a.style.setProperty("height", "100%", "important"), a.style.setProperty("display", "block", "important"));
1653
+ };
1654
+ t(), setTimeout(t, 0);
1655
+ }
1656
+ applyMoveToolbarIcon() {
1657
+ if (!this.container) return;
1658
+ const t = () => {
1659
+ const e = this.container.querySelector(
1660
+ "a.leaflet-draw-draw-move"
1661
+ );
1662
+ if (!e) return;
1663
+ e.style.setProperty("background-image", "none", "important"), e.style.setProperty("background-color", "#fff", "important"), e.style.setProperty("position", "relative", "important");
1664
+ let o = e.querySelector(
1665
+ ".leaflet-geokit-move-icon"
1666
+ );
1667
+ o || (o = document.createElement("span"), o.className = "leaflet-geokit-move-icon", o.setAttribute("aria-hidden", "true"), e.appendChild(o)), o.style.setProperty("position", "absolute", "important"), o.style.setProperty("display", "block", "important"), o.style.setProperty("left", "50%", "important"), o.style.setProperty("top", "50%", "important"), o.style.setProperty("width", "18px", "important"), o.style.setProperty("height", "18px", "important"), o.style.setProperty("transform", "translate(-50%, -50%)", "important"), o.style.setProperty("pointer-events", "none", "important"), o.firstElementChild || (o.innerHTML = ot);
1668
+ const a = o.firstElementChild;
1669
+ a && (a.style.setProperty("width", "100%", "important"), a.style.setProperty("height", "100%", "important"), a.style.setProperty("display", "block", "important"));
1670
+ };
1671
+ t(), setTimeout(t, 0);
1672
+ }
1673
+ /* c8 ignore start */
1674
+ addRulerControl() {
1675
+ if (!this.map) return;
1676
+ this.installRulerPrecisionPatch();
1677
+ const t = pt(this.measurementSystem);
1678
+ this.rulerControl = this.L.control.ruler(t), this.map.addControl(this.rulerControl);
1679
+ }
1680
+ installRulerPrecisionPatch() {
1681
+ if (ae) return;
1682
+ const t = this.L.Control.Ruler;
1683
+ if (!t || typeof t != "function") return;
1684
+ const e = t.prototype, o = e._calculateBearingAndDistance;
1685
+ if (typeof o != "function") return;
1686
+ const a = this.logger;
1687
+ e._calculateBearingAndDistance = function() {
1688
+ var r, i, l;
1689
+ o.call(this);
1690
+ try {
1691
+ const c = this._clickedLatLong, d = (r = this._movingLatLong) != null ? r : this._clickedLatLong;
1692
+ if (!c || !d) return;
1693
+ const { meters: p, bearingDegrees: u } = it(
1694
+ c.lat,
1695
+ c.lng,
1696
+ d.lat,
1697
+ d.lng
1698
+ ), f = p / 1e3, g = typeof ((l = (i = this.options) == null ? void 0 : i.lengthUnit) == null ? void 0 : l.factor) == "number" ? this.options.lengthUnit.factor : 1, A = j(f * g);
1699
+ this._result = this._result || {}, this._result.Distance = A, this._result.Bearing = u, this._result.meters = p;
1700
+ } catch (c) {
1701
+ a == null || a.warn("ruler:precision-patch", c);
1702
+ }
1703
+ }, ae = !0;
1704
+ }
1705
+ rebuildRulerControl() {
1706
+ if (!(!this.map || !this.options.controls.ruler)) {
1707
+ if (this.rulerControl) {
1708
+ try {
1709
+ this.map.removeControl(this.rulerControl);
1710
+ } catch (t) {
1711
+ this.logger.warn("ruler:remove-failed", t);
1712
+ }
1713
+ this.rulerControl = null;
1714
+ }
1715
+ this.addRulerControl();
1716
+ }
1717
+ }
1718
+ /* c8 ignore next */
1719
+ installMeasurementSettingsControl() {
1720
+ if (!this.map || this.measurementControl) return;
1721
+ const t = this, e = this.L.Control.extend({
1722
+ options: { position: "topleft" },
1723
+ onAdd() {
1724
+ const o = t.L.DomUtil.create(
1725
+ "div",
1726
+ "leaflet-bar leaflet-ruler-settings-control"
1727
+ ), a = t.L.DomUtil.create(
1728
+ "button",
1729
+ "leaflet-ruler-settings-button",
1730
+ o
1731
+ );
1732
+ return a.type = "button", a.title = "Measurement settings", a.setAttribute("aria-label", "Measurement settings"), a.addEventListener("click", (n) => {
1733
+ n.preventDefault(), n.stopPropagation(), t.toggleMeasurementModal(!0);
1734
+ }), t.L.DomEvent.disableClickPropagation(o), t.L.DomEvent.disableScrollPropagation(o), o;
1735
+ }
1736
+ });
1737
+ this.measurementControl = new e(), this.map.addControl(this.measurementControl);
1738
+ }
1739
+ /* c8 ignore next */
1740
+ ensureMeasurementModal() {
1741
+ if (this.measurementModalOverlay) return this.measurementModalOverlay;
1742
+ if (typeof document == "undefined")
1743
+ throw new Error("Measurement modal requires a browser environment");
1744
+ const t = document.createElement("div");
1745
+ t.className = "leaflet-ruler-modal-overlay", t.setAttribute("aria-hidden", "true");
1746
+ const e = document.createElement("div");
1747
+ e.className = "leaflet-ruler-modal", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.tabIndex = -1, t.addEventListener("click", (l) => {
1748
+ l.target === t && this.toggleMeasurementModal(!1);
1749
+ });
1750
+ const o = document.createElement("h2");
1751
+ o.className = "leaflet-ruler-modal-title", o.textContent = "Measurement Units", e.appendChild(o);
1752
+ const a = document.createElement("p");
1753
+ a.className = "leaflet-ruler-modal-description", a.textContent = "Choose how the measurement tool reports distances.", e.appendChild(a);
1754
+ const n = document.createElement("div");
1755
+ n.className = "leaflet-ruler-modal-options", e.appendChild(n), ["metric", "imperial"].forEach((l) => {
1756
+ const c = document.createElement("label");
1757
+ c.className = "leaflet-ruler-modal-option";
1758
+ const d = document.createElement("input");
1759
+ d.type = "radio", d.name = "leaflet-ruler-units", d.value = l, d.addEventListener("change", () => {
1760
+ d.checked && this.setRulerUnits(l);
1761
+ });
1762
+ const p = document.createElement("span");
1763
+ p.textContent = ut[l], c.appendChild(d), c.appendChild(p), n.appendChild(c), this.measurementModalRadios[l] = d;
1764
+ });
1765
+ const r = document.createElement("div");
1766
+ r.className = "leaflet-ruler-modal-actions";
1767
+ const i = document.createElement("button");
1768
+ return i.type = "button", i.className = "leaflet-ruler-modal-close", i.textContent = "Close", i.addEventListener("click", () => this.toggleMeasurementModal(!1)), r.appendChild(i), e.appendChild(r), t.appendChild(e), this.container.appendChild(t), this.measurementModalOverlay = t, this.measurementModalDialog = e, this.syncMeasurementModalState(), t;
1769
+ }
1770
+ /* c8 ignore next */
1771
+ toggleMeasurementModal(t) {
1772
+ var o;
1773
+ if (!t) {
1774
+ this.measurementModalOverlay && (this.measurementModalOverlay.classList.remove("is-open"), this.measurementModalOverlay.setAttribute("aria-hidden", "true")), this.detachMeasurementModalKeydown();
1775
+ return;
1776
+ }
1777
+ const e = this.ensureMeasurementModal();
1778
+ e.classList.add("is-open"), e.setAttribute("aria-hidden", "false"), this.syncMeasurementModalState(), this.attachMeasurementModalKeydown(), (o = this.measurementModalDialog) == null || o.focus();
1779
+ }
1780
+ syncMeasurementModalState() {
1781
+ for (const [t, e] of Object.entries(this.measurementModalRadios))
1782
+ e && (e.checked = t === this.measurementSystem);
1783
+ }
1784
+ /* c8 ignore next */
1785
+ removeMeasurementModal() {
1786
+ this.measurementModalOverlay && this.measurementModalOverlay.remove(), this.measurementModalOverlay = null, this.measurementModalDialog = null, this.measurementModalRadios = {}, this.detachMeasurementModalKeydown();
1787
+ }
1788
+ /* c8 ignore next */
1789
+ attachMeasurementModalKeydown() {
1790
+ this.measurementModalKeydownHandler || typeof document == "undefined" || (this.measurementModalKeydownHandler = (t) => {
1791
+ t.key === "Escape" && this.toggleMeasurementModal(!1);
1792
+ }, document.addEventListener("keydown", this.measurementModalKeydownHandler));
1793
+ }
1794
+ /* c8 ignore next */
1795
+ detachMeasurementModalKeydown() {
1796
+ !this.measurementModalKeydownHandler || typeof document == "undefined" || (document.removeEventListener(
1797
+ "keydown",
1798
+ this.measurementModalKeydownHandler
1799
+ ), this.measurementModalKeydownHandler = null);
1800
+ }
1801
+ /* c8 ignore end */
1802
+ /**
1803
+ * Workaround: In some environments (notably within Shadow DOM), clicking the first vertex
1804
+ * to close a polygon can be unreliable due to event retargeting/hit testing.
1805
+ * This patch listens for map clicks while the polygon draw handler is enabled and,
1806
+ * if the click is within a small pixel radius of the first vertex, it triggers finishShape().
1807
+ */
1808
+ installPolygonFinishPatch() {
1809
+ var r, i, l, c, d;
1810
+ if (!this.map || !this.drawControl) return;
1811
+ try {
1812
+ (r = this.detachPolygonFinishPatch) == null || r.call(this);
1813
+ } catch {
1814
+ }
1815
+ this.detachPolygonFinishPatch = null;
1816
+ const t = this.map, e = (l = (i = this.drawControl) == null ? void 0 : i._toolbars) == null ? void 0 : l.draw;
1817
+ if (!e || !!!((d = (c = e._modes) == null ? void 0 : c.polygon) != null && d.handler)) return;
1818
+ const a = 10, n = (p) => {
1819
+ var u, f, g, A, w, b, m, y;
1820
+ try {
1821
+ const x = (f = (u = e._modes) == null ? void 0 : u.polygon) == null ? void 0 : f.handler;
1822
+ if (!x || !x._enabled) return;
1823
+ const L = x._markers;
1824
+ if (!Array.isArray(L) || L.length < 4) return;
1825
+ const v = (A = (g = L[0]) == null ? void 0 : g.getLatLng) == null ? void 0 : A.call(g);
1826
+ if (!v) return;
1827
+ const M = t.latLngToContainerPoint(v), I = t.latLngToContainerPoint(p.latlng);
1828
+ Math.hypot(M.x - I.x, M.y - I.y) <= a && typeof x._finishShape == "function" && ((b = (w = p.originalEvent) == null ? void 0 : w.preventDefault) == null || b.call(w), (y = (m = p.originalEvent) == null ? void 0 : m.stopPropagation) == null || y.call(m), x._finishShape());
1829
+ } catch (x) {
1830
+ this._error("polygon-finish-patch", x);
1831
+ }
1832
+ };
1833
+ t.on("click", n), this.detachPolygonFinishPatch = () => {
1834
+ try {
1835
+ t.off("click", n);
1836
+ } catch {
1837
+ }
1838
+ };
1839
+ }
1840
+ patchLeafletDrawBugs() {
1841
+ var t, e, o, a, n;
1842
+ try {
1843
+ const r = this.L, i = r.GeometryUtil;
1844
+ if (!i) return;
1845
+ const l = {
1846
+ km: 2,
1847
+ ha: 2,
1848
+ m: 0,
1849
+ mi: 2,
1850
+ ac: 2,
1851
+ yd: 0,
1852
+ ft: 0,
1853
+ nm: 2
1854
+ }, c = (e = (t = i.formattedNumber) == null ? void 0 : t.bind(i)) != null ? e : ((d, p) => Number(d).toFixed(p));
1855
+ i.readableArea = (d, p, u) => {
1856
+ var A;
1857
+ const f = (A = r.Util) != null && A.extend ? r.Util.extend({}, l, u || {}) : { ...l, ...u || {} };
1858
+ let g;
1859
+ if (p) {
1860
+ let w = ["ha", "m"];
1861
+ const b = typeof p;
1862
+ b === "string" ? w = [p] : b !== "boolean" && (w = Array.isArray(p) ? p : w), d >= 1e6 && w.indexOf("km") !== -1 ? g = `${c(1e-6 * d, f.km)} km²` : d >= 1e4 && w.indexOf("ha") !== -1 ? g = `${c(1e-4 * d, f.ha)} ha` : g = `${c(d, f.m)} m²`;
1863
+ } else
1864
+ d = d / 0.836127, d >= 3097600 ? g = `${c(d / 3097600, f.mi)} mi²` : d >= 4840 ? g = `${c(d / 4840, f.ac)} acres` : g = `${c(d, f.yd)} yd²`;
1865
+ return g;
1866
+ };
1867
+ } catch (r) {
1868
+ this.logger.warn("leaflet-draw-patch:readableArea", r);
1869
+ }
1870
+ try {
1871
+ const r = this.L, i = (o = r.Edit) == null ? void 0 : o.Circle, l = (a = r.Draw) == null ? void 0 : a.Event, c = r.GeometryUtil;
1872
+ if (!((n = i == null ? void 0 : i.prototype) != null && n._resize) || !l || !c) return;
1873
+ i.prototype._resize = function(p) {
1874
+ var g, A, w;
1875
+ const u = this._moveMarker.getLatLng(), f = c.isVersion07x() ? u.distanceTo(p) : this._map.distance(u, p);
1876
+ this._shape.setRadius(f);
1877
+ try {
1878
+ (g = this._map) != null && g.editTooltip && ((w = (A = this._map) == null ? void 0 : A._editTooltip) != null && w.updateContent) && this._map._editTooltip.updateContent({
1879
+ text: r.drawLocal.edit.handlers.edit.tooltip.subtext + "<br />" + r.drawLocal.edit.handlers.edit.tooltip.text,
1880
+ subtext: r.drawLocal.draw.handlers.circle.radius + ": " + c.readableDistance(
1881
+ f,
1882
+ !0,
1883
+ this.options.feet,
1884
+ this.options.nautic
1885
+ )
1886
+ });
1887
+ } catch {
1888
+ }
1889
+ this._map.fire(l.EDITRESIZE, { layer: this._shape });
1890
+ };
1891
+ } catch (r) {
1892
+ this.logger.warn("leaflet-draw-patch:circle-resize", r);
1893
+ }
1894
+ }
1895
+ bindDrawEvents() {
1896
+ !this.map || !this.drawnItems || (this.map.on(this.L.Draw.Event.CREATED, (t) => {
1897
+ var e, o, a;
1898
+ try {
1899
+ const { layer: n, layerType: r } = t;
1900
+ if (r === D.TYPE) {
1901
+ try {
1902
+ (e = this.activeCakeSession) == null || e.destroy();
1903
+ } catch {
1904
+ }
1905
+ this.activeCakeSession = new et(
1906
+ this.map,
1907
+ n,
1908
+ (d) => {
1909
+ if (!this.drawnItems) return;
1910
+ const p = this.store.add(d), u = this.L.geoJSON(d);
1911
+ let f = 0;
1912
+ u.eachLayer((g) => {
1913
+ var w, b, m;
1914
+ const A = (w = p[f]) != null ? w : p[p.length - 1];
1915
+ g._fid = A, this.drawnItems.addLayer(g), this.installVertexContextMenu(g), (m = (b = this.options.callbacks) == null ? void 0 : b.onCreated) == null || m.call(b, {
1916
+ id: A,
1917
+ layerType: "polygon",
1918
+ geoJSON: g.toGeoJSON()
1919
+ }), f++;
1920
+ }), this.activeCakeSession = null;
1921
+ },
1922
+ this.measurementSystem
1923
+ );
1924
+ return;
1925
+ }
1926
+ this.drawnItems.addLayer(n);
1927
+ const i = n.toGeoJSON(), c = this.store.add({
1928
+ type: "FeatureCollection",
1929
+ features: [i]
1930
+ })[0];
1931
+ n._fid = c, this.installVertexContextMenu(n), (a = (o = this.options.callbacks) == null ? void 0 : o.onCreated) == null || a.call(o, { id: c, layerType: r, geoJSON: i });
1932
+ } catch (n) {
1933
+ this._error("onCreated handler failed", n);
1934
+ }
1935
+ }), this.map.on(this.L.Draw.Event.EDITED, (t) => {
1936
+ var e, o;
1937
+ try {
1938
+ const a = [];
1939
+ t.layers.eachLayer((r) => {
1940
+ const i = r.toGeoJSON(), l = r._fid;
1941
+ if (l)
1942
+ this.store.update(l, i), a.push(l);
1943
+ else {
1944
+ const c = this.store.add({
1945
+ type: "FeatureCollection",
1946
+ features: [i]
1947
+ })[0];
1948
+ r._fid = c, a.push(c);
1949
+ }
1950
+ }), (o = (e = this.options.callbacks) == null ? void 0 : e.onEdited) == null || o.call(e, {
1951
+ ids: a,
1952
+ geoJSON: this.store.toFeatureCollection()
1953
+ });
1954
+ } catch (a) {
1955
+ this._error("onEdited handler failed", a);
1956
+ }
1957
+ }), this.map.on(this.L.Draw.Event.DELETED, (t) => {
1958
+ var e, o;
1959
+ try {
1960
+ const a = [];
1961
+ t.layers.eachLayer((r) => {
1962
+ const i = r._fid;
1963
+ i && (a.push(i), this.store.remove(i));
1964
+ }), (o = (e = this.options.callbacks) == null ? void 0 : e.onDeleted) == null || o.call(e, {
1965
+ ids: a,
1966
+ geoJSON: this.store.toFeatureCollection()
1967
+ });
1968
+ } catch (a) {
1969
+ this._error("onDeleted handler failed", a);
1970
+ }
1971
+ }), this.map.on("draw:moveend", (t) => {
1972
+ try {
1973
+ this.showMoveConfirmationUI(t.layer, t.originalGeoJSON, t.newGeoJSON);
1974
+ } catch (e) {
1975
+ this._error("draw:moveend handler failed", e);
1976
+ }
1977
+ }), this.map.on("draw:moveconfirmed", (t) => {
1978
+ var e, o;
1979
+ try {
1980
+ const a = t.layer, n = a._fid;
1981
+ if (n) {
1982
+ const r = a.toGeoJSON();
1983
+ this.store.update(n, r), (o = (e = this.options.callbacks) == null ? void 0 : e.onEdited) == null || o.call(e, {
1984
+ ids: [n],
1985
+ geoJSON: this.store.toFeatureCollection()
1986
+ });
1987
+ }
1988
+ this.hideMoveConfirmationUI();
1989
+ } catch (a) {
1990
+ this._error("draw:moveconfirmed handler failed", a);
1991
+ }
1992
+ }));
1993
+ }
1994
+ _error(t, e) {
1995
+ var o, a;
1996
+ this.logger.error("error", { message: t, cause: e }), (a = (o = this.options.callbacks) == null ? void 0 : o.onError) == null || a.call(o, { message: t, cause: e });
1997
+ }
1998
+ // -------- Vertex deletion context menu --------
1999
+ installVertexContextMenu(t) {
2000
+ if (!t || typeof t.on != "function") return;
2001
+ const e = (a) => {
2002
+ var n, r, i, l;
2003
+ try {
2004
+ (r = (n = a == null ? void 0 : a.originalEvent) == null ? void 0 : n.preventDefault) == null || r.call(n), (l = (i = a == null ? void 0 : a.originalEvent) == null ? void 0 : i.stopPropagation) == null || l.call(i);
2005
+ } catch {
2006
+ }
2007
+ this.openVertexMenu(t, a);
2008
+ }, o = (a) => {
2009
+ const n = a == null ? void 0 : a.originalEvent;
2010
+ n && (n.ctrlKey || n.metaKey) && this.openVertexMenu(t, a);
2011
+ };
2012
+ try {
2013
+ t.on("contextmenu", e), t.on("click", o);
2014
+ } catch {
2015
+ }
2016
+ }
2017
+ openVertexMenu(t, e) {
2018
+ try {
2019
+ if (!this.map || !(typeof t.getLatLngs == "function" && (t instanceof this.L.Polygon || t instanceof this.L.Polyline))) return;
2020
+ const a = t.editing;
2021
+ if (!a || typeof a.enabled != "function" || !a.enabled())
2022
+ return;
2023
+ const n = e == null ? void 0 : e.latlng, r = this.map.latLngToContainerPoint(n), i = this.findNearestVertex(t, n, 12);
2024
+ if (!i) return;
2025
+ this.showVertexMenu(r, async () => {
2026
+ await this.deleteVertex(t, i.pathIndex, i.vertexIndex);
2027
+ });
2028
+ } catch (o) {
2029
+ this._error("openVertexMenu", o);
2030
+ }
2031
+ }
2032
+ showVertexMenu(t, e) {
2033
+ var o;
2034
+ try {
2035
+ try {
2036
+ (o = this.vertexMenuCleanup) == null || o.call(this);
2037
+ } catch {
2038
+ }
2039
+ if (this.vertexMenuCleanup = null, !this.container) return;
2040
+ const a = document.createElement("div");
2041
+ a.style.position = "absolute", a.style.top = `${t.y}px`, a.style.left = `${t.x}px`, a.style.transform = "translate(-50%, -100%)", a.style.background = "#fff", a.style.border = "1px solid rgba(0,0,0,0.15)", a.style.borderRadius = "6px", a.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)", a.style.padding = "6px", a.style.zIndex = "10000", a.style.fontSize = "12px", a.style.userSelect = "none";
2042
+ const n = document.createElement("button");
2043
+ n.textContent = "Delete vertex", n.style.padding = "6px 10px", n.style.border = "none", n.style.background = "#da1e28", n.style.color = "#fff", n.style.borderRadius = "4px", n.style.cursor = "pointer", n.addEventListener("click", (l) => {
2044
+ l.stopPropagation(), l.preventDefault();
2045
+ try {
2046
+ e();
2047
+ } finally {
2048
+ r();
2049
+ }
2050
+ }), a.appendChild(n);
2051
+ const r = () => {
2052
+ try {
2053
+ window.removeEventListener("pointerdown", i), this.container.removeEventListener("scroll", r, !0), a.remove();
2054
+ } catch {
2055
+ }
2056
+ this.vertexMenuEl = null, this.vertexMenuCleanup = null;
2057
+ }, i = (l) => {
2058
+ a.contains(l.target) || r();
2059
+ };
2060
+ window.addEventListener("pointerdown", i, { capture: !0 }), this.container.addEventListener("scroll", r, !0), this.container.appendChild(a), this.vertexMenuEl = a, this.vertexMenuCleanup = r;
2061
+ } catch (a) {
2062
+ this._error("showVertexMenu", a);
2063
+ }
2064
+ }
2065
+ findNearestVertex(t, e, o) {
2066
+ if (!this.map) return null;
2067
+ const a = (u) => this.map.latLngToContainerPoint(u), n = (u, f) => Math.hypot(u.x - f.x, u.y - f.y), r = a(e);
2068
+ let i = 1 / 0, l = -1, c = -1;
2069
+ const d = t.getLatLngs();
2070
+ return (Array.isArray(d[0]) ? d : [d]).forEach((u, f) => {
2071
+ u.forEach((g, A) => {
2072
+ const w = a(g), b = n(w, r);
2073
+ b < i && (i = b, l = f, c = A);
2074
+ });
2075
+ }), l === -1 || i > o ? null : { pathIndex: l, vertexIndex: c };
2076
+ }
2077
+ async deleteVertex(t, e, o) {
2078
+ var a, n, r;
2079
+ try {
2080
+ if (!(typeof t.getLatLngs == "function" && (t instanceof this.L.Polygon || t instanceof this.L.Polyline))) return;
2081
+ const l = t.getLatLngs(), c = Array.isArray(l[0]) ? l : [l], d = c[e];
2082
+ if (!d) return;
2083
+ const u = t instanceof this.L.Polygon ? 3 : 2;
2084
+ if (d.length <= u) return;
2085
+ if (d.splice(o, 1), c.length === 1)
2086
+ t.setLatLngs(d);
2087
+ else {
2088
+ const g = c.map((A, w) => w === e ? d : A);
2089
+ t.setLatLngs(g);
2090
+ }
2091
+ (a = t.redraw) == null || a.call(t);
2092
+ const f = t._fid;
2093
+ if (f) {
2094
+ const g = t.toGeoJSON();
2095
+ this.store.update(f, g), (r = (n = this.options.callbacks) == null ? void 0 : n.onEdited) == null || r.call(n, {
2096
+ ids: [f],
2097
+ geoJSON: this.store.toFeatureCollection()
2098
+ });
2099
+ }
2100
+ } catch (i) {
2101
+ this._error("deleteVertex", i);
2102
+ }
2103
+ }
2104
+ // -------- Move tool Save/Cancel UI --------
2105
+ showMoveConfirmationUI(t, e, o) {
2106
+ var a, n;
2107
+ try {
2108
+ if (this.hideMoveConfirmationUI(), !this.container || !this.map) return;
2109
+ const r = this.drawControl;
2110
+ if (!r) return;
2111
+ const i = (a = r == null ? void 0 : r._toolbars) == null ? void 0 : a.draw;
2112
+ if (!i) return;
2113
+ const l = i._modes || {};
2114
+ let c = null;
2115
+ for (const f in l) {
2116
+ const g = l[f];
2117
+ if (((n = g == null ? void 0 : g.handler) == null ? void 0 : n.type) === "move") {
2118
+ c = g.handler;
2119
+ break;
2120
+ }
2121
+ }
2122
+ this.activeMoveHandler = c;
2123
+ const d = document.createElement("div");
2124
+ d.style.position = "absolute", d.style.bottom = "60px", d.style.left = "50%", d.style.transform = "translateX(-50%)", d.style.display = "flex", d.style.gap = "8px", d.style.background = "#fff", d.style.border = "2px solid #3388ff", d.style.borderRadius = "8px", d.style.padding = "12px 16px", d.style.boxShadow = "0 4px 12px rgba(0,0,0,0.2)", d.style.zIndex = "10000", d.style.fontSize = "14px", d.style.fontFamily = "system-ui, sans-serif";
2125
+ const p = document.createElement("button");
2126
+ p.textContent = "✓ Save", p.style.padding = "8px 16px", p.style.border = "none", p.style.background = "#28a745", p.style.color = "#fff", p.style.borderRadius = "4px", p.style.cursor = "pointer", p.style.fontWeight = "600", p.style.fontSize = "14px", p.addEventListener("click", (f) => {
2127
+ f.stopPropagation(), f.preventDefault(), c != null && c.confirmMove && c.confirmMove();
2128
+ });
2129
+ const u = document.createElement("button");
2130
+ u.textContent = "✕ Cancel", u.style.padding = "8px 16px", u.style.border = "1px solid #ccc", u.style.background = "#fff", u.style.color = "#333", u.style.borderRadius = "4px", u.style.cursor = "pointer", u.style.fontWeight = "600", u.style.fontSize = "14px", u.addEventListener("click", (f) => {
2131
+ f.stopPropagation(), f.preventDefault(), c != null && c.cancelMove && c.cancelMove(), this.hideMoveConfirmationUI();
2132
+ }), d.appendChild(p), d.appendChild(u), this.container.appendChild(d), this.moveConfirmationUI = d, this.logger.debug("showMoveConfirmationUI", {
2133
+ layerId: t._fid
2134
+ });
2135
+ } catch (r) {
2136
+ this._error("showMoveConfirmationUI", r);
2137
+ }
2138
+ }
2139
+ hideMoveConfirmationUI() {
2140
+ try {
2141
+ this.moveConfirmationUI && (this.moveConfirmationUI.remove(), this.moveConfirmationUI = null), this.activeMoveHandler = null;
2142
+ } catch (t) {
2143
+ this._error("hideMoveConfirmationUI", t);
2144
+ }
2145
+ }
2146
+ }
2147
+ class de extends HTMLElement {
2148
+ constructor() {
2149
+ super();
2150
+ // Shadow DOM and container references
2151
+ h(this, "_root");
2152
+ h(this, "_container");
2153
+ // Logging
2154
+ h(this, "_logger", T("component:leaflet-geokit", "debug"));
2155
+ // Internal state mirrors for attributes/properties
2156
+ h(this, "_latitude", 0);
2157
+ h(this, "_longitude", 0);
2158
+ h(this, "_zoom", 2);
2159
+ h(this, "_minZoom");
2160
+ h(this, "_maxZoom");
2161
+ h(this, "_tileUrl", "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png");
2162
+ h(this, "_tileAttribution");
2163
+ h(this, "_readOnly", !1);
2164
+ h(this, "_logLevel", "debug");
2165
+ h(this, "_devOverlay", !1);
2166
+ h(this, "_polygonAllowIntersection", !1);
2167
+ h(this, "_preferCanvas", !0);
2168
+ // Default to Canvas for performance
2169
+ // Theming
2170
+ h(this, "_themeUrl");
2171
+ h(this, "_themeCss", "");
2172
+ h(this, "_themeLinkEl", null);
2173
+ h(this, "_themeStyleEl", null);
2174
+ // Controller
2175
+ h(this, "_controller", null);
2176
+ // External Leaflet configuration
2177
+ h(this, "_useExternalLeaflet", !1);
2178
+ h(this, "_skipLeafletStyles", !1);
2179
+ h(this, "_leafletInstance");
2180
+ this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = `
2181
+ <style>
2182
+ :host {
2183
+ display: block;
2184
+ contain: content;
2185
+ }
2186
+ .map-container {
2187
+ width: 100%;
2188
+ height: 100%;
2189
+ position: relative;
2190
+ }
2191
+ </style>
2192
+ <div class="map-container" part="map"></div>
2193
+ `;
2194
+ const e = this._root.querySelector(".map-container");
2195
+ if (!(e instanceof HTMLDivElement))
2196
+ throw new Error("Failed to initialize map container");
2197
+ this._container = e;
2198
+ const o = this.getAttribute("log-level");
2199
+ o && (this._logLevel = o, this._logger.setLevel(o));
2200
+ }
2201
+ // Build DrawControlsConfig from boolean attributes
2202
+ _controlsFromAttributes() {
2203
+ return {
2204
+ polygon: this.hasAttribute("draw-polygon"),
2205
+ polyline: this.hasAttribute("draw-polyline"),
2206
+ rectangle: this.hasAttribute("draw-rectangle"),
2207
+ circle: this.hasAttribute("draw-circle"),
2208
+ cake: this.hasAttribute("draw-layer-cake"),
2209
+ marker: this.hasAttribute("draw-marker"),
2210
+ move: this.hasAttribute("draw-move"),
2211
+ edit: this.hasAttribute("edit-features"),
2212
+ delete: this.hasAttribute("delete-features"),
2213
+ ruler: this.hasAttribute("draw-ruler")
2214
+ };
2215
+ }
2216
+ _mapConfig() {
2217
+ return {
2218
+ latitude: this._latitude,
2219
+ longitude: this._longitude,
2220
+ zoom: this._zoom,
2221
+ minZoom: this._minZoom,
2222
+ maxZoom: this._maxZoom,
2223
+ tileUrl: this._tileUrl,
2224
+ tileAttribution: this._tileAttribution,
2225
+ readOnly: this._readOnly,
2226
+ fitToDataOnLoad: !1,
2227
+ logLevel: this._logLevel,
2228
+ devOverlay: this._devOverlay,
2229
+ polygonAllowIntersection: this._polygonAllowIntersection,
2230
+ preferCanvas: this._preferCanvas,
2231
+ useExternalLeaflet: this._useExternalLeaflet,
2232
+ skipLeafletStyles: this._skipLeafletStyles
2233
+ };
2234
+ }
2235
+ // Lifecycle
2236
+ async connectedCallback() {
2237
+ var e;
2238
+ this._logger.debug("connectedCallback", this._currentConfig()), Se({
2239
+ root: this._root,
2240
+ skipStyles: this._skipLeafletStyles
2241
+ }), this._applyThemeStyles(), this._controller = new ft({
2242
+ container: this._container,
2243
+ map: this._mapConfig(),
2244
+ controls: this._controlsFromAttributes(),
2245
+ readOnly: this._readOnly,
2246
+ logger: this._logger.child("controller"),
2247
+ callbacks: {
2248
+ onReady: (o) => {
2249
+ this.dispatchEvent(new CustomEvent("leaflet-draw:ready", { detail: o }));
2250
+ },
2251
+ onCreated: (o) => {
2252
+ this.dispatchEvent(
2253
+ new CustomEvent("leaflet-draw:created", { detail: o })
2254
+ );
2255
+ },
2256
+ onEdited: (o) => {
2257
+ this.dispatchEvent(
2258
+ new CustomEvent("leaflet-draw:edited", { detail: o })
2259
+ );
2260
+ },
2261
+ onDeleted: (o) => {
2262
+ this.dispatchEvent(
2263
+ new CustomEvent("leaflet-draw:deleted", { detail: o })
2264
+ );
2265
+ },
2266
+ onError: (o) => {
2267
+ this.dispatchEvent(new CustomEvent("leaflet-draw:error", { detail: o }));
2268
+ }
2269
+ },
2270
+ leaflet: (e = this._leafletInstance) != null ? e : void 0,
2271
+ useExternalLeaflet: this._useExternalLeaflet
2272
+ }), await this._controller.init();
2273
+ }
2274
+ async disconnectedCallback() {
2275
+ this._logger.debug("disconnectedCallback"), this._controller && (await this._controller.destroy(), this._controller = null);
2276
+ }
2277
+ // Observed attributes and reflection
2278
+ static get observedAttributes() {
2279
+ return [
2280
+ "latitude",
2281
+ "longitude",
2282
+ "zoom",
2283
+ "min-zoom",
2284
+ "max-zoom",
2285
+ "tile-url",
2286
+ "tile-attribution",
2287
+ "read-only",
2288
+ "log-level",
2289
+ "dev-overlay",
2290
+ "prefer-canvas",
2291
+ "use-external-leaflet",
2292
+ "skip-leaflet-styles",
2293
+ "theme-url",
2294
+ // draw controls
2295
+ "draw-polygon",
2296
+ "draw-polyline",
2297
+ "draw-rectangle",
2298
+ "draw-circle",
2299
+ "draw-layer-cake",
2300
+ "draw-marker",
2301
+ "draw-move",
2302
+ "draw-ruler",
2303
+ "edit-features",
2304
+ "delete-features",
2305
+ "polygon-allow-intersection"
2306
+ ];
2307
+ }
2308
+ attributeChangedCallback(e, o, a) {
2309
+ switch (this._logger.debug("attributeChanged", { name: e, value: a }), e) {
2310
+ case "latitude":
2311
+ this._latitude = this._coerceNumber(a, 0);
2312
+ break;
2313
+ case "longitude":
2314
+ this._longitude = this._coerceNumber(a, 0);
2315
+ break;
2316
+ case "zoom":
2317
+ this._zoom = this._coerceNumber(a, 2);
2318
+ break;
2319
+ case "min-zoom":
2320
+ this._minZoom = a != null ? this._coerceNumber(a) : void 0;
2321
+ break;
2322
+ case "max-zoom":
2323
+ this._maxZoom = a != null ? this._coerceNumber(a) : void 0;
2324
+ break;
2325
+ case "tile-url":
2326
+ this._tileUrl = a != null ? a : this._tileUrl;
2327
+ break;
2328
+ case "tile-attribution":
2329
+ this._tileAttribution = a != null ? a : void 0;
2330
+ break;
2331
+ case "theme-url":
2332
+ this._themeUrl = a != null ? a : void 0, this.isConnected && this._applyThemeStyles();
2333
+ break;
2334
+ case "read-only":
2335
+ this._readOnly = a !== null;
2336
+ break;
2337
+ case "log-level":
2338
+ this._logLevel = a != null ? a : this._logLevel, this._logger.setLevel(this._logLevel);
2339
+ break;
2340
+ case "dev-overlay":
2341
+ this._devOverlay = a !== null;
2342
+ break;
2343
+ case "polygon-allow-intersection":
2344
+ this._polygonAllowIntersection = a !== null;
2345
+ break;
2346
+ case "prefer-canvas":
2347
+ this._preferCanvas = a !== null;
2348
+ break;
2349
+ case "use-external-leaflet":
2350
+ this._useExternalLeaflet = a !== null;
2351
+ break;
2352
+ case "skip-leaflet-styles":
2353
+ this._skipLeafletStyles = a !== null;
2354
+ break;
2355
+ }
2356
+ this._controller && (e === "latitude" || e === "longitude" || e === "zoom" ? this._controller.setView(
2357
+ this._latitude,
2358
+ this._longitude,
2359
+ this._zoom
2360
+ ) : (e === "tile-url" || e === "tile-attribution" || e === "min-zoom" || e === "max-zoom" || e === "read-only" || e === "dev-overlay" || e === "log-level" || e === "prefer-canvas" || e === "use-external-leaflet" || e === "skip-leaflet-styles" || e.startsWith("draw-") || e === "edit-features" || e === "delete-features") && this._controller.destroy().then(() => this._controller.init()));
2361
+ }
2362
+ // Properties (reflect attributes)
2363
+ get latitude() {
2364
+ return this._latitude;
2365
+ }
2366
+ set latitude(e) {
2367
+ this._latitude = Number(e), this._reflect("latitude", String(this._latitude));
2368
+ }
2369
+ get longitude() {
2370
+ return this._longitude;
2371
+ }
2372
+ set longitude(e) {
2373
+ this._longitude = Number(e), this._reflect("longitude", String(this._longitude));
2374
+ }
2375
+ get zoom() {
2376
+ return this._zoom;
2377
+ }
2378
+ set zoom(e) {
2379
+ this._zoom = Number(e), this._reflect("zoom", String(this._zoom));
2380
+ }
2381
+ get minZoom() {
2382
+ return this._minZoom;
2383
+ }
2384
+ set minZoom(e) {
2385
+ this._minZoom = e, this._reflect("min-zoom", e != null ? String(e) : null);
2386
+ }
2387
+ get maxZoom() {
2388
+ return this._maxZoom;
2389
+ }
2390
+ set maxZoom(e) {
2391
+ this._maxZoom = e, this._reflect("max-zoom", e != null ? String(e) : null);
2392
+ }
2393
+ get tileUrl() {
2394
+ return this._tileUrl;
2395
+ }
2396
+ set tileUrl(e) {
2397
+ this._tileUrl = e, this._reflect("tile-url", e);
2398
+ }
2399
+ get tileAttribution() {
2400
+ return this._tileAttribution;
2401
+ }
2402
+ set tileAttribution(e) {
2403
+ this._tileAttribution = e, this._reflect("tile-attribution", e != null ? e : null);
2404
+ }
2405
+ get readOnly() {
2406
+ return this._readOnly;
2407
+ }
2408
+ set readOnly(e) {
2409
+ this._readOnly = !!e, this._booleanReflect("read-only", this._readOnly);
2410
+ }
2411
+ get logLevel() {
2412
+ return this._logLevel;
2413
+ }
2414
+ set logLevel(e) {
2415
+ this._logLevel = e, this._logger.setLevel(e), this._reflect("log-level", e);
2416
+ }
2417
+ get devOverlay() {
2418
+ return this._devOverlay;
2419
+ }
2420
+ set devOverlay(e) {
2421
+ this._devOverlay = !!e, this._booleanReflect("dev-overlay", this._devOverlay);
2422
+ }
2423
+ get preferCanvas() {
2424
+ return this._preferCanvas;
2425
+ }
2426
+ set preferCanvas(e) {
2427
+ this._preferCanvas = !!e, this._booleanReflect("prefer-canvas", this._preferCanvas);
2428
+ }
2429
+ get useExternalLeaflet() {
2430
+ return this._useExternalLeaflet;
2431
+ }
2432
+ set useExternalLeaflet(e) {
2433
+ this._useExternalLeaflet = !!e, this._booleanReflect("use-external-leaflet", this._useExternalLeaflet);
2434
+ }
2435
+ get skipLeafletStyles() {
2436
+ return this._skipLeafletStyles;
2437
+ }
2438
+ set skipLeafletStyles(e) {
2439
+ this._skipLeafletStyles = !!e, this._booleanReflect("skip-leaflet-styles", this._skipLeafletStyles);
2440
+ }
2441
+ get leafletInstance() {
2442
+ return this._leafletInstance;
2443
+ }
2444
+ set leafletInstance(e) {
2445
+ this._leafletInstance = e;
2446
+ }
2447
+ get themeCss() {
2448
+ return this._themeCss;
2449
+ }
2450
+ set themeCss(e) {
2451
+ this._themeCss = typeof e == "string" ? e : "", this.isConnected && this._applyThemeStyles();
2452
+ }
2453
+ // Public API methods (delegating to controller)
2454
+ async getGeoJSON() {
2455
+ return this._logger.debug("getGeoJSON"), this._controller ? this._controller.getGeoJSON() : { type: "FeatureCollection", features: [] };
2456
+ }
2457
+ async loadGeoJSON(e) {
2458
+ var n, r;
2459
+ if (this._logger.debug("loadGeoJSON", { features: (r = (n = e == null ? void 0 : e.features) == null ? void 0 : n.length) != null ? r : 0 }), !this._controller) return;
2460
+ const o = { fc: e, mode: "load" };
2461
+ this.dispatchEvent(new CustomEvent("leaflet-draw:ingest", { detail: o }));
2462
+ const a = o.fc && o.fc.type === "FeatureCollection" ? o.fc : e;
2463
+ await this._controller.loadGeoJSON(a, !1);
2464
+ }
2465
+ async clearLayers() {
2466
+ this._logger.debug("clearLayers"), this._controller && await this._controller.clearLayers();
2467
+ }
2468
+ async addFeatures(e) {
2469
+ var n, r;
2470
+ if (this._logger.debug("addFeatures", { count: (r = (n = e == null ? void 0 : e.features) == null ? void 0 : n.length) != null ? r : 0 }), !this._controller) return [];
2471
+ const o = { fc: e, mode: "add" };
2472
+ this.dispatchEvent(new CustomEvent("leaflet-draw:ingest", { detail: o }));
2473
+ const a = o.fc && o.fc.type === "FeatureCollection" ? o.fc : e;
2474
+ return this._controller.addFeatures(a);
2475
+ }
2476
+ async updateFeature(e, o) {
2477
+ this._logger.debug("updateFeature", { id: e }), this._controller && await this._controller.updateFeature(e, o);
2478
+ }
2479
+ async removeFeature(e) {
2480
+ this._logger.debug("removeFeature", { id: e }), this._controller && await this._controller.removeFeature(e);
2481
+ }
2482
+ async fitBoundsToData(e) {
2483
+ this._logger.debug("fitBoundsToData", { padding: e }), this._controller && await this._controller.fitBoundsToData(
2484
+ typeof e == "number" ? e : 0.05
2485
+ );
2486
+ }
2487
+ async fitBounds(e, o) {
2488
+ this._logger.debug("fitBounds", { bounds: e, padding: o }), this._controller && await this._controller.fitBounds(
2489
+ e,
2490
+ typeof o == "number" ? o : 0.05
2491
+ );
2492
+ }
2493
+ async setView(e, o, a) {
2494
+ this._logger.debug("setView", { lat: e, lng: o, zoom: a }), this.latitude = e, this.longitude = o, typeof a == "number" && (this.zoom = a), this._controller && await this._controller.setView(e, o, a);
2495
+ }
2496
+ async exportGeoJSON() {
2497
+ if (this._logger.debug("exportGeoJSON"), !this._controller) return { type: "FeatureCollection", features: [] };
2498
+ const e = await this._controller.getGeoJSON(), o = { geoJSON: e, featureCount: e.features.length };
2499
+ return this.dispatchEvent(new CustomEvent("leaflet-draw:export", { detail: o })), e;
2500
+ }
2501
+ /**
2502
+ * Merge all visible polygon layers into a single polygon.
2503
+ * This removes the original polygon features and adds a new merged feature.
2504
+ *
2505
+ * @param options Optional configuration for the merge operation
2506
+ * @returns Promise resolving to the ID of the newly created merged feature, or null if no polygons to merge
2507
+ */
2508
+ async mergePolygons(e) {
2509
+ if (this._logger.debug("mergePolygons"), !this._controller) return null;
2510
+ const a = (await this._controller.getGeoJSON()).features.length, n = await this._controller.mergeVisiblePolygons(e);
2511
+ if (n) {
2512
+ const r = await this._controller.getGeoJSON(), i = {
2513
+ id: n,
2514
+ mergedFeatureCount: a - r.features.length + 1,
2515
+ geoJSON: r
2516
+ };
2517
+ this.dispatchEvent(new CustomEvent("leaflet-draw:merged", { detail: i }));
2518
+ }
2519
+ return n;
2520
+ }
2521
+ async setMeasurementUnits(e) {
2522
+ this._logger.debug("setMeasurementUnits", { system: e }), this._controller && this._controller.setRulerUnits(e);
2523
+ }
2524
+ async loadGeoJSONFromUrl(e) {
2525
+ if (this._logger.debug("loadGeoJSONFromUrl", { url: e }), !this._controller) return;
2526
+ const o = await fetch(e, { headers: { Accept: "application/json" } });
2527
+ if (!o.ok) {
2528
+ const i = new Error(
2529
+ `Failed to fetch GeoJSON from ${e}: ${o.status} ${o.statusText}`
2530
+ );
2531
+ throw this.dispatchEvent(
2532
+ new CustomEvent("leaflet-draw:error", {
2533
+ detail: { message: i.message, cause: i }
2534
+ })
2535
+ ), i;
2536
+ }
2537
+ const a = await o.json(), n = { fc: a, mode: "load" };
2538
+ this.dispatchEvent(new CustomEvent("leaflet-draw:ingest", { detail: n }));
2539
+ const r = n.fc && n.fc.type === "FeatureCollection" ? n.fc : a;
2540
+ await this._controller.loadGeoJSON(r, !0);
2541
+ }
2542
+ async loadGeoJSONFromText(e) {
2543
+ var r;
2544
+ if (this._logger.debug("loadGeoJSONFromText", { length: (r = e == null ? void 0 : e.length) != null ? r : 0 }), !this._controller) return;
2545
+ let o;
2546
+ try {
2547
+ o = JSON.parse(e);
2548
+ } catch (i) {
2549
+ const l = new Error("Failed to parse GeoJSON text");
2550
+ throw this.dispatchEvent(
2551
+ new CustomEvent("leaflet-draw:error", {
2552
+ detail: { message: l.message, cause: i }
2553
+ })
2554
+ ), l;
2555
+ }
2556
+ const a = { fc: o, mode: "load" };
2557
+ this.dispatchEvent(new CustomEvent("leaflet-draw:ingest", { detail: a }));
2558
+ const n = a.fc && a.fc.type === "FeatureCollection" ? a.fc : o;
2559
+ await this._controller.loadGeoJSON(n, !0);
2560
+ }
2561
+ // Helpers
2562
+ _currentConfig() {
2563
+ return {
2564
+ latitude: this._latitude,
2565
+ longitude: this._longitude,
2566
+ zoom: this._zoom,
2567
+ minZoom: this._minZoom,
2568
+ maxZoom: this._maxZoom,
2569
+ tileUrl: this._tileUrl,
2570
+ tileAttribution: this._tileAttribution,
2571
+ readOnly: this._readOnly,
2572
+ fitToDataOnLoad: !1,
2573
+ logLevel: this._logLevel,
2574
+ devOverlay: this._devOverlay,
2575
+ polygonAllowIntersection: this._polygonAllowIntersection,
2576
+ preferCanvas: this._preferCanvas,
2577
+ useExternalLeaflet: this._useExternalLeaflet,
2578
+ skipLeafletStyles: this._skipLeafletStyles
2579
+ };
2580
+ }
2581
+ _applyThemeStyles() {
2582
+ var a;
2583
+ const e = (a = this._themeUrl) == null ? void 0 : a.trim();
2584
+ if (e) {
2585
+ if (!this._themeLinkEl) {
2586
+ const n = document.createElement("link");
2587
+ n.setAttribute("rel", "stylesheet"), n.setAttribute("data-geokit-theme-url", "true"), this._root.appendChild(n), this._themeLinkEl = n;
2588
+ }
2589
+ this._themeLinkEl.getAttribute("href") !== e && this._themeLinkEl.setAttribute("href", e);
2590
+ } else this._themeLinkEl && (this._themeLinkEl.remove(), this._themeLinkEl = null);
2591
+ const o = this._themeCss;
2592
+ if (o.trim().length > 0) {
2593
+ if (!this._themeStyleEl) {
2594
+ const n = document.createElement("style");
2595
+ n.setAttribute("data-geokit-theme-css", "true"), this._root.appendChild(n), this._themeStyleEl = n;
2596
+ }
2597
+ this._themeStyleEl.textContent !== o && (this._themeStyleEl.textContent = o);
2598
+ } else this._themeStyleEl && (this._themeStyleEl.remove(), this._themeStyleEl = null);
2599
+ }
2600
+ _reflect(e, o) {
2601
+ o === null ? this.removeAttribute(e) : this.getAttribute(e) !== o && this.setAttribute(e, o);
2602
+ }
2603
+ _booleanReflect(e, o) {
2604
+ o ? this.hasAttribute(e) || this.setAttribute(e, "") : this.hasAttribute(e) && this.removeAttribute(e);
2605
+ }
2606
+ _coerceNumber(e, o) {
2607
+ if (e == null) return o != null ? o : NaN;
2608
+ const a = Number(e);
2609
+ return Number.isFinite(a) ? a : o != null ? o : NaN;
2610
+ }
2611
+ }
2612
+ const re = "leaflet-geokit";
2613
+ customElements.get(re) || customElements.define(re, de);
2614
+ const ne = "leaflet-draw-map";
2615
+ if (!customElements.get(ne)) {
2616
+ class s extends de {
2617
+ }
2618
+ customElements.define(ne, s);
2619
+ }
2620
+ export {
2621
+ de as LeafletDrawMapElement
2622
+ };
2623
+ //# sourceMappingURL=index-D8EjMf-1.js.map