@treeviz/gedcom-parser 1.0.21 → 1.0.23

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.
@@ -1,2 +1,2 @@
1
- export { ao as Common, az as CommonDate, aR as CommonName, aT as CommonNote, an as CustomTags, am as Existed, aC as Fam, aj as FamType, aE as Families, aL as FamilySearchMatch, aM as FamilySearchSource, aF as GedCom, ak as GedComType, a3 as GenealogyMember, aa as GenerationIndiType, a9 as GenerationSpouseType, aK as Indi, a5 as IndiGenealogy, ab as IndiGenealogyGenerations, ac as IndiGenealogyResult, a6 as IndiMarker, a4 as IndiTree, a1 as IndiType, aP as Individuals, aQ as List, a8 as MemberMain, a7 as MemberSide, ad as NonNullIndiGenealogyResult, aV as Obje, al as ObjeType, aX as Objects, af as Path, ae as PathItem, aN as ProfilePicture, Z as ProxyOriginal, ai as Queue, ah as QueueItem, ag as ReducedPath, aY as Repo, $ as RepoType, a_ as Repositories, a$ as Sour, _ as SourType, b1 as Sources, b2 as Subm, a0 as SubmType, b4 as Submitters, a2 as TreeMember, aq as createCommon, aA as createCommonDate, aS as createCommonName, aU as createCommonNote, aD as createFam, aG as createGedCom, aO as createIndi, aW as createObje, ap as createProxy, aZ as createRepo, b0 as createSour, b3 as createSubm, av as getListTag, aw as getValidKey, at as getValidKeys, au as getValidTag, ay as idGetter, aB as isCommonDate, aH as isGedcomString, ax as isId, ar as isOnlyMainProp, as as isValidKey, aJ as mergeGedcoms, aI as validateGedcomContent } from '../index-BPEVN_DY.js';
1
+ export { a as Common, b as CommonDate, c as CommonName, d as CommonNote, h as CustomTags, E as Existed, F as Fam, j as FamType, k as Families, l as FamilySearchMatch, m as FamilySearchSource, G as GedCom, p as GedComType, q as GenealogyMember, s as GenerationIndiType, t as GenerationSpouseType, a8 as Indi, a9 as IndiGenealogy, aa as IndiGenealogyGenerations, ab as IndiGenealogyResult, ad as IndiMarker, ae as IndiTree, af as IndiType, ag as Individuals, ak as List, am as MemberMain, an as MemberSide, ar as NonNullIndiGenealogyResult, at as Obje, av as ObjeType, aw as Objects, aB as Path, aC as PathItem, aH as ProfilePicture, aI as ProxyOriginal, aJ as Queue, aK as QueueItem, aN as ReducedPath, aP as Repo, aR as RepoType, aS as Repositories, aV as Sour, aX as SourType, aY as Sources, a_ as Subm, b0 as SubmType, b1 as Submitters, b4 as TreeMember, b6 as createCommon, b7 as createCommonDate, b8 as createCommonName, b9 as createCommonNote, ba as createFam, bb as createGedCom, bc as createIndi, bd as createObje, be as createProxy, bf as createRepo, bg as createSour, bh as createSubm, bn as getListTag, bp as getValidKey, bq as getValidKeys, br as getValidTag, bs as idGetter, bu as isCommonDate, bv as isGedcomString, bw as isId, by as isOnlyMainProp, bA as isValidKey, bB as mergeGedcoms, bF as validateGedcomContent } from '../index-CSjQRlxq.js';
2
2
  import 'date-fns';
@@ -4435,18 +4435,20 @@ var Indi = class extends Common {
4435
4435
  if (!tree) {
4436
4436
  return;
4437
4437
  }
4438
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
4439
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
4440
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
4441
- return fam?.get("MARR.OBJE");
4438
+ const objeList = this.get("OBJE")?.toList();
4439
+ const birthObj = this.get("BIRT.OBJE")?.toList();
4440
+ const deathObj = this.get("DEAT.OBJE")?.toList();
4441
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
4442
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
4442
4443
  });
4443
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
4444
+ objeList?.forEach((o, index) => {
4444
4445
  if (!o) {
4445
4446
  return;
4446
4447
  }
4447
4448
  const obje = o;
4448
4449
  const key = `@O${index}@`;
4449
4450
  obje.standardizeMedia();
4451
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
4450
4452
  const url = obje?.get("FILE")?.toValue();
4451
4453
  const title = obje?.get("NOTE")?.toValue() ?? "";
4452
4454
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -4454,7 +4456,7 @@ var Indi = class extends Common {
4454
4456
  if (url && imgId) {
4455
4457
  const id = `${tree}-${this.id}-${imgId}`;
4456
4458
  list[id] = {
4457
- isPrimary: false,
4459
+ isPrimary,
4458
4460
  key,
4459
4461
  id,
4460
4462
  tree,
@@ -4564,7 +4566,7 @@ var Indi = class extends Common {
4564
4566
  }
4565
4567
  return void 0;
4566
4568
  }
4567
- async getProfilePicture(namespace) {
4569
+ async getProfilePicture(namespace, onlyPrimary = true) {
4568
4570
  const mediaList = await this.multimedia(namespace);
4569
4571
  if (!mediaList) {
4570
4572
  return void 0;
@@ -4581,6 +4583,9 @@ var Indi = class extends Common {
4581
4583
  isPrimary: true
4582
4584
  };
4583
4585
  }
4586
+ if (!onlyPrimary) {
4587
+ return void 0;
4588
+ }
4584
4589
  const secondaryMedia = mediaArray.find(
4585
4590
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
4586
4591
  );
@@ -5883,7 +5888,7 @@ var createIndi = (gedcom, id, main, parent) => {
5883
5888
 
5884
5889
  // package.json
5885
5890
  var package_default = {
5886
- version: "1.0.21"};
5891
+ version: "1.0.23"};
5887
5892
 
5888
5893
  // src/utils/get-product-details.ts
5889
5894
  var getVersion = () => package_default.version;
package/dist/cli/index.js CHANGED
@@ -2001,18 +2001,20 @@ var Indi = class extends Common {
2001
2001
  if (!tree) {
2002
2002
  return;
2003
2003
  }
2004
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
2005
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
2006
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
2007
- return fam?.get("MARR.OBJE");
2004
+ const objeList = this.get("OBJE")?.toList();
2005
+ const birthObj = this.get("BIRT.OBJE")?.toList();
2006
+ const deathObj = this.get("DEAT.OBJE")?.toList();
2007
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
2008
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
2008
2009
  });
2009
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
2010
+ objeList?.forEach((o, index) => {
2010
2011
  if (!o) {
2011
2012
  return;
2012
2013
  }
2013
2014
  const obje = o;
2014
2015
  const key = `@O${index}@`;
2015
2016
  obje.standardizeMedia();
2017
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
2016
2018
  const url = obje?.get("FILE")?.toValue();
2017
2019
  const title = obje?.get("NOTE")?.toValue() ?? "";
2018
2020
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -2020,7 +2022,7 @@ var Indi = class extends Common {
2020
2022
  if (url && imgId) {
2021
2023
  const id = `${tree}-${this.id}-${imgId}`;
2022
2024
  list[id] = {
2023
- isPrimary: false,
2025
+ isPrimary,
2024
2026
  key,
2025
2027
  id,
2026
2028
  tree,
@@ -2130,7 +2132,7 @@ var Indi = class extends Common {
2130
2132
  }
2131
2133
  return void 0;
2132
2134
  }
2133
- async getProfilePicture(namespace) {
2135
+ async getProfilePicture(namespace, onlyPrimary = true) {
2134
2136
  const mediaList = await this.multimedia(namespace);
2135
2137
  if (!mediaList) {
2136
2138
  return void 0;
@@ -2147,6 +2149,9 @@ var Indi = class extends Common {
2147
2149
  isPrimary: true
2148
2150
  };
2149
2151
  }
2152
+ if (!onlyPrimary) {
2153
+ return void 0;
2154
+ }
2150
2155
  const secondaryMedia = mediaArray.find(
2151
2156
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
2152
2157
  );
@@ -5876,7 +5881,7 @@ var Families = class _Families extends List {
5876
5881
 
5877
5882
  // package.json
5878
5883
  var package_default = {
5879
- version: "1.0.21"};
5884
+ version: "1.0.23"};
5880
5885
 
5881
5886
  // src/utils/get-product-details.ts
5882
5887
  var isDevelopment = () => {
@@ -1,4 +1,4 @@
1
- import { x as Filter, y as RequiredFilter, W as RelationType, X as PartnerType, A as Order, K as NameOrder, B as OrderIterator, a1 as IndiType, n as IndiKey } from '../index-BPEVN_DY.js';
1
+ import { aT as RequiredFilter, aO as RelationType, n as Filter, aA as PartnerType, ax as Order, az as OrderIterator, af as IndiType, ac as IndiKey, ap as NameOrder } from '../index-CSjQRlxq.js';
2
2
  import 'date-fns';
3
3
 
4
4
  /**
@@ -2596,18 +2596,20 @@ var Indi = class extends Common {
2596
2596
  if (!tree) {
2597
2597
  return;
2598
2598
  }
2599
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
2600
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
2601
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
2602
- return fam?.get("MARR.OBJE");
2599
+ const objeList = this.get("OBJE")?.toList();
2600
+ const birthObj = this.get("BIRT.OBJE")?.toList();
2601
+ const deathObj = this.get("DEAT.OBJE")?.toList();
2602
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
2603
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
2603
2604
  });
2604
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
2605
+ objeList?.forEach((o, index) => {
2605
2606
  if (!o) {
2606
2607
  return;
2607
2608
  }
2608
2609
  const obje = o;
2609
2610
  const key = `@O${index}@`;
2610
2611
  obje.standardizeMedia();
2612
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
2611
2613
  const url = obje?.get("FILE")?.toValue();
2612
2614
  const title = obje?.get("NOTE")?.toValue() ?? "";
2613
2615
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -2615,7 +2617,7 @@ var Indi = class extends Common {
2615
2617
  if (url && imgId) {
2616
2618
  const id = `${tree}-${this.id}-${imgId}`;
2617
2619
  list[id] = {
2618
- isPrimary: false,
2620
+ isPrimary,
2619
2621
  key,
2620
2622
  id,
2621
2623
  tree,
@@ -2725,7 +2727,7 @@ var Indi = class extends Common {
2725
2727
  }
2726
2728
  return void 0;
2727
2729
  }
2728
- async getProfilePicture(namespace) {
2730
+ async getProfilePicture(namespace, onlyPrimary = true) {
2729
2731
  const mediaList = await this.multimedia(namespace);
2730
2732
  if (!mediaList) {
2731
2733
  return void 0;
@@ -2742,6 +2744,9 @@ var Indi = class extends Common {
2742
2744
  isPrimary: true
2743
2745
  };
2744
2746
  }
2747
+ if (!onlyPrimary) {
2748
+ return void 0;
2749
+ }
2745
2750
  const secondaryMedia = mediaArray.find(
2746
2751
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
2747
2752
  );
@@ -1,6 +1,6 @@
1
- import { I as ICacheManager, P as PlaceParts } from '../place-parser-CM0TJFj8.js';
1
+ import { I as ICacheManager, P as PlaceParts } from '../place-parser-Dl5iva3h.js';
2
2
  import { Locale } from 'date-fns';
3
- import { a1 as IndiType, n as IndiKey, L as Language } from '../index-BPEVN_DY.js';
3
+ import { af as IndiType, ac as IndiKey, ai as Language } from '../index-CSjQRlxq.js';
4
4
 
5
5
  /**
6
6
  * Factory function type for creating cache manager instances.
@@ -3023,18 +3023,20 @@ var Indi = class extends Common {
3023
3023
  if (!tree) {
3024
3024
  return;
3025
3025
  }
3026
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
3027
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
3028
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
3029
- return fam?.get("MARR.OBJE");
3026
+ const objeList = this.get("OBJE")?.toList();
3027
+ const birthObj = this.get("BIRT.OBJE")?.toList();
3028
+ const deathObj = this.get("DEAT.OBJE")?.toList();
3029
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
3030
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
3030
3031
  });
3031
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
3032
+ objeList?.forEach((o, index) => {
3032
3033
  if (!o) {
3033
3034
  return;
3034
3035
  }
3035
3036
  const obje = o;
3036
3037
  const key = `@O${index}@`;
3037
3038
  obje.standardizeMedia();
3039
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
3038
3040
  const url = obje?.get("FILE")?.toValue();
3039
3041
  const title = obje?.get("NOTE")?.toValue() ?? "";
3040
3042
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -3042,7 +3044,7 @@ var Indi = class extends Common {
3042
3044
  if (url && imgId) {
3043
3045
  const id = `${tree}-${this.id}-${imgId}`;
3044
3046
  list[id] = {
3045
- isPrimary: false,
3047
+ isPrimary,
3046
3048
  key,
3047
3049
  id,
3048
3050
  tree,
@@ -3152,7 +3154,7 @@ var Indi = class extends Common {
3152
3154
  }
3153
3155
  return void 0;
3154
3156
  }
3155
- async getProfilePicture(namespace) {
3157
+ async getProfilePicture(namespace, onlyPrimary = true) {
3156
3158
  const mediaList = await this.multimedia(namespace);
3157
3159
  if (!mediaList) {
3158
3160
  return void 0;
@@ -3169,6 +3171,9 @@ var Indi = class extends Common {
3169
3171
  isPrimary: true
3170
3172
  };
3171
3173
  }
3174
+ if (!onlyPrimary) {
3175
+ return void 0;
3176
+ }
3172
3177
  const secondaryMedia = mediaArray.find(
3173
3178
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
3174
3179
  );
@@ -856,7 +856,7 @@ declare class Indi extends Common<string, IndiKey> implements IIndi {
856
856
  hasFamilySearchSources(): boolean;
857
857
  getFamilySearchSources(): FamilySearchSource[];
858
858
  multimedia(namespace?: string | number): Promise<MediaList | undefined>;
859
- getProfilePicture(namespace?: string | number): Promise<ProfilePicture | undefined>;
859
+ getProfilePicture(namespace?: string | number, onlyPrimary?: boolean): Promise<ProfilePicture | undefined>;
860
860
  link(poolId?: number): string;
861
861
  toFamilies(list?: List): Families;
862
862
  getFamilies(type: "FAMC" | "FAMS"): Families;
@@ -1672,4 +1672,4 @@ declare const getValidKey: (tag: string, id: string) => string;
1672
1672
  declare const isId: (string: string) => string is IdType;
1673
1673
  declare const idGetter: <T extends IdType>(id?: T) => T;
1674
1674
 
1675
- export { type RepoType as $, type Order as A, type OrderIterator as B, type Cases as C, type Group as D, type GroupMarker as E, type FamKey as F, type GroupDefinition as G, type GroupIterator as H, type IKinshipTranslator as I, type NestedGroup as J, type NameOrder as K, type Language as L, type MultiTag as M, type NonStandard as N, type ObjeKey as O, type PrimitiveRange as P, type PlaceOrder as Q, type Range$1 as R, type SplitResult as S, type TagKey as T, type UnknownKey as U, type LinkedPersons as V, RelationType as W, PartnerType as X, Range as Y, type ProxyOriginal as Z, type SourType as _, isIntersectedRange as a, Sour as a$, type SubmType as a0, type IndiType as a1, type TreeMember as a2, type GenealogyMember as a3, type IndiTree as a4, type IndiGenealogy as a5, type IndiMarker as a6, type MemberSide as a7, type MemberMain as a8, type GenerationSpouseType as a9, createCommonDate as aA, isCommonDate as aB, Fam as aC, createFam as aD, Families as aE, GedCom as aF, createGedCom as aG, isGedcomString as aH, validateGedcomContent as aI, mergeGedcoms as aJ, Indi as aK, type FamilySearchMatch as aL, type FamilySearchSource as aM, type ProfilePicture as aN, createIndi as aO, Individuals as aP, List as aQ, CommonName as aR, createCommonName as aS, CommonNote as aT, createCommonNote as aU, Obje as aV, createObje as aW, Objects as aX, Repo as aY, createRepo as aZ, Repositories as a_, type GenerationIndiType as aa, type IndiGenealogyGenerations as ab, type IndiGenealogyResult as ac, type NonNullIndiGenealogyResult as ad, type PathItem as ae, type Path as af, type ReducedPath as ag, type QueueItem as ah, type Queue as ai, type FamType as aj, type GedComType as ak, type ObjeType as al, Existed as am, CustomTags as an, Common as ao, createProxy as ap, createCommon as aq, isOnlyMainProp as ar, isValidKey as as, getValidKeys as at, getValidTag as au, getListTag as av, getValidKey as aw, isId as ax, idGetter as ay, CommonDate as az, isRangeContained as b, createSour as b0, Sources as b1, Subm as b2, createSubm as b3, Submitters as b4, type ICommon as b5, type IFam as b6, type IFamilies as b7, type IGedcom as b8, type IIndi as b9, type ISourceCitationStructure as bA, type ISourceRepositoryCitationStructure as bB, type ISourceStructure as bC, type Place as bD, PlaceType as bE, getPlaces as bF, type GeneratedIndiMethods as ba, type IIndividuals as bb, type IList as bc, type IObje as bd, type IRepo as be, type ISour as bf, type ISubm as bg, type IAddressStructure as bh, type IAssociationStructure as bi, type IChangeDateStructure as bj, type ICreationDateStructure as bk, type IDateStructure as bl, type IEventDetailStructure as bm, type IFamilyStructure as bn, type IGedComStructure as bo, type IIndividualEventDetailStructure as bp, type IIndividualEventStructure as bq, type IIndividualStructure as br, type ILdsOrdinanceDetailStructure as bs, type ILdsSpouseSealingStructure as bt, type IMarriageDateStructure as bu, type IMultimediaLinkStructure as bv, type INonEventStructure as bw, type INoteStructure as bx, type IPlaceStructure as by, type IRepositoryStructure as bz, splitOverlappingRanges as c, findMatchingRangeForSplitRange as d, extractSplitPoints as e, fromTuple as f, generateSplitRanges as g, extractSeparationYears as h, inRange as i, type CrossCase as j, type CrossCases as k, type Settings as l, type ConvertType as m, type IndiKey as n, type RepoKey as o, parseRangeBounds as p, type SourKey as q, type SubmKey as r, splitRange as s, type IdType as t, type Tag as u, type ListTag as v, type FilterIterator as w, type Filter as x, type RequiredFilter as y, type OrderDefinition as z };
1675
+ export { type IPlaceStructure as $, type ICommon as A, type ICreationDateStructure as B, type Cases as C, type IDateStructure as D, Existed as E, Fam as F, GedCom as G, type IEventDetailStructure as H, type IAddressStructure as I, type IFam as J, type IFamilies as K, type IFamilyStructure as L, type IGedcom as M, type IGedComStructure as N, type IIndi as O, type IIndividualStructure as P, type IIndividualEventStructure as Q, type IIndividualEventDetailStructure as R, type IIndividuals as S, type ILdsOrdinanceDetailStructure as T, type ILdsSpouseSealingStructure as U, type IList as V, type IMarriageDateStructure as W, type IMultimediaLinkStructure as X, type INonEventStructure as Y, type INoteStructure as Z, type IObje as _, Common as a, type SubmKey as a$, type IRepo as a0, type IRepositoryStructure as a1, type ISour as a2, type ISourceStructure as a3, type ISourceCitationStructure as a4, type ISourceRepositoryCitationStructure as a5, type ISubm as a6, type IdType as a7, Indi as a8, type IndiGenealogy as a9, PartnerType as aA, type Path as aB, type PathItem as aC, type Place as aD, type PlaceOrder as aE, PlaceType as aF, type PrimitiveRange as aG, type ProfilePicture as aH, type ProxyOriginal as aI, type Queue as aJ, type QueueItem as aK, Range as aL, type Range$1 as aM, type ReducedPath as aN, RelationType as aO, Repo as aP, type RepoKey as aQ, type RepoType as aR, Repositories as aS, type RequiredFilter as aT, type Settings as aU, Sour as aV, type SourKey as aW, type SourType as aX, Sources as aY, type SplitResult as aZ, Subm as a_, type IndiGenealogyGenerations as aa, type IndiGenealogyResult as ab, type IndiKey as ac, type IndiMarker as ad, type IndiTree as ae, type IndiType as af, Individuals as ag, type IKinshipTranslator as ah, type Language as ai, type LinkedPersons as aj, List as ak, type ListTag as al, type MemberMain as am, type MemberSide as an, type MultiTag as ao, type NameOrder as ap, type NestedGroup as aq, type NonNullIndiGenealogyResult as ar, type NonStandard as as, Obje as at, type ObjeKey as au, type ObjeType as av, Objects as aw, type Order as ax, type OrderDefinition as ay, type OrderIterator as az, CommonDate as b, type SubmType as b0, Submitters as b1, type Tag as b2, type TagKey as b3, type TreeMember as b4, type UnknownKey as b5, createCommon as b6, createCommonDate as b7, createCommonName as b8, createCommonNote as b9, isValidKey as bA, mergeGedcoms as bB, parseRangeBounds as bC, splitOverlappingRanges as bD, splitRange as bE, validateGedcomContent as bF, createFam as ba, createGedCom as bb, createIndi as bc, createObje as bd, createProxy as be, createRepo as bf, createSour as bg, createSubm as bh, extractSeparationYears as bi, extractSplitPoints as bj, findMatchingRangeForSplitRange as bk, fromTuple as bl, generateSplitRanges as bm, getListTag as bn, getPlaces as bo, getValidKey as bp, getValidKeys as bq, getValidTag as br, idGetter as bs, inRange as bt, isCommonDate as bu, isGedcomString as bv, isId as bw, isIntersectedRange as bx, isOnlyMainProp as by, isRangeContained as bz, CommonName as c, CommonNote as d, type ConvertType as e, type CrossCase as f, type CrossCases as g, CustomTags as h, type FamKey as i, type FamType as j, Families as k, type FamilySearchMatch as l, type FamilySearchSource as m, type Filter as n, type FilterIterator as o, type GedComType as p, type GenealogyMember as q, type GeneratedIndiMethods as r, type GenerationIndiType as s, type GenerationSpouseType as t, type Group as u, type GroupDefinition as v, type GroupIterator as w, type GroupMarker as x, type IAssociationStructure as y, type IChangeDateStructure as z };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, b as commonDateFormatter, c as create, d as dateFormatter, G as default, e as getAllProp, f as getFamilyWith, j as getName, g as getRawSize, h as getVersion, q as hungarianOrdinalize, k as implemented, i as isDevelopment, m as marriageDateFormatter, o as nameFormatter, l as notImplemented, n as noteDateFormatter, p as ordinalize, r as placeTranslator, s as setNestedGroup } from './place-translator-CRiaOO9v.js';
1
+ export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, c as commonDateFormatter, b as create, d as dateFormatter, G as default, g as getAllProp, e as getFamilyWith, f as getName, h as getRawSize, i as getVersion, j as hungarianOrdinalize, k as implemented, l as isDevelopment, m as marriageDateFormatter, n as nameFormatter, o as notImplemented, p as noteDateFormatter, q as ordinalize, r as placeTranslator, s as setNestedGroup } from './place-translator-BYX8180A.js';
2
2
  export { CacheManagerFactory, DateLocaleProvider, I18nProvider, KinshipTranslatorConstructor, PlaceParserFunction, PlaceTranslatorFunction, getCacheManagerFactory, getDateLocale, getI18n, getKinshipTranslatorClass, getPlaceParserProvider, getPlaceTranslatorProvider, i18n, resetCacheManagerFactory, resetDateLocaleProvider, resetI18nProvider, resetKinshipTranslatorClass, resetPlaceParserProvider, resetPlaceTranslatorProvider, setCacheManagerFactory, setDateLocaleProvider, setI18nProvider, setKinshipTranslatorClass, setPlaceParserProvider, setPlaceTranslatorProvider } from './factories/index.js';
3
- export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from './place-parser-CM0TJFj8.js';
3
+ export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, r as relativesCache, a as resetRelativesCache } from './place-parser-Dl5iva3h.js';
4
4
  export { KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDE, KinshipTranslatorEN, KinshipTranslatorES, KinshipTranslatorFR, KinshipTranslatorHU, translators } from './kinship-translator/index.js';
5
- export { C as Cases, ao as Common, az as CommonDate, aR as CommonName, aT as CommonNote, m as ConvertType, j as CrossCase, k as CrossCases, an as CustomTags, am as Existed, aC as Fam, F as FamKey, aj as FamType, aE as Families, aL as FamilySearchMatch, aM as FamilySearchSource, x as Filter, w as FilterIterator, aF as GedCom, ak as GedComType, a3 as GenealogyMember, ba as GeneratedIndiMethods, aa as GenerationIndiType, a9 as GenerationSpouseType, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, bh as IAddress, bi as IAssociation, bj as IChangeDate, b5 as ICommon, bk as ICreationDate, bl as IDate, bm as IEventDetail, bm as IEventDetailStructure, b6 as IFam, b7 as IFamilies, bn as IFamily, b8 as IGedCom, bo as IGedcomStructure, b9 as IIndi, br as IIndividual, bq as IIndividualEvent, bp as IIndividualEventDetail, br as IIndividualStructure, bb as IIndividuals, bs as ILdsOrdinanceDetail, bt as ILdsSpouseSealing, bc as IList, bu as IMarriageDate, bv as IMultimediaLink, bw as INonEvent, bx as INote, bd as IObje, by as IPlace, be as IRepo, bz as IRepository, bf as ISour, bC as ISource, bA as ISourceCitation, bB as ISourceRepositoryCitation, bg as ISubm, t as IdType, aK as Indi, a5 as IndiGenealogy, ab as IndiGenealogyGenerations, ac as IndiGenealogyResult, n as IndiKey, a6 as IndiMarker, a4 as IndiTree, a1 as IndiType, aP as Individuals, I as KinshipTranslatorInterface, L as Language, V as LinkedPersons, aQ as List, v as ListTag, a8 as MemberMain, a7 as MemberSide, M as MultiTag, K as NameOrder, J as NestedGroup, ad as NonNullIndiGenealogyResult, N as NonStandard, aV as Obje, O as ObjeKey, al as ObjeType, aX as Objects, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, af as Path, ae as PathItem, bD as Place, Q as PlaceOrder, bE as PlaceType, P as PrimitiveRange, aN as ProfilePicture, Z as ProxyOriginal, ai as Queue, ah as QueueItem, Y as Range, R as RangeType, ag as ReducedPath, W as RelationType, aY as Repo, o as RepoKey, $ as RepoType, a_ as Repositories, y as RequiredFilter, l as Settings, a$ as Sour, q as SourKey, _ as SourType, b1 as Sources, S as SplitResult, b2 as Subm, r as SubmKey, a0 as SubmType, b4 as Submitters, u as Tag, T as TagKey, a2 as TreeMember, U as UnknownKey, aq as createCommon, aA as createCommonDate, aS as createCommonName, aU as createCommonNote, aD as createFam, aG as createGedCom, aO as createIndi, aW as createObje, ap as createProxy, aZ as createRepo, b0 as createSour, b3 as createSubm, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, av as getListTag, bF as getPlaces, aw as getValidKey, at as getValidKeys, au as getValidTag, ay as idGetter, i as inRange, aB as isCommonDate, aH as isGedcomString, ax as isId, a as isIntersectedRange, ar as isOnlyMainProp, b as isRangeContained, as as isValidKey, aJ as mergeGedcoms, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange, aI as validateGedcomContent } from './index-BPEVN_DY.js';
5
+ export { C as Cases, a as Common, b as CommonDate, c as CommonName, d as CommonNote, e as ConvertType, f as CrossCase, g as CrossCases, h as CustomTags, E as Existed, F as Fam, i as FamKey, j as FamType, k as Families, l as FamilySearchMatch, m as FamilySearchSource, n as Filter, o as FilterIterator, G as GedCom, p as GedComType, q as GenealogyMember, r as GeneratedIndiMethods, s as GenerationIndiType, t as GenerationSpouseType, u as Group, v as GroupDefinition, w as GroupIterator, x as GroupMarker, I as IAddress, y as IAssociation, z as IChangeDate, A as ICommon, B as ICreationDate, D as IDate, H as IEventDetail, H as IEventDetailStructure, J as IFam, K as IFamilies, L as IFamily, M as IGedCom, N as IGedcomStructure, O as IIndi, P as IIndividual, Q as IIndividualEvent, R as IIndividualEventDetail, P as IIndividualStructure, S as IIndividuals, T as ILdsOrdinanceDetail, U as ILdsSpouseSealing, V as IList, W as IMarriageDate, X as IMultimediaLink, Y as INonEvent, Z as INote, _ as IObje, $ as IPlace, a0 as IRepo, a1 as IRepository, a2 as ISour, a3 as ISource, a4 as ISourceCitation, a5 as ISourceRepositoryCitation, a6 as ISubm, a7 as IdType, a8 as Indi, a9 as IndiGenealogy, aa as IndiGenealogyGenerations, ab as IndiGenealogyResult, ac as IndiKey, ad as IndiMarker, ae as IndiTree, af as IndiType, ag as Individuals, ah as KinshipTranslatorInterface, ai as Language, aj as LinkedPersons, ak as List, al as ListTag, am as MemberMain, an as MemberSide, ao as MultiTag, ap as NameOrder, aq as NestedGroup, ar as NonNullIndiGenealogyResult, as as NonStandard, at as Obje, au as ObjeKey, av as ObjeType, aw as Objects, ax as Order, ay as OrderDefinition, az as OrderIterator, aA as PartnerType, aB as Path, aC as PathItem, aD as Place, aE as PlaceOrder, aF as PlaceType, aG as PrimitiveRange, aH as ProfilePicture, aI as ProxyOriginal, aJ as Queue, aK as QueueItem, aL as Range, aM as RangeType, aN as ReducedPath, aO as RelationType, aP as Repo, aQ as RepoKey, aR as RepoType, aS as Repositories, aT as RequiredFilter, aU as Settings, aV as Sour, aW as SourKey, aX as SourType, aY as Sources, aZ as SplitResult, a_ as Subm, a$ as SubmKey, b0 as SubmType, b1 as Submitters, b2 as Tag, b3 as TagKey, b4 as TreeMember, b5 as UnknownKey, b6 as createCommon, b7 as createCommonDate, b8 as createCommonName, b9 as createCommonNote, ba as createFam, bb as createGedCom, bc as createIndi, bd as createObje, be as createProxy, bf as createRepo, bg as createSour, bh as createSubm, bi as extractSeparationYears, bj as extractSplitPoints, bk as findMatchingRangeForSplitRange, bl as fromTuple, bm as generateSplitRanges, bn as getListTag, bo as getPlaces, bp as getValidKey, bq as getValidKeys, br as getValidTag, bs as idGetter, bt as inRange, bu as isCommonDate, bv as isGedcomString, bw as isId, bx as isIntersectedRange, by as isOnlyMainProp, bz as isRangeContained, bA as isValidKey, bB as mergeGedcoms, bC as parseRangeBounds, bD as splitOverlappingRanges, bE as splitRange, bF as validateGedcomContent } from './index-CSjQRlxq.js';
6
6
  export { AncestryMedia } from './types/index.js';
7
7
  export { ADOPTED, BIOLOGICAL, BIRTH, BIRTH_ASC, BIRTH_DESC, DATE_ASC, DATE_DESC, DEATH_ASC, DEATH_DESC, DEFAULT, EVERY, FEMALE, FOSTER, FRIEND, ID_GETTER_REG, ID_REG, ID_SPLIT_REG, LINE_REG, MALE, MAX_FILE_SIZE_TO_SYNC, OTHER, PARTNER, REF_LINE_REG, SEALING, SINGLE, SPOUSE, STEP, UNKOWN, getBirthAsc, getMarriageAsc, getMarriageAscAndBirth, getMarriageAscAndChildBirth, getNameAsc, getNameAscAndBirth, getNameDesc } from './constants/index.js';
8
8
  export { IPersonalName, IPersonalNamePieces } from './structures/index.js';
package/dist/index.js CHANGED
@@ -2101,18 +2101,20 @@ var Indi = class extends Common {
2101
2101
  if (!tree) {
2102
2102
  return;
2103
2103
  }
2104
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
2105
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
2106
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
2107
- return fam?.get("MARR.OBJE");
2104
+ const objeList = this.get("OBJE")?.toList();
2105
+ const birthObj = this.get("BIRT.OBJE")?.toList();
2106
+ const deathObj = this.get("DEAT.OBJE")?.toList();
2107
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
2108
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
2108
2109
  });
2109
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
2110
+ objeList?.forEach((o, index) => {
2110
2111
  if (!o) {
2111
2112
  return;
2112
2113
  }
2113
2114
  const obje = o;
2114
2115
  const key = `@O${index}@`;
2115
2116
  obje.standardizeMedia();
2117
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
2116
2118
  const url = obje?.get("FILE")?.toValue();
2117
2119
  const title = obje?.get("NOTE")?.toValue() ?? "";
2118
2120
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -2120,7 +2122,7 @@ var Indi = class extends Common {
2120
2122
  if (url && imgId) {
2121
2123
  const id = `${tree}-${this.id}-${imgId}`;
2122
2124
  list[id] = {
2123
- isPrimary: false,
2125
+ isPrimary,
2124
2126
  key,
2125
2127
  id,
2126
2128
  tree,
@@ -2230,7 +2232,7 @@ var Indi = class extends Common {
2230
2232
  }
2231
2233
  return void 0;
2232
2234
  }
2233
- async getProfilePicture(namespace) {
2235
+ async getProfilePicture(namespace, onlyPrimary = true) {
2234
2236
  const mediaList = await this.multimedia(namespace);
2235
2237
  if (!mediaList) {
2236
2238
  return void 0;
@@ -2247,6 +2249,9 @@ var Indi = class extends Common {
2247
2249
  isPrimary: true
2248
2250
  };
2249
2251
  }
2252
+ if (!onlyPrimary) {
2253
+ return void 0;
2254
+ }
2250
2255
  const secondaryMedia = mediaArray.find(
2251
2256
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
2252
2257
  );
@@ -6269,7 +6274,7 @@ var Families = class _Families extends List {
6269
6274
  // package.json
6270
6275
  var package_default = {
6271
6276
  name: "@treeviz/gedcom-parser",
6272
- version: "1.0.21"};
6277
+ version: "1.0.23"};
6273
6278
 
6274
6279
  // src/utils/get-product-details.ts
6275
6280
  var isDevelopment = () => {
@@ -1,2 +1,2 @@
1
- export { ba as GeneratedIndiMethods, b5 as ICommon, b6 as IFam, b7 as IFamilies, b8 as IGedCom, b9 as IIndi, bb as IIndividuals, bc as IList, bd as IObje, be as IRepo, bf as ISour, bg as ISubm } from '../index-BPEVN_DY.js';
1
+ export { r as GeneratedIndiMethods, A as ICommon, J as IFam, K as IFamilies, M as IGedCom, O as IIndi, S as IIndividuals, V as IList, _ as IObje, a0 as IRepo, a2 as ISour, a6 as ISubm } from '../index-CSjQRlxq.js';
2
2
  import 'date-fns';
@@ -1,5 +1,5 @@
1
- import { I as IKinshipTranslator, af as Path, ae as PathItem, a1 as IndiType, n as IndiKey, L as Language } from '../index-BPEVN_DY.js';
2
- export { C as Cases, j as CrossCase, k as CrossCases } from '../index-BPEVN_DY.js';
1
+ import { ah as IKinshipTranslator, aB as Path, aC as PathItem, af as IndiType, ac as IndiKey, ai as Language } from '../index-CSjQRlxq.js';
2
+ export { C as Cases, f as CrossCase, g as CrossCases } from '../index-CSjQRlxq.js';
3
3
  import 'date-fns';
4
4
 
5
5
  declare class KinshipTranslatorBasic implements IKinshipTranslator {
@@ -4187,18 +4187,20 @@ var Indi = class extends Common {
4187
4187
  if (!tree) {
4188
4188
  return;
4189
4189
  }
4190
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
4191
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
4192
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
4193
- return fam?.get("MARR.OBJE");
4190
+ const objeList = this.get("OBJE")?.toList();
4191
+ const birthObj = this.get("BIRT.OBJE")?.toList();
4192
+ const deathObj = this.get("DEAT.OBJE")?.toList();
4193
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
4194
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
4194
4195
  });
4195
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
4196
+ objeList?.forEach((o, index) => {
4196
4197
  if (!o) {
4197
4198
  return;
4198
4199
  }
4199
4200
  const obje = o;
4200
4201
  const key = `@O${index}@`;
4201
4202
  obje.standardizeMedia();
4203
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
4202
4204
  const url = obje?.get("FILE")?.toValue();
4203
4205
  const title = obje?.get("NOTE")?.toValue() ?? "";
4204
4206
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -4206,7 +4208,7 @@ var Indi = class extends Common {
4206
4208
  if (url && imgId) {
4207
4209
  const id = `${tree}-${this.id}-${imgId}`;
4208
4210
  list[id] = {
4209
- isPrimary: false,
4211
+ isPrimary,
4210
4212
  key,
4211
4213
  id,
4212
4214
  tree,
@@ -4316,7 +4318,7 @@ var Indi = class extends Common {
4316
4318
  }
4317
4319
  return void 0;
4318
4320
  }
4319
- async getProfilePicture(namespace) {
4321
+ async getProfilePicture(namespace, onlyPrimary = true) {
4320
4322
  const mediaList = await this.multimedia(namespace);
4321
4323
  if (!mediaList) {
4322
4324
  return void 0;
@@ -4333,6 +4335,9 @@ var Indi = class extends Common {
4333
4335
  isPrimary: true
4334
4336
  };
4335
4337
  }
4338
+ if (!onlyPrimary) {
4339
+ return void 0;
4340
+ }
4336
4341
  const secondaryMedia = mediaArray.find(
4337
4342
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
4338
4343
  );
@@ -1,4 +1,4 @@
1
- import { n as IndiKey, af as Path, aP as Individuals } from './index-BPEVN_DY.js';
1
+ import { ac as IndiKey, aB as Path, ag as Individuals } from './index-CSjQRlxq.js';
2
2
 
3
3
  /**
4
4
  * Cache manager interface for pluggable cache implementations.
@@ -34,4 +34,4 @@ interface PlaceParts {
34
34
  */
35
35
  declare const getPlaceParts: (place?: string | (string | undefined)[]) => PlaceParts[];
36
36
 
37
- export { type CacheRelatives as C, type ICacheManager as I, type PlaceParts as P, relativesCache as a, getPlaceParts as g, pathCache as p, resetRelativesCache as r };
37
+ export { type CacheRelatives as C, type ICacheManager as I, type PlaceParts as P, resetRelativesCache as a, getPlaceParts as g, pathCache as p, relativesCache as r };
@@ -1,4 +1,4 @@
1
- import { l as Settings, ak as GedComType, M as MultiTag, ao as Common, t as IdType, bl as IDateStructure, aj as FamType, az as CommonDate, a1 as IndiType, n as IndiKey, J as NestedGroup, aP as Individuals } from './index-BPEVN_DY.js';
1
+ import { aU as Settings, p as GedComType, ao as MultiTag, a as Common, a7 as IdType, D as IDateStructure, af as IndiType, ac as IndiKey, j as FamType, b as CommonDate, aq as NestedGroup, ag as Individuals } from './index-CSjQRlxq.js';
2
2
 
3
3
  declare const GedcomTree: {
4
4
  parse: (content: string, options?: {
@@ -85,4 +85,4 @@ declare const hungarianOrdinalize: (n: number) => string;
85
85
  */
86
86
  declare const placeTranslator: (place: string | string[]) => string;
87
87
 
88
- export { ACCEPTED_DATE_FORMATS as A, GedcomTree as G, ACCEPTED_DATE_FORMATS_REGEX as a, commonDateFormatter as b, create as c, dateFormatter as d, getAllProp as e, getFamilyWith as f, getRawSize as g, getVersion as h, isDevelopment as i, getName as j, implemented as k, notImplemented as l, marriageDateFormatter as m, noteDateFormatter as n, nameFormatter as o, ordinalize as p, hungarianOrdinalize as q, placeTranslator as r, setNestedGroup as s };
88
+ export { ACCEPTED_DATE_FORMATS as A, GedcomTree as G, ACCEPTED_DATE_FORMATS_REGEX as a, create as b, commonDateFormatter as c, dateFormatter as d, getFamilyWith as e, getName as f, getAllProp as g, getRawSize as h, getVersion as i, hungarianOrdinalize as j, implemented as k, isDevelopment as l, marriageDateFormatter as m, nameFormatter as n, notImplemented as o, noteDateFormatter as p, ordinalize as q, placeTranslator as r, setNestedGroup as s };
@@ -1,5 +1,5 @@
1
- import { ao as Common, bx as INoteStructure, bA as ISourceCitationStructure } from '../index-BPEVN_DY.js';
2
- export { bh as IAddress, bi as IAssociation, bj as IChangeDate, bk as ICreationDate, bl as IDate, bm as IEventDetail, bm as IEventDetailStructure, bn as IFamily, bo as IGedcomStructure, br as IIndividual, bq as IIndividualEvent, bp as IIndividualEventDetail, br as IIndividualStructure, bs as ILdsOrdinanceDetail, bt as ILdsSpouseSealing, bu as IMarriageDate, bv as IMultimediaLink, bw as INonEvent, by as IPlace, bz as IRepository, bC as ISource, bB as ISourceRepositoryCitation } from '../index-BPEVN_DY.js';
1
+ import { a as Common, Z as INoteStructure, a4 as ISourceCitationStructure } from '../index-CSjQRlxq.js';
2
+ export { I as IAddress, y as IAssociation, z as IChangeDate, B as ICreationDate, D as IDate, H as IEventDetail, H as IEventDetailStructure, L as IFamily, N as IGedcomStructure, P as IIndividual, Q as IIndividualEvent, R as IIndividualEventDetail, P as IIndividualStructure, T as ILdsOrdinanceDetail, U as ILdsSpouseSealing, W as IMarriageDate, X as IMultimediaLink, Y as INonEvent, $ as IPlace, a1 as IRepository, a3 as ISource, a5 as ISourceRepositoryCitation } from '../index-CSjQRlxq.js';
3
3
  import 'date-fns';
4
4
 
5
5
  interface IPersonalNamePiecesStructure extends Common {
@@ -1,4 +1,4 @@
1
- export { m as ConvertType, F as FamKey, x as Filter, w as FilterIterator, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, t as IdType, n as IndiKey, V as LinkedPersons, v as ListTag, M as MultiTag, K as NameOrder, J as NestedGroup, N as NonStandard, O as ObjeKey, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, Q as PlaceOrder, Y as Range, W as RelationType, o as RepoKey, y as RequiredFilter, l as Settings, q as SourKey, r as SubmKey, u as Tag, T as TagKey, U as UnknownKey } from '../index-BPEVN_DY.js';
1
+ export { e as ConvertType, i as FamKey, n as Filter, o as FilterIterator, u as Group, v as GroupDefinition, w as GroupIterator, x as GroupMarker, a7 as IdType, ac as IndiKey, aj as LinkedPersons, al as ListTag, ao as MultiTag, ap as NameOrder, aq as NestedGroup, as as NonStandard, au as ObjeKey, ax as Order, ay as OrderDefinition, az as OrderIterator, aA as PartnerType, aE as PlaceOrder, aL as Range, aO as RelationType, aQ as RepoKey, aT as RequiredFilter, aU as Settings, aW as SourKey, a$ as SubmKey, b2 as Tag, b3 as TagKey, b5 as UnknownKey } from '../index-CSjQRlxq.js';
2
2
  import 'date-fns';
3
3
 
4
4
  interface AncestryMedia {
@@ -1,6 +1,6 @@
1
- export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from '../place-parser-CM0TJFj8.js';
2
- export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, b as commonDateFormatter, c as create, d as dateFormatter, e as getAllProp, f as getFamilyWith, j as getName, g as getRawSize, h as getVersion, q as hungarianOrdinalize, k as implemented, i as isDevelopment, m as marriageDateFormatter, o as nameFormatter, l as notImplemented, n as noteDateFormatter, p as ordinalize, r as placeTranslator, s as setNestedGroup } from '../place-translator-CRiaOO9v.js';
3
- export { bD as Place, bE as PlaceType, P as PrimitiveRange, R as Range, S as SplitResult, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, bF as getPlaces, i as inRange, a as isIntersectedRange, b as isRangeContained, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange } from '../index-BPEVN_DY.js';
1
+ export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, r as relativesCache, a as resetRelativesCache } from '../place-parser-Dl5iva3h.js';
2
+ export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, c as commonDateFormatter, b as create, d as dateFormatter, g as getAllProp, e as getFamilyWith, f as getName, h as getRawSize, i as getVersion, j as hungarianOrdinalize, k as implemented, l as isDevelopment, m as marriageDateFormatter, n as nameFormatter, o as notImplemented, p as noteDateFormatter, q as ordinalize, r as placeTranslator, s as setNestedGroup } from '../place-translator-BYX8180A.js';
3
+ export { aD as Place, aF as PlaceType, aG as PrimitiveRange, aM as Range, aZ as SplitResult, bi as extractSeparationYears, bj as extractSplitPoints, bk as findMatchingRangeForSplitRange, bl as fromTuple, bm as generateSplitRanges, bo as getPlaces, bt as inRange, bx as isIntersectedRange, bz as isRangeContained, bC as parseRangeBounds, bD as splitOverlappingRanges, bE as splitRange } from '../index-CSjQRlxq.js';
4
4
  import 'date-fns';
5
5
 
6
6
  /**
@@ -2813,18 +2813,20 @@ var Indi = class extends Common {
2813
2813
  if (!tree) {
2814
2814
  return;
2815
2815
  }
2816
- const birthObj = this.get("BIRT.OBJE")?.toList().values();
2817
- const deathObj = this.get("DEAT.OBJE")?.toValueList().values();
2818
- const familiesObj = (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).map((fam) => {
2819
- return fam?.get("MARR.OBJE");
2816
+ const objeList = this.get("OBJE")?.toList();
2817
+ const birthObj = this.get("BIRT.OBJE")?.toList();
2818
+ const deathObj = this.get("DEAT.OBJE")?.toList();
2819
+ (this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
2820
+ objeList?.merge(birthObj).merge(deathObj).merge(fam?.get("MARR.OBJE"));
2820
2821
  });
2821
- (birthObj ?? []).concat(deathObj ?? []).concat(familiesObj ?? []).forEach((o, index) => {
2822
+ objeList?.forEach((o, index) => {
2822
2823
  if (!o) {
2823
2824
  return;
2824
2825
  }
2825
2826
  const obje = o;
2826
2827
  const key = `@O${index}@`;
2827
2828
  obje.standardizeMedia();
2829
+ const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
2828
2830
  const url = obje?.get("FILE")?.toValue();
2829
2831
  const title = obje?.get("NOTE")?.toValue() ?? "";
2830
2832
  const type = obje?.get("FORM")?.toValue() ?? "raw";
@@ -2832,7 +2834,7 @@ var Indi = class extends Common {
2832
2834
  if (url && imgId) {
2833
2835
  const id = `${tree}-${this.id}-${imgId}`;
2834
2836
  list[id] = {
2835
- isPrimary: false,
2837
+ isPrimary,
2836
2838
  key,
2837
2839
  id,
2838
2840
  tree,
@@ -2942,7 +2944,7 @@ var Indi = class extends Common {
2942
2944
  }
2943
2945
  return void 0;
2944
2946
  }
2945
- async getProfilePicture(namespace) {
2947
+ async getProfilePicture(namespace, onlyPrimary = true) {
2946
2948
  const mediaList = await this.multimedia(namespace);
2947
2949
  if (!mediaList) {
2948
2950
  return void 0;
@@ -2959,6 +2961,9 @@ var Indi = class extends Common {
2959
2961
  isPrimary: true
2960
2962
  };
2961
2963
  }
2964
+ if (!onlyPrimary) {
2965
+ return void 0;
2966
+ }
2962
2967
  const secondaryMedia = mediaArray.find(
2963
2968
  (media) => isImageFormat(media.contentType || getFileExtension(media.url))
2964
2969
  );
@@ -6105,7 +6110,7 @@ var isCommonDate = (value) => {
6105
6110
  // package.json
6106
6111
  var package_default = {
6107
6112
  name: "@treeviz/gedcom-parser",
6108
- version: "1.0.21"};
6113
+ version: "1.0.23"};
6109
6114
 
6110
6115
  // src/utils/get-product-details.ts
6111
6116
  var isDevelopment = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeviz/gedcom-parser",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Lightweight, pluggable GEDCOM parser for JavaScript/TypeScript with optional caching and place matching. Zero browser dependencies.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",