@treeviz/gedcom-parser 2.0.9 → 2.0.10

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.
@@ -95,7 +95,8 @@ __export(translators_exports, {
95
95
  en: () => KinshipTranslatorEn,
96
96
  es: () => KinshipTranslatorEs,
97
97
  fr: () => KinshipTranslatorFr,
98
- hu: () => KinshipTranslatorHU
98
+ hu: () => KinshipTranslatorHU,
99
+ ru: () => KinshipTranslatorRu
99
100
  });
100
101
  var getGedcomId = (gedcom) => {
101
102
  if (!gedcom) {
@@ -5962,6 +5963,249 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
5962
5963
  }
5963
5964
  };
5964
5965
 
5966
+ // src/kinship-translator/patterns.ru.ts
5967
+ var InLawsRu = {
5968
+ "\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",
5969
+ "\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",
5970
+ "\u043C\u0443\u0436 (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u0437\u044F\u0442\u044C",
5971
+ "\u043C\u0430\u0442\u044C (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0451\u0449\u0430",
5972
+ "\u043E\u0442\u0435\u0446 (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0435\u0441\u0442\u044C",
5973
+ "\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",
5974
+ "\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",
5975
+ "\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",
5976
+ "\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",
5977
+ "(\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",
5978
+ "(\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",
5979
+ "(\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"
5980
+ };
5981
+
5982
+ // src/kinship-translator/kinship-translator.ru.ts
5983
+ var GENITIVE = {
5984
+ \u0441\u044B\u043D: "\u0441\u044B\u043D\u0430",
5985
+ \u0434\u043E\u0447\u044C: "\u0434\u043E\u0447\u0435\u0440\u0438",
5986
+ \u0440\u0435\u0431\u0451\u043D\u043E\u043A: "\u0440\u0435\u0431\u0451\u043D\u043A\u0430",
5987
+ \u0431\u0440\u0430\u0442: "\u0431\u0440\u0430\u0442\u0430",
5988
+ \u0441\u0435\u0441\u0442\u0440\u0430: "\u0441\u0435\u0441\u0442\u0440\u044B",
5989
+ \u0441\u0438\u0431\u043B\u0438\u043D\u0433: "\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430",
5990
+ \u043E\u0442\u0435\u0446: "\u043E\u0442\u0446\u0430",
5991
+ \u043C\u0430\u0442\u044C: "\u043C\u0430\u0442\u0435\u0440\u0438",
5992
+ \u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C: "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044F",
5993
+ \u043C\u0443\u0436: "\u043C\u0443\u0436\u0430",
5994
+ \u0436\u0435\u043D\u0430: "\u0436\u0435\u043D\u044B",
5995
+ \u0441\u0443\u043F\u0440\u0443\u0433: "\u0441\u0443\u043F\u0440\u0443\u0433\u0430",
5996
+ \u0441\u0443\u043F\u0440\u0443\u0433\u0430: "\u0441\u0443\u043F\u0440\u0443\u0433\u0438"
5997
+ };
5998
+ var toGenitive = (word) => GENITIVE[word] ?? word;
5999
+ var cousinWord = (degree, sex) => {
6000
+ const stem = degree <= 1 ? "\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D" : degree === 2 ? "\u0442\u0440\u043E\u044E\u0440\u043E\u0434\u043D" : degree === 3 ? "\u0447\u0435\u0442\u0432\u0435\u0440\u043E\u044E\u0440\u043E\u0434\u043D" : `${degree + 1}-\u044E\u0440\u043E\u0434\u043D`;
6001
+ if (sex === "m") {
6002
+ return `${stem}\u044B\u0439 \u0431\u0440\u0430\u0442`;
6003
+ }
6004
+ if (sex === "f") {
6005
+ return `${stem}\u0430\u044F \u0441\u0435\u0441\u0442\u0440\u0430`;
6006
+ }
6007
+ return `${stem}\u044B\u0439 \u0431\u0440\u0430\u0442/\u0441\u0435\u0441\u0442\u0440\u0430`;
6008
+ };
6009
+ var praRepeat = (count) => count > 0 ? "\u043F\u0440\u0430".repeat(count) : "";
6010
+ var sexOf = (person) => {
6011
+ if (person?.isMale?.()) {
6012
+ return "m";
6013
+ }
6014
+ if (person?.isFemale?.()) {
6015
+ return "f";
6016
+ }
6017
+ return "n";
6018
+ };
6019
+ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6020
+ indirect() {
6021
+ let degree = Math.abs(this.pathN?.degree ?? 0);
6022
+ if (degree > 0) {
6023
+ degree = degree - 1;
6024
+ }
6025
+ return cousinWord(degree, sexOf(this.personN));
6026
+ }
6027
+ removal() {
6028
+ const level = this.pathN?.level ?? 0;
6029
+ let degree = Math.abs(this.pathN?.degree ?? 0);
6030
+ if (degree > 0) {
6031
+ degree = degree - 1;
6032
+ }
6033
+ if (!degree) {
6034
+ return level < 0 ? this.nibling() : this.auncle();
6035
+ }
6036
+ const removed = Math.abs(level);
6037
+ return `${cousinWord(degree, sexOf(this.personN))} (${removed}\xD7 \u0447\u0435\u0440\u0435\u0437 \u043F\u043E\u043A\u043E\u043B\u0435\u043D\u0438\u0435)`;
6038
+ }
6039
+ auncle() {
6040
+ const level = Math.abs(this.pathN?.level ?? 0);
6041
+ const pra = praRepeat(Math.max(0, level - 2));
6042
+ const sex = sexOf(this.personN);
6043
+ if (sex === "m") {
6044
+ return `${pra}\u0434\u044F\u0434\u044F`;
6045
+ }
6046
+ if (sex === "f") {
6047
+ return `${pra}\u0442\u0451\u0442\u044F`;
6048
+ }
6049
+ return `${pra}\u0434\u044F\u0434\u044F/\u0442\u0451\u0442\u044F`;
6050
+ }
6051
+ nibling() {
6052
+ const level = Math.abs(this.pathN?.level ?? 0);
6053
+ const pra = praRepeat(Math.max(0, level - 2));
6054
+ const sex = sexOf(this.personN);
6055
+ if (sex === "m") {
6056
+ return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A`;
6057
+ }
6058
+ if (sex === "f") {
6059
+ return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
6060
+ }
6061
+ return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
6062
+ }
6063
+ parent() {
6064
+ const level = Math.abs(this.pathN?.level ?? 0);
6065
+ const sex = sexOf(this.personN);
6066
+ if (level <= 1) {
6067
+ if (sex === "m") {
6068
+ return "\u043E\u0442\u0435\u0446";
6069
+ }
6070
+ if (sex === "f") {
6071
+ return "\u043C\u0430\u0442\u044C";
6072
+ }
6073
+ return "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C";
6074
+ }
6075
+ if (level === 2) {
6076
+ if (sex === "m") {
6077
+ return "\u0434\u0435\u0434";
6078
+ }
6079
+ if (sex === "f") {
6080
+ return "\u0431\u0430\u0431\u0443\u0448\u043A\u0430";
6081
+ }
6082
+ return "\u0434\u0435\u0434/\u0431\u0430\u0431\u0443\u0448\u043A\u0430";
6083
+ }
6084
+ const pra = praRepeat(level - 2);
6085
+ if (sex === "m") {
6086
+ return `${pra}\u0434\u0435\u0434`;
6087
+ }
6088
+ if (sex === "f") {
6089
+ return `${pra}\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
6090
+ }
6091
+ return `${pra}\u0434\u0435\u0434/\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
6092
+ }
6093
+ child() {
6094
+ const level = Math.abs(this.pathN?.level ?? 0);
6095
+ const sex = sexOf(this.personN);
6096
+ if (level <= 1) {
6097
+ if (sex === "m") {
6098
+ return "\u0441\u044B\u043D";
6099
+ }
6100
+ if (sex === "f") {
6101
+ return "\u0434\u043E\u0447\u044C";
6102
+ }
6103
+ return "\u0440\u0435\u0431\u0451\u043D\u043E\u043A";
6104
+ }
6105
+ if (level === 2) {
6106
+ if (sex === "m") {
6107
+ return "\u0432\u043D\u0443\u043A";
6108
+ }
6109
+ if (sex === "f") {
6110
+ return "\u0432\u043D\u0443\u0447\u043A\u0430";
6111
+ }
6112
+ return "\u0432\u043D\u0443\u043A/\u0432\u043D\u0443\u0447\u043A\u0430";
6113
+ }
6114
+ const pra = praRepeat(level - 2);
6115
+ if (sex === "m") {
6116
+ return `${pra}\u0432\u043D\u0443\u043A`;
6117
+ }
6118
+ if (sex === "f") {
6119
+ return `${pra}\u0432\u043D\u0443\u0447\u043A\u0430`;
6120
+ }
6121
+ return `${pra}\u0432\u043D\u0443\u043A/\u0432\u043D\u0443\u0447\u043A\u0430`;
6122
+ }
6123
+ sibling() {
6124
+ const sex = sexOf(this.personN);
6125
+ if (sex === "m") {
6126
+ return "\u0431\u0440\u0430\u0442";
6127
+ }
6128
+ if (sex === "f") {
6129
+ return "\u0441\u0435\u0441\u0442\u0440\u0430";
6130
+ }
6131
+ return "\u0441\u0438\u0431\u043B\u0438\u043D\u0433";
6132
+ }
6133
+ halfBlood(relation) {
6134
+ if (!relation || !this.isHalfBlood) {
6135
+ return relation ?? "";
6136
+ }
6137
+ if (/сестра|дочь|мать|тётя|бабушка|жена|племянница|внучка/.test(
6138
+ relation
6139
+ )) {
6140
+ return `\u0441\u0432\u043E\u0434\u043D\u0430\u044F ${relation}`;
6141
+ }
6142
+ return `\u0441\u0432\u043E\u0434\u043D\u044B\u0439 ${relation}`;
6143
+ }
6144
+ spouse() {
6145
+ const sex = sexOf(this.personN);
6146
+ if (sex === "m") {
6147
+ return "\u043C\u0443\u0436";
6148
+ }
6149
+ if (sex === "f") {
6150
+ return "\u0436\u0435\u043D\u0430";
6151
+ }
6152
+ return "\u0441\u0443\u043F\u0440\u0443\u0433";
6153
+ }
6154
+ ofSpouse(relation) {
6155
+ if (!relation) {
6156
+ return "";
6157
+ }
6158
+ const spouse = this.path?.[1].indi;
6159
+ const sex = sexOf(spouse);
6160
+ const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
6161
+ return `${relation} ${toGenitive(spouseType)}`;
6162
+ }
6163
+ spouseOf(relation) {
6164
+ if (!relation) {
6165
+ return "";
6166
+ }
6167
+ const spouse = this.path?.[this.path.length - 1].indi;
6168
+ const sex = sexOf(spouse);
6169
+ const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
6170
+ return `${spouseType} ${toGenitive(relation)}`;
6171
+ }
6172
+ of(relation) {
6173
+ const formattedName = nameFormatter(this.path?.[0]?.indi, {
6174
+ nameOrder: "first-last"
6175
+ });
6176
+ let name = formattedName.inOrder.filter(Boolean).join(" ");
6177
+ if (this.displayName === "none") {
6178
+ name = "";
6179
+ } else if (this.displayName === "givenname") {
6180
+ name = formattedName.givenname;
6181
+ } else if (this.displayName === "surname") {
6182
+ name = `${formattedName.surname}`;
6183
+ }
6184
+ if (!name || !relation) {
6185
+ return relation ?? "";
6186
+ }
6187
+ return `${name}: ${relation}`;
6188
+ }
6189
+ inLaw(relation) {
6190
+ let inLawRelation = relation;
6191
+ Object.keys(InLawsRu).find((pattern) => {
6192
+ const regex = new RegExp(`^${pattern}$`);
6193
+ if (relation?.match(regex)) {
6194
+ inLawRelation = InLawsRu[pattern];
6195
+ return true;
6196
+ }
6197
+ return false;
6198
+ });
6199
+ return inLawRelation ?? "";
6200
+ }
6201
+ relationType(relation) {
6202
+ if (!relation || !this.pathN?.relation) {
6203
+ return relation ?? "";
6204
+ }
6205
+ return `${this.pathN.relation} ${relation}`;
6206
+ }
6207
+ };
6208
+
5965
6209
  // src/kinship-translator/kinship-translator.ts
5966
6210
  var KinshipTranslator = class {
5967
6211
  constructor(person1, person2, lang = "en", entirePath, displayName = "givenname") {
@@ -63,7 +63,8 @@ __export(translators_exports, {
63
63
  en: () => KinshipTranslatorEn,
64
64
  es: () => KinshipTranslatorEs,
65
65
  fr: () => KinshipTranslatorFr,
66
- hu: () => KinshipTranslatorHU
66
+ hu: () => KinshipTranslatorHU,
67
+ ru: () => KinshipTranslatorRu
67
68
  });
68
69
 
69
70
  // src/constants/filters.ts
@@ -6430,6 +6431,249 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
6430
6431
  }
6431
6432
  };
6432
6433
 
6434
+ // src/kinship-translator/patterns.ru.ts
6435
+ var InLawsRu = {
6436
+ "\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",
6437
+ "\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",
6438
+ "\u043C\u0443\u0436 (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u0437\u044F\u0442\u044C",
6439
+ "\u043C\u0430\u0442\u044C (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0451\u0449\u0430",
6440
+ "\u043E\u0442\u0435\u0446 (\u0441\u0443\u043F\u0440\u0443\u0433\u0430|\u0436\u0435\u043D\u044B|\u043C\u0443\u0436\u0430)": "\u0442\u0435\u0441\u0442\u044C",
6441
+ "\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",
6442
+ "\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",
6443
+ "\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",
6444
+ "\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",
6445
+ "(\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",
6446
+ "(\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",
6447
+ "(\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"
6448
+ };
6449
+
6450
+ // src/kinship-translator/kinship-translator.ru.ts
6451
+ var GENITIVE = {
6452
+ \u0441\u044B\u043D: "\u0441\u044B\u043D\u0430",
6453
+ \u0434\u043E\u0447\u044C: "\u0434\u043E\u0447\u0435\u0440\u0438",
6454
+ \u0440\u0435\u0431\u0451\u043D\u043E\u043A: "\u0440\u0435\u0431\u0451\u043D\u043A\u0430",
6455
+ \u0431\u0440\u0430\u0442: "\u0431\u0440\u0430\u0442\u0430",
6456
+ \u0441\u0435\u0441\u0442\u0440\u0430: "\u0441\u0435\u0441\u0442\u0440\u044B",
6457
+ \u0441\u0438\u0431\u043B\u0438\u043D\u0433: "\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430",
6458
+ \u043E\u0442\u0435\u0446: "\u043E\u0442\u0446\u0430",
6459
+ \u043C\u0430\u0442\u044C: "\u043C\u0430\u0442\u0435\u0440\u0438",
6460
+ \u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C: "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044F",
6461
+ \u043C\u0443\u0436: "\u043C\u0443\u0436\u0430",
6462
+ \u0436\u0435\u043D\u0430: "\u0436\u0435\u043D\u044B",
6463
+ \u0441\u0443\u043F\u0440\u0443\u0433: "\u0441\u0443\u043F\u0440\u0443\u0433\u0430",
6464
+ \u0441\u0443\u043F\u0440\u0443\u0433\u0430: "\u0441\u0443\u043F\u0440\u0443\u0433\u0438"
6465
+ };
6466
+ var toGenitive = (word) => GENITIVE[word] ?? word;
6467
+ var cousinWord = (degree, sex) => {
6468
+ const stem = degree <= 1 ? "\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D" : degree === 2 ? "\u0442\u0440\u043E\u044E\u0440\u043E\u0434\u043D" : degree === 3 ? "\u0447\u0435\u0442\u0432\u0435\u0440\u043E\u044E\u0440\u043E\u0434\u043D" : `${degree + 1}-\u044E\u0440\u043E\u0434\u043D`;
6469
+ if (sex === "m") {
6470
+ return `${stem}\u044B\u0439 \u0431\u0440\u0430\u0442`;
6471
+ }
6472
+ if (sex === "f") {
6473
+ return `${stem}\u0430\u044F \u0441\u0435\u0441\u0442\u0440\u0430`;
6474
+ }
6475
+ return `${stem}\u044B\u0439 \u0431\u0440\u0430\u0442/\u0441\u0435\u0441\u0442\u0440\u0430`;
6476
+ };
6477
+ var praRepeat = (count) => count > 0 ? "\u043F\u0440\u0430".repeat(count) : "";
6478
+ var sexOf = (person) => {
6479
+ if (person?.isMale?.()) {
6480
+ return "m";
6481
+ }
6482
+ if (person?.isFemale?.()) {
6483
+ return "f";
6484
+ }
6485
+ return "n";
6486
+ };
6487
+ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
6488
+ indirect() {
6489
+ let degree = Math.abs(this.pathN?.degree ?? 0);
6490
+ if (degree > 0) {
6491
+ degree = degree - 1;
6492
+ }
6493
+ return cousinWord(degree, sexOf(this.personN));
6494
+ }
6495
+ removal() {
6496
+ const level = this.pathN?.level ?? 0;
6497
+ let degree = Math.abs(this.pathN?.degree ?? 0);
6498
+ if (degree > 0) {
6499
+ degree = degree - 1;
6500
+ }
6501
+ if (!degree) {
6502
+ return level < 0 ? this.nibling() : this.auncle();
6503
+ }
6504
+ const removed = Math.abs(level);
6505
+ return `${cousinWord(degree, sexOf(this.personN))} (${removed}\xD7 \u0447\u0435\u0440\u0435\u0437 \u043F\u043E\u043A\u043E\u043B\u0435\u043D\u0438\u0435)`;
6506
+ }
6507
+ auncle() {
6508
+ const level = Math.abs(this.pathN?.level ?? 0);
6509
+ const pra = praRepeat(Math.max(0, level - 2));
6510
+ const sex = sexOf(this.personN);
6511
+ if (sex === "m") {
6512
+ return `${pra}\u0434\u044F\u0434\u044F`;
6513
+ }
6514
+ if (sex === "f") {
6515
+ return `${pra}\u0442\u0451\u0442\u044F`;
6516
+ }
6517
+ return `${pra}\u0434\u044F\u0434\u044F/\u0442\u0451\u0442\u044F`;
6518
+ }
6519
+ nibling() {
6520
+ const level = Math.abs(this.pathN?.level ?? 0);
6521
+ const pra = praRepeat(Math.max(0, level - 2));
6522
+ const sex = sexOf(this.personN);
6523
+ if (sex === "m") {
6524
+ return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A`;
6525
+ }
6526
+ if (sex === "f") {
6527
+ return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
6528
+ }
6529
+ return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
6530
+ }
6531
+ parent() {
6532
+ const level = Math.abs(this.pathN?.level ?? 0);
6533
+ const sex = sexOf(this.personN);
6534
+ if (level <= 1) {
6535
+ if (sex === "m") {
6536
+ return "\u043E\u0442\u0435\u0446";
6537
+ }
6538
+ if (sex === "f") {
6539
+ return "\u043C\u0430\u0442\u044C";
6540
+ }
6541
+ return "\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C";
6542
+ }
6543
+ if (level === 2) {
6544
+ if (sex === "m") {
6545
+ return "\u0434\u0435\u0434";
6546
+ }
6547
+ if (sex === "f") {
6548
+ return "\u0431\u0430\u0431\u0443\u0448\u043A\u0430";
6549
+ }
6550
+ return "\u0434\u0435\u0434/\u0431\u0430\u0431\u0443\u0448\u043A\u0430";
6551
+ }
6552
+ const pra = praRepeat(level - 2);
6553
+ if (sex === "m") {
6554
+ return `${pra}\u0434\u0435\u0434`;
6555
+ }
6556
+ if (sex === "f") {
6557
+ return `${pra}\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
6558
+ }
6559
+ return `${pra}\u0434\u0435\u0434/\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
6560
+ }
6561
+ child() {
6562
+ const level = Math.abs(this.pathN?.level ?? 0);
6563
+ const sex = sexOf(this.personN);
6564
+ if (level <= 1) {
6565
+ if (sex === "m") {
6566
+ return "\u0441\u044B\u043D";
6567
+ }
6568
+ if (sex === "f") {
6569
+ return "\u0434\u043E\u0447\u044C";
6570
+ }
6571
+ return "\u0440\u0435\u0431\u0451\u043D\u043E\u043A";
6572
+ }
6573
+ if (level === 2) {
6574
+ if (sex === "m") {
6575
+ return "\u0432\u043D\u0443\u043A";
6576
+ }
6577
+ if (sex === "f") {
6578
+ return "\u0432\u043D\u0443\u0447\u043A\u0430";
6579
+ }
6580
+ return "\u0432\u043D\u0443\u043A/\u0432\u043D\u0443\u0447\u043A\u0430";
6581
+ }
6582
+ const pra = praRepeat(level - 2);
6583
+ if (sex === "m") {
6584
+ return `${pra}\u0432\u043D\u0443\u043A`;
6585
+ }
6586
+ if (sex === "f") {
6587
+ return `${pra}\u0432\u043D\u0443\u0447\u043A\u0430`;
6588
+ }
6589
+ return `${pra}\u0432\u043D\u0443\u043A/\u0432\u043D\u0443\u0447\u043A\u0430`;
6590
+ }
6591
+ sibling() {
6592
+ const sex = sexOf(this.personN);
6593
+ if (sex === "m") {
6594
+ return "\u0431\u0440\u0430\u0442";
6595
+ }
6596
+ if (sex === "f") {
6597
+ return "\u0441\u0435\u0441\u0442\u0440\u0430";
6598
+ }
6599
+ return "\u0441\u0438\u0431\u043B\u0438\u043D\u0433";
6600
+ }
6601
+ halfBlood(relation) {
6602
+ if (!relation || !this.isHalfBlood) {
6603
+ return relation ?? "";
6604
+ }
6605
+ if (/сестра|дочь|мать|тётя|бабушка|жена|племянница|внучка/.test(
6606
+ relation
6607
+ )) {
6608
+ return `\u0441\u0432\u043E\u0434\u043D\u0430\u044F ${relation}`;
6609
+ }
6610
+ return `\u0441\u0432\u043E\u0434\u043D\u044B\u0439 ${relation}`;
6611
+ }
6612
+ spouse() {
6613
+ const sex = sexOf(this.personN);
6614
+ if (sex === "m") {
6615
+ return "\u043C\u0443\u0436";
6616
+ }
6617
+ if (sex === "f") {
6618
+ return "\u0436\u0435\u043D\u0430";
6619
+ }
6620
+ return "\u0441\u0443\u043F\u0440\u0443\u0433";
6621
+ }
6622
+ ofSpouse(relation) {
6623
+ if (!relation) {
6624
+ return "";
6625
+ }
6626
+ const spouse = this.path?.[1].indi;
6627
+ const sex = sexOf(spouse);
6628
+ const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
6629
+ return `${relation} ${toGenitive(spouseType)}`;
6630
+ }
6631
+ spouseOf(relation) {
6632
+ if (!relation) {
6633
+ return "";
6634
+ }
6635
+ const spouse = this.path?.[this.path.length - 1].indi;
6636
+ const sex = sexOf(spouse);
6637
+ const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
6638
+ return `${spouseType} ${toGenitive(relation)}`;
6639
+ }
6640
+ of(relation) {
6641
+ const formattedName = nameFormatter(this.path?.[0]?.indi, {
6642
+ nameOrder: "first-last"
6643
+ });
6644
+ let name = formattedName.inOrder.filter(Boolean).join(" ");
6645
+ if (this.displayName === "none") {
6646
+ name = "";
6647
+ } else if (this.displayName === "givenname") {
6648
+ name = formattedName.givenname;
6649
+ } else if (this.displayName === "surname") {
6650
+ name = `${formattedName.surname}`;
6651
+ }
6652
+ if (!name || !relation) {
6653
+ return relation ?? "";
6654
+ }
6655
+ return `${name}: ${relation}`;
6656
+ }
6657
+ inLaw(relation) {
6658
+ let inLawRelation = relation;
6659
+ Object.keys(InLawsRu).find((pattern) => {
6660
+ const regex = new RegExp(`^${pattern}$`);
6661
+ if (relation?.match(regex)) {
6662
+ inLawRelation = InLawsRu[pattern];
6663
+ return true;
6664
+ }
6665
+ return false;
6666
+ });
6667
+ return inLawRelation ?? "";
6668
+ }
6669
+ relationType(relation) {
6670
+ if (!relation || !this.pathN?.relation) {
6671
+ return relation ?? "";
6672
+ }
6673
+ return `${this.pathN.relation} ${relation}`;
6674
+ }
6675
+ };
6676
+
6433
6677
  // src/kinship-translator/kinship-translator.ts
6434
6678
  var KinshipTranslator = class {
6435
6679
  constructor(person1, person2, lang = "en", entirePath, displayName = "givenname") {