/**
 * Minified by jsDelivr using Terser v5.19.2.
 * Original file: /npm/@jjwtay/leaflet.ellipse@2.0.1/leaflet.ellipse.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},objectWithoutProperties=function(t,e){var i={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i},RAD_TO_DEG=180/Math.PI,DEG_TO_RAD=Math.PI/180,wrapBrg=function t(e){return e<0?t(e+=360):e>360&&t(e-=360),e},atan2d=function(t,e){return RAD_TO_DEG*Math.atan2(t,e)},closeToZero=function(t){return Math.abs(t)<1e-10?0:t};L.Ellipse=L.Polygon.extend({options:{weight:5,color:"#ffff00",stroke:!0},initialize:function(t){var e=t.center,i=void 0===e?[0,0]:e,n=t.semiMinor,r=void 0===n?100:n,s=t.semiMajor,o=void 0===s?200:s,a=t.bearing,h=void 0===a?0:a,u=t.numberOfPoints,M=void 0===u?61:u,c=objectWithoutProperties(t,["center","semiMinor","semiMajor","bearing","numberOfPoints"]);this.setOptions(c).setCenter(i).setSemiMinor(r).setSemiMajor(o).setBearing(h).setNumberOfPoints(M),this.setLatLngs(),this.setRhumb()},setCenter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lat:0,lng:0};return this._center=L.latLng(t),this.redraw()},getCenter:function(){return this._center},setSemiMinor:function(t){return this._semiMinor=t,this.redraw()},getSemiMinor:function(){return this._semiMinor},setSemiMajor:function(t){return this._semiMajor=t,this.redraw()},getSemiMajor:function(){return this._semiMajor},setBearing:function(t){return this._bearing=t,this.redraw()},getBearing:function(){return this._bearing},getNumberOfPoints:function(){return this._numberOfPoints},setNumberOfPoints:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;return this._numberOfPoints=Math.max(10,t),this.redraw()},getRhumb:function(){return this._rhumb},setRhumb:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:45;return this._rhumb=t,this.redraw()},getOptions:function(){return this.options},setOptions:function(t){var e=t||{};return L.setOptions(this,e),this.redraw()},getLatLngs:function(){var t=void 0,e=void 0,i=void 0,n=[],r=wrapBrg(this.getBearing()),s=360/(this._numberOfPoints-1);this._semiMinor===this._semiMajor&&(r=0);for(var o=wrapBrg(r),a=0;a<this._numberOfPoints;a++){(t=a*s)>=360&&(t-=360),i=this._semiMinor*Math.sin(t*DEG_TO_RAD),e=this._semiMajor*Math.cos(t*DEG_TO_RAD);var h=closeToZero(this._semiMinor!==this._semiMajor?atan2d(i,e):a*s),u=Math.sqrt(e*e+i*i),M=this.computeDestinationPos(this.getCenter(),u,o+h);n.push(M)}return n},getPos:function(t,e,i,n,r){var s=n*Math.cos(e*DEG_TO_RAD),o=r*Math.sin(e*DEG_TO_RAD),a=closeToZero(n!==r?atan2d(s,o):-e),h=Math.sqrt(o*o+s*s);return this.computeDestinationPos(t,h,i+a)},getLatRadius:function(){return this._semiMinor/40075017*360},getLngRadius:function(){return this._semiMajor/40075017*360/Math.cos(Math.PI/180*this._latlngs.lat)},setLatLngs:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLatLngs();return this._setLatLngs(t),this.redraw()},setStyle:L.Path.prototype.setStyle,computeDestinationPos:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lat:0,lng:0},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6378137,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)*Math.PI/180,r=t.lat*Math.PI/180,s=t.lng*Math.PI/180,o=Math.asin(Math.sin(r)*Math.cos(e/i)+Math.cos(r)*Math.sin(e/i)*Math.cos(n)),a=s+Math.atan2(Math.sin(n)*Math.sin(e/i)*Math.cos(r),Math.cos(e/i)-Math.sin(r)*Math.sin(o));return{lat:o=180*o/Math.PI,lng:a=180*a/Math.PI}}}),L.ellipse=function(t){var e=t.center,i=void 0===e?[0,0]:e,n=t.semiMinor,r=void 0===n?100:n,s=t.semiMajor,o=void 0===s?200:s,a=t.bearing,h=void 0===a?0:a,u=objectWithoutProperties(t,["center","semiMinor","semiMajor","bearing"]);return new L.Ellipse(_extends({center:i,semiMinor:r,semiMajor:o,bearing:h},u))};
//# sourceMappingURL=/sm/87b6453aedc552000c78d3dbe36f56a75eaa00f62cf6ebad63616963d59d6f6b.map