@treeviz/gedcom-parser 2.1.9 → 2.1.12

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.
Files changed (43) hide show
  1. package/dist/classes/common.d.ts.map +1 -1
  2. package/dist/classes/gedcom.d.ts +5 -0
  3. package/dist/classes/gedcom.d.ts.map +1 -1
  4. package/dist/classes/index.js +860 -464
  5. package/dist/classes/indi.d.ts.map +1 -1
  6. package/dist/classes/obje.d.ts.map +1 -1
  7. package/dist/cli/index.js +850 -454
  8. package/dist/constants/index.js +818 -448
  9. package/dist/factories/index.js +818 -448
  10. package/dist/index.js +865 -474
  11. package/dist/interfaces/indi.d.ts +1 -0
  12. package/dist/interfaces/indi.d.ts.map +1 -1
  13. package/dist/kinship-translator/index.js +818 -448
  14. package/dist/kinship-translator/kinship-translator.de.d.ts +2 -3
  15. package/dist/kinship-translator/kinship-translator.de.d.ts.map +1 -1
  16. package/dist/kinship-translator/kinship-translator.en.d.ts.map +1 -1
  17. package/dist/kinship-translator/kinship-translator.es.d.ts +2 -3
  18. package/dist/kinship-translator/kinship-translator.es.d.ts.map +1 -1
  19. package/dist/kinship-translator/kinship-translator.fr.d.ts +2 -3
  20. package/dist/kinship-translator/kinship-translator.fr.d.ts.map +1 -1
  21. package/dist/kinship-translator/kinship-translator.hu.d.ts.map +1 -1
  22. package/dist/kinship-translator/kinship-translator.ja.d.ts.map +1 -1
  23. package/dist/kinship-translator/kinship-translator.ru.d.ts +1 -1
  24. package/dist/kinship-translator/kinship-translator.ru.d.ts.map +1 -1
  25. package/dist/kinship-translator/kinship-translator.zh.d.ts.map +1 -1
  26. package/dist/kinship-translator/patterns.de.d.ts +1 -0
  27. package/dist/kinship-translator/patterns.de.d.ts.map +1 -1
  28. package/dist/kinship-translator/patterns.es.d.ts +1 -0
  29. package/dist/kinship-translator/patterns.es.d.ts.map +1 -1
  30. package/dist/kinship-translator/patterns.fr.d.ts +1 -0
  31. package/dist/kinship-translator/patterns.fr.d.ts.map +1 -1
  32. package/dist/kinship-translator/patterns.hu.d.ts.map +1 -1
  33. package/dist/kinship-translator/patterns.ru.d.ts +1 -0
  34. package/dist/kinship-translator/patterns.ru.d.ts.map +1 -1
  35. package/dist/kinship-translator/patterns.zh.d.ts.map +1 -1
  36. package/dist/utils/cache.d.ts.map +1 -1
  37. package/dist/utils/gedzip.d.ts.map +1 -1
  38. package/dist/utils/index.js +865 -474
  39. package/dist/utils/local-media.d.ts +7 -3
  40. package/dist/utils/local-media.d.ts.map +1 -1
  41. package/dist/utils/media-utils.d.ts +20 -0
  42. package/dist/utils/media-utils.d.ts.map +1 -1
  43. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -41,6 +41,82 @@ var appendGedcomTrailer = (serialized) => {
41
41
  }
42
42
  return `${trimmed}${newline}0 TRLR`;
43
43
  };
44
+
45
+ // src/utils/media-utils.ts
46
+ var getFileExtension = (filename) => {
47
+ if (!filename) {
48
+ return "";
49
+ }
50
+ if (filename.startsWith("data:")) {
51
+ const mime = filename.slice(5).split(";")[0] || "";
52
+ const subtype = (mime.split("/")[1] || "").toLowerCase();
53
+ if (subtype === "jpeg") {
54
+ return "jpg";
55
+ }
56
+ return subtype.split("+")[0] || "";
57
+ }
58
+ const withoutQuery = filename.split(/[?#]/)[0] || filename;
59
+ const match = withoutQuery.match(/\.([^.]+)$/);
60
+ return match ? match[1].toLowerCase() : "";
61
+ };
62
+ var isImageFormat = (format2) => {
63
+ if (!format2) {
64
+ return false;
65
+ }
66
+ let normalized = format2.toLowerCase().trim();
67
+ if (normalized.startsWith("data:")) {
68
+ normalized = getFileExtension(normalized);
69
+ } else if (normalized.includes("/")) {
70
+ normalized = normalized.split("/")[1]?.split("+")[0] || "";
71
+ if (normalized === "jpeg") {
72
+ normalized = "jpg";
73
+ }
74
+ }
75
+ const imageFormats = [
76
+ "jpg",
77
+ "jpeg",
78
+ "png",
79
+ "gif",
80
+ "bmp",
81
+ "webp",
82
+ "svg",
83
+ "tiff",
84
+ "tif"
85
+ ];
86
+ return imageFormats.includes(normalized);
87
+ };
88
+ var resolveObjeForm = (obje) => {
89
+ const value = obje?.get?.("FILE.FORM")?.toValue?.() ?? obje?.get?.("FORM")?.toValue?.();
90
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
91
+ };
92
+ var mediaIdValue = (obje, path) => {
93
+ const value = obje?.get?.(path)?.toValue?.();
94
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
95
+ };
96
+ var resolveObjeMediaId = (obje) => mediaIdValue(obje, "RIN") || mediaIdValue(obje, "_CLON._OID") || mediaIdValue(obje, "_MSER._LKID") || mediaIdValue(obje, "_OID") || mediaIdValue(obje, "_LKID");
97
+ var ANCESTRY_MEDIA_RETRIEVAL_PREFIX = "https://www.ancestry.com/api/media/retrieval/v2/image";
98
+ var ANCESTRY_MEDIA_QUERY = "client=trees-mediaservice&imageQuality=hq";
99
+ var ancestryMediaPath = (namespace, imgId) => `/namespaces/${namespace}/media/${imgId}?${ANCESTRY_MEDIA_QUERY}`;
100
+ var ancestryMediaFileUrl = (namespace, imgId) => {
101
+ if (!namespace || !imgId) {
102
+ return void 0;
103
+ }
104
+ return `${ANCESTRY_MEDIA_RETRIEVAL_PREFIX}${ancestryMediaPath(namespace, imgId)}`;
105
+ };
106
+ var objeXrefKey = (obje, fallback = 0) => {
107
+ if (typeof obje?.id === "string" && obje.id) {
108
+ return obje.id;
109
+ }
110
+ const value = obje?.toValue?.();
111
+ if (typeof value === "string" && value.trim()) {
112
+ return value.trim();
113
+ }
114
+ if (typeof fallback === "string" && fallback.trim()) {
115
+ return fallback.trim();
116
+ }
117
+ return `@O${fallback}@`;
118
+ };
119
+ var objeNoteValue = (obje) => mediaIdValue(obje, "FILE.NOTE") || mediaIdValue(obje, "NOTE") || "";
44
120
  var List = class _List {
45
121
  // length = 0;
46
122
  constructor(items) {
@@ -690,7 +766,7 @@ var Common = class _Common {
690
766
  this,
691
767
  options.obje.namespace,
692
768
  options.obje.override,
693
- void 0,
769
+ this.isAncestry() ? ancestryMediaFileUrl : void 0,
694
770
  options.gedcomVersion
695
771
  );
696
772
  }
@@ -1209,11 +1285,8 @@ var storeCache = {
1209
1285
  getCacheDbs().relativesOnDegreeCache.setItem(value);
1210
1286
  }
1211
1287
  }, 50),
1212
- // profilePictureCache IS persisted to IndexedDB
1288
+ // Image bytes are stored as one IndexedDB record per photo.
1213
1289
  profilePictureCache: debounce((value) => {
1214
- if (value) {
1215
- getCacheDbs().profilePictureCache.setItem(value);
1216
- }
1217
1290
  }, 100)
1218
1291
  };
1219
1292
  var resetRelativesCache = () => {
@@ -2269,65 +2342,23 @@ var isRemoteOrEmbeddedMediaUrl = (path) => {
2269
2342
  }
2270
2343
  return path.startsWith("data:") || path.startsWith("blob:") || /^https?:\/\//i.test(path);
2271
2344
  };
2272
- var resolveLocalMediaUrl = async (path) => {
2345
+ var resolveLocalMediaUrl = async (path, context) => {
2273
2346
  if (!path) {
2274
2347
  return void 0;
2275
2348
  }
2276
- if (isRemoteOrEmbeddedMediaUrl(path)) {
2349
+ if (path.startsWith("data:") || path.startsWith("blob:")) {
2277
2350
  return path;
2278
2351
  }
2279
- const resolved = await localMediaResolver?.(path);
2280
- return resolved;
2281
- };
2282
- var implemented = (type, ...args) => {
2283
- };
2284
-
2285
- // src/utils/media-utils.ts
2286
- var getFileExtension = (filename) => {
2287
- if (!filename) {
2288
- return "";
2289
- }
2290
- if (filename.startsWith("data:")) {
2291
- const mime = filename.slice(5).split(";")[0] || "";
2292
- const subtype = (mime.split("/")[1] || "").toLowerCase();
2293
- if (subtype === "jpeg") {
2294
- return "jpg";
2295
- }
2296
- return subtype.split("+")[0] || "";
2297
- }
2298
- const withoutQuery = filename.split(/[?#]/)[0] || filename;
2299
- const match = withoutQuery.match(/\.([^.]+)$/);
2300
- return match ? match[1].toLowerCase() : "";
2301
- };
2302
- var isImageFormat = (format2) => {
2303
- if (!format2) {
2304
- return false;
2352
+ const resolved = await localMediaResolver?.(path, context);
2353
+ if (resolved) {
2354
+ return resolved;
2305
2355
  }
2306
- let normalized = format2.toLowerCase().trim();
2307
- if (normalized.startsWith("data:")) {
2308
- normalized = getFileExtension(normalized);
2309
- } else if (normalized.includes("/")) {
2310
- normalized = normalized.split("/")[1]?.split("+")[0] || "";
2311
- if (normalized === "jpeg") {
2312
- normalized = "jpg";
2313
- }
2356
+ if (/^https?:\/\//i.test(path)) {
2357
+ return path;
2314
2358
  }
2315
- const imageFormats = [
2316
- "jpg",
2317
- "jpeg",
2318
- "png",
2319
- "gif",
2320
- "bmp",
2321
- "webp",
2322
- "svg",
2323
- "tiff",
2324
- "tif"
2325
- ];
2326
- return imageFormats.includes(normalized);
2359
+ return void 0;
2327
2360
  };
2328
- var resolveObjeForm = (obje) => {
2329
- const value = obje?.get?.("FILE.FORM")?.toValue?.() ?? obje?.get?.("FORM")?.toValue?.();
2330
- return typeof value === "string" && value.trim() ? value.trim() : void 0;
2361
+ var implemented = (type, ...args) => {
2331
2362
  };
2332
2363
  var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
2333
2364
  var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
@@ -3504,22 +3535,19 @@ var Indi = class extends Common {
3504
3535
  if (objeList) {
3505
3536
  await Promise.all(
3506
3537
  objeList.map(async (objeRef) => {
3507
- const key = objeRef?.id;
3538
+ const key = objeXrefKey(objeRef, 0);
3508
3539
  const obje = objeRef?.standardizeMedia(
3509
3540
  namespace,
3510
3541
  true,
3511
- (ns, iId) => {
3512
- return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
3513
- }
3542
+ ancestryMediaFileUrl
3514
3543
  );
3515
3544
  const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
3516
- const media = obje?.RIN?.toValue() || obje?.get("_OID")?.toValue();
3517
- const clone = obje?.get("_CLON._OID")?.toValue();
3518
- const mser = obje?.get("_MSER._LKID")?.toValue();
3545
+ const media = resolveObjeMediaId(obje);
3519
3546
  let url = obje?.get("FILE")?.toValue();
3520
3547
  const title = obje?.get("FILE.TITL")?.toValue() ?? obje?.get("TITL")?.toValue() ?? "";
3548
+ const note = objeNoteValue(obje);
3521
3549
  const type = resolveObjeForm(obje) ?? (url ? getFileExtension(url) : void 0) ?? "raw";
3522
- let imgId = clone || mser;
3550
+ let imgId = media;
3523
3551
  const hasEmbeddedOrLocalFile = !!url && (url.startsWith("data:") || url.startsWith("blob:") || !/^https?:\/\//i.test(url));
3524
3552
  if (!hasEmbeddedOrLocalFile && (!www || !tree || !this.id)) {
3525
3553
  return;
@@ -3555,6 +3583,7 @@ var Indi = class extends Common {
3555
3583
  imgId,
3556
3584
  person: this.id,
3557
3585
  title,
3586
+ note,
3558
3587
  url,
3559
3588
  contentType: type,
3560
3589
  downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
@@ -3593,7 +3622,7 @@ var Indi = class extends Common {
3593
3622
  return;
3594
3623
  }
3595
3624
  const obje = o;
3596
- const key = `@O${index}@`;
3625
+ const key = objeXrefKey(obje, index);
3597
3626
  obje.standardizeMedia();
3598
3627
  const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
3599
3628
  const url = obje?.get("FILE")?.toValue();
@@ -3612,6 +3641,7 @@ var Indi = class extends Common {
3612
3641
  imgId,
3613
3642
  person: this.id,
3614
3643
  title,
3644
+ note: objeNoteValue(obje),
3615
3645
  url,
3616
3646
  contentType: type,
3617
3647
  downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
@@ -3720,7 +3750,7 @@ var Indi = class extends Common {
3720
3750
  if (!obje) {
3721
3751
  return;
3722
3752
  }
3723
- const key = `@O${index}@`;
3753
+ const key = objeXrefKey(obje, index);
3724
3754
  const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
3725
3755
  const url = obje?.get("FILE")?.toValue();
3726
3756
  const title = obje?.get("TITL")?.toValue() ?? "";
@@ -3737,6 +3767,7 @@ var Indi = class extends Common {
3737
3767
  imgId,
3738
3768
  person: this.id,
3739
3769
  title,
3770
+ note: objeNoteValue(obje),
3740
3771
  url,
3741
3772
  contentType: type,
3742
3773
  downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
@@ -3760,7 +3791,7 @@ var Indi = class extends Common {
3760
3791
  if (!obje) {
3761
3792
  return;
3762
3793
  }
3763
- const key = `@O${index}@`;
3794
+ const key = objeXrefKey(obje, index);
3764
3795
  obje.standardizeMedia();
3765
3796
  const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
3766
3797
  const url = obje?.get("FILE")?.toValue();
@@ -3777,6 +3808,7 @@ var Indi = class extends Common {
3777
3808
  imgId,
3778
3809
  person: this.id,
3779
3810
  title,
3811
+ note: objeNoteValue(obje),
3780
3812
  url,
3781
3813
  contentType: type,
3782
3814
  downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
@@ -3808,7 +3840,12 @@ var Indi = class extends Common {
3808
3840
  );
3809
3841
  if (cached !== void 0) {
3810
3842
  if (cached?.file && !isRemoteOrEmbeddedMediaUrl(cached.file)) {
3811
- const resolvedCached = await resolveLocalMediaUrl(cached.file);
3843
+ const resolvedCached = await resolveLocalMediaUrl(cached.file, {
3844
+ url: cached.file,
3845
+ person: this.id,
3846
+ tree: this.getTreeId?.(),
3847
+ treeName: this.getTreeName?.()
3848
+ });
3812
3849
  if (resolvedCached && isRemoteOrEmbeddedMediaUrl(resolvedCached)) {
3813
3850
  const refreshed = { ...cached, file: resolvedCached };
3814
3851
  profilePictureCache(
@@ -3833,7 +3870,16 @@ var Indi = class extends Common {
3833
3870
  }
3834
3871
  const mediaArray = Object.values(mediaList);
3835
3872
  const toDisplayableProfile = async (media, isPrimary) => {
3836
- const resolvedFile = await resolveLocalMediaUrl(media.url);
3873
+ const resolvedFile = await resolveLocalMediaUrl(media.url, {
3874
+ url: media.url,
3875
+ id: media.id,
3876
+ imgId: media.imgId,
3877
+ key: media.key,
3878
+ contentType: media.contentType,
3879
+ person: media.person || this.id,
3880
+ tree: media.tree || this.getTreeId?.(),
3881
+ treeName: this.getTreeName?.()
3882
+ });
3837
3883
  if (!resolvedFile || !isRemoteOrEmbeddedMediaUrl(resolvedFile)) {
3838
3884
  return void 0;
3839
3885
  }
@@ -5795,7 +5841,7 @@ var KinshipTranslatorHU = class extends KinshipTranslatorBasic {
5795
5841
  }
5796
5842
  return `${hungarianOrdinalize(
5797
5843
  degree
5798
- )}unokatestv\xE9r ${level}x elt\xE1vol\xEDtva`;
5844
+ )}unokatestv\xE9r ${Math.abs(level)}x elt\xE1vol\xEDtva`;
5799
5845
  }
5800
5846
  auncle() {
5801
5847
  const level = this.pathN?.level ?? 0;
@@ -5839,14 +5885,25 @@ var KinshipTranslatorHU = class extends KinshipTranslatorBasic {
5839
5885
  return `${ordinalized ? `${ordinalized}unoka` : ""}testv\xE9r ${origPrefix.replace(/nagy$/, "")}unok\xE1ja`;
5840
5886
  }
5841
5887
  parent() {
5888
+ const level = Math.abs(this.pathN?.level ?? 0);
5889
+ if (level <= 1) {
5890
+ if (this.personN?.isMale()) {
5891
+ return "apa";
5892
+ }
5893
+ if (this.personN?.isFemale()) {
5894
+ return "anya";
5895
+ }
5896
+ return "sz\xFCl\u0151";
5897
+ }
5842
5898
  const prefix = this.directPrefix();
5899
+ const gen = prefix === "nagy" ? "" : prefix;
5843
5900
  if (this.personN?.isMale()) {
5844
- return `${prefix}apa`;
5901
+ return `${gen}nagyapa`;
5845
5902
  }
5846
5903
  if (this.personN?.isFemale()) {
5847
- return `${prefix}anya`;
5904
+ return `${gen}nagyanya`;
5848
5905
  }
5849
- return `${prefix}sz\xFCl\u0151`;
5906
+ return `${gen}nagysz\xFCl\u0151`;
5850
5907
  }
5851
5908
  child() {
5852
5909
  const level = Math.abs(this.pathN?.level ?? 0);
@@ -6040,27 +6097,30 @@ var KinshipTranslatorEn = class extends KinshipTranslatorBasic {
6040
6097
  if (!degree) {
6041
6098
  return level < 0 ? this.nibling() : this.auncle();
6042
6099
  }
6043
- return `${ordinalize(degree)} cousin ${level}x removed`;
6100
+ return `${ordinalize(degree)} cousin ${Math.abs(level)}x removed`;
6044
6101
  }
6045
6102
  auncle() {
6046
- const prefix = this.directPrefix();
6103
+ const level = Math.abs(this.pathN?.level ?? 0);
6104
+ const greats = level <= 1 ? "" : "great-".repeat(level - 1);
6047
6105
  if (this.personN?.isMale()) {
6048
- return `${prefix}uncle`;
6106
+ return `${greats}uncle`;
6049
6107
  }
6050
6108
  if (this.personN?.isFemale()) {
6051
- return `${prefix}aunt`;
6109
+ return `${greats}aunt`;
6052
6110
  }
6053
- return `${prefix}auncle`;
6111
+ return greats ? `${greats}uncle/${greats}aunt` : "uncle/aunt";
6054
6112
  }
6055
6113
  nibling() {
6056
- const prefix = this.directPrefix();
6114
+ const level = Math.abs(this.pathN?.level ?? 0);
6115
+ const greats = level <= 2 ? "" : "great-".repeat(level - 2);
6116
+ const grand = level <= 1 ? "" : "grand";
6057
6117
  if (this.personN?.isMale()) {
6058
- return `${prefix}nephew`;
6118
+ return `${greats}${grand}nephew`;
6059
6119
  }
6060
6120
  if (this.personN?.isFemale()) {
6061
- return `${prefix}niece`;
6121
+ return `${greats}${grand}niece`;
6062
6122
  }
6063
- return `${prefix}nibling`;
6123
+ return greats || grand ? `${greats}${grand}nephew/${greats}${grand}niece` : "nephew/niece";
6064
6124
  }
6065
6125
  parent() {
6066
6126
  const prefix = this.directPrefix();
@@ -6188,45 +6248,64 @@ var KinshipTranslatorEn = class extends KinshipTranslatorBasic {
6188
6248
  };
6189
6249
 
6190
6250
  // src/kinship-translator/patterns.de.ts
6251
+ var parentRelationsDe = {
6252
+ step: "Stief",
6253
+ foster: "Pflege",
6254
+ adopted: "Adoptiv"
6255
+ };
6191
6256
  var InLawsDe = {
6192
- "Ehepartner von (kind|tochter|sohn)": "Schwiegerkind",
6193
- "Ehefrau von (kind|tochter|sohn)": "Schwiegertochter",
6194
- "Ehemann von (kind|tochter|sohn)": "Schwiegersohn",
6195
- "mutter des (Ehepartner|Ehefrau|Ehemann)s": "Schwiegermutter",
6196
- "vater des (Ehepartner|Ehefrau|Ehemann)s": "Schwiegervater",
6197
- "elternteil des (Ehepartner|Ehefrau|Ehemann)s": "Schwiegerelternteil",
6198
- "Ehefrau von (Halb)?(geschwister|schwester|bruder)": "Schw\xE4gerin",
6199
- "Ehemann von (Halb)?(geschwister|schwester|bruder)": "Schwager",
6200
- "Ehepartner von (Halb)?(geschwister|schwester|bruder)": "Schwager/Schw\xE4gerin",
6201
- "(Halb)?schwester des (Ehepartner|Ehefrau|Ehemann)s": "Schw\xE4gerin",
6202
- "(Halb)?bruder des (Ehepartner|Ehefrau|Ehemann)s": "Schwager",
6203
- "(Halb)?geschwister des (Ehepartner|Ehefrau|Ehemann)s": "Schwager/Schw\xE4gerin"
6257
+ "Ehepartner von (Kind|Tochter|Sohn)": "Schwiegerkind",
6258
+ "Ehefrau von (Kind|Tochter|Sohn)": "Schwiegertochter",
6259
+ "Ehemann von (Kind|Tochter|Sohn)": "Schwiegersohn",
6260
+ "Mutter (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwiegermutter",
6261
+ "Vater (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwiegervater",
6262
+ "Elternteil (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwiegerelternteil",
6263
+ "Ehefrau von (Halb)?-?(Geschwister|Schwester|Bruder)": "Schw\xE4gerin",
6264
+ "Ehemann von (Halb)?-?(Geschwister|Schwester|Bruder)": "Schwager",
6265
+ "Ehepartner von (Halb)?-?(Geschwister|Schwester|Bruder)": "Schwager/Schw\xE4gerin",
6266
+ "(Halb)?-?(Schwester|schwester) (des Ehepartners|des Ehemanns|der Ehefrau)": "Schw\xE4gerin",
6267
+ "(Halb)?-?(Bruder|bruder) (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwager",
6268
+ "(Halb)?-?(Geschwister|geschwister) (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwager/Schw\xE4gerin"
6204
6269
  };
6205
6270
 
6206
6271
  // src/kinship-translator/kinship-translator.de.ts
6207
- var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
6208
- directPrefix() {
6209
- const level = Math.abs(this.pathN?.level ?? 0);
6210
- if (level <= 1) {
6211
- return "";
6212
- }
6213
- if (level === 2) {
6214
- return "Gro\xDF";
6215
- }
6216
- if (level === 3) {
6217
- return "Urgro\xDF";
6218
- }
6219
- return `Ur${level - 2}-gro\xDF`;
6272
+ var sexOf = (person) => {
6273
+ if (person?.isMale?.()) {
6274
+ return "m";
6275
+ }
6276
+ if (person?.isFemale?.()) {
6277
+ return "f";
6278
+ }
6279
+ return "n";
6280
+ };
6281
+ var pick = (sex, male, female, neutral) => {
6282
+ if (sex === "m") {
6283
+ return male;
6284
+ }
6285
+ if (sex === "f") {
6286
+ return female;
6287
+ }
6288
+ return neutral;
6289
+ };
6290
+ var ur = (count) => count > 0 ? "Ur".repeat(count) : "";
6291
+ var genitiveArticle = (spouseType) => {
6292
+ if (spouseType === "Ehefrau") {
6293
+ return `der ${spouseType}`;
6220
6294
  }
6295
+ return `des ${spouseType}s`;
6296
+ };
6297
+ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
6221
6298
  indirect() {
6222
6299
  let degree = Math.abs(this.pathN?.degree ?? 0);
6223
6300
  if (degree > 0) {
6224
6301
  degree = degree - 1;
6225
6302
  }
6226
- if (degree === 1) {
6227
- return `Cousin`;
6303
+ const sex = sexOf(this.personN);
6304
+ const cousin = pick(sex, "Cousin", "Cousine", "Cousin/Cousine");
6305
+ if (degree <= 1) {
6306
+ return cousin;
6228
6307
  }
6229
- return `Cousin ${degree}. Grades`;
6308
+ return `${cousin} ${degree}. Grades`;
6230
6309
  }
6231
6310
  removal() {
6232
6311
  const level = this.pathN?.level ?? 0;
@@ -6237,101 +6316,101 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
6237
6316
  if (!degree) {
6238
6317
  return level < 0 ? this.nibling() : this.auncle();
6239
6318
  }
6240
- return `Cousin ${degree}. Grades ${Math.abs(level)}\xD7 entfernt`;
6319
+ return `${this.indirect()} ${Math.abs(level)}\xD7 entfernt`;
6241
6320
  }
6242
6321
  auncle() {
6243
- const prefix = this.directPrefix();
6244
- if (this.personN?.isMale()) {
6245
- return `${prefix}onkel`;
6246
- }
6247
- if (this.personN?.isFemale()) {
6248
- return `${prefix}tante`;
6322
+ const level = Math.abs(this.pathN?.level ?? 0);
6323
+ const sex = sexOf(this.personN);
6324
+ if (level <= 1) {
6325
+ return pick(sex, "Onkel", "Tante", "Onkel/Tante");
6249
6326
  }
6250
- return `${prefix}onkel/tante`;
6327
+ const prefix = `${ur(level - 2)}Gro\xDF`;
6328
+ return pick(
6329
+ sex,
6330
+ `${prefix}onkel`,
6331
+ `${prefix}tante`,
6332
+ `${prefix}onkel/tante`
6333
+ );
6251
6334
  }
6252
6335
  nibling() {
6253
- const prefix = this.directPrefix();
6254
- if (this.personN?.isMale()) {
6255
- return `${prefix}neffe`;
6256
- }
6257
- if (this.personN?.isFemale()) {
6258
- return `${prefix}nichte`;
6336
+ const level = Math.abs(this.pathN?.level ?? 0);
6337
+ const sex = sexOf(this.personN);
6338
+ if (level <= 1) {
6339
+ return pick(sex, "Neffe", "Nichte", "Neffe/Nichte");
6259
6340
  }
6260
- return `${prefix}neffe/nichte`;
6341
+ const prefix = `${ur(level - 2)}Gro\xDF`;
6342
+ return pick(
6343
+ sex,
6344
+ `${prefix}neffe`,
6345
+ `${prefix}nichte`,
6346
+ `${prefix}neffe/nichte`
6347
+ );
6261
6348
  }
6262
6349
  parent() {
6263
- const prefix = this.directPrefix();
6264
- if (this.personN?.isMale()) {
6265
- return `${prefix}vater`;
6266
- }
6267
- if (this.personN?.isFemale()) {
6268
- return `${prefix}mutter`;
6350
+ const level = Math.abs(this.pathN?.level ?? 0);
6351
+ const sex = sexOf(this.personN);
6352
+ if (level <= 1) {
6353
+ return pick(sex, "Vater", "Mutter", "Elternteil");
6269
6354
  }
6270
- return `${prefix}elternteil`;
6355
+ const prefix = `${ur(level - 2)}Gro\xDF`;
6356
+ return pick(
6357
+ sex,
6358
+ `${prefix}vater`,
6359
+ `${prefix}mutter`,
6360
+ `${prefix}elternteil`
6361
+ );
6271
6362
  }
6272
6363
  child() {
6273
- const prefix = this.directPrefix();
6274
- if (this.personN?.isMale()) {
6275
- return `${prefix}sohn`;
6276
- }
6277
- if (this.personN?.isFemale()) {
6278
- return `${prefix}tochter`;
6364
+ const level = Math.abs(this.pathN?.level ?? 0);
6365
+ const sex = sexOf(this.personN);
6366
+ if (level <= 1) {
6367
+ return pick(sex, "Sohn", "Tochter", "Kind");
6279
6368
  }
6280
- return `${prefix}kind`;
6369
+ const prefix = ur(level - 2);
6370
+ return pick(
6371
+ sex,
6372
+ `${prefix}Enkel`,
6373
+ `${prefix}Enkelin`,
6374
+ `${prefix}Enkelkind`
6375
+ );
6281
6376
  }
6282
6377
  sibling() {
6283
- if (this.personN?.isMale()) {
6284
- return "bruder";
6285
- }
6286
- if (this.personN?.isFemale()) {
6287
- return "schwester";
6288
- }
6289
- return "geschwister";
6378
+ return pick(sexOf(this.personN), "Bruder", "Schwester", "Geschwister");
6290
6379
  }
6291
6380
  halfBlood(relation) {
6292
6381
  if (!relation || !this.isHalfBlood) {
6293
6382
  return relation ?? "";
6294
6383
  }
6295
- if (/^[A-ZÄÖÜ]/.test(relation) || /[-\s]/.test(relation)) {
6384
+ if (/[\s-]/.test(relation) || /^(Groß|Ur)/.test(relation)) {
6296
6385
  return `Halb-${relation}`;
6297
6386
  }
6298
- return `Halb${relation}`;
6387
+ return `Halb${relation.charAt(0).toLowerCase()}${relation.slice(1)}`;
6299
6388
  }
6300
6389
  spouse() {
6301
- if (this.personN?.isMale()) {
6302
- return "Ehemann";
6303
- }
6304
- if (this.personN?.isFemale()) {
6305
- return "Ehefrau";
6306
- }
6307
- return "Ehepartner";
6390
+ return pick(sexOf(this.personN), "Ehemann", "Ehefrau", "Ehepartner");
6308
6391
  }
6309
6392
  ofSpouse(relation) {
6310
6393
  if (!relation) {
6311
6394
  return "";
6312
6395
  }
6313
- const spouse = this.path?.[1].indi;
6314
- let spouseType = "Ehepartner";
6315
- if (spouse?.isMale()) {
6316
- spouseType = "Ehemann";
6317
- }
6318
- if (spouse?.isFemale()) {
6319
- spouseType = "Ehefrau";
6320
- }
6321
- return `${relation} des ${spouseType}s`;
6396
+ const spouseType = pick(
6397
+ sexOf(this.path?.[1].indi),
6398
+ "Ehemann",
6399
+ "Ehefrau",
6400
+ "Ehepartner"
6401
+ );
6402
+ return `${relation} ${genitiveArticle(spouseType)}`;
6322
6403
  }
6323
6404
  spouseOf(relation) {
6324
6405
  if (!relation) {
6325
6406
  return "";
6326
6407
  }
6327
- const spouse = this.path?.[this.path.length - 1].indi;
6328
- let spouseType = "Ehepartner";
6329
- if (spouse?.isMale()) {
6330
- spouseType = "Ehemann";
6331
- }
6332
- if (spouse?.isFemale()) {
6333
- spouseType = "Ehefrau";
6334
- }
6408
+ const spouseType = pick(
6409
+ sexOf(this.path?.[this.path.length - 1].indi),
6410
+ "Ehemann",
6411
+ "Ehefrau",
6412
+ "Ehepartner"
6413
+ );
6335
6414
  return `${spouseType} von ${relation}`;
6336
6415
  }
6337
6416
  of(relation) {
@@ -6349,8 +6428,8 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
6349
6428
  if (!name || !relation) {
6350
6429
  return relation ?? "";
6351
6430
  }
6352
- if (relation.includes(" des ") || relation.includes(" von ")) {
6353
- return relation.replace(/ (des|von) /, ` $1 ${name}s `);
6431
+ if (relation.includes(" des ") || relation.includes(" der ") || relation.includes(" von ")) {
6432
+ return relation.replace(/ (des|der|von) /, ` $1 ${name}s `);
6354
6433
  }
6355
6434
  return `${name}s ${relation}`;
6356
6435
  }
@@ -6380,50 +6459,82 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
6380
6459
  if (!relation || !this.pathN?.relation) {
6381
6460
  return relation ?? "";
6382
6461
  }
6383
- return `${this.pathN.relation} ${relation}`;
6462
+ const prefix = parentRelationsDe[this.pathN.relation];
6463
+ if (!prefix) {
6464
+ return relation;
6465
+ }
6466
+ if (prefix.endsWith("-") || prefix.endsWith(" ")) {
6467
+ return `${prefix}${relation}`;
6468
+ }
6469
+ return `${prefix}${relation.charAt(0).toLowerCase()}${relation.slice(1)}`;
6384
6470
  }
6385
6471
  };
6386
6472
 
6387
6473
  // src/kinship-translator/patterns.fr.ts
6474
+ var parentRelationsFr = {
6475
+ step: "step",
6476
+ foster: "foster",
6477
+ adopted: "adopted"
6478
+ };
6388
6479
  var InLawsFr = {
6389
6480
  "conjoint de (enfant|fille|fils)": "beau-fils/belle-fille",
6390
6481
  "\xE9pouse de (enfant|fille|fils)": "belle-fille",
6391
6482
  "mari de (enfant|fille|fils)": "gendre",
6392
- "m\xE8re du (conjoint|\xE9pouse|mari)": "belle-m\xE8re",
6393
- "p\xE8re du (conjoint|\xE9pouse|mari)": "beau-p\xE8re",
6394
- "parent du (conjoint|\xE9pouse|mari)": "beau-parent",
6483
+ "m\xE8re (du mari|du conjoint|de l'\xE9pouse)": "belle-m\xE8re",
6484
+ "p\xE8re (du mari|du conjoint|de l'\xE9pouse)": "beau-p\xE8re",
6485
+ "parent (du mari|du conjoint|de l'\xE9pouse)": "beau-parent",
6395
6486
  "\xE9pouse de (demi-)?(fr\xE8re/s\u0153ur|s\u0153ur|fr\xE8re)": "belle-s\u0153ur",
6396
6487
  "mari de (demi-)?(fr\xE8re/s\u0153ur|s\u0153ur|fr\xE8re)": "beau-fr\xE8re",
6397
6488
  "conjoint de (demi-)?(fr\xE8re/s\u0153ur|s\u0153ur|fr\xE8re)": "beau-fr\xE8re/belle-s\u0153ur",
6398
- "(demi-)?s\u0153ur du (conjoint|\xE9pouse|mari)": "belle-s\u0153ur",
6399
- "(demi-)?fr\xE8re du (conjoint|\xE9pouse|mari)": "beau-fr\xE8re",
6400
- "(demi-)?fr\xE8re/s\u0153ur du (conjoint|\xE9pouse|mari)": "beau-fr\xE8re/belle-s\u0153ur"
6489
+ "(demi-)?s\u0153ur (du mari|du conjoint|de l'\xE9pouse)": "belle-s\u0153ur",
6490
+ "(demi-)?fr\xE8re (du mari|du conjoint|de l'\xE9pouse)": "beau-fr\xE8re",
6491
+ "(demi-)?fr\xE8re/s\u0153ur (du mari|du conjoint|de l'\xE9pouse)": "beau-fr\xE8re/belle-s\u0153ur"
6401
6492
  };
6402
6493
 
6403
6494
  // src/kinship-translator/kinship-translator.fr.ts
6404
- var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
6405
- directPrefix() {
6406
- const level = Math.abs(this.pathN?.level ?? 0);
6407
- if (level <= 1) {
6408
- return "";
6409
- }
6410
- if (level === 2) {
6411
- return "grand-";
6412
- }
6413
- if (level === 3) {
6414
- return "arri\xE8re-grand-";
6415
- }
6416
- return `arri\xE8re${level - 2}-grand-`;
6495
+ var sexOf2 = (person) => {
6496
+ if (person?.isMale?.()) {
6497
+ return "m";
6498
+ }
6499
+ if (person?.isFemale?.()) {
6500
+ return "f";
6501
+ }
6502
+ return "n";
6503
+ };
6504
+ var pick2 = (sex, male, female, neutral) => {
6505
+ if (sex === "m") {
6506
+ return male;
6507
+ }
6508
+ if (sex === "f") {
6509
+ return female;
6417
6510
  }
6511
+ return neutral;
6512
+ };
6513
+ var arriere = (count) => count > 0 ? "arri\xE8re-".repeat(count) : "";
6514
+ var frenchOrdinal = (n) => n === 1 ? "1er" : `${n}e`;
6515
+ var isFeminineRelation = (relation) => /mère|fille|sœur|tante|nièce|cousine|épouse/.test(relation);
6516
+ var ofSpousePrep = (spouseType) => {
6517
+ if (spouseType === "\xE9pouse") {
6518
+ return "de l'";
6519
+ }
6520
+ return "du ";
6521
+ };
6522
+ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
6418
6523
  indirect() {
6419
6524
  let degree = Math.abs(this.pathN?.degree ?? 0);
6420
6525
  if (degree > 0) {
6421
6526
  degree = degree - 1;
6422
6527
  }
6423
- if (degree === 1) {
6424
- return `cousin`;
6425
- }
6426
- return `cousin au ${ordinalize(degree)} degr\xE9`;
6528
+ const cousin = pick2(
6529
+ sexOf2(this.personN),
6530
+ "cousin",
6531
+ "cousine",
6532
+ "cousin/cousine"
6533
+ );
6534
+ if (degree <= 1) {
6535
+ return cousin;
6536
+ }
6537
+ return `${cousin} au ${frenchOrdinal(degree)} degr\xE9`;
6427
6538
  }
6428
6539
  removal() {
6429
6540
  const level = this.pathN?.level ?? 0;
@@ -6434,56 +6545,57 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
6434
6545
  if (!degree) {
6435
6546
  return level < 0 ? this.nibling() : this.auncle();
6436
6547
  }
6437
- return `cousin au ${ordinalize(degree)} degr\xE9 ${Math.abs(level)}\xD7 \xE9loign\xE9`;
6548
+ return `${this.indirect()} ${Math.abs(level)}\xD7 \xE9loign\xE9`;
6438
6549
  }
6439
6550
  auncle() {
6440
- const prefix = this.directPrefix();
6441
- if (this.personN?.isMale()) {
6442
- return `${prefix}oncle`;
6443
- }
6444
- if (this.personN?.isFemale()) {
6445
- return `${prefix}tante`;
6551
+ const level = Math.abs(this.pathN?.level ?? 0);
6552
+ const sex = sexOf2(this.personN);
6553
+ const base = pick2(sex, "oncle", "tante", "oncle/tante");
6554
+ if (level <= 1) {
6555
+ return base;
6446
6556
  }
6447
- return `${prefix}oncle/tante`;
6557
+ const grands = pick2(
6558
+ sex,
6559
+ "grand-oncle",
6560
+ "grand-tante",
6561
+ "grand-oncle/tante"
6562
+ );
6563
+ return `${arriere(level - 2)}${grands}`;
6448
6564
  }
6449
6565
  nibling() {
6450
- const prefix = this.directPrefix();
6451
- if (this.personN?.isMale()) {
6452
- return `${prefix}neveu`;
6453
- }
6454
- if (this.personN?.isFemale()) {
6455
- return `${prefix}ni\xE8ce`;
6566
+ const level = Math.abs(this.pathN?.level ?? 0);
6567
+ const sex = sexOf2(this.personN);
6568
+ if (level <= 1) {
6569
+ return pick2(sex, "neveu", "ni\xE8ce", "neveu/ni\xE8ce");
6456
6570
  }
6457
- return `${prefix}neveu/ni\xE8ce`;
6571
+ const grands = pick2(
6572
+ sex,
6573
+ "grand-neveu",
6574
+ "grande-ni\xE8ce",
6575
+ "grand-neveu/grande-ni\xE8ce"
6576
+ );
6577
+ return `${arriere(level - 2)}${grands}`;
6458
6578
  }
6459
6579
  parent() {
6460
- const prefix = this.directPrefix();
6461
- if (this.personN?.isMale()) {
6462
- return `${prefix}p\xE8re`;
6463
- }
6464
- if (this.personN?.isFemale()) {
6465
- return `${prefix}m\xE8re`;
6580
+ const level = Math.abs(this.pathN?.level ?? 0);
6581
+ const sex = sexOf2(this.personN);
6582
+ if (level <= 1) {
6583
+ return pick2(sex, "p\xE8re", "m\xE8re", "parent");
6466
6584
  }
6467
- return `${prefix}parent`;
6585
+ const grands = pick2(sex, "grand-p\xE8re", "grand-m\xE8re", "grand-parent");
6586
+ return `${arriere(level - 2)}${grands}`;
6468
6587
  }
6469
6588
  child() {
6470
- const prefix = this.directPrefix();
6471
- if (this.personN?.isMale()) {
6472
- return `${prefix}fils`;
6473
- }
6474
- if (this.personN?.isFemale()) {
6475
- return `${prefix}fille`;
6589
+ const level = Math.abs(this.pathN?.level ?? 0);
6590
+ const sex = sexOf2(this.personN);
6591
+ if (level <= 1) {
6592
+ return pick2(sex, "fils", "fille", "enfant");
6476
6593
  }
6477
- return `${prefix}enfant`;
6594
+ const petits = pick2(sex, "petit-fils", "petite-fille", "petit-enfant");
6595
+ return `${arriere(level - 2)}${petits}`;
6478
6596
  }
6479
6597
  sibling() {
6480
- if (this.personN?.isMale()) {
6481
- return "fr\xE8re";
6482
- }
6483
- if (this.personN?.isFemale()) {
6484
- return "s\u0153ur";
6485
- }
6486
- return "fr\xE8re/s\u0153ur";
6598
+ return pick2(sexOf2(this.personN), "fr\xE8re", "s\u0153ur", "fr\xE8re/s\u0153ur");
6487
6599
  }
6488
6600
  halfBlood(relation) {
6489
6601
  if (!relation || !this.isHalfBlood) {
@@ -6492,40 +6604,30 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
6492
6604
  return `demi-${relation}`;
6493
6605
  }
6494
6606
  spouse() {
6495
- if (this.personN?.isMale()) {
6496
- return "mari";
6497
- }
6498
- if (this.personN?.isFemale()) {
6499
- return "\xE9pouse";
6500
- }
6501
- return "conjoint";
6607
+ return pick2(sexOf2(this.personN), "mari", "\xE9pouse", "conjoint");
6502
6608
  }
6503
6609
  ofSpouse(relation) {
6504
6610
  if (!relation) {
6505
6611
  return "";
6506
6612
  }
6507
- const spouse = this.path?.[1].indi;
6508
- let spouseType = "conjoint";
6509
- if (spouse?.isMale()) {
6510
- spouseType = "mari";
6511
- }
6512
- if (spouse?.isFemale()) {
6513
- spouseType = "\xE9pouse";
6514
- }
6515
- return `${relation} du ${spouseType}`;
6613
+ const spouseType = pick2(
6614
+ sexOf2(this.path?.[1].indi),
6615
+ "mari",
6616
+ "\xE9pouse",
6617
+ "conjoint"
6618
+ );
6619
+ return `${relation} ${ofSpousePrep(spouseType)}${spouseType}`;
6516
6620
  }
6517
6621
  spouseOf(relation) {
6518
6622
  if (!relation) {
6519
6623
  return "";
6520
6624
  }
6521
- const spouse = this.path?.[this.path.length - 1].indi;
6522
- let spouseType = "conjoint";
6523
- if (spouse?.isMale()) {
6524
- spouseType = "mari";
6525
- }
6526
- if (spouse?.isFemale()) {
6527
- spouseType = "\xE9pouse";
6528
- }
6625
+ const spouseType = pick2(
6626
+ sexOf2(this.path?.[this.path.length - 1].indi),
6627
+ "mari",
6628
+ "\xE9pouse",
6629
+ "conjoint"
6630
+ );
6529
6631
  return `${spouseType} de ${relation}`;
6530
6632
  }
6531
6633
  of(relation) {
@@ -6546,6 +6648,9 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
6546
6648
  if (relation.includes(" du ") || relation.includes(" de ")) {
6547
6649
  return relation.replace(/ (du|de) /, ` $1 ${name} `);
6548
6650
  }
6651
+ if (relation.includes(" de l'")) {
6652
+ return relation.replace(" de l'", ` de ${name} l'`);
6653
+ }
6549
6654
  return `${relation} de ${name}`;
6550
6655
  }
6551
6656
  inLaw(relation) {
@@ -6574,50 +6679,118 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
6574
6679
  if (!relation || !this.pathN?.relation) {
6575
6680
  return relation ?? "";
6576
6681
  }
6577
- return `${this.pathN.relation} ${relation}`;
6682
+ const kind = parentRelationsFr[this.pathN.relation];
6683
+ if (!kind) {
6684
+ return relation;
6685
+ }
6686
+ if (kind === "step") {
6687
+ return `${isFeminineRelation(relation) ? "belle-" : "beau-"}${relation}`;
6688
+ }
6689
+ if (kind === "adopted") {
6690
+ return `${relation} ${isFeminineRelation(relation) ? "adoptive" : "adoptif"}`;
6691
+ }
6692
+ if (kind === "foster") {
6693
+ return `${relation} d'accueil`;
6694
+ }
6695
+ return relation;
6578
6696
  }
6579
6697
  };
6580
6698
 
6581
6699
  // src/kinship-translator/patterns.es.ts
6700
+ var parentRelationsEs = {
6701
+ step: {
6702
+ padre: "padrastro",
6703
+ madre: "madrastra",
6704
+ hijo: "hijastro",
6705
+ hija: "hijastra",
6706
+ hermano: "hermanastro",
6707
+ hermana: "hermanastra",
6708
+ abuelo: "abuelastro",
6709
+ abuela: "abuelastra"
6710
+ }
6711
+ };
6582
6712
  var InLawsEs = {
6583
6713
  "c\xF3nyuge de (hijo/hija|hija|hijo)": "yerno/nuera",
6584
6714
  "esposa de (hijo/hija|hija|hijo)": "nuera",
6585
6715
  "esposo de (hijo/hija|hija|hijo)": "yerno",
6586
- "madre del (c\xF3nyuge|esposa|esposo)": "suegra",
6587
- "padre del (c\xF3nyuge|esposa|esposo)": "suegro",
6588
- "padre/madre del (c\xF3nyuge|esposa|esposo)": "suegro/suegra",
6716
+ "madre (del c\xF3nyuge|del esposo|de la esposa)": "suegra",
6717
+ "padre (del c\xF3nyuge|del esposo|de la esposa)": "suegro",
6718
+ "padre/madre (del c\xF3nyuge|del esposo|de la esposa)": "suegro/suegra",
6589
6719
  "esposa de (medio |media |medio/a )?(hermano/hermana|hermana|hermano)": "cu\xF1ada",
6590
6720
  "esposo de (medio |media |medio/a )?(hermano/hermana|hermana|hermano)": "cu\xF1ado",
6591
6721
  "c\xF3nyuge de (medio |media |medio/a )?(hermano/hermana|hermana|hermano)": "cu\xF1ado/cu\xF1ada",
6592
- "(medio |media |medio/a )?hermana del (c\xF3nyuge|esposa|esposo)": "cu\xF1ada",
6593
- "(medio |media |medio/a )?hermano del (c\xF3nyuge|esposa|esposo)": "cu\xF1ado",
6594
- "(medio |media |medio/a )?hermano/hermana del (c\xF3nyuge|esposa|esposo)": "cu\xF1ado/cu\xF1ada"
6722
+ "(medio |media |medio/a )?hermana (del c\xF3nyuge|del esposo|de la esposa)": "cu\xF1ada",
6723
+ "(medio |media |medio/a )?hermano (del c\xF3nyuge|del esposo|de la esposa)": "cu\xF1ado",
6724
+ "(medio |media |medio/a )?hermano/hermana (del c\xF3nyuge|del esposo|de la esposa)": "cu\xF1ado/cu\xF1ada"
6595
6725
  };
6596
6726
 
6597
6727
  // src/kinship-translator/kinship-translator.es.ts
6598
- var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6599
- directPrefix() {
6600
- const level = Math.abs(this.pathN?.level ?? 0);
6601
- if (level <= 1) {
6602
- return "";
6603
- }
6604
- if (level === 2) {
6605
- return "bisabuel";
6606
- }
6607
- if (level === 3) {
6608
- return "tatarabuel";
6609
- }
6610
- return `t\xE1tara${level - 2}-abuel`;
6728
+ var sexOf3 = (person) => {
6729
+ if (person?.isMale?.()) {
6730
+ return "m";
6731
+ }
6732
+ if (person?.isFemale?.()) {
6733
+ return "f";
6734
+ }
6735
+ return "n";
6736
+ };
6737
+ var pick3 = (sex, male, female, neutral) => {
6738
+ if (sex === "m") {
6739
+ return male;
6611
6740
  }
6741
+ if (sex === "f") {
6742
+ return female;
6743
+ }
6744
+ return neutral;
6745
+ };
6746
+ var SPANISH_ORDINALS_M = [
6747
+ "",
6748
+ "",
6749
+ "segundo",
6750
+ "tercero",
6751
+ "cuarto",
6752
+ "quinto",
6753
+ "sexto",
6754
+ "s\xE9ptimo",
6755
+ "octavo",
6756
+ "noveno",
6757
+ "d\xE9cimo"
6758
+ ];
6759
+ var SPANISH_ORDINALS_F = [
6760
+ "",
6761
+ "",
6762
+ "segunda",
6763
+ "tercera",
6764
+ "cuarta",
6765
+ "quinta",
6766
+ "sexta",
6767
+ "s\xE9ptima",
6768
+ "octava",
6769
+ "novena",
6770
+ "d\xE9cima"
6771
+ ];
6772
+ var spanishOrdinal = (n, sex) => {
6773
+ const list = sex === "f" ? SPANISH_ORDINALS_F : SPANISH_ORDINALS_M;
6774
+ return list[n] ?? `${n}.\xBA`;
6775
+ };
6776
+ var ofSpousePrep2 = (spouseType) => {
6777
+ if (spouseType === "esposa") {
6778
+ return "de la ";
6779
+ }
6780
+ return "del ";
6781
+ };
6782
+ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6612
6783
  indirect() {
6613
6784
  let degree = Math.abs(this.pathN?.degree ?? 0);
6614
6785
  if (degree > 0) {
6615
6786
  degree = degree - 1;
6616
6787
  }
6617
- if (degree === 1) {
6618
- return `primo`;
6788
+ const sex = sexOf3(this.personN);
6789
+ const cousin = pick3(sex, "primo", "prima", "primo/prima");
6790
+ if (degree <= 1) {
6791
+ return cousin;
6619
6792
  }
6620
- return `primo ${ordinalize(degree)}`;
6793
+ return `${cousin} ${spanishOrdinal(degree, sex)}`;
6621
6794
  }
6622
6795
  removal() {
6623
6796
  const level = this.pathN?.level ?? 0;
@@ -6628,56 +6801,133 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6628
6801
  if (!degree) {
6629
6802
  return level < 0 ? this.nibling() : this.auncle();
6630
6803
  }
6631
- return `primo ${ordinalize(degree)} ${Math.abs(level)}\xD7 separado`;
6804
+ return `${this.indirect()} ${Math.abs(level)}\xD7 separado`;
6632
6805
  }
6633
6806
  auncle() {
6634
- const prefix = this.directPrefix();
6635
- if (this.personN?.isMale()) {
6636
- return `${prefix}t\xEDo`;
6807
+ const level = Math.abs(this.pathN?.level ?? 0);
6808
+ const sex = sexOf3(this.personN);
6809
+ if (level <= 1) {
6810
+ return pick3(sex, "t\xEDo", "t\xEDa", "t\xEDo/t\xEDa");
6637
6811
  }
6638
- if (this.personN?.isFemale()) {
6639
- return `${prefix}t\xEDa`;
6812
+ if (level === 2) {
6813
+ return pick3(sex, "t\xEDo abuelo", "t\xEDa abuela", "t\xEDo/t\xEDa abuelo");
6640
6814
  }
6641
- return `${prefix}t\xEDo/t\xEDa`;
6815
+ if (level === 3) {
6816
+ return pick3(
6817
+ sex,
6818
+ "t\xEDo bisabuelo",
6819
+ "t\xEDa bisabuela",
6820
+ "t\xEDo/t\xEDa bisabuelo"
6821
+ );
6822
+ }
6823
+ return pick3(
6824
+ sex,
6825
+ `t\xEDo abuelo (${level - 1}.\xBA)`,
6826
+ `t\xEDa abuela (${level - 1}.\xAA)`,
6827
+ `t\xEDo/t\xEDa abuelo (${level - 1}.\xBA)`
6828
+ );
6642
6829
  }
6643
6830
  nibling() {
6644
- const prefix = this.directPrefix();
6645
- if (this.personN?.isMale()) {
6646
- return `${prefix}sobrino`;
6831
+ const level = Math.abs(this.pathN?.level ?? 0);
6832
+ const sex = sexOf3(this.personN);
6833
+ if (level <= 1) {
6834
+ return pick3(sex, "sobrino", "sobrina", "sobrino/sobrina");
6647
6835
  }
6648
- if (this.personN?.isFemale()) {
6649
- return `${prefix}sobrina`;
6836
+ if (level === 2) {
6837
+ return pick3(
6838
+ sex,
6839
+ "sobrino nieto",
6840
+ "sobrina nieta",
6841
+ "sobrino/sobrina nieto"
6842
+ );
6650
6843
  }
6651
- return `${prefix}sobrino/sobrina`;
6844
+ if (level === 3) {
6845
+ return pick3(
6846
+ sex,
6847
+ "sobrino bisnieto",
6848
+ "sobrina bisnieta",
6849
+ "sobrino/sobrina bisnieto"
6850
+ );
6851
+ }
6852
+ return pick3(
6853
+ sex,
6854
+ `sobrino nieto (${level - 1}.\xBA)`,
6855
+ `sobrina nieta (${level - 1}.\xAA)`,
6856
+ `sobrino/sobrina nieto (${level - 1}.\xBA)`
6857
+ );
6652
6858
  }
6653
6859
  parent() {
6654
- const prefix = this.directPrefix();
6655
- if (this.personN?.isMale()) {
6656
- return `${prefix}padre`;
6860
+ const level = Math.abs(this.pathN?.level ?? 0);
6861
+ const sex = sexOf3(this.personN);
6862
+ if (level <= 1) {
6863
+ return pick3(sex, "padre", "madre", "padre/madre");
6657
6864
  }
6658
- if (this.personN?.isFemale()) {
6659
- return `${prefix}madre`;
6865
+ if (level === 2) {
6866
+ return pick3(sex, "abuelo", "abuela", "abuelo/abuela");
6867
+ }
6868
+ if (level === 3) {
6869
+ return pick3(sex, "bisabuelo", "bisabuela", "bisabuelo/bisabuela");
6660
6870
  }
6661
- return `${prefix}padre/madre`;
6871
+ if (level === 4) {
6872
+ return pick3(
6873
+ sex,
6874
+ "tatarabuelo",
6875
+ "tatarabuela",
6876
+ "tatarabuelo/tatarabuela"
6877
+ );
6878
+ }
6879
+ if (level === 5) {
6880
+ return pick3(
6881
+ sex,
6882
+ "trastatarabuelo",
6883
+ "trastatarabuela",
6884
+ "trastatarabuelo/trastatarabuela"
6885
+ );
6886
+ }
6887
+ return pick3(
6888
+ sex,
6889
+ `abuelo (${level}.\xBA)`,
6890
+ `abuela (${level}.\xAA)`,
6891
+ `abuelo/abuela (${level}.\xBA)`
6892
+ );
6662
6893
  }
6663
6894
  child() {
6664
- const prefix = this.directPrefix();
6665
- if (this.personN?.isMale()) {
6666
- return `${prefix}hijo`;
6895
+ const level = Math.abs(this.pathN?.level ?? 0);
6896
+ const sex = sexOf3(this.personN);
6897
+ if (level <= 1) {
6898
+ return pick3(sex, "hijo", "hija", "hijo/hija");
6667
6899
  }
6668
- if (this.personN?.isFemale()) {
6669
- return `${prefix}hija`;
6900
+ if (level === 2) {
6901
+ return pick3(sex, "nieto", "nieta", "nieto/nieta");
6670
6902
  }
6671
- return `${prefix}hijo/hija`;
6672
- }
6673
- sibling() {
6674
- if (this.personN?.isMale()) {
6675
- return "hermano";
6903
+ if (level === 3) {
6904
+ return pick3(sex, "bisnieto", "bisnieta", "bisnieto/bisnieta");
6676
6905
  }
6677
- if (this.personN?.isFemale()) {
6678
- return "hermana";
6906
+ if (level === 4) {
6907
+ return pick3(
6908
+ sex,
6909
+ "tataranieto",
6910
+ "tataranieta",
6911
+ "tataranieto/tataranieta"
6912
+ );
6679
6913
  }
6680
- return "hermano/hermana";
6914
+ if (level === 5) {
6915
+ return pick3(
6916
+ sex,
6917
+ "trastataranieto",
6918
+ "trastataranieta",
6919
+ "trastataranieto/trastataranieta"
6920
+ );
6921
+ }
6922
+ return pick3(
6923
+ sex,
6924
+ `nieto (${level}.\xBA)`,
6925
+ `nieta (${level}.\xAA)`,
6926
+ `nieto/nieta (${level}.\xBA)`
6927
+ );
6928
+ }
6929
+ sibling() {
6930
+ return pick3(sexOf3(this.personN), "hermano", "hermana", "hermano/hermana");
6681
6931
  }
6682
6932
  halfBlood(relation) {
6683
6933
  if (!relation || !this.isHalfBlood) {
@@ -6692,40 +6942,30 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6692
6942
  return `medio/a ${relation}`;
6693
6943
  }
6694
6944
  spouse() {
6695
- if (this.personN?.isMale()) {
6696
- return "esposo";
6697
- }
6698
- if (this.personN?.isFemale()) {
6699
- return "esposa";
6700
- }
6701
- return "c\xF3nyuge";
6945
+ return pick3(sexOf3(this.personN), "esposo", "esposa", "c\xF3nyuge");
6702
6946
  }
6703
6947
  ofSpouse(relation) {
6704
6948
  if (!relation) {
6705
6949
  return "";
6706
6950
  }
6707
- const spouse = this.path?.[1].indi;
6708
- let spouseType = "c\xF3nyuge";
6709
- if (spouse?.isMale()) {
6710
- spouseType = "esposo";
6711
- }
6712
- if (spouse?.isFemale()) {
6713
- spouseType = "esposa";
6714
- }
6715
- return `${relation} del ${spouseType}`;
6951
+ const spouseType = pick3(
6952
+ sexOf3(this.path?.[1].indi),
6953
+ "esposo",
6954
+ "esposa",
6955
+ "c\xF3nyuge"
6956
+ );
6957
+ return `${relation} ${ofSpousePrep2(spouseType)}${spouseType}`;
6716
6958
  }
6717
6959
  spouseOf(relation) {
6718
6960
  if (!relation) {
6719
6961
  return "";
6720
6962
  }
6721
- const spouse = this.path?.[this.path.length - 1].indi;
6722
- let spouseType = "c\xF3nyuge";
6723
- if (spouse?.isMale()) {
6724
- spouseType = "esposo";
6725
- }
6726
- if (spouse?.isFemale()) {
6727
- spouseType = "esposa";
6728
- }
6963
+ const spouseType = pick3(
6964
+ sexOf3(this.path?.[this.path.length - 1].indi),
6965
+ "esposo",
6966
+ "esposa",
6967
+ "c\xF3nyuge"
6968
+ );
6729
6969
  return `${spouseType} de ${relation}`;
6730
6970
  }
6731
6971
  of(relation) {
@@ -6743,8 +6983,8 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6743
6983
  if (!name || !relation) {
6744
6984
  return relation ?? "";
6745
6985
  }
6746
- if (relation.includes(" del ") || relation.includes(" de ")) {
6747
- return relation.replace(/ (del|de) /, ` $1 ${name} `);
6986
+ if (relation.includes(" del ") || relation.includes(" de la ") || relation.includes(" de ")) {
6987
+ return relation.replace(/ (del|de la|de) /, ` $1 ${name} `);
6748
6988
  }
6749
6989
  return `${relation} de ${name}`;
6750
6990
  }
@@ -6774,7 +7014,20 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6774
7014
  if (!relation || !this.pathN?.relation) {
6775
7015
  return relation ?? "";
6776
7016
  }
6777
- return `${this.pathN.relation} ${relation}`;
7017
+ const mapped = parentRelationsEs[this.pathN.relation]?.[relation];
7018
+ if (mapped) {
7019
+ return mapped;
7020
+ }
7021
+ if (this.pathN.relation === "step") {
7022
+ return `${relation} pol\xEDtico`;
7023
+ }
7024
+ if (this.pathN.relation === "adopted") {
7025
+ return `${relation} adoptivo`;
7026
+ }
7027
+ if (this.pathN.relation === "foster") {
7028
+ return `${relation} de acogida`;
7029
+ }
7030
+ return relation;
6778
7031
  }
6779
7032
  };
6780
7033
 
@@ -6783,15 +7036,35 @@ var InLawsRu = {
6783
7036
  "\u0441\u0443\u043F\u0440\u0443\u0433(?:\u0430)? (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u0437\u044F\u0442\u044C/\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
6784
7037
  "\u0436\u0435\u043D\u0430 (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
6785
7038
  "\u043C\u0443\u0436 (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u0437\u044F\u0442\u044C",
6786
- "\u043C\u0430\u0442\u044C (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0451\u0449\u0430",
6787
- "\u043E\u0442\u0435\u0446 (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0435\u0441\u0442\u044C",
6788
- "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0435\u0441\u0442\u044C/\u0442\u0451\u0449\u0430",
7039
+ "\u043C\u0430\u0442\u044C \u0436\u0435\u043D\u044B": "\u0442\u0451\u0449\u0430",
7040
+ "\u043C\u0430\u0442\u044C \u043C\u0443\u0436\u0430": "\u0441\u0432\u0435\u043A\u0440\u043E\u0432\u044C",
7041
+ "\u043C\u0430\u0442\u044C \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0442\u0451\u0449\u0430/\u0441\u0432\u0435\u043A\u0440\u043E\u0432\u044C",
7042
+ "\u043E\u0442\u0435\u0446 \u0436\u0435\u043D\u044B": "\u0442\u0435\u0441\u0442\u044C",
7043
+ "\u043E\u0442\u0435\u0446 \u043C\u0443\u0436\u0430": "\u0441\u0432\u0451\u043A\u043E\u0440",
7044
+ "\u043E\u0442\u0435\u0446 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0442\u0435\u0441\u0442\u044C/\u0441\u0432\u0451\u043A\u043E\u0440",
7045
+ "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C \u0436\u0435\u043D\u044B": "\u0442\u0435\u0441\u0442\u044C/\u0442\u0451\u0449\u0430",
7046
+ "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C \u043C\u0443\u0436\u0430": "\u0441\u0432\u0451\u043A\u043E\u0440/\u0441\u0432\u0435\u043A\u0440\u043E\u0432\u044C",
7047
+ "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0442\u0435\u0441\u0442\u044C/\u0442\u0451\u0449\u0430",
6789
7048
  "\u0436\u0435\u043D\u0430 (\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?(\u0431\u0440\u0430\u0442\u0430|\u0441\u0435\u0441\u0442\u0440\u044B|\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430)": "\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
6790
7049
  "\u043C\u0443\u0436 (\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?(\u0431\u0440\u0430\u0442\u0430|\u0441\u0435\u0441\u0442\u0440\u044B|\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430)": "\u0437\u044F\u0442\u044C",
6791
7050
  "\u0441\u0443\u043F\u0440\u0443\u0433(?:\u0430)? (\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?(\u0431\u0440\u0430\u0442\u0430|\u0441\u0435\u0441\u0442\u0440\u044B|\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430)": "\u0437\u044F\u0442\u044C/\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
6792
- "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
6793
- "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0448\u0443\u0440\u0438\u043D",
6794
- "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0448\u0443\u0440\u0438\u043D/\u0437\u043E\u043B\u043E\u0432\u043A\u0430"
7051
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 \u0436\u0435\u043D\u044B": "\u0441\u0432\u043E\u044F\u0447\u0435\u043D\u0438\u0446\u0430",
7052
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 \u043C\u0443\u0436\u0430": "\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
7053
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0441\u0432\u043E\u044F\u0447\u0435\u043D\u0438\u0446\u0430/\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
7054
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 \u0436\u0435\u043D\u044B": "\u0448\u0443\u0440\u0438\u043D",
7055
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 \u043C\u0443\u0436\u0430": "\u0434\u0435\u0432\u0435\u0440\u044C",
7056
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0448\u0443\u0440\u0438\u043D/\u0434\u0435\u0432\u0435\u0440\u044C",
7057
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 \u0436\u0435\u043D\u044B": "\u0448\u0443\u0440\u0438\u043D/\u0441\u0432\u043E\u044F\u0447\u0435\u043D\u0438\u0446\u0430",
7058
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 \u043C\u0443\u0436\u0430": "\u0434\u0435\u0432\u0435\u0440\u044C/\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
7059
+ "(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0448\u0443\u0440\u0438\u043D/\u0437\u043E\u043B\u043E\u0432\u043A\u0430"
7060
+ };
7061
+ var parentRelationsRu = {
7062
+ step: {
7063
+ \u043E\u0442\u0435\u0446: "\u043E\u0442\u0447\u0438\u043C",
7064
+ \u043C\u0430\u0442\u044C: "\u043C\u0430\u0447\u0435\u0445\u0430",
7065
+ \u0441\u044B\u043D: "\u043F\u0430\u0441\u044B\u043D\u043E\u043A",
7066
+ \u0434\u043E\u0447\u044C: "\u043F\u0430\u0434\u0447\u0435\u0440\u0438\u0446\u0430"
7067
+ }
6795
7068
  };
6796
7069
 
6797
7070
  // src/kinship-translator/kinship-translator.ru.ts
@@ -6822,7 +7095,7 @@ var cousinWord = (degree, sex) => {
6822
7095
  return `${stem}\u044B\u0439 \u0431\u0440\u0430\u0442/\u0441\u0435\u0441\u0442\u0440\u0430`;
6823
7096
  };
6824
7097
  var praRepeat = (count) => count > 0 ? "\u043F\u0440\u0430".repeat(count) : "";
6825
- var sexOf = (person) => {
7098
+ var sexOf4 = (person) => {
6826
7099
  if (person?.isMale?.()) {
6827
7100
  return "m";
6828
7101
  }
@@ -6837,7 +7110,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6837
7110
  if (degree > 0) {
6838
7111
  degree = degree - 1;
6839
7112
  }
6840
- return cousinWord(degree, sexOf(this.personN));
7113
+ return cousinWord(degree, sexOf4(this.personN));
6841
7114
  }
6842
7115
  removal() {
6843
7116
  const level = this.pathN?.level ?? 0;
@@ -6849,35 +7122,53 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6849
7122
  return level < 0 ? this.nibling() : this.auncle();
6850
7123
  }
6851
7124
  const removed = Math.abs(level);
6852
- return `${cousinWord(degree, sexOf(this.personN))} (${removed}\xD7 \u0447\u0435\u0440\u0435\u0437 \u043F\u043E\u043A\u043E\u043B\u0435\u043D\u0438\u0435)`;
7125
+ return `${cousinWord(degree, sexOf4(this.personN))} (${removed}\xD7 \u0447\u0435\u0440\u0435\u0437 \u043F\u043E\u043A\u043E\u043B\u0435\u043D\u0438\u0435)`;
6853
7126
  }
6854
7127
  auncle() {
6855
7128
  const level = Math.abs(this.pathN?.level ?? 0);
6856
- const pra = praRepeat(Math.max(0, level - 2));
6857
- const sex = sexOf(this.personN);
7129
+ const sex = sexOf4(this.personN);
7130
+ if (level <= 1) {
7131
+ if (sex === "m") {
7132
+ return "\u0434\u044F\u0434\u044F";
7133
+ }
7134
+ if (sex === "f") {
7135
+ return "\u0442\u0451\u0442\u044F";
7136
+ }
7137
+ return "\u0434\u044F\u0434\u044F/\u0442\u0451\u0442\u044F";
7138
+ }
7139
+ const pra = praRepeat(level - 2);
6858
7140
  if (sex === "m") {
6859
- return `${pra}\u0434\u044F\u0434\u044F`;
7141
+ return `\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D\u044B\u0439 ${pra}\u0434\u0435\u0434`;
6860
7142
  }
6861
7143
  if (sex === "f") {
6862
- return `${pra}\u0442\u0451\u0442\u044F`;
7144
+ return `\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D\u0430\u044F ${pra}\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
6863
7145
  }
6864
- return `${pra}\u0434\u044F\u0434\u044F/\u0442\u0451\u0442\u044F`;
7146
+ return `\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D\u044B\u0439 ${pra}\u0434\u0435\u0434/\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
6865
7147
  }
6866
7148
  nibling() {
6867
7149
  const level = Math.abs(this.pathN?.level ?? 0);
6868
- const pra = praRepeat(Math.max(0, level - 2));
6869
- const sex = sexOf(this.personN);
7150
+ const sex = sexOf4(this.personN);
7151
+ if (level <= 1) {
7152
+ if (sex === "m") {
7153
+ return "\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A";
7154
+ }
7155
+ if (sex === "f") {
7156
+ return "\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430";
7157
+ }
7158
+ return "\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430";
7159
+ }
7160
+ const pra = praRepeat(level - 2);
6870
7161
  if (sex === "m") {
6871
- return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A`;
7162
+ return `${pra}\u0432\u043D\u0443\u0447\u0430\u0442\u044B\u0439 \u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A`;
6872
7163
  }
6873
7164
  if (sex === "f") {
6874
- return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
7165
+ return `${pra}\u0432\u043D\u0443\u0447\u0430\u0442\u0430\u044F \u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
6875
7166
  }
6876
- return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
7167
+ return `${pra}\u0432\u043D\u0443\u0447\u0430\u0442\u044B\u0439 \u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
6877
7168
  }
6878
7169
  parent() {
6879
7170
  const level = Math.abs(this.pathN?.level ?? 0);
6880
- const sex = sexOf(this.personN);
7171
+ const sex = sexOf4(this.personN);
6881
7172
  if (level <= 1) {
6882
7173
  if (sex === "m") {
6883
7174
  return "\u043E\u0442\u0435\u0446";
@@ -6907,7 +7198,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6907
7198
  }
6908
7199
  child() {
6909
7200
  const level = Math.abs(this.pathN?.level ?? 0);
6910
- const sex = sexOf(this.personN);
7201
+ const sex = sexOf4(this.personN);
6911
7202
  if (level <= 1) {
6912
7203
  if (sex === "m") {
6913
7204
  return "\u0441\u044B\u043D";
@@ -6936,14 +7227,14 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6936
7227
  return `${pra}\u0432\u043D\u0443\u043A/\u0432\u043D\u0443\u0447\u043A\u0430`;
6937
7228
  }
6938
7229
  sibling() {
6939
- const sex = sexOf(this.personN);
7230
+ const sex = sexOf4(this.personN);
6940
7231
  if (sex === "m") {
6941
7232
  return "\u0431\u0440\u0430\u0442";
6942
7233
  }
6943
7234
  if (sex === "f") {
6944
7235
  return "\u0441\u0435\u0441\u0442\u0440\u0430";
6945
7236
  }
6946
- return "\u0441\u0438\u0431\u043B\u0438\u043D\u0433";
7237
+ return "\u0431\u0440\u0430\u0442/\u0441\u0435\u0441\u0442\u0440\u0430";
6947
7238
  }
6948
7239
  halfBlood(relation) {
6949
7240
  if (!relation || !this.isHalfBlood) {
@@ -6957,7 +7248,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6957
7248
  return `\u0441\u0432\u043E\u0434\u043D\u044B\u0439 ${relation}`;
6958
7249
  }
6959
7250
  spouse() {
6960
- const sex = sexOf(this.personN);
7251
+ const sex = sexOf4(this.personN);
6961
7252
  if (sex === "m") {
6962
7253
  return "\u043C\u0443\u0436";
6963
7254
  }
@@ -6971,7 +7262,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6971
7262
  return "";
6972
7263
  }
6973
7264
  const spouse = this.path?.[1].indi;
6974
- const sex = sexOf(spouse);
7265
+ const sex = sexOf4(spouse);
6975
7266
  const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
6976
7267
  return `${relation} ${toGenitive(spouseType)}`;
6977
7268
  }
@@ -6980,7 +7271,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6980
7271
  return "";
6981
7272
  }
6982
7273
  const spouse = this.path?.[this.path.length - 1].indi;
6983
- const sex = sexOf(spouse);
7274
+ const sex = sexOf4(spouse);
6984
7275
  const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
6985
7276
  return `${spouseType} ${toGenitive(relation)}`;
6986
7277
  }
@@ -7017,7 +7308,22 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
7017
7308
  if (!relation || !this.pathN?.relation) {
7018
7309
  return relation ?? "";
7019
7310
  }
7020
- return `${this.pathN.relation} ${relation}`;
7311
+ const mapped = parentRelationsRu[this.pathN.relation]?.[relation];
7312
+ if (mapped) {
7313
+ return mapped;
7314
+ }
7315
+ if (this.pathN.relation === "step") {
7316
+ return `\u043D\u0435\u0440\u043E\u0434\u043D\u043E\u0439 ${relation}`;
7317
+ }
7318
+ if (this.pathN.relation === "adopted") {
7319
+ return /сестра|дочь|мать|тётя|бабушка|жена|племянница|внучка/.test(
7320
+ relation
7321
+ ) ? `\u043F\u0440\u0438\u0451\u043C\u043D\u0430\u044F ${relation}` : `\u043F\u0440\u0438\u0451\u043C\u043D\u044B\u0439 ${relation}`;
7322
+ }
7323
+ if (this.pathN.relation === "foster") {
7324
+ return `\u043F\u0440\u0438\u0451\u043C\u043D\u044B\u0439 ${relation}`;
7325
+ }
7326
+ return relation;
7021
7327
  }
7022
7328
  };
7023
7329
 
@@ -7041,7 +7347,7 @@ var InLawsJa = {
7041
7347
  };
7042
7348
 
7043
7349
  // src/kinship-translator/kinship-translator.ja.ts
7044
- var sexOf2 = (person) => {
7350
+ var sexOf5 = (person) => {
7045
7351
  if (person?.isMale?.()) {
7046
7352
  return "m";
7047
7353
  }
@@ -7050,7 +7356,7 @@ var sexOf2 = (person) => {
7050
7356
  }
7051
7357
  return "n";
7052
7358
  };
7053
- var pick = (sex, male, female, neutral) => {
7359
+ var pick4 = (sex, male, female, neutral) => {
7054
7360
  if (sex === "m") {
7055
7361
  return male;
7056
7362
  }
@@ -7063,18 +7369,18 @@ var lineal = (level, sex, kind) => {
7063
7369
  const L = Math.max(1, level);
7064
7370
  if (kind === "asc") {
7065
7371
  if (L <= 1) {
7066
- return pick(sex, "\u7236", "\u6BCD", "\u89AA");
7372
+ return pick4(sex, "\u7236", "\u6BCD", "\u89AA");
7067
7373
  }
7068
7374
  if (L === 2) {
7069
- return pick(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
7375
+ return pick4(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
7070
7376
  }
7071
7377
  if (L === 3) {
7072
- return pick(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
7378
+ return pick4(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
7073
7379
  }
7074
7380
  if (L === 4) {
7075
- return pick(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
7381
+ return pick4(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
7076
7382
  }
7077
- return pick(
7383
+ return pick4(
7078
7384
  sex,
7079
7385
  `${L - 1}\u4E16\u306E\u7956\u7236`,
7080
7386
  `${L - 1}\u4E16\u306E\u7956\u6BCD`,
@@ -7082,7 +7388,7 @@ var lineal = (level, sex, kind) => {
7082
7388
  );
7083
7389
  }
7084
7390
  if (L <= 1) {
7085
- return pick(sex, "\u606F\u5B50", "\u5A18", "\u5B50");
7391
+ return pick4(sex, "\u606F\u5B50", "\u5A18", "\u5B50");
7086
7392
  }
7087
7393
  if (L === 2) {
7088
7394
  return "\u5B6B";
@@ -7129,52 +7435,52 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
7129
7435
  }
7130
7436
  auncle() {
7131
7437
  const level = Math.abs(this.pathN?.level ?? 0);
7132
- const sex = sexOf2(this.personN);
7133
- if (level <= 2) {
7134
- return pick(sex, "\u304A\u3058", "\u304A\u3070", "\u304A\u3058/\u304A\u3070");
7438
+ const sex = sexOf5(this.personN);
7439
+ if (level <= 1) {
7440
+ return pick4(sex, "\u304A\u3058", "\u304A\u3070", "\u304A\u3058/\u304A\u3070");
7135
7441
  }
7136
- if (level === 3) {
7137
- return pick(sex, "\u5927\u304A\u3058", "\u5927\u304A\u3070", "\u5927\u304A\u3058/\u5927\u304A\u3070");
7442
+ if (level === 2) {
7443
+ return pick4(sex, "\u5927\u304A\u3058", "\u5927\u304A\u3070", "\u5927\u304A\u3058/\u5927\u304A\u3070");
7138
7444
  }
7139
- return pick(
7445
+ return pick4(
7140
7446
  sex,
7141
- `${level - 2}\u4EE3\u524D\u306E\u304A\u3058`,
7142
- `${level - 2}\u4EE3\u524D\u306E\u304A\u3070`,
7143
- `${level - 2}\u4EE3\u524D\u306E\u304A\u3058/\u304A\u3070`
7447
+ `${level - 1}\u4EE3\u524D\u306E\u304A\u3058`,
7448
+ `${level - 1}\u4EE3\u524D\u306E\u304A\u3070`,
7449
+ `${level - 1}\u4EE3\u524D\u306E\u304A\u3058/\u304A\u3070`
7144
7450
  );
7145
7451
  }
7146
7452
  nibling() {
7147
7453
  const level = Math.abs(this.pathN?.level ?? 0);
7148
- const sex = sexOf2(this.personN);
7149
- if (level <= 2) {
7150
- return pick(sex, "\u7525", "\u59EA", "\u7525/\u59EA");
7454
+ const sex = sexOf5(this.personN);
7455
+ if (level <= 1) {
7456
+ return pick4(sex, "\u7525", "\u59EA", "\u7525/\u59EA");
7151
7457
  }
7152
- if (level === 3) {
7153
- return pick(sex, "\u5927\u7525", "\u5927\u59EA", "\u5927\u7525/\u5927\u59EA");
7458
+ if (level === 2) {
7459
+ return pick4(sex, "\u5927\u7525", "\u5927\u59EA", "\u5927\u7525/\u5927\u59EA");
7154
7460
  }
7155
- return pick(
7461
+ return pick4(
7156
7462
  sex,
7157
- `${level - 2}\u4EE3\u4E0B\u306E\u7525`,
7158
- `${level - 2}\u4EE3\u4E0B\u306E\u59EA`,
7159
- `${level - 2}\u4EE3\u4E0B\u306E\u7525/\u59EA`
7463
+ `${level - 1}\u4EE3\u4E0B\u306E\u7525`,
7464
+ `${level - 1}\u4EE3\u4E0B\u306E\u59EA`,
7465
+ `${level - 1}\u4EE3\u4E0B\u306E\u7525/\u59EA`
7160
7466
  );
7161
7467
  }
7162
7468
  parent() {
7163
7469
  return lineal(
7164
7470
  Math.abs(this.pathN?.level ?? 0),
7165
- sexOf2(this.personN),
7471
+ sexOf5(this.personN),
7166
7472
  "asc"
7167
7473
  );
7168
7474
  }
7169
7475
  child() {
7170
7476
  return lineal(
7171
7477
  Math.abs(this.pathN?.level ?? 0),
7172
- sexOf2(this.personN),
7478
+ sexOf5(this.personN),
7173
7479
  "desc"
7174
7480
  );
7175
7481
  }
7176
7482
  sibling() {
7177
- return pick(sexOf2(this.personN), "\u5144\u5F1F", "\u59C9\u59B9", "\u5144\u5F1F\u59C9\u59B9");
7483
+ return pick4(sexOf5(this.personN), "\u5144\u5F1F", "\u59C9\u59B9", "\u5144\u5F1F\u59C9\u59B9");
7178
7484
  }
7179
7485
  halfBlood(relation) {
7180
7486
  if (!relation || !this.isHalfBlood) {
@@ -7183,14 +7489,14 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
7183
7489
  return `\u7570\u7236\u6BCD\u306E${relation}`;
7184
7490
  }
7185
7491
  spouse() {
7186
- return pick(sexOf2(this.personN), "\u592B", "\u59BB", "\u914D\u5076\u8005");
7492
+ return pick4(sexOf5(this.personN), "\u592B", "\u59BB", "\u914D\u5076\u8005");
7187
7493
  }
7188
7494
  ofSpouse(relation) {
7189
7495
  if (!relation) {
7190
7496
  return "";
7191
7497
  }
7192
- const spouseType = pick(
7193
- sexOf2(this.path?.[1].indi),
7498
+ const spouseType = pick4(
7499
+ sexOf5(this.path?.[1].indi),
7194
7500
  "\u592B",
7195
7501
  "\u59BB",
7196
7502
  "\u914D\u5076\u8005"
@@ -7202,7 +7508,7 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
7202
7508
  return "";
7203
7509
  }
7204
7510
  const spouse = this.path?.[this.path.length - 1].indi;
7205
- const spouseType = pick(sexOf2(spouse), "\u592B", "\u59BB", "\u914D\u5076\u8005");
7511
+ const spouseType = pick4(sexOf5(spouse), "\u592B", "\u59BB", "\u914D\u5076\u8005");
7206
7512
  return `${relation}\u306E${spouseType}`;
7207
7513
  }
7208
7514
  of(relation) {
@@ -7238,7 +7544,28 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
7238
7544
  if (!relation || !this.pathN?.relation) {
7239
7545
  return relation ?? "";
7240
7546
  }
7241
- return `${this.pathN.relation}\u306E${relation}`;
7547
+ if (this.pathN.relation === "step") {
7548
+ if (relation === "\u7236") {
7549
+ return "\u7EE7\u7236";
7550
+ }
7551
+ if (relation === "\u6BCD") {
7552
+ return "\u7D99\u6BCD";
7553
+ }
7554
+ if (relation === "\u606F\u5B50") {
7555
+ return "\u7D99\u5B50";
7556
+ }
7557
+ if (relation === "\u5A18") {
7558
+ return "\u7D99\u5A18";
7559
+ }
7560
+ return `\u7D99${relation}`;
7561
+ }
7562
+ if (this.pathN.relation === "adopted") {
7563
+ return `\u990A\u5B50\u306E${relation}`;
7564
+ }
7565
+ if (this.pathN.relation === "foster") {
7566
+ return `\u91CC\u89AA\u306E${relation}`;
7567
+ }
7568
+ return relation;
7242
7569
  }
7243
7570
  };
7244
7571
 
@@ -7247,22 +7574,32 @@ var InLawsZh = {
7247
7574
  "(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u914D\u5076": "\u513F\u5AB3/\u5973\u5A7F",
7248
7575
  "(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u59BB\u5B50": "\u513F\u5AB3",
7249
7576
  "(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u4E08\u592B": "\u5973\u5A7F",
7250
- "(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD/\u5A46\u5A46",
7251
- "(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u7236\u4EB2": "\u5CB3\u7236/\u516C\u516C",
7252
- "(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD/\u516C\u516C\u5A46\u5A46",
7577
+ "\u59BB\u5B50\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD",
7578
+ "\u4E08\u592B\u7684\u6BCD\u4EB2": "\u5A46\u5A46",
7579
+ "(\u914D\u5076)\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD/\u5A46\u5A46",
7580
+ "\u59BB\u5B50\u7684\u7236\u4EB2": "\u5CB3\u7236",
7581
+ "\u4E08\u592B\u7684\u7236\u4EB2": "\u516C\u516C",
7582
+ "(\u914D\u5076)\u7684\u7236\u4EB2": "\u5CB3\u7236/\u516C\u516C",
7583
+ "\u59BB\u5B50\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD",
7584
+ "\u4E08\u592B\u7684\u7236\u6BCD": "\u516C\u516C\u5A46\u5A46",
7585
+ "(\u914D\u5076)\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD/\u516C\u516C\u5A46\u5A46",
7253
7586
  "(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u59BB\u5B50": "\u5AC2\u5B50/\u5F1F\u59B9",
7254
7587
  "(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u4E08\u592B": "\u59D0\u592B/\u59B9\u592B",
7255
7588
  "(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u914D\u5076": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
7256
7589
  "(\u5F02\u7236\u6BCD\u7684)?\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59D0\u592B/\u59B9\u592B",
7257
7590
  "(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u5AC2\u5B50/\u5F1F\u59B9",
7258
7591
  "(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
7259
- "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u59D0\u59B9": "\u59D1\u5B50/\u59E8\u5B50",
7260
- "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4/\u5185\u5144/\u5185\u5F1F",
7592
+ "(\u5F02\u7236\u6BCD\u7684)?\u59BB\u5B50\u7684\u59D0\u59B9": "\u59E8\u5B50",
7593
+ "(\u5F02\u7236\u6BCD\u7684)?\u4E08\u592B\u7684\u59D0\u59B9": "\u59D1\u5B50",
7594
+ "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076)\u7684\u59D0\u59B9": "\u59D1\u5B50/\u59E8\u5B50",
7595
+ "(\u5F02\u7236\u6BCD\u7684)?\u59BB\u5B50\u7684\u5144\u5F1F": "\u5185\u5144/\u5185\u5F1F",
7596
+ "(\u5F02\u7236\u6BCD\u7684)?\u4E08\u592B\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4",
7597
+ "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076)\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4/\u5185\u5144/\u5185\u5F1F",
7261
7598
  "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F\u59D0\u59B9": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9"
7262
7599
  };
7263
7600
 
7264
7601
  // src/kinship-translator/kinship-translator.zh.ts
7265
- var sexOf3 = (person) => {
7602
+ var sexOf6 = (person) => {
7266
7603
  if (person?.isMale?.()) {
7267
7604
  return "m";
7268
7605
  }
@@ -7271,7 +7608,7 @@ var sexOf3 = (person) => {
7271
7608
  }
7272
7609
  return "n";
7273
7610
  };
7274
- var pick2 = (sex, male, female, neutral) => {
7611
+ var pick5 = (sex, male, female, neutral) => {
7275
7612
  if (sex === "m") {
7276
7613
  return male;
7277
7614
  }
@@ -7284,41 +7621,41 @@ var lineal2 = (level, sex, kind) => {
7284
7621
  const L = Math.max(1, level);
7285
7622
  if (kind === "asc") {
7286
7623
  if (L <= 1) {
7287
- return pick2(sex, "\u7236\u4EB2", "\u6BCD\u4EB2", "\u7236\u6BCD");
7624
+ return pick5(sex, "\u7236\u4EB2", "\u6BCD\u4EB2", "\u7236\u6BCD");
7288
7625
  }
7289
7626
  if (L === 2) {
7290
- return pick2(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
7627
+ return pick5(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
7291
7628
  }
7292
7629
  if (L === 3) {
7293
- return pick2(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
7630
+ return pick5(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
7294
7631
  }
7295
7632
  if (L === 4) {
7296
- return pick2(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
7633
+ return pick5(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
7297
7634
  }
7298
- return pick2(sex, `${L}\u4E16\u7956`, `${L}\u4E16\u7956\u6BCD`, `${L}\u4E16\u7956\u7236\u6BCD`);
7635
+ return pick5(sex, `${L}\u4E16\u7956`, `${L}\u4E16\u7956\u6BCD`, `${L}\u4E16\u7956\u7236\u6BCD`);
7299
7636
  }
7300
7637
  if (L <= 1) {
7301
- return pick2(sex, "\u513F\u5B50", "\u5973\u513F", "\u5B50\u5973");
7638
+ return pick5(sex, "\u513F\u5B50", "\u5973\u513F", "\u5B50\u5973");
7302
7639
  }
7303
7640
  if (L === 2) {
7304
- return pick2(sex, "\u5B59\u5B50", "\u5B59\u5973", "\u5B59\u5B50\u5973");
7641
+ return pick5(sex, "\u5B59\u5B50", "\u5B59\u5973", "\u5B59\u5B50\u5973");
7305
7642
  }
7306
7643
  if (L === 3) {
7307
- return pick2(sex, "\u66FE\u5B59", "\u66FE\u5B59\u5973", "\u66FE\u5B59\u5B50\u5973");
7644
+ return pick5(sex, "\u66FE\u5B59", "\u66FE\u5B59\u5973", "\u66FE\u5B59\u5B50\u5973");
7308
7645
  }
7309
7646
  if (L === 4) {
7310
- return pick2(sex, "\u7384\u5B59", "\u7384\u5B59\u5973", "\u7384\u5B59\u5B50\u5973");
7647
+ return pick5(sex, "\u7384\u5B59", "\u7384\u5B59\u5973", "\u7384\u5B59\u5B50\u5973");
7311
7648
  }
7312
- return pick2(sex, `${L}\u4E16\u5B59`, `${L}\u4E16\u5B59\u5973`, `${L}\u4E16\u5B59\u5B50\u5973`);
7649
+ return pick5(sex, `${L}\u4E16\u5B59`, `${L}\u4E16\u5B59\u5973`, `${L}\u4E16\u5B59\u5B50\u5973`);
7313
7650
  };
7314
7651
  var cousinPlain2 = (degree, sex) => {
7315
7652
  if (degree <= 1) {
7316
- return pick2(sex, "\u5802\u8868\u5144\u5F1F", "\u5802\u8868\u59D0\u59B9", "\u5802\u8868\u4EB2");
7653
+ return pick5(sex, "\u5802\u8868\u5144\u5F1F", "\u5802\u8868\u59D0\u59B9", "\u5802\u8868\u4EB2");
7317
7654
  }
7318
7655
  if (degree === 2) {
7319
- return pick2(sex, "\u4ECE\u5802\u8868\u5144\u5F1F", "\u4ECE\u5802\u8868\u59D0\u59B9", "\u4ECE\u5802\u8868\u4EB2");
7656
+ return pick5(sex, "\u4ECE\u5802\u8868\u5144\u5F1F", "\u4ECE\u5802\u8868\u59D0\u59B9", "\u4ECE\u5802\u8868\u4EB2");
7320
7657
  }
7321
- return pick2(
7658
+ return pick5(
7322
7659
  sex,
7323
7660
  `${degree}\u4EE3\u5802\u8868\u5144\u5F1F`,
7324
7661
  `${degree}\u4EE3\u5802\u8868\u59D0\u59B9`,
@@ -7331,7 +7668,7 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
7331
7668
  if (degree > 0) {
7332
7669
  degree = degree - 1;
7333
7670
  }
7334
- return cousinPlain2(degree, sexOf3(this.personN));
7671
+ return cousinPlain2(degree, sexOf6(this.personN));
7335
7672
  }
7336
7673
  removal() {
7337
7674
  const level = this.pathN?.level ?? 0;
@@ -7343,56 +7680,56 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
7343
7680
  return level < 0 ? this.nibling() : this.auncle();
7344
7681
  }
7345
7682
  const removed = Math.abs(level);
7346
- return `${cousinPlain2(degree, sexOf3(this.personN))}\uFF08\u9694${removed}\u4EE3\uFF09`;
7683
+ return `${cousinPlain2(degree, sexOf6(this.personN))}\uFF08\u9694${removed}\u4EE3\uFF09`;
7347
7684
  }
7348
7685
  auncle() {
7349
7686
  const level = Math.abs(this.pathN?.level ?? 0);
7350
- const sex = sexOf3(this.personN);
7351
- if (level <= 2) {
7352
- return pick2(sex, "\u53D4\u53D4", "\u963F\u59E8", "\u53D4\u4F2F/\u59D1\u59E8");
7687
+ const sex = sexOf6(this.personN);
7688
+ if (level <= 1) {
7689
+ return pick5(sex, "\u53D4\u53D4", "\u963F\u59E8", "\u53D4\u4F2F/\u59D1\u59E8");
7353
7690
  }
7354
- if (level === 3) {
7355
- return pick2(sex, "\u4F2F\u53D4\u7956\u7236", "\u59D1\u7956\u6BCD", "\u4F2F\u53D4\u7956\u7236\u6BCD");
7691
+ if (level === 2) {
7692
+ return pick5(sex, "\u4F2F\u53D4\u7956\u7236", "\u59D1\u7956\u6BCD", "\u4F2F\u53D4\u7956\u7236\u6BCD");
7356
7693
  }
7357
- return pick2(
7694
+ return pick5(
7358
7695
  sex,
7359
- `${level - 2}\u4EE3\u524D\u7684\u53D4\u53D4`,
7360
- `${level - 2}\u4EE3\u524D\u7684\u963F\u59E8`,
7361
- `${level - 2}\u4EE3\u524D\u7684\u53D4\u4F2F/\u59D1\u59E8`
7696
+ `${level - 1}\u4EE3\u524D\u7684\u53D4\u53D4`,
7697
+ `${level - 1}\u4EE3\u524D\u7684\u963F\u59E8`,
7698
+ `${level - 1}\u4EE3\u524D\u7684\u53D4\u4F2F/\u59D1\u59E8`
7362
7699
  );
7363
7700
  }
7364
7701
  nibling() {
7365
7702
  const level = Math.abs(this.pathN?.level ?? 0);
7366
- const sex = sexOf3(this.personN);
7367
- if (level <= 2) {
7368
- return pick2(sex, "\u4F84\u5B50", "\u4F84\u5973", "\u4F84\u5B50\u5973");
7703
+ const sex = sexOf6(this.personN);
7704
+ if (level <= 1) {
7705
+ return pick5(sex, "\u4F84\u5B50", "\u4F84\u5973", "\u4F84\u5B50\u5973");
7369
7706
  }
7370
- if (level === 3) {
7371
- return pick2(sex, "\u4F84\u5B59", "\u4F84\u5B59\u5973", "\u4F84\u5B59\u5B50\u5973");
7707
+ if (level === 2) {
7708
+ return pick5(sex, "\u4F84\u5B59", "\u4F84\u5B59\u5973", "\u4F84\u5B59\u5B50\u5973");
7372
7709
  }
7373
- return pick2(
7710
+ return pick5(
7374
7711
  sex,
7375
- `${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5B50`,
7376
- `${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5973`,
7377
- `${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5B50\u5973`
7712
+ `${level - 1}\u4EE3\u4E0B\u7684\u4F84\u5B50`,
7713
+ `${level - 1}\u4EE3\u4E0B\u7684\u4F84\u5973`,
7714
+ `${level - 1}\u4EE3\u4E0B\u7684\u4F84\u5B50\u5973`
7378
7715
  );
7379
7716
  }
7380
7717
  parent() {
7381
7718
  return lineal2(
7382
7719
  Math.abs(this.pathN?.level ?? 0),
7383
- sexOf3(this.personN),
7720
+ sexOf6(this.personN),
7384
7721
  "asc"
7385
7722
  );
7386
7723
  }
7387
7724
  child() {
7388
7725
  return lineal2(
7389
7726
  Math.abs(this.pathN?.level ?? 0),
7390
- sexOf3(this.personN),
7727
+ sexOf6(this.personN),
7391
7728
  "desc"
7392
7729
  );
7393
7730
  }
7394
7731
  sibling() {
7395
- return pick2(sexOf3(this.personN), "\u5144\u5F1F", "\u59D0\u59B9", "\u5144\u5F1F\u59D0\u59B9");
7732
+ return pick5(sexOf6(this.personN), "\u5144\u5F1F", "\u59D0\u59B9", "\u5144\u5F1F\u59D0\u59B9");
7396
7733
  }
7397
7734
  halfBlood(relation) {
7398
7735
  if (!relation || !this.isHalfBlood) {
@@ -7401,14 +7738,14 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
7401
7738
  return `\u5F02\u7236\u6BCD\u7684${relation}`;
7402
7739
  }
7403
7740
  spouse() {
7404
- return pick2(sexOf3(this.personN), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
7741
+ return pick5(sexOf6(this.personN), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
7405
7742
  }
7406
7743
  ofSpouse(relation) {
7407
7744
  if (!relation) {
7408
7745
  return "";
7409
7746
  }
7410
- const spouseType = pick2(
7411
- sexOf3(this.path?.[1].indi),
7747
+ const spouseType = pick5(
7748
+ sexOf6(this.path?.[1].indi),
7412
7749
  "\u4E08\u592B",
7413
7750
  "\u59BB\u5B50",
7414
7751
  "\u914D\u5076"
@@ -7420,7 +7757,7 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
7420
7757
  return "";
7421
7758
  }
7422
7759
  const spouse = this.path?.[this.path.length - 1].indi;
7423
- const spouseType = pick2(sexOf3(spouse), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
7760
+ const spouseType = pick5(sexOf6(spouse), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
7424
7761
  return `${relation}\u7684${spouseType}`;
7425
7762
  }
7426
7763
  of(relation) {
@@ -7456,7 +7793,40 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
7456
7793
  if (!relation || !this.pathN?.relation) {
7457
7794
  return relation ?? "";
7458
7795
  }
7459
- return `${this.pathN.relation}${relation}`;
7796
+ if (this.pathN.relation === "step") {
7797
+ if (relation === "\u7236\u4EB2") {
7798
+ return "\u7EE7\u7236";
7799
+ }
7800
+ if (relation === "\u6BCD\u4EB2") {
7801
+ return "\u7EE7\u6BCD";
7802
+ }
7803
+ if (relation === "\u513F\u5B50") {
7804
+ return "\u7EE7\u5B50";
7805
+ }
7806
+ if (relation === "\u5973\u513F") {
7807
+ return "\u7EE7\u5973";
7808
+ }
7809
+ return `\u7EE7${relation}`;
7810
+ }
7811
+ if (this.pathN.relation === "adopted") {
7812
+ if (relation === "\u7236\u4EB2") {
7813
+ return "\u517B\u7236";
7814
+ }
7815
+ if (relation === "\u6BCD\u4EB2") {
7816
+ return "\u517B\u6BCD";
7817
+ }
7818
+ if (relation === "\u513F\u5B50") {
7819
+ return "\u517B\u5B50";
7820
+ }
7821
+ if (relation === "\u5973\u513F") {
7822
+ return "\u517B\u5973";
7823
+ }
7824
+ return `\u517B${relation}`;
7825
+ }
7826
+ if (this.pathN.relation === "foster") {
7827
+ return `\u5BC4\u517B${relation}`;
7828
+ }
7829
+ return relation;
7460
7830
  }
7461
7831
  };
7462
7832
 
@@ -8611,7 +8981,7 @@ var ensureExtensionSchema = (gedcom, extraTags) => {
8611
8981
 
8612
8982
  // package.json
8613
8983
  var package_default = {
8614
- version: "2.1.9"};
8984
+ version: "2.1.12"};
8615
8985
 
8616
8986
  // src/utils/get-product-details.ts
8617
8987
  var isDevelopment = () => {
@@ -8694,16 +9064,26 @@ var Obje = class extends Common {
8694
9064
  if (!this._gedcom) {
8695
9065
  return this;
8696
9066
  }
9067
+ if (typeof this.value === "string" && isId(this.value) && this.refType === "OBJE") {
9068
+ const resolved = this.ref;
9069
+ if (resolved && resolved !== this && typeof resolved.standardizeMedia === "function") {
9070
+ resolved.standardizeMedia(
9071
+ namespace,
9072
+ override,
9073
+ urlGetter,
9074
+ gedcomVersion
9075
+ );
9076
+ return this;
9077
+ }
9078
+ }
8697
9079
  const rin = this?.get("RIN")?.toValue();
8698
- const clone = this?.get("_CLON._OID")?.toValue();
8699
- const mser = this?.get("_MSER._LKID")?.toValue();
8700
9080
  const title = this?.get("FILE.TITL")?.toValue() ?? this?.get("TITL")?.toValue() ?? "";
8701
9081
  const note = this?.get("FILE.NOTE")?.toValue() ?? this?.get("NOTE")?.toValue() ?? "";
8702
9082
  const formRaw = this?.get("FILE.FORM")?.toValue() ?? this?.get("FORM")?.toValue();
8703
9083
  const mediType = this?.get("FILE.FORM.TYPE")?.toValue() ?? this?.get("FORM.TYPE")?.toValue() ?? this?.get("MEDI")?.toValue();
8704
9084
  const file = this?.get("FILE")?.toValue();
8705
- const imgId = rin || clone || mser;
8706
- const url = file || namespace && urlGetter?.(namespace, imgId);
9085
+ const imgId = resolveObjeMediaId(this);
9086
+ const url = file || this.isAncestry() && namespace && urlGetter?.(namespace, imgId);
8707
9087
  if (!url) {
8708
9088
  return this;
8709
9089
  }
@@ -9216,6 +9596,22 @@ var GedCom = class extends Common {
9216
9596
  obje(index) {
9217
9597
  return this.getMain(this.objes(), index);
9218
9598
  }
9599
+ /**
9600
+ * People who link a shared multimedia record (`1 OBJE @On@`), i.e. Ancestry
9601
+ * face tags / everyone the photo is attached to.
9602
+ */
9603
+ indisLinkingObje(objeKey) {
9604
+ const people = [];
9605
+ this.indis()?.forEach((indi) => {
9606
+ const linked = indi?.get("OBJE")?.toList()?.values()?.some(
9607
+ (item) => item?.toValue?.() === objeKey || item?.id === objeKey
9608
+ );
9609
+ if (linked && indi) {
9610
+ people.push(indi);
9611
+ }
9612
+ });
9613
+ return people;
9614
+ }
9219
9615
  sour(index) {
9220
9616
  return this.getMain(this.sours(), index);
9221
9617
  }