@summeruse/ol 0.4.1 → 0.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @summeruse/ol
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 054bfbf: 修复 xyz,pmtiles 图层坐标系未导入
8
+
3
9
  ## 0.4.1
4
10
 
5
11
  ### Patch Changes
@@ -1,4 +1,4 @@
1
1
  this.SummerUse=this.SummerUse||{},this.SummerUse.ol=(function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=Object.create,v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,x=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,C=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=b(t),a=0,o=i.length,s;a<o;a++)s=i[a],!S.call(e,s)&&s!==n&&v(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=y(t,s))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:_(x(e)),C(t||!e||!e.__esModule?v(n,`default`,{value:e,enumerable:!0}):n,e));s=w(s),c=w(c),d=w(d),p=w(p);let T=Symbol(`olMapInjectionKey`);function E(){return(0,t.inject)(T)}var D=(0,t.defineComponent)({name:`OlMap`,__name:`index`,props:{olMap:{default:()=>new n.Map},center:{default:()=>[0,0]},zoom:{default:2},minZoom:{default:2},maxZoom:{default:18},constrainResolution:{type:Boolean,default:!0},projection:{},extent:{},showZoom:{type:Boolean,default:!1},showAttribution:{type:Boolean,default:!1},showRotate:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!1},showOverview:{type:Boolean,default:!1},showScale:{type:Boolean,default:!1},dragPan:{type:Boolean,default:!0},mouseWheelZoom:{type:Boolean,default:!0},doubleClickZoom:{type:Boolean,default:!1},pinchRotate:{type:Boolean},pinchZoom:{type:Boolean},altShiftDragRotate:{type:Boolean}},emits:[`update:zoom`,`update:center`,`changeResolution`,`changeCenter`,`moveend`,`movestart`],setup(e,{expose:a,emit:o}){let s=e,c=o,l=(0,t.ref)(),u=s.olMap,d=new n.View({projection:s.projection,extent:s.extent});u.setView(d),d.setZoom(s.zoom),d.setCenter(s.center),(0,t.watch)(()=>s.constrainResolution,e=>{d.setConstrainResolution(e)},{immediate:!0}),(0,t.watch)(()=>s.minZoom,e=>{e&&d.setMinZoom(e)},{immediate:!0}),(0,t.watch)(()=>s.maxZoom,e=>{e&&d.setMaxZoom(e)},{immediate:!0}),(0,t.watch)(l,e=>{e&&u.setTarget(e)}),a({olMap:u}),(0,t.provide)(T,u);let f=u.getControls().getArray(),p=f.find(e=>e instanceof r.Zoom)||new r.Zoom,m=f.find(e=>e instanceof r.Attribution)||new r.Attribution,h=f.find(e=>e instanceof r.Rotate)||new r.Rotate,g=f.find(e=>e instanceof r.FullScreen)||new r.FullScreen,_=f.find(e=>e instanceof r.OverviewMap)||new r.OverviewMap,v=f.find(e=>e instanceof r.ScaleLine)||new r.ScaleLine;(0,t.watch)(()=>s.showZoom,e=>{p.setMap(e?u:null)},{immediate:!0}),(0,t.watch)(()=>s.showAttribution,e=>{m.setMap(e?u:null)},{immediate:!0}),(0,t.watch)(()=>s.showRotate,e=>{h.setMap(e?u:null)},{immediate:!0}),(0,t.watch)(()=>s.showFullScreen,e=>{g.setMap(e?u:null)},{immediate:!0}),(0,t.watch)(()=>s.showOverview,e=>{_.setMap(e?u:null)},{immediate:!0}),(0,t.watch)(()=>s.showScale,e=>{v.setMap(e?u:null)},{immediate:!0});let y=u.getInteractions().getArray(),b=y.find(e=>e instanceof i.DragPan)||new i.DragPan,x=y.find(e=>e instanceof i.MouseWheelZoom)||new i.MouseWheelZoom,S=y.find(e=>e instanceof i.DoubleClickZoom)||new i.DoubleClickZoom,C=y.find(e=>e instanceof i.PinchRotate)||new i.PinchRotate,w=y.find(e=>e instanceof i.PinchZoom)||new i.PinchZoom,E=y.find(e=>e instanceof i.DragRotate)||new i.DragRotate,D=y.find(e=>e instanceof i.KeyboardPan)||new i.KeyboardPan,ee=y.find(e=>e instanceof i.KeyboardZoom)||new i.KeyboardZoom;u.removeInteraction(b),u.addInteraction(b),u.removeInteraction(x),u.addInteraction(x),u.removeInteraction(S),u.addInteraction(S),u.removeInteraction(C),u.addInteraction(C),u.removeInteraction(w),u.addInteraction(w),u.removeInteraction(E),u.addInteraction(E),u.removeInteraction(D),u.removeInteraction(ee),(0,t.watch)(()=>s.dragPan,e=>{b.setActive(e)},{immediate:!0}),(0,t.watch)(()=>s.mouseWheelZoom,e=>{x.setActive(e)},{immediate:!0}),(0,t.watch)(()=>s.doubleClickZoom,e=>{S.setActive(e)},{immediate:!0}),(0,t.watch)(()=>s.pinchRotate,e=>{C.setActive(e)},{immediate:!0}),(0,t.watch)(()=>s.pinchZoom,e=>{w.setActive(e)},{immediate:!0}),(0,t.watch)(()=>s.altShiftDragRotate,e=>{E.setActive(e)},{immediate:!0});function O(e){c(`update:zoom`,Math.floor(d.getZoom()||0)),c(`changeResolution`,e)}(0,t.onMounted)(()=>{d.on(`change:resolution`,O)}),(0,t.onUnmounted)(()=>{d.un(`change:resolution`,O)});function k(e){c(`update:center`,d.getCenter()||[0,0]),c(`changeCenter`,e)}(0,t.onMounted)(()=>{d.on(`change:center`,k)}),(0,t.onUnmounted)(()=>{d.un(`change:center`,k)});function te(e){c(`movestart`,e)}(0,t.onMounted)(()=>{u.on(`movestart`,te)}),(0,t.onUnmounted)(()=>{u.un(`movestart`,te)});function ne(e){c(`moveend`,e)}return(0,t.onMounted)(()=>{u.on(`moveend`,ne)}),(0,t.onUnmounted)(()=>{u.un(`moveend`,ne)}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`mapRef`,ref:l},[(0,t.renderSlot)(e.$slots,`default`,{olMap:(0,t.unref)(u),mapRef:l.value})],512))}});function ee(e,n){let r=(0,t.ref)(!1),i=(0,t.ref)({x:0,y:0}),a=(0,t.ref)(),o=(0,t.ref)([]),s=(0,t.ref)(),c;function l(e,t){let n=[];return e.filter(e=>{let n=e.visible;return typeof n==`function`?n(t):n??!0}).filter(e=>!e.children||e.children.length>0).sort((e,t)=>(e.order??0)-(t.order??0)).forEach(e=>{let r=e.icon,i=e.label;n.push({...e,children:e.children?l(e.children,t):void 0,visible:!0,action:()=>{e.action?.(t),d()},icon:typeof r==`function`?()=>r(t):r,label:typeof i==`function`?()=>i(t):i,disabled:typeof e.disabled==`function`?e.disabled(t):e.disabled??!1})}),n}function u(e){if(e.preventDefault(),!c)return;let u=c.getEventCoordinate(e);s.value=u;let d=c.getEventPixel(e),f,p;c.forEachFeatureAtPixel(d,(e,t)=>(f=e,p=t,!0)),a.value=f;let[m,h]=[e.clientX,e.clientY];i.value={x:m,y:h},o.value=l((0,t.toValue)(n),{map:c,position:{...i.value},coordinate:u,feature:f,layer:p}),r.value=!0}function d(){r.value=!1}function f(e){if(!e)return;let t=e.getViewport();t.addEventListener(`contextmenu`,u),t.addEventListener(`click`,d)}function p(e){if(!e)return;let t=e.getViewport();t.removeEventListener(`contextmenu`,u),t.removeEventListener(`click`,d)}return(0,t.watch)(()=>(0,t.toValue)(e),(e,t)=>{t!==e&&(p(t),f(e),c=e)},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{p(c)}),{visible:(0,t.computed)(()=>r.value),position:(0,t.computed)(()=>i.value),feature:(0,t.computed)(()=>a.value),options:(0,t.computed)(()=>o.value),coordinate:(0,t.computed)(()=>s.value),hide:d}}let O=1852,k=`EPSG:3857`,te=`EPSG:4326`,ne=`EPSG:3395`;function re(e){return e*1e3/O}function ie(e){return e*O/1e3}function ae(e){return e<0?ae(e+2*Math.PI):e>2*Math.PI?ae(e-2*Math.PI):e}function oe(e){return e<0?oe(e+360):e>=360?oe(e-360):e}function se(e){let{fillOptions:t,strokeOptions:n,...r}=e;return new l.Circle({...r,fill:t?new l.Fill(t):void 0,stroke:n?new l.Stroke(n):void 0})}function ce(e){let{fillOptions:t,strokeOptions:n,backgroundFillOptions:r,backgroundStrokeOptions:i,...a}=e;return new l.Text({...a,fill:t?new l.Fill(t):void 0,stroke:n?new l.Stroke(n):void 0,backgroundFill:r?new l.Fill(r):void 0,backgroundStroke:i?new l.Stroke(i):void 0})}function A(e){let{fillOptions:t,strokeOptions:n,iconOptions:r,circleOptions:i,textOptions:a,stroke:o,image:s,fill:c,text:u,...d}=e,f=c||(t?new l.Fill(t):void 0),p=o||(n?new l.Stroke(n):void 0),m=s||(r?new l.Icon(r):i?se(i):void 0),h=u||(a?ce(a):void 0);return new l.Style({...d,fill:f,stroke:p,image:m,text:h})}function le(e){return new o.Point(e)}function ue(e){return new o.LineString(e)}function de(e){return new o.Polygon(e)}function fe(e,t){return new o.Circle(e,t)}function pe(e){return new o.MultiPoint(e)}function me(e){return new o.MultiLineString(e)}function he(e){return new o.MultiPolygon(e)}function ge(e){let{styleOptions:t,style:r,geometry:i,...a}=e??{},o=t?A(t):r,s=new n.Feature({geometry:i,...a});return s.setStyle(o),s}function _e(e,t){let n=le(e);return ge({...t,geometry:n})}function ve(e,t){let n=ue(e);return ge({...t,geometry:n})}function ye(e,t){let n=de(e);return ge({...t,geometry:n})}function be(e,t,n){let r=fe(e,t);return ge({...n,geometry:r})}function xe(e,t){let n=pe(e);return ge({...t,geometry:n})}function Se(e,t){let n=me(e);return ge({...t,geometry:n})}function Ce(e,t){let n=he(e);return ge({...t,geometry:n})}var j=Uint8Array,we=Uint16Array,Te=Int32Array,Ee=new j([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),De=new j([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Oe=new j([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ke=function(e,t){for(var n=new we(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Te(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Ae=ke(Ee,2),je=Ae.b,Me=Ae.r;je[28]=258,Me[258]=28;var Ne=ke(De,0),Pe=Ne.b;Ne.r;for(var Fe=new we(32768),M=0;M<32768;++M){var Ie=(M&43690)>>1|(M&21845)<<1;Ie=(Ie&52428)>>2|(Ie&13107)<<2,Ie=(Ie&61680)>>4|(Ie&3855)<<4,Fe[M]=((Ie&65280)>>8|(Ie&255)<<8)>>1}for(var Le=(function(e,t,n){for(var r=e.length,i=0,a=new we(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new we(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new we(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[Fe[d]>>c]=l}else for(s=new we(r),i=0;i<r;++i)e[i]&&(s[i]=Fe[o[e[i]-1]++]>>15-e[i]);return s}),Re=new j(288),M=0;M<144;++M)Re[M]=8;for(var M=144;M<256;++M)Re[M]=9;for(var M=256;M<280;++M)Re[M]=7;for(var M=280;M<288;++M)Re[M]=8;for(var ze=new j(32),M=0;M<32;++M)ze[M]=5;var Be=Le(Re,9,1),Ve=Le(ze,5,1),He=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ue=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},We=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Ge=function(e){return(e+7)/8|0},Ke=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new j(e.subarray(t,n))},qe=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||qe[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},Je=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new j(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new j(i*3));var l=function(e){var t=n.length;if(e>t){var r=new j(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=Ue(e,d,1);var v=Ue(e,d+1,3);if(d+=3,v)if(v==1)p=Be,m=Ve,h=9,g=5;else if(v==2){var y=Ue(e,d,31)+257,b=Ue(e,d+10,15)+4,x=y+Ue(e,d+5,31)+1;d+=14;for(var S=new j(x),C=new j(19),w=0;w<b;++w)C[Oe[w]]=Ue(e,d+w*3,7);d+=b*3;for(var T=He(C),E=(1<<T)-1,D=Le(C,T,1),w=0;w<x;){var ee=D[Ue(e,d,E)];d+=ee&15;var O=ee>>4;if(O<16)S[w++]=O;else{var k=0,te=0;for(O==16?(te=3+Ue(e,d,3),d+=2,k=S[w-1]):O==17?(te=3+Ue(e,d,7),d+=3):O==18&&(te=11+Ue(e,d,127),d+=7);te--;)S[w++]=k}}var ne=S.subarray(0,y),re=S.subarray(y);h=He(ne),g=He(re),p=Le(ne,h,1),m=Le(re,g,1)}else N(1);else{var O=Ge(d)+4,ie=e[O-4]|e[O-3]<<8,ae=O+ie;if(ae>i){c&&N(0);break}s&&l(f+ie),n.set(e.subarray(O,ae),f),t.b=f+=ie,t.p=d=ae*8,t.f=u;continue}if(d>_){c&&N(0);break}}s&&l(f+131072);for(var oe=(1<<h)-1,se=(1<<g)-1,ce=d;;ce=d){var k=p[We(e,d)&oe],A=k>>4;if(d+=k&15,d>_){c&&N(0);break}if(k||N(2),A<256)n[f++]=A;else if(A==256){ce=d,p=null;break}else{var le=A-254;if(A>264){var w=A-257,ue=Ee[w];le=Ue(e,d,(1<<ue)-1)+je[w],d+=ue}var de=m[We(e,d)&se],fe=de>>4;de||N(3),d+=de&15;var re=Pe[fe];if(fe>3){var ue=De[fe];re+=We(e,d)&(1<<ue)-1,d+=ue}if(d>_){c&&N(0);break}s&&l(f+131072);var pe=f+le;if(f<re){var me=a-re,he=Math.min(re,pe);for(me+f<0&&N(3);f<he;++f)n[f]=r[me+f]}for(;f<pe;++f)n[f]=n[f-re]}}t.l=p,t.p=ce,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Ke(n,0,f):n.subarray(0,f)},Ye=new j(0),Xe=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&N(6,`invalid gzip data`);var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},Ze=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Qe=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&N(6,`invalid zlib data`),(e[1]>>5&1)==+!t&&N(6,`invalid zlib data: `+(e[1]&32?`need`:`unexpected`)+` dictionary`),(e[1]>>3&4)+2};function $e(e,t){return Je(e,{i:2},t&&t.out,t&&t.dictionary)}function et(e,t){var n=Xe(e);return n+8>e.length&&N(6,`invalid gzip data`),Je(e.subarray(n,-8),{i:2},t&&t.out||new j(Ze(e)),t&&t.dictionary)}function tt(e,t){return Je(e.subarray(Qe(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}function nt(e,t){return e[0]==31&&e[1]==139&&e[2]==8?et(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?$e(e,t):tt(e,t)}var rt=typeof TextDecoder<`u`&&new TextDecoder;try{rt.decode(Ye,{stream:!0})}catch{}var it=Object.defineProperty,at=Math.pow,P=(e,t)=>it(e,`name`,{value:t,configurable:!0}),F=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});P((e,t)=>{let n=!1,r=``;return new(L.GridLayer.extend({createTile:P((t,i)=>{let a=document.createElement(`img`),o=new AbortController,s=o.signal;return a.cancel=()=>{o.abort()},n||=(e.getHeader().then(e=>{e.tileType===1?console.error(`Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details.`):e.tileType===2?r=`image/png`:e.tileType===3?r=`image/jpeg`:e.tileType===4?r=`image/webp`:e.tileType===5&&(r=`image/avif`)}),!0),e.getZxy(t.z,t.x,t.y,s).then(e=>{if(e){let t=new Blob([e.data],{type:r});a.src=window.URL.createObjectURL(t)}else a.style.display=`none`;a.cancel=void 0,i(void 0,a)}).catch(e=>{if(e.name!==`AbortError`)throw e}),a},`createTile`),_removeTile:P(function(e){let t=this._tiles[e];t&&(t.el.cancel&&t.el.cancel(),t.el.width=0,t.el.height=0,t.el.deleted=!0,L.DomUtil.remove(t.el),delete this._tiles[e],this.fire(`tileunload`,{tile:t.el,coords:this._keyToTileCoords(e)}))},`_removeTile`)}))(t)},`leafletRasterLayer`);var ot=P(e=>(t,n)=>{if(n instanceof AbortController)return e(t,n);let r=new AbortController;return e(t,r).then(e=>n(void 0,e.data,e.cacheControl||``,e.expires||``),e=>n(e)).catch(e=>n(e)),{cancel:P(()=>r.abort(),`cancel`)}},`v3compat`);P(class{constructor(e){this.tilev4=P((e,t)=>F(this,null,function*(){if(e.type===`json`){let n=e.url.substr(10),r=this.tiles.get(n);if(r||(r=new jt(n),this.tiles.set(n,r)),this.metadata){let n=yield r.getTileJson(e.url);return t.signal.throwIfAborted(),{data:n}}let i=yield r.getHeader();return t.signal.throwIfAborted(),(i.minLon>=i.maxLon||i.minLat>=i.maxLat)&&console.error(`Bounds of PMTiles archive ${i.minLon},${i.minLat},${i.maxLon},${i.maxLat} are not valid.`),{data:{tiles:[`${e.url}/{z}/{x}/{y}`],minzoom:i.minZoom,maxzoom:i.maxZoom,bounds:[i.minLon,i.minLat,i.maxLon,i.maxLat]}}}let n=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),r=e.url.match(n);if(!r)throw Error(`Invalid PMTiles protocol URL`);let i=r[1],a=this.tiles.get(i);a||(a=new jt(i),this.tiles.set(i,a));let o=r[2],s=r[3],c=r[4],l=yield a.getHeader(),u=yield a?.getZxy(+o,+s,+c,t.signal);if(t.signal.throwIfAborted(),u)return{data:new Uint8Array(u.data),cacheControl:u.cacheControl,expires:u.expires};if(l.tileType===1){if(this.errorOnMissingTile)throw Error(`Tile not found.`);return{data:new Uint8Array}}return{data:null}}),`tilev4`),this.tile=ot(this.tilev4),this.tiles=new Map,this.metadata=e?.metadata||!1,this.errorOnMissingTile=e?.errorOnMissingTile||!1}add(e){this.tiles.set(e.source.getKey(),e)}get(e){return this.tiles.get(e)}},`Protocol`);function st(e,t){return(t>>>0)*4294967296+(e>>>0)}P(st,`toNum`);function ct(e,t){let n=t.buf,r=n[t.pos++],i=(r&112)>>4;if(r<128||(r=n[t.pos++],i|=(r&127)<<3,r<128)||(r=n[t.pos++],i|=(r&127)<<10,r<128)||(r=n[t.pos++],i|=(r&127)<<17,r<128)||(r=n[t.pos++],i|=(r&127)<<24,r<128)||(r=n[t.pos++],i|=(r&1)<<31,r<128))return st(e,i);throw Error(`Expected varint not more than 10 bytes`)}P(ct,`readVarintRemainder`);function lt(e){let t=e.buf,n=t[e.pos++],r=n&127;return n<128||(n=t[e.pos++],r|=(n&127)<<7,n<128)||(n=t[e.pos++],r|=(n&127)<<14,n<128)||(n=t[e.pos++],r|=(n&127)<<21,n<128)?r:(n=t[e.pos],r|=(n&15)<<28,ct(r,e))}P(lt,`readVarint`);function ut(e,t,n,r,i){return i===0?r===0?[n,t]:[e-1-n,e-1-t]:[t,n]}P(ut,`rotate`);function dt(e,t,n){if(e>26)throw Error(`Tile zoom level exceeds max safe number limit (26)`);if(t>=1<<e||n>=1<<e)throw Error(`tile x/y outside zoom level bounds`);let r=((1<<e)*(1<<e)-1)/3,i=e-1,[a,o]=[t,n];for(let e=1<<i;e>0;e>>=1){let t=a&e,n=o&e;r+=(3*t^n)*(1<<i),[a,o]=ut(e,a,o,t,n),i--}return r}P(dt,`zxyToTileId`);function ft(e){let t=3*e+1;return t<4294967296?31-Math.clz32(t):63-Math.clz32(t/4294967296)}P(ft,`tileIdToZ`);function pt(e){let t=ft(e)>>1;if(t>26)throw Error(`Tile zoom level exceeds max safe number limit (26)`);let n=e-((1<<t)*(1<<t)-1)/3,r=0,i=0,a=1<<t;for(let e=1;e<a;e<<=1){let t=e&n/2,a=e&(n^t);[r,i]=ut(e,r,i,t,a),n/=2,r+=t,i+=a}return[t,r,i]}P(pt,`tileIdToZxy`);var mt=(e=>(e[e.Unknown=0]=`Unknown`,e[e.None=1]=`None`,e[e.Gzip=2]=`Gzip`,e[e.Brotli=3]=`Brotli`,e[e.Zstd=4]=`Zstd`,e))(mt||{});function ht(e,t){return F(this,null,function*(){if(t===1||t===0)return e;if(t===2){if(globalThis.DecompressionStream===void 0)return nt(new Uint8Array(e));let t=new Response(e).body;if(!t)throw Error(`Failed to read response stream`);let n=t.pipeThrough(new globalThis.DecompressionStream(`gzip`));return new Response(n).arrayBuffer()}throw Error(`Compression method not supported`)})}P(ht,`defaultDecompress`);var gt=(e=>(e[e.Unknown=0]=`Unknown`,e[e.Mvt=1]=`Mvt`,e[e.Png=2]=`Png`,e[e.Jpeg=3]=`Jpeg`,e[e.Webp=4]=`Webp`,e[e.Avif=5]=`Avif`,e))(gt||{});function _t(e){return e===1?`.mvt`:e===2?`.png`:e===3?`.jpg`:e===4?`.webp`:e===5?`.avif`:``}P(_t,`tileTypeExt`);var vt=127;function yt(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=r+n>>1,a=t-e[i].tileId;if(a>0)n=i+1;else if(a<0)r=i-1;else return e[i]}return r>=0&&(e[r].runLength===0||t-e[r].tileId<e[r].runLength)?e[r]:null}P(yt,`findTile`),P(class{constructor(e){this.file=e}getKey(){return this.file.name}getBytes(e,t){return F(this,null,function*(){return{data:yield this.file.slice(e,e+t).arrayBuffer()}})}},`FileSource`);var bt=class{constructor(e,t=new Headers){this.url=e,this.customHeaders=t,this.mustReload=!1;let n=``;`navigator`in globalThis&&(n=globalThis.navigator?.userAgent??``);let r=n.indexOf(`Windows`)>-1,i=/Chrome|Chromium|Edg|OPR|Brave/.test(n);this.chromeWindowsNoCache=!1,r&&i&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(e){this.customHeaders=e}getBytes(e,t,n,r){return F(this,null,function*(){let i,a;n?a=n:(i=new AbortController,a=i.signal);let o=new Headers(this.customHeaders);o.set(`range`,`bytes=${e}-${e+t-1}`);let s;this.mustReload?s=`reload`:this.chromeWindowsNoCache&&(s=`no-store`);let c=yield fetch(this.url,{signal:a,cache:s,headers:o});if(e===0&&c.status===416){let e=c.headers.get(`Content-Range`);if(!e||!e.startsWith(`bytes */`))throw Error(`Missing content-length on 416 response`);let t=+e.substr(8);c=yield fetch(this.url,{signal:a,cache:`reload`,headers:{range:`bytes=0-${t-1}`}})}let l=c.headers.get(`Etag`);if(l!=null&&l.startsWith(`W/`)&&(l=null),c.status===416||r&&l&&l!==r)throw this.mustReload=!0,new Tt(`Server returned non-matching ETag ${r} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(c.status>=300)throw Error(`Bad response code: ${c.status}`);let u=c.headers.get(`Content-Length`);if(c.status===200&&(!u||+u>t))throw i&&i.abort(),Error(`Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.`);return{data:yield c.arrayBuffer(),etag:l||void 0,cacheControl:c.headers.get(`Cache-Control`)||void 0,expires:c.headers.get(`Expires`)||void 0}})}};P(bt,`FetchSource`);var xt=bt;function I(e,t){let n=e.getUint32(t+4,!0),r=e.getUint32(t+0,!0);return n*at(2,32)+r}P(I,`getUint64`);function St(e,t){let n=new DataView(e),r=n.getUint8(7);if(r>3)throw Error(`Archive is spec version ${r} but this library supports up to spec version 3`);return{specVersion:r,rootDirectoryOffset:I(n,8),rootDirectoryLength:I(n,16),jsonMetadataOffset:I(n,24),jsonMetadataLength:I(n,32),leafDirectoryOffset:I(n,40),leafDirectoryLength:I(n,48),tileDataOffset:I(n,56),tileDataLength:I(n,64),numAddressedTiles:I(n,72),numTileEntries:I(n,80),numTileContents:I(n,88),clustered:n.getUint8(96)===1,internalCompression:n.getUint8(97),tileCompression:n.getUint8(98),tileType:n.getUint8(99),minZoom:n.getUint8(100),maxZoom:n.getUint8(101),minLon:n.getInt32(102,!0)/1e7,minLat:n.getInt32(106,!0)/1e7,maxLon:n.getInt32(110,!0)/1e7,maxLat:n.getInt32(114,!0)/1e7,centerZoom:n.getUint8(118),centerLon:n.getInt32(119,!0)/1e7,centerLat:n.getInt32(123,!0)/1e7,etag:t}}P(St,`bytesToHeader`);function Ct(e){let t={buf:new Uint8Array(e),pos:0},n=lt(t),r=[],i=0;for(let e=0;e<n;e++){let e=lt(t);r.push({tileId:i+e,offset:0,length:0,runLength:1}),i+=e}for(let e=0;e<n;e++)r[e].runLength=lt(t);for(let e=0;e<n;e++)r[e].length=lt(t);for(let e=0;e<n;e++){let n=lt(t);n===0&&e>0?r[e].offset=r[e-1].offset+r[e-1].length:r[e].offset=n-1}return r}P(Ct,`deserializeIndex`);var wt=class extends Error{};P(wt,`EtagMismatch`);var Tt=wt;function Et(e,t){return F(this,null,function*(){let n=yield e.getBytes(0,16384);if(new DataView(n.data).getUint16(0,!0)!==19792)throw Error(`Wrong magic number for PMTiles archive`);let r=St(n.data.slice(0,vt),n.etag),i=n.data.slice(r.rootDirectoryOffset,r.rootDirectoryOffset+r.rootDirectoryLength),a=`${e.getKey()}|${r.etag||``}|${r.rootDirectoryOffset}|${r.rootDirectoryLength}`,o=Ct(yield t(i,r.internalCompression));return[r,[a,o.length,o]]})}P(Et,`getHeaderAndRoot`);function Dt(e,t,n,r,i){return F(this,null,function*(){let a=Ct(yield t((yield e.getBytes(n,r,void 0,i.etag)).data,i.internalCompression));if(a.length===0)throw Error(`Empty directory is invalid`);return a})}P(Dt,`getDirectory`),P(class{constructor(e=100,t=!0,n=ht){this.cache=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=n}getHeader(e){return F(this,null,function*(){let t=e.getKey(),n=this.cache.get(t);if(n)return n.lastUsed=this.counter++,n.data;let r=yield Et(e,this.decompress);return r[1]&&this.cache.set(r[1][0],{lastUsed:this.counter++,data:r[1][2]}),this.cache.set(t,{lastUsed:this.counter++,data:r[0]}),this.prune(),r[0]})}getDirectory(e,t,n,r){return F(this,null,function*(){let i=`${e.getKey()}|${r.etag||``}|${t}|${n}`,a=this.cache.get(i);if(a)return a.lastUsed=this.counter++,a.data;let o=yield Dt(e,this.decompress,t,n,r);return this.cache.set(i,{lastUsed:this.counter++,data:o}),this.prune(),o})}prune(){if(this.cache.size>this.maxCacheEntries){let e=1/0,t;this.cache.forEach((n,r)=>{n.lastUsed<e&&(e=n.lastUsed,t=r)}),t&&this.cache.delete(t)}}invalidate(e){return F(this,null,function*(){this.cache.delete(e.getKey())})}},`ResolvedValueCache`);var Ot=class{constructor(e=100,t=!0,n=ht){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=n}getHeader(e){return F(this,null,function*(){let t=e.getKey(),n=this.cache.get(t);if(n)return n.lastUsed=this.counter++,yield n.data;let r=new Promise((t,n)=>{Et(e,this.decompress).then(e=>{e[1]&&this.cache.set(e[1][0],{lastUsed:this.counter++,data:Promise.resolve(e[1][2])}),t(e[0]),this.prune()}).catch(e=>{n(e)})});return this.cache.set(t,{lastUsed:this.counter++,data:r}),r})}getDirectory(e,t,n,r){return F(this,null,function*(){let i=`${e.getKey()}|${r.etag||``}|${t}|${n}`,a=this.cache.get(i);if(a)return a.lastUsed=this.counter++,yield a.data;let o=new Promise((i,a)=>{Dt(e,this.decompress,t,n,r).then(e=>{i(e),this.prune()}).catch(e=>{a(e)})});return this.cache.set(i,{lastUsed:this.counter++,data:o}),o})}prune(){if(this.cache.size>=this.maxCacheEntries){let e=1/0,t;this.cache.forEach((n,r)=>{n.lastUsed<e&&(e=n.lastUsed,t=r)}),t&&this.cache.delete(t)}}invalidate(e){return F(this,null,function*(){let t=e.getKey();if(this.invalidations.get(t))return yield this.invalidations.get(t);this.cache.delete(e.getKey());let n=new Promise((n,r)=>{this.getHeader(e).then(e=>{n(),this.invalidations.delete(t)}).catch(e=>{r(e)})});this.invalidations.set(t,n)})}};P(Ot,`SharedPromiseCache`);var kt=Ot,At=class{constructor(e,t,n){typeof e==`string`?this.source=new xt(e):this.source=e,n?this.decompress=n:this.decompress=ht,t?this.cache=t:this.cache=new kt}getHeader(){return F(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(e,t,n,r){return F(this,null,function*(){let i=dt(e,t,n),a=yield this.cache.getHeader(this.source);if(e<a.minZoom||e>a.maxZoom)return;let o=a.rootDirectoryOffset,s=a.rootDirectoryLength;for(let e=0;e<=3;e++){let e=yt(yield this.cache.getDirectory(this.source,o,s,a),i);if(e){if(e.runLength>0){let t=yield this.source.getBytes(a.tileDataOffset+e.offset,e.length,r,a.etag);return{data:yield this.decompress(t.data,a.tileCompression),cacheControl:t.cacheControl,expires:t.expires}}o=a.leafDirectoryOffset+e.offset,s=e.length}else return}throw Error(`Maximum directory depth exceeded`)})}getZxy(e,t,n,r){return F(this,null,function*(){try{return yield this.getZxyAttempt(e,t,n,r)}catch(i){if(i instanceof Tt)return this.cache.invalidate(this.source),yield this.getZxyAttempt(e,t,n,r);throw i}})}getMetadataAttempt(){return F(this,null,function*(){let e=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(e.jsonMetadataOffset,e.jsonMetadataLength,void 0,e.etag),n=yield this.decompress(t.data,e.internalCompression),r=new TextDecoder(`utf-8`);return JSON.parse(r.decode(n))})}getMetadata(){return F(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(e){if(e instanceof Tt)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw e}})}getTileJson(e){return F(this,null,function*(){let t=yield this.getHeader(),n=yield this.getMetadata();return{tilejson:`3.0.0`,scheme:`xyz`,tiles:[`${e}/{z}/{x}/{y}${_t(t.tileType)}`],vector_layers:n.vector_layers,attribution:n.attribution,description:n.description,name:n.name,version:n.version,bounds:[t.minLon,t.minLat,t.maxLon,t.maxLat],center:[t.centerLon,t.centerLat,t.centerZoom],minzoom:t.minZoom,maxzoom:t.maxZoom}})}};P(At,`PMTiles`);var jt=At;function Mt(e){e(`EPSG:4326`,`+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees`),e(`EPSG:4269`,`+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees`),e(`EPSG:3857`,`+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs`);for(var t=1;t<=60;++t)e(`EPSG:`+(32600+t),`+proj=utm +zone=`+t+` +datum=WGS84 +units=m`),e(`EPSG:`+(32700+t),`+proj=utm +zone=`+t+` +south +datum=WGS84 +units=m`);e(`EPSG:5041`,`+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m`),e(`EPSG:5042`,`+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m`),e.WGS84=e[`EPSG:4326`],e[`EPSG:3785`]=e[`EPSG:3857`],e.GOOGLE=e[`EPSG:3857`],e[`EPSG:900913`]=e[`EPSG:3857`],e[`EPSG:102113`]=e[`EPSG:3857`]}var Nt=1,Pt=2,Ft=3,It=4,Lt=5,Rt=6378137,zt=6356752.314,Bt=.0066943799901413165,Vt=484813681109536e-20,R=Math.PI/2,Ht=.16666666666666666,Ut=.04722222222222222,Wt=.022156084656084655,z=1e-10,B=.017453292519943295,V=57.29577951308232,H=Math.PI/4,Gt=Math.PI*2,U=3.14159265359,W={};W.greenwich=0,W.lisbon=-9.131906111111,W.paris=2.337229166667,W.bogota=-74.080916666667,W.madrid=-3.687938888889,W.rome=12.452333333333,W.bern=7.439583333333,W.jakarta=106.807719444444,W.ferro=-17.666666666667,W.brussels=4.367975,W.stockholm=18.058277777778,W.athens=23.7163375,W.oslo=10.722916666667;var Kt=W,qt={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}},Jt=/[\s_\-\/\(\)]/g;function Yt(e,t){if(e[t])return e[t];for(var n=Object.keys(e),r=t.toLowerCase().replace(Jt,``),i=-1,a,o;++i<n.length;)if(a=n[i],o=a.toLowerCase().replace(Jt,``),o===r)return e[a]}function Xt(e){var t={},n=e.split(`+`).map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var n=t.split(`=`);return n.push(!0),e[n[0].toLowerCase()]=n[1],e},{}),r,i,a,o={proj:`projName`,datum:`datumCode`,rf:function(e){t.rf=parseFloat(e)},lat_0:function(e){t.lat0=e*B},lat_1:function(e){t.lat1=e*B},lat_2:function(e){t.lat2=e*B},lat_ts:function(e){t.lat_ts=e*B},lon_0:function(e){t.long0=e*B},lon_1:function(e){t.long1=e*B},lon_2:function(e){t.long2=e*B},alpha:function(e){t.alpha=parseFloat(e)*B},gamma:function(e){t.rectified_grid_angle=parseFloat(e)*B},lonc:function(e){t.longc=e*B},x_0:function(e){t.x0=parseFloat(e)},y_0:function(e){t.y0=parseFloat(e)},k_0:function(e){t.k0=parseFloat(e)},k:function(e){t.k0=parseFloat(e)},a:function(e){t.a=parseFloat(e)},b:function(e){t.b=parseFloat(e)},r:function(e){t.a=t.b=parseFloat(e)},r_a:function(){t.R_A=!0},zone:function(e){t.zone=parseInt(e,10)},south:function(){t.utmSouth=!0},towgs84:function(e){t.datum_params=e.split(`,`).map(function(e){return parseFloat(e)})},to_meter:function(e){t.to_meter=parseFloat(e)},units:function(e){t.units=e;var n=Yt(qt,e);n&&(t.to_meter=n.to_meter)},from_greenwich:function(e){t.from_greenwich=e*B},pm:function(e){t.from_greenwich=(Yt(Kt,e)||parseFloat(e))*B},nadgrids:function(e){e===`@null`?t.datumCode=`none`:t.nadgrids=e},axis:function(e){var n=`ewnsud`;e.length===3&&n.indexOf(e.substr(0,1))!==-1&&n.indexOf(e.substr(1,1))!==-1&&n.indexOf(e.substr(2,1))!==-1&&(t.axis=e)},approx:function(){t.approx=!0},over:function(){t.over=!0}};for(r in n)i=n[r],r in o?(a=o[r],typeof a==`function`?a(i):t[a]=i):t[r]=i;return typeof t.datumCode==`string`&&t.datumCode!==`WGS84`&&(t.datumCode=t.datumCode.toLowerCase()),t.projStr=e,t}var Zt=class{static getId(e){let t=e.find(e=>Array.isArray(e)&&e[0]===`ID`);return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t=`unit`){if(!e||e.length<3)return{type:t,name:`unknown`,conversion_factor:null};let n=e[1],r=parseFloat(e[2])||null,i=e.find(e=>Array.isArray(e)&&e[0]===`ID`);return{type:t,name:n,conversion_factor:r,id:i?{authority:i[1],code:parseInt(i[2],10)}:null}}static convertAxis(e){let t=e[1]||`Unknown`,n,r=t.match(/^\((.)\)$/);if(r){let e=r[1].toUpperCase();if(e===`E`)n=`east`;else if(e===`N`)n=`north`;else if(e===`U`)n=`up`;else throw Error(`Unknown axis abbreviation: ${e}`)}else n=e[2]?e[2].toLowerCase():`unknown`;let i=e.find(e=>Array.isArray(e)&&e[0]===`ORDER`),a=i?parseInt(i[1],10):null,o=e.find(e=>Array.isArray(e)&&(e[0]===`LENGTHUNIT`||e[0]===`ANGLEUNIT`||e[0]===`SCALEUNIT`)),s=this.convertUnit(o);return{name:t,direction:n,unit:s,order:a}}static extractAxes(e){return e.filter(e=>Array.isArray(e)&&e[0]===`AXIS`).map(e=>this.convertAxis(e)).sort((e,t)=>(e.order||0)-(t.order||0))}static convert(e,t={}){switch(e[0]){case`PROJCRS`:t.type=`ProjectedCRS`,t.name=e[1],t.base_crs=e.find(e=>Array.isArray(e)&&e[0]===`BASEGEOGCRS`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`BASEGEOGCRS`)):null,t.conversion=e.find(e=>Array.isArray(e)&&e[0]===`CONVERSION`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`CONVERSION`)):null;let n=e.find(e=>Array.isArray(e)&&e[0]===`CS`);n&&(t.coordinate_system={type:n[1],axis:this.extractAxes(e)});let r=e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`);if(r){let e=this.convertUnit(r);t.coordinate_system.unit=e}t.id=this.getId(e);break;case`BASEGEOGCRS`:case`GEOGCRS`:t.type=`GeographicCRS`,t.name=e[1];let i=e.find(e=>Array.isArray(e)&&(e[0]===`DATUM`||e[0]===`ENSEMBLE`));if(i){let n=this.convert(i);i[0]===`ENSEMBLE`?t.datum_ensemble=n:t.datum=n;let r=e.find(e=>Array.isArray(e)&&e[0]===`PRIMEM`);r&&r[1]!==`Greenwich`&&(n.prime_meridian={name:r[1],longitude:parseFloat(r[2])})}t.coordinate_system={type:`ellipsoidal`,axis:this.extractAxes(e)},t.id=this.getId(e);break;case`DATUM`:t.type=`GeodeticReferenceFrame`,t.name=e[1],t.ellipsoid=e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`)):null;break;case`ENSEMBLE`:t.type=`DatumEnsemble`,t.name=e[1],t.members=e.filter(e=>Array.isArray(e)&&e[0]===`MEMBER`).map(e=>({type:`DatumEnsembleMember`,name:e[1],id:this.getId(e)}));let a=e.find(e=>Array.isArray(e)&&e[0]===`ENSEMBLEACCURACY`);a&&(t.accuracy=parseFloat(a[1]));let o=e.find(e=>Array.isArray(e)&&e[0]===`ELLIPSOID`);o&&(t.ellipsoid=this.convert(o)),t.id=this.getId(e);break;case`ELLIPSOID`:t.type=`Ellipsoid`,t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`)&&this.convert(e.find(e=>Array.isArray(e)&&e[0]===`LENGTHUNIT`),t);break;case`CONVERSION`:t.type=`Conversion`,t.name=e[1],t.method=e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)):null,t.parameters=e.filter(e=>Array.isArray(e)&&e[0]===`PARAMETER`).map(e=>this.convert(e));break;case`METHOD`:t.type=`Method`,t.name=e[1],t.id=this.getId(e);break;case`PARAMETER`:t.type=`Parameter`,t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(e=>Array.isArray(e)&&(e[0]===`LENGTHUNIT`||e[0]===`ANGLEUNIT`||e[0]===`SCALEUNIT`))),t.id=this.getId(e);break;case`BOUNDCRS`:t.type=`BoundCRS`;let s=e.find(e=>Array.isArray(e)&&e[0]===`SOURCECRS`);if(s){let e=s.find(e=>Array.isArray(e));t.source_crs=e?this.convert(e):null}let c=e.find(e=>Array.isArray(e)&&e[0]===`TARGETCRS`);if(c){let e=c.find(e=>Array.isArray(e));t.target_crs=e?this.convert(e):null}let l=e.find(e=>Array.isArray(e)&&e[0]===`ABRIDGEDTRANSFORMATION`);l?t.transformation=this.convert(l):t.transformation=null;break;case`ABRIDGEDTRANSFORMATION`:if(t.type=`Transformation`,t.name=e[1],t.method=e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)?this.convert(e.find(e=>Array.isArray(e)&&e[0]===`METHOD`)):null,t.parameters=e.filter(e=>Array.isArray(e)&&(e[0]===`PARAMETER`||e[0]===`PARAMETERFILE`)).map(e=>{if(e[0]===`PARAMETER`)return this.convert(e);if(e[0]===`PARAMETERFILE`)return{name:e[1],value:e[2],id:{authority:`EPSG`,code:8656}}}),t.parameters.length===7){let e=t.parameters[6];e.name===`Scale difference`&&(e.value=Math.round((e.value-1)*0xe8d4a51000)/1e6)}t.id=this.getId(e);break;case`AXIS`:t.coordinate_system||={type:`unspecified`,axis:[]},t.coordinate_system.axis.push(this.convertAxis(e));break;case`LENGTHUNIT`:let u=this.convertUnit(e,`LinearUnit`);t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(e=>{e.unit||=u}),u.conversion_factor&&u.conversion_factor!==1&&(t.semi_major_axis&&={value:t.semi_major_axis,unit:u});break;default:t.keyword=e[0];break}return t}},Qt=class extends Zt{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype===`Cartesian`&&delete t.coordinate_system,t.usage&&delete t.usage,t}},$t=class extends Zt{static convert(e,t={}){super.convert(e,t);let n=e.find(e=>Array.isArray(e)&&e[0]===`CS`);n&&(t.coordinate_system={subtype:n[1],axis:this.extractAxes(e)});let r=e.find(e=>Array.isArray(e)&&e[0]===`USAGE`);if(r){let e=r.find(e=>Array.isArray(e)&&e[0]===`SCOPE`),n=r.find(e=>Array.isArray(e)&&e[0]===`AREA`),i=r.find(e=>Array.isArray(e)&&e[0]===`BBOX`);t.usage={},e&&(t.usage.scope=e[1]),n&&(t.usage.area=n[1]),i&&(t.usage.bbox=i.slice(1))}return t}};function en(e){return e.find(e=>Array.isArray(e)&&e[0]===`USAGE`)?`2019`:(e.find(e=>Array.isArray(e)&&e[0]===`CS`)||e[0]===`BOUNDCRS`||e[0]===`PROJCRS`||e[0],`2015`)}function tn(e){return(en(e)===`2019`?$t:Qt).convert(e)}function nn(e){let t=e.toUpperCase();return t.includes(`PROJCRS`)||t.includes(`GEOGCRS`)||t.includes(`BOUNDCRS`)||t.includes(`VERTCRS`)||t.includes(`LENGTHUNIT`)||t.includes(`ANGLEUNIT`)||t.includes(`SCALEUNIT`)?`WKT2`:(t.includes(`PROJCS`)||t.includes(`GEOGCS`)||t.includes(`LOCAL_CS`)||t.includes(`VERT_CS`)||t.includes(`UNIT`),`WKT1`)}var rn=_n,an=1,on=2,sn=3,cn=4,ln=5,un=-1,dn=/\s/,fn=/[A-Za-z]/,pn=/[A-Za-z84_]/,mn=/[,\]]/,hn=/[\d\.E\-\+]/;function gn(e){if(typeof e!=`string`)throw Error(`not a string`);this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=an}gn.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==cn)for(;dn.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case an:return this.neutral(e);case on:return this.keyword(e);case cn:return this.quoted(e);case ln:return this.afterquote(e);case sn:return this.number(e);case un:return}},gn.prototype.afterquote=function(e){if(e===`"`){this.word+=`"`,this.state=cn;return}if(mn.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in afterquote yet, index `+this.place)},gn.prototype.afterItem=function(e){if(e===`,`){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=an;return}if(e===`]`){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=an,this.currentObject=this.stack.pop(),this.currentObject||(this.state=un);return}},gn.prototype.number=function(e){if(hn.test(e)){this.word+=e;return}if(mn.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in number yet, index `+this.place)},gn.prototype.quoted=function(e){if(e===`"`){this.state=ln;return}this.word+=e},gn.prototype.keyword=function(e){if(pn.test(e)){this.word+=e;return}if(e===`[`){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=an;return}if(mn.test(e)){this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in keyword yet, index `+this.place)},gn.prototype.neutral=function(e){if(fn.test(e)){this.word=e,this.state=on;return}if(e===`"`){this.word=``,this.state=cn;return}if(hn.test(e)){this.word=e,this.state=sn;return}if(mn.test(e)){this.afterItem(e);return}throw Error(`havn't handled "`+e+`" in neutral yet, index `+this.place)},gn.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===un)return this.root;throw Error(`unable to parse string "`+this.text+`". State is `+this.state)};function _n(e){return new gn(e).output()}function vn(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var r=t?{}:e,i=n.reduce(function(e,t){return yn(t,e),e},r);t&&(e[t]=i)}function yn(e,t){if(!Array.isArray(e)){t[e]=!0;return}var n=e.shift();if(n===`PARAMETER`&&(n=e.shift()),e.length===1){if(Array.isArray(e[0])){t[n]={},yn(e[0],t[n]);return}t[n]=e[0];return}if(!e.length){t[n]=!0;return}if(n===`TOWGS84`){t[n]=e;return}if(n===`AXIS`){n in t||(t[n]=[]),t[n].push(e);return}Array.isArray(n)||(t[n]={});var r;switch(n){case`UNIT`:case`PRIMEM`:case`VERT_DATUM`:t[n]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&yn(e[2],t[n]);return;case`SPHEROID`:case`ELLIPSOID`:t[n]={name:e[0],a:e[1],rf:e[2]},e.length===4&&yn(e[3],t[n]);return;case`EDATUM`:case`ENGINEERINGDATUM`:case`LOCAL_DATUM`:case`DATUM`:case`VERT_CS`:case`VERTCRS`:case`VERTICALCRS`:e[0]=[`name`,e[0]],vn(t,n,e);return;case`COMPD_CS`:case`COMPOUNDCRS`:case`FITTED_CS`:case`PROJECTEDCRS`:case`PROJCRS`:case`GEOGCS`:case`GEOCCS`:case`PROJCS`:case`LOCAL_CS`:case`GEODCRS`:case`GEODETICCRS`:case`GEODETICDATUM`:case`ENGCRS`:case`ENGINEERINGCRS`:e[0]=[`name`,e[0]],vn(t,n,e),t[n].type=n;return;default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return yn(e,t[n]);return vn(t,n,e)}}var bn=.017453292519943295;function xn(e){return e*bn}function Sn(e){let t=(e.projName||``).toLowerCase().replace(/_/g,` `);!e.long0&&e.longc&&(t===`albers conic equal area`||t===`lambert azimuthal equal area`)&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(t===`stereographic south pole`||t===`polar stereographic (variant b)`)?(e.lat0=xn(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1):!e.lat_ts&&e.lat0&&(t===`polar stereographic`||t===`polar stereographic (variant a)`)&&(e.lat_ts=e.lat0,e.lat0=xn(e.lat0>0?90:-90),delete e.lat1)}function Cn(e){let t={units:null,to_meter:void 0};return typeof e==`string`?(t.units=e.toLowerCase(),t.units===`metre`&&(t.units=`meter`),t.units===`meter`&&(t.to_meter=1)):e&&e.name&&(t.units=e.name.toLowerCase(),t.units===`metre`&&(t.units=`meter`),t.to_meter=e.conversion_factor),t}function wn(e){return typeof e==`object`?e.value*e.unit.conversion_factor:e}function Tn(e,t){e.ellipsoid.radius?(t.a=e.ellipsoid.radius,t.rf=0):(t.a=wn(e.ellipsoid.semi_major_axis),e.ellipsoid.inverse_flattening===void 0?e.ellipsoid.semi_major_axis!==void 0&&e.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-wn(e.ellipsoid.semi_minor_axis))):t.rf=e.ellipsoid.inverse_flattening)}function En(e,t={}){return!e||typeof e!=`object`?e:e.type===`BoundCRS`?(En(e.source_crs,t),e.transformation&&(e.transformation.method&&e.transformation.method.name===`NTv2`?t.nadgrids=e.transformation.parameters[0].value:t.datum_params=e.transformation.parameters.map(e=>e.value)),t):(Object.keys(e).forEach(n=>{let r=e[n];if(r!==null)switch(n){case`name`:if(t.srsCode)break;t.name=r,t.srsCode=r;break;case`type`:r===`GeographicCRS`?t.projName=`longlat`:r===`ProjectedCRS`&&e.conversion&&e.conversion.method&&(t.projName=e.conversion.method.name);break;case`datum`:case`datum_ensemble`:r.ellipsoid&&(t.ellps=r.ellipsoid.name,Tn(r,t)),r.prime_meridian&&(t.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case`ellipsoid`:t.ellps=r.name,Tn(r,t);break;case`prime_meridian`:t.long0=(r.longitude||0)*Math.PI/180;break;case`coordinate_system`:if(r.axis){if(t.axis=r.axis.map(e=>{let t=e.direction;if(t===`east`)return`e`;if(t===`north`)return`n`;if(t===`west`)return`w`;if(t===`south`)return`s`;throw Error(`Unknown axis direction: ${t}`)}).join(``)+`u`,r.unit){let{units:e,to_meter:n}=Cn(r.unit);t.units=e,t.to_meter=n}else if(r.axis[0]&&r.axis[0].unit){let{units:e,to_meter:n}=Cn(r.axis[0].unit);t.units=e,t.to_meter=n}}break;case`id`:r.authority&&r.code&&(t.title=r.authority+`:`+r.code);break;case`conversion`:r.method&&r.method.name&&(t.projName=r.method.name),r.parameters&&r.parameters.forEach(e=>{let n=e.name.toLowerCase().replace(/\s+/g,`_`),r=e.value;e.unit&&e.unit.conversion_factor?t[n]=r*e.unit.conversion_factor:e.unit===`degree`?t[n]=r*Math.PI/180:t[n]=r});break;case`unit`:r.name&&(t.units=r.name.toLowerCase(),t.units===`metre`&&(t.units=`meter`)),r.conversion_factor&&(t.to_meter=r.conversion_factor);break;case`base_crs`:En(r,t),t.datumCode=r.id?r.id.authority+`_`+r.id.code:r.name;break;default:break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),Sn(t),t)}var Dn=[`PROJECTEDCRS`,`PROJCRS`,`GEOGCS`,`GEOCCS`,`PROJCS`,`LOCAL_CS`,`GEODCRS`,`GEODETICCRS`,`GEODETICDATUM`,`ENGCRS`,`ENGINEERINGCRS`];function On(e,t){var n=t[0],r=t[1];!(n in e)&&r in e&&(e[n]=e[r],t.length===3&&(e[n]=t[2](e[n])))}function kn(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;++n){var i=t[n];Dn.indexOf(i)!==-1&&An(e[i]),typeof e[i]==`object`&&kn(e[i])}}function An(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+`:`+e.AUTHORITY[t])}if(e.type===`GEOGCS`?e.projName=`longlat`:e.type===`LOCAL_CS`?(e.projName=`identity`,e.local=!0):typeof e.PROJECTION==`object`?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var n=``,r=0,i=e.AXIS.length;r<i;++r){var a=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];a[0].indexOf(`north`)!==-1||(a[0]===`y`||a[0]===`lat`)&&a[1]===`north`?n+=`n`:a[0].indexOf(`south`)!==-1||(a[0]===`y`||a[0]===`lat`)&&a[1]===`south`?n+=`s`:a[0].indexOf(`east`)!==-1||(a[0]===`x`||a[0]===`lon`)&&a[1]===`east`?n+=`e`:(a[0].indexOf(`west`)!==-1||(a[0]===`x`||a[0]===`lon`)&&a[1]===`west`)&&(n+=`w`)}n.length===2&&(n+=`u`),n.length===3&&(e.axis=n)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units===`metre`&&(e.units=`meter`),e.UNIT.convert&&(e.type===`GEOGCS`?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type===`GEOGCS`&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)===`d_`&&(e.datumCode=e.datumCode.slice(2)),e.datumCode===`new_zealand_1949`&&(e.datumCode=`nzgd49`),(e.datumCode===`wgs_1984`||e.datumCode===`world_geodetic_system_1984`)&&(e.PROJECTION===`Mercator_Auxiliary_Sphere`&&(e.sphere=!0),e.datumCode=`wgs84`),e.datumCode===`belge_1972`&&(e.datumCode=`rnb72`),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace(`_19`,``).replace(/[Cc]larke\_18/,`clrk`),e.ellps.toLowerCase().slice(0,13)===`international`&&(e.ellps=`intl`),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf(`osgb_1936`)&&(e.datumCode=`osgb36`),~e.datumCode.indexOf(`osni_1952`)&&(e.datumCode=`osni52`),(~e.datumCode.indexOf(`tm65`)||~e.datumCode.indexOf(`geodetic_datum_of_1965`))&&(e.datumCode=`ire65`),e.datumCode===`ch1903+`&&(e.datumCode=`ch1903`),~e.datumCode.indexOf(`israel`)&&(e.datumCode=`isr93`)),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&=xn(e.rectified_grid_angle);function s(t){return t*(e.to_meter||1)}[[`standard_parallel_1`,`Standard_Parallel_1`],[`standard_parallel_1`,`Latitude of 1st standard parallel`],[`standard_parallel_2`,`Standard_Parallel_2`],[`standard_parallel_2`,`Latitude of 2nd standard parallel`],[`false_easting`,`False_Easting`],[`false_easting`,`False easting`],[`false-easting`,`Easting at false origin`],[`false_northing`,`False_Northing`],[`false_northing`,`False northing`],[`false_northing`,`Northing at false origin`],[`central_meridian`,`Central_Meridian`],[`central_meridian`,`Longitude of natural origin`],[`central_meridian`,`Longitude of false origin`],[`latitude_of_origin`,`Latitude_Of_Origin`],[`latitude_of_origin`,`Central_Parallel`],[`latitude_of_origin`,`Latitude of natural origin`],[`latitude_of_origin`,`Latitude of false origin`],[`scale_factor`,`Scale_Factor`],[`k0`,`scale_factor`],[`latitude_of_center`,`Latitude_Of_Center`],[`latitude_of_center`,`Latitude_of_center`],[`lat0`,`latitude_of_center`,xn],[`longitude_of_center`,`Longitude_Of_Center`],[`longitude_of_center`,`Longitude_of_center`],[`longc`,`longitude_of_center`,xn],[`x0`,`false_easting`,s],[`y0`,`false_northing`,s],[`long0`,`central_meridian`,xn],[`lat0`,`latitude_of_origin`,xn],[`lat0`,`standard_parallel_1`,xn],[`lat1`,`standard_parallel_1`,xn],[`lat2`,`standard_parallel_2`,xn],[`azimuth`,`Azimuth`],[`alpha`,`azimuth`,xn],[`srsCode`,`name`]].forEach(function(t){return On(e,t)}),Sn(e)}function jn(e){if(typeof e==`object`)return En(e);let t=nn(e);var n=rn(e);if(t===`WKT2`)return En(tn(n));var r=n[0],i={};return yn(n,i),kn(i),i[r]}function G(e){var t=this;if(arguments.length===2){var n=arguments[1];typeof n==`string`?n.charAt(0)===`+`?G[e]=Xt(arguments[1]):G[e]=jn(arguments[1]):n&&typeof n==`object`&&!(`projName`in n)?G[e]=jn(arguments[1]):(G[e]=n,n||delete G[e])}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(e){return Array.isArray(e)?G.apply(t,e):G(e)});if(typeof e==`string`){if(e in G)return G[e]}else `EPSG`in e?G[`EPSG:`+e.EPSG]=e:`ESRI`in e?G[`ESRI:`+e.ESRI]=e:`IAU2000`in e?G[`IAU2000:`+e.IAU2000]=e:console.log(e);return}}Mt(G);var Mn=G;function Nn(e){return typeof e==`string`}function Pn(e){return e in Mn}function Fn(e){return e.indexOf(`+`)!==0&&e.indexOf(`[`)!==-1||typeof e==`object`&&!(`srsCode`in e)}var In=[`3857`,`900913`,`3785`,`102113`];function Ln(e){var t=Yt(e,`authority`);if(t){var n=Yt(t,`epsg`);return n&&In.indexOf(n)>-1}}function Rn(e){var t=Yt(e,`extension`);if(t)return Yt(t,`proj4`)}function zn(e){return e[0]===`+`}function Bn(e){if(Nn(e)){if(Pn(e))return Mn[e];if(Fn(e)){var t=jn(e);if(Ln(t))return Mn[`EPSG:3857`];var n=Rn(t);return n?Xt(n):t}if(zn(e))return Xt(e)}else if(`projName`in e)return e;else return jn(e)}var Vn=Bn;function Hn(e,t){e||={};var n,r;if(!t)return e;for(r in t)n=t[r],n!==void 0&&(e[r]=n);return e}function Un(e,t,n){var r=e*t;return n/Math.sqrt(1-r*r)}function Wn(e){return e<0?-1:1}function K(e,t){return t||Math.abs(e)<=U?e:e-Wn(e)*Gt}function Gn(e,t,n){var r=e*n,i=.5*e;return r=((1-r)/(1+r))**i,Math.tan(.5*(R-t))/r}function Kn(e,t){for(var n=.5*e,r,i,a=R-2*Math.atan(t),o=0;o<=15;o++)if(r=e*Math.sin(a),i=R-2*Math.atan(t*((1-r)/(1+r))**n)-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function qn(){var e=this.b/this.a;this.es=1-e*e,`x0`in this||(this.x0=0),`y0`in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Un(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Jn(e){var t=e.x,n=e.y;if(n*V>90&&n*V<-90&&t*V>180&&t*V<-180)return null;var r,i;if(Math.abs(Math.abs(n)-R)<=z)return null;if(this.sphere)r=this.x0+this.a*this.k0*K(t-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(H+.5*n));else{var a=Math.sin(n),o=Gn(this.e,n,a);r=this.x0+this.a*this.k0*K(t-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=r,e.y=i,e}function Yn(e){var t=e.x-this.x0,n=e.y-this.y0,r,i;if(this.sphere)i=R-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(i=Kn(this.e,a),i===-9999)return null}return r=K(this.long0+t/(this.a*this.k0),this.over),e.x=r,e.y=i,e}var Xn={init:qn,forward:Jn,inverse:Yn,names:[`Mercator`,`Popular Visualisation Pseudo Mercator`,`Mercator_1SP`,`Mercator_Auxiliary_Sphere`,`Mercator_Variant_A`,`merc`]};function Zn(){}function Qn(e){return e}var $n=[`longlat`,`identity`],er=[Xn,{init:Zn,forward:Qn,inverse:Qn,names:$n}],tr={},nr=[];function rr(e,t){var n=nr.length;return e.names?(nr[n]=e,e.names.forEach(function(e){tr[e.toLowerCase()]=n}),this):(console.log(t),!0)}function ir(e){return e.replace(/[-\(\)\s]+/g,` `).trim().replace(/ /g,`_`)}function ar(e){if(!e)return!1;var t=e.toLowerCase();if(tr[t]!==void 0&&nr[tr[t]]||(t=ir(t),t in tr&&nr[tr[t]]))return nr[tr[t]]}function or(){er.forEach(rr)}var sr={start:or,add:rr,get:ar},cr={MERIT:{a:6378137,rf:298.257,ellipseName:`MERIT 1983`},SGS85:{a:6378136,rf:298.257,ellipseName:`Soviet Geodetic System 85`},GRS80:{a:6378137,rf:298.257222101,ellipseName:`GRS 1980(IUGG, 1980)`},IAU76:{a:6378140,rf:298.257,ellipseName:`IAU 1976`},airy:{a:6377563.396,b:6356256.91,ellipseName:`Airy 1830`},APL4:{a:6378137,rf:298.25,ellipseName:`Appl. Physics. 1965`},NWL9D:{a:6378145,rf:298.25,ellipseName:`Naval Weapons Lab., 1965`},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:`Modified Airy`},andrae:{a:6377104.43,rf:300,ellipseName:`Andrae 1876 (Den., Iclnd.)`},aust_SA:{a:6378160,rf:298.25,ellipseName:`Australian Natl & S. Amer. 1969`},GRS67:{a:6378160,rf:298.247167427,ellipseName:`GRS 67(IUGG 1967)`},bessel:{a:6377397.155,rf:299.1528128,ellipseName:`Bessel 1841`},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:`Bessel 1841 (Namibia)`},clrk66:{a:6378206.4,b:6356583.8,ellipseName:`Clarke 1866`},clrk80:{a:6378249.145,rf:293.4663,ellipseName:`Clarke 1880 mod.`},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:`Clarke 1880 (IGN)`},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:`Clarke 1858`},CPM:{a:6375738.7,rf:334.29,ellipseName:`Comm. des Poids et Mesures 1799`},delmbr:{a:6376428,rf:311.5,ellipseName:`Delambre 1810 (Belgium)`},engelis:{a:6378136.05,rf:298.2566,ellipseName:`Engelis 1985`},evrst30:{a:6377276.345,rf:300.8017,ellipseName:`Everest 1830`},evrst48:{a:6377304.063,rf:300.8017,ellipseName:`Everest 1948`},evrst56:{a:6377301.243,rf:300.8017,ellipseName:`Everest 1956`},evrst69:{a:6377295.664,rf:300.8017,ellipseName:`Everest 1969`},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:`Everest (Sabah & Sarawak)`},fschr60:{a:6378166,rf:298.3,ellipseName:`Fischer (Mercury Datum) 1960`},fschr60m:{a:6378155,rf:298.3,ellipseName:`Fischer 1960`},fschr68:{a:6378150,rf:298.3,ellipseName:`Fischer 1968`},helmert:{a:6378200,rf:298.3,ellipseName:`Helmert 1906`},hough:{a:6378270,rf:297,ellipseName:`Hough`},intl:{a:6378388,rf:297,ellipseName:`International 1909 (Hayford)`},kaula:{a:6378163,rf:298.24,ellipseName:`Kaula 1961`},lerch:{a:6378139,rf:298.257,ellipseName:`Lerch 1979`},mprts:{a:6397300,rf:191,ellipseName:`Maupertius 1738`},new_intl:{a:6378157.5,b:6356772.2,ellipseName:`New International 1967`},plessis:{a:6376523,rf:6355863,ellipseName:`Plessis 1817 (France)`},krass:{a:6378245,rf:298.3,ellipseName:`Krassovsky, 1942`},SEasia:{a:6378155,b:6356773.3205,ellipseName:`Southeast Asia`},walbeck:{a:6376896,b:6355834.8467,ellipseName:`Walbeck`},WGS60:{a:6378165,rf:298.3,ellipseName:`WGS 60`},WGS66:{a:6378145,rf:298.25,ellipseName:`WGS 66`},WGS7:{a:6378135,rf:298.26,ellipseName:`WGS 72`},WGS84:{a:6378137,rf:298.257223563,ellipseName:`WGS 84`},sphere:{a:6370997,b:6370997,ellipseName:`Normal Sphere (r=6370997)`}};let lr=cr.WGS84;function ur(e,t,n,r){var i=e*e,a=t*t,o=(i-a)/i,s=0;r?(e*=1-o*(Ht+o*(Ut+o*Wt)),i=e*e,o=0):s=Math.sqrt(o);var c=(i-a)/a;return{es:o,e:s,ep2:c}}function dr(e,t,n,r,i){if(!e){var a=Yt(cr,r);a||=lr,e=a.a,t=a.b,n=a.rf}return n&&!t&&(t=(1-1/n)*e),(n===0||Math.abs(e-t)<z)&&(i=!0,t=e),{a:e,b:t,rf:n,sphere:i}}var fr={wgs84:{towgs84:`0,0,0`,ellipse:`WGS84`,datumName:`WGS84`},ch1903:{towgs84:`674.374,15.056,405.346`,ellipse:`bessel`,datumName:`swiss`},ggrs87:{towgs84:`-199.87,74.79,246.62`,ellipse:`GRS80`,datumName:`Greek_Geodetic_Reference_System_1987`},nad83:{towgs84:`0,0,0`,ellipse:`GRS80`,datumName:`North_American_Datum_1983`},nad27:{nadgrids:`@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat`,ellipse:`clrk66`,datumName:`North_American_Datum_1927`},potsdam:{towgs84:`598.1,73.7,418.2,0.202,0.045,-2.455,6.7`,ellipse:`bessel`,datumName:`Potsdam Rauenberg 1950 DHDN`},carthage:{towgs84:`-263.0,6.0,431.0`,ellipse:`clark80`,datumName:`Carthage 1934 Tunisia`},hermannskogel:{towgs84:`577.326,90.129,463.919,5.137,1.474,5.297,2.4232`,ellipse:`bessel`,datumName:`Hermannskogel`},mgi:{towgs84:`577.326,90.129,463.919,5.137,1.474,5.297,2.4232`,ellipse:`bessel`,datumName:`Militar-Geographische Institut`},osni52:{towgs84:`482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15`,ellipse:`airy`,datumName:`Irish National`},ire65:{towgs84:`482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15`,ellipse:`mod_airy`,datumName:`Ireland 1965`},rassadiran:{towgs84:`-133.63,-157.5,-158.62`,ellipse:`intl`,datumName:`Rassadiran`},nzgd49:{towgs84:`59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993`,ellipse:`intl`,datumName:`New Zealand Geodetic Datum 1949`},osgb36:{towgs84:`446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894`,ellipse:`airy`,datumName:`Ordnance Survey of Great Britain 1936`},s_jtsk:{towgs84:`589,76,480`,ellipse:`bessel`,datumName:`S-JTSK (Ferro)`},beduaram:{towgs84:`-106,-87,188`,ellipse:`clrk80`,datumName:`Beduaram`},gunung_segara:{towgs84:`-403,684,41`,ellipse:`bessel`,datumName:`Gunung Segara Jakarta`},rnb72:{towgs84:`106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1`,ellipse:`intl`,datumName:`Reseau National Belge 1972`},EPSG_5451:{towgs84:`6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649`},IGNF_LURESG:{towgs84:`-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43`},EPSG_4614:{towgs84:`-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065`},EPSG_4615:{towgs84:`-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748`},ESRI_37241:{towgs84:`-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031`},ESRI_37249:{towgs84:`-440.296,58.548,296.265,1.128,10.202,4.559,-0.438`},ESRI_37245:{towgs84:`-511.151,-181.269,139.609,1.05,2.703,1.798,3.071`},EPSG_4178:{towgs84:`24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01`},EPSG_4622:{towgs84:`-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984`},EPSG_4625:{towgs84:`126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227`},EPSG_5252:{towgs84:`0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439`},EPSG_4314:{towgs84:`597.1,71.4,412.1,0.894,0.068,-1.563,7.58`},EPSG_4282:{towgs84:`-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166`},EPSG_4231:{towgs84:`-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218`},EPSG_4274:{towgs84:`-230.994,102.591,25.199,0.633,-0.239,0.9,1.95`},EPSG_4134:{towgs84:`-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006`},EPSG_4254:{towgs84:`18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013`},EPSG_4159:{towgs84:`-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175`},EPSG_4687:{towgs84:`0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093`},EPSG_4227:{towgs84:`-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225`},EPSG_4746:{towgs84:`599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46`},EPSG_4745:{towgs84:`612.4,77,440.2,-0.054,0.057,-2.797,2.55`},EPSG_6311:{towgs84:`8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926`},EPSG_4289:{towgs84:`565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244`},EPSG_4230:{towgs84:`-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4`},EPSG_4154:{towgs84:`-123.02,-158.95,-168.47`},EPSG_4156:{towgs84:`570.8,85.7,462.8,4.998,1.587,5.261,3.56`},EPSG_4299:{towgs84:`482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15`},EPSG_4179:{towgs84:`33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84`},EPSG_4313:{towgs84:`-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747`},EPSG_4194:{towgs84:`163.511,127.533,-159.789`},EPSG_4195:{towgs84:`105,326,-102.5`},EPSG_4196:{towgs84:`-45,417,-3.5`},EPSG_4611:{towgs84:`-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246`},EPSG_4633:{towgs84:`137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824`},EPSG_4641:{towgs84:`-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993`},EPSG_4643:{towgs84:`-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002`},EPSG_4300:{towgs84:`482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15`},EPSG_4188:{towgs84:`482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15`},EPSG_4660:{towgs84:`982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805`},EPSG_4662:{towgs84:`97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259`},EPSG_3906:{towgs84:`577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664`},EPSG_4307:{towgs84:`-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547`},EPSG_6892:{towgs84:`-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686`},EPSG_4690:{towgs84:`221.597,152.441,176.523,2.403,1.3893,0.884,11.4648`},EPSG_4691:{towgs84:`218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817`},EPSG_4629:{towgs84:`72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653`},EPSG_4630:{towgs84:`165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111`},EPSG_4692:{towgs84:`217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093`},EPSG_9333:{towgs84:`0,0,0,-8.393,0.749,-10.276,0`},EPSG_9059:{towgs84:`0,0,0`},EPSG_4312:{towgs84:`601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887`},EPSG_4123:{towgs84:`-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496`},EPSG_4309:{towgs84:`-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365`},ESRI_104106:{towgs84:`-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058`},EPSG_4281:{towgs84:`-219.247,-73.802,269.529`},EPSG_4322:{towgs84:`0,0,4.5`},EPSG_4324:{towgs84:`0,0,1.9`},EPSG_4284:{towgs84:`43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549`},EPSG_4277:{towgs84:`446.448,-125.157,542.06,0.15,0.247,0.842,-20.489`},EPSG_4207:{towgs84:`-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46`},EPSG_4688:{towgs84:`347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647`},EPSG_4689:{towgs84:`410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218`},EPSG_4720:{towgs84:`0,0,4.5`},EPSG_4273:{towgs84:`278.3,93,474.5,7.889,0.05,-6.61,6.21`},EPSG_4240:{towgs84:`204.64,834.74,293.8`},EPSG_4817:{towgs84:`278.3,93,474.5,7.889,0.05,-6.61,6.21`},ESRI_104131:{towgs84:`426.62,142.62,460.09,4.98,4.49,-12.42,-17.1`},EPSG_4265:{towgs84:`-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68`},EPSG_4263:{towgs84:`-111.92,-87.85,114.5,1.875,0.202,0.219,0.032`},EPSG_4298:{towgs84:`-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536`},EPSG_4270:{towgs84:`-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424`},EPSG_4229:{towgs84:`-121.8,98.1,-10.7`},EPSG_4220:{towgs84:`-55.5,-348,-229.2`},EPSG_4214:{towgs84:`12.646,-155.176,-80.863`},EPSG_4232:{towgs84:`-345,3,223`},EPSG_4238:{towgs84:`-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037`},EPSG_4168:{towgs84:`-170,33,326`},EPSG_4131:{towgs84:`199,931,318.9`},EPSG_4152:{towgs84:`-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0`},EPSG_5228:{towgs84:`572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378`},EPSG_8351:{towgs84:`485.021,169.465,483.839,7.786342,4.397554,4.102655,0`},EPSG_4683:{towgs84:`-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06`},EPSG_4133:{towgs84:`0,0,0`},EPSG_7373:{towgs84:`0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693`},EPSG_9075:{towgs84:`-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0`},EPSG_9072:{towgs84:`-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0`},EPSG_9294:{towgs84:`1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388`},EPSG_4212:{towgs84:`-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492`},EPSG_4191:{towgs84:`-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703`},EPSG_4237:{towgs84:`52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191`},EPSG_4740:{towgs84:`-1.08,-0.27,-0.9`},EPSG_4124:{towgs84:`419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496`},EPSG_5681:{towgs84:`584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922`},EPSG_4141:{towgs84:`23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262`},EPSG_4204:{towgs84:`-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194`},EPSG_4319:{towgs84:`226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798`},EPSG_4200:{towgs84:`24.82,-131.21,-82.66`},EPSG_4130:{towgs84:`0,0,0`},EPSG_4127:{towgs84:`-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359`},EPSG_4149:{towgs84:`674.374,15.056,405.346`},EPSG_4617:{towgs84:`-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0`},EPSG_4663:{towgs84:`-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485`},EPSG_4664:{towgs84:`-211.939,137.626,58.3,-0.089,0.251,0.079,0.384`},EPSG_4665:{towgs84:`-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048`},EPSG_4666:{towgs84:`631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43`},EPSG_4756:{towgs84:`-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188`},EPSG_4723:{towgs84:`-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925`},EPSG_4726:{towgs84:`8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081`},EPSG_4267:{towgs84:`-8.0,160.0,176.0`},EPSG_5365:{towgs84:`-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693`},EPSG_4218:{towgs84:`304.5,306.5,-318.1`},EPSG_4242:{towgs84:`-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95`},EPSG_4216:{towgs84:`-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289`},ESRI_104105:{towgs84:`631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43`},ESRI_104129:{towgs84:`0,0,0`},EPSG_4673:{towgs84:`174.05,-25.49,112.57`},EPSG_4202:{towgs84:`-124,-60,154`},EPSG_4203:{towgs84:`-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191`},EPSG_3819:{towgs84:`595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408`},EPSG_8694:{towgs84:`-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169`},EPSG_4145:{towgs84:`275.57,676.78,229.6`},EPSG_4283:{towgs84:`61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994`},EPSG_4317:{towgs84:`2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266`},EPSG_4272:{towgs84:`59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993`},EPSG_4248:{towgs84:`-307.7,265.3,-363.5`},EPSG_5561:{towgs84:`24,-121,-76`},EPSG_5233:{towgs84:`-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338`},ESRI_104130:{towgs84:`-86,-98,-119`},ESRI_104102:{towgs84:`682,-203,480`},ESRI_37207:{towgs84:`7,-10,-26`},EPSG_4675:{towgs84:`59.935,118.4,-10.871`},ESRI_104109:{towgs84:`-89.121,-348.182,260.871`},ESRI_104112:{towgs84:`-185.583,-230.096,281.361`},ESRI_104113:{towgs84:`25.1,-275.6,222.6`},IGNF_WGS72G:{towgs84:`0,12,6`},IGNF_NTFG:{towgs84:`-168,-60,320`},IGNF_EFATE57G:{towgs84:`-127,-769,472`},IGNF_PGP50G:{towgs84:`324.8,153.6,172.1`},IGNF_REUN47G:{towgs84:`94,-948,-1262`},IGNF_CSG67G:{towgs84:`-186,230,110`},IGNF_GUAD48G:{towgs84:`-467,-16,-300`},IGNF_TAHI51G:{towgs84:`162,117,154`},IGNF_TAHAAG:{towgs84:`65,342,77`},IGNF_NUKU72G:{towgs84:`84,274,65`},IGNF_PETRELS72G:{towgs84:`365,194,166`},IGNF_WALL78G:{towgs84:`253,-133,-127`},IGNF_MAYO50G:{towgs84:`-382,-59,-262`},IGNF_TANNAG:{towgs84:`-139,-967,436`},IGNF_IGN72G:{towgs84:`-13,-348,292`},IGNF_ATIGG:{towgs84:`1118,23,66`},IGNF_FANGA84G:{towgs84:`150.57,158.33,118.32`},IGNF_RUSAT84G:{towgs84:`202.13,174.6,-15.74`},IGNF_KAUE70G:{towgs84:`126.74,300.1,-75.49`},IGNF_MOP90G:{towgs84:`-10.8,-1.8,12.77`},IGNF_MHPF67G:{towgs84:`338.08,212.58,-296.17`},IGNF_TAHI79G:{towgs84:`160.61,116.05,153.69`},IGNF_ANAA92G:{towgs84:`1.5,3.84,4.81`},IGNF_MARQUI72G:{towgs84:`330.91,-13.92,58.56`},IGNF_APAT86G:{towgs84:`143.6,197.82,74.05`},IGNF_TUBU69G:{towgs84:`237.17,171.61,-77.84`},IGNF_STPM50G:{towgs84:`11.363,424.148,373.13`},EPSG_4150:{towgs84:`674.374,15.056,405.346`},EPSG_4754:{towgs84:`-208.4058,-109.8777,-2.5764`},ESRI_104101:{towgs84:`374,150,588`},EPSG_4693:{towgs84:`0,-0.15,0.68`},EPSG_6207:{towgs84:`293.17,726.18,245.36`},EPSG_4153:{towgs84:`-133.63,-157.5,-158.62`},EPSG_4132:{towgs84:`-241.54,-163.64,396.06`},EPSG_4221:{towgs84:`-154.5,150.7,100.4`},EPSG_4266:{towgs84:`-80.7,-132.5,41.1`},EPSG_4193:{towgs84:`-70.9,-151.8,-41.4`},EPSG_5340:{towgs84:`-0.41,0.46,-0.35`},EPSG_4246:{towgs84:`-294.7,-200.1,525.5`},EPSG_4318:{towgs84:`-3.2,-5.7,2.8`},EPSG_4121:{towgs84:`-199.87,74.79,246.62`},EPSG_4223:{towgs84:`-260.1,5.5,432.2`},EPSG_4158:{towgs84:`-0.465,372.095,171.736`},EPSG_4285:{towgs84:`-128.16,-282.42,21.93`},EPSG_4613:{towgs84:`-404.78,685.68,45.47`},EPSG_4607:{towgs84:`195.671,332.517,274.607`},EPSG_4475:{towgs84:`-381.788,-57.501,-256.673`},EPSG_4208:{towgs84:`-157.84,308.54,-146.6`},EPSG_4743:{towgs84:`70.995,-335.916,262.898`},EPSG_4710:{towgs84:`-323.65,551.39,-491.22`},EPSG_7881:{towgs84:`-0.077,0.079,0.086`},EPSG_4682:{towgs84:`283.729,735.942,261.143`},EPSG_4739:{towgs84:`-156,-271,-189`},EPSG_4679:{towgs84:`-80.01,253.26,291.19`},EPSG_4750:{towgs84:`-56.263,16.136,-22.856`},EPSG_4644:{towgs84:`-10.18,-350.43,291.37`},EPSG_4695:{towgs84:`-103.746,-9.614,-255.95`},EPSG_4292:{towgs84:`-355,21,72`},EPSG_4302:{towgs84:`-61.702,284.488,472.052`},EPSG_4143:{towgs84:`-124.76,53,466.79`},EPSG_4606:{towgs84:`-153,153,307`},EPSG_4699:{towgs84:`-770.1,158.4,-498.2`},EPSG_4247:{towgs84:`-273.5,110.6,-357.9`},EPSG_4160:{towgs84:`8.88,184.86,106.69`},EPSG_4161:{towgs84:`-233.43,6.65,173.64`},EPSG_9251:{towgs84:`-9.5,122.9,138.2`},EPSG_9253:{towgs84:`-78.1,101.6,133.3`},EPSG_4297:{towgs84:`-198.383,-240.517,-107.909`},EPSG_4269:{towgs84:`0,0,0`},EPSG_4301:{towgs84:`-147,506,687`},EPSG_4618:{towgs84:`-59,-11,-52`},EPSG_4612:{towgs84:`0,0,0`},EPSG_4678:{towgs84:`44.585,-131.212,-39.544`},EPSG_4250:{towgs84:`-130,29,364`},EPSG_4144:{towgs84:`214,804,268`},EPSG_4147:{towgs84:`-17.51,-108.32,-62.39`},EPSG_4259:{towgs84:`-254.1,-5.36,-100.29`},EPSG_4164:{towgs84:`-76,-138,67`},EPSG_4211:{towgs84:`-378.873,676.002,-46.255`},EPSG_4182:{towgs84:`-422.651,-172.995,84.02`},EPSG_4224:{towgs84:`-143.87,243.37,-33.52`},EPSG_4225:{towgs84:`-205.57,168.77,-4.12`},EPSG_5527:{towgs84:`-67.35,3.88,-38.22`},EPSG_4752:{towgs84:`98,390,-22`},EPSG_4310:{towgs84:`-30,190,89`},EPSG_9248:{towgs84:`-192.26,65.72,132.08`},EPSG_4680:{towgs84:`124.5,-63.5,-281`},EPSG_4701:{towgs84:`-79.9,-158,-168.9`},EPSG_4706:{towgs84:`-146.21,112.63,4.05`},EPSG_4805:{towgs84:`682,-203,480`},EPSG_4201:{towgs84:`-165,-11,206`},EPSG_4210:{towgs84:`-157,-2,-299`},EPSG_4183:{towgs84:`-104,167,-38`},EPSG_4139:{towgs84:`11,72,-101`},EPSG_4668:{towgs84:`-86,-98,-119`},EPSG_4717:{towgs84:`-2,151,181`},EPSG_4732:{towgs84:`102,52,-38`},EPSG_4280:{towgs84:`-377,681,-50`},EPSG_4209:{towgs84:`-138,-105,-289`},EPSG_4261:{towgs84:`31,146,47`},EPSG_4658:{towgs84:`-73,46,-86`},EPSG_4721:{towgs84:`265.025,384.929,-194.046`},EPSG_4222:{towgs84:`-136,-108,-292`},EPSG_4601:{towgs84:`-255,-15,71`},EPSG_4602:{towgs84:`725,685,536`},EPSG_4603:{towgs84:`72,213.7,93`},EPSG_4605:{towgs84:`9,183,236`},EPSG_4621:{towgs84:`137,248,-430`},EPSG_4657:{towgs84:`-28,199,5`},EPSG_4316:{towgs84:`103.25,-100.4,-307.19`},EPSG_4642:{towgs84:`-13,-348,292`},EPSG_4698:{towgs84:`145,-187,103`},EPSG_4192:{towgs84:`-206.1,-174.7,-87.7`},EPSG_4311:{towgs84:`-265,120,-358`},EPSG_4135:{towgs84:`58,-283,-182`},ESRI_104138:{towgs84:`198,-226,-347`},EPSG_4245:{towgs84:`-11,851,5`},EPSG_4142:{towgs84:`-125,53,467`},EPSG_4213:{towgs84:`-106,-87,188`},EPSG_4253:{towgs84:`-133,-77,-51`},EPSG_4129:{towgs84:`-132,-110,-335`},EPSG_4713:{towgs84:`-77,-128,142`},EPSG_4239:{towgs84:`217,823,299`},EPSG_4146:{towgs84:`295,736,257`},EPSG_4155:{towgs84:`-83,37,124`},EPSG_4165:{towgs84:`-173,253,27`},EPSG_4672:{towgs84:`175,-38,113`},EPSG_4236:{towgs84:`-637,-549,-203`},EPSG_4251:{towgs84:`-90,40,88`},EPSG_4271:{towgs84:`-2,374,172`},EPSG_4175:{towgs84:`-88,4,101`},EPSG_4716:{towgs84:`298,-304,-375`},EPSG_4315:{towgs84:`-23,259,-9`},EPSG_4744:{towgs84:`-242.2,-144.9,370.3`},EPSG_4244:{towgs84:`-97,787,86`},EPSG_4293:{towgs84:`616,97,-251`},EPSG_4714:{towgs84:`-127,-769,472`},EPSG_4736:{towgs84:`260,12,-147`},EPSG_6883:{towgs84:`-235,-110,393`},EPSG_6894:{towgs84:`-63,176,185`},EPSG_4205:{towgs84:`-43,-163,45`},EPSG_4256:{towgs84:`41,-220,-134`},EPSG_4262:{towgs84:`639,405,60`},EPSG_4604:{towgs84:`174,359,365`},EPSG_4169:{towgs84:`-115,118,426`},EPSG_4620:{towgs84:`-106,-129,165`},EPSG_4184:{towgs84:`-203,141,53`},EPSG_4616:{towgs84:`-289,-124,60`},EPSG_9403:{towgs84:`-307,-92,127`},EPSG_4684:{towgs84:`-133,-321,50`},EPSG_4708:{towgs84:`-491,-22,435`},EPSG_4707:{towgs84:`114,-116,-333`},EPSG_4709:{towgs84:`145,75,-272`},EPSG_4712:{towgs84:`-205,107,53`},EPSG_4711:{towgs84:`124,-234,-25`},EPSG_4718:{towgs84:`230,-199,-752`},EPSG_4719:{towgs84:`211,147,111`},EPSG_4724:{towgs84:`208,-435,-229`},EPSG_4725:{towgs84:`189,-79,-202`},EPSG_4735:{towgs84:`647,1777,-1124`},EPSG_4722:{towgs84:`-794,119,-298`},EPSG_4728:{towgs84:`-307,-92,127`},EPSG_4734:{towgs84:`-632,438,-609`},EPSG_4727:{towgs84:`912,-58,1227`},EPSG_4729:{towgs84:`185,165,42`},EPSG_4730:{towgs84:`170,42,84`},EPSG_4733:{towgs84:`276,-57,149`},ESRI_37218:{towgs84:`230,-199,-752`},ESRI_37240:{towgs84:`-7,215,225`},ESRI_37221:{towgs84:`252,-209,-751`},ESRI_4305:{towgs84:`-123,-206,219`},ESRI_104139:{towgs84:`-73,-247,227`},EPSG_4748:{towgs84:`51,391,-36`},EPSG_4219:{towgs84:`-384,664,-48`},EPSG_4255:{towgs84:`-333,-222,114`},EPSG_4257:{towgs84:`-587.8,519.75,145.76`},EPSG_4646:{towgs84:`-963,510,-359`},EPSG_6881:{towgs84:`-24,-203,268`},EPSG_6882:{towgs84:`-183,-15,273`},EPSG_4715:{towgs84:`-104,-129,239`},IGNF_RGF93GDD:{towgs84:`0,0,0`},IGNF_RGM04GDD:{towgs84:`0,0,0`},IGNF_RGSPM06GDD:{towgs84:`0,0,0`},IGNF_RGTAAF07GDD:{towgs84:`0,0,0`},IGNF_RGFG95GDD:{towgs84:`0,0,0`},IGNF_RGNCG:{towgs84:`0,0,0`},IGNF_RGPFGDD:{towgs84:`0,0,0`},IGNF_ETRS89G:{towgs84:`0,0,0`},IGNF_RGR92GDD:{towgs84:`0,0,0`},EPSG_4173:{towgs84:`0,0,0`},EPSG_4180:{towgs84:`0,0,0`},EPSG_4619:{towgs84:`0,0,0`},EPSG_4667:{towgs84:`0,0,0`},EPSG_4075:{towgs84:`0,0,0`},EPSG_6706:{towgs84:`0,0,0`},EPSG_7798:{towgs84:`0,0,0`},EPSG_4661:{towgs84:`0,0,0`},EPSG_4669:{towgs84:`0,0,0`},EPSG_8685:{towgs84:`0,0,0`},EPSG_4151:{towgs84:`0,0,0`},EPSG_9702:{towgs84:`0,0,0`},EPSG_4758:{towgs84:`0,0,0`},EPSG_4761:{towgs84:`0,0,0`},EPSG_4765:{towgs84:`0,0,0`},EPSG_8997:{towgs84:`0,0,0`},EPSG_4023:{towgs84:`0,0,0`},EPSG_4670:{towgs84:`0,0,0`},EPSG_4694:{towgs84:`0,0,0`},EPSG_4148:{towgs84:`0,0,0`},EPSG_4163:{towgs84:`0,0,0`},EPSG_4167:{towgs84:`0,0,0`},EPSG_4189:{towgs84:`0,0,0`},EPSG_4190:{towgs84:`0,0,0`},EPSG_4176:{towgs84:`0,0,0`},EPSG_4659:{towgs84:`0,0,0`},EPSG_3824:{towgs84:`0,0,0`},EPSG_3889:{towgs84:`0,0,0`},EPSG_4046:{towgs84:`0,0,0`},EPSG_4081:{towgs84:`0,0,0`},EPSG_4558:{towgs84:`0,0,0`},EPSG_4483:{towgs84:`0,0,0`},EPSG_5013:{towgs84:`0,0,0`},EPSG_5264:{towgs84:`0,0,0`},EPSG_5324:{towgs84:`0,0,0`},EPSG_5354:{towgs84:`0,0,0`},EPSG_5371:{towgs84:`0,0,0`},EPSG_5373:{towgs84:`0,0,0`},EPSG_5381:{towgs84:`0,0,0`},EPSG_5393:{towgs84:`0,0,0`},EPSG_5489:{towgs84:`0,0,0`},EPSG_5593:{towgs84:`0,0,0`},EPSG_6135:{towgs84:`0,0,0`},EPSG_6365:{towgs84:`0,0,0`},EPSG_5246:{towgs84:`0,0,0`},EPSG_7886:{towgs84:`0,0,0`},EPSG_8431:{towgs84:`0,0,0`},EPSG_8427:{towgs84:`0,0,0`},EPSG_8699:{towgs84:`0,0,0`},EPSG_8818:{towgs84:`0,0,0`},EPSG_4757:{towgs84:`0,0,0`},EPSG_9140:{towgs84:`0,0,0`},EPSG_8086:{towgs84:`0,0,0`},EPSG_4686:{towgs84:`0,0,0`},EPSG_4737:{towgs84:`0,0,0`},EPSG_4702:{towgs84:`0,0,0`},EPSG_4747:{towgs84:`0,0,0`},EPSG_4749:{towgs84:`0,0,0`},EPSG_4674:{towgs84:`0,0,0`},EPSG_4755:{towgs84:`0,0,0`},EPSG_4759:{towgs84:`0,0,0`},EPSG_4762:{towgs84:`0,0,0`},EPSG_4763:{towgs84:`0,0,0`},EPSG_4764:{towgs84:`0,0,0`},EPSG_4166:{towgs84:`0,0,0`},EPSG_4170:{towgs84:`0,0,0`},EPSG_5546:{towgs84:`0,0,0`},EPSG_7844:{towgs84:`0,0,0`},EPSG_4818:{towgs84:`589,76,480`}};for(var pr in fr){var mr=fr[pr];mr.datumName&&(fr[mr.datumName]=mr)}var hr=fr;function gr(e,t,n,r,i,a,o){var s={};return e===void 0||e===`none`?s.datum_type=Lt:s.datum_type=It,t&&(s.datum_params=t.map(parseFloat),(s.datum_params[0]!==0||s.datum_params[1]!==0||s.datum_params[2]!==0)&&(s.datum_type=Nt),s.datum_params.length>3&&(s.datum_params[3]!==0||s.datum_params[4]!==0||s.datum_params[5]!==0||s.datum_params[6]!==0)&&(s.datum_type=Pt,s.datum_params[3]*=Vt,s.datum_params[4]*=Vt,s.datum_params[5]*=Vt,s.datum_params[6]=s.datum_params[6]/1e6+1)),o&&(s.datum_type=Ft,s.grids=o),s.a=n,s.b=r,s.es=i,s.ep2=a,s}var _r=gr,vr={};function yr(e,t,n){return t instanceof ArrayBuffer?br(e,t,n):{ready:xr(e,t)}}function br(e,t,n){var r=!0;n!==void 0&&n.includeErrorFields===!1&&(r=!1);var i=new DataView(t),a=Er(i),o=Dr(i,a),s={header:o,subgrids:kr(i,o,a,r)};return vr[e]=s,s}async function xr(e,t){for(var n=[],r=await t.getImageCount(),i=r-1;i>=0;i--){var a=await t.getImage(i),o=await a.readRasters(),s=[a.getWidth(),a.getHeight()],c=a.getBoundingBox().map(wr),l=[a.fileDirectory.ModelPixelScale[0],a.fileDirectory.ModelPixelScale[1]].map(wr),u=c[0]+(s[0]-1)*l[0],d=c[3]-(s[1]-1)*l[1],f=o[0],p=o[1],m=[];for(let e=s[1]-1;e>=0;e--)for(let t=s[0]-1;t>=0;t--){var h=e*s[0]+t;m.push([-Tr(p[h]),Tr(f[h])])}n.push({del:l,lim:s,ll:[-u,d],cvs:m})}var g={header:{nSubgrids:r},subgrids:n};return vr[e]=g,g}function Sr(e){return e===void 0?null:e.split(`,`).map(Cr)}function Cr(e){if(e.length===0)return null;var t=e[0]===`@`;return t&&(e=e.slice(1)),e===`null`?{name:`null`,mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:vr[e]||null,isNull:!1}}function wr(e){return e*Math.PI/180}function Tr(e){return e/3600*Math.PI/180}function Er(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn(`Failed to detect nadgrid endian-ness, defaulting to little-endian`),!0)}function Dr(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Or(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function Or(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function kr(e,t,n,r){for(var i=176,a=[],o=0;o<t.nSubgrids;o++){var s=jr(e,i,n),c=Mr(e,i,s,n,r),l=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);a.push({ll:[Tr(s.lowerLongitude),Tr(s.lowerLatitude)],del:[Tr(s.longitudeInterval),Tr(s.latitudeInterval)],lim:[l,u],count:s.gridNodeCount,cvs:Ar(c)});var d=16;r===!1&&(d=8),i+=176+s.gridNodeCount*d}return a}function Ar(e){return e.map(function(e){return[Tr(e.longitudeShift),Tr(e.latitudeShift)]})}function jr(e,t,n){return{name:Or(e,t+8,t+16).trim(),parent:Or(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function Mr(e,t,n,r,i){var a=t+176,o=16;i===!1&&(o=8);for(var s=[],c=0;c<n.gridNodeCount;c++){var l={latitudeShift:e.getFloat32(a+c*o,r),longitudeShift:e.getFloat32(a+c*o+4,r)};i!==!1&&(l.latitudeAccuracy=e.getFloat32(a+c*o+8,r),l.longitudeAccuracy=e.getFloat32(a+c*o+12,r)),s.push(l)}return s}function Nr(e,t){if(!(this instanceof Nr))return new Nr(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,t||=function(e){if(e)throw e};var n=Vn(e);if(typeof n!=`object`){t(`Could not parse to valid json: `+e);return}var r=Nr.projections.get(n.projName);if(!r){t(`Could not get projection name from: `+e);return}if(n.datumCode&&n.datumCode!==`none`){var i=Yt(hr,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(`,`):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||`enu`,n.ellps=n.ellps||`wgs84`,n.lat1=n.lat1||n.lat0;var a=dr(n.a,n.b,n.rf,n.ellps,n.sphere),o=ur(a.a,a.b,a.rf,n.R_A),s=Sr(n.nadgrids),c=n.datum||_r(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);Hn(this,n),Hn(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=c,`init`in this&&typeof this.init==`function`&&this.init(),t(null,this)}Nr.projections=sr,Nr.projections.start();var Pr=Nr;function Fr(e,t){return e.datum_type===t.datum_type?e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===Nt?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===Pt?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0:!1}function Ir(e,t,n){var r=e.x,i=e.y,a=e.z?e.z:0,o,s,c,l;if(i<-R&&i>-1.001*R)i=-R;else if(i>R&&i<1.001*R)i=R;else if(i<-R)return{x:-1/0,y:-1/0,z:e.z};else if(i>R)return{x:1/0,y:1/0,z:e.z};return r>Math.PI&&(r-=2*Math.PI),s=Math.sin(i),l=Math.cos(i),c=s*s,o=n/Math.sqrt(1-t*c),{x:(o+a)*l*Math.cos(r),y:(o+a)*l*Math.sin(r),z:(o*(1-t)+a)*s}}function Lr(e,t,n,r){var i=1e-12,a=i*i,o=30,s,c,l,u,d,f,p,m,h,g,_,v,y,b=e.x,x=e.y,S=e.z?e.z:0,C,w,T;if(s=Math.sqrt(b*b+x*x),c=Math.sqrt(b*b+x*x+S*S),s/n<i){if(C=0,c/n<i)return w=R,T=-r,{x:e.x,y:e.y,z:e.z}}else C=Math.atan2(x,b);l=S/c,u=s/c,d=1/Math.sqrt(1-t*(2-t)*u*u),m=u*(1-t)*d,h=l*d,y=0;do y++,p=n/Math.sqrt(1-t*h*h),T=s*m+S*h-p*(1-t*h*h),f=t*p/(p+T),d=1/Math.sqrt(1-f*(2-f)*u*u),g=u*(1-f)*d,_=l*d,v=_*m-g*h,m=g,h=_;while(v*v>a&&y<o);return w=Math.atan(_/Math.abs(g)),{x:C,y:w,z:T}}function Rr(e,t,n){if(t===Nt)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(t===Pt){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6];return{x:l*(e.x-c*e.y+s*e.z)+r,y:l*(c*e.x+e.y-o*e.z)+i,z:l*(-s*e.x+o*e.y+e.z)+a}}}function zr(e,t,n){if(t===Nt)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(t===Pt){var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=(e.x-r)/l,d=(e.y-i)/l,f=(e.z-a)/l;return{x:u+c*d-s*f,y:-c*u+d+o*f,z:s*u-o*d+f}}}function Br(e){return e===Nt||e===Pt}function Vr(e,t,n){if(Fr(e,t)||e.datum_type===Lt||t.datum_type===Lt)return n;var r=e.a,i=e.es;if(e.datum_type===Ft){if(Hr(e,!1,n)!==0)return;r=Rt,i=Bt}var a=t.a,o=t.b,s=t.es;if(t.datum_type===Ft&&(a=Rt,o=zt,s=Bt),i===s&&r===a&&!Br(e.datum_type)&&!Br(t.datum_type)||(n=Ir(n,i,r),Br(e.datum_type)&&(n=Rr(n,e.datum_type,e.datum_params)),Br(t.datum_type)&&(n=zr(n,t.datum_type,t.datum_params)),n=Lr(n,s,a,o),!(t.datum_type===Ft&&Hr(t,!0,n)!==0)))return n}function Hr(e,t,n){if(e.grids===null||e.grids.length===0)return console.log(`Grid shift grids not found`),-1;var r={x:-n.x,y:n.y},i={x:NaN,y:NaN},a=[];outer:for(var o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){i=r;break}if(s.grid===null){if(s.mandatory)return console.log(`Unable to find mandatory grid '`+s.name+`'`),-1;continue}for(var c=s.grid.subgrids,l=0,u=c.length;l<u;l++){var d=c[l],f=(Math.abs(d.del[1])+Math.abs(d.del[0]))/1e4,p=d.ll[0]-f,m=d.ll[1]-f,h=d.ll[0]+(d.lim[0]-1)*d.del[0]+f,g=d.ll[1]+(d.lim[1]-1)*d.del[1]+f;if(!(m>r.y||p>r.x||g<r.y||h<r.x)&&(i=Ur(r,t,d),!isNaN(i.x)))break outer}}return isNaN(i.x)?(console.log(`Failed to find a grid shift table for location '`+-r.x*V+` `+r.y*V+` tried: '`+a+`'`),-1):(n.x=-i.x,n.y=i.y,0)}function Ur(e,t,n){var r={x:NaN,y:NaN};if(isNaN(e.x))return r;var i={x:e.x,y:e.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=K(i.x-Math.PI)+Math.PI;var a=Wr(i,n);if(t){if(isNaN(a.x))return r;a.x=i.x-a.x,a.y=i.y-a.y;var o=9,s=1e-12,c,l;do{if(l=Wr(a,n),isNaN(l.x)){console.log(`Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.`);break}c={x:i.x-(l.x+a.x),y:i.y-(l.y+a.y)},a.x+=c.x,a.y+=c.y}while(o--&&Math.abs(c.x)>s&&Math.abs(c.y)>s);if(o<0)return console.log(`Inverse grid shift iterator failed to converge.`),r;r.x=K(a.x+n.ll[0]),r.y=a.y+n.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Wr(e,t){var n={x:e.x/t.del[0],y:e.y/t.del[1]},r={x:Math.floor(n.x),y:Math.floor(n.y)},i={x:n.x-1*r.x,y:n.y-1*r.y},a={x:NaN,y:NaN},o;if(r.x<0||r.x>=t.lim[0]||r.y<0||r.y>=t.lim[1])return a;o=r.y*t.lim[0]+r.x;var s={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var c={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var l={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var u={x:t.cvs[o][0],y:t.cvs[o][1]},d=i.x*i.y,f=i.x*(1-i.y),p=(1-i.x)*(1-i.y),m=(1-i.x)*i.y;return a.x=p*s.x+f*c.x+m*u.x+d*l.x,a.y=p*s.y+f*c.y+m*u.y+d*l.y,a}function Gr(e,t,n){var r=n.x,i=n.y,a=n.z||0,o,s,c,l={};for(c=0;c<3;c++)if(!(t&&c===2&&n.z===void 0))switch(c===0?(o=r,s=`ew`.indexOf(e.axis[c])===-1?`y`:`x`):c===1?(o=i,s=`ns`.indexOf(e.axis[c])===-1?`x`:`y`):(o=a,s=`z`),e.axis[c]){case`e`:l[s]=o;break;case`w`:l[s]=-o;break;case`n`:l[s]=o;break;case`s`:l[s]=-o;break;case`u`:n[s]!==void 0&&(l.z=o);break;case`d`:n[s]!==void 0&&(l.z=-o);break;default:return null}return l}function Kr(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function qr(e){Jr(e.x),Jr(e.y)}function Jr(e){if(typeof Number.isFinite==`function`){if(Number.isFinite(e))return;throw TypeError(`coordinates must be finite numbers`)}if(typeof e!=`number`||e!==e||!isFinite(e))throw TypeError(`coordinates must be finite numbers`)}function Yr(e,t){return(e.datum.datum_type===Nt||e.datum.datum_type===Pt||e.datum.datum_type===Ft)&&t.datumCode!==`WGS84`||(t.datum.datum_type===Nt||t.datum.datum_type===Pt||t.datum.datum_type===Ft)&&e.datumCode!==`WGS84`}function Xr(e,t,n,r){var i;n=Array.isArray(n)?Kr(n):{x:n.x,y:n.y,z:n.z,m:n.m};var a=n.z!==void 0;if(qr(n),e.datum&&t.datum&&Yr(e,t)&&(i=new Pr(`WGS84`),n=Xr(e,i,n,r),e=i),r&&e.axis!==`enu`&&(n=Gr(e,!1,n)),e.projName===`longlat`)n={x:n.x*B,y:n.y*B,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),n=e.inverse(n),!n)return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=Vr(e.datum,t.datum,n),n)return n=n,t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),t.projName===`longlat`?n={x:n.x*V,y:n.y*V,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),r&&t.axis!==`enu`?Gr(t,!0,n):(n&&!a&&delete n.z,n)}var Zr=Pr(`WGS84`);function Qr(e,t,n,r){var i,a,o;return Array.isArray(n)?(i=Xr(e,t,n,r)||{x:NaN,y:NaN},n.length>2?e.name!==void 0&&e.name===`geocent`||t.name!==void 0&&t.name===`geocent`?typeof i.z==`number`?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2)):[i.x,i.y]):(a=Xr(e,t,n,r),o=Object.keys(n),o.length===2||o.forEach(function(r){if(e.name!==void 0&&e.name===`geocent`||t.name!==void 0&&t.name===`geocent`){if(r===`x`||r===`y`||r===`z`)return}else if(r===`x`||r===`y`)return;a[r]=n[r]}),a)}function $r(e){return e instanceof Pr?e:typeof e==`object`&&`oProj`in e?e.oProj:Pr(e)}function ei(e,t,n){var r,i,a=!1,o;return t===void 0?(i=$r(e),r=Zr,a=!0):(t.x!==void 0||Array.isArray(t))&&(n=t,i=$r(e),r=Zr,a=!0),r||=$r(e),i||=$r(t),n?Qr(r,i,n):(o={forward:function(e,t){return Qr(r,i,e,t)},inverse:function(e,t){return Qr(i,r,e,t)}},a&&(o.oProj=i),o)}var ti=ei,ni=6,ri=`AJSAJS`,ii=`AFAFAF`,ai=65,q=73,J=79,oi=86,si=90,ci={forward:li,inverse:ui,toPoint:di};function li(e,t){return t||=5,_i(mi({lat:e[1],lon:e[0]}),t)}function ui(e){var t=hi(xi(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function di(e){var t=hi(xi(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function fi(e){return e*(Math.PI/180)}function pi(e){return 180*(e/Math.PI)}function mi(e){var t=e.lat,n=e.lon,r=6378137,i=.00669438,a=.9996,o,s,c,l,u,d,f,p=fi(t),m=fi(n),h,g=Math.floor((n+180)/6)+1;n===180&&(g=60),t>=56&&t<64&&n>=3&&n<12&&(g=32),t>=72&&t<84&&(n>=0&&n<9?g=31:n>=9&&n<21?g=33:n>=21&&n<33?g=35:n>=33&&n<42&&(g=37)),o=(g-1)*6-180+3,h=fi(o),s=i/(1-i),c=r/Math.sqrt(1-i*Math.sin(p)*Math.sin(p)),l=Math.tan(p)*Math.tan(p),u=s*Math.cos(p)*Math.cos(p),d=Math.cos(p)*(m-h),f=r*((1-i/4-3*i*i/64-5*i*i*i/256)*p-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*p)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*p)-35*i*i*i/3072*Math.sin(6*p));var _=a*c*(d+(1-l+u)*d*d*d/6+(5-18*l+l*l+72*u-58*s)*d*d*d*d*d/120)+5e5,v=a*(f+c*Math.tan(p)*(d*d/2+(5-l+9*u+4*u*u)*d*d*d*d/24+(61-58*l+l*l+600*u-330*s)*d*d*d*d*d*d/720));return t<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(_),zoneNumber:g,zoneLetter:gi(t)}}function hi(e){var t=e.northing,n=e.easting,r=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var a=.9996,o=6378137,s=.00669438,c,l=(1-Math.sqrt(1-s))/(1+Math.sqrt(1-s)),u,d,f,p,m,h,g,_,v,y=n-5e5,b=t;r<`N`&&(b-=1e7),g=(i-1)*6-180+3,c=s/(1-s),h=b/a,_=h/(o*(1-s/4-3*s*s/64-5*s*s*s/256)),v=_+(3*l/2-27*l*l*l/32)*Math.sin(2*_)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*_)+151*l*l*l/96*Math.sin(6*_),u=o/Math.sqrt(1-s*Math.sin(v)*Math.sin(v)),d=Math.tan(v)*Math.tan(v),f=c*Math.cos(v)*Math.cos(v),p=o*(1-s)/(1-s*Math.sin(v)*Math.sin(v))**1.5,m=y/(u*a);var x=v-u*Math.tan(v)/p*(m*m/2-(5+3*d+10*f-4*f*f-9*c)*m*m*m*m/24+(61+90*d+298*f+45*d*d-252*c-3*f*f)*m*m*m*m*m*m/720);x=pi(x);var S=(m-(1+2*d+f)*m*m*m/6+(5-2*f+28*d-3*f*f+8*c+24*d*d)*m*m*m*m*m/120)/Math.cos(v);S=g+pi(S);var C;if(e.accuracy){var w=hi({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});C={top:w.lat,right:w.lon,bottom:x,left:S}}else C={lat:x,lon:S};return C}function gi(e){var t=`Z`;return 84>=e&&e>=72?t=`X`:72>e&&e>=64?t=`W`:64>e&&e>=56?t=`V`:56>e&&e>=48?t=`U`:48>e&&e>=40?t=`T`:40>e&&e>=32?t=`S`:32>e&&e>=24?t=`R`:24>e&&e>=16?t=`Q`:16>e&&e>=8?t=`P`:8>e&&e>=0?t=`N`:0>e&&e>=-8?t=`M`:-8>e&&e>=-16?t=`L`:-16>e&&e>=-24?t=`K`:-24>e&&e>=-32?t=`J`:-32>e&&e>=-40?t=`H`:-40>e&&e>=-48?t=`G`:-48>e&&e>=-56?t=`F`:-56>e&&e>=-64?t=`E`:-64>e&&e>=-72?t=`D`:-72>e&&e>=-80&&(t=`C`),t}function _i(e,t){var n=`00000`+e.easting,r=`00000`+e.northing;return e.zoneNumber+e.zoneLetter+vi(e.easting,e.northing,e.zoneNumber)+n.substr(n.length-5,t)+r.substr(r.length-5,t)}function vi(e,t,n){var r=yi(n);return bi(Math.floor(e/1e5),Math.floor(t/1e5)%20,r)}function yi(e){var t=e%ni;return t===0&&(t=ni),t}function bi(e,t,n){var r=n-1,i=ri.charCodeAt(r),a=ii.charCodeAt(r),o=i+e-1,s=a+t,c=!1;return o>si&&(o=o-si+ai-1,c=!0),(o===q||i<q&&o>q||(o>q||i<q)&&c)&&o++,(o===J||i<J&&o>J||(o>J||i<J)&&c)&&(o++,o===q&&o++),o>si&&(o=o-si+ai-1),s>oi?(s=s-oi+ai-1,c=!0):c=!1,(s===q||a<q&&s>q||(s>q||a<q)&&c)&&s++,(s===J||a<J&&s>J||(s>J||a<J)&&c)&&(s++,s===q&&s++),s>oi&&(s=s-oi+ai-1),String.fromCharCode(o)+String.fromCharCode(s)}function xi(e){if(e&&e.length===0)throw`MGRSPoint coverting from nothing`;for(var t=e.length,n=null,r=``,i,a=0;!/[A-Z]/.test(i=e.charAt(a));){if(a>=2)throw`MGRSPoint bad conversion from: `+e;r+=i,a++}var o=parseInt(r,10);if(a===0||a+3>t)throw`MGRSPoint bad conversion from: `+e;var s=e.charAt(a++);if(s<=`A`||s===`B`||s===`Y`||s>=`Z`||s===`I`||s===`O`)throw`MGRSPoint zone letter `+s+` not handled: `+e;n=e.substring(a,a+=2);for(var c=yi(o),l=Si(n.charAt(0),c),u=Ci(n.charAt(1),c);u<wi(s);)u+=2e6;var d=t-a;if(d%2!=0)throw`MGRSPoint has to have an even number
2
2
  of digits after the zone letter and two 100km letters - front
3
3
  half for easting meters, second half for
4
- northing meters`+e;var f=d/2,p=0,m=0,h,g,_,v,y;return f>0&&(h=1e5/10**f,g=e.substring(a,a+f),p=parseFloat(g)*h,_=e.substring(a+f),m=parseFloat(_)*h),v=p+l,y=m+u,{easting:v,northing:y,zoneLetter:s,zoneNumber:o,accuracy:h}}function Si(e,t){for(var n=ri.charCodeAt(t-1),r=1e5,i=!1;n!==e.charCodeAt(0);){if(n++,n===q&&n++,n===J&&n++,n>si){if(i)throw`Bad character: `+e;n=ai,i=!0}r+=1e5}return r}function Ci(e,t){if(e>`V`)throw`MGRSPoint given invalid Northing `+e;for(var n=ii.charCodeAt(t-1),r=0,i=!1;n!==e.charCodeAt(0);){if(n++,n===q&&n++,n===J&&n++,n>oi){if(i)throw`Bad character: `+e;n=ai,i=!0}r+=1e5}return r}function wi(e){var t;switch(e){case`C`:t=11e5;break;case`D`:t=2e6;break;case`E`:t=28e5;break;case`F`:t=37e5;break;case`G`:t=46e5;break;case`H`:t=55e5;break;case`J`:t=64e5;break;case`K`:t=73e5;break;case`L`:t=82e5;break;case`M`:t=91e5;break;case`N`:t=0;break;case`P`:t=8e5;break;case`Q`:t=17e5;break;case`R`:t=26e5;break;case`S`:t=35e5;break;case`T`:t=44e5;break;case`U`:t=53e5;break;case`V`:t=62e5;break;case`W`:t=7e6;break;case`X`:t=79e5;break;default:t=-1}if(t>=0)return t;throw`Invalid zone letter: `+e}function Ti(e,t,n){if(!(this instanceof Ti))return new Ti(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==`object`)this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==`string`&&t===void 0){var r=e.split(`,`);this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=e,this.y=t,this.z=n||0;console.warn(`proj4.Point will be removed in version 3, use proj4.toPoint`)}Ti.fromMGRS=function(e){return new Ti(di(e))},Ti.prototype.toMGRS=function(e){return li([this.x,this.y],e)};var Ei=Ti,Di=1,Oi=.25,ki=.046875,Ai=.01953125,ji=.01068115234375,Mi=.75,Ni=.46875,Pi=.013020833333333334,Fi=.007120768229166667,Ii=.3645833333333333,Li=.005696614583333333,Ri=.3076171875;function zi(e){var t=[];t[0]=Di-e*(Oi+e*(ki+e*(Ai+e*ji))),t[1]=e*(Mi-e*(ki+e*(Ai+e*ji)));var n=e*e;return t[2]=n*(Ni-e*(Pi+e*Fi)),n*=e,t[3]=n*(Ii-e*Li),t[4]=n*e*Ri,t}function Bi(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))}var Vi=20;function Hi(e,t,n){for(var r=1/(1-t),i=e,a=Vi;a;--a){var o=Math.sin(i),s=1-t*o*o;if(s=(Bi(i,o,Math.cos(i),n)-e)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)<z)return i}return i}function Ui(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.es&&(this.en=zi(this.es),this.ml0=Bi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Wi(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i,a,o,s=Math.sin(n),c=Math.cos(n);if(this.es){var l=c*r,u=l**2,d=this.ep2*c**2,f=d**2,p=(Math.abs(c)>z?Math.tan(n):0)**2,m=p**2;i=1-this.es*s**2,l/=Math.sqrt(i);var h=Bi(n,s,c,this.en);a=this.a*(this.k0*l*(1+u/6*(1-p+d+u/20*(5-18*p+m+14*d-58*p*d+u/42*(61+179*m-m*p-479*p)))))+this.x0,o=this.a*(this.k0*(h-this.ml0+s*r*l/2*(1+u/12*(5-p+9*d+4*f+u/30*(61+m-58*p+270*d-330*p*d+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=c*Math.sin(r);if(Math.abs(Math.abs(g)-1)<z)return 93;if(a=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,o=c*Math.cos(r)/Math.sqrt(1-g**2),g=Math.abs(o),g>=1){if(g-1>z)return 93;o=0}else o=Math.acos(o);n<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return e.x=a,e.y=o,e}function Gi(e){var t,n,r,i,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,n=Hi(t,this.es,this.en),Math.abs(n)<R){var s=Math.sin(n),c=Math.cos(n),l=Math.abs(c)>z?Math.tan(n):0,u=this.ep2*c**2,d=u**2,f=l**2,p=f**2;t=1-this.es*s**2;var m=a*Math.sqrt(t)/this.k0,h=m**2;t*=l,r=n-t*h/(1-this.es)*.5*(1-h/12*(5+3*f-9*u*f+u-4*d-h/30*(61+90*f-252*u*f+45*p+46*u-h/56*(1385+3633*f+4095*p+1574*p*f)))),i=K(this.long0+m*(1-h/6*(1+2*f+u-h/20*(5+28*f+24*p+8*u*f+6*u-h/42*(61+662*f+1320*p+720*p*f))))/c,this.over)}else r=R*Wn(o),i=0;else{var g=Math.exp(a/this.k0),_=.5*(g-1/g),v=this.lat0+o/this.k0,y=Math.cos(v);t=Math.sqrt((1-y**2)/(1+_**2)),r=Math.asin(t),o<0&&(r=-r),i=_===0&&y===0?0:K(Math.atan2(_,y)+this.long0,this.over)}return e.x=i,e.y=r,e}var Ki={init:Ui,forward:Wi,inverse:Gi,names:[`Fast_Transverse_Mercator`,`Fast Transverse Mercator`]};function qi(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Y(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+r**2)}function Ji(e){var t=1+e,n=t-1;return n===0?e:e*Math.log(t)/n}function Yi(e){var t=Math.abs(e);return t=Ji(t*(1+t/(Y(1,t)+1))),e<0?-t:t}function Xi(e,t){for(var n=2*Math.cos(2*t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return t+o*Math.sin(2*t)}function Zi(e,t){for(var n=2*Math.cos(t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return Math.sin(t)*o}function Qi(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function $i(e,t,n){for(var r=Math.sin(t),i=Math.cos(t),a=qi(n),o=Qi(n),s=2*i*o,c=-2*r*a,l=e.length-1,u=e[l],d=0,f=0,p=0,m,h;--l>=0;)m=f,h=d,f=u,d=p,u=-m+s*f-c*d+e[l],p=-h+c*f+s*d;return s=r*o,c=i*a,[s*u-c*p,s*p+c*u]}function ea(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw Error(`Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.`);this.approx&&(Ki.init.apply(this),this.forward=Ki.forward,this.inverse=Ki.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+-2854/675*t))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+4642/4725*t))))),n*=t,this.cgb[1]=n*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+2323/945*t)))),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+-1522/945*t)))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+73814/2835*t))),this.cbg[2]=n*(-26/15+t*(34/21+t*(8/5+-12686/2835*t))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+-399572/14175*t)),this.cbg[3]=n*(1237/630+t*(-12/5+-24832/14175*t)),n*=t,this.cgb[4]=n*(4174/315+-144838/6237*t),this.cbg[4]=n*(-734/315+109598/31185*t),n*=t,this.cgb[5]=601676/22275*n,this.cbg[5]=444337/155925*n,n=t**2,this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+-96199/604800*t))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+7891/37800*t))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+1118711/3870720*t)))),this.gtu[1]=n*(13/48+t*(-3/5+t*(557/1440+t*(281/630+-1983433/1935360*t)))),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+-5569/90720*t))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+167603/181440*t))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+830251/7257600*t)),this.gtu[3]=n*(49561/161280+t*(-179/168+6601661/7257600*t)),n*=t,this.utg[4]=n*(-4583/161280+108847/3991680*t),this.gtu[4]=n*(34729/80640+-3418889/1995840*t),n*=t,this.utg[5]=-20648693/638668800*n,this.gtu[5]=212378941/319334400*n;var r=Xi(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Zi(this.gtu,2*r))}function ta(e){var t=K(e.x-this.long0,this.over),n=e.y;n=Xi(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(r,o*i),t=Math.atan2(a*i,Y(r,i*o)),t=Yi(Math.tan(t));var s=$i(this.gtu,2*n,2*t);n+=s[0],t+=s[1];var c,l;return Math.abs(t)<=2.623395162778?(c=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function na(e){var t=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,t/=this.Qn;var r,i;if(Math.abs(t)<=2.623395162778){var a=$i(this.utg,2*n,2*t);n+=a[0],t+=a[1],t=Math.atan(qi(t));var o=Math.sin(n),s=Math.cos(n),c=Math.sin(t),l=Math.cos(t);n=Math.atan2(o*l,Y(c,l*s)),t=Math.atan2(c,l*s),r=K(t+this.long0,this.over),i=Xi(this.cgb,n)}else r=1/0,i=1/0;return e.x=r,e.y=i,e}var ra={init:ea,forward:ta,inverse:na,names:[`Extended_Transverse_Mercator`,`Extended Transverse Mercator`,`etmerc`,`Transverse_Mercator`,`Transverse Mercator`,`Gauss Kruger`,`Gauss_Kruger`,`tmerc`]};function ia(e,t){if(e===void 0){if(e=Math.floor((K(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var aa=`etmerc`;function oa(){var e=ia(this.zone,this.long0);if(e===void 0)throw Error(`unknown utm zone`);this.lat0=0,this.long0=(6*Math.abs(e)-183)*B,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ra.init.apply(this),this.forward=ra.forward,this.inverse=ra.inverse}var sa={init:oa,names:[`Universal Transverse Mercator System`,`utm`],dependsOn:aa};function ca(e,t){return((1-e)/(1+e))**t}var la=20;function ua(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+H)/(Math.tan(.5*this.lat0+H)**+this.C*ca(this.e*e,this.ratexp))}function da(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.tan(.5*n+H)**+this.C*ca(this.e*Math.sin(n),this.ratexp))-R,e.x=this.C*t,e}function fa(e){for(var t=1e-14,n=e.x/this.C,r=e.y,i=(Math.tan(.5*r+H)/this.K)**(1/this.C),a=la;a>0&&(r=2*Math.atan(i*ca(this.e*Math.sin(e.y),-.5*this.e))-R,!(Math.abs(r-e.y)<t));--a)e.y=r;return a?(e.x=n,e.y=r,e):null}var pa={init:ua,forward:da,inverse:fa,names:[`gauss`]};function ma(){pa.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||=`Oblique Stereographic Alternative`)}function ha(e){var t,n,r,i;return e.x=K(e.x-this.long0,this.over),pa.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function ga(e){var t,n,r,i,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Y(e.x,e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,pa.inverse.apply(this,[e]),e.x=K(e.x+this.long0,this.over),e}var _a={init:ma,forward:ha,inverse:ga,names:[`Stereographic_North_Pole`,`Oblique_Stereographic`,`sterea`,`Oblique Stereographic Alternative`,`Double_Stereographic`]};function va(e,t,n){return t*=n,Math.tan(.5*(R+e))*((1-t)/(1+t))**(.5*n)}function ya(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=z&&(this.k0=.5*(1+Wn(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=z&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt((1+this.e)**+(1+this.e)*(1-this.e)**(1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=z&&Math.abs(Math.cos(this.lat_ts))>z&&(this.k0=.5*this.cons*Un(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Gn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Un(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(va(this.lat0,this.sinlat0,this.e))-R,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function ba(e){var t=e.x,n=e.y,r=Math.sin(n),i=Math.cos(n),a,o,s,c,l,u,d=K(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=z&&Math.abs(n+this.lat0)<=z?(e.x=NaN,e.y=NaN,e):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(d)),e.x=this.a*a*i*Math.sin(d)+this.x0,e.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(d))+this.y0,e):(o=2*Math.atan(va(n,r,this.e))-R,c=Math.cos(o),s=Math.sin(o),Math.abs(this.coslat0)<=z?(l=Gn(this.e,n*this.con,this.con*r),u=2*this.a*this.k0*l/this.cons,e.x=this.x0+u*Math.sin(t-this.long0),e.y=this.y0-this.con*u*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<z?(a=2*this.a*this.k0/(1+c*Math.cos(d)),e.y=a*s):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*c*Math.cos(d))),e.y=a*(this.cosX0*s-this.sinX0*c*Math.cos(d))+this.y0),e.x=a*c*Math.sin(d)+this.x0,e))}function xa(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,n=this.lat0,o<=z?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<z?this.lat0>0?K(this.long0+Math.atan2(e.x,-1*e.y),this.over):K(this.long0+Math.atan2(e.x,e.y),this.over):K(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s)),this.over),e.x=t,e.y=n,e)}else if(Math.abs(this.coslat0)<=z){if(o<=z)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),n=this.con*Kn(this.e,r),t=this.con*K(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=z?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/o),t=K(this.long0+Math.atan2(e.x*Math.sin(i),o*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)),this.over)),n=-1*Kn(this.e,Math.tan(.5*(R+a)));return e.x=t,e.y=n,e}var Sa={init:ya,forward:ba,inverse:xa,names:[`stere`,`Stereographic_South_Pole`,`Polar_Stereographic_variant_A`,`Polar_Stereographic_variant_B`,`Polar_Stereographic`],ssfn_:va};function Ca(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=1/this.rf,i=2*r-r**2,a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*t**2),this.alpha=Math.sqrt(1+i/(1-i)*Math.cos(e)**4),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*c}function wa(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e}function Ta(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,c=0,l=a,u=-1e3,d=0;Math.abs(l-u)>1e-7;){if(++d>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(c))-Math.PI/2}return e.x=s,e.y=l,e}var Ea={init:Ca,forward:wa,inverse:Ta,names:[`somerc`]},Da=1e-7;function Oa(e){var t=[`Hotine_Oblique_Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`],n=typeof e.projName==`object`?Object.keys(e.projName)[0]:e.projName;return`no_uoff`in e||`no_off`in e||t.indexOf(n)!==-1||t.indexOf(ir(n))!==-1}function ka(){var e,t,n,r,i,a,o,s,c,l,u=0,d,f=0,p=0,m=0,h=0,g=0,_=0;this.no_off=Oa(this),this.no_rot=`no_rot`in this;var v=!1;`alpha`in this&&(v=!0);var y=!1;if(`rectified_grid_angle`in this&&(y=!0),v&&(_=this.alpha),y&&(u=this.rectified_grid_angle),v||y)f=this.longc;else if(p=this.long1,h=this.lat1,m=this.long2,g=this.lat2,Math.abs(h-g)<=Da||(e=Math.abs(h))<=Da||Math.abs(e-R)<=Da||Math.abs(Math.abs(this.lat0)-R)<=Da||Math.abs(Math.abs(g)-R)<=Da)throw Error();var b=1-this.es;t=Math.sqrt(b),Math.abs(this.lat0)>z?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*t/e,r=this.B*t/(n*Math.sqrt(e)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Gn(this.e,this.lat0,s)**+this.B):(this.B=1/t,this.A=this.k0,this.E=r=i=1),v||y?(v?(d=Math.asin(Math.sin(_)/r),y||(u=_)):(d=u,_=Math.asin(r*Math.sin(d))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(d))/this.B):(a=Gn(this.e,h,Math.sin(h))**+this.B,o=Gn(this.e,g,Math.sin(g))**+this.B,i=this.E/a,c=(o-a)/(o+a),l=this.E*this.E,l=(l-o*a)/(l+o*a),e=p-m,e<-Math.PI?m-=Gt:e>Math.PI&&(m+=Gt),this.lam0=K(.5*(p+m)-Math.atan(l*Math.tan(.5*this.B*(p-m))/c)/this.B,this.over),d=Math.atan(2*Math.sin(this.B*K(p-this.lam0,this.over))/(i-1/i)),u=_=Math.asin(r*Math.sin(d))),this.singam=Math.sin(d),this.cosgam=Math.cos(d),this.sinrot=Math.sin(u),this.cosrot=Math.cos(u),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(_))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*d,this.v_pole_n=this.ArB*Math.log(Math.tan(H-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(H+i))}function Aa(e){var t={},n,r,i,a,o,s,c,l;if(e.x-=this.lam0,Math.abs(Math.abs(e.y)-R)>z){if(o=this.E/Gn(this.e,e.y,Math.sin(e.y))**+this.B,s=1/o,n=.5*(o-s),r=.5*(o+s),a=Math.sin(this.B*e.x),i=(n*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)<z)throw Error();l=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*e.x),c=Math.abs(s)<Da?this.A*e.x:this.ArB*Math.atan2(n*this.cosgam+a*this.singam,s)}else l=e.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*e.y;return this.no_rot?(t.x=c,t.y=l):(c-=this.u_0,t.x=l*this.cosrot+c*this.sinrot,t.y=c*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function ja(e){var t,n,r,i,a,o,s,c={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.BrA*t),s=(o*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)<z)c.x=0,c.y=s<0?-R:R;else{if(c.y=this.E/Math.sqrt((1+s)/(1-s)),c.y=Kn(this.e,c.y**(1/this.B)),c.y===1/0)throw Error();c.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return c.x+=this.lam0,c}var Ma={init:ka,forward:Aa,inverse:ja,names:[`Hotine_Oblique_Mercator`,`Hotine Oblique Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Variant_B`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`,`Hotine_Oblique_Mercator_Two_Point_Natural_Origin`,`Hotine_Oblique_Mercator_Azimuth_Center`,`Oblique_Mercator`,`omerc`]};function Na(){if(this.lat2||=this.lat1,this.k0||=1,this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<z)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Un(this.e,t,n),i=Gn(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=Un(this.e,a,o),c=Gn(this.e,this.lat2,a),l=Math.abs(Math.abs(this.lat0)-R)<z?0:Gn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>z?this.ns=Math.log(r/s)/Math.log(i/c):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*i**+this.ns),this.rh=this.a*this.f0*l**+this.ns,this.title||=`Lambert Conformal Conic`}}function Pa(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=z&&(n=Wn(n)*(R-2*z));var r=Math.abs(Math.abs(n)-R),i,a;if(r>z)i=Gn(this.e,n,Math.sin(n)),a=this.a*this.f0*i**+this.ns;else{if(r=n*this.ns,r<=0)return null;a=0}var o=this.ns*K(t-this.long0,this.over);return e.x=this.k0*(a*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,e}function Fa(e){var t,n,r,i,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),n=1):(t=-Math.sqrt(o*o+s*s),n=-1);var c=0;if(t!==0&&(c=Math.atan2(n*o,n*s)),t!==0||this.ns>0){if(n=1/this.ns,r=(t/(this.a*this.f0))**+n,i=Kn(this.e,r),i===-9999)return null}else i=-R;return a=K(c/this.ns+this.long0,this.over),e.x=a,e.y=i,e}var Ia={init:Na,forward:Pa,inverse:Fa,names:[`Lambert Tangential Conformal Conic Projection`,`Lambert_Conformal_Conic`,`Lambert_Conformal_Conic_1SP`,`Lambert_Conformal_Conic_2SP`,`lcc`,`Lambert Conic Conformal (1SP)`,`Lambert Conic Conformal (2SP)`]};function La(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||=.863937979737193,this.long0||=.4334234309119251,this.k0||=.9999,this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.cos(this.fi0)**4/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)))**(this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.tan(this.fi0/2+this.s45)**+this.alfa*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.sin(this.fi0)**2),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Ra(e){var t,n,r,i,a,o,s,c=e.x,l=e.y,u=K(c-this.long0,this.over);return t=((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)))**(this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.tan(l/2+this.s45)**+this.alfa/t)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.tan(this.s0/2+this.s45)**+this.n/Math.tan(i/2+this.s45)**+this.n,e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e}function za(e){var t,n,r,i,a,o,s,c,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),a=Math.atan2(e.y,e.x),i=a/Math.sin(this.s0),r=2*(Math.atan((this.ro0/o)**(1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,s=t,c=0;var u=0;do e.y=2*(Math.atan(this.k**(-1/this.alfa)*Math.tan(t/2+this.s45)**(1/this.alfa)*((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)))**(this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(c=1),s=e.y,u+=1;while(c===0&&u<15);return u>=15?null:e}var Ba={init:La,forward:Ra,inverse:za,names:[`Krovak`,`krovak`]};function X(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function Va(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function Ha(e){return .375*e*(1+.25*e*(1+.46875*e))}function Ua(e){return .05859375*e*e*(1+.75*e)}function Wa(e){return e*e*e*(35/3072)}function Ga(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)}function Ka(e){return Math.abs(e)<R?e:e-Wn(e)*Math.PI}function qa(e,t,n,r,i){for(var a=e/t,o,s=0;s<15;s++)if(o=(e-(t*a-n*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(t-2*n*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}function Ja(){this.sphere||(this.e0=Va(this.es),this.e1=Ha(this.es),this.e2=Ua(this.es),this.e3=Wa(this.es),this.ml0=this.a*X(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Ya(e){var t,n,r=e.x,i=e.y;if(r=K(r-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=Ga(this.a,this.e,a),c=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),u=l*l,d=this.es*o*o/(1-this.es),f=this.a*X(this.e0,this.e1,this.e2,this.e3,i);t=s*l*(1-u*c*(1/6-(8-c+8*d)*u/120)),n=f-this.ml0+s*a/o*u*(.5+(5-c+6*d)*u/24)}return e.x=t+this.x0,e.y=n+this.y0,e}function Xa(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i;if(this.sphere){var a=n+this.lat0;r=Math.asin(Math.sin(a)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(a))}else{var o=qa(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-R)<=z)return e.x=this.long0,e.y=R,n<0&&(e.y*=-1),e;var s=Ga(this.a,this.e,Math.sin(o)),c=s*s*s/this.a/this.a*(1-this.es),l=Math.tan(o)**2,u=t*this.a/s,d=u*u;r=o-s*Math.tan(o)/c*u*u*(.5-(1+3*l)*u*u/24),i=u*(1-d*(l/3+(1+3*l)*l*d/15))/Math.cos(o)}return e.x=K(i+this.long0,this.over),e.y=Ka(r),e}var Za={init:Ja,forward:Ya,inverse:Xa,names:[`Cassini`,`Cassini_Soldner`,`cass`]};function Qa(e,t){var n;return e>1e-7?(n=e*t,(1-e*e)*(t/(1-n*n)-.5/e*Math.log((1-n)/(1+n)))):2*t}var $a=1,eo=2,to=3,no=4;function ro(){var e=Math.abs(this.lat0);if(Math.abs(e-R)<z?this.mode=this.lat0<0?$a:eo:Math.abs(e)<z?this.mode=to:this.mode=no,this.es>0){var t;switch(this.qp=Qa(this.e,1),this.mmf=.5/(1-this.es),this.apa=po(this.es),this.mode){case eo:this.dd=1;break;case $a:this.dd=1;break;case to:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case no:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Qa(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===no&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function io(e){var t,n,r,i,a,o,s,c,l,u,d=e.x,f=e.y;if(d=K(d-this.long0,this.over),this.sphere){if(a=Math.sin(f),u=Math.cos(f),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*a+this.cosph0*u*r,n<=z)return null;n=Math.sqrt(2/n),t=n*u*Math.sin(d),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<z)return null;n=H-f*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),t=n*Math.sin(d),n*=r}}else{switch(s=0,c=0,l=0,r=Math.cos(d),i=Math.sin(d),a=Math.sin(f),o=Qa(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=o/this.qp,c=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:l=1+this.sinb1*s+this.cosb1*c*r;break;case this.EQUIT:l=1+c*r;break;case this.N_POLE:l=R+f,o=this.qp-o;break;case this.S_POLE:l=f-R,o=this.qp+o;break}if(Math.abs(l)<z)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),n=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*s-this.sinb1*c*r):(l=Math.sqrt(2/(1+c*r)))*s*this.ymf,t=this.xmf*l*c*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(l=Math.sqrt(o))*i,n=r*(this.mode===this.S_POLE?l:-l)):t=n=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e}function ao(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i,a,o,s,c,l;if(this.sphere){var u=0,d,f=0;if(d=Math.sqrt(t*t+n*n),i=d*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),u=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(d)<=z?0:Math.asin(n*f/d),t*=f,n=u*d;break;case this.OBLIQ:i=Math.abs(d)<=z?this.lat0:Math.asin(u*this.sinph0+n*f*this.cosph0/d),t*=f*this.cosph0,n=(u-Math.sin(i)*this.sinph0)*d;break;case this.N_POLE:n=-n,i=R-i;break;case this.S_POLE:i-=R;break}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,n)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,n*=this.dd,c=Math.sqrt(t*t+n*n),c<z)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*c/this.rq),a=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(l=a*this.sinb1+n*o*this.cosb1/c,s=this.qp*l,n=c*this.cosb1*a-n*this.sinb1*o):(l=n*o/c,s=this.qp*l,n=c*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),s=t*t+n*n,!s)return e.x=this.long0,e.y=this.lat0,e;l=1-s/this.qp,this.mode===this.S_POLE&&(l=-l)}r=Math.atan2(t,n),i=mo(Math.asin(l),this.apa)}return e.x=K(this.long0+r,this.over),e.y=i,e}var oo=.3333333333333333,so=.17222222222222222,co=.10257936507936508,lo=.06388888888888888,uo=.0664021164021164,fo=.016415012942191543;function po(e){var t,n=[];return n[0]=e*oo,t=e*e,n[0]+=t*so,n[1]=t*lo,t*=e,n[0]+=t*co,n[1]+=t*uo,n[2]=t*fo,n}function mo(e,t){var n=e+e;return e+t[0]*Math.sin(n)+t[1]*Math.sin(n+n)+t[2]*Math.sin(n+n+n)}var ho={init:ro,forward:io,inverse:ao,names:[`Lambert Azimuthal Equal Area`,`Lambert_Azimuthal_Equal_Area`,`laea`],S_POLE:$a,N_POLE:eo,EQUIT:to,OBLIQ:no};function go(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function _o(){Math.abs(this.lat1+this.lat2)<z||(this.temp=this.b/this.a,this.es=1-this.temp**2,this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Un(this.e3,this.sin_po,this.cos_po),this.qs1=Qa(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Un(this.e3,this.sin_po,this.cos_po),this.qs2=Qa(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Qa(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>z?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function vo(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Qa(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*K(t-this.long0,this.over),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return e.x=o,e.y=s,e}function yo(e){var t,n,r,i,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,t!==0&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=K(i/this.ns0+this.long0,this.over),e.x=a,e.y=o,e}function bo(e,t){var n,r,i,a,o,s=go(.5*t);if(e<z)return s;for(var c=e*e,l=1;l<=25;l++)if(n=Math.sin(s),r=Math.cos(s),i=e*n,a=1-i*i,o=.5*a*a/r*(t/(1-c)-n/a+.5/e*Math.log((1-i)/(1+i))),s+=o,Math.abs(o)<=1e-7)return s;return null}var xo={init:_o,forward:vo,inverse:yo,names:[`Albers_Conic_Equal_Area`,`Albers_Equal_Area`,`Albers`,`aea`],phi1z:bo};function So(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Co(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=K(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,o>0||Math.abs(o)<=z?(s=this.x0+this.a*a*n*Math.sin(r)/o,c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),c=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function wo(e){var t,n,r,i,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),o=go(r*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),a=K(this.long0+a,this.over)):(o=this.phic0,a=0),e.x=a,e.y=o,e}var To={init:So,forward:Co,inverse:wo,names:[`gnom`]};function Eo(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*R:R;for(var r=Math.asin(.5*t),i,a,o,s,c=0;c<30;c++)if(a=Math.sin(r),o=Math.cos(r),s=e*a,i=(1-s*s)**2/(2*o)*(t/(1-e*e)-a/(1-s*s)+.5/e*Math.log((1-s)/(1+s))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function Do(){this.sphere||(this.k0=Un(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Oo(e){var t=e.x,n=e.y,r,i,a=K(t-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=Qa(this.e,Math.sin(n));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=r,e.y=i,e}function ko(e){e.x-=this.x0,e.y-=this.y0;var t,n;return this.sphere?(t=K(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=Eo(this.e,2*e.y*this.k0/this.a),t=K(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=n,e}var Ao={init:Do,forward:Oo,inverse:ko,names:[`cea`]};function jo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Equidistant Cylindrical (Plate Carre)`,this.rc=Math.cos(this.lat_ts)}function Mo(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i=Ka(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e}function No(e){var t=e.x,n=e.y;return e.x=K(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=Ka(this.lat0+(n-this.y0)/this.a),e}var Po={init:jo,forward:Mo,inverse:No,names:[`Equirectangular`,`Equidistant_Cylindrical`,`Equidistant_Cylindrical_Spherical`,`eqc`]},Fo=20;function Io(){this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=Va(this.es),this.e1=Ha(this.es),this.e2=Ua(this.es),this.e3=Wa(this.es),this.ml0=this.a*X(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Lo(e){var t=e.x,n=e.y,r,i,a,o=K(t-this.long0,this.over);if(a=o*Math.sin(n),this.sphere)Math.abs(n)<=z?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(n),i=this.a*(Ka(n-this.lat0)+(1-Math.cos(a))/Math.tan(n)));else if(Math.abs(n)<=z)r=this.a*o,i=-1*this.ml0;else{var s=Ga(this.a,this.e,Math.sin(n))/Math.tan(n);r=s*Math.sin(a),i=this.a*X(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(a))}return e.x=r+this.x0,e.y=i+this.y0,e}function Ro(e){var t,n,r=e.x-this.x0,i=e.y-this.y0,a,o,s,c,l;if(this.sphere)if(Math.abs(i+this.a*this.lat0)<=z)t=K(r/this.a+this.long0,this.over),n=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,c=o;var u;for(a=Fo;a;--a)if(u=Math.tan(c),l=-1*(o*(c*u+1)-c-.5*(c*c+s)*u)/((c-o)/u-1),c+=l,Math.abs(l)<=z){n=c;break}t=K(this.long0+Math.asin(r*Math.tan(c)/this.a)/Math.sin(n),this.over)}else if(Math.abs(i+this.ml0)<=z)n=0,t=K(this.long0+r/this.a,this.over);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,c=o;var d,f,p,m,h;for(a=Fo;a;--a)if(h=this.e*Math.sin(c),d=Math.sqrt(1-h*h)*Math.tan(c),f=this.a*X(this.e0,this.e1,this.e2,this.e3,c),p=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),m=f/this.a,l=(o*(d*m+1)-m-.5*d*(m*m+s))/(this.es*Math.sin(2*c)*(m*m+s-2*o*m)/(4*d)+(o-m)*(d*p-2/Math.sin(2*c))-p),c-=l,Math.abs(l)<=z){n=c;break}d=Math.sqrt(1-this.es*Math.sin(n)**2)*Math.tan(n),t=K(this.long0+Math.asin(r*d/this.a)/Math.sin(n),this.over)}return e.x=t,e.y=n,e}var zo={init:Io,forward:Lo,inverse:Ro,names:[`Polyconic`,`American_Polyconic`,`poly`]};function Bo(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Vo(e){var t,n=e.x,r=e.y-this.lat0,i=n-this.long0,a=r/Vt*1e-5,o=i,s=1,c=0;for(t=1;t<=10;t++)s*=a,c+=this.A[t]*s;var l=c,u=o,d=1,f=0,p,m,h=0,g=0;for(t=1;t<=6;t++)p=d*l-f*u,m=f*l+d*u,d=p,f=m,h=h+this.B_re[t]*d-this.B_im[t]*f,g=g+this.B_im[t]*d+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=h*this.a+this.y0,e}function Ho(e){var t,n=e.x,r=e.y,i=n-this.x0,a=(r-this.y0)/this.a,o=i/this.a,s=1,c=0,l,u,d=0,f=0;for(t=1;t<=6;t++)l=s*a-c*o,u=c*a+s*o,s=l,c=u,d=d+this.C_re[t]*s-this.C_im[t]*c,f=f+this.C_im[t]*s+this.C_re[t]*c;for(var p=0;p<this.iterations;p++){var m=d,h=f,g,_,v=a,y=o;for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,v+=(t-1)*(this.B_re[t]*m-this.B_im[t]*h),y+=(t-1)*(this.B_im[t]*m+this.B_re[t]*h);m=1,h=0;var b=this.B_re[1],x=this.B_im[1];for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,b+=t*(this.B_re[t]*m-this.B_im[t]*h),x+=t*(this.B_im[t]*m+this.B_re[t]*h);var S=b*b+x*x;d=(v*b+y*x)/S,f=(y*b-v*x)/S}var C=d,w=f,T=1,E=0;for(t=1;t<=9;t++)T*=C,E+=this.D[t]*T;var D=this.lat0+E*Vt*1e5;return e.x=this.long0+w,e.y=D,e}var Uo={init:Bo,forward:Vo,inverse:Ho,names:[`New_Zealand_Map_Grid`,`nzmg`]};function Wo(){}function Go(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=i,e.y=a,e}function Ko(e){e.x-=this.x0,e.y-=this.y0;var t=K(this.long0+e.x/this.a,this.over),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e}var qo={init:Wo,forward:Go,inverse:Ko,names:[`Miller_Cylindrical`,`mill`]},Jo=20;function Yo(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=zi(this.es)}function Xo(e){var t,n,r=e.x,i=e.y;if(r=K(r-this.long0,this.over),this.sphere){if(!this.m)i=this.n===1?i:Math.asin(this.n*Math.sin(i));else for(var a=this.n*Math.sin(i),o=Jo;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<z)break}t=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var c=Math.sin(i),l=Math.cos(i);n=this.a*Bi(i,c,l,this.en),t=this.a*r*l/Math.sqrt(1-this.es*c*c)}return e.x=t,e.y=n,e}function Zo(e){var t,n,r,i;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=go((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=go(Math.sin(t)/this.n)),r=K(r+this.long0,this.over),t=Ka(t)):(t=Hi(e.y/this.a,this.es,this.en),i=Math.abs(t),i<R?(i=Math.sin(t),n=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=K(n,this.over)):i-z<R&&(r=this.long0)),e.x=r,e.y=t,e}var Qo={init:Yo,forward:Xo,inverse:Zo,names:[`Sinusoidal`,`sinu`]};function $o(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0}function es(e){for(var t=e.x,n=e.y,r=K(t-this.long0,this.over),i=n,a=Math.PI*Math.sin(n);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<z)break}i/=2,Math.PI/2-Math.abs(n)<z&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,c=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=c,e}function ts(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var r=K(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e}var ns={init:$o,forward:es,inverse:ts,names:[`Mollweide`,`moll`]};function rs(){Math.abs(this.lat1+this.lat2)<z||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=Va(this.es),this.e1=Ha(this.es),this.e2=Ua(this.es),this.e3=Wa(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Un(this.e,this.sin_phi,this.cos_phi),this.ml1=X(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<z?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Un(this.e,this.sin_phi,this.cos_phi),this.ml2=X(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=X(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function is(e){var t=e.x,n=e.y,r;if(this.sphere)r=this.a*(this.g-n);else{var i=X(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-i)}var a=this.ns*K(t-this.long0,this.over),o=this.x0+r*Math.sin(a),s=this.y0+this.rh-r*Math.cos(a);return e.x=o,e.y=s,e}function as(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,n,r,i;this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;return n!==0&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=K(this.long0+a/this.ns,this.over),r=Ka(this.g-n/this.a),e.x=i,e.y=r,e):(r=qa(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=K(this.long0+a/this.ns,this.over),e.x=i,e.y=r,e)}var os={init:rs,forward:is,inverse:as,names:[`Equidistant_Conic`,`eqdc`]};function ss(){this.R=this.a}function cs(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i,a;Math.abs(n)<=z&&(i=this.x0+this.R*r,a=this.y0);var o=go(2*Math.abs(n/Math.PI));(Math.abs(r)<=z||Math.abs(Math.abs(n)-R)<=z)&&(i=this.x0,a=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/r-r/Math.PI),c=s*s,l=Math.sin(o),u=Math.cos(o),d=u/(l+u-1),f=d*d,p=d*(2/l-1),m=p*p,h=Math.PI*this.R*(s*(d-m)+Math.sqrt(c*(d-m)*(d-m)-(m+c)*(f-m)))/(m+c);r<0&&(h=-h),i=this.x0+h;var g=c+d;return h=Math.PI*this.R*(p*g-s*Math.sqrt((m+c)*(c+1)-g*g))/(m+c),a=n>=0?this.y0+h:this.y0-h,e.x=i,e.y=a,e}function ls(e){var t,n,r,i,a,o,s,c,l,u,d,f,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,i=e.y/d,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,c=-2*o+1+2*i*i+a*a,p=i*i/c+(2*s*s*s/c/c/c-9*o*s/c/c)/27,l=(o-s*s/3/c)/c,u=2*Math.sqrt(-l/3),d=3*p/l/u,Math.abs(d)>1&&(d=d>=0?1:-1),f=Math.acos(d)/3,n=e.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI,t=Math.abs(r)<z?this.long0:K(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r,this.over),e.x=t,e.y=n,e}var us={init:ss,forward:cs,inverse:ls,names:[`Van_der_Grinten_I`,`VanDerGrinten`,`Van_der_Grinten`,`vandg`]};function ds(e,t,n,r,i,a){let o=r-t,s=Math.atan((1-a)*Math.tan(e)),c=Math.atan((1-a)*Math.tan(n)),l=Math.sin(s),u=Math.cos(s),d=Math.sin(c),f=Math.cos(c),p=o,m,h=100,g,_,v,y,b,x,S,C,w,T,E,D,ee,O;do{if(g=Math.sin(p),_=Math.cos(p),v=Math.sqrt(f*g*(f*g)+(u*d-l*f*_)*(u*d-l*f*_)),v===0)return{azi1:0,s12:0};y=l*d+u*f*_,b=Math.atan2(v,y),x=u*f*g/v,S=1-x*x,C=S===0?0:y-2*l*d/S,w=a/16*S*(4+a*(4-3*S)),m=p,p=o+(1-w)*a*x*(b+w*v*(C+w*y*(-1+2*C*C)))}while(Math.abs(p-m)>1e-12&&--h>0);return h===0?{azi1:NaN,s12:NaN}:(T=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),E=1+T/16384*(4096+T*(-768+T*(320-175*T))),D=T/1024*(256+T*(-128+T*(74-47*T))),ee=D*v*(C+D/4*(y*(-1+2*C*C)-D/6*C*(-3+4*v*v)*(-3+4*C*C))),O=i*(1-a)*E*(b-ee),{azi1:Math.atan2(f*g,u*d-l*f*_),s12:O})}function fs(e,t,n,r,i,a){let o=Math.atan((1-a)*Math.tan(e)),s=Math.sin(o),c=Math.cos(o),l=Math.sin(n),u=Math.cos(n),d=Math.atan2(s,c*u),f=c*l,p=1-f*f,m=p*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),h=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m))),_=r/(i*(1-a)*h),v,y=100,b,x,S,C;do b=Math.cos(2*d+_),x=Math.sin(_),S=Math.cos(_),C=g*x*(b+g/4*(S*(-1+2*b*b)-g/6*b*(-3+4*x*x)*(-3+4*b*b))),v=_,_=r/(i*(1-a)*h)+C;while(Math.abs(_-v)>1e-12&&--y>0);if(y===0)return{lat2:NaN,lon2:NaN};let w=s*x-c*S*u,T=Math.atan2(s*S+c*x*u,(1-a)*Math.sqrt(f*f+w*w)),E=Math.atan2(x*l,c*S-s*x*u),D=a/16*p*(4+a*(4-3*p));return{lat2:T,lon2:t+(E-(1-D)*a*f*(_+D*x*(b+D*S*(-1+2*b*b))))}}function ps(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function ms(e){var t=e.x,n=e.y,r=Math.sin(e.y),i=Math.cos(e.y),a=K(t-this.long0,this.over),o,s,c,l,u,d,f,p,m,h,g;return this.sphere?Math.abs(this.sin_p12-1)<=z?(e.x=this.x0+this.a*(R-n)*Math.sin(a),e.y=this.y0-this.a*(R-n)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=z?(e.x=this.x0+this.a*(R+n)*Math.sin(a),e.y=this.y0+this.a*(R+n)*Math.cos(a),e):(m=this.sin_p12*r+this.cos_p12*i*Math.cos(a),f=Math.acos(m),p=f?f/Math.sin(f):1,e.x=this.x0+this.a*p*i*Math.sin(a),e.y=this.y0+this.a*p*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),e):(o=Va(this.es),s=Ha(this.es),c=Ua(this.es),l=Wa(this.es),Math.abs(this.sin_p12-1)<=z?(u=this.a*X(o,s,c,l,R),d=this.a*X(o,s,c,l,n),e.x=this.x0+(u-d)*Math.sin(a),e.y=this.y0-(u-d)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=z?(u=this.a*X(o,s,c,l,R),d=this.a*X(o,s,c,l,n),e.x=this.x0+(u+d)*Math.sin(a),e.y=this.y0+(u+d)*Math.cos(a),e):Math.abs(t)<z&&Math.abs(n-this.lat0)<z?(e.x=e.y=0,e):(h=ds(this.lat0,this.long0,n,t,this.a,this.f),g=h.azi1,e.x=h.s12*Math.sin(g),e.y=h.s12*Math.cos(g),e))}function hs(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*R*this.a?void 0:(n=t/this.a,r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(t)<=z?o=this.lat0:(o=go(i*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-R,a=Math.abs(s)<=z?this.lat0>=0?K(this.long0+Math.atan2(e.x,-e.y),this.over):K(this.long0-Math.atan2(-e.x,e.y),this.over):K(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r),this.over)),e.x=a,e.y=o,e)):(c=Va(this.es),l=Ha(this.es),u=Ua(this.es),d=Wa(this.es),Math.abs(this.sin_p12-1)<=z?(f=this.a*X(c,l,u,d,R),t=Math.sqrt(e.x*e.x+e.y*e.y),p=f-t,o=qa(p/this.a,c,l,u,d),a=K(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=z?(f=this.a*X(c,l,u,d,R),t=Math.sqrt(e.x*e.x+e.y*e.y),p=t-f,o=qa(p/this.a,c,l,u,d),a=K(this.long0+Math.atan2(e.x,e.y),this.over),e.x=a,e.y=o,e):(m=Math.atan2(e.x,e.y),h=Math.sqrt(e.x*e.x+e.y*e.y),g=fs(this.lat0,this.long0,m,h,this.a,this.f),e.x=g.lon2,e.y=g.lat2,e))}var gs={init:ps,forward:ms,inverse:hs,names:[`Azimuthal_Equidistant`,`aeqd`]};function _s(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function vs(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=K(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,(o>0||Math.abs(o)<=z)&&(s=this.a*a*n*Math.sin(r),c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function ys(e){var t,n,r,i,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=go(t/this.a),r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(t)<=z?(s=this.lat0,e.x=o,e.y=s,e):(s=go(i*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-R,Math.abs(a)<=z?(o=this.lat0>=0?K(this.long0+Math.atan2(e.x,-e.y),this.over):K(this.long0-Math.atan2(-e.x,e.y),this.over),e.x=o,e.y=s,e):(o=K(this.long0+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),this.over),e.x=o,e.y=s,e))}var bs={init:_s,forward:vs,inverse:ys,names:[`ortho`]},Z={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Q={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function xs(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Quadrilateralized Spherical Cube`,this.lat0>=R-H/2?this.face=Z.TOP:this.lat0<=-(R-H/2)?this.face=Z.BOTTOM:Math.abs(this.long0)<=H?this.face=Z.FRONT:Math.abs(this.long0)<=R+H?this.face=this.long0>0?Z.RIGHT:Z.LEFT:this.face=Z.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ss(e){var t={x:0,y:0},n,r,i,a,o,s,c={value:0};if(e.x-=this.long0,n=this.es===0?e.y:Math.atan(this.one_minus_f_squared*Math.tan(e.y)),r=e.x,this.face===Z.TOP)a=R-n,r>=H&&r<=R+H?(c.value=Q.AREA_0,i=r-R):r>R+H||r<=-(R+H)?(c.value=Q.AREA_1,i=r>0?r-U:r+U):r>-(R+H)&&r<=-H?(c.value=Q.AREA_2,i=r+R):(c.value=Q.AREA_3,i=r);else if(this.face===Z.BOTTOM)a=R+n,r>=H&&r<=R+H?(c.value=Q.AREA_0,i=-r+R):r<H&&r>=-H?(c.value=Q.AREA_1,i=-r):r<-H&&r>=-(R+H)?(c.value=Q.AREA_2,i=-r-R):(c.value=Q.AREA_3,i=r>0?-r+U:-r-U);else{var l,u,d,f,p,m,h;this.face===Z.RIGHT?r=Ts(r,+R):this.face===Z.BACK?r=Ts(r,+U):this.face===Z.LEFT&&(r=Ts(r,-R)),f=Math.sin(n),p=Math.cos(n),m=Math.sin(r),h=Math.cos(r),l=p*h,u=p*m,d=f,this.face===Z.FRONT?(a=Math.acos(l),i=ws(a,d,u,c)):this.face===Z.RIGHT?(a=Math.acos(u),i=ws(a,d,-l,c)):this.face===Z.BACK?(a=Math.acos(-l),i=ws(a,d,-u,c)):this.face===Z.LEFT?(a=Math.acos(-u),i=ws(a,d,l,c)):(a=i=0,c.value=Q.AREA_0)}return s=Math.atan(12/U*(i+Math.acos(Math.sin(i)*Math.cos(H))-R)),o=Math.sqrt((1-Math.cos(a))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),c.value===Q.AREA_1?s+=R:c.value===Q.AREA_2?s+=U:c.value===Q.AREA_3&&(s+=1.5*U),t.x=o*Math.cos(s),t.y=o*Math.sin(s),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Cs(e){var t={lam:0,phi:0},n,r,i,a,o,s,c,l,u,d={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),n=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?d.value=Q.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(d.value=Q.AREA_1,n-=R):e.x<0&&-e.x>=Math.abs(e.y)?(d.value=Q.AREA_2,n=n<0?n+U:n-U):(d.value=Q.AREA_3,n+=R),u=U/12*Math.tan(n),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),s=Math.atan(o),i=Math.cos(n),a=Math.tan(r),c=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(s)))),c<-1?c=-1:c>1&&(c=1),this.face===Z.TOP)l=Math.acos(c),t.phi=R-l,d.value===Q.AREA_0?t.lam=s+R:d.value===Q.AREA_1?t.lam=s<0?s+U:s-U:d.value===Q.AREA_2?t.lam=s-R:t.lam=s;else if(this.face===Z.BOTTOM)l=Math.acos(c),t.phi=l-R,d.value===Q.AREA_0?t.lam=-s+R:d.value===Q.AREA_1?t.lam=-s:d.value===Q.AREA_2?t.lam=-s-R:t.lam=s<0?-s-U:-s+U;else{var f=c,p,m;u=f*f,m=u>=1?0:Math.sqrt(1-u)*Math.sin(s),u+=m*m,p=u>=1?0:Math.sqrt(1-u),d.value===Q.AREA_1?(u=p,p=-m,m=u):d.value===Q.AREA_2?(p=-p,m=-m):d.value===Q.AREA_3&&(u=p,p=m,m=-u),this.face===Z.RIGHT?(u=f,f=-p,p=u):this.face===Z.BACK?(f=-f,p=-p):this.face===Z.LEFT&&(u=f,f=p,p=-u),t.phi=Math.acos(-m)-R,t.lam=Math.atan2(p,f),this.face===Z.RIGHT?t.lam=Ts(t.lam,-R):this.face===Z.BACK?t.lam=Ts(t.lam,-U):this.face===Z.LEFT&&(t.lam=Ts(t.lam,+R))}if(this.es!==0){var h=t.phi<0?1:0,g=Math.tan(t.phi),_=this.b/Math.sqrt(g*g+this.one_minus_f_squared);t.phi=Math.atan(Math.sqrt(this.a*this.a-_*_)/(this.one_minus_f*_)),h&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function ws(e,t,n,r){var i;return e<z?(r.value=Q.AREA_0,i=0):(i=Math.atan2(t,n),Math.abs(i)<=H?r.value=Q.AREA_0:i>H&&i<=R+H?(r.value=Q.AREA_1,i-=R):i>R+H||i<=-(R+H)?(r.value=Q.AREA_2,i=i>=0?i-U:i+U):(r.value=Q.AREA_3,i+=R)),i}function Ts(e,t){var n=e+t;return n<-U?n+=Gt:n>+U&&(n-=Gt),n}var Es={init:xs,forward:Ss,inverse:Cs,names:[`Quadrilateralized Spherical Cube`,`Quadrilateralized_Spherical_Cube`,`qsc`]},Ds=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Os=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,422642e-15],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ks=.8487,As=1.3523,js=V/5,Ms=1/js,Ns=18,Ps=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},Fs=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function Is(e,t,n,r){for(var i=t;r;--r){var a=e(i);if(i-=a,Math.abs(a)<n)break}return i}function Ls(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||`Robinson`}function Rs(e){var t=K(e.x-this.long0,this.over),n=Math.abs(e.y),r=Math.floor(n*js);r<0?r=0:r>=Ns&&(r=Ns-1),n=V*(n-Ms*r);var i={x:Ps(Ds[r],n)*t,y:Ps(Os[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*ks+this.x0,i.y=i.y*this.a*As+this.y0,i}function zs(e){var t={x:(e.x-this.x0)/(this.a*ks),y:Math.abs(e.y-this.y0)/(this.a*As)};if(t.y>=1)t.x/=Ds[Ns][0],t.y=e.y<0?-R:R;else{var n=Math.floor(t.y*Ns);for(n<0?n=0:n>=Ns&&(n=Ns-1);;)if(Os[n][0]>t.y)--n;else if(Os[n+1][0]<=t.y)++n;else break;var r=Os[n],i=5*(t.y-r[0])/(Os[n+1][0]-r[0]);i=Is(function(e){return(Ps(r,e)-t.y)/Fs(r,e)},i,z,100),t.x/=Ps(Ds[n],i),t.y=(5*n+i)*B,e.y<0&&(t.y=-t.y)}return t.x=K(t.x+this.long0,this.over),t}var Bs={init:Ls,forward:Rs,inverse:zs,names:[`Robinson`,`robin`]};function Vs(){this.name=`geocent`}function Hs(e){return Ir(e,this.es,this.a)}function Us(e){return Lr(e,this.es,this.a,this.b)}var Ws={init:Vs,forward:Hs,inverse:Us,names:[`Geocentric`,`geocentric`,`geocent`,`Geocent`]},$={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Gs={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Ks(){if(Object.keys(Gs).forEach(function(e){if(this[e]===void 0)this[e]=Gs[e].def;else if(Gs[e].num&&isNaN(this[e]))throw Error(`Invalid parameter value, must be numeric `+e+` = `+this[e]);else Gs[e].num&&(this[e]=parseFloat(this[e]));Gs[e].degrees&&(this[e]=this[e]*B)}.bind(this)),Math.abs(Math.abs(this.lat0)-R)<z?this.mode=this.lat0<0?$.S_POLE:$.N_POLE:Math.abs(this.lat0)<z?this.mode=$.EQUIT:(this.mode=$.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw Error(`Invalid height`);this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function qs(e){e.x-=this.long0;var t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i,a;switch(this.mode){case $.OBLIQ:a=this.sinph0*t+this.cosph0*n*r;break;case $.EQUIT:a=n*r;break;case $.S_POLE:a=-t;break;case $.N_POLE:a=t;break}switch(a=this.pn1/(this.p-a),i=a*n*Math.sin(e.x),this.mode){case $.OBLIQ:a*=this.cosph0*t-this.sinph0*n*r;break;case $.EQUIT:a*=t;break;case $.N_POLE:a*=-(n*r);break;case $.S_POLE:a*=n*r;break}var o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw);return i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,e.x=i*this.a,e.y=a*this.a,e}function Js(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},n,r,i=1/(this.pn1-e.y*this.sw);n=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=n*this.cg+r*this.sg,e.y=r*this.cg-n*this.sg;var a=Y(e.x,e.y);if(Math.abs(a)<z)t.x=0,t.y=e.y;else{var o,s=1-a*a*this.pfact;switch(s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case $.OBLIQ:t.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(t.y))*a,e.x*=s*this.cosph0;break;case $.EQUIT:t.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case $.N_POLE:t.y=Math.asin(o),e.y=-e.y;break;case $.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var Ys={init:Ks,forward:qs,inverse:Js,names:[`Tilted_Perspective`,`tpers`]};function Xs(){if(this.flip_axis=this.sweep===`x`?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw Error();if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=`ellipse`}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=`sphere`;this.title||=`Geostationary Satellite View`}function Zs(e){var t=e.x,n=e.y,r,i,a,o;if(t-=this.long0,this.shape===`ellipse`){n=Math.atan(this.radius_p2*Math.tan(n));var s=this.radius_p/Y(this.radius_p*Math.cos(n),Math.sin(n));if(i=s*Math.cos(t)*Math.cos(n),a=s*Math.sin(t)*Math.cos(n),o=s*Math.sin(n),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return e.x=NaN,e.y=NaN,e;r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Y(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Y(a,r)))}else this.shape===`sphere`&&(r=Math.cos(n),i=Math.cos(t)*r,a=Math.sin(t)*r,o=Math.sin(n),r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Y(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Y(a,r))));return e.x*=this.a,e.y*=this.a,e}function Qs(e){var t=-1,n=0,r=0,i,a,o,s;if(e.x/=this.a,e.y/=this.a,this.shape===`ellipse`){this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Y(1,r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Y(1,n));var c=r/this.radius_p;if(i=n*n+c*c+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===`sphere`){if(this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+r*r+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t)}return e.x+=this.long0,e}var $s={init:Xs,forward:Zs,inverse:Qs,names:[`Geostationary Satellite View`,`Geostationary_Satellite`,`geos`]},ec=1.340264,tc=-.081106,nc=893e-6,rc=.003796,ic=Math.sqrt(3)/2;function ac(){this.es=0,this.long0=this.long0===void 0?0:this.long0,this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0}function oc(e){var t=K(e.x-this.long0,this.over),n=e.y,r=Math.asin(ic*Math.sin(n)),i=r*r,a=i*i*i;return e.x=t*Math.cos(r)/(ic*(ec+3*tc*i+a*(7*nc+9*rc*i))),e.y=r*(ec+tc*i+a*(nc+rc*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function sc(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,n=12,r=e.y,i,a,o,s,c,l;for(l=0;l<n&&(i=r*r,a=i*i*i,o=r*(ec+tc*i+a*(nc+rc*i))-e.y,s=ec+3*tc*i+a*(7*nc+9*rc*i),r-=c=o/s,!(Math.abs(c)<t));++l);return i=r*r,a=i*i*i,e.x=ic*e.x*(ec+3*tc*i+a*(7*nc+9*rc*i))/Math.cos(r),e.y=Math.asin(Math.sin(r)/ic),e.x=K(e.x+this.long0,this.over),e}var cc={init:ac,forward:oc,inverse:sc,names:[`eqearth`,`Equal Earth`,`Equal_Earth`]},lc=1e-10;function uc(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<lc)throw Error();this.es?(this.en=zi(this.es),this.m1=Bi(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=fc,this.forward=dc):(Math.abs(this.phi1)+lc>=R?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=mc,this.forward=pc)}function dc(e){var t=K(e.x-(this.long0||0),this.over),n=e.y,r=this.am1+this.m1-Bi(n,i=Math.sin(n),a=Math.cos(n),this.en),i=a*t/(r*Math.sqrt(1-this.es*i*i)),a;return e.x=r*Math.sin(i),e.y=this.am1-r*Math.cos(i),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function fc(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n=Y(e.x,e.y=this.am1-e.y),r,i=Hi(this.am1+this.m1-n,this.es,this.en);if((t=Math.abs(i))<R)t=Math.sin(i),r=n*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-R)<=lc)r=0;else throw Error();return e.x=K(r+(this.long0||0),this.over),e.y=Ka(i),e}function pc(e){var t=K(e.x-(this.long0||0),this.over),n=e.y,r,i=this.cphi1+this.phi1-n;return Math.abs(i)>lc?(e.x=i*Math.sin(r=t*Math.cos(n)/i),e.y=this.cphi1-i*Math.cos(r)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function mc(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r=Y(e.x,e.y=this.cphi1-e.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>R)throw Error();return t=Math.abs(Math.abs(n)-R)<=lc?0:r*Math.atan2(e.x,e.y)/Math.cos(n),e.x=K(t+(this.long0||0),this.over),e.y=Ka(n),e}var hc={init:uc,names:[`bonne`,`Bonne (Werner lat_1=90)`]};let gc={OBLIQUE:{forward:Sc,inverse:wc},TRANSVERSE:{forward:Cc,inverse:Tc}},_c={ROTATE:{o_alpha:`oAlpha`,o_lon_c:`oLongC`,o_lat_c:`oLatC`},NEW_POLE:{o_lat_p:`oLatP`,o_lon_p:`oLongP`},NEW_EQUATOR:{o_lon_1:`oLong1`,o_lat_1:`oLat1`,o_lon_2:`oLong2`,o_lat_2:`oLat2`}};function vc(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||`General Oblique Transformation`,this.isIdentity=$n.includes(this.o_proj),!this.o_proj)throw Error(`Missing parameter: o_proj`);if(this.o_proj===`ob_tran`)throw Error(`Invalid value for o_proj: `+this.o_proj);let e=Pr(this.projStr.replace(`+proj=ob_tran`,``).replace(`+o_proj=`,`+proj=`).trim());if(!e)throw Error(`Invalid parameter: o_proj. Unknown projection `+this.o_proj);e.long0=0,this.obliqueProjection=e;let t,n=Object.keys(_c),r=e=>{if(this[e]===void 0)return;let t=parseFloat(this[e])*B;if(isNaN(t))throw Error(`Invalid value for `+e+`: `+this[e]);return t};for(let e=0;e<n.length;e++){let i=_c[n[e]],a=Object.entries(i);if(a.some(([e])=>this[e]!==void 0)){t=i;for(let e=0;e<a.length;e++){let[t,n]=a[e],i=r(t);if(i===void 0)throw Error(`Missing parameter: `+t+`.`);this[n]=i}break}}if(!t)throw Error(`No valid parameters provided for ob_tran projection.`);let{lamp:i,phip:a}=xc(this,t);this.lamp=i,Math.abs(a)>z?(this.cphip=Math.cos(a),this.sphip=Math.sin(a),this.projectionType=gc.OBLIQUE):this.projectionType=gc.TRANSVERSE}function yc(e){return this.projectionType.forward(this,e)}function bc(e){return this.projectionType.inverse(this,e)}function xc(e,t){let n,r;if(t===_c.ROTATE){let t=e.oLongC,i=e.oLatC,a=e.oAlpha;if(Math.abs(Math.abs(i)-R)<=z)throw Error(`Invalid value for o_lat_c: `+e.o_lat_c+` should be < 90°`);r=t+Math.atan2(-1*Math.cos(a),-1*Math.sin(a)*Math.sin(i)),n=Math.asin(Math.cos(i)*Math.sin(a))}else if(t===_c.NEW_POLE)r=e.oLongP,n=e.oLatP;else{let t=e.oLong1,i=e.oLat1,a=e.oLong2,o=e.oLat2,s=Math.abs(i);if(Math.abs(i)>R-z)throw Error(`Invalid value for o_lat_1: `+e.o_lat_1+` should be < 90°`);if(Math.abs(o)>R-z)throw Error(`Invalid value for o_lat_2: `+e.o_lat_2+` should be < 90°`);if(Math.abs(i-o)<z)throw Error(`Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2`);if(s<z)throw Error(`Invalid value for o_lat_1: o_lat_1 should be different from zero`);r=Math.atan2(Math.cos(i)*Math.sin(o)*Math.cos(t)-Math.sin(i)*Math.cos(o)*Math.cos(a),Math.sin(i)*Math.cos(o)*Math.sin(a)-Math.cos(i)*Math.sin(o)*Math.sin(t)),n=Math.atan(-1*Math.cos(r-t)/Math.tan(i))}return{lamp:r,phip:n}}function Sc(e,t){let{x:n,y:r}=t;n+=e.long0;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=K(Math.atan2(o*Math.sin(n),e.sphip*o*i+e.cphip*a)+e.lamp),t.y=Math.asin(e.sphip*a-e.cphip*o*i);let s=e.obliqueProjection.forward(t);return e.isIdentity&&(s.x*=V,s.y*=V),s}function Cc(e,t){let{x:n,y:r}=t;n+=e.long0;let i=Math.cos(r),a=Math.cos(n);t.x=K(Math.atan2(i*Math.sin(n),Math.sin(r))+e.lamp),t.y=Math.asin(-1*i*a);let o=e.obliqueProjection.forward(t);return e.isIdentity&&(o.x*=V,o.y*=V),o}function wc(e,t){e.isIdentity&&(t.x*=B,t.y*=B);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){n-=e.lamp;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Math.atan2(o*Math.sin(n),e.sphip*o*i-e.cphip*a),t.y=Math.asin(e.sphip*a+e.cphip*o*i)}return t.x=K(t.x+e.long0),t}function Tc(e,t){e.isIdentity&&(t.x*=B,t.y*=B);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){let i=Math.cos(r);n-=e.lamp,t.x=Math.atan2(i*Math.sin(n),-1*Math.sin(r)),t.y=Math.asin(i*Math.cos(n))}return t.x=K(t.x+e.long0),t}var Ec={init:vc,forward:yc,inverse:bc,names:[`General Oblique Transformation`,`General_Oblique_Transformation`,`ob_tran`]};function Dc(e){e.Proj.projections.add(Ki),e.Proj.projections.add(ra),e.Proj.projections.add(sa),e.Proj.projections.add(_a),e.Proj.projections.add(Sa),e.Proj.projections.add(Ea),e.Proj.projections.add(Ma),e.Proj.projections.add(Ia),e.Proj.projections.add(Ba),e.Proj.projections.add(Za),e.Proj.projections.add(ho),e.Proj.projections.add(xo),e.Proj.projections.add(To),e.Proj.projections.add(Ao),e.Proj.projections.add(Po),e.Proj.projections.add(zo),e.Proj.projections.add(Uo),e.Proj.projections.add(qo),e.Proj.projections.add(Qo),e.Proj.projections.add(ns),e.Proj.projections.add(os),e.Proj.projections.add(us),e.Proj.projections.add(gs),e.Proj.projections.add(bs),e.Proj.projections.add(Es),e.Proj.projections.add(Bs),e.Proj.projections.add(Ws),e.Proj.projections.add(Ys),e.Proj.projections.add($s),e.Proj.projections.add(cc),e.Proj.projections.add(hc),e.Proj.projections.add(Ec)}let Oc=Object.assign(ti,{defaultDatum:`WGS84`,Proj:Pr,WGS84:new Pr(`WGS84`),Point:Ei,toPoint:Kr,defs:Mn,nadgrid:yr,transform:Xr,mgrs:ci,version:`__VERSION__`});Dc(Oc);var kc=Oc;function Ac(e){return(0,m.transform)(e,te,k)}function jc(e){return(0,m.transform)(e,k,te)}function Mc(e){return(0,m.transformExtent)(e,te,k)}function Nc(e){return(0,m.transformExtent)(e,k,te)}function Pc(){(0,m.get)(ne)||(kc.defs(`EPSG:3395`,`+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs`),(0,h.register)(kc))}function Fc(e){if(e===ne)return Pc(),(0,g.createXYZ)({extent:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]})}function Ic(e){let{type:t=`img`,projection:n=k,key:r}=e,i=e.url||`https://t{0-4}.tianditu.gov.cn`,a=`&tk=${r}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}`;return`${i}/${t}_${n===k?`w`:`c`}/wmts?LAYER=${t}${a}`}function Lc(e){let{layerOptions:t,sourceOptions:n,...r}=e;return new u.Tile({source:new f.XYZ({url:Ic(r),projection:r.projection,crossOrigin:`Anonymous`,...n}),...t})}function Rc({name:e,key:t,layerOptions:n,sourceOptions:r}){return new u.Tile({source:new f.BingMaps({key:t,imagerySet:e,placeholderTiles:!1,...r}),...n})}function zc(e){let{layerOptions:t,sourceOptions:n}=e||{};return new u.Tile({source:new f.OSM({crossOrigin:`Anonymous`,...n}),...t})}function Bc(e){return new c.default({...e})}function Vc(e){let{styleOptions:t,sourceOptions:n,style:r,source:i,...a}=e||{},o=r||(t?A(t):void 0),c=i||Bc(n);return{source:c,layer:new s.default({...a,source:c,style:o})}}function Hc(e){let{style:t,source:n,sourceOptions:r,...i}=e,a=n||Bc(r);return{source:a,layer:new d.default({...i,source:a,style:t})}}function Uc(e){return new Promise((t,n)=>{let r=new Image;r.addEventListener(`load`,()=>t(r)),r.addEventListener(`error`,()=>n(Error(`load failed`))),r.src=e})}function Wc(e){let{url:t,sourceOptions:n,...r}=e,{projection:i,...a}=n||{},o=new jt(t),s=Fc(i);return new u.Tile({...r,source:new p.default({async loader(e,t,n,{signal:r}){let i=await o.getZxy(e,t,n,r),a=new Blob([i.data]),s=URL.createObjectURL(a),c=await Uc(s);return URL.revokeObjectURL(s),c},crossOrigin:`anonymous`,tileGrid:s,...a})})}function Gc({sourceOptions:e,...t}){let{projection:n,...r}=e||{},i=Fc(n);return new u.Tile({...t,source:new f.XYZ({crossOrigin:`anonymous`,...r,tileGrid:i})})}function Kc(e,t,n){let r=document.createElement(`div`);r.style.position=`absolute`,r.style.width=`100%`,r.style.height=`100%`;let i=document.createElement(`canvas`);i.style.width=`100%`,i.style.height=`100%`,r.appendChild(i);let a=i.getContext(`2d`),o={size:[0,0],dpi:window.devicePixelRatio},s=new f.Source({}),c=new u.Layer({render:e=>{let n=e.size,s=t(e);if(s){let{imageBitmap:e,dpi:t}=s;t===o.dpi&&n[0]===o.size[0]&&n[1]===o.size[1]?a.clearRect(0,0,i.width,i.height):(o.size=[n[0],n[1]],o.dpi=t,i.width=n[0]*t,i.height=n[1]*t,a.scale(t,t)),a.drawImage(e,0,0,n[0],n[1]),e.close()}else a.clearRect(0,0,i.width,i.height);return r},source:s,...n});return e.addLayer(c),{layer:c,source:s}}function qc(e){let t=document.createElement(`div`);return t.innerHTML=e,t.style.cursor=`pointer`,t.style.userSelect=`none`,t.style.backgroundColor=`red`,t.style.color=`white`,t.style.borderRadius=`5px`,t.style.padding=`0 5px`,t.style.fontSize=`12px`,t.style.border=`2px solid white`,t}function Jc(e,r){let l=(0,t.ref)(!0),u=(0,t.ref)([]),d=(0,t.computed)(()=>u.value.map(e=>e.getGeometry().getCoordinates())),f=new c.default,p=r.styleOptions?A(r.styleOptions):r?.style,m=new s.default({source:f,style:p,zIndex:r?.zIndex});e.addLayer(m);let h=new i.Draw({source:f,style:(r.drawStyleOptions?A(r.drawStyleOptions):r?.drawStyle)||p,type:`LineString`});h.setActive(!1);let g=new i.Modify({source:f,style:(r.modifyStyleOptions?A(r.modifyStyleOptions):r?.modifyStyle)||p}),_=new Set;e.addInteraction(h),(0,t.onMounted)(()=>{e.addInteraction(g)}),f.on(`addfeature`,()=>{r.size&&f.getFeatures().length>=r.size&&h.setActive(!1)}),f.on(`removefeature`,()=>{r.size&&f.getFeatures().length<r.size&&h.setActive(!0)});let v=()=>{_.forEach(t=>{e.removeOverlay(t)}),_.clear()};f.on(`change`,()=>{v(),f.getFeatures().forEach(i=>{let s=i.getGeometry();s.getCoordinates();let c=(0,a.getCenter)(s.getExtent()),l=document.createElement(`div`);r.deleteFeatureLabel?(0,t.render)(r.deleteFeatureLabel,l):l=qc(`删除线`),l.addEventListener(`click`,()=>{f.removeFeature(i)});let u=new n.Overlay({position:c,positioning:`center-center`,element:l});_.add(u),e.addOverlay(u);let d=s.getCoordinates();d.length<3||d.forEach((a,s)=>{let c=document.createElement(`div`);r.deletePointLabel?(0,t.render)(r.deletePointLabel,c):c=qc(`删除点`),c.addEventListener(`click`,()=>{i.setGeometry(new o.LineString(d.filter((e,t)=>t!==s)))});let l=new n.Overlay({position:a,positioning:`top-center`,offset:[0,-30],element:c});_.add(l),e.addOverlay(l)})})}),h.on(`change:active`,()=>{l.value=h.getActive()}),f.on(`change`,()=>{u.value=f.getFeatures()});let y=()=>{v(),e.removeLayer(m),e.removeInteraction(h),e.removeInteraction(g)},b=()=>{r.size&&u.value.length>=r.size||h.setActive(!0)},x=()=>{h.setActive(!1)},S=e=>{f.clear(),e.forEach(e=>{if(e.length<2)return;let t=new n.Feature({geometry:new o.LineString(e)});f.addFeature(t)})},C=()=>{S(r.defaultCoordinates||[])};return C(),(0,t.onUnmounted)(()=>{y()}),{inDraw:l,start:b,stop:x,clear:()=>{f.clear(),x()},setFeatures:S,reset:C,features:u,coordinates:d,destroy:y}}function Yc(e,r){let l=(0,t.ref)(!0),u=(0,t.ref)([]),d=(0,t.computed)(()=>u.value.map(e=>e.getGeometry().getCoordinates())),f=r.styleOptions?A(r.styleOptions):r?.style,p=new c.default,m=new s.default({source:p,style:f,zIndex:r?.zIndex});e.addLayer(m);let h=new i.Draw({source:p,style:(r.drawStyleOptions?A(r.drawStyleOptions):r?.drawStyle)||f,type:`Polygon`});h.setActive(!1);let g=new i.Modify({source:p,style:(r.modifyStyleOptions?A(r.modifyStyleOptions):r?.modifyStyle)||f}),_=new Set;e.addInteraction(h),(0,t.onMounted)(()=>{e.addInteraction(g)}),p.on(`addfeature`,()=>{r.size&&p.getFeatures().length>=r.size&&h.setActive(!1)}),p.on(`removefeature`,()=>{r.size&&p.getFeatures().length<r.size&&h.setActive(!0)});let v=()=>{_.forEach(t=>{e.removeOverlay(t)}),_.clear()};p.on(`change`,()=>{v(),p.getFeatures().forEach(i=>{let s=i.getGeometry(),c=(0,a.getCenter)(s.getExtent()),l=document.createElement(`div`);r.deleteFeatureLabel?(0,t.render)(r.deleteFeatureLabel,l):l=qc(`删除区域`),l.addEventListener(`click`,()=>{p.removeFeature(i)});let u=new n.Overlay({position:c,positioning:`center-center`,element:l});_.add(u),e.addOverlay(u);let d=s.getCoordinates()[0];d.length<3||d.forEach((a,s)=>{let c=document.createElement(`div`);r.deletePointLabel?(0,t.render)(r.deletePointLabel,c):c=qc(`删除点`),c.addEventListener(`click`,()=>{i.setGeometry(new o.Polygon([d.filter((e,t)=>t!==s)]))});let l=new n.Overlay({position:a,positioning:`top-center`,offset:[0,-30],element:c});_.add(l),e.addOverlay(l)})})}),h.on(`change:active`,()=>{l.value=h.getActive()}),p.on(`change`,()=>{u.value=p.getFeatures()});let y=()=>{v(),e.removeLayer(m),e.removeInteraction(h),e.removeInteraction(g)},b=()=>{r.size&&u.value.length>=r.size||h.setActive(!0)},x=()=>{h.setActive(!1)},S=e=>{p.clear(),e?.forEach(e=>{e.forEach(e=>{if(e.length<2)return;e[0]!==e[e.length-1]&&e.push(e[0]);let t=new n.Feature({geometry:new o.Polygon([e])});p.addFeature(t)})})},C=()=>{S(r.defaultCoordinates)};return C(),(0,t.onUnmounted)(()=>{y()}),{inDraw:l,start:b,stop:x,clear:()=>{p.clear(),x()},setFeatures:S,reset:C,features:u,coordinates:d,destroy:y}}function Xc(e){let n=(0,t.ref)(e.defaultShow||!1),{strokeStyleOption:r,strokeStyle:i,labelStyleOption:a,latLabelStyleOption:o,lonLabelStyleOption:s,latLabelStyle:c,lonLabelStyle:d,...f}=e.graticuleOptions||{},p=r?new l.Stroke(r):i,m=a?ce(a):void 0,h=(o?ce(o):c)||m,g=(s?ce(s):d)||m,_=new u.Graticule({...f,strokeStyle:p,latLabelStyle:h,lonLabelStyle:g});return(0,t.watch)(n,n=>{if(_.setMap(null),n){let n=(0,t.toValue)(e.olMap);n&&_.setMap(n)}},{immediate:!0,deep:!0}),{showGraticule:n}}function Zc({mapRef:e,items:n,forceUpdate:r=!1}){let i=(0,t.ref)(!1),o=(0,t.ref)({x:0,y:0}),s=(0,t.ref)(),c=(0,t.ref)(),l=(0,t.ref)({x:0,y:0}),u=(0,t.ref)(),d=(0,t.ref)(),f=(0,t.ref)(),p=(0,t.computed)(()=>({x:o.value.x+l.value.x,y:o.value.y+l.value.y})),m,h,g=``;function _(e){let r=(0,t.toValue)(n);return r.sort((e,t)=>(t.priority??0)-(e.priority??0)),r.find(t=>{let n=t.visible;return typeof n==`function`?n(e):n??!0})}function v(e){if(e.dragging||!m||!h)return;let t=e.coordinate;u.value=t,d.value=t;let n=e.pixel,p,g;if(m.forEachFeatureAtPixel(n,(e,t)=>(p=e,g=t,!0)),!p){y();return}if(!r&&s.value&&s.value.getId()===p.getId())return;s.value=p;let{top:v,left:b}=h.getBoundingClientRect(),x={map:m,position:{x:n[0]+b,y:n[1]+v},coordinate:t,feature:p,layer:g},S=_(x);if(S){let{content:e,cursor:t,visible:n,fixedFeatureCenter:r,offset:i,priority:a,...o}=S;f.value={...o}}if(!S){y();return}l.value={x:S.offset?.x??0,y:S.offset?.y??0};let C=r===!1?!0:S.fixedFeatureCenter??!0,w=p.getGeometry();if(C&&w){let e=(0,a.getCenter)(w.getExtent());d.value=e,n=m.getPixelFromCoordinate(e)}o.value.x=n[0]+b,o.value.y=n[1]+v;let T=S.content;c.value=typeof T==`function`?()=>T(x):T;let E=S.cursor,D=typeof E==`function`?E(x):E;D!==void 0&&D!==h.style.cursor&&(h.style.cursor=D),i.value=!0}function y(){i.value=!1,s.value=void 0,h&&h.style.cursor!==g&&(h.style.cursor=g)}function b(e){e.on(`pointermove`,v)}function x(e){e.un(`pointermove`,v)}return(0,t.watch)(()=>(0,t.toValue)(e),(e,t)=>{t&&x(t),t!==e&&(m=e,e&&(h=e.getViewport(),b(e),g=h.style.cursor))},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{m&&x(m)}),{visible:(0,t.computed)(()=>i.value),position:(0,t.computed)(()=>p.value),offset:(0,t.computed)(()=>l.value),originalPosition:(0,t.computed)(()=>o.value),feature:(0,t.computed)(()=>s.value),content:(0,t.computed)(()=>c.value),originalCoordinate:(0,t.computed)(()=>u.value),coordinate:(0,t.computed)(()=>d.value),option:(0,t.computed)(()=>f.value),hide:y}}function Qc(e){let n=(0,t.ref)(e.defaultLayerName||Object.keys(e.layers)[0]);return Object.values(e.layers).forEach(t=>{t.forEach(t=>{e.olMap.addLayer(t)})}),(0,t.watch)(n,()=>{Object.entries(e.layers).forEach(([e,t])=>{let r=e===n.value;t.forEach(e=>{e.setVisible(r)})})},{immediate:!0}),{visibleLayerName:n}}return e.EPSG_3395=ne,e.EPSG_3857=k,e.EPSG_3857ExtentToEPSG_4326=Nc,e.EPSG_3857ToEPSG_4326=jc,e.EPSG_4326=te,e.EPSG_4326ExtentToEPSG_3857=Mc,e.EPSG_4326ToEPSG_3857=Ac,e.ONE_NM=O,e.OlMap=D,e.createBingLayer=Rc,e.createCanvasLayer=Kc,e.createCircle=fe,e.createCircleFeature=be,e.createCircleStyle=se,e.createFeature=ge,e.createLineString=ue,e.createLineStringFeature=ve,e.createMultiLineString=me,e.createMultiLineStringFeature=Se,e.createMultiPoint=pe,e.createMultiPointFeature=xe,e.createMultiPolygon=he,e.createMultiPolygonFeature=Ce,e.createOpenStreetMapLayer=zc,e.createPMTilesLayer=Wc,e.createPoint=le,e.createPointFeature=_e,e.createPolygon=de,e.createPolygonFeature=ye,e.createStyle=A,e.createTextStyle=ce,e.createTianDiTuLayer=Lc,e.createTianDiTuUrl=Ic,e.createTileGrid=Fc,e.createVectorLayer=Vc,e.createVectorSource=Bc,e.createWebGLVectorLayer=Hc,e.createXYZLayer=Gc,e.formatAngle=oe,e.formatRotation=ae,e.kmToNauticalMiles=re,e.nauticalMilesToKm=ie,e.olMapInjectionKey=T,e.proj4=kc,e.registerEPSG_3395=Pc,e.useContextmenu=ee,e.useDrawLineString=Jc,e.useDrawPolygon=Yc,e.useGraticule=Xc,e.useOlMap=E,e.usePointermove=Zc,e.useSwitchBaseLayer=Qc,e})({},Vue,ol,ol.control,ol.interaction,ol.extent,ol.geom,ol.layer.Vector,ol.source.Vector,ol.style,ol.layer,ol.layer.WebGLVector,ol.source,ol.source.ImageTile,ol.proj,ol.proj.proj4,ol.tilegrid);
4
+ northing meters`+e;var f=d/2,p=0,m=0,h,g,_,v,y;return f>0&&(h=1e5/10**f,g=e.substring(a,a+f),p=parseFloat(g)*h,_=e.substring(a+f),m=parseFloat(_)*h),v=p+l,y=m+u,{easting:v,northing:y,zoneLetter:s,zoneNumber:o,accuracy:h}}function Si(e,t){for(var n=ri.charCodeAt(t-1),r=1e5,i=!1;n!==e.charCodeAt(0);){if(n++,n===q&&n++,n===J&&n++,n>si){if(i)throw`Bad character: `+e;n=ai,i=!0}r+=1e5}return r}function Ci(e,t){if(e>`V`)throw`MGRSPoint given invalid Northing `+e;for(var n=ii.charCodeAt(t-1),r=0,i=!1;n!==e.charCodeAt(0);){if(n++,n===q&&n++,n===J&&n++,n>oi){if(i)throw`Bad character: `+e;n=ai,i=!0}r+=1e5}return r}function wi(e){var t;switch(e){case`C`:t=11e5;break;case`D`:t=2e6;break;case`E`:t=28e5;break;case`F`:t=37e5;break;case`G`:t=46e5;break;case`H`:t=55e5;break;case`J`:t=64e5;break;case`K`:t=73e5;break;case`L`:t=82e5;break;case`M`:t=91e5;break;case`N`:t=0;break;case`P`:t=8e5;break;case`Q`:t=17e5;break;case`R`:t=26e5;break;case`S`:t=35e5;break;case`T`:t=44e5;break;case`U`:t=53e5;break;case`V`:t=62e5;break;case`W`:t=7e6;break;case`X`:t=79e5;break;default:t=-1}if(t>=0)return t;throw`Invalid zone letter: `+e}function Ti(e,t,n){if(!(this instanceof Ti))return new Ti(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e==`object`)this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e==`string`&&t===void 0){var r=e.split(`,`);this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=e,this.y=t,this.z=n||0;console.warn(`proj4.Point will be removed in version 3, use proj4.toPoint`)}Ti.fromMGRS=function(e){return new Ti(di(e))},Ti.prototype.toMGRS=function(e){return li([this.x,this.y],e)};var Ei=Ti,Di=1,Oi=.25,ki=.046875,Ai=.01953125,ji=.01068115234375,Mi=.75,Ni=.46875,Pi=.013020833333333334,Fi=.007120768229166667,Ii=.3645833333333333,Li=.005696614583333333,Ri=.3076171875;function zi(e){var t=[];t[0]=Di-e*(Oi+e*(ki+e*(Ai+e*ji))),t[1]=e*(Mi-e*(ki+e*(Ai+e*ji)));var n=e*e;return t[2]=n*(Ni-e*(Pi+e*Fi)),n*=e,t[3]=n*(Ii-e*Li),t[4]=n*e*Ri,t}function Bi(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))}var Vi=20;function Hi(e,t,n){for(var r=1/(1-t),i=e,a=Vi;a;--a){var o=Math.sin(i),s=1-t*o*o;if(s=(Bi(i,o,Math.cos(i),n)-e)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)<z)return i}return i}function Ui(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.es&&(this.en=zi(this.es),this.ml0=Bi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Wi(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i,a,o,s=Math.sin(n),c=Math.cos(n);if(this.es){var l=c*r,u=l**2,d=this.ep2*c**2,f=d**2,p=(Math.abs(c)>z?Math.tan(n):0)**2,m=p**2;i=1-this.es*s**2,l/=Math.sqrt(i);var h=Bi(n,s,c,this.en);a=this.a*(this.k0*l*(1+u/6*(1-p+d+u/20*(5-18*p+m+14*d-58*p*d+u/42*(61+179*m-m*p-479*p)))))+this.x0,o=this.a*(this.k0*(h-this.ml0+s*r*l/2*(1+u/12*(5-p+9*d+4*f+u/30*(61+m-58*p+270*d-330*p*d+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=c*Math.sin(r);if(Math.abs(Math.abs(g)-1)<z)return 93;if(a=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,o=c*Math.cos(r)/Math.sqrt(1-g**2),g=Math.abs(o),g>=1){if(g-1>z)return 93;o=0}else o=Math.acos(o);n<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return e.x=a,e.y=o,e}function Gi(e){var t,n,r,i,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,n=Hi(t,this.es,this.en),Math.abs(n)<R){var s=Math.sin(n),c=Math.cos(n),l=Math.abs(c)>z?Math.tan(n):0,u=this.ep2*c**2,d=u**2,f=l**2,p=f**2;t=1-this.es*s**2;var m=a*Math.sqrt(t)/this.k0,h=m**2;t*=l,r=n-t*h/(1-this.es)*.5*(1-h/12*(5+3*f-9*u*f+u-4*d-h/30*(61+90*f-252*u*f+45*p+46*u-h/56*(1385+3633*f+4095*p+1574*p*f)))),i=K(this.long0+m*(1-h/6*(1+2*f+u-h/20*(5+28*f+24*p+8*u*f+6*u-h/42*(61+662*f+1320*p+720*p*f))))/c,this.over)}else r=R*Wn(o),i=0;else{var g=Math.exp(a/this.k0),_=.5*(g-1/g),v=this.lat0+o/this.k0,y=Math.cos(v);t=Math.sqrt((1-y**2)/(1+_**2)),r=Math.asin(t),o<0&&(r=-r),i=_===0&&y===0?0:K(Math.atan2(_,y)+this.long0,this.over)}return e.x=i,e.y=r,e}var Ki={init:Ui,forward:Wi,inverse:Gi,names:[`Fast_Transverse_Mercator`,`Fast Transverse Mercator`]};function qi(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Y(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+r**2)}function Ji(e){var t=1+e,n=t-1;return n===0?e:e*Math.log(t)/n}function Yi(e){var t=Math.abs(e);return t=Ji(t*(1+t/(Y(1,t)+1))),e<0?-t:t}function Xi(e,t){for(var n=2*Math.cos(2*t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return t+o*Math.sin(2*t)}function Zi(e,t){for(var n=2*Math.cos(t),r=e.length-1,i=e[r],a=0,o;--r>=0;)o=-a+n*i+e[r],a=i,i=o;return Math.sin(t)*o}function Qi(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function $i(e,t,n){for(var r=Math.sin(t),i=Math.cos(t),a=qi(n),o=Qi(n),s=2*i*o,c=-2*r*a,l=e.length-1,u=e[l],d=0,f=0,p=0,m,h;--l>=0;)m=f,h=d,f=u,d=p,u=-m+s*f-c*d+e[l],p=-h+c*f+s*d;return s=r*o,c=i*a,[s*u-c*p,s*p+c*u]}function ea(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw Error(`Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.`);this.approx&&(Ki.init.apply(this),this.forward=Ki.forward,this.inverse=Ki.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+-2854/675*t))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+4642/4725*t))))),n*=t,this.cgb[1]=n*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+2323/945*t)))),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+-1522/945*t)))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+73814/2835*t))),this.cbg[2]=n*(-26/15+t*(34/21+t*(8/5+-12686/2835*t))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+-399572/14175*t)),this.cbg[3]=n*(1237/630+t*(-12/5+-24832/14175*t)),n*=t,this.cgb[4]=n*(4174/315+-144838/6237*t),this.cbg[4]=n*(-734/315+109598/31185*t),n*=t,this.cgb[5]=601676/22275*n,this.cbg[5]=444337/155925*n,n=t**2,this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+-96199/604800*t))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+7891/37800*t))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+1118711/3870720*t)))),this.gtu[1]=n*(13/48+t*(-3/5+t*(557/1440+t*(281/630+-1983433/1935360*t)))),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+-5569/90720*t))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+167603/181440*t))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+830251/7257600*t)),this.gtu[3]=n*(49561/161280+t*(-179/168+6601661/7257600*t)),n*=t,this.utg[4]=n*(-4583/161280+108847/3991680*t),this.gtu[4]=n*(34729/80640+-3418889/1995840*t),n*=t,this.utg[5]=-20648693/638668800*n,this.gtu[5]=212378941/319334400*n;var r=Xi(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Zi(this.gtu,2*r))}function ta(e){var t=K(e.x-this.long0,this.over),n=e.y;n=Xi(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(r,o*i),t=Math.atan2(a*i,Y(r,i*o)),t=Yi(Math.tan(t));var s=$i(this.gtu,2*n,2*t);n+=s[0],t+=s[1];var c,l;return Math.abs(t)<=2.623395162778?(c=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function na(e){var t=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,t/=this.Qn;var r,i;if(Math.abs(t)<=2.623395162778){var a=$i(this.utg,2*n,2*t);n+=a[0],t+=a[1],t=Math.atan(qi(t));var o=Math.sin(n),s=Math.cos(n),c=Math.sin(t),l=Math.cos(t);n=Math.atan2(o*l,Y(c,l*s)),t=Math.atan2(c,l*s),r=K(t+this.long0,this.over),i=Xi(this.cgb,n)}else r=1/0,i=1/0;return e.x=r,e.y=i,e}var ra={init:ea,forward:ta,inverse:na,names:[`Extended_Transverse_Mercator`,`Extended Transverse Mercator`,`etmerc`,`Transverse_Mercator`,`Transverse Mercator`,`Gauss Kruger`,`Gauss_Kruger`,`tmerc`]};function ia(e,t){if(e===void 0){if(e=Math.floor((K(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var aa=`etmerc`;function oa(){var e=ia(this.zone,this.long0);if(e===void 0)throw Error(`unknown utm zone`);this.lat0=0,this.long0=(6*Math.abs(e)-183)*B,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ra.init.apply(this),this.forward=ra.forward,this.inverse=ra.inverse}var sa={init:oa,names:[`Universal Transverse Mercator System`,`utm`],dependsOn:aa};function ca(e,t){return((1-e)/(1+e))**t}var la=20;function ua(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+H)/(Math.tan(.5*this.lat0+H)**+this.C*ca(this.e*e,this.ratexp))}function da(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.tan(.5*n+H)**+this.C*ca(this.e*Math.sin(n),this.ratexp))-R,e.x=this.C*t,e}function fa(e){for(var t=1e-14,n=e.x/this.C,r=e.y,i=(Math.tan(.5*r+H)/this.K)**(1/this.C),a=la;a>0&&(r=2*Math.atan(i*ca(this.e*Math.sin(e.y),-.5*this.e))-R,!(Math.abs(r-e.y)<t));--a)e.y=r;return a?(e.x=n,e.y=r,e):null}var pa={init:ua,forward:da,inverse:fa,names:[`gauss`]};function ma(){pa.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||=`Oblique Stereographic Alternative`)}function ha(e){var t,n,r,i;return e.x=K(e.x-this.long0,this.over),pa.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function ga(e){var t,n,r,i,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Y(e.x,e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,pa.inverse.apply(this,[e]),e.x=K(e.x+this.long0,this.over),e}var _a={init:ma,forward:ha,inverse:ga,names:[`Stereographic_North_Pole`,`Oblique_Stereographic`,`sterea`,`Oblique Stereographic Alternative`,`Double_Stereographic`]};function va(e,t,n){return t*=n,Math.tan(.5*(R+e))*((1-t)/(1+t))**(.5*n)}function ya(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=z&&(this.k0=.5*(1+Wn(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=z&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt((1+this.e)**+(1+this.e)*(1-this.e)**(1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=z&&Math.abs(Math.cos(this.lat_ts))>z&&(this.k0=.5*this.cons*Un(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Gn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Un(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(va(this.lat0,this.sinlat0,this.e))-R,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function ba(e){var t=e.x,n=e.y,r=Math.sin(n),i=Math.cos(n),a,o,s,c,l,u,d=K(t-this.long0,this.over);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=z&&Math.abs(n+this.lat0)<=z?(e.x=NaN,e.y=NaN,e):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(d)),e.x=this.a*a*i*Math.sin(d)+this.x0,e.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(d))+this.y0,e):(o=2*Math.atan(va(n,r,this.e))-R,c=Math.cos(o),s=Math.sin(o),Math.abs(this.coslat0)<=z?(l=Gn(this.e,n*this.con,this.con*r),u=2*this.a*this.k0*l/this.cons,e.x=this.x0+u*Math.sin(t-this.long0),e.y=this.y0-this.con*u*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<z?(a=2*this.a*this.k0/(1+c*Math.cos(d)),e.y=a*s):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*c*Math.cos(d))),e.y=a*(this.cosX0*s-this.sinX0*c*Math.cos(d))+this.y0),e.x=a*c*Math.sin(d)+this.x0,e))}function xa(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,n=this.lat0,o<=z?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<z?this.lat0>0?K(this.long0+Math.atan2(e.x,-1*e.y),this.over):K(this.long0+Math.atan2(e.x,e.y),this.over):K(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s)),this.over),e.x=t,e.y=n,e)}else if(Math.abs(this.coslat0)<=z){if(o<=z)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),n=this.con*Kn(this.e,r),t=this.con*K(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=z?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/o),t=K(this.long0+Math.atan2(e.x*Math.sin(i),o*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)),this.over)),n=-1*Kn(this.e,Math.tan(.5*(R+a)));return e.x=t,e.y=n,e}var Sa={init:ya,forward:ba,inverse:xa,names:[`stere`,`Stereographic_South_Pole`,`Polar_Stereographic_variant_A`,`Polar_Stereographic_variant_B`,`Polar_Stereographic`],ssfn_:va};function Ca(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=1/this.rf,i=2*r-r**2,a=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*t**2),this.alpha=Math.sqrt(1+i/(1-i)*Math.cos(e)**4),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*c}function wa(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e}function Ta(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,c=0,l=a,u=-1e3,d=0;Math.abs(l-u)>1e-7;){if(++d>20)return;c=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(c))-Math.PI/2}return e.x=s,e.y=l,e}var Ea={init:Ca,forward:wa,inverse:Ta,names:[`somerc`]},Da=1e-7;function Oa(e){var t=[`Hotine_Oblique_Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`],n=typeof e.projName==`object`?Object.keys(e.projName)[0]:e.projName;return`no_uoff`in e||`no_off`in e||t.indexOf(n)!==-1||t.indexOf(ir(n))!==-1}function ka(){var e,t,n,r,i,a,o,s,c,l,u=0,d,f=0,p=0,m=0,h=0,g=0,_=0;this.no_off=Oa(this),this.no_rot=`no_rot`in this;var v=!1;`alpha`in this&&(v=!0);var y=!1;if(`rectified_grid_angle`in this&&(y=!0),v&&(_=this.alpha),y&&(u=this.rectified_grid_angle),v||y)f=this.longc;else if(p=this.long1,h=this.lat1,m=this.long2,g=this.lat2,Math.abs(h-g)<=Da||(e=Math.abs(h))<=Da||Math.abs(e-R)<=Da||Math.abs(Math.abs(this.lat0)-R)<=Da||Math.abs(Math.abs(g)-R)<=Da)throw Error();var b=1-this.es;t=Math.sqrt(b),Math.abs(this.lat0)>z?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*t/e,r=this.B*t/(n*Math.sqrt(e)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Gn(this.e,this.lat0,s)**+this.B):(this.B=1/t,this.A=this.k0,this.E=r=i=1),v||y?(v?(d=Math.asin(Math.sin(_)/r),y||(u=_)):(d=u,_=Math.asin(r*Math.sin(d))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(d))/this.B):(a=Gn(this.e,h,Math.sin(h))**+this.B,o=Gn(this.e,g,Math.sin(g))**+this.B,i=this.E/a,c=(o-a)/(o+a),l=this.E*this.E,l=(l-o*a)/(l+o*a),e=p-m,e<-Math.PI?m-=Gt:e>Math.PI&&(m+=Gt),this.lam0=K(.5*(p+m)-Math.atan(l*Math.tan(.5*this.B*(p-m))/c)/this.B,this.over),d=Math.atan(2*Math.sin(this.B*K(p-this.lam0,this.over))/(i-1/i)),u=_=Math.asin(r*Math.sin(d))),this.singam=Math.sin(d),this.cosgam=Math.cos(d),this.sinrot=Math.sin(u),this.cosrot=Math.cos(u),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(_))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*d,this.v_pole_n=this.ArB*Math.log(Math.tan(H-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(H+i))}function Aa(e){var t={},n,r,i,a,o,s,c,l;if(e.x-=this.lam0,Math.abs(Math.abs(e.y)-R)>z){if(o=this.E/Gn(this.e,e.y,Math.sin(e.y))**+this.B,s=1/o,n=.5*(o-s),r=.5*(o+s),a=Math.sin(this.B*e.x),i=(n*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)<z)throw Error();l=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*e.x),c=Math.abs(s)<Da?this.A*e.x:this.ArB*Math.atan2(n*this.cosgam+a*this.singam,s)}else l=e.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*e.y;return this.no_rot?(t.x=c,t.y=l):(c-=this.u_0,t.x=l*this.cosrot+c*this.sinrot,t.y=c*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function ja(e){var t,n,r,i,a,o,s,c={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.BrA*t),s=(o*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)<z)c.x=0,c.y=s<0?-R:R;else{if(c.y=this.E/Math.sqrt((1+s)/(1-s)),c.y=Kn(this.e,c.y**(1/this.B)),c.y===1/0)throw Error();c.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return c.x+=this.lam0,c}var Ma={init:ka,forward:Aa,inverse:ja,names:[`Hotine_Oblique_Mercator`,`Hotine Oblique Mercator`,`Hotine_Oblique_Mercator_variant_A`,`Hotine_Oblique_Mercator_Variant_B`,`Hotine_Oblique_Mercator_Azimuth_Natural_Origin`,`Hotine_Oblique_Mercator_Two_Point_Natural_Origin`,`Hotine_Oblique_Mercator_Azimuth_Center`,`Oblique_Mercator`,`omerc`]};function Na(){if(this.lat2||=this.lat1,this.k0||=1,this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<z)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Un(this.e,t,n),i=Gn(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=Un(this.e,a,o),c=Gn(this.e,this.lat2,a),l=Math.abs(Math.abs(this.lat0)-R)<z?0:Gn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>z?this.ns=Math.log(r/s)/Math.log(i/c):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*i**+this.ns),this.rh=this.a*this.f0*l**+this.ns,this.title||=`Lambert Conformal Conic`}}function Pa(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=z&&(n=Wn(n)*(R-2*z));var r=Math.abs(Math.abs(n)-R),i,a;if(r>z)i=Gn(this.e,n,Math.sin(n)),a=this.a*this.f0*i**+this.ns;else{if(r=n*this.ns,r<=0)return null;a=0}var o=this.ns*K(t-this.long0,this.over);return e.x=this.k0*(a*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,e}function Fa(e){var t,n,r,i,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),n=1):(t=-Math.sqrt(o*o+s*s),n=-1);var c=0;if(t!==0&&(c=Math.atan2(n*o,n*s)),t!==0||this.ns>0){if(n=1/this.ns,r=(t/(this.a*this.f0))**+n,i=Kn(this.e,r),i===-9999)return null}else i=-R;return a=K(c/this.ns+this.long0,this.over),e.x=a,e.y=i,e}var Ia={init:Na,forward:Pa,inverse:Fa,names:[`Lambert Tangential Conformal Conic Projection`,`Lambert_Conformal_Conic`,`Lambert_Conformal_Conic_1SP`,`Lambert_Conformal_Conic_2SP`,`lcc`,`Lambert Conic Conformal (1SP)`,`Lambert Conic Conformal (2SP)`]};function La(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||=.863937979737193,this.long0||=.4334234309119251,this.k0||=.9999,this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.cos(this.fi0)**4/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)))**(this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.tan(this.fi0/2+this.s45)**+this.alfa*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.sin(this.fi0)**2),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Ra(e){var t,n,r,i,a,o,s,c=e.x,l=e.y,u=K(c-this.long0,this.over);return t=((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)))**(this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.tan(l/2+this.s45)**+this.alfa/t)-this.s45),r=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),a=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.tan(this.s0/2+this.s45)**+this.n/Math.tan(i/2+this.s45)**+this.n,e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e}function za(e){var t,n,r,i,a,o,s,c,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),a=Math.atan2(e.y,e.x),i=a/Math.sin(this.s0),r=2*(Math.atan((this.ro0/o)**(1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,s=t,c=0;var u=0;do e.y=2*(Math.atan(this.k**(-1/this.alfa)*Math.tan(t/2+this.s45)**(1/this.alfa)*((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)))**(this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(c=1),s=e.y,u+=1;while(c===0&&u<15);return u>=15?null:e}var Ba={init:La,forward:Ra,inverse:za,names:[`Krovak`,`krovak`]};function X(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function Va(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function Ha(e){return .375*e*(1+.25*e*(1+.46875*e))}function Ua(e){return .05859375*e*e*(1+.75*e)}function Wa(e){return e*e*e*(35/3072)}function Ga(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)}function Ka(e){return Math.abs(e)<R?e:e-Wn(e)*Math.PI}function qa(e,t,n,r,i){for(var a=e/t,o,s=0;s<15;s++)if(o=(e-(t*a-n*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(t-2*n*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}function Ja(){this.sphere||(this.e0=Va(this.es),this.e1=Ha(this.es),this.e2=Ua(this.es),this.e3=Wa(this.es),this.ml0=this.a*X(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Ya(e){var t,n,r=e.x,i=e.y;if(r=K(r-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=Ga(this.a,this.e,a),c=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),u=l*l,d=this.es*o*o/(1-this.es),f=this.a*X(this.e0,this.e1,this.e2,this.e3,i);t=s*l*(1-u*c*(1/6-(8-c+8*d)*u/120)),n=f-this.ml0+s*a/o*u*(.5+(5-c+6*d)*u/24)}return e.x=t+this.x0,e.y=n+this.y0,e}function Xa(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i;if(this.sphere){var a=n+this.lat0;r=Math.asin(Math.sin(a)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(a))}else{var o=qa(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-R)<=z)return e.x=this.long0,e.y=R,n<0&&(e.y*=-1),e;var s=Ga(this.a,this.e,Math.sin(o)),c=s*s*s/this.a/this.a*(1-this.es),l=Math.tan(o)**2,u=t*this.a/s,d=u*u;r=o-s*Math.tan(o)/c*u*u*(.5-(1+3*l)*u*u/24),i=u*(1-d*(l/3+(1+3*l)*l*d/15))/Math.cos(o)}return e.x=K(i+this.long0,this.over),e.y=Ka(r),e}var Za={init:Ja,forward:Ya,inverse:Xa,names:[`Cassini`,`Cassini_Soldner`,`cass`]};function Qa(e,t){var n;return e>1e-7?(n=e*t,(1-e*e)*(t/(1-n*n)-.5/e*Math.log((1-n)/(1+n)))):2*t}var $a=1,eo=2,to=3,no=4;function ro(){var e=Math.abs(this.lat0);if(Math.abs(e-R)<z?this.mode=this.lat0<0?$a:eo:Math.abs(e)<z?this.mode=to:this.mode=no,this.es>0){var t;switch(this.qp=Qa(this.e,1),this.mmf=.5/(1-this.es),this.apa=po(this.es),this.mode){case eo:this.dd=1;break;case $a:this.dd=1;break;case to:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case no:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Qa(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===no&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function io(e){var t,n,r,i,a,o,s,c,l,u,d=e.x,f=e.y;if(d=K(d-this.long0,this.over),this.sphere){if(a=Math.sin(f),u=Math.cos(f),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+u*r:1+this.sinph0*a+this.cosph0*u*r,n<=z)return null;n=Math.sqrt(2/n),t=n*u*Math.sin(d),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<z)return null;n=H-f*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),t=n*Math.sin(d),n*=r}}else{switch(s=0,c=0,l=0,r=Math.cos(d),i=Math.sin(d),a=Math.sin(f),o=Qa(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=o/this.qp,c=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:l=1+this.sinb1*s+this.cosb1*c*r;break;case this.EQUIT:l=1+c*r;break;case this.N_POLE:l=R+f,o=this.qp-o;break;case this.S_POLE:l=f-R,o=this.qp+o;break}if(Math.abs(l)<z)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),n=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*s-this.sinb1*c*r):(l=Math.sqrt(2/(1+c*r)))*s*this.ymf,t=this.xmf*l*c*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(l=Math.sqrt(o))*i,n=r*(this.mode===this.S_POLE?l:-l)):t=n=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e}function ao(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i,a,o,s,c,l;if(this.sphere){var u=0,d,f=0;if(d=Math.sqrt(t*t+n*n),i=d*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),u=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(d)<=z?0:Math.asin(n*f/d),t*=f,n=u*d;break;case this.OBLIQ:i=Math.abs(d)<=z?this.lat0:Math.asin(u*this.sinph0+n*f*this.cosph0/d),t*=f*this.cosph0,n=(u-Math.sin(i)*this.sinph0)*d;break;case this.N_POLE:n=-n,i=R-i;break;case this.S_POLE:i-=R;break}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,n)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,n*=this.dd,c=Math.sqrt(t*t+n*n),c<z)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*c/this.rq),a=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(l=a*this.sinb1+n*o*this.cosb1/c,s=this.qp*l,n=c*this.cosb1*a-n*this.sinb1*o):(l=n*o/c,s=this.qp*l,n=c*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),s=t*t+n*n,!s)return e.x=this.long0,e.y=this.lat0,e;l=1-s/this.qp,this.mode===this.S_POLE&&(l=-l)}r=Math.atan2(t,n),i=mo(Math.asin(l),this.apa)}return e.x=K(this.long0+r,this.over),e.y=i,e}var oo=.3333333333333333,so=.17222222222222222,co=.10257936507936508,lo=.06388888888888888,uo=.0664021164021164,fo=.016415012942191543;function po(e){var t,n=[];return n[0]=e*oo,t=e*e,n[0]+=t*so,n[1]=t*lo,t*=e,n[0]+=t*co,n[1]+=t*uo,n[2]=t*fo,n}function mo(e,t){var n=e+e;return e+t[0]*Math.sin(n)+t[1]*Math.sin(n+n)+t[2]*Math.sin(n+n+n)}var ho={init:ro,forward:io,inverse:ao,names:[`Lambert Azimuthal Equal Area`,`Lambert_Azimuthal_Equal_Area`,`laea`],S_POLE:$a,N_POLE:eo,EQUIT:to,OBLIQ:no};function go(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function _o(){Math.abs(this.lat1+this.lat2)<z||(this.temp=this.b/this.a,this.es=1-this.temp**2,this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Un(this.e3,this.sin_po,this.cos_po),this.qs1=Qa(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Un(this.e3,this.sin_po,this.cos_po),this.qs2=Qa(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Qa(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>z?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function vo(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Qa(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*K(t-this.long0,this.over),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return e.x=o,e.y=s,e}function yo(e){var t,n,r,i,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,t!==0&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,n)),a=K(i/this.ns0+this.long0,this.over),e.x=a,e.y=o,e}function bo(e,t){var n,r,i,a,o,s=go(.5*t);if(e<z)return s;for(var c=e*e,l=1;l<=25;l++)if(n=Math.sin(s),r=Math.cos(s),i=e*n,a=1-i*i,o=.5*a*a/r*(t/(1-c)-n/a+.5/e*Math.log((1-i)/(1+i))),s+=o,Math.abs(o)<=1e-7)return s;return null}var xo={init:_o,forward:vo,inverse:yo,names:[`Albers_Conic_Equal_Area`,`Albers_Equal_Area`,`Albers`,`aea`],phi1z:bo};function So(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Co(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=K(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,o>0||Math.abs(o)<=z?(s=this.x0+this.a*a*n*Math.sin(r)/o,c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)/o):(s=this.x0+this.infinity_dist*n*Math.sin(r),c=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function wo(e){var t,n,r,i,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),o=go(r*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),a=K(this.long0+a,this.over)):(o=this.phic0,a=0),e.x=a,e.y=o,e}var To={init:So,forward:Co,inverse:wo,names:[`gnom`]};function Eo(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*R:R;for(var r=Math.asin(.5*t),i,a,o,s,c=0;c<30;c++)if(a=Math.sin(r),o=Math.cos(r),s=e*a,i=(1-s*s)**2/(2*o)*(t/(1-e*e)-a/(1-s*s)+.5/e*Math.log((1-s)/(1+s))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function Do(){this.sphere||(this.k0=Un(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Oo(e){var t=e.x,n=e.y,r,i,a=K(t-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=Qa(this.e,Math.sin(n));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return e.x=r,e.y=i,e}function ko(e){e.x-=this.x0,e.y-=this.y0;var t,n;return this.sphere?(t=K(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=Eo(this.e,2*e.y*this.k0/this.a),t=K(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=n,e}var Ao={init:Do,forward:Oo,inverse:ko,names:[`cea`]};function jo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Equidistant Cylindrical (Plate Carre)`,this.rc=Math.cos(this.lat_ts)}function Mo(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i=Ka(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e}function No(e){var t=e.x,n=e.y;return e.x=K(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=Ka(this.lat0+(n-this.y0)/this.a),e}var Po={init:jo,forward:Mo,inverse:No,names:[`Equirectangular`,`Equidistant_Cylindrical`,`Equidistant_Cylindrical_Spherical`,`eqc`]},Fo=20;function Io(){this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=Va(this.es),this.e1=Ha(this.es),this.e2=Ua(this.es),this.e3=Wa(this.es),this.ml0=this.a*X(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Lo(e){var t=e.x,n=e.y,r,i,a,o=K(t-this.long0,this.over);if(a=o*Math.sin(n),this.sphere)Math.abs(n)<=z?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(n),i=this.a*(Ka(n-this.lat0)+(1-Math.cos(a))/Math.tan(n)));else if(Math.abs(n)<=z)r=this.a*o,i=-1*this.ml0;else{var s=Ga(this.a,this.e,Math.sin(n))/Math.tan(n);r=s*Math.sin(a),i=this.a*X(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(a))}return e.x=r+this.x0,e.y=i+this.y0,e}function Ro(e){var t,n,r=e.x-this.x0,i=e.y-this.y0,a,o,s,c,l;if(this.sphere)if(Math.abs(i+this.a*this.lat0)<=z)t=K(r/this.a+this.long0,this.over),n=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,c=o;var u;for(a=Fo;a;--a)if(u=Math.tan(c),l=-1*(o*(c*u+1)-c-.5*(c*c+s)*u)/((c-o)/u-1),c+=l,Math.abs(l)<=z){n=c;break}t=K(this.long0+Math.asin(r*Math.tan(c)/this.a)/Math.sin(n),this.over)}else if(Math.abs(i+this.ml0)<=z)n=0,t=K(this.long0+r/this.a,this.over);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,c=o;var d,f,p,m,h;for(a=Fo;a;--a)if(h=this.e*Math.sin(c),d=Math.sqrt(1-h*h)*Math.tan(c),f=this.a*X(this.e0,this.e1,this.e2,this.e3,c),p=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),m=f/this.a,l=(o*(d*m+1)-m-.5*d*(m*m+s))/(this.es*Math.sin(2*c)*(m*m+s-2*o*m)/(4*d)+(o-m)*(d*p-2/Math.sin(2*c))-p),c-=l,Math.abs(l)<=z){n=c;break}d=Math.sqrt(1-this.es*Math.sin(n)**2)*Math.tan(n),t=K(this.long0+Math.asin(r*d/this.a)/Math.sin(n),this.over)}return e.x=t,e.y=n,e}var zo={init:Io,forward:Lo,inverse:Ro,names:[`Polyconic`,`American_Polyconic`,`poly`]};function Bo(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Vo(e){var t,n=e.x,r=e.y-this.lat0,i=n-this.long0,a=r/Vt*1e-5,o=i,s=1,c=0;for(t=1;t<=10;t++)s*=a,c+=this.A[t]*s;var l=c,u=o,d=1,f=0,p,m,h=0,g=0;for(t=1;t<=6;t++)p=d*l-f*u,m=f*l+d*u,d=p,f=m,h=h+this.B_re[t]*d-this.B_im[t]*f,g=g+this.B_im[t]*d+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=h*this.a+this.y0,e}function Ho(e){var t,n=e.x,r=e.y,i=n-this.x0,a=(r-this.y0)/this.a,o=i/this.a,s=1,c=0,l,u,d=0,f=0;for(t=1;t<=6;t++)l=s*a-c*o,u=c*a+s*o,s=l,c=u,d=d+this.C_re[t]*s-this.C_im[t]*c,f=f+this.C_im[t]*s+this.C_re[t]*c;for(var p=0;p<this.iterations;p++){var m=d,h=f,g,_,v=a,y=o;for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,v+=(t-1)*(this.B_re[t]*m-this.B_im[t]*h),y+=(t-1)*(this.B_im[t]*m+this.B_re[t]*h);m=1,h=0;var b=this.B_re[1],x=this.B_im[1];for(t=2;t<=6;t++)g=m*d-h*f,_=h*d+m*f,m=g,h=_,b+=t*(this.B_re[t]*m-this.B_im[t]*h),x+=t*(this.B_im[t]*m+this.B_re[t]*h);var S=b*b+x*x;d=(v*b+y*x)/S,f=(y*b-v*x)/S}var C=d,w=f,T=1,E=0;for(t=1;t<=9;t++)T*=C,E+=this.D[t]*T;var D=this.lat0+E*Vt*1e5;return e.x=this.long0+w,e.y=D,e}var Uo={init:Bo,forward:Vo,inverse:Ho,names:[`New_Zealand_Map_Grid`,`nzmg`]};function Wo(){}function Go(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=i,e.y=a,e}function Ko(e){e.x-=this.x0,e.y-=this.y0;var t=K(this.long0+e.x/this.a,this.over),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e}var qo={init:Wo,forward:Go,inverse:Ko,names:[`Miller_Cylindrical`,`mill`]},Jo=20;function Yo(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=zi(this.es)}function Xo(e){var t,n,r=e.x,i=e.y;if(r=K(r-this.long0,this.over),this.sphere){if(!this.m)i=this.n===1?i:Math.asin(this.n*Math.sin(i));else for(var a=this.n*Math.sin(i),o=Jo;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<z)break}t=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var c=Math.sin(i),l=Math.cos(i);n=this.a*Bi(i,c,l,this.en),t=this.a*r*l/Math.sqrt(1-this.es*c*c)}return e.x=t,e.y=n,e}function Zo(e){var t,n,r,i;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=go((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=go(Math.sin(t)/this.n)),r=K(r+this.long0,this.over),t=Ka(t)):(t=Hi(e.y/this.a,this.es,this.en),i=Math.abs(t),i<R?(i=Math.sin(t),n=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=K(n,this.over)):i-z<R&&(r=this.long0)),e.x=r,e.y=t,e}var Qo={init:Yo,forward:Xo,inverse:Zo,names:[`Sinusoidal`,`sinu`]};function $o(){this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0}function es(e){for(var t=e.x,n=e.y,r=K(t-this.long0,this.over),i=n,a=Math.PI*Math.sin(n);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<z)break}i/=2,Math.PI/2-Math.abs(n)<z&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,c=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=c,e}function ts(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var r=K(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e}var ns={init:$o,forward:es,inverse:ts,names:[`Mollweide`,`moll`]};function rs(){Math.abs(this.lat1+this.lat2)<z||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-this.temp**2,this.e=Math.sqrt(this.es),this.e0=Va(this.es),this.e1=Ha(this.es),this.e2=Ua(this.es),this.e3=Wa(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Un(this.e,this.sin_phi,this.cos_phi),this.ml1=X(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<z?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Un(this.e,this.sin_phi,this.cos_phi),this.ml2=X(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=X(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function is(e){var t=e.x,n=e.y,r;if(this.sphere)r=this.a*(this.g-n);else{var i=X(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-i)}var a=this.ns*K(t-this.long0,this.over),o=this.x0+r*Math.sin(a),s=this.y0+this.rh-r*Math.cos(a);return e.x=o,e.y=s,e}function as(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,n,r,i;this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;return n!==0&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=K(this.long0+a/this.ns,this.over),r=Ka(this.g-n/this.a),e.x=i,e.y=r,e):(r=qa(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=K(this.long0+a/this.ns,this.over),e.x=i,e.y=r,e)}var os={init:rs,forward:is,inverse:as,names:[`Equidistant_Conic`,`eqdc`]};function ss(){this.R=this.a}function cs(e){var t=e.x,n=e.y,r=K(t-this.long0,this.over),i,a;Math.abs(n)<=z&&(i=this.x0+this.R*r,a=this.y0);var o=go(2*Math.abs(n/Math.PI));(Math.abs(r)<=z||Math.abs(Math.abs(n)-R)<=z)&&(i=this.x0,a=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/r-r/Math.PI),c=s*s,l=Math.sin(o),u=Math.cos(o),d=u/(l+u-1),f=d*d,p=d*(2/l-1),m=p*p,h=Math.PI*this.R*(s*(d-m)+Math.sqrt(c*(d-m)*(d-m)-(m+c)*(f-m)))/(m+c);r<0&&(h=-h),i=this.x0+h;var g=c+d;return h=Math.PI*this.R*(p*g-s*Math.sqrt((m+c)*(c+1)-g*g))/(m+c),a=n>=0?this.y0+h:this.y0-h,e.x=i,e.y=a,e}function ls(e){var t,n,r,i,a,o,s,c,l,u,d,f,p;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,i=e.y/d,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,c=-2*o+1+2*i*i+a*a,p=i*i/c+(2*s*s*s/c/c/c-9*o*s/c/c)/27,l=(o-s*s/3/c)/c,u=2*Math.sqrt(-l/3),d=3*p/l/u,Math.abs(d)>1&&(d=d>=0?1:-1),f=Math.acos(d)/3,n=e.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/c)*Math.PI,t=Math.abs(r)<z?this.long0:K(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r,this.over),e.x=t,e.y=n,e}var us={init:ss,forward:cs,inverse:ls,names:[`Van_der_Grinten_I`,`VanDerGrinten`,`Van_der_Grinten`,`vandg`]};function ds(e,t,n,r,i,a){let o=r-t,s=Math.atan((1-a)*Math.tan(e)),c=Math.atan((1-a)*Math.tan(n)),l=Math.sin(s),u=Math.cos(s),d=Math.sin(c),f=Math.cos(c),p=o,m,h=100,g,_,v,y,b,x,S,C,w,T,E,D,ee,O;do{if(g=Math.sin(p),_=Math.cos(p),v=Math.sqrt(f*g*(f*g)+(u*d-l*f*_)*(u*d-l*f*_)),v===0)return{azi1:0,s12:0};y=l*d+u*f*_,b=Math.atan2(v,y),x=u*f*g/v,S=1-x*x,C=S===0?0:y-2*l*d/S,w=a/16*S*(4+a*(4-3*S)),m=p,p=o+(1-w)*a*x*(b+w*v*(C+w*y*(-1+2*C*C)))}while(Math.abs(p-m)>1e-12&&--h>0);return h===0?{azi1:NaN,s12:NaN}:(T=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),E=1+T/16384*(4096+T*(-768+T*(320-175*T))),D=T/1024*(256+T*(-128+T*(74-47*T))),ee=D*v*(C+D/4*(y*(-1+2*C*C)-D/6*C*(-3+4*v*v)*(-3+4*C*C))),O=i*(1-a)*E*(b-ee),{azi1:Math.atan2(f*g,u*d-l*f*_),s12:O})}function fs(e,t,n,r,i,a){let o=Math.atan((1-a)*Math.tan(e)),s=Math.sin(o),c=Math.cos(o),l=Math.sin(n),u=Math.cos(n),d=Math.atan2(s,c*u),f=c*l,p=1-f*f,m=p*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),h=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m))),_=r/(i*(1-a)*h),v,y=100,b,x,S,C;do b=Math.cos(2*d+_),x=Math.sin(_),S=Math.cos(_),C=g*x*(b+g/4*(S*(-1+2*b*b)-g/6*b*(-3+4*x*x)*(-3+4*b*b))),v=_,_=r/(i*(1-a)*h)+C;while(Math.abs(_-v)>1e-12&&--y>0);if(y===0)return{lat2:NaN,lon2:NaN};let w=s*x-c*S*u,T=Math.atan2(s*S+c*x*u,(1-a)*Math.sqrt(f*f+w*w)),E=Math.atan2(x*l,c*S-s*x*u),D=a/16*p*(4+a*(4-3*p));return{lat2:T,lon2:t+(E-(1-D)*a*f*(_+D*x*(b+D*S*(-1+2*b*b))))}}function ps(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function ms(e){var t=e.x,n=e.y,r=Math.sin(e.y),i=Math.cos(e.y),a=K(t-this.long0,this.over),o,s,c,l,u,d,f,p,m,h,g;return this.sphere?Math.abs(this.sin_p12-1)<=z?(e.x=this.x0+this.a*(R-n)*Math.sin(a),e.y=this.y0-this.a*(R-n)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=z?(e.x=this.x0+this.a*(R+n)*Math.sin(a),e.y=this.y0+this.a*(R+n)*Math.cos(a),e):(m=this.sin_p12*r+this.cos_p12*i*Math.cos(a),f=Math.acos(m),p=f?f/Math.sin(f):1,e.x=this.x0+this.a*p*i*Math.sin(a),e.y=this.y0+this.a*p*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),e):(o=Va(this.es),s=Ha(this.es),c=Ua(this.es),l=Wa(this.es),Math.abs(this.sin_p12-1)<=z?(u=this.a*X(o,s,c,l,R),d=this.a*X(o,s,c,l,n),e.x=this.x0+(u-d)*Math.sin(a),e.y=this.y0-(u-d)*Math.cos(a),e):Math.abs(this.sin_p12+1)<=z?(u=this.a*X(o,s,c,l,R),d=this.a*X(o,s,c,l,n),e.x=this.x0+(u+d)*Math.sin(a),e.y=this.y0+(u+d)*Math.cos(a),e):Math.abs(t)<z&&Math.abs(n-this.lat0)<z?(e.x=e.y=0,e):(h=ds(this.lat0,this.long0,n,t,this.a,this.f),g=h.azi1,e.x=h.s12*Math.sin(g),e.y=h.s12*Math.cos(g),e))}function hs(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*R*this.a?void 0:(n=t/this.a,r=Math.sin(n),i=Math.cos(n),a=this.long0,Math.abs(t)<=z?o=this.lat0:(o=go(i*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-R,a=Math.abs(s)<=z?this.lat0>=0?K(this.long0+Math.atan2(e.x,-e.y),this.over):K(this.long0-Math.atan2(-e.x,e.y),this.over):K(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r),this.over)),e.x=a,e.y=o,e)):(c=Va(this.es),l=Ha(this.es),u=Ua(this.es),d=Wa(this.es),Math.abs(this.sin_p12-1)<=z?(f=this.a*X(c,l,u,d,R),t=Math.sqrt(e.x*e.x+e.y*e.y),p=f-t,o=qa(p/this.a,c,l,u,d),a=K(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=z?(f=this.a*X(c,l,u,d,R),t=Math.sqrt(e.x*e.x+e.y*e.y),p=t-f,o=qa(p/this.a,c,l,u,d),a=K(this.long0+Math.atan2(e.x,e.y),this.over),e.x=a,e.y=o,e):(m=Math.atan2(e.x,e.y),h=Math.sqrt(e.x*e.x+e.y*e.y),g=fs(this.lat0,this.long0,m,h,this.a,this.f),e.x=g.lon2,e.y=g.lat2,e))}var gs={init:ps,forward:ms,inverse:hs,names:[`Azimuthal_Equidistant`,`aeqd`]};function _s(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function vs(e){var t,n,r,i,a,o,s,c,l=e.x,u=e.y;return r=K(l-this.long0,this.over),t=Math.sin(u),n=Math.cos(u),i=Math.cos(r),o=this.sin_p14*t+this.cos_p14*n*i,a=1,(o>0||Math.abs(o)<=z)&&(s=this.a*a*n*Math.sin(r),c=this.y0+this.a*a*(this.cos_p14*t-this.sin_p14*n*i)),e.x=s,e.y=c,e}function ys(e){var t,n,r,i,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=go(t/this.a),r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(t)<=z?(s=this.lat0,e.x=o,e.y=s,e):(s=go(i*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-R,Math.abs(a)<=z?(o=this.lat0>=0?K(this.long0+Math.atan2(e.x,-e.y),this.over):K(this.long0-Math.atan2(-e.x,e.y),this.over),e.x=o,e.y=s,e):(o=K(this.long0+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),this.over),e.x=o,e.y=s,e))}var bs={init:_s,forward:vs,inverse:ys,names:[`ortho`]},Z={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Q={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function xs(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||`Quadrilateralized Spherical Cube`,this.lat0>=R-H/2?this.face=Z.TOP:this.lat0<=-(R-H/2)?this.face=Z.BOTTOM:Math.abs(this.long0)<=H?this.face=Z.FRONT:Math.abs(this.long0)<=R+H?this.face=this.long0>0?Z.RIGHT:Z.LEFT:this.face=Z.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ss(e){var t={x:0,y:0},n,r,i,a,o,s,c={value:0};if(e.x-=this.long0,n=this.es===0?e.y:Math.atan(this.one_minus_f_squared*Math.tan(e.y)),r=e.x,this.face===Z.TOP)a=R-n,r>=H&&r<=R+H?(c.value=Q.AREA_0,i=r-R):r>R+H||r<=-(R+H)?(c.value=Q.AREA_1,i=r>0?r-U:r+U):r>-(R+H)&&r<=-H?(c.value=Q.AREA_2,i=r+R):(c.value=Q.AREA_3,i=r);else if(this.face===Z.BOTTOM)a=R+n,r>=H&&r<=R+H?(c.value=Q.AREA_0,i=-r+R):r<H&&r>=-H?(c.value=Q.AREA_1,i=-r):r<-H&&r>=-(R+H)?(c.value=Q.AREA_2,i=-r-R):(c.value=Q.AREA_3,i=r>0?-r+U:-r-U);else{var l,u,d,f,p,m,h;this.face===Z.RIGHT?r=Ts(r,+R):this.face===Z.BACK?r=Ts(r,+U):this.face===Z.LEFT&&(r=Ts(r,-R)),f=Math.sin(n),p=Math.cos(n),m=Math.sin(r),h=Math.cos(r),l=p*h,u=p*m,d=f,this.face===Z.FRONT?(a=Math.acos(l),i=ws(a,d,u,c)):this.face===Z.RIGHT?(a=Math.acos(u),i=ws(a,d,-l,c)):this.face===Z.BACK?(a=Math.acos(-l),i=ws(a,d,-u,c)):this.face===Z.LEFT?(a=Math.acos(-u),i=ws(a,d,l,c)):(a=i=0,c.value=Q.AREA_0)}return s=Math.atan(12/U*(i+Math.acos(Math.sin(i)*Math.cos(H))-R)),o=Math.sqrt((1-Math.cos(a))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),c.value===Q.AREA_1?s+=R:c.value===Q.AREA_2?s+=U:c.value===Q.AREA_3&&(s+=1.5*U),t.x=o*Math.cos(s),t.y=o*Math.sin(s),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Cs(e){var t={lam:0,phi:0},n,r,i,a,o,s,c,l,u,d={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),n=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?d.value=Q.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(d.value=Q.AREA_1,n-=R):e.x<0&&-e.x>=Math.abs(e.y)?(d.value=Q.AREA_2,n=n<0?n+U:n-U):(d.value=Q.AREA_3,n+=R),u=U/12*Math.tan(n),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),s=Math.atan(o),i=Math.cos(n),a=Math.tan(r),c=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(s)))),c<-1?c=-1:c>1&&(c=1),this.face===Z.TOP)l=Math.acos(c),t.phi=R-l,d.value===Q.AREA_0?t.lam=s+R:d.value===Q.AREA_1?t.lam=s<0?s+U:s-U:d.value===Q.AREA_2?t.lam=s-R:t.lam=s;else if(this.face===Z.BOTTOM)l=Math.acos(c),t.phi=l-R,d.value===Q.AREA_0?t.lam=-s+R:d.value===Q.AREA_1?t.lam=-s:d.value===Q.AREA_2?t.lam=-s-R:t.lam=s<0?-s-U:-s+U;else{var f=c,p,m;u=f*f,m=u>=1?0:Math.sqrt(1-u)*Math.sin(s),u+=m*m,p=u>=1?0:Math.sqrt(1-u),d.value===Q.AREA_1?(u=p,p=-m,m=u):d.value===Q.AREA_2?(p=-p,m=-m):d.value===Q.AREA_3&&(u=p,p=m,m=-u),this.face===Z.RIGHT?(u=f,f=-p,p=u):this.face===Z.BACK?(f=-f,p=-p):this.face===Z.LEFT&&(u=f,f=p,p=-u),t.phi=Math.acos(-m)-R,t.lam=Math.atan2(p,f),this.face===Z.RIGHT?t.lam=Ts(t.lam,-R):this.face===Z.BACK?t.lam=Ts(t.lam,-U):this.face===Z.LEFT&&(t.lam=Ts(t.lam,+R))}if(this.es!==0){var h=t.phi<0?1:0,g=Math.tan(t.phi),_=this.b/Math.sqrt(g*g+this.one_minus_f_squared);t.phi=Math.atan(Math.sqrt(this.a*this.a-_*_)/(this.one_minus_f*_)),h&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function ws(e,t,n,r){var i;return e<z?(r.value=Q.AREA_0,i=0):(i=Math.atan2(t,n),Math.abs(i)<=H?r.value=Q.AREA_0:i>H&&i<=R+H?(r.value=Q.AREA_1,i-=R):i>R+H||i<=-(R+H)?(r.value=Q.AREA_2,i=i>=0?i-U:i+U):(r.value=Q.AREA_3,i+=R)),i}function Ts(e,t){var n=e+t;return n<-U?n+=Gt:n>+U&&(n-=Gt),n}var Es={init:xs,forward:Ss,inverse:Cs,names:[`Quadrilateralized Spherical Cube`,`Quadrilateralized_Spherical_Cube`,`qsc`]},Ds=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Os=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,422642e-15],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ks=.8487,As=1.3523,js=V/5,Ms=1/js,Ns=18,Ps=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},Fs=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function Is(e,t,n,r){for(var i=t;r;--r){var a=e(i);if(i-=a,Math.abs(a)<n)break}return i}function Ls(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||`Robinson`}function Rs(e){var t=K(e.x-this.long0,this.over),n=Math.abs(e.y),r=Math.floor(n*js);r<0?r=0:r>=Ns&&(r=Ns-1),n=V*(n-Ms*r);var i={x:Ps(Ds[r],n)*t,y:Ps(Os[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*ks+this.x0,i.y=i.y*this.a*As+this.y0,i}function zs(e){var t={x:(e.x-this.x0)/(this.a*ks),y:Math.abs(e.y-this.y0)/(this.a*As)};if(t.y>=1)t.x/=Ds[Ns][0],t.y=e.y<0?-R:R;else{var n=Math.floor(t.y*Ns);for(n<0?n=0:n>=Ns&&(n=Ns-1);;)if(Os[n][0]>t.y)--n;else if(Os[n+1][0]<=t.y)++n;else break;var r=Os[n],i=5*(t.y-r[0])/(Os[n+1][0]-r[0]);i=Is(function(e){return(Ps(r,e)-t.y)/Fs(r,e)},i,z,100),t.x/=Ps(Ds[n],i),t.y=(5*n+i)*B,e.y<0&&(t.y=-t.y)}return t.x=K(t.x+this.long0,this.over),t}var Bs={init:Ls,forward:Rs,inverse:zs,names:[`Robinson`,`robin`]};function Vs(){this.name=`geocent`}function Hs(e){return Ir(e,this.es,this.a)}function Us(e){return Lr(e,this.es,this.a,this.b)}var Ws={init:Vs,forward:Hs,inverse:Us,names:[`Geocentric`,`geocentric`,`geocent`,`Geocent`]},$={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Gs={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Ks(){if(Object.keys(Gs).forEach(function(e){if(this[e]===void 0)this[e]=Gs[e].def;else if(Gs[e].num&&isNaN(this[e]))throw Error(`Invalid parameter value, must be numeric `+e+` = `+this[e]);else Gs[e].num&&(this[e]=parseFloat(this[e]));Gs[e].degrees&&(this[e]=this[e]*B)}.bind(this)),Math.abs(Math.abs(this.lat0)-R)<z?this.mode=this.lat0<0?$.S_POLE:$.N_POLE:Math.abs(this.lat0)<z?this.mode=$.EQUIT:(this.mode=$.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw Error(`Invalid height`);this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function qs(e){e.x-=this.long0;var t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i,a;switch(this.mode){case $.OBLIQ:a=this.sinph0*t+this.cosph0*n*r;break;case $.EQUIT:a=n*r;break;case $.S_POLE:a=-t;break;case $.N_POLE:a=t;break}switch(a=this.pn1/(this.p-a),i=a*n*Math.sin(e.x),this.mode){case $.OBLIQ:a*=this.cosph0*t-this.sinph0*n*r;break;case $.EQUIT:a*=t;break;case $.N_POLE:a*=-(n*r);break;case $.S_POLE:a*=n*r;break}var o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw);return i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,e.x=i*this.a,e.y=a*this.a,e}function Js(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},n,r,i=1/(this.pn1-e.y*this.sw);n=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=n*this.cg+r*this.sg,e.y=r*this.cg-n*this.sg;var a=Y(e.x,e.y);if(Math.abs(a)<z)t.x=0,t.y=e.y;else{var o,s=1-a*a*this.pfact;switch(s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case $.OBLIQ:t.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(t.y))*a,e.x*=s*this.cosph0;break;case $.EQUIT:t.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case $.N_POLE:t.y=Math.asin(o),e.y=-e.y;break;case $.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var Ys={init:Ks,forward:qs,inverse:Js,names:[`Tilted_Perspective`,`tpers`]};function Xs(){if(this.flip_axis=this.sweep===`x`?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw Error();if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape=`ellipse`}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape=`sphere`;this.title||=`Geostationary Satellite View`}function Zs(e){var t=e.x,n=e.y,r,i,a,o;if(t-=this.long0,this.shape===`ellipse`){n=Math.atan(this.radius_p2*Math.tan(n));var s=this.radius_p/Y(this.radius_p*Math.cos(n),Math.sin(n));if(i=s*Math.cos(t)*Math.cos(n),a=s*Math.sin(t)*Math.cos(n),o=s*Math.sin(n),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return e.x=NaN,e.y=NaN,e;r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Y(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Y(a,r)))}else this.shape===`sphere`&&(r=Math.cos(n),i=Math.cos(t)*r,a=Math.sin(t)*r,o=Math.sin(n),r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(a/Y(o,r)),e.y=this.radius_g_1*Math.atan(o/r)):(e.x=this.radius_g_1*Math.atan(a/r),e.y=this.radius_g_1*Math.atan(o/Y(a,r))));return e.x*=this.a,e.y*=this.a,e}function Qs(e){var t=-1,n=0,r=0,i,a,o,s;if(e.x/=this.a,e.y/=this.a,this.shape===`ellipse`){this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Y(1,r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Y(1,n));var c=r/this.radius_p;if(i=n*n+c*c+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape===`sphere`){if(this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+r*r+t*t,a=2*this.radius_g*t,o=a*a-4*i*this.C,o<0)return e.x=NaN,e.y=NaN,e;s=(-a-Math.sqrt(o))/(2*i),t=this.radius_g+s*t,n*=s,r*=s,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t)}return e.x+=this.long0,e}var $s={init:Xs,forward:Zs,inverse:Qs,names:[`Geostationary Satellite View`,`Geostationary_Satellite`,`geos`]},ec=1.340264,tc=-.081106,nc=893e-6,rc=.003796,ic=Math.sqrt(3)/2;function ac(){this.es=0,this.long0=this.long0===void 0?0:this.long0,this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0}function oc(e){var t=K(e.x-this.long0,this.over),n=e.y,r=Math.asin(ic*Math.sin(n)),i=r*r,a=i*i*i;return e.x=t*Math.cos(r)/(ic*(ec+3*tc*i+a*(7*nc+9*rc*i))),e.y=r*(ec+tc*i+a*(nc+rc*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function sc(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,n=12,r=e.y,i,a,o,s,c,l;for(l=0;l<n&&(i=r*r,a=i*i*i,o=r*(ec+tc*i+a*(nc+rc*i))-e.y,s=ec+3*tc*i+a*(7*nc+9*rc*i),r-=c=o/s,!(Math.abs(c)<t));++l);return i=r*r,a=i*i*i,e.x=ic*e.x*(ec+3*tc*i+a*(7*nc+9*rc*i))/Math.cos(r),e.y=Math.asin(Math.sin(r)/ic),e.x=K(e.x+this.long0,this.over),e}var cc={init:ac,forward:oc,inverse:sc,names:[`eqearth`,`Equal Earth`,`Equal_Earth`]},lc=1e-10;function uc(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<lc)throw Error();this.es?(this.en=zi(this.es),this.m1=Bi(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=fc,this.forward=dc):(Math.abs(this.phi1)+lc>=R?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=mc,this.forward=pc)}function dc(e){var t=K(e.x-(this.long0||0),this.over),n=e.y,r=this.am1+this.m1-Bi(n,i=Math.sin(n),a=Math.cos(n),this.en),i=a*t/(r*Math.sqrt(1-this.es*i*i)),a;return e.x=r*Math.sin(i),e.y=this.am1-r*Math.cos(i),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function fc(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n=Y(e.x,e.y=this.am1-e.y),r,i=Hi(this.am1+this.m1-n,this.es,this.en);if((t=Math.abs(i))<R)t=Math.sin(i),r=n*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-R)<=lc)r=0;else throw Error();return e.x=K(r+(this.long0||0),this.over),e.y=Ka(i),e}function pc(e){var t=K(e.x-(this.long0||0),this.over),n=e.y,r,i=this.cphi1+this.phi1-n;return Math.abs(i)>lc?(e.x=i*Math.sin(r=t*Math.cos(n)/i),e.y=this.cphi1-i*Math.cos(r)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function mc(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r=Y(e.x,e.y=this.cphi1-e.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>R)throw Error();return t=Math.abs(Math.abs(n)-R)<=lc?0:r*Math.atan2(e.x,e.y)/Math.cos(n),e.x=K(t+(this.long0||0),this.over),e.y=Ka(n),e}var hc={init:uc,names:[`bonne`,`Bonne (Werner lat_1=90)`]};let gc={OBLIQUE:{forward:Sc,inverse:wc},TRANSVERSE:{forward:Cc,inverse:Tc}},_c={ROTATE:{o_alpha:`oAlpha`,o_lon_c:`oLongC`,o_lat_c:`oLatC`},NEW_POLE:{o_lat_p:`oLatP`,o_lon_p:`oLongP`},NEW_EQUATOR:{o_lon_1:`oLong1`,o_lat_1:`oLat1`,o_lon_2:`oLong2`,o_lat_2:`oLat2`}};function vc(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||`General Oblique Transformation`,this.isIdentity=$n.includes(this.o_proj),!this.o_proj)throw Error(`Missing parameter: o_proj`);if(this.o_proj===`ob_tran`)throw Error(`Invalid value for o_proj: `+this.o_proj);let e=Pr(this.projStr.replace(`+proj=ob_tran`,``).replace(`+o_proj=`,`+proj=`).trim());if(!e)throw Error(`Invalid parameter: o_proj. Unknown projection `+this.o_proj);e.long0=0,this.obliqueProjection=e;let t,n=Object.keys(_c),r=e=>{if(this[e]===void 0)return;let t=parseFloat(this[e])*B;if(isNaN(t))throw Error(`Invalid value for `+e+`: `+this[e]);return t};for(let e=0;e<n.length;e++){let i=_c[n[e]],a=Object.entries(i);if(a.some(([e])=>this[e]!==void 0)){t=i;for(let e=0;e<a.length;e++){let[t,n]=a[e],i=r(t);if(i===void 0)throw Error(`Missing parameter: `+t+`.`);this[n]=i}break}}if(!t)throw Error(`No valid parameters provided for ob_tran projection.`);let{lamp:i,phip:a}=xc(this,t);this.lamp=i,Math.abs(a)>z?(this.cphip=Math.cos(a),this.sphip=Math.sin(a),this.projectionType=gc.OBLIQUE):this.projectionType=gc.TRANSVERSE}function yc(e){return this.projectionType.forward(this,e)}function bc(e){return this.projectionType.inverse(this,e)}function xc(e,t){let n,r;if(t===_c.ROTATE){let t=e.oLongC,i=e.oLatC,a=e.oAlpha;if(Math.abs(Math.abs(i)-R)<=z)throw Error(`Invalid value for o_lat_c: `+e.o_lat_c+` should be < 90°`);r=t+Math.atan2(-1*Math.cos(a),-1*Math.sin(a)*Math.sin(i)),n=Math.asin(Math.cos(i)*Math.sin(a))}else if(t===_c.NEW_POLE)r=e.oLongP,n=e.oLatP;else{let t=e.oLong1,i=e.oLat1,a=e.oLong2,o=e.oLat2,s=Math.abs(i);if(Math.abs(i)>R-z)throw Error(`Invalid value for o_lat_1: `+e.o_lat_1+` should be < 90°`);if(Math.abs(o)>R-z)throw Error(`Invalid value for o_lat_2: `+e.o_lat_2+` should be < 90°`);if(Math.abs(i-o)<z)throw Error(`Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2`);if(s<z)throw Error(`Invalid value for o_lat_1: o_lat_1 should be different from zero`);r=Math.atan2(Math.cos(i)*Math.sin(o)*Math.cos(t)-Math.sin(i)*Math.cos(o)*Math.cos(a),Math.sin(i)*Math.cos(o)*Math.sin(a)-Math.cos(i)*Math.sin(o)*Math.sin(t)),n=Math.atan(-1*Math.cos(r-t)/Math.tan(i))}return{lamp:r,phip:n}}function Sc(e,t){let{x:n,y:r}=t;n+=e.long0;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=K(Math.atan2(o*Math.sin(n),e.sphip*o*i+e.cphip*a)+e.lamp),t.y=Math.asin(e.sphip*a-e.cphip*o*i);let s=e.obliqueProjection.forward(t);return e.isIdentity&&(s.x*=V,s.y*=V),s}function Cc(e,t){let{x:n,y:r}=t;n+=e.long0;let i=Math.cos(r),a=Math.cos(n);t.x=K(Math.atan2(i*Math.sin(n),Math.sin(r))+e.lamp),t.y=Math.asin(-1*i*a);let o=e.obliqueProjection.forward(t);return e.isIdentity&&(o.x*=V,o.y*=V),o}function wc(e,t){e.isIdentity&&(t.x*=B,t.y*=B);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){n-=e.lamp;let i=Math.cos(n),a=Math.sin(r),o=Math.cos(r);t.x=Math.atan2(o*Math.sin(n),e.sphip*o*i-e.cphip*a),t.y=Math.asin(e.sphip*a+e.cphip*o*i)}return t.x=K(t.x+e.long0),t}function Tc(e,t){e.isIdentity&&(t.x*=B,t.y*=B);let{x:n,y:r}=e.obliqueProjection.inverse(t);if(n<Number.MAX_VALUE){let i=Math.cos(r);n-=e.lamp,t.x=Math.atan2(i*Math.sin(n),-1*Math.sin(r)),t.y=Math.asin(i*Math.cos(n))}return t.x=K(t.x+e.long0),t}var Ec={init:vc,forward:yc,inverse:bc,names:[`General Oblique Transformation`,`General_Oblique_Transformation`,`ob_tran`]};function Dc(e){e.Proj.projections.add(Ki),e.Proj.projections.add(ra),e.Proj.projections.add(sa),e.Proj.projections.add(_a),e.Proj.projections.add(Sa),e.Proj.projections.add(Ea),e.Proj.projections.add(Ma),e.Proj.projections.add(Ia),e.Proj.projections.add(Ba),e.Proj.projections.add(Za),e.Proj.projections.add(ho),e.Proj.projections.add(xo),e.Proj.projections.add(To),e.Proj.projections.add(Ao),e.Proj.projections.add(Po),e.Proj.projections.add(zo),e.Proj.projections.add(Uo),e.Proj.projections.add(qo),e.Proj.projections.add(Qo),e.Proj.projections.add(ns),e.Proj.projections.add(os),e.Proj.projections.add(us),e.Proj.projections.add(gs),e.Proj.projections.add(bs),e.Proj.projections.add(Es),e.Proj.projections.add(Bs),e.Proj.projections.add(Ws),e.Proj.projections.add(Ys),e.Proj.projections.add($s),e.Proj.projections.add(cc),e.Proj.projections.add(hc),e.Proj.projections.add(Ec)}let Oc=Object.assign(ti,{defaultDatum:`WGS84`,Proj:Pr,WGS84:new Pr(`WGS84`),Point:Ei,toPoint:Kr,defs:Mn,nadgrid:yr,transform:Xr,mgrs:ci,version:`__VERSION__`});Dc(Oc);var kc=Oc;function Ac(e){return(0,m.transform)(e,te,k)}function jc(e){return(0,m.transform)(e,k,te)}function Mc(e){return(0,m.transformExtent)(e,te,k)}function Nc(e){return(0,m.transformExtent)(e,k,te)}function Pc(){(0,m.get)(ne)||(kc.defs(`EPSG:3395`,`+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs`),(0,h.register)(kc))}function Fc(e){if(e===ne)return Pc(),(0,g.createXYZ)({extent:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]})}function Ic(e){let{type:t=`img`,projection:n=k,key:r}=e,i=e.url||`https://t{0-4}.tianditu.gov.cn`,a=`&tk=${r}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}`;return`${i}/${t}_${n===k?`w`:`c`}/wmts?LAYER=${t}${a}`}function Lc(e){let{layerOptions:t,sourceOptions:n,...r}=e;return new u.Tile({source:new f.XYZ({url:Ic(r),projection:r.projection,crossOrigin:`Anonymous`,...n}),...t})}function Rc({name:e,key:t,layerOptions:n,sourceOptions:r}){return new u.Tile({source:new f.BingMaps({key:t,imagerySet:e,placeholderTiles:!1,...r}),...n})}function zc(e){let{layerOptions:t,sourceOptions:n}=e||{};return new u.Tile({source:new f.OSM({crossOrigin:`Anonymous`,...n}),...t})}function Bc(e){return new c.default({...e})}function Vc(e){let{styleOptions:t,sourceOptions:n,style:r,source:i,...a}=e||{},o=r||(t?A(t):void 0),c=i||Bc(n);return{source:c,layer:new s.default({...a,source:c,style:o})}}function Hc(e){let{style:t,source:n,sourceOptions:r,...i}=e,a=n||Bc(r);return{source:a,layer:new d.default({...i,source:a,style:t})}}function Uc(e){return new Promise((t,n)=>{let r=new Image;r.addEventListener(`load`,()=>t(r)),r.addEventListener(`error`,()=>n(Error(`load failed`))),r.src=e})}function Wc(e){let{url:t,sourceOptions:n,...r}=e,i=new jt(t),a=Fc(n?.projection);return new u.Tile({...r,source:new p.default({async loader(e,t,n,{signal:r}){let a=await i.getZxy(e,t,n,r),o=new Blob([a.data]),s=URL.createObjectURL(o),c=await Uc(s);return URL.revokeObjectURL(s),c},crossOrigin:`anonymous`,tileGrid:a,...n})})}function Gc({sourceOptions:e,...t}){let n=Fc(e?.projection);return new u.Tile({...t,source:new f.XYZ({crossOrigin:`anonymous`,...e,tileGrid:n})})}function Kc(e,t,n){let r=document.createElement(`div`);r.style.position=`absolute`,r.style.width=`100%`,r.style.height=`100%`;let i=document.createElement(`canvas`);i.style.width=`100%`,i.style.height=`100%`,r.appendChild(i);let a=i.getContext(`2d`),o={size:[0,0],dpi:window.devicePixelRatio},s=new f.Source({}),c=new u.Layer({render:e=>{let n=e.size,s=t(e);if(s){let{imageBitmap:e,dpi:t}=s;t===o.dpi&&n[0]===o.size[0]&&n[1]===o.size[1]?a.clearRect(0,0,i.width,i.height):(o.size=[n[0],n[1]],o.dpi=t,i.width=n[0]*t,i.height=n[1]*t,a.scale(t,t)),a.drawImage(e,0,0,n[0],n[1]),e.close()}else a.clearRect(0,0,i.width,i.height);return r},source:s,...n});return e.addLayer(c),{layer:c,source:s}}function qc(e){let t=document.createElement(`div`);return t.innerHTML=e,t.style.cursor=`pointer`,t.style.userSelect=`none`,t.style.backgroundColor=`red`,t.style.color=`white`,t.style.borderRadius=`5px`,t.style.padding=`0 5px`,t.style.fontSize=`12px`,t.style.border=`2px solid white`,t}function Jc(e,r){let l=(0,t.ref)(!0),u=(0,t.ref)([]),d=(0,t.computed)(()=>u.value.map(e=>e.getGeometry().getCoordinates())),f=new c.default,p=r.styleOptions?A(r.styleOptions):r?.style,m=new s.default({source:f,style:p,zIndex:r?.zIndex});e.addLayer(m);let h=new i.Draw({source:f,style:(r.drawStyleOptions?A(r.drawStyleOptions):r?.drawStyle)||p,type:`LineString`});h.setActive(!1);let g=new i.Modify({source:f,style:(r.modifyStyleOptions?A(r.modifyStyleOptions):r?.modifyStyle)||p}),_=new Set;e.addInteraction(h),(0,t.onMounted)(()=>{e.addInteraction(g)}),f.on(`addfeature`,()=>{r.size&&f.getFeatures().length>=r.size&&h.setActive(!1)}),f.on(`removefeature`,()=>{r.size&&f.getFeatures().length<r.size&&h.setActive(!0)});let v=()=>{_.forEach(t=>{e.removeOverlay(t)}),_.clear()};f.on(`change`,()=>{v(),f.getFeatures().forEach(i=>{let s=i.getGeometry();s.getCoordinates();let c=(0,a.getCenter)(s.getExtent()),l=document.createElement(`div`);r.deleteFeatureLabel?(0,t.render)(r.deleteFeatureLabel,l):l=qc(`删除线`),l.addEventListener(`click`,()=>{f.removeFeature(i)});let u=new n.Overlay({position:c,positioning:`center-center`,element:l});_.add(u),e.addOverlay(u);let d=s.getCoordinates();d.length<3||d.forEach((a,s)=>{let c=document.createElement(`div`);r.deletePointLabel?(0,t.render)(r.deletePointLabel,c):c=qc(`删除点`),c.addEventListener(`click`,()=>{i.setGeometry(new o.LineString(d.filter((e,t)=>t!==s)))});let l=new n.Overlay({position:a,positioning:`top-center`,offset:[0,-30],element:c});_.add(l),e.addOverlay(l)})})}),h.on(`change:active`,()=>{l.value=h.getActive()}),f.on(`change`,()=>{u.value=f.getFeatures()});let y=()=>{v(),e.removeLayer(m),e.removeInteraction(h),e.removeInteraction(g)},b=()=>{r.size&&u.value.length>=r.size||h.setActive(!0)},x=()=>{h.setActive(!1)},S=e=>{f.clear(),e.forEach(e=>{if(e.length<2)return;let t=new n.Feature({geometry:new o.LineString(e)});f.addFeature(t)})},C=()=>{S(r.defaultCoordinates||[])};return C(),(0,t.onUnmounted)(()=>{y()}),{inDraw:l,start:b,stop:x,clear:()=>{f.clear(),x()},setFeatures:S,reset:C,features:u,coordinates:d,destroy:y}}function Yc(e,r){let l=(0,t.ref)(!0),u=(0,t.ref)([]),d=(0,t.computed)(()=>u.value.map(e=>e.getGeometry().getCoordinates())),f=r.styleOptions?A(r.styleOptions):r?.style,p=new c.default,m=new s.default({source:p,style:f,zIndex:r?.zIndex});e.addLayer(m);let h=new i.Draw({source:p,style:(r.drawStyleOptions?A(r.drawStyleOptions):r?.drawStyle)||f,type:`Polygon`});h.setActive(!1);let g=new i.Modify({source:p,style:(r.modifyStyleOptions?A(r.modifyStyleOptions):r?.modifyStyle)||f}),_=new Set;e.addInteraction(h),(0,t.onMounted)(()=>{e.addInteraction(g)}),p.on(`addfeature`,()=>{r.size&&p.getFeatures().length>=r.size&&h.setActive(!1)}),p.on(`removefeature`,()=>{r.size&&p.getFeatures().length<r.size&&h.setActive(!0)});let v=()=>{_.forEach(t=>{e.removeOverlay(t)}),_.clear()};p.on(`change`,()=>{v(),p.getFeatures().forEach(i=>{let s=i.getGeometry(),c=(0,a.getCenter)(s.getExtent()),l=document.createElement(`div`);r.deleteFeatureLabel?(0,t.render)(r.deleteFeatureLabel,l):l=qc(`删除区域`),l.addEventListener(`click`,()=>{p.removeFeature(i)});let u=new n.Overlay({position:c,positioning:`center-center`,element:l});_.add(u),e.addOverlay(u);let d=s.getCoordinates()[0];d.length<3||d.forEach((a,s)=>{let c=document.createElement(`div`);r.deletePointLabel?(0,t.render)(r.deletePointLabel,c):c=qc(`删除点`),c.addEventListener(`click`,()=>{i.setGeometry(new o.Polygon([d.filter((e,t)=>t!==s)]))});let l=new n.Overlay({position:a,positioning:`top-center`,offset:[0,-30],element:c});_.add(l),e.addOverlay(l)})})}),h.on(`change:active`,()=>{l.value=h.getActive()}),p.on(`change`,()=>{u.value=p.getFeatures()});let y=()=>{v(),e.removeLayer(m),e.removeInteraction(h),e.removeInteraction(g)},b=()=>{r.size&&u.value.length>=r.size||h.setActive(!0)},x=()=>{h.setActive(!1)},S=e=>{p.clear(),e?.forEach(e=>{e.forEach(e=>{if(e.length<2)return;e[0]!==e[e.length-1]&&e.push(e[0]);let t=new n.Feature({geometry:new o.Polygon([e])});p.addFeature(t)})})},C=()=>{S(r.defaultCoordinates)};return C(),(0,t.onUnmounted)(()=>{y()}),{inDraw:l,start:b,stop:x,clear:()=>{p.clear(),x()},setFeatures:S,reset:C,features:u,coordinates:d,destroy:y}}function Xc(e){let n=(0,t.ref)(e.defaultShow||!1),{strokeStyleOption:r,strokeStyle:i,labelStyleOption:a,latLabelStyleOption:o,lonLabelStyleOption:s,latLabelStyle:c,lonLabelStyle:d,...f}=e.graticuleOptions||{},p=r?new l.Stroke(r):i,m=a?ce(a):void 0,h=(o?ce(o):c)||m,g=(s?ce(s):d)||m,_=new u.Graticule({...f,strokeStyle:p,latLabelStyle:h,lonLabelStyle:g});return(0,t.watch)(n,n=>{if(_.setMap(null),n){let n=(0,t.toValue)(e.olMap);n&&_.setMap(n)}},{immediate:!0,deep:!0}),{showGraticule:n}}function Zc({mapRef:e,items:n,forceUpdate:r=!1}){let i=(0,t.ref)(!1),o=(0,t.ref)({x:0,y:0}),s=(0,t.ref)(),c=(0,t.ref)(),l=(0,t.ref)({x:0,y:0}),u=(0,t.ref)(),d=(0,t.ref)(),f=(0,t.ref)(),p=(0,t.computed)(()=>({x:o.value.x+l.value.x,y:o.value.y+l.value.y})),m,h,g=``;function _(e){let r=(0,t.toValue)(n);return r.sort((e,t)=>(t.priority??0)-(e.priority??0)),r.find(t=>{let n=t.visible;return typeof n==`function`?n(e):n??!0})}function v(e){if(e.dragging||!m||!h)return;let t=e.coordinate;u.value=t,d.value=t;let n=e.pixel,p,g;if(m.forEachFeatureAtPixel(n,(e,t)=>(p=e,g=t,!0)),!p){y();return}if(!r&&s.value&&s.value.getId()===p.getId())return;s.value=p;let{top:v,left:b}=h.getBoundingClientRect(),x={map:m,position:{x:n[0]+b,y:n[1]+v},coordinate:t,feature:p,layer:g},S=_(x);if(S){let{content:e,cursor:t,visible:n,fixedFeatureCenter:r,offset:i,priority:a,...o}=S;f.value={...o}}if(!S){y();return}l.value={x:S.offset?.x??0,y:S.offset?.y??0};let C=r===!1?!0:S.fixedFeatureCenter??!0,w=p.getGeometry();if(C&&w){let e=(0,a.getCenter)(w.getExtent());d.value=e,n=m.getPixelFromCoordinate(e)}o.value.x=n[0]+b,o.value.y=n[1]+v;let T=S.content;c.value=typeof T==`function`?()=>T(x):T;let E=S.cursor,D=typeof E==`function`?E(x):E;D!==void 0&&D!==h.style.cursor&&(h.style.cursor=D),i.value=!0}function y(){i.value=!1,s.value=void 0,h&&h.style.cursor!==g&&(h.style.cursor=g)}function b(e){e.on(`pointermove`,v)}function x(e){e.un(`pointermove`,v)}return(0,t.watch)(()=>(0,t.toValue)(e),(e,t)=>{t&&x(t),t!==e&&(m=e,e&&(h=e.getViewport(),b(e),g=h.style.cursor))},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{m&&x(m)}),{visible:(0,t.computed)(()=>i.value),position:(0,t.computed)(()=>p.value),offset:(0,t.computed)(()=>l.value),originalPosition:(0,t.computed)(()=>o.value),feature:(0,t.computed)(()=>s.value),content:(0,t.computed)(()=>c.value),originalCoordinate:(0,t.computed)(()=>u.value),coordinate:(0,t.computed)(()=>d.value),option:(0,t.computed)(()=>f.value),hide:y}}function Qc(e){let n=(0,t.ref)(e.defaultLayerName||Object.keys(e.layers)[0]);return Object.values(e.layers).forEach(t=>{t.forEach(t=>{e.olMap.addLayer(t)})}),(0,t.watch)(n,()=>{Object.entries(e.layers).forEach(([e,t])=>{let r=e===n.value;t.forEach(e=>{e.setVisible(r)})})},{immediate:!0}),{visibleLayerName:n}}return e.EPSG_3395=ne,e.EPSG_3857=k,e.EPSG_3857ExtentToEPSG_4326=Nc,e.EPSG_3857ToEPSG_4326=jc,e.EPSG_4326=te,e.EPSG_4326ExtentToEPSG_3857=Mc,e.EPSG_4326ToEPSG_3857=Ac,e.ONE_NM=O,e.OlMap=D,e.createBingLayer=Rc,e.createCanvasLayer=Kc,e.createCircle=fe,e.createCircleFeature=be,e.createCircleStyle=se,e.createFeature=ge,e.createLineString=ue,e.createLineStringFeature=ve,e.createMultiLineString=me,e.createMultiLineStringFeature=Se,e.createMultiPoint=pe,e.createMultiPointFeature=xe,e.createMultiPolygon=he,e.createMultiPolygonFeature=Ce,e.createOpenStreetMapLayer=zc,e.createPMTilesLayer=Wc,e.createPoint=le,e.createPointFeature=_e,e.createPolygon=de,e.createPolygonFeature=ye,e.createStyle=A,e.createTextStyle=ce,e.createTianDiTuLayer=Lc,e.createTianDiTuUrl=Ic,e.createTileGrid=Fc,e.createVectorLayer=Vc,e.createVectorSource=Bc,e.createWebGLVectorLayer=Hc,e.createXYZLayer=Gc,e.formatAngle=oe,e.formatRotation=ae,e.kmToNauticalMiles=re,e.nauticalMilesToKm=ie,e.olMapInjectionKey=T,e.proj4=kc,e.registerEPSG_3395=Pc,e.useContextmenu=ee,e.useDrawLineString=Jc,e.useDrawPolygon=Yc,e.useGraticule=Xc,e.useOlMap=E,e.usePointermove=Zc,e.useSwitchBaseLayer=Qc,e})({},Vue,ol,ol.control,ol.interaction,ol.extent,ol.geom,ol.layer.Vector,ol.source.Vector,ol.style,ol.layer,ol.layer.WebGLVector,ol.source,ol.source.ImageTile,ol.proj,ol.proj.proj4,ol.tilegrid);
package/dist/index.js CHANGED
@@ -9547,9 +9547,8 @@ function loadImage(src) {
9547
9547
  }
9548
9548
  function createPMTilesLayer(config) {
9549
9549
  const { url, sourceOptions, ...layerOptions } = config;
9550
- const { projection, ...restSourceOptions } = sourceOptions || {};
9551
9550
  const tiles = new w(url);
9552
- const tileGrid = createTileGrid(projection);
9551
+ const tileGrid = createTileGrid(sourceOptions?.projection);
9553
9552
  return new Tile({
9554
9553
  ...layerOptions,
9555
9554
  source: new ImageTileSource({
@@ -9563,18 +9562,17 @@ function createPMTilesLayer(config) {
9563
9562
  },
9564
9563
  crossOrigin: "anonymous",
9565
9564
  tileGrid,
9566
- ...restSourceOptions
9565
+ ...sourceOptions
9567
9566
  })
9568
9567
  });
9569
9568
  }
9570
9569
  function createXYZLayer({ sourceOptions, ...layerOptions }) {
9571
- const { projection, ...restSourceOptions } = sourceOptions || {};
9572
- const tileGrid = createTileGrid(projection);
9570
+ const tileGrid = createTileGrid(sourceOptions?.projection);
9573
9571
  return new Tile({
9574
9572
  ...layerOptions,
9575
9573
  source: new XYZ({
9576
9574
  crossOrigin: "anonymous",
9577
- ...restSourceOptions,
9575
+ ...sourceOptions,
9578
9576
  tileGrid
9579
9577
  })
9580
9578
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@summeruse/ol",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "description": "",
6
6
  "author": "finalsummer",
7
7
  "license": "ISC",