geocanvas
Version:
Functions for Working with GeoSpatial Canvas Elements
1 lines • 286 kB
JavaScript
(()=>{var t={973:(t,a,s)=>{const i=s(338),n=s(641),e=s(173),o=s(441),h=s(40),l=s(300),_=s(182),r=s(289),k=s(365),c=s(363),u=s(622);t.exports=function({raster_bbox:t,raster_height:a,raster_width:s,pixel_height:f,pixel_width:x,geometry:M,per_pixel:y,per_row_segment:g}){const[p,d,m,w]=t,b=[];if(0!==a){for(let t=0;t<a;t++){const a=w-f*t-f/2,s=i([p,a],[p+1,a]);b.push(s)}r(M).map(l).forEach((l=>{const r=u(a).map((()=>[])),M=l.length;for(let s=0;s<M;s++){const n=l[s],[o,h]=n,[k,c]=o,[u,x]=h,M=Math.sign(x-c),y=c===x,g=k===u,p=c,d=i(o,h),m=Math.min(c,x),w=Math.max(c,x);let v,N,S,C;if(k<u?([v,N]=o,[C,S]=h):([v,N]=h,[C,S]=o),void 0===v)throw Error("startLng is "+v);const P=Math.round((t[3]-.5*f-N)/f),E=Math.round((t[3]-.5*f-S)/f);let A,I;P<E?(A=P,I=E):(A=E,I=P),A=e(A,0,a-1),I=e(I,0,a-1);for(let t=A;t<I+1;t++){const a=b[t];if(void 0===a)throw console.error("j:",t),console.error("imageLines:",b),Error("imageLines");const i=-1*a.c,e=c===i,o=x===i,h=!o;let l,f;if(y){if(p!==i)continue;l=v,f=C}else if(g)i>=m&&i<=w&&(l=v,f=C);else if(e)l=f=k;else if(o)l=f=u;else try{l=f=_(d,a).x}catch(t){throw t}l&&f&&(y||l>=v&&f<=C&&i<=w&&i>=m)&&r[t].push({direction:M,index:s,edge:n,endsOnLine:o,endsOffLine:h,horizontal:y,startsOnLine:e,vertical:g,xmin:l,xmax:f,imageLineY:i})}}r.map(((t,a)=>{if(t.length>0){const i=h(t,M).map(n),[e,l]=c(i,(t=>t.through));if(e.length%2==1)throw Error("throughs.length for "+a+" is odd with "+e.length);let _=l.map((t=>[t.xmin,t.xmax]));e.sort(((t,a)=>t.xmin-a.xmin));const r=o(e).map((t=>{const[a,s]=t;return[a.xmin,s.xmax]}));_=_.concat(r),_=k(_),_.forEach((t=>{const[i,n]=t,e=Math.round((i-(p+.5*x))/x),o=Math.round((n-(p+.5*x))/x);if(e>=s)return;if(o<0)return;const h=Math.max(e,0),l=Math.min(o,s-1);if(g&&g({row:a,columns:[h,l]}),y)for(let t=h;t<=l;t++)y({row:a,column:t})}))}}))}))}}},184:(t,a,s)=>{const i=s(973),n=s(436),e=s(911);t.exports=function({debug:t=!1,raster_bbox:a,raster_height:s,raster_width:o,pixel_height:h,pixel_width:l,geometry:_,per_pixel:r,per_row_segment:k}){const[c,u,f,x]=a;null==h&&(h=(x-u)/s),null==l&&(l=(f-c)/o);const M=new Array(s);i({raster_bbox:a,raster_height:s,raster_width:o,pixel_height:h,pixel_width:l,geometry:_,per_pixel:r,per_row_segment:({row:t,columns:a})=>{M[t]||(M[t]=[]),M[t].push(a),k&&k({row:t,columns:a})}});for(let t=0;t<M.length;t++){const a=M[t];a&&(a.sort(((t,a)=>t===a?t[1]-a[1]:t[0]-a[0])),M[t]=e(a))}return t&&n(insides),{rows:M}}},641:t=>{t.exports=function(t){try{let a,s,i;const n=t.length,e=t[0];if(1===n)a=!0,s=e.xmin,i=e.xmax;else{const o=t[n-1];a=e.direction===o.direction,s=Math.min(e.xmin,o.xmin),i=Math.max(e.xmax,o.xmax)}if(void 0===s||void 0===i||void 0===a||isNaN(s)||isNaN(i))throw Error("categorizeIntersection failed with xmin",s,"and xmax",i);return{xmin:s,xmax:i,through:a}}catch(a){throw console.error("[categorizeIntersection] segments:",t),console.error("[categorizeIntersection]",a),a}}},436:t=>{t.exports=function(t){t.forEach(((t,a)=>{for(let s=0;s<t.length;s++){const i=t[s],[n,e]=i;n>e&&console.warn("[dufour-peyton-intersection] uh oh, encountered invalid range",i,"at row index",a,"with ranges",t);for(let i=s+1;i<t.length;i++)i[0]<=e&&console.warn("[dufour-peyton-intersection] encountered range problem on row index",a,":",t)}}))}},173:t=>{t.exports=function(t,a,s){return t<a?a:t>s?s:t}},40:(t,a,s)=>{const i=s(259);t.exports=function(t,a,s=!1){try{const s=i(t,(t=>t.endsOffLine));if(s.length>=2){const t=s[0],i=t[0],n=s[s.length-1],e=n[n.length-1];e.index===a-1&&0===i.index&&e.endsOnLine&&(s[0]=s.pop().concat(t))}return s}catch(t){console.error("[clusterLineSegments]",t)}}},259:t=>{t.exports=function(t,a){try{const s=t.length,i=[];let n=[];for(let e=0;e<s;e++){const s=t[e];n.push(s),a(s)&&(i.push(n),n=[])}return n.length>0&&i.push(n),i}catch(t){console.error("[cluster]:",t)}}},441:t=>{t.exports=function(t){const a=[],s=t.length;for(let i=0;i<s;i+=2)a.push([t[i],t[i+1]]);return a}},827:t=>{t.exports=function(t,a){t.forEach((t=>{for(let s=1;s<t.length;s++){const i=t[s-1],n=t[s];a([i,n],s-1)}}))}},385:(t,a,s)=>{const i=s(155);t.exports=function t(a,s){if("FeatureCollection"===a.type)a.features.forEach((a=>t(a,s)));else if("Feature"===a.type)t(a.geometry,s);else if("Polygon"===a.type)t(a.coordinates,s);else if("MultiPolygon"===a.type)a.coordinates.forEach((t=>{s(t)}));else if(Array.isArray(a)){const t=i(a);4===t?a.forEach((t=>{s(t)})):3===t&&s(a)}}},450:(t,a,s)=>{const i=s(385);t.exports=function(t){let a,s,n,e;return i(t,(t=>{const i=t[0],o=i.length-1;let h;for(void 0===a?(a=n=i[0][0],s=e=i[0][1],h=1):h=0;h<=o;h++){const[t,o]=i[h];t<a?a=t:t>n&&(n=t),o<s?s=o:o>e&&(e=o)}})),[a,s,n,e]}},300:(t,a,s)=>{const i=s(827);t.exports=function(t){const a=[];return i(t,(t=>a.push(t))),a}},182:t=>{t.exports=function(t,a){const s=t.a*a.b-a.a*t.b;if(s)return{x:(a.b*t.c-t.b*a.c)/s,y:(t.a*a.c-a.a*t.c)/s}}},338:t=>{t.exports=function(t,a){const[s,i]=t,[n,e]=a,o=e-i,h=s-n;return{a:o,b:h,c:o*s+h*i}}},289:(t,a,s)=>{const i=s(385);t.exports=function(t){const a=[];return i(t,(t=>a.push(t))),a}},81:(t,a,s)=>{var i;const n=s(641),e=s(173),o=s(259),h=s(40),l=s(184),_=s(973),r=s(441),k=s(450),c=s(289),u={calculate:l,calculateCore:_,categorizeIntersection:n,clamp:e,cluster:o,clusterLineSegments:h,couple:r,eachEdge:s(827),getBoundingBox:k,getIntersectionOfTwoLines:s(182),getLineFromPoints:s(338),getPolygons:c,mergeRanges:s(365),partition:s(363),range:s(622)};void 0===(i=(()=>u).call(a,s,a,t))||(t.exports=i),t.exports=u,"object"==typeof self&&(self.dufour_peyton_intersection=u),"object"==typeof window&&(window.dufour_peyton_intersection=u)},911:t=>{t.exports=function(t){const a=t.length;if(a>0){const s=t[0];let i=s[1];const n=[s];for(let s=1;s<a;s++){const a=t[s],[e,o]=a;e<=i+1?n[n.length-1][1]=o:n.push(a),i=o}return n}}},365:t=>{t.exports=function(t){const a=t.length;if(a>0){const s=t[0];let i=s[1];const n=[s];for(let s=1;s<a;s++){const a=t[s],[e,o]=a;e<=i?n[n.length-1][1]=o:n.push(a),i=o}return n}}},363:t=>{t.exports=function(t,a){const s=[],i=[],n=t.length;for(let e=0;e<n;e++){const n=t[e];a(n)?s.push(n):i.push(n)}return[s,i]}},622:t=>{t.exports=function(t){const a=new Array(t);for(let s=0;s<t;s++)a[s]=s;return a}},728:(t,a,s)=>{const i=s(869),n=s(544);function e({debug:t=!1,fname:a,raster_bbox:s,raster_srs:e,raster_height:o,raster_width:h,pixel_height:l,pixel_width:_,mask:r,mask_srs:k}){return e!==k&&(r=n(r,{from:k,to:e})),i[a]({debug:t,raster_bbox:s,raster_height:o,raster_width:h,pixel_height:l,pixel_width:_,mask:r})}const o={inside:function(t){return e({...t,fname:"inside"})},outside:function(t){return e({...t,fname:"outside"})}};t.exports=o},869:(t,a,s)=>{const i=s(81),n=s(42),e=s(89),o=s(683),h=s(905);function l({rows:t}){t.forEach(((t,a)=>{t&&t.forEach((([t,s],i)=>{if(t>s)throw Error(`uh oh: invalid segment at row ${a}, segment ${i}`)}))}))}function _({debug:t=!1,raster_bbox:a,raster_height:s,raster_width:h,pixel_height:_,pixel_width:r,mask:k,reproject:c}){"function"==typeof c&&(k=o(k,{in_place:!1,reproject:c})),void 0===_&&(_=Number(e(n(a[3].toString(),a[1].toString()),s.toString()))),void 0===r&&(r=Number(e(n(a[2].toString(),a[0].toString()),h.toString())));const{rows:u}=i.calculate({raster_bbox:a,raster_height:s,raster_width:h,pixel_height:_,pixel_width:r,geometry:k});return t&&l({rows:u}),{rows:u}}const r={inside:_,outside:function({debug:t=!1,raster_bbox:a,raster_height:s,raster_width:i,pixel_height:r,pixel_width:k,mask:c,reproject:u}){"function"==typeof u&&(c=o(c,{in_place:!1,reproject:u})),void 0===r&&(r=Number(e(n(a[3].toString(),a[1].toString()),s.toString()))),void 0===k&&(k=Number(e(n(a[2].toString(),a[0].toString()),i.toString())));const{rows:f}=_({debug:t,raster_bbox:a,raster_height:s,raster_width:i,pixel_height:r,pixel_width:k,mask:c});t&&l({rows:f});const x=i-1,M=[];for(let t=0;t<f.length;t++){const a=f[t];Array.isArray(a)&&0!==a.length?M.push(h({segments:a,min:0,max:x,debug:!1})):M.push([[0,x]])}return t&&l({rows:M}),{rows:M}}};t.exports=r},155:t=>{t.exports=function(t){const a=t=>Array.isArray(t)||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof BigInt64Array||t instanceof BigUint64Array;let s=0,i=t;for(;a(i);)s++,i=i[0];return s}},585:(t,a,s)=>{const i=s(875);t.exports=function(t){return"-"===(t=i(t))[0]?t.substring(1):t}},316:(t,a,s)=>{const i=s(232),n=s(875),e=s(888),o=s(411);t.exports=function(t,a){t=n(t),a=n(a);const s="-"!==t[0],h="-"!==a[0];if(s&&h)return e(t,a);if(!s&&!h)return"-"+e(t.substring(1),a.substring(1));if(!s&&h)switch(t=t.substring(1),i(t,a)){case"=":return"0";case"<":return o(a,t);case">":return"-"+o(t,a)}else if(s&&!h)switch(a=a.substring(1),i(t,a)){case"=":return"0";case"<":return"-"+o(a,t);case">":return o(t,a)}}},875:(t,a,s)=>{const i=s(604);t.exports=function(t){return"+"===t[0]&&(t=t.substring(1)),(t=i(t)).replace(/^0+(?=\d)/,"")}},232:(t,a,s)=>{s(875),t.exports=function(t,a){const s=t.length,i=a.length,n=t.indexOf("."),e=a.indexOf("."),o=-1===n?s:n,h=-1===e?i:e,l=o-h;let _=l<0?-1*l:0,r=l<=0?0:l,k=Math.max(o,h)+1+Math.max(s-o,i-h)-1,c=0;for(;c<k;){const s=t[c-_]||"0",i=a[c-r]||"0";if(s!==i){if(s>i)return">";if(s<i)return"<"}c++}return"="}},89:(t,a,s)=>{const i=s(585),n=s(875),e=s(41);t.exports=function(t,a,s){t=n(t),a=n(a);const o="-"!==t[0],h="-"!==a[0],l=o!==h?"-":"";return o||(t=i(t)),h||(a=i(a)),l+e(t,a,s)}},604:t=>{t.exports=function(t){"+"===t[0]&&(t=t.substring(1));const a="-"===t[0]?"-":"";"-"===a&&(t=t.substring(1));const s=t.indexOf("e");if(-1===s)return a+t;let i=t.indexOf(".");-1===i&&(i=s);const n=Number(t.substring(s+1)),e=t.substring(0,s).replace(".",""),o=i+n,h=e.length;if(o>=h){const t=o-h;let s=e;for(let a=0;a<t;a++)s+="0";return a+s}if(o<0){result="0.";for(let t=0;t>o;t--)result+="0";return result+=e,a+result}return a+e.substring(0,o)+"."+e.substring(o)}},888:t=>{t.exports=function(t,a){const s=t.length,i=a.length,n=t.indexOf("."),e=a.indexOf("."),o=-1===n?s:n,h=-1===e?i:e,l=o-h;let _=Math.max(o,h),r=Math.max(s-o-1,i-h-1),k=l<0?-1*l:0,c=l<=0?0:l,u=_+1+r-1,f="",x=0,M=u;if(r>0){for(;M>u-r;){const s=t[M-k]||"0",i=a[M-c]||"0";let n=Number(s)+Number(i)+x;n>=10?(n-=10,x=1):x=0,""===f&&0===n||(f=n+f),M--}f&&(f="."+f),M--}if(_>0)for(;M>=0;){const s=t[M-k]||"0",i=a[M-c]||"0";let n=Number(s)+Number(i)+x;n>=10?(n-=10,x=1):x=0,f=n+f,M--}return 1===x&&(f=x+f),f}},41:(t,a,s)=>{const i=s(232),n=s(316),e=(s(494),s(42)),o=s(360);t.exports=function(t,a,{max_decimal_digits:s=100,ellipsis:h=!1}={}){"0"===t[0]&&(t=t.substring(1)),"0"===a[0]&&(a=a.substring(1));const l=t.indexOf("."),_=a.indexOf("."),r=-1===l?t.length:l,k=-1===_?0:a.length-1-_;let c=!1;t=t.replace(/\./,""),a=a.replace(/\./,"");const u=t.length;let f,x="",M="",y=-1*k,g=0;for(let s=0;s<u;s++)if(x+=t[s],f=i(x,a),">"===f){let t=1,s=n(a,a),o=a;for(;">"!==i(s,x);)t++,o=s,s=n(s,a);if(t=t.toString(),""!==M)for(let a=t.length;a<=g;a++)M+="0";M+=t,x=e(x,o),g=0}else{if("<"===f){""===M&&y++,g++;continue}if("="===f){if(""!==M)for(let t=0;t<g;t++)M+="0";M+="1",x="0",g=0}}if(x.match(/^0+$/g))"<"===f&&(M+=x.substring(0,x.length-1));else{const t={},o=r-y-M.length+s+1;""===M&&(g=0);for(let s=0;s<o;s++){if(x+="0",h)if(x in t){if(t[x]++,t[x]>3){M+="...",c=!0;break}}else t[x]=1;const s=i(x,a);if(">"===s){let t=1,s=n(a,a),o=a;for(;">"!==i(s,x);)t++,o=s,s=n(s,a);t=t.toString();for(let a=t.length;a<=g;a++)M+="0";if(M+=t,x=e(x,o),"0"===x)break;g=0}else{if("<"===s){g++;continue}if("="===s){for(let t=0;t<g;t++)M+="0";M+="1",g=0;break}}}}const p=r-y,d=M.length;let m;if(p===d)m=0;else if(p<0)M="0."+"0".repeat(Math.abs(p))+M,m=d-p;else if(p>d){for(let t=d;t<p;t++)M+="0";m=0}else p<d?(M=M.substring(0,p)+"."+M.substring(p),m=d-p):0===p&&(M="0."+M,m=d);if(M=M.replace(/^0+/,""),M=M.replace(/\.\d+0+$/,""),!c){const t=m-s;t>0&&(M=o(M.substring(0,M.length-t+1)))}return"."===M[0]&&(M="0"+M),M}},90:t=>{t.exports=function(t,a){if("0"===t||"0"===a)return"0";const s=t.indexOf("."),i=a.indexOf("."),n=(-1===s?0:t.length-1-s)+(-1===i?0:a.length-1-i);t=t.replace(".",""),a=a.replace(".","");const e=t.length,o=a.length,h=[];let l=e;for(;l>=0;){const a=l,s=l-=15,i=t.substring(s,a);h.push([Number(i),i.length])}const _=[],r=[];for(let t=0,s=o-1;s>=0;s--,t++){const i=a[s],n=Number(i);let e=0,o="";const l=h.length-1;h.forEach((([t,a],s)=>{let i=(e+n*t).toString();const h=i.length;if(h>a&&s!==l){const t=-1*a;o=i.slice(t)+o,e=Number(i.slice(0,t))}else{const t=a-h;for(let a=0;a<t;a++)i="0"+i;e=0,o=i+o}})),o+="0".repeat(t),_.push(o),r.push([Array.from(o).map((t=>Number(t))),o.length])}const k=_.length,c=r[r.length-1][1]+k;let u="",f=0;for(let t=0;t<c;t++){let a=f;const s=Math.min(t,k-1);for(let i=0;i<=s;i++){const[s,n]=r[i],e=n-1-t;e>=0&&(a+=s[e])}a>=10?(a=a.toString(),u=a[a.length-1]+u,f=Number(a.slice(0,-1))):(u=a+u,f=0)}if(0===n)u=u.replace(/^0+/,"");else{const t=u.length-n;u=u.substring(0,t)+"."+u.substring(t),u=u.replace(/^0+/,""),u=u.replace(/\.?0+$/,""),"."===u[0]&&(u="0"+u)}return u}},411:t=>{t.exports=function(t,a){const s=t.length,i=a.length,n=t.indexOf("."),e=a.indexOf("."),o=-1===n?s:n,h=-1===e?i:e,l=o-h;let _=Math.max(o,h),r=Math.max(s-o-1,i-h-1),k=l<0?-1*l:0,c=l<=0?0:l,u=_+1+r-1,f="",x=0,M=u;if(r>0){for(;M>u-r;){let s=t[M-k]||"0",i=a[M-c]||"0";s-=x,x=0;let n=s-i;if(n<0)for(;n<0;)x++,n+=10;else x&&x--;""===f&&0===n||(f=n+f),M--}""!==f&&(f="."+f),M--}if(_>0){for(;M>0;){let s=t[M-k]||"0",i=a[M-c]||"0";s-=x,x=0;let n=s-i;if(n<0)for(;n<0;)x++,n+=10;else x&&x--;f=n+f,M--}const s=t[0-k]||"0",i=a[0-c]||"0";let n=Number(s)-(x>0?1:0)-Number(i);0!==n&&(f=n+f),f=f.replace(/^0+/,"")}return"."===f[0]&&(f="0"+f),f}},494:(t,a,s)=>{const i=s(585),n=s(875),e=s(232),o=s(90);t.exports=function(t,a){t=n(t),a=n(a);const s="-"!==t[0]!=("-"!==a[0])?"-":"";if(t=i(t),a=i(a),"<"===e(t,a)){const s=t;t=a,a=s}return s+o(t,a)}},360:t=>{const a=["5","6","7","8","9"];t.exports=function(t){"+"===t[0]&&(t=t.substring(1));const s=t.length;let i="";const n=t[t.length-1];if(a.includes(n)){let a;for(a=s-2;a>=0;a--){const s=t[a];if("."===s||"-"===s)continue;const n=Number(s)+1;if(10!==n){i=n+i;break}i="0"+i}a>0&&(i=t.substring(0,a)+i)}else i=t.substring(0,s-1);return"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i.indexOf(".")>-1&&(i=i.replace(/0+$/,"")),i}},42:(t,a,s)=>{const i=s(875),n=s(232),e=s(888),o=s(411);t.exports=function(t,a){t=i(t),a=i(a);const s="-"!==t[0],h="-"!==a[0];if(s){if(h){const s=n(t,a);return">"===s?o(t,a):"<"===s?"-"+o(a,t):"0"}return e(t,a.substring(1))}if(h)return"-"+e(t.substring(1),a);{t=t.substring(1),a=a.substring(1);const s=n(t,a);return">"===s?"-"+o(t,a):"<"===s?o(a,t):"0"}}},328:(t,a,s)=>{var i;let n=s(643);const e=s(667);"object"!=typeof n&&"function"!=typeof n||"function"==typeof n.defs||"function"!=typeof n.default||"function"!=typeof n.default.defs||(n=n.default),n.defs(e),void 0===(i=function(){return n}.call(a,s,a,t))||(t.exports=i),t.exports=n,t.exports.default=n},643:(t,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>Ba});var i=6378137,n=.0066943799901413165,e=484813681109536e-20,o=Math.PI/2,h=1e-10,l=.017453292519943295,_=57.29577951308232,r=Math.PI/4,k=2*Math.PI,c=3.14159265359,u={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const f={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var x=/[\s_\-\/\(\)]/g;function M(t,a){if(t[a])return t[a];for(var s,i=Object.keys(t),n=a.toLowerCase().replace(x,""),e=-1;++e<i.length;)if((s=i[e]).toLowerCase().replace(x,"")===n)return t[s]}function y(t){var a,s,i,n={},e=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,a){var s=a.split("=");return s.push(!0),t[s[0].toLowerCase()]=s[1],t}),{}),o={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*l},lat_1:function(t){n.lat1=t*l},lat_2:function(t){n.lat2=t*l},lat_ts:function(t){n.lat_ts=t*l},lon_0:function(t){n.long0=t*l},lon_1:function(t){n.long1=t*l},lon_2:function(t){n.long2=t*l},alpha:function(t){n.alpha=parseFloat(t)*l},gamma:function(t){n.rectified_grid_angle=parseFloat(t)},lonc:function(t){n.longc=t*l},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var a=M(f,t);a&&(n.to_meter=a.to_meter)},from_greenwich:function(t){n.from_greenwich=t*l},pm:function(t){var a=M(u,t);n.from_greenwich=(a||parseFloat(t))*l},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){var a="ewnsud";3===t.length&&-1!==a.indexOf(t.substr(0,1))&&-1!==a.indexOf(t.substr(1,1))&&-1!==a.indexOf(t.substr(2,1))&&(n.axis=t)},approx:function(){n.approx=!0}};for(a in e)s=e[a],a in o?"function"==typeof(i=o[a])?i(s):n[i]=s:n[a]=s;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n}var g=/\s/,p=/[A-Za-z]/,d=/[A-Za-z84_]/,m=/[,\]]/,w=/[\d\.E\-\+]/;function b(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function v(t,a,s){Array.isArray(a)&&(s.unshift(a),a=null);var i=a?{}:t,n=s.reduce((function(t,a){return N(a,t),t}),i);a&&(t[a]=n)}function N(t,a){if(Array.isArray(t)){var s=t.shift();if("PARAMETER"===s&&(s=t.shift()),1===t.length)return Array.isArray(t[0])?(a[s]={},void N(t[0],a[s])):void(a[s]=t[0]);if(t.length)if("TOWGS84"!==s){if("AXIS"===s)return s in a||(a[s]=[]),void a[s].push(t);var i;switch(Array.isArray(s)||(a[s]={}),s){case"UNIT":case"PRIMEM":case"VERT_DATUM":return a[s]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&N(t[2],a[s]));case"SPHEROID":case"ELLIPSOID":return a[s]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&N(t[3],a[s]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void v(a,s,t);default:for(i=-1;++i<t.length;)if(!Array.isArray(t[i]))return N(t,a[s]);return v(a,s,t)}}else a[s]=t;else a[s]=!0}else a[t]=!0}function S(t){return.017453292519943295*t}function C(t){var a=new b(t).output(),s=a.shift(),i=a.shift();a.unshift(["name",i]),a.unshift(["type",s]);var n={};return N(a,n),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var a="",s=0,i=t.AXIS.length;s<i;++s){var n=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?a+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?a+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?a+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(a+="w")}2===a.length&&(a+="u"),3===a.length&&(t.axis=a)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var e=t.GEOGCS;function o(a){return a*(t.to_meter||1)}"GEOGCS"===t.type&&(e=t),e&&(e.DATUM?t.datumCode=e.DATUM.name.toLowerCase():t.datumCode=e.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),e.DATUM&&e.DATUM.SPHEROID&&(t.ellps=e.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=e.DATUM.SPHEROID.a,t.rf=parseFloat(e.DATUM.SPHEROID.rf,10)),e.DATUM&&e.DATUM.TOWGS84&&(t.datum_params=e.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["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",S],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",S],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",S],["lat0","latitude_of_origin",S],["lat0","standard_parallel_1",S],["lat1","standard_parallel_1",S],["lat2","standard_parallel_2",S],["azimuth","Azimuth"],["alpha","azimuth",S],["srsCode","name"]].forEach((function(a){return function(t,a){var s=a[0],i=a[1];!(s in t)&&i in t&&(t[s]=t[i],3===a.length&&(t[s]=a[2](t[s])))}(t,a)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=S(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function P(t){var a=this;if(2===arguments.length){var s=arguments[1];"string"==typeof s?"+"===s.charAt(0)?P[t]=y(arguments[1]):P[t]=C(arguments[1]):P[t]=s}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?P.apply(a,t):P(t)}));if("string"==typeof t){if(t in P)return P[t]}else"EPSG"in t?P["EPSG:"+t.EPSG]=t:"ESRI"in t?P["ESRI:"+t.ESRI]=t:"IAU2000"in t?P["IAU2000:"+t.IAU2000]=t:console.log(t);return}}b.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;g.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},b.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(m.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},b.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},b.prototype.number=function(t){if(!w.test(t)){if(m.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},b.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},b.prototype.keyword=function(t){if(d.test(t))this.word+=t;else{if("["===t){var a=[];return a.push(this.word),this.level++,null===this.root?this.root=a:this.currentObject.push(a),this.stack.push(this.currentObject),this.currentObject=a,void(this.state=1)}if(!m.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},b.prototype.neutral=function(t){if(p.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(w.test(t))return this.word=t,void(this.state=3);if(!m.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},b.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)},function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("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"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(P);const E=P;var A=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],I=["3857","900913","3785","102113"];function O(t,a){var s,i;if(t=t||{},!a)return t;for(i in a)void 0!==(s=a[i])&&(t[i]=s);return t}function j(t,a,s){var i=t*a;return s/Math.sqrt(1-i*i)}function z(t){return t<0?-1:1}function q(t){return Math.abs(t)<=c?t:t-z(t)*k}function G(t,a,s){var i=t*s,n=.5*t;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(o-a))/i}function L(t,a){for(var s,i,n=.5*t,e=o-2*Math.atan(a),h=0;h<=15;h++)if(s=t*Math.sin(e),e+=i=o-2*Math.atan(a*Math.pow((1-s)/(1+s),n))-e,Math.abs(i)<=1e-10)return e;return-9999}function R(t){return t}var B=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"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=j(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var a,s,i=t.x,n=t.y;if(n*_>90&&n*_<-90&&i*_>180&&i*_<-180)return null;if(Math.abs(Math.abs(n)-o)<=h)return null;if(this.sphere)a=this.x0+this.a*this.k0*q(i-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(r+.5*n));else{var e=Math.sin(n),l=G(this.e,n,e);a=this.x0+this.a*this.k0*q(i-this.long0),s=this.y0-this.a*this.k0*Math.log(l)}return t.x=a,t.y=s,t},inverse:function(t){var a,s,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)s=o-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var e=Math.exp(-n/(this.a*this.k0));if(-9999===(s=L(this.e,e)))return null}return a=q(this.long0+i/(this.a*this.k0)),t.x=a,t.y=s,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:R,inverse:R,names:["longlat","identity"]}],T={},D=[];function F(t,a){var s=D.length;return t.names?(D[s]=t,t.names.forEach((function(t){T[t.toLowerCase()]=s})),this):(console.log(a),!0)}const U={start:function(){B.forEach(F)},add:F,get:function(t){if(!t)return!1;var a=t.toLowerCase();return void 0!==T[a]&&D[T[a]]?D[T[a]]:void 0}};var Q={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."},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"}},W=Q.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Q.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var J={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"},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:"Airy 1830"},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"}};var X={};function H(t){if(0===t.length)return null;var a="@"===t[0];return a&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!a,grid:null,isNull:!0}:{name:t,mandatory:!a,grid:X[t]||null,isNull:!1}}function V(t){return t/3600*Math.PI/180}function K(t,a,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(a,s)))}function $(t){return t.map((function(t){return[V(t.longitudeShift),V(t.latitudeShift)]}))}function Z(t,a,s){return{name:K(t,a+8,a+16).trim(),parent:K(t,a+24,a+24+8).trim(),lowerLatitude:t.getFloat64(a+72,s),upperLatitude:t.getFloat64(a+88,s),lowerLongitude:t.getFloat64(a+104,s),upperLongitude:t.getFloat64(a+120,s),latitudeInterval:t.getFloat64(a+136,s),longitudeInterval:t.getFloat64(a+152,s),gridNodeCount:t.getInt32(a+168,s)}}function Y(t,a,s,i){for(var n=a+176,e=[],o=0;o<s.gridNodeCount;o++){var h={latitudeShift:t.getFloat32(n+16*o,i),longitudeShift:t.getFloat32(n+16*o+4,i),latitudeAccuracy:t.getFloat32(n+16*o+8,i),longitudeAccuracy:t.getFloat32(n+16*o+12,i)};e.push(h)}return e}function tt(t,a){if(!(this instanceof tt))return new tt(t);a=a||function(t){if(t)throw t};var s=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in E}(t))return E[t];if(function(t){return A.some((function(a){return t.indexOf(a)>-1}))}(t)){var a=C(t);if(function(t){var a=M(t,"authority");if(a){var s=M(a,"epsg");return s&&I.indexOf(s)>-1}}(a))return E["EPSG:3857"];var s=function(t){var a=M(t,"extension");if(a)return M(a,"proj4")}(a);return s?y(s):a}return function(t){return"+"===t[0]}(t)?y(t):void 0}(t);if("object"==typeof s){var i=tt.projections.get(s.projName);if(i){if(s.datumCode&&"none"!==s.datumCode){var n=M(J,s.datumCode);n&&(s.datum_params=s.datum_params||(n.towgs84?n.towgs84.split(","):null),s.ellps=n.ellipse,s.datumName=n.datumName?n.datumName:s.datumCode)}s.k0=s.k0||1,s.axis=s.axis||"enu",s.ellps=s.ellps||"wgs84",s.lat1=s.lat1||s.lat0;var o,l,_,r,k,c,u=function(t,a,s,i,n){if(!t){var e=M(Q,i);e||(e=W),t=e.a,a=e.b,s=e.rf}return s&&!a&&(a=(1-1/s)*t),(0===s||Math.abs(t-a)<h)&&(n=!0,a=t),{a:t,b:a,rf:s,sphere:n}}(s.a,s.b,s.rf,s.ellps,s.sphere),f=(o=u.a,l=u.b,u.rf,k=((_=o*o)-(r=l*l))/_,c=0,s.R_A?(_=(o*=1-k*(.16666666666666666+k*(.04722222222222222+.022156084656084655*k)))*o,k=0):c=Math.sqrt(k),{es:k,e:c,ep2:(_-r)/r}),x=function(t){return void 0===t?null:t.split(",").map(H)}(s.nadgrids),g=s.datum||function(t,a,s,i,n,o,h){var l={};return l.datum_type=void 0===t||"none"===t?5:4,a&&(l.datum_params=a.map(parseFloat),0===l.datum_params[0]&&0===l.datum_params[1]&&0===l.datum_params[2]||(l.datum_type=1),l.datum_params.length>3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=2,l.datum_params[3]*=e,l.datum_params[4]*=e,l.datum_params[5]*=e,l.datum_params[6]=l.datum_params[6]/1e6+1))),h&&(l.datum_type=3,l.grids=h),l.a=s,l.b=i,l.es=n,l.ep2=o,l}(s.datumCode,s.datum_params,u.a,u.b,f.es,f.ep2,x);O(this,s),O(this,i),this.a=u.a,this.b=u.b,this.rf=u.rf,this.sphere=u.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=g,this.init(),a(null,this)}else a(t)}else a(t)}tt.projections=U,tt.projections.start();const at=tt;function st(t,a,s){var i,n,e,h,l=t.x,_=t.y,r=t.z?t.z:0;if(_<-o&&_>-1.001*o)_=-o;else if(_>o&&_<1.001*o)_=o;else{if(_<-o)return{x:-1/0,y:-1/0,z:t.z};if(_>o)return{x:1/0,y:1/0,z:t.z}}return l>Math.PI&&(l-=2*Math.PI),n=Math.sin(_),h=Math.cos(_),e=n*n,{x:((i=s/Math.sqrt(1-a*e))+r)*h*Math.cos(l),y:(i+r)*h*Math.sin(l),z:(i*(1-a)+r)*n}}function it(t,a,s,i){var n,e,o,h,l,_,r,k,c,u,f,x,M,y,g,p=t.x,d=t.y,m=t.z?t.z:0;if(n=Math.sqrt(p*p+d*d),e=Math.sqrt(p*p+d*d+m*m),n/s<1e-12){if(y=0,e/s<1e-12)return g=-i,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(d,p);o=m/e,k=(h=n/e)*(1-a)*(l=1/Math.sqrt(1-a*(2-a)*h*h)),c=o*l,M=0;do{M++,_=a*(r=s/Math.sqrt(1-a*c*c))/(r+(g=n*k+m*c-r*(1-a*c*c))),x=(f=o*(l=1/Math.sqrt(1-_*(2-_)*h*h)))*k-(u=h*(1-_)*l)*c,k=u,c=f}while(x*x>1e-24&&M<30);return{x:y,y:Math.atan(f/Math.abs(u)),z:g}}function nt(t){return 1===t||2===t}function et(t,a,s){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var i={x:-s.x,y:s.y},n={x:Number.NaN,y:Number.NaN},e=[],o=0;o<t.grids.length;o++){var h=t.grids[o];if(e.push(h.name),h.isNull){n=i;break}if(h.mandatory,null!==h.grid){var l=h.grid.subgrids[0],r=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,k=l.ll[0]-r,c=l.ll[1]-r,u=l.ll[0]+(l.lim[0]-1)*l.del[0]+r,f=l.ll[1]+(l.lim[1]-1)*l.del[1]+r;if(!(c>i.y||k>i.x||f<i.y||u<i.x||(n=ot(i,a,l),isNaN(n.x))))break}else if(h.mandatory)return console.log("Unable to find mandatory grid '"+h.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*_+" "+i.y*_+" tried: '"+e+"'"),-1):(s.x=-n.x,s.y=n.y,0)}function ot(t,a,s){var i={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return i;var n={x:t.x,y:t.y};n.x-=s.ll[0],n.y-=s.ll[1],n.x=q(n.x-Math.PI)+Math.PI;var e=ht(n,s);if(a){if(isNaN(e.x))return i;e.x=n.x-e.x,e.y=n.y-e.y;var o,h,l=9;do{if(h=ht(e,s),isNaN(h.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:n.x-(h.x+e.x),y:n.y-(h.y+e.y)},e.x+=o.x,e.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=q(e.x+s.ll[0]),i.y=e.y+s.ll[1]}else isNaN(e.x)||(i.x=t.x+e.x,i.y=t.y+e.y);return i}function ht(t,a){var s,i={x:t.x/a.del[0],y:t.y/a.del[1]},n=Math.floor(i.x),e=Math.floor(i.y),o=i.x-1*n,h=i.y-1*e,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=a.lim[0])return l;if(e<0||e>=a.lim[1])return l;s=e*a.lim[0]+n;var _=a.cvs[s][0],r=a.cvs[s][1];s++;var k=a.cvs[s][0],c=a.cvs[s][1];s+=a.lim[0];var u=a.cvs[s][0],f=a.cvs[s][1];s--;var x=a.cvs[s][0],M=a.cvs[s][1],y=o*h,g=o*(1-h),p=(1-o)*(1-h),d=(1-o)*h;return l.x=p*_+g*k+d*x+y*u,l.y=p*r+g*c+d*M+y*f,l}function lt(t,a,s){var i,n,e,o=s.x,h=s.y,l=s.z||0,_={};for(e=0;e<3;e++)if(!a||2!==e||void 0!==s.z)switch(0===e?(i=o,n=-1!=="ew".indexOf(t.axis[e])?"x":"y"):1===e?(i=h,n=-1!=="ns".indexOf(t.axis[e])?"y":"x"):(i=l,n="z"),t.axis[e]){case"e":case"n":_[n]=i;break;case"w":case"s":_[n]=-i;break;case"u":void 0!==s[n]&&(_.z=i);break;case"d":void 0!==s[n]&&(_.z=-i);break;default:return null}return _}function _t(t){var a={x:t[0],y:t[1]};return t.length>2&&(a.z=t[2]),t.length>3&&(a.m=t[3]),a}function rt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function kt(t,a,s,e){var o;if(Array.isArray(s)&&(s=_t(s)),function(t){rt(t.x),rt(t.y)}(s),t.datum&&a.datum&&function(t,a){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==a.datumCode||(1===a.datum.datum_type||2===a.datum.datum_type)&&"WGS84"!==t.datumCode}(t,a)&&(s=kt(t,o=new at("WGS84"),s,e),t=o),e&&"enu"!==t.axis&&(s=lt(t,!1,s)),"longlat"===t.projName)s={x:s.x*l,y:s.y*l,z:s.z||0};else if(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}),!(s=t.inverse(s)))return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=function(t,a,s){if(function(t,a){return t.datum_type===a.datum_type&&!(t.a!==a.a||Math.abs(t.es-a.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===a.datum_params[0]&&t.datum_params[1]===a.datum_params[1]&&t.datum_params[2]===a.datum_params[2]:2!==t.datum_type||t.datum_params[0]===a.datum_params[0]&&t.datum_params[1]===a.datum_params[1]&&t.datum_params[2]===a.datum_params[2]&&t.datum_params[3]===a.datum_params[3]&&t.datum_params[4]===a.datum_params[4]&&t.datum_params[5]===a.datum_params[5]&&t.datum_params[6]===a.datum_params[6])}(t,a))return s;if(5===t.datum_type||5===a.datum_type)return s;var e=t.a,o=t.es;if(3===t.datum_type){if(0!==et(t,!1,s))return;e=i,o=n}var h=a.a,l=a.b,_=a.es;return 3===a.datum_type&&(h=i,l=6356752.314,_=n),o!==_||e!==h||nt(t.datum_type)||nt(a.datum_type)?(s=st(s,o,e),nt(t.datum_type)&&(s=function(t,a,s){if(1===a)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(2===a){var i=s[0],n=s[1],e=s[2],o=s[3],h=s[4],l=s[5],_=s[6];return{x:_*(t.x-l*t.y+h*t.z)+i,y:_*(l*t.x+t.y-o*t.z)+n,z:_*(-h*t.x+o*t.y+t.z)+e}}}(s,t.datum_type,t.datum_params)),nt(a.datum_type)&&(s=function(t,a,s){if(1===a)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(2===a){var i=s[0],n=s[1],e=s[2],o=s[3],h=s[4],l=s[5],_=s[6],r=(t.x-i)/_,k=(t.y-n)/_,c=(t.z-e)/_;return{x:r+l*k-h*c,y:-l*r+k+o*c,z:h*r-o*k+c}}}(s,a.datum_type,a.datum_params)),s=it(s,_,h,l),3!==a.datum_type||0===et(a,!0,s)?s:void 0):s}(t.datum,a.datum,s))return a.from_greenwich&&(s={x:s.x-a.from_greenwich,y:s.y,z:s.z||0}),"longlat"===a.projName?s={x:s.x*_,y:s.y*_,z:s.z||0}:(s=a.forward(s),a.to_meter&&(s={x:s.x/a.to_meter,y:s.y/a.to_meter,z:s.z||0})),e&&"enu"!==a.axis?lt(a,!0,s):s}var ct=at("WGS84");function ut(t,a,s,i){var n,e,o;return Array.isArray(s)?(n=kt(t,a,s,i)||{x:NaN,y:NaN},s.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==a.name&&"geocent"===a.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(s.splice(3)):[n.x,n.y,s[2]].concat(s.splice(3)):[n.x,n.y].concat(s.splice(2)):[n.x,n.y]):(e=kt(t,a,s,i),2===(o=Object.keys(s)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==a.name&&"geocent"===a.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;e[i]=s[i]})),e)}function ft(t){return t instanceof at?t:t.oProj?t.oProj:at(t)}const xt=function(t,a,s){t=ft(t);var i,n=!1;return void 0===a?(a=t,t=ct,n=!0):(void 0!==a.x||Array.isArray(a))&&(s=a,a=t,t=ct,n=!0),a=ft(a),s?ut(t,a,s):(i={forward:function(s,i){return ut(t,a,s,i)},inverse:function(s,i){return ut(a,t,s,i)}},n&&(i.oProj=a),i)};var Mt="AJSAJS",yt="AFAFAF",gt=65,pt=73,dt=79;const mt={forward:wt,inverse:function(t){var a=St(Pt(t.toUpperCase()));return a.lat&&a.lon?[a.lon,a.lat,a.lon,a.lat]:[a.left,a.bottom,a.right,a.top]},toPoint:bt};function wt(t,a){return a=a||5,function(t,a){var s,i,n,e,o,h,l,_,r,k,c,u="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(r=t.easting,k=t.northing,c=Ct(t.zoneNumber),s=Math.floor(r/1e5),i=Math.floor(k/1e5)%20,e=Mt.charCodeAt(n=c-1),o=yt.charCodeAt(n),_=!1,(h=e+s-1)>90&&(h=h-90+gt-1,_=!0),(h===pt||e<pt&&h>pt||(h>pt||e<pt)&&_)&&h++,(h===dt||e<dt&&h>dt||(h>dt||e<dt)&&_)&&++h===pt&&h++,h>90&&(h=h-90+gt-1),(l=o+i)>86?(l=l-86+gt-1,_=!0):_=!1,(l===pt||o<pt&&l>pt||(l>pt||o<pt)&&_)&&l++,(l===dt||o<dt&&l>dt||(l>dt||o<dt)&&_)&&++l===pt&&l++,l>86&&(l=l-86+gt-1),String.fromCharCode(h)+String.fromCharCode(l))+u.substr(u.length-5,a)+f.substr(f.length-5,a)}(function(t){var a,s,i,n,e,o,h,l=t.lat,_=t.lon,r=6378137,k=.00669438,c=.9996,u=vt(l),f=vt(_);h=Math.floor((_+180)/6)+1,180===_&&(h=60),l>=56&&l<64&&_>=3&&_<12&&(h=32),l>=72&&l<84&&(_>=0&&_<9?h=31:_>=9&&_<21?h=33:_>=21&&_<33?h=35:_>=33&&_<42&&(h=37)),o=vt(6*(h-1)-180+3),a=.006739496752268451,s=r/Math.sqrt(1-k*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),n=a*Math.cos(u)*Math.cos(u);var x,M,y=c*s*((e=Math.cos(u)*(f-o))+(1-i+n)*e*e*e/6+(5-18*i+i*i+72*n-58*a)*e*e*e*e*e/120)+5e5,g=c*(r*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u))+s*Math.tan(u)*(e*e/2+(5-i+9*n+4*n*n)*e*e*e*e/24+(61-58*i+i*i+600*n-2.2240339282485886)*e*e*e*e*e*e/720));return l<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(y),zoneNumber:h,zoneLetter:(x=l,M="Z",84>=x&&x>=72?M="X":72>x&&x>=64?M="W":64>x&&x>=56?M="V":56>x&&x>=48?M="U":48>x&&x>=40?M="T":40>x&&x>=32?M="S":32>x&&x>=24?M="R":24>x&&x>=16?M="Q":16>x&&x>=8?M="P":8>x&&x>=0?M="N":0>x&&x>=-8?M="M":-8>x&&x>=-16?M="L":-16>x&&x>=-24?M="K":-24>x&&x>=-32?M="J":-32>x&&x>=-40?M="H":-40>x&&x>=-48?M="G":-48>x&&x>=-56?M="F":-56>x&&x>=-64?M="E":-64>x&&x>=-72?M="D":-72>x&&x>=-80&&(M="C"),M)}}({lat:t[1],lon:t[0]}),a)}function bt(t){var a=St(Pt(t.toUpperCase()));return a.lat&&a.lon?[a.lon,a.lat]:[(a.left+a.right)/2,(a.top+a.bottom)/2]}function vt(t){return t*(Math.PI/180)}function Nt(t){return t/Math.PI*180}function St(t){var a=t.northing,s=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var e,o,h,l,_,r,k,c,u,f=.9996,x=6378137,M=.00669438,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=s-5e5,p=a;i<"N"&&(p-=1e7),k=6*(n-1)-180+3,e=.006739496752268451,u=(c=p/f/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*c)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*c)+151*y*y*y/96*Math.sin(6*c),o=x/Math.sqrt(1-M*Math.sin(u)*Math.sin(u)),h=Math.tan(u)*Math.tan(u),l=e*Math.cos(u)*Math.cos(u),_=.99330562*x/Math.pow(1-M*Math.sin(u)*Math.sin(u),1.5),r=g/(o*f);var d=u-o*Math.tan(u)/_*(r*r/2-(5+3*h+10*l-4*l*l-9*e)*r*r*r*r/24+(61+90*h+298*l+45*h*h-1.6983531815716497-3*l*l)*r*r*r*r*r*r/720);d=Nt(d);var m,w=(r-(1+2*h+l)*r*r*r/6+(5-2*l+28*h-3*l*l+8*e+24*h*h)*r*r*r*r*r/120)/Math.cos(u);if(w=k+Nt(w),t.accuracy){var b=St({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:b.lat,right:b.lon,bottom:d,left:w}}else m={lat:d,lon:w};return m}function Ct(t){var a=t%6;return 0===a&&(a=6),a}function Pt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var a,s=t.length,i=null,n="",e=0;!/[A-Z]/.test(a=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;n+=a,e++}var o=parseInt(n,10);if(0===e||e+3>s)throw"MGRSPoint bad conversion from: "+t;var h=t.charAt(e++);if(h<="A"||"B"===h||"Y"===h||h>="Z"||"I"===h||"O"===h)throw"MGRSPoint zone letter "+h+" not handled: "+t;i=t.substring(e,e+=2);for(var l=Ct(o),_=function(t,a){for(var s=Mt.charCodeAt(a-1),i=1e5,n=!1;s!==t.charCodeAt(0);){if(++s===pt&&s++,s===dt&&s++,s>90){if(n)throw"Bad character: "+t;s=gt,n=!0}i+=1e5}return i}(i.charAt(0),l),r=function(t,a){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=yt.charCodeAt(a-1),i=0,n=!1;s!==t.charCodeAt(0);){if(++s===pt&&s++,s===dt&&s++,s>86){if(n)throw"Bad character: "+t;s=gt,n=!0}i+=1e5}return i}(i.charAt(1),l);r<Et(h);)r+=2e6;var k=s-e;if(k%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var c,u,f,x=k/2,M=0,y=0;return x>0&&(c=1e5/Math.pow(10,x),u=t.substring(e,e+x),M=parseFloat(u)*c,f=t.substring(e+x),y=parseFloat(f)*c),{easting:M+_,northing:y+r,zoneLetter:h,zoneNumber:o,accuracy:c}}function Et(t){var a;switch(t){case"C":a=11e5;break;case"D":a=2e6;break;case"E":a=28e5;break;case"F":a=37e5;break;case"G":a=46e5;break;case"H":a=55e5;break;case"J":a=64e5;break;case"K":a=73e5;break;case"L":a=82e5;break;case"M":a=91e5;break;case"N":a=0;break;case"P":a=8e5;break;case"Q":a=17e5;break;case"R":a=26e5;break;case"S":a=35e5;break;case"T":a=44e5;break;case"U":a=53e5;break;case"V":a=62e5;break;case"W":a=7e6;break;case"X":a=79e5;break;default:a=-1}if(a>=0)return a;throw"Invalid zone letter: "+t}function At(t,a,s){if(!(this instanceof At))return new At(t,a,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===a){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=a,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}At.fromMGRS=function(t){return new At(bt(t))},At.prototype.toMGRS=function(t){return wt([this.x,this.y],t)};const It=At;var Ot=.046875,jt=.01953125,zt=.01068115234375;function qt(t){var a=[];a[0]=1-t*(.25+t*(Ot+t*(jt+t*zt))),a[1]=t*(.75-t*(Ot+t*(jt+t*zt)));var s=t*t;return a[2]=s*(.46875-t*(.013020833333333334+.007120768229166667*t)),s*=t,a[3]=s*(.3645833333333333-.005696614583333333*t),a[4]=s*t*.3076171875,a}function Gt(t,a,s,i){return s*=a,a*=a,i[0]*t-s*(i[1]+a*(i[2]+a*(i[3]+a*i[4])))}function Lt(t,a,s){for(var i=1/(1-a),n=t,e=20;e;--e){var o=Math.sin(n),l=1-a*o*o;if(n-=l=(Gt(n,o,Math.cos(n),s)-t)*(l*Math.sqrt(l))*i,Math.abs(l)<h)return n}return n}const Rt={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=qt(this.es),this.ml0=Gt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var a,s,i,n=t.x,e=t.y,o=q(n-this.long0),l=Math.sin(e),_=Math.cos(e);if(this.es){var r=_*o,k=Math.pow(r,2),c=this.ep2*Math.pow(_,2),u=Math.pow(c,2),f=Math.abs(_)>h?Math.tan(e):0,x=Math.pow(f,2),M=Math.pow(x,2);a=1-this.es*Math.pow(l,2),r/=Math.sqrt(a);var y=Gt(e,l,_,this.en);s=this.a*(this.k0*r*(1+k/6*(1-x+c+k/20*(5-18*x+M+14*c-58*x*c+k/42*(61+179*M-M*x-479*x)))))+this.x0,i=this.a*(this.k0*(y-this.ml0+l*o*r/2*(1+k/12*(5-x+9*c+4*u+k/30*(61+M-58*x+270*c-330*x*c+k/56*(1385+543*M-M*x-3111*x))))))+this.y0}else{var g=_*Math.sin(o);if(Math.abs(Math.abs(g)-1)<h)return 93;if(s=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,i=_*Math.cos(o)/Math.sqrt(1-Math.pow(g,2)),(g=Math.abs(i))>=1){if(g-1>h)return 93;i=0}else i=Math.acos(i);e<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=s,t.y=i,t},inverse:function(t){var a,s,i,n,e=(t.x-this.x0)*(1/this.a),l=(t.y-this.y0)*(1/this.a);if(this.es)if(s=Lt(a=this.ml0+l/this.k0,this.es,this.en),Math.abs(s)<o){var _=Math.sin(s),r=Math.cos(s),k=Math.abs(r)>h?Math.tan(s):0,c=this.ep2*Math.pow(r,2),u=Math.pow(c,2),f=Math.pow(k,2),x=Math.pow(f,2);a=1-this.es*Math.pow(_,2);var M=e*Math.sqrt(a)/this.k0,y=Math.pow(M,2);i=s-(a*=k)*y/(1-this.es)*.5*(1-y/12*(5+3*f-9*c*f+c-4*u-y/30*(61+90*f-252*c*f+45*x+46*c-y/56*(1385+3633*f+4095*x+1574*x*f)))),n=q(this.long0+M*(1-y/6*(1+2*f+c-y/20*(5+28*f+24*x+8*c*f+6*c-y/42*(61+662*f+1320*x+720*x*f))))/r)}else i=o*z(l),n=0;else{var g=Math.exp(e/this.k0)