You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hy-screen-2.0/docs/assets/index-7950c07e-178407487704...

4 lines
174 KiB

var Ci=Object.defineProperty,Li=Object.defineProperties;var Ri=Object.getOwnPropertyDescriptors;var la=Object.getOwnPropertySymbols;var Ti=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable;var ua=(t,e,s)=>e in t?Ci(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Tt=(t,e)=>{for(var s in e||(e={}))Ti.call(e,s)&&ua(t,s,e[s]);if(la)for(var s of la(e))Oi.call(e,s)&&ua(t,s,e[s]);return t},kt=(t,e)=>Li(t,Ri(e));var nt=(t,e,s)=>new Promise((a,i)=>{var r=h=>{try{n(s.next(h))}catch(l){i(l)}},o=h=>{try{n(s.throw(h))}catch(l){i(l)}},n=h=>h.done?a(h.value):Promise.resolve(h.value).then(r,o);n((s=s.apply(t,e)).next())});import{g as ca}from"./index-e9f36657-1784074877048.js";/* empty css */import{_ as fa}from"./index-1f5d6021-1784074877048.js";import{i as pe,g as Fi,b as ga}from"./townshipBoundaries-1b068bef-1784074877048.js";import{r as ji,n as ki}from"./index-bc047bb3-1784074877048.js";import{c as qi,F as $i,b as Di}from"./featurePanelLayout-dc118942-1784074877048.js";import{A as Ui}from"./assets-34f9bc99-1784074877048.js";import{q as Bi,r as zi,s as Wi}from"./screen2Standard-9c6af3a2-1784074877048.js";import{M as Vi}from"./index-b4ec1ae2-1784074877048.js";import{_ as Hi}from"./LayerPanel-9c0c5952-1784074877048.js";import{a as va,_ as Qi}from"./FeatureInfoPanel-8e9f606e-1784074877048.js";import{_ as Ji}from"./TopicSwitcher-3ee7ffcb-1784074877048.js";import{_ as Xi,g as z,q as Ua,o as J,c as Y,a as L,t as ut,j as It,n as Ot,f as te,F as fs,y as gs,d as Q,h as Ki,w as es,A as ss,b as ee,C as Ls,x as da,u as as,J as _a,z as Zi}from"./index-1784074877048.js";import{b as is,e as Rs,r as Yi,a as tr,p as er,g as sr,c as Ts,d as ar}from"./data-c66f5cee-1784074877048.js";import"./data-5c83c66b-1784074877048.js";const ir="/openApi";function rr(t){return nt(this,null,function*(){const e=yield ji(`${ir}/ecologicalProtection/rangeStats`,{method:"POST",timeout:3e4,params:{scopeKey:t},headers:{"Content-Type":"application/json"},body:JSON.stringify({scopeKey:t})}),s=ki(e);return or(Array.isArray(s)?s[0]||{}:s||{})})}const nr={scope_key:"scopeKey",scope_name:"scopeName",scope_area_wan_mu:"scopeAreaWanMu",source_feature_count:"sourceFeatureCount",grassland_area_wan_mu:"grasslandAreaWanMu",wetland_area_wan_mu:"wetlandAreaWanMu",woodland_area_wan_mu:"woodlandAreaWanMu",grassland_fresh_yield_wan_ton:"grasslandFreshYieldWanTon",wetland_fresh_yield_wan_ton:"wetlandFreshYieldWanTon",grassland_mu_yield_jin:"grasslandMuYieldJin",wetland_mu_yield_jin:"wetlandMuYieldJin",grassland_vegetation_cover_percent:"grasslandVegetationCoverPercent",grassland_patch_count:"grasslandPatchCount",wetland_patch_count:"wetlandPatchCount",woodland_patch_count:"woodlandPatchCount",grassland_distribution:"grasslandDistribution",wetland_distribution:"wetlandDistribution",woodland_distribution:"woodlandDistribution",grassland_productivity:"grasslandProductivity",grassland_types:"grasslandTypes",zoning_structure:"zoningStructure",grassland_levels:"grasslandLevels",vegetation_cover_bands:"vegetationCoverBands",woodland_types:"woodlandTypes",woodland_quality:"woodlandQuality",area_method:"areaMethod",area_unit:"areaUnit",productivity_method:"productivityMethod"};function or(t={}){return!t||typeof t!="object"?{}:Object.entries(t).reduce((e,[s,a])=>{e[s]=a;const i=nr[s];return i&&e[i]===void 0&&(e[i]=a),e},{})}function hr(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");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t("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"),t("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"),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"]}var Qt=1,Jt=2,oe=3,lr=4,$s=5,Ma=6378137,ur=6356752314e-3,ma=.0066943799901413165,Ae=484813681109536e-20,P=Math.PI/2,cr=.16666666666666666,fr=.04722222222222222,gr=.022156084656084655,x=1e-10,Z=.017453292519943295,yt=57.29577951308232,U=Math.PI/4,Te=Math.PI*2,tt=3.14159265359,wt={};wt.greenwich=0;wt.lisbon=-9.131906111111;wt.paris=2.337229166667;wt.bogota=-74.080916666667;wt.madrid=-3.687938888889;wt.rome=12.452333333333;wt.bern=7.439583333333;wt.jakarta=106.807719444444;wt.ferro=-17.666666666667;wt.brussels=4.367975;wt.stockholm=18.058277777778;wt.athens=23.7163375;wt.oslo=10.722916666667;const vr={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}};var ya=/[\s_\-\/\(\)]/g;function $t(t,e){if(t[e])return t[e];for(var s=Object.keys(t),a=e.toLowerCase().replace(ya,""),i=-1,r,o;++i<s.length;)if(r=s[i],o=r.toLowerCase().replace(ya,""),o===a)return t[r]}function Ds(t){var e={},s=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,h){var l=h.split("=");return l.push(!0),n[l[0].toLowerCase()]=l[1],n},{}),a,i,r,o={proj:"projName",datum:"datumCode",rf:function(n){e.rf=parseFloat(n)},lat_0:function(n){e.lat0=n*Z},lat_1:function(n){e.lat1=n*Z},lat_2:function(n){e.lat2=n*Z},lat_ts:function(n){e.lat_ts=n*Z},lon_0:function(n){e.long0=n*Z},lon_1:function(n){e.long1=n*Z},lon_2:function(n){e.long2=n*Z},alpha:function(n){e.alpha=parseFloat(n)*Z},gamma:function(n){e.rectified_grid_angle=parseFloat(n)*Z},lonc:function(n){e.longc=n*Z},x_0:function(n){e.x0=parseFloat(n)},y_0:function(n){e.y0=parseFloat(n)},k_0:function(n){e.k0=parseFloat(n)},k:function(n){e.k0=parseFloat(n)},a:function(n){e.a=parseFloat(n)},b:function(n){e.b=parseFloat(n)},r:function(n){e.a=e.b=parseFloat(n)},r_a:function(){e.R_A=!0},zone:function(n){e.zone=parseInt(n,10)},south:function(){e.utmSouth=!0},towgs84:function(n){e.datum_params=n.split(",").map(function(h){return parseFloat(h)})},to_meter:function(n){e.to_meter=parseFloat(n)},units:function(n){e.units=n;var h=$t(vr,n);h&&(e.to_meter=h.to_meter)},from_greenwich:function(n){e.from_greenwich=n*Z},pm:function(n){var h=$t(wt,n);e.from_greenwich=(h||parseFloat(n))*Z},nadgrids:function(n){n==="@null"?e.datumCode="none":e.nadgrids=n},axis:function(n){var h="ewnsud";n.length===3&&h.indexOf(n.substr(0,1))!==-1&&h.indexOf(n.substr(1,1))!==-1&&h.indexOf(n.substr(2,1))!==-1&&(e.axis=n)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(a in s)i=s[a],a in o?(r=o[a],typeof r=="function"?r(i):e[r]=i):e[a]=i;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=t,e}class Ba{static getId(e){const s=e.find(a=>Array.isArray(a)&&a[0]==="ID");return s&&s.length>=3?{authority:s[1],code:parseInt(s[2],10)}:null}static convertUnit(e,s="unit"){if(!e||e.length<3)return{type:s,name:"unknown",conversion_factor:null};const a=e[1],i=parseFloat(e[2])||null,r=e.find(n=>Array.isArray(n)&&n[0]==="ID"),o=r?{authority:r[1],code:parseInt(r[2],10)}:null;return{type:s,name:a,conversion_factor:i,id:o}}static convertAxis(e){const s=e[1]||"Unknown";let a;const i=s.match(/^\((.)\)$/);if(i){const l=i[1].toUpperCase();if(l==="E")a="east";else if(l==="N")a="north";else if(l==="U")a="up";else if(e[2])a=e[2];else throw new Error(`Unknown axis abbreviation: ${l}`)}else a=e[2]||"unknown";const r=e.find(l=>Array.isArray(l)&&l[0]==="ORDER"),o=r?parseInt(r[1],10):null,n=e.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),h=this.convertUnit(n);return{name:s,direction:a,unit:h,order:o}}static extractAxes(e){return e.filter(s=>Array.isArray(s)&&s[0]==="AXIS").map(s=>this.convertAxis(s)).sort((s,a)=>(s.order||0)-(a.order||0))}static convert(e,s={}){switch(e[0]){case"PROJCRS":s.type="ProjectedCRS",s.name=e[1],s.base_crs=e.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")):null,s.conversion=e.find(u=>Array.isArray(u)&&u[0]==="CONVERSION")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="CONVERSION")):null;const a=e.find(u=>Array.isArray(u)&&u[0]==="CS");a&&(s.coordinate_system={type:a[1],axis:this.extractAxes(e)});const i=e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT");if(i){const u=this.convertUnit(i);s.coordinate_system.unit=u}s.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":s.type=e[0]==="GEODCRS"?"GeodeticCRS":"GeographicCRS",s.name=e[1];const r=e.find(u=>Array.isArray(u)&&(u[0]==="DATUM"||u[0]==="ENSEMBLE"));if(r){const u=this.convert(r);r[0]==="ENSEMBLE"?s.datum_ensemble=u:s.datum=u;const m=e.find(w=>Array.isArray(w)&&w[0]==="PRIMEM");m&&m[1]!=="Greenwich"&&(u.prime_meridian={name:m[1],longitude:parseFloat(m[2])})}s.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},s.id=this.getId(e);break;case"DATUM":s.type="GeodeticReferenceFrame",s.name=e[1],s.ellipsoid=e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":s.type="DatumEnsemble",s.name=e[1],s.members=e.filter(u=>Array.isArray(u)&&u[0]==="MEMBER").map(u=>({type:"DatumEnsembleMember",name:u[1],id:this.getId(u)}));const o=e.find(u=>Array.isArray(u)&&u[0]==="ENSEMBLEACCURACY");o&&(s.accuracy=parseFloat(o[1]));const n=e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID");n&&(s.ellipsoid=this.convert(n)),s.id=this.getId(e);break;case"ELLIPSOID":s.type="Ellipsoid",s.name=e[1],s.semi_major_axis=parseFloat(e[2]),s.inverse_flattening=parseFloat(e[3]),e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT")&&this.convert(e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT"),s);break;case"CONVERSION":s.type="Conversion",s.name=e[1],s.method=e.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,s.parameters=e.filter(u=>Array.isArray(u)&&u[0]==="PARAMETER").map(u=>this.convert(u));break;case"METHOD":s.type="Method",s.name=e[1],s.id=this.getId(e);break;case"PARAMETER":s.type="Parameter",s.name=e[1],s.value=parseFloat(e[2]),s.unit=this.convertUnit(e.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT"))),s.id=this.getId(e);break;case"BOUNDCRS":s.type="BoundCRS";const h=e.find(u=>Array.isArray(u)&&u[0]==="SOURCECRS");if(h){const u=h.find(m=>Array.isArray(m));s.source_crs=u?this.convert(u):null}const l=e.find(u=>Array.isArray(u)&&u[0]==="TARGETCRS");if(l){const u=l.find(m=>Array.isArray(m));s.target_crs=u?this.convert(u):null}const g=e.find(u=>Array.isArray(u)&&u[0]==="ABRIDGEDTRANSFORMATION");g?s.transformation=this.convert(g):s.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(s.type="Transformation",s.name=e[1],s.method=e.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,s.parameters=e.filter(u=>Array.isArray(u)&&(u[0]==="PARAMETER"||u[0]==="PARAMETERFILE")).map(u=>{if(u[0]==="PARAMETER")return this.convert(u);if(u[0]==="PARAMETERFILE")return{name:u[1],value:u[2],id:{authority:"EPSG",code:8656}}}),s.parameters.length===7){const u=s.parameters[6];u.name==="Scale difference"&&(u.value=Math.round((u.value-1)*1e12)/1e6)}s.id=this.getId(e);break;case"AXIS":s.coordinate_system||(s.coordinate_system={type:"unspecified",axis:[]}),s.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const f=this.convertUnit(e,"LinearUnit");s.coordinate_system&&s.coordinate_system.axis&&s.coordinate_system.axis.forEach(u=>{u.unit||(u.unit=f)}),f.conversion_factor&&f.conversion_factor!==1&&s.semi_major_axis&&(s.semi_major_axis={value:s.semi_major_axis,unit:f});break;default:s.keyword=e[0];break}return s}}class dr extends Ba{static convert(e,s={}){return super.convert(e,s),s.coordinate_system&&s.coordinate_system.subtype==="Cartesian"&&delete s.coordinate_system,s.usage&&delete s.usage,s}}class _r extends Ba{static convert(e,s={}){super.convert(e,s);const a=e.find(r=>Array.isArray(r)&&r[0]==="CS");a&&(s.coordinate_system={subtype:a[1],axis:this.extractAxes(e)});const i=e.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(i){const r=i.find(h=>Array.isArray(h)&&h[0]==="SCOPE"),o=i.find(h=>Array.isArray(h)&&h[0]==="AREA"),n=i.find(h=>Array.isArray(h)&&h[0]==="BBOX");s.usage={},r&&(s.usage.scope=r[1]),o&&(s.usage.area=o[1]),n&&(s.usage.bbox=n.slice(1))}return s}}function Mr(t){return t.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(t.find(e=>Array.isArray(e)&&e[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function mr(t){return(Mr(t)==="2019"?_r:dr).convert(t)}function yr(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Oe=1,za=2,Wa=3,vs=4,Va=5,Hs=-1,wr=/\s/,Er=/[A-Za-z]/,Sr=/[A-Za-z84_]/,Ss=/[,\]]/,Ha=/[\d\.E\-\+]/;function Ft(t){if(typeof t!="string")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=Oe}Ft.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==vs)for(;wr.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Oe:return this.neutral(t);case za:return this.keyword(t);case vs:return this.quoted(t);case Va:return this.afterquote(t);case Wa:return this.number(t);case Hs:return}};Ft.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=vs;return}if(Ss.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};Ft.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Oe;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Oe,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Hs);return}};Ft.prototype.number=function(t){if(Ha.test(t)){this.word+=t;return}if(Ss.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};Ft.prototype.quoted=function(t){if(t==='"'){this.state=Va;return}this.word+=t};Ft.prototype.keyword=function(t){if(Sr.test(t)){this.word+=t;return}if(t==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Oe;return}if(Ss.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};Ft.prototype.neutral=function(t){if(Er.test(t)){this.word=t,this.state=za;return}if(t==='"'){this.word="",this.state=vs;return}if(Ha.test(t)){this.word=t,this.state=Wa;return}if(Ss.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};Ft.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Hs)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Pr(t){var e=new Ft(t);return e.output()}function Os(t,e,s){Array.isArray(e)&&(s.unshift(e),e=null);var a=e?{}:t,i=s.reduce(function(r,o){return ae(o,r),r},a);e&&(t[e]=i)}function ae(t,e){if(!Array.isArray(t)){e[t]=!0;return}var s=t.shift();if(s==="PARAMETER"&&(s=t.shift()),t.length===1){if(Array.isArray(t[0])){e[s]={},ae(t[0],e[s]);return}e[s]=t[0];return}if(!t.length){e[s]=!0;return}if(s==="TOWGS84"){e[s]=t;return}if(s==="AXIS"){s in e||(e[s]=[]),e[s].push(t);return}Array.isArray(s)||(e[s]={});var a;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[s]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&ae(t[2],e[s]);return;case"SPHEROID":case"ELLIPSOID":e[s]={name:t[0],a:t[1],rf:t[2]},t.length===4&&ae(t[3],e[s]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],Os(e,s,t);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":t[0]=["name",t[0]],Os(e,s,t),e[s].type=s;return;default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return ae(t,e[s]);return Os(e,s,t)}}var pr=.017453292519943295;function St(t){return t*pr}function Qa(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0===void 0&&t.longc!==void 0&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(t.lat0=St(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=St(t.lat0>0?90:-90),delete t.lat1)}function wa(t){let e={units:null,to_meter:void 0};return typeof t=="string"?(e.units=t.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function Ea(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function Sa(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=Ea(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?e.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Ea(t.ellipsoid.semi_minor_axis))))}function ds(t,e={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(ds(t.source_crs,e),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(s=>s.value)),e):(Object.keys(t).forEach(s=>{const a=t[s];if(a!==null)switch(s){case"name":if(e.srsCode)break;e.name=a,e.srsCode=a;break;case"type":a==="GeographicCRS"?e.projName="longlat":a==="GeodeticCRS"?t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"?e.projName="geocent":e.projName="longlat":a==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":a.ellipsoid&&(e.ellps=a.ellipsoid.name,Sa(a,e)),a.prime_meridian&&(e.from_greenwich=a.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=a.name,Sa(a,e);break;case"prime_meridian":e.long0=(a.longitude||0)*Math.PI/180;break;case"coordinate_system":if(a.axis){const i={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},r=a.axis.map(o=>i[o.direction.toLowerCase()]);if(r.every(Boolean)&&(e.axis=r.join(""),e.axis.length===2&&(e.axis+="u")),a.unit){const{units:o,to_meter:n}=wa(a.unit);e.units=o,e.to_meter=n}else if(a.axis[0]&&a.axis[0].unit){const{units:o,to_meter:n}=wa(a.axis[0].unit);e.units=o,e.to_meter=n}}break;case"id":a.authority&&a.code&&(e.title=a.authority+":"+a.code);break;case"conversion":a.method&&a.method.name&&(e.projName=a.method.name),a.parameters&&a.parameters.forEach(i=>{const r=i.name.toLowerCase().replace(/\s+/g,"_"),o=i.value;i.unit&&i.unit.conversion_factor?e[r]=o*i.unit.conversion_factor:i.unit==="degree"?e[r]=o*Math.PI/180:e[r]=o});break;case"unit":a.name&&(e.units=a.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),a.conversion_factor&&(e.to_meter=a.conversion_factor);break;case"base_crs":ds(a,e),e.datumCode=a.id?a.id.authority+"_"+a.id.code:a.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),Qa(e),e)}var xr=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function br(t,e){var s=e[0],a=e[1];!(s in t)&&a in t&&(t[s]=t[a],e.length===3&&(t[s]=e[2](t[s])))}function Ja(t){for(var e=Object.keys(t),s=0,a=e.length;s<a;++s){var i=e[s];xr.indexOf(i)!==-1&&Gr(t[i]),typeof t[i]=="object"&&Ja(t[i])}}function Gr(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var s="",a=0,i=t.AXIS.length;a<i;++a){var r=[t.AXIS[a][0].toLowerCase(),t.AXIS[a][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?s+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?s+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?s+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(s+="w")}s.length===2&&(s+="u"),s.length===3&&(t.axis=s)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;t.type==="GEOGCS"&&(o=t),o&&(o.PRIMEM&&o.PRIMEM.convert&&(t.from_greenwich=St(o.PRIMEM.convert)),o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode==="new_zealand_1949"&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode==="belge_1972"&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.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"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=St(t.rectified_grid_angle));function n(g){var f=t.to_meter||1;return g*f}var h=function(g){return br(t,g)},l=[["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",St],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",St],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",St],["lat0","latitude_of_origin",St],["lat0","standard_parallel_1",St],["lat1","standard_parallel_1",St],["lat2","standard_parallel_2",St],["azimuth","Azimuth"],["alpha","azimuth",St],["srsCode","name"]];l.forEach(h),Qa(t)}function _s(t){if(typeof t=="object")return ds(t);const e=yr(t);var s=Pr(t);if(e==="WKT2"){const r=mr(s);return ds(r)}var a=s[0],i={};return ae(s,i),Ja(i),i[a]}function ot(t){var e=this;if(arguments.length===2){var s=arguments[1];typeof s=="string"?s.charAt(0)==="+"?ot[t]=Ds(arguments[1]):ot[t]=_s(arguments[1]):s&&typeof s=="object"&&!("projName"in s)?ot[t]=_s(arguments[1]):(ot[t]=s,s||delete ot[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(a){return Array.isArray(a)?ot.apply(e,a):ot(a)});if(typeof t=="string"){if(t in ot)return ot[t]}else"EPSG"in t?ot["EPSG:"+t.EPSG]=t:"ESRI"in t?ot["ESRI:"+t.ESRI]=t:"IAU2000"in t?ot["IAU2000:"+t.IAU2000]=t:console.log(t);return}}hr(ot);function Nr(t){return typeof t=="string"}function Ar(t){return t in ot}function Ir(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var Pa=["3857","900913","3785","102113"];function Cr(t){if(t.title)return t.title.toLowerCase().indexOf("epsg:")===0&&Pa.indexOf(t.title.substr(5))>-1;var e=$t(t,"authority");if(e){var s=$t(e,"epsg");return s&&Pa.indexOf(s)>-1}}function Lr(t){var e=$t(t,"extension");if(e)return $t(e,"proj4")}function Rr(t){return t[0]==="+"}function Tr(t){let e;if(Nr(t))if(Ar(t))e=ot[t];else if(Ir(t)){e=_s(t);var s=Lr(e);s&&(e=Ds(s))}else Rr(t)&&(e=Ds(t));else"projName"in t?e=t:e=_s(t);return e&&Cr(e)?ot["EPSG:3857"]:e}function pa(t,e){t=t||{};var s,a;if(!e)return t;for(a in e)s=e[a],s!==void 0&&(t[a]=s);return t}function Lt(t,e,s){var a=t*e;return s/Math.sqrt(1-a*a)}function qe(t){return t<0?-1:1}function G(t,e){return e||Math.abs(t)<=tt?t:t-qe(t)*Te}function Gt(t,e,s){var a=t*s,i=.5*t;return a=Math.pow((1-a)/(1+a),i),Math.tan(.5*(P-e))/a}function Fe(t,e){for(var s=.5*t,a,i,r=P-2*Math.atan(e),o=0;o<=15;o++)if(a=t*Math.sin(r),i=P-2*Math.atan(e*Math.pow((1-a)/(1+a),s))-r,r+=i,Math.abs(i)<=1e-10)return r;return-9999}function Or(){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=Lt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Fr(t){var e=t.x,s=t.y;if(s*yt>90&&s*yt<-90&&e*yt>180&&e*yt<-180)return null;var a,i;if(Math.abs(Math.abs(s)-P)<=x)return null;if(this.sphere)a=this.x0+this.a*this.k0*G(e-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(U+.5*s));else{var r=Math.sin(s),o=Gt(this.e,s,r);a=this.x0+this.a*this.k0*G(e-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(o)}return t.x=a,t.y=i,t}function jr(t){var e=t.x-this.x0,s=t.y-this.y0,a,i;if(this.sphere)i=P-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var r=Math.exp(-s/(this.a*this.k0));if(i=Fe(this.e,r),i===-9999)return null}return a=G(this.long0+e/(this.a*this.k0),this.over),t.x=a,t.y=i,t}var kr=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const qr={init:Or,forward:Fr,inverse:jr,names:kr};function $r(){}function xa(t){return t}var Xa=["longlat","identity"];const Dr={init:$r,forward:xa,inverse:xa,names:Xa};var Ur=[qr,Dr],Vt={},ie=[];function Ka(t,e){var s=ie.length;return t.names?(ie[s]=t,t.names.forEach(function(a){Vt[a.toLowerCase()]=s}),this):(console.log(e),!0)}function Za(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function Br(t){if(!t)return!1;var e=t.toLowerCase();if(typeof Vt[e]!="undefined"&&ie[Vt[e]]||(e=Za(e),e in Vt&&ie[Vt[e]]))return ie[Vt[e]]}function zr(){Ur.forEach(Ka)}const Wr={start:zr,add:Ka,get:Br};var Ya={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:6377563396e-3,b:635625691e-2,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:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,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:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,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:63781575e-1,b:63567722e-1,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:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,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)"}};const Vr=Ya.WGS84;function Hr(t,e,s,a){var i=t*t,r=e*e,o=(i-r)/i,n=0;a?(t*=1-o*(cr+o*(fr+o*gr)),i=t*t,o=0):n=Math.sqrt(o);var h=(i-r)/r;return{es:o,e:n,ep2:h}}function Qr(t,e,s,a,i){if(!t){var r=$t(Ya,a);r||(r=Vr),t=r.a,e=r.b,s=r.rf}return s&&!e&&(e=(1-1/s)*t),(s===0||Math.abs(t-e)<x)&&(i=!0,e=t),{a:t,b:e,rf:s,sphere:i}}var hs={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.005693,-0.044698,0.044285,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,-0.395026,0.330772,-1.876073,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.243648,-1.158828,-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,6.681627,-31.611492,-19.848161,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,-0.008393,0.000749,-0.010276,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,0.02579,0.00965,0.01166,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:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},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:"372.87,149.23,585.29"},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"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(var Jr in hs){var Fs=hs[Jr];Fs.datumName&&(hs[Fs.datumName]=Fs)}function Xr(t,e,s,a,i,r,o){var n={};return n.datum_type=$s,e&&(n.datum_type=lr,n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=Qt),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=Jt,n.datum_params[3]*=Ae,n.datum_params[4]*=Ae,n.datum_params[5]*=Ae,n.datum_params[6]=n.datum_params[6]/1e6+1)),o&&(n.datum_type=oe,n.grids=o),n.a=s,n.b=a,n.es=i,n.ep2=r,n}var Qs={};function Kr(t,e,s){return e instanceof ArrayBuffer?Zr(t,e,s):{ready:Yr(t,e)}}function Zr(t,e,s){var a=!0;s!==void 0&&s.includeErrorFields===!1&&(a=!1);var i=new DataView(e),r=sn(i),o=an(i,r),n=rn(i,o,r,a),h={header:o,subgrids:n};return Qs[t]=h,h}function Yr(t,e){return nt(this,null,function*(){for(var s=[],a=yield e.getImageCount(),i=a-1;i>=0;i--){var r=yield e.getImage(i),o=yield r.readRasters(),n=o,h=[r.getWidth(),r.getHeight()],l=r.getBoundingBox().map(ba),g=typeof r.fileDirectory.getValue=="function"?r.fileDirectory.getValue("ModelPixelScale"):r.fileDirectory.ModelPixelScale,f=[g[0],g[1]].map(ba),u=l[0]+(h[0]-1)*f[0],m=l[3]-(h[1]-1)*f[1],w=n[0],E=n[1],S=[];for(let I=h[1]-1;I>=0;I--)for(let R=h[0]-1;R>=0;R--){var b=I*h[0]+R;S.push([-qt(E[b]),qt(w[b])])}s.push({del:f,lim:h,ll:[-u,m],cvs:S})}var A={header:{nSubgrids:a},subgrids:s};return Qs[t]=A,A})}function tn(t){if(t===void 0)return null;var e=t.split(",");return e.map(en)}function en(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Qs[t]||null,isNull:!1}}function ba(t){return t*Math.PI/180}function qt(t){return t/3600*Math.PI/180}function sn(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function an(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Us(t,56,56+8).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function Us(t,e,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,s)))}function rn(t,e,s,a){for(var i=176,r=[],o=0;o<e.nSubgrids;o++){var n=on(t,i,s),h=hn(t,i,n,s,a),l=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),g=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[qt(n.lowerLongitude),qt(n.lowerLatitude)],del:[qt(n.longitudeInterval),qt(n.latitudeInterval)],lim:[l,g],count:n.gridNodeCount,cvs:nn(h)});var f=16;a===!1&&(f=8),i+=176+n.gridNodeCount*f}return r}function nn(t){return t.map(function(e){return[qt(e.longitudeShift),qt(e.latitudeShift)]})}function on(t,e,s){return{name:Us(t,e+8,e+16).trim(),parent:Us(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,s),upperLatitude:t.getFloat64(e+88,s),lowerLongitude:t.getFloat64(e+104,s),upperLongitude:t.getFloat64(e+120,s),latitudeInterval:t.getFloat64(e+136,s),longitudeInterval:t.getFloat64(e+152,s),gridNodeCount:t.getInt32(e+168,s)}}function hn(t,e,s,a,i){var r=e+176,o=16;i===!1&&(o=8);for(var n=[],h=0;h<s.gridNodeCount;h++){var l={latitudeShift:t.getFloat32(r+h*o,a),longitudeShift:t.getFloat32(r+h*o+4,a)};i!==!1&&(l.latitudeAccuracy=t.getFloat32(r+h*o+8,a),l.longitudeAccuracy=t.getFloat32(r+h*o+12,a)),n.push(l)}return n}function pt(t,e){if(!(this instanceof pt))return new pt(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.axis,this.names=null,this.title,e=e||function(l){if(l)throw l};var s=Tr(t);if(typeof s!="object"){e("Could not parse to valid json: "+t);return}var a=pt.projections.get(s.projName);if(!a){e("Could not get projection name from: "+t);return}if(s.datumCode&&s.datumCode!=="none"){var i=$t(hs,s.datumCode);i&&(s.datum_params=s.datum_params||(i.towgs84?i.towgs84.split(","):null),s.ellps=i.ellipse,s.datumName=i.datumName?i.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 r=Qr(s.a,s.b,s.rf,s.ellps,s.sphere),o=Hr(r.a,r.b,r.rf,s.R_A),n=tn(s.nadgrids),h=s.datum||Xr(s.datumCode,s.datum_params,r.a,r.b,o.es,o.ep2,n);pa(this,s),pa(this,a),this.a=r.a,this.b=r.b,this.rf=r.rf,this.sphere=r.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=h,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}pt.projections=Wr;pt.projections.start();function ln(t,e){return t.datum_type!==e.datum_type||t.a!==e.a||Math.abs(t.es-e.es)>5e-11?!1:t.datum_type===Qt?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===Jt?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function ti(t,e,s){var a=t.x,i=t.y,r=t.z?t.z:0,o,n,h,l;if(i<-P&&i>-1.001*P)i=-P;else if(i>P&&i<1.001*P)i=P;else{if(i<-P)return{x:-1/0,y:-1/0,z:t.z};if(i>P)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(i),l=Math.cos(i),h=n*n,o=s/Math.sqrt(1-e*h),{x:(o+r)*l*Math.cos(a),y:(o+r)*l*Math.sin(a),z:(o*(1-e)+r)*n}}function ei(t,e,s,a){var i=1e-12,r=i*i,o=30,n,h,l,g,f,u,m,w,E,S,b,A,I,R=t.x,j=t.y,O=t.z?t.z:0,F,K,W;if(n=Math.sqrt(R*R+j*j),h=Math.sqrt(R*R+j*j+O*O),n/s<i){if(F=0,h/s<i)return K=P,W=-a,{x:t.x,y:t.y,z:t.z}}else F=Math.atan2(j,R);l=O/h,g=n/h,f=1/Math.sqrt(1-e*(2-e)*g*g),w=g*(1-e)*f,E=l*f,I=0;do I++,m=s/Math.sqrt(1-e*E*E),W=n*w+O*E-m*(1-e*E*E),u=e*m/(m+W),f=1/Math.sqrt(1-u*(2-u)*g*g),S=g*(1-u)*f,b=l*f,A=b*w-S*E,w=S,E=b;while(A*A>r&&I<o);return K=Math.atan(b/Math.abs(S)),{x:F,y:K,z:W}}function un(t,e,s){if(e===Qt)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(e===Jt){var a=s[0],i=s[1],r=s[2],o=s[3],n=s[4],h=s[5],l=s[6];return{x:l*(t.x-h*t.y+n*t.z)+a,y:l*(h*t.x+t.y-o*t.z)+i,z:l*(-n*t.x+o*t.y+t.z)+r}}}function cn(t,e,s){if(e===Qt)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(e===Jt){var a=s[0],i=s[1],r=s[2],o=s[3],n=s[4],h=s[5],l=s[6],g=(t.x-a)/l,f=(t.y-i)/l,u=(t.z-r)/l;return{x:g+h*f-n*u,y:-h*g+f+o*u,z:n*g-o*f+u}}}function rs(t){return t===Qt||t===Jt}function fn(t,e,s){if(ln(t,e)||t.datum_type===$s||e.datum_type===$s)return s;var a=t.a,i=t.es;if(t.datum_type===oe){var r=Ga(t,!1,s);if(r!==0)return;a=Ma,i=ma}var o=e.a,n=e.b,h=e.es;if(e.datum_type===oe&&(o=Ma,n=ur,h=ma),i===h&&a===o&&!rs(t.datum_type)&&!rs(e.datum_type))return s;if(s=ti(s,i,a),rs(t.datum_type)&&(s=un(s,t.datum_type,t.datum_params)),rs(e.datum_type)&&(s=cn(s,e.datum_type,e.datum_params)),s=ei(s,h,o,n),e.datum_type===oe){var l=Ga(e,!0,s);if(l!==0)return}return s}function Ga(t,e,s){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var a={x:-s.x,y:s.y},i={x:Number.NaN,y:Number.NaN},r=[];t:for(var o=0;o<t.grids.length;o++){var n=t.grids[o];if(r.push(n.name),n.isNull){i=a;break}if(n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var h=n.grid.subgrids,l=0,g=h.length;l<g;l++){var f=h[l],u=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,m=f.ll[0]-u,w=f.ll[1]-u,E=f.ll[0]+(f.lim[0]-1)*f.del[0]+u,S=f.ll[1]+(f.lim[1]-1)*f.del[1]+u;if(!(w>a.y||m>a.x||S<a.y||E<a.x)&&(i=gn(a,e,f),!isNaN(i.x)))break t}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*yt+" "+a.y*yt+" tried: '"+r+"'"),-1):(s.x=-i.x,s.y=i.y,0)}function gn(t,e,s){var a={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return a;var i={x:t.x,y:t.y};i.x-=s.ll[0],i.y-=s.ll[1],i.x=G(i.x-Math.PI)+Math.PI;var r=Na(i,s);if(e){if(isNaN(r.x))return a;r.x=i.x-r.x,r.y=i.y-r.y;var o=9,n=1e-12,h,l;do{if(l=Na(r,s),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}h={x:i.x-(l.x+r.x),y:i.y-(l.y+r.y)},r.x+=h.x,r.y+=h.y}while(o--&&Math.abs(h.x)>n&&Math.abs(h.y)>n);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=G(r.x+s.ll[0]),a.y=r.y+s.ll[1]}else isNaN(r.x)||(a.x=t.x+r.x,a.y=t.y+r.y);return a}function Na(t,e){var s={x:t.x/e.del[0],y:t.y/e.del[1]},a={x:Math.floor(s.x),y:Math.floor(s.y)},i={x:s.x-1*a.x,y:s.y-1*a.y},r={x:Number.NaN,y:Number.NaN},o;if(a.x<0||a.x>=e.lim[0]||a.y<0||a.y>=e.lim[1])return r;o=a.y*e.lim[0]+a.x;var n={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var h={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var l={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var g={x:e.cvs[o][0],y:e.cvs[o][1]},f=i.x*i.y,u=i.x*(1-i.y),m=(1-i.x)*(1-i.y),w=(1-i.x)*i.y;return r.x=m*n.x+u*h.x+w*g.x+f*l.x,r.y=m*n.y+u*h.y+w*g.y+f*l.y,r}var Ht=["x","y","z"];function vn(t,e){const s={};for(let a=0,i=t.axis.length;a<i;a++){if(a===2&&e.z===void 0)continue;let r=e[Ht[a]];switch(t.axis[a]){case"e":s.x=r;break;case"w":s.x=-r;break;case"n":s.y=r;break;case"s":s.y=-r;break;case"u":s.z=r;break;case"d":s.z=-r;break;default:return null}}return s}function dn(t,e){const s={};for(let a=0,i=t.axis.length;a<i;a++)if(!(a===2&&e.z===void 0))switch(t.axis[a]){case"e":s[Ht[a]]=e.x;break;case"w":s[Ht[a]]=-e.x;break;case"n":s[Ht[a]]=e.y;break;case"s":s[Ht[a]]=-e.y;break;case"u":s[Ht[a]]=e.z;break;case"d":s[Ht[a]]=-e.z;break;default:return null}return s}function Js(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function _n(t){Aa(t.x),Aa(t.y)}function Aa(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Mn(t,e){return(t.datum.datum_type===Qt||t.datum.datum_type===Jt||t.datum.datum_type===oe)&&e.datumCode!=="WGS84"||(e.datum.datum_type===Qt||e.datum.datum_type===Jt||e.datum.datum_type===oe)&&t.datumCode!=="WGS84"}function Ms(t,e,s,a){var i,r=s.z!==void 0;if(_n(s),t.datum&&e.datum&&Mn(t,e)&&(i=new pt("WGS84"),s=Ms(t,i,s,a),t=i),a&&t.axis!=="enu"&&(s=vn(t,s)),t.projName==="longlat")s={x:s.x*Z,y:s.y*Z,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),!s)return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=fn(t.datum,e.datum,s),!!s)return s=s,e.from_greenwich&&(s={x:s.x-e.from_greenwich,y:s.y,z:s.z||0}),e.projName==="longlat"?s={x:s.x*yt,y:s.y*yt,z:s.z||0}:(s=e.forward(s),e.to_meter&&(s={x:s.x/e.to_meter,y:s.y/e.to_meter,z:s.z||0})),a&&e.axis!=="enu"?dn(e,s):(s&&!r&&e.projName!=="geocent"&&delete s.z,s)}function mn(t,e,s,a){var i;return Array.isArray(s)?i=Js(s):i={x:s.x,y:s.y,z:s.z,m:s.m},Ms(t,e,i,a)}var Ia=pt("WGS84");function js(t,e,s,a){var i,r,o;return Array.isArray(s)?(i=Ms(t,e,Js(s),a)||{x:NaN,y:NaN},s.length>2?(r=typeof t.name!="undefined"&&t.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",r?typeof i.z=="number"?[i.x,i.y,i.z].concat(s.slice(3)):[i.x,i.y,s[2]].concat(s.slice(3)):a&&typeof i.z=="number"?[i.x,i.y,i.z].concat(s.slice(3)):[i.x,i.y].concat(s.slice(2))):[i.x,i.y]):(i=Ms(t,e,{x:s.x,y:s.y,z:s.z,m:s.m},a)||{x:NaN,y:NaN},o=Object.keys(s),o.length===2||(r=typeof t.name!="undefined"&&t.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",o.forEach(function(n){n==="x"||n==="y"||n==="z"&&(r||a)||(i[n]=s[n])})),i)}function ns(t){return t instanceof pt?t:typeof t=="object"&&"oProj"in t?t.oProj:pt(t)}function yn(t,e,s){var a,i,r=!1,o;return typeof e=="undefined"?(i=ns(t),a=Ia,r=!0):(typeof e.x!="undefined"||Array.isArray(e))&&(s=e,i=ns(t),a=Ia,r=!0),a||(a=ns(t)),i||(i=ns(e)),s?js(a,i,s):(o={forward:function(n,h){return js(a,i,n,h)},inverse:function(n,h){return js(i,a,n,h)}},r&&(o.oProj=i),o)}var Ca=6,si="AJSAJS",ai="AFAFAF",re=65,Mt=73,Pt=79,be=86,Ge=90;const wn={forward:ii,inverse:En,toPoint:ri};function ii(t,e){return e=e||5,pn(Sn({lat:t[1],lon:t[0]}),e)}function En(t){var e=Xs(oi(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function ri(t){var e=Xs(oi(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function ks(t){return t*(Math.PI/180)}function La(t){return 180*(t/Math.PI)}function Sn(t){var e=t.lat,s=t.lon,a=6378137,i=.00669438,r=.9996,o,n,h,l,g,f,u,m=ks(e),w=ks(s),E,S;S=Math.floor((s+180)/6)+1,s===180&&(S=60),e>=56&&e<64&&s>=3&&s<12&&(S=32),e>=72&&e<84&&(s>=0&&s<9?S=31:s>=9&&s<21?S=33:s>=21&&s<33?S=35:s>=33&&s<42&&(S=37)),o=(S-1)*6-180+3,E=ks(o),n=i/(1-i),h=a/Math.sqrt(1-i*Math.sin(m)*Math.sin(m)),l=Math.tan(m)*Math.tan(m),g=n*Math.cos(m)*Math.cos(m),f=Math.cos(m)*(w-E),u=a*((1-i/4-3*i*i/64-5*i*i*i/256)*m-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*m)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*m)-35*i*i*i/3072*Math.sin(6*m));var b=r*h*(f+(1-l+g)*f*f*f/6+(5-18*l+l*l+72*g-58*n)*f*f*f*f*f/120)+5e5,A=r*(u+h*Math.tan(m)*(f*f/2+(5-l+9*g+4*g*g)*f*f*f*f/24+(61-58*l+l*l+600*g-330*n)*f*f*f*f*f*f/720));return e<0&&(A+=1e7),{northing:Math.round(A),easting:Math.round(b),zoneNumber:S,zoneLetter:Pn(e)}}function Xs(t){var e=t.northing,s=t.easting,a=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var r=.9996,o=6378137,n=.00669438,h,l=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),g,f,u,m,w,E,S,b,A,I=s-5e5,R=e;a<"N"&&(R-=1e7),S=(i-1)*6-180+3,h=n/(1-n),E=R/r,b=E/(o*(1-n/4-3*n*n/64-5*n*n*n/256)),A=b+(3*l/2-27*l*l*l/32)*Math.sin(2*b)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*b)+151*l*l*l/96*Math.sin(6*b),g=o/Math.sqrt(1-n*Math.sin(A)*Math.sin(A)),f=Math.tan(A)*Math.tan(A),u=h*Math.cos(A)*Math.cos(A),m=o*(1-n)/Math.pow(1-n*Math.sin(A)*Math.sin(A),1.5),w=I/(g*r);var j=A-g*Math.tan(A)/m*(w*w/2-(5+3*f+10*u-4*u*u-9*h)*w*w*w*w/24+(61+90*f+298*u+45*f*f-252*h-3*u*u)*w*w*w*w*w*w/720);j=La(j);var O=(w-(1+2*f+u)*w*w*w/6+(5-2*u+28*f-3*u*u+8*h+24*f*f)*w*w*w*w*w/120)/Math.cos(A);O=S+La(O);var F;if(t.accuracy){var K=Xs({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});F={top:K.lat,right:K.lon,bottom:j,left:O}}else F={lat:j,lon:O};return F}function Pn(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function pn(t,e){var s="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+xn(t.easting,t.northing,t.zoneNumber)+s.substr(s.length-5,e)+a.substr(a.length-5,e)}function xn(t,e,s){var a=ni(s),i=Math.floor(t/1e5),r=Math.floor(e/1e5)%20;return bn(i,r,a)}function ni(t){var e=t%Ca;return e===0&&(e=Ca),e}function bn(t,e,s){var a=s-1,i=si.charCodeAt(a),r=ai.charCodeAt(a),o=i+t-1,n=r+e,h=!1;o>Ge&&(o=o-Ge+re-1,h=!0),(o===Mt||i<Mt&&o>Mt||(o>Mt||i<Mt)&&h)&&o++,(o===Pt||i<Pt&&o>Pt||(o>Pt||i<Pt)&&h)&&(o++,o===Mt&&o++),o>Ge&&(o=o-Ge+re-1),n>be?(n=n-be+re-1,h=!0):h=!1,(n===Mt||r<Mt&&n>Mt||(n>Mt||r<Mt)&&h)&&n++,(n===Pt||r<Pt&&n>Pt||(n>Pt||r<Pt)&&h)&&(n++,n===Mt&&n++),n>be&&(n=n-be+re-1);var l=String.fromCharCode(o)+String.fromCharCode(n);return l}function oi(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,s=null,a="",i,r=0;!/[A-Z]/.test(i=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;a+=i,r++}var o=parseInt(a,10);if(r===0||r+3>e)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(r++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;s=t.substring(r,r+=2);for(var h=ni(o),l=Gn(s.charAt(0),h),g=Nn(s.charAt(1),h);g<An(n);)g+=2e6;var f=e-r;if(f%2!==0)throw`MGRSPoint has to have an even number
of digits after the zone letter and two 100km letters - front
half for easting meters, second half for
northing meters`+t;var u=f/2,m=0,w=0,E,S,b,A,I;return u>0&&(E=1e5/Math.pow(10,u),S=t.substring(r,r+u),m=parseFloat(S)*E,b=t.substring(r+u),w=parseFloat(b)*E),A=m+l,I=w+g,{easting:A,northing:I,zoneLetter:n,zoneNumber:o,accuracy:E}}function Gn(t,e){for(var s=si.charCodeAt(e-1),a=1e5,i=!1;s!==t.charCodeAt(0);){if(s++,s===Mt&&s++,s===Pt&&s++,s>Ge){if(i)throw"Bad character: "+t;s=re,i=!0}a+=1e5}return a}function Nn(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=ai.charCodeAt(e-1),a=0,i=!1;s!==t.charCodeAt(0);){if(s++,s===Mt&&s++,s===Pt&&s++,s>be){if(i)throw"Bad character: "+t;s=re,i=!0}a+=1e5}return a}function An(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function le(t,e,s){if(!(this instanceof le))return new le(t,e,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e=="undefined"){var a=t.split(",");this.x=parseFloat(a[0]),this.y=parseFloat(a[1]),this.z=parseFloat(a[2])||0}else this.x=t,this.y=e,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}le.fromMGRS=function(t){return new le(ri(t))};le.prototype.toMGRS=function(t){return ii([this.x,this.y],t)};var In=1,Cn=.25,Ra=.046875,Ta=.01953125,Oa=.01068115234375,Ln=.75,Rn=.46875,Tn=.013020833333333334,On=.007120768229166667,Fn=.3645833333333333,jn=.005696614583333333,kn=.3076171875;function Ks(t){var e=[];e[0]=In-t*(Cn+t*(Ra+t*(Ta+t*Oa))),e[1]=t*(Ln-t*(Ra+t*(Ta+t*Oa)));var s=t*t;return e[2]=s*(Rn-t*(Tn+t*On)),s*=t,e[3]=s*(Fn-t*jn),e[4]=s*t*kn,e}function ce(t,e,s,a){return s*=e,e*=e,a[0]*t-s*(a[1]+e*(a[2]+e*(a[3]+e*a[4])))}var qn=20;function Zs(t,e,s){for(var a=1/(1-e),i=t,r=qn;r;--r){var o=Math.sin(i),n=1-e*o*o;if(n=(ce(i,o,Math.cos(i),s)-t)*(n*Math.sqrt(n))*a,i-=n,Math.abs(n)<x)return i}return i}function $n(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Ks(this.es),this.ml0=ce(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Dn(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i,r,o,n=Math.sin(s),h=Math.cos(s);if(this.es){var g=h*a,f=Math.pow(g,2),u=this.ep2*Math.pow(h,2),m=Math.pow(u,2),w=Math.abs(h)>x?Math.tan(s):0,E=Math.pow(w,2),S=Math.pow(E,2);i=1-this.es*Math.pow(n,2),g=g/Math.sqrt(i);var b=ce(s,n,h,this.en);r=this.a*(this.k0*g*(1+f/6*(1-E+u+f/20*(5-18*E+S+14*u-58*E*u+f/42*(61+179*S-S*E-479*E)))))+this.x0,o=this.a*(this.k0*(b-this.ml0+n*a*g/2*(1+f/12*(5-E+9*u+4*m+f/30*(61+S-58*E+270*u-330*E*u+f/56*(1385+543*S-S*E-3111*E))))))+this.y0}else{var l=h*Math.sin(a);if(Math.abs(Math.abs(l)-1)<x)return 93;if(r=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,o=h*Math.cos(a)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(o),l>=1){if(l-1>x)return 93;o=0}else o=Math.acos(o);s<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=r,t.y=o,t}function Un(t){var e,s,a,i,r=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,s=Zs(e,this.es,this.en),Math.abs(s)<P){var f=Math.sin(s),u=Math.cos(s),m=Math.abs(u)>x?Math.tan(s):0,w=this.ep2*Math.pow(u,2),E=Math.pow(w,2),S=Math.pow(m,2),b=Math.pow(S,2);e=1-this.es*Math.pow(f,2);var A=r*Math.sqrt(e)/this.k0,I=Math.pow(A,2);e=e*m,a=s-e*I/(1-this.es)*.5*(1-I/12*(5+3*S-9*w*S+w-4*E-I/30*(61+90*S-252*w*S+45*b+46*w-I/56*(1385+3633*S+4095*b+1574*b*S)))),i=G(this.long0+A*(1-I/6*(1+2*S+w-I/20*(5+28*S+24*b+8*w*S+6*w-I/42*(61+662*S+1320*b+720*b*S))))/u,this.over)}else a=P*qe(o),i=0;else{var n=Math.exp(r/this.k0),h=.5*(n-1/n),l=this.lat0+o/this.k0,g=Math.cos(l);e=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(h,2))),a=Math.asin(e),o<0&&(a=-a),h===0&&g===0?i=0:i=G(Math.atan2(h,g)+this.long0,this.over)}return t.x=i,t.y=a,t}var Bn=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ls={init:$n,forward:Dn,inverse:Un,names:Bn};function hi(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function mt(t,e){t=Math.abs(t),e=Math.abs(e);var s=Math.max(t,e),a=Math.min(t,e)/(s||1);return s*Math.sqrt(1+Math.pow(a,2))}function zn(t){var e=1+t,s=e-1;return s===0?t:t*Math.log(e)/s}function Wn(t){var e=Math.abs(t);return e=zn(e*(1+e/(mt(1,e)+1))),t<0?-e:e}function Ys(t,e){for(var s=2*Math.cos(2*e),a=t.length-1,i=t[a],r=0,o;--a>=0;)o=-r+s*i+t[a],r=i,i=o;return e+o*Math.sin(2*e)}function Vn(t,e){for(var s=2*Math.cos(e),a=t.length-1,i=t[a],r=0,o;--a>=0;)o=-r+s*i+t[a],r=i,i=o;return Math.sin(e)*o}function Hn(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function li(t,e,s){for(var a=Math.sin(e),i=Math.cos(e),r=hi(s),o=Hn(s),n=2*i*o,h=-2*a*r,l=t.length-1,g=t[l],f=0,u=0,m=0,w,E;--l>=0;)w=u,E=f,u=g,f=m,g=-w+n*u-h*f+t[l],m=-E+h*u+n*f;return n=a*o,h=i*r,[n*g-h*m,n*m+h*g]}function Qn(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ls.init.apply(this),this.forward=ls.forward,this.inverse=ls.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),s=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),s=s*e,this.cgb[1]=s*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=s*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),s=s*e,this.cgb[2]=s*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=s*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),s=s*e,this.cgb[3]=s*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=s*(1237/630+e*(-12/5+e*(-24832/14175))),s=s*e,this.cgb[4]=s*(4174/315+e*(-144838/6237)),this.cbg[4]=s*(-734/315+e*(109598/31185)),s=s*e,this.cgb[5]=s*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=s*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=s*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),s=s*e,this.utg[2]=s*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=s*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),s=s*e,this.utg[3]=s*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=s*(49561/161280+e*(-179/168+e*(6601661/7257600))),s=s*e,this.utg[4]=s*(-4583/161280+e*(108847/3991680)),this.gtu[4]=s*(34729/80640+e*(-3418889/1995840)),s=s*e,this.utg[5]=s*(-20648693/638668800),this.gtu[5]=s*(212378941/319334400);var a=Ys(this.cbg,this.lat0);this.Zb=-this.Qn*(a+Vn(this.gtu,2*a))}function Jn(t){var e=G(t.x-this.long0,this.over),s=t.y;s=Ys(this.cbg,s);var a=Math.sin(s),i=Math.cos(s),r=Math.sin(e),o=Math.cos(e);s=Math.atan2(a,o*i),e=Math.atan2(r*i,mt(a,i*o)),e=Wn(Math.tan(e));var n=li(this.gtu,2*s,2*e);s=s+n[0],e=e+n[1];var h,l;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*s+this.Zb)+this.y0):(h=1/0,l=1/0),t.x=h,t.y=l,t}function Xn(t){var e=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn,e=e/this.Qn;var a,i;if(Math.abs(e)<=2.623395162778){var r=li(this.utg,2*s,2*e);s=s+r[0],e=e+r[1],e=Math.atan(hi(e));var o=Math.sin(s),n=Math.cos(s),h=Math.sin(e),l=Math.cos(e);s=Math.atan2(o*l,mt(h,l*n)),e=Math.atan2(h,l*n),a=G(e+this.long0,this.over),i=Ys(this.cgb,s)}else a=1/0,i=1/0;return t.x=a,t.y=i,t}var Kn=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const us={init:Qn,forward:Jn,inverse:Xn,names:Kn};function Zn(t,e){if(t===void 0){if(t=Math.floor((G(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Yn="etmerc";function to(){var t=Zn(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Z,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,us.init.apply(this),this.forward=us.forward,this.inverse=us.inverse}var eo=["Universal Transverse Mercator System","utm"];const so={init:to,names:eo,dependsOn:Yn};function ta(t,e){return Math.pow((1-t)/(1+t),e)}var ao=20;function io(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+U)/(Math.pow(Math.tan(.5*this.lat0+U),this.C)*ta(this.e*t,this.ratexp))}function ro(t){var e=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+U),this.C)*ta(this.e*Math.sin(s),this.ratexp))-P,t.x=this.C*e,t}function no(t){for(var e=1e-14,s=t.x/this.C,a=t.y,i=Math.pow(Math.tan(.5*a+U)/this.K,1/this.C),r=ao;r>0&&(a=2*Math.atan(i*ta(this.e*Math.sin(t.y),-.5*this.e))-P,!(Math.abs(a-t.y)<e));--r)t.y=a;return r?(t.x=s,t.y=a,t):null}var oo=["gauss"];const ea={init:io,forward:ro,inverse:no,names:oo};function ho(){ea.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function lo(t){var e,s,a,i;return t.x=G(t.x-this.long0,this.over),ea.forward.apply(this,[t]),e=Math.sin(t.y),s=Math.cos(t.y),a=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*s*a),t.x=i*s*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*s*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function uo(t){var e,s,a,i,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=mt(t.x,t.y)){var o=2*Math.atan2(r,this.R2);e=Math.sin(o),s=Math.cos(o),i=Math.asin(s*this.sinc0+t.y*e*this.cosc0/r),a=Math.atan2(t.x*e,r*this.cosc0*s-t.y*this.sinc0*e)}else i=this.phic0,a=0;return t.x=a,t.y=i,ea.inverse.apply(this,[t]),t.x=G(t.x+this.long0,this.over),t}var co=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const fo={init:ho,forward:lo,inverse:uo,names:co};function sa(t,e,s){return e*=s,Math.tan(.5*(P+t))*Math.pow((1-e)/(1+e),.5*s)}function go(){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)<=x&&(this.k0=.5*(1+qe(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=x&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&Math.abs(Math.cos(this.lat_ts))>x&&(this.k0=.5*this.cons*Lt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Gt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Lt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(sa(this.lat0,this.sinlat0,this.e))-P,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function vo(t){var e=t.x,s=t.y,a=Math.sin(s),i=Math.cos(s),r,o,n,h,l,g,f=G(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=x&&Math.abs(s+this.lat0)<=x?(t.x=NaN,t.y=NaN,t):this.sphere?(r=2*this.k0/(1+this.sinlat0*a+this.coslat0*i*Math.cos(f)),t.x=this.a*r*i*Math.sin(f)+this.x0,t.y=this.a*r*(this.coslat0*a-this.sinlat0*i*Math.cos(f))+this.y0,t):(o=2*Math.atan(sa(s,a,this.e))-P,h=Math.cos(o),n=Math.sin(o),Math.abs(this.coslat0)<=x?(l=Gt(this.e,s*this.con,this.con*a),g=2*this.a*this.k0*l/this.cons,t.x=this.x0+g*Math.sin(e-this.long0),t.y=this.y0-this.con*g*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<x?(r=2*this.a*this.k0/(1+h*Math.cos(f)),t.y=r*n):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*h*Math.cos(f))),t.y=r*(this.cosX0*n-this.sinX0*h*Math.cos(f))+this.y0),t.x=r*h*Math.sin(f)+this.x0,t))}function _o(t){t.x-=this.x0,t.y-=this.y0;var e,s,a,i,r,o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,s=this.lat0,o<=x?(t.x=e,t.y=s,t):(s=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/o),Math.abs(this.coslat0)<x?this.lat0>0?e=G(this.long0+Math.atan2(t.x,-1*t.y),this.over):e=G(this.long0+Math.atan2(t.x,t.y),this.over):e=G(this.long0+Math.atan2(t.x*Math.sin(n),o*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n)),this.over),t.x=e,t.y=s,t)}else if(Math.abs(this.coslat0)<=x){if(o<=x)return s=this.lat0,e=this.long0,t.x=e,t.y=s,t;t.x*=this.con,t.y*=this.con,a=o*this.cons/(2*this.a*this.k0),s=this.con*Fe(this.e,a),e=this.con*G(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=x?r=this.X0:(r=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/o),e=G(this.long0+Math.atan2(t.x*Math.sin(i),o*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)),this.over)),s=-1*Fe(this.e,Math.tan(.5*(P+r)));return t.x=e,t.y=s,t}var Mo=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const mo={init:go,forward:vo,inverse:_o,names:Mo,ssfn_:sa};function yo(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),s=this.a,a=this.rf,i=1/a,r=2*i-Math.pow(i,2),o=this.e=Math.sqrt(r);this.R=this.k0*s*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+o*e)/(1-o*e));this.K=n-this.alpha*h+this.alpha*o/2*l}function wo(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(e+s)+this.K,i=2*(Math.atan(Math.exp(a))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(r))),n=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*o+this.x0,t}function Eo(t){for(var e=t.x-this.x0,s=t.y-this.y0,a=e/this.R,i=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(a)),o=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(i))),n=this.lambda0+o/this.alpha,h=0,l=r,g=-1e3,f=0;Math.abs(l-g)>1e-7;){if(++f>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),g=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=n,t.y=l,t}var So=["somerc"];const Po={init:yo,forward:wo,inverse:Eo,names:So};var se=1e-7;function po(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],s=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||e.indexOf(s)!==-1||e.indexOf(Za(s))!==-1}function xo(){var t,e,s,a,i,r,o,n,h,l,g=0,f,u=0,m=0,w=0,E=0,S=0,b=0;this.no_off=po(this),this.no_rot="no_rot"in this;var A=!1;"alpha"in this&&(A=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),A&&(b=this.alpha),I&&(g=this.rectified_grid_angle,A||(b=0,A=!0)),A||I)u=this.longc;else if(m=this.long1,E=this.lat1,w=this.long2,S=this.lat2,Math.abs(E-S)<=se||(t=Math.abs(E))<=se||Math.abs(t-P)<=se||Math.abs(Math.abs(this.lat0)-P)<=se||Math.abs(Math.abs(S)-P)<=se)throw new Error;var R=1-this.es;e=Math.sqrt(R),Math.abs(this.lat0)>x?(n=Math.sin(this.lat0),s=Math.cos(this.lat0),t=1-this.es*n*n,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/R),this.A=this.B*this.k0*e/t,a=this.B*e/(s*Math.sqrt(t)),i=a*a-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=a,this.E*=Math.pow(Gt(this.e,this.lat0,n),this.B)):(this.B=1/e,this.A=this.k0,this.E=a=i=1),A||I?(A?(f=Math.asin(Math.sin(b)/a),I||(g=b)):(f=g,b=Math.asin(a*Math.sin(f))),this.lam0=u-Math.asin(.5*(i-1/i)*Math.tan(f))/this.B):(r=Math.pow(Gt(this.e,E,Math.sin(E)),this.B),o=Math.pow(Gt(this.e,S,Math.sin(S)),this.B),i=this.E/r,h=(o-r)/(o+r),l=this.E*this.E,l=(l-o*r)/(l+o*r),t=m-w,t<-Math.PI?w-=Te:t>Math.PI&&(w+=Te),this.lam0=G(.5*(m+w)-Math.atan(l*Math.tan(.5*this.B*(m-w))/h)/this.B,this.over),f=Math.atan(2*Math.sin(this.B*G(m-this.lam0,this.over))/(i-1/i)),g=b=Math.asin(a*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(g),this.cosrot=Math.cos(g),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(a*a-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(U-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(U+i))}function bo(t){var e={},s,a,i,r,o,n,h,l;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-P)>x){if(o=this.E/Math.pow(Gt(this.e,t.y,Math.sin(t.y)),this.B),n=1/o,s=.5*(o-n),a=.5*(o+n),r=Math.sin(this.B*t.x),i=(s*this.singam-r*this.cosgam)/a,Math.abs(Math.abs(i)-1)<x)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),n=Math.cos(this.B*t.x),Math.abs(n)<se?h=this.A*t.x:h=this.ArB*Math.atan2(s*this.cosgam+r*this.singam,n)}else l=t.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*t.y;return this.no_rot?(e.x=h,e.y=l):(h-=this.u_0,e.x=l*this.cosrot+h*this.sinrot,e.y=h*this.cosrot-l*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Go(t){var e,s,a,i,r,o,n,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(s=t.y,e=t.x):(s=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=Math.exp(-this.BrA*s),i=.5*(a-1/a),r=.5*(a+1/a),o=Math.sin(this.BrA*e),n=(o*this.cosgam+i*this.singam)/r,Math.abs(Math.abs(n)-1)<x)h.x=0,h.y=n<0?-P:P;else{if(h.y=this.E/Math.sqrt((1+n)/(1-n)),h.y=Fe(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return h.x+=this.lam0,h}var No=["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"];const Ao={init:xo,forward:bo,inverse:Go,names:No};function Io(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<x)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),s=Math.cos(this.lat1),a=Lt(this.e,e,s),i=Gt(this.e,this.lat1,e),r=Math.sin(this.lat2),o=Math.cos(this.lat2),n=Lt(this.e,r,o),h=Gt(this.e,this.lat2,r),l=Math.abs(Math.abs(this.lat0)-P)<x?0:Gt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>x?this.ns=Math.log(a/n)/Math.log(i/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=a/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Co(t){var e=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=x&&(s=qe(s)*(P-2*x));var a=Math.abs(Math.abs(s)-P),i,r;if(a>x)i=Gt(this.e,s,Math.sin(s)),r=this.a*this.f0*Math.pow(i,this.ns);else{if(a=s*this.ns,a<=0)return null;r=0}var o=this.ns*G(e-this.long0,this.over);return t.x=this.k0*(r*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,t}function Lo(t){var e,s,a,i,r,o=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+n*n),s=1):(e=-Math.sqrt(o*o+n*n),s=-1);var h=0;if(e!==0&&(h=Math.atan2(s*o,s*n)),e!==0||this.ns>0){if(s=1/this.ns,a=Math.pow(e/(this.a*this.f0),s),i=Fe(this.e,a),i===-9999)return null}else i=-P;return r=G(h/this.ns+this.long0,this.over),t.x=r,t.y=i,t}var Ro=["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)"];const To={init:Io,forward:Co,inverse:Lo,names:Ro};function Oo(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(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.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((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.pow(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.pow(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 Fo(t){var e,s,a,i,r,o,n,h=t.x,l=t.y,g=G(h-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),a=-g*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),r=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(i)),o=this.n*r,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=n*Math.cos(o)/1,t.x=n*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function jo(t){var e,s,a,i,r,o,n,h,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x),i=r/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(i)),s=Math.asin(Math.cos(a)*Math.sin(i)/Math.cos(e)),t.x=this.long0-s/this.alfa,n=e,h=0;var g=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(h=1),n=t.y,g+=1;while(h===0&&g<15);return g>=15?null:t}var ko=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const qo={init:Oo,forward:Fo,inverse:jo,names:ko};function vt(t,e,s,a,i){return t*i-e*Math.sin(2*i)+s*Math.sin(4*i)-a*Math.sin(6*i)}function $e(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function De(t){return .375*t*(1+.25*t*(1+.46875*t))}function Ue(t){return .05859375*t*t*(1+.75*t)}function Be(t){return t*t*t*(35/3072)}function aa(t,e,s){var a=e*s;return t/Math.sqrt(1-a*a)}function Ut(t){return Math.abs(t)<P?t:t-qe(t)*Math.PI}function ms(t,e,s,a,i){var r,o;r=t/e;for(var n=0;n<15;n++)if(o=(t-(e*r-s*Math.sin(2*r)+a*Math.sin(4*r)-i*Math.sin(6*r)))/(e-2*s*Math.cos(2*r)+4*a*Math.cos(4*r)-6*i*Math.cos(6*r)),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function $o(){this.sphere||(this.e0=$e(this.es),this.e1=De(this.es),this.e2=Ue(this.es),this.e3=Be(this.es),this.ml0=this.a*vt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Do(t){var e,s,a=t.x,i=t.y;if(a=G(a-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(a)),s=this.a*(Math.atan2(Math.tan(i),Math.cos(a))-this.lat0);else{var r=Math.sin(i),o=Math.cos(i),n=aa(this.a,this.e,r),h=Math.tan(i)*Math.tan(i),l=a*Math.cos(i),g=l*l,f=this.es*o*o/(1-this.es),u=this.a*vt(this.e0,this.e1,this.e2,this.e3,i);e=n*l*(1-g*h*(1/6-(8-h+8*f)*g/120)),s=u-this.ml0+n*r/o*g*(.5+(5-h+6*f)*g/24)}return t.x=e+this.x0,t.y=s+this.y0,t}function Uo(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,s=t.y/this.a,a,i;if(this.sphere){var r=s+this.lat0;a=Math.asin(Math.sin(r)*Math.cos(e)),i=Math.atan2(Math.tan(e),Math.cos(r))}else{var o=this.ml0/this.a+s,n=ms(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-P)<=x)return t.x=this.long0,t.y=P,s<0&&(t.y*=-1),t;var h=aa(this.a,this.e,Math.sin(n)),l=h*h*h/this.a/this.a*(1-this.es),g=Math.pow(Math.tan(n),2),f=e*this.a/h,u=f*f;a=n-h*Math.tan(n)/l*f*f*(.5-(1+3*g)*f*f/24),i=f*(1-u*(g/3+(1+3*g)*g*u/15))/Math.cos(n)}return t.x=G(i+this.long0,this.over),t.y=Ut(a),t}var Bo=["Cassini","Cassini_Soldner","cass"];const zo={init:$o,forward:Do,inverse:Uo,names:Bo};function Ct(t,e){var s;return t>1e-7?(s=t*e,(1-t*t)*(e/(1-s*s)-.5/t*Math.log((1-s)/(1+s)))):2*e}var Wo=.3333333333333333,Vo=.17222222222222222,Ho=.10257936507936508,Qo=.06388888888888888,Jo=.0664021164021164,Xo=.016415012942191543;function ui(t){var e,s=[];return s[0]=t*Wo,e=t*t,s[0]+=e*Vo,s[1]=e*Qo,e*=t,s[0]+=e*Ho,s[1]+=e*Jo,s[2]=e*Xo,s}function ci(t,e){var s=t+t;return t+e[0]*Math.sin(s)+e[1]*Math.sin(s+s)+e[2]*Math.sin(s+s+s)}var Bs=1,zs=2,Ws=3,cs=4;function Ko(){var t=Math.abs(this.lat0);if(Math.abs(t-P)<x?this.mode=this.lat0<0?Bs:zs:Math.abs(t)<x?this.mode=Ws:this.mode=cs,this.es>0){var e;switch(this.qp=Ct(this.e,1),this.mmf=.5/(1-this.es),this.apa=ui(this.es),this.mode){case zs:this.dd=1;break;case Bs:this.dd=1;break;case Ws:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case cs:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Ct(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===cs&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Zo(t){var e,s,a,i,r,o,n,h,l,g,f=t.x,u=t.y;if(f=G(f-this.long0,this.over),this.sphere){if(r=Math.sin(u),g=Math.cos(u),a=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s=this.mode===this.EQUIT?1+g*a:1+this.sinph0*r+this.cosph0*g*a,s<=x)return null;s=Math.sqrt(2/s),e=s*g*Math.sin(f),s*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*g*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(u+this.lat0)<x)return null;s=U-u*.5,s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)),e=s*Math.sin(f),s*=a}}else{switch(n=0,h=0,l=0,a=Math.cos(f),i=Math.sin(f),r=Math.sin(u),o=Ct(this.e,r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=o/this.qp,h=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:l=1+this.sinb1*n+this.cosb1*h*a;break;case this.EQUIT:l=1+h*a;break;case this.N_POLE:l=P+u,o=this.qp-o;break;case this.S_POLE:l=u-P,o=this.qp+o;break}if(Math.abs(l)<x)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?s=this.ymf*l*(this.cosb1*n-this.sinb1*h*a):s=(l=Math.sqrt(2/(1+h*a)))*n*this.ymf,e=this.xmf*l*h*i;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(l=Math.sqrt(o))*i,s=a*(this.mode===this.S_POLE?l:-l)):e=s=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*s+this.y0,t}function Yo(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,s=t.y/this.a,a,i,r,o,n,h,l;if(this.sphere){var g=0,f,u=0;if(f=Math.sqrt(e*e+s*s),i=f*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(i),g=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(f)<=x?0:Math.asin(s*u/f),e*=u,s=g*f;break;case this.OBLIQ:i=Math.abs(f)<=x?this.lat0:Math.asin(g*this.sinph0+s*u*this.cosph0/f),e*=u*this.cosph0,s=(g-Math.sin(i)*this.sinph0)*f;break;case this.N_POLE:s=-s,i=P-i;break;case this.S_POLE:i-=P;break}a=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,s)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,s*=this.dd,h=Math.sqrt(e*e+s*s),h<x)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*h/this.rq),r=Math.cos(o),e*=o=Math.sin(o),this.mode===this.OBLIQ?(l=r*this.sinb1+s*o*this.cosb1/h,n=this.qp*l,s=h*this.cosb1*r-s*this.sinb1*o):(l=s*o/h,n=this.qp*l,s=h*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),n=e*e+s*s,!n)return t.x=this.long0,t.y=this.lat0,t;l=1-n/this.qp,this.mode===this.S_POLE&&(l=-l)}a=Math.atan2(e,s),i=ci(Math.asin(l),this.apa)}return t.x=G(this.long0+a,this.over),t.y=i,t}var th=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const eh={init:Ko,forward:Zo,inverse:Yo,names:th,S_POLE:Bs,N_POLE:zs,EQUIT:Ws,OBLIQ:cs};function Dt(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function sh(){Math.abs(this.lat1+this.lat2)<x||(this.temp=this.b/this.a,this.es=1-Math.pow(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=Lt(this.e3,this.sin_po,this.cos_po),this.qs1=Ct(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=Lt(this.e3,this.sin_po,this.cos_po),this.qs2=Ct(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=Ct(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>x?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 ah(t){var e=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var a=Ct(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,r=this.ns0*G(e-this.long0,this.over),o=i*Math.sin(r)+this.x0,n=this.rh-i*Math.cos(r)+this.y0;return t.x=o,t.y=n,t}function ih(t){var e,s,a,i,r,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),i=0,e!==0&&(i=Math.atan2(a*t.x,a*t.y)),a=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-a*a)/(2*this.ns0)):(s=(this.c-a*a)/this.ns0,o=this.phi1z(this.e3,s)),r=G(i/this.ns0+this.long0,this.over),t.x=r,t.y=o,t}function rh(t,e){var s,a,i,r,o,n=Dt(.5*e);if(t<x)return n;for(var h=t*t,l=1;l<=25;l++)if(s=Math.sin(n),a=Math.cos(n),i=t*s,r=1-i*i,o=.5*r*r/a*(e/(1-h)-s/r+.5/t*Math.log((1-i)/(1+i))),n=n+o,Math.abs(o)<=1e-7)return n;return null}var nh=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const oh={init:sh,forward:ah,inverse:ih,names:nh,phi1z:rh};function hh(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function lh(t){var e,s,a,i,r,o,n,h,l=t.x,g=t.y;return a=G(l-this.long0,this.over),e=Math.sin(g),s=Math.cos(g),i=Math.cos(a),o=this.sin_p14*e+this.cos_p14*s*i,r=1,o>0||Math.abs(o)<=x?(n=this.x0+this.a*r*s*Math.sin(a)/o,h=this.y0+this.a*r*(this.cos_p14*e-this.sin_p14*s*i)/o):(n=this.x0+this.infinity_dist*s*Math.sin(a),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*s*i)),t.x=n,t.y=h,t}function uh(t){var e,s,a,i,r,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),s=Math.sin(i),a=Math.cos(i),o=Dt(a*this.sin_p14+t.y*s*this.cos_p14/e),r=Math.atan2(t.x*s,e*this.cos_p14*a-t.y*this.sin_p14*s),r=G(this.long0+r,this.over)):(o=this.phic0,r=0),t.x=r,t.y=o,t}var ch=["gnom"];const fh={init:hh,forward:lh,inverse:uh,names:ch};function gh(t,e){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-s)<1e-6)return e<0?-1*P:P;for(var a=Math.asin(.5*e),i,r,o,n,h=0;h<30;h++)if(r=Math.sin(a),o=Math.cos(a),n=t*r,i=Math.pow(1-n*n,2)/(2*o)*(e/(1-t*t)-r/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),a+=i,Math.abs(i)<=1e-10)return a;return NaN}function vh(){this.sphere||(this.k0=Lt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function dh(t){var e=t.x,s=t.y,a,i,r=G(e-this.long0,this.over);if(this.sphere)a=this.x0+this.a*r*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var o=Ct(this.e,Math.sin(s));a=this.x0+this.a*this.k0*r,i=this.y0+this.a*o*.5/this.k0}return t.x=a,t.y=i,t}function _h(t){t.x-=this.x0,t.y-=this.y0;var e,s;return this.sphere?(e=G(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=gh(this.e,2*t.y*this.k0/this.a),e=G(this.long0+t.x/(this.a*this.k0),this.over)),t.x=e,t.y=s,t}var Mh=["cea"];const mh={init:vh,forward:dh,inverse:_h,names:Mh};function yh(){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 wh(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i=Ut(s-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*i,t}function Eh(t){var e=t.x,s=t.y;return t.x=G(this.long0+(e-this.x0)/(this.a*this.rc),this.over),t.y=Ut(this.lat0+(s-this.y0)/this.a),t}var Sh=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const Ph={init:yh,forward:wh,inverse:Eh,names:Sh};var Fa=20;function ph(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=$e(this.es),this.e1=De(this.es),this.e2=Ue(this.es),this.e3=Be(this.es),this.ml0=this.a*vt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function xh(t){var e=t.x,s=t.y,a,i,r,o=G(e-this.long0,this.over);if(r=o*Math.sin(s),this.sphere)Math.abs(s)<=x?(a=this.a*o,i=-1*this.a*this.lat0):(a=this.a*Math.sin(r)/Math.tan(s),i=this.a*(Ut(s-this.lat0)+(1-Math.cos(r))/Math.tan(s)));else if(Math.abs(s)<=x)a=this.a*o,i=-1*this.ml0;else{var n=aa(this.a,this.e,Math.sin(s))/Math.tan(s);a=n*Math.sin(r),i=this.a*vt(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+n*(1-Math.cos(r))}return t.x=a+this.x0,t.y=i+this.y0,t}function bh(t){var e,s,a,i,r,o,n,h,l;if(a=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=x)e=G(a/this.a+this.long0,this.over),s=0;else{o=this.lat0+i/this.a,n=a*a/this.a/this.a+o*o,h=o;var g;for(r=Fa;r;--r)if(g=Math.tan(h),l=-1*(o*(h*g+1)-h-.5*(h*h+n)*g)/((h-o)/g-1),h+=l,Math.abs(l)<=x){s=h;break}e=G(this.long0+Math.asin(a*Math.tan(h)/this.a)/Math.sin(s),this.over)}else if(Math.abs(i+this.ml0)<=x)s=0,e=G(this.long0+a/this.a,this.over);else{o=(this.ml0+i)/this.a,n=a*a/this.a/this.a+o*o,h=o;var f,u,m,w,E;for(r=Fa;r;--r)if(E=this.e*Math.sin(h),f=Math.sqrt(1-E*E)*Math.tan(h),u=this.a*vt(this.e0,this.e1,this.e2,this.e3,h),m=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),w=u/this.a,l=(o*(f*w+1)-w-.5*f*(w*w+n))/(this.es*Math.sin(2*h)*(w*w+n-2*o*w)/(4*f)+(o-w)*(f*m-2/Math.sin(2*h))-m),h-=l,Math.abs(l)<=x){s=h;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),e=G(this.long0+Math.asin(a*f/this.a)/Math.sin(s),this.over)}return t.x=e,t.y=s,t}var Gh=["Polyconic","American_Polyconic","poly"];const Nh={init:ph,forward:xh,inverse:bh,names:Gh};function Ah(){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 Ih(t){var e,s=t.x,a=t.y,i=a-this.lat0,r=s-this.long0,o=i/Ae*1e-5,n=r,h=1,l=0;for(e=1;e<=10;e++)h=h*o,l=l+this.A[e]*h;var g=l,f=n,u=1,m=0,w,E,S=0,b=0;for(e=1;e<=6;e++)w=u*g-m*f,E=m*g+u*f,u=w,m=E,S=S+this.B_re[e]*u-this.B_im[e]*m,b=b+this.B_im[e]*u+this.B_re[e]*m;return t.x=b*this.a+this.x0,t.y=S*this.a+this.y0,t}function Ch(t){var e,s=t.x,a=t.y,i=s-this.x0,r=a-this.y0,o=r/this.a,n=i/this.a,h=1,l=0,g,f,u=0,m=0;for(e=1;e<=6;e++)g=h*o-l*n,f=l*o+h*n,h=g,l=f,u=u+this.C_re[e]*h-this.C_im[e]*l,m=m+this.C_im[e]*h+this.C_re[e]*l;for(var w=0;w<this.iterations;w++){var E=u,S=m,b,A,I=o,R=n;for(e=2;e<=6;e++)b=E*u-S*m,A=S*u+E*m,E=b,S=A,I=I+(e-1)*(this.B_re[e]*E-this.B_im[e]*S),R=R+(e-1)*(this.B_im[e]*E+this.B_re[e]*S);E=1,S=0;var j=this.B_re[1],O=this.B_im[1];for(e=2;e<=6;e++)b=E*u-S*m,A=S*u+E*m,E=b,S=A,j=j+e*(this.B_re[e]*E-this.B_im[e]*S),O=O+e*(this.B_im[e]*E+this.B_re[e]*S);var F=j*j+O*O;u=(I*j+R*O)/F,m=(R*j-I*O)/F}var K=u,W=m,dt=1,ht=0;for(e=1;e<=9;e++)dt=dt*K,ht=ht+this.D[e]*dt;var D=this.lat0+ht*Ae*1e5,_t=this.long0+W;return t.x=_t,t.y=D,t}var Lh=["New_Zealand_Map_Grid","nzmg"];const Rh={init:Ah,forward:Ih,inverse:Ch,names:Lh};function Th(){}function Oh(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i=this.x0+this.a*a,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;return t.x=i,t.y=r,t}function Fh(t){t.x-=this.x0,t.y-=this.y0;var e=G(this.long0+t.x/this.a,this.over),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=s,t}var jh=["Miller_Cylindrical","mill"];const kh={init:Th,forward:Oh,inverse:Fh,names:jh};var qh=20;function $h(){this.long0=this.long0||0,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=Ks(this.es)}function fi(t){var e,s,a=t.x,i=t.y;if(a=G(a-this.long0,this.over),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var r=this.n*Math.sin(i),o=qh;o;--o){var n=(this.m*i+Math.sin(i)-r)/(this.m+Math.cos(i));if(i-=n,Math.abs(n)<x)break}e=this.a*this.C_x*a*(this.m+Math.cos(i)),s=this.a*this.C_y*i}else{var h=Math.sin(i),l=Math.cos(i);s=this.a*ce(i,h,l,this.en),e=this.a*a*l/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=s,t}function gi(t){var e,s,a,i;return t.x-=this.x0,a=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,a=a/(this.C_x*(this.m+Math.cos(e))),this.m?e=Dt((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=Dt(Math.sin(e)/this.n)),a=G(a+this.long0,this.over),e=Ut(e)):(e=Zs(t.y/this.a,this.es,this.en),i=Math.abs(e),i<P?(i=Math.sin(e),s=this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),a=G(s,this.over)):i-x<P&&(a=this.long0)),t.x=a,t.y=e,t}var Dh=["Sinusoidal","sinu"];const Uh={init:$h,forward:fi,inverse:gi,names:Dh};function Bh(){this.sphere=!0,this.b=this.a,this.m=1,this.n=2.5707963267948966,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)}var zh=fi,Wh=gi,Vh=["Eckert_VI","eck6"];const Hh={init:Bh,forward:zh,inverse:Wh,names:Vh};function Qh(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function Jh(t){for(var e=t.x,s=t.y,a=G(e-this.long0,this.over),i=s,r=Math.PI*Math.sin(s);;){var o=-(i+Math.sin(i)-r)/(1+Math.cos(i));if(i+=o,Math.abs(o)<x)break}i/=2,Math.PI/2-Math.abs(s)<x&&(a=0);var n=.900316316158*this.a*a*Math.cos(i)+this.x0,h=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=n,t.y=h,t}function Xh(t){var e,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),e=Math.asin(s);var a=G(this.long0+t.x/(.900316316158*this.a*Math.cos(e)),this.over);a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),s=(2*e+Math.sin(2*e))/Math.PI,Math.abs(s)>1&&(s=1);var i=Math.asin(s);return t.x=a,t.y=i,t}var Kh=["Mollweide","moll"];const Zh={init:Qh,forward:Jh,inverse:Xh,names:Kh};function Yh(){Math.abs(this.lat1+this.lat2)<x||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=$e(this.es),this.e1=De(this.es),this.e2=Ue(this.es),this.e3=Be(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Lt(this.e,this.sin_phi,this.cos_phi),this.ml1=vt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<x?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Lt(this.e,this.sin_phi,this.cos_phi),this.ml2=vt(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=vt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function t0(t){var e=t.x,s=t.y,a;if(this.sphere)a=this.a*(this.g-s);else{var i=vt(this.e0,this.e1,this.e2,this.e3,s);a=this.a*(this.g-i)}var r=this.ns*G(e-this.long0,this.over),o=this.x0+a*Math.sin(r),n=this.y0+this.rh-a*Math.cos(r);return t.x=o,t.y=n,t}function e0(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,s,a,i;this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var r=0;if(s!==0&&(r=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=G(this.long0+r/this.ns,this.over),a=Ut(this.g-s/this.a),t.x=i,t.y=a,t;var o=this.g-s/this.a;return a=ms(o,this.e0,this.e1,this.e2,this.e3),i=G(this.long0+r/this.ns,this.over),t.x=i,t.y=a,t}var s0=["Equidistant_Conic","eqdc"];const a0={init:Yh,forward:t0,inverse:e0,names:s0};function i0(){this.R=this.a}function r0(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i,r;Math.abs(s)<=x&&(i=this.x0+this.R*a,r=this.y0);var o=Dt(2*Math.abs(s/Math.PI));(Math.abs(a)<=x||Math.abs(Math.abs(s)-P)<=x)&&(i=this.x0,s>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*o):r=this.y0+Math.PI*this.R*-Math.tan(.5*o));var n=.5*Math.abs(Math.PI/a-a/Math.PI),h=n*n,l=Math.sin(o),g=Math.cos(o),f=g/(l+g-1),u=f*f,m=f*(2/l-1),w=m*m,E=Math.PI*this.R*(n*(f-w)+Math.sqrt(h*(f-w)*(f-w)-(w+h)*(u-w)))/(w+h);a<0&&(E=-E),i=this.x0+E;var S=h+f;return E=Math.PI*this.R*(m*S-n*Math.sqrt((w+h)*(h+1)-S*S))/(w+h),s>=0?r=this.y0+E:r=this.y0-E,t.x=i,t.y=r,t}function n0(t){var e,s,a,i,r,o,n,h,l,g,f,u,m;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,a=t.x/f,i=t.y/f,r=a*a+i*i,o=-Math.abs(i)*(1+r),n=o-2*i*i+a*a,h=-2*o+1+2*i*i+r*r,m=i*i/h+(2*n*n*n/h/h/h-9*o*n/h/h)/27,l=(o-n*n/3/h)/h,g=2*Math.sqrt(-l/3),f=3*m/l/g,Math.abs(f)>1&&(f>=0?f=1:f=-1),u=Math.acos(f)/3,t.y>=0?s=(-g*Math.cos(u+Math.PI/3)-n/3/h)*Math.PI:s=-(-g*Math.cos(u+Math.PI/3)-n/3/h)*Math.PI,Math.abs(a)<x?e=this.long0:e=G(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(a*a-i*i)+r*r))/2/a,this.over),t.x=e,t.y=s,t}var o0=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const h0={init:i0,forward:r0,inverse:n0,names:o0};function l0(t,e,s,a,i,r){const o=a-e,n=Math.atan((1-r)*Math.tan(t)),h=Math.atan((1-r)*Math.tan(s)),l=Math.sin(n),g=Math.cos(n),f=Math.sin(h),u=Math.cos(h);let m=o,w,E=100,S,b,A,I,R,j,O,F,K,W,dt,ht,D,_t;do{if(S=Math.sin(m),b=Math.cos(m),A=Math.sqrt(u*S*(u*S)+(g*f-l*u*b)*(g*f-l*u*b)),A===0)return{azi1:0,s12:0};I=l*f+g*u*b,R=Math.atan2(A,I),j=g*u*S/A,O=1-j*j,F=O!==0?I-2*l*f/O:0,K=r/16*O*(4+r*(4-3*O)),w=m,m=o+(1-K)*r*j*(R+K*A*(F+K*I*(-1+2*F*F)))}while(Math.abs(m-w)>1e-12&&--E>0);return E===0?{azi1:NaN,s12:NaN}:(W=O*(i*i-i*(1-r)*(i*(1-r)))/(i*(1-r)*(i*(1-r))),dt=1+W/16384*(4096+W*(-768+W*(320-175*W))),ht=W/1024*(256+W*(-128+W*(74-47*W))),D=ht*A*(F+ht/4*(I*(-1+2*F*F)-ht/6*F*(-3+4*A*A)*(-3+4*F*F))),_t=i*(1-r)*dt*(R-D),{azi1:Math.atan2(u*S,g*f-l*u*b),s12:_t})}function u0(t,e,s,a,i,r){const o=Math.atan((1-r)*Math.tan(t)),n=Math.sin(o),h=Math.cos(o),l=Math.sin(s),g=Math.cos(s),f=Math.atan2(n,h*g),u=h*l,m=1-u*u,w=m*(i*i-i*(1-r)*(i*(1-r)))/(i*(1-r)*(i*(1-r))),E=1+w/16384*(4096+w*(-768+w*(320-175*w))),S=w/1024*(256+w*(-128+w*(74-47*w)));let b=a/(i*(1-r)*E),A,I=100,R,j,O,F;do R=Math.cos(2*f+b),j=Math.sin(b),O=Math.cos(b),F=S*j*(R+S/4*(O*(-1+2*R*R)-S/6*R*(-3+4*j*j)*(-3+4*R*R))),A=b,b=a/(i*(1-r)*E)+F;while(Math.abs(b-A)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const K=n*j-h*O*g,W=Math.atan2(n*O+h*j*g,(1-r)*Math.sqrt(u*u+K*K)),dt=Math.atan2(j*l,h*O-n*j*g),ht=r/16*m*(4+r*(4-3*m)),D=dt-(1-ht)*r*u*(b+ht*j*(R+ht*O*(-1+2*R*R))),_t=e+D;return{lat2:W,lon2:_t}}function c0(){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 f0(t){var e=t.x,s=t.y,a=Math.sin(t.y),i=Math.cos(t.y),r=G(e-this.long0,this.over),o,n,h,l,g,f,u,m,w,E,S;return this.sphere?Math.abs(this.sin_p12-1)<=x?(t.x=this.x0+this.a*(P-s)*Math.sin(r),t.y=this.y0-this.a*(P-s)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(t.x=this.x0+this.a*(P+s)*Math.sin(r),t.y=this.y0+this.a*(P+s)*Math.cos(r),t):(w=this.sin_p12*a+this.cos_p12*i*Math.cos(r),u=Math.acos(w),m=u?u/Math.sin(u):1,t.x=this.x0+this.a*m*i*Math.sin(r),t.y=this.y0+this.a*m*(this.cos_p12*a-this.sin_p12*i*Math.cos(r)),t):(o=$e(this.es),n=De(this.es),h=Ue(this.es),l=Be(this.es),Math.abs(this.sin_p12-1)<=x?(g=this.a*vt(o,n,h,l,P),f=this.a*vt(o,n,h,l,s),t.x=this.x0+(g-f)*Math.sin(r),t.y=this.y0-(g-f)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(g=this.a*vt(o,n,h,l,P),f=this.a*vt(o,n,h,l,s),t.x=this.x0+(g+f)*Math.sin(r),t.y=this.y0+(g+f)*Math.cos(r),t):Math.abs(e)<x&&Math.abs(s-this.lat0)<x?(t.x=t.y=0,t):(E=l0(this.lat0,this.long0,s,e,this.a,this.f),S=E.azi1,t.x=E.s12*Math.sin(S),t.y=E.s12*Math.cos(S),t))}function g0(t){t.x-=this.x0,t.y-=this.y0;var e,s,a,i,r,o,n,h,l,g,f,u,m,w,E,S;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*P*this.a?void 0:(s=e/this.a,a=Math.sin(s),i=Math.cos(s),r=this.long0,Math.abs(e)<=x?o=this.lat0:(o=Dt(i*this.sin_p12+t.y*a*this.cos_p12/e),n=Math.abs(this.lat0)-P,Math.abs(n)<=x?this.lat0>=0?r=G(this.long0+Math.atan2(t.x,-t.y),this.over):r=G(this.long0-Math.atan2(-t.x,t.y),this.over):r=G(this.long0+Math.atan2(t.x*a,e*this.cos_p12*i-t.y*this.sin_p12*a),this.over)),t.x=r,t.y=o,t)):(h=$e(this.es),l=De(this.es),g=Ue(this.es),f=Be(this.es),Math.abs(this.sin_p12-1)<=x?(u=this.a*vt(h,l,g,f,P),e=Math.sqrt(t.x*t.x+t.y*t.y),m=u-e,o=ms(m/this.a,h,l,g,f),r=G(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=r,t.y=o,t):Math.abs(this.sin_p12+1)<=x?(u=this.a*vt(h,l,g,f,P),e=Math.sqrt(t.x*t.x+t.y*t.y),m=e-u,o=ms(m/this.a,h,l,g,f),r=G(this.long0+Math.atan2(t.x,t.y),this.over),t.x=r,t.y=o,t):(w=Math.atan2(t.x,t.y),E=Math.sqrt(t.x*t.x+t.y*t.y),S=u0(this.lat0,this.long0,w,E,this.a,this.f),t.x=S.lon2,t.y=S.lat2,t))}var v0=["Azimuthal_Equidistant","aeqd"];const d0={init:c0,forward:f0,inverse:g0,names:v0};function _0(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function M0(t){var e,s,a,i,r,o,n,h,l=t.x,g=t.y;return a=G(l-(this.long0||0),this.over),e=Math.sin(g),s=Math.cos(g),i=Math.cos(a),o=this.sin_p14*e+this.cos_p14*s*i,r=1,(o>0||Math.abs(o)<=x)&&(n=this.a*r*s*Math.sin(a),h=(this.y0||0)+this.a*r*(this.cos_p14*e-this.sin_p14*s*i)),t.x=n,t.y=h,t}function m0(t){var e,s,a,i,r,o,n,h,l;return t.x-=this.x0||0,t.y-=this.y0||0,e=Math.sqrt(t.x*t.x+t.y*t.y),s=Dt(e/this.a),a=Math.sin(s),i=Math.cos(s),h=this.long0||0,l=this.lat0||0,o=h,Math.abs(e)<=x?(n=l,t.x=o,t.y=n,t):(n=Dt(i*this.sin_p14+t.y*a*this.cos_p14/e),r=Math.abs(l)-P,Math.abs(r)<=x?(l>=0?o=G(h+Math.atan2(t.x,-t.y),this.over):o=G(h-Math.atan2(-t.x,t.y),this.over),t.x=o,t.y=n,t):(o=G(h+Math.atan2(t.x*a,e*this.cos_p14*i-t.y*this.sin_p14*a),this.over),t.x=o,t.y=n,t))}var y0=["ortho"];const w0={init:_0,forward:M0,inverse:m0,names:y0};var X={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},B={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function E0(){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>=P-U/2?this.face=X.TOP:this.lat0<=-(P-U/2)?this.face=X.BOTTOM:Math.abs(this.long0)<=U?this.face=X.FRONT:Math.abs(this.long0)<=P+U?this.face=this.long0>0?X.RIGHT:X.LEFT:this.face=X.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 S0(t){var e={x:0,y:0},s,a,i,r,o,n,h={value:0};if(t.x-=this.long0,this.es!==0?s=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):s=t.y,a=t.x,this.face===X.TOP)r=P-s,a>=U&&a<=P+U?(h.value=B.AREA_0,i=a-P):a>P+U||a<=-(P+U)?(h.value=B.AREA_1,i=a>0?a-tt:a+tt):a>-(P+U)&&a<=-U?(h.value=B.AREA_2,i=a+P):(h.value=B.AREA_3,i=a);else if(this.face===X.BOTTOM)r=P+s,a>=U&&a<=P+U?(h.value=B.AREA_0,i=-a+P):a<U&&a>=-U?(h.value=B.AREA_1,i=-a):a<-U&&a>=-(P+U)?(h.value=B.AREA_2,i=-a-P):(h.value=B.AREA_3,i=a>0?-a+tt:-a-tt);else{var l,g,f,u,m,w,E;this.face===X.RIGHT?a=he(a,+P):this.face===X.BACK?a=he(a,+tt):this.face===X.LEFT&&(a=he(a,-P)),u=Math.sin(s),m=Math.cos(s),w=Math.sin(a),E=Math.cos(a),l=m*E,g=m*w,f=u,this.face===X.FRONT?(r=Math.acos(l),i=os(r,f,g,h)):this.face===X.RIGHT?(r=Math.acos(g),i=os(r,f,-l,h)):this.face===X.BACK?(r=Math.acos(-l),i=os(r,f,-g,h)):this.face===X.LEFT?(r=Math.acos(-g),i=os(r,f,l,h)):(r=i=0,h.value=B.AREA_0)}return n=Math.atan(12/tt*(i+Math.acos(Math.sin(i)*Math.cos(U))-P)),o=Math.sqrt((1-Math.cos(r))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(i))))),h.value===B.AREA_1?n+=P:h.value===B.AREA_2?n+=tt:h.value===B.AREA_3&&(n+=1.5*tt),e.x=o*Math.cos(n),e.y=o*Math.sin(n),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function P0(t){var e={lam:0,phi:0},s,a,i,r,o,n,h,l,g,f={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,a=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),s=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?f.value=B.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(f.value=B.AREA_1,s-=P):t.x<0&&-t.x>=Math.abs(t.y)?(f.value=B.AREA_2,s=s<0?s+tt:s-tt):(f.value=B.AREA_3,s+=P),g=tt/12*Math.tan(s),o=Math.sin(g)/(Math.cos(g)-1/Math.sqrt(2)),n=Math.atan(o),i=Math.cos(s),r=Math.tan(a),h=1-i*i*r*r*(1-Math.cos(Math.atan(1/Math.cos(n)))),h<-1?h=-1:h>1&&(h=1),this.face===X.TOP)l=Math.acos(h),e.phi=P-l,f.value===B.AREA_0?e.lam=n+P:f.value===B.AREA_1?e.lam=n<0?n+tt:n-tt:f.value===B.AREA_2?e.lam=n-P:e.lam=n;else if(this.face===X.BOTTOM)l=Math.acos(h),e.phi=l-P,f.value===B.AREA_0?e.lam=-n+P:f.value===B.AREA_1?e.lam=-n:f.value===B.AREA_2?e.lam=-n-P:e.lam=n<0?-n-tt:-n+tt;else{var u,m,w;u=h,g=u*u,g>=1?w=0:w=Math.sqrt(1-g)*Math.sin(n),g+=w*w,g>=1?m=0:m=Math.sqrt(1-g),f.value===B.AREA_1?(g=m,m=-w,w=g):f.value===B.AREA_2?(m=-m,w=-w):f.value===B.AREA_3&&(g=m,m=w,w=-g),this.face===X.RIGHT?(g=u,u=-m,m=g):this.face===X.BACK?(u=-u,m=-m):this.face===X.LEFT&&(g=u,u=m,m=-g),e.phi=Math.acos(-w)-P,e.lam=Math.atan2(m,u),this.face===X.RIGHT?e.lam=he(e.lam,-P):this.face===X.BACK?e.lam=he(e.lam,-tt):this.face===X.LEFT&&(e.lam=he(e.lam,+P))}if(this.es!==0){var E,S,b;E=e.phi<0?1:0,S=Math.tan(e.phi),b=this.b/Math.sqrt(S*S+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-b*b)/(this.one_minus_f*b)),E&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function os(t,e,s,a){var i;return t<x?(a.value=B.AREA_0,i=0):(i=Math.atan2(e,s),Math.abs(i)<=U?a.value=B.AREA_0:i>U&&i<=P+U?(a.value=B.AREA_1,i-=P):i>P+U||i<=-(P+U)?(a.value=B.AREA_2,i=i>=0?i-tt:i+tt):(a.value=B.AREA_3,i+=P)),i}function he(t,e){var s=t+e;return s<-tt?s+=Te:s>+tt&&(s-=Te),s}var p0=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const x0={init:E0,forward:S0,inverse:P0,names:p0};var Vs=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.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,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.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]],Ne=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],vi=.8487,di=1.3523,_i=yt/5,b0=1/_i,ne=18,ys=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},G0=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function N0(t,e,s,a){for(var i=e;a;--a){var r=t(i);if(i-=r,Math.abs(r)<s)break}return i}function A0(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function I0(t){var e=G(t.x-this.long0,this.over),s=Math.abs(t.y),a=Math.floor(s*_i);a<0?a=0:a>=ne&&(a=ne-1),s=yt*(s-b0*a);var i={x:ys(Vs[a],s)*e,y:ys(Ne[a],s)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*vi+this.x0,i.y=i.y*this.a*di+this.y0,i}function C0(t){var e={x:(t.x-this.x0)/(this.a*vi),y:Math.abs(t.y-this.y0)/(this.a*di)};if(e.y>=1)e.x/=Vs[ne][0],e.y=t.y<0?-P:P;else{var s=Math.floor(e.y*ne);for(s<0?s=0:s>=ne&&(s=ne-1);;)if(Ne[s][0]>e.y)--s;else if(Ne[s+1][0]<=e.y)++s;else break;var a=Ne[s],i=5*(e.y-a[0])/(Ne[s+1][0]-a[0]);i=N0(function(r){return(ys(a,r)-e.y)/G0(a,r)},i,x,100),e.x/=ys(Vs[s],i),e.y=(5*s+i)*Z,t.y<0&&(e.y=-e.y)}return e.x=G(e.x+this.long0,this.over),e}var L0=["Robinson","robin"];const R0={init:A0,forward:I0,inverse:C0,names:L0};function T0(){this.name="geocent"}function O0(t){var e=ti(t,this.es,this.a);return e}function F0(t){var e=ei(t,this.es,this.a,this.b);return e}var j0=["Geocentric","geocentric","geocent","Geocent"];const k0={init:T0,forward:O0,inverse:F0,names:j0};var ct={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},xe={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 q0(){if(Object.keys(xe).forEach(function(s){if(typeof this[s]=="undefined")this[s]=xe[s].def;else{if(xe[s].num&&isNaN(this[s]))throw new Error("Invalid parameter value, must be numeric "+s+" = "+this[s]);xe[s].num&&(this[s]=parseFloat(this[s]))}xe[s].degrees&&(this[s]=this[s]*Z)}.bind(this)),Math.abs(Math.abs(this.lat0)-P)<x?this.mode=this.lat0<0?ct.S_POLE:ct.N_POLE:Math.abs(this.lat0)<x?this.mode=ct.EQUIT:(this.mode=ct.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 new 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 t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function $0(t){t.x-=this.long0;var e=Math.sin(t.y),s=Math.cos(t.y),a=Math.cos(t.x),i,r;switch(this.mode){case ct.OBLIQ:r=this.sinph0*e+this.cosph0*s*a;break;case ct.EQUIT:r=s*a;break;case ct.S_POLE:r=-e;break;case ct.N_POLE:r=e;break}switch(r=this.pn1/(this.p-r),i=r*s*Math.sin(t.x),this.mode){case ct.OBLIQ:r*=this.cosph0*e-this.sinph0*s*a;break;case ct.EQUIT:r*=e;break;case ct.N_POLE:r*=-(s*a);break;case ct.S_POLE:r*=s*a;break}var o,n;return o=r*this.cg+i*this.sg,n=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-r*this.sg)*this.cw*n,r=o*n,t.x=i*this.a,t.y=r*this.a,t}function D0(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},s,a,i;i=1/(this.pn1-t.y*this.sw),s=this.pn1*t.x*i,a=this.pn1*t.y*this.cw*i,t.x=s*this.cg+a*this.sg,t.y=a*this.cg-s*this.sg;var r=mt(t.x,t.y);if(Math.abs(r)<x)e.x=0,e.y=t.y;else{var o,n;switch(n=1-r*r*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/r+r/this.pn1),o=Math.sqrt(1-n*n),this.mode){case ct.OBLIQ:e.y=Math.asin(o*this.sinph0+t.y*n*this.cosph0/r),t.y=(o-this.sinph0*Math.sin(e.y))*r,t.x*=n*this.cosph0;break;case ct.EQUIT:e.y=Math.asin(t.y*n/r),t.y=o*r,t.x*=n;break;case ct.N_POLE:e.y=Math.asin(o),t.y=-t.y;break;case ct.S_POLE:e.y=-Math.asin(o);break}e.x=Math.atan2(t.x,t.y)}return t.x=e.x+this.long0,t.y=e.y,t}var U0=["Tilted_Perspective","tpers"];const B0={init:q0,forward:$0,inverse:D0,names:U0};function z0(){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 new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function W0(t){var e=t.x,s=t.y,a,i,r,o;if(e=e-this.long0,this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var n=this.radius_p/mt(this.radius_p*Math.cos(s),Math.sin(s));if(i=n*Math.cos(e)*Math.cos(s),r=n*Math.sin(e)*Math.cos(s),o=n*Math.sin(s),(this.radius_g-i)*i-r*r-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/mt(o,a)),t.y=this.radius_g_1*Math.atan(o/a)):(t.x=this.radius_g_1*Math.atan(r/a),t.y=this.radius_g_1*Math.atan(o/mt(r,a)))}else this.shape==="sphere"&&(a=Math.cos(s),i=Math.cos(e)*a,r=Math.sin(e)*a,o=Math.sin(s),a=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/mt(o,a)),t.y=this.radius_g_1*Math.atan(o/a)):(t.x=this.radius_g_1*Math.atan(r/a),t.y=this.radius_g_1*Math.atan(o/mt(r,a))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function V0(t){var e=-1,s=0,a=0,i,r,o,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*mt(1,a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*mt(1,s));var h=a/this.radius_p;if(i=s*s+h*h+e*e,r=2*this.radius_g*e,o=r*r-4*i*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*i),e=this.radius_g+n*e,s*=n,a*=n,t.x=Math.atan2(s,e),t.y=Math.atan(a*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),i=s*s+a*a+e*e,r=2*this.radius_g*e,o=r*r-4*i*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*i),e=this.radius_g+n*e,s*=n,a*=n,t.x=Math.atan2(s,e),t.y=Math.atan(a*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var H0=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Q0={init:z0,forward:W0,inverse:V0,names:H0};var Ie=1.340264,Ce=-.081106,Le=893e-6,Re=.003796,ws=Math.sqrt(3)/2;function J0(){this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.es!==0&&(this.apa=ui(this.es),this.qp=Ct(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function X0(t){var e=G(t.x-this.long0,this.over),s=t.y,a=Math.sin(s);this.es!==0&&(a=Ct(this.e,a)/this.qp);var i=Math.asin(ws*a),r=i*i,o=r*r*r;return t.x=e*Math.cos(i)/(ws*(Ie+3*Ce*r+o*(7*Le+9*Re*r))),t.y=i*(Ie+Ce*r+o*(Le+Re*r)),this.es!==0&&(t.x*=this.rqda,t.y*=this.rqda),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function K0(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,this.es!==0&&(t.x/=this.rqda,t.y/=this.rqda);var e=1e-9,s=12,a=t.y,i,r,o,n,h,l;for(l=0;l<s&&(i=a*a,r=i*i*i,o=a*(Ie+Ce*i+r*(Le+Re*i))-t.y,n=Ie+3*Ce*i+r*(7*Le+9*Re*i),a-=h=o/n,!(Math.abs(h)<e));++l);return i=a*a,r=i*i*i,t.x=ws*t.x*(Ie+3*Ce*i+r*(7*Le+9*Re*i))/Math.cos(a),t.y=Math.asin(Math.sin(a)/ws),this.es!==0&&(t.y=ci(t.y,this.apa)),t.x=G(t.x+this.long0,this.over),t}var Z0=["eqearth","Equal Earth","Equal_Earth"];const Y0={init:J0,forward:X0,inverse:K0,names:Z0};var je=1e-10;function tl(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<je)throw new Error;this.es?(this.en=Ks(this.es),this.m1=ce(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=sl,this.forward=el):(Math.abs(this.phi1)+je>=P?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=il,this.forward=al)}function el(t){var e=G(t.x-(this.long0||0),this.over),s=t.y,a,i,r;return a=this.am1+this.m1-ce(s,i=Math.sin(s),r=Math.cos(s),this.en),i=r*e/(a*Math.sqrt(1-this.es*i*i)),t.x=a*Math.sin(i),t.y=this.am1-a*Math.cos(i),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function sl(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,s,a,i;if(s=mt(t.x,t.y=this.am1-t.y),i=Zs(this.am1+this.m1-s,this.es,this.en),(e=Math.abs(i))<P)e=Math.sin(i),a=s*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(i);else if(Math.abs(e-P)<=je)a=0;else throw new Error;return t.x=G(a+(this.long0||0),this.over),t.y=Ut(i),t}function al(t){var e=G(t.x-(this.long0||0),this.over),s=t.y,a,i;return i=this.cphi1+this.phi1-s,Math.abs(i)>je?(t.x=i*Math.sin(a=e*Math.cos(s)/i),t.y=this.cphi1-i*Math.cos(a)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function il(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,s,a=mt(t.x,t.y=this.cphi1-t.y);if(s=this.cphi1+this.phi1-a,Math.abs(s)>P)throw new Error;return Math.abs(Math.abs(s)-P)<=je?e=0:e=a*Math.atan2(t.x,t.y)/Math.cos(s),t.x=G(e+(this.long0||0),this.over),t.y=Ut(s),t}var rl=["bonne","Bonne (Werner lat_1=90)"];const nl={init:tl,names:rl},ja={OBLIQUE:{forward:cl,inverse:gl},TRANSVERSE:{forward:fl,inverse:vl}},Es={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 ol(){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=Xa.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=pt(t);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let s;const a=Object.keys(Es),i=n=>{if(typeof this[n]=="undefined")return;const h=parseFloat(this[n])*Z;if(isNaN(h))throw new Error("Invalid value for "+n+": "+this[n]);return h};for(let n=0;n<a.length;n++){const h=a[n],l=Es[h],g=Object.entries(l);if(g.some(([u])=>typeof this[u]!="undefined")){s=l;for(let u=0;u<g.length;u++){const[m,w]=g[u],E=i(m);if(typeof E=="undefined")throw new Error("Missing parameter: "+m+".");this[w]=E}break}}if(!s)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:r,phip:o}=ul(this,s);this.lamp=r,Math.abs(o)>x?(this.cphip=Math.cos(o),this.sphip=Math.sin(o),this.projectionType=ja.OBLIQUE):this.projectionType=ja.TRANSVERSE}function hl(t){return this.projectionType.forward(this,t)}function ll(t){return this.projectionType.inverse(this,t)}function ul(t,e){let s,a;if(e===Es.ROTATE){let i=t.oLongC,r=t.oLatC,o=t.oAlpha;if(Math.abs(Math.abs(r)-P)<=x)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");a=i+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(r)),s=Math.asin(Math.cos(r)*Math.sin(o))}else if(e===Es.NEW_POLE)a=t.oLongP,s=t.oLatP;else{let i=t.oLong1,r=t.oLat1,o=t.oLong2,n=t.oLat2,h=Math.abs(r);if(Math.abs(r)>P-x)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(n)>P-x)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(r-n)<x)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(h<x)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");a=Math.atan2(Math.cos(r)*Math.sin(n)*Math.cos(i)-Math.sin(r)*Math.cos(n)*Math.cos(o),Math.sin(r)*Math.cos(n)*Math.sin(o)-Math.cos(r)*Math.sin(n)*Math.sin(i)),s=Math.atan(-1*Math.cos(a-i)/Math.tan(r))}return{lamp:a,phip:s}}function cl(t,e){let{x:s,y:a}=e;s=G(s-t.long0,t.over);const i=Math.cos(s),r=Math.sin(a),o=Math.cos(a);e.x=G(Math.atan2(o*Math.sin(s),t.sphip*o*i+t.cphip*r)+t.lamp),e.y=Math.asin(t.sphip*r-t.cphip*o*i);const n=t.obliqueProjection.forward(e);return t.isIdentity&&(n.x*=yt,n.y*=yt),n}function fl(t,e){let{x:s,y:a}=e;s=G(s-t.long0,t.over);const i=Math.cos(a),r=Math.cos(s);e.x=G(Math.atan2(i*Math.sin(s),Math.sin(a))+t.lamp),e.y=Math.asin(-1*i*r);const o=t.obliqueProjection.forward(e);return t.isIdentity&&(o.x*=yt,o.y*=yt),o}function gl(t,e){t.isIdentity&&(e.x*=Z,e.y*=Z);const s=t.obliqueProjection.inverse(e);let{x:a,y:i}=s;if(a<Number.MAX_VALUE){a-=t.lamp;const r=Math.cos(a),o=Math.sin(i),n=Math.cos(i);e.x=Math.atan2(n*Math.sin(a),t.sphip*n*r-t.cphip*o),e.y=Math.asin(t.sphip*o+t.cphip*n*r)}return e.x=G(e.x+t.long0),e}function vl(t,e){t.isIdentity&&(e.x*=Z,e.y*=Z);const s=t.obliqueProjection.inverse(e);let{x:a,y:i}=s;if(a<Number.MAX_VALUE){const r=Math.cos(i);a-=t.lamp,e.x=Math.atan2(r*Math.sin(a),-1*Math.sin(i)),e.y=Math.asin(r*Math.cos(a))}return e.x=G(e.x+t.long0),e}var dl=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const _l={init:ol,forward:hl,inverse:ll,names:dl};function Ml(t){t.Proj.projections.add(ls),t.Proj.projections.add(us),t.Proj.projections.add(so),t.Proj.projections.add(fo),t.Proj.projections.add(mo),t.Proj.projections.add(Po),t.Proj.projections.add(Ao),t.Proj.projections.add(To),t.Proj.projections.add(qo),t.Proj.projections.add(zo),t.Proj.projections.add(eh),t.Proj.projections.add(oh),t.Proj.projections.add(fh),t.Proj.projections.add(mh),t.Proj.projections.add(Ph),t.Proj.projections.add(Nh),t.Proj.projections.add(Rh),t.Proj.projections.add(kh),t.Proj.projections.add(Uh),t.Proj.projections.add(Hh),t.Proj.projections.add(Zh),t.Proj.projections.add(a0),t.Proj.projections.add(h0),t.Proj.projections.add(d0),t.Proj.projections.add(w0),t.Proj.projections.add(x0),t.Proj.projections.add(R0),t.Proj.projections.add(k0),t.Proj.projections.add(B0),t.Proj.projections.add(Q0),t.Proj.projections.add(Y0),t.Proj.projections.add(nl),t.Proj.projections.add(_l)}const Ps=Object.assign(yn,{defaultDatum:"WGS84",Proj:pt,WGS84:new pt("WGS84"),Point:le,toPoint:Js,defs:ot,nadgrid:Kr,transform:mn,mgrs:wn,version:"__VERSION__"});Ml(Ps);try{let t=()=>new DecompressionStream("deflate-raw"),e=s=>new Response(s);t(),Mi=s=>e(e(s).body.pipeThrough(t())).arrayBuffer().then(a=>new Uint8Array(a))}catch(t){}var Mi,ka=new TextDecoder,qs=t=>{throw Error("but-unzip~"+t)};function*ml(t,e=Mi){let s=t.length-21,a=s-65536,i=new DataView(t.buffer,t.byteOffset),r=h=>i.getUint16(h+s,1),o=h=>i.getUint32(h+s,1),n=(h,l)=>t.subarray(s+=h,s+=l);for(;s>a&&(s=t.lastIndexOf(80,s-1))+1&&(t[s+1]-75||t[s+2]-5||t[s+3]-6););for(s<0&&qs(2),a=r(10),a-r(8)&&qs(3),s=o(16);a--;){let h=r(10),l=r(28),g=r(30),f=r(32),u=o(20),m=o(42),w=ka.decode(n(46,l)),E=ka.decode(n(g,f)),S=s,b;s=m,b=n(30+r(26)+r(28),u),yield{filename:w,comment:E,read:()=>h-8?h?qs(1):b:e(b)},s=S}}const yl=/.+\.(shp|dbf|json|prj|cpg)$/i,wl=t=>nt(void 0,null,function*(){const e={},s=[];for(const r of ml(t))yl.test(r.filename)&&s.push(Promise.resolve(r.read()).then(o=>e[r.filename]=o));yield Promise.all(s);const a={},i=new TextDecoder;for(const[r,o]of Object.entries(e))r.slice(-3).toLowerCase()==="shp"||r.slice(-3).toLowerCase()==="dbf"?a[r]=new DataView(o.buffer,o.byteOffset,o.byteLength):a[r]=i.decode(o);return a}),El=globalThis.URL,Sl=(t,e)=>{if(!e)return t;const s=new El(t);return s.pathname=`${s.pathname}.${e}`,s.href};function ke(t,e){return nt(this,null,function*(){const s=Sl(t,e),a=e==="prj"||e==="cpg";try{const i=yield fetch(s);if(i.status>399)throw new Error(i.statusText);if(a)return i.text();const r=yield i.arrayBuffer();return new DataView(r)}catch(i){if(a||e==="dbf")return!1;throw i}})}function Pl(t){let e=0,s=1;const a=t.length;let i,r;const o=[t[0][0],t[0][1],t[0][0],t[0][1]];for(;s<a;)i=r||t[0],r=t[s],e+=(r[0]-i[0])*(r[1]+i[1]),s++,r[0]<o[0]&&(o[0]=r[0]),r[1]<o[1]&&(o[1]=r[1]),r[0]>o[2]&&(o[2]=r[0]),r[1]>o[3]&&(o[3]=r[1]);return{ring:t,clockWise:e>0,bbox:o,children:[]}}function qa(t,e){return!(t.bbox[0]>e.bbox[0]||t.bbox[1]>e.bbox[1]||t.bbox[2]<e.bbox[2]||t.bbox[3]<e.bbox[3])}function mi(t,e=!1){const s=[],a=[];for(const o of t){const n=Pl(o);n.clockWise!==e?s.push(n):a.push(n)}const i=[];for(const o of a){let n;for(const h of s)qa(h,o)&&(n?qa(n,h)&&(n=h):n=h);n?n.children.push(o.ring):i.push(o)}if(e)return{outers:s,orphens:i};if(i.length&&!e){const o=mi(t,!0);if(o.orphens.length===0){const n=[];for(const h of o.outers)n.push([h.ring.toReversed()].concat(h.children.map(l=>l.toReversed())));return n}}const r=[];for(const o of s)r.push([o.ring].concat(o.children));return r}et.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}};et.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.getFloat64(16,!0)),e};et.prototype.parsePointArray=function(t,e,s){const a=[];let i=0;for(;i<s;)a.push(this.parseCoord(t,e)),e+=16,i++;return a};et.prototype.parseZPointArray=function(t,e,s,a){let i=0;for(;i<s;)a[i].push(t.getFloat64(e,!0)),i++,e+=8;return a};et.prototype.parseArrayGroup=function(t,e,s,a,i){const r=[];let o=0,n,h=0,l;for(;o<a;)o++,s+=4,n=h,o===a?h=i:h=t.getInt32(s,!0),l=h-n,l&&(r.push(this.parsePointArray(t,e,l)),e+=l<<4);return r};et.prototype.parseZArrayGroup=function(t,e,s,a){let i=0;for(;i<s;)a[i]=this.parseZPointArray(t,e,a[i].length,a[i]),e+=a[i].length<<3,i++;return a};et.prototype.parseMultiPoint=function(t){const e={},s=t.getInt32(32,!0);if(!s)return null;const a=this.parseCoord(t,0),i=this.parseCoord(t,16);e.bbox=[a[0],a[1],i[0],i[1]];const r=36;return s===1?(e.type="Point",e.coordinates=this.parseCoord(t,r)):(e.type="MultiPoint",e.coordinates=this.parsePointArray(t,r,s)),e};et.prototype.parseZMultiPoint=function(t){const e=this.parseMultiPoint(t);if(!e)return null;let s;if(e.type==="Point")return e.coordinates.push(t.getFloat64(72,!0)),e;s=e.coordinates.length;const a=52+(s<<4);return e.coordinates=this.parseZPointArray(t,a,s,e.coordinates),e};et.prototype.parsePolyline=function(t){const e={},s=t.getInt32(32,!0);if(!s)return null;const a=this.parseCoord(t,0),i=this.parseCoord(t,16);e.bbox=[a[0],a[1],i[0],i[1]];const r=t.getInt32(36,!0);let o,n;return s===1?(e.type="LineString",o=44,e.coordinates=this.parsePointArray(t,o,r)):(e.type="MultiLineString",o=40+(s<<2),n=40,e.coordinates=this.parseArrayGroup(t,o,n,s,r)),e};et.prototype.parseZPolyline=function(t){const e=this.parsePolyline(t);if(!e)return null;const s=e.coordinates.length;let a;return e.type==="LineString"?(a=60+(s<<4),e.coordinates=this.parseZPointArray(t,a,s,e.coordinates),e):(a=56+(e.coordinates.reduce(function(r,o){return r+o.length},0)<<4)+(s<<2),e.coordinates=this.parseZArrayGroup(t,a,s,e.coordinates),e)};et.prototype.polyFuncs=function(t){return t&&(t.type==="LineString"?(t.type="Polygon",t.coordinates=[t.coordinates],t):(t.coordinates=mi(t.coordinates),t.coordinates.length===1?(t.type="Polygon",t.coordinates=t.coordinates[0],t):(t.type="MultiPolygon",t)))};et.prototype.parsePolygon=function(t){return this.polyFuncs(this.parsePolyline(t))};et.prototype.parseZPolygon=function(t){return this.polyFuncs(this.parseZPolyline(t))};const $a={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};function pl(t){return t?function(e,s){const a=[e.getFloat64(s,!0),e.getFloat64(s+8,!0)];return t.inverse(a)}:function(e,s){return[e.getFloat64(s,!0),e.getFloat64(s+8,!0)]}}function et(t,e){if(!(this instanceof et))return new et(t,e);this.buffer=t,this.headers=this.parseHeader(),this.shpFuncs(e),this.rows=this.getRows()}et.prototype.shpFuncs=function(t){let e=this.headers.shpCode;if(e>20&&(e-=20),!(e in $a))throw new Error(`I don't know shp type "${e}"`);this.parseFunc=this[$a[e]],this.parseCoord=pl(t)};et.prototype.getShpCode=function(){return this.parseHeader().shpCode};et.prototype.parseHeader=function(){const t=this.buffer;return{length:t.getInt32(24)<<1,version:t.getInt32(28,!0),shpCode:t.getInt32(32,!0),bbox:[t.getFloat64(36,!0),t.getFloat64(44,!0),t.getFloat64(52,!0),t.getFloat64(60,!0)]}};et.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength-8,s=[];let a;for(;t<=e&&(a=this.getRow(t),!!a);)t+=8,t+=a.len,a.type?s.push(this.parseFunc(a.data)):s.push(null);return s};et.prototype.getRow=function(t){const e=this.buffer.getInt32(t),s=this.buffer.getInt32(t+4)<<1;if(s===0)return{id:e,len:s,type:0};if(!(t+s+8>this.buffer.byteLength))return{id:e,len:s,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+t+12,s-4),type:this.buffer.getInt32(t+8,!0)}};function ia(t,e){return new et(t,e).rows}var xl=/^(?:ANSI\s)?(\d+)$/m;function yi(t,e){if(!t)return a;try{new TextDecoder(t.trim())}catch(i){var s=xl.exec(t);return s&&!e?yi("windows-"+s[1],!0):(t=void 0,a)}return a;function a(i){var r=new TextDecoder(t||void 0),o=r.decode(i,{stream:!0})+r.decode();return o.replace(/\0/g,"").trim()}}function bl(t){var e={};return e.lastUpdated=new Date(t.getUint8(1)+1900,t.getUint8(2),t.getUint8(3)),e.records=t.getUint32(4,!0),e.headerLen=t.getUint16(8,!0),e.recLen=t.getUint16(10,!0),e}function Gl(t,e,s){for(var a=[],i=32;i<e&&(a.push({name:s(new Uint8Array(t.buffer.slice(t.byteOffset+i,t.byteOffset+i+11))),dataType:String.fromCharCode(t.getUint8(i+11)),len:t.getUint8(i+16),decimal:t.getUint8(i+17)}),t.getUint8(i+32)!==13);)i+=32;return a}function Nl(t,e,s,a,i){const r=new Uint8Array(t.buffer.slice(t.byteOffset+e,t.byteOffset+e+s));var o=i(r);switch(a){case"N":case"F":case"O":return parseFloat(o,10);case"D":return new Date(o.slice(0,4),parseInt(o.slice(4,6),10)-1,o.slice(6,8));case"L":return o.toLowerCase()==="y"||o.toLowerCase()==="t";default:return o}}function Al(t,e,s,a){for(var i={},r=0,o=s.length,n,h;r<o;)h=s[r],n=Nl(t,e,h.len,h.dataType,a),e+=h.len,typeof n!="undefined"&&(i[h.name]=n),r++;return i}function ra(t,e){for(var s=yi(e),a=bl(t),i=Gl(t,a.headerLen-1,s),r=(i.length+1<<5)+2,o=a.recLen,n=a.records,h=[];n;)h.push(Al(t,r,i,s)),r+=o,n--;return h}const Il=globalThis.URL,Cl=t=>{if(!t)throw new Error("forgot to pass buffer");if(ue(t))return new Uint8Array(t);if(ue(t.buffer))return t.BYTES_PER_ELEMENT===1?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")},Ll=new TextDecoder,wi=t=>{if(t){if(typeof t=="string")return t;if(ue(t)||ArrayBuffer.isView(t)||na(t))return Ll.decode(t)}},Ei=t=>{if(!t)throw new Error("forgot to pass buffer");if(na(t))return t;if(ue(t))return new DataView(t);if(ue(t.buffer))return new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")};function ue(t){return t instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"}function na(t){return t instanceof globalThis.DataView||Object.prototype.toString.call(t)==="[object DataView]"}const oa=function([t,e]){const s={};s.type="FeatureCollection",s.features=[];let a=0;const i=t.length;for(e||(e=[]);a<i;)s.features.push({type:"Feature",geometry:t[a],properties:e[a]||{}}),a++;return s},Si=function(t,e){return nt(this,null,function*(){let s;t=Cl(t);const a=yield wl(t),i=[];e=e||[];for(s in a)s.indexOf("__MACOSX")===-1&&(s.slice(-4).toLowerCase()===".shp"?(i.push(s.slice(0,-4)),a[s.slice(0,-3)+s.slice(-3).toLowerCase()]=a[s]):s.slice(-4).toLowerCase()===".prj"?a[s.slice(0,-3)+s.slice(-3).toLowerCase()]=Ps(a[s]):s.slice(-5).toLowerCase()===".json"||e.indexOf(s.split(".").pop())>-1?i.push(s.slice(0,-3)+s.slice(-3).toLowerCase()):(s.slice(-4).toLowerCase()===".dbf"||s.slice(-4).toLowerCase()===".cpg")&&(a[s.slice(0,-3)+s.slice(-3).toLowerCase()]=a[s]));if(!i.length)throw new Error("no layers founds");const r=i.map(function(o){let n,h;const l=o.lastIndexOf(".");return l>-1&&o.slice(l).indexOf("json")>-1?(n=JSON.parse(a[o]),n.fileName=o.slice(0,l)):e.indexOf(o.slice(l+1))>-1?(n=a[o],n.fileName=o):(a[o+".dbf"]&&(h=ra(a[o+".dbf"],a[o+".cpg"])),n=oa([ia(a[o+".shp"],a[o+".prj"]),h]),n.fileName=o),n});return r.length===1?r[0]:r})};function Rl(t,e){return nt(this,null,function*(){const s=yield ke(t);return Si(s,e)})}const Tl=t=>nt(void 0,null,function*(){const e=yield Promise.all([ke(t,"shp"),ke(t,"prj")]);let s=!1;try{e[1]&&(s=Ps(e[1]))}catch(a){s=!1}return ia(e[0],s)}),Ol=t=>nt(void 0,null,function*(){const[e,s]=yield Promise.all([ke(t,"dbf"),ke(t,"cpg")]);if(e)return ra(e,s)}),Da=(t,e)=>{var a;return new Il(t,(a=globalThis==null?void 0:globalThis.document)==null?void 0:a.location).pathname.slice(-4).toLowerCase()===e},Fl=({shp:t,dbf:e,cpg:s,prj:a})=>{const i=[kl(t,a)];return e&&i.push(ql(e,s)),oa(i)},jl=function(t,e){return nt(this,null,function*(){if(typeof t!="string"){if(ue(t)||ArrayBuffer.isView(t)||na(t))return Si(t);if(t.shp)return Fl(t);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(Da(t,".zip"))return Rl(t,e);Da(t,".shp")&&(t=t.slice(0,-4));const s=yield Promise.all([Tl(t),Ol(t)]);return oa(s)})},kl=function(t,e){if(t=Ei(t),e=wi(e),typeof e=="string")try{e=Ps(e)}catch(s){e=!1}return ia(t,e)},ql=function(t,e){return t=Ei(t),e=wi(e),ra(t,e)};const $l={class:"engineering-analysis-panel"},Dl={class:"analysis-card-head"},Ul={key:0},Bl=["disabled"],zl=["disabled"],Wl={key:1,class:"analysis-drawing-stage"},Vl={class:"analysis-point-count"},Hl=["disabled"],Ql=["disabled"],Jl={key:2,class:"analysis-boundary-bar"},Xl={class:"analysis-card-head"},Kl={key:0,class:"analysis-running"},Zl={class:"analysis-conclusion-head"},Yl={class:"analysis-conclusion-tags"},t1={key:2,class:"analysis-empty is-success"},e1={key:3,class:"analysis-project-list"},s1=["onPointerup"],a1={class:"analysis-project-name"},i1={class:"analysis-project-meta"},r1={__name:"EngineeringAnalysisPanel",props:{drawingPointCount:{type:Number,default:0}},emits:["drawing-change","finish-drawing","undo-point","clear-boundary","analysis-result","focus-project"],setup(t,{expose:e,emit:s}){const a=t,i=s,r=Q(!1),o=Q(null),n=Q([]),h=Q([]),l=Q(""),g=Q("idle"),f=Q([]),u=Q("idle"),m=Q("");let w=null,E=0;const S=z(()=>{var p;const v=h.value.length,d=n.value.length,_=n.value.reduce((C,$)=>C+Number($.overlapAreaWanMu||0),0);return{boundaryAreaWanMu:me((p=o.value)==null?void 0:p.geometry),featureCount:v,projectCount:d,overlapAreaWanMu:_}}),b=z(()=>l.value?l.value:I.value?"自动分析中":g.value==="loading"?"项目库加载中":g.value==="error"?"项目库加载失败":""),A=z(()=>o.value?I.value?"正在分析":u.value==="error"?"分析异常":n.value.length?"已发现建设记录":"未发现建设记录":"未分析"),I=z(()=>u.value==="running"),R=z(()=>!!o.value&&u.value==="done"),j=z(()=>I.value?"正在自动分析":u.value==="error"?"分析失败":n.value.length?`命中 ${n.value.length}`:A.value),O=z(()=>r.value&&a.drawingPointCount>=3),F=z(()=>{if(!o.value)return{levelClass:"",verdict:"",summary:"",tags:[],advice:""};if(!n.value.length)return{levelClass:"is-clear",verdict:"未发现建设记录",summary:"该边界范围暂未与项目库中的已建设工程形成空间叠加。",tags:[`分析范围 ${we(S.value.boundaryAreaWanMu)} 万亩`,"项目库未命中"],advice:"可进入新增工程选址论证,仍需结合保护红线、审批台账和现场踏勘复核。"};const v=Ee(n.value),d=ts(n.value),_=[...n.value].sort(($,V)=>Number(V.overlapAreaWanMu||0)-Number($.overlapAreaWanMu||0))[0],p=Zt(S.value.overlapAreaWanMu),C=n.value.length>=6||S.value.overlapAreaWanMu>=1?"存在建设叠加":"存在局部叠加";return{levelClass:n.value.length>=6?"is-heavy":"is-hit",verdict:C,summary:`该边界命中 ${n.value.length} 个历史项目,叠加约 ${p} 亩,项目类型以${v.name}为主,年份集中在 ${d}`,tags:[`主类型 ${v.name}`,`年份 ${d}`,`最大叠加 ${Zt(_==null?void 0:_.overlapAreaWanMu)}`],advice:`重点复核“${Yt(_==null?void 0:_.projectName)}”(${(_==null?void 0:_.year)||"未知"}${(_==null?void 0:_.category)||"未知类型"})与拟建范围的重合边界。`}});Ua(()=>{ve().catch(()=>{})});function K(v){return nt(this,null,function*(){var _;const d=(_=v.target.files)==null?void 0:_[0];if(v.target.value="",!!d){l.value="";try{const p=yield W(d);r.value&&(r.value=!1,i("drawing-change",!1)),i("clear-boundary"),yield Bt(p)}catch(p){l.value="边界文件解析失败"}}})}function W(v){return nt(this,null,function*(){const d=String(v.name||"").toLowerCase();if(d.endsWith(".json")||d.endsWith(".geojson"))return dt(JSON.parse(yield v.text()));if(d.endsWith(".zip")){const _=yield jl(yield v.arrayBuffer());return dt(_)}throw new Error("unsupported file")})}function dt(v){const d=zt(v).filter(_=>He(_==null?void 0:_.geometry));if(d.length)return jt(d);throw new Error("no polygon")}function ht(){r.value||(E+=1,l.value="",u.value="idle",m.value="",r.value=!0,o.value=null,n.value=[],h.value=[],i("analysis-result",{boundary:null,matches:[],rows:[],summary:S.value}),i("drawing-change",!0))}function D(){r.value&&(E+=1,r.value=!1,u.value="idle",m.value="",i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:S.value}))}function _t(){O.value&&i("finish-drawing")}function fe(){i("undo-point")}function ps(){E+=1,r.value=!1,o.value=null,n.value=[],h.value=[],l.value="",u.value="idle",m.value="",i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:S.value})}function Nt(v){v!=null&&v.geometry&&(r.value=!1,Bt(v))}function Bt(v){return nt(this,null,function*(){const d=++E;o.value=v,h.value=[],n.value=[],m.value="",l.value="",u.value="running";let _=[];i("analysis-result",{boundary:v,matches:[],rows:[],summary:S.value});try{const p=yield ve();if(d!==E)return;_=ze(v,p),h.value=_,n.value=xs(_),u.value="done"}catch(p){if(d!==E)return;l.value="项目库加载失败",u.value="error"}d===E&&i("analysis-result",{boundary:v,matches:_,rows:n.value,summary:S.value})})}function ge(v){m.value=(v==null?void 0:v.key)||"",i("focus-project",kt(Tt({},v),{boundary:o.value}))}function ve(){return nt(this,null,function*(){return f.value.length?f.value:w||(g.value="loading",w=fetch(de("datas/ecological-protection/ecological_restoration_projects.geojson"),{credentials:"include"}).then(d=>{if(!d.ok)throw new Error(`HTTP ${d.status}`);return d.json()}).then(d=>{const _=zt(d).filter(p=>{var C;return(C=p==null?void 0:p.geometry)==null?void 0:C.coordinates}).map((p,C)=>kt(Tt({},p),{properties:kt(Tt({},p.properties||{}),{source_index:C})}));return f.value=_,g.value="success",_}).catch(d=>{throw g.value="error",w=null,d}),w)})}function de(v){return v?/^https?:\/\//.test(v)||v.startsWith("/")?v:`./${v}`:""}function zt(v){return v?Array.isArray(v)?v.flatMap(d=>zt(d)):v.type==="FeatureCollection"?(v.features||[]).filter(Boolean):v.type==="Feature"?v.geometry?[v]:[]:Qe(v)?[{type:"Feature",properties:{},geometry:v}]:typeof v=="object"?Object.values(v).flatMap(d=>zt(d)):[]:[]}function jt(v){const d=v.flatMap(_=>_.geometry.type==="Polygon"?[_.geometry.coordinates]:_.geometry.coordinates);return d.length===1?{type:"Feature",properties:v[0].properties||{},geometry:{type:"Polygon",coordinates:d[0]}}:{type:"Feature",properties:{sourceFeatureCount:v.length},geometry:{type:"MultiPolygon",coordinates:d}}}function ze(v,d=f.value){const _=Xe(v.geometry);return d.filter(p=>bs(p.geometry,v.geometry,_)).map(p=>({feature:p,properties:p.properties||{},overlapAreaWanMu:Gs(p,v.geometry)}))}function xs(v){const d=new Map;return v.forEach(_=>{const p=_.properties||{},C=p.project_name||p.projectName||"未命名项目",$=d.get(C)||{key:C,projectName:C,category:p.project_category||"未知类型",year:p.year||"未知",featureCount:0,overlapAreaWanMu:0,features:[],sourceIndex:Number(p.source_index||0)};$.featureCount+=1,$.overlapAreaWanMu+=Number(_.overlapAreaWanMu||0),$.features.push(_.feature),d.set(C,$)}),[...d.values()].map(_=>kt(Tt({},_),{overlapAreaWanMu:Number(_.overlapAreaWanMu.toFixed(4))}))}function bs(v,d,_){if(!Kt(Xe(v),_))return!1;const p=Wt(d);return p.length?He(v)?We(v,p):(v==null?void 0:v.type)==="Point"?Rt(v.coordinates,p):(v==null?void 0:v.type)==="MultiPoint"?v.coordinates.some(C=>Rt(C,p)):(v==null?void 0:v.type)==="LineString"?_e(v.coordinates,p):(v==null?void 0:v.type)==="MultiLineString"?v.coordinates.some(C=>_e(C,p)):!1:!1}function We(v,d){const _=Wt(v);return _.length?_.some(p=>p.some(C=>Rt(C,d)))||d.some(p=>p.some(C=>Rt(C,_)))||_.some(p=>d.some(C=>Je(p,C))):!1}function _e(v=[],d){return!Array.isArray(v)||!v.length?!1:v.some(_=>Rt(_,d))?!0:d.some(_=>Ve(v,_))}function Ve(v,d){for(let _=1;_<v.length;_+=1)for(let p=1;p<d.length;p+=1)if(Me(v[_-1],v[_],d[p-1],d[p]))return!0;return!1}function Gs(v,d){const _=v==null?void 0:v.geometry,p=Wt(_),C=Wt(d),$=Ke(v),V=me(d);if(!p.length||!C.length)return 0;const st=p.reduce((at,rt)=>at+rt.filter(xt=>Rt(xt,C)).length,0),it=p.reduce((at,rt)=>at+rt.length,0);return st?Number(($*Math.max(.08,Math.min(1,st/Math.max(it,1)))).toFixed(4)):C.reduce((at,rt)=>at+rt.filter(xt=>Rt(xt,p)).length,0)?Number(Math.min($,V).toFixed(4)):p.some(at=>C.some(rt=>Je(at,rt)))?Number((Math.min($,V)*.12).toFixed(4)):0}function Wt(v){var d;return(v==null?void 0:v.type)==="Polygon"?[((d=v.coordinates)==null?void 0:d[0])||[]]:(v==null?void 0:v.type)==="MultiPolygon"?v.coordinates.map(_=>(_==null?void 0:_[0])||[]).filter(_=>_.length):[]}function He(v){return(v==null?void 0:v.type)==="Polygon"||(v==null?void 0:v.type)==="MultiPolygon"}function Qe(v){return["Polygon","MultiPolygon","LineString","MultiLineString","Point","MultiPoint"].includes(v==null?void 0:v.type)}function Rt(v,d){return d.some(_=>Ns(v,_))}function Ns(v,d){var $,V,st,it;let _=!1;const p=Number(v==null?void 0:v[0]),C=Number(v==null?void 0:v[1]);for(let lt=0,at=d.length-1;lt<d.length;at=lt++){const rt=Number(($=d[lt])==null?void 0:$[0]),xt=Number((V=d[lt])==null?void 0:V[1]),Is=Number((st=d[at])==null?void 0:st[0]),Se=Number((it=d[at])==null?void 0:it[1]);xt>C!=Se>C&&p<(Is-rt)*(C-xt)/(Se-xt)+rt&&(_=!_)}return _}function Je(v,d){for(let _=1;_<v.length;_+=1)for(let p=1;p<d.length;p+=1)if(Me(v[_-1],v[_],d[p-1],d[p]))return!0;return!1}function Me(v,d,_,p){if(!As(v,d,_,p))return!1;const C=(lt,at,rt)=>(Number(at[0])-Number(lt[0]))*(Number(rt[1])-Number(lt[1]))-(Number(at[1])-Number(lt[1]))*(Number(rt[0])-Number(lt[0])),$=C(v,d,_),V=C(v,d,p),st=C(_,p,v),it=C(_,p,d);return $===0&&Xt(_,v,d)||V===0&&Xt(p,v,d)||st===0&&Xt(v,_,p)||it===0&&Xt(d,_,p)?!0:($>0&&V<0||$<0&&V>0)&&(st>0&&it<0||st<0&&it>0)}function As(v,d,_,p){const C=Ye([v,d]),$=Ye([_,p]);return Kt(C,$)}function Xt(v,d,_){const p=Number(v==null?void 0:v[0]),C=Number(v==null?void 0:v[1]),$=Number(d==null?void 0:d[0]),V=Number(d==null?void 0:d[1]),st=Number(_==null?void 0:_[0]),it=Number(_==null?void 0:_[1]),lt=(p-$)*(it-V)-(C-V)*(st-$);return Math.abs(lt)>1e-10?!1:p>=Math.min($,st)-1e-10&&p<=Math.max($,st)+1e-10&&C>=Math.min(V,it)-1e-10&&C<=Math.max(V,it)+1e-10}function Xe(v){const d=[];return Ze(v==null?void 0:v.coordinates,d),d.length?d.reduce((_,p)=>({minLng:Math.min(_.minLng,Number(p[0])),minLat:Math.min(_.minLat,Number(p[1])),maxLng:Math.max(_.maxLng,Number(p[0])),maxLat:Math.max(_.maxLat,Number(p[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY}):null}function Kt(v,d){return!v||!d?!1:!(v.maxLng<d.minLng||v.minLng>d.maxLng||v.maxLat<d.minLat||v.minLat>d.maxLat)}function Ke(v){return me(v==null?void 0:v.geometry)}function me(v){return(v==null?void 0:v.type)==="Polygon"?ye(v.coordinates):(v==null?void 0:v.type)==="MultiPolygon"?v.coordinates.reduce((d,_)=>d+ye(_),0):0}function ye(v=[]){const d=v[0]||[];if(d.length<3)return 0;const _=d.reduce((V,st)=>V+Number(st[1]||0),0)/d.length,p=111320*Math.cos(_*Math.PI/180),C=110540;let $=0;for(let V=0;V<d.length;V+=1){const st=d[V],it=d[(V+1)%d.length],lt=Number(st[0]||0)*p,at=Number(st[1]||0)*C,rt=Number(it[0]||0)*p,xt=Number(it[1]||0)*C;$+=lt*xt-rt*at}return Math.abs($)/2/666.6666667/1e4}function Ze(v,d){if(Array.isArray(v)){if(typeof v[0]=="number"&&typeof v[1]=="number"){d.push(v);return}v.forEach(_=>Ze(_,d))}}function Ye(v){return v.reduce((d,_)=>({minLng:Math.min(d.minLng,Number(_==null?void 0:_[0])),minLat:Math.min(d.minLat,Number(_==null?void 0:_[1])),maxLng:Math.max(d.maxLng,Number(_==null?void 0:_[0])),maxLat:Math.max(d.maxLat,Number(_==null?void 0:_[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY})}function we(v){const d=Number(v||0);return Number.isFinite(d)?Number(d.toFixed(d>=10?2:4)).toString():"0"}function Zt(v){const d=Number(v||0)*1e4;return Number.isFinite(d)?d>=1e3?Number(d.toFixed(0)).toLocaleString("zh-CN"):d>=10?Number(d.toFixed(1)).toLocaleString("zh-CN"):Number(d.toFixed(2)).toString():"0"}function Ee(v=[]){const d=new Map;return v.forEach(_=>{const p=_.category||"未知类型",C=d.get(p)||{name:p,count:0,area:0};C.count+=1,C.area+=Number(_.overlapAreaWanMu||0),d.set(p,C)}),[...d.values()].sort((_,p)=>p.area-_.area||p.count-_.count)[0]||{name:"未知类型",count:0,area:0}}function ts(v=[]){const d=v.map(C=>Number(C.year)).filter(C=>Number.isFinite(C));if(!d.length)return"未知年份";const _=Math.min(...d),p=Math.max(...d);return _===p?`${_}`:`${_}-${p}`}function Yt(v,d=18){const _=String(v||"未命名项目");return _.length>d?`${_.slice(0,d)}...`:_}return e({applyDrawnBoundary:Nt}),(v,d)=>(J(),Y("div",$l,[L("div",{class:Ot(["analysis-card analysis-workbench",{"is-running":I.value,"is-complete":R.value}])},[L("div",Dl,[d[0]||(d[0]=L("span",null,"生态工程分析",-1)),b.value?(J(),Y("strong",Ul,ut(b.value),1)):It("",!0)]),r.value?It("",!0):(J(),Y("div",{key:0,class:Ot(["analysis-operation",{"has-boundary":o.value}])},[L("label",{class:Ot(["analysis-entry is-upload",{"is-disabled":r.value||I.value}])},[L("input",{type:"file",accept:".zip,.json,.geojson",disabled:r.value||I.value,onChange:K},null,40,Bl),L("span",null,ut(o.value?"更换边界":"上传边界"),1),d[1]||(d[1]=L("strong",null,"SHP / GeoJSON",-1))],2),L("button",{type:"button",class:"analysis-entry is-draw",disabled:r.value||I.value,onPointerup:te(ht,["stop","prevent"])},[L("span",null,ut(o.value?"重新绘制":"在线绘制"),1),d[2]||(d[2]=L("strong",null,"地图圈定",-1))],40,zl)],2)),r.value?(J(),Y("div",Wl,[L("div",Vl,[d[3]||(d[3]=L("span",null,"已落点",-1)),L("strong",null,ut(t.drawingPointCount),1),d[4]||(d[4]=L("em",null,"点",-1)),d[5]||(d[5]=L("small",null,"至少 3 点",-1))]),L("button",{type:"button",class:"analysis-control is-primary",disabled:!O.value||I.value,onPointerup:te(_t,["stop","prevent"])}," 完成绘制 ",40,Hl),L("button",{type:"button",class:"analysis-control",disabled:!t.drawingPointCount,onPointerup:te(fe,["stop","prevent"])},"撤销",40,Ql),L("button",{type:"button",class:"analysis-control is-danger",onPointerup:te(D,["stop","prevent"])},"删除图形",32)])):o.value?(J(),Y("div",Jl,[d[6]||(d[6]=L("span",null,"边界已加载",-1)),L("strong",null,ut(j.value),1),L("button",{type:"button",onPointerup:te(ps,["stop","prevent"])},"删除图形",32)])):It("",!0)],2),o.value?(J(),Y("div",{key:0,class:Ot(["analysis-card analysis-result",{"is-running":I.value,"is-empty":R.value&&!n.value.length}])},[L("div",Xl,[d[7]||(d[7]=L("span",null,"建设记录核查",-1)),L("strong",null,ut(A.value),1)]),I.value?(J(),Y("div",Kl,[...d[8]||(d[8]=[L("div",{class:"analysis-running-orbit","aria-hidden":"true"},null,-1),L("div",null,[L("strong",null,"空间叠加分析中"),L("span",null,"正在核对边界与建设项目库")],-1)])])):(J(),Y("div",{key:1,class:Ot(["analysis-conclusion",F.value.levelClass])},[L("div",Zl,[d[9]||(d[9]=L("span",null,"分析结论",-1)),L("strong",null,ut(F.value.verdict),1)]),L("p",null,ut(F.value.summary),1),L("div",Yl,[(J(!0),Y(fs,null,gs(F.value.tags,_=>(J(),Y("span",{key:_},ut(_),1))),128))]),L("small",null,ut(F.value.advice),1)],2)),R.value&&!n.value.length?(J(),Y("div",t1,"该边界范围内暂未匹配到已建设项目")):R.value?(J(),Y("div",e1,[(J(!0),Y(fs,null,gs(n.value,_=>(J(),Y("button",{key:_.key,type:"button",class:Ot(["analysis-project-row",{"is-active":_.key===m.value}]),onPointerup:te(p=>ge(_),["stop","prevent"])},[L("span",a1,ut(_.projectName),1),L("div",i1,[L("strong",null,ut(_.year),1),L("em",null,ut(_.category),1),L("small",null,"叠加 "+ut(Zt(_.overlapAreaWanMu))+" 亩",1)]),L("b",null,ut(_.featureCount)+" 个要素",1)],42,s1))),128))])):It("",!0)],2)):It("",!0)]))}},n1=Xi(r1,[["__scopeId","data-v-96bdd213"]]);const o1={class:"forest-grass-wet ecological-protection"},h1={class:"forest-grass-wet-ui ecological-protection-ui"},l1={key:0,class:"fgw-left"},u1={class:"fgw-side-stack is-left"},c1={key:1,class:"fgw-right"},f1={class:"fgw-side-stack is-right"},g1={class:"fgw-bottom-topic ecological-bottom-topic"},v1={key:0,class:"loading"},d1={class:"loading-progress"},_1={class:"value"},R1={__name:"index",props:{activeView:{type:String,default:"ecological-redline"},showLoading:{type:Boolean,default:!0},active:{type:Boolean,default:!0}},emits:["module-stats","view-change"],setup(t,{expose:e,emit:s}){const a=t,i=s,r=Q(null),o=Q(null),n=Q(""),h=Q(""),l=Q(is({},"ecological-redline")),g=Q(null),f=Q(!1),u=Q(!1),m=Q(null),w=Q(0),E=Q(a.showLoading),S=Q(null),b=Q(0),A=Q({type:"idle",text:"等待生态保护图层加载"});let I=null,R=!1,j=!1,O=!1,F=null,K=0,W=0;const dt=new Map,ht=new Set(["code","msg","message","success","data","result","project","progress","dycolumn","geom","wkt","geometry","the_geom","raw_properties","gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"]),D=z(()=>pe.some(c=>c.key===a.activeView)?a.activeView:"ecological-redline"),_t=z(()=>D.value==="engineering-analysis"),fe=z(()=>["restoration","engineering-analysis"].includes(D.value)),ps=z(()=>Rs.includes(D.value)),Nt=z(()=>n.value?Fi(D.value,n.value):null),Bt=z(()=>{var c;return(((c=Nt.value)==null?void 0:c.legends)||[]).find(M=>M.key===h.value)||null}),ge=z(()=>{var c;return((c=Nt.value)==null?void 0:c.legends)||[]}),ve=z(()=>ga(D.value)),de=z(()=>!_t.value&&ve.value.length<=2&&ge.value.length<=6),zt=z(()=>{if(!de.value)return 430;const c=Math.max(1,ve.value.length),y=30+Math.max(1,ge.value.length)*28;return Math.max(220,Math.min(360,96+c*32+y))}),jt=z(()=>{const c=Nt.value;return c?Bt.value?kt(Tt({},c),{cqlFilter:Bt.value.cqlFilter||c.cqlFilter,activeLegend:Bt.value,name:Bt.value.name||c.name}):c:null}),ze=z(()=>ps.value?l.value:D.value==="restoration"?Yi:D.value==="engineering-analysis"?tr:er),xs=z(()=>ze.value.left||[]),bs=z(()=>ze.value.right||[]),We=Q(typeof window=="undefined"?1080:window.innerHeight),_e=Bi.sideCardWidth,Ve=z(()=>zi(We.value)),Gs=z(()=>Wi(Ve.value,2)),Wt=z(()=>!!m.value),He=$i,Qe=z(()=>qi({point:m.value?Ye(m.value):null,rowCount:g.value?Yt(g.value):0,loading:u.value,empty:f.value||!g.value})),Rt=z(()=>Qe.value.height),Ns=z(()=>Qe.value.style),Je=z(()=>{var M;return{"ecological-redline":"生态保护红线详情","natural-protected-area":"自然保护地详情","national-park":"国家公园详情",restoration:"生态修复详情","engineering-analysis":"生态工程详情"}[D.value]||`${((M=Nt.value)==null?void 0:M.name)||"生态图斑"}详情`});Ua(()=>{we(),window.addEventListener("resize",we),document.addEventListener("pointerdown",ha,!0),Xe(),Me(D.value)}),Ki(()=>{R=!0,F&&window.clearTimeout(F),window.removeEventListener("resize",we),document.removeEventListener("pointerdown",ha,!0)}),es(D,c=>{Me(c)}),es(n,()=>{h.value="",ft()}),es(h,()=>{ft()}),es(()=>a.active,c=>{var M,y,N,T;r.value&&(c?(Kt(),(y=(M=r.value).resume)==null||y.call(M)):(T=(N=r.value).pause)==null||T.call(N))});function Me(c){var N,T,k,q,H;const M=pe.find(gt=>gt.key===c)||pe[0],y=ga(c);h.value="",n.value=M.defaultLayerKey||((N=y[0])==null?void 0:N.key)||"",S.value=sr(c),b.value=0,(k=(T=r.value)==null?void 0:T.setBoundaryDrawing)==null||k.call(T,!1),c!=="engineering-analysis"&&((H=(q=r.value)==null?void 0:q.clearAnalysisBoundary)==null||H.call(q)),ft(),Rs.includes(c)&&(l.value=is({},c),Xt(c)),i("module-stats",{moduleKey:"ecological-protection",viewKey:c,items:Rs.includes(c)?Ts({},c):ar(c)})}function As(c){const M=pe.some(y=>y.key===c)?c:"ecological-redline";M!==D.value&&i("view-change",M)}function Xt(c){return nt(this,null,function*(){const M=++K;try{const N=dt.get(c)||(yield rr(c));if(M!==K||D.value!==c)return;dt.set(c,N),l.value=is(N,c),i("module-stats",{moduleKey:"ecological-protection",viewKey:c,items:Ts(N,c)})}catch(y){if(M!==K||D.value!==c)return;l.value=is({},c),i("module-stats",{moduleKey:"ecological-protection",viewKey:c,items:Ts({},c)}),A.value={type:"error",text:"保护范围统计加载失败"},console.warn("Failed to load ecological scope statistics",y)}})}function Xe(){var y;I=new Ui;const c={progress:0};I.instance.on("onProgress",(N,T,k)=>{const q=Math.floor(T/k*100);ca.to(c,{progress:q,onUpdate:()=>{w.value=Math.floor(c.progress)}})});const M=()=>{R||j||(j=!0,Kt())};I.instance.on("onLoad",M),(y=I.ready)==null||y.then(M).catch(()=>{R||(A.value={type:"error",text:"地图资源加载失败"})})}function Kt(){R||!a.active||!j||O||(O=!0,F&&window.clearTimeout(F),F=window.setTimeout(()=>{F=null,Ke()},600))}function Ke(c=0){return nt(this,null,function*(){var y,N,T,k,q;if(R)return;if(!a.active){O=!1;return}if(yield ss(),!a.active){O=!1;return}if(!!((N=(y=r.value)==null?void 0:y.loadMap)!=null&&N.call(y,I)||(k=(T=r.value)==null?void 0:T.hasMap)!=null&&k.call(T))){yield Ii(),yield ss(),(q=r.value)==null||q.play();return}if(c<24){window.setTimeout(()=>Ke(c+1),120);return}O=!1})}function me(){F&&(window.clearTimeout(F),F=null)}function ye(){var c,M,y,N;(M=(c=r.value)==null?void 0:c.resume)==null||M.call(c),(N=(y=r.value)==null?void 0:y.refreshView)==null||N.call(y)}function Ze(){var c,M,y,N,T,k;if(ft(),(M=(c=r.value)==null?void 0:c.setBoundaryDrawing)==null||M.call(c,!1),(N=(y=r.value)==null?void 0:y.clearAnalysisBoundary)==null||N.call(y),(k=(T=r.value)==null?void 0:T.hasMap)!=null&&k.call(T)){ye();return}me(),O=!1,ss(()=>{Kt()})}e({refreshMapView:ye,resetMap:Ze});function Ye(c){const M=document.querySelector(".ecological-protection"),y=M==null?void 0:M.getBoundingClientRect();return!(y!=null&&y.width)||!(y!=null&&y.height)?c:{x:(c.x-y.left)/y.width*1920,y:(c.y-y.top)/y.height*1080}}function we(){We.value=typeof window=="undefined"?1080:window.innerHeight}function Zt(c,M){return`${D.value}-${M}-${(c==null?void 0:c.key)||(c==null?void 0:c.title)||"panel"}`}function Ee(c){return(c==null?void 0:c.span)===2}function ts(c){return Ee(c)?Gs.value:Ve.value}function Yt(c){const M=(c==null?void 0:c.properties)||{};return Object.keys(M).filter(y=>v(y,M[y])).length}function v(c,M){return M==null||M===""||Array.isArray(M)||typeof M=="object"?!1:!ht.has(String(c||"").toLowerCase())}function d(c={}){const M=_(c.lng),y=_(c.lat);return M===""||y===""?"":`POINT(${M} ${y})`}function _(c){const M=Number(c);return Number.isFinite(M)?M.toFixed(8).replace(/\.?0+$/,""):""}function p(){return nt(this,arguments,function*(c={}){var k,q,H,gt,Et,bt;if(!fe.value)return;if(C(c.overlayLayer||jt.value||Nt.value)){ft();return}const M=Number((k=c==null?void 0:c.lngLat)==null?void 0:k.lng),y=Number((q=c==null?void 0:c.lngLat)==null?void 0:q.lat);if(!Number.isFinite(M)||!Number.isFinite(y)){ft();return}const N=++W,T=c.screen||{x:960,y:540};m.value=null,g.value=null,f.value=!1,u.value=!0;try{const At=yield Di(d({lng:M,lat:y}));if(N!==W||R)return;const Pe=$(At,c);if(!Pe||Yt(Pe)<=0){ft();return}g.value=Pe,m.value=((gt=(H=r.value)==null?void 0:H.getVectorFeatureAnchorScreen)==null?void 0:gt.call(H,Pe))||T,f.value=!1,(bt=(Et=r.value)==null?void 0:Et.highlightFeature)==null||bt.call(Et,Pe,{highlightTone:"v21"})}catch(At){if(N!==W)return;ft()}finally{N===W&&(u.value=!1)}})}function C(c=jt.value){const M=String((c==null?void 0:c.sourceType)||"").toLowerCase();return["geojson","wkt-api","wfs"].includes(M)||String((c==null?void 0:c.dataPath)||"").includes("ecological_restoration_projects")}function $(c,M={}){var k,q,H;const y=st((c==null?void 0:c.project)||((k=c==null?void 0:c.data)==null?void 0:k.project)||(c==null?void 0:c.data)||c);if(!it(y))return null;const N=at(y,c),T=y.geom||y.geometry||y.wkt||null;return{id:y.id||N.id||N.project_name||`project-${(q=M==null?void 0:M.lngLat)==null?void 0:q.lng}-${(H=M==null?void 0:M.lngLat)==null?void 0:H.lat}`,properties:N,feature:{type:"Feature",properties:N,geometry:T},geometry:T,layer:M.overlayLayer||jt.value||Nt.value,lngLat:M.lngLat}}function V(c,M={}){var gt,Et,bt;const y=c!=null&&c.feature&&c.feature.type==="Feature"?kt(Tt({},c.feature),{id:c.id||c.feature.id,layer:c.layer,lngLat:c.lngLat}):c,N=(y==null?void 0:y.type)==="Feature"?y:((gt=y==null?void 0:y.feature)==null?void 0:gt.type)==="Feature"?y.feature:null,T=(y==null?void 0:y.properties)||(N==null?void 0:N.properties)||{},k=(y==null?void 0:y.geometry)||(N==null?void 0:N.geometry)||T.geometry||T.geom||T.wkt||null,q=at(T,M),H=(y==null?void 0:y.id)||(N==null?void 0:N.id)||q.id||q.gid||q.project_id||q.project_name||`project-${((Et=M==null?void 0:M.lngLat)==null?void 0:Et.lng)||""}-${((bt=M==null?void 0:M.lngLat)==null?void 0:bt.lat)||""}`;return{id:H,properties:q,feature:{type:"Feature",id:H,properties:q,geometry:k},geometry:k,layer:(y==null?void 0:y.layer)||M.overlayLayer||jt.value||Nt.value,lngLat:(y==null?void 0:y.lngLat)||M.lngLat}}function st(c){return Array.isArray(c)?c.find(M=>M&&typeof M=="object")||null:c&&typeof c=="object"?c:null}function it(c){return!c||typeof c!="object"?!1:Array.isArray(c.dyColumn)&&c.dyColumn.some(lt)?!0:Object.keys(c).some(M=>v(M,c[M]))}function lt(c={}){const M=c==null?void 0:c.value;return M==null||M===""?!1:!!String((c==null?void 0:c.field)||(c==null?void 0:c.title)||"").trim()}function at(c={},M={}){const y=Tt({},c);(Array.isArray(c.dyColumn)?c.dyColumn:[]).forEach(H=>{const gt=H==null?void 0:H.value;if(gt==null||gt==="")return;const Et=String((H==null?void 0:H.field)||"").trim();[Et,rt(Et)].filter(Boolean).forEach(At=>{(y[At]===void 0||y[At]===null||y[At]==="")&&(y[At]=gt)})});const T=y.project_name||y.projectName||y.name,k=y.area_mu||y.areaMu||y.acreage,q=y.project_status||y.projectStatus;return kt(Tt({},y),{project_name:T,name:T||y.name,area_mu:k,project_status:q,progress_count:Array.isArray(M==null?void 0:M.progress)?M.progress.length:void 0})}function rt(c){return String(c||"").replace(/[A-Z]/g,M=>`_${M.toLowerCase()}`)}function xt(c){var y,N,T,k;const M=(N=(y=c==null?void 0:c.feature)!=null?y:c)!=null?N:null;if(!M||Yt(M)<=0){ft();return}if(fe.value){W+=1;const q=V(M,c);if(!q||Yt(q)<=0){ft();return}g.value=q,f.value=!1,u.value=!1,m.value=((k=(T=r.value)==null?void 0:T.getVectorFeatureAnchorScreen)==null?void 0:k.call(T,q))||(c==null?void 0:c.screen)||null;return}g.value=M,f.value=!1,c!=null&&c.screen&&(m.value=c.screen)}function Is(c){A.value=c}function Se(c,M){var T,k;if(D.value==="national-park"&&(M!=null&&M.name)){ft(),(k=(T=r.value)==null?void 0:T.focusTown)==null||k.call(T,M.name,{distanceScale:.66,targetLocalZ:.84,cameraOffset:{x:0,y:1.05,z:0},select:!0});return}if(D.value!=="restoration"||(c==null?void 0:c.key)!=="restoration-projects"||!((M==null?void 0:M.projectName)||(M==null?void 0:M.name)))return;ft();const N=()=>Cs(M);if(h.value){h.value="",ss(()=>window.setTimeout(N,80));return}N()}function Cs(c,M=0){var k,q,H,gt,Et,bt,At;if(D.value!=="restoration")return;const y=(c==null?void 0:c.projectName)||(c==null?void 0:c.name);if(!y)return;const N=(q=(k=r.value)==null?void 0:k.focusProject)==null?void 0:q.call(k,{id:c==null?void 0:c.id,key:c==null?void 0:c.key,name:y,projectName:y,project_name:y,highlightTone:"white"});if(!(N!=null&&N.feature)){if(M<10){window.setTimeout(()=>Cs(c,M+1),120);return}A.value={type:"warning",text:"当前项目图斑尚未加载"};return}const T=V({id:N.feature.id,properties:N.feature.properties||{},geometry:N.feature.geometry,feature:N.feature,layer:jt.value||Nt.value},{});g.value=T,f.value=!1,u.value=!1,m.value=N.screen||((Et=(H=r.value)==null?void 0:H.getVectorFeaturesAnchorScreen)==null?void 0:Et.call(H,(gt=N.highlightFeatures)!=null&&gt.length?N.highlightFeatures:N.features))||((At=(bt=r.value)==null?void 0:bt.getVectorFeatureAnchorScreen)==null?void 0:At.call(bt,T))}function Pi(c){var M,y;ft(),b.value=0,(y=(M=r.value)==null?void 0:M.setBoundaryDrawing)==null||y.call(M,c)}function pi(){var c,M;(M=(c=r.value)==null?void 0:c.finishBoundaryDrawing)==null||M.call(c)}function xi(){var c,M;(M=(c=r.value)==null?void 0:c.undoBoundaryPoint)==null||M.call(c)}function bi(){var c,M;b.value=0,(M=(c=r.value)==null?void 0:c.clearAnalysisBoundary)==null||M.call(c)}function Gi(c={}){var M,y,N;b.value=c.pointCount||((M=c.points)==null?void 0:M.length)||0,c.status==="complete"&&c.feature&&(b.value=0,(N=(y=o.value)==null?void 0:y.applyDrawnBoundary)==null||N.call(y,c.feature)),c.status==="clear"&&(b.value=0)}function Ni(c={}){var M,y;(y=(M=r.value)==null?void 0:M.showAnalysisResult)==null||y.call(M,{boundary:c.boundary,matches:c.matches,preserveView:D.value==="engineering-analysis"}),D.value}function Ai(c){var y,N;const M=((c==null?void 0:c.features)||[]).filter(Boolean);(N=(y=r.value)==null?void 0:y.showAnalysisResult)==null||N.call(y,{boundary:c==null?void 0:c.boundary,matches:M})}function ft(){var c,M;W+=1,g.value=null,f.value=!1,u.value=!1,m.value=null,(M=(c=r.value)==null?void 0:c.clearSelectedFeature)==null||M.call(c)}function ha(c){if(!Wt.value)return;const M=document.querySelector(".fgw-map-feature-info"),y=c.target;M&&y instanceof Node&&M.contains(y)||ft()}function Ii(){return E.value?new Promise(c=>{ca.to(".ecological-protection .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{E.value=!1,c()}})}):Promise.resolve()}return(c,M)=>(J(),Y("div",o1,[ee(Vi,{ref_key:"mapSceneRef",ref:r,"active-layer":jt.value,"map-ranking":S.value,"admin-boundary-line-scale":2.4,"auto-apply-layer-map-view":!1,"max-zoom":21,onFeatureLoading:M[0]||(M[0]=y=>u.value=y),onFeatureInfo:xt,onMapClick:p,onLayerStatus:Is,onDrawBoundary:Gi},null,8,["active-layer","map-ranking"]),L("div",h1,[_t.value?It("",!0):(J(),Y("div",l1,[L("div",u1,[(J(!0),Y(fs,null,gs(xs.value,y=>(J(),Ls(fa,{key:Zt(y,"left"),class:Ot(["fgw-side-card left-card",{"is-double":Ee(y)}]),title:y.title,width:as(_e),height:ts(y)},{default:da(()=>[ee(va,{panel:y,compact:"","column-label-standard":"","visual-version":"v21",onRowSelect:N=>Se(y,N)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","width","height"]))),128))])])),_t.value?It("",!0):(J(),Y("div",c1,[L("div",f1,[(J(!0),Y(fs,null,gs(bs.value,y=>(J(),Ls(fa,{key:Zt(y,"right"),class:Ot(["fgw-side-card right-card",{"is-double":Ee(y)}]),title:y.title,width:as(_e),height:ts(y)},{default:da(()=>[ee(va,{panel:y,compact:"","column-label-standard":"","visual-version":"v21",onRowSelect:N=>Se(y,N)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","width","height"]))),128))])])),_t.value?(J(),Ls(n1,{key:2,ref_key:"engineeringAnalysisRef",ref:o,"drawing-point-count":b.value,onDrawingChange:Pi,onFinishDrawing:pi,onUndoPoint:xi,onClearBoundary:bi,onAnalysisResult:Ni,onFocusProject:Ai},null,8,["drawing-point-count"])):It("",!0),L("div",{class:Ot(["fgw-map-layer-tools",{"is-analysis":_t.value,"is-compact":de.value}]),style:_a({height:`${zt.value}px`})},[ee(Hi,{modelValue:n.value,"onUpdate:modelValue":M[1]||(M[1]=y=>n.value=y),"selected-legend-key":h.value,"onUpdate:selectedLegendKey":M[2]||(M[2]=y=>h.value=y),"topic-key":D.value,legends:ge.value,width:248,height:zt.value,compact:de.value},null,8,["modelValue","selected-legend-key","topic-key","legends","height","compact"])],6),Wt.value?(J(),Y("div",{key:3,class:"fgw-map-feature-info",style:_a(Ns.value)},[ee(Qi,{title:Je.value,feature:g.value,empty:f.value,loading:u.value,width:as(He),height:Rt.value,closable:"",onClose:ft},null,8,["title","feature","empty","loading","width","height"])],4)):It("",!0),L("div",g1,[ee(Ji,{"model-value":D.value,topics:as(pe),"onUpdate:modelValue":As},null,8,["model-value","topics"])])]),E.value?(J(),Y("div",v1,[M[4]||(M[4]=Zi('<div class="loading-text"><span style="--index:1;">L</span><span style="--index:2;">O</span><span style="--index:3;">A</span><span style="--index:4;">D</span><span style="--index:5;">I</span><span style="--index:6;">N</span><span style="--index:7;">G</span></div>',1)),L("div",d1,[L("span",_1,ut(w.value),1),M[3]||(M[3]=L("span",{class:"unit"},"%",-1))])])):It("",!0)]))}};export{R1 as default};