UPN-grid layer: - src/database.js — new upn_grid SQLocal table (id, districtid, upn_prefix, geometry_wkt) + saveUpnGrid / getLocalUpnGrid; cache-once-per-district. - src/remotedb.js — getUpnGrid → get_upn_grid_per_district.php. - main.js loadUpnGrid + upnGridToGeoJSON in the Administration group, with a zoom-aware style: white casing under a bolder violet dashed stroke (visible against parcels) and upn_prefix labels rendered only when resolution ≤ 7 m/px (≈ scale ≤ 1:25,000). - main.js click handler: single click on a UPN-grid cell opens an info popup showing the upn_prefix. External-dataset import → staging → upload (client-side complete): - src/database.js — external_imports + external_import_features tables, plus createExternalImport / addExternalImportFeatures / updateExternalImport / getExternalImport / getExternalImportFeatures / listExternalImports / remapImportedFeatureProperties / deleteExternalImport. Status enum: imported/mapped/other/uploading/ submitted/migrated/failed (aligned with the database team's staged- upload model — lu_parcels_upload_tmp + supervisor review). - src/import-detect.js — pure helpers: detectTargetType(), autoMapFields(), applyFieldMapping(), listSourceFields() + TARGET_TYPES / TARGET_FIELDS registries. - src/import-modal.js — Bootstrap mapping modal: target dropdown, field-rename table, three actions (Cancel / Save / Save + Upload now). - main.js — stageImport hooked into addImportedGeoJSON (the single convergence point for shp/GeoJSON/KML drops); handleImportModalResult applies the mapping in one transaction; runUpload builds the real payload (district_id + api_token from remotePost, user_id_upload from SSO session, per-feature client_uuid/geom/props) and currently logs + toasts — the upload_<target>.php endpoints are not yet live. - index.html — #importMappingModal markup. - MapView._decorateLayerListItem — import-state chip (Upload N / spinner / ✓ submitted / ✓ live / N errors) dispatching lupmis:import-chip-click; src/styles/layerswitcher.css — chip variants. GIS export from Area / Circle Analysis popups: - MapView._showAnalysisPopup now accepts an exportContext (clipGeometry + parcelFeatures + zoneFeatures + otherByLayer) and renders an "Export GIS" button next to "Export PDF". Click dispatches lupmis:export-gis. - index.html — #exportGisModal markup. - src/export-gis-modal.js — Bootstrap modal: format toggle (GeoJSON default / Shapefile / KML), filename, field-rename table with SHP 10-char DBF warning. - src/gis-export.js — writers: GeoJSON via Blob, KML via OL KMLFormat, Shapefile via shp-write (with DBF-safe name sanitiser). - Adds shp-write@0.3.2 dependency. MapView style options: - addGeoJSONLayer now accepts strokeDash for line-dash patterns (used by the UPN-grid layer and available for any future contextual overlay). Service Worker v9 → v10 to evict the stale shell/module caches on the next deploy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 lines
212 KiB
JavaScript
7 lines
212 KiB
JavaScript
var li={},ka;function _a(){if(ka)return li;ka=1;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return li.encode=function(e,i){for(var a="",r,s,h,n,f,l,d,_=0;_<e.length;)r=e.charCodeAt(_++),s=e.charCodeAt(_++),h=e.charCodeAt(_++),n=r>>2,f=(r&3)<<4|s>>4,l=(s&15)<<2|h>>6,d=h&63,isNaN(s)?l=d=64:isNaN(h)&&(d=64),a=a+t.charAt(n)+t.charAt(f)+t.charAt(l)+t.charAt(d);return a},li.decode=function(e,i){var a="",r,s,h,n,f,l,d,_=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");_<e.length;)n=t.indexOf(e.charAt(_++)),f=t.indexOf(e.charAt(_++)),l=t.indexOf(e.charAt(_++)),d=t.indexOf(e.charAt(_++)),r=n<<2|f>>4,s=(f&15)<<4|l>>2,h=(l&3)<<6|d,a=a+String.fromCharCode(r),l!=64&&(a=a+String.fromCharCode(s)),d!=64&&(a=a+String.fromCharCode(h));return a},li}var Wt={},Ta;function ii(){if(Ta)return Wt;if(Ta=1,Wt.base64=!0,Wt.array=!0,Wt.string=!0,Wt.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Wt.nodebuffer=typeof Buffer<"u",Wt.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")Wt.blob=!1;else{var t=new ArrayBuffer(0);try{Wt.blob=new Blob([t],{type:"application/zip"}).size===0}catch{try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=new e;i.append(t),Wt.blob=i.getBlob("application/zip").size===0}catch{Wt.blob=!1}}}return Wt}var Ri={},ui={},Me={},Di={},Ba;function ye(){return Ba||(Ba=1,(function(t){var e=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";t.assign=function(r){for(var s=Array.prototype.slice.call(arguments,1);s.length;){var h=s.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var n in h)h.hasOwnProperty(n)&&(r[n]=h[n])}}return r},t.shrinkBuf=function(r,s){return r.length===s?r:r.subarray?r.subarray(0,s):(r.length=s,r)};var i={arraySet:function(r,s,h,n,f){if(s.subarray&&r.subarray){r.set(s.subarray(h,h+n),f);return}for(var l=0;l<n;l++)r[f+l]=s[h+l]},flattenChunks:function(r){var s,h,n,f,l,d;for(n=0,s=0,h=r.length;s<h;s++)n+=r[s].length;for(d=new Uint8Array(n),f=0,s=0,h=r.length;s<h;s++)l=r[s],d.set(l,f),f+=l.length;return d}},a={arraySet:function(r,s,h,n,f){for(var l=0;l<n;l++)r[f+l]=s[h+l]},flattenChunks:function(r){return[].concat.apply([],r)}};t.setTyped=function(r){r?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(e)})(Di)),Di}var Ie={},Jt={},we={},Oa;function Ts(){if(Oa)return we;Oa=1;var t=ye(),e=4,i=0,a=1,r=2;function s(g){for(var T=g.length;--T>=0;)g[T]=0}var h=0,n=1,f=2,l=3,d=258,_=29,u=256,x=u+1+_,y=30,A=19,w=2*x+1,C=15,N=16,R=7,U=256,L=16,O=17,D=18,X=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],tt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],E=512,b=new Array((x+2)*2);s(b);var I=new Array(y*2);s(I);var W=new Array(E);s(W);var Y=new Array(d-l+1);s(Y);var q=new Array(_);s(q);var _t=new Array(y);s(_t);function nt(g,T,F,H,M){this.static_tree=g,this.extra_bits=T,this.extra_base=F,this.elems=H,this.max_length=M,this.has_stree=g&&g.length}var bt,St,gt;function st(g,T){this.dyn_tree=g,this.max_code=0,this.stat_desc=T}function ct(g){return g<256?W[g]:W[256+(g>>>7)]}function dt(g,T){g.pending_buf[g.pending++]=T&255,g.pending_buf[g.pending++]=T>>>8&255}function at(g,T,F){g.bi_valid>N-F?(g.bi_buf|=T<<g.bi_valid&65535,dt(g,g.bi_buf),g.bi_buf=T>>N-g.bi_valid,g.bi_valid+=F-N):(g.bi_buf|=T<<g.bi_valid&65535,g.bi_valid+=F)}function ft(g,T,F){at(g,F[T*2],F[T*2+1])}function et(g,T){var F=0;do F|=g&1,g>>>=1,F<<=1;while(--T>0);return F>>>1}function vt(g){g.bi_valid===16?(dt(g,g.bi_buf),g.bi_buf=0,g.bi_valid=0):g.bi_valid>=8&&(g.pending_buf[g.pending++]=g.bi_buf&255,g.bi_buf>>=8,g.bi_valid-=8)}function Pt(g,T){var F=T.dyn_tree,H=T.max_code,M=T.stat_desc.static_tree,G=T.stat_desc.has_stree,c=T.stat_desc.extra_bits,B=T.stat_desc.extra_base,J=T.stat_desc.max_length,o,S,P,v,m,p,K=0;for(v=0;v<=C;v++)g.bl_count[v]=0;for(F[g.heap[g.heap_max]*2+1]=0,o=g.heap_max+1;o<w;o++)S=g.heap[o],v=F[F[S*2+1]*2+1]+1,v>J&&(v=J,K++),F[S*2+1]=v,!(S>H)&&(g.bl_count[v]++,m=0,S>=B&&(m=c[S-B]),p=F[S*2],g.opt_len+=p*(v+m),G&&(g.static_len+=p*(M[S*2+1]+m)));if(K!==0){do{for(v=J-1;g.bl_count[v]===0;)v--;g.bl_count[v]--,g.bl_count[v+1]+=2,g.bl_count[J]--,K-=2}while(K>0);for(v=J;v!==0;v--)for(S=g.bl_count[v];S!==0;)P=g.heap[--o],!(P>H)&&(F[P*2+1]!==v&&(g.opt_len+=(v-F[P*2+1])*F[P*2],F[P*2+1]=v),S--)}}function It(g,T,F){var H=new Array(C+1),M=0,G,c;for(G=1;G<=C;G++)H[G]=M=M+F[G-1]<<1;for(c=0;c<=T;c++){var B=g[c*2+1];B!==0&&(g[c*2]=et(H[B]++,B))}}function it(){var g,T,F,H,M,G=new Array(C+1);for(F=0,H=0;H<_-1;H++)for(q[H]=F,g=0;g<1<<X[H];g++)Y[F++]=H;for(Y[F-1]=H,M=0,H=0;H<16;H++)for(_t[H]=M,g=0;g<1<<V[H];g++)W[M++]=H;for(M>>=7;H<y;H++)for(_t[H]=M<<7,g=0;g<1<<V[H]-7;g++)W[256+M++]=H;for(T=0;T<=C;T++)G[T]=0;for(g=0;g<=143;)b[g*2+1]=8,g++,G[8]++;for(;g<=255;)b[g*2+1]=9,g++,G[9]++;for(;g<=279;)b[g*2+1]=7,g++,G[7]++;for(;g<=287;)b[g*2+1]=8,g++,G[8]++;for(It(b,x+1,G),g=0;g<y;g++)I[g*2+1]=5,I[g*2]=et(g,5);bt=new nt(b,X,u+1,x,C),St=new nt(I,V,0,y,C),gt=new nt(new Array(0),Q,0,A,R)}function Nt(g){var T;for(T=0;T<x;T++)g.dyn_ltree[T*2]=0;for(T=0;T<y;T++)g.dyn_dtree[T*2]=0;for(T=0;T<A;T++)g.bl_tree[T*2]=0;g.dyn_ltree[U*2]=1,g.opt_len=g.static_len=0,g.last_lit=g.matches=0}function ne(g){g.bi_valid>8?dt(g,g.bi_buf):g.bi_valid>0&&(g.pending_buf[g.pending++]=g.bi_buf),g.bi_buf=0,g.bi_valid=0}function jt(g,T,F,H){ne(g),dt(g,F),dt(g,~F),t.arraySet(g.pending_buf,g.window,T,F,g.pending),g.pending+=F}function qt(g,T,F,H){var M=T*2,G=F*2;return g[M]<g[G]||g[M]===g[G]&&H[T]<=H[F]}function xt(g,T,F){for(var H=g.heap[F],M=F<<1;M<=g.heap_len&&(M<g.heap_len&&qt(T,g.heap[M+1],g.heap[M],g.depth)&&M++,!qt(T,H,g.heap[M],g.depth));)g.heap[F]=g.heap[M],F=M,M<<=1;g.heap[F]=H}function rt(g,T,F){var H,M,G=0,c,B;if(g.last_lit!==0)do H=g.pending_buf[g.d_buf+G*2]<<8|g.pending_buf[g.d_buf+G*2+1],M=g.pending_buf[g.l_buf+G],G++,H===0?ft(g,M,T):(c=Y[M],ft(g,c+u+1,T),B=X[c],B!==0&&(M-=q[c],at(g,M,B)),H--,c=ct(H),ft(g,c,F),B=V[c],B!==0&&(H-=_t[c],at(g,H,B)));while(G<g.last_lit);ft(g,U,T)}function Zt(g,T){var F=T.dyn_tree,H=T.stat_desc.static_tree,M=T.stat_desc.has_stree,G=T.stat_desc.elems,c,B,J=-1,o;for(g.heap_len=0,g.heap_max=w,c=0;c<G;c++)F[c*2]!==0?(g.heap[++g.heap_len]=J=c,g.depth[c]=0):F[c*2+1]=0;for(;g.heap_len<2;)o=g.heap[++g.heap_len]=J<2?++J:0,F[o*2]=1,g.depth[o]=0,g.opt_len--,M&&(g.static_len-=H[o*2+1]);for(T.max_code=J,c=g.heap_len>>1;c>=1;c--)xt(g,F,c);o=G;do c=g.heap[1],g.heap[1]=g.heap[g.heap_len--],xt(g,F,1),B=g.heap[1],g.heap[--g.heap_max]=c,g.heap[--g.heap_max]=B,F[o*2]=F[c*2]+F[B*2],g.depth[o]=(g.depth[c]>=g.depth[B]?g.depth[c]:g.depth[B])+1,F[c*2+1]=F[B*2+1]=o,g.heap[1]=o++,xt(g,F,1);while(g.heap_len>=2);g.heap[--g.heap_max]=g.heap[1],Pt(g,T),It(F,J,g.bl_count)}function Ae(g,T,F){var H,M=-1,G,c=T[1],B=0,J=7,o=4;for(c===0&&(J=138,o=3),T[(F+1)*2+1]=65535,H=0;H<=F;H++)G=c,c=T[(H+1)*2+1],!(++B<J&&G===c)&&(B<o?g.bl_tree[G*2]+=B:G!==0?(G!==M&&g.bl_tree[G*2]++,g.bl_tree[L*2]++):B<=10?g.bl_tree[O*2]++:g.bl_tree[D*2]++,B=0,M=G,c===0?(J=138,o=3):G===c?(J=6,o=3):(J=7,o=4))}function le(g,T,F){var H,M=-1,G,c=T[1],B=0,J=7,o=4;for(c===0&&(J=138,o=3),H=0;H<=F;H++)if(G=c,c=T[(H+1)*2+1],!(++B<J&&G===c)){if(B<o)do ft(g,G,g.bl_tree);while(--B!==0);else G!==0?(G!==M&&(ft(g,G,g.bl_tree),B--),ft(g,L,g.bl_tree),at(g,B-3,2)):B<=10?(ft(g,O,g.bl_tree),at(g,B-3,3)):(ft(g,D,g.bl_tree),at(g,B-11,7));B=0,M=G,c===0?(J=138,o=3):G===c?(J=6,o=3):(J=7,o=4)}}function $t(g){var T;for(Ae(g,g.dyn_ltree,g.l_desc.max_code),Ae(g,g.dyn_dtree,g.d_desc.max_code),Zt(g,g.bl_desc),T=A-1;T>=3&&g.bl_tree[tt[T]*2+1]===0;T--);return g.opt_len+=3*(T+1)+5+5+4,T}function Pe(g,T,F,H){var M;for(at(g,T-257,5),at(g,F-1,5),at(g,H-4,4),M=0;M<H;M++)at(g,g.bl_tree[tt[M]*2+1],3);le(g,g.dyn_ltree,T-1),le(g,g.dyn_dtree,F-1)}function ue(g){var T=4093624447,F;for(F=0;F<=31;F++,T>>>=1)if(T&1&&g.dyn_ltree[F*2]!==0)return i;if(g.dyn_ltree[18]!==0||g.dyn_ltree[20]!==0||g.dyn_ltree[26]!==0)return a;for(F=32;F<u;F++)if(g.dyn_ltree[F*2]!==0)return a;return i}var Yt=!1;function Ce(g){Yt||(it(),Yt=!0),g.l_desc=new st(g.dyn_ltree,bt),g.d_desc=new st(g.dyn_dtree,St),g.bl_desc=new st(g.bl_tree,gt),g.bi_buf=0,g.bi_valid=0,Nt(g)}function ce(g,T,F,H){at(g,(h<<1)+(H?1:0),3),jt(g,T,F)}function Rt(g){at(g,n<<1,3),ft(g,U,b),vt(g)}function ie(g,T,F,H){var M,G,c=0;g.level>0?(g.strm.data_type===r&&(g.strm.data_type=ue(g)),Zt(g,g.l_desc),Zt(g,g.d_desc),c=$t(g),M=g.opt_len+3+7>>>3,G=g.static_len+3+7>>>3,G<=M&&(M=G)):M=G=F+5,F+4<=M&&T!==-1?ce(g,T,F,H):g.strategy===e||G===M?(at(g,(n<<1)+(H?1:0),3),rt(g,b,I)):(at(g,(f<<1)+(H?1:0),3),Pe(g,g.l_desc.max_code+1,g.d_desc.max_code+1,c+1),rt(g,g.dyn_ltree,g.dyn_dtree)),Nt(g),H&&ne(g)}function Ge(g,T,F){return g.pending_buf[g.d_buf+g.last_lit*2]=T>>>8&255,g.pending_buf[g.d_buf+g.last_lit*2+1]=T&255,g.pending_buf[g.l_buf+g.last_lit]=F&255,g.last_lit++,T===0?g.dyn_ltree[F*2]++:(g.matches++,T--,g.dyn_ltree[(Y[F]+u+1)*2]++,g.dyn_dtree[ct(T)*2]++),g.last_lit===g.lit_bufsize-1}return we._tr_init=Ce,we._tr_stored_block=ce,we._tr_flush_block=ie,we._tr_tally=Ge,we._tr_align=Rt,we}var ki,Fa;function Hr(){if(Fa)return ki;Fa=1;function t(e,i,a,r){for(var s=e&65535|0,h=e>>>16&65535|0,n=0;a!==0;){n=a>2e3?2e3:a,a-=n;do s=s+i[r++]|0,h=h+s|0;while(--n);s%=65521,h%=65521}return s|h<<16|0}return ki=t,ki}var Ti,La;function Wr(){if(La)return Ti;La=1;function t(){for(var a,r=[],s=0;s<256;s++){a=s;for(var h=0;h<8;h++)a=a&1?3988292384^a>>>1:a>>>1;r[s]=a}return r}var e=t();function i(a,r,s,h){var n=e,f=h+s;a^=-1;for(var l=h;l<f;l++)a=a>>>8^n[(a^r[l])&255];return a^-1}return Ti=i,Ti}var Bi,za;function va(){return za||(za=1,Bi={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Bi}var Ua;function Bs(){if(Ua)return Jt;Ua=1;var t=ye(),e=Ts(),i=Hr(),a=Wr(),r=va(),s=0,h=1,n=3,f=4,l=5,d=0,_=1,u=-2,x=-3,y=-5,A=-1,w=1,C=2,N=3,R=4,U=0,L=2,O=8,D=9,X=15,V=8,Q=29,tt=256,E=tt+1+Q,b=30,I=19,W=2*E+1,Y=15,q=3,_t=258,nt=_t+q+1,bt=32,St=42,gt=69,st=73,ct=91,dt=103,at=113,ft=666,et=1,vt=2,Pt=3,It=4,it=3;function Nt(o,S){return o.msg=r[S],S}function ne(o){return(o<<1)-(o>4?9:0)}function jt(o){for(var S=o.length;--S>=0;)o[S]=0}function qt(o){var S=o.state,P=S.pending;P>o.avail_out&&(P=o.avail_out),P!==0&&(t.arraySet(o.output,S.pending_buf,S.pending_out,P,o.next_out),o.next_out+=P,S.pending_out+=P,o.total_out+=P,o.avail_out-=P,S.pending-=P,S.pending===0&&(S.pending_out=0))}function xt(o,S){e._tr_flush_block(o,o.block_start>=0?o.block_start:-1,o.strstart-o.block_start,S),o.block_start=o.strstart,qt(o.strm)}function rt(o,S){o.pending_buf[o.pending++]=S}function Zt(o,S){o.pending_buf[o.pending++]=S>>>8&255,o.pending_buf[o.pending++]=S&255}function Ae(o,S,P,v){var m=o.avail_in;return m>v&&(m=v),m===0?0:(o.avail_in-=m,t.arraySet(S,o.input,o.next_in,m,P),o.state.wrap===1?o.adler=i(o.adler,S,m,P):o.state.wrap===2&&(o.adler=a(o.adler,S,m,P)),o.next_in+=m,o.total_in+=m,m)}function le(o,S){var P=o.max_chain_length,v=o.strstart,m,p,K=o.prev_length,Z=o.nice_match,$=o.strstart>o.w_size-nt?o.strstart-(o.w_size-nt):0,ht=o.window,he=o.w_mask,mt=o.prev,ot=o.strstart+_t,At=ht[v+K-1],Dt=ht[v+K];o.prev_length>=o.good_match&&(P>>=2),Z>o.lookahead&&(Z=o.lookahead);do if(m=S,!(ht[m+K]!==Dt||ht[m+K-1]!==At||ht[m]!==ht[v]||ht[++m]!==ht[v+1])){v+=2,m++;do;while(ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&ht[++v]===ht[++m]&&v<ot);if(p=_t-(ot-v),v=ot-_t,p>K){if(o.match_start=S,K=p,p>=Z)break;At=ht[v+K-1],Dt=ht[v+K]}}while((S=mt[S&he])>$&&--P!==0);return K<=o.lookahead?K:o.lookahead}function $t(o){var S=o.w_size,P,v,m,p,K;do{if(p=o.window_size-o.lookahead-o.strstart,o.strstart>=S+(S-nt)){t.arraySet(o.window,o.window,S,S,0),o.match_start-=S,o.strstart-=S,o.block_start-=S,v=o.hash_size,P=v;do m=o.head[--P],o.head[P]=m>=S?m-S:0;while(--v);v=S,P=v;do m=o.prev[--P],o.prev[P]=m>=S?m-S:0;while(--v);p+=S}if(o.strm.avail_in===0)break;if(v=Ae(o.strm,o.window,o.strstart+o.lookahead,p),o.lookahead+=v,o.lookahead+o.insert>=q)for(K=o.strstart-o.insert,o.ins_h=o.window[K],o.ins_h=(o.ins_h<<o.hash_shift^o.window[K+1])&o.hash_mask;o.insert&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[K+q-1])&o.hash_mask,o.prev[K&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=K,K++,o.insert--,!(o.lookahead+o.insert<q)););}while(o.lookahead<nt&&o.strm.avail_in!==0)}function Pe(o,S){var P=65535;for(P>o.pending_buf_size-5&&(P=o.pending_buf_size-5);;){if(o.lookahead<=1){if($t(o),o.lookahead===0&&S===s)return et;if(o.lookahead===0)break}o.strstart+=o.lookahead,o.lookahead=0;var v=o.block_start+P;if((o.strstart===0||o.strstart>=v)&&(o.lookahead=o.strstart-v,o.strstart=v,xt(o,!1),o.strm.avail_out===0)||o.strstart-o.block_start>=o.w_size-nt&&(xt(o,!1),o.strm.avail_out===0))return et}return o.insert=0,S===f?(xt(o,!0),o.strm.avail_out===0?Pt:It):(o.strstart>o.block_start&&(xt(o,!1),o.strm.avail_out===0),et)}function ue(o,S){for(var P,v;;){if(o.lookahead<nt){if($t(o),o.lookahead<nt&&S===s)return et;if(o.lookahead===0)break}if(P=0,o.lookahead>=q&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+q-1])&o.hash_mask,P=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),P!==0&&o.strstart-P<=o.w_size-nt&&(o.match_length=le(o,P)),o.match_length>=q)if(v=e._tr_tally(o,o.strstart-o.match_start,o.match_length-q),o.lookahead-=o.match_length,o.match_length<=o.max_lazy_match&&o.lookahead>=q){o.match_length--;do o.strstart++,o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+q-1])&o.hash_mask,P=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart;while(--o.match_length!==0);o.strstart++}else o.strstart+=o.match_length,o.match_length=0,o.ins_h=o.window[o.strstart],o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+1])&o.hash_mask;else v=e._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++;if(v&&(xt(o,!1),o.strm.avail_out===0))return et}return o.insert=o.strstart<q-1?o.strstart:q-1,S===f?(xt(o,!0),o.strm.avail_out===0?Pt:It):o.last_lit&&(xt(o,!1),o.strm.avail_out===0)?et:vt}function Yt(o,S){for(var P,v,m;;){if(o.lookahead<nt){if($t(o),o.lookahead<nt&&S===s)return et;if(o.lookahead===0)break}if(P=0,o.lookahead>=q&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+q-1])&o.hash_mask,P=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),o.prev_length=o.match_length,o.prev_match=o.match_start,o.match_length=q-1,P!==0&&o.prev_length<o.max_lazy_match&&o.strstart-P<=o.w_size-nt&&(o.match_length=le(o,P),o.match_length<=5&&(o.strategy===w||o.match_length===q&&o.strstart-o.match_start>4096)&&(o.match_length=q-1)),o.prev_length>=q&&o.match_length<=o.prev_length){m=o.strstart+o.lookahead-q,v=e._tr_tally(o,o.strstart-1-o.prev_match,o.prev_length-q),o.lookahead-=o.prev_length-1,o.prev_length-=2;do++o.strstart<=m&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+q-1])&o.hash_mask,P=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart);while(--o.prev_length!==0);if(o.match_available=0,o.match_length=q-1,o.strstart++,v&&(xt(o,!1),o.strm.avail_out===0))return et}else if(o.match_available){if(v=e._tr_tally(o,0,o.window[o.strstart-1]),v&&xt(o,!1),o.strstart++,o.lookahead--,o.strm.avail_out===0)return et}else o.match_available=1,o.strstart++,o.lookahead--}return o.match_available&&(v=e._tr_tally(o,0,o.window[o.strstart-1]),o.match_available=0),o.insert=o.strstart<q-1?o.strstart:q-1,S===f?(xt(o,!0),o.strm.avail_out===0?Pt:It):o.last_lit&&(xt(o,!1),o.strm.avail_out===0)?et:vt}function Ce(o,S){for(var P,v,m,p,K=o.window;;){if(o.lookahead<=_t){if($t(o),o.lookahead<=_t&&S===s)return et;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=q&&o.strstart>0&&(m=o.strstart-1,v=K[m],v===K[++m]&&v===K[++m]&&v===K[++m])){p=o.strstart+_t;do;while(v===K[++m]&&v===K[++m]&&v===K[++m]&&v===K[++m]&&v===K[++m]&&v===K[++m]&&v===K[++m]&&v===K[++m]&&m<p);o.match_length=_t-(p-m),o.match_length>o.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=q?(P=e._tr_tally(o,1,o.match_length-q),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(P=e._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),P&&(xt(o,!1),o.strm.avail_out===0))return et}return o.insert=0,S===f?(xt(o,!0),o.strm.avail_out===0?Pt:It):o.last_lit&&(xt(o,!1),o.strm.avail_out===0)?et:vt}function ce(o,S){for(var P;;){if(o.lookahead===0&&($t(o),o.lookahead===0)){if(S===s)return et;break}if(o.match_length=0,P=e._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,P&&(xt(o,!1),o.strm.avail_out===0))return et}return o.insert=0,S===f?(xt(o,!0),o.strm.avail_out===0?Pt:It):o.last_lit&&(xt(o,!1),o.strm.avail_out===0)?et:vt}function Rt(o,S,P,v,m){this.good_length=o,this.max_lazy=S,this.nice_length=P,this.max_chain=v,this.func=m}var ie;ie=[new Rt(0,0,0,0,Pe),new Rt(4,4,8,4,ue),new Rt(4,5,16,8,ue),new Rt(4,6,32,32,ue),new Rt(4,4,16,16,Yt),new Rt(8,16,32,32,Yt),new Rt(8,16,128,128,Yt),new Rt(8,32,128,256,Yt),new Rt(32,128,258,1024,Yt),new Rt(32,258,258,4096,Yt)];function Ge(o){o.window_size=2*o.w_size,jt(o.head),o.max_lazy_match=ie[o.level].max_lazy,o.good_match=ie[o.level].good_length,o.nice_match=ie[o.level].nice_length,o.max_chain_length=ie[o.level].max_chain,o.strstart=0,o.block_start=0,o.lookahead=0,o.insert=0,o.match_length=o.prev_length=q-1,o.match_available=0,o.ins_h=0}function g(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=O,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(W*2),this.dyn_dtree=new t.Buf16((2*b+1)*2),this.bl_tree=new t.Buf16((2*I+1)*2),jt(this.dyn_ltree),jt(this.dyn_dtree),jt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(Y+1),this.heap=new t.Buf16(2*E+1),jt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*E+1),jt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function T(o){var S;return!o||!o.state?Nt(o,u):(o.total_in=o.total_out=0,o.data_type=L,S=o.state,S.pending=0,S.pending_out=0,S.wrap<0&&(S.wrap=-S.wrap),S.status=S.wrap?St:at,o.adler=S.wrap===2?0:1,S.last_flush=s,e._tr_init(S),d)}function F(o){var S=T(o);return S===d&&Ge(o.state),S}function H(o,S){return!o||!o.state||o.state.wrap!==2?u:(o.state.gzhead=S,d)}function M(o,S,P,v,m,p){if(!o)return u;var K=1;if(S===A&&(S=6),v<0?(K=0,v=-v):v>15&&(K=2,v-=16),m<1||m>D||P!==O||v<8||v>15||S<0||S>9||p<0||p>R)return Nt(o,u);v===8&&(v=9);var Z=new g;return o.state=Z,Z.strm=o,Z.wrap=K,Z.gzhead=null,Z.w_bits=v,Z.w_size=1<<Z.w_bits,Z.w_mask=Z.w_size-1,Z.hash_bits=m+7,Z.hash_size=1<<Z.hash_bits,Z.hash_mask=Z.hash_size-1,Z.hash_shift=~~((Z.hash_bits+q-1)/q),Z.window=new t.Buf8(Z.w_size*2),Z.head=new t.Buf16(Z.hash_size),Z.prev=new t.Buf16(Z.w_size),Z.lit_bufsize=1<<m+6,Z.pending_buf_size=Z.lit_bufsize*4,Z.pending_buf=new t.Buf8(Z.pending_buf_size),Z.d_buf=1*Z.lit_bufsize,Z.l_buf=3*Z.lit_bufsize,Z.level=S,Z.strategy=p,Z.method=P,F(o)}function G(o,S){return M(o,S,O,X,V,U)}function c(o,S){var P,v,m,p;if(!o||!o.state||S>l||S<0)return o?Nt(o,u):u;if(v=o.state,!o.output||!o.input&&o.avail_in!==0||v.status===ft&&S!==f)return Nt(o,o.avail_out===0?y:u);if(v.strm=o,P=v.last_flush,v.last_flush=S,v.status===St)if(v.wrap===2)o.adler=0,rt(v,31),rt(v,139),rt(v,8),v.gzhead?(rt(v,(v.gzhead.text?1:0)+(v.gzhead.hcrc?2:0)+(v.gzhead.extra?4:0)+(v.gzhead.name?8:0)+(v.gzhead.comment?16:0)),rt(v,v.gzhead.time&255),rt(v,v.gzhead.time>>8&255),rt(v,v.gzhead.time>>16&255),rt(v,v.gzhead.time>>24&255),rt(v,v.level===9?2:v.strategy>=C||v.level<2?4:0),rt(v,v.gzhead.os&255),v.gzhead.extra&&v.gzhead.extra.length&&(rt(v,v.gzhead.extra.length&255),rt(v,v.gzhead.extra.length>>8&255)),v.gzhead.hcrc&&(o.adler=a(o.adler,v.pending_buf,v.pending,0)),v.gzindex=0,v.status=gt):(rt(v,0),rt(v,0),rt(v,0),rt(v,0),rt(v,0),rt(v,v.level===9?2:v.strategy>=C||v.level<2?4:0),rt(v,it),v.status=at);else{var K=O+(v.w_bits-8<<4)<<8,Z=-1;v.strategy>=C||v.level<2?Z=0:v.level<6?Z=1:v.level===6?Z=2:Z=3,K|=Z<<6,v.strstart!==0&&(K|=bt),K+=31-K%31,v.status=at,Zt(v,K),v.strstart!==0&&(Zt(v,o.adler>>>16),Zt(v,o.adler&65535)),o.adler=1}if(v.status===gt)if(v.gzhead.extra){for(m=v.pending;v.gzindex<(v.gzhead.extra.length&65535)&&!(v.pending===v.pending_buf_size&&(v.gzhead.hcrc&&v.pending>m&&(o.adler=a(o.adler,v.pending_buf,v.pending-m,m)),qt(o),m=v.pending,v.pending===v.pending_buf_size));)rt(v,v.gzhead.extra[v.gzindex]&255),v.gzindex++;v.gzhead.hcrc&&v.pending>m&&(o.adler=a(o.adler,v.pending_buf,v.pending-m,m)),v.gzindex===v.gzhead.extra.length&&(v.gzindex=0,v.status=st)}else v.status=st;if(v.status===st)if(v.gzhead.name){m=v.pending;do{if(v.pending===v.pending_buf_size&&(v.gzhead.hcrc&&v.pending>m&&(o.adler=a(o.adler,v.pending_buf,v.pending-m,m)),qt(o),m=v.pending,v.pending===v.pending_buf_size)){p=1;break}v.gzindex<v.gzhead.name.length?p=v.gzhead.name.charCodeAt(v.gzindex++)&255:p=0,rt(v,p)}while(p!==0);v.gzhead.hcrc&&v.pending>m&&(o.adler=a(o.adler,v.pending_buf,v.pending-m,m)),p===0&&(v.gzindex=0,v.status=ct)}else v.status=ct;if(v.status===ct)if(v.gzhead.comment){m=v.pending;do{if(v.pending===v.pending_buf_size&&(v.gzhead.hcrc&&v.pending>m&&(o.adler=a(o.adler,v.pending_buf,v.pending-m,m)),qt(o),m=v.pending,v.pending===v.pending_buf_size)){p=1;break}v.gzindex<v.gzhead.comment.length?p=v.gzhead.comment.charCodeAt(v.gzindex++)&255:p=0,rt(v,p)}while(p!==0);v.gzhead.hcrc&&v.pending>m&&(o.adler=a(o.adler,v.pending_buf,v.pending-m,m)),p===0&&(v.status=dt)}else v.status=dt;if(v.status===dt&&(v.gzhead.hcrc?(v.pending+2>v.pending_buf_size&&qt(o),v.pending+2<=v.pending_buf_size&&(rt(v,o.adler&255),rt(v,o.adler>>8&255),o.adler=0,v.status=at)):v.status=at),v.pending!==0){if(qt(o),o.avail_out===0)return v.last_flush=-1,d}else if(o.avail_in===0&&ne(S)<=ne(P)&&S!==f)return Nt(o,y);if(v.status===ft&&o.avail_in!==0)return Nt(o,y);if(o.avail_in!==0||v.lookahead!==0||S!==s&&v.status!==ft){var $=v.strategy===C?ce(v,S):v.strategy===N?Ce(v,S):ie[v.level].func(v,S);if(($===Pt||$===It)&&(v.status=ft),$===et||$===Pt)return o.avail_out===0&&(v.last_flush=-1),d;if($===vt&&(S===h?e._tr_align(v):S!==l&&(e._tr_stored_block(v,0,0,!1),S===n&&(jt(v.head),v.lookahead===0&&(v.strstart=0,v.block_start=0,v.insert=0))),qt(o),o.avail_out===0))return v.last_flush=-1,d}return S!==f?d:v.wrap<=0?_:(v.wrap===2?(rt(v,o.adler&255),rt(v,o.adler>>8&255),rt(v,o.adler>>16&255),rt(v,o.adler>>24&255),rt(v,o.total_in&255),rt(v,o.total_in>>8&255),rt(v,o.total_in>>16&255),rt(v,o.total_in>>24&255)):(Zt(v,o.adler>>>16),Zt(v,o.adler&65535)),qt(o),v.wrap>0&&(v.wrap=-v.wrap),v.pending!==0?d:_)}function B(o){var S;return!o||!o.state?u:(S=o.state.status,S!==St&&S!==gt&&S!==st&&S!==ct&&S!==dt&&S!==at&&S!==ft?Nt(o,u):(o.state=null,S===at?Nt(o,x):d))}function J(o,S){var P=S.length,v,m,p,K,Z,$,ht,he;if(!o||!o.state||(v=o.state,K=v.wrap,K===2||K===1&&v.status!==St||v.lookahead))return u;for(K===1&&(o.adler=i(o.adler,S,P,0)),v.wrap=0,P>=v.w_size&&(K===0&&(jt(v.head),v.strstart=0,v.block_start=0,v.insert=0),he=new t.Buf8(v.w_size),t.arraySet(he,S,P-v.w_size,v.w_size,0),S=he,P=v.w_size),Z=o.avail_in,$=o.next_in,ht=o.input,o.avail_in=P,o.next_in=0,o.input=S,$t(v);v.lookahead>=q;){m=v.strstart,p=v.lookahead-(q-1);do v.ins_h=(v.ins_h<<v.hash_shift^v.window[m+q-1])&v.hash_mask,v.prev[m&v.w_mask]=v.head[v.ins_h],v.head[v.ins_h]=m,m++;while(--p);v.strstart=m,v.lookahead=q-1,$t(v)}return v.strstart+=v.lookahead,v.block_start=v.strstart,v.insert=v.lookahead,v.lookahead=0,v.match_length=v.prev_length=q-1,v.match_available=0,o.next_in=$,o.input=ht,o.avail_in=Z,v.wrap=K,d}return Jt.deflateInit=G,Jt.deflateInit2=M,Jt.deflateReset=F,Jt.deflateResetKeep=T,Jt.deflateSetHeader=H,Jt.deflate=c,Jt.deflateEnd=B,Jt.deflateSetDictionary=J,Jt.deflateInfo="pako deflate (from Nodeca project)",Jt}var Ee={},qa;function Xr(){if(qa)return Ee;qa=1;var t=ye(),e=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{i=!1}for(var a=new t.Buf8(256),r=0;r<256;r++)a[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;a[254]=a[254]=1,Ee.string2buf=function(h){var n,f,l,d,_,u=h.length,x=0;for(d=0;d<u;d++)f=h.charCodeAt(d),(f&64512)===55296&&d+1<u&&(l=h.charCodeAt(d+1),(l&64512)===56320&&(f=65536+(f-55296<<10)+(l-56320),d++)),x+=f<128?1:f<2048?2:f<65536?3:4;for(n=new t.Buf8(x),_=0,d=0;_<x;d++)f=h.charCodeAt(d),(f&64512)===55296&&d+1<u&&(l=h.charCodeAt(d+1),(l&64512)===56320&&(f=65536+(f-55296<<10)+(l-56320),d++)),f<128?n[_++]=f:f<2048?(n[_++]=192|f>>>6,n[_++]=128|f&63):f<65536?(n[_++]=224|f>>>12,n[_++]=128|f>>>6&63,n[_++]=128|f&63):(n[_++]=240|f>>>18,n[_++]=128|f>>>12&63,n[_++]=128|f>>>6&63,n[_++]=128|f&63);return n};function s(h,n){if(n<65537&&(h.subarray&&i||!h.subarray&&e))return String.fromCharCode.apply(null,t.shrinkBuf(h,n));for(var f="",l=0;l<n;l++)f+=String.fromCharCode(h[l]);return f}return Ee.buf2binstring=function(h){return s(h,h.length)},Ee.binstring2buf=function(h){for(var n=new t.Buf8(h.length),f=0,l=n.length;f<l;f++)n[f]=h.charCodeAt(f);return n},Ee.buf2string=function(h,n){var f,l,d,_,u=n||h.length,x=new Array(u*2);for(l=0,f=0;f<u;){if(d=h[f++],d<128){x[l++]=d;continue}if(_=a[d],_>4){x[l++]=65533,f+=_-1;continue}for(d&=_===2?31:_===3?15:7;_>1&&f<u;)d=d<<6|h[f++]&63,_--;if(_>1){x[l++]=65533;continue}d<65536?x[l++]=d:(d-=65536,x[l++]=55296|d>>10&1023,x[l++]=56320|d&1023)}return s(x,l)},Ee.utf8border=function(h,n){var f;for(n=n||h.length,n>h.length&&(n=h.length),f=n-1;f>=0&&(h[f]&192)===128;)f--;return f<0||f===0?n:f+a[h[f]]>n?f:n},Ee}var Oi,ja;function Kr(){if(ja)return Oi;ja=1;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Oi=t,Oi}var Za;function Os(){if(Za)return Ie;Za=1;var t=Bs(),e=ye(),i=Xr(),a=va(),r=Kr(),s=Object.prototype.toString,h=0,n=4,f=0,l=1,d=2,_=-1,u=0,x=8;function y(N){if(!(this instanceof y))return new y(N);this.options=e.assign({level:_,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},N||{});var R=this.options;R.raw&&R.windowBits>0?R.windowBits=-R.windowBits:R.gzip&&R.windowBits>0&&R.windowBits<16&&(R.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;var U=t.deflateInit2(this.strm,R.level,R.method,R.windowBits,R.memLevel,R.strategy);if(U!==f)throw new Error(a[U]);if(R.header&&t.deflateSetHeader(this.strm,R.header),R.dictionary){var L;if(typeof R.dictionary=="string"?L=i.string2buf(R.dictionary):s.call(R.dictionary)==="[object ArrayBuffer]"?L=new Uint8Array(R.dictionary):L=R.dictionary,U=t.deflateSetDictionary(this.strm,L),U!==f)throw new Error(a[U]);this._dict_set=!0}}y.prototype.push=function(N,R){var U=this.strm,L=this.options.chunkSize,O,D;if(this.ended)return!1;D=R===~~R?R:R===!0?n:h,typeof N=="string"?U.input=i.string2buf(N):s.call(N)==="[object ArrayBuffer]"?U.input=new Uint8Array(N):U.input=N,U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0&&(U.output=new e.Buf8(L),U.next_out=0,U.avail_out=L),O=t.deflate(U,D),O!==l&&O!==f)return this.onEnd(O),this.ended=!0,!1;(U.avail_out===0||U.avail_in===0&&(D===n||D===d))&&(this.options.to==="string"?this.onData(i.buf2binstring(e.shrinkBuf(U.output,U.next_out))):this.onData(e.shrinkBuf(U.output,U.next_out)))}while((U.avail_in>0||U.avail_out===0)&&O!==l);return D===n?(O=t.deflateEnd(this.strm),this.onEnd(O),this.ended=!0,O===f):(D===d&&(this.onEnd(f),U.avail_out=0),!0)},y.prototype.onData=function(N){this.chunks.push(N)},y.prototype.onEnd=function(N){N===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function A(N,R){var U=new y(R);if(U.push(N,!0),U.err)throw U.msg;return U.result}function w(N,R){return R=R||{},R.raw=!0,A(N,R)}function C(N,R){return R=R||{},R.gzip=!0,A(N,R)}return Ie.Deflate=y,Ie.deflate=A,Ie.deflateRaw=w,Ie.gzip=C,Ie}var Ne={},Xt={},Fi,$a;function Fs(){if($a)return Fi;$a=1;var t=30,e=12;return Fi=function(a,r){var s,h,n,f,l,d,_,u,x,y,A,w,C,N,R,U,L,O,D,X,V,Q,tt,E,b;s=a.state,h=a.next_in,E=a.input,n=h+(a.avail_in-5),f=a.next_out,b=a.output,l=f-(r-a.avail_out),d=f+(a.avail_out-257),_=s.dmax,u=s.wsize,x=s.whave,y=s.wnext,A=s.window,w=s.hold,C=s.bits,N=s.lencode,R=s.distcode,U=(1<<s.lenbits)-1,L=(1<<s.distbits)-1;t:do{C<15&&(w+=E[h++]<<C,C+=8,w+=E[h++]<<C,C+=8),O=N[w&U];e:for(;;){if(D=O>>>24,w>>>=D,C-=D,D=O>>>16&255,D===0)b[f++]=O&65535;else if(D&16){X=O&65535,D&=15,D&&(C<D&&(w+=E[h++]<<C,C+=8),X+=w&(1<<D)-1,w>>>=D,C-=D),C<15&&(w+=E[h++]<<C,C+=8,w+=E[h++]<<C,C+=8),O=R[w&L];i:for(;;){if(D=O>>>24,w>>>=D,C-=D,D=O>>>16&255,D&16){if(V=O&65535,D&=15,C<D&&(w+=E[h++]<<C,C+=8,C<D&&(w+=E[h++]<<C,C+=8)),V+=w&(1<<D)-1,V>_){a.msg="invalid distance too far back",s.mode=t;break t}if(w>>>=D,C-=D,D=f-l,V>D){if(D=V-D,D>x&&s.sane){a.msg="invalid distance too far back",s.mode=t;break t}if(Q=0,tt=A,y===0){if(Q+=u-D,D<X){X-=D;do b[f++]=A[Q++];while(--D);Q=f-V,tt=b}}else if(y<D){if(Q+=u+y-D,D-=y,D<X){X-=D;do b[f++]=A[Q++];while(--D);if(Q=0,y<X){D=y,X-=D;do b[f++]=A[Q++];while(--D);Q=f-V,tt=b}}}else if(Q+=y-D,D<X){X-=D;do b[f++]=A[Q++];while(--D);Q=f-V,tt=b}for(;X>2;)b[f++]=tt[Q++],b[f++]=tt[Q++],b[f++]=tt[Q++],X-=3;X&&(b[f++]=tt[Q++],X>1&&(b[f++]=tt[Q++]))}else{Q=f-V;do b[f++]=b[Q++],b[f++]=b[Q++],b[f++]=b[Q++],X-=3;while(X>2);X&&(b[f++]=b[Q++],X>1&&(b[f++]=b[Q++]))}}else if((D&64)===0){O=R[(O&65535)+(w&(1<<D)-1)];continue i}else{a.msg="invalid distance code",s.mode=t;break t}break}}else if((D&64)===0){O=N[(O&65535)+(w&(1<<D)-1)];continue e}else if(D&32){s.mode=e;break t}else{a.msg="invalid literal/length code",s.mode=t;break t}break}}while(h<n&&f<d);X=C>>3,h-=X,C-=X<<3,w&=(1<<C)-1,a.next_in=h,a.next_out=f,a.avail_in=h<n?5+(n-h):5-(h-n),a.avail_out=f<d?257+(d-f):257-(f-d),s.hold=w,s.bits=C},Fi}var Li,Ha;function Ls(){if(Ha)return Li;Ha=1;var t=ye(),e=15,i=852,a=592,r=0,s=1,h=2,n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Li=function(u,x,y,A,w,C,N,R){var U=R.bits,L=0,O=0,D=0,X=0,V=0,Q=0,tt=0,E=0,b=0,I=0,W,Y,q,_t,nt,bt=null,St=0,gt,st=new t.Buf16(e+1),ct=new t.Buf16(e+1),dt=null,at=0,ft,et,vt;for(L=0;L<=e;L++)st[L]=0;for(O=0;O<A;O++)st[x[y+O]]++;for(V=U,X=e;X>=1&&st[X]===0;X--);if(V>X&&(V=X),X===0)return w[C++]=1<<24|64<<16|0,w[C++]=1<<24|64<<16|0,R.bits=1,0;for(D=1;D<X&&st[D]===0;D++);for(V<D&&(V=D),E=1,L=1;L<=e;L++)if(E<<=1,E-=st[L],E<0)return-1;if(E>0&&(u===r||X!==1))return-1;for(ct[1]=0,L=1;L<e;L++)ct[L+1]=ct[L]+st[L];for(O=0;O<A;O++)x[y+O]!==0&&(N[ct[x[y+O]]++]=O);if(u===r?(bt=dt=N,gt=19):u===s?(bt=n,St-=257,dt=f,at-=257,gt=256):(bt=l,dt=d,gt=-1),I=0,O=0,L=D,nt=C,Q=V,tt=0,q=-1,b=1<<V,_t=b-1,u===s&&b>i||u===h&&b>a)return 1;for(;;){ft=L-tt,N[O]<gt?(et=0,vt=N[O]):N[O]>gt?(et=dt[at+N[O]],vt=bt[St+N[O]]):(et=96,vt=0),W=1<<L-tt,Y=1<<Q,D=Y;do Y-=W,w[nt+(I>>tt)+Y]=ft<<24|et<<16|vt|0;while(Y!==0);for(W=1<<L-1;I&W;)W>>=1;if(W!==0?(I&=W-1,I+=W):I=0,O++,--st[L]===0){if(L===X)break;L=x[y+N[O]]}if(L>V&&(I&_t)!==q){for(tt===0&&(tt=V),nt+=D,Q=L-tt,E=1<<Q;Q+tt<X&&(E-=st[Q+tt],!(E<=0));)Q++,E<<=1;if(b+=1<<Q,u===s&&b>i||u===h&&b>a)return 1;q=I&_t,w[q]=V<<24|Q<<16|nt-C|0}}return I!==0&&(w[nt+I]=L-tt<<24|64<<16|0),R.bits=V,0},Li}var Wa;function zs(){if(Wa)return Xt;Wa=1;var t=ye(),e=Hr(),i=Wr(),a=Fs(),r=Ls(),s=0,h=1,n=2,f=4,l=5,d=6,_=0,u=1,x=2,y=-2,A=-3,w=-4,C=-5,N=8,R=1,U=2,L=3,O=4,D=5,X=6,V=7,Q=8,tt=9,E=10,b=11,I=12,W=13,Y=14,q=15,_t=16,nt=17,bt=18,St=19,gt=20,st=21,ct=22,dt=23,at=24,ft=25,et=26,vt=27,Pt=28,It=29,it=30,Nt=31,ne=32,jt=852,qt=592,xt=15,rt=xt;function Zt(M){return(M>>>24&255)+(M>>>8&65280)+((M&65280)<<8)+((M&255)<<24)}function Ae(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function le(M){var G;return!M||!M.state?y:(G=M.state,M.total_in=M.total_out=G.total=0,M.msg="",G.wrap&&(M.adler=G.wrap&1),G.mode=R,G.last=0,G.havedict=0,G.dmax=32768,G.head=null,G.hold=0,G.bits=0,G.lencode=G.lendyn=new t.Buf32(jt),G.distcode=G.distdyn=new t.Buf32(qt),G.sane=1,G.back=-1,_)}function $t(M){var G;return!M||!M.state?y:(G=M.state,G.wsize=0,G.whave=0,G.wnext=0,le(M))}function Pe(M,G){var c,B;return!M||!M.state||(B=M.state,G<0?(c=0,G=-G):(c=(G>>4)+1,G<48&&(G&=15)),G&&(G<8||G>15))?y:(B.window!==null&&B.wbits!==G&&(B.window=null),B.wrap=c,B.wbits=G,$t(M))}function ue(M,G){var c,B;return M?(B=new Ae,M.state=B,B.window=null,c=Pe(M,G),c!==_&&(M.state=null),c):y}function Yt(M){return ue(M,rt)}var Ce=!0,ce,Rt;function ie(M){if(Ce){var G;for(ce=new t.Buf32(512),Rt=new t.Buf32(32),G=0;G<144;)M.lens[G++]=8;for(;G<256;)M.lens[G++]=9;for(;G<280;)M.lens[G++]=7;for(;G<288;)M.lens[G++]=8;for(r(h,M.lens,0,288,ce,0,M.work,{bits:9}),G=0;G<32;)M.lens[G++]=5;r(n,M.lens,0,32,Rt,0,M.work,{bits:5}),Ce=!1}M.lencode=ce,M.lenbits=9,M.distcode=Rt,M.distbits=5}function Ge(M,G,c,B){var J,o=M.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),B>=o.wsize?(t.arraySet(o.window,G,c-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(J=o.wsize-o.wnext,J>B&&(J=B),t.arraySet(o.window,G,c-B,J,o.wnext),B-=J,B?(t.arraySet(o.window,G,c-B,B,0),o.wnext=B,o.whave=o.wsize):(o.wnext+=J,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=J))),0}function g(M,G){var c,B,J,o,S,P,v,m,p,K,Z,$,ht,he,mt=0,ot,At,Dt,Ot,oi,fi,pt,Ht,Ct=new t.Buf8(4),oe,ae,Da=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return y;c=M.state,c.mode===I&&(c.mode=W),S=M.next_out,J=M.output,v=M.avail_out,o=M.next_in,B=M.input,P=M.avail_in,m=c.hold,p=c.bits,K=P,Z=v,Ht=_;t:for(;;)switch(c.mode){case R:if(c.wrap===0){c.mode=W;break}for(;p<16;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(c.wrap&2&&m===35615){c.check=0,Ct[0]=m&255,Ct[1]=m>>>8&255,c.check=i(c.check,Ct,2,0),m=0,p=0,c.mode=U;break}if(c.flags=0,c.head&&(c.head.done=!1),!(c.wrap&1)||(((m&255)<<8)+(m>>8))%31){M.msg="incorrect header check",c.mode=it;break}if((m&15)!==N){M.msg="unknown compression method",c.mode=it;break}if(m>>>=4,p-=4,pt=(m&15)+8,c.wbits===0)c.wbits=pt;else if(pt>c.wbits){M.msg="invalid window size",c.mode=it;break}c.dmax=1<<pt,M.adler=c.check=1,c.mode=m&512?E:I,m=0,p=0;break;case U:for(;p<16;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(c.flags=m,(c.flags&255)!==N){M.msg="unknown compression method",c.mode=it;break}if(c.flags&57344){M.msg="unknown header flags set",c.mode=it;break}c.head&&(c.head.text=m>>8&1),c.flags&512&&(Ct[0]=m&255,Ct[1]=m>>>8&255,c.check=i(c.check,Ct,2,0)),m=0,p=0,c.mode=L;case L:for(;p<32;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}c.head&&(c.head.time=m),c.flags&512&&(Ct[0]=m&255,Ct[1]=m>>>8&255,Ct[2]=m>>>16&255,Ct[3]=m>>>24&255,c.check=i(c.check,Ct,4,0)),m=0,p=0,c.mode=O;case O:for(;p<16;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}c.head&&(c.head.xflags=m&255,c.head.os=m>>8),c.flags&512&&(Ct[0]=m&255,Ct[1]=m>>>8&255,c.check=i(c.check,Ct,2,0)),m=0,p=0,c.mode=D;case D:if(c.flags&1024){for(;p<16;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}c.length=m,c.head&&(c.head.extra_len=m),c.flags&512&&(Ct[0]=m&255,Ct[1]=m>>>8&255,c.check=i(c.check,Ct,2,0)),m=0,p=0}else c.head&&(c.head.extra=null);c.mode=X;case X:if(c.flags&1024&&($=c.length,$>P&&($=P),$&&(c.head&&(pt=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),t.arraySet(c.head.extra,B,o,$,pt)),c.flags&512&&(c.check=i(c.check,B,$,o)),P-=$,o+=$,c.length-=$),c.length))break t;c.length=0,c.mode=V;case V:if(c.flags&2048){if(P===0)break t;$=0;do pt=B[o+$++],c.head&&pt&&c.length<65536&&(c.head.name+=String.fromCharCode(pt));while(pt&&$<P);if(c.flags&512&&(c.check=i(c.check,B,$,o)),P-=$,o+=$,pt)break t}else c.head&&(c.head.name=null);c.length=0,c.mode=Q;case Q:if(c.flags&4096){if(P===0)break t;$=0;do pt=B[o+$++],c.head&&pt&&c.length<65536&&(c.head.comment+=String.fromCharCode(pt));while(pt&&$<P);if(c.flags&512&&(c.check=i(c.check,B,$,o)),P-=$,o+=$,pt)break t}else c.head&&(c.head.comment=null);c.mode=tt;case tt:if(c.flags&512){for(;p<16;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(m!==(c.check&65535)){M.msg="header crc mismatch",c.mode=it;break}m=0,p=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),M.adler=c.check=0,c.mode=I;break;case E:for(;p<32;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}M.adler=c.check=Zt(m),m=0,p=0,c.mode=b;case b:if(c.havedict===0)return M.next_out=S,M.avail_out=v,M.next_in=o,M.avail_in=P,c.hold=m,c.bits=p,x;M.adler=c.check=1,c.mode=I;case I:if(G===l||G===d)break t;case W:if(c.last){m>>>=p&7,p-=p&7,c.mode=vt;break}for(;p<3;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}switch(c.last=m&1,m>>>=1,p-=1,m&3){case 0:c.mode=Y;break;case 1:if(ie(c),c.mode=gt,G===d){m>>>=2,p-=2;break t}break;case 2:c.mode=nt;break;case 3:M.msg="invalid block type",c.mode=it}m>>>=2,p-=2;break;case Y:for(m>>>=p&7,p-=p&7;p<32;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if((m&65535)!==(m>>>16^65535)){M.msg="invalid stored block lengths",c.mode=it;break}if(c.length=m&65535,m=0,p=0,c.mode=q,G===d)break t;case q:c.mode=_t;case _t:if($=c.length,$){if($>P&&($=P),$>v&&($=v),$===0)break t;t.arraySet(J,B,o,$,S),P-=$,o+=$,v-=$,S+=$,c.length-=$;break}c.mode=I;break;case nt:for(;p<14;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(c.nlen=(m&31)+257,m>>>=5,p-=5,c.ndist=(m&31)+1,m>>>=5,p-=5,c.ncode=(m&15)+4,m>>>=4,p-=4,c.nlen>286||c.ndist>30){M.msg="too many length or distance symbols",c.mode=it;break}c.have=0,c.mode=bt;case bt:for(;c.have<c.ncode;){for(;p<3;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}c.lens[Da[c.have++]]=m&7,m>>>=3,p-=3}for(;c.have<19;)c.lens[Da[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,oe={bits:c.lenbits},Ht=r(s,c.lens,0,19,c.lencode,0,c.work,oe),c.lenbits=oe.bits,Ht){M.msg="invalid code lengths set",c.mode=it;break}c.have=0,c.mode=St;case St:for(;c.have<c.nlen+c.ndist;){for(;mt=c.lencode[m&(1<<c.lenbits)-1],ot=mt>>>24,At=mt>>>16&255,Dt=mt&65535,!(ot<=p);){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(Dt<16)m>>>=ot,p-=ot,c.lens[c.have++]=Dt;else{if(Dt===16){for(ae=ot+2;p<ae;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(m>>>=ot,p-=ot,c.have===0){M.msg="invalid bit length repeat",c.mode=it;break}pt=c.lens[c.have-1],$=3+(m&3),m>>>=2,p-=2}else if(Dt===17){for(ae=ot+3;p<ae;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}m>>>=ot,p-=ot,pt=0,$=3+(m&7),m>>>=3,p-=3}else{for(ae=ot+7;p<ae;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}m>>>=ot,p-=ot,pt=0,$=11+(m&127),m>>>=7,p-=7}if(c.have+$>c.nlen+c.ndist){M.msg="invalid bit length repeat",c.mode=it;break}for(;$--;)c.lens[c.have++]=pt}}if(c.mode===it)break;if(c.lens[256]===0){M.msg="invalid code -- missing end-of-block",c.mode=it;break}if(c.lenbits=9,oe={bits:c.lenbits},Ht=r(h,c.lens,0,c.nlen,c.lencode,0,c.work,oe),c.lenbits=oe.bits,Ht){M.msg="invalid literal/lengths set",c.mode=it;break}if(c.distbits=6,c.distcode=c.distdyn,oe={bits:c.distbits},Ht=r(n,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,oe),c.distbits=oe.bits,Ht){M.msg="invalid distances set",c.mode=it;break}if(c.mode=gt,G===d)break t;case gt:c.mode=st;case st:if(P>=6&&v>=258){M.next_out=S,M.avail_out=v,M.next_in=o,M.avail_in=P,c.hold=m,c.bits=p,a(M,Z),S=M.next_out,J=M.output,v=M.avail_out,o=M.next_in,B=M.input,P=M.avail_in,m=c.hold,p=c.bits,c.mode===I&&(c.back=-1);break}for(c.back=0;mt=c.lencode[m&(1<<c.lenbits)-1],ot=mt>>>24,At=mt>>>16&255,Dt=mt&65535,!(ot<=p);){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(At&&(At&240)===0){for(Ot=ot,oi=At,fi=Dt;mt=c.lencode[fi+((m&(1<<Ot+oi)-1)>>Ot)],ot=mt>>>24,At=mt>>>16&255,Dt=mt&65535,!(Ot+ot<=p);){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}m>>>=Ot,p-=Ot,c.back+=Ot}if(m>>>=ot,p-=ot,c.back+=ot,c.length=Dt,At===0){c.mode=et;break}if(At&32){c.back=-1,c.mode=I;break}if(At&64){M.msg="invalid literal/length code",c.mode=it;break}c.extra=At&15,c.mode=ct;case ct:if(c.extra){for(ae=c.extra;p<ae;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}c.length+=m&(1<<c.extra)-1,m>>>=c.extra,p-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=dt;case dt:for(;mt=c.distcode[m&(1<<c.distbits)-1],ot=mt>>>24,At=mt>>>16&255,Dt=mt&65535,!(ot<=p);){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if((At&240)===0){for(Ot=ot,oi=At,fi=Dt;mt=c.distcode[fi+((m&(1<<Ot+oi)-1)>>Ot)],ot=mt>>>24,At=mt>>>16&255,Dt=mt&65535,!(Ot+ot<=p);){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}m>>>=Ot,p-=Ot,c.back+=Ot}if(m>>>=ot,p-=ot,c.back+=ot,At&64){M.msg="invalid distance code",c.mode=it;break}c.offset=Dt,c.extra=At&15,c.mode=at;case at:if(c.extra){for(ae=c.extra;p<ae;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}c.offset+=m&(1<<c.extra)-1,m>>>=c.extra,p-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){M.msg="invalid distance too far back",c.mode=it;break}c.mode=ft;case ft:if(v===0)break t;if($=Z-v,c.offset>$){if($=c.offset-$,$>c.whave&&c.sane){M.msg="invalid distance too far back",c.mode=it;break}$>c.wnext?($-=c.wnext,ht=c.wsize-$):ht=c.wnext-$,$>c.length&&($=c.length),he=c.window}else he=J,ht=S-c.offset,$=c.length;$>v&&($=v),v-=$,c.length-=$;do J[S++]=he[ht++];while(--$);c.length===0&&(c.mode=st);break;case et:if(v===0)break t;J[S++]=c.length,v--,c.mode=st;break;case vt:if(c.wrap){for(;p<32;){if(P===0)break t;P--,m|=B[o++]<<p,p+=8}if(Z-=v,M.total_out+=Z,c.total+=Z,Z&&(M.adler=c.check=c.flags?i(c.check,J,Z,S-Z):e(c.check,J,Z,S-Z)),Z=v,(c.flags?m:Zt(m))!==c.check){M.msg="incorrect data check",c.mode=it;break}m=0,p=0}c.mode=Pt;case Pt:if(c.wrap&&c.flags){for(;p<32;){if(P===0)break t;P--,m+=B[o++]<<p,p+=8}if(m!==(c.total&4294967295)){M.msg="incorrect length check",c.mode=it;break}m=0,p=0}c.mode=It;case It:Ht=u;break t;case it:Ht=A;break t;case Nt:return w;case ne:default:return y}return M.next_out=S,M.avail_out=v,M.next_in=o,M.avail_in=P,c.hold=m,c.bits=p,(c.wsize||Z!==M.avail_out&&c.mode<it&&(c.mode<vt||G!==f))&&Ge(M,M.output,M.next_out,Z-M.avail_out),K-=M.avail_in,Z-=M.avail_out,M.total_in+=K,M.total_out+=Z,c.total+=Z,c.wrap&&Z&&(M.adler=c.check=c.flags?i(c.check,J,Z,M.next_out-Z):e(c.check,J,Z,M.next_out-Z)),M.data_type=c.bits+(c.last?64:0)+(c.mode===I?128:0)+(c.mode===gt||c.mode===q?256:0),(K===0&&Z===0||G===f)&&Ht===_&&(Ht=C),Ht}function T(M){if(!M||!M.state)return y;var G=M.state;return G.window&&(G.window=null),M.state=null,_}function F(M,G){var c;return!M||!M.state||(c=M.state,(c.wrap&2)===0)?y:(c.head=G,G.done=!1,_)}function H(M,G){var c=G.length,B,J,o;return!M||!M.state||(B=M.state,B.wrap!==0&&B.mode!==b)?y:B.mode===b&&(J=1,J=e(J,G,c,0),J!==B.check)?A:(o=Ge(M,G,c,c),o?(B.mode=Nt,w):(B.havedict=1,_))}return Xt.inflateReset=$t,Xt.inflateReset2=Pe,Xt.inflateResetKeep=le,Xt.inflateInit=Yt,Xt.inflateInit2=ue,Xt.inflate=g,Xt.inflateEnd=T,Xt.inflateGetHeader=F,Xt.inflateSetDictionary=H,Xt.inflateInfo="pako inflate (from Nodeca project)",Xt}var zi,Xa;function Vr(){return Xa||(Xa=1,zi={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),zi}var Ui,Ka;function Us(){if(Ka)return Ui;Ka=1;function t(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return Ui=t,Ui}var Va;function qs(){if(Va)return Ne;Va=1;var t=zs(),e=ye(),i=Xr(),a=Vr(),r=va(),s=Kr(),h=Us(),n=Object.prototype.toString;function f(_){if(!(this instanceof f))return new f(_);this.options=e.assign({chunkSize:16384,windowBits:0,to:""},_||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,u.windowBits===0&&(u.windowBits=-15)),u.windowBits>=0&&u.windowBits<16&&!(_&&_.windowBits)&&(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&(u.windowBits&15)===0&&(u.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var x=t.inflateInit2(this.strm,u.windowBits);if(x!==a.Z_OK)throw new Error(r[x]);this.header=new h,t.inflateGetHeader(this.strm,this.header)}f.prototype.push=function(_,u){var x=this.strm,y=this.options.chunkSize,A=this.options.dictionary,w,C,N,R,U,L,O=!1;if(this.ended)return!1;C=u===~~u?u:u===!0?a.Z_FINISH:a.Z_NO_FLUSH,typeof _=="string"?x.input=i.binstring2buf(_):n.call(_)==="[object ArrayBuffer]"?x.input=new Uint8Array(_):x.input=_,x.next_in=0,x.avail_in=x.input.length;do{if(x.avail_out===0&&(x.output=new e.Buf8(y),x.next_out=0,x.avail_out=y),w=t.inflate(x,a.Z_NO_FLUSH),w===a.Z_NEED_DICT&&A&&(typeof A=="string"?L=i.string2buf(A):n.call(A)==="[object ArrayBuffer]"?L=new Uint8Array(A):L=A,w=t.inflateSetDictionary(this.strm,L)),w===a.Z_BUF_ERROR&&O===!0&&(w=a.Z_OK,O=!1),w!==a.Z_STREAM_END&&w!==a.Z_OK)return this.onEnd(w),this.ended=!0,!1;x.next_out&&(x.avail_out===0||w===a.Z_STREAM_END||x.avail_in===0&&(C===a.Z_FINISH||C===a.Z_SYNC_FLUSH))&&(this.options.to==="string"?(N=i.utf8border(x.output,x.next_out),R=x.next_out-N,U=i.buf2string(x.output,N),x.next_out=R,x.avail_out=y-R,R&&e.arraySet(x.output,x.output,N,R,0),this.onData(U)):this.onData(e.shrinkBuf(x.output,x.next_out))),x.avail_in===0&&x.avail_out===0&&(O=!0)}while((x.avail_in>0||x.avail_out===0)&&w!==a.Z_STREAM_END);return w===a.Z_STREAM_END&&(C=a.Z_FINISH),C===a.Z_FINISH?(w=t.inflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===a.Z_OK):(C===a.Z_SYNC_FLUSH&&(this.onEnd(a.Z_OK),x.avail_out=0),!0)},f.prototype.onData=function(_){this.chunks.push(_)},f.prototype.onEnd=function(_){_===a.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function l(_,u){var x=new f(u);if(x.push(_,!0),x.err)throw x.msg;return x.result}function d(_,u){return u=u||{},u.raw=!0,l(_,u)}return Ne.Inflate=f,Ne.inflate=l,Ne.inflateRaw=d,Ne.ungzip=l,Ne}var qi,Qa;function js(){if(Qa)return qi;Qa=1;var t=ye().assign,e=Os(),i=qs(),a=Vr(),r={};return t(r,e,i,a),qi=r,qi}var Ya;function Zs(){if(Ya)return Me;Ya=1;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",e=js();return Me.uncompressInputType=t?"uint8array":"array",Me.compressInputType=t?"uint8array":"array",Me.magic="\b\0",Me.compress=function(i,a){return e.deflateRaw(i,{level:a.level||-1})},Me.uncompress=function(i){return e.inflateRaw(i)},Me}var Ja;function ga(){return Ja||(Ja=1,ui.STORE={magic:"\0\0",compress:function(t,e){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},ui.DEFLATE=Zs()),ui}var ci={exports:{}},tr;function xa(){return tr||(tr=1,ci.exports=function(t,e){return new Buffer(t,e)},ci.exports.test=function(t){return Buffer.isBuffer(t)}),ci.exports}var er;function se(){return er||(er=1,(function(t){var e=ii(),i=ga(),a=xa();t.string2binary=function(l){for(var d="",_=0;_<l.length;_++)d+=String.fromCharCode(l.charCodeAt(_)&255);return d},t.arrayBuffer2Blob=function(l,d){t.checkSupport("blob"),d=d||"application/zip";try{return new Blob([l],{type:d})}catch{try{var _=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,u=new _;return u.append(l),u.getBlob(d)}catch{throw new Error("Bug : can't construct the Blob.")}}};function r(l){return l}function s(l,d){for(var _=0;_<l.length;++_)d[_]=l.charCodeAt(_)&255;return d}function h(l){var d=65536,_=[],u=l.length,x=t.getTypeOf(l),y=0,A=!0;try{switch(x){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,a(0));break}}catch{A=!1}if(!A){for(var w="",C=0;C<l.length;C++)w+=String.fromCharCode(l[C]);return w}for(;y<u&&d>1;)try{x==="array"||x==="nodebuffer"?_.push(String.fromCharCode.apply(null,l.slice(y,Math.min(y+d,u)))):_.push(String.fromCharCode.apply(null,l.subarray(y,Math.min(y+d,u)))),y+=d}catch{d=Math.floor(d/2)}return _.join("")}t.applyFromCharCode=h;function n(l,d){for(var _=0;_<l.length;_++)d[_]=l[_];return d}var f={};f.string={string:r,array:function(l){return s(l,new Array(l.length))},arraybuffer:function(l){return f.string.uint8array(l).buffer},uint8array:function(l){return s(l,new Uint8Array(l.length))},nodebuffer:function(l){return s(l,a(l.length))}},f.array={string:h,array:r,arraybuffer:function(l){return new Uint8Array(l).buffer},uint8array:function(l){return new Uint8Array(l)},nodebuffer:function(l){return a(l)}},f.arraybuffer={string:function(l){return h(new Uint8Array(l))},array:function(l){return n(new Uint8Array(l),new Array(l.byteLength))},arraybuffer:r,uint8array:function(l){return new Uint8Array(l)},nodebuffer:function(l){return a(new Uint8Array(l))}},f.uint8array={string:h,array:function(l){return n(l,new Array(l.length))},arraybuffer:function(l){return l.buffer},uint8array:r,nodebuffer:function(l){return a(l)}},f.nodebuffer={string:h,array:function(l){return n(l,new Array(l.length))},arraybuffer:function(l){return f.nodebuffer.uint8array(l).buffer},uint8array:function(l){return n(l,new Uint8Array(l.length))},nodebuffer:r},t.transformTo=function(l,d){if(d||(d=""),!l)return d;t.checkSupport(l);var _=t.getTypeOf(d),u=f[_][l](d);return u},t.getTypeOf=function(l){if(typeof l=="string")return"string";if(Object.prototype.toString.call(l)==="[object Array]")return"array";if(e.nodebuffer&&a.test(l))return"nodebuffer";if(e.uint8array&&l instanceof Uint8Array)return"uint8array";if(e.arraybuffer&&l instanceof ArrayBuffer)return"arraybuffer"},t.checkSupport=function(l){var d=e[l.toLowerCase()];if(!d)throw new Error(l+" is not supported by this browser")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(l){var d="",_,u;for(u=0;u<(l||"").length;u++)_=l.charCodeAt(u),d+="\\x"+(_<16?"0":"")+_.toString(16).toUpperCase();return d},t.findCompression=function(l){for(var d in i)if(i.hasOwnProperty(d)&&i[d].magic===l)return i[d];return null},t.isRegExp=function(l){return Object.prototype.toString.call(l)==="[object RegExp]"}})(Ri)),Ri}var ji,ir;function $s(){if(ir)return ji;ir=1;var t=se(),e=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];return ji=function(a,r){if(typeof a>"u"||!a.length)return 0;var s=t.getTypeOf(a)!=="string";typeof r>"u"&&(r=0);var h=0,n=0,f=0;r=r^-1;for(var l=0,d=a.length;l<d;l++)f=s?a[l]:a.charCodeAt(l),n=(r^f)&255,h=e[n],r=r>>>8^h;return r^-1},ji}var de={},ar;function Qr(){return ar||(ar=1,de.LOCAL_FILE_HEADER="PK",de.CENTRAL_FILE_HEADER="PK",de.CENTRAL_DIRECTORY_END="PK",de.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",de.ZIP64_CENTRAL_DIRECTORY_END="PK",de.DATA_DESCRIPTOR="PK\x07\b"),de}var Kt={},rr;function Yr(){return rr||(rr=1,Kt.base64=!1,Kt.binary=!1,Kt.dir=!1,Kt.createFolders=!1,Kt.date=null,Kt.compression=null,Kt.compressionOptions=null,Kt.comment=null,Kt.unixPermissions=null,Kt.dosPermissions=null),Kt}var Zi,sr;function Jr(){if(sr)return Zi;sr=1;function t(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}return t.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},Zi=t,Zi}var di={},nr;function Hs(){if(nr)return di;nr=1;for(var t=se(),e=ii(),i=xa(),a=new Array(256),r=0;r<256;r++)a[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;a[254]=a[254]=1;var s=function(f){var l,d,_,u,x,y=f.length,A=0;for(u=0;u<y;u++)d=f.charCodeAt(u),(d&64512)===55296&&u+1<y&&(_=f.charCodeAt(u+1),(_&64512)===56320&&(d=65536+(d-55296<<10)+(_-56320),u++)),A+=d<128?1:d<2048?2:d<65536?3:4;for(e.uint8array?l=new Uint8Array(A):l=new Array(A),x=0,u=0;x<A;u++)d=f.charCodeAt(u),(d&64512)===55296&&u+1<y&&(_=f.charCodeAt(u+1),(_&64512)===56320&&(d=65536+(d-55296<<10)+(_-56320),u++)),d<128?l[x++]=d:d<2048?(l[x++]=192|d>>>6,l[x++]=128|d&63):d<65536?(l[x++]=224|d>>>12,l[x++]=128|d>>>6&63,l[x++]=128|d&63):(l[x++]=240|d>>>18,l[x++]=128|d>>>12&63,l[x++]=128|d>>>6&63,l[x++]=128|d&63);return l},h=function(f,l){var d;for(l=l||f.length,l>f.length&&(l=f.length),d=l-1;d>=0&&(f[d]&192)===128;)d--;return d<0||d===0?l:d+a[f[d]]>l?d:l},n=function(f){var l,d,_,u,x=f.length,y=new Array(x*2);for(d=0,l=0;l<x;){if(_=f[l++],_<128){y[d++]=_;continue}if(u=a[_],u>4){y[d++]=65533,l+=u-1;continue}for(_&=u===2?31:u===3?15:7;u>1&&l<x;)_=_<<6|f[l++]&63,u--;if(u>1){y[d++]=65533;continue}_<65536?y[d++]=_:(_-=65536,y[d++]=55296|_>>10&1023,y[d++]=56320|_&1023)}return y.length!==d&&(y.subarray?y=y.subarray(0,d):y.length=d),t.applyFromCharCode(y)};return di.utf8encode=function(l){return e.nodebuffer?i(l,"utf-8"):s(l)},di.utf8decode=function(l){if(e.nodebuffer)return t.transformTo("nodebuffer",l).toString("utf-8");l=t.transformTo(e.uint8array?"uint8array":"array",l);for(var d=[],_=0,u=l.length,x=65536;_<u;){var y=h(l,Math.min(_+x,u));e.uint8array?d.push(n(l.subarray(_,y))):d.push(n(l.slice(_,y))),_=y}return d.join("")},di}var $i,hr;function Ws(){if(hr)return $i;hr=1;var t=se(),e=function(){this.data=[]};return e.prototype={append:function(i){i=t.transformTo("string",i),this.data.push(i)},finalize:function(){return this.data.join("")}},$i=e,$i}var Hi,or;function Xs(){if(or)return Hi;or=1;var t=se(),e=function(i){this.data=new Uint8Array(i),this.index=0};return e.prototype={append:function(i){i.length!==0&&(i=t.transformTo("uint8array",i),this.data.set(i,this.index),this.index+=i.length)},finalize:function(){return this.data}},Hi=e,Hi}var Wi,fr;function ya(){if(fr)return Wi;fr=1;var t=ii(),e=se(),i=$s(),a=Qr(),r=Yr(),s=_a(),h=ga(),n=Jr(),f=xa(),l=Hs(),d=Ws(),_=Xs(),u=function(E){if(E._data instanceof n&&(E._data=E._data.getContent(),E.options.binary=!0,E.options.base64=!1,e.getTypeOf(E._data)==="uint8array")){var b=E._data;E._data=new Uint8Array(b.length),b.length!==0&&E._data.set(b,0)}return E._data},x=function(E){var b=u(E),I=e.getTypeOf(b);return I==="string"?!E.options.binary&&t.nodebuffer?f(b,"utf-8"):E.asBinary():b},y=function(E){var b=u(this);return b===null||typeof b>"u"?"":(this.options.base64&&(b=s.decode(b)),E&&this.options.binary?b=tt.utf8decode(b):b=e.transformTo("string",b),!E&&!this.options.binary&&(b=e.transformTo("string",tt.utf8encode(b))),b)},A=function(E,b,I){this.name=E,this.dir=I.dir,this.date=I.date,this.comment=I.comment,this.unixPermissions=I.unixPermissions,this.dosPermissions=I.dosPermissions,this._data=b,this.options=I,this._initialMetadata={dir:I.dir,date:I.date}};A.prototype={asText:function(){return y.call(this,!0)},asBinary:function(){return y.call(this,!1)},asNodeBuffer:function(){var E=x(this);return e.transformTo("nodebuffer",E)},asUint8Array:function(){var E=x(this);return e.transformTo("uint8array",E)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var w=function(E,b){var I="",W;for(W=0;W<b;W++)I+=String.fromCharCode(E&255),E=E>>>8;return I},C=function(){var E={},b,I;for(b=0;b<arguments.length;b++)for(I in arguments[b])arguments[b].hasOwnProperty(I)&&typeof E[I]>"u"&&(E[I]=arguments[b][I]);return E},N=function(E){return E=E||{},E.base64===!0&&(E.binary===null||E.binary===void 0)&&(E.binary=!0),E=C(E,r),E.date=E.date||new Date,E.compression!==null&&(E.compression=E.compression.toUpperCase()),E},R=function(E,b,I){var W=e.getTypeOf(b),Y;if(I=N(I),typeof I.unixPermissions=="string"&&(I.unixPermissions=parseInt(I.unixPermissions,8)),I.unixPermissions&&I.unixPermissions&16384&&(I.dir=!0),I.dosPermissions&&I.dosPermissions&16&&(I.dir=!0),I.dir&&(E=L(E)),I.createFolders&&(Y=U(E))&&O.call(this,Y,!0),I.dir||b===null||typeof b>"u")I.base64=!1,I.binary=!1,b=null,W=null;else if(W==="string")I.binary&&!I.base64&&I.optimizedBinaryString!==!0&&(b=e.string2binary(b));else{if(I.base64=!1,I.binary=!0,!W&&!(b instanceof n))throw new Error("The data of '"+E+"' is in an unsupported format !");W==="arraybuffer"&&(b=e.transformTo("uint8array",b))}var q=new A(E,b,I);return this.files[E]=q,q},U=function(E){E.slice(-1)=="/"&&(E=E.substring(0,E.length-1));var b=E.lastIndexOf("/");return b>0?E.substring(0,b):""},L=function(E){return E.slice(-1)!="/"&&(E+="/"),E},O=function(E,b){return b=typeof b<"u"?b:!1,E=L(E),this.files[E]||R.call(this,E,null,{dir:!0,createFolders:b}),this.files[E]},D=function(E,b,I){var W=new n,Y;return E._data instanceof n?(W.uncompressedSize=E._data.uncompressedSize,W.crc32=E._data.crc32,W.uncompressedSize===0||E.dir?(b=h.STORE,W.compressedContent="",W.crc32=0):E._data.compressionMethod===b.magic?W.compressedContent=E._data.getCompressedContent():(Y=E._data.getContent(),W.compressedContent=b.compress(e.transformTo(b.compressInputType,Y),I))):(Y=x(E),(!Y||Y.length===0||E.dir)&&(b=h.STORE,Y=""),W.uncompressedSize=Y.length,W.crc32=i(Y),W.compressedContent=b.compress(e.transformTo(b.compressInputType,Y),I)),W.compressedSize=W.compressedContent.length,W.compressionMethod=b.magic,W},X=function(E,b){var I=E;return E||(I=b?16893:33204),(I&65535)<<16},V=function(E,b){return(E||0)&63},Q=function(E,b,I,W,Y){I.compressedContent;var q=e.transformTo("string",l.utf8encode(b.name)),_t=b.comment||"",nt=e.transformTo("string",l.utf8encode(_t)),bt=q.length!==b.name.length,St=nt.length!==_t.length,gt=b.options,st,ct,dt="",at="",ft="",et,vt;b._initialMetadata.dir!==b.dir?et=b.dir:et=gt.dir,b._initialMetadata.date!==b.date?vt=b.date:vt=gt.date;var Pt=0,It=0;et&&(Pt|=16),Y==="UNIX"?(It=798,Pt|=X(b.unixPermissions,et)):(It=20,Pt|=V(b.dosPermissions)),st=vt.getHours(),st=st<<6,st=st|vt.getMinutes(),st=st<<5,st=st|vt.getSeconds()/2,ct=vt.getFullYear()-1980,ct=ct<<4,ct=ct|vt.getMonth()+1,ct=ct<<5,ct=ct|vt.getDate(),bt&&(at=w(1,1)+w(i(q),4)+q,dt+="up"+w(at.length,2)+at),St&&(ft=w(1,1)+w(this.crc32(nt),4)+nt,dt+="uc"+w(ft.length,2)+ft);var it="";it+=`
|
||
\0`,it+=bt||St?"\0\b":"\0\0",it+=I.compressionMethod,it+=w(st,2),it+=w(ct,2),it+=w(I.crc32,4),it+=w(I.compressedSize,4),it+=w(I.uncompressedSize,4),it+=w(q.length,2),it+=w(dt.length,2);var Nt=a.LOCAL_FILE_HEADER+it+q+dt,ne=a.CENTRAL_FILE_HEADER+w(It,2)+it+w(nt.length,2)+"\0\0\0\0"+w(Pt,4)+w(W,4)+q+dt+nt;return{fileRecord:Nt,dirRecord:ne,compressedObject:I}},tt={load:function(E,b){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(E){var b=[],I,W,Y,q;for(I in this.files)this.files.hasOwnProperty(I)&&(Y=this.files[I],q=new A(Y.name,Y._data,C(Y.options)),W=I.slice(this.root.length,I.length),I.slice(0,this.root.length)===this.root&&E(W,q)&&b.push(q));return b},file:function(E,b,I){if(arguments.length===1)if(e.isRegExp(E)){var W=E;return this.filter(function(Y,q){return!q.dir&&W.test(Y)})}else return this.filter(function(Y,q){return!q.dir&&Y===E})[0]||null;else E=this.root+E,R.call(this,E,b,I);return this},folder:function(E){if(!E)return this;if(e.isRegExp(E))return this.filter(function(Y,q){return q.dir&&E.test(Y)});var b=this.root+E,I=O.call(this,b),W=this.clone();return W.root=I.name,W},remove:function(E){E=this.root+E;var b=this.files[E];if(b||(E.slice(-1)!="/"&&(E+="/"),b=this.files[E]),b&&!b.dir)delete this.files[E];else for(var I=this.filter(function(Y,q){return q.name.slice(0,E.length)===E}),W=0;W<I.length;W++)delete this.files[I[W].name];return this},generate:function(E){E=C(E||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip"}),e.checkSupport(E.type),(E.platform==="darwin"||E.platform==="freebsd"||E.platform==="linux"||E.platform==="sunos")&&(E.platform="UNIX"),E.platform==="win32"&&(E.platform="DOS");var b=[],I=0,W=0,Y,q,_t=e.transformTo("string",this.utf8encode(E.comment||this.comment||""));for(var nt in this.files)if(this.files.hasOwnProperty(nt)){var bt=this.files[nt],St=bt.options.compression||E.compression.toUpperCase(),gt=h[St];if(!gt)throw new Error(St+" is not a valid compression method !");var st=bt.options.compressionOptions||E.compressionOptions||{},ct=D.call(this,bt,gt,st),dt=Q.call(this,nt,bt,ct,I,E.platform);I+=dt.fileRecord.length+ct.compressedSize,W+=dt.dirRecord.length,b.push(dt)}var at="";at=a.CENTRAL_DIRECTORY_END+"\0\0\0\0"+w(b.length,2)+w(b.length,2)+w(W,4)+w(I,4)+w(_t.length,2)+_t;var ft=E.type.toLowerCase();for(ft==="uint8array"||ft==="arraybuffer"||ft==="blob"||ft==="nodebuffer"?Y=new _(I+W+at.length):Y=new d(I+W+at.length),q=0;q<b.length;q++)Y.append(b[q].fileRecord),Y.append(b[q].compressedObject.compressedContent);for(q=0;q<b.length;q++)Y.append(b[q].dirRecord);Y.append(at);var et=Y.finalize();switch(E.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return e.transformTo(E.type.toLowerCase(),et);case"blob":return e.arrayBuffer2Blob(e.transformTo("arraybuffer",et),E.mimeType);case"base64":return E.base64?s.encode(et):et;default:return et}},crc32:function(E,b){return i(E,b)},utf8encode:function(E){return e.transformTo("string",l.utf8encode(E))},utf8decode:function(E){return l.utf8decode(E)}};return Wi=tt,Wi}var Xi,lr;function ts(){if(lr)return Xi;lr=1;var t=se();function e(i){this.data=null,this.length=0,this.index=0}return e.prototype={checkOffset:function(i){this.checkIndex(this.index+i)},checkIndex:function(i){if(this.length<i||i<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+i+"). Corrupted zip ?")},setIndex:function(i){this.checkIndex(i),this.index=i},skip:function(i){this.setIndex(this.index+i)},byteAt:function(i){},readInt:function(i){var a=0,r;for(this.checkOffset(i),r=this.index+i-1;r>=this.index;r--)a=(a<<8)+this.byteAt(r);return this.index+=i,a},readString:function(i){return t.transformTo("string",this.readData(i))},readData:function(i){},lastIndexOfSignature:function(i){},readDate:function(){var i=this.readInt(4);return new Date((i>>25&127)+1980,(i>>21&15)-1,i>>16&31,i>>11&31,i>>5&63,(i&31)<<1)}},Xi=e,Xi}var Ki,ur;function es(){if(ur)return Ki;ur=1;var t=ts(),e=se();function i(a,r){this.data=a,r||(this.data=e.string2binary(this.data)),this.length=this.data.length,this.index=0}return i.prototype=new t,i.prototype.byteAt=function(a){return this.data.charCodeAt(a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)},i.prototype.readData=function(a){this.checkOffset(a);var r=this.data.slice(this.index,this.index+a);return this.index+=a,r},Ki=i,Ki}var Vi,cr;function is(){if(cr)return Vi;cr=1;var t=ts();function e(i){i&&(this.data=i,this.length=this.data.length,this.index=0)}return e.prototype=new t,e.prototype.byteAt=function(i){return this.data[i]},e.prototype.lastIndexOfSignature=function(i){for(var a=i.charCodeAt(0),r=i.charCodeAt(1),s=i.charCodeAt(2),h=i.charCodeAt(3),n=this.length-4;n>=0;--n)if(this.data[n]===a&&this.data[n+1]===r&&this.data[n+2]===s&&this.data[n+3]===h)return n;return-1},e.prototype.readData=function(i){if(this.checkOffset(i),i===0)return new Uint8Array(0);var a=this.data.subarray(this.index,this.index+i);return this.index+=i,a},Vi=e,Vi}var Qi,dr;function Ks(){if(dr)return Qi;dr=1;var t=is();function e(i){this.data=i,this.length=this.data.length,this.index=0}return e.prototype=new t,e.prototype.readData=function(i){this.checkOffset(i);var a=this.data.slice(this.index,this.index+i);return this.index+=i,a},Qi=e,Qi}var Yi,_r;function Vs(){if(_r)return Yi;_r=1;var t=es(),e=se(),i=Jr(),a=ya(),r=0,s=3;function h(n,f){this.options=n,this.loadOptions=f}return h.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},prepareCompressedContent:function(n,f,l){return function(){var d=n.index;n.setIndex(f);var _=n.readData(l);return n.setIndex(d),_}},prepareContent:function(n,f,l,d,_){return function(){var u=e.transformTo(d.uncompressInputType,this.getCompressedContent()),x=d.uncompress(u);if(x.length!==_)throw new Error("Bug : uncompressed data size mismatch");return x}},readLocalPart:function(n){var f,l;if(n.skip(22),this.fileNameLength=n.readInt(2),l=n.readInt(2),this.fileName=n.readString(this.fileNameLength),n.skip(l),this.compressedSize==-1||this.uncompressedSize==-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(f=e.findCompression(this.compressionMethod),f===null)throw new Error("Corrupted zip : compression "+e.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new i,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(n,n.index,this.compressedSize,f),this.decompressed.getContent=this.prepareContent(n,n.index,this.compressedSize,f,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=e.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(n){if(this.versionMadeBy=n.readInt(2),this.versionNeeded=n.readInt(2),this.bitFlag=n.readInt(2),this.compressionMethod=n.readString(2),this.date=n.readDate(),this.crc32=n.readInt(4),this.compressedSize=n.readInt(4),this.uncompressedSize=n.readInt(4),this.fileNameLength=n.readInt(2),this.extraFieldsLength=n.readInt(2),this.fileCommentLength=n.readInt(2),this.diskNumberStart=n.readInt(2),this.internalFileAttributes=n.readInt(2),this.externalFileAttributes=n.readInt(4),this.localHeaderOffset=n.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=n.readString(this.fileNameLength),this.readExtraFields(n),this.parseZIP64ExtraField(n),this.fileComment=n.readString(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var n=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),n===r&&(this.dosPermissions=this.externalFileAttributes&63),n===s&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileName.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(n){if(this.extraFields[1]){var f=new t(this.extraFields[1].value);this.uncompressedSize===e.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===e.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===e.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===e.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(n){var f=n.index,l,d,_;for(this.extraFields=this.extraFields||{};n.index<f+this.extraFieldsLength;)l=n.readInt(2),d=n.readInt(2),_=n.readString(d),this.extraFields[l]={id:l,length:d,value:_}},handleUTF8:function(){if(this.useUTF8())this.fileName=a.utf8decode(this.fileName),this.fileComment=a.utf8decode(this.fileComment);else{var n=this.findExtraFieldUnicodePath();n!==null&&(this.fileName=n);var f=this.findExtraFieldUnicodeComment();f!==null&&(this.fileComment=f)}},findExtraFieldUnicodePath:function(){var n=this.extraFields[28789];if(n){var f=new t(n.value);return f.readInt(1)!==1||a.crc32(this.fileName)!==f.readInt(4)?null:a.utf8decode(f.readString(n.length-5))}return null},findExtraFieldUnicodeComment:function(){var n=this.extraFields[25461];if(n){var f=new t(n.value);return f.readInt(1)!==1||a.crc32(this.fileComment)!==f.readInt(4)?null:a.utf8decode(f.readString(n.length-5))}return null}},Yi=h,Yi}var Ji,vr;function Qs(){if(vr)return Ji;vr=1;var t=es(),e=Ks(),i=is(),a=se(),r=Qr(),s=Vs(),h=ii(),n=ya();function f(l,d){this.files=[],this.loadOptions=d,l&&this.load(l)}return f.prototype={checkSignature:function(l){var d=this.reader.readString(4);if(d!==l)throw new Error("Corrupted zip or bug : unexpected signature ("+a.pretty(d)+", expected "+a.pretty(l)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=n.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var l=this.zip64EndOfCentralSize-44,d=0,_,u,x;d<l;)_=this.reader.readInt(2),u=this.reader.readInt(4),x=this.reader.readString(u),this.zip64ExtensibleData[_]={id:_,length:u,value:x}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var l,d;for(l=0;l<this.files.length;l++)d=this.files[l],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var l;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===r.CENTRAL_FILE_HEADER;)l=new s({zip64:this.zip64},this.loadOptions),l.readCentralPart(this.reader),this.files.push(l)},readEndOfCentral:function(){var l=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(l===-1){var d=!0;try{this.reader.setIndex(0),this.checkSignature(r.LOCAL_FILE_HEADER),d=!1}catch{}throw d?new Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip : can't find end of central directory")}if(this.reader.setIndex(l),this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,l=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),l===-1)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(l),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(l){var d=a.getTypeOf(l);d==="string"&&!h.uint8array?this.reader=new t(l,this.loadOptions.optimizedBinaryString):d==="nodebuffer"?this.reader=new e(l):this.reader=new i(a.transformTo("uint8array",l))},load:function(l){this.prepareReader(l),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},Ji=f,Ji}var ta,gr;function Ys(){if(gr)return ta;gr=1;var t=_a(),e=Qs();return ta=function(i,a){var r,s,h,n;for(a=a||{},a.base64&&(i=t.decode(i)),s=new e(i,a),r=s.files,h=0;h<r.length;h++)n=r[h],this.file(n.fileName,n.decompressed,{binary:!0,optimizedBinaryString:!0,date:n.date,dir:n.dir,comment:n.fileComment.length?n.fileComment:null,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions,createFolders:a.createFolders});return s.zipComment.length&&(this.comment=s.zipComment),this},ta}var Tt={},xr;function Js(){if(xr)return Tt;xr=1;var t=se();return Tt.string2binary=function(e){return t.string2binary(e)},Tt.string2Uint8Array=function(e){return t.transformTo("uint8array",e)},Tt.uint8Array2String=function(e){return t.transformTo("string",e)},Tt.string2Blob=function(e){var i=t.transformTo("arraybuffer",e);return t.arrayBuffer2Blob(i)},Tt.arrayBuffer2Blob=function(e){return t.arrayBuffer2Blob(e)},Tt.transformTo=function(e,i){return t.transformTo(e,i)},Tt.getTypeOf=function(e){return t.getTypeOf(e)},Tt.checkSupport=function(e){return t.checkSupport(e)},Tt.MAX_VALUE_16BITS=t.MAX_VALUE_16BITS,Tt.MAX_VALUE_32BITS=t.MAX_VALUE_32BITS,Tt.pretty=function(e){return t.pretty(e)},Tt.findCompression=function(e){return t.findCompression(e)},Tt.isRegExp=function(e){return t.isRegExp(e)},Tt}var ea,yr;function Sl(){if(yr)return ea;yr=1;var t=_a();function e(i,a){if(!(this instanceof e))return new e(i,a);this.files={},this.comment=null,this.root="",i&&this.load(i,a),this.clone=function(){var r=new e;for(var s in this)typeof this[s]!="function"&&(r[s]=this[s]);return r}}return e.prototype=ya(),e.prototype.load=Ys(),e.support=ii(),e.defaults=Yr(),e.utils=Js(),e.base64={encode:function(i){return t.encode(i)},decode:function(i){return t.decode(i)}},e.compressions=ga(),ea=e,ea}function tn(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 pe=1,Se=2,Oe=3,en=4,ha=5,mr=6378137,an=6356752314e-3,Mr=.0066943799901413165,He=484813681109536e-20,k=Math.PI/2,rn=.16666666666666666,sn=.04722222222222222,nn=.022156084656084655,z=1e-10,Mt=.017453292519943295,zt=57.29577951308232,lt=Math.PI/4,Qe=Math.PI*2,wt=3.14159265359,Ut={};Ut.greenwich=0;Ut.lisbon=-9.131906111111;Ut.paris=2.337229166667;Ut.bogota=-74.080916666667;Ut.madrid=-3.687938888889;Ut.rome=12.452333333333;Ut.bern=7.439583333333;Ut.jakarta=106.807719444444;Ut.ferro=-17.666666666667;Ut.brussels=4.367975;Ut.stockholm=18.058277777778;Ut.athens=23.7163375;Ut.oslo=10.722916666667;const hn={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 wr=/[\s_\-\/\(\)]/g;function ge(t,e){if(t[e])return t[e];for(var i=Object.keys(t),a=e.toLowerCase().replace(wr,""),r=-1,s,h;++r<i.length;)if(s=i[r],h=s.toLowerCase().replace(wr,""),h===a)return t[s]}function oa(t){var e={},i=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,f){var l=f.split("=");return l.push(!0),n[l[0].toLowerCase()]=l[1],n},{}),a,r,s,h={proj:"projName",datum:"datumCode",rf:function(n){e.rf=parseFloat(n)},lat_0:function(n){e.lat0=n*Mt},lat_1:function(n){e.lat1=n*Mt},lat_2:function(n){e.lat2=n*Mt},lat_ts:function(n){e.lat_ts=n*Mt},lon_0:function(n){e.long0=n*Mt},lon_1:function(n){e.long1=n*Mt},lon_2:function(n){e.long2=n*Mt},alpha:function(n){e.alpha=parseFloat(n)*Mt},gamma:function(n){e.rectified_grid_angle=parseFloat(n)*Mt},lonc:function(n){e.longc=n*Mt},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(f){return parseFloat(f)})},to_meter:function(n){e.to_meter=parseFloat(n)},units:function(n){e.units=n;var f=ge(hn,n);f&&(e.to_meter=f.to_meter)},from_greenwich:function(n){e.from_greenwich=n*Mt},pm:function(n){var f=ge(Ut,n);e.from_greenwich=(f||parseFloat(n))*Mt},nadgrids:function(n){n==="@null"?e.datumCode="none":e.nadgrids=n},axis:function(n){var f="ewnsud";n.length===3&&f.indexOf(n.substr(0,1))!==-1&&f.indexOf(n.substr(1,1))!==-1&&f.indexOf(n.substr(2,1))!==-1&&(e.axis=n)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(a in i)r=i[a],a in h?(s=h[a],typeof s=="function"?s(r):e[s]=r):e[a]=r;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=t,e}class as{static getId(e){const i=e.find(a=>Array.isArray(a)&&a[0]==="ID");return i&&i.length>=3?{authority:i[1],code:parseInt(i[2],10)}:null}static convertUnit(e,i="unit"){if(!e||e.length<3)return{type:i,name:"unknown",conversion_factor:null};const a=e[1],r=parseFloat(e[2])||null,s=e.find(n=>Array.isArray(n)&&n[0]==="ID"),h=s?{authority:s[1],code:parseInt(s[2],10)}:null;return{type:i,name:a,conversion_factor:r,id:h}}static convertAxis(e){const i=e[1]||"Unknown";let a;const r=i.match(/^\((.)\)$/);if(r){const l=r[1].toUpperCase();if(l==="E")a="east";else if(l==="N")a="north";else if(l==="U")a="up";else throw new Error(`Unknown axis abbreviation: ${l}`)}else a=e[2]?e[2].toLowerCase():"unknown";const s=e.find(l=>Array.isArray(l)&&l[0]==="ORDER"),h=s?parseInt(s[1],10):null,n=e.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),f=this.convertUnit(n);return{name:i,direction:a,unit:f,order:h}}static extractAxes(e){return e.filter(i=>Array.isArray(i)&&i[0]==="AXIS").map(i=>this.convertAxis(i)).sort((i,a)=>(i.order||0)-(a.order||0))}static convert(e,i={}){switch(e[0]){case"PROJCRS":i.type="ProjectedCRS",i.name=e[1],i.base_crs=e.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")):null,i.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&&(i.coordinate_system={type:a[1],axis:this.extractAxes(e)});const r=e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT");if(r){const u=this.convertUnit(r);i.coordinate_system.unit=u}i.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":i.type="GeographicCRS",i.name=e[1];const s=e.find(u=>Array.isArray(u)&&(u[0]==="DATUM"||u[0]==="ENSEMBLE"));if(s){const u=this.convert(s);s[0]==="ENSEMBLE"?i.datum_ensemble=u:i.datum=u;const x=e.find(y=>Array.isArray(y)&&y[0]==="PRIMEM");x&&x[1]!=="Greenwich"&&(u.prime_meridian={name:x[1],longitude:parseFloat(x[2])})}i.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},i.id=this.getId(e);break;case"DATUM":i.type="GeodeticReferenceFrame",i.name=e[1],i.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":i.type="DatumEnsemble",i.name=e[1],i.members=e.filter(u=>Array.isArray(u)&&u[0]==="MEMBER").map(u=>({type:"DatumEnsembleMember",name:u[1],id:this.getId(u)}));const h=e.find(u=>Array.isArray(u)&&u[0]==="ENSEMBLEACCURACY");h&&(i.accuracy=parseFloat(h[1]));const n=e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID");n&&(i.ellipsoid=this.convert(n)),i.id=this.getId(e);break;case"ELLIPSOID":i.type="Ellipsoid",i.name=e[1],i.semi_major_axis=parseFloat(e[2]),i.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"),i);break;case"CONVERSION":i.type="Conversion",i.name=e[1],i.method=e.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,i.parameters=e.filter(u=>Array.isArray(u)&&u[0]==="PARAMETER").map(u=>this.convert(u));break;case"METHOD":i.type="Method",i.name=e[1],i.id=this.getId(e);break;case"PARAMETER":i.type="Parameter",i.name=e[1],i.value=parseFloat(e[2]),i.unit=this.convertUnit(e.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT"))),i.id=this.getId(e);break;case"BOUNDCRS":i.type="BoundCRS";const f=e.find(u=>Array.isArray(u)&&u[0]==="SOURCECRS");if(f){const u=f.find(x=>Array.isArray(x));i.source_crs=u?this.convert(u):null}const l=e.find(u=>Array.isArray(u)&&u[0]==="TARGETCRS");if(l){const u=l.find(x=>Array.isArray(x));i.target_crs=u?this.convert(u):null}const d=e.find(u=>Array.isArray(u)&&u[0]==="ABRIDGEDTRANSFORMATION");d?i.transformation=this.convert(d):i.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(i.type="Transformation",i.name=e[1],i.method=e.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,i.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}}}),i.parameters.length===7){const u=i.parameters[6];u.name==="Scale difference"&&(u.value=Math.round((u.value-1)*1e12)/1e6)}i.id=this.getId(e);break;case"AXIS":i.coordinate_system||(i.coordinate_system={type:"unspecified",axis:[]}),i.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const _=this.convertUnit(e,"LinearUnit");i.coordinate_system&&i.coordinate_system.axis&&i.coordinate_system.axis.forEach(u=>{u.unit||(u.unit=_)}),_.conversion_factor&&_.conversion_factor!==1&&i.semi_major_axis&&(i.semi_major_axis={value:i.semi_major_axis,unit:_});break;default:i.keyword=e[0];break}return i}}class on extends as{static convert(e,i={}){return super.convert(e,i),i.coordinate_system&&i.coordinate_system.subtype==="Cartesian"&&delete i.coordinate_system,i.usage&&delete i.usage,i}}class fn extends as{static convert(e,i={}){super.convert(e,i);const a=e.find(s=>Array.isArray(s)&&s[0]==="CS");a&&(i.coordinate_system={subtype:a[1],axis:this.extractAxes(e)});const r=e.find(s=>Array.isArray(s)&&s[0]==="USAGE");if(r){const s=r.find(f=>Array.isArray(f)&&f[0]==="SCOPE"),h=r.find(f=>Array.isArray(f)&&f[0]==="AREA"),n=r.find(f=>Array.isArray(f)&&f[0]==="BBOX");i.usage={},s&&(i.usage.scope=s[1]),h&&(i.usage.area=h[1]),n&&(i.usage.bbox=n.slice(1))}return i}}function ln(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 un(t){return(ln(t)==="2019"?fn:on).convert(t)}function cn(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 Ye=1,rs=2,ss=3,wi=4,ns=5,ma=-1,dn=/\s/,_n=/[A-Za-z]/,vn=/[A-Za-z84_]/,Gi=/[,\]]/,hs=/[\d\.E\-\+]/;function fe(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=Ye}fe.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==wi)for(;dn.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Ye:return this.neutral(t);case rs:return this.keyword(t);case wi:return this.quoted(t);case ns:return this.afterquote(t);case ss:return this.number(t);case ma:return}};fe.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=wi;return}if(Gi.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};fe.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ye;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Ye,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ma);return}};fe.prototype.number=function(t){if(hs.test(t)){this.word+=t;return}if(Gi.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};fe.prototype.quoted=function(t){if(t==='"'){this.state=ns;return}this.word+=t};fe.prototype.keyword=function(t){if(vn.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=Ye;return}if(Gi.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};fe.prototype.neutral=function(t){if(_n.test(t)){this.word=t,this.state=rs;return}if(t==='"'){this.word="",this.state=wi;return}if(hs.test(t)){this.word=t,this.state=ss;return}if(Gi.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};fe.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ma)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function gn(t){var e=new fe(t);return e.output()}function ia(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var a=e?{}:t,r=i.reduce(function(s,h){return De(h,s),s},a);e&&(t[e]=r)}function De(t,e){if(!Array.isArray(t)){e[t]=!0;return}var i=t.shift();if(i==="PARAMETER"&&(i=t.shift()),t.length===1){if(Array.isArray(t[0])){e[i]={},De(t[0],e[i]);return}e[i]=t[0];return}if(!t.length){e[i]=!0;return}if(i==="TOWGS84"){e[i]=t;return}if(i==="AXIS"){i in e||(e[i]=[]),e[i].push(t);return}Array.isArray(i)||(e[i]={});var a;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[i]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&De(t[2],e[i]);return;case"SPHEROID":case"ELLIPSOID":e[i]={name:t[0],a:t[1],rf:t[2]},t.length===4&&De(t[3],e[i]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],ia(e,i,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]],ia(e,i,t),e[i].type=i;return;default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return De(t,e[i]);return ia(e,i,t)}}var xn=.017453292519943295;function te(t){return t*xn}function os(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");!t.long0&&t.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(t.lat0=te(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=te(t.lat0>0?90:-90),delete t.lat1)}function Er(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 br(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function pr(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=br(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-br(t.ellipsoid.semi_minor_axis))))}function Ei(t,e={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(Ei(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(i=>i.value)),e):(Object.keys(t).forEach(i=>{const a=t[i];if(a!==null)switch(i){case"name":if(e.srsCode)break;e.name=a,e.srsCode=a;break;case"type":a==="GeographicCRS"?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,pr(a,e)),a.prime_meridian&&(e.from_greenwich=a.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=a.name,pr(a,e);break;case"prime_meridian":e.long0=(a.longitude||0)*Math.PI/180;break;case"coordinate_system":if(a.axis){if(e.axis=a.axis.map(r=>{const s=r.direction;if(s==="east")return"e";if(s==="north")return"n";if(s==="west")return"w";if(s==="south")return"s";throw new Error(`Unknown axis direction: ${s}`)}).join("")+"u",a.unit){const{units:r,to_meter:s}=Er(a.unit);e.units=r,e.to_meter=s}else if(a.axis[0]&&a.axis[0].unit){const{units:r,to_meter:s}=Er(a.axis[0].unit);e.units=r,e.to_meter=s}}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(r=>{const s=r.name.toLowerCase().replace(/\s+/g,"_"),h=r.value;r.unit&&r.unit.conversion_factor?e[s]=h*r.unit.conversion_factor:r.unit==="degree"?e[s]=h*Math.PI/180:e[s]=h});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":Ei(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),os(e),e)}var yn=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function mn(t,e){var i=e[0],a=e[1];!(i in t)&&a in t&&(t[i]=t[a],e.length===3&&(t[i]=e[2](t[i])))}function fs(t){for(var e=Object.keys(t),i=0,a=e.length;i<a;++i){var r=e[i];yn.indexOf(r)!==-1&&Mn(t[r]),typeof t[r]=="object"&&fs(t[r])}}function Mn(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 i="",a=0,r=t.AXIS.length;a<r;++a){var s=[t.AXIS[a][0].toLowerCase(),t.AXIS[a][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?i+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?i+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?i+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(i+="w")}i.length===2&&(i+="u"),i.length===3&&(t.axis=i)}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 h=t.GEOGCS;t.type==="GEOGCS"&&(h=t),h&&(h.DATUM?t.datumCode=h.DATUM.name.toLowerCase():t.datumCode=h.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"),h.DATUM&&h.DATUM.SPHEROID&&(t.ellps=h.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=h.DATUM.SPHEROID.a,t.rf=parseFloat(h.DATUM.SPHEROID.rf,10)),h.DATUM&&h.DATUM.TOWGS84&&(t.datum_params=h.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=te(t.rectified_grid_angle));function n(d){var _=t.to_meter||1;return d*_}var f=function(d){return mn(t,d)},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",te],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",te],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",te],["lat0","latitude_of_origin",te],["lat0","standard_parallel_1",te],["lat1","standard_parallel_1",te],["lat2","standard_parallel_2",te],["azimuth","Azimuth"],["alpha","azimuth",te],["srsCode","name"]];l.forEach(f),os(t)}function bi(t){if(typeof t=="object")return Ei(t);const e=cn(t);var i=gn(t);if(e==="WKT2"){const s=un(i);return Ei(s)}var a=i[0],r={};return De(i,r),fs(r),r[a]}function Gt(t){var e=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?Gt[t]=oa(arguments[1]):Gt[t]=bi(arguments[1]):i&&typeof i=="object"&&!("projName"in i)?Gt[t]=bi(arguments[1]):(Gt[t]=i,i||delete Gt[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(a){return Array.isArray(a)?Gt.apply(e,a):Gt(a)});if(typeof t=="string"){if(t in Gt)return Gt[t]}else"EPSG"in t?Gt["EPSG:"+t.EPSG]=t:"ESRI"in t?Gt["ESRI:"+t.ESRI]=t:"IAU2000"in t?Gt["IAU2000:"+t.IAU2000]=t:console.log(t);return}}tn(Gt);function wn(t){return typeof t=="string"}function En(t){return t in Gt}function bn(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var Sr=["3857","900913","3785","102113"];function pn(t){if(t.title)return t.title.toLowerCase().indexOf("epsg:")===0&&Sr.indexOf(t.title.substr(5))>-1;var e=ge(t,"authority");if(e){var i=ge(e,"epsg");return i&&Sr.indexOf(i)>-1}}function Sn(t){var e=ge(t,"extension");if(e)return ge(e,"proj4")}function An(t){return t[0]==="+"}function Pn(t){if(wn(t)){if(En(t))return Gt[t];if(bn(t)){var e=bi(t);if(pn(e))return Gt["EPSG:3857"];var i=Sn(e);return i?oa(i):e}if(An(t))return oa(t)}else return"projName"in t?t:bi(t)}function Ar(t,e){t=t||{};var i,a;if(!e)return t;for(a in e)i=e[a],i!==void 0&&(t[a]=i);return t}function re(t,e,i){var a=t*e;return i/Math.sqrt(1-a*a)}function ai(t){return t<0?-1:1}function j(t,e){return e||Math.abs(t)<=wt?t:t-ai(t)*Qe}function ee(t,e,i){var a=t*i,r=.5*t;return a=Math.pow((1-a)/(1+a),r),Math.tan(.5*(k-e))/a}function Je(t,e){for(var i=.5*t,a,r,s=k-2*Math.atan(e),h=0;h<=15;h++)if(a=t*Math.sin(s),r=k-2*Math.atan(e*Math.pow((1-a)/(1+a),i))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}function Cn(){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=re(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Gn(t){var e=t.x,i=t.y;if(i*zt>90&&i*zt<-90&&e*zt>180&&e*zt<-180)return null;var a,r;if(Math.abs(Math.abs(i)-k)<=z)return null;if(this.sphere)a=this.x0+this.a*this.k0*j(e-this.long0,this.over),r=this.y0+this.a*this.k0*Math.log(Math.tan(lt+.5*i));else{var s=Math.sin(i),h=ee(this.e,i,s);a=this.x0+this.a*this.k0*j(e-this.long0,this.over),r=this.y0-this.a*this.k0*Math.log(h)}return t.x=a,t.y=r,t}function In(t){var e=t.x-this.x0,i=t.y-this.y0,a,r;if(this.sphere)r=k-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(r=Je(this.e,s),r===-9999)return null}return a=j(this.long0+e/(this.a*this.k0),this.over),t.x=a,t.y=r,t}var Nn=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const Rn={init:Cn,forward:Gn,inverse:In,names:Nn};function Dn(){}function Pr(t){return t}var ls=["longlat","identity"];const kn={init:Dn,forward:Pr,inverse:Pr,names:ls};var Tn=[Rn,kn],be={},ke=[];function us(t,e){var i=ke.length;return t.names?(ke[i]=t,t.names.forEach(function(a){be[a.toLowerCase()]=i}),this):(console.log(e),!0)}function cs(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function Bn(t){if(!t)return!1;var e=t.toLowerCase();if(typeof be[e]<"u"&&ke[be[e]]||(e=cs(e),e in be&&ke[be[e]]))return ke[be[e]]}function On(){Tn.forEach(us)}const Fn={start:On,add:us,get:Bn};var ds={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 Ln=ds.WGS84;function zn(t,e,i,a){var r=t*t,s=e*e,h=(r-s)/r,n=0;a?(t*=1-h*(rn+h*(sn+h*nn)),r=t*t,h=0):n=Math.sqrt(h);var f=(r-s)/s;return{es:h,e:n,ep2:f}}function Un(t,e,i,a,r){if(!t){var s=ge(ds,a);s||(s=Ln),t=s.a,e=s.b,i=s.rf}return i&&!e&&(e=(1-1/i)*t),(i===0||Math.abs(t-e)<z)&&(r=!0,e=t),{a:t,b:e,rf:i,sphere:r}}var xi={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var qn in xi){var aa=xi[qn];aa.datumName&&(xi[aa.datumName]=aa)}function jn(t,e,i,a,r,s,h){var n={};return t===void 0||t==="none"?n.datum_type=ha:n.datum_type=en,e&&(n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=pe),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=Se,n.datum_params[3]*=He,n.datum_params[4]*=He,n.datum_params[5]*=He,n.datum_params[6]=n.datum_params[6]/1e6+1)),h&&(n.datum_type=Oe,n.grids=h),n.a=i,n.b=a,n.es=r,n.ep2=s,n}var Ma={};function Zn(t,e,i){return e instanceof ArrayBuffer?$n(t,e,i):{ready:Hn(t,e)}}function $n(t,e,i){var a=!0;i!==void 0&&i.includeErrorFields===!1&&(a=!1);var r=new DataView(e),s=Kn(r),h=Vn(r,s),n=Qn(r,h,s,a),f={header:h,subgrids:n};return Ma[t]=f,f}async function Hn(t,e){for(var i=[],a=await e.getImageCount(),r=a-1;r>=0;r--){var s=await e.getImage(r),h=await s.readRasters(),n=h,f=[s.getWidth(),s.getHeight()],l=s.getBoundingBox().map(Cr),d=[s.fileDirectory.ModelPixelScale[0],s.fileDirectory.ModelPixelScale[1]].map(Cr),_=l[0]+(f[0]-1)*d[0],u=l[3]-(f[1]-1)*d[1],x=n[0],y=n[1],A=[];for(let N=f[1]-1;N>=0;N--)for(let R=f[0]-1;R>=0;R--){var w=N*f[0]+R;A.push([-_e(y[w]),_e(x[w])])}i.push({del:d,lim:f,ll:[-_,u],cvs:A})}var C={header:{nSubgrids:a},subgrids:i};return Ma[t]=C,C}function Wn(t){if(t===void 0)return null;var e=t.split(",");return e.map(Xn)}function Xn(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:Ma[t]||null,isNull:!1}}function Cr(t){return t*Math.PI/180}function _e(t){return t/3600*Math.PI/180}function Kn(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 Vn(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:fa(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function fa(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function Qn(t,e,i,a){for(var r=176,s=[],h=0;h<e.nSubgrids;h++){var n=Jn(t,r,i),f=th(t,r,n,i,a),l=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),d=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);s.push({ll:[_e(n.lowerLongitude),_e(n.lowerLatitude)],del:[_e(n.longitudeInterval),_e(n.latitudeInterval)],lim:[l,d],count:n.gridNodeCount,cvs:Yn(f)});var _=16;a===!1&&(_=8),r+=176+n.gridNodeCount*_}return s}function Yn(t){return t.map(function(e){return[_e(e.longitudeShift),_e(e.latitudeShift)]})}function Jn(t,e,i){return{name:fa(t,e+8,e+16).trim(),parent:fa(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function th(t,e,i,a,r){var s=e+176,h=16;r===!1&&(h=8);for(var n=[],f=0;f<i.gridNodeCount;f++){var l={latitudeShift:t.getFloat32(s+f*h,a),longitudeShift:t.getFloat32(s+f*h+4,a)};r!==!1&&(l.latitudeAccuracy=t.getFloat32(s+f*h+8,a),l.longitudeAccuracy=t.getFloat32(s+f*h+12,a)),n.push(l)}return n}function Qt(t,e){if(!(this instanceof Qt))return new Qt(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(l){if(l)throw l};var i=Pn(t);if(typeof i!="object"){e("Could not parse to valid json: "+t);return}var a=Qt.projections.get(i.projName);if(!a){e("Could not get projection name from: "+t);return}if(i.datumCode&&i.datumCode!=="none"){var r=ge(xi,i.datumCode);r&&(i.datum_params=i.datum_params||(r.towgs84?r.towgs84.split(","):null),i.ellps=r.ellipse,i.datumName=r.datumName?r.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var s=Un(i.a,i.b,i.rf,i.ellps,i.sphere),h=zn(s.a,s.b,s.rf,i.R_A),n=Wn(i.nadgrids),f=i.datum||jn(i.datumCode,i.datum_params,s.a,s.b,h.es,h.ep2,n);Ar(this,i),Ar(this,a),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=h.es,this.e=h.e,this.ep2=h.ep2,this.datum=f,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}Qt.projections=Fn;Qt.projections.start();function eh(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===pe?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===Se?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 _s(t,e,i){var a=t.x,r=t.y,s=t.z?t.z:0,h,n,f,l;if(r<-k&&r>-1.001*k)r=-k;else if(r>k&&r<1.001*k)r=k;else{if(r<-k)return{x:-1/0,y:-1/0,z:t.z};if(r>k)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(r),l=Math.cos(r),f=n*n,h=i/Math.sqrt(1-e*f),{x:(h+s)*l*Math.cos(a),y:(h+s)*l*Math.sin(a),z:(h*(1-e)+s)*n}}function vs(t,e,i,a){var r=1e-12,s=r*r,h=30,n,f,l,d,_,u,x,y,A,w,C,N,R,U=t.x,L=t.y,O=t.z?t.z:0,D,X,V;if(n=Math.sqrt(U*U+L*L),f=Math.sqrt(U*U+L*L+O*O),n/i<r){if(D=0,f/i<r)return X=k,V=-a,{x:t.x,y:t.y,z:t.z}}else D=Math.atan2(L,U);l=O/f,d=n/f,_=1/Math.sqrt(1-e*(2-e)*d*d),y=d*(1-e)*_,A=l*_,R=0;do R++,x=i/Math.sqrt(1-e*A*A),V=n*y+O*A-x*(1-e*A*A),u=e*x/(x+V),_=1/Math.sqrt(1-u*(2-u)*d*d),w=d*(1-u)*_,C=l*_,N=C*y-w*A,y=w,A=C;while(N*N>s&&R<h);return X=Math.atan(C/Math.abs(w)),{x:D,y:X,z:V}}function ih(t,e,i){if(e===pe)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===Se){var a=i[0],r=i[1],s=i[2],h=i[3],n=i[4],f=i[5],l=i[6];return{x:l*(t.x-f*t.y+n*t.z)+a,y:l*(f*t.x+t.y-h*t.z)+r,z:l*(-n*t.x+h*t.y+t.z)+s}}}function ah(t,e,i){if(e===pe)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===Se){var a=i[0],r=i[1],s=i[2],h=i[3],n=i[4],f=i[5],l=i[6],d=(t.x-a)/l,_=(t.y-r)/l,u=(t.z-s)/l;return{x:d+f*_-n*u,y:-f*d+_+h*u,z:n*d-h*_+u}}}function _i(t){return t===pe||t===Se}function rh(t,e,i){if(eh(t,e)||t.datum_type===ha||e.datum_type===ha)return i;var a=t.a,r=t.es;if(t.datum_type===Oe){var s=Gr(t,!1,i);if(s!==0)return;a=mr,r=Mr}var h=e.a,n=e.b,f=e.es;if(e.datum_type===Oe&&(h=mr,n=an,f=Mr),r===f&&a===h&&!_i(t.datum_type)&&!_i(e.datum_type))return i;if(i=_s(i,r,a),_i(t.datum_type)&&(i=ih(i,t.datum_type,t.datum_params)),_i(e.datum_type)&&(i=ah(i,e.datum_type,e.datum_params)),i=vs(i,f,h,n),e.datum_type===Oe){var l=Gr(e,!0,i);if(l!==0)return}return i}function Gr(t,e,i){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var a={x:-i.x,y:i.y},r={x:Number.NaN,y:Number.NaN},s=[];t:for(var h=0;h<t.grids.length;h++){var n=t.grids[h];if(s.push(n.name),n.isNull){r=a;break}if(n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var f=n.grid.subgrids,l=0,d=f.length;l<d;l++){var _=f[l],u=(Math.abs(_.del[1])+Math.abs(_.del[0]))/1e4,x=_.ll[0]-u,y=_.ll[1]-u,A=_.ll[0]+(_.lim[0]-1)*_.del[0]+u,w=_.ll[1]+(_.lim[1]-1)*_.del[1]+u;if(!(y>a.y||x>a.x||w<a.y||A<a.x)&&(r=sh(a,e,_),!isNaN(r.x)))break t}}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*zt+" "+a.y*zt+" tried: '"+s+"'"),-1):(i.x=-r.x,i.y=r.y,0)}function sh(t,e,i){var a={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return a;var r={x:t.x,y:t.y};r.x-=i.ll[0],r.y-=i.ll[1],r.x=j(r.x-Math.PI)+Math.PI;var s=Ir(r,i);if(e){if(isNaN(s.x))return a;s.x=r.x-s.x,s.y=r.y-s.y;var h=9,n=1e-12,f,l;do{if(l=Ir(s,i),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}f={x:r.x-(l.x+s.x),y:r.y-(l.y+s.y)},s.x+=f.x,s.y+=f.y}while(h--&&Math.abs(f.x)>n&&Math.abs(f.y)>n);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=j(s.x+i.ll[0]),a.y=s.y+i.ll[1]}else isNaN(s.x)||(a.x=t.x+s.x,a.y=t.y+s.y);return a}function Ir(t,e){var i={x:t.x/e.del[0],y:t.y/e.del[1]},a={x:Math.floor(i.x),y:Math.floor(i.y)},r={x:i.x-1*a.x,y:i.y-1*a.y},s={x:Number.NaN,y:Number.NaN},h;if(a.x<0||a.x>=e.lim[0]||a.y<0||a.y>=e.lim[1])return s;h=a.y*e.lim[0]+a.x;var n={x:e.cvs[h][0],y:e.cvs[h][1]};h++;var f={x:e.cvs[h][0],y:e.cvs[h][1]};h+=e.lim[0];var l={x:e.cvs[h][0],y:e.cvs[h][1]};h--;var d={x:e.cvs[h][0],y:e.cvs[h][1]},_=r.x*r.y,u=r.x*(1-r.y),x=(1-r.x)*(1-r.y),y=(1-r.x)*r.y;return s.x=x*n.x+u*f.x+y*d.x+_*l.x,s.y=x*n.y+u*f.y+y*d.y+_*l.y,s}function Nr(t,e,i){var a=i.x,r=i.y,s=i.z||0,h,n,f,l={};for(f=0;f<3;f++)if(!(e&&f===2&&i.z===void 0))switch(f===0?(h=a,"ew".indexOf(t.axis[f])!==-1?n="x":n="y"):f===1?(h=r,"ns".indexOf(t.axis[f])!==-1?n="y":n="x"):(h=s,n="z"),t.axis[f]){case"e":l[n]=h;break;case"w":l[n]=-h;break;case"n":l[n]=h;break;case"s":l[n]=-h;break;case"u":i[n]!==void 0&&(l.z=h);break;case"d":i[n]!==void 0&&(l.z=-h);break;default:return null}return l}function gs(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 nh(t){Rr(t.x),Rr(t.y)}function Rr(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 hh(t,e){return(t.datum.datum_type===pe||t.datum.datum_type===Se||t.datum.datum_type===Oe)&&e.datumCode!=="WGS84"||(e.datum.datum_type===pe||e.datum.datum_type===Se||e.datum.datum_type===Oe)&&t.datumCode!=="WGS84"}function pi(t,e,i,a){var r;Array.isArray(i)?i=gs(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var s=i.z!==void 0;if(nh(i),t.datum&&e.datum&&hh(t,e)&&(r=new Qt("WGS84"),i=pi(t,r,i,a),t=r),a&&t.axis!=="enu"&&(i=Nr(t,!1,i)),t.projName==="longlat")i={x:i.x*Mt,y:i.y*Mt,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),i=t.inverse(i),!i)return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=rh(t.datum,e.datum,i),!!i)return i=i,e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),e.projName==="longlat"?i={x:i.x*zt,y:i.y*zt,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),a&&e.axis!=="enu"?Nr(e,!0,i):(i&&!s&&delete i.z,i)}var Dr=Qt("WGS84");function ra(t,e,i,a){var r,s,h;return Array.isArray(i)?(r=pi(t,e,i,a)||{x:NaN,y:NaN},i.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof r.z=="number"?[r.x,r.y,r.z].concat(i.slice(3)):[r.x,r.y,i[2]].concat(i.slice(3)):[r.x,r.y].concat(i.slice(2)):[r.x,r.y]):(s=pi(t,e,i,a),h=Object.keys(i),h.length===2||h.forEach(function(n){if(typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(n==="x"||n==="y"||n==="z")return}else if(n==="x"||n==="y")return;s[n]=i[n]}),s)}function vi(t){return t instanceof Qt?t:typeof t=="object"&&"oProj"in t?t.oProj:Qt(t)}function oh(t,e,i){var a,r,s=!1,h;return typeof e>"u"?(r=vi(t),a=Dr,s=!0):(typeof e.x<"u"||Array.isArray(e))&&(i=e,r=vi(t),a=Dr,s=!0),a||(a=vi(t)),r||(r=vi(e)),i?ra(a,r,i):(h={forward:function(n,f){return ra(a,r,n,f)},inverse:function(n,f){return ra(r,a,n,f)}},s&&(h.oProj=r),h)}var kr=6,xs="AJSAJS",ys="AFAFAF",Te=65,Ft=73,Vt=79,je=86,Ze=90;const fh={forward:ms,inverse:lh,toPoint:Ms};function ms(t,e){return e=e||5,dh(uh({lat:t[1],lon:t[0]}),e)}function lh(t){var e=wa(Es(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function Ms(t){var e=wa(Es(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function sa(t){return t*(Math.PI/180)}function Tr(t){return 180*(t/Math.PI)}function uh(t){var e=t.lat,i=t.lon,a=6378137,r=.00669438,s=.9996,h,n,f,l,d,_,u,x=sa(e),y=sa(i),A,w;w=Math.floor((i+180)/6)+1,i===180&&(w=60),e>=56&&e<64&&i>=3&&i<12&&(w=32),e>=72&&e<84&&(i>=0&&i<9?w=31:i>=9&&i<21?w=33:i>=21&&i<33?w=35:i>=33&&i<42&&(w=37)),h=(w-1)*6-180+3,A=sa(h),n=r/(1-r),f=a/Math.sqrt(1-r*Math.sin(x)*Math.sin(x)),l=Math.tan(x)*Math.tan(x),d=n*Math.cos(x)*Math.cos(x),_=Math.cos(x)*(y-A),u=a*((1-r/4-3*r*r/64-5*r*r*r/256)*x-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*x)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*x)-35*r*r*r/3072*Math.sin(6*x));var C=s*f*(_+(1-l+d)*_*_*_/6+(5-18*l+l*l+72*d-58*n)*_*_*_*_*_/120)+5e5,N=s*(u+f*Math.tan(x)*(_*_/2+(5-l+9*d+4*d*d)*_*_*_*_/24+(61-58*l+l*l+600*d-330*n)*_*_*_*_*_*_/720));return e<0&&(N+=1e7),{northing:Math.round(N),easting:Math.round(C),zoneNumber:w,zoneLetter:ch(e)}}function wa(t){var e=t.northing,i=t.easting,a=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var s=.9996,h=6378137,n=.00669438,f,l=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),d,_,u,x,y,A,w,C,N,R=i-5e5,U=e;a<"N"&&(U-=1e7),w=(r-1)*6-180+3,f=n/(1-n),A=U/s,C=A/(h*(1-n/4-3*n*n/64-5*n*n*n/256)),N=C+(3*l/2-27*l*l*l/32)*Math.sin(2*C)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*C)+151*l*l*l/96*Math.sin(6*C),d=h/Math.sqrt(1-n*Math.sin(N)*Math.sin(N)),_=Math.tan(N)*Math.tan(N),u=f*Math.cos(N)*Math.cos(N),x=h*(1-n)/Math.pow(1-n*Math.sin(N)*Math.sin(N),1.5),y=R/(d*s);var L=N-d*Math.tan(N)/x*(y*y/2-(5+3*_+10*u-4*u*u-9*f)*y*y*y*y/24+(61+90*_+298*u+45*_*_-252*f-3*u*u)*y*y*y*y*y*y/720);L=Tr(L);var O=(y-(1+2*_+u)*y*y*y/6+(5-2*u+28*_-3*u*u+8*f+24*_*_)*y*y*y*y*y/120)/Math.cos(N);O=w+Tr(O);var D;if(t.accuracy){var X=wa({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});D={top:X.lat,right:X.lon,bottom:L,left:O}}else D={lat:L,lon:O};return D}function ch(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 dh(t,e){var i="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+_h(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+a.substr(a.length-5,e)}function _h(t,e,i){var a=ws(i),r=Math.floor(t/1e5),s=Math.floor(e/1e5)%20;return vh(r,s,a)}function ws(t){var e=t%kr;return e===0&&(e=kr),e}function vh(t,e,i){var a=i-1,r=xs.charCodeAt(a),s=ys.charCodeAt(a),h=r+t-1,n=s+e,f=!1;h>Ze&&(h=h-Ze+Te-1,f=!0),(h===Ft||r<Ft&&h>Ft||(h>Ft||r<Ft)&&f)&&h++,(h===Vt||r<Vt&&h>Vt||(h>Vt||r<Vt)&&f)&&(h++,h===Ft&&h++),h>Ze&&(h=h-Ze+Te-1),n>je?(n=n-je+Te-1,f=!0):f=!1,(n===Ft||s<Ft&&n>Ft||(n>Ft||s<Ft)&&f)&&n++,(n===Vt||s<Vt&&n>Vt||(n>Vt||s<Vt)&&f)&&(n++,n===Ft&&n++),n>je&&(n=n-je+Te-1);var l=String.fromCharCode(h)+String.fromCharCode(n);return l}function Es(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,i=null,a="",r,s=0;!/[A-Z]/.test(r=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;a+=r,s++}var h=parseInt(a,10);if(s===0||s+3>e)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(s++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;i=t.substring(s,s+=2);for(var f=ws(h),l=gh(i.charAt(0),f),d=xh(i.charAt(1),f);d<yh(n);)d+=2e6;var _=e-s;if(_%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=_/2,x=0,y=0,A,w,C,N,R;return u>0&&(A=1e5/Math.pow(10,u),w=t.substring(s,s+u),x=parseFloat(w)*A,C=t.substring(s+u),y=parseFloat(C)*A),N=x+l,R=y+d,{easting:N,northing:R,zoneLetter:n,zoneNumber:h,accuracy:A}}function gh(t,e){for(var i=xs.charCodeAt(e-1),a=1e5,r=!1;i!==t.charCodeAt(0);){if(i++,i===Ft&&i++,i===Vt&&i++,i>Ze){if(r)throw"Bad character: "+t;i=Te,r=!0}a+=1e5}return a}function xh(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=ys.charCodeAt(e-1),a=0,r=!1;i!==t.charCodeAt(0);){if(i++,i===Ft&&i++,i===Vt&&i++,i>je){if(r)throw"Bad character: "+t;i=Te,r=!0}a+=1e5}return a}function yh(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,i){if(!(this instanceof Le))return new Le(t,e,i);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>"u"){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=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Le.fromMGRS=function(t){return new Le(Ms(t))};Le.prototype.toMGRS=function(t){return ms([this.x,this.y],t)};var mh=1,Mh=.25,Br=.046875,Or=.01953125,Fr=.01068115234375,wh=.75,Eh=.46875,bh=.013020833333333334,ph=.007120768229166667,Sh=.3645833333333333,Ah=.005696614583333333,Ph=.3076171875;function Ea(t){var e=[];e[0]=mh-t*(Mh+t*(Br+t*(Or+t*Fr))),e[1]=t*(wh-t*(Br+t*(Or+t*Fr)));var i=t*t;return e[2]=i*(Eh-t*(bh+t*ph)),i*=t,e[3]=i*(Sh-t*Ah),e[4]=i*t*Ph,e}function Ue(t,e,i,a){return i*=e,e*=e,a[0]*t-i*(a[1]+e*(a[2]+e*(a[3]+e*a[4])))}var Ch=20;function ba(t,e,i){for(var a=1/(1-e),r=t,s=Ch;s;--s){var h=Math.sin(r),n=1-e*h*h;if(n=(Ue(r,h,Math.cos(r),i)-t)*(n*Math.sqrt(n))*a,r-=n,Math.abs(n)<z)return r}return r}function Gh(){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=Ea(this.es),this.ml0=Ue(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Ih(t){var e=t.x,i=t.y,a=j(e-this.long0,this.over),r,s,h,n=Math.sin(i),f=Math.cos(i);if(this.es){var d=f*a,_=Math.pow(d,2),u=this.ep2*Math.pow(f,2),x=Math.pow(u,2),y=Math.abs(f)>z?Math.tan(i):0,A=Math.pow(y,2),w=Math.pow(A,2);r=1-this.es*Math.pow(n,2),d=d/Math.sqrt(r);var C=Ue(i,n,f,this.en);s=this.a*(this.k0*d*(1+_/6*(1-A+u+_/20*(5-18*A+w+14*u-58*A*u+_/42*(61+179*w-w*A-479*A)))))+this.x0,h=this.a*(this.k0*(C-this.ml0+n*a*d/2*(1+_/12*(5-A+9*u+4*x+_/30*(61+w-58*A+270*u-330*A*u+_/56*(1385+543*w-w*A-3111*A))))))+this.y0}else{var l=f*Math.sin(a);if(Math.abs(Math.abs(l)-1)<z)return 93;if(s=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,h=f*Math.cos(a)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(h),l>=1){if(l-1>z)return 93;h=0}else h=Math.acos(h);i<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return t.x=s,t.y=h,t}function Nh(t){var e,i,a,r,s=(t.x-this.x0)*(1/this.a),h=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+h/this.k0,i=ba(e,this.es,this.en),Math.abs(i)<k){var _=Math.sin(i),u=Math.cos(i),x=Math.abs(u)>z?Math.tan(i):0,y=this.ep2*Math.pow(u,2),A=Math.pow(y,2),w=Math.pow(x,2),C=Math.pow(w,2);e=1-this.es*Math.pow(_,2);var N=s*Math.sqrt(e)/this.k0,R=Math.pow(N,2);e=e*x,a=i-e*R/(1-this.es)*.5*(1-R/12*(5+3*w-9*y*w+y-4*A-R/30*(61+90*w-252*y*w+45*C+46*y-R/56*(1385+3633*w+4095*C+1574*C*w)))),r=j(this.long0+N*(1-R/6*(1+2*w+y-R/20*(5+28*w+24*C+8*y*w+6*y-R/42*(61+662*w+1320*C+720*C*w))))/u,this.over)}else a=k*ai(h),r=0;else{var n=Math.exp(s/this.k0),f=.5*(n-1/n),l=this.lat0+h/this.k0,d=Math.cos(l);e=Math.sqrt((1-Math.pow(d,2))/(1+Math.pow(f,2))),a=Math.asin(e),h<0&&(a=-a),f===0&&d===0?r=0:r=j(Math.atan2(f,d)+this.long0,this.over)}return t.x=r,t.y=a,t}var Rh=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const yi={init:Gh,forward:Ih,inverse:Nh,names:Rh};function bs(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function Lt(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),a=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(a,2))}function Dh(t){var e=1+t,i=e-1;return i===0?t:t*Math.log(e)/i}function kh(t){var e=Math.abs(t);return e=Dh(e*(1+e/(Lt(1,e)+1))),t<0?-e:e}function pa(t,e){for(var i=2*Math.cos(2*e),a=t.length-1,r=t[a],s=0,h;--a>=0;)h=-s+i*r+t[a],s=r,r=h;return e+h*Math.sin(2*e)}function Th(t,e){for(var i=2*Math.cos(e),a=t.length-1,r=t[a],s=0,h;--a>=0;)h=-s+i*r+t[a],s=r,r=h;return Math.sin(e)*h}function Bh(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function ps(t,e,i){for(var a=Math.sin(e),r=Math.cos(e),s=bs(i),h=Bh(i),n=2*r*h,f=-2*a*s,l=t.length-1,d=t[l],_=0,u=0,x=0,y,A;--l>=0;)y=u,A=_,u=d,_=x,d=-y+n*u-f*_+t[l],x=-A+f*u+n*_;return n=a*h,f=r*s,[n*d-f*x,n*x+f*d]}function Oh(){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&&(yi.init.apply(this),this.forward=yi.forward,this.inverse=yi.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),i=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)))))),i=i*e,this.cgb[1]=i*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i=i*e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),i=i*e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(-12/5+e*(-24832/14175))),i=i*e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i=i*e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/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]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),i=i*e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i=i*e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i=i*e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i=i*e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=i*(212378941/319334400);var a=pa(this.cbg,this.lat0);this.Zb=-this.Qn*(a+Th(this.gtu,2*a))}function Fh(t){var e=j(t.x-this.long0,this.over),i=t.y;i=pa(this.cbg,i);var a=Math.sin(i),r=Math.cos(i),s=Math.sin(e),h=Math.cos(e);i=Math.atan2(a,h*r),e=Math.atan2(s*r,Lt(a,r*h)),e=kh(Math.tan(e));var n=ps(this.gtu,2*i,2*e);i=i+n[0],e=e+n[1];var f,l;return Math.abs(e)<=2.623395162778?(f=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(f=1/0,l=1/0),t.x=f,t.y=l,t}function Lh(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e=e/this.Qn;var a,r;if(Math.abs(e)<=2.623395162778){var s=ps(this.utg,2*i,2*e);i=i+s[0],e=e+s[1],e=Math.atan(bs(e));var h=Math.sin(i),n=Math.cos(i),f=Math.sin(e),l=Math.cos(e);i=Math.atan2(h*l,Lt(f,l*n)),e=Math.atan2(f,l*n),a=j(e+this.long0,this.over),r=pa(this.cgb,i)}else a=1/0,r=1/0;return t.x=a,t.y=r,t}var zh=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const mi={init:Oh,forward:Fh,inverse:Lh,names:zh};function Uh(t,e){if(t===void 0){if(t=Math.floor((j(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var qh="etmerc";function jh(){var t=Uh(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Mt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,mi.init.apply(this),this.forward=mi.forward,this.inverse=mi.inverse}var Zh=["Universal Transverse Mercator System","utm"];const $h={init:jh,names:Zh,dependsOn:qh};function Sa(t,e){return Math.pow((1-t)/(1+t),e)}var Hh=20;function Wh(){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+lt)/(Math.pow(Math.tan(.5*this.lat0+lt),this.C)*Sa(this.e*t,this.ratexp))}function Xh(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+lt),this.C)*Sa(this.e*Math.sin(i),this.ratexp))-k,t.x=this.C*e,t}function Kh(t){for(var e=1e-14,i=t.x/this.C,a=t.y,r=Math.pow(Math.tan(.5*a+lt)/this.K,1/this.C),s=Hh;s>0&&(a=2*Math.atan(r*Sa(this.e*Math.sin(t.y),-.5*this.e))-k,!(Math.abs(a-t.y)<e));--s)t.y=a;return s?(t.x=i,t.y=a,t):null}const Aa={init:Wh,forward:Xh,inverse:Kh};function Vh(){Aa.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 Qh(t){var e,i,a,r;return t.x=j(t.x-this.long0,this.over),Aa.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*a),t.x=r*i*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Yh(t){var e,i,a,r,s;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,s=Lt(t.x,t.y)){var h=2*Math.atan2(s,this.R2);e=Math.sin(h),i=Math.cos(h),r=Math.asin(i*this.sinc0+t.y*e*this.cosc0/s),a=Math.atan2(t.x*e,s*this.cosc0*i-t.y*this.sinc0*e)}else r=this.phic0,a=0;return t.x=a,t.y=r,Aa.inverse.apply(this,[t]),t.x=j(t.x+this.long0,this.over),t}var Jh=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const to={init:Vh,forward:Qh,inverse:Yh,names:Jh};function Pa(t,e,i){return e*=i,Math.tan(.5*(k+t))*Math.pow((1-e)/(1+e),.5*i)}function eo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=z&&(this.k0=.5*(1+ai(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=z&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(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)<=z&&Math.abs(Math.cos(this.lat_ts))>z&&(this.k0=.5*this.cons*re(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ee(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=re(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Pa(this.lat0,this.sinlat0,this.e))-k,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function io(t){var e=t.x,i=t.y,a=Math.sin(i),r=Math.cos(i),s,h,n,f,l,d,_=j(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=z&&Math.abs(i+this.lat0)<=z?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*a+this.coslat0*r*Math.cos(_)),t.x=this.a*s*r*Math.sin(_)+this.x0,t.y=this.a*s*(this.coslat0*a-this.sinlat0*r*Math.cos(_))+this.y0,t):(h=2*Math.atan(Pa(i,a,this.e))-k,f=Math.cos(h),n=Math.sin(h),Math.abs(this.coslat0)<=z?(l=ee(this.e,i*this.con,this.con*a),d=2*this.a*this.k0*l/this.cons,t.x=this.x0+d*Math.sin(e-this.long0),t.y=this.y0-this.con*d*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<z?(s=2*this.a*this.k0/(1+f*Math.cos(_)),t.y=s*n):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*f*Math.cos(_))),t.y=s*(this.cosX0*n-this.sinX0*f*Math.cos(_))+this.y0),t.x=s*f*Math.sin(_)+this.x0,t))}function ao(t){t.x-=this.x0,t.y-=this.y0;var e,i,a,r,s,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(h/(2*this.a*this.k0));return e=this.long0,i=this.lat0,h<=z?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/h),Math.abs(this.coslat0)<z?this.lat0>0?e=j(this.long0+Math.atan2(t.x,-1*t.y),this.over):e=j(this.long0+Math.atan2(t.x,t.y),this.over):e=j(this.long0+Math.atan2(t.x*Math.sin(n),h*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n)),this.over),t.x=e,t.y=i,t)}else if(Math.abs(this.coslat0)<=z){if(h<=z)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,a=h*this.cons/(2*this.a*this.k0),i=this.con*Je(this.e,a),e=this.con*j(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else r=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=z?s=this.X0:(s=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/h),e=j(this.long0+Math.atan2(t.x*Math.sin(r),h*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)),this.over)),i=-1*Je(this.e,Math.tan(.5*(k+s)));return t.x=e,t.y=i,t}var ro=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const so={init:eo,forward:io,inverse:ao,names:ro,ssfn_:Pa};function no(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,a=this.rf,r=1/a,s=2*r-Math.pow(r,2),h=this.e=Math.sqrt(s);this.R=this.k0*i*Math.sqrt(1-s)/(1-s*Math.pow(e,2)),this.alpha=Math.sqrt(1+s/(1-s)*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)),f=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+h*e)/(1-h*e));this.K=n-this.alpha*f+this.alpha*h/2*l}function ho(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(e+i)+this.K,r=2*(Math.atan(Math.exp(a))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),h=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),n=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*h+this.x0,t}function oo(t){for(var e=t.x-this.x0,i=t.y-this.y0,a=e/this.R,r=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(a)),h=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(r))),n=this.lambda0+h/this.alpha,f=0,l=s,d=-1e3,_=0;Math.abs(l-d)>1e-7;){if(++_>20)return;f=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),d=l,l=2*Math.atan(Math.exp(f))-Math.PI/2}return t.x=n,t.y=l,t}var fo=["somerc"];const lo={init:no,forward:ho,inverse:oo,names:fo};var Re=1e-7;function uo(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||e.indexOf(i)!==-1||e.indexOf(cs(i))!==-1}function co(){var t,e,i,a,r,s,h,n,f,l,d=0,_,u=0,x=0,y=0,A=0,w=0,C=0;this.no_off=uo(this),this.no_rot="no_rot"in this;var N=!1;"alpha"in this&&(N=!0);var R=!1;if("rectified_grid_angle"in this&&(R=!0),N&&(C=this.alpha),R&&(d=this.rectified_grid_angle),N||R)u=this.longc;else if(x=this.long1,A=this.lat1,y=this.long2,w=this.lat2,Math.abs(A-w)<=Re||(t=Math.abs(A))<=Re||Math.abs(t-k)<=Re||Math.abs(Math.abs(this.lat0)-k)<=Re||Math.abs(Math.abs(w)-k)<=Re)throw new Error;var U=1-this.es;e=Math.sqrt(U),Math.abs(this.lat0)>z?(n=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*n*n,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/U),this.A=this.B*this.k0*e/t,a=this.B*e/(i*Math.sqrt(t)),r=a*a-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=a,this.E*=Math.pow(ee(this.e,this.lat0,n),this.B)):(this.B=1/e,this.A=this.k0,this.E=a=r=1),N||R?(N?(_=Math.asin(Math.sin(C)/a),R||(d=C)):(_=d,C=Math.asin(a*Math.sin(_))),this.lam0=u-Math.asin(.5*(r-1/r)*Math.tan(_))/this.B):(s=Math.pow(ee(this.e,A,Math.sin(A)),this.B),h=Math.pow(ee(this.e,w,Math.sin(w)),this.B),r=this.E/s,f=(h-s)/(h+s),l=this.E*this.E,l=(l-h*s)/(l+h*s),t=x-y,t<-Math.PI?y-=Qe:t>Math.PI&&(y+=Qe),this.lam0=j(.5*(x+y)-Math.atan(l*Math.tan(.5*this.B*(x-y))/f)/this.B,this.over),_=Math.atan(2*Math.sin(this.B*j(x-this.lam0,this.over))/(r-1/r)),d=C=Math.asin(a*Math.sin(_))),this.singam=Math.sin(_),this.cosgam=Math.cos(_),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),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(C))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*_,this.v_pole_n=this.ArB*Math.log(Math.tan(lt-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(lt+r))}function _o(t){var e={},i,a,r,s,h,n,f,l;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-k)>z){if(h=this.E/Math.pow(ee(this.e,t.y,Math.sin(t.y)),this.B),n=1/h,i=.5*(h-n),a=.5*(h+n),s=Math.sin(this.B*t.x),r=(i*this.singam-s*this.cosgam)/a,Math.abs(Math.abs(r)-1)<z)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),n=Math.cos(this.B*t.x),Math.abs(n)<Re?f=this.A*t.x:f=this.ArB*Math.atan2(i*this.cosgam+s*this.singam,n)}else l=t.y>0?this.v_pole_n:this.v_pole_s,f=this.ArB*t.y;return this.no_rot?(e.x=f,e.y=l):(f-=this.u_0,e.x=l*this.cosrot+f*this.sinrot,e.y=f*this.cosrot-l*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function vo(t){var e,i,a,r,s,h,n,f={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=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*i),r=.5*(a-1/a),s=.5*(a+1/a),h=Math.sin(this.BrA*e),n=(h*this.cosgam+r*this.singam)/s,Math.abs(Math.abs(n)-1)<z)f.x=0,f.y=n<0?-k:k;else{if(f.y=this.E/Math.sqrt((1+n)/(1-n)),f.y=Je(this.e,Math.pow(f.y,1/this.B)),f.y===1/0)throw new Error;f.x=-this.rB*Math.atan2(r*this.cosgam-h*this.singam,Math.cos(this.BrA*e))}return f.x+=this.lam0,f}var go=["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 xo={init:co,forward:_o,inverse:vo,names:go};function yo(){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)<z)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),a=re(this.e,e,i),r=ee(this.e,this.lat1,e),s=Math.sin(this.lat2),h=Math.cos(this.lat2),n=re(this.e,s,h),f=ee(this.e,this.lat2,s),l=Math.abs(Math.abs(this.lat0)-k)<z?0:ee(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>z?this.ns=Math.log(a/n)/Math.log(r/f):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=a/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function mo(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=z&&(i=ai(i)*(k-2*z));var a=Math.abs(Math.abs(i)-k),r,s;if(a>z)r=ee(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(r,this.ns);else{if(a=i*this.ns,a<=0)return null;s=0}var h=this.ns*j(e-this.long0,this.over);return t.x=this.k0*(s*Math.sin(h))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(h))+this.y0,t}function Mo(t){var e,i,a,r,s,h=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(h*h+n*n),i=1):(e=-Math.sqrt(h*h+n*n),i=-1);var f=0;if(e!==0&&(f=Math.atan2(i*h,i*n)),e!==0||this.ns>0){if(i=1/this.ns,a=Math.pow(e/(this.a*this.f0),i),r=Je(this.e,a),r===-9999)return null}else r=-k;return s=j(f/this.ns+this.long0,this.over),t.x=s,t.y=r,t}var wo=["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 Eo={init:yo,forward:mo,inverse:Mo,names:wo};function bo(){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 po(t){var e,i,a,r,s,h,n,f=t.x,l=t.y,d=j(f-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),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),a=-d*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),s=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(r)),h=this.n*s,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=n*Math.cos(h)/1,t.x=n*Math.sin(h)/1,this.czech||(t.y*=-1,t.x*=-1),t}function So(t){var e,i,a,r,s,h,n,f,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),h=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),r=s/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/h,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(r)),i=Math.asin(Math.cos(a)*Math.sin(r)/Math.cos(e)),t.x=this.long0-i/this.alfa,n=e,f=0;var d=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&&(f=1),n=t.y,d+=1;while(f===0&&d<15);return d>=15?null:t}var Ao=["Krovak","krovak"];const Po={init:bo,forward:po,inverse:So,names:Ao};function Bt(t,e,i,a,r){return t*r-e*Math.sin(2*r)+i*Math.sin(4*r)-a*Math.sin(6*r)}function ri(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function si(t){return .375*t*(1+.25*t*(1+.46875*t))}function ni(t){return .05859375*t*t*(1+.75*t)}function hi(t){return t*t*t*(35/3072)}function Ca(t,e,i){var a=e*i;return t/Math.sqrt(1-a*a)}function me(t){return Math.abs(t)<k?t:t-ai(t)*Math.PI}function Si(t,e,i,a,r){var s,h;s=t/e;for(var n=0;n<15;n++)if(h=(t-(e*s-i*Math.sin(2*s)+a*Math.sin(4*s)-r*Math.sin(6*s)))/(e-2*i*Math.cos(2*s)+4*a*Math.cos(4*s)-6*r*Math.cos(6*s)),s+=h,Math.abs(h)<=1e-10)return s;return NaN}function Co(){this.sphere||(this.e0=ri(this.es),this.e1=si(this.es),this.e2=ni(this.es),this.e3=hi(this.es),this.ml0=this.a*Bt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Go(t){var e,i,a=t.x,r=t.y;if(a=j(a-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(r)*Math.sin(a)),i=this.a*(Math.atan2(Math.tan(r),Math.cos(a))-this.lat0);else{var s=Math.sin(r),h=Math.cos(r),n=Ca(this.a,this.e,s),f=Math.tan(r)*Math.tan(r),l=a*Math.cos(r),d=l*l,_=this.es*h*h/(1-this.es),u=this.a*Bt(this.e0,this.e1,this.e2,this.e3,r);e=n*l*(1-d*f*(1/6-(8-f+8*_)*d/120)),i=u-this.ml0+n*s/h*d*(.5+(5-f+6*_)*d/24)}return t.x=e+this.x0,t.y=i+this.y0,t}function Io(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,a,r;if(this.sphere){var s=i+this.lat0;a=Math.asin(Math.sin(s)*Math.cos(e)),r=Math.atan2(Math.tan(e),Math.cos(s))}else{var h=this.ml0/this.a+i,n=Si(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-k)<=z)return t.x=this.long0,t.y=k,i<0&&(t.y*=-1),t;var f=Ca(this.a,this.e,Math.sin(n)),l=f*f*f/this.a/this.a*(1-this.es),d=Math.pow(Math.tan(n),2),_=e*this.a/f,u=_*_;a=n-f*Math.tan(n)/l*_*_*(.5-(1+3*d)*_*_/24),r=_*(1-u*(d/3+(1+3*d)*d*u/15))/Math.cos(n)}return t.x=j(r+this.long0,this.over),t.y=me(a),t}var No=["Cassini","Cassini_Soldner","cass"];const Ro={init:Co,forward:Go,inverse:Io,names:No};function ve(t,e){var i;return t>1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}var la=1,ua=2,ca=3,Mi=4;function Do(){var t=Math.abs(this.lat0);if(Math.abs(t-k)<z?this.mode=this.lat0<0?la:ua:Math.abs(t)<z?this.mode=ca:this.mode=Mi,this.es>0){var e;switch(this.qp=ve(this.e,1),this.mmf=.5/(1-this.es),this.apa=qo(this.es),this.mode){case ua:this.dd=1;break;case la:this.dd=1;break;case ca:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Mi:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ve(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===Mi&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function ko(t){var e,i,a,r,s,h,n,f,l,d,_=t.x,u=t.y;if(_=j(_-this.long0,this.over),this.sphere){if(s=Math.sin(u),d=Math.cos(u),a=Math.cos(_),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+d*a:1+this.sinph0*s+this.cosph0*d*a,i<=z)return null;i=Math.sqrt(2/i),e=i*d*Math.sin(_),i*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*d*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)<z)return null;i=lt-u*.5,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),e=i*Math.sin(_),i*=a}}else{switch(n=0,f=0,l=0,a=Math.cos(_),r=Math.sin(_),s=Math.sin(u),h=ve(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=h/this.qp,f=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:l=1+this.sinb1*n+this.cosb1*f*a;break;case this.EQUIT:l=1+f*a;break;case this.N_POLE:l=k+u,h=this.qp-h;break;case this.S_POLE:l=u-k,h=this.qp+h;break}if(Math.abs(l)<z)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?i=this.ymf*l*(this.cosb1*n-this.sinb1*f*a):i=(l=Math.sqrt(2/(1+f*a)))*n*this.ymf,e=this.xmf*l*f*r;break;case this.N_POLE:case this.S_POLE:h>=0?(e=(l=Math.sqrt(h))*r,i=a*(this.mode===this.S_POLE?l:-l)):e=i=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function To(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,a,r,s,h,n,f,l;if(this.sphere){var d=0,_,u=0;if(_=Math.sqrt(e*e+i*i),r=_*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(r),d=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(_)<=z?0:Math.asin(i*u/_),e*=u,i=d*_;break;case this.OBLIQ:r=Math.abs(_)<=z?this.lat0:Math.asin(d*this.sinph0+i*u*this.cosph0/_),e*=u*this.cosph0,i=(d-Math.sin(r)*this.sinph0)*_;break;case this.N_POLE:i=-i,r=k-r;break;case this.S_POLE:r-=k;break}a=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,i)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,i*=this.dd,f=Math.sqrt(e*e+i*i),f<z)return t.x=this.long0,t.y=this.lat0,t;h=2*Math.asin(.5*f/this.rq),s=Math.cos(h),e*=h=Math.sin(h),this.mode===this.OBLIQ?(l=s*this.sinb1+i*h*this.cosb1/f,n=this.qp*l,i=f*this.cosb1*s-i*this.sinb1*h):(l=i*h/f,n=this.qp*l,i=f*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),n=e*e+i*i,!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,i),r=jo(Math.asin(l),this.apa)}return t.x=j(this.long0+a,this.over),t.y=r,t}var Bo=.3333333333333333,Oo=.17222222222222222,Fo=.10257936507936508,Lo=.06388888888888888,zo=.0664021164021164,Uo=.016415012942191543;function qo(t){var e,i=[];return i[0]=t*Bo,e=t*t,i[0]+=e*Oo,i[1]=e*Lo,e*=t,i[0]+=e*Fo,i[1]+=e*zo,i[2]=e*Uo,i}function jo(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}var Zo=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const $o={init:Do,forward:ko,inverse:To,names:Zo,S_POLE:la,N_POLE:ua,EQUIT:ca,OBLIQ:Mi};function xe(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Ho(){Math.abs(this.lat1+this.lat2)<z||(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=re(this.e3,this.sin_po,this.cos_po),this.qs1=ve(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=re(this.e3,this.sin_po,this.cos_po),this.qs2=ve(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=ve(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>z?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Wo(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=ve(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,s=this.ns0*j(e-this.long0,this.over),h=r*Math.sin(s)+this.x0,n=this.rh-r*Math.cos(s)+this.y0;return t.x=h,t.y=n,t}function Xo(t){var e,i,a,r,s,h;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),r=0,e!==0&&(r=Math.atan2(a*t.x,a*t.y)),a=e*this.ns0/this.a,this.sphere?h=Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,h=this.phi1z(this.e3,i)),s=j(r/this.ns0+this.long0,this.over),t.x=s,t.y=h,t}function Ko(t,e){var i,a,r,s,h,n=xe(.5*e);if(t<z)return n;for(var f=t*t,l=1;l<=25;l++)if(i=Math.sin(n),a=Math.cos(n),r=t*i,s=1-r*r,h=.5*s*s/a*(e/(1-f)-i/s+.5/t*Math.log((1-r)/(1+r))),n=n+h,Math.abs(h)<=1e-7)return n;return null}var Vo=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const Qo={init:Ho,forward:Wo,inverse:Xo,names:Vo,phi1z:Ko};function Yo(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Jo(t){var e,i,a,r,s,h,n,f,l=t.x,d=t.y;return a=j(l-this.long0,this.over),e=Math.sin(d),i=Math.cos(d),r=Math.cos(a),h=this.sin_p14*e+this.cos_p14*i*r,s=1,h>0||Math.abs(h)<=z?(n=this.x0+this.a*s*i*Math.sin(a)/h,f=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*i*r)/h):(n=this.x0+this.infinity_dist*i*Math.sin(a),f=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*r)),t.x=n,t.y=f,t}function t0(t){var e,i,a,r,s,h;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))?(r=Math.atan2(e,this.rc),i=Math.sin(r),a=Math.cos(r),h=xe(a*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*a-t.y*this.sin_p14*i),s=j(this.long0+s,this.over)):(h=this.phic0,s=0),t.x=s,t.y=h,t}var e0=["gnom"];const i0={init:Yo,forward:Jo,inverse:t0,names:e0};function a0(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*k:k;for(var a=Math.asin(.5*e),r,s,h,n,f=0;f<30;f++)if(s=Math.sin(a),h=Math.cos(a),n=t*s,r=Math.pow(1-n*n,2)/(2*h)*(e/(1-t*t)-s/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),a+=r,Math.abs(r)<=1e-10)return a;return NaN}function r0(){this.sphere||(this.k0=re(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function s0(t){var e=t.x,i=t.y,a,r,s=j(e-this.long0,this.over);if(this.sphere)a=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var h=ve(this.e,Math.sin(i));a=this.x0+this.a*this.k0*s,r=this.y0+this.a*h*.5/this.k0}return t.x=a,t.y=r,t}function n0(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=j(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=a0(this.e,2*t.y*this.k0/this.a),e=j(this.long0+t.x/(this.a*this.k0),this.over)),t.x=e,t.y=i,t}var h0=["cea"];const o0={init:r0,forward:s0,inverse:n0,names:h0};function f0(){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 l0(t){var e=t.x,i=t.y,a=j(e-this.long0,this.over),r=me(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*r,t}function u0(t){var e=t.x,i=t.y;return t.x=j(this.long0+(e-this.x0)/(this.a*this.rc),this.over),t.y=me(this.lat0+(i-this.y0)/this.a),t}var c0=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const d0={init:f0,forward:l0,inverse:u0,names:c0};var Lr=20;function _0(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ri(this.es),this.e1=si(this.es),this.e2=ni(this.es),this.e3=hi(this.es),this.ml0=this.a*Bt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function v0(t){var e=t.x,i=t.y,a,r,s,h=j(e-this.long0,this.over);if(s=h*Math.sin(i),this.sphere)Math.abs(i)<=z?(a=this.a*h,r=-1*this.a*this.lat0):(a=this.a*Math.sin(s)/Math.tan(i),r=this.a*(me(i-this.lat0)+(1-Math.cos(s))/Math.tan(i)));else if(Math.abs(i)<=z)a=this.a*h,r=-1*this.ml0;else{var n=Ca(this.a,this.e,Math.sin(i))/Math.tan(i);a=n*Math.sin(s),r=this.a*Bt(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+n*(1-Math.cos(s))}return t.x=a+this.x0,t.y=r+this.y0,t}function g0(t){var e,i,a,r,s,h,n,f,l;if(a=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=z)e=j(a/this.a+this.long0,this.over),i=0;else{h=this.lat0+r/this.a,n=a*a/this.a/this.a+h*h,f=h;var d;for(s=Lr;s;--s)if(d=Math.tan(f),l=-1*(h*(f*d+1)-f-.5*(f*f+n)*d)/((f-h)/d-1),f+=l,Math.abs(l)<=z){i=f;break}e=j(this.long0+Math.asin(a*Math.tan(f)/this.a)/Math.sin(i),this.over)}else if(Math.abs(r+this.ml0)<=z)i=0,e=j(this.long0+a/this.a,this.over);else{h=(this.ml0+r)/this.a,n=a*a/this.a/this.a+h*h,f=h;var _,u,x,y,A;for(s=Lr;s;--s)if(A=this.e*Math.sin(f),_=Math.sqrt(1-A*A)*Math.tan(f),u=this.a*Bt(this.e0,this.e1,this.e2,this.e3,f),x=this.e0-2*this.e1*Math.cos(2*f)+4*this.e2*Math.cos(4*f)-6*this.e3*Math.cos(6*f),y=u/this.a,l=(h*(_*y+1)-y-.5*_*(y*y+n))/(this.es*Math.sin(2*f)*(y*y+n-2*h*y)/(4*_)+(h-y)*(_*x-2/Math.sin(2*f))-x),f-=l,Math.abs(l)<=z){i=f;break}_=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=j(this.long0+Math.asin(a*_/this.a)/Math.sin(i),this.over)}return t.x=e,t.y=i,t}var x0=["Polyconic","American_Polyconic","poly"];const y0={init:_0,forward:v0,inverse:g0,names:x0};function m0(){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 M0(t){var e,i=t.x,a=t.y,r=a-this.lat0,s=i-this.long0,h=r/He*1e-5,n=s,f=1,l=0;for(e=1;e<=10;e++)f=f*h,l=l+this.A[e]*f;var d=l,_=n,u=1,x=0,y,A,w=0,C=0;for(e=1;e<=6;e++)y=u*d-x*_,A=x*d+u*_,u=y,x=A,w=w+this.B_re[e]*u-this.B_im[e]*x,C=C+this.B_im[e]*u+this.B_re[e]*x;return t.x=C*this.a+this.x0,t.y=w*this.a+this.y0,t}function w0(t){var e,i=t.x,a=t.y,r=i-this.x0,s=a-this.y0,h=s/this.a,n=r/this.a,f=1,l=0,d,_,u=0,x=0;for(e=1;e<=6;e++)d=f*h-l*n,_=l*h+f*n,f=d,l=_,u=u+this.C_re[e]*f-this.C_im[e]*l,x=x+this.C_im[e]*f+this.C_re[e]*l;for(var y=0;y<this.iterations;y++){var A=u,w=x,C,N,R=h,U=n;for(e=2;e<=6;e++)C=A*u-w*x,N=w*u+A*x,A=C,w=N,R=R+(e-1)*(this.B_re[e]*A-this.B_im[e]*w),U=U+(e-1)*(this.B_im[e]*A+this.B_re[e]*w);A=1,w=0;var L=this.B_re[1],O=this.B_im[1];for(e=2;e<=6;e++)C=A*u-w*x,N=w*u+A*x,A=C,w=N,L=L+e*(this.B_re[e]*A-this.B_im[e]*w),O=O+e*(this.B_im[e]*A+this.B_re[e]*w);var D=L*L+O*O;u=(R*L+U*O)/D,x=(U*L-R*O)/D}var X=u,V=x,Q=1,tt=0;for(e=1;e<=9;e++)Q=Q*X,tt=tt+this.D[e]*Q;var E=this.lat0+tt*He*1e5,b=this.long0+V;return t.x=b,t.y=E,t}var E0=["New_Zealand_Map_Grid","nzmg"];const b0={init:m0,forward:M0,inverse:w0,names:E0};function p0(){}function S0(t){var e=t.x,i=t.y,a=j(e-this.long0,this.over),r=this.x0+this.a*a,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=r,t.y=s,t}function A0(t){t.x-=this.x0,t.y-=this.y0;var e=j(this.long0+t.x/this.a,this.over),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t}var P0=["Miller_Cylindrical","mill"];const C0={init:p0,forward:S0,inverse:A0,names:P0};var G0=20;function I0(){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=Ea(this.es)}function N0(t){var e,i,a=t.x,r=t.y;if(a=j(a-this.long0,this.over),this.sphere){if(!this.m)r=this.n!==1?Math.asin(this.n*Math.sin(r)):r;else for(var s=this.n*Math.sin(r),h=G0;h;--h){var n=(this.m*r+Math.sin(r)-s)/(this.m+Math.cos(r));if(r-=n,Math.abs(n)<z)break}e=this.a*this.C_x*a*(this.m+Math.cos(r)),i=this.a*this.C_y*r}else{var f=Math.sin(r),l=Math.cos(r);i=this.a*Ue(r,f,l,this.en),e=this.a*a*l/Math.sqrt(1-this.es*f*f)}return t.x=e,t.y=i,t}function R0(t){var e,i,a,r;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=xe((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=xe(Math.sin(e)/this.n)),a=j(a+this.long0,this.over),e=me(e)):(e=ba(t.y/this.a,this.es,this.en),r=Math.abs(e),r<k?(r=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(e)),a=j(i,this.over)):r-z<k&&(a=this.long0)),t.x=a,t.y=e,t}var D0=["Sinusoidal","sinu"];const k0={init:I0,forward:N0,inverse:R0,names:D0};function T0(){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 B0(t){for(var e=t.x,i=t.y,a=j(e-this.long0,this.over),r=i,s=Math.PI*Math.sin(i);;){var h=-(r+Math.sin(r)-s)/(1+Math.cos(r));if(r+=h,Math.abs(h)<z)break}r/=2,Math.PI/2-Math.abs(i)<z&&(a=0);var n=.900316316158*this.a*a*Math.cos(r)+this.x0,f=1.4142135623731*this.a*Math.sin(r)+this.y0;return t.x=n,t.y=f,t}function O0(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var a=j(this.long0+t.x/(.900316316158*this.a*Math.cos(e)),this.over);a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var r=Math.asin(i);return t.x=a,t.y=r,t}var F0=["Mollweide","moll"];const L0={init:T0,forward:B0,inverse:O0,names:F0};function z0(){Math.abs(this.lat1+this.lat2)<z||(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=ri(this.es),this.e1=si(this.es),this.e2=ni(this.es),this.e3=hi(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=re(this.e,this.sin_phi,this.cos_phi),this.ml1=Bt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<z?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=re(this.e,this.sin_phi,this.cos_phi),this.ml2=Bt(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=Bt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function U0(t){var e=t.x,i=t.y,a;if(this.sphere)a=this.a*(this.g-i);else{var r=Bt(this.e0,this.e1,this.e2,this.e3,i);a=this.a*(this.g-r)}var s=this.ns*j(e-this.long0,this.over),h=this.x0+a*Math.sin(s),n=this.y0+this.rh-a*Math.cos(s);return t.x=h,t.y=n,t}function q0(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,a,r;this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(i!==0&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return r=j(this.long0+s/this.ns,this.over),a=me(this.g-i/this.a),t.x=r,t.y=a,t;var h=this.g-i/this.a;return a=Si(h,this.e0,this.e1,this.e2,this.e3),r=j(this.long0+s/this.ns,this.over),t.x=r,t.y=a,t}var j0=["Equidistant_Conic","eqdc"];const Z0={init:z0,forward:U0,inverse:q0,names:j0};function $0(){this.R=this.a}function H0(t){var e=t.x,i=t.y,a=j(e-this.long0,this.over),r,s;Math.abs(i)<=z&&(r=this.x0+this.R*a,s=this.y0);var h=xe(2*Math.abs(i/Math.PI));(Math.abs(a)<=z||Math.abs(Math.abs(i)-k)<=z)&&(r=this.x0,i>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*h):s=this.y0+Math.PI*this.R*-Math.tan(.5*h));var n=.5*Math.abs(Math.PI/a-a/Math.PI),f=n*n,l=Math.sin(h),d=Math.cos(h),_=d/(l+d-1),u=_*_,x=_*(2/l-1),y=x*x,A=Math.PI*this.R*(n*(_-y)+Math.sqrt(f*(_-y)*(_-y)-(y+f)*(u-y)))/(y+f);a<0&&(A=-A),r=this.x0+A;var w=f+_;return A=Math.PI*this.R*(x*w-n*Math.sqrt((y+f)*(f+1)-w*w))/(y+f),i>=0?s=this.y0+A:s=this.y0-A,t.x=r,t.y=s,t}function W0(t){var e,i,a,r,s,h,n,f,l,d,_,u,x;return t.x-=this.x0,t.y-=this.y0,_=Math.PI*this.R,a=t.x/_,r=t.y/_,s=a*a+r*r,h=-Math.abs(r)*(1+s),n=h-2*r*r+a*a,f=-2*h+1+2*r*r+s*s,x=r*r/f+(2*n*n*n/f/f/f-9*h*n/f/f)/27,l=(h-n*n/3/f)/f,d=2*Math.sqrt(-l/3),_=3*x/l/d,Math.abs(_)>1&&(_>=0?_=1:_=-1),u=Math.acos(_)/3,t.y>=0?i=(-d*Math.cos(u+Math.PI/3)-n/3/f)*Math.PI:i=-(-d*Math.cos(u+Math.PI/3)-n/3/f)*Math.PI,Math.abs(a)<z?e=this.long0:e=j(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(a*a-r*r)+s*s))/2/a,this.over),t.x=e,t.y=i,t}var X0=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const K0={init:$0,forward:H0,inverse:W0,names:X0};function V0(t,e,i,a,r,s){const h=a-e,n=Math.atan((1-s)*Math.tan(t)),f=Math.atan((1-s)*Math.tan(i)),l=Math.sin(n),d=Math.cos(n),_=Math.sin(f),u=Math.cos(f);let x=h,y,A=100,w,C,N,R,U,L,O,D,X,V,Q,tt,E,b;do{if(w=Math.sin(x),C=Math.cos(x),N=Math.sqrt(u*w*(u*w)+(d*_-l*u*C)*(d*_-l*u*C)),N===0)return{azi1:0,s12:0};R=l*_+d*u*C,U=Math.atan2(N,R),L=d*u*w/N,O=1-L*L,D=O!==0?R-2*l*_/O:0,X=s/16*O*(4+s*(4-3*O)),y=x,x=h+(1-X)*s*L*(U+X*N*(D+X*R*(-1+2*D*D)))}while(Math.abs(x-y)>1e-12&&--A>0);return A===0?{azi1:NaN,s12:NaN}:(V=O*(r*r-r*(1-s)*(r*(1-s)))/(r*(1-s)*(r*(1-s))),Q=1+V/16384*(4096+V*(-768+V*(320-175*V))),tt=V/1024*(256+V*(-128+V*(74-47*V))),E=tt*N*(D+tt/4*(R*(-1+2*D*D)-tt/6*D*(-3+4*N*N)*(-3+4*D*D))),b=r*(1-s)*Q*(U-E),{azi1:Math.atan2(u*w,d*_-l*u*C),s12:b})}function Q0(t,e,i,a,r,s){const h=Math.atan((1-s)*Math.tan(t)),n=Math.sin(h),f=Math.cos(h),l=Math.sin(i),d=Math.cos(i),_=Math.atan2(n,f*d),u=f*l,x=1-u*u,y=x*(r*r-r*(1-s)*(r*(1-s)))/(r*(1-s)*(r*(1-s))),A=1+y/16384*(4096+y*(-768+y*(320-175*y))),w=y/1024*(256+y*(-128+y*(74-47*y)));let C=a/(r*(1-s)*A),N,R=100,U,L,O,D;do U=Math.cos(2*_+C),L=Math.sin(C),O=Math.cos(C),D=w*L*(U+w/4*(O*(-1+2*U*U)-w/6*U*(-3+4*L*L)*(-3+4*U*U))),N=C,C=a/(r*(1-s)*A)+D;while(Math.abs(C-N)>1e-12&&--R>0);if(R===0)return{lat2:NaN,lon2:NaN};const X=n*L-f*O*d,V=Math.atan2(n*O+f*L*d,(1-s)*Math.sqrt(u*u+X*X)),Q=Math.atan2(L*l,f*O-n*L*d),tt=s/16*x*(4+s*(4-3*x)),E=Q-(1-tt)*s*u*(C+tt*L*(U+tt*O*(-1+2*U*U))),b=e+E;return{lat2:V,lon2:b}}function Y0(){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 J0(t){var e=t.x,i=t.y,a=Math.sin(t.y),r=Math.cos(t.y),s=j(e-this.long0,this.over),h,n,f,l,d,_,u,x,y,A,w;return this.sphere?Math.abs(this.sin_p12-1)<=z?(t.x=this.x0+this.a*(k-i)*Math.sin(s),t.y=this.y0-this.a*(k-i)*Math.cos(s),t):Math.abs(this.sin_p12+1)<=z?(t.x=this.x0+this.a*(k+i)*Math.sin(s),t.y=this.y0+this.a*(k+i)*Math.cos(s),t):(y=this.sin_p12*a+this.cos_p12*r*Math.cos(s),u=Math.acos(y),x=u?u/Math.sin(u):1,t.x=this.x0+this.a*x*r*Math.sin(s),t.y=this.y0+this.a*x*(this.cos_p12*a-this.sin_p12*r*Math.cos(s)),t):(h=ri(this.es),n=si(this.es),f=ni(this.es),l=hi(this.es),Math.abs(this.sin_p12-1)<=z?(d=this.a*Bt(h,n,f,l,k),_=this.a*Bt(h,n,f,l,i),t.x=this.x0+(d-_)*Math.sin(s),t.y=this.y0-(d-_)*Math.cos(s),t):Math.abs(this.sin_p12+1)<=z?(d=this.a*Bt(h,n,f,l,k),_=this.a*Bt(h,n,f,l,i),t.x=this.x0+(d+_)*Math.sin(s),t.y=this.y0+(d+_)*Math.cos(s),t):Math.abs(e)<z&&Math.abs(i-this.lat0)<z?(t.x=t.y=0,t):(A=V0(this.lat0,this.long0,i,e,this.a,this.f),w=A.azi1,t.x=A.s12*Math.sin(w),t.y=A.s12*Math.cos(w),t))}function tf(t){t.x-=this.x0,t.y-=this.y0;var e,i,a,r,s,h,n,f,l,d,_,u,x,y,A,w;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*k*this.a?void 0:(i=e/this.a,a=Math.sin(i),r=Math.cos(i),s=this.long0,Math.abs(e)<=z?h=this.lat0:(h=xe(r*this.sin_p12+t.y*a*this.cos_p12/e),n=Math.abs(this.lat0)-k,Math.abs(n)<=z?this.lat0>=0?s=j(this.long0+Math.atan2(t.x,-t.y),this.over):s=j(this.long0-Math.atan2(-t.x,t.y),this.over):s=j(this.long0+Math.atan2(t.x*a,e*this.cos_p12*r-t.y*this.sin_p12*a),this.over)),t.x=s,t.y=h,t)):(f=ri(this.es),l=si(this.es),d=ni(this.es),_=hi(this.es),Math.abs(this.sin_p12-1)<=z?(u=this.a*Bt(f,l,d,_,k),e=Math.sqrt(t.x*t.x+t.y*t.y),x=u-e,h=Si(x/this.a,f,l,d,_),s=j(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=s,t.y=h,t):Math.abs(this.sin_p12+1)<=z?(u=this.a*Bt(f,l,d,_,k),e=Math.sqrt(t.x*t.x+t.y*t.y),x=e-u,h=Si(x/this.a,f,l,d,_),s=j(this.long0+Math.atan2(t.x,t.y),this.over),t.x=s,t.y=h,t):(y=Math.atan2(t.x,t.y),A=Math.sqrt(t.x*t.x+t.y*t.y),w=Q0(this.lat0,this.long0,y,A,this.a,this.f),t.x=w.lon2,t.y=w.lat2,t))}var ef=["Azimuthal_Equidistant","aeqd"];const af={init:Y0,forward:J0,inverse:tf,names:ef};function rf(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function sf(t){var e,i,a,r,s,h,n,f,l=t.x,d=t.y;return a=j(l-(this.long0||0),this.over),e=Math.sin(d),i=Math.cos(d),r=Math.cos(a),h=this.sin_p14*e+this.cos_p14*i*r,s=1,(h>0||Math.abs(h)<=z)&&(n=this.a*s*i*Math.sin(a),f=(this.y0||0)+this.a*s*(this.cos_p14*e-this.sin_p14*i*r)),t.x=n,t.y=f,t}function nf(t){var e,i,a,r,s,h,n,f,l;return t.x-=this.x0||0,t.y-=this.y0||0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=xe(e/this.a),a=Math.sin(i),r=Math.cos(i),f=this.long0||0,l=this.lat0||0,h=f,Math.abs(e)<=z?(n=l,t.x=h,t.y=n,t):(n=xe(r*this.sin_p14+t.y*a*this.cos_p14/e),s=Math.abs(l)-k,Math.abs(s)<=z?(l>=0?h=j(f+Math.atan2(t.x,-t.y),this.over):h=j(f-Math.atan2(-t.x,t.y),this.over),t.x=h,t.y=n,t):(h=j(f+Math.atan2(t.x*a,e*this.cos_p14*r-t.y*this.sin_p14*a),this.over),t.x=h,t.y=n,t))}var hf=["ortho"];const of={init:rf,forward:sf,inverse:nf,names:hf};var yt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ut={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ff(){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>=k-lt/2?this.face=yt.TOP:this.lat0<=-(k-lt/2)?this.face=yt.BOTTOM:Math.abs(this.long0)<=lt?this.face=yt.FRONT:Math.abs(this.long0)<=k+lt?this.face=this.long0>0?yt.RIGHT:yt.LEFT:this.face=yt.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 lf(t){var e={x:0,y:0},i,a,r,s,h,n,f={value:0};if(t.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):i=t.y,a=t.x,this.face===yt.TOP)s=k-i,a>=lt&&a<=k+lt?(f.value=ut.AREA_0,r=a-k):a>k+lt||a<=-(k+lt)?(f.value=ut.AREA_1,r=a>0?a-wt:a+wt):a>-(k+lt)&&a<=-lt?(f.value=ut.AREA_2,r=a+k):(f.value=ut.AREA_3,r=a);else if(this.face===yt.BOTTOM)s=k+i,a>=lt&&a<=k+lt?(f.value=ut.AREA_0,r=-a+k):a<lt&&a>=-lt?(f.value=ut.AREA_1,r=-a):a<-lt&&a>=-(k+lt)?(f.value=ut.AREA_2,r=-a-k):(f.value=ut.AREA_3,r=a>0?-a+wt:-a-wt);else{var l,d,_,u,x,y,A;this.face===yt.RIGHT?a=Fe(a,+k):this.face===yt.BACK?a=Fe(a,+wt):this.face===yt.LEFT&&(a=Fe(a,-k)),u=Math.sin(i),x=Math.cos(i),y=Math.sin(a),A=Math.cos(a),l=x*A,d=x*y,_=u,this.face===yt.FRONT?(s=Math.acos(l),r=gi(s,_,d,f)):this.face===yt.RIGHT?(s=Math.acos(d),r=gi(s,_,-l,f)):this.face===yt.BACK?(s=Math.acos(-l),r=gi(s,_,-d,f)):this.face===yt.LEFT?(s=Math.acos(-d),r=gi(s,_,l,f)):(s=r=0,f.value=ut.AREA_0)}return n=Math.atan(12/wt*(r+Math.acos(Math.sin(r)*Math.cos(lt))-k)),h=Math.sqrt((1-Math.cos(s))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(r))))),f.value===ut.AREA_1?n+=k:f.value===ut.AREA_2?n+=wt:f.value===ut.AREA_3&&(n+=1.5*wt),e.x=h*Math.cos(n),e.y=h*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 uf(t){var e={lam:0,phi:0},i,a,r,s,h,n,f,l,d,_={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)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?_.value=ut.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(_.value=ut.AREA_1,i-=k):t.x<0&&-t.x>=Math.abs(t.y)?(_.value=ut.AREA_2,i=i<0?i+wt:i-wt):(_.value=ut.AREA_3,i+=k),d=wt/12*Math.tan(i),h=Math.sin(d)/(Math.cos(d)-1/Math.sqrt(2)),n=Math.atan(h),r=Math.cos(i),s=Math.tan(a),f=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(n)))),f<-1?f=-1:f>1&&(f=1),this.face===yt.TOP)l=Math.acos(f),e.phi=k-l,_.value===ut.AREA_0?e.lam=n+k:_.value===ut.AREA_1?e.lam=n<0?n+wt:n-wt:_.value===ut.AREA_2?e.lam=n-k:e.lam=n;else if(this.face===yt.BOTTOM)l=Math.acos(f),e.phi=l-k,_.value===ut.AREA_0?e.lam=-n+k:_.value===ut.AREA_1?e.lam=-n:_.value===ut.AREA_2?e.lam=-n-k:e.lam=n<0?-n-wt:-n+wt;else{var u,x,y;u=f,d=u*u,d>=1?y=0:y=Math.sqrt(1-d)*Math.sin(n),d+=y*y,d>=1?x=0:x=Math.sqrt(1-d),_.value===ut.AREA_1?(d=x,x=-y,y=d):_.value===ut.AREA_2?(x=-x,y=-y):_.value===ut.AREA_3&&(d=x,x=y,y=-d),this.face===yt.RIGHT?(d=u,u=-x,x=d):this.face===yt.BACK?(u=-u,x=-x):this.face===yt.LEFT&&(d=u,u=x,x=-d),e.phi=Math.acos(-y)-k,e.lam=Math.atan2(x,u),this.face===yt.RIGHT?e.lam=Fe(e.lam,-k):this.face===yt.BACK?e.lam=Fe(e.lam,-wt):this.face===yt.LEFT&&(e.lam=Fe(e.lam,+k))}if(this.es!==0){var A,w,C;A=e.phi<0?1:0,w=Math.tan(e.phi),C=this.b/Math.sqrt(w*w+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-C*C)/(this.one_minus_f*C)),A&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function gi(t,e,i,a){var r;return t<z?(a.value=ut.AREA_0,r=0):(r=Math.atan2(e,i),Math.abs(r)<=lt?a.value=ut.AREA_0:r>lt&&r<=k+lt?(a.value=ut.AREA_1,r-=k):r>k+lt||r<=-(k+lt)?(a.value=ut.AREA_2,r=r>=0?r-wt:r+wt):(a.value=ut.AREA_3,r+=k)),r}function Fe(t,e){var i=t+e;return i<-wt?i+=Qe:i>+wt&&(i-=Qe),i}var cf=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const df={init:ff,forward:lf,inverse:uf,names:cf};var da=[[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]],$e=[[-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]],Ss=.8487,As=1.3523,Ps=zt/5,_f=1/Ps,Be=18,Ai=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},vf=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function gf(t,e,i,a){for(var r=e;a;--a){var s=t(r);if(r-=s,Math.abs(s)<i)break}return r}function xf(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function yf(t){var e=j(t.x-this.long0,this.over),i=Math.abs(t.y),a=Math.floor(i*Ps);a<0?a=0:a>=Be&&(a=Be-1),i=zt*(i-_f*a);var r={x:Ai(da[a],i)*e,y:Ai($e[a],i)};return t.y<0&&(r.y=-r.y),r.x=r.x*this.a*Ss+this.x0,r.y=r.y*this.a*As+this.y0,r}function mf(t){var e={x:(t.x-this.x0)/(this.a*Ss),y:Math.abs(t.y-this.y0)/(this.a*As)};if(e.y>=1)e.x/=da[Be][0],e.y=t.y<0?-k:k;else{var i=Math.floor(e.y*Be);for(i<0?i=0:i>=Be&&(i=Be-1);;)if($e[i][0]>e.y)--i;else if($e[i+1][0]<=e.y)++i;else break;var a=$e[i],r=5*(e.y-a[0])/($e[i+1][0]-a[0]);r=gf(function(s){return(Ai(a,s)-e.y)/vf(a,s)},r,z,100),e.x/=Ai(da[i],r),e.y=(5*i+r)*Mt,t.y<0&&(e.y=-e.y)}return e.x=j(e.x+this.long0,this.over),e}var Mf=["Robinson","robin"];const wf={init:xf,forward:yf,inverse:mf,names:Mf};function Ef(){this.name="geocent"}function bf(t){var e=_s(t,this.es,this.a);return e}function pf(t){var e=vs(t,this.es,this.a,this.b);return e}var Sf=["Geocentric","geocentric","geocent","Geocent"];const Af={init:Ef,forward:bf,inverse:pf,names:Sf};var kt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},qe={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 Pf(){if(Object.keys(qe).forEach(function(i){if(typeof this[i]>"u")this[i]=qe[i].def;else{if(qe[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);qe[i].num&&(this[i]=parseFloat(this[i]))}qe[i].degrees&&(this[i]=this[i]*Mt)}.bind(this)),Math.abs(Math.abs(this.lat0)-k)<z?this.mode=this.lat0<0?kt.S_POLE:kt.N_POLE:Math.abs(this.lat0)<z?this.mode=kt.EQUIT:(this.mode=kt.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 Cf(t){t.x-=this.long0;var e=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),r,s;switch(this.mode){case kt.OBLIQ:s=this.sinph0*e+this.cosph0*i*a;break;case kt.EQUIT:s=i*a;break;case kt.S_POLE:s=-e;break;case kt.N_POLE:s=e;break}switch(s=this.pn1/(this.p-s),r=s*i*Math.sin(t.x),this.mode){case kt.OBLIQ:s*=this.cosph0*e-this.sinph0*i*a;break;case kt.EQUIT:s*=e;break;case kt.N_POLE:s*=-(i*a);break;case kt.S_POLE:s*=i*a;break}var h,n;return h=s*this.cg+r*this.sg,n=1/(h*this.sw*this.h1+this.cw),r=(r*this.cg-s*this.sg)*this.cw*n,s=h*n,t.x=r*this.a,t.y=s*this.a,t}function Gf(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},i,a,r;r=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*r,a=this.pn1*t.y*this.cw*r,t.x=i*this.cg+a*this.sg,t.y=a*this.cg-i*this.sg;var s=Lt(t.x,t.y);if(Math.abs(s)<z)e.x=0,e.y=t.y;else{var h,n;switch(n=1-s*s*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/s+s/this.pn1),h=Math.sqrt(1-n*n),this.mode){case kt.OBLIQ:e.y=Math.asin(h*this.sinph0+t.y*n*this.cosph0/s),t.y=(h-this.sinph0*Math.sin(e.y))*s,t.x*=n*this.cosph0;break;case kt.EQUIT:e.y=Math.asin(t.y*n/s),t.y=h*s,t.x*=n;break;case kt.N_POLE:e.y=Math.asin(h),t.y=-t.y;break;case kt.S_POLE:e.y=-Math.asin(h);break}e.x=Math.atan2(t.x,t.y)}return t.x=e.x+this.long0,t.y=e.y,t}var If=["Tilted_Perspective","tpers"];const Nf={init:Pf,forward:Cf,inverse:Gf,names:If};function Rf(){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 Df(t){var e=t.x,i=t.y,a,r,s,h;if(e=e-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var n=this.radius_p/Lt(this.radius_p*Math.cos(i),Math.sin(i));if(r=n*Math.cos(e)*Math.cos(i),s=n*Math.sin(e)*Math.cos(i),h=n*Math.sin(i),(this.radius_g-r)*r-s*s-h*h*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Lt(h,a)),t.y=this.radius_g_1*Math.atan(h/a)):(t.x=this.radius_g_1*Math.atan(s/a),t.y=this.radius_g_1*Math.atan(h/Lt(s,a)))}else this.shape==="sphere"&&(a=Math.cos(i),r=Math.cos(e)*a,s=Math.sin(e)*a,h=Math.sin(i),a=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Lt(h,a)),t.y=this.radius_g_1*Math.atan(h/a)):(t.x=this.radius_g_1*Math.atan(s/a),t.y=this.radius_g_1*Math.atan(h/Lt(s,a))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function kf(t){var e=-1,i=0,a=0,r,s,h,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),i=Math.tan(t.x/this.radius_g_1)*Lt(1,a)):(i=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Lt(1,i));var f=a/this.radius_p;if(r=i*i+f*f+e*e,s=2*this.radius_g*e,h=s*s-4*r*this.C,h<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-s-Math.sqrt(h))/(2*r),e=this.radius_g+n*e,i*=n,a*=n,t.x=Math.atan2(i,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),i=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(i=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+i*i)),r=i*i+a*a+e*e,s=2*this.radius_g*e,h=s*s-4*r*this.C,h<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-s-Math.sqrt(h))/(2*r),e=this.radius_g+n*e,i*=n,a*=n,t.x=Math.atan2(i,e),t.y=Math.atan(a*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var Tf=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Bf={init:Rf,forward:Df,inverse:kf,names:Tf};var We=1.340264,Xe=-.081106,Ke=893e-6,Ve=.003796,Pi=Math.sqrt(3)/2;function Of(){this.es=0,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}function Ff(t){var e=j(t.x-this.long0,this.over),i=t.y,a=Math.asin(Pi*Math.sin(i)),r=a*a,s=r*r*r;return t.x=e*Math.cos(a)/(Pi*(We+3*Xe*r+s*(7*Ke+9*Ve*r))),t.y=a*(We+Xe*r+s*(Ke+Ve*r)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Lf(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e=1e-9,i=12,a=t.y,r,s,h,n,f,l;for(l=0;l<i&&(r=a*a,s=r*r*r,h=a*(We+Xe*r+s*(Ke+Ve*r))-t.y,n=We+3*Xe*r+s*(7*Ke+9*Ve*r),a-=f=h/n,!(Math.abs(f)<e));++l);return r=a*a,s=r*r*r,t.x=Pi*t.x*(We+3*Xe*r+s*(7*Ke+9*Ve*r))/Math.cos(a),t.y=Math.asin(Math.sin(a)/Pi),t.x=j(t.x+this.long0,this.over),t}var zf=["eqearth","Equal Earth","Equal_Earth"];const Uf={init:Of,forward:Ff,inverse:Lf,names:zf};var ti=1e-10;function qf(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<ti)throw new Error;this.es?(this.en=Ea(this.es),this.m1=Ue(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=Zf,this.forward=jf):(Math.abs(this.phi1)+ti>=k?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Hf,this.forward=$f)}function jf(t){var e=j(t.x-(this.long0||0),this.over),i=t.y,a,r,s;return a=this.am1+this.m1-Ue(i,r=Math.sin(i),s=Math.cos(i),this.en),r=s*e/(a*Math.sqrt(1-this.es*r*r)),t.x=a*Math.sin(r),t.y=this.am1-a*Math.cos(r),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Zf(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,a,r;if(i=Lt(t.x,t.y=this.am1-t.y),r=ba(this.am1+this.m1-i,this.es,this.en),(e=Math.abs(r))<k)e=Math.sin(r),a=i*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(r);else if(Math.abs(e-k)<=ti)a=0;else throw new Error;return t.x=j(a+(this.long0||0),this.over),t.y=me(r),t}function $f(t){var e=j(t.x-(this.long0||0),this.over),i=t.y,a,r;return r=this.cphi1+this.phi1-i,Math.abs(r)>ti?(t.x=r*Math.sin(a=e*Math.cos(i)/r),t.y=this.cphi1-r*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 Hf(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,a=Lt(t.x,t.y=this.cphi1-t.y);if(i=this.cphi1+this.phi1-a,Math.abs(i)>k)throw new Error;return Math.abs(Math.abs(i)-k)<=ti?e=0:e=a*Math.atan2(t.x,t.y)/Math.cos(i),t.x=j(e+(this.long0||0),this.over),t.y=me(i),t}var Wf=["bonne","Bonne (Werner lat_1=90)"];const Xf={init:qf,names:Wf},zr={OBLIQUE:{forward:Jf,inverse:el},TRANSVERSE:{forward:tl,inverse:il}},Ci={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 Kf(){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=ls.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=Qt(t);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let i;const a=Object.keys(Ci),r=n=>{if(typeof this[n]>"u")return;const f=parseFloat(this[n])*Mt;if(isNaN(f))throw new Error("Invalid value for "+n+": "+this[n]);return f};for(let n=0;n<a.length;n++){const f=a[n],l=Ci[f],d=Object.entries(l);if(d.some(([u])=>typeof this[u]<"u")){i=l;for(let u=0;u<d.length;u++){const[x,y]=d[u],A=r(x);if(typeof A>"u")throw new Error("Missing parameter: "+x+".");this[y]=A}break}}if(!i)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:s,phip:h}=Yf(this,i);this.lamp=s,Math.abs(h)>z?(this.cphip=Math.cos(h),this.sphip=Math.sin(h),this.projectionType=zr.OBLIQUE):this.projectionType=zr.TRANSVERSE}function Vf(t){return this.projectionType.forward(this,t)}function Qf(t){return this.projectionType.inverse(this,t)}function Yf(t,e){let i,a;if(e===Ci.ROTATE){let r=t.oLongC,s=t.oLatC,h=t.oAlpha;if(Math.abs(Math.abs(s)-k)<=z)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");a=r+Math.atan2(-1*Math.cos(h),-1*Math.sin(h)*Math.sin(s)),i=Math.asin(Math.cos(s)*Math.sin(h))}else if(e===Ci.NEW_POLE)a=t.oLongP,i=t.oLatP;else{let r=t.oLong1,s=t.oLat1,h=t.oLong2,n=t.oLat2,f=Math.abs(s);if(Math.abs(s)>k-z)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(n)>k-z)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(s-n)<z)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(f<z)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");a=Math.atan2(Math.cos(s)*Math.sin(n)*Math.cos(r)-Math.sin(s)*Math.cos(n)*Math.cos(h),Math.sin(s)*Math.cos(n)*Math.sin(h)-Math.cos(s)*Math.sin(n)*Math.sin(r)),i=Math.atan(-1*Math.cos(a-r)/Math.tan(s))}return{lamp:a,phip:i}}function Jf(t,e){let{x:i,y:a}=e;i+=t.long0;const r=Math.cos(i),s=Math.sin(a),h=Math.cos(a);e.x=j(Math.atan2(h*Math.sin(i),t.sphip*h*r+t.cphip*s)+t.lamp),e.y=Math.asin(t.sphip*s-t.cphip*h*r);const n=t.obliqueProjection.forward(e);return t.isIdentity&&(n.x*=zt,n.y*=zt),n}function tl(t,e){let{x:i,y:a}=e;i+=t.long0;const r=Math.cos(a),s=Math.cos(i);e.x=j(Math.atan2(r*Math.sin(i),Math.sin(a))+t.lamp),e.y=Math.asin(-1*r*s);const h=t.obliqueProjection.forward(e);return t.isIdentity&&(h.x*=zt,h.y*=zt),h}function el(t,e){t.isIdentity&&(e.x*=Mt,e.y*=Mt);const i=t.obliqueProjection.inverse(e);let{x:a,y:r}=i;if(a<Number.MAX_VALUE){a-=t.lamp;const s=Math.cos(a),h=Math.sin(r),n=Math.cos(r);e.x=Math.atan2(n*Math.sin(a),t.sphip*n*s-t.cphip*h),e.y=Math.asin(t.sphip*h+t.cphip*n*s)}return e.x=j(e.x+t.long0),e}function il(t,e){t.isIdentity&&(e.x*=Mt,e.y*=Mt);const i=t.obliqueProjection.inverse(e);let{x:a,y:r}=i;if(a<Number.MAX_VALUE){const s=Math.cos(r);a-=t.lamp,e.x=Math.atan2(s*Math.sin(a),-1*Math.sin(r)),e.y=Math.asin(s*Math.cos(a))}return e.x=j(e.x+t.long0),e}var al=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const rl={init:Kf,forward:Vf,inverse:Qf,names:al};function sl(t){t.Proj.projections.add(yi),t.Proj.projections.add(mi),t.Proj.projections.add($h),t.Proj.projections.add(to),t.Proj.projections.add(so),t.Proj.projections.add(lo),t.Proj.projections.add(xo),t.Proj.projections.add(Eo),t.Proj.projections.add(Po),t.Proj.projections.add(Ro),t.Proj.projections.add($o),t.Proj.projections.add(Qo),t.Proj.projections.add(i0),t.Proj.projections.add(o0),t.Proj.projections.add(d0),t.Proj.projections.add(y0),t.Proj.projections.add(b0),t.Proj.projections.add(C0),t.Proj.projections.add(k0),t.Proj.projections.add(L0),t.Proj.projections.add(Z0),t.Proj.projections.add(K0),t.Proj.projections.add(af),t.Proj.projections.add(of),t.Proj.projections.add(df),t.Proj.projections.add(wf),t.Proj.projections.add(Af),t.Proj.projections.add(Nf),t.Proj.projections.add(Bf),t.Proj.projections.add(Uf),t.Proj.projections.add(Xf),t.Proj.projections.add(rl)}const Ii=Object.assign(oh,{defaultDatum:"WGS84",Proj:Qt,WGS84:new Qt("WGS84"),Point:Le,toPoint:gs,defs:Gt,nadgrid:Zn,transform:pi,mgrs:fh,version:"__VERSION__"});sl(Ii);try{let t=()=>new DecompressionStream("deflate-raw"),e=i=>new Response(i);t(),Cs=i=>e(e(i).body.pipeThrough(t())).arrayBuffer().then(a=>new Uint8Array(a))}catch{}var Cs,Ur=new TextDecoder,na=t=>{throw Error("but-unzip~"+t)};function*nl(t,e=Cs){let i=t.length-21,a=i-65536,r=new DataView(t.buffer,t.byteOffset),s=f=>r.getUint16(f+i,1),h=f=>r.getUint32(f+i,1),n=(f,l)=>t.subarray(i+=f,i+=l);for(;i>a&&(i=t.lastIndexOf(80,i-1))+1&&(t[i+1]-75||t[i+2]-5||t[i+3]-6););for(i<0&&na(2),a=s(10),a-s(8)&&na(3),i=h(16);a--;){let f=s(10),l=s(28),d=s(30),_=s(32),u=h(20),x=h(42),y=Ur.decode(n(46,l)),A=Ur.decode(n(d,_)),w=i,C;i=x,C=n(30+s(26)+s(28),u),yield{filename:y,comment:A,read:()=>f-8?f?na(1):C:e(C)},i=w}}const hl=/.+\.(shp|dbf|json|prj|cpg)$/i,ol=async t=>{const e={},i=[];for(const s of nl(t))hl.test(s.filename)&&i.push(Promise.resolve(s.read()).then(h=>e[s.filename]=h));await Promise.all(i);const a={},r=new TextDecoder;for(const[s,h]of Object.entries(e))s.slice(-3).toLowerCase()==="shp"||s.slice(-3).toLowerCase()==="dbf"?a[s]=new DataView(h.buffer,h.byteOffset,h.byteLength):a[s]=r.decode(h);return a},fl=globalThis.URL,ll=(t,e)=>{if(!e)return t;const i=new fl(t);return i.pathname=`${i.pathname}.${e}`,i.href};async function ei(t,e){const i=ll(t,e),a=e==="prj"||e==="cpg";try{const r=await fetch(i);if(r.status>399)throw new Error(r.statusText);if(a)return r.text();const s=await r.arrayBuffer();return new DataView(s)}catch(r){if(a||e==="dbf")return!1;throw r}}function ul(t){let e=0,i=1;const a=t.length;let r,s;const h=[t[0][0],t[0][1],t[0][0],t[0][1]];for(;i<a;)r=s||t[0],s=t[i],e+=(s[0]-r[0])*(s[1]+r[1]),i++,s[0]<h[0]&&(h[0]=s[0]),s[1]<h[1]&&(h[1]=s[1]),s[0]>h[2]&&(h[2]=s[0]),s[1]>h[3]&&(h[3]=s[1]);return{ring:t,clockWise:e>0,bbox:h,children:[]}}function qr(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 Gs(t,e=!1){const i=[],a=[];for(const h of t){const n=ul(h);n.clockWise!==e?i.push(n):a.push(n)}const r=[];for(const h of a){let n;for(const f of i)qr(f,h)&&(n?qr(n,f)&&(n=f):n=f);n?n.children.push(h.ring):r.push(h)}if(e)return{outers:i,orphens:r};if(r.length&&!e){const h=Gs(t,!0);if(h.orphens.length===0){const n=[];for(const f of h.outers)n.push([f.ring.toReversed()].concat(f.children.map(l=>l.toReversed())));return n}}const s=[];for(const h of i)s.push([h.ring].concat(h.children));return s}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,i){const a=[];let r=0;for(;r<i;)a.push(this.parseCoord(t,e)),e+=16,r++;return a};Et.prototype.parseZPointArray=function(t,e,i,a){let r=0;for(;r<i;)a[r].push(t.getFloat64(e,!0)),r++,e+=8;return a};Et.prototype.parseArrayGroup=function(t,e,i,a,r){const s=[];let h=0,n,f=0,l;for(;h<a;)h++,i+=4,n=f,h===a?f=r:f=t.getInt32(i,!0),l=f-n,l&&(s.push(this.parsePointArray(t,e,l)),e+=l<<4);return s};Et.prototype.parseZArrayGroup=function(t,e,i,a){let r=0;for(;r<i;)a[r]=this.parseZPointArray(t,e,a[r].length,a[r]),e+=a[r].length<<3,r++;return a};Et.prototype.parseMultiPoint=function(t){const e={},i=t.getInt32(32,!0);if(!i)return null;const a=this.parseCoord(t,0),r=this.parseCoord(t,16);e.bbox=[a[0],a[1],r[0],r[1]];const s=36;return i===1?(e.type="Point",e.coordinates=this.parseCoord(t,s)):(e.type="MultiPoint",e.coordinates=this.parsePointArray(t,s,i)),e};Et.prototype.parseZMultiPoint=function(t){const e=this.parseMultiPoint(t);if(!e)return null;let i;if(e.type==="Point")return e.coordinates.push(t.getFloat64(72,!0)),e;i=e.coordinates.length;const a=52+(i<<4);return e.coordinates=this.parseZPointArray(t,a,i,e.coordinates),e};Et.prototype.parsePolyline=function(t){const e={},i=t.getInt32(32,!0);if(!i)return null;const a=this.parseCoord(t,0),r=this.parseCoord(t,16);e.bbox=[a[0],a[1],r[0],r[1]];const s=t.getInt32(36,!0);let h,n;return i===1?(e.type="LineString",h=44,e.coordinates=this.parsePointArray(t,h,s)):(e.type="MultiLineString",h=40+(i<<2),n=40,e.coordinates=this.parseArrayGroup(t,h,n,i,s)),e};Et.prototype.parseZPolyline=function(t){const e=this.parsePolyline(t);if(!e)return null;const i=e.coordinates.length;let a;return e.type==="LineString"?(a=60+(i<<4),e.coordinates=this.parseZPointArray(t,a,i,e.coordinates),e):(a=56+(e.coordinates.reduce(function(s,h){return s+h.length},0)<<4)+(i<<2),e.coordinates=this.parseZArrayGroup(t,a,i,e.coordinates),e)};Et.prototype.polyFuncs=function(t){return t&&(t.type==="LineString"?(t.type="Polygon",t.coordinates=[t.coordinates],t):(t.coordinates=Gs(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 jr={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};function cl(t){return t?function(e,i){const a=[e.getFloat64(i,!0),e.getFloat64(i+8,!0)];return t.inverse(a)}:function(e,i){return[e.getFloat64(i,!0),e.getFloat64(i+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 jr))throw new Error(`I don't know shp type "${e}"`);this.parseFunc=this[jr[e]],this.parseCoord=cl(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,i=[];let a;for(;t<=e&&(a=this.getRow(t),!!a);)t+=8,t+=a.len,a.type?i.push(this.parseFunc(a.data)):i.push(null);return i};Et.prototype.getRow=function(t){const e=this.buffer.getInt32(t),i=this.buffer.getInt32(t+4)<<1;if(i===0)return{id:e,len:i,type:0};if(!(t+i+8>this.buffer.byteLength))return{id:e,len:i,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+t+12,i-4),type:this.buffer.getInt32(t+8,!0)}};function Ga(t,e){return new Et(t,e).rows}var dl=/^(?:ANSI\s)?(\d+)$/m;function Is(t,e){if(!t)return a;try{new TextDecoder(t.trim())}catch{var i=dl.exec(t);return i&&!e?Is("windows-"+i[1],!0):(t=void 0,a)}return a;function a(r){var s=new TextDecoder(t||void 0),h=s.decode(r,{stream:!0})+s.decode();return h.replace(/\0/g,"").trim()}}function _l(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 vl(t,e,i){for(var a=[],r=32;r<e&&(a.push({name:i(new Uint8Array(t.buffer.slice(t.byteOffset+r,t.byteOffset+r+11))),dataType:String.fromCharCode(t.getUint8(r+11)),len:t.getUint8(r+16),decimal:t.getUint8(r+17)}),t.getUint8(r+32)!==13);)r+=32;return a}function gl(t,e,i,a,r){const s=new Uint8Array(t.buffer.slice(t.byteOffset+e,t.byteOffset+e+i));var h=r(s);switch(a){case"N":case"F":case"O":return parseFloat(h,10);case"D":return new Date(h.slice(0,4),parseInt(h.slice(4,6),10)-1,h.slice(6,8));case"L":return h.toLowerCase()==="y"||h.toLowerCase()==="t";default:return h}}function xl(t,e,i,a){for(var r={},s=0,h=i.length,n,f;s<h;)f=i[s],n=gl(t,e,f.len,f.dataType,a),e+=f.len,typeof n<"u"&&(r[f.name]=n),s++;return r}function Ia(t,e){for(var i=Is(e),a=_l(t),r=vl(t,a.headerLen-1,i),s=(r.length+1<<5)+2,h=a.recLen,n=a.records,f=[];n;)f.push(xl(t,s,r,i)),s+=h,n--;return f}const yl=globalThis.URL,ml=t=>{if(!t)throw new Error("forgot to pass buffer");if(ze(t))return new Uint8Array(t);if(ze(t.buffer))return t.BYTES_PER_ELEMENT===1?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")},Ml=new TextDecoder,Ns=t=>{if(t){if(typeof t=="string")return t;if(ze(t)||ArrayBuffer.isView(t)||Na(t))return Ml.decode(t)}},Rs=t=>{if(!t)throw new Error("forgot to pass buffer");if(Na(t))return t;if(ze(t))return new DataView(t);if(ze(t.buffer))return new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")};function ze(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 Ni=function([t,e]){const i={};i.type="FeatureCollection",i.features=[];let a=0;const r=t.length;for(e||(e=[]);a<r;)i.features.push({type:"Feature",geometry:t[a],properties:e[a]||{}}),a++;return i},Ra=async function(t,e){let i;t=ml(t);const a=await ol(t),r=[];e=e||[];for(i in a)i.indexOf("__MACOSX")===-1&&(i.slice(-4).toLowerCase()===".shp"?(r.push(i.slice(0,-4)),a[i.slice(0,-3)+i.slice(-3).toLowerCase()]=a[i]):i.slice(-4).toLowerCase()===".prj"?a[i.slice(0,-3)+i.slice(-3).toLowerCase()]=Ii(a[i]):i.slice(-5).toLowerCase()===".json"||e.indexOf(i.split(".").pop())>-1?r.push(i.slice(0,-3)+i.slice(-3).toLowerCase()):(i.slice(-4).toLowerCase()===".dbf"||i.slice(-4).toLowerCase()===".cpg")&&(a[i.slice(0,-3)+i.slice(-3).toLowerCase()]=a[i]));if(!r.length)throw new Error("no layers founds");const s=r.map(function(h){let n,f;const l=h.lastIndexOf(".");return l>-1&&h.slice(l).indexOf("json")>-1?(n=JSON.parse(a[h]),n.fileName=h.slice(0,l)):e.indexOf(h.slice(l+1))>-1?(n=a[h],n.fileName=h):(a[h+".dbf"]&&(f=Ia(a[h+".dbf"],a[h+".cpg"])),n=Ni([Ga(a[h+".shp"],a[h+".prj"]),f]),n.fileName=h),n});return s.length===1?s[0]:s};async function wl(t,e){const i=await ei(t);return Ra(i,e)}const El=async t=>{const e=await Promise.all([ei(t,"shp"),ei(t,"prj")]);let i=!1;try{e[1]&&(i=Ii(e[1]))}catch{i=!1}return Ga(e[0],i)},bl=async t=>{const[e,i]=await Promise.all([ei(t,"dbf"),ei(t,"cpg")]);if(e)return Ia(e,i)},Zr=(t,e)=>new yl(t,globalThis?.document?.location).pathname.slice(-4).toLowerCase()===e,pl=({shp:t,dbf:e,cpg:i,prj:a})=>{const r=[Ds(t,a)];return e&&r.push(ks(e,i)),Ni(r)},$r=async function(t,e){if(typeof t!="string"){if(ze(t)||ArrayBuffer.isView(t)||Na(t))return Ra(t);if(t.shp)return pl(t);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(Zr(t,".zip"))return wl(t,e);Zr(t,".shp")&&(t=t.slice(0,-4));const i=await Promise.all([El(t),bl(t)]);return Ni(i)},Ds=function(t,e){if(t=Rs(t),e=Ns(e),typeof e=="string")try{e=Ii(e)}catch{e=!1}return Ga(t,e)},ks=function(t,e){return t=Rs(t),e=Ns(e),Ia(t,e)},Al=Object.freeze(Object.defineProperty({__proto__:null,combine:Ni,default:$r,getShapefile:$r,parseDbf:ks,parseShp:Ds,parseZip:Ra},Symbol.toStringTag,{value:"Module"}));export{Al as i,Sl as r};
|
||
//# sourceMappingURL=shpjs-iyObTF9J.js.map
|