@tricoteuses/tisseuse 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{html-_xYtGRXN.js → html-IERGWCi4.js} +689 -612
- package/dist/index.js +1 -1
- package/dist/server.js +790 -675
- package/dist/src/lib/extractors/action_directives.d.ts +4 -0
- package/dist/src/lib/server/index.d.ts +1 -1
- package/dist/src/lib/server/parsed_bills.d.ts +16 -0
- package/dist/src/lib/text_parsers/ast.d.ts +2 -0
- package/dist/src/lib/text_parsers/citations.d.ts +4 -4
- package/dist/src/lib/text_parsers/repeated_actions.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10348,7 +10348,38 @@ var Kp = C(String.raw`^« ?([^»\n]+)`, {
|
|
|
10348
10348
|
stop: n[1]
|
|
10349
10349
|
}, t.position());
|
|
10350
10350
|
}
|
|
10351
|
-
})
|
|
10351
|
+
});
|
|
10352
|
+
function Jp(e, t) {
|
|
10353
|
+
let n = e.indexOf("\n", t);
|
|
10354
|
+
return n === -1 ? !1 : /^[ \t]*«/u.test(e.slice(n + 1));
|
|
10355
|
+
}
|
|
10356
|
+
function Yp(e) {
|
|
10357
|
+
return /»[.;]?\s*$/u.exec(e);
|
|
10358
|
+
}
|
|
10359
|
+
var $ = T((e) => {
|
|
10360
|
+
let { input: t } = e, n = e.offset;
|
|
10361
|
+
if (t[n] !== "«" || t.indexOf("\n", n) === -1) return;
|
|
10362
|
+
let r = n, i = [];
|
|
10363
|
+
for (; r < t.length;) {
|
|
10364
|
+
let a = t.indexOf("\n", r), o = a === -1 ? t.length : a, s = t.slice(r, o), c = /^[ \t]*« ?/u.exec(s);
|
|
10365
|
+
if (c === null) break;
|
|
10366
|
+
let l = r + c[0].length, u = o, d = Yp(s), f = Jp(t, o), p = s.slice(c[0].length).includes("«");
|
|
10367
|
+
if (d !== null && (!f || !p)) for (u = r + d.index; u > l && /\s/u.test(t[u - 1]);) u--;
|
|
10368
|
+
if (i.push({ position: {
|
|
10369
|
+
start: l,
|
|
10370
|
+
stop: u
|
|
10371
|
+
} }), d !== null && !f) return e.length = r + d.index + d[0].length - n, e.usedInputs = t.slice(n, n + e.length), e.offset += e.length, e.length = 0, {
|
|
10372
|
+
content: i,
|
|
10373
|
+
position: {
|
|
10374
|
+
start: n,
|
|
10375
|
+
stop: e.offset
|
|
10376
|
+
},
|
|
10377
|
+
type: "citation"
|
|
10378
|
+
};
|
|
10379
|
+
if (a === -1) break;
|
|
10380
|
+
r = a + 1;
|
|
10381
|
+
}
|
|
10382
|
+
}, x([_(Kp, {
|
|
10352
10383
|
min: 1,
|
|
10353
10384
|
separator: C(String.raw`»?\n`),
|
|
10354
10385
|
value: (e) => e.map((e, t) => t === 0 ? e : e[1])
|
|
@@ -10357,7 +10388,7 @@ var Kp = C(String.raw`^« ?([^»\n]+)`, {
|
|
|
10357
10388
|
position: t.position(),
|
|
10358
10389
|
type: "citation"
|
|
10359
10390
|
}) }), x([ue, qp], { value: (e) => e[1] }));
|
|
10360
|
-
function
|
|
10391
|
+
function Xp(e, t) {
|
|
10361
10392
|
let n = 0, r = t.content[0].position, i = t.content.at(-1).position, a = t.content.map(({ position: t }) => e.input.slice(t.start, t.stop)).join("\n");
|
|
10362
10393
|
return {
|
|
10363
10394
|
input: e.text(t.position),
|
|
@@ -10388,12 +10419,12 @@ function Jp(e, t) {
|
|
|
10388
10419
|
title: "Conversion de citation"
|
|
10389
10420
|
};
|
|
10390
10421
|
}
|
|
10391
|
-
function
|
|
10392
|
-
return
|
|
10422
|
+
function Zp(e, t) {
|
|
10423
|
+
return Xp(new n(e), t).output;
|
|
10393
10424
|
}
|
|
10394
10425
|
//#endregion
|
|
10395
10426
|
//#region src/lib/text_parsers/legal_text_aliases.ts
|
|
10396
|
-
var
|
|
10427
|
+
var Qp = [
|
|
10397
10428
|
{
|
|
10398
10429
|
cid: "LEGITEXT000025024948",
|
|
10399
10430
|
nature: "CODE",
|
|
@@ -10550,10 +10581,10 @@ var Xp = [
|
|
|
10550
10581
|
pattern: "(?:comofi|cmf)",
|
|
10551
10582
|
title: "Code monétaire et financier"
|
|
10552
10583
|
}
|
|
10553
|
-
],
|
|
10584
|
+
], $p = Qp.map((e) => ({
|
|
10554
10585
|
alias: e,
|
|
10555
10586
|
regExp: RegExp(`^(?:${e.pattern})$`, "iv")
|
|
10556
|
-
})),
|
|
10587
|
+
})), em = `(?:${Qp.map(({ pattern: e }) => `(?:${e})`).join("|")})`, tm = {
|
|
10557
10588
|
I: {
|
|
10558
10589
|
cid: "LEGITEXT000006069568",
|
|
10559
10590
|
nature: "CODE",
|
|
@@ -10575,8 +10606,8 @@ var Xp = [
|
|
|
10575
10606
|
title: "Code général des impôts, annexe IV"
|
|
10576
10607
|
}
|
|
10577
10608
|
};
|
|
10578
|
-
function
|
|
10579
|
-
let t =
|
|
10609
|
+
function nm(e) {
|
|
10610
|
+
let t = $p.find(({ regExp: t }) => t.test(e))?.alias;
|
|
10580
10611
|
if (t === void 0) return;
|
|
10581
10612
|
let { cid: n, nature: r, title: i } = t;
|
|
10582
10613
|
return {
|
|
@@ -10585,35 +10616,35 @@ function em(e) {
|
|
|
10585
10616
|
title: i
|
|
10586
10617
|
};
|
|
10587
10618
|
}
|
|
10588
|
-
function
|
|
10589
|
-
let n =
|
|
10619
|
+
function rm(e, t) {
|
|
10620
|
+
let n = nm(e);
|
|
10590
10621
|
return n === void 0 ? void 0 : {
|
|
10591
10622
|
...n,
|
|
10592
10623
|
position: t,
|
|
10593
10624
|
type: "texte"
|
|
10594
10625
|
};
|
|
10595
10626
|
}
|
|
10596
|
-
var
|
|
10627
|
+
var im = T(...Qp.map(({ pattern: e }) => C(`${e}(?=$|\\P{Alphabetic})`, {
|
|
10597
10628
|
flags: "iv",
|
|
10598
|
-
value: (e, t) =>
|
|
10629
|
+
value: (e, t) => rm(e[0], t.position())
|
|
10599
10630
|
})));
|
|
10600
10631
|
//#endregion
|
|
10601
10632
|
//#region src/lib/text_parsers/doctrinal_references.ts
|
|
10602
|
-
function
|
|
10633
|
+
function am(e, t) {
|
|
10603
10634
|
let n = e.indices?.groups?.[t];
|
|
10604
10635
|
return n === void 0 ? void 0 : {
|
|
10605
10636
|
start: n[0],
|
|
10606
10637
|
stop: n[1]
|
|
10607
10638
|
};
|
|
10608
10639
|
}
|
|
10609
|
-
function
|
|
10640
|
+
function om(e) {
|
|
10610
10641
|
let t = e.groups?.article?.trim(), n = e.groups?.text;
|
|
10611
10642
|
if (t === void 0 || n === void 0) return;
|
|
10612
|
-
let r =
|
|
10643
|
+
let r = am(e, "articleKeyword");
|
|
10613
10644
|
if (r === void 0 && !/^(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d/iu.test(t)) return;
|
|
10614
|
-
let i = t.match(/^(?<article>.*\d(?:[\p{L}\d-]*))\s+(?<subdivision>[IVXLCDM]+(?:\s+(?:bis|ter|quater))?|\d+\s*(?:°|º))$/iu)?.groups?.article?.trim() ?? t, a = Jt(i), o =
|
|
10645
|
+
let i = t.match(/^(?<article>.*\d(?:[\p{L}\d-]*))\s+(?<subdivision>[IVXLCDM]+(?:\s+(?:bis|ter|quater))?|\d+\s*(?:°|º))$/iu)?.groups?.article?.trim() ?? t, a = Jt(i), o = am(e, "article"), s = am(e, "text");
|
|
10615
10646
|
if (a === void 0 || o === void 0 || s === void 0) return;
|
|
10616
|
-
let c =
|
|
10647
|
+
let c = rm(n, s);
|
|
10617
10648
|
if (c === void 0) return;
|
|
10618
10649
|
let l = {
|
|
10619
10650
|
num: a,
|
|
@@ -10633,36 +10664,36 @@ function im(e) {
|
|
|
10633
10664
|
type: "parent-enfant"
|
|
10634
10665
|
};
|
|
10635
10666
|
}
|
|
10636
|
-
var
|
|
10667
|
+
var sm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
10637
10668
|
flags: "i",
|
|
10638
10669
|
value: (e, t) => {
|
|
10639
|
-
let n =
|
|
10670
|
+
let n = tm[e[1].toUpperCase()];
|
|
10640
10671
|
return n === void 0 ? void 0 : {
|
|
10641
10672
|
...n,
|
|
10642
10673
|
position: t.position(),
|
|
10643
10674
|
type: "texte"
|
|
10644
10675
|
};
|
|
10645
10676
|
}
|
|
10646
|
-
}),
|
|
10677
|
+
}), cm = o(Qt, { value: (e, t) => ({
|
|
10647
10678
|
num: e,
|
|
10648
10679
|
position: t.position(),
|
|
10649
10680
|
type: "article"
|
|
10650
|
-
}) }),
|
|
10681
|
+
}) }), lm = x([C(String.raw`\s*,\s*art(?:icle)?\.?\s+`, { flags: "i" }), cm], { value: (e) => e[1] }), um = x([
|
|
10651
10682
|
w(C(String.raw`(?:le|la|les)\s+`, { flags: "i" }), { default: "" }),
|
|
10652
|
-
T(
|
|
10653
|
-
|
|
10683
|
+
T(sm, im),
|
|
10684
|
+
lm
|
|
10654
10685
|
], { value: (e, t) => ({
|
|
10655
10686
|
child: e[2],
|
|
10656
10687
|
parent: e[1],
|
|
10657
10688
|
position: t.position(),
|
|
10658
10689
|
type: "parent-enfant"
|
|
10659
|
-
}) }),
|
|
10690
|
+
}) }), dm = C(String.raw`(?:(?<articleKeyword>articles?)\s+)?(?<article>\S[^\n,;:\(\)]*?)\s+(?:(?:du|de\s+la|de\s+l['’])\s+)?(?<text>${em})(?=$|\P{Alphabetic})`, {
|
|
10660
10691
|
flags: "div",
|
|
10661
|
-
value: (e) =>
|
|
10662
|
-
}),
|
|
10692
|
+
value: (e) => om(e)
|
|
10693
|
+
}), fm = C(String.raw`(?<article1>(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d[^\n,;:\(\)]*?)\s+(?<coordinator>et|ou)\s+(?<article2>(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d[^\n,;:\(\)]*?)\s+(?:(?:du|de\s+la|de\s+l['’])\s+)?(?<text>${em})(?=$|\P{Alphabetic})`, {
|
|
10663
10694
|
flags: "div",
|
|
10664
10695
|
value: (e) => {
|
|
10665
|
-
let t =
|
|
10696
|
+
let t = am(e, "article1"), n = am(e, "article2"), r = am(e, "text"), i = e.groups?.article1, a = e.groups?.article2, o = e.groups?.coordinator, s = i === void 0 ? void 0 : Jt(i.trim()), c = a === void 0 ? void 0 : Jt(a.trim()), l = e.groups?.text === void 0 || r === void 0 ? void 0 : rm(e.groups.text, r);
|
|
10666
10697
|
if (!(t === void 0 || n === void 0 || s === void 0 || c === void 0 || o !== "et" && o !== "ou" || l === void 0)) return {
|
|
10667
10698
|
child: {
|
|
10668
10699
|
coordinator: o,
|
|
@@ -10690,7 +10721,7 @@ var am = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
|
10690
10721
|
type: "parent-enfant"
|
|
10691
10722
|
};
|
|
10692
10723
|
}
|
|
10693
|
-
}),
|
|
10724
|
+
}), pm = T(um, fm, dm), mm = (e) => {
|
|
10694
10725
|
let t = e.offset, n = /,\s*(?:par\s+)?/guy;
|
|
10695
10726
|
if (n.lastIndex = t, !n.exec(e.input)) return;
|
|
10696
10727
|
e.offset = n.lastIndex;
|
|
@@ -10706,7 +10737,7 @@ var am = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
|
10706
10737
|
}
|
|
10707
10738
|
return e.offset = i.lastIndex, e.length = 0, e.usedInputs = e.input.slice(t, e.offset), r;
|
|
10708
10739
|
};
|
|
10709
|
-
function
|
|
10740
|
+
function hm(e) {
|
|
10710
10741
|
for (let t = 0; t < e.length; t += 1) {
|
|
10711
10742
|
let r = t === 0 ? void 0 : e[t - 1];
|
|
10712
10743
|
if (r && /[\p{L}\p{N}_]/u.test(r)) continue;
|
|
@@ -10715,7 +10746,15 @@ function pm(e) {
|
|
|
10715
10746
|
}
|
|
10716
10747
|
return null;
|
|
10717
10748
|
}
|
|
10718
|
-
function
|
|
10749
|
+
function gm(e, t) {
|
|
10750
|
+
let r = e.slice(0, Math.max(0, t)), i = /(?:^|[^\p{L}\p{N}_])les\s+/giu, a = null;
|
|
10751
|
+
for (; i.exec(r) !== null;) {
|
|
10752
|
+
let e = new n(r, i.lastIndex), t = Ae(e);
|
|
10753
|
+
typeof t != "number" || t <= 1 || /^\s+occurrences\b/iu.exec(r.slice(e.offset)) && (a = t);
|
|
10754
|
+
}
|
|
10755
|
+
return a;
|
|
10756
|
+
}
|
|
10757
|
+
function _m(e) {
|
|
10719
10758
|
let t = [], r = /(?:,\s*)?par\s+/giu, i = 0, a;
|
|
10720
10759
|
for (; (a = r.exec(e)) !== null;) {
|
|
10721
10760
|
let o = new n(e, r.lastIndex);
|
|
@@ -10727,17 +10766,17 @@ function mm(e) {
|
|
|
10727
10766
|
}
|
|
10728
10767
|
//#endregion
|
|
10729
10768
|
//#region src/lib/text_parsers/actions.ts
|
|
10730
|
-
var
|
|
10769
|
+
var vm = (e) => x([
|
|
10731
10770
|
C(e, { flags: "i" }),
|
|
10732
|
-
|
|
10771
|
+
mm,
|
|
10733
10772
|
C(e === "est" ? "remplacée?" : "remplacée?s", { flags: "i" })
|
|
10734
|
-
], { value: "remplacer" }),
|
|
10773
|
+
], { value: "remplacer" }), ym = T(ee(C("(modalités|conditions) d'application (de )?", { flags: "i" }), {
|
|
10735
10774
|
lookbackLength: 35,
|
|
10736
10775
|
value: { action: "précision" }
|
|
10737
10776
|
}), ee(C("en application (de )?", { flags: "i" }), {
|
|
10738
10777
|
lookbackLength: 35,
|
|
10739
10778
|
value: { action: "application" }
|
|
10740
|
-
})),
|
|
10779
|
+
})), bm = i("après|avant|ajoutée?s?|insérée?s?|complétée?s?|rédigée?s?|suit|modifiée?s?|rétablie?s?|remplacée?s?|supprimée?s?|abrogée?s?|devient", T(x([
|
|
10741
10780
|
b,
|
|
10742
10781
|
C("est complété par les mots ?", { flags: "i" }),
|
|
10743
10782
|
C(" ?:"),
|
|
@@ -10805,7 +10844,7 @@ var hm = (e) => x([
|
|
|
10805
10844
|
}), C("est rétablie? (ainsi qu'il|comme) suit", {
|
|
10806
10845
|
flags: "i",
|
|
10807
10846
|
value: "rétablir"
|
|
10808
|
-
}),
|
|
10847
|
+
}), vm("est"), C("est remplacée?", {
|
|
10809
10848
|
flags: "i",
|
|
10810
10849
|
value: "remplacer"
|
|
10811
10850
|
}), C("sont ainsi modifiée?s", {
|
|
@@ -10820,7 +10859,7 @@ var hm = (e) => x([
|
|
|
10820
10859
|
}), C("sont rétablie?s (ainsi qu'il|comme) suit", {
|
|
10821
10860
|
flags: "i",
|
|
10822
10861
|
value: "rétablir"
|
|
10823
|
-
}),
|
|
10862
|
+
}), vm("sont"), C("sont remplacée?s", {
|
|
10824
10863
|
flags: "i",
|
|
10825
10864
|
value: "remplacer"
|
|
10826
10865
|
}), C("sont renum[eé]rotée?s", {
|
|
@@ -10840,7 +10879,7 @@ var hm = (e) => x([
|
|
|
10840
10879
|
}), C("est remplacée?", {
|
|
10841
10880
|
flags: "i",
|
|
10842
10881
|
value: "remplacer"
|
|
10843
|
-
}),
|
|
10882
|
+
}), vm("est"), vm("sont"), C("sont remplacée?s", {
|
|
10844
10883
|
flags: "i",
|
|
10845
10884
|
value: "remplacer"
|
|
10846
10885
|
}), C("est modifiée?", {
|
|
@@ -11000,23 +11039,23 @@ var hm = (e) => x([
|
|
|
11000
11039
|
}), C("est supprimée?", {
|
|
11001
11040
|
flags: "i",
|
|
11002
11041
|
value: "supprimer"
|
|
11003
|
-
}))], { value: (e) => ({ action: e[1] }) }))),
|
|
11042
|
+
}))], { value: (e) => ({ action: e[1] }) }))), xm = T(un, wn), Sm = T(fn, xn, im, he), Cm = x([xm, _(x([le, Sm], { value: (e) => e[1] }))], { value: (e, t) => _t(e[0], e[1], t.position()) }), wm = x([Sm, _(x([le, Sm], { value: (e) => e[1] }))], { value: (e, t) => _t(e[0], e[1], t.position()) }), Tm = x([se, Cm], { value: (e) => e[1] }), Em = T(x([le, wm], { value: (e) => e[1] }), Tm), Dm = T(x([Ht, w(Em, { default: null })], { value: (e) => {
|
|
11004
11043
|
let t = e[0], n = e[1];
|
|
11005
11044
|
return n === null ? t : mt(n, t);
|
|
11006
|
-
} }),
|
|
11045
|
+
} }), Cm), Om = T(x([Ut, w(Em, { default: null })], { value: (e) => {
|
|
11007
11046
|
let t = e[0], n = e[1];
|
|
11008
11047
|
return n === null ? t : mt(n, t);
|
|
11009
|
-
} }),
|
|
11010
|
-
w(
|
|
11048
|
+
} }), wm), km = x([
|
|
11049
|
+
w(ym, { default: null }),
|
|
11011
11050
|
x([
|
|
11012
11051
|
p,
|
|
11013
|
-
|
|
11052
|
+
Dm,
|
|
11014
11053
|
w([w(C(" modifiée?s", { flags: "i" }), { default: "" }), C(" susvisée?s", { flags: "i" })], { default: "" })
|
|
11015
11054
|
], { value: (e, t) => ({
|
|
11016
11055
|
...e[1],
|
|
11017
11056
|
position: t.position()
|
|
11018
11057
|
}) }),
|
|
11019
|
-
w(
|
|
11058
|
+
w(bm, { default: null })
|
|
11020
11059
|
], { value: (e, t) => {
|
|
11021
11060
|
let n = e[2] ?? e[0];
|
|
11022
11061
|
return n === null ? e[1] : {
|
|
@@ -11025,18 +11064,18 @@ var hm = (e) => x([
|
|
|
11025
11064
|
reference: e[1],
|
|
11026
11065
|
type: "reference_et_action"
|
|
11027
11066
|
};
|
|
11028
|
-
} }),
|
|
11029
|
-
w(
|
|
11067
|
+
} }), Am = T(x([
|
|
11068
|
+
w(ym, { default: null }),
|
|
11030
11069
|
x([
|
|
11031
11070
|
ce,
|
|
11032
|
-
|
|
11071
|
+
Om,
|
|
11033
11072
|
w([w(C(" modifiée?", { flags: "i" }), { default: "" }), C(" susvisée?", { flags: "i" })], { default: "" }),
|
|
11034
11073
|
w(C(String.raw`, ?qui devient [^,]+ ","`, { flags: "i" }), { default: "" })
|
|
11035
11074
|
], { value: (e, t) => ({
|
|
11036
11075
|
...e[1],
|
|
11037
11076
|
position: t.position()
|
|
11038
11077
|
}) }),
|
|
11039
|
-
w(
|
|
11078
|
+
w(bm, { default: null })
|
|
11040
11079
|
], { value: (e, t) => {
|
|
11041
11080
|
let n = e[2] ?? e[0];
|
|
11042
11081
|
return n === null ? e[1] : {
|
|
@@ -11045,23 +11084,23 @@ var hm = (e) => x([
|
|
|
11045
11084
|
reference: e[1],
|
|
11046
11085
|
type: "reference_et_action"
|
|
11047
11086
|
};
|
|
11048
|
-
} }),
|
|
11087
|
+
} }), km), jm = i("article|loi|décret|code|alinéa|phrase|chapitre|titre|livre|partie|section|paragraphe|ordonnance|constitution|directive|règlement|\\d|[ivxlc]+|[a-zA-Z]", x([Am, _([T(Ct, St), Am])], { value: (e, t) => ht(e[0], e[1], t.position()) })), Mm = o(Om, { value: (e, t) => ({
|
|
11049
11088
|
...e,
|
|
11050
11089
|
position: t.position()
|
|
11051
|
-
}) }),
|
|
11090
|
+
}) }), Nm = T(_(Mm, {
|
|
11052
11091
|
min: 2,
|
|
11053
11092
|
separator: Ne,
|
|
11054
11093
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
11055
|
-
}), _(
|
|
11094
|
+
}), _(Mm, {
|
|
11056
11095
|
min: 2,
|
|
11057
11096
|
separator: C(String.raw`\n`),
|
|
11058
11097
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
11059
|
-
}), o(
|
|
11098
|
+
}), o(Mm, { value: (e) => [e] }));
|
|
11060
11099
|
//#endregion
|
|
11061
11100
|
//#region src/lib/extractors/references.ts
|
|
11062
|
-
function*
|
|
11063
|
-
let r =
|
|
11064
|
-
for (let e of
|
|
11101
|
+
function* Pm(e, t) {
|
|
11102
|
+
let r = Xp(e, t), i = new n(r.output), a = _e(r);
|
|
11103
|
+
for (let e of Im(i)) {
|
|
11065
11104
|
e = structuredClone(e), t.references === void 0 && (t.references = []), t.references.push(e);
|
|
11066
11105
|
for (let t of xt(e)) {
|
|
11067
11106
|
let e = t.position;
|
|
@@ -11070,132 +11109,132 @@ function* jm(e, t) {
|
|
|
11070
11109
|
yield e;
|
|
11071
11110
|
}
|
|
11072
11111
|
}
|
|
11073
|
-
function*
|
|
11074
|
-
yield*
|
|
11112
|
+
function* Fm(e, t = {}) {
|
|
11113
|
+
yield* Im(e, t);
|
|
11075
11114
|
}
|
|
11076
|
-
function*
|
|
11077
|
-
let n = i(String.raw`arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+`, T($, tn, _n,
|
|
11115
|
+
function* Im(e, t = {}) {
|
|
11116
|
+
let n = i(String.raw`arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+`, T($, tn, _n, pm, jm), 80, String.raw`(?<=^|\P{Alphabetic})(?:arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+)(?=$|\P{Alphabetic})`);
|
|
11078
11117
|
for (let r of n.extract(e, {
|
|
11079
11118
|
overlapWindow: 80,
|
|
11080
11119
|
overlapWindowForCandidate: t.overlapWindowForCandidate
|
|
11081
|
-
})) if (r !== void 0) if (r.type === "citation") yield*
|
|
11120
|
+
})) if (r !== void 0) if (r.type === "citation") yield* Pm(e, r);
|
|
11082
11121
|
else {
|
|
11083
11122
|
if (r.type === "reference_et_action" || r.type === "alinéa" || r.type === "article" || r.type === "chapitre" || r.type === "item" || r.type === "livre" || r.type === "paragraphe" || r.type === "partie" || r.type === "phrase" || r.type === "section" || r.type === "sous-paragraphe" || r.type === "sous-section" || r.type === "sous-sous-paragraphe" || r.type === "sous-titre" || r.type === "titre" || r.type === "texte" || r.type === "bounded-interval" || r.type === "counted-interval" || r.type === "enumeration" || r.type === "exclusion" || r.type === "parent-enfant" || r.type === "incomplete-header") {
|
|
11084
11123
|
for (let t of xt(r)) if (t.type === "reference_et_action") {
|
|
11085
11124
|
let { originalCitations: n } = t.action;
|
|
11086
|
-
if (n !== void 0) for (let t of n) for (let n of
|
|
11125
|
+
if (n !== void 0) for (let t of n) for (let n of Pm(e, t));
|
|
11087
11126
|
}
|
|
11088
11127
|
}
|
|
11089
11128
|
yield r;
|
|
11090
11129
|
}
|
|
11091
11130
|
}
|
|
11092
|
-
function*
|
|
11131
|
+
function* Lm(e, t) {
|
|
11093
11132
|
let n = _e(t);
|
|
11094
|
-
for (let t of
|
|
11133
|
+
for (let t of Fm(e)) {
|
|
11095
11134
|
for (let e of xt(t, { citations: !0 })) e.position !== void 0 && (e.originalTransformation = v(n, e.position));
|
|
11096
11135
|
yield t;
|
|
11097
11136
|
}
|
|
11098
11137
|
}
|
|
11099
|
-
var
|
|
11138
|
+
var Rm = (e) => [...Fm(e)], zm = (e, t) => [...Lm(e, t)], Bm = "(?:avant|apr[eè]s)", Vm = T(C("avant(?![-A-Za-zÀ-ÖØ-öø-ÿ0-9_])", {
|
|
11100
11139
|
flags: "i",
|
|
11101
11140
|
value: "before"
|
|
11102
11141
|
}), C("apr[eè]s(?![-A-Za-zÀ-ÖØ-öø-ÿ0-9_])", {
|
|
11103
11142
|
flags: "i",
|
|
11104
11143
|
value: "after"
|
|
11105
|
-
})),
|
|
11144
|
+
})), Hm = T(C("(?:au|a[uù])\\s+d[eé]but\\b", {
|
|
11106
11145
|
flags: "i",
|
|
11107
11146
|
value: "start"
|
|
11108
11147
|
}), C("(?:a|à)\\s+la\\s+fin\\b", {
|
|
11109
11148
|
flags: "i",
|
|
11110
11149
|
value: "end"
|
|
11111
11150
|
}));
|
|
11112
|
-
function
|
|
11151
|
+
function Um(e) {
|
|
11113
11152
|
return e === "before" ? "insert_before" : "insert_after";
|
|
11114
11153
|
}
|
|
11115
|
-
function
|
|
11116
|
-
let t =
|
|
11154
|
+
function Wm(e) {
|
|
11155
|
+
let t = Gm(e), n = /(?:^|[^\p{L}\p{N}_-])(avant|apres)(?![\p{L}\p{N}_-])/u.exec(t);
|
|
11117
11156
|
return n ? n[1] === "avant" ? "before" : "after" : null;
|
|
11118
11157
|
}
|
|
11119
|
-
function
|
|
11158
|
+
function Gm(e) {
|
|
11120
11159
|
return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
11121
11160
|
}
|
|
11122
11161
|
//#endregion
|
|
11123
11162
|
//#region src/lib/text_parsers/action_words.ts
|
|
11124
|
-
var
|
|
11125
|
-
function
|
|
11163
|
+
var Km = /\b(ins[èe]re|ins[ée]r[ée]|ajout|remplac|supprim|abrog|compl[èeé]t|r[ée]dig|r[ée]tabl|modifi(?:e|é|ée|és|ées|er|ant|ent))/iu;
|
|
11164
|
+
function qm(e) {
|
|
11126
11165
|
return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
11127
11166
|
}
|
|
11128
|
-
function
|
|
11167
|
+
function Jm(e, t = e) {
|
|
11129
11168
|
return /\bredige\b|\bredigee\b|\bredigees\b|\brediges\b|\bainsi\b/.test(e) || /\bdispositions suivantes\b/.test(t);
|
|
11130
11169
|
}
|
|
11131
|
-
function
|
|
11132
|
-
return
|
|
11170
|
+
function Ym(e) {
|
|
11171
|
+
return Wm(e) === "after";
|
|
11133
11172
|
}
|
|
11134
|
-
function
|
|
11135
|
-
return
|
|
11173
|
+
function Xm(e) {
|
|
11174
|
+
return Wm(e) === "before";
|
|
11136
11175
|
}
|
|
11137
|
-
function
|
|
11176
|
+
function Zm(e) {
|
|
11138
11177
|
return /\bretabl/.test(e);
|
|
11139
11178
|
}
|
|
11140
|
-
function
|
|
11179
|
+
function Qm(e) {
|
|
11141
11180
|
return /\binsere(?:e|es|s)?\b|\bajoute\b|\bajoutee\b|\bajoutes\b|\bajoutees\b|\bcomplete(?:e|es|s)?\b/.test(e);
|
|
11142
11181
|
}
|
|
11143
|
-
function
|
|
11182
|
+
function $m(e) {
|
|
11144
11183
|
return /\bremplace\b|\bremplacee\b|\bremplaces\b|\bremplacees\b/.test(e);
|
|
11145
11184
|
}
|
|
11146
|
-
function
|
|
11185
|
+
function eh(e) {
|
|
11147
11186
|
return /\bsupprime\b|\bsupprimee\b|\bsupprimes\b|\bsupprimees\b|\babroge\b|\babrogee\b|\babroges\b|\babrogees\b/.test(e);
|
|
11148
11187
|
}
|
|
11149
|
-
function
|
|
11188
|
+
function th(e) {
|
|
11150
11189
|
return /\b(remplace|modifie|redige|rediges|redigee|redigees)\b/.test(e);
|
|
11151
11190
|
}
|
|
11152
11191
|
//#endregion
|
|
11153
11192
|
//#region src/lib/extractors/portion_references.ts
|
|
11154
|
-
function
|
|
11193
|
+
function nh(e, t) {
|
|
11155
11194
|
e && (e.start += t, e.stop += t);
|
|
11156
11195
|
}
|
|
11157
|
-
function
|
|
11196
|
+
function rh(e, t) {
|
|
11158
11197
|
if (e.type === "parent-enfant") {
|
|
11159
|
-
|
|
11198
|
+
rh(e.parent, t), rh(e.child, t), nh(e.position, t);
|
|
11160
11199
|
return;
|
|
11161
11200
|
}
|
|
11162
11201
|
if (e.type === "bounded-interval") {
|
|
11163
|
-
|
|
11202
|
+
rh(e.first, t), rh(e.last, t), nh(e.position, t);
|
|
11164
11203
|
return;
|
|
11165
11204
|
}
|
|
11166
11205
|
if (e.type === "counted-interval") {
|
|
11167
|
-
|
|
11206
|
+
rh(e.first, t), nh(e.position, t);
|
|
11168
11207
|
return;
|
|
11169
11208
|
}
|
|
11170
11209
|
if (e.type === "enumeration" || e.type === "exclusion") {
|
|
11171
|
-
|
|
11210
|
+
rh(e.left, t), rh(e.right, t), nh(e.position, t);
|
|
11172
11211
|
return;
|
|
11173
11212
|
}
|
|
11174
11213
|
if (e.type === "reference_et_action") {
|
|
11175
|
-
|
|
11214
|
+
rh(e.reference, t), nh(e.position, t);
|
|
11176
11215
|
return;
|
|
11177
11216
|
}
|
|
11178
|
-
|
|
11217
|
+
nh(e.position, t);
|
|
11179
11218
|
}
|
|
11180
|
-
function
|
|
11219
|
+
function ih(e) {
|
|
11181
11220
|
return e.replace(/\b(de\s+l['’]?|de\s+la|de\s+le|du|des)\s*$/i, "");
|
|
11182
11221
|
}
|
|
11183
|
-
function
|
|
11222
|
+
function ah(e) {
|
|
11184
11223
|
let t = /^(?:(?:[aà]\s+)?l['’]|(?:[aà]\s+)?la\b|(?:[aà]\s+)?le\b|les\b|des\b|aux\b|du\b)\s*/iu.exec(e)?.[0].length ?? 0, n = e.slice(t > 0 ? t : 0).trim();
|
|
11185
11224
|
return n ? {
|
|
11186
11225
|
text: n,
|
|
11187
11226
|
offset: t
|
|
11188
11227
|
} : null;
|
|
11189
11228
|
}
|
|
11190
|
-
function
|
|
11229
|
+
function oh(e) {
|
|
11191
11230
|
return [...e.matchAll(/(?:^|\P{L})(\p{L})/gu)].map((e) => (e.index ?? 0) + e[0].length - (e[1]?.length ?? 0));
|
|
11192
11231
|
}
|
|
11193
|
-
function
|
|
11232
|
+
function sh(e) {
|
|
11194
11233
|
let t = new n(e), r = Rt(t);
|
|
11195
11234
|
return !r || t.remaining().trim().length !== 0 ? null : r;
|
|
11196
11235
|
}
|
|
11197
|
-
function
|
|
11198
|
-
for (let t of
|
|
11236
|
+
function ch(e) {
|
|
11237
|
+
for (let t of oh(e)) {
|
|
11199
11238
|
let r = new n(e, t), i = Et(r);
|
|
11200
11239
|
if (!(i === void 0 || r.remaining().trim() !== "")) return {
|
|
11201
11240
|
nature: i,
|
|
@@ -11204,17 +11243,17 @@ function ah(e) {
|
|
|
11204
11243
|
}
|
|
11205
11244
|
return null;
|
|
11206
11245
|
}
|
|
11207
|
-
function
|
|
11246
|
+
function lh(e, t) {
|
|
11208
11247
|
let n = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
|
|
11209
11248
|
if (!n) return null;
|
|
11210
|
-
for (let e of
|
|
11211
|
-
let r = n.slice(e).trim(), i =
|
|
11249
|
+
for (let e of oh(n)) {
|
|
11250
|
+
let r = n.slice(e).trim(), i = ch(r);
|
|
11212
11251
|
if (!i) continue;
|
|
11213
|
-
let a =
|
|
11252
|
+
let a = _m(r.slice(0, i.start)).trim();
|
|
11214
11253
|
if (!a) continue;
|
|
11215
11254
|
let o = /\s*(,|\bet\b|\bou\b|(?<!\p{L})[aà](?!\p{L}))\s*/giu, s = [], c = 0, l;
|
|
11216
11255
|
for (; (l = o.exec(a)) !== null;) {
|
|
11217
|
-
let e =
|
|
11256
|
+
let e = qm(l[1] ?? "");
|
|
11218
11257
|
if (a.slice(c, l.index).trim() === "") {
|
|
11219
11258
|
e !== "a" && e !== "à" && (c = o.lastIndex);
|
|
11220
11259
|
continue;
|
|
@@ -11231,17 +11270,17 @@ function oh(e, t) {
|
|
|
11231
11270
|
}), s.length < 2) continue;
|
|
11232
11271
|
let u = s.some((e) => e.separator === "à"), d = [], f = [], p = !0, m = i.nature, h;
|
|
11233
11272
|
for (let [n, r] of s.entries()) {
|
|
11234
|
-
let i =
|
|
11273
|
+
let i = ah(r.text);
|
|
11235
11274
|
if (!i) {
|
|
11236
11275
|
d.length = 0;
|
|
11237
11276
|
break;
|
|
11238
11277
|
}
|
|
11239
|
-
let a =
|
|
11278
|
+
let a = sh(`${i.text} ${m}`);
|
|
11240
11279
|
if (!a) {
|
|
11241
11280
|
d.length = 0;
|
|
11242
11281
|
break;
|
|
11243
11282
|
}
|
|
11244
|
-
|
|
11283
|
+
rh(a, t + e + r.start + i.offset), d.push(a), a.type !== m || a.index === void 0 || a.index < 1 ? p = !1 : (h !== void 0 && !u && a.index !== h + 1 && (p = !1), h = a.index), n < s.length - 1 && (f.push(r.separator ?? "et"), (r.separator ?? "et") === "ou" && (p = !1));
|
|
11245
11284
|
}
|
|
11246
11285
|
let [g, ..._] = d;
|
|
11247
11286
|
if (!g || _.length === 0) continue;
|
|
@@ -11258,16 +11297,16 @@ function oh(e, t) {
|
|
|
11258
11297
|
}
|
|
11259
11298
|
return null;
|
|
11260
11299
|
}
|
|
11261
|
-
function
|
|
11300
|
+
function uh(e, t) {
|
|
11262
11301
|
let r = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
|
|
11263
11302
|
if (!r) return null;
|
|
11264
|
-
for (let e of
|
|
11303
|
+
for (let e of oh(r)) {
|
|
11265
11304
|
let i = r.slice(e);
|
|
11266
11305
|
if (!i) continue;
|
|
11267
11306
|
let a = new n(i), o = Rt(a);
|
|
11268
11307
|
if (!o || a.offset === 0 || !se(a)) continue;
|
|
11269
|
-
let s = a.offset, c =
|
|
11270
|
-
if (c) return
|
|
11308
|
+
let s = a.offset, c = lh(i.slice(s), t + e + s);
|
|
11309
|
+
if (c) return rh(o, t + e), {
|
|
11271
11310
|
...mt(c, o),
|
|
11272
11311
|
position: {
|
|
11273
11312
|
start: o.position.start,
|
|
@@ -11277,57 +11316,57 @@ function sh(e, t) {
|
|
|
11277
11316
|
}
|
|
11278
11317
|
return null;
|
|
11279
11318
|
}
|
|
11280
|
-
function
|
|
11281
|
-
let r =
|
|
11319
|
+
function dh(e, t) {
|
|
11320
|
+
let r = ih(e);
|
|
11282
11321
|
if (!r) return null;
|
|
11283
|
-
let i =
|
|
11322
|
+
let i = uh(r, t);
|
|
11284
11323
|
if (i) return i;
|
|
11285
|
-
let a =
|
|
11324
|
+
let a = lh(r, t);
|
|
11286
11325
|
if (a) return a;
|
|
11287
|
-
for (let e of
|
|
11326
|
+
for (let e of oh(r)) {
|
|
11288
11327
|
let i = r.slice(e);
|
|
11289
11328
|
if (!i) continue;
|
|
11290
11329
|
let a = new n(i), o = Rt(a);
|
|
11291
|
-
if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return
|
|
11330
|
+
if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return rh(o, t + e), o;
|
|
11292
11331
|
}
|
|
11293
11332
|
return null;
|
|
11294
11333
|
}
|
|
11295
|
-
function
|
|
11334
|
+
function fh(e) {
|
|
11296
11335
|
return Math.max(0, ...Rp(e).map((e) => e.kind === "single" ? e.steps.length : Math.max(e.first.length, e.last.length)));
|
|
11297
11336
|
}
|
|
11298
|
-
function
|
|
11337
|
+
function ph(e) {
|
|
11299
11338
|
return Rp(e).length;
|
|
11300
11339
|
}
|
|
11301
|
-
function
|
|
11340
|
+
function mh(e, t) {
|
|
11302
11341
|
if (!e) return t;
|
|
11303
11342
|
if (!t) return e;
|
|
11304
|
-
let n =
|
|
11305
|
-
return n === r ?
|
|
11343
|
+
let n = fh(e), r = fh(t);
|
|
11344
|
+
return n === r ? ph(e) >= ph(t) ? e : t : n > r ? e : t;
|
|
11306
11345
|
}
|
|
11307
|
-
function
|
|
11346
|
+
function hh(e) {
|
|
11308
11347
|
return e.map((e) => ({
|
|
11309
11348
|
reference: e,
|
|
11310
|
-
specificity:
|
|
11349
|
+
specificity: fh(e)
|
|
11311
11350
|
})).filter((e) => e.specificity > 0).sort((e, t) => t.specificity - e.specificity)[0]?.reference ?? null;
|
|
11312
11351
|
}
|
|
11313
|
-
function
|
|
11352
|
+
function gh(e, { actionIndex: t = e.length } = {}) {
|
|
11314
11353
|
let r = /\barticle\b/i.exec(e);
|
|
11315
11354
|
if (!r || r.index === void 0) return null;
|
|
11316
11355
|
let i = r.index, a = new n(e.slice(i)), o = fn(a);
|
|
11317
11356
|
if (!o) return null;
|
|
11318
|
-
|
|
11319
|
-
let s = e.slice(0, i), c = i + a.offset, l = e.slice(c, t), u =
|
|
11357
|
+
rh(o, i);
|
|
11358
|
+
let s = e.slice(0, i), c = i + a.offset, l = e.slice(c, t), u = mh(hh(_h(s)), dh(s, 0)) ?? hh(_h(l)) ?? dh(l, c);
|
|
11320
11359
|
return u ? mt(o, u) : null;
|
|
11321
11360
|
}
|
|
11322
|
-
function
|
|
11323
|
-
return
|
|
11361
|
+
function _h(e) {
|
|
11362
|
+
return Rm(new n(e));
|
|
11324
11363
|
}
|
|
11325
11364
|
//#endregion
|
|
11326
11365
|
//#region src/lib/extractors/quoted_text.ts
|
|
11327
|
-
function
|
|
11366
|
+
function vh(e) {
|
|
11328
11367
|
return e.split(/\n+/).map((e) => e.replace(/^\s*[«“"]\s*/u, "").trim()).filter((e) => e.length > 0).join("\n").replace(/[»”"]\s*$/u, "").trim();
|
|
11329
11368
|
}
|
|
11330
|
-
function
|
|
11369
|
+
function yh(e) {
|
|
11331
11370
|
let t = [], r = 0;
|
|
11332
11371
|
for (; r < e.length;) {
|
|
11333
11372
|
let i = e.indexOf("«", r);
|
|
@@ -11339,7 +11378,7 @@ function gh(e) {
|
|
|
11339
11378
|
r = i + 1;
|
|
11340
11379
|
continue;
|
|
11341
11380
|
}
|
|
11342
|
-
let s =
|
|
11381
|
+
let s = vh(Zp(e, o)), c = o.position ?? {
|
|
11343
11382
|
start: i,
|
|
11344
11383
|
stop: i + 1
|
|
11345
11384
|
};
|
|
@@ -11353,7 +11392,7 @@ function gh(e) {
|
|
|
11353
11392
|
}
|
|
11354
11393
|
return t;
|
|
11355
11394
|
}
|
|
11356
|
-
function
|
|
11395
|
+
function bh(e, t) {
|
|
11357
11396
|
if (t.length === 0) return e;
|
|
11358
11397
|
let n = 0, r = [];
|
|
11359
11398
|
for (let { start: i, end: a } of t) {
|
|
@@ -11362,7 +11401,7 @@ function _h(e, t) {
|
|
|
11362
11401
|
}
|
|
11363
11402
|
return n < e.length && r.push(e.slice(n)), r.join("");
|
|
11364
11403
|
}
|
|
11365
|
-
function
|
|
11404
|
+
function xh(e) {
|
|
11366
11405
|
let t = [], n = 0;
|
|
11367
11406
|
for (; n < e.length;) {
|
|
11368
11407
|
let r = e.indexOf("«", n);
|
|
@@ -11382,13 +11421,13 @@ function vh(e) {
|
|
|
11382
11421
|
}
|
|
11383
11422
|
return t;
|
|
11384
11423
|
}
|
|
11385
|
-
function
|
|
11424
|
+
function Sh(e, t) {
|
|
11386
11425
|
return e ? t.some((t) => e.start >= t.start && e.stop <= t.end) : !1;
|
|
11387
11426
|
}
|
|
11388
|
-
function
|
|
11389
|
-
return
|
|
11427
|
+
function Ch(e, t) {
|
|
11428
|
+
return Sh(e, t);
|
|
11390
11429
|
}
|
|
11391
|
-
function
|
|
11430
|
+
function wh(e) {
|
|
11392
11431
|
if (!e.includes("«")) return e;
|
|
11393
11432
|
let t = e.split(""), n = !1;
|
|
11394
11433
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -11407,10 +11446,10 @@ function xh(e) {
|
|
|
11407
11446
|
}
|
|
11408
11447
|
//#endregion
|
|
11409
11448
|
//#region src/lib/text_parsers/action_citation_patterns.ts
|
|
11410
|
-
function
|
|
11449
|
+
function Th(e) {
|
|
11411
11450
|
return `(?:${e.join("|")})`;
|
|
11412
11451
|
}
|
|
11413
|
-
var
|
|
11452
|
+
var Eh = [
|
|
11414
11453
|
"(?:à\\s+|de\\s+)?l[’']année",
|
|
11415
11454
|
"(?:à\\s+|de\\s+)?la date",
|
|
11416
11455
|
"(?:à\\s+|de\\s+)?la mention",
|
|
@@ -11428,7 +11467,7 @@ var Ch = [
|
|
|
11428
11467
|
"(?:aux|des|les)\\s+nombres",
|
|
11429
11468
|
"(?:aux|des|les)\\s+références",
|
|
11430
11469
|
"le tableau intitulé"
|
|
11431
|
-
],
|
|
11470
|
+
], Dh = [
|
|
11432
11471
|
"l[’']année",
|
|
11433
11472
|
"la date",
|
|
11434
11473
|
"la mention",
|
|
@@ -11446,10 +11485,10 @@ var Ch = [
|
|
|
11446
11485
|
"les mots",
|
|
11447
11486
|
"les nombres",
|
|
11448
11487
|
"les références"
|
|
11449
|
-
],
|
|
11488
|
+
], Oh = Th(Eh), kh = Th(Dh);
|
|
11450
11489
|
//#endregion
|
|
11451
11490
|
//#region src/lib/text_parsers/action_directives.ts
|
|
11452
|
-
function
|
|
11491
|
+
function Ah(e) {
|
|
11453
11492
|
return e.type === "reference_et_action" ? {
|
|
11454
11493
|
action: e.action,
|
|
11455
11494
|
reference: e.reference
|
|
@@ -11458,7 +11497,7 @@ function Dh(e) {
|
|
|
11458
11497
|
reference: e
|
|
11459
11498
|
};
|
|
11460
11499
|
}
|
|
11461
|
-
function
|
|
11500
|
+
function jh(e) {
|
|
11462
11501
|
let t = e.indices?.[0]?.[0] ?? e.index, n = /« ?(.*?) ?»/dg, r = [], i;
|
|
11463
11502
|
for (; (i = n.exec(e[0])) !== null;) {
|
|
11464
11503
|
let e = i.indices?.[1], n = i.indices?.[0];
|
|
@@ -11474,21 +11513,21 @@ function Oh(e) {
|
|
|
11474
11513
|
}
|
|
11475
11514
|
return r;
|
|
11476
11515
|
}
|
|
11477
|
-
var
|
|
11478
|
-
C(`${
|
|
11516
|
+
var Mh = x([
|
|
11517
|
+
C(`${Oh}s?`, { flags: "i" }),
|
|
11479
11518
|
C(" ?: ?"),
|
|
11480
11519
|
$
|
|
11481
|
-
], { value: (e) => e[2] }),
|
|
11482
|
-
C(`${
|
|
11520
|
+
], { value: (e) => e[2] }), Nh = x([
|
|
11521
|
+
C(`${kh}s?(?: suivant(?:e)?s?)?`, { flags: "i" }),
|
|
11483
11522
|
C(" ?: ?"),
|
|
11484
11523
|
$
|
|
11485
|
-
], { value: (e) => e[2] }),
|
|
11524
|
+
], { value: (e) => e[2] }), Ph = x([
|
|
11486
11525
|
b,
|
|
11487
|
-
|
|
11526
|
+
Mh,
|
|
11488
11527
|
S,
|
|
11489
11528
|
T(C("est remplacée? par", { flags: "i" }), C("sont remplacée?s par", { flags: "i" })),
|
|
11490
11529
|
S,
|
|
11491
|
-
|
|
11530
|
+
Nh
|
|
11492
11531
|
], { value: (e) => ({
|
|
11493
11532
|
action: {
|
|
11494
11533
|
action: "remplacer",
|
|
@@ -11499,9 +11538,9 @@ var kh = x([
|
|
|
11499
11538
|
replacementCitation: e[5],
|
|
11500
11539
|
targetCitation: e[1]
|
|
11501
11540
|
}
|
|
11502
|
-
}) }),
|
|
11541
|
+
}) }), Fh = T(C(`(?:, ?| )(?:${Oh}s? ?: ?« ?[^»]+ ?»(?: ?(?:,|et) ?)*)+(?:est|sont) (?:supprimée?s?|abrogée?s?)`, {
|
|
11503
11542
|
flags: "di",
|
|
11504
|
-
value: (e) =>
|
|
11543
|
+
value: (e) => jh(e).map((e) => ({
|
|
11505
11544
|
action: {
|
|
11506
11545
|
action: "supprimer",
|
|
11507
11546
|
actionInContent: !0
|
|
@@ -11513,8 +11552,8 @@ var kh = x([
|
|
|
11513
11552
|
}))
|
|
11514
11553
|
}), x([
|
|
11515
11554
|
b,
|
|
11516
|
-
|
|
11517
|
-
_([C("(?:, ?| et )"),
|
|
11555
|
+
Mh,
|
|
11556
|
+
_([C("(?:, ?| et )"), Mh], { value: (e) => e.map((e) => e[1]) }),
|
|
11518
11557
|
S,
|
|
11519
11558
|
T(C("est supprimée?", { flags: "i" }), C("sont supprimée?s", { flags: "i" }), C("est abrogée?", { flags: "i" }), C("sont abrogée?s", { flags: "i" }))
|
|
11520
11559
|
], { value: (e) => [e[1], ...e[2] ?? []].map((e) => ({
|
|
@@ -11526,9 +11565,9 @@ var kh = x([
|
|
|
11526
11565
|
kind: "delete",
|
|
11527
11566
|
targetCitation: e
|
|
11528
11567
|
}
|
|
11529
|
-
})) })),
|
|
11568
|
+
})) })), Ih = T(x([
|
|
11530
11569
|
b,
|
|
11531
|
-
|
|
11570
|
+
Vm,
|
|
11532
11571
|
S,
|
|
11533
11572
|
C("(?:la référence|la mention|le mot|les mots|le signe)", { flags: "i" }),
|
|
11534
11573
|
C(" ?: ?"),
|
|
@@ -11544,10 +11583,10 @@ var kh = x([
|
|
|
11544
11583
|
},
|
|
11545
11584
|
operation: {
|
|
11546
11585
|
insertCitation: e[9],
|
|
11547
|
-
kind:
|
|
11586
|
+
kind: Um(e[1]),
|
|
11548
11587
|
targetCitation: e[5]
|
|
11549
11588
|
}
|
|
11550
|
-
}) }),
|
|
11589
|
+
}) }), Ph, Fh, x([
|
|
11551
11590
|
b,
|
|
11552
11591
|
T(C("est ainsi rédigée?", { flags: "i" }), C("sont ainsi rédigée?s", { flags: "i" }), C("est rédigée? (?:ainsi qu'il|comme) suit", { flags: "i" }), C("sont rédigée?s (?:ainsi qu'il|comme) suit", { flags: "i" })),
|
|
11553
11592
|
C(" ?: ?"),
|
|
@@ -11562,27 +11601,27 @@ var kh = x([
|
|
|
11562
11601
|
replacementCitation: e[3],
|
|
11563
11602
|
replacementKind: "text"
|
|
11564
11603
|
}
|
|
11565
|
-
}) })),
|
|
11604
|
+
}) })), Lh = T(Ih, x([C(" et"), Ih], { value: (e) => e[1] })), Rh = w(T(x([
|
|
11566
11605
|
S,
|
|
11567
11606
|
C("par", { flags: "i" }),
|
|
11568
11607
|
S,
|
|
11569
|
-
|
|
11608
|
+
Nh
|
|
11570
11609
|
], { value: (e) => ({
|
|
11571
11610
|
citation: e[3],
|
|
11572
11611
|
kind: "replace"
|
|
11573
|
-
}) }), x([S,
|
|
11612
|
+
}) }), x([S, Nh], { value: (e) => ({
|
|
11574
11613
|
citation: e[1],
|
|
11575
11614
|
kind: "insert"
|
|
11576
11615
|
}) })), { default: null });
|
|
11577
|
-
function
|
|
11616
|
+
function zh(e) {
|
|
11578
11617
|
return typeof e == "object" && !!e && "action" in e && "operation" in e;
|
|
11579
11618
|
}
|
|
11580
|
-
function
|
|
11619
|
+
function Bh(e) {
|
|
11581
11620
|
let t = [];
|
|
11582
|
-
for (let n of e)
|
|
11621
|
+
for (let n of e) zh(n) ? t.push(n) : Array.isArray(n) && t.push(...Bh(n));
|
|
11583
11622
|
return t;
|
|
11584
11623
|
}
|
|
11585
|
-
function
|
|
11624
|
+
function Vh(e, t) {
|
|
11586
11625
|
if (!e) return [];
|
|
11587
11626
|
let n = e.originalCitations ?? [];
|
|
11588
11627
|
if (e.action === "remplacer") {
|
|
@@ -11630,12 +11669,12 @@ function Rh(e, t) {
|
|
|
11630
11669
|
}
|
|
11631
11670
|
return [];
|
|
11632
11671
|
}
|
|
11633
|
-
var
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
_(
|
|
11672
|
+
var Hh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e?s?|ajout[eé]e?s?|rédigée?s?", x([
|
|
11673
|
+
jm,
|
|
11674
|
+
Rh,
|
|
11675
|
+
_(Lh, { value: (e) => Bh(e) })
|
|
11637
11676
|
], { value: (e, t) => {
|
|
11638
|
-
let { action: n, reference: r } =
|
|
11677
|
+
let { action: n, reference: r } = Ah(e[0]), i = [...Vh(n, e[1]), ...e[2] ?? []], a = n ?? i[0]?.action;
|
|
11639
11678
|
if (!(!a || i.length === 0)) return {
|
|
11640
11679
|
action: a,
|
|
11641
11680
|
operations: i.map(({ operation: e }) => e),
|
|
@@ -11643,7 +11682,7 @@ var zh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e
|
|
|
11643
11682
|
reference: r,
|
|
11644
11683
|
type: "action_directive"
|
|
11645
11684
|
};
|
|
11646
|
-
} }), 200),
|
|
11685
|
+
} }), 200), Uh = x([
|
|
11647
11686
|
C("la\\s+fin\\s+de\\s+", { flags: "i" }),
|
|
11648
11687
|
w(C("(?:la\\s+|l['’]\\s*)", { flags: "i" }), { default: "" }),
|
|
11649
11688
|
T(C("phrase", {
|
|
@@ -11660,14 +11699,14 @@ var zh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e
|
|
|
11660
11699
|
type: "tail_after_target",
|
|
11661
11700
|
unit: e[2]
|
|
11662
11701
|
}) });
|
|
11663
|
-
function
|
|
11702
|
+
function Wh(e) {
|
|
11664
11703
|
if (e.type === "phrase") return "phrase";
|
|
11665
11704
|
if (e.type === "alinéa") return "alinéa";
|
|
11666
11705
|
if (e.type === "article") return "article";
|
|
11667
|
-
if (e.type === "parent-enfant") return
|
|
11706
|
+
if (e.type === "parent-enfant") return Wh(e.child);
|
|
11668
11707
|
}
|
|
11669
|
-
function
|
|
11670
|
-
let t =
|
|
11708
|
+
function Gh(e) {
|
|
11709
|
+
let t = qm(e);
|
|
11671
11710
|
if (!/\bla\s+fin\s+d/iu.test(t)) return null;
|
|
11672
11711
|
let n = /\bla\s+fin\s+(?:de\s+la|d['’]?une|du|de\s+l['’]?|des)\s*[^,;.]*\bphrase\b/u.test(t) ? "phrase" : /\bla\s+fin\s+(?:de\s+la|d['’]?un|du|de\s+l['’]?|des)\s*[^,;.]*\balinea\b/u.test(t) ? "alinéa" : /\bla\s+fin\s+(?:de\s+l['’]?|d['’]?)article\b/u.test(t) ? "article" : void 0;
|
|
11673
11712
|
return {
|
|
@@ -11677,10 +11716,10 @@ function Hh(e) {
|
|
|
11677
11716
|
}
|
|
11678
11717
|
//#endregion
|
|
11679
11718
|
//#region src/lib/text_parsers/action_occurrences.ts
|
|
11680
|
-
function
|
|
11719
|
+
function Kh(e) {
|
|
11681
11720
|
return e.replace(/\s+/gu, " ").trim().normalize("NFD").replace(/[\u0300-\u036f]/gu, "").replace(/[’‘]/gu, "'").toLowerCase();
|
|
11682
11721
|
}
|
|
11683
|
-
function
|
|
11722
|
+
function qh(e, t) {
|
|
11684
11723
|
let n = e.slice(0, Math.max(0, t)), r = RegExp(`\\b(${we})\\s+occurrence\\b`, "giu"), i = null, a;
|
|
11685
11724
|
for (; (a = r.exec(n)) !== null;) {
|
|
11686
11725
|
let e = be(a[1] ?? "");
|
|
@@ -11688,37 +11727,37 @@ function Wh(e, t) {
|
|
|
11688
11727
|
}
|
|
11689
11728
|
return i;
|
|
11690
11729
|
}
|
|
11691
|
-
function
|
|
11692
|
-
let t =
|
|
11693
|
-
return /\b(?:derniere\s+occurrence|a\s+la\s+fin)\b/u.test(t) ? "last" :
|
|
11730
|
+
function Jh(e) {
|
|
11731
|
+
let t = Kh(e);
|
|
11732
|
+
return /\b(?:derniere\s+occurrence|a\s+la\s+fin)\b/u.test(t) ? "last" : qh(e, e.length) ?? void 0;
|
|
11694
11733
|
}
|
|
11695
11734
|
//#endregion
|
|
11696
11735
|
//#region src/lib/extractors/action_directives.ts
|
|
11697
|
-
var
|
|
11698
|
-
function
|
|
11736
|
+
var Yh = "(?:(?:alinea|alineas|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe|chapitre|titre|livre|partie)|(?:[ivxlcdm]+|[a-z]|\\d+\\s*°?)(?:\\s+(?:bis|ter|quater|quinquies|sexies|septies|octies|nonies|decies|undecies|duodecies))?)", Xh = "(?:un|une|l['’]?|le|la)";
|
|
11737
|
+
function Zh(e) {
|
|
11699
11738
|
return /\b(?:les?|la|l['’]?)\s+(?:mots?|references?|mentions?|signes?|nombres?|montants?|taux|pourcentages?|dates?|annees?)\b/u.test(e);
|
|
11700
11739
|
}
|
|
11701
|
-
function
|
|
11740
|
+
function Qh(e) {
|
|
11702
11741
|
return /\b(?:une|la|les?)\s+phrases?\b/u.test(e);
|
|
11703
11742
|
}
|
|
11704
|
-
function
|
|
11705
|
-
return new RegExp(String.raw`\b(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b[\s\S]{0,90}\b${
|
|
11743
|
+
function $h(e) {
|
|
11744
|
+
return new RegExp(String.raw`\b(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b[\s\S]{0,90}\b${Xh}\s+${Yh}\b`, "u").test(e) ? !0 : new RegExp(String.raw`\b${Xh}\s+${Yh}\b[\s\S]{0,90}\b(?:est|sont)\s+(?:ainsi\s+)?(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b`, "u").test(e);
|
|
11706
11745
|
}
|
|
11707
|
-
function
|
|
11708
|
-
if (!
|
|
11746
|
+
function eg({ hasRedactionIntro: e, insertText: t, normalized: n }) {
|
|
11747
|
+
if (!Zh(n) && !Qh(n) && ($h(n) && /\balinea\b/u.test(n) || e && yp(t))) return "block";
|
|
11709
11748
|
}
|
|
11710
|
-
function
|
|
11711
|
-
if (!
|
|
11749
|
+
function tg({ hasRedactionIntro: e, normalized: t, replacementText: n }) {
|
|
11750
|
+
if (!Qh(t) && (e && /\balineas?\b/u.test(t) || e && yp(n))) return "block";
|
|
11712
11751
|
}
|
|
11713
|
-
function
|
|
11752
|
+
function ng(e) {
|
|
11714
11753
|
let t = bp(e);
|
|
11715
11754
|
return t ? t.restText : e;
|
|
11716
11755
|
}
|
|
11717
|
-
function
|
|
11718
|
-
let t =
|
|
11756
|
+
function rg(e) {
|
|
11757
|
+
let t = ng(e);
|
|
11719
11758
|
return t === e ? e.replace(gp, "") : t;
|
|
11720
11759
|
}
|
|
11721
|
-
function
|
|
11760
|
+
function ig(e) {
|
|
11722
11761
|
let t = e.split("\n"), n = [], r = 0;
|
|
11723
11762
|
for (let e of t) {
|
|
11724
11763
|
let t = r, i = t + e.length;
|
|
@@ -11730,10 +11769,10 @@ function tg(e) {
|
|
|
11730
11769
|
}
|
|
11731
11770
|
return n;
|
|
11732
11771
|
}
|
|
11733
|
-
function
|
|
11772
|
+
function ag(e) {
|
|
11734
11773
|
return bp(e) !== void 0 || gp.test(e);
|
|
11735
11774
|
}
|
|
11736
|
-
function
|
|
11775
|
+
function og(e) {
|
|
11737
11776
|
if (gp.test(e)) return {
|
|
11738
11777
|
marker: "-",
|
|
11739
11778
|
level: 5
|
|
@@ -11741,87 +11780,87 @@ function rg(e) {
|
|
|
11741
11780
|
let t = bp(e);
|
|
11742
11781
|
return t ? {
|
|
11743
11782
|
marker: t.token,
|
|
11744
|
-
level:
|
|
11783
|
+
level: sg(t.token)
|
|
11745
11784
|
} : null;
|
|
11746
11785
|
}
|
|
11747
|
-
function
|
|
11786
|
+
function sg(e) {
|
|
11748
11787
|
let t = e.trim().split(/\s+/u)[0]?.replace(/[^\p{L}\p{N}]+/gu, "") ?? "";
|
|
11749
11788
|
return /^\d+$/u.test(t) ? 2 : /^[ivxlcdm]+$/u.test(t) && (t.length > 1 || /^[ivx]$/u.test(t)) ? 4 : /^[a-z]$/u.test(t) ? 3 : vp(t) || /^[A-Z]$/u.test(t) ? 1 : 2;
|
|
11750
11789
|
}
|
|
11751
|
-
function
|
|
11790
|
+
function cg(e) {
|
|
11752
11791
|
let t = [], n = e;
|
|
11753
11792
|
for (;;) {
|
|
11754
|
-
let e =
|
|
11793
|
+
let e = og(n);
|
|
11755
11794
|
if (!e) return t;
|
|
11756
11795
|
t.push(e.marker);
|
|
11757
|
-
let r =
|
|
11796
|
+
let r = rg(n);
|
|
11758
11797
|
if (r === n) return t;
|
|
11759
11798
|
n = r.trimStart();
|
|
11760
11799
|
}
|
|
11761
11800
|
}
|
|
11762
|
-
function
|
|
11763
|
-
let t =
|
|
11801
|
+
function lg(e) {
|
|
11802
|
+
let t = qm(bh(e, yh(e)));
|
|
11764
11803
|
return /(?:^|[;:.]\s*)(?:(?:il\s+)?est|sont)\s+(?:inseree?s?|ajoutee?s?)\s+(?:la\s+reference|la\s+mention|les\s+mots|le\s+mot|le\s+signe|les\s+references)?\s*:/.exec(t)?.index ?? null;
|
|
11765
11804
|
}
|
|
11766
|
-
function
|
|
11767
|
-
let t =
|
|
11805
|
+
function ug(e) {
|
|
11806
|
+
let t = lg(e);
|
|
11768
11807
|
if (t !== null) return t;
|
|
11769
11808
|
for (let t = 0; t < e.length; t += 1) {
|
|
11770
11809
|
let r = new n(e.slice(t));
|
|
11771
|
-
if (
|
|
11810
|
+
if (bm(r) && r.offset > 0) return t;
|
|
11772
11811
|
}
|
|
11773
11812
|
return null;
|
|
11774
11813
|
}
|
|
11775
|
-
function
|
|
11814
|
+
function dg(e) {
|
|
11776
11815
|
return e.type === "reference_et_action" ? e.reference : e;
|
|
11777
11816
|
}
|
|
11778
|
-
function
|
|
11779
|
-
return
|
|
11817
|
+
function fg(e) {
|
|
11818
|
+
return Rm(new n(e)).map(dg).find((e) => bt(e) === "article") || (x_(e)?.reference ?? null);
|
|
11780
11819
|
}
|
|
11781
|
-
function
|
|
11782
|
-
let t =
|
|
11820
|
+
function pg(e) {
|
|
11821
|
+
let t = ug(e) ?? e.length, r = xh(e), i = Rm(new n(e)), a = i.flatMap((e) => Array.from(O(dg(e)))).filter((e) => e.type === "article" && e.position).map((e) => ({
|
|
11783
11822
|
start: e.position.start,
|
|
11784
11823
|
end: e.position.stop
|
|
11785
|
-
})), o = i.map(
|
|
11786
|
-
return u ?
|
|
11824
|
+
})), o = i.map(dg).filter((e) => !Ch(e.position, r) && !Sh(e.position, a) && bt(e) !== "article" && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0)), s = e.slice(0, t).trimEnd(), c = dh(a_(s), 0) ?? dh(s, 0) ?? dh(s.replace(/\b(?:est|sont)\s*$/iu, "").trimEnd(), 0), l = c && !Sh(c.position, a) ? c : null, u = o[0];
|
|
11825
|
+
return u ? mh(u, l) : l;
|
|
11787
11826
|
}
|
|
11788
|
-
function
|
|
11789
|
-
let t =
|
|
11827
|
+
function mg(e) {
|
|
11828
|
+
let t = ug(e) ?? e.length, r = xh(e), i = Rm(new n(e)).map(dg).filter((e) => !Ch(e.position, r) && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0));
|
|
11790
11829
|
return i.length === 0 ? null : i.find((e) => bt(e) !== "article") ?? null ?? i[0] ?? null;
|
|
11791
11830
|
}
|
|
11792
|
-
function
|
|
11793
|
-
let t = [e,
|
|
11831
|
+
function hg(e) {
|
|
11832
|
+
let t = [e, ng(e)].map((e) => e.trim()).filter((e, t, n) => e && n.indexOf(e) === t);
|
|
11794
11833
|
for (let e of t) {
|
|
11795
|
-
let t =
|
|
11834
|
+
let t = ug(e) ?? e.length, n = dh(e, 0) ?? gh(e, { actionIndex: t }) ?? mg(e) ?? fg(e);
|
|
11796
11835
|
if (n) return n;
|
|
11797
11836
|
}
|
|
11798
11837
|
return null;
|
|
11799
11838
|
}
|
|
11800
|
-
function
|
|
11839
|
+
function gg(e) {
|
|
11801
11840
|
return e?.toLowerCase().replace(/[.)]/g, "").trim();
|
|
11802
11841
|
}
|
|
11803
|
-
function
|
|
11804
|
-
return !(e.type !== t.type || e.index !== void 0 && t.index !== void 0 && e.index !== t.index || e.num !== void 0 && t.num !== void 0 &&
|
|
11842
|
+
function _g(e, t) {
|
|
11843
|
+
return !(e.type !== t.type || e.index !== void 0 && t.index !== void 0 && e.index !== t.index || e.num !== void 0 && t.num !== void 0 && gg(e.num) !== gg(t.num));
|
|
11805
11844
|
}
|
|
11806
|
-
function
|
|
11845
|
+
function vg(e) {
|
|
11807
11846
|
let t = null;
|
|
11808
11847
|
for (let n of O(e)) t = n;
|
|
11809
11848
|
return t;
|
|
11810
11849
|
}
|
|
11811
|
-
function
|
|
11812
|
-
return t && e.type === "parent-enfant" &&
|
|
11850
|
+
function yg(e, t) {
|
|
11851
|
+
return t && e.type === "parent-enfant" && _g(e.parent, t) ? e.child : e;
|
|
11813
11852
|
}
|
|
11814
|
-
function
|
|
11853
|
+
function bg(e, t) {
|
|
11815
11854
|
let n = null;
|
|
11816
11855
|
for (let r of O(e)) r.type === t && r.relative === void 0 && (r.index === void 0 && r.num === void 0 || (n = r));
|
|
11817
11856
|
return n;
|
|
11818
11857
|
}
|
|
11819
|
-
function
|
|
11858
|
+
function xg(e, t) {
|
|
11820
11859
|
if (!t) return e;
|
|
11821
11860
|
let n = structuredClone(e), r = (e) => {
|
|
11822
11861
|
if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") {
|
|
11823
11862
|
if (e.relative === 0) {
|
|
11824
|
-
let n =
|
|
11863
|
+
let n = bg(t, e.type);
|
|
11825
11864
|
n && (e.index = n.index, e.num = n.num, delete e.relative);
|
|
11826
11865
|
}
|
|
11827
11866
|
return;
|
|
@@ -11847,7 +11886,7 @@ function vg(e, t) {
|
|
|
11847
11886
|
};
|
|
11848
11887
|
return r(n), n;
|
|
11849
11888
|
}
|
|
11850
|
-
function
|
|
11889
|
+
function Sg(e) {
|
|
11851
11890
|
let t = (e) => {
|
|
11852
11891
|
if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") return e.relative !== void 0;
|
|
11853
11892
|
switch (e.type) {
|
|
@@ -11861,14 +11900,14 @@ function yg(e) {
|
|
|
11861
11900
|
};
|
|
11862
11901
|
return t(e);
|
|
11863
11902
|
}
|
|
11864
|
-
function
|
|
11903
|
+
function Cg(e) {
|
|
11865
11904
|
let t = [], n = [];
|
|
11866
11905
|
for (let r of e) {
|
|
11867
|
-
if (!
|
|
11906
|
+
if (!ag(r.text)) {
|
|
11868
11907
|
n[n.length - 1]?.body.push(r);
|
|
11869
11908
|
continue;
|
|
11870
11909
|
}
|
|
11871
|
-
let e =
|
|
11910
|
+
let e = og(r.text), i = e?.level ?? 0, a = {
|
|
11872
11911
|
body: [],
|
|
11873
11912
|
children: [],
|
|
11874
11913
|
level: i,
|
|
@@ -11880,13 +11919,13 @@ function bg(e) {
|
|
|
11880
11919
|
}
|
|
11881
11920
|
return t;
|
|
11882
11921
|
}
|
|
11883
|
-
function
|
|
11922
|
+
function wg(e, t) {
|
|
11884
11923
|
if (!e) return t;
|
|
11885
11924
|
if (!t) return e;
|
|
11886
|
-
let n =
|
|
11925
|
+
let n = yg(t, vg(e));
|
|
11887
11926
|
return n.type === "article" || bt(n), mt(e, n);
|
|
11888
11927
|
}
|
|
11889
|
-
function
|
|
11928
|
+
function Tg(e, t) {
|
|
11890
11929
|
return {
|
|
11891
11930
|
...mt(e, t),
|
|
11892
11931
|
position: {
|
|
@@ -11895,16 +11934,16 @@ function Sg(e, t) {
|
|
|
11895
11934
|
}
|
|
11896
11935
|
};
|
|
11897
11936
|
}
|
|
11898
|
-
function
|
|
11899
|
-
return [
|
|
11937
|
+
function Eg(e) {
|
|
11938
|
+
return [rg(e.line.text), ...e.body.map((e) => e.text)].join("\n").trim();
|
|
11900
11939
|
}
|
|
11901
|
-
function
|
|
11940
|
+
function Dg(e) {
|
|
11902
11941
|
return e.body[e.body.length - 1]?.end ?? e.line.end;
|
|
11903
11942
|
}
|
|
11904
|
-
function
|
|
11943
|
+
function Og(e) {
|
|
11905
11944
|
return (e ?? "").replace(/°/gu, "").replace(/\s+/gu, " ").trim();
|
|
11906
11945
|
}
|
|
11907
|
-
function
|
|
11946
|
+
function kg(e, t) {
|
|
11908
11947
|
let r = new n(e, t), i = te(r);
|
|
11909
11948
|
return typeof i == "string" && r.offset > t ? {
|
|
11910
11949
|
date: i,
|
|
@@ -11912,14 +11951,14 @@ function Eg(e, t) {
|
|
|
11912
11951
|
stop: r.offset
|
|
11913
11952
|
} : null;
|
|
11914
11953
|
}
|
|
11915
|
-
function
|
|
11916
|
-
let t =
|
|
11954
|
+
function Ag(e) {
|
|
11955
|
+
let t = xh(e), n = [];
|
|
11917
11956
|
for (let r = 0; r < e.length; r += 1) {
|
|
11918
11957
|
let i = e[r];
|
|
11919
11958
|
if (i === void 0 || !/\d/u.test(i)) continue;
|
|
11920
|
-
let a =
|
|
11959
|
+
let a = kg(e, r);
|
|
11921
11960
|
if (a) {
|
|
11922
|
-
if (
|
|
11961
|
+
if (Sh(a, t)) {
|
|
11923
11962
|
r = Math.max(r, a.stop - 1);
|
|
11924
11963
|
continue;
|
|
11925
11964
|
}
|
|
@@ -11928,25 +11967,25 @@ function Dg(e) {
|
|
|
11928
11967
|
}
|
|
11929
11968
|
return n;
|
|
11930
11969
|
}
|
|
11931
|
-
function
|
|
11932
|
-
return
|
|
11970
|
+
function jg(e) {
|
|
11971
|
+
return qm(e).replace(/\s+/gu, " ");
|
|
11933
11972
|
}
|
|
11934
|
-
function
|
|
11935
|
-
let t =
|
|
11973
|
+
function Mg(e) {
|
|
11974
|
+
let t = jg(e), n = /\b(?:entr(?:e|ent|era|eront)\s+en\s+vigueur|s['’]?\s*appli(?:que|quent)|est\s+applicable|sont\s+applicables?|applicables?)\b/giu, r = null, i;
|
|
11936
11975
|
for (; (i = n.exec(t)) !== null;) r = i;
|
|
11937
11976
|
return r;
|
|
11938
11977
|
}
|
|
11939
|
-
function
|
|
11940
|
-
let n =
|
|
11941
|
-
return !!(/\bau\s*$/u.test(n) && r.startsWith(",") || /\ba compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || /\babroge(?:e|es|s)?\s+a compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) ||
|
|
11978
|
+
function Ng(e, t) {
|
|
11979
|
+
let n = jg(e.slice(0, t.start)), r = jg(e.slice(t.stop));
|
|
11980
|
+
return !!(/\bau\s*$/u.test(n) && r.startsWith(",") || /\ba compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || /\babroge(?:e|es|s)?\s+a compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || Mg(e.slice(0, t.start)));
|
|
11942
11981
|
}
|
|
11943
|
-
function
|
|
11944
|
-
return
|
|
11982
|
+
function Pg(e) {
|
|
11983
|
+
return Ag(e).find((t) => Ng(e, t))?.date;
|
|
11945
11984
|
}
|
|
11946
|
-
function
|
|
11947
|
-
return e.map((e) =>
|
|
11985
|
+
function Fg(e) {
|
|
11986
|
+
return e.map((e) => Og(e.num)).filter((e) => e.length > 0);
|
|
11948
11987
|
}
|
|
11949
|
-
function
|
|
11988
|
+
function Ig(e, t) {
|
|
11950
11989
|
let n = e.at(-1), r = t.at(-1);
|
|
11951
11990
|
if (!n || !r) return [e, t];
|
|
11952
11991
|
let i = e.slice(0, -1), a = t.slice(0, -1);
|
|
@@ -11957,51 +11996,51 @@ function Ng(e, t) {
|
|
|
11957
11996
|
for (let e = o; e <= s; e += 1) c.push([...i, String(e)]);
|
|
11958
11997
|
return c;
|
|
11959
11998
|
}
|
|
11960
|
-
function
|
|
11999
|
+
function Lg(e) {
|
|
11961
12000
|
if (e.kind === "single") {
|
|
11962
|
-
let t =
|
|
12001
|
+
let t = Fg(e.steps);
|
|
11963
12002
|
return t.length > 0 ? [t] : [];
|
|
11964
12003
|
}
|
|
11965
|
-
let t =
|
|
11966
|
-
return t.length === 0 && n.length === 0 ? [] :
|
|
12004
|
+
let t = Fg(e.first), n = Fg(e.last);
|
|
12005
|
+
return t.length === 0 && n.length === 0 ? [] : Ig(t, n);
|
|
11967
12006
|
}
|
|
11968
|
-
function
|
|
11969
|
-
let t =
|
|
11970
|
-
for (let e of t.map(
|
|
12007
|
+
function Rg(e) {
|
|
12008
|
+
let t = Rm(new n(e)), r = [];
|
|
12009
|
+
for (let e of t.map(dg)) {
|
|
11971
12010
|
if (e.type === "article" && e.present) {
|
|
11972
12011
|
r.push([]);
|
|
11973
12012
|
continue;
|
|
11974
12013
|
}
|
|
11975
|
-
for (let t of Rp(e)) r.push(...
|
|
12014
|
+
for (let t of Rp(e)) r.push(...Lg(t));
|
|
11976
12015
|
}
|
|
11977
12016
|
return r.filter((e, t, n) => n.findIndex((t) => t.join("\0") === e.join("\0")) === t);
|
|
11978
12017
|
}
|
|
11979
|
-
function
|
|
12018
|
+
function zg(e) {
|
|
11980
12019
|
let t = [], n = e.split(/(?<=[.;])\s+/u).map((e) => e.trim()).filter(Boolean);
|
|
11981
|
-
for (let e of n) for (let n of
|
|
11982
|
-
if (!
|
|
11983
|
-
let r =
|
|
12020
|
+
for (let e of n) for (let n of Ag(e)) {
|
|
12021
|
+
if (!Ng(e, n)) continue;
|
|
12022
|
+
let r = Mg(e.slice(0, n.start));
|
|
11984
12023
|
if (!r) continue;
|
|
11985
|
-
let i =
|
|
12024
|
+
let i = Rg(e.slice(0, r.index).trim());
|
|
11986
12025
|
if (i.length === 0) continue;
|
|
11987
12026
|
t.push({
|
|
11988
12027
|
date: n.date,
|
|
11989
12028
|
paths: i
|
|
11990
12029
|
});
|
|
11991
|
-
let a =
|
|
12030
|
+
let a = Bg(e.slice(n.stop), i);
|
|
11992
12031
|
t.push(...a);
|
|
11993
12032
|
}
|
|
11994
12033
|
return t;
|
|
11995
12034
|
}
|
|
11996
|
-
function
|
|
12035
|
+
function Bg(e, t) {
|
|
11997
12036
|
let n = /(?:^|[^\p{L}\p{N}_])(?:a|à)\s+l['’]exception\s+(.+?)(?:\bqui\b|\bentr(?:e|ent|era|eront)\s+en\s+vigueur\b)/iu.exec(e);
|
|
11998
12037
|
if (!n) return [];
|
|
11999
12038
|
let r = n.index + n[0].length, i = n[1]?.trim();
|
|
12000
12039
|
if (!i) return [];
|
|
12001
|
-
let a =
|
|
12040
|
+
let a = Rg(i);
|
|
12002
12041
|
if (a.length === 0) return [];
|
|
12003
12042
|
let o = [];
|
|
12004
|
-
for (let n of
|
|
12043
|
+
for (let n of Ag(e.slice(r))) {
|
|
12005
12044
|
let e = n.date;
|
|
12006
12045
|
o.push({
|
|
12007
12046
|
date: e,
|
|
@@ -12012,44 +12051,44 @@ function Lg(e, t) {
|
|
|
12012
12051
|
}
|
|
12013
12052
|
return o;
|
|
12014
12053
|
}
|
|
12015
|
-
function
|
|
12054
|
+
function Vg(e, t, n) {
|
|
12016
12055
|
return [
|
|
12017
12056
|
...e,
|
|
12018
|
-
|
|
12019
|
-
...
|
|
12057
|
+
Og(t.marker),
|
|
12058
|
+
...cg(n).map(Og)
|
|
12020
12059
|
].filter((e) => e.length > 0);
|
|
12021
12060
|
}
|
|
12022
|
-
function
|
|
12061
|
+
function Hg(e) {
|
|
12023
12062
|
let t = [];
|
|
12024
|
-
for (let n of e) t.push(...
|
|
12063
|
+
for (let n of e) t.push(...zg(Eg(n))), t.push(...Hg(n.children));
|
|
12025
12064
|
return t;
|
|
12026
12065
|
}
|
|
12027
|
-
function
|
|
12066
|
+
function Ug(e, t) {
|
|
12028
12067
|
return t.length > e.length ? !1 : t.every((t, n) => e[n] === t);
|
|
12029
12068
|
}
|
|
12030
|
-
function
|
|
12069
|
+
function Wg(e, t) {
|
|
12031
12070
|
if (t.length > e.length) return !1;
|
|
12032
12071
|
let n = e.length - t.length;
|
|
12033
12072
|
return t.every((t, r) => e[n + r] === t);
|
|
12034
12073
|
}
|
|
12035
|
-
function
|
|
12036
|
-
return n ? n.some((n) =>
|
|
12074
|
+
function Gg(e, t, n) {
|
|
12075
|
+
return n ? n.some((n) => Gg(e, n) ? Gg(e, Ug(e, n) ? [...n, ...t] : t) : !1) : t.length === 0 ? !0 : Ug(e, t) || Wg(e, t);
|
|
12037
12076
|
}
|
|
12038
|
-
function
|
|
12077
|
+
function Kg(e, t, n) {
|
|
12039
12078
|
if (e.length === 0 || n.length === 0) return;
|
|
12040
12079
|
let r = new Map(t.map((e) => [e.directive, e.sourcePath]));
|
|
12041
12080
|
for (let t of e) {
|
|
12042
12081
|
if (t.applicabilityDate) continue;
|
|
12043
12082
|
let e = r.get(t) ?? [], i, a = -1;
|
|
12044
12083
|
for (let t of n) for (let n of t.paths) {
|
|
12045
|
-
if (!
|
|
12084
|
+
if (!Gg(e, n, t.parentPaths)) continue;
|
|
12046
12085
|
let r = n.length + Math.max(0, ...t.parentPaths?.map((e) => e.length) ?? [0]);
|
|
12047
12086
|
r > a && (i = t.date, a = r);
|
|
12048
12087
|
}
|
|
12049
12088
|
i && (t.applicabilityDate = i);
|
|
12050
12089
|
}
|
|
12051
12090
|
}
|
|
12052
|
-
function
|
|
12091
|
+
function qg(e, t) {
|
|
12053
12092
|
if (!e) return t;
|
|
12054
12093
|
if (!t) return e;
|
|
12055
12094
|
let n = t.rowIndex ?? e.rowIndex, r = t.columnIndex ?? e.columnIndex;
|
|
@@ -12059,39 +12098,39 @@ function Wg(e, t) {
|
|
|
12059
12098
|
...r ? { columnIndex: r } : {}
|
|
12060
12099
|
};
|
|
12061
12100
|
}
|
|
12062
|
-
function
|
|
12101
|
+
function Jg(e) {
|
|
12063
12102
|
return e !== void 0 && (e.rowIndex !== void 0 || e.columnIndex !== void 0);
|
|
12064
12103
|
}
|
|
12065
|
-
function
|
|
12104
|
+
function Yg(e, t, n, r, i = [], a = []) {
|
|
12066
12105
|
let o = [], s = t;
|
|
12067
12106
|
for (let c of e) {
|
|
12068
|
-
let e =
|
|
12107
|
+
let e = rg(c.line.text), l = Vg(i, c, e), u = Eg(c);
|
|
12069
12108
|
if (!u) continue;
|
|
12070
|
-
let d =
|
|
12071
|
-
if (
|
|
12109
|
+
let d = qg(r, i_(u, r !== void 0)), f = hg(e), p = wg(t, f);
|
|
12110
|
+
if (ug(u) === null) {
|
|
12072
12111
|
if (c.children.length > 0) {
|
|
12073
|
-
let e = p ?? t, r =
|
|
12112
|
+
let e = p ?? t, r = Yg(c.children, e, n, d, l, a);
|
|
12074
12113
|
r.length > 0 && (o.push(...r), s = r[r.length - 1]?.reference ?? s);
|
|
12075
12114
|
continue;
|
|
12076
12115
|
}
|
|
12077
12116
|
s = p ?? s;
|
|
12078
12117
|
continue;
|
|
12079
12118
|
}
|
|
12080
|
-
let m =
|
|
12119
|
+
let m = fg(u), h = wg(t, pg(u) ?? m ?? f) ?? m ?? p;
|
|
12081
12120
|
if (!h) {
|
|
12082
12121
|
if (c.children.length > 0) {
|
|
12083
|
-
let e =
|
|
12122
|
+
let e = Yg(c.children, p ?? t, n, d, l, a);
|
|
12084
12123
|
o.push(...e);
|
|
12085
12124
|
}
|
|
12086
12125
|
continue;
|
|
12087
12126
|
}
|
|
12088
|
-
h =
|
|
12089
|
-
let g =
|
|
12127
|
+
h = xg(h, Sg(h) ? s ?? t : t);
|
|
12128
|
+
let g = b_({
|
|
12090
12129
|
action: { action: "modifier" },
|
|
12091
12130
|
reference: h,
|
|
12092
12131
|
sourcePosition: {
|
|
12093
12132
|
start: c.line.start,
|
|
12094
|
-
stop:
|
|
12133
|
+
stop: Dg(c)
|
|
12095
12134
|
},
|
|
12096
12135
|
sourceText: u,
|
|
12097
12136
|
fullText: n,
|
|
@@ -12099,7 +12138,7 @@ function Kg(e, t, n, r, i = [], a = []) {
|
|
|
12099
12138
|
});
|
|
12100
12139
|
if (!g) {
|
|
12101
12140
|
if (s = h, c.children.length > 0) {
|
|
12102
|
-
let e =
|
|
12141
|
+
let e = Yg(c.children, p ?? h, n, d, l, a);
|
|
12103
12142
|
o.push(...e), s = e[e.length - 1]?.reference ?? s;
|
|
12104
12143
|
}
|
|
12105
12144
|
continue;
|
|
@@ -12115,19 +12154,19 @@ function Kg(e, t, n, r, i = [], a = []) {
|
|
|
12115
12154
|
sourcePath: l
|
|
12116
12155
|
});
|
|
12117
12156
|
if (s = h, c.children.length > 0) {
|
|
12118
|
-
let e =
|
|
12157
|
+
let e = Yg(c.children, p ?? h, n, d, l, a);
|
|
12119
12158
|
e.length > 0 && (o.push(...e), s = e[e.length - 1]?.reference ?? s);
|
|
12120
12159
|
}
|
|
12121
12160
|
}
|
|
12122
|
-
return
|
|
12161
|
+
return y_(o);
|
|
12123
12162
|
}
|
|
12124
|
-
function
|
|
12125
|
-
let t =
|
|
12163
|
+
function Xg(e) {
|
|
12164
|
+
let t = ig(e), n = t.findIndex((e) => ag(e.text));
|
|
12126
12165
|
if (n === -1) return null;
|
|
12127
|
-
let r = t.slice(0, n).reverse().map((e) =>
|
|
12128
|
-
return
|
|
12166
|
+
let r = t.slice(0, n).reverse().map((e) => hg(e.text)).find((e) => e !== null) ?? null, i = Cg(t.slice(n)), a = [], o = Yg(i, r, e, void 0, [], a);
|
|
12167
|
+
return Kg(o, a, Hg(i)), o.length > 0 ? o : null;
|
|
12129
12168
|
}
|
|
12130
|
-
function
|
|
12169
|
+
function Zg(e, t) {
|
|
12131
12170
|
let n = e.indexOf("«");
|
|
12132
12171
|
if (n === -1) return;
|
|
12133
12172
|
let r = e.indexOf("»", n + 1);
|
|
@@ -12142,36 +12181,40 @@ function Jg(e, t) {
|
|
|
12142
12181
|
}
|
|
12143
12182
|
};
|
|
12144
12183
|
}
|
|
12145
|
-
function
|
|
12146
|
-
let t =
|
|
12184
|
+
function Qg(e) {
|
|
12185
|
+
let t = qm(e);
|
|
12147
12186
|
return /\btableau\b/.test(t) && /\b(?:tableau|celui)\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(t);
|
|
12148
12187
|
}
|
|
12149
|
-
function
|
|
12150
|
-
for (let t of
|
|
12151
|
-
if (!
|
|
12188
|
+
function $g(e) {
|
|
12189
|
+
for (let t of ig(e)) {
|
|
12190
|
+
if (!Qg(t.text)) continue;
|
|
12152
12191
|
let e = t.text.indexOf(":");
|
|
12153
12192
|
return e === -1 ? t.end : t.start + e + 1;
|
|
12154
12193
|
}
|
|
12155
12194
|
return null;
|
|
12156
12195
|
}
|
|
12157
|
-
function
|
|
12158
|
-
let n =
|
|
12159
|
-
return n === null ?
|
|
12196
|
+
function e_(e, t) {
|
|
12197
|
+
let n = $g(e);
|
|
12198
|
+
return n === null ? Zg(e, t) : Zg(e.slice(n), t + n);
|
|
12199
|
+
}
|
|
12200
|
+
function t_(e, t) {
|
|
12201
|
+
return qh(e, t);
|
|
12160
12202
|
}
|
|
12161
|
-
function
|
|
12162
|
-
|
|
12203
|
+
function n_(e, t) {
|
|
12204
|
+
let n = gm(e, t);
|
|
12205
|
+
return n && n > 1 ? n : void 0;
|
|
12163
12206
|
}
|
|
12164
|
-
function
|
|
12207
|
+
function r_(e, t) {
|
|
12165
12208
|
if (!Array.isArray(e) || e.length < 2 || t.length < e.length) return e;
|
|
12166
12209
|
let n = e[0];
|
|
12167
12210
|
return e.some((e) => JSON.stringify(e) !== JSON.stringify(n)) ? e : n;
|
|
12168
12211
|
}
|
|
12169
|
-
function
|
|
12170
|
-
let n =
|
|
12212
|
+
function i_(e, t = !1) {
|
|
12213
|
+
let n = bh(e, yh(e)), r = qm(n), i = /\btableau\b/.test(r);
|
|
12171
12214
|
if (!i && !t) return;
|
|
12172
12215
|
let a = (e) => {
|
|
12173
12216
|
if (!e) return;
|
|
12174
|
-
let t = e.replace(/^(?:a|à)\s+la\s+/iu, "").trim(), n =
|
|
12217
|
+
let t = e.replace(/^(?:a|à)\s+la\s+/iu, "").trim(), n = qm(t);
|
|
12175
12218
|
if (/^derni(?:er|ere)s?\b/u.test(n)) return -1;
|
|
12176
12219
|
let r = be(t);
|
|
12177
12220
|
return r && r > 0 ? r : void 0;
|
|
@@ -12192,30 +12235,30 @@ function e_(e, t = !1) {
|
|
|
12192
12235
|
let l = /\bla\s+(.+?)\s+ligne\b/iu.exec(n), u = /\bla\s+(.+?)\s+colonne\b/iu.exec(n);
|
|
12193
12236
|
return o(a(l?.[1]), a(u?.[1])) || (i ? { type: "table" } : void 0);
|
|
12194
12237
|
}
|
|
12195
|
-
function
|
|
12238
|
+
function a_(e) {
|
|
12196
12239
|
return e.replace(/(?:[,;:]\s*)?(?:(?:le|la|les|l['’])\s+)?(?:année|date|dispositions?|mention|montant|mot|mots|nombre|nombres|pourcentage|référence|références|signe|taux|texte|phrase|phrases|tableau)(?:\s+[^,;:]*)?\s*:?\s*$/iu, "").trimEnd();
|
|
12197
12240
|
}
|
|
12198
|
-
function
|
|
12241
|
+
function o_(e) {
|
|
12199
12242
|
return e.replace(/(?:[,;:]\s*)?(?:(?:le|la|les|l['’])\s+)?(?:année|date|dispositions?|mention|montant|mot|mots|nombre|nombres|pourcentage|référence|références|signe|taux|texte|tableau)(?:\s+[^,;:]*)?\s*:?\s*$/iu, "").trimEnd();
|
|
12200
12243
|
}
|
|
12201
|
-
var
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12244
|
+
var s_ = [
|
|
12245
|
+
c_("(?:la\\s+date\\s+d(?:u|e|[’']))"),
|
|
12246
|
+
c_("(?:le\\s+montant\\s+d(?:e|[’']))"),
|
|
12247
|
+
c_("(?:la\\s+référence\\s+à)")
|
|
12205
12248
|
];
|
|
12206
|
-
function
|
|
12249
|
+
function c_(e) {
|
|
12207
12250
|
return new RegExp(String.raw`(?:^|[,;:]\s*)${e}\s+(?<target>.+?)\s+(?:est|sont)\s+remplac[eé]e?s?\s+par\s+${e}\s+(?<replacement>.+?)(?=\s*(?:[.;]|$))`, "iu");
|
|
12208
12251
|
}
|
|
12209
|
-
function
|
|
12252
|
+
function l_(e) {
|
|
12210
12253
|
return e.replace(/\s+/gu, " ").replace(/\s+([,;])/gu, "$1").trim();
|
|
12211
12254
|
}
|
|
12212
|
-
function
|
|
12255
|
+
function u_(e) {
|
|
12213
12256
|
if (e.includes("«") || e.includes("»")) return null;
|
|
12214
|
-
for (let t of
|
|
12257
|
+
for (let t of s_) {
|
|
12215
12258
|
let n = t.exec(e), r = n?.groups?.target, i = n?.groups?.replacement;
|
|
12216
12259
|
if (!(!r || !i)) return {
|
|
12217
|
-
targetText:
|
|
12218
|
-
replacementText:
|
|
12260
|
+
targetText: l_(r),
|
|
12261
|
+
replacementText: l_(i),
|
|
12219
12262
|
operandRange: {
|
|
12220
12263
|
start: n.index,
|
|
12221
12264
|
end: n.index + n[0].length
|
|
@@ -12224,19 +12267,22 @@ function o_(e) {
|
|
|
12224
12267
|
}
|
|
12225
12268
|
return null;
|
|
12226
12269
|
}
|
|
12227
|
-
function
|
|
12228
|
-
let t =
|
|
12270
|
+
function d_(e) {
|
|
12271
|
+
let t = u_(e);
|
|
12229
12272
|
return t ? [t.operandRange] : [];
|
|
12230
12273
|
}
|
|
12231
|
-
function
|
|
12232
|
-
return
|
|
12274
|
+
function f_(e, t) {
|
|
12275
|
+
return Sh(e.position, t) ? !0 : Array.from(O(dg(e))).some((e) => Sh(e.position, t));
|
|
12233
12276
|
}
|
|
12234
|
-
function
|
|
12235
|
-
let
|
|
12236
|
-
let
|
|
12237
|
-
|
|
12277
|
+
function p_(e, t, n, r, i, a) {
|
|
12278
|
+
let o = qm(e), s = qm(bh(e, i)), c = Jm(s, o), l = Ym(s), u = Xm(s), d = n.action === "rétablir" || Zm(s), f = Qm(s) || d, p = $m(s), m = eh(s), h = Qg(e), g = u ? "insert_before" : "insert_after", _ = l ? Gh(s) : null, v = p ? _ : null, y = m ? _ : null, ee = () => {
|
|
12279
|
+
let n = i[0]?.start;
|
|
12280
|
+
return (n === void 0 ? void 0 : n_(t, n)) ?? hm(e) ?? void 0;
|
|
12281
|
+
}, te = ({ kind: e, targetText: t, insertText: n, expectsFollowingTable: r }) => {
|
|
12282
|
+
let i = eg({
|
|
12283
|
+
hasRedactionIntro: c,
|
|
12238
12284
|
insertText: n,
|
|
12239
|
-
normalized:
|
|
12285
|
+
normalized: o
|
|
12240
12286
|
});
|
|
12241
12287
|
return {
|
|
12242
12288
|
kind: e,
|
|
@@ -12246,131 +12292,140 @@ function l_(e, t, n, r, i) {
|
|
|
12246
12292
|
...r ? { expectsFollowingTable: r } : {}
|
|
12247
12293
|
};
|
|
12248
12294
|
};
|
|
12249
|
-
if ((
|
|
12250
|
-
let e =
|
|
12295
|
+
if ((l || u) && f && m && a.length >= 3) {
|
|
12296
|
+
let e = a.slice(0, -2), t = a.at(-2), n = a.at(-1);
|
|
12251
12297
|
if (e.length > 0 && t && n) return [{
|
|
12252
12298
|
kind: "delete",
|
|
12253
12299
|
targetText: e[0],
|
|
12254
12300
|
extraTargetTexts: e.slice(1)
|
|
12255
|
-
},
|
|
12256
|
-
kind:
|
|
12301
|
+
}, te({
|
|
12302
|
+
kind: g,
|
|
12257
12303
|
targetText: t,
|
|
12258
12304
|
insertText: n,
|
|
12259
|
-
expectsFollowingTable:
|
|
12305
|
+
expectsFollowingTable: h
|
|
12260
12306
|
})];
|
|
12261
12307
|
}
|
|
12262
|
-
if (!
|
|
12263
|
-
let e =
|
|
12308
|
+
if (!l && !u && f && m && a.length >= 2 && /\best ajoutee?\s+une phrase\b|\bune phrase ainsi redigee\b/.test(o)) {
|
|
12309
|
+
let e = a.slice(0, -1), t = a.at(-1);
|
|
12264
12310
|
if (e.length > 0 && t) return [{
|
|
12265
12311
|
kind: "delete",
|
|
12266
12312
|
targetText: e[0],
|
|
12267
12313
|
extraTargetTexts: e.slice(1)
|
|
12268
|
-
},
|
|
12314
|
+
}, te({
|
|
12269
12315
|
kind: "insert_after",
|
|
12270
12316
|
targetText: "",
|
|
12271
12317
|
insertText: t,
|
|
12272
|
-
expectsFollowingTable:
|
|
12318
|
+
expectsFollowingTable: h
|
|
12273
12319
|
})];
|
|
12274
12320
|
}
|
|
12275
|
-
if ((
|
|
12276
|
-
let e =
|
|
12321
|
+
if ((l || u) && f && p && a.length >= 4) {
|
|
12322
|
+
let e = a.at(-2), t = a.at(-1);
|
|
12277
12323
|
if (e && t) return [{
|
|
12278
12324
|
kind: "replace",
|
|
12279
|
-
targetText:
|
|
12280
|
-
replacementText:
|
|
12281
|
-
},
|
|
12282
|
-
kind:
|
|
12325
|
+
targetText: a[0],
|
|
12326
|
+
replacementText: a[1]
|
|
12327
|
+
}, te({
|
|
12328
|
+
kind: g,
|
|
12283
12329
|
targetText: e,
|
|
12284
12330
|
insertText: t,
|
|
12285
|
-
expectsFollowingTable:
|
|
12331
|
+
expectsFollowingTable: h
|
|
12286
12332
|
})];
|
|
12287
12333
|
}
|
|
12288
|
-
if (
|
|
12289
|
-
let e =
|
|
12334
|
+
if (p && m && !f && a.length >= 3) {
|
|
12335
|
+
let e = o.search(/\bremplace(?:e|es|s)?\b/u), t = o.search(/\bsupprime(?:e|es|s)?\b/u);
|
|
12290
12336
|
if (e !== -1 && t !== -1 && e < t) return [{
|
|
12291
12337
|
kind: "replace",
|
|
12292
|
-
targetText:
|
|
12293
|
-
replacementText:
|
|
12294
|
-
...
|
|
12338
|
+
targetText: a[0],
|
|
12339
|
+
replacementText: a[1],
|
|
12340
|
+
...v ? { targetScope: v } : {}
|
|
12295
12341
|
}, {
|
|
12296
12342
|
kind: "delete",
|
|
12297
|
-
targetText:
|
|
12298
|
-
extraTargetTexts:
|
|
12299
|
-
...
|
|
12343
|
+
targetText: a[2],
|
|
12344
|
+
extraTargetTexts: a.slice(3),
|
|
12345
|
+
...y ? { targetScope: y } : {}
|
|
12300
12346
|
}];
|
|
12301
|
-
if (e !== -1 && t !== -1 && t < e &&
|
|
12347
|
+
if (e !== -1 && t !== -1 && t < e && a.length >= 4) return [{
|
|
12302
12348
|
kind: "delete",
|
|
12303
|
-
targetText:
|
|
12304
|
-
extraTargetTexts:
|
|
12305
|
-
...
|
|
12349
|
+
targetText: a[0],
|
|
12350
|
+
extraTargetTexts: a.slice(1, -2),
|
|
12351
|
+
...y ? { targetScope: y } : {}
|
|
12306
12352
|
}, {
|
|
12307
12353
|
kind: "replace",
|
|
12308
|
-
targetText:
|
|
12309
|
-
replacementText:
|
|
12310
|
-
...
|
|
12354
|
+
targetText: a.at(-2) ?? "",
|
|
12355
|
+
replacementText: a.at(-1) ?? "",
|
|
12356
|
+
...v ? { targetScope: v } : {}
|
|
12311
12357
|
}];
|
|
12312
12358
|
}
|
|
12313
|
-
let
|
|
12314
|
-
if (
|
|
12359
|
+
let ne = s.match(/\bremplace(?:e|es|s)?\b/gu)?.length ?? 0;
|
|
12360
|
+
if (p && !f && a.length >= 4 && a.length % 2 == 0 && ne >= 2) {
|
|
12315
12361
|
let e = [];
|
|
12316
|
-
for (let t = 0; t <
|
|
12362
|
+
for (let t = 0; t < a.length; t += 2) e.push({
|
|
12317
12363
|
kind: "replace",
|
|
12318
|
-
targetText:
|
|
12319
|
-
replacementText:
|
|
12320
|
-
...
|
|
12364
|
+
targetText: a[t],
|
|
12365
|
+
replacementText: a[t + 1],
|
|
12366
|
+
...v ? { targetScope: v } : {}
|
|
12321
12367
|
});
|
|
12322
12368
|
return e;
|
|
12323
12369
|
}
|
|
12324
|
-
if (
|
|
12325
|
-
kind: "
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12370
|
+
if (n.action === "supprimer" || m) {
|
|
12371
|
+
if (r === "article" && a.length === 0) return { kind: "delete_article" };
|
|
12372
|
+
if (a.length >= 1) {
|
|
12373
|
+
let e = a.length === 1 ? ee() : void 0;
|
|
12374
|
+
return {
|
|
12375
|
+
kind: "delete",
|
|
12376
|
+
targetText: a[0],
|
|
12377
|
+
extraTargetTexts: a.slice(1),
|
|
12378
|
+
...e ? { targetOccurrenceCount: e } : {},
|
|
12379
|
+
...y ? { targetScope: y } : {}
|
|
12380
|
+
};
|
|
12381
|
+
}
|
|
12382
|
+
return { kind: "delete_portion" };
|
|
12383
|
+
}
|
|
12384
|
+
if (p && /\bpar\s+(?:le|un)\s+tableau\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(o)) return {
|
|
12331
12385
|
kind: "replace_portion",
|
|
12332
12386
|
replacement: { type: "following_table" }
|
|
12333
12387
|
};
|
|
12334
|
-
if (
|
|
12335
|
-
let t =
|
|
12388
|
+
if (p && !f && !m && a.length === 0) {
|
|
12389
|
+
let t = u_(e);
|
|
12336
12390
|
if (t) return {
|
|
12337
12391
|
kind: "replace",
|
|
12338
12392
|
targetText: t.targetText,
|
|
12339
12393
|
replacementText: t.replacementText,
|
|
12340
|
-
...
|
|
12394
|
+
...v ? { targetScope: v } : {}
|
|
12341
12395
|
};
|
|
12342
12396
|
}
|
|
12343
|
-
if (
|
|
12344
|
-
let
|
|
12397
|
+
if (p && a.length >= 2) {
|
|
12398
|
+
let e = ee();
|
|
12399
|
+
return {
|
|
12345
12400
|
kind: "replace",
|
|
12346
|
-
targetText:
|
|
12347
|
-
replacementText:
|
|
12348
|
-
...
|
|
12401
|
+
targetText: a[0],
|
|
12402
|
+
replacementText: a[1],
|
|
12403
|
+
...e ? { targetOccurrenceCount: e } : {},
|
|
12404
|
+
...v ? { targetScope: v } : {}
|
|
12349
12405
|
};
|
|
12350
|
-
return t && t > 1 ? Array.from({ length: t }, () => n) : n;
|
|
12351
12406
|
}
|
|
12352
|
-
if (
|
|
12407
|
+
if (l && c && a.length >= 2 && _) return {
|
|
12353
12408
|
kind: "replace",
|
|
12354
|
-
targetText:
|
|
12355
|
-
replacementText:
|
|
12356
|
-
targetScope:
|
|
12409
|
+
targetText: a[0],
|
|
12410
|
+
replacementText: a[1],
|
|
12411
|
+
targetScope: _
|
|
12357
12412
|
};
|
|
12358
|
-
if (!
|
|
12359
|
-
let e =
|
|
12360
|
-
hasRedactionIntro:
|
|
12361
|
-
normalized:
|
|
12362
|
-
replacementText:
|
|
12413
|
+
if (!f && a.length === 1 && c) {
|
|
12414
|
+
let e = tg({
|
|
12415
|
+
hasRedactionIntro: c,
|
|
12416
|
+
normalized: o,
|
|
12417
|
+
replacementText: a[0]
|
|
12363
12418
|
});
|
|
12364
12419
|
return {
|
|
12365
12420
|
kind: "replace_portion",
|
|
12366
12421
|
replacement: {
|
|
12367
12422
|
type: "text",
|
|
12368
|
-
text:
|
|
12423
|
+
text: a[0]
|
|
12369
12424
|
},
|
|
12370
12425
|
...e ? { replacementLayout: e } : {}
|
|
12371
12426
|
};
|
|
12372
12427
|
}
|
|
12373
|
-
if (
|
|
12428
|
+
if (f && h) return te(u ? {
|
|
12374
12429
|
kind: "insert_before",
|
|
12375
12430
|
targetText: "",
|
|
12376
12431
|
insertText: "",
|
|
@@ -12381,42 +12436,42 @@ function l_(e, t, n, r, i) {
|
|
|
12381
12436
|
insertText: "",
|
|
12382
12437
|
expectsFollowingTable: !0
|
|
12383
12438
|
});
|
|
12384
|
-
if (
|
|
12385
|
-
if (
|
|
12439
|
+
if (f && a.length >= 2) {
|
|
12440
|
+
if (l) return te({
|
|
12386
12441
|
kind: "insert_after",
|
|
12387
|
-
targetText:
|
|
12388
|
-
insertText:
|
|
12389
|
-
expectsFollowingTable:
|
|
12442
|
+
targetText: a[0],
|
|
12443
|
+
insertText: a[1],
|
|
12444
|
+
expectsFollowingTable: h
|
|
12390
12445
|
});
|
|
12391
|
-
if (
|
|
12446
|
+
if (u) return te({
|
|
12392
12447
|
kind: "insert_before",
|
|
12393
|
-
targetText:
|
|
12394
|
-
insertText:
|
|
12395
|
-
expectsFollowingTable:
|
|
12448
|
+
targetText: a[0],
|
|
12449
|
+
insertText: a[1],
|
|
12450
|
+
expectsFollowingTable: h
|
|
12396
12451
|
});
|
|
12397
12452
|
}
|
|
12398
|
-
return
|
|
12453
|
+
return f && a.length === 1 ? te(l ? {
|
|
12399
12454
|
kind: "insert_after",
|
|
12400
12455
|
targetText: "",
|
|
12401
|
-
insertText:
|
|
12402
|
-
expectsFollowingTable:
|
|
12403
|
-
} :
|
|
12456
|
+
insertText: a[0],
|
|
12457
|
+
expectsFollowingTable: h
|
|
12458
|
+
} : u ? {
|
|
12404
12459
|
kind: "insert_before",
|
|
12405
12460
|
targetText: "",
|
|
12406
|
-
insertText:
|
|
12407
|
-
expectsFollowingTable:
|
|
12461
|
+
insertText: a[0],
|
|
12462
|
+
expectsFollowingTable: h
|
|
12408
12463
|
} : {
|
|
12409
12464
|
kind: "insert_after",
|
|
12410
12465
|
targetText: "",
|
|
12411
|
-
insertText:
|
|
12412
|
-
expectsFollowingTable:
|
|
12466
|
+
insertText: a[0],
|
|
12467
|
+
expectsFollowingTable: h
|
|
12413
12468
|
}) : null;
|
|
12414
12469
|
}
|
|
12415
|
-
function
|
|
12416
|
-
let t =
|
|
12470
|
+
function m_(e) {
|
|
12471
|
+
let t = qm(e);
|
|
12417
12472
|
return /\bapres\b/.test(t) && /\bla\s+fin\s+(?:(?:de\s+l['’]?)|d['’]?|de|du|des)?\s*$/u.test(t);
|
|
12418
12473
|
}
|
|
12419
|
-
function
|
|
12474
|
+
function h_(e) {
|
|
12420
12475
|
switch (e.kind) {
|
|
12421
12476
|
case "insert_after":
|
|
12422
12477
|
case "insert_before": return {
|
|
@@ -12432,6 +12487,7 @@ function d_(e) {
|
|
|
12432
12487
|
targetText: e.targetText,
|
|
12433
12488
|
replacementText: e.replacementText,
|
|
12434
12489
|
replacement: e.replacement,
|
|
12490
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12435
12491
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12436
12492
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12437
12493
|
};
|
|
@@ -12448,6 +12504,7 @@ function d_(e) {
|
|
|
12448
12504
|
targetText: e.targetText,
|
|
12449
12505
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12450
12506
|
...e.occurrenceIndex === void 0 ? {} : { occurrenceIndex: e.occurrenceIndex },
|
|
12507
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12451
12508
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12452
12509
|
};
|
|
12453
12510
|
case "delete_portion": return {
|
|
@@ -12457,11 +12514,11 @@ function d_(e) {
|
|
|
12457
12514
|
case "delete_article": return { kind: "delete_article" };
|
|
12458
12515
|
}
|
|
12459
12516
|
}
|
|
12460
|
-
function
|
|
12517
|
+
function g_(e) {
|
|
12461
12518
|
let t = (t) => {
|
|
12462
12519
|
let n = e[t];
|
|
12463
12520
|
return typeof n == "string" ? n : "";
|
|
12464
|
-
}, n = "targetScope" in e && e.targetScope ? e.targetScope.type : "", r = "occurrenceIndex" in e && e.occurrenceIndex !== void 0 ? String(e.occurrenceIndex) : "", i = "insertLayout" in e && e.insertLayout ? e.insertLayout : "",
|
|
12521
|
+
}, n = "targetScope" in e && e.targetScope ? e.targetScope.type : "", r = "occurrenceIndex" in e && e.occurrenceIndex !== void 0 ? String(e.occurrenceIndex) : "", i = "targetOccurrenceCount" in e && e.targetOccurrenceCount !== void 0 ? String(e.targetOccurrenceCount) : "", a = "insertLayout" in e && e.insertLayout ? e.insertLayout : "", o = "replacementLayout" in e && e.replacementLayout ? e.replacementLayout : "";
|
|
12465
12522
|
return [
|
|
12466
12523
|
e.kind,
|
|
12467
12524
|
t("targetText"),
|
|
@@ -12470,10 +12527,11 @@ function f_(e) {
|
|
|
12470
12527
|
n,
|
|
12471
12528
|
r,
|
|
12472
12529
|
i,
|
|
12473
|
-
a
|
|
12530
|
+
a,
|
|
12531
|
+
o
|
|
12474
12532
|
].join("|");
|
|
12475
12533
|
}
|
|
12476
|
-
function
|
|
12534
|
+
function __(e, t, n) {
|
|
12477
12535
|
return t.targetType === n.targetType && JSON.stringify(t.reference) === JSON.stringify(n.reference) && JSON.stringify(t.portionSelectors) === JSON.stringify(n.portionSelectors) ? e : {
|
|
12478
12536
|
...e,
|
|
12479
12537
|
targetType: t.targetType,
|
|
@@ -12481,10 +12539,10 @@ function p_(e, t, n) {
|
|
|
12481
12539
|
portionSelectors: t.portionSelectors
|
|
12482
12540
|
};
|
|
12483
12541
|
}
|
|
12484
|
-
function
|
|
12485
|
-
return (e.kind === "compound" ? e.operations : [
|
|
12542
|
+
function v_(e, t) {
|
|
12543
|
+
return (e.kind === "compound" ? e.operations : [h_(e)]).map((n) => __(n, e, t));
|
|
12486
12544
|
}
|
|
12487
|
-
function
|
|
12545
|
+
function y_(e) {
|
|
12488
12546
|
let t = [];
|
|
12489
12547
|
for (let n = 0; n < e.length; n += 1) {
|
|
12490
12548
|
let r = e[n];
|
|
@@ -12499,14 +12557,14 @@ function h_(e) {
|
|
|
12499
12557
|
continue;
|
|
12500
12558
|
}
|
|
12501
12559
|
let o = i[0], s = [];
|
|
12502
|
-
for (let [e, t] of i.entries()) for (let [n, r] of
|
|
12560
|
+
for (let [e, t] of i.entries()) for (let [n, r] of v_(t, o).entries()) s.push({
|
|
12503
12561
|
directiveIndex: e,
|
|
12504
12562
|
operationIndex: n,
|
|
12505
12563
|
operation: r
|
|
12506
12564
|
});
|
|
12507
12565
|
let c = /* @__PURE__ */ new Set(), l = [];
|
|
12508
12566
|
for (let e = s.length - 1; e >= 0; --e) {
|
|
12509
|
-
let t = s[e], n =
|
|
12567
|
+
let t = s[e], n = g_(t.operation);
|
|
12510
12568
|
c.has(n) || (c.add(n), l.push(t));
|
|
12511
12569
|
}
|
|
12512
12570
|
l.sort((e, t) => e.directiveIndex - t.directiveIndex || e.operationIndex - t.operationIndex), t.push({
|
|
@@ -12525,14 +12583,14 @@ function h_(e) {
|
|
|
12525
12583
|
}
|
|
12526
12584
|
return t;
|
|
12527
12585
|
}
|
|
12528
|
-
function
|
|
12529
|
-
let o = e.target ?? bt(t), s = Rp(t), c = i && n.start < i.length ? i.slice(n.start) : r, l = i && n.start < i.length ? n.start : 0, u = i === r && n.start < r.length && !
|
|
12586
|
+
function b_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullText: i, tableTarget: a }) {
|
|
12587
|
+
let o = e.target ?? bt(t), s = Rp(t), c = i && n.start < i.length ? i.slice(n.start) : r, l = i && n.start < i.length ? n.start : 0, u = i === r && n.start < r.length && !m_(r.slice(0, n.start)) ? r.slice(n.start) : r, d = yh(u), f = p_(r, u, e, o, d, d.map((e) => e.text));
|
|
12530
12588
|
if (!f) return null;
|
|
12531
|
-
let p =
|
|
12589
|
+
let p = r_(f, s), m = Pg(r), h = {
|
|
12532
12590
|
...m ? { applicabilityDate: m } : {},
|
|
12533
12591
|
sourcePosition: n,
|
|
12534
12592
|
sourceText: r
|
|
12535
|
-
}, g =
|
|
12593
|
+
}, g = e_(c, l), _ = (e) => {
|
|
12536
12594
|
switch (e.kind) {
|
|
12537
12595
|
case "insert_after":
|
|
12538
12596
|
case "insert_before": return {
|
|
@@ -12548,6 +12606,7 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12548
12606
|
targetText: e.targetText,
|
|
12549
12607
|
replacementText: e.replacementText,
|
|
12550
12608
|
replacement: e.replacement,
|
|
12609
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12551
12610
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12552
12611
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12553
12612
|
};
|
|
@@ -12564,6 +12623,7 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12564
12623
|
targetText: e.targetText,
|
|
12565
12624
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12566
12625
|
...e.occurrenceIndex === void 0 ? {} : { occurrenceIndex: e.occurrenceIndex },
|
|
12626
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12567
12627
|
...e.tableTarget ? { tableTarget: e.tableTarget } : {}
|
|
12568
12628
|
};
|
|
12569
12629
|
case "delete_portion": return {
|
|
@@ -12591,7 +12651,7 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12591
12651
|
insertText: e.insertText,
|
|
12592
12652
|
...e.insertLayout ? { insertLayout: e.insertLayout } : {},
|
|
12593
12653
|
...e.expectsFollowingTable && g ? { citation: g } : {},
|
|
12594
|
-
...
|
|
12654
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12595
12655
|
...h
|
|
12596
12656
|
};
|
|
12597
12657
|
case "replace": return {
|
|
@@ -12605,8 +12665,9 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12605
12665
|
type: "text",
|
|
12606
12666
|
text: e.replacementText
|
|
12607
12667
|
},
|
|
12668
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12608
12669
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12609
|
-
...
|
|
12670
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12610
12671
|
...h
|
|
12611
12672
|
};
|
|
12612
12673
|
case "replace_portion": return e.replacement.type === "following_table" && !g ? null : {
|
|
@@ -12618,11 +12679,11 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12618
12679
|
replacement: e.replacement,
|
|
12619
12680
|
...e.replacementLayout ? { replacementLayout: e.replacementLayout } : {},
|
|
12620
12681
|
...e.replacement.type === "following_table" && g ? { citation: g } : {},
|
|
12621
|
-
...
|
|
12682
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12622
12683
|
...h
|
|
12623
12684
|
};
|
|
12624
12685
|
case "delete": {
|
|
12625
|
-
let n = d.map((e) =>
|
|
12686
|
+
let n = d.map((e) => t_(u, e.start)), r = /* @__PURE__ */ new Map();
|
|
12626
12687
|
for (let [e, t] of d.entries()) r.has(t.text) || r.set(t.text, n[e] ?? null);
|
|
12627
12688
|
let i = [e.targetText, ...e.extraTargetTexts ?? []].filter((e) => e && e.trim().length > 0).filter((e, t, n) => n.indexOf(e) === t);
|
|
12628
12689
|
return i.length > 1 ? v(i.map((t) => ({
|
|
@@ -12630,7 +12691,8 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12630
12691
|
targetText: t,
|
|
12631
12692
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12632
12693
|
occurrenceIndex: r.get(t) ?? void 0,
|
|
12633
|
-
...
|
|
12694
|
+
...t === e.targetText && e.targetOccurrenceCount !== void 0 ? { targetOccurrenceCount: e.targetOccurrenceCount } : {},
|
|
12695
|
+
...Jg(a) ? { tableTarget: a } : {}
|
|
12634
12696
|
}))) : {
|
|
12635
12697
|
kind: "delete",
|
|
12636
12698
|
targetType: o,
|
|
@@ -12639,7 +12701,8 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12639
12701
|
targetText: e.targetText,
|
|
12640
12702
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12641
12703
|
occurrenceIndex: r.get(e.targetText) ?? void 0,
|
|
12642
|
-
...
|
|
12704
|
+
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12705
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12643
12706
|
...h
|
|
12644
12707
|
};
|
|
12645
12708
|
}
|
|
@@ -12648,7 +12711,7 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12648
12711
|
targetType: o,
|
|
12649
12712
|
reference: t,
|
|
12650
12713
|
portionSelectors: s,
|
|
12651
|
-
...
|
|
12714
|
+
...Jg(a) ? { tableTarget: a } : {},
|
|
12652
12715
|
...h
|
|
12653
12716
|
};
|
|
12654
12717
|
case "delete_article": return o === "article" ? {
|
|
@@ -12672,7 +12735,7 @@ function g_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12672
12735
|
}
|
|
12673
12736
|
return y(p);
|
|
12674
12737
|
}
|
|
12675
|
-
function
|
|
12738
|
+
function x_(e) {
|
|
12676
12739
|
let t = /\barticle\s+([0-9]+(?:-[0-9]+)?(?:\s*[A-Z])?(?:\s+[a-z]+)?)\b/i.exec(e);
|
|
12677
12740
|
if (!t || t.index === void 0) return null;
|
|
12678
12741
|
let n = t.index, r = t.index + t[0].length;
|
|
@@ -12691,57 +12754,57 @@ function __(e) {
|
|
|
12691
12754
|
}
|
|
12692
12755
|
};
|
|
12693
12756
|
}
|
|
12694
|
-
function
|
|
12757
|
+
function S_(e, t) {
|
|
12695
12758
|
let i = r(e).output;
|
|
12696
12759
|
if (t.allowListExtraction) {
|
|
12697
|
-
let e =
|
|
12760
|
+
let e = Xg(i);
|
|
12698
12761
|
if (e) return e;
|
|
12699
12762
|
}
|
|
12700
|
-
let a =
|
|
12701
|
-
if (l.length > 0 && (c = c.filter((e) => !
|
|
12702
|
-
let e =
|
|
12763
|
+
let a = xh(i), o = d_(i), s = wh(i), c = Rm(new n(i)), l = [...a, ...o];
|
|
12764
|
+
if (l.length > 0 && (c = c.filter((e) => !f_(e, l))), c.length === 0 && (c = Rm(new n(s.split(",")[0] ?? s))), c.length === 0) {
|
|
12765
|
+
let e = x_(s);
|
|
12703
12766
|
e && (c = [{
|
|
12704
12767
|
...e.reference,
|
|
12705
12768
|
position: e.position
|
|
12706
12769
|
}]);
|
|
12707
12770
|
}
|
|
12708
|
-
let u =
|
|
12771
|
+
let u = ug(s);
|
|
12709
12772
|
if (c.length === 1 && c[0]?.type === "article") {
|
|
12710
|
-
let e =
|
|
12773
|
+
let e = gh(s, { actionIndex: u ?? s.length });
|
|
12711
12774
|
e && (c = [e]);
|
|
12712
12775
|
}
|
|
12713
12776
|
if (u !== null) {
|
|
12714
|
-
let e = c.some((e) => bt(
|
|
12777
|
+
let e = c.some((e) => bt(dg(e)) === "article"), t = c.some((e) => [...O(dg(e))].some((e) => e.type === "article")), n = s.slice(0, u), r = dh(a_(n), 0) ?? dh(n, 0), i = c.map(dg).sort((e, t) => fh(t) - fh(e) || ph(t) - ph(e))[0], a = mh(i ?? null, r);
|
|
12715
12778
|
if (!e && a && a === r && (c = [r]), !t) {
|
|
12716
12779
|
let e = i, t = n.indexOf(":");
|
|
12717
12780
|
if (t !== -1) {
|
|
12718
|
-
let r = t + 1, i =
|
|
12719
|
-
e && i &&
|
|
12781
|
+
let r = t + 1, i = dh(o_(n.slice(r)), r), a = i ? Rp(i) : [];
|
|
12782
|
+
e && i && fh(e) > 0 && (a.length > 1 || a.some((e) => e.kind === "range")) && (c = [Tg(e, i)]);
|
|
12720
12783
|
}
|
|
12721
12784
|
}
|
|
12722
12785
|
if (t) {
|
|
12723
|
-
let e = c.map(
|
|
12724
|
-
t !== -1 && e && i &&
|
|
12786
|
+
let e = c.map(dg).filter((e) => [...O(e)].some((e) => e.type === "article")).sort((e, t) => fh(t) - fh(e) || ph(t) - ph(e))[0], t = n.indexOf(":"), r = t === -1 ? 0 : t + 1, i = dh(o_(n.slice(r)), r), a = i ? Rp(i) : [];
|
|
12787
|
+
t !== -1 && e && i && fh(e) > 0 && (a.length > 1 || a.some((e) => e.kind === "range")) && c.push(Tg(e, i));
|
|
12725
12788
|
}
|
|
12726
12789
|
}
|
|
12727
12790
|
let d = [];
|
|
12728
12791
|
for (let e of c) {
|
|
12729
12792
|
if (e.type === "reference_et_action") {
|
|
12730
|
-
let t = e.position?.start ?? 0, n = i.lastIndexOf("\n", Math.max(0, t - 1)) + 1, r =
|
|
12793
|
+
let t = e.position?.start ?? 0, n = i.lastIndexOf("\n", Math.max(0, t - 1)) + 1, r = m_(i.slice(n, t)) ? n : t, a = {
|
|
12731
12794
|
start: r,
|
|
12732
12795
|
stop: i.length
|
|
12733
|
-
}, o = i.slice(r), s =
|
|
12796
|
+
}, o = i.slice(r), s = b_({
|
|
12734
12797
|
action: e.action,
|
|
12735
12798
|
reference: e.reference,
|
|
12736
12799
|
sourcePosition: a,
|
|
12737
12800
|
sourceText: o,
|
|
12738
12801
|
fullText: i,
|
|
12739
|
-
tableTarget:
|
|
12802
|
+
tableTarget: i_(o) ?? i_(i)
|
|
12740
12803
|
});
|
|
12741
12804
|
s && (Array.isArray(s) ? d.push(...s) : d.push(s));
|
|
12742
12805
|
continue;
|
|
12743
12806
|
}
|
|
12744
|
-
let t =
|
|
12807
|
+
let t = b_({
|
|
12745
12808
|
action: { action: "modifier" },
|
|
12746
12809
|
reference: e,
|
|
12747
12810
|
sourcePosition: e.position ?? {
|
|
@@ -12750,73 +12813,87 @@ function v_(e, t) {
|
|
|
12750
12813
|
},
|
|
12751
12814
|
sourceText: i,
|
|
12752
12815
|
fullText: i,
|
|
12753
|
-
tableTarget:
|
|
12816
|
+
tableTarget: i_(i)
|
|
12754
12817
|
});
|
|
12755
12818
|
t && (Array.isArray(t) ? d.push(...t) : d.push(t));
|
|
12756
12819
|
}
|
|
12757
12820
|
if (d.length === 0) {
|
|
12758
|
-
let e =
|
|
12821
|
+
let e = x_(s);
|
|
12759
12822
|
if (e) {
|
|
12760
|
-
let t =
|
|
12823
|
+
let t = b_({
|
|
12761
12824
|
action: { action: "modifier" },
|
|
12762
12825
|
reference: e.reference,
|
|
12763
12826
|
sourcePosition: e.position,
|
|
12764
12827
|
sourceText: i,
|
|
12765
12828
|
fullText: i,
|
|
12766
|
-
tableTarget:
|
|
12829
|
+
tableTarget: i_(i)
|
|
12767
12830
|
});
|
|
12768
12831
|
t && (Array.isArray(t) ? d.push(...t) : d.push(t));
|
|
12769
12832
|
}
|
|
12770
12833
|
}
|
|
12771
|
-
return
|
|
12834
|
+
return y_(d);
|
|
12772
12835
|
}
|
|
12773
|
-
function
|
|
12836
|
+
function C_(e) {
|
|
12774
12837
|
let t = new n(r(e).output);
|
|
12775
|
-
return [...
|
|
12838
|
+
return [...Hh.extract(t, { overlapWindow: 100 })];
|
|
12839
|
+
}
|
|
12840
|
+
function w_(e) {
|
|
12841
|
+
return S_(e, { allowListExtraction: !0 });
|
|
12842
|
+
}
|
|
12843
|
+
var T_ = w_;
|
|
12844
|
+
function E_(e) {
|
|
12845
|
+
let t = qm(e);
|
|
12846
|
+
return t.includes("«") || t.includes("»") || !e.trim().endsWith(":") ? !1 : th(t);
|
|
12776
12847
|
}
|
|
12777
|
-
function
|
|
12778
|
-
return
|
|
12848
|
+
function D_(e) {
|
|
12849
|
+
return e.trimStart().startsWith("«");
|
|
12850
|
+
}
|
|
12851
|
+
function O_(e) {
|
|
12852
|
+
return /»[.;]?\s*$/u.test(e);
|
|
12779
12853
|
}
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12854
|
+
function k_(e, t) {
|
|
12855
|
+
for (let n = t; n < e.length; n += 1) {
|
|
12856
|
+
let t = ng(e[n]).trim();
|
|
12857
|
+
if (t.length > 0) return t;
|
|
12858
|
+
}
|
|
12784
12859
|
}
|
|
12785
|
-
function
|
|
12860
|
+
function A_(e, t) {
|
|
12786
12861
|
let n = [], r = !1, i = t + 1;
|
|
12787
12862
|
for (; i < e.length;) {
|
|
12788
|
-
let t = e[i], a =
|
|
12863
|
+
let t = e[i], a = ng(t);
|
|
12789
12864
|
if (!r && a.includes("«") && (r = !0), r) {
|
|
12790
|
-
|
|
12865
|
+
n.push(a);
|
|
12866
|
+
let t = k_(e, i + 1);
|
|
12867
|
+
if (O_(a) && (t === void 0 || !D_(t))) break;
|
|
12791
12868
|
} else if (a.trim().length > 0) break;
|
|
12792
12869
|
i += 1;
|
|
12793
12870
|
}
|
|
12794
12871
|
return !r || n.length === 0 ? null : {
|
|
12795
|
-
combinedText: [
|
|
12872
|
+
combinedText: [ng(e[t]), ...n].join("\n"),
|
|
12796
12873
|
endIndex: i
|
|
12797
12874
|
};
|
|
12798
12875
|
}
|
|
12799
|
-
function
|
|
12876
|
+
function j_(e) {
|
|
12800
12877
|
let t = a()(e).output.split("\n").map((e) => e.trim()).filter((e) => e.length > 0), n = [];
|
|
12801
12878
|
for (let e = 0; e < t.length; e += 1) {
|
|
12802
12879
|
let r = t[e];
|
|
12803
|
-
if (
|
|
12804
|
-
let r =
|
|
12880
|
+
if (E_(r)) {
|
|
12881
|
+
let r = A_(t, e);
|
|
12805
12882
|
if (r) {
|
|
12806
|
-
let t =
|
|
12883
|
+
let t = w_(r.combinedText);
|
|
12807
12884
|
if (t.length > 0) {
|
|
12808
12885
|
n.push(...t), e = r.endIndex;
|
|
12809
12886
|
continue;
|
|
12810
12887
|
}
|
|
12811
12888
|
}
|
|
12812
12889
|
}
|
|
12813
|
-
let i =
|
|
12890
|
+
let i = S_(r, { allowListExtraction: !1 });
|
|
12814
12891
|
i.length > 0 && n.push(...i);
|
|
12815
12892
|
}
|
|
12816
12893
|
return n;
|
|
12817
12894
|
}
|
|
12818
|
-
var
|
|
12819
|
-
function
|
|
12895
|
+
var M_ = j_, N_;
|
|
12896
|
+
function P_(e) {
|
|
12820
12897
|
return {
|
|
12821
12898
|
dateDebut: e.dateDebut ?? "0001-01-01",
|
|
12822
12899
|
dateFin: e.dateFin ?? "2999-01-01",
|
|
@@ -12825,7 +12902,7 @@ function D_(e) {
|
|
|
12825
12902
|
textId: e.textId
|
|
12826
12903
|
};
|
|
12827
12904
|
}
|
|
12828
|
-
function
|
|
12905
|
+
function F_(e) {
|
|
12829
12906
|
let t = e["@id"];
|
|
12830
12907
|
return t === void 0 ? null : {
|
|
12831
12908
|
dateDebut: e["@debut"] ?? null,
|
|
@@ -12835,10 +12912,10 @@ function O_(e) {
|
|
|
12835
12912
|
title: e["#text"] ?? null
|
|
12836
12913
|
};
|
|
12837
12914
|
}
|
|
12838
|
-
function
|
|
12915
|
+
function I_(e, t) {
|
|
12839
12916
|
return (e.dateDebut === null || e.dateDebut <= t) && (e.dateFin === null || e.dateFin >= t);
|
|
12840
12917
|
}
|
|
12841
|
-
var
|
|
12918
|
+
var L_ = class extends ke {
|
|
12842
12919
|
canutesDb;
|
|
12843
12920
|
articleRowsByNumByTextAndDate = /* @__PURE__ */ new Map();
|
|
12844
12921
|
directSectionChildrenByParentAndDate = /* @__PURE__ */ new Map();
|
|
@@ -12863,7 +12940,7 @@ var A_ = class extends ke {
|
|
|
12863
12940
|
WHERE
|
|
12864
12941
|
data -> 'CONTEXTE' -> 'TEXTE' ->> '@cid' = ${n}
|
|
12865
12942
|
AND num = ${t}
|
|
12866
|
-
`).map(
|
|
12943
|
+
`).map(P_), this.articleRowsByNumByTextAndDate.set(r, i)), i;
|
|
12867
12944
|
}
|
|
12868
12945
|
async getDirectSectionChildren({ date: e, parentPath: t }) {
|
|
12869
12946
|
let n = `${t}\0${e}`, r = this.directSectionChildrenByParentAndDate.get(n);
|
|
@@ -12877,7 +12954,7 @@ var A_ = class extends ke {
|
|
|
12877
12954
|
SELECT data
|
|
12878
12955
|
FROM legifrance.textelr
|
|
12879
12956
|
WHERE id = ${t}
|
|
12880
|
-
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(
|
|
12957
|
+
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(F_).filter((e) => e !== null).filter((t) => I_(t, e)) ?? [] : i.map(F_).filter((e) => e !== null).filter((t) => I_(t, e)), this.directSectionChildrenByParentAndDate.set(n, r);
|
|
12881
12958
|
}
|
|
12882
12959
|
return r;
|
|
12883
12960
|
}
|
|
@@ -12920,7 +12997,7 @@ var A_ = class extends ke {
|
|
|
12920
12997
|
FROM legifrance.article
|
|
12921
12998
|
WHERE num = ${t}
|
|
12922
12999
|
LIMIT 100
|
|
12923
|
-
`).map(
|
|
13000
|
+
`).map(P_), this.globalArticleRowsByNumAndDate.set(n, r)), r;
|
|
12924
13001
|
}
|
|
12925
13002
|
async preloadTextTitlesInfos(e = {}) {
|
|
12926
13003
|
let t = (t, n = {}) => {
|
|
@@ -12935,7 +13012,7 @@ var A_ = class extends ke {
|
|
|
12935
13012
|
return;
|
|
12936
13013
|
}
|
|
12937
13014
|
let n = new xe("canutes.preloadTextTitlesInfos");
|
|
12938
|
-
|
|
13015
|
+
N_ === void 0 ? (t("queryTextTitlesInfos:start"), N_ = (async () => {
|
|
12939
13016
|
let e = await n.time("queryTextTitlesInfos", () => this.canutesDb`
|
|
12940
13017
|
SELECT
|
|
12941
13018
|
data -> 'META' -> 'META_SPEC' -> 'META_TEXTE_CHRONICLE' ->> 'CID' AS cid,
|
|
@@ -12965,8 +13042,8 @@ var A_ = class extends ke {
|
|
|
12965
13042
|
`);
|
|
12966
13043
|
t("queryTextTitlesInfos:done", { count: e.length }), t("buildTextTitlesInfos:start", { count: e.length }), await Ee(e, { onProgress: ({ count: e, phase: n }) => t(`buildTextTitlesInfos:${n}`, { count: e }) }), t("buildTextTitlesInfos:done", { count: e.length }), t("setTextTitlesInfos:done");
|
|
12967
13044
|
})().catch((e) => {
|
|
12968
|
-
throw
|
|
12969
|
-
})) : t("waiting-for-shared-preload"), await
|
|
13045
|
+
throw N_ = void 0, e;
|
|
13046
|
+
})) : t("waiting-for-shared-preload"), await N_, n.log(), this.textTitlesInfosLoaded = !0;
|
|
12970
13047
|
}
|
|
12971
13048
|
async preloadUniqueActiveArticlesByNums({ date: e, nums: t }) {
|
|
12972
13049
|
let n = [...new Set([...t].filter(Boolean))].filter((t) => !this.globalArticleRowsByNumAndDate.has(`${t}\0${e}`));
|
|
@@ -12980,7 +13057,7 @@ var A_ = class extends ke {
|
|
|
12980
13057
|
data -> 'META' -> 'META_SPEC' -> 'META_ARTICLE' ->> 'DATE_FIN' AS "dateFin"
|
|
12981
13058
|
FROM legifrance.article
|
|
12982
13059
|
WHERE num IN ${this.canutesDb(n)}
|
|
12983
|
-
`).map(
|
|
13060
|
+
`).map(P_), i = /* @__PURE__ */ new Map();
|
|
12984
13061
|
for (let e of r) {
|
|
12985
13062
|
if (e.num === null) continue;
|
|
12986
13063
|
let t = i.get(e.num);
|
|
@@ -12991,15 +13068,15 @@ var A_ = class extends ke {
|
|
|
12991
13068
|
};
|
|
12992
13069
|
//#endregion
|
|
12993
13070
|
//#region src/lib/extractors/links.ts
|
|
12994
|
-
async function*
|
|
12995
|
-
let l = r ?? (e === void 0 ? void 0 : new
|
|
13071
|
+
async function* R_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgnoredReferencesTypes: i, logPartialReferences: a, logReferences: o, state: s, transformation: c }) {
|
|
13072
|
+
let l = r ?? (e === void 0 ? void 0 : new L_(e));
|
|
12996
13073
|
if (l === void 0) throw Error("A Canutes database or legal resolver is required");
|
|
12997
13074
|
let u = new xe("extractTextLinks"), d = {}, f = c === void 0 ? void 0 : _e(c), p = s === void 0 ? {} : structuredClone(s), m = u.timeSync("extractReferences", () => {
|
|
12998
13075
|
let e = [];
|
|
12999
|
-
for (let n of c === void 0 ?
|
|
13076
|
+
for (let n of c === void 0 ? Fm(t) : Lm(t, c)) o && console.log(`In "${t.input.slice(n.position.start, n.position.stop)}": \nReference "${t.text(n.position)}": ${JSON.stringify(n, null, 2)}`), e.push(n);
|
|
13000
13077
|
return e;
|
|
13001
13078
|
}, { inputSize: t.input.length }), h = performance.now();
|
|
13002
|
-
for (let e of m) for (let n of
|
|
13079
|
+
for (let e of m) for (let n of q_(t, e)) {
|
|
13003
13080
|
let r = n.type === "parent-enfant" ? n.parent : n;
|
|
13004
13081
|
switch (r.type) {
|
|
13005
13082
|
case "alinéa":
|
|
@@ -13028,7 +13105,7 @@ async function* j_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13028
13105
|
r.definition && p.textId === void 0 && a && console.log(`In "${t.input.slice(e.position.start, e.position.stop)}": Missing state.textId for division definition`);
|
|
13029
13106
|
break;
|
|
13030
13107
|
case "texte":
|
|
13031
|
-
|
|
13108
|
+
z_({
|
|
13032
13109
|
context: t,
|
|
13033
13110
|
logPartialReferences: a,
|
|
13034
13111
|
reference: e,
|
|
@@ -13044,14 +13121,14 @@ async function* j_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13044
13121
|
phase: "collectDefinitionsAndTextState"
|
|
13045
13122
|
});
|
|
13046
13123
|
let g = /* @__PURE__ */ new Set();
|
|
13047
|
-
for (let e of m) for (let t of
|
|
13048
|
-
let _ =
|
|
13124
|
+
for (let e of m) for (let t of K_(e, { citations: !0 })) g.add(t);
|
|
13125
|
+
let _ = B_(t, m);
|
|
13049
13126
|
await u.time("preloadActiveArticlesByTextIds", () => l.preloadActiveArticlesByTextIds({
|
|
13050
13127
|
date: n,
|
|
13051
13128
|
nums: g,
|
|
13052
13129
|
textIds: _
|
|
13053
13130
|
}), { count: _.size });
|
|
13054
|
-
let v = await u.time("collectUniqueFallbackArticleNums", () =>
|
|
13131
|
+
let v = await u.time("collectUniqueFallbackArticleNums", () => V_({
|
|
13055
13132
|
context: t,
|
|
13056
13133
|
date: n,
|
|
13057
13134
|
legiResolver: l,
|
|
@@ -13064,7 +13141,7 @@ async function* j_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13064
13141
|
nums: v
|
|
13065
13142
|
}), { count: v.size }), p = s === void 0 ? {} : s;
|
|
13066
13143
|
let y = 0, ee = performance.now();
|
|
13067
|
-
for (let e of m) for await (let r of
|
|
13144
|
+
for (let e of m) for await (let r of Q_({
|
|
13068
13145
|
articleDefinitionByNumByTextId: d,
|
|
13069
13146
|
legiResolver: l,
|
|
13070
13147
|
context: t,
|
|
@@ -13081,7 +13158,7 @@ async function* j_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13081
13158
|
phase: "iterReferenceLinks"
|
|
13082
13159
|
}), u.log({ referenceCount: m.length });
|
|
13083
13160
|
}
|
|
13084
|
-
function
|
|
13161
|
+
function z_({ context: e, logPartialReferences: t, reference: n, state: r, text: i }) {
|
|
13085
13162
|
switch (i.nature) {
|
|
13086
13163
|
case "ARRETE":
|
|
13087
13164
|
case "CIRCULAIRE":
|
|
@@ -13152,17 +13229,17 @@ function M_({ context: e, logPartialReferences: t, reference: n, state: r, text:
|
|
|
13152
13229
|
default: i.nature === void 0 ? delete r.textId : c("nature", i.nature);
|
|
13153
13230
|
}
|
|
13154
13231
|
}
|
|
13155
|
-
function
|
|
13232
|
+
function B_(e, t) {
|
|
13156
13233
|
let n = /* @__PURE__ */ new Set();
|
|
13157
|
-
for (let r of t) for (let t of
|
|
13234
|
+
for (let r of t) for (let t of q_(e, r, { citations: !0 })) {
|
|
13158
13235
|
let e = t.type === "parent-enfant" ? t.parent : t;
|
|
13159
13236
|
e.type === "texte" && e.cid !== void 0 ? n.add(e.cid) : e.type === "article" && e.implicitText?.cid !== void 0 && n.add(e.implicitText.cid);
|
|
13160
13237
|
}
|
|
13161
13238
|
return n;
|
|
13162
13239
|
}
|
|
13163
|
-
async function
|
|
13240
|
+
async function V_({ context: e, date: t, legiResolver: n, logPartialReferences: r, references: i, state: a }) {
|
|
13164
13241
|
let o = /* @__PURE__ */ new Set();
|
|
13165
|
-
for (let s of i) await
|
|
13242
|
+
for (let s of i) await H_({
|
|
13166
13243
|
articleNums: o,
|
|
13167
13244
|
context: e,
|
|
13168
13245
|
date: t,
|
|
@@ -13173,8 +13250,8 @@ async function P_({ context: e, date: t, legiResolver: n, logPartialReferences:
|
|
|
13173
13250
|
});
|
|
13174
13251
|
return o;
|
|
13175
13252
|
}
|
|
13176
|
-
async function
|
|
13177
|
-
for (let s of
|
|
13253
|
+
async function H_({ articleNums: e, context: t, date: n, legiResolver: r, logPartialReferences: i, reference: a, state: o }) {
|
|
13254
|
+
for (let s of q_(t, a)) await U_({
|
|
13178
13255
|
articleNums: e,
|
|
13179
13256
|
atomicOrParentChildReference: s,
|
|
13180
13257
|
context: t,
|
|
@@ -13189,7 +13266,7 @@ async function F_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
13189
13266
|
if (s !== void 0) {
|
|
13190
13267
|
for (let a of s) if (a.references !== void 0) {
|
|
13191
13268
|
let s = structuredClone(o);
|
|
13192
|
-
for (let o of a.references) await
|
|
13269
|
+
for (let o of a.references) await H_({
|
|
13193
13270
|
articleNums: e,
|
|
13194
13271
|
context: t,
|
|
13195
13272
|
date: n,
|
|
@@ -13202,7 +13279,7 @@ async function F_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
13202
13279
|
}
|
|
13203
13280
|
}
|
|
13204
13281
|
}
|
|
13205
|
-
async function
|
|
13282
|
+
async function U_({ articleNums: e, atomicOrParentChildReference: t, context: n, date: r, legiResolver: i, logPartialReferences: a, reference: o, state: s }) {
|
|
13206
13283
|
let c = t.type === "parent-enfant" ? t.parent : t, l = t.type === "parent-enfant" ? t : void 0;
|
|
13207
13284
|
switch (c.type) {
|
|
13208
13285
|
case "alinéa":
|
|
@@ -13211,7 +13288,7 @@ async function I_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13211
13288
|
case "phrase": break;
|
|
13212
13289
|
case "article":
|
|
13213
13290
|
if (c.definition && s.textId !== void 0) break;
|
|
13214
|
-
await
|
|
13291
|
+
await W_({
|
|
13215
13292
|
article: c,
|
|
13216
13293
|
date: r,
|
|
13217
13294
|
legiResolver: i,
|
|
@@ -13229,7 +13306,7 @@ async function I_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13229
13306
|
case "sous-titre":
|
|
13230
13307
|
case "titre":
|
|
13231
13308
|
if (c.definition && s.textId !== void 0) break;
|
|
13232
|
-
l !== void 0 && await
|
|
13309
|
+
l !== void 0 && await H_({
|
|
13233
13310
|
articleNums: e,
|
|
13234
13311
|
context: n,
|
|
13235
13312
|
date: r,
|
|
@@ -13240,13 +13317,13 @@ async function I_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13240
13317
|
});
|
|
13241
13318
|
break;
|
|
13242
13319
|
case "texte":
|
|
13243
|
-
|
|
13320
|
+
z_({
|
|
13244
13321
|
context: n,
|
|
13245
13322
|
logPartialReferences: a,
|
|
13246
13323
|
reference: o,
|
|
13247
13324
|
state: s,
|
|
13248
13325
|
text: c
|
|
13249
|
-
}), l !== void 0 && await
|
|
13326
|
+
}), l !== void 0 && await H_({
|
|
13250
13327
|
articleNums: e,
|
|
13251
13328
|
context: n,
|
|
13252
13329
|
date: r,
|
|
@@ -13259,7 +13336,7 @@ async function I_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13259
13336
|
default: break;
|
|
13260
13337
|
}
|
|
13261
13338
|
}
|
|
13262
|
-
async function
|
|
13339
|
+
async function W_({ article: e, date: t, legiResolver: n, state: r }) {
|
|
13263
13340
|
if (e.present || e.num === void 0) return !1;
|
|
13264
13341
|
let i = e.implicitText?.cid ?? r.textId;
|
|
13265
13342
|
return !(i !== void 0 && (await n.getActiveArticlesByTextAndNum({
|
|
@@ -13272,7 +13349,7 @@ async function L_({ article: e, date: t, legiResolver: n, state: r }) {
|
|
|
13272
13349
|
textId: r.defaultTextId
|
|
13273
13350
|
})).length > 0);
|
|
13274
13351
|
}
|
|
13275
|
-
async function*
|
|
13352
|
+
async function* G_({ ancestors: e, article: t, legiResolver: n, context: r, date: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13276
13353
|
if (t.present) return;
|
|
13277
13354
|
let l = [], u = t.implicitText?.cid ?? c.textId;
|
|
13278
13355
|
if (u !== void 0 && (l = await n.getActiveArticlesByTextAndNum({
|
|
@@ -13308,91 +13385,91 @@ async function* R_({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13308
13385
|
type: "external_article"
|
|
13309
13386
|
}).filter(([, e]) => e !== void 0));
|
|
13310
13387
|
}
|
|
13311
|
-
function*
|
|
13388
|
+
function* K_(e, { citations: t = !1 } = {}) {
|
|
13312
13389
|
switch (e.type) {
|
|
13313
13390
|
case "article":
|
|
13314
13391
|
e.num !== void 0 && (yield e.num);
|
|
13315
13392
|
break;
|
|
13316
13393
|
case "bounded-interval":
|
|
13317
|
-
yield*
|
|
13394
|
+
yield* K_(e.first, { citations: t }), yield* K_(e.last, { citations: t });
|
|
13318
13395
|
break;
|
|
13319
13396
|
case "counted-interval":
|
|
13320
|
-
yield*
|
|
13397
|
+
yield* K_(e.first, { citations: t });
|
|
13321
13398
|
break;
|
|
13322
13399
|
case "enumeration":
|
|
13323
13400
|
case "exclusion":
|
|
13324
|
-
yield*
|
|
13401
|
+
yield* K_(e.left, { citations: t }), yield* K_(e.right, { citations: t });
|
|
13325
13402
|
break;
|
|
13326
13403
|
case "parent-enfant":
|
|
13327
|
-
yield*
|
|
13404
|
+
yield* K_(e.parent, { citations: t }), yield* K_(e.child, { citations: t });
|
|
13328
13405
|
break;
|
|
13329
13406
|
case "reference_et_action":
|
|
13330
|
-
if (yield*
|
|
13407
|
+
if (yield* K_(e.reference, { citations: t }), t) {
|
|
13331
13408
|
let { originalCitations: n } = e.action;
|
|
13332
13409
|
if (n !== void 0) {
|
|
13333
|
-
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield*
|
|
13410
|
+
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield* K_(n, { citations: t });
|
|
13334
13411
|
}
|
|
13335
13412
|
}
|
|
13336
13413
|
break;
|
|
13337
13414
|
}
|
|
13338
13415
|
}
|
|
13339
|
-
function*
|
|
13416
|
+
function* q_(e, t, { citations: n = !1 } = {}) {
|
|
13340
13417
|
switch (t.type) {
|
|
13341
13418
|
case "bounded-interval":
|
|
13342
|
-
yield*
|
|
13419
|
+
yield* q_(e, t.first, { citations: n }), yield* q_(e, t.last, { citations: n });
|
|
13343
13420
|
break;
|
|
13344
13421
|
case "counted-interval":
|
|
13345
|
-
yield*
|
|
13422
|
+
yield* q_(e, t.first, { citations: n });
|
|
13346
13423
|
break;
|
|
13347
13424
|
case "enumeration":
|
|
13348
13425
|
case "exclusion":
|
|
13349
|
-
yield*
|
|
13426
|
+
yield* q_(e, t.left, { citations: n }), yield* q_(e, t.right, { citations: n });
|
|
13350
13427
|
break;
|
|
13351
13428
|
case "reference_et_action":
|
|
13352
|
-
if (yield*
|
|
13429
|
+
if (yield* q_(e, t.reference, { citations: n }), n) {
|
|
13353
13430
|
let { originalCitations: r } = t.action;
|
|
13354
13431
|
if (r !== void 0) {
|
|
13355
|
-
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield*
|
|
13432
|
+
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield* q_(e, r, { citations: n });
|
|
13356
13433
|
}
|
|
13357
13434
|
}
|
|
13358
13435
|
break;
|
|
13359
13436
|
default: yield t;
|
|
13360
13437
|
}
|
|
13361
13438
|
}
|
|
13362
|
-
function*
|
|
13439
|
+
function* J_(e, t) {
|
|
13363
13440
|
if (t.type === "texte") console.error(`iterDeepestDivisionsOrArticles must not be called with a text:\n${JSON.stringify(t, null, 2)}`);
|
|
13364
13441
|
else if (dt(t) || t.type === "article") yield t;
|
|
13365
13442
|
else if (!(ft(t) || t.type === "incomplete-header")) switch (t.type) {
|
|
13366
13443
|
case "bounded-interval":
|
|
13367
|
-
yield*
|
|
13444
|
+
yield* J_(e, t.first), yield* J_(e, t.last);
|
|
13368
13445
|
break;
|
|
13369
13446
|
case "counted-interval":
|
|
13370
|
-
yield*
|
|
13447
|
+
yield* J_(e, t.first);
|
|
13371
13448
|
break;
|
|
13372
13449
|
case "enumeration":
|
|
13373
13450
|
case "exclusion":
|
|
13374
|
-
yield*
|
|
13451
|
+
yield* J_(e, t.left), yield* J_(e, t.right);
|
|
13375
13452
|
break;
|
|
13376
13453
|
case "parent-enfant": {
|
|
13377
|
-
let n = [...
|
|
13378
|
-
n.length === 0 ? yield*
|
|
13454
|
+
let n = [...J_(e, t.child)];
|
|
13455
|
+
n.length === 0 ? yield* J_(e, t.parent) : yield* n;
|
|
13379
13456
|
break;
|
|
13380
13457
|
}
|
|
13381
13458
|
case "reference_et_action": {
|
|
13382
|
-
yield*
|
|
13459
|
+
yield* J_(e, t.reference);
|
|
13383
13460
|
let { originalCitations: n } = t.action;
|
|
13384
13461
|
if (n !== void 0) {
|
|
13385
|
-
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield*
|
|
13462
|
+
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield* J_(e, n);
|
|
13386
13463
|
}
|
|
13387
13464
|
break;
|
|
13388
13465
|
}
|
|
13389
13466
|
default: c("iterDeepestDivisionsOrArticles reference.type", t);
|
|
13390
13467
|
}
|
|
13391
13468
|
}
|
|
13392
|
-
function
|
|
13469
|
+
function Y_(e) {
|
|
13393
13470
|
return e?.split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== "").join(" ");
|
|
13394
13471
|
}
|
|
13395
|
-
async function*
|
|
13472
|
+
async function* X_({ ancestors: e, legiResolver: t, context: n, date: r, division: i, divisionChildReference: a, logIgnoredReferencesTypes: o, logPartialReferences: s, originalPositionsFromTransformedIterator: c, parentSectionChildren: l, reference: u, state: d }) {
|
|
13396
13473
|
if (i.present) return;
|
|
13397
13474
|
let f;
|
|
13398
13475
|
if (l === void 0 && d.textId !== void 0 && (l = await t.getDirectSectionChildren({
|
|
@@ -13400,20 +13477,20 @@ async function* U_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13400
13477
|
parentPath: d.textId
|
|
13401
13478
|
})), l !== void 0) {
|
|
13402
13479
|
for (let e of l) {
|
|
13403
|
-
let t =
|
|
13480
|
+
let t = Y_(e.title);
|
|
13404
13481
|
if (t !== void 0) {
|
|
13405
13482
|
let n = !1;
|
|
13406
|
-
if (i.index !== void 0 && (n =
|
|
13483
|
+
if (i.index !== void 0 && (n = Z_(i.type, i.index).some((e) => e === t)), !n && i.num !== void 0 && (n = `${i.type} ${i.num.toLowerCase()}` === t), n) {
|
|
13407
13484
|
f = e;
|
|
13408
13485
|
break;
|
|
13409
13486
|
}
|
|
13410
13487
|
}
|
|
13411
13488
|
}
|
|
13412
13489
|
if (f === void 0 && (f = l.find((e) => {
|
|
13413
|
-
let t =
|
|
13490
|
+
let t = Y_(e.title)?.split(/\s+/);
|
|
13414
13491
|
return t !== void 0 && t.length === 2 && ot.includes(t[0]) && t[1] === "législative";
|
|
13415
13492
|
}), f !== void 0)) {
|
|
13416
|
-
let e =
|
|
13493
|
+
let e = Y_(f.title).split(/\s+/), t = {
|
|
13417
13494
|
start: i.position.stop,
|
|
13418
13495
|
stop: i.position.stop
|
|
13419
13496
|
}, n = c === void 0 ? void 0 : v(c, t), r = Object.fromEntries(Object.entries({
|
|
@@ -13431,8 +13508,8 @@ async function* U_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13431
13508
|
}).filter(([, e]) => e !== void 0)), i = r;
|
|
13432
13509
|
}
|
|
13433
13510
|
}
|
|
13434
|
-
let p = a === void 0 ? [] : [...
|
|
13435
|
-
if (a !== void 0) for (let l of
|
|
13511
|
+
let p = a === void 0 ? [] : [...J_(n, a.child)], m = 0;
|
|
13512
|
+
if (a !== void 0) for (let l of q_(n, a.child)) {
|
|
13436
13513
|
let h = l.type === "parent-enfant" ? l.parent : l, g = l.type === "parent-enfant" ? l : void 0;
|
|
13437
13514
|
switch (h.type) {
|
|
13438
13515
|
case "alinéa":
|
|
@@ -13440,7 +13517,7 @@ async function* U_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13440
13517
|
case "item":
|
|
13441
13518
|
case "phrase": break;
|
|
13442
13519
|
case "article":
|
|
13443
|
-
yield*
|
|
13520
|
+
yield* G_({
|
|
13444
13521
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13445
13522
|
article: h,
|
|
13446
13523
|
legiResolver: t,
|
|
@@ -13466,7 +13543,7 @@ async function* U_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13466
13543
|
f !== void 0 && (a = await t.getDirectSectionChildren({
|
|
13467
13544
|
date: r,
|
|
13468
13545
|
parentPath: f.path
|
|
13469
|
-
})), yield*
|
|
13546
|
+
})), yield* X_({
|
|
13470
13547
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13471
13548
|
legiResolver: t,
|
|
13472
13549
|
context: n,
|
|
@@ -13504,7 +13581,7 @@ async function* U_({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13504
13581
|
}).filter(([, e]) => e !== void 0));
|
|
13505
13582
|
}
|
|
13506
13583
|
}
|
|
13507
|
-
function*
|
|
13584
|
+
function* Z_(e, t) {
|
|
13508
13585
|
let n = Math.floor(t), r = Math.floor((t - n) * 1e3);
|
|
13509
13586
|
if (r === 0) {
|
|
13510
13587
|
for (let t of re(n)) yield `${t.toLowerCase()} ${e}`;
|
|
@@ -13514,9 +13591,9 @@ function* W_(e, t) {
|
|
|
13514
13591
|
for (let r of f(n)) yield `${e} ${t} ${r.toLowerCase()}`;
|
|
13515
13592
|
}
|
|
13516
13593
|
}
|
|
13517
|
-
async function*
|
|
13594
|
+
async function* Q_({ articleDefinitionByNumByTextId: e, legiResolver: t, context: n, date: r, logIgnoredReferencesTypes: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13518
13595
|
let l = e ?? {}, u = c === void 0 ? {} : c;
|
|
13519
|
-
for (let e of
|
|
13596
|
+
for (let e of q_(n, s)) {
|
|
13520
13597
|
let c = e.type === "parent-enfant" ? e.parent : e, d = e.type === "parent-enfant" ? e : void 0;
|
|
13521
13598
|
switch (c.type) {
|
|
13522
13599
|
case "alinéa":
|
|
@@ -13527,7 +13604,7 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13527
13604
|
if (c.definition && u.textId !== void 0) {
|
|
13528
13605
|
let e = l[u.textId]?.[c.num];
|
|
13529
13606
|
e !== void 0 && (e.originalTransformation === void 0 && o !== void 0 && (e.originalTransformation = v(o, e.position)), yield e);
|
|
13530
|
-
} else yield*
|
|
13607
|
+
} else yield* G_({
|
|
13531
13608
|
article: c,
|
|
13532
13609
|
legiResolver: t,
|
|
13533
13610
|
context: n,
|
|
@@ -13548,7 +13625,7 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13548
13625
|
case "sous-sous-paragraphe":
|
|
13549
13626
|
case "sous-titre":
|
|
13550
13627
|
case "titre":
|
|
13551
|
-
c.definition && u.textId !== void 0 || (yield*
|
|
13628
|
+
c.definition && u.textId !== void 0 || (yield* X_({
|
|
13552
13629
|
legiResolver: t,
|
|
13553
13630
|
context: n,
|
|
13554
13631
|
date: r,
|
|
@@ -13562,15 +13639,15 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13562
13639
|
}));
|
|
13563
13640
|
break;
|
|
13564
13641
|
case "texte": {
|
|
13565
|
-
|
|
13642
|
+
z_({
|
|
13566
13643
|
context: n,
|
|
13567
13644
|
logPartialReferences: a,
|
|
13568
13645
|
reference: s,
|
|
13569
13646
|
state: u,
|
|
13570
13647
|
text: c
|
|
13571
13648
|
});
|
|
13572
|
-
let e = d === void 0 ? [] : [...
|
|
13573
|
-
if (d !== void 0) for (let f of
|
|
13649
|
+
let e = d === void 0 ? [] : [...J_(n, d.child)], l = 0;
|
|
13650
|
+
if (d !== void 0) for (let f of q_(n, d.child)) {
|
|
13574
13651
|
let p = f.type === "parent-enfant" ? f.parent : f, m = f.type === "parent-enfant" ? f : void 0;
|
|
13575
13652
|
switch (p.type) {
|
|
13576
13653
|
case "alinéa":
|
|
@@ -13578,7 +13655,7 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13578
13655
|
case "item":
|
|
13579
13656
|
case "phrase": break;
|
|
13580
13657
|
case "article":
|
|
13581
|
-
yield*
|
|
13658
|
+
yield* G_({
|
|
13582
13659
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13583
13660
|
article: p,
|
|
13584
13661
|
legiResolver: t,
|
|
@@ -13604,7 +13681,7 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13604
13681
|
u.textId !== void 0 && (d = await t.getDirectSectionChildren({
|
|
13605
13682
|
date: r,
|
|
13606
13683
|
parentPath: u.textId
|
|
13607
|
-
})), yield*
|
|
13684
|
+
})), yield* X_({
|
|
13608
13685
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13609
13686
|
legiResolver: t,
|
|
13610
13687
|
context: n,
|
|
@@ -13655,7 +13732,7 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13655
13732
|
if (e !== void 0) {
|
|
13656
13733
|
for (let s of e) if (s.references !== void 0) {
|
|
13657
13734
|
let e = structuredClone(u);
|
|
13658
|
-
for (let c of s.references) yield*
|
|
13735
|
+
for (let c of s.references) yield* Q_({
|
|
13659
13736
|
articleDefinitionByNumByTextId: l,
|
|
13660
13737
|
legiResolver: t,
|
|
13661
13738
|
context: n,
|
|
@@ -13672,13 +13749,13 @@ async function* G_({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13672
13749
|
}
|
|
13673
13750
|
//#endregion
|
|
13674
13751
|
//#region src/lib/extractors/table_of_contents.ts
|
|
13675
|
-
function
|
|
13752
|
+
function $_(e) {
|
|
13676
13753
|
let t = e;
|
|
13677
13754
|
return t.items ?? [...t.articles ?? [], ...t.divisions ?? []];
|
|
13678
13755
|
}
|
|
13679
|
-
function*
|
|
13756
|
+
function* ev({ context: e, tableOfContents: t, transformation: n }) {
|
|
13680
13757
|
let r = 0, i = _e(n);
|
|
13681
|
-
for (let n of
|
|
13758
|
+
for (let n of nv(t)) {
|
|
13682
13759
|
let t = n.line.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = RegExp(`^${t}$`, "m");
|
|
13683
13760
|
a.lastIndex = r;
|
|
13684
13761
|
let o = a.exec(e.input);
|
|
@@ -13690,7 +13767,7 @@ function* q_({ context: e, tableOfContents: t, transformation: n }) {
|
|
|
13690
13767
|
l.originalTransformation = c, l.position = s, yield l, r = s.stop;
|
|
13691
13768
|
}
|
|
13692
13769
|
}
|
|
13693
|
-
function
|
|
13770
|
+
function tv(e) {
|
|
13694
13771
|
let t = new n(e), r = { items: [] }, i = [];
|
|
13695
13772
|
for (let e of Tn(t)) if (dt(e)) {
|
|
13696
13773
|
let n = i.findIndex(({ type: t }) => t === e.type);
|
|
@@ -13708,14 +13785,14 @@ function J_(e) {
|
|
|
13708
13785
|
else throw Error(`Unexpected type "${e.type}" in definition:\n${JSON.stringify(e, null, 2)}`);
|
|
13709
13786
|
return r;
|
|
13710
13787
|
}
|
|
13711
|
-
function*
|
|
13788
|
+
function* nv(e) {
|
|
13712
13789
|
e.type !== void 0 && (yield e);
|
|
13713
|
-
for (let t of
|
|
13790
|
+
for (let t of $_(e)) t.type === "article" ? yield t : yield* nv(t);
|
|
13714
13791
|
}
|
|
13715
13792
|
//#endregion
|
|
13716
13793
|
//#region src/lib/links.ts
|
|
13717
|
-
var
|
|
13718
|
-
function
|
|
13794
|
+
var rv = ["Exploratrice", "Forgejo"];
|
|
13795
|
+
function iv(e, t, n) {
|
|
13719
13796
|
let r = n.match(Ke);
|
|
13720
13797
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
13721
13798
|
switch (e) {
|
|
@@ -13736,19 +13813,19 @@ function Z_(e, t, n) {
|
|
|
13736
13813
|
}
|
|
13737
13814
|
//#endregion
|
|
13738
13815
|
//#region src/lib/linkers/html.ts
|
|
13739
|
-
function
|
|
13816
|
+
function av(e, t) {
|
|
13740
13817
|
if (e !== void 0) return e;
|
|
13741
|
-
if (t !== void 0) return new
|
|
13818
|
+
if (t !== void 0) return new L_(t);
|
|
13742
13819
|
throw Error("A Canutes database or legal resolver is required");
|
|
13743
13820
|
}
|
|
13744
|
-
function
|
|
13821
|
+
function ov(e, t) {
|
|
13745
13822
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
13746
13823
|
...e,
|
|
13747
13824
|
action: t.action
|
|
13748
13825
|
}) : JSON.stringify(e);
|
|
13749
13826
|
}
|
|
13750
|
-
async function
|
|
13751
|
-
let h = new xe("addLinksToHtml"), g =
|
|
13827
|
+
async function sv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl: o, linkType: s, logIgnoredReferencesTypes: l, logPartialReferences: u, logReferences: d, onLink: f, previousContext: p, state: m }) {
|
|
13828
|
+
let h = new xe("addLinksToHtml"), g = av(t, e);
|
|
13752
13829
|
await h.time("preloadTextTitlesInfos", () => g.preloadTextTitlesInfos());
|
|
13753
13830
|
let _ = h.timeSync("simplifyHtml", () => a({ removeAWithHref: !0 })(i), {
|
|
13754
13831
|
inputSize: i.length,
|
|
@@ -13757,7 +13834,7 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13757
13834
|
v.currentArticle = p?.currentArticle, v.currentText = p?.currentText;
|
|
13758
13835
|
let y = [], ee = { value: 0 }, te = -1;
|
|
13759
13836
|
await h.time("extractTextLinks", async () => {
|
|
13760
|
-
for await (let e of
|
|
13837
|
+
for await (let e of R_({
|
|
13761
13838
|
legiResolver: g,
|
|
13762
13839
|
context: v,
|
|
13763
13840
|
date: r,
|
|
@@ -13770,7 +13847,7 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13770
13847
|
case "article_definition": {
|
|
13771
13848
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
13772
13849
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
13773
|
-
|
|
13850
|
+
lv({
|
|
13774
13851
|
inputHtml: i,
|
|
13775
13852
|
originalTransformation: n,
|
|
13776
13853
|
output: { replacements: y },
|
|
@@ -13783,12 +13860,12 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13783
13860
|
let { articleId: t, originalTransformation: n } = e;
|
|
13784
13861
|
if (t !== void 0) {
|
|
13785
13862
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
13786
|
-
|
|
13863
|
+
lv({
|
|
13787
13864
|
inputHtml: i,
|
|
13788
13865
|
originalTransformation: n,
|
|
13789
13866
|
output: { replacements: y },
|
|
13790
13867
|
replacementCounter: ee,
|
|
13791
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_article_externe" href="${
|
|
13868
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_article_externe" href="${iv(s, o, t)}">${e}</a>`
|
|
13792
13869
|
});
|
|
13793
13870
|
}
|
|
13794
13871
|
break;
|
|
@@ -13797,12 +13874,12 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13797
13874
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
13798
13875
|
if (n !== void 0) {
|
|
13799
13876
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
13800
|
-
|
|
13877
|
+
lv({
|
|
13801
13878
|
inputHtml: i,
|
|
13802
13879
|
originalTransformation: t,
|
|
13803
13880
|
output: { replacements: y },
|
|
13804
13881
|
replacementCounter: ee,
|
|
13805
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${
|
|
13882
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${iv(s, o, n)}">${e}</a>`
|
|
13806
13883
|
});
|
|
13807
13884
|
}
|
|
13808
13885
|
break;
|
|
@@ -13814,12 +13891,12 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13814
13891
|
continue;
|
|
13815
13892
|
}
|
|
13816
13893
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
13817
|
-
|
|
13894
|
+
lv({
|
|
13818
13895
|
inputHtml: i,
|
|
13819
13896
|
originalTransformation: t,
|
|
13820
13897
|
output: { replacements: y },
|
|
13821
13898
|
replacementCounter: ee,
|
|
13822
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${
|
|
13899
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${iv(s, o, n.cid)}">${e}</a>`
|
|
13823
13900
|
});
|
|
13824
13901
|
break;
|
|
13825
13902
|
}
|
|
@@ -13827,7 +13904,7 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13827
13904
|
let { url: t, originalTransformation: n } = e;
|
|
13828
13905
|
if (t === void 0) continue;
|
|
13829
13906
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
13830
|
-
|
|
13907
|
+
lv({
|
|
13831
13908
|
inputHtml: i,
|
|
13832
13909
|
originalTransformation: n,
|
|
13833
13910
|
output: { replacements: y },
|
|
@@ -13839,7 +13916,7 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13839
13916
|
case "internal_article": {
|
|
13840
13917
|
let { definition: t, originalTransformation: n } = e;
|
|
13841
13918
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
13842
|
-
|
|
13919
|
+
lv({
|
|
13843
13920
|
inputHtml: i,
|
|
13844
13921
|
originalTransformation: n,
|
|
13845
13922
|
output: { replacements: y },
|
|
@@ -13851,7 +13928,7 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13851
13928
|
default: c("Link", e);
|
|
13852
13929
|
}
|
|
13853
13930
|
}, { count: te + 1 });
|
|
13854
|
-
let ne = h.timeSync("applyHtmlReplacements", () =>
|
|
13931
|
+
let ne = h.timeSync("applyHtmlReplacements", () => cv(i, y), {
|
|
13855
13932
|
count: y.length,
|
|
13856
13933
|
inputSize: i.length
|
|
13857
13934
|
});
|
|
@@ -13863,13 +13940,13 @@ async function ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13863
13940
|
output: y.length === 0 ? null : ne
|
|
13864
13941
|
};
|
|
13865
13942
|
}
|
|
13866
|
-
function
|
|
13943
|
+
function cv(e, t) {
|
|
13867
13944
|
if (t.length === 0) return e;
|
|
13868
13945
|
let n = [], r = 0;
|
|
13869
13946
|
for (let i of t.toSorted((e, t) => e.start - t.start || e.stop - t.stop || e.order - t.order)) i.start < r || (n.push(e.slice(r, i.start)), n.push(i.replacement), r = i.stop);
|
|
13870
13947
|
return n.push(e.slice(r)), n.join("");
|
|
13871
13948
|
}
|
|
13872
|
-
function
|
|
13949
|
+
function lv({ inputHtml: e, originalTransformation: t, output: n, replacementCounter: r, tagHtmlFromOriginal: i }) {
|
|
13873
13950
|
let a = d(t, i(s(e, t, 0) ?? ""));
|
|
13874
13951
|
n.replacements.push({
|
|
13875
13952
|
order: r.value++,
|
|
@@ -13878,11 +13955,11 @@ function nv({ inputHtml: e, originalTransformation: t, output: n, replacementCou
|
|
|
13878
13955
|
stop: t.position.stop
|
|
13879
13956
|
});
|
|
13880
13957
|
}
|
|
13881
|
-
function
|
|
13958
|
+
function uv({ attributes: e, inputHtml: t, originalTransformation: n, outputByType: r, replacementCounter: i }) {
|
|
13882
13959
|
let a = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
13883
13960
|
for (let e of ["links", "links_or_references"]) {
|
|
13884
13961
|
let o = r[e];
|
|
13885
|
-
o !== void 0 &&
|
|
13962
|
+
o !== void 0 && lv({
|
|
13886
13963
|
inputHtml: t,
|
|
13887
13964
|
originalTransformation: n,
|
|
13888
13965
|
output: o,
|
|
@@ -13891,11 +13968,11 @@ function rv({ attributes: e, inputHtml: t, originalTransformation: n, outputByTy
|
|
|
13891
13968
|
});
|
|
13892
13969
|
}
|
|
13893
13970
|
}
|
|
13894
|
-
function
|
|
13971
|
+
function dv({ id: e, outputByType: t }) {
|
|
13895
13972
|
return t.references !== void 0 || e === void 0 && t.links_or_references !== void 0;
|
|
13896
13973
|
}
|
|
13897
|
-
async function
|
|
13898
|
-
let h =
|
|
13974
|
+
async function fv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, htmlTransformation: a, inputHtml: o, linkBaseUrl: s, linkType: l, logIgnoredReferencesTypes: u, logPartialReferences: d, logReferences: f, outputTypes: p, referredLegifranceTextsInfos: m }) {
|
|
13975
|
+
let h = av(t, e);
|
|
13899
13976
|
await h.preloadTextTitlesInfos();
|
|
13900
13977
|
let g = new n(a.output), _ = {}, v = {};
|
|
13901
13978
|
for (let e of p) v[e] = {
|
|
@@ -13904,7 +13981,7 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13904
13981
|
replacements: []
|
|
13905
13982
|
};
|
|
13906
13983
|
let y = { value: 0 };
|
|
13907
|
-
for await (let e of
|
|
13984
|
+
for await (let e of R_({
|
|
13908
13985
|
legiResolver: h,
|
|
13909
13986
|
context: g,
|
|
13910
13987
|
date: r,
|
|
@@ -13917,7 +13994,7 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13917
13994
|
case "article_definition": {
|
|
13918
13995
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
13919
13996
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
13920
|
-
for (let e of Object.values(v))
|
|
13997
|
+
for (let e of Object.values(v)) lv({
|
|
13921
13998
|
inputHtml: o,
|
|
13922
13999
|
originalTransformation: n,
|
|
13923
14000
|
output: e,
|
|
@@ -13929,10 +14006,10 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13929
14006
|
case "external_article": {
|
|
13930
14007
|
let { article: t, articleId: n, originalTransformation: r } = e;
|
|
13931
14008
|
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
13932
|
-
if (n !== void 0 && (
|
|
14009
|
+
if (n !== void 0 && (uv({
|
|
13933
14010
|
attributes: {
|
|
13934
14011
|
class: "lien_article_externe",
|
|
13935
|
-
href:
|
|
14012
|
+
href: iv(l, s, n)
|
|
13936
14013
|
},
|
|
13937
14014
|
inputHtml: o,
|
|
13938
14015
|
originalTransformation: r,
|
|
@@ -13942,14 +14019,14 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13942
14019
|
let e = await h.getTextIdFromSegmentId(n);
|
|
13943
14020
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
13944
14021
|
}
|
|
13945
|
-
|
|
14022
|
+
dv({
|
|
13946
14023
|
id: n,
|
|
13947
14024
|
outputByType: v
|
|
13948
|
-
}) &&
|
|
14025
|
+
}) && pv({
|
|
13949
14026
|
attributes: {
|
|
13950
14027
|
class: "reference_article",
|
|
13951
14028
|
style: "background-color: #eae462",
|
|
13952
|
-
title:
|
|
14029
|
+
title: ov(t, e.reference)
|
|
13953
14030
|
},
|
|
13954
14031
|
id: n,
|
|
13955
14032
|
inputHtml: o,
|
|
@@ -13962,10 +14039,10 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13962
14039
|
case "external_division": {
|
|
13963
14040
|
let { division: t, originalTransformation: n, sectionTaId: r } = e;
|
|
13964
14041
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
13965
|
-
if (r !== void 0 && (
|
|
14042
|
+
if (r !== void 0 && (uv({
|
|
13966
14043
|
attributes: {
|
|
13967
14044
|
class: "lien_division_externe",
|
|
13968
|
-
href:
|
|
14045
|
+
href: iv(l, s, r)
|
|
13969
14046
|
},
|
|
13970
14047
|
inputHtml: o,
|
|
13971
14048
|
originalTransformation: n,
|
|
@@ -13975,14 +14052,14 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13975
14052
|
let e = await h.getTextIdFromSegmentId(r);
|
|
13976
14053
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
13977
14054
|
}
|
|
13978
|
-
|
|
14055
|
+
dv({
|
|
13979
14056
|
id: r,
|
|
13980
14057
|
outputByType: v
|
|
13981
|
-
}) &&
|
|
14058
|
+
}) && pv({
|
|
13982
14059
|
attributes: {
|
|
13983
14060
|
class: "reference_division",
|
|
13984
14061
|
style: "background-color: #eae462",
|
|
13985
|
-
title:
|
|
14062
|
+
title: ov(t, e.reference)
|
|
13986
14063
|
},
|
|
13987
14064
|
id: r,
|
|
13988
14065
|
inputHtml: o,
|
|
@@ -13995,7 +14072,7 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
13995
14072
|
case "european_text": {
|
|
13996
14073
|
let { url: t, originalTransformation: n, text: r, titleId: i } = e;
|
|
13997
14074
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
13998
|
-
|
|
14075
|
+
uv({
|
|
13999
14076
|
attributes: {
|
|
14000
14077
|
class: "lien_texte_european",
|
|
14001
14078
|
href: t,
|
|
@@ -14005,14 +14082,14 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14005
14082
|
originalTransformation: n,
|
|
14006
14083
|
outputByType: v,
|
|
14007
14084
|
replacementCounter: y
|
|
14008
|
-
}),
|
|
14085
|
+
}), dv({
|
|
14009
14086
|
id: i,
|
|
14010
14087
|
outputByType: v
|
|
14011
|
-
}) &&
|
|
14088
|
+
}) && pv({
|
|
14012
14089
|
attributes: {
|
|
14013
14090
|
class: "reference_texte",
|
|
14014
14091
|
style: "background-color: #eae462",
|
|
14015
|
-
title:
|
|
14092
|
+
title: ov(r, e.reference)
|
|
14016
14093
|
},
|
|
14017
14094
|
id: i,
|
|
14018
14095
|
inputHtml: o,
|
|
@@ -14025,23 +14102,23 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14025
14102
|
case "external_text": {
|
|
14026
14103
|
let { originalTransformation: t, text: n } = e;
|
|
14027
14104
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14028
|
-
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (
|
|
14105
|
+
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (uv({
|
|
14029
14106
|
attributes: {
|
|
14030
14107
|
class: "lien_texte_externe",
|
|
14031
|
-
href:
|
|
14108
|
+
href: iv(l, s, n.cid)
|
|
14032
14109
|
},
|
|
14033
14110
|
inputHtml: o,
|
|
14034
14111
|
originalTransformation: t,
|
|
14035
14112
|
outputByType: v,
|
|
14036
14113
|
replacementCounter: y
|
|
14037
|
-
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)),
|
|
14114
|
+
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)), dv({
|
|
14038
14115
|
id: n.cid,
|
|
14039
14116
|
outputByType: v
|
|
14040
|
-
}) &&
|
|
14117
|
+
}) && pv({
|
|
14041
14118
|
attributes: {
|
|
14042
14119
|
class: "reference_texte",
|
|
14043
14120
|
style: "background-color: #eae462",
|
|
14044
|
-
title:
|
|
14121
|
+
title: ov(n, e.reference)
|
|
14045
14122
|
},
|
|
14046
14123
|
id: n.cid,
|
|
14047
14124
|
inputHtml: o,
|
|
@@ -14054,7 +14131,7 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14054
14131
|
case "internal_article": {
|
|
14055
14132
|
let { definition: t, originalTransformation: n } = e;
|
|
14056
14133
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14057
|
-
for (let e of Object.values(v))
|
|
14134
|
+
for (let e of Object.values(v)) lv({
|
|
14058
14135
|
inputHtml: o,
|
|
14059
14136
|
originalTransformation: n,
|
|
14060
14137
|
output: e,
|
|
@@ -14065,18 +14142,18 @@ async function av({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14065
14142
|
}
|
|
14066
14143
|
default: c("Link", e);
|
|
14067
14144
|
}
|
|
14068
|
-
for (let e of Object.values(v)) e.html =
|
|
14145
|
+
for (let e of Object.values(v)) e.html = cv(o, e.replacements);
|
|
14069
14146
|
return {
|
|
14070
14147
|
outputByType: v,
|
|
14071
14148
|
referredLegifranceTextCountByCid: _
|
|
14072
14149
|
};
|
|
14073
14150
|
}
|
|
14074
|
-
function
|
|
14151
|
+
function pv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, outputByType: i, replacementCounter: a }) {
|
|
14075
14152
|
let o = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14076
14153
|
for (let e of ["links_or_references", "references"]) {
|
|
14077
14154
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
14078
14155
|
let s = i[e];
|
|
14079
|
-
s !== void 0 &&
|
|
14156
|
+
s !== void 0 && lv({
|
|
14080
14157
|
inputHtml: n,
|
|
14081
14158
|
originalTransformation: r,
|
|
14082
14159
|
output: s,
|
|
@@ -14086,4 +14163,4 @@ function ov({ attributes: e, id: t, inputHtml: n, originalTransformation: r, out
|
|
|
14086
14163
|
}
|
|
14087
14164
|
}
|
|
14088
14165
|
//#endregion
|
|
14089
|
-
export { Wp as $,
|
|
14166
|
+
export { Wp as $, Lm as A, O as At, dm as B, ft as Bt, Km as C, Rt as Ct, Bm as D, ht as Dt, Vm as E, mt as Et, Mm as F, rt as Ft, Kp as G, um as H, lt as Ht, wm as I, it as It, Gp as J, qp as K, Sm as L, at as Lt, zm as M, tt as Mt, Nm as N, nt as Nt, Pm as O, _t as Ot, jm as P, ot as Pt, bp as Q, bm as R, ut as Rt, Oh as S, Dt as St, Um as T, Ot as Tt, im as U, ct as Ut, fm as V, st as Vt, $ as W, Rp as X, jp as Y, yp as Z, Jh as _, qt as _t, ev as a, wn as at, Hh as b, Bt as bt, nv as c, fn as ct, L_ as d, rn as dt, dp as et, C_ as f, an as ft, w_ as g, Xt as gt, j_ as h, Qt as ht, iv as i, xn as it, Rm as j, xt as jt, Fm as k, D as kt, R_ as l, un as lt, T_ as m, sn as mt, sv as n, _n as nt, tv as o, pn as ot, M_ as p, nn as pt, Zp as q, rv as r, vn as rt, $_ as s, gn as st, fv as t, Tn as tt, Q_ as u, tn as ut, Uh as v, Jt as vt, Hm as w, zt as wt, kh as x, Vt as xt, Wh as y, Yt as yt, pm as z, dt as zt };
|