@corpsmap/corpsmap 3.2.84 → 3.2.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/prod.js CHANGED
@@ -80081,6 +80081,8 @@ function globals (defs) {
80081
80081
  defs('EPSG:' + (32600 + i), '+proj=utm +zone=' + i + ' +datum=WGS84 +units=m');
80082
80082
  defs('EPSG:' + (32700 + i), '+proj=utm +zone=' + i + ' +south +datum=WGS84 +units=m');
80083
80083
  }
80084
+ defs('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');
80085
+ defs('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');
80084
80086
 
80085
80087
  defs.WGS84 = defs['EPSG:4326'];
80086
80088
  defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857
@@ -80298,6 +80300,9 @@ function projStr (defData) {
80298
80300
  },
80299
80301
  approx: function () {
80300
80302
  self.approx = true;
80303
+ },
80304
+ over: function () {
80305
+ self.over = true;
80301
80306
  }
80302
80307
  };
80303
80308
  for (paramName in paramObj) {
@@ -80316,6 +80321,7 @@ function projStr (defData) {
80316
80321
  if (typeof self.datumCode === 'string' && self.datumCode !== 'WGS84') {
80317
80322
  self.datumCode = self.datumCode.toLowerCase();
80318
80323
  }
80324
+ self['projStr'] = defData;
80319
80325
  return self;
80320
80326
  }
80321
80327
 
@@ -80367,10 +80373,11 @@ class PROJJSONBuilderBase {
80367
80373
  if (abbreviation === 'E') direction = 'east';
80368
80374
  else if (abbreviation === 'N') direction = 'north';
80369
80375
  else if (abbreviation === 'U') direction = 'up';
80376
+ else if (node[2]) direction = node[2];
80370
80377
  else throw new Error(`Unknown axis abbreviation: ${abbreviation}`);
80371
80378
  } else {
80372
80379
  // Use the explicit direction provided in the AXIS node
80373
- direction = node[2] ? node[2].toLowerCase() : 'unknown';
80380
+ direction = node[2] || 'unknown';
80374
80381
  }
80375
80382
 
80376
80383
  const orderNode = node.find((child) => Array.isArray(child) && child[0] === 'ORDER');
@@ -80430,7 +80437,8 @@ class PROJJSONBuilderBase {
80430
80437
 
80431
80438
  case 'BASEGEOGCRS':
80432
80439
  case 'GEOGCRS':
80433
- result.type = 'GeographicCRS';
80440
+ case 'GEODCRS':
80441
+ result.type = node[0] === 'GEODCRS' ? 'GeodeticCRS' : 'GeographicCRS';
80434
80442
  result.name = node[1];
80435
80443
 
80436
80444
  // Handle DATUM or ENSEMBLE
@@ -81054,8 +81062,8 @@ function applyProjectionDefaults(wkt) {
81054
81062
  // Normalize projName for WKT2 compatibility
81055
81063
  const normalizedProjName = (wkt.projName || '').toLowerCase().replace(/_/g, ' ');
81056
81064
 
81057
- if (!wkt.long0 && wkt.longc && (normalizedProjName === 'albers conic equal area' || normalizedProjName === 'lambert azimuthal equal area')) {
81058
- wkt.long0 = wkt.longc;
81065
+ if (wkt.long0 === undefined && wkt.longc !== undefined) {
81066
+ wkt.long0 = wkt.longc; // keep in the projection's native prime meridian frame
81059
81067
  }
81060
81068
  if (!wkt.lat_ts && wkt.lat1 && (normalizedProjName === 'stereographic south pole' || normalizedProjName === 'polar stereographic (variant b)')) {
81061
81069
  wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
@@ -81151,6 +81159,12 @@ function transformPROJJSON(projjson, result = {}) {
81151
81159
  case 'type':
81152
81160
  if (value === 'GeographicCRS') {
81153
81161
  result.projName = 'longlat';
81162
+ } else if (value === 'GeodeticCRS') {
81163
+ if (projjson.coordinate_system && projjson.coordinate_system.subtype === 'Cartesian') {
81164
+ result.projName = 'geocent';
81165
+ } else {
81166
+ result.projName = 'longlat';
81167
+ }
81154
81168
  } else if (value === 'ProjectedCRS' && projjson.conversion && projjson.conversion.method) {
81155
81169
  result.projName = projjson.conversion.method.name; // Retain original capitalization
81156
81170
  }
@@ -81179,16 +81193,24 @@ function transformPROJJSON(projjson, result = {}) {
81179
81193
 
81180
81194
  case 'coordinate_system':
81181
81195
  if (value.axis) {
81182
- result.axis = value.axis
81183
- .map((axis) => {
81184
- const direction = axis.direction;
81185
- if (direction === 'east') return 'e';
81186
- if (direction === 'north') return 'n';
81187
- if (direction === 'west') return 'w';
81188
- if (direction === 'south') return 's';
81189
- throw new Error(`Unknown axis direction: ${direction}`);
81190
- })
81191
- .join('') + 'u'; // Combine into a single string (e.g., "enu")
81196
+ const directionMap = {
81197
+ 'east': 'e',
81198
+ 'north': 'n',
81199
+ 'west': 'w',
81200
+ 'south': 's',
81201
+ 'up': 'u',
81202
+ 'down': 'd',
81203
+ 'geocentricx': 'e',
81204
+ 'geocentricy': 'n',
81205
+ 'geocentricz': 'u',
81206
+ };
81207
+ const mapped = value.axis.map((axis) => directionMap[axis.direction.toLowerCase()]);
81208
+ if (mapped.every(Boolean)) {
81209
+ result.axis = mapped.join('');
81210
+ if (result.axis.length === 2) {
81211
+ result.axis += 'u';
81212
+ }
81213
+ }
81192
81214
 
81193
81215
  if (value.unit) {
81194
81216
  const { units, to_meter } = processUnit(value.unit);
@@ -81416,9 +81438,9 @@ function setPropertiesFromWkt(wkt) {
81416
81438
  geogcs = wkt;
81417
81439
  }
81418
81440
  if (geogcs) {
81419
- //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){
81420
- // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;
81421
- //}
81441
+ if (geogcs.PRIMEM && geogcs.PRIMEM.convert) {
81442
+ wkt.from_greenwich = d2r(geogcs.PRIMEM.convert);
81443
+ }
81422
81444
  if (geogcs.DATUM) {
81423
81445
  wkt.datumCode = geogcs.DATUM.name.toLowerCase();
81424
81446
  } else {
@@ -81446,7 +81468,7 @@ function setPropertiesFromWkt(wkt) {
81446
81468
  }
81447
81469
 
81448
81470
  wkt.a = geogcs.DATUM.SPHEROID.a;
81449
- wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);
81471
+ wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf);
81450
81472
  }
81451
81473
 
81452
81474
  if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {
@@ -81575,6 +81597,8 @@ function wkt(wkt) {
81575
81597
  * @property {boolean} [sphere]
81576
81598
  * @property {number} [rectified_grid_angle]
81577
81599
  * @property {boolean} [approx]
81600
+ * @property {boolean} [over]
81601
+ * @property {string} [projStr]
81578
81602
  * @property {<T extends import('./core').TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T} inverse
81579
81603
  * @property {<T extends import('./core').TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T} forward
81580
81604
  */
@@ -81611,8 +81635,14 @@ function defs(name) {
81611
81635
  } else {
81612
81636
  defs[/** @type {string} */ (name)] = wkt(arguments[1]);
81613
81637
  }
81638
+ } else if (def && typeof def === 'object' && !('projName' in def)) {
81639
+ // PROJJSON
81640
+ defs[/** @type {string} */ (name)] = wkt(arguments[1]);
81614
81641
  } else {
81615
81642
  defs[/** @type {string} */ (name)] = def;
81643
+ if (!def) {
81644
+ delete defs[/** @type {string} */ (name)];
81645
+ }
81616
81646
  }
81617
81647
  } else if (arguments.length === 1) {
81618
81648
  if (Array.isArray(name)) {
@@ -81652,6 +81682,9 @@ function testWKT(code) {
81652
81682
  }
81653
81683
  var codes = ['3857', '900913', '3785', '102113'];
81654
81684
  function checkMercator(item) {
81685
+ if (item.title) {
81686
+ return item.title.toLowerCase().indexOf('epsg:') === 0 && codes.indexOf(item.title.substr(5)) > -1;
81687
+ }
81655
81688
  var auth = match(item, 'authority');
81656
81689
  if (!auth) {
81657
81690
  return;
@@ -81674,31 +81707,27 @@ function testProj(code) {
81674
81707
  * @returns {import('./defs').ProjectionDefinition}
81675
81708
  */
81676
81709
  function parse$3(code) {
81710
+ let out;
81677
81711
  if (testObj(code)) {
81678
81712
  // check to see if this is a WKT string
81679
81713
  if (testDef(code)) {
81680
- return defs[code];
81681
- }
81682
- if (testWKT(code)) {
81683
- var out = wkt(code);
81684
- // test of spetial case, due to this being a very common and often malformed
81685
- if (checkMercator(out)) {
81686
- return defs['EPSG:3857'];
81687
- }
81714
+ out = defs[code];
81715
+ } else if (testWKT(code)) {
81716
+ out = wkt(code);
81688
81717
  var maybeProjStr = checkProjStr(out);
81689
81718
  if (maybeProjStr) {
81690
- return projStr(maybeProjStr);
81719
+ out = projStr(maybeProjStr);
81691
81720
  }
81692
- return out;
81693
- }
81694
- if (testProj(code)) {
81695
- return projStr(code);
81721
+ } else if (testProj(code)) {
81722
+ out = projStr(code);
81696
81723
  }
81697
81724
  } else if (!('projName' in code)) {
81698
- return wkt(code);
81725
+ out = wkt(code);
81699
81726
  } else {
81700
- return code;
81727
+ out = code;
81701
81728
  }
81729
+ // test for special Web Mercator case, due to this being a very common and often malformed
81730
+ return out && checkMercator(out) ? defs['EPSG:3857'] : out;
81702
81731
  }
81703
81732
 
81704
81733
  function extend$4 (destination, source) {
@@ -81725,7 +81754,10 @@ function sign$1 (x) {
81725
81754
  return x < 0 ? -1 : 1;
81726
81755
  }
81727
81756
 
81728
- function adjust_lon (x) {
81757
+ function adjust_lon (x, skipAdjust) {
81758
+ if (skipAdjust) {
81759
+ return x;
81760
+ }
81729
81761
  return (Math.abs(x) <= SPI) ? x : (x - (sign$1(x) * TWO_PI));
81730
81762
  }
81731
81763
 
@@ -81803,12 +81835,12 @@ function forward(p) {
81803
81835
  return null;
81804
81836
  } else {
81805
81837
  if (this.sphere) {
81806
- x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
81838
+ x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0, this.over);
81807
81839
  y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
81808
81840
  } else {
81809
81841
  var sinphi = Math.sin(lat);
81810
81842
  var ts = tsfnz(this.e, lat, sinphi);
81811
- x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
81843
+ x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0, this.over);
81812
81844
  y = this.y0 - this.a * this.k0 * Math.log(ts);
81813
81845
  }
81814
81846
  p.x = x;
@@ -81833,7 +81865,7 @@ function inverse(p) {
81833
81865
  return null;
81834
81866
  }
81835
81867
  }
81836
- lon = adjust_lon(this.long0 + x / (this.a * this.k0));
81868
+ lon = adjust_lon(this.long0 + x / (this.a * this.k0), this.over);
81837
81869
 
81838
81870
  p.x = lon;
81839
81871
  p.y = lat;
@@ -82319,7 +82351,7 @@ var datums = {
82319
82351
  towgs84: '-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166'
82320
82352
  },
82321
82353
  EPSG_4231: {
82322
- towgs84: '-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218'
82354
+ towgs84: '-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218'
82323
82355
  },
82324
82356
  EPSG_4274: {
82325
82357
  towgs84: '-230.994,102.591,25.199,0.633,-0.239,0.9,1.95'
@@ -82349,7 +82381,7 @@ var datums = {
82349
82381
  towgs84: '8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926'
82350
82382
  },
82351
82383
  EPSG_4289: {
82352
- towgs84: '565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244'
82384
+ towgs84: '565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244'
82353
82385
  },
82354
82386
  EPSG_4230: {
82355
82387
  towgs84: '-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4'
@@ -82379,7 +82411,7 @@ var datums = {
82379
82411
  towgs84: '-45,417,-3.5'
82380
82412
  },
82381
82413
  EPSG_4611: {
82382
- towgs84: '-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246'
82414
+ towgs84: '-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246'
82383
82415
  },
82384
82416
  EPSG_4633: {
82385
82417
  towgs84: '137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824'
@@ -82397,7 +82429,7 @@ var datums = {
82397
82429
  towgs84: '482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15'
82398
82430
  },
82399
82431
  EPSG_4660: {
82400
- towgs84: '982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805'
82432
+ towgs84: '982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805'
82401
82433
  },
82402
82434
  EPSG_4662: {
82403
82435
  towgs84: '97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259'
@@ -82427,7 +82459,7 @@ var datums = {
82427
82459
  towgs84: '217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093'
82428
82460
  },
82429
82461
  EPSG_9333: {
82430
- towgs84: '0,0,0,-8.393,0.749,-10.276,0'
82462
+ towgs84: '0,0,0,-0.008393,0.000749,-0.010276,0'
82431
82463
  },
82432
82464
  EPSG_9059: {
82433
82465
  towgs84: '0,0,0'
@@ -82583,7 +82615,7 @@ var datums = {
82583
82615
  towgs84: '674.374,15.056,405.346'
82584
82616
  },
82585
82617
  EPSG_4617: {
82586
- towgs84: '-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0'
82618
+ towgs84: '-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0'
82587
82619
  },
82588
82620
  EPSG_4663: {
82589
82621
  towgs84: '-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485'
@@ -82646,10 +82678,10 @@ var datums = {
82646
82678
  towgs84: '275.57,676.78,229.6'
82647
82679
  },
82648
82680
  EPSG_4283: {
82649
- towgs84: '61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994'
82681
+ towgs84: '0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994'
82650
82682
  },
82651
82683
  EPSG_4317: {
82652
- towgs84: '2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266'
82684
+ towgs84: '2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063'
82653
82685
  },
82654
82686
  EPSG_4272: {
82655
82687
  towgs84: '59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993'
@@ -82772,7 +82804,7 @@ var datums = {
82772
82804
  towgs84: '-208.4058,-109.8777,-2.5764'
82773
82805
  },
82774
82806
  ESRI_104101: {
82775
- towgs84: '374,150,588'
82807
+ towgs84: '372.87,149.23,585.29'
82776
82808
  },
82777
82809
  EPSG_4693: {
82778
82810
  towgs84: '0,-0.15,0.68'
@@ -83457,6 +83489,87 @@ var datums = {
83457
83489
  },
83458
83490
  EPSG_4818: {
83459
83491
  towgs84: '589,76,480'
83492
+ },
83493
+ EPSG_10328: {
83494
+ towgs84: '0,0,0'
83495
+ },
83496
+ EPSG_9782: {
83497
+ towgs84: '0,0,0'
83498
+ },
83499
+ EPSG_9777: {
83500
+ towgs84: '0,0,0'
83501
+ },
83502
+ EPSG_10690: {
83503
+ towgs84: '0,0,0'
83504
+ },
83505
+ EPSG_10639: {
83506
+ towgs84: '0,0,0'
83507
+ },
83508
+ EPSG_10739: {
83509
+ towgs84: '0,0,0'
83510
+ },
83511
+ EPSG_7686: {
83512
+ towgs84: '0,0,0'
83513
+ },
83514
+ EPSG_8900: {
83515
+ towgs84: '0,0,0'
83516
+ },
83517
+ EPSG_5886: {
83518
+ towgs84: '0,0,0'
83519
+ },
83520
+ EPSG_7683: {
83521
+ towgs84: '0,0,0'
83522
+ },
83523
+ EPSG_6668: {
83524
+ towgs84: '0,0,0'
83525
+ },
83526
+ EPSG_20046: {
83527
+ towgs84: '0,0,0'
83528
+ },
83529
+ EPSG_10299: {
83530
+ towgs84: '0,0,0'
83531
+ },
83532
+ EPSG_10310: {
83533
+ towgs84: '0,0,0'
83534
+ },
83535
+ EPSG_10475: {
83536
+ towgs84: '0,0,0'
83537
+ },
83538
+ EPSG_4742: {
83539
+ towgs84: '0,0,0'
83540
+ },
83541
+ EPSG_10671: {
83542
+ towgs84: '0,0,0'
83543
+ },
83544
+ EPSG_10762: {
83545
+ towgs84: '0,0,0'
83546
+ },
83547
+ EPSG_10725: {
83548
+ towgs84: '0,0,0'
83549
+ },
83550
+ EPSG_10791: {
83551
+ towgs84: '0,0,0'
83552
+ },
83553
+ EPSG_10800: {
83554
+ towgs84: '0,0,0'
83555
+ },
83556
+ EPSG_10305: {
83557
+ towgs84: '0,0,0'
83558
+ },
83559
+ EPSG_10941: {
83560
+ towgs84: '0,0,0'
83561
+ },
83562
+ EPSG_10968: {
83563
+ towgs84: '0,0,0'
83564
+ },
83565
+ EPSG_10875: {
83566
+ towgs84: '0,0,0'
83567
+ },
83568
+ EPSG_6318: {
83569
+ towgs84: '0,0,0'
83570
+ },
83571
+ EPSG_10910: {
83572
+ towgs84: '0,0,0'
83460
83573
  }
83461
83574
  };
83462
83575
 
@@ -84525,7 +84638,7 @@ function transform$1(source, dest, point, enforceAxis) {
84525
84638
  return adjust_axis(dest, true, point);
84526
84639
  }
84527
84640
 
84528
- if (point && !hasZ) {
84641
+ if (point && !hasZ && dest.projName !== 'geocent') {
84529
84642
  delete point.z;
84530
84643
  }
84531
84644
  return point;
@@ -85612,7 +85725,7 @@ function forward$2(p) {
85612
85725
  var lon = p.x;
85613
85726
  var lat = p.y;
85614
85727
 
85615
- var delta_lon = adjust_lon(lon - this.long0);
85728
+ var delta_lon = adjust_lon(lon - this.long0, this.over);
85616
85729
  var con;
85617
85730
  var x, y;
85618
85731
  var sin_phi = Math.sin(lat);
@@ -85700,7 +85813,7 @@ function inverse$2(p) {
85700
85813
  if ((g === 0) && (h === 0)) {
85701
85814
  lon = 0;
85702
85815
  } else {
85703
- lon = adjust_lon(Math.atan2(g, h) + this.long0);
85816
+ lon = adjust_lon(Math.atan2(g, h) + this.long0, this.over);
85704
85817
  }
85705
85818
  } else { // ellipsoidal form
85706
85819
  con = this.ml0 + y / this.k0;
@@ -85727,7 +85840,7 @@ function inverse$2(p) {
85727
85840
  lon = adjust_lon(this.long0 + (d * (1
85728
85841
  - ds / 6 * (1 + 2 * t + c
85729
85842
  - ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c
85730
- - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));
85843
+ - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi), this.over);
85731
85844
  } else {
85732
85845
  lat = HALF_PI * sign$1(y);
85733
85846
  lon = 0;
@@ -85937,7 +86050,7 @@ function init$3() {
85937
86050
  }
85938
86051
 
85939
86052
  function forward$3(p) {
85940
- var Ce = adjust_lon(p.x - this.long0);
86053
+ var Ce = adjust_lon(p.x - this.long0, this.over);
85941
86054
  var Cn = p.y;
85942
86055
 
85943
86056
  Cn = gatg(this.cbg, Cn);
@@ -85997,7 +86110,7 @@ function inverse$3(p) {
85997
86110
  Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));
85998
86111
  Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
85999
86112
 
86000
- lon = adjust_lon(Ce + this.long0);
86113
+ lon = adjust_lon(Ce + this.long0, this.over);
86001
86114
  lat = gatg(this.cgb, Cn);
86002
86115
  } else {
86003
86116
  lon = Infinity;
@@ -86149,7 +86262,7 @@ function init$6() {
86149
86262
 
86150
86263
  function forward$5(p) {
86151
86264
  var sinc, cosc, cosl, k;
86152
- p.x = adjust_lon(p.x - this.long0);
86265
+ p.x = adjust_lon(p.x - this.long0, this.over);
86153
86266
  gauss.forward.apply(this, [p]);
86154
86267
  sinc = Math.sin(p.y);
86155
86268
  cosc = Math.cos(p.y);
@@ -86183,7 +86296,7 @@ function inverse$5(p) {
86183
86296
  p.x = lon;
86184
86297
  p.y = lat;
86185
86298
  gauss.inverse.apply(this, [p]);
86186
- p.x = adjust_lon(p.x + this.long0);
86299
+ p.x = adjust_lon(p.x + this.long0, this.over);
86187
86300
  return p;
86188
86301
  }
86189
86302
 
@@ -86259,7 +86372,7 @@ function forward$6(p) {
86259
86372
  var sinlat = Math.sin(lat);
86260
86373
  var coslat = Math.cos(lat);
86261
86374
  var A, X, sinX, cosX, ts, rh;
86262
- var dlon = adjust_lon(lon - this.long0);
86375
+ var dlon = adjust_lon(lon - this.long0, this.over);
86263
86376
 
86264
86377
  if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
86265
86378
  // case of the origine point
@@ -86320,12 +86433,12 @@ function inverse$6(p) {
86320
86433
  lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
86321
86434
  if (Math.abs(this.coslat0) < EPSLN) {
86322
86435
  if (this.lat0 > 0) {
86323
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
86436
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y), this.over);
86324
86437
  } else {
86325
- lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
86438
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y), this.over);
86326
86439
  }
86327
86440
  } else {
86328
- lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));
86441
+ lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)), this.over);
86329
86442
  }
86330
86443
  p.x = lon;
86331
86444
  p.y = lat;
@@ -86344,7 +86457,7 @@ function inverse$6(p) {
86344
86457
  p.y *= this.con;
86345
86458
  ts = rh * this.cons / (2 * this.a * this.k0);
86346
86459
  lat = this.con * phi2z(this.e, ts);
86347
- lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
86460
+ lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y), this.over);
86348
86461
  } else {
86349
86462
  ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
86350
86463
  lon = this.long0;
@@ -86352,7 +86465,7 @@ function inverse$6(p) {
86352
86465
  Chi = this.X0;
86353
86466
  } else {
86354
86467
  Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
86355
- lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));
86468
+ lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)), this.over);
86356
86469
  }
86357
86470
  lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
86358
86471
  }
@@ -86604,8 +86717,8 @@ function init$9() {
86604
86717
  lam2 += TWO_PI;
86605
86718
  }
86606
86719
 
86607
- this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B);
86608
- gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F));
86720
+ this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B, this.over);
86721
+ gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0, this.over)) / (F - 1 / F));
86609
86722
  gamma = alpha_c = Math.asin(D * Math.sin(gamma0));
86610
86723
  }
86611
86724
 
@@ -86819,7 +86932,7 @@ function forward$9(p) {
86819
86932
  }
86820
86933
  rh1 = 0;
86821
86934
  }
86822
- var theta = this.ns * adjust_lon(lon - this.long0);
86935
+ var theta = this.ns * adjust_lon(lon - this.long0, this.over);
86823
86936
  p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
86824
86937
  p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
86825
86938
 
@@ -86854,7 +86967,7 @@ function inverse$9(p) {
86854
86967
  } else {
86855
86968
  lat = -HALF_PI;
86856
86969
  }
86857
- lon = adjust_lon(theta / this.ns + this.long0);
86970
+ lon = adjust_lon(theta / this.ns + this.long0, this.over);
86858
86971
 
86859
86972
  p.x = lon;
86860
86973
  p.y = lat;
@@ -86886,7 +86999,7 @@ function init$b() {
86886
86999
  this.lat0 = 0.863937979737193;
86887
87000
  }
86888
87001
  if (!this.long0) {
86889
- this.long0 = 0.7417649320975901 - 0.308341501185665;
87002
+ this.long0 = 0.7417649320975901 - 0.308341501185665; // 42.5° from Ferro = 24.833° from Greenwich
86890
87003
  }
86891
87004
  /* if scale not set default to 0.9999 */
86892
87005
  if (!this.k0) {
@@ -86917,7 +87030,7 @@ function forward$a(p) {
86917
87030
  var gfi, u, deltav, s, d, eps, ro;
86918
87031
  var lon = p.x;
86919
87032
  var lat = p.y;
86920
- var delta_lon = adjust_lon(lon - this.long0);
87033
+ var delta_lon = adjust_lon(lon - this.long0, this.over);
86921
87034
  /* Transformation */
86922
87035
  gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));
86923
87036
  u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
@@ -86975,7 +87088,7 @@ function inverse$a(p) {
86975
87088
  return (p);
86976
87089
  }
86977
87090
 
86978
- var names$c = ['Krovak', 'krovak'];
87091
+ var names$c = ['Krovak', 'Krovak Modified', 'Krovak (North Orientated)', 'Krovak Modified (North Orientated)', 'krovak'];
86979
87092
  var krovak = {
86980
87093
  init: init$b,
86981
87094
  forward: forward$a,
@@ -87058,7 +87171,7 @@ function forward$b(p) {
87058
87171
  var x, y;
87059
87172
  var lam = p.x;
87060
87173
  var phi = p.y;
87061
- lam = adjust_lon(lam - this.long0);
87174
+ lam = adjust_lon(lam - this.long0, this.over);
87062
87175
 
87063
87176
  if (this.sphere) {
87064
87177
  x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
@@ -87118,7 +87231,7 @@ function inverse$b(p) {
87118
87231
  lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
87119
87232
  }
87120
87233
 
87121
- p.x = adjust_lon(lam + this.long0);
87234
+ p.x = adjust_lon(lam + this.long0, this.over);
87122
87235
  p.y = adjust_lat(phi);
87123
87236
  return p;
87124
87237
  }
@@ -87229,7 +87342,7 @@ function forward$c(p) {
87229
87342
  var lam = p.x;
87230
87343
  var phi = p.y;
87231
87344
 
87232
- lam = adjust_lon(lam - this.long0);
87345
+ lam = adjust_lon(lam - this.long0, this.over);
87233
87346
  if (this.sphere) {
87234
87347
  sinphi = Math.sin(phi);
87235
87348
  cosphi = Math.cos(phi);
@@ -87397,7 +87510,7 @@ function inverse$c(p) {
87397
87510
  phi = authlat(Math.asin(ab), this.apa);
87398
87511
  }
87399
87512
 
87400
- p.x = adjust_lon(this.long0 + lam);
87513
+ p.x = adjust_lon(this.long0 + lam, this.over);
87401
87514
  p.y = phi;
87402
87515
  return p;
87403
87516
  }
@@ -87520,7 +87633,7 @@ function forward$d(p) {
87520
87633
 
87521
87634
  var qs = qsfnz(this.e3, this.sin_phi);
87522
87635
  var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
87523
- var theta = this.ns0 * adjust_lon(lon - this.long0);
87636
+ var theta = this.ns0 * adjust_lon(lon - this.long0, this.over);
87524
87637
  var x = rh1 * Math.sin(theta) + this.x0;
87525
87638
  var y = this.rh - rh1 * Math.cos(theta) + this.y0;
87526
87639
 
@@ -87553,7 +87666,7 @@ function inverse$d(p) {
87553
87666
  lat = this.phi1z(this.e3, qs);
87554
87667
  }
87555
87668
 
87556
- lon = adjust_lon(theta / this.ns0 + this.long0);
87669
+ lon = adjust_lon(theta / this.ns0 + this.long0, this.over);
87557
87670
  p.x = lon;
87558
87671
  p.y = lat;
87559
87672
  return p;
@@ -87631,7 +87744,7 @@ function forward$e(p) {
87631
87744
  var lat = p.y;
87632
87745
  /* Forward equations
87633
87746
  ----------------- */
87634
- dlon = adjust_lon(lon - this.long0);
87747
+ dlon = adjust_lon(lon - this.long0, this.over);
87635
87748
 
87636
87749
  sinphi = Math.sin(lat);
87637
87750
  cosphi = Math.cos(lat);
@@ -87679,7 +87792,7 @@ function inverse$e(p) {
87679
87792
 
87680
87793
  lat = asinz(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);
87681
87794
  lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
87682
- lon = adjust_lon(this.long0 + lon);
87795
+ lon = adjust_lon(this.long0 + lon, this.over);
87683
87796
  } else {
87684
87797
  lat = this.phic0;
87685
87798
  lon = 0;
@@ -87755,7 +87868,7 @@ function forward$f(p) {
87755
87868
  var x, y;
87756
87869
  /* Forward equations
87757
87870
  ----------------- */
87758
- var dlon = adjust_lon(lon - this.long0);
87871
+ var dlon = adjust_lon(lon - this.long0, this.over);
87759
87872
  if (this.sphere) {
87760
87873
  x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
87761
87874
  y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
@@ -87778,11 +87891,11 @@ function inverse$f(p) {
87778
87891
  var lon, lat;
87779
87892
 
87780
87893
  if (this.sphere) {
87781
- lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));
87894
+ lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts), this.over);
87782
87895
  lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));
87783
87896
  } else {
87784
87897
  lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);
87785
- lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));
87898
+ lon = adjust_lon(this.long0 + p.x / (this.a * this.k0), this.over);
87786
87899
  }
87787
87900
 
87788
87901
  p.x = lon;
@@ -87815,7 +87928,7 @@ function forward$g(p) {
87815
87928
  var lon = p.x;
87816
87929
  var lat = p.y;
87817
87930
 
87818
- var dlon = adjust_lon(lon - this.long0);
87931
+ var dlon = adjust_lon(lon - this.long0, this.over);
87819
87932
  var dlat = adjust_lat(lat - this.lat0);
87820
87933
  p.x = this.x0 + (this.a * dlon * this.rc);
87821
87934
  p.y = this.y0 + (this.a * dlat);
@@ -87828,7 +87941,7 @@ function inverse$g(p) {
87828
87941
  var x = p.x;
87829
87942
  var y = p.y;
87830
87943
 
87831
- p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)));
87944
+ p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)), this.over);
87832
87945
  p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a)));
87833
87946
  return p;
87834
87947
  }
@@ -87875,7 +87988,7 @@ function forward$h(p) {
87875
87988
  var lon = p.x;
87876
87989
  var lat = p.y;
87877
87990
  var x, y, el;
87878
- var dlon = adjust_lon(lon - this.long0);
87991
+ var dlon = adjust_lon(lon - this.long0, this.over);
87879
87992
  el = dlon * Math.sin(lat);
87880
87993
  if (this.sphere) {
87881
87994
  if (Math.abs(lat) <= EPSLN) {
@@ -87911,7 +88024,7 @@ function inverse$h(p) {
87911
88024
 
87912
88025
  if (this.sphere) {
87913
88026
  if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
87914
- lon = adjust_lon(x / this.a + this.long0);
88027
+ lon = adjust_lon(x / this.a + this.long0, this.over);
87915
88028
  lat = 0;
87916
88029
  } else {
87917
88030
  al = this.lat0 + y / this.a;
@@ -87927,12 +88040,12 @@ function inverse$h(p) {
87927
88040
  break;
87928
88041
  }
87929
88042
  }
87930
- lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));
88043
+ lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat), this.over);
87931
88044
  }
87932
88045
  } else {
87933
88046
  if (Math.abs(y + this.ml0) <= EPSLN) {
87934
88047
  lat = 0;
87935
- lon = adjust_lon(this.long0 + x / this.a);
88048
+ lon = adjust_lon(this.long0 + x / this.a, this.over);
87936
88049
  } else {
87937
88050
  al = (this.ml0 + y) / this.a;
87938
88051
  bl = x * x / this.a / this.a + al * al;
@@ -87955,7 +88068,7 @@ function inverse$h(p) {
87955
88068
 
87956
88069
  // lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);
87957
88070
  cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
87958
- lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
88071
+ lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat), this.over);
87959
88072
  }
87960
88073
  }
87961
88074
 
@@ -88200,7 +88313,7 @@ function forward$j(p) {
88200
88313
  var lat = p.y;
88201
88314
  /* Forward equations
88202
88315
  ----------------- */
88203
- var dlon = adjust_lon(lon - this.long0);
88316
+ var dlon = adjust_lon(lon - this.long0, this.over);
88204
88317
  var x = this.x0 + this.a * dlon;
88205
88318
  var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;
88206
88319
 
@@ -88215,7 +88328,7 @@ function inverse$j(p) {
88215
88328
  p.x -= this.x0;
88216
88329
  p.y -= this.y0;
88217
88330
 
88218
- var lon = adjust_lon(this.long0 + p.x / this.a);
88331
+ var lon = adjust_lon(this.long0 + p.x / this.a, this.over);
88219
88332
  var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
88220
88333
 
88221
88334
  p.x = lon;
@@ -88247,6 +88360,7 @@ var MAX_ITER$3 = 20;
88247
88360
  function init$l() {
88248
88361
  /* Place parameters in static storage for common use
88249
88362
  ------------------------------------------------- */
88363
+ this.long0 = this.long0 || 0;
88250
88364
 
88251
88365
  if (!this.sphere) {
88252
88366
  this.en = pj_enfn(this.es);
@@ -88267,7 +88381,7 @@ function forward$k(p) {
88267
88381
  var lat = p.y;
88268
88382
  /* Forward equations
88269
88383
  ----------------- */
88270
- lon = adjust_lon(lon - this.long0);
88384
+ lon = adjust_lon(lon - this.long0, this.over);
88271
88385
 
88272
88386
  if (this.sphere) {
88273
88387
  if (!this.m) {
@@ -88312,7 +88426,7 @@ function inverse$k(p) {
88312
88426
  } else if (this.n !== 1) {
88313
88427
  lat = asinz(Math.sin(lat) / this.n);
88314
88428
  }
88315
- lon = adjust_lon(lon + this.long0);
88429
+ lon = adjust_lon(lon + this.long0, this.over);
88316
88430
  lat = adjust_lat(lat);
88317
88431
  } else {
88318
88432
  lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);
@@ -88321,7 +88435,7 @@ function inverse$k(p) {
88321
88435
  s = Math.sin(lat);
88322
88436
  temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));
88323
88437
  // temp = this.long0 + p.x / (this.a * Math.cos(lat));
88324
- lon = adjust_lon(temp);
88438
+ lon = adjust_lon(temp, this.over);
88325
88439
  } else if ((s - EPSLN) < HALF_PI) {
88326
88440
  lon = this.long0;
88327
88441
  }
@@ -88339,7 +88453,13 @@ var sinu = {
88339
88453
  names: names$m
88340
88454
  };
88341
88455
 
88342
- function init$m() {}
88456
+ /** @this {import('../defs.js').ProjectionDefinition} */
88457
+ function init$m() {
88458
+ this.x0 = this.x0 !== undefined ? this.x0 : 0;
88459
+ this.y0 = this.y0 !== undefined ? this.y0 : 0;
88460
+ this.long0 = this.long0 !== undefined ? this.long0 : 0;
88461
+ }
88462
+
88343
88463
  /* Mollweide forward equations--mapping lat,long to x,y
88344
88464
  ---------------------------------------------------- */
88345
88465
  function forward$l(p) {
@@ -88348,7 +88468,7 @@ function forward$l(p) {
88348
88468
  var lon = p.x;
88349
88469
  var lat = p.y;
88350
88470
 
88351
- var delta_lon = adjust_lon(lon - this.long0);
88471
+ var delta_lon = adjust_lon(lon - this.long0, this.over);
88352
88472
  var theta = lat;
88353
88473
  var con = Math.PI * Math.sin(lat);
88354
88474
 
@@ -88394,7 +88514,7 @@ function inverse$l(p) {
88394
88514
  arg = 0.999999999999;
88395
88515
  }
88396
88516
  theta = Math.asin(arg);
88397
- var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));
88517
+ var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))), this.over);
88398
88518
  if (lon < (-Math.PI)) {
88399
88519
  lon = -Math.PI;
88400
88520
  }
@@ -88493,7 +88613,7 @@ function forward$m(p) {
88493
88613
  var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);
88494
88614
  rh1 = this.a * (this.g - ml);
88495
88615
  }
88496
- var theta = this.ns * adjust_lon(lon - this.long0);
88616
+ var theta = this.ns * adjust_lon(lon - this.long0, this.over);
88497
88617
  var x = this.x0 + rh1 * Math.sin(theta);
88498
88618
  var y = this.y0 + this.rh - rh1 * Math.cos(theta);
88499
88619
  p.x = x;
@@ -88520,7 +88640,7 @@ function inverse$m(p) {
88520
88640
  }
88521
88641
 
88522
88642
  if (this.sphere) {
88523
- lon = adjust_lon(this.long0 + theta / this.ns);
88643
+ lon = adjust_lon(this.long0 + theta / this.ns, this.over);
88524
88644
  lat = adjust_lat(this.g - rh1 / this.a);
88525
88645
  p.x = lon;
88526
88646
  p.y = lat;
@@ -88528,7 +88648,7 @@ function inverse$m(p) {
88528
88648
  } else {
88529
88649
  var ml = this.g - rh1 / this.a;
88530
88650
  lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);
88531
- lon = adjust_lon(this.long0 + theta / this.ns);
88651
+ lon = adjust_lon(this.long0 + theta / this.ns, this.over);
88532
88652
  p.x = lon;
88533
88653
  p.y = lat;
88534
88654
  return p;
@@ -88563,7 +88683,7 @@ function forward$n(p) {
88563
88683
 
88564
88684
  /* Forward equations
88565
88685
  ----------------- */
88566
- var dlon = adjust_lon(lon - this.long0);
88686
+ var dlon = adjust_lon(lon - this.long0, this.over);
88567
88687
  var x, y;
88568
88688
 
88569
88689
  if (Math.abs(lat) <= EPSLN) {
@@ -88652,7 +88772,7 @@ function inverse$n(p) {
88652
88772
  if (Math.abs(xx) < EPSLN) {
88653
88773
  lon = this.long0;
88654
88774
  } else {
88655
- lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
88775
+ lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx, this.over);
88656
88776
  }
88657
88777
 
88658
88778
  p.x = lon;
@@ -88814,7 +88934,7 @@ function forward$o(p) {
88814
88934
  var lat = p.y;
88815
88935
  var sinphi = Math.sin(p.y);
88816
88936
  var cosphi = Math.cos(p.y);
88817
- var dlon = adjust_lon(lon - this.long0);
88937
+ var dlon = adjust_lon(lon - this.long0, this.over);
88818
88938
  var e0, e1, e2, e3, Mlp, Ml, c, kp, cos_c, vars, azi1;
88819
88939
  if (this.sphere) {
88820
88940
  if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
@@ -88892,12 +89012,12 @@ function inverse$o(p) {
88892
89012
  con = Math.abs(this.lat0) - HALF_PI;
88893
89013
  if (Math.abs(con) <= EPSLN) {
88894
89014
  if (this.lat0 >= 0) {
88895
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
89015
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y), this.over);
88896
89016
  } else {
88897
- lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
89017
+ lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y), this.over);
88898
89018
  }
88899
89019
  } else {
88900
- lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
89020
+ lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz), this.over);
88901
89021
  }
88902
89022
  }
88903
89023
 
@@ -88915,7 +89035,7 @@ function inverse$o(p) {
88915
89035
  rh = Math.sqrt(p.x * p.x + p.y * p.y);
88916
89036
  M = Mlp - rh;
88917
89037
  lat = imlfn(M / this.a, e0, e1, e2, e3);
88918
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
89038
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y), this.over);
88919
89039
  p.x = lon;
88920
89040
  p.y = lat;
88921
89041
  return p;
@@ -88926,7 +89046,7 @@ function inverse$o(p) {
88926
89046
  M = rh - Mlp;
88927
89047
 
88928
89048
  lat = imlfn(M / this.a, e0, e1, e2, e3);
88929
- lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
89049
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y), this.over);
88930
89050
  p.x = lon;
88931
89051
  p.y = lat;
88932
89052
  return p;
@@ -88963,8 +89083,8 @@ function init$q() {
88963
89083
 
88964
89084
  /* Place parameters in static storage for common use
88965
89085
  ------------------------------------------------- */
88966
- this.sin_p14 = Math.sin(this.lat0);
88967
- this.cos_p14 = Math.cos(this.lat0);
89086
+ this.sin_p14 = Math.sin(this.lat0 || 0);
89087
+ this.cos_p14 = Math.cos(this.lat0 || 0);
88968
89088
  }
88969
89089
 
88970
89090
  /* Orthographic forward equations--mapping lat,long to x,y
@@ -88979,7 +89099,7 @@ function forward$p(p) {
88979
89099
  var lat = p.y;
88980
89100
  /* Forward equations
88981
89101
  ----------------- */
88982
- dlon = adjust_lon(lon - this.long0);
89102
+ dlon = adjust_lon(lon - (this.long0 || 0), this.over);
88983
89103
 
88984
89104
  sinphi = Math.sin(lat);
88985
89105
  cosphi = Math.cos(lat);
@@ -88989,7 +89109,7 @@ function forward$p(p) {
88989
89109
  ksp = 1;
88990
89110
  if ((g > 0) || (Math.abs(g) <= EPSLN)) {
88991
89111
  x = this.a * ksp * cosphi * Math.sin(dlon);
88992
- y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
89112
+ y = (this.y0 || 0) + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
88993
89113
  }
88994
89114
  p.x = x;
88995
89115
  p.y = y;
@@ -89002,36 +89122,39 @@ function inverse$p(p) {
89002
89122
  var sinz, cosz; /* sin of z and cos of z */
89003
89123
  var con;
89004
89124
  var lon, lat;
89125
+ var long0, lat0;
89005
89126
  /* Inverse equations
89006
89127
  ----------------- */
89007
- p.x -= this.x0;
89008
- p.y -= this.y0;
89128
+ p.x -= this.x0 || 0;
89129
+ p.y -= this.y0 || 0;
89009
89130
  rh = Math.sqrt(p.x * p.x + p.y * p.y);
89010
89131
  z = asinz(rh / this.a);
89011
89132
 
89012
89133
  sinz = Math.sin(z);
89013
89134
  cosz = Math.cos(z);
89014
89135
 
89015
- lon = this.long0;
89136
+ long0 = this.long0 || 0;
89137
+ lat0 = this.lat0 || 0;
89138
+ lon = long0;
89016
89139
  if (Math.abs(rh) <= EPSLN) {
89017
- lat = this.lat0;
89140
+ lat = lat0;
89018
89141
  p.x = lon;
89019
89142
  p.y = lat;
89020
89143
  return p;
89021
89144
  }
89022
89145
  lat = asinz(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);
89023
- con = Math.abs(this.lat0) - HALF_PI;
89146
+ con = Math.abs(lat0) - HALF_PI;
89024
89147
  if (Math.abs(con) <= EPSLN) {
89025
- if (this.lat0 >= 0) {
89026
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
89148
+ if (lat0 >= 0) {
89149
+ lon = adjust_lon(long0 + Math.atan2(p.x, -p.y), this.over);
89027
89150
  } else {
89028
- lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
89151
+ lon = adjust_lon(long0 - Math.atan2(-p.x, p.y), this.over);
89029
89152
  }
89030
89153
  p.x = lon;
89031
89154
  p.y = lat;
89032
89155
  return p;
89033
89156
  }
89034
- lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
89157
+ lon = adjust_lon(long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz), this.over);
89035
89158
  p.x = lon;
89036
89159
  p.y = lat;
89037
89160
  return p;
@@ -89501,7 +89624,7 @@ function init$s() {
89501
89624
  }
89502
89625
 
89503
89626
  function forward$r(ll) {
89504
- var lon = adjust_lon(ll.x - this.long0);
89627
+ var lon = adjust_lon(ll.x - this.long0, this.over);
89505
89628
 
89506
89629
  var dphi = Math.abs(ll.y);
89507
89630
  var i = Math.floor(dphi * C1);
@@ -89565,7 +89688,7 @@ function inverse$r(xy) {
89565
89688
  }
89566
89689
  }
89567
89690
 
89568
- ll.x = adjust_lon(ll.x + this.long0);
89691
+ ll.x = adjust_lon(ll.x + this.long0, this.over);
89569
89692
  return ll;
89570
89693
  }
89571
89694
 
@@ -89997,10 +90120,12 @@ var A1 = 1.340264,
89997
90120
  function init$w() {
89998
90121
  this.es = 0;
89999
90122
  this.long0 = this.long0 !== undefined ? this.long0 : 0;
90123
+ this.x0 = this.x0 !== undefined ? this.x0 : 0;
90124
+ this.y0 = this.y0 !== undefined ? this.y0 : 0;
90000
90125
  }
90001
90126
 
90002
90127
  function forward$v(p) {
90003
- var lam = adjust_lon(p.x - this.long0);
90128
+ var lam = adjust_lon(p.x - this.long0, this.over);
90004
90129
  var phi = p.y;
90005
90130
  var paramLat = Math.asin(M * Math.sin(phi)),
90006
90131
  paramLatSq = paramLat * paramLat,
@@ -90039,7 +90164,7 @@ function inverse$v(p) {
90039
90164
  / Math.cos(paramLat);
90040
90165
  p.y = Math.asin(Math.sin(paramLat) / M);
90041
90166
 
90042
- p.x = adjust_lon(p.x + this.long0);
90167
+ p.x = adjust_lon(p.x + this.long0, this.over);
90043
90168
  return p;
90044
90169
  }
90045
90170
 
@@ -90090,7 +90215,7 @@ function init$x() {
90090
90215
  }
90091
90216
 
90092
90217
  function e_fwd(p) {
90093
- var lam = adjust_lon(p.x - (this.long0 || 0));
90218
+ var lam = adjust_lon(p.x - (this.long0 || 0), this.over);
90094
90219
  var phi = p.y;
90095
90220
  var rh, E, c;
90096
90221
  rh = this.am1 + this.m1 - pj_mlfn(phi, E = Math.sin(phi), c = Math.cos(phi), this.en);
@@ -90118,13 +90243,13 @@ function e_inv(p) {
90118
90243
  } else {
90119
90244
  throw new Error();
90120
90245
  }
90121
- p.x = adjust_lon(lam + (this.long0 || 0));
90246
+ p.x = adjust_lon(lam + (this.long0 || 0), this.over);
90122
90247
  p.y = adjust_lat(phi);
90123
90248
  return p;
90124
90249
  }
90125
90250
 
90126
90251
  function s_fwd(p) {
90127
- var lam = adjust_lon(p.x - (this.long0 || 0));
90252
+ var lam = adjust_lon(p.x - (this.long0 || 0), this.over);
90128
90253
  var phi = p.y;
90129
90254
  var E, rh;
90130
90255
  rh = this.cphi1 + this.phi1 - phi;
@@ -90155,7 +90280,7 @@ function s_inv(p) {
90155
90280
  } else {
90156
90281
  lam = rh * Math.atan2(p.x, p.y) / Math.cos(phi);
90157
90282
  }
90158
- p.x = adjust_lon(lam + (this.long0 || 0));
90283
+ p.x = adjust_lon(lam + (this.long0 || 0), this.over);
90159
90284
  p.y = adjust_lat(phi);
90160
90285
  return p;
90161
90286
  }
@@ -90166,6 +90291,373 @@ var bonne = {
90166
90291
  names: names$y
90167
90292
  };
90168
90293
 
90294
+ /**
90295
+ Original projection implementation:
90296
+ https://github.com/OSGeo/PROJ/blob/46c47e9adf6376ae06afabe5d24a0016a05ced82/src/projections/ob_tran.cpp
90297
+
90298
+ Documentation:
90299
+ https://proj.org/operations/projections/ob_tran.html
90300
+
90301
+ References/Formulas:
90302
+ https://pubs.usgs.gov/pp/1395/report.pdf
90303
+
90304
+ Examples:
90305
+ +proj=ob_tran +o_proj=moll +o_lat_p=45 +o_lon_p=-90
90306
+ +proj=ob_tran +o_proj=moll +o_lat_p=45 +o_lon_p=-90 +lon_0=60
90307
+ +proj=ob_tran +o_proj=moll +o_lat_p=45 +o_lon_p=-90 +lon_0=-90
90308
+ */
90309
+
90310
+ const projectionType = {
90311
+ OBLIQUE: {
90312
+ forward: forwardOblique,
90313
+ inverse: inverseOblique
90314
+ },
90315
+ TRANSVERSE: {
90316
+ forward: forwardTransverse,
90317
+ inverse: inverseTransverse
90318
+ }
90319
+ };
90320
+
90321
+ /**
90322
+ * @typedef {Object} LocalThis
90323
+ * @property {number} lamp
90324
+ * @property {number} cphip
90325
+ * @property {number} sphip
90326
+ * @property {Object} projectionType
90327
+ * @property {string | undefined} o_proj
90328
+ * @property {string | undefined} o_lon_p
90329
+ * @property {string | undefined} o_lat_p
90330
+ * @property {string | undefined} o_alpha
90331
+ * @property {string | undefined} o_lon_c
90332
+ * @property {string | undefined} o_lat_c
90333
+ * @property {string | undefined} o_lon_1
90334
+ * @property {string | undefined} o_lat_1
90335
+ * @property {string | undefined} o_lon_2
90336
+ * @property {string | undefined} o_lat_2
90337
+ * @property {number | undefined} oLongP
90338
+ * @property {number | undefined} oLatP
90339
+ * @property {number | undefined} oAlpha
90340
+ * @property {number | undefined} oLongC
90341
+ * @property {number | undefined} oLatC
90342
+ * @property {number | undefined} oLong1
90343
+ * @property {number | undefined} oLat1
90344
+ * @property {number | undefined} oLong2
90345
+ * @property {number | undefined} oLat2
90346
+ * @property {boolean} isIdentity
90347
+ * @property {import('..').Converter} obliqueProjection
90348
+ *
90349
+ */
90350
+
90351
+ /**
90352
+ * Parameters can be from the following sets:
90353
+ * New pole --> o_lat_p, o_lon_p
90354
+ * Rotate about point --> o_alpha, o_lon_c, o_lat_c
90355
+ * New equator points --> lon_1, lat_1, lon_2, lat_2
90356
+ *
90357
+ * Per the original source code, the parameter sets are
90358
+ * checked in the order of the object below.
90359
+ */
90360
+ const paramSets = {
90361
+ ROTATE: {
90362
+ o_alpha: 'oAlpha',
90363
+ o_lon_c: 'oLongC',
90364
+ o_lat_c: 'oLatC'
90365
+ },
90366
+ NEW_POLE: {
90367
+ o_lat_p: 'oLatP',
90368
+ o_lon_p: 'oLongP'
90369
+ },
90370
+ NEW_EQUATOR: {
90371
+ o_lon_1: 'oLong1',
90372
+ o_lat_1: 'oLat1',
90373
+ o_lon_2: 'oLong2',
90374
+ o_lat_2: 'oLat2'
90375
+ }
90376
+ };
90377
+
90378
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
90379
+ function init$y() {
90380
+ this.x0 = this.x0 || 0;
90381
+ this.y0 = this.y0 || 0;
90382
+ this.long0 = this.long0 || 0;
90383
+ this.title = this.title || 'General Oblique Transformation';
90384
+ this.isIdentity = names$1.includes(this.o_proj);
90385
+
90386
+ /** Verify required parameters exist */
90387
+ if (!this.o_proj) {
90388
+ throw new Error('Missing parameter: o_proj');
90389
+ }
90390
+
90391
+ if (this.o_proj === `ob_tran`) {
90392
+ throw new Error('Invalid value for o_proj: ' + this.o_proj);
90393
+ }
90394
+
90395
+ const newProjStr = this.projStr.replace('+proj=ob_tran', '').replace('+o_proj=', '+proj=').trim();
90396
+
90397
+ /** @type {import('../defs.js').ProjectionDefinition} */
90398
+ const oProj = Projection$1(newProjStr);
90399
+ if (!oProj) {
90400
+ throw new Error('Invalid parameter: o_proj. Unknown projection ' + this.o_proj);
90401
+ }
90402
+ oProj.long0 = 0; // we handle long0 before/after forward/inverse
90403
+ this.obliqueProjection = oProj;
90404
+
90405
+ let matchedSet;
90406
+ const paramSetsKeys = Object.keys(paramSets);
90407
+
90408
+ /**
90409
+ * parse strings, convert to radians, throw on NaN
90410
+ * @param {string} name
90411
+ * @returns {number | undefined}
90412
+ */
90413
+ const parseParam = (name) => {
90414
+ if (typeof this[name] === `undefined`) {
90415
+ return undefined;
90416
+ }
90417
+ const val = parseFloat(this[name]) * D2R;
90418
+ if (isNaN(val)) {
90419
+ throw new Error('Invalid value for ' + name + ': ' + this[name]);
90420
+ }
90421
+ return val;
90422
+ };
90423
+
90424
+ for (let i = 0; i < paramSetsKeys.length; i++) {
90425
+ const setKey = paramSetsKeys[i];
90426
+ const set = paramSets[setKey];
90427
+ const params = Object.entries(set);
90428
+ const setHasParams = params.some(
90429
+ ([p]) => typeof this[p] !== 'undefined'
90430
+ );
90431
+ if (!setHasParams) {
90432
+ continue;
90433
+ }
90434
+ matchedSet = set;
90435
+ for (let ii = 0; ii < params.length; ii++) {
90436
+ const [inputParam, param] = params[ii];
90437
+ const val = parseParam(inputParam);
90438
+ if (typeof val === 'undefined') {
90439
+ throw new Error('Missing parameter: ' + inputParam + '.');
90440
+ }
90441
+ this[param] = val;
90442
+ }
90443
+ break;
90444
+ }
90445
+
90446
+ if (!matchedSet) {
90447
+ throw new Error('No valid parameters provided for ob_tran projection.');
90448
+ }
90449
+
90450
+ const { lamp, phip } = createRotation(this, matchedSet);
90451
+ this.lamp = lamp;
90452
+
90453
+ if (Math.abs(phip) > EPSLN) {
90454
+ this.cphip = Math.cos(phip);
90455
+ this.sphip = Math.sin(phip);
90456
+ this.projectionType = projectionType.OBLIQUE;
90457
+ } else {
90458
+ this.projectionType = projectionType.TRANSVERSE;
90459
+ }
90460
+ }
90461
+
90462
+ // ob_tran forward equations--mapping (lat,long) to (x,y)
90463
+ // transverse (90 degrees from normal orientation) - forwardTransverse
90464
+ // or oblique (arbitrary angle) used based on parameters - forwardOblique
90465
+ // -----------------------------------------------------------------
90466
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
90467
+ function forward$w(p) {
90468
+ return this.projectionType.forward(this, p);
90469
+ }
90470
+
90471
+ // inverse equations--mapping (x,y) to (lat,long)
90472
+ // transverse: inverseTransverse
90473
+ // oblique: inverseOblique
90474
+ // -----------------------------------------------------------------
90475
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
90476
+ function inverse$w(p) {
90477
+ return this.projectionType.inverse(this, p);
90478
+ }
90479
+
90480
+ /**
90481
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} params - Initialized projection definition
90482
+ * @param {Object} how - Transformation method
90483
+ * @returns {{phip: number, lamp: number}}
90484
+ */
90485
+ function createRotation(params, how) {
90486
+ let phip, lamp;
90487
+ if (how === paramSets.ROTATE) {
90488
+ let lamc = params.oLongC;
90489
+ let phic = params.oLatC;
90490
+ let alpha = params.oAlpha;
90491
+ if (Math.abs(Math.abs(phic) - HALF_PI) <= EPSLN) {
90492
+ throw new Error('Invalid value for o_lat_c: ' + params.o_lat_c + ' should be < 90°');
90493
+ }
90494
+ lamp = lamc + Math.atan2(-1 * Math.cos(alpha), -1 * Math.sin(alpha) * Math.sin(phic));
90495
+ phip = Math.asin(Math.cos(phic) * Math.sin(alpha));
90496
+ } else if (how === paramSets.NEW_POLE) {
90497
+ lamp = params.oLongP;
90498
+ phip = params.oLatP;
90499
+ } else {
90500
+ let lam1 = params.oLong1;
90501
+ let phi1 = params.oLat1;
90502
+ let lam2 = params.oLong2;
90503
+ let phi2 = params.oLat2;
90504
+ let con = Math.abs(phi1);
90505
+
90506
+ if (Math.abs(phi1) > HALF_PI - EPSLN) {
90507
+ throw new Error('Invalid value for o_lat_1: ' + params.o_lat_1 + ' should be < 90°');
90508
+ }
90509
+
90510
+ if (Math.abs(phi2) > HALF_PI - EPSLN) {
90511
+ throw new Error('Invalid value for o_lat_2: ' + params.o_lat_2 + ' should be < 90°');
90512
+ }
90513
+
90514
+ if (Math.abs(phi1 - phi2) < EPSLN) {
90515
+ throw new Error('Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2');
90516
+ }
90517
+ if (con < EPSLN) {
90518
+ throw new Error('Invalid value for o_lat_1: o_lat_1 should be different from zero');
90519
+ }
90520
+
90521
+ lamp = Math.atan2(
90522
+ (Math.cos(phi1) * Math.sin(phi2) * Math.cos(lam1))
90523
+ - (Math.sin(phi1) * Math.cos(phi2) * Math.cos(lam2)),
90524
+ (Math.sin(phi1) * Math.cos(phi2) * Math.sin(lam2))
90525
+ - (Math.cos(phi1) * Math.sin(phi2) * Math.sin(lam1))
90526
+ );
90527
+
90528
+ phip = Math.atan(-1 * Math.cos(lamp - lam1) / Math.tan(phi1));
90529
+ }
90530
+
90531
+ return { lamp, phip };
90532
+ }
90533
+
90534
+ /**
90535
+ * Forward (lng, lat) to (x, y) for oblique case
90536
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
90537
+ * @param {{x: number, y: number}} lp - lambda, phi
90538
+ */
90539
+ function forwardOblique(self, lp) {
90540
+ let { x: lam, y: phi } = lp;
90541
+ lam += self.long0;
90542
+ const coslam = Math.cos(lam);
90543
+ const sinphi = Math.sin(phi);
90544
+ const cosphi = Math.cos(phi);
90545
+
90546
+ lp.x = adjust_lon(
90547
+ Math.atan2(
90548
+ cosphi * Math.sin(lam),
90549
+ (self.sphip * cosphi * coslam) + (self.cphip * sinphi)
90550
+ ) + self.lamp
90551
+ );
90552
+ lp.y = Math.asin(
90553
+ (self.sphip * sinphi) - (self.cphip * cosphi * coslam)
90554
+ );
90555
+
90556
+ const result = self.obliqueProjection.forward(lp);
90557
+ if (self.isIdentity) {
90558
+ result.x *= R2D;
90559
+ result.y *= R2D;
90560
+ }
90561
+ return result;
90562
+ }
90563
+
90564
+ /**
90565
+ * Forward (lng, lat) to (x, y) for transverse case
90566
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
90567
+ * @param {{x: number, y: number}} lp - lambda, phi
90568
+ */
90569
+ function forwardTransverse(self, lp) {
90570
+ let { x: lam, y: phi } = lp;
90571
+ lam += self.long0;
90572
+ const cosphi = Math.cos(phi);
90573
+ const coslam = Math.cos(lam);
90574
+ lp.x = adjust_lon(
90575
+ Math.atan2(
90576
+ cosphi * Math.sin(lam),
90577
+ Math.sin(phi)
90578
+ ) + self.lamp
90579
+ );
90580
+ lp.y = Math.asin(-1 * cosphi * coslam);
90581
+
90582
+ const result = self.obliqueProjection.forward(lp);
90583
+
90584
+ if (self.isIdentity) {
90585
+ result.x *= R2D;
90586
+ result.y *= R2D;
90587
+ }
90588
+ return result;
90589
+ }
90590
+
90591
+ /**
90592
+ * Inverse (x, y) to (lng, lat) for oblique case
90593
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
90594
+ * @param {{x: number, y: number}} lp - lambda, phi
90595
+ */
90596
+ function inverseOblique(self, lp) {
90597
+ if (self.isIdentity) {
90598
+ lp.x *= D2R;
90599
+ lp.y *= D2R;
90600
+ }
90601
+
90602
+ const innerLp = self.obliqueProjection.inverse(lp);
90603
+ let { x: lam, y: phi } = innerLp;
90604
+
90605
+ if (lam < Number.MAX_VALUE) {
90606
+ lam -= self.lamp;
90607
+ const coslam = Math.cos(lam);
90608
+ const sinphi = Math.sin(phi);
90609
+ const cosphi = Math.cos(phi);
90610
+ lp.x = Math.atan2(
90611
+ cosphi * Math.sin(lam),
90612
+ (self.sphip * cosphi * coslam) - (self.cphip * sinphi)
90613
+ );
90614
+ lp.y = Math.asin(
90615
+ (self.sphip * sinphi) + (self.cphip * cosphi * coslam)
90616
+ );
90617
+ }
90618
+
90619
+ lp.x = adjust_lon(lp.x + self.long0);
90620
+ return lp;
90621
+ }
90622
+
90623
+ /**
90624
+ * Inverse (x, y) to (lng, lat) for transverse case
90625
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
90626
+ * @param {{x: number, y: number}} lp - lambda, phi
90627
+ */
90628
+ function inverseTransverse(self, lp) {
90629
+ if (self.isIdentity) {
90630
+ lp.x *= D2R;
90631
+ lp.y *= D2R;
90632
+ }
90633
+
90634
+ const innerLp = self.obliqueProjection.inverse(lp);
90635
+ let { x: lam, y: phi } = innerLp;
90636
+
90637
+ if (lam < Number.MAX_VALUE) {
90638
+ const cosphi = Math.cos(phi);
90639
+ lam -= self.lamp;
90640
+ lp.x = Math.atan2(
90641
+ cosphi * Math.sin(lam),
90642
+ -1 * Math.sin(phi)
90643
+ );
90644
+ lp.y = Math.asin(
90645
+ cosphi * Math.cos(lam)
90646
+ );
90647
+ }
90648
+
90649
+ lp.x = adjust_lon(lp.x + self.long0);
90650
+ return lp;
90651
+ }
90652
+
90653
+ var names$z = ['General Oblique Transformation', 'General_Oblique_Transformation', 'ob_tran'];
90654
+ var ob_tran = {
90655
+ init: init$y,
90656
+ forward: forward$w,
90657
+ inverse: inverse$w,
90658
+ names: names$z
90659
+ };
90660
+
90169
90661
  function includedProjections (proj4) {
90170
90662
  proj4.Proj.projections.add(tmerc);
90171
90663
  proj4.Proj.projections.add(etmerc);
@@ -90198,6 +90690,7 @@ function includedProjections (proj4) {
90198
90690
  proj4.Proj.projections.add(geos);
90199
90691
  proj4.Proj.projections.add(eqearth);
90200
90692
  proj4.Proj.projections.add(bonne);
90693
+ proj4.Proj.projections.add(ob_tran);
90201
90694
  }
90202
90695
 
90203
90696
  /**
@@ -90240,7 +90733,7 @@ var lodash = createCommonjsModule(function (module, exports) {
90240
90733
  var undefined$1;
90241
90734
 
90242
90735
  /** Used as the semantic version number. */
90243
- var VERSION = '4.17.21';
90736
+ var VERSION = '4.18.1';
90244
90737
 
90245
90738
  /** Used as the size to enable large array optimizations. */
90246
90739
  var LARGE_ARRAY_SIZE = 200;
@@ -90248,7 +90741,8 @@ var lodash = createCommonjsModule(function (module, exports) {
90248
90741
  /** Error message constants. */
90249
90742
  var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
90250
90743
  FUNC_ERROR_TEXT = 'Expected a function',
90251
- INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
90744
+ INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`',
90745
+ INVALID_TEMPL_IMPORTS_ERROR_TEXT = 'Invalid `imports` option passed into `_.template`';
90252
90746
 
90253
90747
  /** Used to stand-in for `undefined` hash values. */
90254
90748
  var HASH_UNDEFINED = '__lodash_hash_undefined__';
@@ -91980,6 +92474,10 @@ var lodash = createCommonjsModule(function (module, exports) {
91980
92474
  * embedded Ruby (ERB) as well as ES2015 template strings. Change the
91981
92475
  * following template settings to use alternative delimiters.
91982
92476
  *
92477
+ * **Security:** See
92478
+ * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md)
92479
+ * — `_.template` is insecure and will be removed in v5.
92480
+ *
91983
92481
  * @static
91984
92482
  * @memberOf _
91985
92483
  * @type {Object}
@@ -92528,7 +93026,7 @@ var lodash = createCommonjsModule(function (module, exports) {
92528
93026
  * @name has
92529
93027
  * @memberOf SetCache
92530
93028
  * @param {*} value The value to search for.
92531
- * @returns {number} Returns `true` if `value` is found, else `false`.
93029
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
92532
93030
  */
92533
93031
  function setCacheHas(value) {
92534
93032
  return this.__data__.has(value);
@@ -93994,7 +94492,7 @@ var lodash = createCommonjsModule(function (module, exports) {
93994
94492
  if (isArray(iteratee)) {
93995
94493
  return function(value) {
93996
94494
  return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
93997
- }
94495
+ };
93998
94496
  }
93999
94497
  return iteratee;
94000
94498
  });
@@ -94598,8 +95096,34 @@ var lodash = createCommonjsModule(function (module, exports) {
94598
95096
  */
94599
95097
  function baseUnset(object, path) {
94600
95098
  path = castPath(path, object);
94601
- object = parent(object, path);
94602
- return object == null || delete object[toKey(last(path))];
95099
+
95100
+ // Prevent prototype pollution:
95101
+ // https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
95102
+ // https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh
95103
+ var index = -1,
95104
+ length = path.length;
95105
+
95106
+ if (!length) {
95107
+ return true;
95108
+ }
95109
+
95110
+ while (++index < length) {
95111
+ var key = toKey(path[index]);
95112
+
95113
+ // Always block "__proto__" anywhere in the path if it's not expected
95114
+ if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
95115
+ return false;
95116
+ }
95117
+
95118
+ // Block constructor/prototype as non-terminal traversal keys to prevent
95119
+ // escaping the object graph into built-in constructors and prototypes.
95120
+ if ((key === 'constructor' || key === 'prototype') && index < length - 1) {
95121
+ return false;
95122
+ }
95123
+ }
95124
+
95125
+ var obj = parent(object, path);
95126
+ return obj == null || delete obj[toKey(last(path))];
94603
95127
  }
94604
95128
 
94605
95129
  /**
@@ -97150,7 +97674,7 @@ var lodash = createCommonjsModule(function (module, exports) {
97150
97674
 
97151
97675
  /**
97152
97676
  * Creates an array with all falsey values removed. The values `false`, `null`,
97153
- * `0`, `""`, `undefined`, and `NaN` are falsey.
97677
+ * `0`, `-0`, `0n`, `""`, `undefined`, and `NaN` are falsy.
97154
97678
  *
97155
97679
  * @static
97156
97680
  * @memberOf _
@@ -97689,7 +98213,7 @@ var lodash = createCommonjsModule(function (module, exports) {
97689
98213
 
97690
98214
  while (++index < length) {
97691
98215
  var pair = pairs[index];
97692
- result[pair[0]] = pair[1];
98216
+ baseAssignValue(result, pair[0], pair[1]);
97693
98217
  }
97694
98218
  return result;
97695
98219
  }
@@ -104349,6 +104873,8 @@ var lodash = createCommonjsModule(function (module, exports) {
104349
104873
  * **Note:** JavaScript follows the IEEE-754 standard for resolving
104350
104874
  * floating-point values which can produce unexpected results.
104351
104875
  *
104876
+ * **Note:** If `lower` is greater than `upper`, the values are swapped.
104877
+ *
104352
104878
  * @static
104353
104879
  * @memberOf _
104354
104880
  * @since 0.7.0
@@ -104362,9 +104888,16 @@ var lodash = createCommonjsModule(function (module, exports) {
104362
104888
  * _.random(0, 5);
104363
104889
  * // => an integer between 0 and 5
104364
104890
  *
104891
+ * // when lower is greater than upper the values are swapped
104892
+ * _.random(5, 0);
104893
+ * // => an integer between 0 and 5
104894
+ *
104365
104895
  * _.random(5);
104366
104896
  * // => also an integer between 0 and 5
104367
104897
  *
104898
+ * _.random(-5);
104899
+ * // => an integer between -5 and 0
104900
+ *
104368
104901
  * _.random(5, true);
104369
104902
  * // => a floating-point number between 0 and 5
104370
104903
  *
@@ -104966,6 +105499,10 @@ var lodash = createCommonjsModule(function (module, exports) {
104966
105499
  * properties may be accessed as free variables in the template. If a setting
104967
105500
  * object is given, it takes precedence over `_.templateSettings` values.
104968
105501
  *
105502
+ * **Security:** `_.template` is insecure and should not be used. It will be
105503
+ * removed in Lodash v5. Avoid untrusted input. See
105504
+ * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md).
105505
+ *
104969
105506
  * **Note:** In the development build `_.template` utilizes
104970
105507
  * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
104971
105508
  * for easier debugging.
@@ -105073,12 +105610,18 @@ var lodash = createCommonjsModule(function (module, exports) {
105073
105610
  options = undefined$1;
105074
105611
  }
105075
105612
  string = toString(string);
105076
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
105613
+ options = assignWith({}, options, settings, customDefaultsAssignIn);
105077
105614
 
105078
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
105615
+ var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn),
105079
105616
  importsKeys = keys(imports),
105080
105617
  importsValues = baseValues(imports, importsKeys);
105081
105618
 
105619
+ arrayEach(importsKeys, function(key) {
105620
+ if (reForbiddenIdentifierChars.test(key)) {
105621
+ throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT);
105622
+ }
105623
+ });
105624
+
105082
105625
  var isEscaping,
105083
105626
  isEvaluating,
105084
105627
  index = 0,
@@ -107724,7 +108267,7 @@ var mapViewBundle = {
107724
108267
  var dispatch = _ref5.dispatch,
107725
108268
  store = _ref5.store;
107726
108269
  } // @TODO get the layer from the store and figure out where to zoom to
107727
- ;
108270
+ ;
107728
108271
  },
107729
108272
  doZoomToLocation: function doZoomToLocation(center, zoom) {
107730
108273
  return function (_ref6) {
@@ -109229,7 +109772,7 @@ var config = {
109229
109772
  };
109230
109773
 
109231
109774
  var name = "@corpsmap/corpsmap";
109232
- var version$1 = "3.2.84";
109775
+ var version$1 = "3.2.93";
109233
109776
  var description = "CorpsMap as React Components";
109234
109777
  var main = "index.js";
109235
109778
  var scripts = {
@@ -132912,9 +133455,10 @@ function NodeList() {
132912
133455
  item: function(index) {
132913
133456
  return index >= 0 && index < this.length ? this[index] : null;
132914
133457
  },
132915
- toString:function(isHTML,nodeFilter){
133458
+ toString:function(isHTML,nodeFilter,options){
133459
+ var requireWellFormed = !!options && !!options.requireWellFormed;
132916
133460
  for(var buf = [], i = 0;i<this.length;i++){
132917
- serializeToString(this[i],buf,isHTML,nodeFilter);
133461
+ serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
132918
133462
  }
132919
133463
  return buf.join('');
132920
133464
  },
@@ -133159,13 +133703,28 @@ DOMImplementation.prototype = {
133159
133703
  /**
133160
133704
  * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
133161
133705
  *
133162
- * __This behavior is slightly different from the in the specs__:
133706
+ * __This implementation differs from the specification:__
133163
133707
  * - this implementation is not validating names or qualified names
133164
133708
  * (when parsing XML strings, the SAX parser takes care of that)
133165
133709
  *
133710
+ * Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
133711
+ * Creation-time validation of `publicId`, `systemId` is not enforced.
133712
+ * The serializer-level check covers all mutation vectors, including direct property writes.
133713
+ * `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
133714
+ * absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
133715
+ * silently omitted from the serialized output.
133716
+ *
133166
133717
  * @param {string} qualifiedName
133167
133718
  * @param {string} [publicId]
133719
+ * The external subset public identifier. Stored verbatim including surrounding quotes.
133720
+ * When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
133721
+ * throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
133722
+ * not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
133168
133723
  * @param {string} [systemId]
133724
+ * The external subset system identifier. Stored verbatim including surrounding quotes.
133725
+ * When serialized with `requireWellFormed: true`, throws `DOMException` with code
133726
+ * `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
133727
+ * production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
133169
133728
  * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
133170
133729
  * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
133171
133730
  *
@@ -133231,18 +133790,44 @@ Node$1.prototype = {
133231
133790
  return cloneNode(this.ownerDocument||this,this,deep);
133232
133791
  },
133233
133792
  // Modified in DOM Level 2:
133234
- normalize:function(){
133235
- var child = this.firstChild;
133236
- while(child){
133237
- var next = child.nextSibling;
133238
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
133239
- this.removeChild(next);
133240
- child.appendData(next.data);
133241
- }else {
133242
- child.normalize();
133243
- child = next;
133244
- }
133245
- }
133793
+ /**
133794
+ * Puts the specified node and all of its subtree into a "normalized" form. In a normalized
133795
+ * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
133796
+ *
133797
+ * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
133798
+ * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
133799
+ * nodes.
133800
+ *
133801
+ * This method iteratively traverses all child nodes to normalize all descendant nodes within
133802
+ * the subtree.
133803
+ *
133804
+ * @throws {DOMException}
133805
+ * May throw a DOMException if operations within removeChild or appendData (which are
133806
+ * potentially invoked in this method) do not meet their specific constraints.
133807
+ * @see {@link Node.removeChild}
133808
+ * @see {@link CharacterData.appendData}
133809
+ * @see ../docs/walk-dom.md.
133810
+ */
133811
+ normalize: function () {
133812
+ walkDOM(this, null, {
133813
+ enter: function (node) {
133814
+ // Merge adjacent text children of node before walkDOM schedules them.
133815
+ // walkDOM reads lastChild/previousSibling after enter returns, so the
133816
+ // surviving post-merge children are what it descends into.
133817
+ var child = node.firstChild;
133818
+ while (child) {
133819
+ var next = child.nextSibling;
133820
+ if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
133821
+ node.removeChild(next);
133822
+ child.appendData(next.data);
133823
+ // Do not advance child: re-check new nextSibling for another text run
133824
+ } else {
133825
+ child = next;
133826
+ }
133827
+ }
133828
+ return true; // descend into surviving children
133829
+ },
133830
+ });
133246
133831
  },
133247
133832
  // Introduced in DOM Level 2:
133248
133833
  isSupported:function(feature, version){
@@ -133318,21 +133903,103 @@ copy(NodeType,Node$1);
133318
133903
  copy(NodeType,Node$1.prototype);
133319
133904
 
133320
133905
  /**
133321
- * @param callback return true for continue,false for break
133322
- * @return boolean true: break visit;
133906
+ * @param {Node} node
133907
+ * Root of the subtree to visit.
133908
+ * @param {function(Node): boolean} callback
133909
+ * Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
133910
+ * @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
133323
133911
  */
133324
- function _visitNode(node,callback){
133325
- if(callback(node)){
133326
- return true;
133327
- }
133328
- if(node = node.firstChild){
133329
- do{
133330
- if(_visitNode(node,callback)){return true}
133331
- }while(node=node.nextSibling)
133332
- }
133912
+ function _visitNode(node, callback) {
133913
+ return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
133333
133914
  }
133334
133915
 
133916
+ /**
133917
+ * Depth-first pre/post-order DOM tree walker.
133918
+ *
133919
+ * Visits every node in the subtree rooted at `node`. For each node:
133920
+ *
133921
+ * 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
133922
+ * return value becomes the `context` passed to each child's `enter` call and to the matching
133923
+ * `exit` call.
133924
+ * 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
133925
+ * sibling traversal continues normally.
133926
+ * 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
133927
+ * further `enter` or `exit` calls are made.
133928
+ * 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
133929
+ * safely modify the node's own child list before the walker descends. Modifying siblings of
133930
+ * the current node or any other part of the tree produces unpredictable results: nodes already
133931
+ * queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
133932
+ * the current child list are never visited.
133933
+ * 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
133934
+ * been visited, passing the same `context` that `enter`
133935
+ * returned for that node.
133936
+ *
133937
+ * This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
133938
+ * deep trees.
133939
+ *
133940
+ * @param {Node} node
133941
+ * Root of the subtree to walk.
133942
+ * @param {*} context
133943
+ * Initial context value passed to the root node's `enter`.
133944
+ * @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
133945
+ * @returns {void | walkDOM.STOP}
133946
+ * @see ../docs/walk-dom.md.
133947
+ */
133948
+ function walkDOM(node, context, callbacks) {
133949
+ // Each stack frame is {node, context, phase}:
133950
+ // walkDOM.ENTER — call enter, then push children
133951
+ // walkDOM.EXIT — call exit
133952
+ var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
133953
+ while (stack.length > 0) {
133954
+ var frame = stack.pop();
133955
+ if (frame.phase === walkDOM.ENTER) {
133956
+ var childContext = callbacks.enter(frame.node, frame.context);
133957
+ if (childContext === walkDOM.STOP) {
133958
+ return walkDOM.STOP;
133959
+ }
133960
+ // Push exit frame before children so it fires after all children are processed (Last In First Out)
133961
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
133962
+ if (childContext === null || childContext === undefined) {
133963
+ continue; // skip children
133964
+ }
133965
+ // lastChild is read after enter returns, so enter may modify the child list.
133966
+ var child = frame.node.lastChild;
133967
+ // Traverse from lastChild backwards so that pushing onto the stack
133968
+ // naturally yields firstChild on top (processed first).
133969
+ while (child) {
133970
+ stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
133971
+ child = child.previousSibling;
133972
+ }
133973
+ } else {
133974
+ // frame.phase === walkDOM.EXIT
133975
+ if (callbacks.exit) {
133976
+ callbacks.exit(frame.node, frame.context);
133977
+ }
133978
+ }
133979
+ }
133980
+ }
133335
133981
 
133982
+ /**
133983
+ * Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
133984
+ * immediately.
133985
+ *
133986
+ * @type {symbol}
133987
+ */
133988
+ walkDOM.STOP = Symbol('walkDOM.STOP');
133989
+ /**
133990
+ * Phase constant for a stack frame that has not yet been visited.
133991
+ * The `enter` callback is called and children are scheduled.
133992
+ *
133993
+ * @type {number}
133994
+ */
133995
+ walkDOM.ENTER = 0;
133996
+ /**
133997
+ * Phase constant for a stack frame whose subtree has been fully visited.
133998
+ * The `exit` callback is called.
133999
+ *
134000
+ * @type {number}
134001
+ */
134002
+ walkDOM.EXIT = 1;
133336
134003
 
133337
134004
  function Document(){
133338
134005
  this.ownerDocument = this;
@@ -133936,12 +134603,44 @@ Document.prototype = {
133936
134603
  node.appendData(data);
133937
134604
  return node;
133938
134605
  },
134606
+ /**
134607
+ * Returns a new CDATASection node whose data is `data`.
134608
+ *
134609
+ * __This implementation differs from the specification:__
134610
+ * - calling this method on an HTML document does not throw `NotSupportedError`.
134611
+ *
134612
+ * @param {string} data
134613
+ * @returns {CDATASection}
134614
+ * @throws DOMException with code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
134615
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
134616
+ * @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
134617
+ */
133939
134618
  createCDATASection : function(data){
134619
+ if (data.indexOf(']]>') !== -1) {
134620
+ throw new DOMException(INVALID_CHARACTER_ERR, 'data contains "]]>"');
134621
+ }
133940
134622
  var node = new CDATASection();
133941
134623
  node.ownerDocument = this;
133942
134624
  node.appendData(data);
133943
134625
  return node;
133944
134626
  },
134627
+ /**
134628
+ * Returns a ProcessingInstruction node whose target is target and data is data.
134629
+ *
134630
+ * __This implementation differs from the specification:__
134631
+ * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
134632
+ *
134633
+ * Note: When the resulting document is serialized with `requireWellFormed: true`, the
134634
+ * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
134635
+ * §3.2.1.7). Without that option the data is emitted verbatim.
134636
+ *
134637
+ * @param {string} target
134638
+ * @param {string} data
134639
+ * @returns {ProcessingInstruction}
134640
+ * @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
134641
+ * @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
134642
+ * @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
134643
+ */
133945
134644
  createProcessingInstruction : function(target,data){
133946
134645
  var node = new ProcessingInstruction();
133947
134646
  node.ownerDocument = this;
@@ -134167,6 +134866,19 @@ function CDATASection() {
134167
134866
  _extends$1(CDATASection,CharacterData);
134168
134867
 
134169
134868
 
134869
+ /**
134870
+ * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
134871
+ *
134872
+ * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
134873
+ * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
134874
+ * direct property writes succeed silently. Values are serialized verbatim when
134875
+ * `requireWellFormed` is false (the default). When the serializer is invoked with
134876
+ * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
134877
+ * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
134878
+ *
134879
+ * @class
134880
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
134881
+ */
134170
134882
  function DocumentType() {
134171
134883
  }DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
134172
134884
  _extends$1(DocumentType,Node$1);
@@ -134194,11 +134906,48 @@ function ProcessingInstruction() {
134194
134906
  ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
134195
134907
  _extends$1(ProcessingInstruction,Node$1);
134196
134908
  function XMLSerializer$1(){}
134197
- XMLSerializer$1.prototype.serializeToString = function(node,isHtml,nodeFilter){
134198
- return nodeSerializeToString.call(node,isHtml,nodeFilter);
134909
+ /**
134910
+ * Returns the result of serializing `node` to XML.
134911
+ *
134912
+ * When `options.requireWellFormed` is `true`, the serializer throws for content that would
134913
+ * produce ill-formed XML.
134914
+ *
134915
+ * __This implementation differs from the specification:__
134916
+ * - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
134917
+ * at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
134918
+ * default behaviour) unless `requireWellFormed` is `true`.
134919
+ * - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
134920
+ * is only thrown to prevent injection vectors, not for all the spec mandated checks.
134921
+ *
134922
+ * @param {Node} node
134923
+ * @param {boolean} [isHtml]
134924
+ * @param {function} [nodeFilter]
134925
+ * @param {Object} [options]
134926
+ * @param {boolean} [options.requireWellFormed=false]
134927
+ * When `true`, throws for content that would produce ill-formed XML.
134928
+ * @returns {string}
134929
+ * @throws {DOMException}
134930
+ * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
134931
+ * - a CDATASection node's data contains `"]]>"`,
134932
+ * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
134933
+ * - a ProcessingInstruction's data contains `"?>"`,
134934
+ * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
134935
+ * production,
134936
+ * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
134937
+ * production, or
134938
+ * - a DocumentType's `internalSubset` contains `"]>"`.
134939
+ * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
134940
+ * writes succeed and are covered by the serializer-level checks above.
134941
+ * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
134942
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serialization
134943
+ * @see https://github.com/w3c/DOM-Parsing/issues/84
134944
+ */
134945
+ XMLSerializer$1.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
134946
+ return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
134199
134947
  };
134200
134948
  Node$1.prototype.toString = nodeSerializeToString;
134201
- function nodeSerializeToString(isHtml,nodeFilter){
134949
+ function nodeSerializeToString(isHtml,nodeFilter,options){
134950
+ var requireWellFormed = !!options && !!options.requireWellFormed;
134202
134951
  var buf = [];
134203
134952
  var refNode = this.nodeType == 9 && this.documentElement || this;
134204
134953
  var prefix = refNode.prefix;
@@ -134215,7 +134964,7 @@ function nodeSerializeToString(isHtml,nodeFilter){
134215
134964
  ];
134216
134965
  }
134217
134966
  }
134218
- serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
134967
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
134219
134968
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
134220
134969
  return buf.join('');
134221
134970
  }
@@ -134264,271 +135013,323 @@ function addSerializedAttribute(buf, qualifiedName, value) {
134264
135013
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
134265
135014
  }
134266
135015
 
134267
- function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
135016
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
134268
135017
  if (!visibleNamespaces) {
134269
135018
  visibleNamespaces = [];
134270
135019
  }
134271
-
134272
- if(nodeFilter){
134273
- node = nodeFilter(node);
134274
- if(node){
134275
- if(typeof node == 'string'){
134276
- buf.push(node);
134277
- return;
134278
- }
134279
- }else {
134280
- return;
134281
- }
134282
- //buf.sort.apply(attrs, attributeSorter);
134283
- }
134284
-
134285
- switch(node.nodeType){
134286
- case ELEMENT_NODE:
134287
- var attrs = node.attributes;
134288
- var len = attrs.length;
134289
- var child = node.firstChild;
134290
- var nodeName = node.tagName;
134291
-
134292
- isHTML = NAMESPACE$1.isHTML(node.namespaceURI) || isHTML;
134293
-
134294
- var prefixedNodeName = nodeName;
134295
- if (!isHTML && !node.prefix && node.namespaceURI) {
134296
- var defaultNS;
134297
- // lookup current default ns from `xmlns` attribute
134298
- for (var ai = 0; ai < attrs.length; ai++) {
134299
- if (attrs.item(ai).name === 'xmlns') {
134300
- defaultNS = attrs.item(ai).value;
134301
- break
134302
- }
134303
- }
134304
- if (!defaultNS) {
134305
- // lookup current default ns in visibleNamespaces
134306
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
134307
- var namespace = visibleNamespaces[nsi];
134308
- if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
134309
- defaultNS = namespace.namespace;
134310
- break
135020
+ walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
135021
+ enter: function (n, ctx) {
135022
+ var ns = ctx.ns;
135023
+ var html = ctx.isHTML;
135024
+
135025
+ if (nodeFilter) {
135026
+ n = nodeFilter(n);
135027
+ if (n) {
135028
+ if (typeof n == 'string') {
135029
+ buf.push(n);
135030
+ return null;
134311
135031
  }
135032
+ } else {
135033
+ return null;
134312
135034
  }
134313
135035
  }
134314
- if (defaultNS !== node.namespaceURI) {
134315
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
134316
- var namespace = visibleNamespaces[nsi];
134317
- if (namespace.namespace === node.namespaceURI) {
134318
- if (namespace.prefix) {
134319
- prefixedNodeName = namespace.prefix + ':' + nodeName;
135036
+
135037
+ switch (n.nodeType) {
135038
+ case ELEMENT_NODE:
135039
+ var attrs = n.attributes;
135040
+ var len = attrs.length;
135041
+ var nodeName = n.tagName;
135042
+
135043
+ html = NAMESPACE$1.isHTML(n.namespaceURI) || html;
135044
+
135045
+ var prefixedNodeName = nodeName;
135046
+ if (!html && !n.prefix && n.namespaceURI) {
135047
+ var defaultNS;
135048
+ // lookup current default ns from `xmlns` attribute
135049
+ for (var ai = 0; ai < attrs.length; ai++) {
135050
+ if (attrs.item(ai).name === 'xmlns') {
135051
+ defaultNS = attrs.item(ai).value;
135052
+ break;
135053
+ }
135054
+ }
135055
+ if (!defaultNS) {
135056
+ // lookup current default ns in visibleNamespaces
135057
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
135058
+ var nsEntry = ns[nsi];
135059
+ if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
135060
+ defaultNS = nsEntry.namespace;
135061
+ break;
135062
+ }
135063
+ }
135064
+ }
135065
+ if (defaultNS !== n.namespaceURI) {
135066
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
135067
+ var nsEntry = ns[nsi];
135068
+ if (nsEntry.namespace === n.namespaceURI) {
135069
+ if (nsEntry.prefix) {
135070
+ prefixedNodeName = nsEntry.prefix + ':' + nodeName;
135071
+ }
135072
+ break;
135073
+ }
135074
+ }
134320
135075
  }
134321
- break
134322
135076
  }
134323
- }
134324
- }
134325
- }
134326
135077
 
134327
- buf.push('<', prefixedNodeName);
135078
+ buf.push('<', prefixedNodeName);
135079
+
135080
+ // Build a fresh namespace snapshot for this element's children.
135081
+ // The slice prevents sibling elements from inheriting each other's declarations.
135082
+ var childNs = ns.slice();
135083
+ for (var i = 0; i < len; i++) {
135084
+ var attr = attrs.item(i);
135085
+ if (attr.prefix == 'xmlns') {
135086
+ childNs.push({ prefix: attr.localName, namespace: attr.value });
135087
+ } else if (attr.nodeName == 'xmlns') {
135088
+ childNs.push({ prefix: '', namespace: attr.value });
135089
+ }
135090
+ }
134328
135091
 
134329
- for(var i=0;i<len;i++){
134330
- // add namespaces for attributes
134331
- var attr = attrs.item(i);
134332
- if (attr.prefix == 'xmlns') {
134333
- visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
134334
- }else if(attr.nodeName == 'xmlns'){
134335
- visibleNamespaces.push({ prefix: '', namespace: attr.value });
134336
- }
134337
- }
135092
+ for (var i = 0; i < len; i++) {
135093
+ var attr = attrs.item(i);
135094
+ if (needNamespaceDefine(attr, html, childNs)) {
135095
+ var attrPrefix = attr.prefix || '';
135096
+ var uri = attr.namespaceURI;
135097
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
135098
+ childNs.push({ prefix: attrPrefix, namespace: uri });
135099
+ }
135100
+ // Apply nodeFilter and serialize the attribute.
135101
+ var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
135102
+ if (filteredAttr) {
135103
+ if (typeof filteredAttr === 'string') {
135104
+ buf.push(filteredAttr);
135105
+ } else {
135106
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
135107
+ }
135108
+ }
135109
+ }
134338
135110
 
134339
- for(var i=0;i<len;i++){
134340
- var attr = attrs.item(i);
134341
- if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
134342
- var prefix = attr.prefix||'';
134343
- var uri = attr.namespaceURI;
134344
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
134345
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
134346
- }
134347
- serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
134348
- }
135111
+ // add namespace for current node
135112
+ if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
135113
+ var nodePrefix = n.prefix || '';
135114
+ var uri = n.namespaceURI;
135115
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
135116
+ childNs.push({ prefix: nodePrefix, namespace: uri });
135117
+ }
134349
135118
 
134350
- // add namespace for current node
134351
- if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
134352
- var prefix = node.prefix||'';
134353
- var uri = node.namespaceURI;
134354
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
134355
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
134356
- }
135119
+ var child = n.firstChild;
135120
+ if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
135121
+ buf.push('>');
135122
+ if (html && /^script$/i.test(nodeName)) {
135123
+ // Inline serialization for <script> children; return null to skip walkDOM descent.
135124
+ while (child) {
135125
+ if (child.data) {
135126
+ buf.push(child.data);
135127
+ } else {
135128
+ serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
135129
+ }
135130
+ child = child.nextSibling;
135131
+ }
135132
+ buf.push('</', nodeName, '>');
135133
+ return null;
135134
+ }
135135
+ // Return child context; walkDOM descends and exit emits the closing tag.
135136
+ return { ns: childNs, isHTML: html, tag: prefixedNodeName };
135137
+ } else {
135138
+ buf.push('/>');
135139
+ return null;
135140
+ }
134357
135141
 
134358
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
134359
- buf.push('>');
134360
- //if is cdata child node
134361
- if(isHTML && /^script$/i.test(nodeName)){
134362
- while(child){
134363
- if(child.data){
134364
- buf.push(child.data);
134365
- }else {
134366
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
135142
+ case DOCUMENT_NODE:
135143
+ case DOCUMENT_FRAGMENT_NODE:
135144
+ // Descend into children; exit is a no-op (tag is null).
135145
+ return { ns: ns.slice(), isHTML: html, tag: null };
135146
+
135147
+ case ATTRIBUTE_NODE:
135148
+ addSerializedAttribute(buf, n.name, n.value);
135149
+ return null;
135150
+
135151
+ case TEXT_NODE:
135152
+ /**
135153
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
135154
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
135155
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
135156
+ * `&amp;` and `&lt;` respectively.
135157
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
135158
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
135159
+ * when that string is not marking the end of a CDATA section.
135160
+ *
135161
+ * In the content of elements, character data is any string of characters
135162
+ * which does not contain the start-delimiter of any markup
135163
+ * and does not include the CDATA-section-close delimiter, `]]>`.
135164
+ *
135165
+ * @see https://www.w3.org/TR/xml/#NT-CharData
135166
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
135167
+ */
135168
+ buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
135169
+ return null;
135170
+
135171
+ case CDATA_SECTION_NODE:
135172
+ if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
135173
+ throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
134367
135174
  }
134368
- child = child.nextSibling;
134369
- }
134370
- }else
134371
- {
134372
- while(child){
134373
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
134374
- child = child.nextSibling;
134375
- }
134376
- }
134377
- buf.push('</',prefixedNodeName,'>');
134378
- }else {
134379
- buf.push('/>');
134380
- }
134381
- // remove added visible namespaces
134382
- //visibleNamespaces.length = startVisibleNamespaces;
134383
- return;
134384
- case DOCUMENT_NODE:
134385
- case DOCUMENT_FRAGMENT_NODE:
134386
- var child = node.firstChild;
134387
- while(child){
134388
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
134389
- child = child.nextSibling;
134390
- }
134391
- return;
134392
- case ATTRIBUTE_NODE:
134393
- return addSerializedAttribute(buf, node.name, node.value);
134394
- case TEXT_NODE:
134395
- /**
134396
- * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
134397
- * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
134398
- * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
134399
- * `&amp;` and `&lt;` respectively.
134400
- * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
134401
- * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
134402
- * when that string is not marking the end of a CDATA section.
134403
- *
134404
- * In the content of elements, character data is any string of characters
134405
- * which does not contain the start-delimiter of any markup
134406
- * and does not include the CDATA-section-close delimiter, `]]>`.
134407
- *
134408
- * @see https://www.w3.org/TR/xml/#NT-CharData
134409
- * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
134410
- */
134411
- return buf.push(node.data
134412
- .replace(/[<&>]/g,_xmlEncoder)
134413
- );
134414
- case CDATA_SECTION_NODE:
134415
- return buf.push( '<![CDATA[',node.data,']]>');
134416
- case COMMENT_NODE:
134417
- return buf.push( "<!--",node.data,"-->");
134418
- case DOCUMENT_TYPE_NODE:
134419
- var pubid = node.publicId;
134420
- var sysid = node.systemId;
134421
- buf.push('<!DOCTYPE ',node.name);
134422
- if(pubid){
134423
- buf.push(' PUBLIC ', pubid);
134424
- if (sysid && sysid!='.') {
134425
- buf.push(' ', sysid);
135175
+ buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
135176
+ return null;
135177
+
135178
+ case COMMENT_NODE:
135179
+ if (requireWellFormed && n.data.indexOf('-->') !== -1) {
135180
+ throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
135181
+ }
135182
+ buf.push('<!--', n.data, '-->');
135183
+ return null;
135184
+
135185
+ case DOCUMENT_TYPE_NODE:
135186
+ if (requireWellFormed) {
135187
+ if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
135188
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
135189
+ }
135190
+ if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
135191
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
135192
+ }
135193
+ if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
135194
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
135195
+ }
135196
+ }
135197
+ var pubid = n.publicId;
135198
+ var sysid = n.systemId;
135199
+ buf.push('<!DOCTYPE ', n.name);
135200
+ if (pubid) {
135201
+ buf.push(' PUBLIC ', pubid);
135202
+ if (sysid && sysid != '.') {
135203
+ buf.push(' ', sysid);
135204
+ }
135205
+ buf.push('>');
135206
+ } else if (sysid && sysid != '.') {
135207
+ buf.push(' SYSTEM ', sysid, '>');
135208
+ } else {
135209
+ var sub = n.internalSubset;
135210
+ if (sub) {
135211
+ buf.push(' [', sub, ']');
135212
+ }
135213
+ buf.push('>');
135214
+ }
135215
+ return null;
135216
+
135217
+ case PROCESSING_INSTRUCTION_NODE:
135218
+ if (requireWellFormed && n.data.indexOf('?>') !== -1) {
135219
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
135220
+ }
135221
+ buf.push('<?', n.target, ' ', n.data, '?>');
135222
+ return null;
135223
+
135224
+ case ENTITY_REFERENCE_NODE:
135225
+ buf.push('&', n.nodeName, ';');
135226
+ return null;
135227
+
135228
+ //case ENTITY_NODE:
135229
+ //case NOTATION_NODE:
135230
+ default:
135231
+ buf.push('??', n.nodeName);
135232
+ return null;
134426
135233
  }
134427
- buf.push('>');
134428
- }else if(sysid && sysid!='.'){
134429
- buf.push(' SYSTEM ', sysid, '>');
134430
- }else {
134431
- var sub = node.internalSubset;
134432
- if(sub){
134433
- buf.push(" [",sub,"]");
135234
+ },
135235
+ exit: function (n, childCtx) {
135236
+ if (childCtx && childCtx.tag) {
135237
+ buf.push('</', childCtx.tag, '>');
134434
135238
  }
134435
- buf.push(">");
134436
- }
134437
- return;
134438
- case PROCESSING_INSTRUCTION_NODE:
134439
- return buf.push( "<?",node.target," ",node.data,"?>");
134440
- case ENTITY_REFERENCE_NODE:
134441
- return buf.push( '&',node.nodeName,';');
134442
- //case ENTITY_NODE:
134443
- //case NOTATION_NODE:
134444
- default:
134445
- buf.push('??',node.nodeName);
134446
- }
135239
+ },
135240
+ });
134447
135241
  }
134448
- function importNode(doc,node,deep){
134449
- var node2;
134450
- switch (node.nodeType) {
134451
- case ELEMENT_NODE:
134452
- node2 = node.cloneNode(false);
134453
- node2.ownerDocument = doc;
134454
- //var attrs = node2.attributes;
134455
- //var len = attrs.length;
134456
- //for(var i=0;i<len;i++){
134457
- //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
134458
- //}
134459
- case DOCUMENT_FRAGMENT_NODE:
134460
- break;
134461
- case ATTRIBUTE_NODE:
134462
- deep = true;
134463
- break;
134464
- //case ENTITY_REFERENCE_NODE:
134465
- //case PROCESSING_INSTRUCTION_NODE:
134466
- ////case TEXT_NODE:
134467
- //case CDATA_SECTION_NODE:
134468
- //case COMMENT_NODE:
134469
- // deep = false;
134470
- // break;
134471
- //case DOCUMENT_NODE:
134472
- //case DOCUMENT_TYPE_NODE:
134473
- //cannot be imported.
134474
- //case ENTITY_NODE:
134475
- //case NOTATION_NODE:
134476
- //can not hit in level3
134477
- //default:throw e;
134478
- }
134479
- if(!node2){
134480
- node2 = node.cloneNode(false);//false
134481
- }
134482
- node2.ownerDocument = doc;
134483
- node2.parentNode = null;
134484
- if(deep){
134485
- var child = node.firstChild;
134486
- while(child){
134487
- node2.appendChild(importNode(doc,child,deep));
134488
- child = child.nextSibling;
134489
- }
134490
- }
134491
- return node2;
135242
+ /**
135243
+ * Imports a node from a different document into `doc`, creating a new copy.
135244
+ * Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
135245
+ * stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
135246
+ * Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
135247
+ * always forced to `true`
135248
+ * because an attribute's value lives in a child text node.
135249
+ *
135250
+ * @param {Document} doc
135251
+ * The document that will own the imported node.
135252
+ * @param {Node} node
135253
+ * The node to import.
135254
+ * @param {boolean} deep
135255
+ * If `true`, descendants are imported recursively.
135256
+ * @returns {Node}
135257
+ * The newly imported node, now owned by `doc`.
135258
+ */
135259
+ function importNode(doc, node, deep) {
135260
+ var destRoot;
135261
+ walkDOM(node, null, {
135262
+ enter: function (srcNode, destParent) {
135263
+ // Shallow-clone the node and stamp it into the target document.
135264
+ var destNode = srcNode.cloneNode(false);
135265
+ destNode.ownerDocument = doc;
135266
+ destNode.parentNode = null;
135267
+ // capture as the root of the imported subtree or attach to parent.
135268
+ if (destParent === null) {
135269
+ destRoot = destNode;
135270
+ } else {
135271
+ destParent.appendChild(destNode);
135272
+ }
135273
+ // ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
135274
+ var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
135275
+ return shouldDeep ? destNode : null;
135276
+ },
135277
+ });
135278
+ return destRoot;
134492
135279
  }
134493
135280
  //
134494
135281
  //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
134495
135282
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
134496
- function cloneNode(doc,node,deep){
134497
- var node2 = new node.constructor();
134498
- for (var n in node) {
134499
- if (Object.prototype.hasOwnProperty.call(node, n)) {
134500
- var v = node[n];
134501
- if (typeof v != "object") {
134502
- if (v != node2[n]) {
134503
- node2[n] = v;
135283
+ function cloneNode(doc, node, deep) {
135284
+ var destRoot;
135285
+ walkDOM(node, null, {
135286
+ enter: function (srcNode, destParent) {
135287
+ // 1. Create a blank node of the same type and copy all scalar own properties.
135288
+ var destNode = new srcNode.constructor();
135289
+ for (var n in srcNode) {
135290
+ if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
135291
+ var v = srcNode[n];
135292
+ if (typeof v != 'object') {
135293
+ if (v != destNode[n]) {
135294
+ destNode[n] = v;
135295
+ }
135296
+ }
134504
135297
  }
134505
135298
  }
134506
- }
134507
- }
134508
- if(node.childNodes){
134509
- node2.childNodes = new NodeList();
134510
- }
134511
- node2.ownerDocument = doc;
134512
- switch (node2.nodeType) {
134513
- case ELEMENT_NODE:
134514
- var attrs = node.attributes;
134515
- var attrs2 = node2.attributes = new NamedNodeMap();
134516
- var len = attrs.length;
134517
- attrs2._ownerElement = node2;
134518
- for(var i=0;i<len;i++){
134519
- node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
134520
- }
134521
- break; case ATTRIBUTE_NODE:
134522
- deep = true;
134523
- }
134524
- if(deep){
134525
- var child = node.firstChild;
134526
- while(child){
134527
- node2.appendChild(cloneNode(doc,child,deep));
134528
- child = child.nextSibling;
134529
- }
134530
- }
134531
- return node2;
135299
+ if (srcNode.childNodes) {
135300
+ destNode.childNodes = new NodeList();
135301
+ }
135302
+ destNode.ownerDocument = doc;
135303
+ // 2. Handle node-type-specific setup.
135304
+ // Attributes are not DOM children, so they are cloned inline here
135305
+ // rather than by walkDOM descent.
135306
+ // ATTRIBUTE_NODE forces deep=true so its own children are walked.
135307
+ var shouldDeep = deep;
135308
+ switch (destNode.nodeType) {
135309
+ case ELEMENT_NODE:
135310
+ var attrs = srcNode.attributes;
135311
+ var attrs2 = (destNode.attributes = new NamedNodeMap());
135312
+ var len = attrs.length;
135313
+ attrs2._ownerElement = destNode;
135314
+ for (var i = 0; i < len; i++) {
135315
+ destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
135316
+ }
135317
+ break;
135318
+ case ATTRIBUTE_NODE:
135319
+ shouldDeep = true;
135320
+ }
135321
+ // 3. Attach to parent, or capture as the root of the cloned subtree.
135322
+ if (destParent !== null) {
135323
+ destParent.appendChild(destNode);
135324
+ } else {
135325
+ destRoot = destNode;
135326
+ }
135327
+ // 4. Return destNode as the context for children (causes walkDOM to descend),
135328
+ // or null to skip children (shallow clone).
135329
+ return shouldDeep ? destNode : null;
135330
+ },
135331
+ });
135332
+ return destRoot;
134532
135333
  }
134533
135334
 
134534
135335
  function __set__(object,key,value){
@@ -134544,49 +135345,55 @@ try{
134544
135345
  }
134545
135346
  });
134546
135347
 
134547
- Object.defineProperty(Node$1.prototype,'textContent',{
134548
- get:function(){
134549
- return getTextContent(this);
135348
+ /**
135349
+ * The text content of this node and its descendants.
135350
+ *
135351
+ * Setting `textContent` on an element or document fragment replaces all child nodes with a
135352
+ * single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
135353
+ *
135354
+ * @type {string | null}
135355
+ * @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
135356
+ */
135357
+ Object.defineProperty(Node$1.prototype, 'textContent', {
135358
+ get: function () {
135359
+ if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
135360
+ var buf = [];
135361
+ walkDOM(this, null, {
135362
+ enter: function (n) {
135363
+ if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
135364
+ return true; // enter children
135365
+ }
135366
+ if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
135367
+ return null; // excluded from text content
135368
+ }
135369
+ buf.push(n.nodeValue);
135370
+ },
135371
+ });
135372
+ return buf.join('');
135373
+ }
135374
+ return this.nodeValue;
134550
135375
  },
134551
135376
 
134552
- set:function(data){
134553
- switch(this.nodeType){
134554
- case ELEMENT_NODE:
134555
- case DOCUMENT_FRAGMENT_NODE:
134556
- while(this.firstChild){
134557
- this.removeChild(this.firstChild);
134558
- }
134559
- if(data || String(data)){
134560
- this.appendChild(this.ownerDocument.createTextNode(data));
134561
- }
134562
- break;
135377
+ set: function (data) {
135378
+ switch (this.nodeType) {
135379
+ case ELEMENT_NODE:
135380
+ case DOCUMENT_FRAGMENT_NODE:
135381
+ while (this.firstChild) {
135382
+ this.removeChild(this.firstChild);
135383
+ }
135384
+ if (data || String(data)) {
135385
+ this.appendChild(this.ownerDocument.createTextNode(data));
135386
+ }
135387
+ break;
134563
135388
 
134564
- default:
134565
- this.data = data;
134566
- this.value = data;
134567
- this.nodeValue = data;
135389
+ default:
135390
+ this.data = data;
135391
+ this.value = data;
135392
+ this.nodeValue = data;
134568
135393
  }
134569
- }
135394
+ },
134570
135395
  });
134571
135396
 
134572
- function getTextContent(node){
134573
- switch(node.nodeType){
134574
- case ELEMENT_NODE:
134575
- case DOCUMENT_FRAGMENT_NODE:
134576
- var buf = [];
134577
- node = node.firstChild;
134578
- while(node){
134579
- if(node.nodeType!==7 && node.nodeType !==8){
134580
- buf.push(getTextContent(node));
134581
- }
134582
- node = node.nextSibling;
134583
- }
134584
- return buf.join('');
134585
- default:
134586
- return node.nodeValue;
134587
- }
134588
- }
134589
-
134590
135397
  __set__ = function(object,key,value){
134591
135398
  //console.log(value)
134592
135399
  object['$$'+key] = value;
@@ -134602,6 +135409,7 @@ try{
134602
135409
  var Element_1 = Element$1;
134603
135410
  var Node_1 = Node$1;
134604
135411
  var NodeList_1 = NodeList;
135412
+ var walkDOM_1 = walkDOM;
134605
135413
  var XMLSerializer_1 = XMLSerializer$1;
134606
135414
  //}
134607
135415
 
@@ -134612,6 +135420,7 @@ var dom = {
134612
135420
  Element: Element_1,
134613
135421
  Node: Node_1,
134614
135422
  NodeList: NodeList_1,
135423
+ walkDOM: walkDOM_1,
134615
135424
  XMLSerializer: XMLSerializer_1
134616
135425
  };
134617
135426
 
@@ -137385,7 +138194,7 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
137385
138194
  function parseInstruction(source,start,domBuilder){
137386
138195
  var end = source.indexOf('?>',start);
137387
138196
  if(end){
137388
- var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
138197
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
137389
138198
  if(match){
137390
138199
  var len = match[0].length;
137391
138200
  domBuilder.processingInstruction(match[1], match[2]) ;
@@ -139487,12 +140296,14 @@ var ChangeLogModal = /*#__PURE__*/function (_React$Component) {
139487
140296
  key: "formatDate",
139488
140297
  value: function formatDate(oldDate) {
139489
140298
  var newDate = new Date(oldDate);
139490
- newDate = newDate.toLocaleDateString("default", {
140299
+ var offset = newDate.getTimezoneOffset() * 60000;
140300
+ var newDate2 = new Date(newDate.getTime() + offset);
140301
+ newDate2 = newDate2.toLocaleDateString("default", {
139491
140302
  month: "long",
139492
140303
  day: "numeric",
139493
140304
  year: "numeric"
139494
140305
  });
139495
- return newDate;
140306
+ return newDate2;
139496
140307
  }
139497
140308
  }, {
139498
140309
  key: "render",
@@ -146706,7 +147517,7 @@ var _setCacheAdd = setCacheAdd;
146706
147517
  * @name has
146707
147518
  * @memberOf SetCache
146708
147519
  * @param {*} value The value to search for.
146709
- * @returns {number} Returns `true` if `value` is found, else `false`.
147520
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
146710
147521
  */
146711
147522
  function setCacheHas(value) {
146712
147523
  return this.__data__.has(value);
@@ -150174,7 +150985,7 @@ function baseOrderBy(collection, iteratees, orders) {
150174
150985
  if (isArray_1(iteratee)) {
150175
150986
  return function(value) {
150176
150987
  return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
150177
- }
150988
+ };
150178
150989
  }
150179
150990
  return iteratee;
150180
150991
  });