@tricoteuses/assemblee 2.5.19 → 2.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/loaders.js CHANGED
@@ -1,15 +1,16 @@
1
- import q from "node:assert";
1
+ import C from "node:assert";
2
2
  import n from "fs-extra";
3
- import i from "node:path";
3
+ import s from "node:path";
4
4
  import "node:crypto";
5
- import { L as r, a1 as C, a2 as M, a3 as R, a4 as Z, a5 as B, a6 as J, Y, $ as G, a0 as K, X as ee, Z as te, _ as se } from "./uids-DaRrTkI-.js";
5
+ import { L as r, a1 as U, a2 as M, a3 as q, a4 as Z, a5 as B, a6 as J, Y as G, $ as K, a0 as ee, X as te, Z as ie, _ as se } from "./uids-DaRrTkI-.js";
6
6
  import "glob";
7
+ import { getChangedFilesSinceCommit as k } from "./git.js";
7
8
  import { C as N } from "./amendements-40Z7OJLT.js";
8
9
  var I = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ActeursEtOrganes = 1] = "ActeursEtOrganes", t[t.Agendas = 2] = "Agendas", t[t.Amendements = 4] = "Amendements", t[t.DossiersLegislatifs = 8] = "DossiersLegislatifs", t[t.Photos = 16] = "Photos", t[t.Scrutins = 32] = "Scrutins", t[t.Questions = 64] = "Questions", t[t.ComptesRendusSeances = 128] = "ComptesRendusSeances", t[t.All = 255] = "All", t))(I || {});
9
- async function h(t, s) {
10
- const e = i.join(s, t.filename);
11
- await n.pathExists(e) && await n.remove(e), await n.pathExists(i.join(s, `${t.filename}.temp`, "json")) ? await n.move(
12
- i.join(s, `${t.filename}.temp`, "json"),
10
+ async function h(t, i) {
11
+ const e = s.join(i, t.filename);
12
+ await n.pathExists(e) && await n.remove(e), await n.pathExists(s.join(i, `${t.filename}.temp`, "json")) ? await n.move(
13
+ s.join(i, `${t.filename}.temp`, "json"),
13
14
  e
14
15
  ) : await n.mkdir(e);
15
16
  }
@@ -279,16 +280,16 @@ const A = {
279
280
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVII.json",
280
281
  ignoreForWeb: !0,
281
282
  legislature: r.DixSept,
282
- repairZip: async (t, s) => {
283
- const e = i.join(s, t.filename);
283
+ repairZip: async (t, i) => {
284
+ const e = s.join(i, t.filename);
284
285
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
285
- i.join(s, `${t.filename}.temp`, "acteur")
286
+ s.join(i, `${t.filename}.temp`, "acteur")
286
287
  ) && await n.move(
287
- i.join(s, `${t.filename}.temp`, "acteur"),
288
- i.join(e, "acteur")
288
+ s.join(i, `${t.filename}.temp`, "acteur"),
289
+ s.join(e, "acteur")
289
290
  ), await n.move(
290
- i.join(s, `${t.filename}.temp`, "organe"),
291
- i.join(e, "organe")
291
+ s.join(i, `${t.filename}.temp`, "organe"),
292
+ s.join(e, "organe")
292
293
  );
293
294
  },
294
295
  structure: 1,
@@ -323,16 +324,16 @@ const A = {
323
324
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XVI.json",
324
325
  ignoreForWeb: !0,
325
326
  legislature: r.Seize,
326
- repairZip: async (t, s) => {
327
- const e = i.join(s, t.filename);
327
+ repairZip: async (t, i) => {
328
+ const e = s.join(i, t.filename);
328
329
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.pathExists(
329
- i.join(s, `${t.filename}.temp`, "acteur")
330
+ s.join(i, `${t.filename}.temp`, "acteur")
330
331
  ) && await n.move(
331
- i.join(s, `${t.filename}.temp`, "acteur"),
332
- i.join(e, "acteur")
332
+ s.join(i, `${t.filename}.temp`, "acteur"),
333
+ s.join(e, "acteur")
333
334
  ), await n.move(
334
- i.join(s, `${t.filename}.temp`, "organe"),
335
- i.join(e, "organe")
335
+ s.join(i, `${t.filename}.temp`, "organe"),
336
+ s.join(e, "organe")
336
337
  );
337
338
  },
338
339
  structure: 1,
@@ -367,14 +368,14 @@ const A = {
367
368
  filename: "AMO40_deputes_actifs_mandats_actifs_organes_divises_XV.json",
368
369
  ignoreForWeb: !0,
369
370
  legislature: r.Quinze,
370
- repairZip: async (t, s) => {
371
- const e = i.join(s, t.filename);
371
+ repairZip: async (t, i) => {
372
+ const e = s.join(i, t.filename);
372
373
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
373
- i.join(s, `${t.filename}.temp`, "acteur"),
374
- i.join(e, "acteur")
374
+ s.join(i, `${t.filename}.temp`, "acteur"),
375
+ s.join(e, "acteur")
375
376
  ), await n.move(
376
- i.join(s, `${t.filename}.temp`, "organe"),
377
- i.join(e, "organe")
377
+ s.join(i, `${t.filename}.temp`, "organe"),
378
+ s.join(e, "organe")
378
379
  );
379
380
  },
380
381
  structure: 1,
@@ -399,17 +400,17 @@ const A = {
399
400
  filename: "AMO50_acteurs_mandats_organes_divises_XVII.json",
400
401
  ignoreForWeb: !0,
401
402
  legislature: r.DixSept,
402
- repairZip: async (t, s) => {
403
- const e = i.join(s, t.filename);
403
+ repairZip: async (t, i) => {
404
+ const e = s.join(i, t.filename);
404
405
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
405
- i.join(s, `${t.filename}.temp`, "mandat"),
406
- i.join(e, "mandat")
406
+ s.join(i, `${t.filename}.temp`, "mandat"),
407
+ s.join(e, "mandat")
407
408
  ), await n.move(
408
- i.join(s, `${t.filename}.temp`, "acteur"),
409
- i.join(e, "acteur")
409
+ s.join(i, `${t.filename}.temp`, "acteur"),
410
+ s.join(e, "acteur")
410
411
  ), await n.move(
411
- i.join(s, `${t.filename}.temp`, "organe"),
412
- i.join(e, "organe")
412
+ s.join(i, `${t.filename}.temp`, "organe"),
413
+ s.join(e, "organe")
413
414
  );
414
415
  },
415
416
  structure: 1,
@@ -434,17 +435,17 @@ const A = {
434
435
  filename: "AMO50_acteurs_mandats_organes_divises_XVI.json",
435
436
  ignoreForWeb: !0,
436
437
  legislature: r.Seize,
437
- repairZip: async (t, s) => {
438
- const e = i.join(s, t.filename);
438
+ repairZip: async (t, i) => {
439
+ const e = s.join(i, t.filename);
439
440
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
440
- i.join(s, `${t.filename}.temp`, "mandat"),
441
- i.join(e, "mandat")
441
+ s.join(i, `${t.filename}.temp`, "mandat"),
442
+ s.join(e, "mandat")
442
443
  ), await n.move(
443
- i.join(s, `${t.filename}.temp`, "acteur"),
444
- i.join(e, "acteur")
444
+ s.join(i, `${t.filename}.temp`, "acteur"),
445
+ s.join(e, "acteur")
445
446
  ), await n.move(
446
- i.join(s, `${t.filename}.temp`, "organe"),
447
- i.join(e, "organe")
447
+ s.join(i, `${t.filename}.temp`, "organe"),
448
+ s.join(e, "organe")
448
449
  );
449
450
  },
450
451
  structure: 1,
@@ -469,17 +470,17 @@ const A = {
469
470
  filename: "AMO50_acteurs_mandats_organes_divises_XV.json",
470
471
  ignoreForWeb: !0,
471
472
  legislature: r.Quinze,
472
- repairZip: async (t, s) => {
473
- const e = i.join(s, t.filename);
473
+ repairZip: async (t, i) => {
474
+ const e = s.join(i, t.filename);
474
475
  await n.pathExists(e) && await n.remove(e), await n.mkdir(e), await n.move(
475
- i.join(s, `${t.filename}.temp`, "mandat"),
476
- i.join(e, "mandat")
476
+ s.join(i, `${t.filename}.temp`, "mandat"),
477
+ s.join(e, "mandat")
477
478
  ), await n.move(
478
- i.join(s, `${t.filename}.temp`, "acteur"),
479
- i.join(e, "acteur")
479
+ s.join(i, `${t.filename}.temp`, "acteur"),
480
+ s.join(e, "acteur")
480
481
  ), await n.move(
481
- i.join(s, `${t.filename}.temp`, "organe"),
482
- i.join(e, "organe")
482
+ s.join(i, `${t.filename}.temp`, "organe"),
483
+ s.join(e, "organe")
483
484
  );
484
485
  },
485
486
  structure: 1,
@@ -675,10 +676,10 @@ const A = {
675
676
  {
676
677
  filename: "Comptes_Rendus_Seances_XVII.xml",
677
678
  legislature: r.DixSept,
678
- repairZip: async (t, s) => {
679
- const e = i.join(s, t.filename);
679
+ repairZip: async (t, i) => {
680
+ const e = s.join(i, t.filename);
680
681
  await n.pathExists(e) && await n.remove(e), await n.move(
681
- i.join(s, `${t.filename}.temp`, "xml"),
682
+ s.join(i, `${t.filename}.temp`, "xml"),
682
683
  e
683
684
  );
684
685
  },
@@ -689,10 +690,10 @@ const A = {
689
690
  {
690
691
  filename: "Comptes_Rendus_Seances_XVI.xml",
691
692
  legislature: r.Seize,
692
- repairZip: async (t, s) => {
693
- const e = i.join(s, t.filename);
693
+ repairZip: async (t, i) => {
694
+ const e = s.join(i, t.filename);
694
695
  await n.pathExists(e) && await n.remove(e), await n.move(
695
- i.join(s, `${t.filename}.temp`, "xml"),
696
+ s.join(i, `${t.filename}.temp`, "xml"),
696
697
  e
697
698
  );
698
699
  },
@@ -702,14 +703,14 @@ const A = {
702
703
  }
703
704
  ]
704
705
  };
705
- function* x(t, s = []) {
706
- const e = i.join(t, ...s);
706
+ function* P(t, i = []) {
707
+ const e = s.join(t, ...i);
707
708
  if (n.existsSync(e))
708
- for (const o of n.readdirSync(e)) {
709
- if (o[0] === ".")
709
+ for (const a of n.readdirSync(e)) {
710
+ if (a[0] === ".")
710
711
  continue;
711
- const l = i.join(e, o), m = [...s, o];
712
- n.statSync(l).isDirectory() ? yield* x(t, m) : yield m;
712
+ const u = s.join(e, a), d = [...i, a];
713
+ n.statSync(u).isDirectory() ? yield* P(t, d) : yield d;
713
714
  }
714
715
  }
715
716
  const Q = [
@@ -740,730 +741,812 @@ const Q = [
740
741
  1,
741
742
  "I"
742
743
  ];
743
- function ie(t) {
744
+ function ne(t) {
744
745
  if (t < 0)
745
746
  return;
746
747
  if (t === 0)
747
748
  return "0I";
748
- let s = "";
749
+ let i = "";
749
750
  for (let e = 0; e < Q.length; e += 2)
750
751
  for (; t >= Q[e]; )
751
- s += Q[e + 1], t -= Q[e];
752
- return s;
752
+ i += Q[e + 1], t -= Q[e];
753
+ return i;
753
754
  }
754
- function* z(t, s, e, o, l, m = "json", { enriched: _ = !1, log: j = !1, noValidation: y = !1 } = {}) {
755
- const F = /* @__PURE__ */ new Set();
756
- for (const v of e) {
757
- if (v.ignoreForWeb || !ne(s, v))
755
+ function* O(t, i, e, a, u, d = "json", { enriched: l = !1, log: j = !1, noValidation: y = !1, sinceCommit: S } = {}) {
756
+ const v = /* @__PURE__ */ new Set();
757
+ for (const b of e) {
758
+ if (b.ignoreForWeb || !oe(i, b))
758
759
  continue;
759
- const b = new RegExp(`\\.${m}$`), P = i.join(
760
+ const x = new RegExp(`\\.${d}$`), D = s.join(
760
761
  t,
761
- v.filename.replace(
762
- b,
763
- _ ? "_enrichi" : "_nettoye"
762
+ b.filename.replace(
763
+ x,
764
+ l ? "_enrichi" : "_nettoye"
764
765
  )
765
- );
766
- for (const X of x(P, l)) {
766
+ ), z = S ? k(D, S, {
767
+ diffFilter: "AMR"
768
+ }) : null;
769
+ j && S && (console.log(
770
+ `Filtering files changed since commit ${S} in ${D}`
771
+ ), console.log(`Found ${z?.size || 0} changed files`));
772
+ for (const X of P(D, u)) {
767
773
  if (!X[X.length - 1].endsWith(".json"))
768
774
  continue;
769
- const D = i.join(P, ...X);
770
- j && console.log(`Loading file: ${D}…`);
771
- let V = n.readFileSync(D, { encoding: "utf8" });
772
- const $ = y ? JSON.parse(V) : o(V);
773
- F.has($.uid) || (F.add($.uid), yield {
774
- datasetLegislature: v.legislature,
775
- filePath: D,
776
- item: $
777
- }, V = null);
775
+ const V = s.join(D, ...X), p = s.join(...X), o = z?.get(p);
776
+ if (z && !o)
777
+ continue;
778
+ j && console.log(`Loading file: ${V}…`);
779
+ let f = n.readFileSync(V, { encoding: "utf8" });
780
+ const c = y ? JSON.parse(f) : a(f);
781
+ v.has(c.uid) || (v.add(c.uid), yield {
782
+ datasetLegislature: b.legislature,
783
+ filePath: V,
784
+ item: c,
785
+ ...o && { gitStatus: o }
786
+ }, f = null);
787
+ }
788
+ if (S) {
789
+ const X = k(
790
+ D,
791
+ S,
792
+ {
793
+ diffFilter: "D"
794
+ }
795
+ );
796
+ for (const [$, V] of X.entries()) {
797
+ const p = s.join(D, $);
798
+ j && console.log(`Deleted file: ${p}`);
799
+ const f = { uid: s.basename($, `.${d}`) };
800
+ yield {
801
+ datasetLegislature: b.legislature,
802
+ filePath: p,
803
+ item: f,
804
+ gitStatus: V
805
+ };
806
+ }
778
807
  }
779
808
  }
780
- F.clear();
809
+ v.clear();
781
810
  }
782
- function ne(t, s) {
811
+ function oe(t, i) {
783
812
  const e = Array.isArray(t) ? t : t !== void 0 ? [t] : [];
784
- return t === void 0 || e.includes(0) || s.legislature === r.All ? !0 : e.includes(s.legislature);
813
+ return t === void 0 || e.includes(0) || i.legislature === r.All ? !0 : e.includes(i.legislature);
785
814
  }
786
- function* de(t, s, e = {}) {
815
+ function* ge(t, i, e = {}) {
787
816
  for (const {
788
- datasetLegislature: o,
789
- item: l,
790
- filePath: m
791
- } of z(
817
+ datasetLegislature: a,
818
+ item: u,
819
+ filePath: d,
820
+ gitStatus: l
821
+ } of O(
792
822
  t,
793
- s,
823
+ i,
794
824
  A.acteursEtOrganes,
795
- C.toActeur,
825
+ U.toActeur,
796
826
  ["acteurs"],
797
827
  "json",
798
828
  e
799
829
  ))
800
- yield { acteur: l, datasetLegislature: o, filePath: m };
830
+ yield {
831
+ acteur: u,
832
+ datasetLegislature: a,
833
+ filePath: d,
834
+ ...l && { gitStatus: l }
835
+ };
801
836
  }
802
- function* pe(t, s, e = {}) {
837
+ function* _e(t, i, e = {}) {
803
838
  for (const {
804
- item: o,
805
- datasetLegislature: l,
806
- filePath: m
807
- } of z(
839
+ item: a,
840
+ datasetLegislature: u,
841
+ filePath: d,
842
+ gitStatus: l
843
+ } of O(
808
844
  t,
809
- s,
845
+ i,
810
846
  A.acteursEtOrganes,
811
- C.toOrgane,
847
+ U.toOrgane,
812
848
  ["organes"],
813
849
  "json",
814
850
  e
815
851
  ))
816
- yield { organe: o, datasetLegislature: l, filePath: m };
852
+ yield {
853
+ organe: a,
854
+ datasetLegislature: u,
855
+ filePath: d,
856
+ ...l && { gitStatus: l }
857
+ };
817
858
  }
818
- function* ge(t, s, e = {}) {
859
+ function* je(t, i, e = {}) {
819
860
  for (const {
820
- datasetLegislature: o,
821
- item: l,
822
- filePath: m
823
- } of z(
861
+ datasetLegislature: a,
862
+ item: u,
863
+ filePath: d,
864
+ gitStatus: l
865
+ } of O(
824
866
  t,
825
- s,
867
+ i,
826
868
  A.amendements,
827
869
  N.toAmendement,
828
870
  [],
829
871
  "json",
830
872
  e
831
873
  ))
832
- yield { amendement: l, datasetLegislature: o, filePath: m };
874
+ yield {
875
+ amendement: u,
876
+ datasetLegislature: a,
877
+ filePath: d,
878
+ ...l && { gitStatus: l }
879
+ };
833
880
  }
834
- function* _e(t, s, e = {}) {
881
+ function* he(t, i, e = {}) {
835
882
  for (const {
836
- item: o,
837
- datasetLegislature: l,
838
- filePath: m
839
- } of z(
883
+ item: a,
884
+ datasetLegislature: u,
885
+ filePath: d,
886
+ gitStatus: l
887
+ } of O(
840
888
  t,
841
- s,
889
+ i,
842
890
  A.dossiersLegislatifs,
843
- R.toDocument,
891
+ q.toDocument,
844
892
  ["documents"],
845
893
  "json",
846
894
  e
847
895
  ))
848
- yield { document: o, datasetLegislature: l, filePath: m };
896
+ yield {
897
+ document: a,
898
+ datasetLegislature: u,
899
+ filePath: d,
900
+ ...l && { gitStatus: l }
901
+ };
849
902
  }
850
- function* je(t, s, e = {}) {
903
+ function* ye(t, i, e = {}) {
851
904
  for (const {
852
- item: o,
853
- datasetLegislature: l,
854
- filePath: m
855
- } of z(
905
+ item: a,
906
+ datasetLegislature: u,
907
+ filePath: d,
908
+ gitStatus: l
909
+ } of O(
856
910
  t,
857
- s,
911
+ i,
858
912
  A.dossiersLegislatifs,
859
- R.toDossierParlementaire,
913
+ q.toDossierParlementaire,
860
914
  ["dossiers"],
861
915
  "json",
862
916
  e
863
917
  ))
864
- yield { dossierParlementaire: o, datasetLegislature: l, filePath: m };
918
+ yield {
919
+ dossierParlementaire: a,
920
+ datasetLegislature: u,
921
+ filePath: d,
922
+ ...l && { gitStatus: l }
923
+ };
865
924
  }
866
- function* he(t, s, e = {}) {
925
+ function* Se(t, i, e = {}) {
867
926
  for (const {
868
- item: o,
869
- datasetLegislature: l,
870
- filePath: m
871
- } of z(
927
+ item: a,
928
+ datasetLegislature: u,
929
+ filePath: d,
930
+ gitStatus: l
931
+ } of O(
872
932
  t,
873
- s,
933
+ i,
874
934
  A.agendas,
875
935
  M.toReunion,
876
936
  [],
877
937
  "json",
878
938
  e
879
939
  ))
880
- yield { reunion: o, datasetLegislature: l, filePath: m };
940
+ yield {
941
+ reunion: a,
942
+ datasetLegislature: u,
943
+ filePath: d,
944
+ ...l && { gitStatus: l }
945
+ };
881
946
  }
882
- function* ye(t, s, e = {}) {
947
+ function* Ae(t, i, e = {}) {
883
948
  for (const {
884
- item: o,
885
- datasetLegislature: l,
886
- filePath: m
887
- } of z(
949
+ item: a,
950
+ datasetLegislature: u,
951
+ filePath: d,
952
+ gitStatus: l
953
+ } of O(
888
954
  t,
889
- s,
955
+ i,
890
956
  A.scrutins,
891
957
  Z.toScrutin,
892
958
  [],
893
959
  "json",
894
960
  e
895
961
  ))
896
- yield { scrutin: o, datasetLegislature: l, filePath: m };
962
+ yield {
963
+ scrutin: a,
964
+ datasetLegislature: u,
965
+ filePath: d,
966
+ ...l && { gitStatus: l }
967
+ };
897
968
  }
898
- function* Ae(t, s, e = {}) {
969
+ function* Fe(t, i, e = {}) {
899
970
  for (const {
900
- item: o,
901
- datasetLegislature: l,
902
- filePath: m
903
- } of z(
971
+ item: a,
972
+ datasetLegislature: u,
973
+ filePath: d,
974
+ gitStatus: l
975
+ } of O(
904
976
  t,
905
- s,
977
+ i,
906
978
  A.questions,
907
979
  B.toQuestion,
908
980
  [],
909
981
  "json",
910
982
  e
911
983
  ))
912
- yield { question: o, datasetLegislature: l, filePath: m };
984
+ yield {
985
+ question: a,
986
+ datasetLegislature: u,
987
+ filePath: d,
988
+ ...l && { gitStatus: l }
989
+ };
913
990
  }
914
- function* Se(t, s, e = {}) {
991
+ function* ve(t, i, e = {}) {
915
992
  for (const {
916
- item: o,
917
- datasetLegislature: l,
918
- filePath: m
919
- } of z(
993
+ item: a,
994
+ datasetLegislature: u,
995
+ filePath: d,
996
+ gitStatus: l
997
+ } of O(
920
998
  t,
921
- s,
999
+ i,
922
1000
  A.comptesRendusSeances,
923
1001
  J.toCompteRendu,
924
1002
  [],
925
1003
  "xml",
926
1004
  e
927
1005
  ))
928
- yield { compteRendu: o, datasetLegislature: l, filePath: m };
1006
+ yield {
1007
+ compteRendu: a,
1008
+ datasetLegislature: u,
1009
+ filePath: d,
1010
+ ...l && { gitStatus: l }
1011
+ };
929
1012
  }
930
- function* Fe(t, s, { enriched: e = !1 } = {}) {
931
- const o = `Comptes_Rendus_Commissions_${ie(s)}${e ? "_enrichi" : "_nettoye"}`, l = i.join(t, o);
932
- if (n.existsSync(l))
933
- for (const m of k(l))
1013
+ function* Ie(t, i, { enriched: e = !1 } = {}) {
1014
+ const a = `Comptes_Rendus_Commissions_${ne(i)}${e ? "_enrichi" : "_nettoye"}`, u = s.join(t, a);
1015
+ if (n.existsSync(u))
1016
+ for (const d of T(u))
934
1017
  try {
935
- const _ = n.readFileSync(m, "utf-8");
1018
+ const l = n.readFileSync(d, "utf-8");
936
1019
  yield {
937
- compteRendu: JSON.parse(_),
938
- datasetLegislature: s,
939
- filePath: m
1020
+ compteRendu: JSON.parse(l),
1021
+ datasetLegislature: i,
1022
+ filePath: d
940
1023
  };
941
- } catch (_) {
942
- console.warn(`Erreur lors de la lecture du fichier ${m} :`, _);
1024
+ } catch (l) {
1025
+ console.warn(`Erreur lors de la lecture du fichier ${d} :`, l);
943
1026
  }
944
1027
  }
945
- function* k(t) {
1028
+ function* T(t) {
946
1029
  if (n.existsSync(t))
947
- for (const s of n.readdirSync(t, { withFileTypes: !0 })) {
948
- const e = i.join(t, s.name);
949
- s.isDirectory() ? yield* k(e) : s.isFile() && e.endsWith(".json") && (yield e);
1030
+ for (const i of n.readdirSync(t, { withFileTypes: !0 })) {
1031
+ const e = s.join(t, i.name);
1032
+ i.isDirectory() ? yield* T(e) : i.isFile() && e.endsWith(".json") && (yield e);
950
1033
  }
951
1034
  }
952
- function ve(t, s, e, { enriched: o = !1, log: l = !1 } = {}) {
953
- const m = {}, _ = {};
954
- if (s & I.ActeursEtOrganes)
955
- for (const a of A.acteursEtOrganes) {
956
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1035
+ function be(t, i, e, { enriched: a = !1, log: u = !1 } = {}) {
1036
+ const d = {}, l = {};
1037
+ if (i & I.ActeursEtOrganes)
1038
+ for (const o of A.acteursEtOrganes) {
1039
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
957
1040
  continue;
958
- const f = i.join(
1041
+ const f = s.join(
959
1042
  t,
960
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1043
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
961
1044
  );
962
- for (const u of x(f, ["acteurs"])) {
963
- if (!u[u.length - 1].endsWith(".json"))
1045
+ for (const c of P(f, ["acteurs"])) {
1046
+ if (!c[c.length - 1].endsWith(".json"))
964
1047
  continue;
965
- const g = i.join(f, ...u);
966
- l && console.log(`Loading file: ${g}…`);
967
- const S = n.readFileSync(g, {
1048
+ const _ = s.join(f, ...c);
1049
+ u && console.log(`Loading file: ${_}…`);
1050
+ const F = n.readFileSync(_, {
968
1051
  encoding: "utf8"
969
- }), d = C.toActeur(S);
970
- m[d.uid] === void 0 && (m[d.uid] = d);
1052
+ }), g = U.toActeur(F);
1053
+ d[g.uid] === void 0 && (d[g.uid] = g);
971
1054
  }
972
- for (const u of x(f, ["organes"])) {
973
- if (!u[u.length - 1].endsWith(".json"))
1055
+ for (const c of P(f, ["organes"])) {
1056
+ if (!c[c.length - 1].endsWith(".json"))
974
1057
  continue;
975
- const g = i.join(f, ...u);
976
- l && console.log(`Loading file: ${g}…`);
977
- const S = n.readFileSync(g, {
1058
+ const _ = s.join(f, ...c);
1059
+ u && console.log(`Loading file: ${_}…`);
1060
+ const F = n.readFileSync(_, {
978
1061
  encoding: "utf8"
979
- }), d = C.toOrgane(S);
980
- _[d.uid] === void 0 && (_[d.uid] = d);
1062
+ }), g = U.toOrgane(F);
1063
+ l[g.uid] === void 0 && (l[g.uid] = g);
981
1064
  }
982
1065
  }
983
- const j = {}, y = {}, F = {};
984
- if (s & I.Agendas)
985
- for (const a of A.agendas) {
986
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1066
+ const j = {}, y = {}, S = {};
1067
+ if (i & I.Agendas)
1068
+ for (const o of A.agendas) {
1069
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
987
1070
  continue;
988
- const f = i.join(
1071
+ const f = s.join(
989
1072
  t,
990
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1073
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
991
1074
  );
992
- for (const u of x(f)) {
993
- if (!u[u.length - 1].endsWith(".json"))
1075
+ for (const c of P(f)) {
1076
+ if (!c[c.length - 1].endsWith(".json"))
994
1077
  continue;
995
- const g = i.join(f, ...u);
996
- l && console.log(`Loading file: ${g}…`);
997
- const S = n.readFileSync(g, {
1078
+ const _ = s.join(f, ...c);
1079
+ u && console.log(`Loading file: ${_}…`);
1080
+ const F = n.readFileSync(_, {
998
1081
  encoding: "utf8"
999
- }), d = M.toReunion(S);
1000
- j[d.uid] === void 0 && (j[d.uid] = d);
1001
- const L = d.timestampDebut.toISOString().split("T")[0];
1082
+ }), g = M.toReunion(F);
1083
+ j[g.uid] === void 0 && (j[g.uid] = g);
1084
+ const L = g.timestampDebut.toISOString().split("T")[0];
1002
1085
  let w = y[L];
1003
- w === void 0 && (w = y[L] = []), w.push(d);
1004
- const U = d.odj;
1005
- if (U !== void 0)
1006
- for (const H of U.pointsOdj || [])
1007
- for (const E of H.dossiersLegislatifsRefs || []) {
1008
- let W = F[E];
1009
- W === void 0 && (W = F[E] = []), W.push(d);
1086
+ w === void 0 && (w = y[L] = []), w.push(g);
1087
+ const R = g.odj;
1088
+ if (R !== void 0)
1089
+ for (const Y of R.pointsOdj || [])
1090
+ for (const E of Y.dossiersLegislatifsRefs || []) {
1091
+ let W = S[E];
1092
+ W === void 0 && (W = S[E] = []), W.push(g);
1010
1093
  }
1011
1094
  }
1012
1095
  }
1013
1096
  const v = {};
1014
- if (s & I.Amendements)
1015
- for (const a of A.amendements) {
1016
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1097
+ if (i & I.Amendements)
1098
+ for (const o of A.amendements) {
1099
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1017
1100
  continue;
1018
- const f = i.join(
1101
+ const f = s.join(
1019
1102
  t,
1020
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1103
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1021
1104
  );
1022
- for (const u of x(f)) {
1023
- if (!u[u.length - 1].endsWith(".json"))
1105
+ for (const c of P(f)) {
1106
+ if (!c[c.length - 1].endsWith(".json"))
1024
1107
  continue;
1025
- const g = i.join(f, ...u);
1026
- l && console.log(`Loading file: ${g}…`);
1027
- const S = n.readFileSync(g, {
1108
+ const _ = s.join(f, ...c);
1109
+ u && console.log(`Loading file: ${_}…`);
1110
+ const F = n.readFileSync(_, {
1028
1111
  encoding: "utf8"
1029
- }), d = N.toAmendement(S);
1030
- v[d.uid] === void 0 && (v[d.uid] = d);
1112
+ }), g = N.toAmendement(F);
1113
+ v[g.uid] === void 0 && (v[g.uid] = g);
1031
1114
  }
1032
1115
  }
1033
- const b = {}, P = {}, X = {}, O = {};
1034
- if (s & I.DossiersLegislatifs)
1035
- for (const a of A.dossiersLegislatifs) {
1036
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1116
+ const b = {}, x = {}, D = {}, z = {};
1117
+ if (i & I.DossiersLegislatifs)
1118
+ for (const o of A.dossiersLegislatifs) {
1119
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1037
1120
  continue;
1038
- const f = i.join(
1121
+ const f = s.join(
1039
1122
  t,
1040
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1123
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1041
1124
  );
1042
- for (const u of x(f, ["documents"])) {
1043
- if (!u[u.length - 1].endsWith(".json"))
1125
+ for (const c of P(f, ["documents"])) {
1126
+ if (!c[c.length - 1].endsWith(".json"))
1044
1127
  continue;
1045
- const g = i.join(f, ...u);
1046
- l && console.log(`Loading file: ${g}…`);
1047
- const S = n.readFileSync(g, {
1128
+ const _ = s.join(f, ...c);
1129
+ u && console.log(`Loading file: ${_}…`);
1130
+ const F = n.readFileSync(_, {
1048
1131
  encoding: "utf8"
1049
- }), d = R.toDocument(S);
1050
- b[d.uid] === void 0 && (b[d.uid] = d);
1132
+ }), g = q.toDocument(F);
1133
+ b[g.uid] === void 0 && (b[g.uid] = g);
1051
1134
  }
1052
- for (const u of x(f, ["dossiers"])) {
1053
- if (!u[u.length - 1].endsWith(".json"))
1135
+ for (const c of P(f, ["dossiers"])) {
1136
+ if (!c[c.length - 1].endsWith(".json"))
1054
1137
  continue;
1055
- const g = i.join(f, ...u);
1056
- l && console.log(`Loading file: ${g}…`);
1057
- const S = n.readFileSync(g, {
1138
+ const _ = s.join(f, ...c);
1139
+ u && console.log(`Loading file: ${_}…`);
1140
+ const F = n.readFileSync(_, {
1058
1141
  encoding: "utf8"
1059
- }), d = R.toDossierParlementaire(S), L = d.titreDossier;
1060
- L.senatChemin && P[L.senatChemin] === void 0 && (P[L.senatChemin] = d), L.titreChemin && X[L.titreChemin] === void 0 && (X[L.titreChemin] = d), O[d.uid] === void 0 && (O[d.uid] = d);
1142
+ }), g = q.toDossierParlementaire(F), L = g.titreDossier;
1143
+ L.senatChemin && x[L.senatChemin] === void 0 && (x[L.senatChemin] = g), L.titreChemin && D[L.titreChemin] === void 0 && (D[L.titreChemin] = g), z[g.uid] === void 0 && (z[g.uid] = g);
1061
1144
  }
1062
1145
  }
1063
- let D = {};
1064
- if (s & I.Photos) {
1146
+ let X = {};
1147
+ if (i & I.Photos) {
1065
1148
  {
1066
- const a = i.join(
1149
+ const o = s.join(
1067
1150
  t,
1068
1151
  `photos_deputes_${// TODO: Handle Legislature.All.
1069
1152
  e === r.All ? r.DixSept : e}`,
1070
1153
  "deputes.json"
1071
1154
  );
1072
- if (n.existsSync(a)) {
1073
- l && console.log(`Loading file: ${a}`);
1074
- const f = n.readFileSync(a, { encoding: "utf8" });
1075
- Object.assign(D, JSON.parse(f));
1076
- } else l && console.log(`Ignoring missing file: ${a}`);
1155
+ if (n.existsSync(o)) {
1156
+ u && console.log(`Loading file: ${o}`);
1157
+ const f = n.readFileSync(o, { encoding: "utf8" });
1158
+ Object.assign(X, JSON.parse(f));
1159
+ } else u && console.log(`Ignoring missing file: ${o}`);
1077
1160
  }
1078
1161
  {
1079
- const a = i.join(
1162
+ const o = s.join(
1080
1163
  t,
1081
1164
  "photos_senateurs",
1082
1165
  "senateurs.json"
1083
1166
  );
1084
- if (n.existsSync(a)) {
1085
- l && console.log(`Loading file: ${a}`);
1086
- const f = n.readFileSync(a, { encoding: "utf8" });
1087
- Object.assign(D, JSON.parse(f));
1088
- } else l && console.log(`Ignoring missing file: ${a}`);
1167
+ if (n.existsSync(o)) {
1168
+ u && console.log(`Loading file: ${o}`);
1169
+ const f = n.readFileSync(o, { encoding: "utf8" });
1170
+ Object.assign(X, JSON.parse(f));
1171
+ } else u && console.log(`Ignoring missing file: ${o}`);
1089
1172
  }
1090
1173
  }
1091
- const V = {};
1092
- if (s & I.Scrutins)
1093
- for (const a of A.scrutins) {
1094
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1174
+ const $ = {};
1175
+ if (i & I.Scrutins)
1176
+ for (const o of A.scrutins) {
1177
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1095
1178
  continue;
1096
- const f = i.join(
1179
+ const f = s.join(
1097
1180
  t,
1098
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1181
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1099
1182
  );
1100
- for (const u of x(f)) {
1101
- if (!u[u.length - 1].endsWith(".json"))
1183
+ for (const c of P(f)) {
1184
+ if (!c[c.length - 1].endsWith(".json"))
1102
1185
  continue;
1103
- const g = i.join(f, ...u);
1104
- l && console.log(`Loading file: ${g}…`);
1105
- const S = n.readFileSync(g, {
1186
+ const _ = s.join(f, ...c);
1187
+ u && console.log(`Loading file: ${_}…`);
1188
+ const F = n.readFileSync(_, {
1106
1189
  encoding: "utf8"
1107
- }), d = Z.toScrutin(S);
1108
- V[d.uid] === void 0 && (V[d.uid] = d);
1190
+ }), g = Z.toScrutin(F);
1191
+ $[g.uid] === void 0 && ($[g.uid] = g);
1109
1192
  }
1110
1193
  }
1111
- const $ = {};
1112
- if (s & I.Questions)
1113
- for (const a of A.questions) {
1114
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1194
+ const V = {};
1195
+ if (i & I.Questions)
1196
+ for (const o of A.questions) {
1197
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1115
1198
  continue;
1116
- const f = i.join(
1199
+ const f = s.join(
1117
1200
  t,
1118
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1201
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1119
1202
  );
1120
- for (const u of x(f)) {
1121
- if (!u[u.length - 1].endsWith(".json"))
1203
+ for (const c of P(f)) {
1204
+ if (!c[c.length - 1].endsWith(".json"))
1122
1205
  continue;
1123
- const g = i.join(f, ...u);
1124
- l && console.log(`Loading file: ${g}…`);
1125
- const S = n.readFileSync(g, {
1206
+ const _ = s.join(f, ...c);
1207
+ u && console.log(`Loading file: ${_}…`);
1208
+ const F = n.readFileSync(_, {
1126
1209
  encoding: "utf8"
1127
- }), d = B.toQuestion(S);
1128
- $[d.uid] === void 0 && ($[d.uid] = d);
1210
+ }), g = B.toQuestion(F);
1211
+ V[g.uid] === void 0 && (V[g.uid] = g);
1129
1212
  }
1130
1213
  }
1131
1214
  const p = {};
1132
- if (s & I.ComptesRendusSeances)
1133
- for (const a of A.comptesRendusSeances) {
1134
- if (a.ignoreForWeb || e !== r.All && a.legislature !== r.All && e !== a.legislature)
1215
+ if (i & I.ComptesRendusSeances)
1216
+ for (const o of A.comptesRendusSeances) {
1217
+ if (o.ignoreForWeb || e !== r.All && o.legislature !== r.All && e !== o.legislature)
1135
1218
  continue;
1136
- const f = i.join(
1219
+ const f = s.join(
1137
1220
  t,
1138
- a.filename.replace(/\.json$/, o ? "_enrichi" : "_nettoye")
1221
+ o.filename.replace(/\.json$/, a ? "_enrichi" : "_nettoye")
1139
1222
  );
1140
- for (const u of x(f)) {
1141
- if (!u[u.length - 1].endsWith(".json"))
1223
+ for (const c of P(f)) {
1224
+ if (!c[c.length - 1].endsWith(".json"))
1142
1225
  continue;
1143
- const g = i.join(f, ...u);
1144
- l && console.log(`Loading file: ${g}…`);
1145
- const S = n.readFileSync(g, {
1226
+ const _ = s.join(f, ...c);
1227
+ u && console.log(`Loading file: ${_}…`);
1228
+ const F = n.readFileSync(_, {
1146
1229
  encoding: "utf8"
1147
- }), d = J.toCompteRendu(S);
1148
- p[d.uid] === void 0 && (p[d.uid] = d);
1230
+ }), g = J.toCompteRendu(F);
1231
+ p[g.uid] === void 0 && (p[g.uid] = g);
1149
1232
  }
1150
1233
  }
1151
1234
  return {
1152
- acteurByUid: m,
1235
+ acteurByUid: d,
1153
1236
  amendementByUid: v,
1154
1237
  documentByUid: b,
1155
- dossierParlementaireBySenatChemin: P,
1156
- dossierParlementaireByTitreChemin: X,
1157
- dossierParlementaireByUid: O,
1158
- organeByUid: _,
1159
- photoByUid: D,
1238
+ dossierParlementaireBySenatChemin: x,
1239
+ dossierParlementaireByTitreChemin: D,
1240
+ dossierParlementaireByUid: z,
1241
+ organeByUid: l,
1242
+ photoByUid: X,
1160
1243
  reunionByUid: j,
1161
1244
  reunionsByDay: y,
1162
- reunionsByDossierUid: F,
1163
- scrutinByUid: V,
1164
- questionByUid: $,
1245
+ reunionsByDossierUid: S,
1246
+ scrutinByUid: $,
1247
+ questionByUid: V,
1165
1248
  compteRenduByUid: p
1166
1249
  };
1167
1250
  }
1168
- function Ie(t, s, e, { log: o = !1 } = {}) {
1169
- const l = {}, m = {};
1170
- if (s & I.ActeursEtOrganes)
1251
+ function De(t, i, e, { log: a = !1 } = {}) {
1252
+ const u = {}, d = {};
1253
+ if (i & I.ActeursEtOrganes)
1171
1254
  for (const p of A.acteursEtOrganes) {
1172
1255
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1173
1256
  continue;
1174
- const a = i.join(
1257
+ const o = s.join(
1175
1258
  t,
1176
1259
  p.filename.replace(/\.json$/, "_nettoye.json")
1177
1260
  );
1178
- o && console.log(`Loading file: ${a}`);
1179
- const f = n.readFileSync(a, { encoding: "utf8" }), u = C.toActeursEtOrganes(f);
1180
- for (const c of u.acteurs)
1181
- l[c.uid] === void 0 && (l[c.uid] = c);
1182
- for (const c of u.organes)
1183
- m[c.uid] === void 0 && (m[c.uid] = c);
1261
+ a && console.log(`Loading file: ${o}`);
1262
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = U.toActeursEtOrganes(f);
1263
+ for (const m of c.acteurs)
1264
+ u[m.uid] === void 0 && (u[m.uid] = m);
1265
+ for (const m of c.organes)
1266
+ d[m.uid] === void 0 && (d[m.uid] = m);
1184
1267
  }
1185
- const _ = {}, j = {}, y = {};
1186
- if (s & I.Agendas)
1268
+ const l = {}, j = {}, y = {};
1269
+ if (i & I.Agendas)
1187
1270
  for (const p of A.agendas) {
1188
1271
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1189
1272
  continue;
1190
- const a = i.join(
1273
+ const o = s.join(
1191
1274
  t,
1192
1275
  p.filename.replace(/\.json$/, "_nettoye.json")
1193
1276
  );
1194
- o && console.log(`Loading file: ${a}`);
1195
- const f = n.readFileSync(a, { encoding: "utf8" }), u = M.toAgendas(f);
1196
- for (const c of u.reunions) {
1197
- _[c.uid] === void 0 && (_[c.uid] = c);
1198
- const g = c.timestampDebut.toISOString().split("T")[0];
1199
- let S = j[g];
1200
- S === void 0 && (S = j[g] = []), S.push(c);
1201
- const d = c.odj;
1202
- if (d !== void 0)
1203
- for (const L of d.pointsOdj || [])
1277
+ a && console.log(`Loading file: ${o}`);
1278
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = M.toAgendas(f);
1279
+ for (const m of c.reunions) {
1280
+ l[m.uid] === void 0 && (l[m.uid] = m);
1281
+ const _ = m.timestampDebut.toISOString().split("T")[0];
1282
+ let F = j[_];
1283
+ F === void 0 && (F = j[_] = []), F.push(m);
1284
+ const g = m.odj;
1285
+ if (g !== void 0)
1286
+ for (const L of g.pointsOdj || [])
1204
1287
  for (const w of L.dossiersLegislatifsRefs || []) {
1205
- let U = y[w];
1206
- U === void 0 && (U = y[w] = []), U.push(c);
1288
+ let R = y[w];
1289
+ R === void 0 && (R = y[w] = []), R.push(m);
1207
1290
  }
1208
1291
  }
1209
1292
  }
1210
- const F = {};
1211
- if (s & I.Amendements)
1293
+ const S = {};
1294
+ if (i & I.Amendements)
1212
1295
  for (const p of A.amendements) {
1213
1296
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1214
1297
  continue;
1215
- const a = i.join(
1298
+ const o = s.join(
1216
1299
  t,
1217
1300
  p.filename.replace(/\.json$/, "_nettoye.json")
1218
1301
  );
1219
- o && console.log(`Loading file: ${a}`);
1220
- const f = n.readFileSync(a, { encoding: "utf8" }), u = N.toAmendements(f);
1221
- for (const c of u.textesLegislatifs)
1222
- for (const g of c.amendements)
1223
- F[g.uid] === void 0 && (F[g.uid] = g);
1302
+ a && console.log(`Loading file: ${o}`);
1303
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = N.toAmendements(f);
1304
+ for (const m of c.textesLegislatifs)
1305
+ for (const _ of m.amendements)
1306
+ S[_.uid] === void 0 && (S[_.uid] = _);
1224
1307
  }
1225
- const v = {}, b = {}, P = {}, X = {};
1226
- if (s & I.DossiersLegislatifs)
1308
+ const v = {}, b = {}, x = {}, D = {};
1309
+ if (i & I.DossiersLegislatifs)
1227
1310
  for (const p of A.dossiersLegislatifs) {
1228
1311
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1229
1312
  continue;
1230
- const a = i.join(
1313
+ const o = s.join(
1231
1314
  t,
1232
1315
  p.filename.replace(/\.json$/, "_nettoye.json")
1233
1316
  );
1234
- o && console.log(`Loading file: ${a}`);
1235
- const f = n.readFileSync(a, { encoding: "utf8" }), u = R.toDossiersLegislatifs(f);
1236
- for (const c of u.textesLegislatifs)
1237
- v[c.uid] === void 0 && (v[c.uid] = c);
1238
- for (const c of u.dossiersParlementaires) {
1239
- const g = c.titreDossier;
1240
- g.senatChemin && b[g.senatChemin] === void 0 && (b[g.senatChemin] = c), g.titreChemin && P[g.titreChemin] === void 0 && (P[g.titreChemin] = c), X[c.uid] === void 0 && (X[c.uid] = c);
1317
+ a && console.log(`Loading file: ${o}`);
1318
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = q.toDossiersLegislatifs(f);
1319
+ for (const m of c.textesLegislatifs)
1320
+ v[m.uid] === void 0 && (v[m.uid] = m);
1321
+ for (const m of c.dossiersParlementaires) {
1322
+ const _ = m.titreDossier;
1323
+ _.senatChemin && b[_.senatChemin] === void 0 && (b[_.senatChemin] = m), _.titreChemin && x[_.titreChemin] === void 0 && (x[_.titreChemin] = m), D[m.uid] === void 0 && (D[m.uid] = m);
1241
1324
  }
1242
1325
  }
1243
- const O = {};
1244
- if (s & I.Photos) {
1326
+ const z = {};
1327
+ if (i & I.Photos) {
1245
1328
  const p = {};
1246
1329
  {
1247
- const a = i.join(
1330
+ const o = s.join(
1248
1331
  t,
1249
1332
  `photos_deputes_${// TODO: Handle Legislature.All.
1250
1333
  e === r.All ? r.DixSept : e}`,
1251
1334
  "deputes.json"
1252
1335
  );
1253
- if (n.existsSync(a)) {
1254
- o && console.log(`Loading file: ${a}`);
1255
- const f = n.readFileSync(a, { encoding: "utf8" });
1336
+ if (n.existsSync(o)) {
1337
+ a && console.log(`Loading file: ${o}`);
1338
+ const f = n.readFileSync(o, { encoding: "utf8" });
1256
1339
  Object.assign(p, JSON.parse(f));
1257
- } else o && console.log(`Ignoring missing file: ${a}`);
1340
+ } else a && console.log(`Ignoring missing file: ${o}`);
1258
1341
  }
1259
1342
  {
1260
- const a = i.join(
1343
+ const o = s.join(
1261
1344
  t,
1262
1345
  "photos_senateurs",
1263
1346
  "senateurs.json"
1264
1347
  );
1265
- if (n.existsSync(a)) {
1266
- o && console.log(`Loading file: ${a}`);
1267
- const f = n.readFileSync(a, { encoding: "utf8" });
1348
+ if (n.existsSync(o)) {
1349
+ a && console.log(`Loading file: ${o}`);
1350
+ const f = n.readFileSync(o, { encoding: "utf8" });
1268
1351
  Object.assign(p, JSON.parse(f));
1269
- } else o && console.log(`Ignoring missing file: ${a}`);
1352
+ } else a && console.log(`Ignoring missing file: ${o}`);
1270
1353
  }
1271
1354
  }
1272
- const D = {};
1273
- if (s & I.Scrutins)
1355
+ const X = {};
1356
+ if (i & I.Scrutins)
1274
1357
  for (const p of A.scrutins) {
1275
1358
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1276
1359
  continue;
1277
- const a = i.join(
1360
+ const o = s.join(
1278
1361
  t,
1279
1362
  p.filename.replace(/\.json$/, "_nettoye.json")
1280
1363
  );
1281
- o && console.log(`Loading file: ${a}`);
1282
- const f = n.readFileSync(a, { encoding: "utf8" }), u = Z.toScrutins(f);
1283
- for (const c of u.scrutins)
1284
- D[c.uid] === void 0 && (D[c.uid] = c);
1364
+ a && console.log(`Loading file: ${o}`);
1365
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = Z.toScrutins(f);
1366
+ for (const m of c.scrutins)
1367
+ X[m.uid] === void 0 && (X[m.uid] = m);
1285
1368
  }
1286
- const V = {};
1287
- if (s & I.Questions)
1369
+ const $ = {};
1370
+ if (i & I.Questions)
1288
1371
  for (const p of A.questions) {
1289
1372
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1290
1373
  continue;
1291
- const a = i.join(
1374
+ const o = s.join(
1292
1375
  t,
1293
1376
  p.filename.replace(/\.json$/, "_nettoye.json")
1294
1377
  );
1295
- o && console.log(`Loading file: ${a}`);
1296
- const f = n.readFileSync(a, { encoding: "utf8" }), u = B.toQuestions(f);
1297
- for (const c of u.questions)
1298
- V[c.uid] === void 0 && (V[c.uid] = c);
1378
+ a && console.log(`Loading file: ${o}`);
1379
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = B.toQuestions(f);
1380
+ for (const m of c.questions)
1381
+ $[m.uid] === void 0 && ($[m.uid] = m);
1299
1382
  }
1300
- const $ = {};
1301
- if (s & I.ComptesRendusSeances)
1383
+ const V = {};
1384
+ if (i & I.ComptesRendusSeances)
1302
1385
  for (const p of A.comptesRendusSeances) {
1303
1386
  if (p.ignoreForWeb || e !== r.All && p.legislature !== r.All && e !== p.legislature)
1304
1387
  continue;
1305
- const a = i.join(
1388
+ const o = s.join(
1306
1389
  t,
1307
1390
  p.filename.replace(/\.json$/, "_nettoye.json")
1308
1391
  );
1309
- o && console.log(`Loading file: ${a}`);
1310
- const f = n.readFileSync(a, { encoding: "utf8" }), u = J.toComptesRendus(f);
1311
- for (const c of u.comptesRendus)
1312
- $[c.uid] === void 0 && ($[c.uid] = c);
1392
+ a && console.log(`Loading file: ${o}`);
1393
+ const f = n.readFileSync(o, { encoding: "utf8" }), c = J.toComptesRendus(f);
1394
+ for (const m of c.comptesRendus)
1395
+ V[m.uid] === void 0 && (V[m.uid] = m);
1313
1396
  }
1314
1397
  return {
1315
- acteurByUid: l,
1316
- amendementByUid: F,
1398
+ acteurByUid: u,
1399
+ amendementByUid: S,
1317
1400
  documentByUid: v,
1318
1401
  dossierParlementaireBySenatChemin: b,
1319
- dossierParlementaireByTitreChemin: P,
1320
- dossierParlementaireByUid: X,
1321
- organeByUid: m,
1322
- photoByUid: O,
1323
- reunionByUid: _,
1402
+ dossierParlementaireByTitreChemin: x,
1403
+ dossierParlementaireByUid: D,
1404
+ organeByUid: d,
1405
+ photoByUid: z,
1406
+ reunionByUid: l,
1324
1407
  reunionsByDay: j,
1325
1408
  reunionsByDossierUid: y,
1326
- scrutinByUid: D,
1327
- questionByUid: V,
1328
- compteRenduByUid: $
1409
+ scrutinByUid: X,
1410
+ questionByUid: $,
1411
+ compteRenduByUid: V
1329
1412
  };
1330
1413
  }
1331
- function be(t, s, e) {
1332
- const o = i.join(t, "Documents"), l = oe(o, s), m = i.join(l, "index.json");
1333
- if (!n.pathExistsSync(m))
1414
+ function Xe(t, i, e) {
1415
+ const a = s.join(t, "Documents"), u = ae(a, i), d = s.join(u, "index.json");
1416
+ if (!n.pathExistsSync(d))
1334
1417
  return;
1335
- const _ = n.readJsonSync(m);
1418
+ const l = n.readJsonSync(d);
1336
1419
  for (const j of e)
1337
- for (const { filename: y, url: F } of _[j] ?? [])
1420
+ for (const { filename: y, url: S } of l[j] ?? [])
1338
1421
  if (y !== void 0)
1339
- return { format: j, path: i.join(l, y), url: F };
1422
+ return { format: j, path: s.join(u, y), url: S };
1340
1423
  }
1341
- function Xe(t, s, { log: e = !1 } = {}) {
1342
- const o = i.join(
1424
+ function Ve(t, i, { log: e = !1 } = {}) {
1425
+ const a = s.join(
1343
1426
  t,
1344
1427
  `photos_deputes_${// TODO: Handle Legislature.All.
1345
- s === r.All ? r.DixSept : s}`,
1428
+ i === r.All ? r.DixSept : i}`,
1346
1429
  "deputes.json"
1347
1430
  );
1348
- e && console.log(`Loading file: ${o}`);
1349
- const l = n.readFileSync(o, { encoding: "utf8" });
1350
- return JSON.parse(l);
1431
+ e && console.log(`Loading file: ${a}`);
1432
+ const u = n.readFileSync(a, { encoding: "utf8" });
1433
+ return JSON.parse(u);
1351
1434
  }
1352
- function De(t, { log: s = !1 } = {}) {
1353
- const e = i.join(
1435
+ function $e(t, { log: i = !1 } = {}) {
1436
+ const e = s.join(
1354
1437
  t,
1355
1438
  "photos_senateurs",
1356
1439
  "senateurs.json"
1357
1440
  );
1358
- s && console.log(`Loading file: ${e}`);
1359
- const o = n.readFileSync(e, { encoding: "utf8" });
1360
- return JSON.parse(o);
1441
+ i && console.log(`Loading file: ${e}`);
1442
+ const a = n.readFileSync(e, { encoding: "utf8" });
1443
+ return JSON.parse(a);
1361
1444
  }
1362
- function oe(t, s) {
1363
- const e = s.match(Y);
1364
- q.notStrictEqual(
1445
+ function ae(t, i) {
1446
+ const e = i.match(G);
1447
+ C.notStrictEqual(
1365
1448
  e,
1366
1449
  null,
1367
- `Unexpected structure for document UID: ${s}`
1450
+ `Unexpected structure for document UID: ${i}`
1368
1451
  );
1369
- const o = e.groups, l = i.join(
1452
+ const a = e.groups, u = s.join(
1370
1453
  t,
1371
- o.documentType ?? o.documentType2
1372
- ), m = i.join(l, o.chambre ?? o.chambre2), _ = i.join(
1373
- m,
1374
- o.republique ?? o.republique2
1375
- ), j = i.join(
1376
- _,
1377
- o.legislature ?? o.legislature2
1378
- ), y = o.etat;
1454
+ a.documentType ?? a.documentType2
1455
+ ), d = s.join(u, a.chambre ?? a.chambre2), l = s.join(
1456
+ d,
1457
+ a.republique ?? a.republique2
1458
+ ), j = s.join(
1459
+ l,
1460
+ a.legislature ?? a.legislature2
1461
+ ), y = a.etat;
1379
1462
  if (y === void 0)
1380
- return n.ensureDirSync(j), i.join(j, s);
1381
- const F = i.join(j, y);
1382
- let v = "000000" + (o.numero ?? o.numero2);
1463
+ return n.ensureDirSync(j), s.join(j, i);
1464
+ const S = s.join(j, y);
1465
+ let v = "000000" + (a.numero ?? a.numero2);
1383
1466
  v = v.substring(v.length - 6);
1384
- const b = i.join(F, v.substring(0, 3));
1385
- return n.ensureDirSync(b), i.join(b, s);
1467
+ const b = s.join(S, v.substring(0, 3));
1468
+ return n.ensureDirSync(b), s.join(b, i);
1386
1469
  }
1387
- function Ve(t, s) {
1388
- return T(t, s, te);
1470
+ function Le(t, i) {
1471
+ return H(t, i, ie);
1389
1472
  }
1390
- function $e(t, s) {
1391
- const e = G.exec(s);
1392
- q.notStrictEqual(
1473
+ function Pe(t, i) {
1474
+ const e = K.exec(i);
1475
+ C.notStrictEqual(
1393
1476
  e,
1394
1477
  null,
1395
- `Unexpected structure for reunion UID: ${s}`
1478
+ `Unexpected structure for reunion UID: ${i}`
1396
1479
  );
1397
- const o = i.join(t, e[1]), l = i.join(o, e[2]), m = i.join(l, e[3]), _ = i.join(m, e[4]), j = i.join(_, e[5]);
1480
+ const a = s.join(t, e[1]), u = s.join(a, e[2]), d = s.join(u, e[3]), l = s.join(d, e[4]), j = s.join(l, e[5]);
1398
1481
  let y = "000000000" + e[6];
1399
1482
  y = y.substring(y.length - 9);
1400
- const F = i.join(j, y.substring(0, 3)), v = i.join(F, y.substring(3, 3));
1401
- return n.ensureDirSync(v), i.join(v, s);
1483
+ const S = s.join(j, y.substring(0, 3)), v = s.join(S, y.substring(3, 3));
1484
+ return n.ensureDirSync(v), s.join(v, i);
1402
1485
  }
1403
- function Le(t, s) {
1404
- const e = K.exec(s);
1405
- q.notStrictEqual(
1486
+ function xe(t, i) {
1487
+ const e = ee.exec(i);
1488
+ C.notStrictEqual(
1406
1489
  e,
1407
1490
  null,
1408
- `Unexpected structure for scrutin UID: ${s}`
1491
+ `Unexpected structure for scrutin UID: ${i}`
1409
1492
  );
1410
- const o = i.join(t, e[1]), l = i.join(o, e[2]), m = i.join(l, e[3]);
1411
- let _ = "000000" + e[4];
1412
- _ = _.substring(_.length - 6);
1413
- const j = i.join(m, _.substring(0, 3));
1414
- return n.ensureDirSync(j), i.join(j, s);
1493
+ const a = s.join(t, e[1]), u = s.join(a, e[2]), d = s.join(u, e[3]);
1494
+ let l = "000000" + e[4];
1495
+ l = l.substring(l.length - 6);
1496
+ const j = s.join(d, l.substring(0, 3));
1497
+ return n.ensureDirSync(j), s.join(j, i);
1415
1498
  }
1416
- function xe(t, s) {
1417
- return T(t, s, se);
1499
+ function ze(t, i) {
1500
+ return H(t, i, se);
1418
1501
  }
1419
- function Pe(t, s) {
1420
- const e = ee.exec(s);
1421
- q.notStrictEqual(
1502
+ function Oe(t, i) {
1503
+ const e = te.exec(i);
1504
+ C.notStrictEqual(
1422
1505
  e,
1423
1506
  null,
1424
- `Unexpected structure for object with UID: ${s}`
1507
+ `Unexpected structure for object with UID: ${i}`
1425
1508
  );
1426
- const o = i.join(t, e[2]), l = i.join(o, e[3]), m = i.join(l, e[4]), _ = i.join(m, e[5]);
1509
+ const a = s.join(t, e[2]), u = s.join(a, e[3]), d = s.join(u, e[4]), l = s.join(d, e[5]);
1427
1510
  let j = "000000000" + e[7];
1428
1511
  j = j.substring(j.length - 9);
1429
- const y = i.join(_, j.substring(0, 3)), F = i.join(y, j.substring(3, 3));
1430
- return n.ensureDirSync(F), i.join(F, s);
1512
+ const y = s.join(l, j.substring(0, 3)), S = s.join(y, j.substring(3, 3));
1513
+ return n.ensureDirSync(S), s.join(S, i);
1431
1514
  }
1432
- function T(t, s, e) {
1433
- const o = e.exec(s);
1434
- q.notStrictEqual(
1435
- o,
1515
+ function H(t, i, e) {
1516
+ const a = e.exec(i);
1517
+ C.notStrictEqual(
1518
+ a,
1436
1519
  null,
1437
- `Unexpected structure for object with UID: ${s}`
1520
+ `Unexpected structure for object with UID: ${i}`
1438
1521
  );
1439
- const l = i.join(t, o[1]), m = i.join(l, o[2]);
1440
- let _ = "000000" + o[3];
1441
- _ = _.substring(_.length - 6);
1442
- const j = i.join(m, _.substring(0, 3));
1443
- return n.ensureDirSync(j), i.join(j, s);
1522
+ const u = s.join(t, a[1]), d = s.join(u, a[2]);
1523
+ let l = "000000" + a[3];
1524
+ l = l.substring(l.length - 6);
1525
+ const j = s.join(d, l.substring(0, 3));
1526
+ return n.ensureDirSync(j), s.join(j, i);
1444
1527
  }
1445
1528
  export {
1446
1529
  I as EnabledDatasets,
1447
- de as iterLoadAssembleeActeurs,
1448
- ge as iterLoadAssembleeAmendements,
1449
- Se as iterLoadAssembleeComptesRendus,
1450
- Fe as iterLoadAssembleeComptesRendusCommissions,
1451
- _e as iterLoadAssembleeDocuments,
1452
- je as iterLoadAssembleeDossiersParlementaires,
1453
- pe as iterLoadAssembleeOrganes,
1454
- Ae as iterLoadAssembleeQuestions,
1455
- he as iterLoadAssembleeReunions,
1456
- ye as iterLoadAssembleeScrutins,
1457
- ve as loadAssembleeData,
1458
- Ie as loadAssembleeDataFromBigFiles,
1459
- be as loadAssembleeDocumentFile,
1460
- Xe as loadAssembleePhotosDeputes,
1461
- De as loadAssembleePhotosSenateurs,
1462
- Pe as pathFromCompteRenduUid,
1463
- oe as pathFromDocumentUid,
1464
- Ve as pathFromDossierParlementaireUid,
1465
- xe as pathFromQuestionUid,
1466
- $e as pathFromReunionUid,
1467
- Le as pathFromScrutinUid,
1468
- x as walkDir
1530
+ ge as iterLoadAssembleeActeurs,
1531
+ je as iterLoadAssembleeAmendements,
1532
+ ve as iterLoadAssembleeComptesRendus,
1533
+ Ie as iterLoadAssembleeComptesRendusCommissions,
1534
+ he as iterLoadAssembleeDocuments,
1535
+ ye as iterLoadAssembleeDossiersParlementaires,
1536
+ _e as iterLoadAssembleeOrganes,
1537
+ Fe as iterLoadAssembleeQuestions,
1538
+ Se as iterLoadAssembleeReunions,
1539
+ Ae as iterLoadAssembleeScrutins,
1540
+ be as loadAssembleeData,
1541
+ De as loadAssembleeDataFromBigFiles,
1542
+ Xe as loadAssembleeDocumentFile,
1543
+ Ve as loadAssembleePhotosDeputes,
1544
+ $e as loadAssembleePhotosSenateurs,
1545
+ Oe as pathFromCompteRenduUid,
1546
+ ae as pathFromDocumentUid,
1547
+ Le as pathFromDossierParlementaireUid,
1548
+ ze as pathFromQuestionUid,
1549
+ Pe as pathFromReunionUid,
1550
+ xe as pathFromScrutinUid,
1551
+ P as walkDir
1469
1552
  };