@chrtco/sdk 0.10.2 → 0.10.3

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/dist/index.js CHANGED
@@ -340,10 +340,11 @@ var TilesEndpoint = class {
340
340
  }
341
341
  region;
342
342
  tileBaseUrl;
343
- styleEndpoint(theme, symbols) {
343
+ styleEndpoint(opts) {
344
344
  const params = new URLSearchParams();
345
- if (theme) params.set("theme", theme);
346
- if (symbols) params.set("symbols", symbols);
345
+ if (opts.theme) params.set("theme", opts.theme);
346
+ if (opts.symbols) params.set("symbols", opts.symbols);
347
+ if (opts.mode) params.set("mode", opts.mode);
347
348
  const query2 = params.size > 0 ? `?${params.toString()}` : "";
348
349
  return `${this.tileBaseUrl}/v1/styles/${this.region}/style.json${query2}`;
349
350
  }
@@ -369,7 +370,7 @@ var TilesEndpoint = class {
369
370
  */
370
371
  async styleUrl(opts = {}) {
371
372
  await this.tileAuth.getToken(this.region);
372
- return this.styleEndpoint(opts.theme, opts.symbols);
373
+ return this.styleEndpoint(opts);
373
374
  }
374
375
  /**
375
376
  * Fetch the served S-52 style as a MapLibre style object (see
@@ -383,7 +384,7 @@ var TilesEndpoint = class {
383
384
  */
384
385
  async fetchStyle(opts = {}) {
385
386
  const token = await this.tileAuth.getToken(this.region);
386
- const res = await fetch(this.styleEndpoint(opts.theme, opts.symbols), {
387
+ const res = await fetch(this.styleEndpoint(opts), {
387
388
  headers: { authorization: `Bearer ${token.token}` },
388
389
  signal: opts.signal
389
390
  });
@@ -958,7 +959,9 @@ var OfflineEndpoint = class {
958
959
  const token = await this.requireToken([region]);
959
960
  const palette = opts.palette ?? "DAY";
960
961
  const protocol = opts.protocol ?? "mbtiles";
961
- const path = `/offline/styles/${encodeURIComponent(region)}?palette=${palette}&protocol=${protocol}`;
962
+ const symbolsParam = opts.symbols ? `&symbols=${encodeURIComponent(opts.symbols)}` : "";
963
+ const modeParam = opts.mode ? `&mode=${encodeURIComponent(opts.mode)}` : "";
964
+ const path = `/offline/styles/${encodeURIComponent(region)}?palette=${palette}&protocol=${protocol}${symbolsParam}${modeParam}`;
962
965
  const res = await this.http.getJsonWithBearer(
963
966
  path,
964
967
  token.token
@@ -1303,157 +1306,519 @@ function dirname(p) {
1303
1306
  return p.slice(0, k);
1304
1307
  }
1305
1308
 
1306
- // src/interact/decode.ts
1307
- var LITCHR_TABLE = {
1308
- 1: { name: "Fixed", abbr: "F" },
1309
- 2: { name: "Flashing", abbr: "Fl" },
1310
- 3: { name: "Long Flashing", abbr: "LFl" },
1311
- 4: { name: "Occulting", abbr: "Oc" },
1312
- 5: { name: "Isophase", abbr: "Iso" },
1313
- 6: { name: "Short Flashing", abbr: "S.Fl" },
1314
- 7: { name: "Short Long Flashing", abbr: "S.LFl" },
1315
- 8: { name: "Alternating Occulting", abbr: "Al.Oc" },
1316
- 9: { name: "Alternating Long Flashing", abbr: "Al.LFl" },
1317
- 10: { name: "Alternating Flashing", abbr: "Al.Fl" },
1318
- 11: { name: "Alternating Group", abbr: "Al.Gp" },
1319
- 12: { name: "Morse", abbr: "Mo" },
1320
- 13: { name: "Quick", abbr: "Q" },
1321
- 14: { name: "Very Quick", abbr: "VQ" },
1322
- 15: { name: "Ultra Quick", abbr: "UQ" },
1323
- 16: { name: "Alternating", abbr: "Al" },
1324
- 17: { name: "Alternating Fixed/Flash", abbr: "Al.F.Fl" },
1325
- 25: { name: "Quick + Long Flash", abbr: "Q+LFl" },
1326
- 26: { name: "Very Quick + Long Flash", abbr: "VQ+LFl" },
1327
- 27: { name: "Ultra Quick + Long Flash", abbr: "UQ+LFl" },
1328
- 28: { name: "Alternating", abbr: "Al" },
1329
- 29: { name: "Fixed + Long Flash", abbr: "F.LFl" }
1309
+ // src/s57/codelists.generated.ts
1310
+ var BOYSHP_CODES = {
1311
+ 1: { code: 1, name: "Conical (nun, ogival)" },
1312
+ 2: { code: 2, name: "Can (cylindrical)" },
1313
+ 3: { code: 3, name: "Spherical" },
1314
+ 4: { code: 4, name: "Pillar" },
1315
+ 5: { code: 5, name: "Spar (spindle)" },
1316
+ 6: { code: 6, name: "Barrel (tun)" },
1317
+ 7: { code: 7, name: "Super-buoy" },
1318
+ 8: { code: 8, name: "Ice buoy" }
1319
+ };
1320
+ var CATACH_CODES = {
1321
+ 1: { code: 1, name: "Unrestricted anchorage" },
1322
+ 2: { code: 2, name: "Deep water anchorage" },
1323
+ 3: { code: 3, name: "Tanker anchorage" },
1324
+ 4: { code: 4, name: "Explosives anchorage" },
1325
+ 5: { code: 5, name: "Quarantine anchorage" },
1326
+ 6: { code: 6, name: "Sea-plane anchorage" },
1327
+ 7: { code: 7, name: "Small craft anchorage" },
1328
+ 8: { code: 8, name: "Small craft mooring area" },
1329
+ 9: { code: 9, name: "Anchorage for periods up to 24 hours" }
1330
+ };
1331
+ var CATCAM_CODES = {
1332
+ 1: { code: 1, name: "North cardinal mark" },
1333
+ 2: { code: 2, name: "East cardinal mark" },
1334
+ 3: { code: 3, name: "South cardinal mark" },
1335
+ 4: { code: 4, name: "West cardinal mark" }
1336
+ };
1337
+ var CATCBL_CODES = {
1338
+ 1: { code: 1, name: "Power line" },
1339
+ 2: { code: 2, name: "Submarine cable", supplement: true, unverified: true },
1340
+ 3: { code: 3, name: "Transmission line" },
1341
+ 4: { code: 4, name: "Telephone" },
1342
+ 5: { code: 5, name: "Telegraph" },
1343
+ 6: { code: 6, name: "Mooring cable/chain" }
1344
+ };
1345
+ var CATCOA_CODES = {
1346
+ 1: { code: 1, name: "Steep coast" },
1347
+ 2: { code: 2, name: "Flat coast" },
1348
+ 3: { code: 3, name: "Sandy shore" },
1349
+ 4: { code: 4, name: "Stony shore" },
1350
+ 5: { code: 5, name: "Shingly shore" },
1351
+ 6: { code: 6, name: "Glacier (seaward end)" },
1352
+ 7: { code: 7, name: "Mangrove" },
1353
+ 8: { code: 8, name: "Marshy shore" },
1354
+ 9: { code: 9, name: "Coral reef" },
1355
+ 10: { code: 10, name: "Ice coast" },
1356
+ 11: { code: 11, name: "Embankment", supplement: true, unverified: true }
1357
+ };
1358
+ var CATCRN_CODES = {
1359
+ 2: { code: 2, name: "Container crane/gantry" },
1360
+ 3: { code: 3, name: "Sheerlegs" },
1361
+ 4: { code: 4, name: "Travelling crane" },
1362
+ 5: { code: 5, name: "A-frame" }
1363
+ };
1364
+ var CATDPG_CODES = {
1365
+ 1: { code: 1, name: "General dumping ground", supplement: true, unverified: true },
1366
+ 2: { code: 2, name: "Chemical waste dumping ground" },
1367
+ 3: { code: 3, name: "Nuclear waste dumping ground" },
1368
+ 4: { code: 4, name: "Explosives dumping ground" },
1369
+ 5: { code: 5, name: "Spoil ground" },
1370
+ 6: { code: 6, name: "Vessel dumping ground" }
1371
+ };
1372
+ var CATFOG_CODES = {
1373
+ 1: { code: 1, name: "Explosive", abbr: "EXPLOS" },
1374
+ 2: { code: 2, name: "Diaphone", abbr: "DIA" },
1375
+ 3: { code: 3, name: "Siren", abbr: "SIREN" },
1376
+ 4: { code: 4, name: "Nautophone", abbr: "NAUTO" },
1377
+ 5: { code: 5, name: "Reed", abbr: "REED" },
1378
+ 6: { code: 6, name: "Tyfon", abbr: "TYFON" },
1379
+ 7: { code: 7, name: "Bell", abbr: "BELL" },
1380
+ 8: { code: 8, name: "Whistle", abbr: "WHIS" },
1381
+ 9: { code: 9, name: "Gong", abbr: "GONG" },
1382
+ 10: { code: 10, name: "Horn", abbr: "HORN" }
1383
+ };
1384
+ var CATHAF_CODES = {
1385
+ 1: { code: 1, name: "RoRo-terminal" },
1386
+ 3: { code: 3, name: "Ferry terminal" },
1387
+ 4: { code: 4, name: "Fishing harbour" },
1388
+ 5: { code: 5, name: "Yacht harbour/marina" },
1389
+ 6: { code: 6, name: "Naval base" },
1390
+ 7: { code: 7, name: "Tanker terminal" },
1391
+ 8: { code: 8, name: "Passenger terminal" },
1392
+ 9: { code: 9, name: "Shipyard" },
1393
+ 10: { code: 10, name: "Container terminal" },
1394
+ 11: { code: 11, name: "Bulk terminal" },
1395
+ 12: { code: 12, name: "Synchrolift", supplement: true, unverified: true },
1396
+ 13: { code: 13, name: "Straddle carrier", supplement: true, unverified: true },
1397
+ 14: { code: 14, name: "Port terminal", supplement: true, unverified: true }
1398
+ };
1399
+ var CATLAM_CODES = {
1400
+ 1: { code: 1, name: "Port-hand lateral mark" },
1401
+ 2: { code: 2, name: "Starboard-hand lateral mark" },
1402
+ 3: { code: 3, name: "Preferred channel to starboard lateral mark" },
1403
+ 4: { code: 4, name: "Preferred channel to port lateral mark" }
1404
+ };
1405
+ var CATLIT_CODES = {
1406
+ 1: { code: 1, name: "Directional function" },
1407
+ 4: { code: 4, name: "Leading light" },
1408
+ 5: { code: 5, name: "Aero light" },
1409
+ 6: { code: 6, name: "Air obstruction light" },
1410
+ 7: { code: 7, name: "Fog detector light" },
1411
+ 8: { code: 8, name: "Flood light" },
1412
+ 9: { code: 9, name: "Strip light" },
1413
+ 10: { code: 10, name: "Subsidiary light" },
1414
+ 11: { code: 11, name: "Spotlight" },
1415
+ 12: { code: 12, name: "Front" },
1416
+ 13: { code: 13, name: "Rear" },
1417
+ 14: { code: 14, name: "Lower" },
1418
+ 15: { code: 15, name: "Upper" },
1419
+ 16: { code: 16, name: "Moir\xE9 effect" },
1420
+ 17: { code: 17, name: "Emergency" },
1421
+ 18: { code: 18, name: "Bearing light" },
1422
+ 19: { code: 19, name: "Horizontally disposed" },
1423
+ 20: { code: 20, name: "Vertically disposed" }
1424
+ };
1425
+ var CATLMK_CODES = {
1426
+ 1: { code: 1, name: "Cairn" },
1427
+ 2: { code: 2, name: "Cemetery" },
1428
+ 3: { code: 3, name: "Chimney" },
1429
+ 4: { code: 4, name: "Dish aerial" },
1430
+ 5: { code: 5, name: "Flagstaff (flagpole)" },
1431
+ 6: { code: 6, name: "Flare stack" },
1432
+ 7: { code: 7, name: "Mast" },
1433
+ 8: { code: 8, name: "Windsock" },
1434
+ 9: { code: 9, name: "Monument" },
1435
+ 10: { code: 10, name: "Column (pillar)" },
1436
+ 11: { code: 11, name: "Memorial plaque" },
1437
+ 12: { code: 12, name: "Obelisk" },
1438
+ 13: { code: 13, name: "Statue" },
1439
+ 14: { code: 14, name: "Cross" },
1440
+ 15: { code: 15, name: "Dome" },
1441
+ 16: { code: 16, name: "Radar scanner" },
1442
+ 17: { code: 17, name: "Tower" },
1443
+ 18: { code: 18, name: "Windmill" },
1444
+ 19: { code: 19, name: "Windmotor" },
1445
+ 20: { code: 20, name: "Spire/minaret" }
1330
1446
  };
1331
- var COLOUR_TABLE = {
1332
- 1: { name: "White", abbr: "W", hex: "#ffffff" },
1333
- 2: { name: "Black", abbr: "B", hex: "#333333" },
1334
- 3: { name: "Red", abbr: "R", hex: "#ef4444" },
1335
- 4: { name: "Green", abbr: "G", hex: "#22c55e" },
1336
- 5: { name: "Blue", abbr: "Bu", hex: "#3b82f6" },
1337
- 6: { name: "Yellow", abbr: "Y", hex: "#eab308" },
1338
- 7: { name: "Grey", abbr: "Gr", hex: "#9ca3af" },
1339
- 8: { name: "Brown", abbr: "Bn", hex: "#92400e" },
1340
- 9: { name: "Amber", abbr: "Am", hex: "#f59e0b" },
1341
- 10: { name: "Violet", abbr: "Vi", hex: "#8b5cf6" },
1342
- 11: { name: "Orange", abbr: "Or", hex: "#f97316" },
1343
- 12: { name: "Magenta", abbr: "Mg", hex: "#d946ef" },
1344
- 13: { name: "Pink", abbr: "Pk", hex: "#f472b6" }
1447
+ var CATMFA_CODES = {
1448
+ 1: { code: 1, name: "Crustaceans" },
1449
+ 2: { code: 2, name: "Oyster/mussels" },
1450
+ 3: { code: 3, name: "Fish" },
1451
+ 4: { code: 4, name: "Seaweed" },
1452
+ 5: { code: 5, name: "Seaweed / kelp farm", supplement: true, unverified: true }
1345
1453
  };
1346
- var BOYSHP_TABLE = {
1347
- 1: "Conical (nun)",
1348
- 2: "Can (cylindrical)",
1349
- 3: "Spherical",
1350
- 4: "Pillar",
1351
- 5: "Spar",
1352
- 6: "Barrel",
1353
- 7: "Super buoy",
1354
- 8: "Ice buoy"
1454
+ var CATOBS_CODES = {
1455
+ 1: { code: 1, name: "Snag / stump" },
1456
+ 2: { code: 2, name: "Wellhead" },
1457
+ 3: { code: 3, name: "Diffuser" },
1458
+ 4: { code: 4, name: "Crib" },
1459
+ 5: { code: 5, name: "Fish haven" },
1460
+ 6: { code: 6, name: "Foul area" },
1461
+ 7: { code: 7, name: "Foul ground" },
1462
+ 8: { code: 8, name: "Ice boom" },
1463
+ 9: { code: 9, name: "Ground tackle" },
1464
+ 10: { code: 10, name: "Boom", supplement: true, unverified: true },
1465
+ 11: { code: 11, name: "Platform", supplement: true, unverified: true }
1355
1466
  };
1356
- var CATLAM_TABLE = {
1357
- 1: "Port",
1358
- 2: "Starboard",
1359
- 3: "Preferred channel to starboard",
1360
- 4: "Preferred channel to port"
1467
+ var CATPIP_CODES = {
1468
+ 1: { code: 1, name: "Pipeline in general", supplement: true, unverified: true },
1469
+ 2: { code: 2, name: "Outfall pipe" },
1470
+ 3: { code: 3, name: "Intake pipe" },
1471
+ 4: { code: 4, name: "Sewer" },
1472
+ 5: { code: 5, name: "Bubbler system" },
1473
+ 6: { code: 6, name: "Supply pipe" }
1361
1474
  };
1362
- var CATCAM_TABLE = {
1363
- 1: "North cardinal",
1364
- 2: "East cardinal",
1365
- 3: "South cardinal",
1366
- 4: "West cardinal"
1475
+ var CATREA_CODES = {
1476
+ 1: { code: 1, name: "Offshore safety zone" },
1477
+ 2: { code: 2, name: "Anchoring prohibition", supplement: true, unverified: true },
1478
+ 3: { code: 3, name: "Fishing prohibition", supplement: true, unverified: true },
1479
+ 4: { code: 4, name: "Nature reserve" },
1480
+ 5: { code: 5, name: "Bird sanctuary" },
1481
+ 6: { code: 6, name: "Game preserve" },
1482
+ 7: { code: 7, name: "Seal sanctuary" },
1483
+ 8: { code: 8, name: "Degaussing range" },
1484
+ 9: { code: 9, name: "Military area" },
1485
+ 10: { code: 10, name: "Historic wreck area" },
1486
+ 12: { code: 12, name: "Navigational aid safety zone" },
1487
+ 14: { code: 14, name: "Minefield" },
1488
+ 18: { code: 18, name: "Swimming area" },
1489
+ 19: { code: 19, name: "Waiting area" },
1490
+ 20: { code: 20, name: "Research area" },
1491
+ 21: { code: 21, name: "Dredging area" },
1492
+ 22: { code: 22, name: "Fish sanctuary" },
1493
+ 23: { code: 23, name: "Ecological reserve" },
1494
+ 24: { code: 24, name: "No wake area" },
1495
+ 25: { code: 25, name: "Swinging area" },
1496
+ 26: { code: 26, name: "No fishing area", supplement: true, unverified: true },
1497
+ 27: { code: 27, name: "Speed restriction zone", supplement: true, unverified: true },
1498
+ 28: { code: 28, name: "To be avoided area", supplement: true, unverified: true }
1367
1499
  };
1368
- var CATLMK_TABLE = {
1369
- 1: "Cairn",
1370
- 2: "Cemetery",
1371
- 3: "Chimney",
1372
- 4: "Dish aerial",
1373
- 5: "Flagstaff",
1374
- 6: "Flare stack",
1375
- 7: "Mast",
1376
- 8: "Windsock",
1377
- 9: "Monument",
1378
- 10: "Column / pillar",
1379
- 11: "Memorial plaque",
1380
- 12: "Obelisk",
1381
- 13: "Statue",
1382
- 14: "Cross",
1383
- 15: "Dome",
1384
- 16: "Radar scanner",
1385
- 17: "Tower",
1386
- 18: "Windmill",
1387
- 19: "Wind turbine",
1388
- 20: "Spire"
1500
+ var CATSCF_CODES = {
1501
+ 1: { code: 1, name: "Visitors' berth" },
1502
+ 2: { code: 2, name: "Nautical club" },
1503
+ 3: { code: 3, name: "Boat hoist" },
1504
+ 4: { code: 4, name: "Sailmaker" },
1505
+ 5: { code: 5, name: "Boatyard" },
1506
+ 6: { code: 6, name: "Public inn" },
1507
+ 7: { code: 7, name: "Restaurant" },
1508
+ 8: { code: 8, name: "Chandler" },
1509
+ 9: { code: 9, name: "Provisions" },
1510
+ 10: { code: 10, name: "Doctor" },
1511
+ 11: { code: 11, name: "Pharmacy" },
1512
+ 12: { code: 12, name: "Water tap" },
1513
+ 13: { code: 13, name: "Fuel station" },
1514
+ 14: { code: 14, name: "Electricity" },
1515
+ 15: { code: 15, name: "Bottle gas" },
1516
+ 16: { code: 16, name: "Showers" },
1517
+ 17: { code: 17, name: "Launderette" },
1518
+ 18: { code: 18, name: "Public toilets" },
1519
+ 19: { code: 19, name: "Post box" },
1520
+ 20: { code: 20, name: "Public telephone" },
1521
+ 21: { code: 21, name: "Refuse bin" },
1522
+ 22: { code: 22, name: "Car park" },
1523
+ 23: { code: 23, name: "Parking for boats and trailers" },
1524
+ 24: { code: 24, name: "Caravan site" },
1525
+ 25: { code: 25, name: "Camping site" },
1526
+ 26: { code: 26, name: "Sewerage pump-out station" },
1527
+ 27: { code: 27, name: "Emergency telephone" },
1528
+ 28: { code: 28, name: "Landing / launching place for boats" },
1529
+ 29: { code: 29, name: "Visitors mooring" },
1530
+ 30: { code: 30, name: "Scrubbing berth" },
1531
+ 31: { code: 31, name: "Picnic area" }
1389
1532
  };
1390
- var CATFOG_TABLE = {
1391
- 1: "Explosive",
1392
- 2: "Diaphone",
1393
- 3: "Siren",
1394
- 4: "Nautophone",
1395
- 5: "Bell",
1396
- 6: "Whistle",
1397
- 7: "Reed",
1398
- 8: "Gong",
1399
- 9: "Horn"
1533
+ var CATWRK_CODES = {
1534
+ 1: { code: 1, name: "Non-dangerous wreck" },
1535
+ 2: { code: 2, name: "Dangerous wreck" },
1536
+ 3: { code: 3, name: "Distributed remains of wreck" },
1537
+ 4: { code: 4, name: "Wreck showing mast/masts" },
1538
+ 5: { code: 5, name: "Wreck showing any portion of hull or superstructure" }
1400
1539
  };
1401
- var CATFOG_ABBR_TABLE = {
1402
- 1: "EXPLOS",
1403
- 2: "DIA",
1404
- 3: "SIREN",
1405
- 4: "NAUTO",
1406
- 5: "BELL",
1407
- 6: "WHIS",
1408
- 7: "REED",
1409
- 8: "GONG",
1410
- 9: "HORN"
1540
+ var COLOUR_CODES = {
1541
+ 1: { code: 1, name: "White", abbr: "W" },
1542
+ 2: { code: 2, name: "Black", abbr: "B" },
1543
+ 3: { code: 3, name: "Red", abbr: "R" },
1544
+ 4: { code: 4, name: "Green", abbr: "G" },
1545
+ 5: { code: 5, name: "Blue", abbr: "Bu" },
1546
+ 6: { code: 6, name: "Yellow", abbr: "Y" },
1547
+ 7: { code: 7, name: "Grey", abbr: "Gr" },
1548
+ 8: { code: 8, name: "Brown", abbr: "Bn" },
1549
+ 9: { code: 9, name: "Amber", abbr: "Am" },
1550
+ 10: { code: 10, name: "Violet", abbr: "Vi" },
1551
+ 11: { code: 11, name: "Orange", abbr: "Or" },
1552
+ 12: { code: 12, name: "Magenta", abbr: "Mg" },
1553
+ 13: { code: 13, name: "Pink", abbr: "Pk" }
1411
1554
  };
1412
- var TOPSHP_TABLE = {
1413
- 1: "Cone, point up",
1414
- 2: "Cone, point down",
1415
- 3: "Sphere",
1416
- 4: "2 spheres",
1417
- 5: "Cylinder",
1418
- 6: "Board",
1419
- 7: "X-shape",
1420
- 8: "Upright cross",
1421
- 9: "Cube, point up",
1422
- 10: "2 cones, point to point",
1423
- 11: "2 cones, base to base",
1424
- 12: "Rhombus",
1425
- 13: "2 cones, up",
1426
- 14: "2 cones, down",
1427
- 15: "Besom, point up",
1428
- 16: "Besom, point down",
1429
- 17: "Flag",
1430
- 18: "Sphere over rhombus",
1431
- 19: "Square",
1432
- 33: "T-shape"
1555
+ var CONDTN_CODES = {
1556
+ 1: { code: 1, name: "Under construction" },
1557
+ 2: { code: 2, name: "Ruined" },
1558
+ 3: { code: 3, name: "Under reclamation" },
1559
+ 4: { code: 4, name: "Wingless" },
1560
+ 5: { code: 5, name: "Planned construction" }
1433
1561
  };
1434
- var STATUS_TABLE = {
1435
- 1: "Permanent",
1436
- 2: "Occasional",
1437
- 3: "Recommended",
1438
- 4: "Not in use",
1439
- 5: "Periodic/intermittent",
1440
- 6: "Reserved",
1441
- 7: "Temporary",
1442
- 8: "Private",
1443
- 9: "Mandatory",
1444
- 11: "Extinguished",
1445
- 12: "Illuminated",
1446
- 13: "Historic",
1447
- 14: "Public",
1448
- 15: "Synchronized",
1449
- 16: "Watched",
1450
- 17: "Un-watched",
1451
- 18: "Existence doubtful"
1562
+ var LITCHR_CODES = {
1563
+ 1: { code: 1, name: "Fixed", abbr: "F" },
1564
+ 2: { code: 2, name: "Flashing", abbr: "Fl" },
1565
+ 3: { code: 3, name: "Long-flashing", abbr: "LFl" },
1566
+ 4: { code: 4, name: "Quick-flashing", abbr: "Q" },
1567
+ 5: { code: 5, name: "Very quick-flashing", abbr: "VQ" },
1568
+ 6: { code: 6, name: "Ultra quick-flashing", abbr: "UQ" },
1569
+ 7: { code: 7, name: "Isophase", abbr: "Iso" },
1570
+ 8: { code: 8, name: "Occulting", abbr: "Oc" },
1571
+ 9: { code: 9, name: "Interrupted quick-flashing", abbr: "IQ" },
1572
+ 10: { code: 10, name: "Interrupted very quick-flashing", abbr: "IVQ" },
1573
+ 11: { code: 11, name: "Interrupted ultra quick-flashing", abbr: "IUQ" },
1574
+ 12: { code: 12, name: "Morse", abbr: "Mo" },
1575
+ 13: { code: 13, name: "Fixed / flash", abbr: "FFl" },
1576
+ 14: { code: 14, name: "Flash / long-flash", abbr: "Fl+LFl" },
1577
+ 15: { code: 15, name: "Occulting / flash", abbr: "Oc+Fl" },
1578
+ 16: { code: 16, name: "Fixed / long-flash", abbr: "FLFl" },
1579
+ 17: { code: 17, name: "Occulting alternating", abbr: "Al.Oc" },
1580
+ 18: { code: 18, name: "Long-flash alternating", abbr: "Al.LFl" },
1581
+ 19: { code: 19, name: "Flash alternating", abbr: "Al.Fl" },
1582
+ 20: { code: 20, name: "Group alternating", abbr: "Al.Gr" },
1583
+ 25: { code: 25, name: "Quick-flash plus long-flash", abbr: "Q+LFl" },
1584
+ 26: { code: 26, name: "Very quick-flash plus long-flash", abbr: "VQ+LFl" },
1585
+ 27: { code: 27, name: "Ultra quick-flash plus long-flash", abbr: "UQ+LFl" },
1586
+ 28: { code: 28, name: "Alternating", abbr: "Al" },
1587
+ 29: { code: 29, name: "Fixed and alternating flashing", abbr: "F.Al.Fl" }
1452
1588
  };
1453
- var MARSYS_TABLE = {
1454
- 1: "IALA-A",
1455
- 2: "IALA-B"
1589
+ var MARSYS_CODES = {
1590
+ 1: { code: 1, name: "IALA A" },
1591
+ 2: { code: 2, name: "IALA B" },
1592
+ 9: { code: 9, name: "No system" },
1593
+ 10: { code: 10, name: "Other system" }
1456
1594
  };
1595
+ var NATSUR_CODES = {
1596
+ 1: { code: 1, name: "Mud" },
1597
+ 2: { code: 2, name: "Clay" },
1598
+ 3: { code: 3, name: "Silt" },
1599
+ 4: { code: 4, name: "Sand" },
1600
+ 5: { code: 5, name: "Stone" },
1601
+ 6: { code: 6, name: "Gravel" },
1602
+ 7: { code: 7, name: "Pebbles" },
1603
+ 8: { code: 8, name: "Cobbles" },
1604
+ 9: { code: 9, name: "Rock" },
1605
+ 11: { code: 11, name: "Lava" },
1606
+ 14: { code: 14, name: "Coral" },
1607
+ 17: { code: 17, name: "Shells" },
1608
+ 18: { code: 18, name: "Boulder" }
1609
+ };
1610
+ var QUASOU_CODES = {
1611
+ 1: { code: 1, name: "Depth known" },
1612
+ 2: { code: 2, name: "Depth unknown" },
1613
+ 3: { code: 3, name: "Doubtful sounding" },
1614
+ 4: { code: 4, name: "Unreliable sounding" },
1615
+ 5: { code: 5, name: "No bottom found at value shown" },
1616
+ 6: { code: 6, name: "Least depth known" },
1617
+ 7: { code: 7, name: "Least depth unknown, safe clearance at value shown" },
1618
+ 8: { code: 8, name: "Value reported (not surveyed)" },
1619
+ 9: { code: 9, name: "Value reported (not confirmed)" },
1620
+ 10: { code: 10, name: "Maintained depth" },
1621
+ 11: { code: 11, name: "Not regularly maintained" }
1622
+ };
1623
+ var RESTRN_CODES = {
1624
+ 1: { code: 1, name: "Anchoring prohibited" },
1625
+ 2: { code: 2, name: "Anchoring restricted" },
1626
+ 3: { code: 3, name: "Fishing prohibited" },
1627
+ 4: { code: 4, name: "Fishing restricted" },
1628
+ 5: { code: 5, name: "Trawling prohibited" },
1629
+ 6: { code: 6, name: "Trawling restricted" },
1630
+ 7: { code: 7, name: "Entry prohibited" },
1631
+ 8: { code: 8, name: "Entry restricted" },
1632
+ 9: { code: 9, name: "Dredging prohibited" },
1633
+ 10: { code: 10, name: "Dredging restricted" },
1634
+ 11: { code: 11, name: "Diving prohibited" },
1635
+ 12: { code: 12, name: "Diving restricted" },
1636
+ 13: { code: 13, name: "No wake" },
1637
+ 14: { code: 14, name: "Area to be avoided" },
1638
+ 15: { code: 15, name: "Construction prohibited" },
1639
+ 16: { code: 16, name: "Discharging prohibited", supplement: true, unverified: true },
1640
+ 17: { code: 17, name: "Discharging restricted", supplement: true, unverified: true },
1641
+ 18: { code: 18, name: "Industrial prohibited", supplement: true, unverified: true },
1642
+ 19: { code: 19, name: "Metallic hull vessels prohibited", supplement: true, unverified: true },
1643
+ 20: { code: 20, name: "Navigating prohibited", supplement: true, unverified: true },
1644
+ 21: { code: 21, name: "Speed restricted", supplement: true, unverified: true },
1645
+ 24: { code: 24, name: "Stopping prohibited", supplement: true, unverified: true },
1646
+ 25: { code: 25, name: "Landing prohibited", supplement: true, unverified: true }
1647
+ };
1648
+ var STATUS_CODES = {
1649
+ 1: { code: 1, name: "Permanent" },
1650
+ 2: { code: 2, name: "Occasional" },
1651
+ 3: { code: 3, name: "Recommended" },
1652
+ 4: { code: 4, name: "Disused" },
1653
+ 5: { code: 5, name: "Periodically/intermittent" },
1654
+ 6: { code: 6, name: "Reserved" },
1655
+ 7: { code: 7, name: "Temporary" },
1656
+ 8: { code: 8, name: "Private" },
1657
+ 9: { code: 9, name: "Mandatory" },
1658
+ 11: { code: 11, name: "Extinguished" },
1659
+ 12: { code: 12, name: "Illuminated" },
1660
+ 13: { code: 13, name: "Historic" },
1661
+ 14: { code: 14, name: "Public" },
1662
+ 15: { code: 15, name: "Synchronized" },
1663
+ 16: { code: 16, name: "Watched" },
1664
+ 17: { code: 17, name: "Un-watched" },
1665
+ 18: { code: 18, name: "Existence doubtful" }
1666
+ };
1667
+ var TOPSHP_CODES = {
1668
+ 1: { code: 1, name: "Cone, point up" },
1669
+ 2: { code: 2, name: "Cone, point down" },
1670
+ 3: { code: 3, name: "Sphere" },
1671
+ 4: { code: 4, name: "2 sphere" },
1672
+ 5: { code: 5, name: "Cylinder (can)" },
1673
+ 6: { code: 6, name: "Board" },
1674
+ 7: { code: 7, name: "X-shape (St. Andrew's cross)" },
1675
+ 8: { code: 8, name: "Upright cross (St. George cross)" },
1676
+ 9: { code: 9, name: "Cube, point up" },
1677
+ 10: { code: 10, name: "2 cones, point to point" },
1678
+ 11: { code: 11, name: "2 cones, base to base" },
1679
+ 12: { code: 12, name: "Rhombus (diamond)" },
1680
+ 13: { code: 13, name: "2 cones (points upward)" },
1681
+ 14: { code: 14, name: "2 cones (points downward)" },
1682
+ 15: { code: 15, name: "Besom, point up (broom or perch)" },
1683
+ 16: { code: 16, name: "Besom, point down (broom or perch)" },
1684
+ 17: { code: 17, name: "Flag" },
1685
+ 18: { code: 18, name: "Sphere over rhombus" },
1686
+ 19: { code: 19, name: "Square" },
1687
+ 20: { code: 20, name: "Rectangle, horizontal" },
1688
+ 21: { code: 21, name: "Rectangle, vertical" },
1689
+ 22: { code: 22, name: "Trapezium, up" },
1690
+ 23: { code: 23, name: "Trapezium, down" },
1691
+ 24: { code: 24, name: "Triangle, point up" },
1692
+ 25: { code: 25, name: "Triangle, point down" },
1693
+ 26: { code: 26, name: "Circle" },
1694
+ 27: { code: 27, name: "Two upright crosses (one over the other)" },
1695
+ 28: { code: 28, name: "T-shape" },
1696
+ 29: { code: 29, name: "Triangle pointing up over a circle" },
1697
+ 30: { code: 30, name: "Upright cross over a circle" },
1698
+ 31: { code: 31, name: "Rhombus over a circle" },
1699
+ 32: { code: 32, name: "Circle over a triangle pointing up" },
1700
+ 33: { code: 33, name: "Other shape (see INFORM)" }
1701
+ };
1702
+ var TRAFIC_CODES = {
1703
+ 1: { code: 1, name: "Inbound" },
1704
+ 2: { code: 2, name: "Outbound" },
1705
+ 3: { code: 3, name: "One-way" },
1706
+ 4: { code: 4, name: "Two-way" }
1707
+ };
1708
+ var WATLEV_CODES = {
1709
+ 1: { code: 1, name: "Partly submerged at high water" },
1710
+ 2: { code: 2, name: "Always dry" },
1711
+ 3: { code: 3, name: "Always under water/submerged" },
1712
+ 4: { code: 4, name: "Covers and uncovers" },
1713
+ 5: { code: 5, name: "Awash" },
1714
+ 6: { code: 6, name: "Subject to inundation or flooding" },
1715
+ 7: { code: 7, name: "Floating", supplement: true, unverified: true }
1716
+ };
1717
+ var S57_CODELISTS = /* @__PURE__ */ new Map([
1718
+ ["BOYSHP", BOYSHP_CODES],
1719
+ ["CATACH", CATACH_CODES],
1720
+ ["CATCAM", CATCAM_CODES],
1721
+ ["CATCBL", CATCBL_CODES],
1722
+ ["CATCOA", CATCOA_CODES],
1723
+ ["CATCRN", CATCRN_CODES],
1724
+ ["CATDPG", CATDPG_CODES],
1725
+ ["CATFOG", CATFOG_CODES],
1726
+ ["CATHAF", CATHAF_CODES],
1727
+ ["CATLAM", CATLAM_CODES],
1728
+ ["CATLIT", CATLIT_CODES],
1729
+ ["CATLMK", CATLMK_CODES],
1730
+ ["CATMFA", CATMFA_CODES],
1731
+ ["CATOBS", CATOBS_CODES],
1732
+ ["CATPIP", CATPIP_CODES],
1733
+ ["CATREA", CATREA_CODES],
1734
+ ["CATSCF", CATSCF_CODES],
1735
+ ["CATWRK", CATWRK_CODES],
1736
+ ["COLOUR", COLOUR_CODES],
1737
+ ["CONDTN", CONDTN_CODES],
1738
+ ["LITCHR", LITCHR_CODES],
1739
+ ["MARSYS", MARSYS_CODES],
1740
+ ["NATSUR", NATSUR_CODES],
1741
+ ["QUASOU", QUASOU_CODES],
1742
+ ["RESTRN", RESTRN_CODES],
1743
+ ["STATUS", STATUS_CODES],
1744
+ ["TOPSHP", TOPSHP_CODES],
1745
+ ["TRAFIC", TRAFIC_CODES],
1746
+ ["WATLEV", WATLEV_CODES]
1747
+ ]);
1748
+ var S57_DOMAINS = new Map(
1749
+ [...S57_CODELISTS].map(([acronym, list]) => [
1750
+ acronym,
1751
+ new Set(Object.keys(list).map(Number))
1752
+ ])
1753
+ );
1754
+ var nameTableCache = /* @__PURE__ */ new Map();
1755
+ var abbrTableCache = /* @__PURE__ */ new Map();
1756
+ function s57NameTable(acronym) {
1757
+ let cached = nameTableCache.get(acronym);
1758
+ if (cached === void 0) {
1759
+ const out = {};
1760
+ for (const c of Object.values(S57_CODELISTS.get(acronym) ?? {})) out[c.code] = c.name;
1761
+ cached = Object.freeze(out);
1762
+ nameTableCache.set(acronym, cached);
1763
+ }
1764
+ return cached;
1765
+ }
1766
+ function s57AbbrTable(acronym) {
1767
+ let cached = abbrTableCache.get(acronym);
1768
+ if (cached === void 0) {
1769
+ const out = {};
1770
+ for (const c of Object.values(S57_CODELISTS.get(acronym) ?? {})) {
1771
+ if (c.abbr !== void 0) out[c.code] = c.abbr;
1772
+ }
1773
+ cached = Object.freeze(out);
1774
+ abbrTableCache.set(acronym, cached);
1775
+ }
1776
+ return cached;
1777
+ }
1778
+
1779
+ // src/interact/decode.ts
1780
+ function nameAbbrTable(acronym) {
1781
+ const names = s57NameTable(acronym);
1782
+ const abbrs = s57AbbrTable(acronym);
1783
+ const out = {};
1784
+ for (const [code, name] of Object.entries(names)) {
1785
+ const abbr = abbrs[Number(code)];
1786
+ if (abbr !== void 0) out[Number(code)] = { name, abbr };
1787
+ }
1788
+ return out;
1789
+ }
1790
+ var COLOUR_HEX = {
1791
+ 1: "#ffffff",
1792
+ 2: "#333333",
1793
+ 3: "#ef4444",
1794
+ 4: "#22c55e",
1795
+ 5: "#3b82f6",
1796
+ 6: "#eab308",
1797
+ 7: "#9ca3af",
1798
+ 8: "#92400e",
1799
+ 9: "#f59e0b",
1800
+ 10: "#8b5cf6",
1801
+ 11: "#f97316",
1802
+ 12: "#d946ef",
1803
+ 13: "#f472b6"
1804
+ };
1805
+ var LITCHR_TABLE = nameAbbrTable("LITCHR");
1806
+ var COLOUR_TABLE = Object.fromEntries(
1807
+ Object.values(COLOUR_CODES).filter((c) => c.abbr !== void 0 && COLOUR_HEX[c.code] !== void 0).map((c) => [c.code, { name: c.name, abbr: c.abbr, hex: COLOUR_HEX[c.code] }])
1808
+ );
1809
+ var BOYSHP_TABLE = s57NameTable("BOYSHP");
1810
+ var CATLAM_TABLE = s57NameTable("CATLAM");
1811
+ var CATCAM_TABLE = s57NameTable("CATCAM");
1812
+ var CATLMK_TABLE = s57NameTable("CATLMK");
1813
+ var CATFOG_TABLE = s57NameTable("CATFOG");
1814
+ var CATFOG_ABBR_TABLE = s57AbbrTable("CATFOG");
1815
+ var CATFOG_NAUTOPHONE = Object.values(CATFOG_CODES).find(
1816
+ (c) => c.name.toLowerCase() === "nautophone"
1817
+ )?.code;
1818
+ var CATLIT_TABLE = s57NameTable("CATLIT");
1819
+ var TOPSHP_TABLE = s57NameTable("TOPSHP");
1820
+ var STATUS_TABLE = s57NameTable("STATUS");
1821
+ var MARSYS_TABLE = s57NameTable("MARSYS");
1457
1822
  var LAYER_TYPE_MAP = {
1458
1823
  BOYLAT: "Lateral Buoy",
1459
1824
  BOYCAR: "Cardinal Buoy",
@@ -1647,12 +2012,7 @@ var CATBRG_LABELS = {
1647
2012
  11: "Aqueduct",
1648
2013
  12: "Suspension bridge"
1649
2014
  };
1650
- var CONDTN_TABLE = {
1651
- 1: "Under construction",
1652
- 2: "Ruined",
1653
- 3: "Under reclamation",
1654
- 5: "Planned"
1655
- };
2015
+ var CONDTN_TABLE = s57NameTable("CONDTN");
1656
2016
  function parseFirstNum(val) {
1657
2017
  if (val == null) return null;
1658
2018
  const s = String(val);
@@ -1694,185 +2054,21 @@ function decodeBridgeProps(props) {
1694
2054
  sourceDate: props.SORDAT ? String(props.SORDAT) : null
1695
2055
  };
1696
2056
  }
1697
- var CATOBS_TABLE = {
1698
- 1: "Snag / stump",
1699
- 2: "Wellhead",
1700
- 3: "Diffuser",
1701
- 4: "Crib",
1702
- 5: "Fish haven",
1703
- 6: "Foul area",
1704
- 7: "Foul ground",
1705
- 8: "Ice boom",
1706
- 9: "Ground tackle",
1707
- 10: "Boom",
1708
- 11: "Platform"
1709
- };
1710
- var CATWRK_TABLE = {
1711
- 1: "Non-dangerous",
1712
- 2: "Dangerous",
1713
- 3: "Distributed remains",
1714
- 4: "Mast showing",
1715
- 5: "Hull showing"
1716
- };
1717
- var WATLEV_TABLE = {
1718
- 1: "Partly submerged at high water",
1719
- 2: "Always dry",
1720
- 3: "Always submerged",
1721
- 4: "Covers and uncovers",
1722
- 5: "Awash",
1723
- 6: "Subject to inundation / flooding",
1724
- 7: "Floating"
1725
- };
1726
- var CATREA_TABLE = {
1727
- 1: "Offshore safety zone",
1728
- 2: "Anchoring prohibition",
1729
- 3: "Fishing prohibition",
1730
- 4: "Nature reserve",
1731
- 5: "Bird sanctuary",
1732
- 6: "Game preserve",
1733
- 7: "Seal sanctuary",
1734
- 8: "Degaussing range",
1735
- 9: "Military area",
1736
- 10: "Historic wreck",
1737
- 12: "Navigational aid safety zone",
1738
- 14: "No wake zone",
1739
- 18: "Swimming area",
1740
- 19: "Waiting area",
1741
- 20: "Research area",
1742
- 21: "Dredging area",
1743
- 22: "Fish sanctuary",
1744
- 23: "Ecological reserve",
1745
- 24: "No discharge zone",
1746
- 25: "No anchoring area",
1747
- 26: "No fishing area",
1748
- 27: "Speed restriction zone",
1749
- 28: "To be avoided area"
1750
- };
1751
- var RESTRN_TABLE = {
1752
- 1: "Anchoring prohibited",
1753
- 2: "Anchoring restricted",
1754
- 3: "Fishing prohibited",
1755
- 4: "Fishing restricted",
1756
- 5: "Trawling prohibited",
1757
- 6: "Trawling restricted",
1758
- 7: "Entry prohibited",
1759
- 8: "Entry restricted",
1760
- 9: "Dredging prohibited",
1761
- 10: "Dredging restricted",
1762
- 11: "Diving prohibited",
1763
- 12: "Diving restricted",
1764
- 13: "No wake",
1765
- 14: "To be avoided",
1766
- 15: "Construction prohibited",
1767
- 16: "Discharging prohibited",
1768
- 17: "Discharging restricted",
1769
- 18: "Industrial prohibited",
1770
- 19: "Metallic hull vessels prohibited",
1771
- 20: "Navigating prohibited",
1772
- 21: "Speed restricted",
1773
- 24: "Stopping prohibited",
1774
- 25: "Landing prohibited"
1775
- };
1776
- var CATHAF_TABLE = {
1777
- 1: "RoRo terminal",
1778
- 3: "Ferry terminal",
1779
- 4: "Fishing harbour",
1780
- 5: "Yacht harbour / marina",
1781
- 6: "Naval base",
1782
- 7: "Tanker terminal",
1783
- 8: "Passenger terminal",
1784
- 9: "Shipyard",
1785
- 10: "Container terminal",
1786
- 11: "Bulk terminal",
1787
- 12: "Synchrolift",
1788
- 13: "Straddle carrier",
1789
- 14: "Port terminal"
1790
- };
1791
- var CATSCF_TABLE = {
1792
- 1: "Visitors' berth",
1793
- 2: "Nautical club",
1794
- 3: "Boat hoist",
1795
- 4: "Sailmaker",
1796
- 5: "Boatyard",
1797
- 6: "Public inn",
1798
- 7: "Restaurant",
1799
- 8: "Chandler",
1800
- 9: "Provisions",
1801
- 10: "Doctor",
1802
- 11: "Pharmacy",
1803
- 12: "Water tap",
1804
- 13: "Fuel station",
1805
- 14: "Electricity",
1806
- 15: "Bottle gas",
1807
- 16: "Showers",
1808
- 17: "Launderette",
1809
- 18: "Public toilets",
1810
- 19: "Post box"
1811
- };
1812
- var CATCRN_TABLE = {
1813
- 2: "Container crane / gantry",
1814
- 3: "Sheerlegs",
1815
- 4: "Travelling crane"
1816
- };
1817
- var CATACH_TABLE = {
1818
- 1: "Unrestricted anchorage",
1819
- 2: "Deep water anchorage",
1820
- 3: "Tanker anchorage",
1821
- 4: "Explosives anchorage",
1822
- 5: "Quarantine anchorage",
1823
- 6: "Sea-plane anchorage",
1824
- 7: "Small craft anchorage",
1825
- 8: "Small craft mooring area",
1826
- 9: "Anchorage for 24 hours or less"
1827
- };
1828
- var CATDPG_TABLE = {
1829
- 1: "General dumping ground",
1830
- 2: "Chemical waste",
1831
- 3: "Nuclear waste",
1832
- 4: "Explosives",
1833
- 5: "Spoil ground",
1834
- 6: "Vessel dumping ground"
1835
- };
1836
- var CATMFA_TABLE = {
1837
- 1: "Crustaceans",
1838
- 2: "Oysters / mussels",
1839
- 3: "Fish",
1840
- 4: "Seaweed",
1841
- 5: "Pearl culture"
1842
- };
1843
- var CATCBL_TABLE = {
1844
- 1: "Submarine power cable",
1845
- 2: "Submarine transmission cable",
1846
- 3: "Submarine telegraph cable",
1847
- 4: "Submarine telephone cable",
1848
- 5: "Mooring cable",
1849
- 6: "Ferry cable"
1850
- };
1851
- var CATPIP_TABLE = {
1852
- 1: "Pipeline",
1853
- 2: "Outfall pipe",
1854
- 3: "Intake pipe",
1855
- 4: "Sewer",
1856
- 5: "Bubbler system",
1857
- 6: "Supply pipe"
1858
- };
1859
- var TRAFIC_TABLE = {
1860
- 1: "Inbound",
1861
- 2: "Outbound",
1862
- 3: "One-way",
1863
- 4: "Two-way"
1864
- };
1865
- var QUASOU_TABLE = {
1866
- 1: "Depth known",
1867
- 2: "Depth unknown",
1868
- 3: "Doubtful sounding",
1869
- 4: "Unreliable sounding",
1870
- 6: "Least depth known",
1871
- 7: "Least depth unknown",
1872
- 9: "Not regularly maintained",
1873
- 10: "Maintained depth",
1874
- 11: "Not surveyed"
1875
- };
2057
+ var CATOBS_TABLE = s57NameTable("CATOBS");
2058
+ var CATWRK_TABLE = s57NameTable("CATWRK");
2059
+ var WATLEV_TABLE = s57NameTable("WATLEV");
2060
+ var CATREA_TABLE = s57NameTable("CATREA");
2061
+ var RESTRN_TABLE = s57NameTable("RESTRN");
2062
+ var CATHAF_TABLE = s57NameTable("CATHAF");
2063
+ var CATSCF_TABLE = s57NameTable("CATSCF");
2064
+ var CATCRN_TABLE = s57NameTable("CATCRN");
2065
+ var CATACH_TABLE = s57NameTable("CATACH");
2066
+ var CATDPG_TABLE = s57NameTable("CATDPG");
2067
+ var CATMFA_TABLE = s57NameTable("CATMFA");
2068
+ var CATCBL_TABLE = s57NameTable("CATCBL");
2069
+ var CATPIP_TABLE = s57NameTable("CATPIP");
2070
+ var TRAFIC_TABLE = s57NameTable("TRAFIC");
2071
+ var QUASOU_TABLE = s57NameTable("QUASOU");
1876
2072
  function decodeAreaFeatureProps(layerName, props) {
1877
2073
  const rawLayer = layerName.replace(/^enc-/, "").replace(/-(point|line|polygon|midpoint)$/, "");
1878
2074
  const parseCodeLocal = (val) => {
@@ -2335,6 +2531,15 @@ function decodeAreaFeatureProps(layerName, props) {
2335
2531
  if (st && STATUS_TABLE[st]) entries.push({ label: "Status", value: STATUS_TABLE[st] });
2336
2532
  return { type, title: title || type, properties: entries };
2337
2533
  }
2534
+ function catfogCodeFromName(lowercaseName) {
2535
+ if (!lowercaseName) return null;
2536
+ for (const entry of Object.values(CATFOG_CODES)) {
2537
+ const term = entry.name.toLowerCase();
2538
+ if (new RegExp(`\\b${term}\\b`).test(lowercaseName)) return entry.code;
2539
+ }
2540
+ if (/\bnauto\b/.test(lowercaseName)) return CATFOG_NAUTOPHONE ?? null;
2541
+ return null;
2542
+ }
2338
2543
  function parseCode(val) {
2339
2544
  if (val == null) return null;
2340
2545
  let s = String(val).trim();
@@ -2446,14 +2651,7 @@ function decodeNavAidProps(layerName, props, coords) {
2446
2651
  const sigper = props.SIGPER != null ? Number(props.SIGPER) : null;
2447
2652
  const group = parseGroup(props.SIGGRP);
2448
2653
  const nameForFog = String(props.OBJNAM ?? "").toLowerCase();
2449
- let catfogCode = null;
2450
- if (/\bwhistle\b/.test(nameForFog)) catfogCode = 6;
2451
- else if (/\bgong\b/.test(nameForFog)) catfogCode = 8;
2452
- else if (/\bbell\b/.test(nameForFog)) catfogCode = 5;
2453
- else if (/\bhorn\b/.test(nameForFog)) catfogCode = 9;
2454
- else if (/\bsiren\b/.test(nameForFog)) catfogCode = 3;
2455
- else if (/diaphone/.test(nameForFog)) catfogCode = 2;
2456
- else if (/nautophone|nauto/.test(nameForFog)) catfogCode = 4;
2654
+ let catfogCode = catfogCodeFromName(nameForFog);
2457
2655
  if (!catfogCode) catfogCode = parseCode(props.CATFOG);
2458
2656
  const fogSignal2 = catfogCode ? CATFOG_TABLE[catfogCode] ?? null : null;
2459
2657
  const fogSignalAbbr = catfogCode ? CATFOG_ABBR_TABLE[catfogCode] ?? null : null;
@@ -5607,6 +5805,31 @@ var S52_LOOKUP = {
5607
5805
  viewingGroup: 27080,
5608
5806
  scamin: 22e3
5609
5807
  },
5808
+ RADRFL: {
5809
+ objectClass: "RADRFL",
5810
+ name: "Radar Reflector",
5811
+ category: "Navigation Aids",
5812
+ displayCategory: "OTHER",
5813
+ int1Ref: "S6",
5814
+ style: { type: "symbol", paint: {}, layout: { "icon-size": 0.6, "icon-allow-overlap": true }, iconImage: "RADRFL03" },
5815
+ viewingGroup: 27080,
5816
+ scamin: 22e3
5817
+ },
5818
+ // Retroreflecting material fitted to buoys/beacons. 7,506 features across 616
5819
+ // NOAA cells (docs/validation/s52-occurrence-snapshot.json) rendered nothing
5820
+ // until this entry existed. RETRFL02 is the simplified variant — RETRFL01 is
5821
+ // the paper-chart glyph, per the reference manifest descriptions.
5822
+ // int1Ref intentionally omitted: no INT-1 citation for retroreflectors could
5823
+ // be verified against an in-repo source, and the field is optional.
5824
+ RETRFL: {
5825
+ objectClass: "RETRFL",
5826
+ name: "Retroreflector",
5827
+ category: "Navigation Aids",
5828
+ displayCategory: "OTHER",
5829
+ style: { type: "symbol", paint: {}, layout: { "icon-size": 0.6, "icon-allow-overlap": true }, iconImage: "RETRFL02" },
5830
+ viewingGroup: 27080,
5831
+ scamin: 22e3
5832
+ },
5610
5833
  NAVLNE: {
5611
5834
  objectClass: "NAVLNE",
5612
5835
  name: "Navigation Line",
@@ -21151,6 +21374,8 @@ var SYMBOL_MAP = {
21151
21374
  FOGSIG: "FOGSIG01",
21152
21375
  RTPBCN: "RTPBCN02",
21153
21376
  RDOSTA: "RTPBCN02",
21377
+ RADRFL: "RADRFL03",
21378
+ RETRFL: "RETRFL02",
21154
21379
  // Nav aids
21155
21380
  DAYMAR: "DAYTRI01",
21156
21381
  PILPNT: "PILPNT02",
@@ -21604,31 +21829,28 @@ function getLookupEntry(layerName) {
21604
21829
  return S52_LOOKUP[layerName] ?? null;
21605
21830
  }
21606
21831
 
21832
+ // src/s57/match-expression.ts
21833
+ var pairsCache = /* @__PURE__ */ new Map();
21834
+ function codeLabelPairs(acronym, kind) {
21835
+ const key = `${acronym}:${kind}`;
21836
+ let pairs = pairsCache.get(key);
21837
+ if (pairs === void 0) {
21838
+ const table = kind === "abbr" ? s57AbbrTable(acronym) : s57NameTable(acronym);
21839
+ const flat = [];
21840
+ for (const code of Object.keys(table).map(Number).sort((a, b) => a - b)) {
21841
+ flat.push(code, table[code]);
21842
+ }
21843
+ pairs = flat;
21844
+ pairsCache.set(key, pairs);
21845
+ }
21846
+ return pairs;
21847
+ }
21848
+ function s57MatchExpression(acronym, kind, input, fallback = "") {
21849
+ return ["match", input, ...codeLabelPairs(acronym, kind), fallback];
21850
+ }
21851
+
21607
21852
  // src/atlas/labels.ts
21608
- var LITCHR_ABBR = {
21609
- 1: "F",
21610
- 2: "Fl",
21611
- 3: "LFl",
21612
- 4: "Oc",
21613
- 5: "Iso",
21614
- 6: "S.Fl",
21615
- 7: "S.LFl",
21616
- 8: "Al.Oc",
21617
- 9: "Al.LFl",
21618
- 10: "Al.Fl",
21619
- 11: "Al.Gp",
21620
- 12: "Mo",
21621
- 13: "Q",
21622
- 14: "VQ",
21623
- 15: "UQ",
21624
- 16: "Al",
21625
- 17: "Al.F.Fl",
21626
- 25: "Q+LFl",
21627
- 26: "VQ+LFl",
21628
- 27: "UQ+LFl",
21629
- 28: "Al",
21630
- 29: "F.LFl"
21631
- };
21853
+ var LITCHR_ABBR = s57AbbrTable("LITCHR");
21632
21854
  var COLOUR_ABBR = {
21633
21855
  1: "W",
21634
21856
  3: "R",
@@ -22417,27 +22639,11 @@ function getLabelConfig(layerName, opts = {}) {
22417
22639
  }
22418
22640
  };
22419
22641
  case "FOGSIG": {
22420
- const catfogExpr = [
22421
- "match",
22422
- ["to-number", ["coalesce", ["get", "CATFOG"], 0], 0],
22423
- 2,
22424
- "DIA",
22425
- 3,
22426
- "SIREN",
22427
- 4,
22428
- "NAUTO",
22429
- 5,
22430
- "BELL",
22431
- 6,
22432
- "WHIS",
22433
- 7,
22434
- "REED",
22435
- 8,
22436
- "GONG",
22437
- 9,
22438
- "HORN",
22439
- ""
22440
- ];
22642
+ const catfogExpr = s57MatchExpression(
22643
+ "CATFOG",
22644
+ "abbr",
22645
+ ["to-number", ["coalesce", ["get", "CATFOG"], 0], 0]
22646
+ );
22441
22647
  return {
22442
22648
  type: "symbol",
22443
22649
  textField: catfogExpr,
@@ -25993,33 +26199,11 @@ function buildNavAidLabelExpression() {
25993
26199
  ];
25994
26200
  }
25995
26201
  function buildLightLabelExpression() {
25996
- const litchrExpr = [
25997
- "match",
25998
- ["coalesce", ["get", "LITCHR"], 0],
25999
- 1,
26000
- "F",
26001
- 2,
26002
- "Fl",
26003
- 3,
26004
- "LFl",
26005
- 4,
26006
- "Oc",
26007
- 5,
26008
- "Iso",
26009
- 6,
26010
- "S.Fl",
26011
- 7,
26012
- "S.LFl",
26013
- 12,
26014
- "Mo",
26015
- 13,
26016
- "Q",
26017
- 14,
26018
- "VQ",
26019
- 15,
26020
- "UQ",
26021
- ""
26022
- ];
26202
+ const litchrExpr = s57MatchExpression(
26203
+ "LITCHR",
26204
+ "abbr",
26205
+ ["coalesce", ["get", "LITCHR"], 0]
26206
+ );
26023
26207
  const colourExpr = colourCodeCase(
26024
26208
  [
26025
26209
  ["3", " R"],
@@ -27167,6 +27351,20 @@ var CHART_CASCADE_CODES = {
27167
27351
  Approach: ["1", "2", "3", "4"],
27168
27352
  Harbor: ["1", "2", "3", "4", "5", "6"]
27169
27353
  };
27354
+ var CHRT_STYLE_MODES = [
27355
+ "continuous",
27356
+ ...Object.keys(CHART_BAND_CODES).map(
27357
+ (band) => `chart:${band}`
27358
+ )
27359
+ ];
27360
+ function normalizeStyleMode(raw) {
27361
+ if (raw === null || raw === void 0 || raw === "") return "continuous";
27362
+ const lower = raw.toLowerCase();
27363
+ return CHRT_STYLE_MODES.find((mode) => mode.toLowerCase() === lower) ?? null;
27364
+ }
27365
+ function styleModeBand(mode) {
27366
+ return mode === "continuous" ? null : mode.slice("chart:".length);
27367
+ }
27170
27368
  function bandFilterExpression(codes) {
27171
27369
  const list = Array.isArray(codes) ? codes : [codes];
27172
27370
  if (list.length === 1) {
@@ -28495,6 +28693,7 @@ export {
28495
28693
  CHRT_ICON_EXPRESSIONS,
28496
28694
  CHRT_ICON_PREFIX,
28497
28695
  CHRT_SDF_GLYPHS,
28696
+ CHRT_STYLE_MODES,
28498
28697
  Chrt,
28499
28698
  ChrtError,
28500
28699
  DEFAULT_CLICK_TOLERANCE,
@@ -28624,6 +28823,7 @@ export {
28624
28823
  lightColor,
28625
28824
  lightFillExpression,
28626
28825
  lightsIconExpression,
28826
+ normalizeStyleMode,
28627
28827
  normalizeTheme,
28628
28828
  paginate,
28629
28829
  parseListCodes,
@@ -28644,6 +28844,7 @@ export {
28644
28844
  sanitizeCustomStyleConfig,
28645
28845
  scaleSizeValue,
28646
28846
  scaminToMinZoom,
28847
+ styleModeBand,
28647
28848
  withinBboxFilter,
28648
28849
  worldMinusBboxPolygon
28649
28850
  };