@dartcom/ui-kit 10.2.33 → 10.2.34

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.
package/dist/index.cjs CHANGED
@@ -41,21 +41,6 @@ function _interopNamespaceDefault(e) {
41
41
  return Object.freeze(n);
42
42
  }
43
43
 
44
- function _mergeNamespaces(n, m) {
45
- m.forEach(function (e) {
46
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
47
- if (k !== 'default' && !(k in n)) {
48
- var d = Object.getOwnPropertyDescriptor(e, k);
49
- Object.defineProperty(n, k, d.get ? d : {
50
- enumerable: true,
51
- get: function () { return e[k]; }
52
- });
53
- }
54
- });
55
- });
56
- return Object.freeze(n);
57
- }
58
-
59
44
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
60
45
 
61
46
  exports.Operations = void 0;
@@ -14648,11 +14633,10 @@ function requireLeafletSrc () {
14648
14633
  }
14649
14634
 
14650
14635
  var leafletSrcExports = requireLeafletSrc();
14651
- var s$3 = /*@__PURE__*/getDefaultExportFromCjs(leafletSrcExports);
14652
14636
 
14653
- function r$2(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$2(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$2(e))&&(n&&(n+=" "),n+=t);return n}
14637
+ function r$1(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$1(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
14654
14638
 
14655
- let e$1={data:""},t=t=>{if("object"==typeof window){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$2=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o$2(c,n):n+"{"+o$2(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o$2(c,t?t.replace(/([^,])+/g,e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o$2.p?o$2.p(n,c):n+":"+c+";");}return r+(t&&a?t+"{"+a+"}":a)+l},c$1={},s$2=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s$2(e[r]);return t}return e},i$2=(e,t,r,i,p)=>{let u=s$2(e),d=c$1[u]||(c$1[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(u));if(!c$1[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l$1.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n$1," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n$1," ").trim();return o[0]})(e);c$1[d]=o$2(p?{["@keyframes "+d]:t}:t,r?"":"."+d);}let f=r&&c$1.g?c$1.g:null;return r&&(c$1.g=c$1[d]),((e,t,r,l)=>{l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(c$1[d],t,i,f),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o$2(e,""):false===e?"":e;}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i$2(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}u.bind({g:1});u.bind({k:1});
14639
+ let e$1={data:""},t=t=>{if("object"==typeof window){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||e$1},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$2=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o$2(c,n):n+"{"+o$2(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o$2(c,t?t.replace(/([^,])+/g,e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o$2.p?o$2.p(n,c):n+":"+c+";");}return r+(t&&a?t+"{"+a+"}":a)+l},c$1={},s$2=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s$2(e[r]);return t}return e},i$2=(e,t,r,i,p)=>{let u=s$2(e),d=c$1[u]||(c$1[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(u));if(!c$1[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n$1," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n$1," ").trim();return o[0]})(e);c$1[d]=o$2(p?{["@keyframes "+d]:t}:t,r?"":"."+d);}let f=r&&c$1.g?c$1.g:null;return r&&(c$1.g=c$1[d]),((e,t,r,l)=>{l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(c$1[d],t,i,f),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o$2(e,""):false===e?"":e;}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i$2(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}u.bind({g:1});u.bind({k:1});
14656
14640
 
14657
14641
  function _defineProperties$1(target, props) {
14658
14642
  for (var i = 0; i < props.length; i++) {
@@ -26638,11 +26622,11 @@ const MapProvider = ({ children }) => {
26638
26622
  const [isReady, setIsReady] = React__namespace.useState(false);
26639
26623
  const init = async () => {
26640
26624
  try {
26641
- await Promise.resolve().then(function () { return leaflet_rotatedMarker; });
26642
- await Promise.resolve().then(function () { return leaflet_polylineoffset$1; });
26643
- await Promise.resolve().then(function () { return index$1; });
26644
- await Promise.resolve().then(function () { return index; });
26645
- await Promise.resolve().then(function () { return leafletArrows$1; });
26625
+ // await import('leaflet-rotatedmarker');
26626
+ // await import('leaflet-polylineoffset');
26627
+ // await import('leaflet-area-select');
26628
+ // await import('leaflet-path-drag');
26629
+ // await import('./library/leaflet-arrows');
26646
26630
  await Promise.resolve().then(function () { return tangram_min; });
26647
26631
  setIsReady(true);
26648
26632
  }
@@ -44344,10 +44328,10 @@ function requirePapaparse_min () {
44344
44328
  var papaparse_minExports = requirePapaparse_min();
44345
44329
  var e = /*@__PURE__*/getDefaultExportFromCjs(papaparse_minExports);
44346
44330
 
44347
- "function"==typeof SuppressedError&&SuppressedError;function P(n,t){return e.parse(n,t)}function x$1(n,t){e.parse(n,Object.assign({},{download:true},t));}function O(n,t){return void 0===t&&(t={}),e.unparse(n,t)}function S$1(){return {readString:P,readRemoteFile:x$1,jsonToCSV:O}}e.BAD_DELIMITERS;e.RECORD_SEP;e.UNIT_SEP;e.WORKERS_SUPPORTED;e.LocalChunkSize;e.DefaultDelimiter;
44331
+ "function"==typeof SuppressedError&&SuppressedError;function P(n,t){return e.parse(n,t)}function x$1(n,t){e.parse(n,Object.assign({},{download:true},t));}function O(n,t){return void 0===t&&(t={}),e.unparse(n,t)}function S(){return {readString:P,readRemoteFile:x$1,jsonToCSV:O}}e.BAD_DELIMITERS;e.RECORD_SEP;e.UNIT_SEP;e.WORKERS_SUPPORTED;e.LocalChunkSize;e.DefaultDelimiter;
44348
44332
 
44349
44333
  const CSVUploader = ({ onDataParsed, onError, delimiter = ',', header = true, dynamicTyping = true, skipEmptyLines = true, worker = false, }) => {
44350
- const { readString } = S$1();
44334
+ const { readString } = S();
44351
44335
  const [loading, setLoading] = React__namespace.useState(false);
44352
44336
  const [error, setError] = React__namespace.useState(null);
44353
44337
  return (jsxRuntime.jsx(UploadButton, { accept: ".csv", loading: loading, error: error, onFilesLoad: ({ files }) => {
@@ -46799,7 +46783,7 @@ const schema = create$3().shape({
46799
46783
  password: create$6().required(),
46800
46784
  });
46801
46785
 
46802
- const r$1=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o$1=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r$1(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r$1(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o$1(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
46786
+ const r=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o$1=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o$1(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
46803
46787
 
46804
46788
  function o(o,n,s$1){return void 0===s$1&&(s$1={}),function(a,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(o["sync"===s$1.mode?"validateSync":"validate"](a,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&o$1({},c),{values:s$1.raw?Object.assign({},a):t,errors:{}}}));}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return {values:{},errors:s((o=e,n=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,s=o&&o[t.type];e[t.path]=appendErrors(t.path,n,e,t.type,s?[].concat(s,t.message):t.message);}return e},{})),c)};var o,n;}))}catch(e){return Promise.reject(e)}}}
46805
46789
 
@@ -46848,1029 +46832,6 @@ const AuthPage = ({ onSuccessSignIn }) => {
46848
46832
  }, children: [jsxRuntime.jsx(material.Typography, { variant: "h4", children: "Authorization" }), jsxRuntime.jsx(CustomInput, { ...register('username'), label: "Login", placeholder: "Enter your login" }), jsxRuntime.jsx(CustomInput, { ...register('password'), label: "Password", placeholder: "Enter your password", type: "password" }), jsxRuntime.jsx(Button, { type: "submit", disabled: !isValid, children: "Sign in" })] }) }));
46849
46833
  };
46850
46834
 
46851
- (function() {
46852
- // save these original methods before they are overwritten
46853
- var proto_initIcon = L.Marker.prototype._initIcon;
46854
- var proto_setPos = L.Marker.prototype._setPos;
46855
-
46856
- var oldIE = (L.DomUtil.TRANSFORM === 'msTransform');
46857
-
46858
- L.Marker.addInitHook(function () {
46859
- var iconOptions = this.options.icon && this.options.icon.options;
46860
- var iconAnchor = iconOptions && this.options.icon.options.iconAnchor;
46861
- if (iconAnchor) {
46862
- iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px');
46863
- }
46864
- this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom' ;
46865
- this.options.rotationAngle = this.options.rotationAngle || 0;
46866
-
46867
- // Ensure marker keeps rotated during dragging
46868
- this.on('drag', function(e) { e.target._applyRotation(); });
46869
- });
46870
-
46871
- L.Marker.include({
46872
- _initIcon: function() {
46873
- proto_initIcon.call(this);
46874
- },
46875
-
46876
- _setPos: function (pos) {
46877
- proto_setPos.call(this, pos);
46878
- this._applyRotation();
46879
- },
46880
-
46881
- _applyRotation: function () {
46882
- if(this.options.rotationAngle) {
46883
- this._icon.style[L.DomUtil.TRANSFORM+'Origin'] = this.options.rotationOrigin;
46884
-
46885
- if(oldIE) {
46886
- // for IE 9, use the 2D rotation
46887
- this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)';
46888
- } else {
46889
- // for modern browsers, prefer the 3D accelerated version
46890
- this._icon.style[L.DomUtil.TRANSFORM] += ' rotateZ(' + this.options.rotationAngle + 'deg)';
46891
- }
46892
- }
46893
- },
46894
-
46895
- setRotationAngle: function(angle) {
46896
- this.options.rotationAngle = angle;
46897
- this.update();
46898
- return this;
46899
- },
46900
-
46901
- setRotationOrigin: function(origin) {
46902
- this.options.rotationOrigin = origin;
46903
- this.update();
46904
- return this;
46905
- }
46906
- });
46907
- })();
46908
-
46909
- var leaflet_rotatedMarker = /*#__PURE__*/Object.freeze({
46910
- __proto__: null
46911
- });
46912
-
46913
- var leaflet_polylineoffset$2 = {exports: {}};
46914
-
46915
- var hasRequiredLeaflet_polylineoffset;
46916
-
46917
- function requireLeaflet_polylineoffset () {
46918
- if (hasRequiredLeaflet_polylineoffset) return leaflet_polylineoffset$2.exports;
46919
- hasRequiredLeaflet_polylineoffset = 1;
46920
- (function (module, exports$1) {
46921
- (function (factory, window) {
46922
- {
46923
- module.exports = factory(requireLeafletSrc());
46924
- }
46925
- if (typeof window !== 'undefined' && window.L) {
46926
- window.L.PolylineOffset = factory(L);
46927
- }
46928
- }(function (L) {
46929
-
46930
- function forEachPair(list, callback) {
46931
- if (!list || list.length < 1) { return; }
46932
- for (var i = 1, l = list.length; i < l; i++) {
46933
- callback(list[i-1], list[i]);
46934
- }
46935
- }
46936
-
46937
- /**
46938
- Find the coefficients (a,b) of a line of equation y = a.x + b,
46939
- or the constant x for vertical lines
46940
- Return null if there's no equation possible
46941
- */
46942
- function lineEquation(pt1, pt2) {
46943
- if (pt1.x === pt2.x) {
46944
- return pt1.y === pt2.y ? null : { x: pt1.x };
46945
- }
46946
-
46947
- var a = (pt2.y - pt1.y) / (pt2.x - pt1.x);
46948
- return {
46949
- a: a,
46950
- b: pt1.y - a * pt1.x,
46951
- };
46952
- }
46953
-
46954
- /**
46955
- Return the intersection point of two lines defined by two points each
46956
- Return null when there's no unique intersection
46957
- */
46958
- function intersection(l1a, l1b, l2a, l2b) {
46959
- var line1 = lineEquation(l1a, l1b);
46960
- var line2 = lineEquation(l2a, l2b);
46961
-
46962
- if (line1 === null || line2 === null) {
46963
- return null;
46964
- }
46965
-
46966
- if (line1.hasOwnProperty('x')) {
46967
- return line2.hasOwnProperty('x')
46968
- ? null
46969
- : {
46970
- x: line1.x,
46971
- y: line2.a * line1.x + line2.b,
46972
- };
46973
- }
46974
- if (line2.hasOwnProperty('x')) {
46975
- return {
46976
- x: line2.x,
46977
- y: line1.a * line2.x + line1.b,
46978
- };
46979
- }
46980
-
46981
- if (line1.a === line2.a) {
46982
- return null;
46983
- }
46984
-
46985
- var x = (line2.b - line1.b) / (line1.a - line2.a);
46986
- return {
46987
- x: x,
46988
- y: line1.a * x + line1.b,
46989
- };
46990
- }
46991
-
46992
- function translatePoint(pt, dist, heading) {
46993
- return {
46994
- x: pt.x + dist * Math.cos(heading),
46995
- y: pt.y + dist * Math.sin(heading),
46996
- };
46997
- }
46998
-
46999
- var PolylineOffset = {
47000
- offsetPointLine: function(points, distance) {
47001
- var offsetSegments = [];
47002
-
47003
- forEachPair(points, L.bind(function(a, b) {
47004
- if (a.x === b.x && a.y === b.y) { return; }
47005
-
47006
- // angles in (-PI, PI]
47007
- var segmentAngle = Math.atan2(a.y - b.y, a.x - b.x);
47008
- var offsetAngle = segmentAngle - Math.PI/2;
47009
-
47010
- offsetSegments.push({
47011
- offsetAngle: offsetAngle,
47012
- original: [a, b],
47013
- offset: [
47014
- translatePoint(a, distance, offsetAngle),
47015
- translatePoint(b, distance, offsetAngle)
47016
- ]
47017
- });
47018
- }, this));
47019
-
47020
- return offsetSegments;
47021
- },
47022
-
47023
- offsetPoints: function(pts, offset) {
47024
- var offsetSegments = this.offsetPointLine(pts, offset);
47025
- return this.joinLineSegments(offsetSegments, offset);
47026
- },
47027
-
47028
- /**
47029
- Join 2 line segments defined by 2 points each with a circular arc
47030
- */
47031
- joinSegments: function(s1, s2, offset) {
47032
- // TODO: different join styles
47033
- return this.circularArc(s1, s2, offset)
47034
- .filter(function(x) { return x; })
47035
- },
47036
-
47037
- joinLineSegments: function(segments, offset) {
47038
- var joinedPoints = [];
47039
- var first = segments[0];
47040
- var last = segments[segments.length - 1];
47041
-
47042
- if (first && last) {
47043
- joinedPoints.push(first.offset[0]);
47044
- forEachPair(segments, L.bind(function(s1, s2) {
47045
- joinedPoints = joinedPoints.concat(this.joinSegments(s1, s2, offset));
47046
- }, this));
47047
- joinedPoints.push(last.offset[1]);
47048
- }
47049
-
47050
- return joinedPoints;
47051
- },
47052
-
47053
- segmentAsVector: function(s) {
47054
- return {
47055
- x: s[1].x - s[0].x,
47056
- y: s[1].y - s[0].y,
47057
- };
47058
- },
47059
-
47060
- getSignedAngle: function(s1, s2) {
47061
- const a = this.segmentAsVector(s1);
47062
- const b = this.segmentAsVector(s2);
47063
- return Math.atan2(a.x * b.y - a.y * b.x, a.x * b.x + a.y * b.y);
47064
- },
47065
-
47066
- /**
47067
- Interpolates points between two offset segments in a circular form
47068
- */
47069
- circularArc: function(s1, s2, distance) {
47070
- // if the segments are the same angle,
47071
- // there should be a single join point
47072
- if (s1.offsetAngle === s2.offsetAngle) {
47073
- return [s1.offset[1]];
47074
- }
47075
-
47076
- const signedAngle = this.getSignedAngle(s1.offset, s2.offset);
47077
- // for inner angles, just find the offset segments intersection
47078
- if ((signedAngle * distance > 0) &&
47079
- (signedAngle * this.getSignedAngle(s1.offset, [s1.offset[0], s2.offset[1]]) > 0)) {
47080
- return [intersection(s1.offset[0], s1.offset[1], s2.offset[0], s2.offset[1])];
47081
- }
47082
-
47083
- // draws a circular arc with R = offset distance, C = original meeting point
47084
- var points = [];
47085
- var center = s1.original[1];
47086
- // ensure angles go in the anti-clockwise direction
47087
- var rightOffset = distance > 0;
47088
- var startAngle = rightOffset ? s2.offsetAngle : s1.offsetAngle;
47089
- var endAngle = rightOffset ? s1.offsetAngle : s2.offsetAngle;
47090
- // and that the end angle is bigger than the start angle
47091
- if (endAngle < startAngle) {
47092
- endAngle += Math.PI * 2;
47093
- }
47094
- var step = Math.PI / 8;
47095
- for (var alpha = startAngle; alpha < endAngle; alpha += step) {
47096
- points.push(translatePoint(center, distance, alpha));
47097
- }
47098
- points.push(translatePoint(center, distance, endAngle));
47099
-
47100
- return rightOffset ? points.reverse() : points;
47101
- }
47102
- };
47103
-
47104
- // Modify the L.Polyline class by overwriting the projection function
47105
- L.Polyline.include({
47106
- _projectLatlngs: function (latlngs, result, projectedBounds) {
47107
- var isFlat = latlngs.length > 0 && latlngs[0] instanceof L.LatLng;
47108
-
47109
- if (isFlat) {
47110
- var ring = latlngs.map(L.bind(function(ll) {
47111
- var point = this._map.latLngToLayerPoint(ll);
47112
- if (projectedBounds) {
47113
- projectedBounds.extend(point);
47114
- }
47115
- return point;
47116
- }, this));
47117
-
47118
- // Offset management hack ---
47119
- if (this.options.offset) {
47120
- ring = L.PolylineOffset.offsetPoints(ring, this.options.offset);
47121
- }
47122
- // Offset management hack END ---
47123
-
47124
- result.push(ring.map(function (xy) {
47125
- return L.point(xy.x, xy.y);
47126
- }));
47127
- } else {
47128
- latlngs.forEach(L.bind(function(ll) {
47129
- this._projectLatlngs(ll, result, projectedBounds);
47130
- }, this));
47131
- }
47132
- }
47133
- });
47134
-
47135
- L.Polyline.include({
47136
- setOffset: function(offset) {
47137
- this.options.offset = offset;
47138
- this.redraw();
47139
- return this;
47140
- }
47141
- });
47142
-
47143
- return PolylineOffset;
47144
-
47145
- }, window));
47146
- } (leaflet_polylineoffset$2));
47147
- return leaflet_polylineoffset$2.exports;
47148
- }
47149
-
47150
- var leaflet_polylineoffsetExports = requireLeaflet_polylineoffset();
47151
- var leaflet_polylineoffset = /*@__PURE__*/getDefaultExportFromCjs(leaflet_polylineoffsetExports);
47152
-
47153
- var leaflet_polylineoffset$1 = /*#__PURE__*/_mergeNamespaces({
47154
- __proto__: null,
47155
- default: leaflet_polylineoffset
47156
- }, [leaflet_polylineoffsetExports]);
47157
-
47158
- /**
47159
- * L.Map.SelectArea - Area selection tool for leaflet
47160
- *
47161
- * @author Alexander Milevski <info@w8r.name>
47162
- * @see https://github.com/w8r/leaflet-area-select
47163
- * @license MIT
47164
- * @preserve
47165
- */
47166
- var r = function() {
47167
- return true;
47168
- };
47169
- s$3.Map.SelectArea = s$3.Map.BoxZoom.extend({
47170
- statics: {
47171
- /**
47172
- * @static
47173
- * @type {String}
47174
- */
47175
- SELECT_AREA_SELECTED: "selectarea:selected",
47176
- /**
47177
- * @static
47178
- * @type {String}
47179
- */
47180
- SELECT_AREA_START: "selectarea:start",
47181
- /**
47182
- * @static
47183
- * @type {String}
47184
- */
47185
- SELECT_AREA_TOGGLED: "selectarea:toggled"
47186
- },
47187
- options: {
47188
- shiftKey: false,
47189
- ctrlKey: true,
47190
- validate: r,
47191
- autoDisable: false,
47192
- cursor: "crosshair"
47193
- },
47194
- /**
47195
- * @param {L.Map} map
47196
- * @constructor
47197
- */
47198
- initialize: function(t, e) {
47199
- s$3.Util.setOptions(this, e || {}), s$3.Map.BoxZoom.prototype.initialize.call(this, t), this._validate = null, this._moved = false, this._autoDisable = !this.options.ctrlKey && this.options.autoDisable, this._lastLayerPoint = null, this._beforeCursor = null, this.setValidate(this.options.validate), this.setAutoDisable(this.options.autoDisable);
47200
- },
47201
- /**
47202
- * @param {Function=} validate
47203
- * @return {SelectArea}
47204
- */
47205
- setValidate: function(t) {
47206
- var e = this;
47207
- return typeof t != "function" && (t = r), this._validate = function(i) {
47208
- return t.call(e, i);
47209
- }, this;
47210
- },
47211
- /**
47212
- * @param {Boolean} autoDisable
47213
- */
47214
- setAutoDisable: function(t) {
47215
- this._autoDisable = !!t;
47216
- },
47217
- /**
47218
- * @param {Boolean} on
47219
- */
47220
- setControlKey: function(t) {
47221
- var e = this._enabled;
47222
- e && this.disable(), this.options.ctrlKey = !!t, t && (this.options.shiftKey = false), e && this.enable();
47223
- },
47224
- /**
47225
- * @param {Boolean} on
47226
- */
47227
- setShiftKey: function(t) {
47228
- var e = this._enabled;
47229
- e && this.disable(), this.options.shiftKey = !!t, t && (this.options.ctrlKey = false), e && this.enable();
47230
- },
47231
- /**
47232
- * Disable dragging or zoombox
47233
- * @param {Function=} validate
47234
- * @param {Boolean=} autoDisable
47235
- */
47236
- enable: function(t, e) {
47237
- this.options.shiftKey ? this._map.boxZoom && this._map.boxZoom.disable() : this.options.ctrlKey || this._map.dragging.disable(), s$3.Map.BoxZoom.prototype.enable.call(this), this.options.ctrlKey || this._setCursor(), t && this.setValidate(t), this.setAutoDisable(e), this._map.fire(s$3.Map.SelectArea.SELECT_AREA_TOGGLED);
47238
- },
47239
- /**
47240
- * Re-enable box zoom or dragging
47241
- */
47242
- disable: function() {
47243
- s$3.Map.BoxZoom.prototype.disable.call(this), this.options.ctrlKey || this._restoreCursor(), this.options.shiftKey ? this._map.boxZoom && this._map.boxZoom.enable() : this._map.dragging.enable(), this._map.fire(s$3.Map.SelectArea.SELECT_AREA_TOGGLED);
47244
- },
47245
- /**
47246
- * Also listen to ESC to cancel interaction
47247
- * @override
47248
- */
47249
- addHooks: function() {
47250
- s$3.Map.BoxZoom.prototype.addHooks.call(this), s$3.DomEvent.on(document, "keyup", this._onKeyUp, this).on(document, "keydown", this._onKeyPress, this).on(document, "contextmenu", this._onMouseDown, this).on(window, "blur", this._onBlur, this), this._map.on("dragstart", this._onMouseDown, this);
47251
- },
47252
- /**
47253
- * @override
47254
- */
47255
- removeHooks: function() {
47256
- s$3.Map.BoxZoom.prototype.removeHooks.call(this), s$3.DomEvent.off(document, "keyup", this._onKeyUp, this).off(document, "keydown", this._onKeyPress, this).off(document, "contextmenu", this._onMouseDown, this).off(window, "blur", this._onBlur, this), this._map.off("dragstart", this._onMouseDown, this);
47257
- },
47258
- /**
47259
- * @override
47260
- */
47261
- _onMouseDown: function(t) {
47262
- if (this._moved = false, this._lastLayerPoint = null, this.options.shiftKey && !t.shiftKey || this.options.ctrlKey && !t.ctrlKey || t.which !== 1 && t.button !== 1)
47263
- return false;
47264
- s$3.DomEvent.stop(t);
47265
- var e = this._map.mouseEventToLayerPoint(t);
47266
- if (!this._validate(e)) return false;
47267
- s$3.DomUtil.disableTextSelection(), s$3.DomUtil.disableImageDrag(), this._startLayerPoint = e, s$3.DomEvent.on(document, "mousemove", this._onMouseMove, this).on(document, "mouseup", this._onMouseUp, this).on(document, "keydown", this._onKeyDown, this);
47268
- },
47269
- /**
47270
- * @override
47271
- */
47272
- _onMouseMove: function(t) {
47273
- this._moved || (this._box = s$3.DomUtil.create("div", "leaflet-zoom-box", this._pane), s$3.DomUtil.setPosition(this._box, this._startLayerPoint), this._map.fire(s$3.Map.SelectArea.SELECT_AREA_START));
47274
- var e = this._startLayerPoint, i = this._box, o = this._map.mouseEventToLayerPoint(t), a = o.subtract(e);
47275
- if (this._validate(o)) {
47276
- this._lastLayerPoint = o;
47277
- var n = new s$3.Point(
47278
- Math.min(o.x, e.x),
47279
- Math.min(o.y, e.y)
47280
- );
47281
- s$3.DomUtil.setPosition(i, n), this._moved = true, i.style.width = Math.max(0, Math.abs(a.x) - 4) + "px", i.style.height = Math.max(0, Math.abs(a.y) - 4) + "px";
47282
- }
47283
- },
47284
- /**
47285
- * General on/off toggle
47286
- * @param {KeyboardEvent} e
47287
- */
47288
- _onKeyUp: function(t) {
47289
- t.keyCode === 27 ? this._moved && this._box && this._finish() : this.options.ctrlKey && (this._restoreCursor(), this._map.dragging.enable());
47290
- },
47291
- /**
47292
- * Key down listener to enable on ctrl-press
47293
- * @param {KeyboardEvent} e
47294
- */
47295
- _onKeyPress: function(t) {
47296
- this.options.ctrlKey && (t.ctrlKey || t.type === "dragstart") && this._beforeCursor === null && (this._setCursor(), this._map.dragging._draggable._onUp(t), this._map.dragging.disable());
47297
- },
47298
- /**
47299
- * Window blur listener to restore state
47300
- * @param {Event} e
47301
- */
47302
- _onBlur: function(t) {
47303
- this._restoreCursor(), this._map.dragging.enable();
47304
- },
47305
- /**
47306
- * Set crosshair cursor
47307
- */
47308
- _setCursor: function() {
47309
- this._beforeCursor = this._container.style.cursor, this._container.style.cursor = this.options.cursor;
47310
- },
47311
- /**
47312
- * Restore status quo cursor
47313
- */
47314
- _restoreCursor: function() {
47315
- this._container.style.cursor = this._beforeCursor, this._beforeCursor = null;
47316
- },
47317
- /**
47318
- * @override
47319
- */
47320
- _onMouseUp: function(t) {
47321
- this._finish();
47322
- var e = this._map, i = this._lastLayerPoint;
47323
- if (!(!i || this._startLayerPoint.equals(i))) {
47324
- s$3.DomEvent.stop(t);
47325
- var o = e.layerPointToLatLng(this._startLayerPoint), a = e.layerPointToLatLng(i), n = new s$3.LatLngBounds(o, a);
47326
- this._autoDisable ? this.disable() : this._restoreCursor(), this._moved = false, s$3.Util.requestAnimFrame(function() {
47327
- e.fire(s$3.Map.SelectArea.SELECT_AREA_SELECTED, {
47328
- bounds: n,
47329
- start: o,
47330
- end: a
47331
- });
47332
- });
47333
- }
47334
- }
47335
- });
47336
- s$3.Map.mergeOptions({
47337
- selectArea: false
47338
- });
47339
- s$3.Map.addInitHook("addHandler", "selectArea", s$3.Map.SelectArea);
47340
- const l = s$3.Map.SelectArea;
47341
-
47342
- var index$1 = /*#__PURE__*/Object.freeze({
47343
- __proto__: null,
47344
- default: l
47345
- });
47346
-
47347
- leafletSrcExports.SVG.include({
47348
- /**
47349
- * Reset transform matrix
47350
- */
47351
- _resetTransformPath: function(t) {
47352
- t._path.setAttributeNS(null, "transform", "");
47353
- },
47354
- /**
47355
- * Applies matrix transformation to SVG
47356
- * @param {L.Path} layer
47357
- * @param {Array.<Number>} matrix
47358
- */
47359
- transformPath: function(t, i) {
47360
- t._path.setAttributeNS(
47361
- null,
47362
- "transform",
47363
- "matrix(" + i.join(" ") + ")"
47364
- );
47365
- }
47366
- });
47367
- leafletSrcExports.SVG.include(
47368
- leafletSrcExports.Browser.vml ? {
47369
- /**
47370
- * Reset transform matrix
47371
- */
47372
- _resetTransformPath: function(t) {
47373
- t._skew && (t._skew.on = false, t._path.removeChild(t._skew), t._skew = null);
47374
- },
47375
- /**
47376
- * Applies matrix transformation to VML
47377
- * @param {L.Path} layer
47378
- * @param {Array.<Number>} matrix
47379
- */
47380
- transformPath: function(t, i) {
47381
- let n = t._skew;
47382
- n || (n = leafletSrcExports.SVG.create("skew"), t._path.appendChild(n), n.style.behavior = "url(#default#VML)", t._skew = n);
47383
- const a = i[0].toFixed(8) + " " + i[1].toFixed(8) + " " + i[2].toFixed(8) + " " + i[3].toFixed(8) + " 0 0", r = Math.floor(i[4]).toFixed() + ", " + Math.floor(i[5]).toFixed(), s = this._path.style;
47384
- let e = parseFloat(s.left), o = parseFloat(s.top), _ = parseFloat(s.width), p = parseFloat(s.height);
47385
- isNaN(e) && (e = 0), isNaN(o) && (o = 0), (isNaN(_) || !_) && (_ = 1), (isNaN(p) || !p) && (p = 1);
47386
- const u = (-e / _ - 0.5).toFixed(8) + " " + (-o / p - 0.5).toFixed(8);
47387
- n.on = "f", n.matrix = a, n.origin = u, n.offset = r, n.on = true;
47388
- }
47389
- } : {}
47390
- );
47391
- function E() {
47392
- return true;
47393
- }
47394
- leafletSrcExports.Canvas.include({
47395
- /**
47396
- * Do nothing
47397
- * @param {L.Path} layer
47398
- */
47399
- _resetTransformPath: function(t) {
47400
- this._containerCopy && (delete this._containerCopy, t._containsPoint_ && (t._containsPoint = t._containsPoint_, delete t._containsPoint_, this._requestRedraw(t)));
47401
- },
47402
- /**
47403
- * Algorithm outline:
47404
- *
47405
- * 1. pre-transform - clear the path out of the canvas, copy canvas state
47406
- * 2. at every frame:
47407
- * 2.1. save
47408
- * 2.2. redraw the canvas from saved one
47409
- * 2.3. transform
47410
- * 2.4. draw path
47411
- * 2.5. restore
47412
- * 3. Repeat
47413
- *
47414
- * @param {L.Path} layer
47415
- * @param {Array.<Number>} matrix
47416
- */
47417
- transformPath: function(t, i) {
47418
- let n = this._containerCopy;
47419
- const a = this._ctx;
47420
- let r;
47421
- const s = leafletSrcExports.Browser.retina ? 2 : 1, e = this._bounds, o = e.getSize(), _ = e.min;
47422
- n || (n = this._containerCopy = document.createElement("canvas"), r = n.getContext("2d"), n.width = s * o.x, n.height = s * o.y, this._removePath(t), this._redraw(), r.translate(s * e.min.x, s * e.min.y), r.drawImage(this._container, 0, 0), this._initPath(t), t._containsPoint_ = t._containsPoint, t._containsPoint = E), a.save(), a.clearRect(_.x, _.y, o.x * s, o.y * s), a.setTransform(1, 0, 0, 1, 0, 0), a.restore(), a.save(), a.drawImage(this._containerCopy, 0, 0, o.x, o.y), a.transform.apply(a, i), this._drawing = true, t._updatePath(), this._drawing = false, a.restore();
47423
- }
47424
- });
47425
- /**
47426
- * Leaflet vector features drag functionality
47427
- * @author Alexander Milevski <info@w8r.name>
47428
- * @preserve
47429
- */
47430
- leafletSrcExports.Path.include({
47431
- /**
47432
- * Applies matrix transformation to SVG
47433
- * @param {Array.<Number>?} matrix
47434
- */
47435
- _transform: function(t) {
47436
- return this._renderer && (t ? this._renderer.transformPath(this, t) : (this._renderer._resetTransformPath(this), this._update())), this;
47437
- },
47438
- /**
47439
- * Check if the feature was dragged, that'll supress the click event
47440
- * on mouseup. That fixes popups for example
47441
- *
47442
- * @param {MouseEvent} e
47443
- */
47444
- _onMouseClick: function(t) {
47445
- this.dragging && this.dragging.moved() || this._map.dragging && this._map.dragging.moved() || this._fireMouseEvent(t);
47446
- }
47447
- });
47448
- const S = {
47449
- mousedown: "mouseup",
47450
- touchstart: "touchend",
47451
- pointerdown: "touchend",
47452
- MSPointerDown: "touchend"
47453
- }, M = {
47454
- mousedown: "mousemove",
47455
- touchstart: "touchmove",
47456
- pointerdown: "touchmove",
47457
- MSPointerDown: "touchmove"
47458
- };
47459
- function k(t, i) {
47460
- const n = t.x - i.x, a = t.y - i.y;
47461
- return Math.sqrt(n * n + a * a);
47462
- }
47463
- leafletSrcExports.Handler.PathDrag = leafletSrcExports.Handler.extend(
47464
- /** @lends L.Path.Drag.prototype */
47465
- {
47466
- statics: {
47467
- DRAGGING_CLS: "leaflet-path-draggable"
47468
- },
47469
- /**
47470
- * @param {L.Path} path
47471
- * @constructor
47472
- */
47473
- initialize: function(t) {
47474
- this._path = t, this._matrix = null, this._startPoint = null, this._dragStartPoint = null, this._mapDraggingWasEnabled = false, this._path._dragMoved = false;
47475
- },
47476
- /**
47477
- * Enable dragging
47478
- */
47479
- addHooks: function() {
47480
- this._path.on("mousedown", this._onDragStart, this), this._path.options.className = this._path.options.className ? this._path.options.className + " " + leafletSrcExports.Handler.PathDrag.DRAGGING_CLS : leafletSrcExports.Handler.PathDrag.DRAGGING_CLS, this._path._path && leafletSrcExports.DomUtil.addClass(this._path._path, leafletSrcExports.Handler.PathDrag.DRAGGING_CLS);
47481
- },
47482
- /**
47483
- * Disable dragging
47484
- */
47485
- removeHooks: function() {
47486
- this._path.off("mousedown", this._onDragStart, this), this._path.options.className = this._path.options.className.replace(
47487
- new RegExp("\\s+" + leafletSrcExports.Handler.PathDrag.DRAGGING_CLS),
47488
- ""
47489
- ), this._path._path && leafletSrcExports.DomUtil.removeClass(this._path._path, leafletSrcExports.Handler.PathDrag.DRAGGING_CLS);
47490
- },
47491
- /**
47492
- * @return {Boolean}
47493
- */
47494
- moved: function() {
47495
- return this._path._dragMoved;
47496
- },
47497
- /**
47498
- * Start drag
47499
- * @param {L.MouseEvent} evt
47500
- */
47501
- _onDragStart: function(t) {
47502
- const i = t.originalEvent._simulated ? "touchstart" : t.originalEvent.type;
47503
- this._mapDraggingWasEnabled = false, this._startPoint = t.containerPoint.clone(), this._dragStartPoint = t.containerPoint.clone(), this._matrix = [1, 0, 0, 1, 0, 0], leafletSrcExports.DomEvent.stop(t.originalEvent), leafletSrcExports.DomUtil.addClass(this._path._renderer._container, "leaflet-interactive"), leafletSrcExports.DomEvent.on(document, M[i], this._onDrag, this).on(
47504
- document,
47505
- S[i],
47506
- this._onDragEnd,
47507
- this
47508
- ), this._path._map.dragging.enabled() && (this._path._map.dragging.disable(), this._mapDraggingWasEnabled = true), this._path._dragMoved = false, this._path._popup && this._path._popup.close(), this._replaceCoordGetters(t);
47509
- },
47510
- /**
47511
- * Dragging
47512
- * @param {L.MouseEvent} evt
47513
- */
47514
- _onDrag: function(t) {
47515
- leafletSrcExports.DomEvent.stop(t);
47516
- const i = t.touches && t.touches.length >= 1 ? t.touches[0] : t, n = this._path._map.mouseEventToContainerPoint(i);
47517
- if (t.type === "touchmove" && !this._path._dragMoved && this._dragStartPoint.distanceTo(n) <= this._path._map.options.tapTolerance)
47518
- return;
47519
- const a = n.x, r = n.y, s = a - this._startPoint.x, e = r - this._startPoint.y;
47520
- (s || e) && (this._path._dragMoved || (this._path._dragMoved = true, this._path.options.interactive = false, this._path._map.dragging._draggable._moved = true, this._path.fire("dragstart", t), this._path.bringToFront()), this._matrix[4] += s, this._matrix[5] += e, this._startPoint.x = a, this._startPoint.y = r, this._path.fire("predrag", t), this._path._transform(this._matrix), this._path.fire("drag", t));
47521
- },
47522
- /**
47523
- * Dragging stopped, apply
47524
- * @param {L.MouseEvent} evt
47525
- */
47526
- _onDragEnd: function(t) {
47527
- const i = this._path._map.mouseEventToContainerPoint(t), n = this.moved();
47528
- if (n && (this._transformPoints(this._matrix), this._path._updatePath(), this._path._project(), this._path._transform(null), leafletSrcExports.DomEvent.stop(t)), leafletSrcExports.DomEvent.off(document, "mousemove touchmove", this._onDrag, this), leafletSrcExports.DomEvent.off(document, "mouseup touchend", this._onDragEnd, this), this._restoreCoordGetters(), n) {
47529
- this._path.fire("dragend", {
47530
- distance: k(this._dragStartPoint, i)
47531
- });
47532
- const a = this._path._containsPoint;
47533
- this._path._containsPoint = leafletSrcExports.Util.falseFn, leafletSrcExports.Util.requestAnimFrame(function() {
47534
- this._path._dragMoved = false, this._path.options.interactive = true, this._path._containsPoint = a;
47535
- }, this);
47536
- }
47537
- this._mapDraggingWasEnabled && this._path._map.dragging.enable();
47538
- },
47539
- /**
47540
- * Applies transformation, does it in one sweep for performance,
47541
- * so don't be surprised about the code repetition.
47542
- *
47543
- * [ x ] [ a b tx ] [ x ] [ a * x + b * y + tx ]
47544
- * [ y ] = [ c d ty ] [ y ] = [ c * x + d * y + ty ]
47545
- *
47546
- * @param {Array.<Number>} matrix
47547
- */
47548
- _transformPoints: function(t, i) {
47549
- const n = this._path, a = L.point(t[4], t[5]), r = n._map.options.crs, s = r.transformation, e = r.scale(n._map.getZoom()), o = r.projection, _ = s.untransform(a, e).subtract(s.untransform(leafletSrcExports.point(0, 0), e)), p = !i;
47550
- if (n._bounds = new leafletSrcExports.LatLngBounds(), n._point)
47551
- i = o.unproject(
47552
- o.project(n._latlng)._add(_)
47553
- ), p && (n._latlng = i, n._point._add(a));
47554
- else if (n._rings || n._parts) {
47555
- const u = n._rings || n._parts;
47556
- let c = n._latlngs;
47557
- i = i || c, leafletSrcExports.Util.isArray(c[0]) || (c = [c], i = [i]);
47558
- for (let g = 0, w = u.length; g < w; g++) {
47559
- i[g] = i[g] || [];
47560
- for (let d = 0, v = u[g].length; d < v; d++) {
47561
- const b = c[g][d];
47562
- i[g][d] = o.unproject(
47563
- o.project(b)._add(_)
47564
- ), p && (n._bounds.extend(c[g][d]), u[g][d]._add(a));
47565
- }
47566
- }
47567
- }
47568
- return i;
47569
- },
47570
- /**
47571
- * If you want to read the latlngs during the drag - your right,
47572
- * but they have to be transformed
47573
- */
47574
- _replaceCoordGetters: function() {
47575
- this._path.getLatLng ? (this._path.getLatLng_ = this._path.getLatLng, this._path.getLatLng = leafletSrcExports.Util.bind(function() {
47576
- return this.dragging._transformPoints(this.dragging._matrix, {});
47577
- }, this._path)) : this._path.getLatLngs && (this._path.getLatLngs_ = this._path.getLatLngs, this._path.getLatLngs = leafletSrcExports.Util.bind(function() {
47578
- return this.dragging._transformPoints(this.dragging._matrix, []);
47579
- }, this._path));
47580
- },
47581
- /**
47582
- * Put back the getters
47583
- */
47584
- _restoreCoordGetters: function() {
47585
- this._path.getLatLng_ ? (this._path.getLatLng = this._path.getLatLng_, delete this._path.getLatLng_) : this._path.getLatLngs_ && (this._path.getLatLngs = this._path.getLatLngs_, delete this._path.getLatLngs_);
47586
- }
47587
- }
47588
- );
47589
- leafletSrcExports.Handler.PathDrag.makeDraggable = function(t) {
47590
- return t.dragging = new leafletSrcExports.Handler.PathDrag(t), t;
47591
- };
47592
- leafletSrcExports.Path.prototype.makeDraggable = function() {
47593
- return leafletSrcExports.Handler.PathDrag.makeDraggable(this);
47594
- };
47595
- leafletSrcExports.Path.addInitHook(function() {
47596
- this.options.draggable ? (this.options.interactive = true, this.dragging ? this.dragging.enable() : (leafletSrcExports.Handler.PathDrag.makeDraggable(this), this.dragging.enable())) : this.dragging && this.dragging.disable();
47597
- });
47598
- const T = leafletSrcExports.Handler.PathDrag;
47599
-
47600
- var index = /*#__PURE__*/Object.freeze({
47601
- __proto__: null,
47602
- default: T
47603
- });
47604
-
47605
- var leafletArrows$2 = {exports: {}};
47606
-
47607
- var hasRequiredLeafletArrows;
47608
-
47609
- function requireLeafletArrows () {
47610
- if (hasRequiredLeafletArrows) return leafletArrows$2.exports;
47611
- hasRequiredLeafletArrows = 1;
47612
- (function (module, exports$1) {
47613
- // Leaflet Arrows by Meteotest
47614
- // https://github.com/meteotest/leaflet-arrows
47615
- // Module Loader Boilerplate
47616
- (function (factory, window) {
47617
- // define an AMD module that relies on 'leaflet'
47618
- {
47619
- module.exports = factory(requireLeafletSrc());
47620
- }
47621
- // attach your plugin to the global 'L' variable
47622
- if (typeof window !== 'undefined' && window.L) {
47623
- window.L.Arrow = factory(L);
47624
- }
47625
- })(function (L) {
47626
- // beware! the arrow factory
47627
- const Arrow = L.FeatureGroup.extend({
47628
- options: {
47629
- distanceUnit: 'km', // can be [px,km]
47630
- stretchFactor: 1, // should the distance be stretched?
47631
- arrowheadLength: 4, // in distance unit
47632
- arrowheadClosingLine: false, // should a closing third line be drawn?
47633
- arrowheadDegree: 155, // degree of arrowhead
47634
- clickableWidth: 10, // defines the width in pixels of the "phantom" path to capture click events on a line
47635
- //optional: popupContent: function(data) {},
47636
- // add your own custom validator, probably not needed...
47637
- // the validator gets the bound data object as argument
47638
- validator: function (data) {
47639
- return (typeof data.latlng !== 'undefined' &&
47640
- typeof data.distance !== 'undefined' &&
47641
- !isNaN(data.distance));
47642
- }, // validator is a callback function that takes the data object of the current point and returns whether it is 'valid'. Invalid arrows will be drawn gray
47643
- colorScheme: function () {
47644
- return this.color;
47645
- }, // add own colorscheme callback
47646
- circleRadiusInvalidPoint: 1000, // Radius of the circle to display missing or '0'-value
47647
- // path options
47648
- color: '#333',
47649
- opacity: 0.9, // stroke opacity
47650
- fillOpacity: 0.9,
47651
- weight: 4, // the width of the arrow
47652
- smoothFactor: 0,
47653
- radius: 5, // default radius, when distance is 0
47654
- defaultPointOptions: {
47655
- stroke: false,
47656
- fillOpacity: 0.8,
47657
- fillColor: '#111',
47658
- radius: 7,
47659
- },
47660
- invalidPointOptions: {
47661
- stroke: false,
47662
- fillOpacity: 0.8,
47663
- fillColor: 'red',
47664
- radius: 7,
47665
- },
47666
- drawSourceMarker: false,
47667
- sourceMarkerOptions: {
47668
- stroke: false,
47669
- fillOpacity: 1,
47670
- fillColor: '#333',
47671
- radius: 5,
47672
- },
47673
- },
47674
- /**
47675
- * The data opject needs at least following properties:
47676
- * - latlng : L.LatLng
47677
- * - degree : float
47678
- * - distance: float
47679
- */
47680
- initialize: function (data, options) {
47681
- L.Util.setOptions(this, options);
47682
- this.setData(data);
47683
- },
47684
- onAdd: function (map) {
47685
- this._map = map;
47686
- this.redraw();
47687
- // add a viewreset event listener for updating layer's position
47688
- map.on('viewreset', this._reset, this);
47689
- },
47690
- onRemove: function () {
47691
- // remove layer's DOM elements and listeners
47692
- for (const i in this._layers) {
47693
- if (this._layers.hasOwnProperty(i)) {
47694
- this._map.removeLayer(this._layers[i]);
47695
- }
47696
- }
47697
- if (typeof this._sourceMarker !== 'undefined') {
47698
- this._map.removeLayer(this._sourceMarker);
47699
- }
47700
- this._map.off('viewreset', this._reset, this);
47701
- },
47702
- // draw
47703
- redraw: function () {
47704
- // only draw when on map
47705
- if (!this._map) {
47706
- return;
47707
- }
47708
- this._layers = {};
47709
- // bind popup to the whole feature group
47710
- if (typeof this.options.popupContent === 'function') {
47711
- this.bindPopup(this.options.popupContent(this._data));
47712
- }
47713
- if (this._data.valid && typeof this.options.colorScheme === 'function') {
47714
- this.options.color = this.options.colorScheme(this._data);
47715
- }
47716
- this._data.distance = parseFloat(this._data.distance);
47717
- // if distance or degree is falsy/Zero then draw a point instead of an arrow
47718
- if (!this._data.valid || !this._data.distance || !this._data.angle) {
47719
- let circle;
47720
- const pathOptions = this._data.valid
47721
- ? this.options.defaultPointOptions
47722
- : this.options.invalidPointOptions;
47723
- if (this.options.distanceUnit.toLowerCase() === 'km') {
47724
- // use a tenth of the supplied radius (usally used in the circlemarker)
47725
- circle = L.circle(this._data.latlng, this.options.radius / 10, pathOptions);
47726
- }
47727
- else {
47728
- circle = L.circleMarker(this._data.latlng, pathOptions);
47729
- }
47730
- this.addLayer(circle);
47731
- }
47732
- else {
47733
- const theLine = [
47734
- this._data.latlng,
47735
- this._calculateEndPoint(this._data.latlng, this._data.distance, this._data.angle),
47736
- ];
47737
- const theArrow = this._calculateArrowArray(theLine[1]);
47738
- const backgroundPathOption = L.Util.setOptions({}, this.pathOptions);
47739
- backgroundPathOption.opacity = 0;
47740
- backgroundPathOption.weight = this.options.clickableWidth;
47741
- const invisibleBackgroundPolyline = new L.Polyline([theLine, theArrow], backgroundPathOption);
47742
- const polyline = new L.Polyline([theLine, theArrow], this.options);
47743
- this.addLayer(invisibleBackgroundPolyline);
47744
- this.addLayer(polyline);
47745
- // that special case, where a circle has to be drawn on the source of the arrow
47746
- if (this.options.drawSourceMarker) {
47747
- if (typeof this._sourceMarker === 'undefined') {
47748
- // use the same coloar as the arrow does
47749
- this.options.sourceMarkerOptions.fillColor = this.color;
47750
- this._sourceMarker = L.circleMarker(this._data.latlng, this.options.sourceMarkerOptions);
47751
- }
47752
- else {
47753
- // there is a chance, that the latlng values have been changed by the setData-function
47754
- this._sourceMarker.setLatLng(this._data.latlng);
47755
- }
47756
- }
47757
- }
47758
- },
47759
- // custom methods
47760
- // just change the angle of the arrow
47761
- setAngle: function (angle) {
47762
- if (isNaN(angle)) {
47763
- this._data.angle = 0; // undefined direction.
47764
- }
47765
- else {
47766
- if (this.options.isWindDegree) {
47767
- this._data.angle = angle - 180;
47768
- if (this.options.distanceUnit.toLowerCase() === 'px') {
47769
- this._data.angle -= 90;
47770
- }
47771
- }
47772
- else {
47773
- this._data.angle = angle;
47774
- }
47775
- }
47776
- this.redraw();
47777
- },
47778
- // just change the length of the arrow
47779
- setDistance: function (distance) {
47780
- if (isNaN(distance)) {
47781
- this._data.distance = 0;
47782
- }
47783
- else {
47784
- this._data.distance = parseFloat(distance);
47785
- }
47786
- this.redraw();
47787
- },
47788
- // use this method to update the whole dataset that corresponds to the arrow
47789
- setData: function (data) {
47790
- this._data = data;
47791
- if (this.options.validator(this._data)) {
47792
- this._data.valid = true;
47793
- this.setAngle(data.degree);
47794
- }
47795
- else {
47796
- this._data.valid = false;
47797
- this._data.distance = NaN;
47798
- this._data.degree = NaN;
47799
- }
47800
- },
47801
- // private methods
47802
- // When using Screen Pixels as unit, the arrows have to be
47803
- // recalculated after the zoom level has changed
47804
- _reset: function () {
47805
- if (this.options.distanceUnit.toLowerCase() === 'px') {
47806
- this.redraw();
47807
- }
47808
- },
47809
- _calculateEndPoint: function (latlng, dist, degree) {
47810
- /*
47811
- * http://www.codeguru.com/cpp/cpp/algorithms/article.php/c5115/Geographic-Distance-and-Azimuth-Calculations.htm
47812
- */
47813
- // don't use this._data here.
47814
- // this function is also used to find the points of the arrow
47815
- let distance = dist * this.options.stretchFactor, d2r = Math.PI / 180, // degree 2 radius
47816
- r2d = 180 / Math.PI;
47817
- if (this.options.distanceUnit.toLowerCase() === 'km') {
47818
- const R = 6378.137, // earth radius in kmeters
47819
- bearing = degree * d2r;
47820
- distance = distance / R;
47821
- const a = Math.acos(Math.cos(distance) * Math.cos((90 - latlng.lat) * d2r) +
47822
- Math.sin((90 - latlng.lat) * d2r) *
47823
- Math.sin(distance) *
47824
- Math.cos(bearing));
47825
- const B = Math.asin((Math.sin(distance) * Math.sin(bearing)) / Math.sin(a));
47826
- return new L.LatLng(90 - a * r2d, B * r2d + latlng.lng);
47827
- }
47828
- else if (this.options.distanceUnit.toLowerCase() === 'px') {
47829
- const sourcePoint = this._map.latLngToLayerPoint(latlng);
47830
- const rad = degree * d2r;
47831
- const vector = L.point(Math.cos(rad) * distance, Math.sin(rad) * distance);
47832
- const targetPoint = sourcePoint.add(vector);
47833
- return this._map.layerPointToLatLng(targetPoint);
47834
- }
47835
- else {
47836
- throw Error('calculate end point undefined for distanceUnit: ' +
47837
- this.options.distanceUnit);
47838
- }
47839
- },
47840
- _calculateArrowArray: function (latlng) {
47841
- // calculates the Array for the arrow
47842
- // latlng is the position, where the arrow is added
47843
- const degree = this._data.angle;
47844
- if (latlng.length !== undefined) {
47845
- latlng = new L.LatLng(latlng);
47846
- }
47847
- const firstEdge = this._calculateEndPoint(latlng, this.options.arrowheadLength, degree - this.options.arrowheadDegree);
47848
- const arr = [
47849
- firstEdge,
47850
- latlng,
47851
- this._calculateEndPoint(latlng, this.options.arrowheadLength, degree + this.options.arrowheadDegree),
47852
- ];
47853
- if (this.options.arrowheadClosingLine) {
47854
- arr.push(firstEdge);
47855
- }
47856
- return arr;
47857
- },
47858
- });
47859
- return Arrow;
47860
- }, window);
47861
-
47862
- } (leafletArrows$2));
47863
- return leafletArrows$2.exports;
47864
- }
47865
-
47866
- var leafletArrowsExports = requireLeafletArrows();
47867
- var leafletArrows = /*@__PURE__*/getDefaultExportFromCjs(leafletArrowsExports);
47868
-
47869
- var leafletArrows$1 = /*#__PURE__*/_mergeNamespaces({
47870
- __proto__: null,
47871
- default: leafletArrows
47872
- }, [leafletArrowsExports]);
47873
-
47874
46835
  // define() gets called for each chunk generated by the first Rollup pass.
47875
46836
  // The order the chunks are called in is controlled by the imports in bundle.js:
47876
46837
  //