@tricoteuses/tisseuse 0.12.5 → 0.12.6
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.
|
@@ -1266,32 +1266,50 @@ var Oe = class {
|
|
|
1266
1266
|
}, Ne = (e, { value: t } = {}) => (n) => {
|
|
1267
1267
|
let r = e, i = n.offset, a = /([\-\/\d\p{Alphabetic}'°]+)($|[^\-\/\d\p{Alphabetic}°]{1,10000})/gvy;
|
|
1268
1268
|
a.lastIndex = n.offset;
|
|
1269
|
-
let o = [], s;
|
|
1269
|
+
let o = [], s, c = (e) => /^[IVX]+$/g.test(e) ? ae(e).toString() : e.toLowerCase().replace(/^no$/, "n°");
|
|
1270
1270
|
for (;;) {
|
|
1271
1271
|
let e = a.exec(n.input);
|
|
1272
1272
|
if (e === null) break;
|
|
1273
|
-
let t = e[1];
|
|
1274
|
-
if (t
|
|
1275
|
-
let
|
|
1276
|
-
if (
|
|
1277
|
-
|
|
1273
|
+
let t = c(e[1]);
|
|
1274
|
+
if (t === "constitution" && e[1][0] !== "C") break;
|
|
1275
|
+
let l = r[t];
|
|
1276
|
+
if (l === void 0) {
|
|
1277
|
+
let u = a.lastIndex, d = Object.entries(r).filter(([e]) => e !== "cid" && e.includes(" ")).sort((e, t) => t[0].length - e[0].length).find(([e]) => {
|
|
1278
|
+
let r = e.split(" ");
|
|
1279
|
+
if (r[0] !== t) return !1;
|
|
1280
|
+
a.lastIndex = u;
|
|
1281
|
+
for (let e of r.slice(1)) {
|
|
1282
|
+
let t = a.exec(n.input);
|
|
1283
|
+
if (t === null || c(t[1]) !== e) return !1;
|
|
1284
|
+
}
|
|
1285
|
+
return !0;
|
|
1286
|
+
});
|
|
1287
|
+
if (d === void 0) break;
|
|
1288
|
+
l = d[1], a.lastIndex = u;
|
|
1289
|
+
let f = d[0].split(" "), p = [e];
|
|
1290
|
+
for (let e = 1; e < f.length; e++) p.push(a.exec(n.input));
|
|
1291
|
+
for (let e of p) o.push(e[0]);
|
|
1292
|
+
s = p.at(-1)[2], r = l, i = a.lastIndex;
|
|
1293
|
+
continue;
|
|
1294
|
+
}
|
|
1295
|
+
s = e[2], r = l, i = a.lastIndex, o.push(e[0]);
|
|
1278
1296
|
}
|
|
1279
1297
|
if (r.cid === void 0) {
|
|
1280
1298
|
n.length = 0, n.usedInputs = void 0;
|
|
1281
1299
|
return;
|
|
1282
1300
|
}
|
|
1283
1301
|
s && (i -= s.length, o[o.length - 1] = o[o.length - 1].slice(0, -s.length)), n.length = i - n.offset, n.usedInputs = o.length === 0 ? void 0 : o;
|
|
1284
|
-
let
|
|
1285
|
-
if (t === void 0)
|
|
1302
|
+
let l = { cid: r.cid }, u;
|
|
1303
|
+
if (t === void 0) u = l;
|
|
1286
1304
|
else if (typeof t == "function") {
|
|
1287
|
-
let e = t(
|
|
1305
|
+
let e = t(l, n);
|
|
1288
1306
|
if (e === void 0) {
|
|
1289
1307
|
n.length = 0, n.usedInputs = void 0;
|
|
1290
1308
|
return;
|
|
1291
1309
|
}
|
|
1292
|
-
|
|
1293
|
-
} else
|
|
1294
|
-
return n.offset = i, n.length = 0,
|
|
1310
|
+
u = e;
|
|
1311
|
+
} else u = t;
|
|
1312
|
+
return n.offset = i, n.length = 0, u;
|
|
1295
1313
|
};
|
|
1296
1314
|
x(" ?' ?", { value: "'" });
|
|
1297
1315
|
var w = x(" "), Pe = x(" ?", { value: "" }), Fe = x("[a-z]", { flags: "i" }), Ie = x(String.raw`(?=$|\P{Alphabetic})`, { flags: "iv" }), Le = x("n ?[°o] ?", {
|
|
@@ -11074,7 +11092,10 @@ var Lp = _(Ae(x("(modalités|conditions) d'application (de )?", { flags: "i" }),
|
|
|
11074
11092
|
}), x("est supprimée?", {
|
|
11075
11093
|
flags: "i",
|
|
11076
11094
|
value: "supprimer"
|
|
11077
|
-
}))], { value: (e) => ({ action: e[1] }) }))), zp = JSON.parse("{}\n"), Bp =
|
|
11095
|
+
}))], { value: (e) => ({ action: e[1] }) }))), zp = JSON.parse("{}\n"), Bp = Object.fromEntries(Object.entries(zp.textInfosByCid ?? {}).map(([e, t]) => [e, Array.isArray(t) ? {
|
|
11096
|
+
nature: t[0],
|
|
11097
|
+
title: t[1]
|
|
11098
|
+
} : t])), Vp = zp.textCidByOtherTitleWordsTree ?? {}, Hp = zp.textCidByTitleRestWordsTree ?? {}, Up = zp.textsCidsByNatureAndDate ?? {}, Wp = zp.textsCidsByNatureAndNum ?? {}, Gp = (e) => Array.isArray(e) ? e : [e], Kp = y(_(x("Constitution", { value: "CONSTITUTION" }), x("arrêtés?|circulaires?|code professionnel local|code|décret-loi|décrets?|livre(?= des procédures fiscales)|loi constitutionnelle|loi d'orientation quinquennale|loi d'orientation|loi de programme|loi locale|loi organique|loi quinquennale|loi|ordonnance (?:du Roi|locale|ministérielle|royale)|ordonnance", {
|
|
11078
11099
|
flags: "i",
|
|
11079
11100
|
value: (e) => {
|
|
11080
11101
|
let t = e[0].toLowerCase();
|
|
@@ -11083,7 +11104,7 @@ var Lp = _(Ae(x("(modalités|conditions) d'application (de )?", { flags: "i" }),
|
|
|
11083
11104
|
})), { value: (e) => ({
|
|
11084
11105
|
nature: e,
|
|
11085
11106
|
type: "texte"
|
|
11086
|
-
}) }),
|
|
11107
|
+
}) }), qp = v([b(Le, { default: null }), x(String.raw`\d+(-\d+)?`)], { value: (e) => e[1] }), Jp = _(dt, v([qp, b(ft, { default: null })], { value: (e) => e[1] === null ? { num: e[0] } : {
|
|
11087
11108
|
...e[1],
|
|
11088
11109
|
num: e[0]
|
|
11089
11110
|
} }));
|
|
@@ -11095,11 +11116,11 @@ x("décision( du Conseil constitutionnel)? (?<numero>[-/0-9A-Z]+ (QPC|DC|AN|D|EL
|
|
|
11095
11116
|
type: "décision du Conseil constitutionnel"
|
|
11096
11117
|
})
|
|
11097
11118
|
});
|
|
11098
|
-
var
|
|
11099
|
-
|
|
11100
|
-
|
|
11119
|
+
var Yp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", { flags: "i" })), { default: null }), Xp = _(v([
|
|
11120
|
+
Kp,
|
|
11121
|
+
Yp,
|
|
11101
11122
|
w,
|
|
11102
|
-
|
|
11123
|
+
Jp,
|
|
11103
11124
|
x(".*")
|
|
11104
11125
|
], { value: (e) => {
|
|
11105
11126
|
let t = {
|
|
@@ -11108,10 +11129,10 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11108
11129
|
}, n = e[4].trim() || void 0;
|
|
11109
11130
|
return n !== void 0 && (t.titleRest = n), t;
|
|
11110
11131
|
} }), v([
|
|
11111
|
-
|
|
11132
|
+
Kp,
|
|
11112
11133
|
x("[^()]+"),
|
|
11113
11134
|
x(String.raw`\( ?`),
|
|
11114
|
-
|
|
11135
|
+
Jp,
|
|
11115
11136
|
x(String.raw` ?\)`)
|
|
11116
11137
|
], { value: (e) => {
|
|
11117
11138
|
let t = {
|
|
@@ -11128,10 +11149,10 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11128
11149
|
})), x(".+")], { value: (e) => {
|
|
11129
11150
|
let t = { ...e[0] }, n = e[1].trim() || void 0;
|
|
11130
11151
|
return n !== void 0 && (t.titleRest = n), t;
|
|
11131
|
-
} })),
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
b([w,
|
|
11152
|
+
} })), Zp = _(v([
|
|
11153
|
+
Kp,
|
|
11154
|
+
Yp,
|
|
11155
|
+
b([w, Jp], {
|
|
11135
11156
|
default: null,
|
|
11136
11157
|
value: (e) => e[1]
|
|
11137
11158
|
}),
|
|
@@ -11144,7 +11165,7 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11144
11165
|
}),
|
|
11145
11166
|
b([
|
|
11146
11167
|
x(String.raw` ?\( ?`),
|
|
11147
|
-
|
|
11168
|
+
Jp,
|
|
11148
11169
|
x(String.raw` ?\)`)
|
|
11149
11170
|
], {
|
|
11150
11171
|
default: null,
|
|
@@ -11157,11 +11178,17 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11157
11178
|
let s = /* @__PURE__ */ new Set();
|
|
11158
11179
|
if (r !== void 0) {
|
|
11159
11180
|
let e = Up[t]?.[r];
|
|
11160
|
-
e !== void 0
|
|
11181
|
+
if (e !== void 0) {
|
|
11182
|
+
let t = Gp(e);
|
|
11183
|
+
s = s.size === 0 ? new Set(t) : s.intersection(new Set(t));
|
|
11184
|
+
}
|
|
11161
11185
|
}
|
|
11162
11186
|
if (i !== void 0) {
|
|
11163
11187
|
let e = Wp[t]?.[i];
|
|
11164
|
-
e !== void 0
|
|
11188
|
+
if (e !== void 0) {
|
|
11189
|
+
let t = Gp(e);
|
|
11190
|
+
s = s.size === 0 ? new Set(t) : s.intersection(new Set(t));
|
|
11191
|
+
}
|
|
11165
11192
|
}
|
|
11166
11193
|
if (a !== void 0) {
|
|
11167
11194
|
let e = Array.isArray(a) ? a : [a];
|
|
@@ -11184,15 +11211,15 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11184
11211
|
...n ?? {},
|
|
11185
11212
|
type: "texte"
|
|
11186
11213
|
}).filter(([, e]) => e !== void 0));
|
|
11187
|
-
} })),
|
|
11214
|
+
} })), Qp = v([
|
|
11188
11215
|
He,
|
|
11189
11216
|
x("/"),
|
|
11190
11217
|
He,
|
|
11191
11218
|
b(x(" ?/ ?(CEE?)", { value: (e) => e[1] }), { default: "" })
|
|
11192
|
-
], { value: (e) => `${e[0]}/${e[2]}${e[3] ? `/${e[3]}` : ""}` }),
|
|
11219
|
+
], { value: (e) => `${e[0]}/${e[2]}${e[3] ? `/${e[3]}` : ""}` }), $p = v([b(Le, { default: "" }), Qp], { value: (e) => e[1] }), em = _(v([$p, b(ft, { default: null })], { value: (e) => e[1] === null ? { num: e[0] } : {
|
|
11193
11220
|
...e[1],
|
|
11194
11221
|
num: e[0]
|
|
11195
|
-
} }), dt),
|
|
11222
|
+
} }), dt), tm = v([x("arrêtés?|arrêts?|avis|décisions?|déclarations?|délibérations?|directive(?: d'exécution|déléguée)?|informations?|instructions?|lettres?|règlement(?: d'exécution)?", {
|
|
11196
11223
|
flags: "i",
|
|
11197
11224
|
value: (e) => {
|
|
11198
11225
|
let t = e[0].toLowerCase();
|
|
@@ -11202,45 +11229,45 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11202
11229
|
nature: e[0],
|
|
11203
11230
|
legislation: "UE",
|
|
11204
11231
|
type: "texte"
|
|
11205
|
-
}) }),
|
|
11206
|
-
|
|
11232
|
+
}) }), nm = v([
|
|
11233
|
+
tm,
|
|
11207
11234
|
w,
|
|
11208
|
-
|
|
11235
|
+
em
|
|
11209
11236
|
], { value: (e) => ({
|
|
11210
11237
|
...e[2],
|
|
11211
11238
|
...e[0]
|
|
11212
|
-
}) }),
|
|
11239
|
+
}) }), rm = x("convention", {
|
|
11213
11240
|
flags: "i",
|
|
11214
11241
|
value: {
|
|
11215
11242
|
nature: "CONVENTION",
|
|
11216
11243
|
legislation: "international",
|
|
11217
11244
|
type: "texte"
|
|
11218
11245
|
}
|
|
11219
|
-
}),
|
|
11246
|
+
}), im = v([b(Ht, { default: !1 }), _(v([
|
|
11220
11247
|
Qt,
|
|
11221
11248
|
w,
|
|
11222
|
-
_(
|
|
11249
|
+
_(Zp, nm, rm, Kp, tm)
|
|
11223
11250
|
], { value: (e) => ({
|
|
11224
11251
|
...e[2],
|
|
11225
11252
|
...e[0] === void 0 ? {} : e[0]
|
|
11226
|
-
}) }),
|
|
11253
|
+
}) }), Zp, nm, rm)], { value: (e, t) => {
|
|
11227
11254
|
let n = {
|
|
11228
11255
|
...e[1],
|
|
11229
11256
|
...e[0] ? { ofTheSaid: !0 } : {},
|
|
11230
11257
|
position: t.position()
|
|
11231
11258
|
};
|
|
11232
11259
|
return t.currentText = n, n;
|
|
11233
|
-
} }),
|
|
11260
|
+
} }), am = _(Nn, qn), om = _(Fn, Wn, im), sm = v([am, S(v([Bt, om], { value: (e) => e[1] }))], { value: (e, t) => Mt(e[0], e[1], t.position()) }), cm = v([om, S(v([Bt, om], { value: (e) => e[1] }))], { value: (e, t) => Mt(e[0], e[1], t.position()) }), lm = v([zt, sm], { value: (e) => e[1] }), um = _(v([Bt, cm], { value: (e) => e[1] }), lm), dm = _(v([yn, b(um, { default: null })], { value: (e) => {
|
|
11234
11261
|
let t = e[0], n = e[1];
|
|
11235
11262
|
return n === null ? t : kt(n, t);
|
|
11236
|
-
} }),
|
|
11263
|
+
} }), sm), fm = _(v([bn, b(um, { default: null })], { value: (e) => {
|
|
11237
11264
|
let t = e[0], n = e[1];
|
|
11238
11265
|
return n === null ? t : kt(n, t);
|
|
11239
|
-
} }),
|
|
11266
|
+
} }), cm), pm = v([
|
|
11240
11267
|
b(Lp, { default: null }),
|
|
11241
11268
|
v([
|
|
11242
11269
|
Lt,
|
|
11243
|
-
|
|
11270
|
+
dm,
|
|
11244
11271
|
b([b(x(" modifiée?s", { flags: "i" }), { default: "" }), x(" susvisée?s", { flags: "i" })], { default: "" })
|
|
11245
11272
|
], { value: (e, t) => ({
|
|
11246
11273
|
...e[1],
|
|
@@ -11255,11 +11282,11 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11255
11282
|
reference: e[1],
|
|
11256
11283
|
type: "reference_et_action"
|
|
11257
11284
|
};
|
|
11258
|
-
} }),
|
|
11285
|
+
} }), mm = _(v([
|
|
11259
11286
|
b(Lp, { default: null }),
|
|
11260
11287
|
v([
|
|
11261
11288
|
Rt,
|
|
11262
|
-
|
|
11289
|
+
fm,
|
|
11263
11290
|
b([b(x(" modifiée?", { flags: "i" }), { default: "" }), x(" susvisée?", { flags: "i" })], { default: "" }),
|
|
11264
11291
|
b(x(String.raw`, ?qui devient [^,]+ ","`, { flags: "i" }), { default: "" })
|
|
11265
11292
|
], { value: (e, t) => ({
|
|
@@ -11275,19 +11302,19 @@ var Jp = b(_(x(" de la République française", { flags: "i" }), x(" du pays", {
|
|
|
11275
11302
|
reference: e[1],
|
|
11276
11303
|
type: "reference_et_action"
|
|
11277
11304
|
};
|
|
11278
|
-
} }),
|
|
11305
|
+
} }), pm), hm = ke("article|loi|décret|code|alinéa|phrase|chapitre|titre|livre|partie|section|paragraphe|ordonnance|constitution|directive|règlement|\\d|[ivxlc]+|[a-zA-Z]", v([mm, S([_(en, $t), mm])], { value: (e, t) => At(e[0], e[1], t.position()) })), gm = y(fm, { value: (e, t) => ({
|
|
11279
11306
|
...e,
|
|
11280
11307
|
position: t.position()
|
|
11281
|
-
}) }),
|
|
11308
|
+
}) }), _m = _(S(gm, {
|
|
11282
11309
|
min: 2,
|
|
11283
11310
|
separator: ze,
|
|
11284
11311
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
11285
|
-
}), S(
|
|
11312
|
+
}), S(gm, {
|
|
11286
11313
|
min: 2,
|
|
11287
11314
|
separator: x(String.raw`\n`),
|
|
11288
11315
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
11289
|
-
}), y(
|
|
11290
|
-
function
|
|
11316
|
+
}), y(gm, { value: (e) => [e] })), vm = /^<\/?(!DOCTYPE|\?XML|[A-Z][A-Z0-9]*)/i;
|
|
11317
|
+
function ym(e, t) {
|
|
11291
11318
|
return (n) => {
|
|
11292
11319
|
let r = [], i = n;
|
|
11293
11320
|
for (let e of t) {
|
|
@@ -11302,16 +11329,16 @@ function vm(e, t) {
|
|
|
11302
11329
|
};
|
|
11303
11330
|
};
|
|
11304
11331
|
}
|
|
11305
|
-
function*
|
|
11332
|
+
function* bm(e) {
|
|
11306
11333
|
if (e.transformations === void 0) yield e;
|
|
11307
|
-
else for (let t of e.transformations) yield*
|
|
11334
|
+
else for (let t of e.transformations) yield* bm(t);
|
|
11308
11335
|
}
|
|
11309
|
-
function*
|
|
11310
|
-
let t = [...
|
|
11336
|
+
function* xm(e) {
|
|
11337
|
+
let t = [...bm(e)].reverse(), n = { position: {
|
|
11311
11338
|
start: 0,
|
|
11312
11339
|
stop: 0
|
|
11313
11340
|
} }, r = t.map((e) => {
|
|
11314
|
-
let t =
|
|
11341
|
+
let t = Sm(e);
|
|
11315
11342
|
return t.next(n), t;
|
|
11316
11343
|
}), i = yield n;
|
|
11317
11344
|
for (; i !== void 0;) {
|
|
@@ -11325,7 +11352,7 @@ function* bm(e) {
|
|
|
11325
11352
|
}
|
|
11326
11353
|
for (let e of r) e.next(void 0);
|
|
11327
11354
|
}
|
|
11328
|
-
function*
|
|
11355
|
+
function* Sm(e) {
|
|
11329
11356
|
let t = yield { position: {
|
|
11330
11357
|
start: 0,
|
|
11331
11358
|
stop: 0
|
|
@@ -11364,7 +11391,7 @@ function* xm(e) {
|
|
|
11364
11391
|
if (i + 1 < d) {
|
|
11365
11392
|
let r = !1, o = n[i + 1];
|
|
11366
11393
|
if (o.openingTag !== void 0 && o.outputIndex + o.outputLength < e.start) {
|
|
11367
|
-
let e = o.openingTag.match(
|
|
11394
|
+
let e = o.openingTag.match(vm);
|
|
11368
11395
|
if (e !== null) {
|
|
11369
11396
|
let t = e[1], n = t.toUpperCase();
|
|
11370
11397
|
[
|
|
@@ -11389,7 +11416,7 @@ function* xm(e) {
|
|
|
11389
11416
|
if (i + 1 > f) {
|
|
11390
11417
|
let a = !1, s = n[r], l = n[i + 1];
|
|
11391
11418
|
if (s.openingTag !== void 0 && e.stop < l.outputIndex) {
|
|
11392
|
-
let e = s.openingTag.match(
|
|
11419
|
+
let e = s.openingTag.match(vm);
|
|
11393
11420
|
if (e !== null) {
|
|
11394
11421
|
let t = e[1], n = t.toUpperCase();
|
|
11395
11422
|
[
|
|
@@ -11429,19 +11456,19 @@ function* xm(e) {
|
|
|
11429
11456
|
}).filter(([, e]) => e !== void 0));
|
|
11430
11457
|
}
|
|
11431
11458
|
}
|
|
11432
|
-
function
|
|
11433
|
-
let t =
|
|
11459
|
+
function Cm(e) {
|
|
11460
|
+
let t = xm(e);
|
|
11434
11461
|
return t.next({
|
|
11435
11462
|
start: 0,
|
|
11436
11463
|
stop: 0
|
|
11437
11464
|
}), t;
|
|
11438
11465
|
}
|
|
11439
|
-
function
|
|
11466
|
+
function wm(e, t) {
|
|
11440
11467
|
let n = t.map((e) => [e]);
|
|
11441
|
-
for (let { sourceMap: t } of [...
|
|
11468
|
+
for (let { sourceMap: t } of [...bm(e)].reverse()) n = Tm(t, n);
|
|
11442
11469
|
return n;
|
|
11443
11470
|
}
|
|
11444
|
-
function
|
|
11471
|
+
function Tm(e, t) {
|
|
11445
11472
|
let n = [];
|
|
11446
11473
|
e = [
|
|
11447
11474
|
{
|
|
@@ -11506,50 +11533,50 @@ function wm(e, t) {
|
|
|
11506
11533
|
}
|
|
11507
11534
|
return n;
|
|
11508
11535
|
}
|
|
11509
|
-
function Tm(e, t) {
|
|
11510
|
-
let n = Sm(e);
|
|
11511
|
-
return t.map((e) => Em(n, e));
|
|
11512
|
-
}
|
|
11513
11536
|
function Em(e, t) {
|
|
11537
|
+
let n = Cm(e);
|
|
11538
|
+
return t.map((e) => Dm(n, e));
|
|
11539
|
+
}
|
|
11540
|
+
function Dm(e, t) {
|
|
11514
11541
|
let n = e.next(t);
|
|
11515
11542
|
if (n.done) throw Error(`Reverse transformation of position failed: ${t}`);
|
|
11516
11543
|
return n.value;
|
|
11517
11544
|
}
|
|
11518
|
-
var
|
|
11545
|
+
var Om = (e, t, n = 0) => t === void 0 ? e : (t.innerPrefix ?? "") + e.slice(t.position.start + n, t.position.stop + n) + (t.innerSuffix ?? ""), km = (e, t) => (e.outerPrefix ?? "") + t + (e.outerSuffix ?? "");
|
|
11519
11546
|
//#endregion
|
|
11520
11547
|
//#region src/lib/extractors/references.ts
|
|
11521
|
-
function*
|
|
11522
|
-
let n = Ip(e, t), r = new Oe(n.output), i =
|
|
11523
|
-
for (let e of
|
|
11548
|
+
function* Am(e, t) {
|
|
11549
|
+
let n = Ip(e, t), r = new Oe(n.output), i = Cm(n);
|
|
11550
|
+
for (let e of jm(r)) {
|
|
11524
11551
|
e = structuredClone(e), t.references === void 0 && (t.references = []), t.references.push(e);
|
|
11525
11552
|
for (let t of It(e)) {
|
|
11526
11553
|
let e = t.position;
|
|
11527
|
-
e !== void 0 && (t.position =
|
|
11554
|
+
e !== void 0 && (t.position = Dm(i, e).position);
|
|
11528
11555
|
}
|
|
11529
11556
|
yield e;
|
|
11530
11557
|
}
|
|
11531
11558
|
}
|
|
11532
|
-
function*
|
|
11533
|
-
let t = ke(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+`, _(Fp, En, Bn,
|
|
11534
|
-
for (let n of t.extract(e, { overlapWindow: 80 })) if (n !== void 0) if (n.type === "citation") yield*
|
|
11559
|
+
function* jm(e) {
|
|
11560
|
+
let t = ke(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+`, _(Fp, En, Bn, hm), 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+)(?=\b| |$)`);
|
|
11561
|
+
for (let n of t.extract(e, { overlapWindow: 80 })) if (n !== void 0) if (n.type === "citation") yield* Am(e, n);
|
|
11535
11562
|
else {
|
|
11536
11563
|
if (n.type === "reference_et_action" || n.type === "alinéa" || n.type === "article" || n.type === "chapitre" || n.type === "item" || n.type === "livre" || n.type === "paragraphe" || n.type === "partie" || n.type === "phrase" || n.type === "section" || n.type === "sous-paragraphe" || n.type === "sous-section" || n.type === "sous-sous-paragraphe" || n.type === "sous-titre" || n.type === "titre" || n.type === "texte" || n.type === "bounded-interval" || n.type === "counted-interval" || n.type === "enumeration" || n.type === "exclusion" || n.type === "parent-enfant" || n.type === "incomplete-header") {
|
|
11537
11564
|
for (let t of It(n)) if (t.type === "reference_et_action") {
|
|
11538
11565
|
let { originalCitations: n } = t.action;
|
|
11539
|
-
if (n !== void 0) for (let t of n) for (let n of
|
|
11566
|
+
if (n !== void 0) for (let t of n) for (let n of Am(e, t));
|
|
11540
11567
|
}
|
|
11541
11568
|
}
|
|
11542
11569
|
yield n;
|
|
11543
11570
|
}
|
|
11544
11571
|
}
|
|
11545
|
-
function*
|
|
11546
|
-
let n =
|
|
11547
|
-
for (let t of
|
|
11548
|
-
for (let e of It(t, { citations: !0 })) e.position !== void 0 && (e.originalTransformation =
|
|
11572
|
+
function* Mm(e, t) {
|
|
11573
|
+
let n = Cm(t);
|
|
11574
|
+
for (let t of jm(e)) {
|
|
11575
|
+
for (let e of It(t, { citations: !0 })) e.position !== void 0 && (e.originalTransformation = Dm(n, e.position));
|
|
11549
11576
|
yield t;
|
|
11550
11577
|
}
|
|
11551
11578
|
}
|
|
11552
|
-
var
|
|
11579
|
+
var Nm = (e) => [...jm(e)], Pm = (e, t) => [...Mm(e, t)], Fm = {
|
|
11553
11580
|
amp: "&",
|
|
11554
11581
|
apos: "'",
|
|
11555
11582
|
asymp: "≈",
|
|
@@ -11567,7 +11594,7 @@ var Mm = (e) => [...Am(e)], Nm = (e, t) => [...jm(e, t)], Pm = {
|
|
|
11567
11594
|
reg: "®",
|
|
11568
11595
|
trade: "™"
|
|
11569
11596
|
};
|
|
11570
|
-
function
|
|
11597
|
+
function Im({ removeAWithHref: e } = {}) {
|
|
11571
11598
|
return (t) => {
|
|
11572
11599
|
let n = 0, r = 0, i = [], a = [], o = [], s = "Conversion des éléments HTML en texte";
|
|
11573
11600
|
for (; n < t.length;) {
|
|
@@ -11585,7 +11612,7 @@ function Fm({ removeAWithHref: e } = {}) {
|
|
|
11585
11612
|
sourceMap: a,
|
|
11586
11613
|
title: s
|
|
11587
11614
|
};
|
|
11588
|
-
let u = t.slice(c, l + 1), d = u.startsWith("</"), f = u.length, p = u.match(
|
|
11615
|
+
let u = t.slice(c, l + 1), d = u.startsWith("</"), f = u.length, p = u.match(vm);
|
|
11589
11616
|
if (p === null) {
|
|
11590
11617
|
i.push(t.slice(n, l + 1).replace(/[\n\r]/g, " ")), n = l + 1;
|
|
11591
11618
|
continue;
|
|
@@ -11762,12 +11789,12 @@ function Fm({ removeAWithHref: e } = {}) {
|
|
|
11762
11789
|
};
|
|
11763
11790
|
};
|
|
11764
11791
|
}
|
|
11765
|
-
function
|
|
11792
|
+
function Lm(e) {
|
|
11766
11793
|
let t = 0, n = [];
|
|
11767
11794
|
return {
|
|
11768
11795
|
input: e,
|
|
11769
11796
|
output: e.replace(/&(amp|apos|asymp|copy|deg|euro|gt|lt|mdash|nbsp|ndash|ne|pound|quot|reg|trade);/gi, (e, r, i) => {
|
|
11770
|
-
let a =
|
|
11797
|
+
let a = Fm[r.toLowerCase()];
|
|
11771
11798
|
return n.push({
|
|
11772
11799
|
inputIndex: i,
|
|
11773
11800
|
inputLength: e.length,
|
|
@@ -11779,7 +11806,7 @@ function Im(e) {
|
|
|
11779
11806
|
title: "Décodage des entités HTML nommées"
|
|
11780
11807
|
};
|
|
11781
11808
|
}
|
|
11782
|
-
function
|
|
11809
|
+
function Rm(e) {
|
|
11783
11810
|
let t = 0, n = [];
|
|
11784
11811
|
return {
|
|
11785
11812
|
input: e,
|
|
@@ -11796,14 +11823,14 @@ function Lm(e) {
|
|
|
11796
11823
|
title: "Décodage des entités HTML numériques"
|
|
11797
11824
|
};
|
|
11798
11825
|
}
|
|
11799
|
-
function
|
|
11826
|
+
function zm(e) {
|
|
11800
11827
|
let t = [], n = e;
|
|
11801
11828
|
for (let [e, r] of [
|
|
11802
11829
|
[/<!--.*?-->/gs, ""],
|
|
11803
11830
|
[/<script.*?>.*?<\/script>/gis, ""],
|
|
11804
11831
|
[/<style.*?>.*?<\/style>/gis, ""]
|
|
11805
11832
|
]) {
|
|
11806
|
-
let i =
|
|
11833
|
+
let i = Bm(e, r)(n);
|
|
11807
11834
|
i.sourceMap.length !== 0 && (t.push(i), n = i.output);
|
|
11808
11835
|
}
|
|
11809
11836
|
return {
|
|
@@ -11813,7 +11840,7 @@ function Rm(e) {
|
|
|
11813
11840
|
transformations: t
|
|
11814
11841
|
};
|
|
11815
11842
|
}
|
|
11816
|
-
function
|
|
11843
|
+
function Bm(e, t) {
|
|
11817
11844
|
return (n) => {
|
|
11818
11845
|
let r = [], i = n.replaceAll(e, (e, ...n) => {
|
|
11819
11846
|
let i = n.at(-2), a = t;
|
|
@@ -11833,14 +11860,14 @@ function zm(e, t) {
|
|
|
11833
11860
|
};
|
|
11834
11861
|
};
|
|
11835
11862
|
}
|
|
11836
|
-
function
|
|
11863
|
+
function Vm(e) {
|
|
11837
11864
|
let t = [], n = e;
|
|
11838
11865
|
for (let [e, r] of [
|
|
11839
11866
|
[/(\sn°)([^\s])/gi, "$1 $2"],
|
|
11840
11867
|
[/[\u200E\u200F]/g, ""],
|
|
11841
11868
|
[/[\uF031-\uF039\uF041-\uF054\uF061-\uF06A]/g, ""]
|
|
11842
11869
|
]) {
|
|
11843
|
-
let i =
|
|
11870
|
+
let i = Bm(e, r)(n);
|
|
11844
11871
|
i.sourceMap.length !== 0 && (t.push(i), n = i.output);
|
|
11845
11872
|
}
|
|
11846
11873
|
return {
|
|
@@ -11850,25 +11877,25 @@ function Bm(e) {
|
|
|
11850
11877
|
transformations: t
|
|
11851
11878
|
};
|
|
11852
11879
|
}
|
|
11853
|
-
function
|
|
11854
|
-
return (t) =>
|
|
11855
|
-
Im,
|
|
11880
|
+
function Hm({ removeAWithHref: e } = {}) {
|
|
11881
|
+
return (t) => ym("Simplification du HTML", [
|
|
11856
11882
|
Lm,
|
|
11857
11883
|
Rm,
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11884
|
+
zm,
|
|
11885
|
+
Vm,
|
|
11886
|
+
Gm,
|
|
11887
|
+
Im({ removeAWithHref: e }),
|
|
11888
|
+
Wm
|
|
11862
11889
|
])(t);
|
|
11863
11890
|
}
|
|
11864
|
-
function
|
|
11865
|
-
return
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11891
|
+
function Um(e) {
|
|
11892
|
+
return ym("Simplification du texte brut", [
|
|
11893
|
+
Vm,
|
|
11894
|
+
Gm,
|
|
11895
|
+
Wm
|
|
11869
11896
|
])(e);
|
|
11870
11897
|
}
|
|
11871
|
-
function
|
|
11898
|
+
function Wm(e) {
|
|
11872
11899
|
let t = [], n = e;
|
|
11873
11900
|
for (let [e, r, i] of [
|
|
11874
11901
|
[
|
|
@@ -11926,7 +11953,7 @@ function Um(e) {
|
|
|
11926
11953
|
transformations: t
|
|
11927
11954
|
};
|
|
11928
11955
|
}
|
|
11929
|
-
function
|
|
11956
|
+
function Gm(e) {
|
|
11930
11957
|
let t = [], n = e;
|
|
11931
11958
|
for (let [e, r] of [
|
|
11932
11959
|
[/[ \t]/g, " "],
|
|
@@ -11953,10 +11980,10 @@ function Wm(e) {
|
|
|
11953
11980
|
}
|
|
11954
11981
|
//#endregion
|
|
11955
11982
|
//#region src/lib/extractors/links.ts
|
|
11956
|
-
async function*
|
|
11957
|
-
let c = {}, l = s === void 0 ? void 0 :
|
|
11958
|
-
for (let t of s === void 0 ?
|
|
11959
|
-
for (let t of d) for (let n of
|
|
11983
|
+
async function* Km({ context: e, date: t, canutesDb: n, logIgnoredReferencesTypes: r, logPartialReferences: i, logReferences: a, state: o, transformation: s }) {
|
|
11984
|
+
let c = {}, l = s === void 0 ? void 0 : Cm(s), u = o === void 0 ? {} : structuredClone(o), d = [];
|
|
11985
|
+
for (let t of s === void 0 ? jm(e) : Mm(e, s)) a && console.log(`In "${e.input.slice(t.position.start, t.position.stop)}": \nReference "${e.text(t.position)}": ${JSON.stringify(t, null, 2)}`), d.push(t);
|
|
11986
|
+
for (let t of d) for (let n of Ym(e, t)) {
|
|
11960
11987
|
let a = n.type === "parent-enfant" ? n.parent : n;
|
|
11961
11988
|
switch (a.type) {
|
|
11962
11989
|
case "alinéa":
|
|
@@ -11986,7 +12013,7 @@ async function* Gm({ context: e, date: t, canutesDb: n, logIgnoredReferencesType
|
|
|
11986
12013
|
a.definition && u.textId === void 0 && i && console.log(`In "${e.input.slice(t.position.start, t.position.stop)}": Missing state.textId for division definition`);
|
|
11987
12014
|
break;
|
|
11988
12015
|
case "texte":
|
|
11989
|
-
|
|
12016
|
+
qm({
|
|
11990
12017
|
context: e,
|
|
11991
12018
|
logPartialReferences: i,
|
|
11992
12019
|
reference: t,
|
|
@@ -11998,7 +12025,7 @@ async function* Gm({ context: e, date: t, canutesDb: n, logIgnoredReferencesType
|
|
|
11998
12025
|
}
|
|
11999
12026
|
}
|
|
12000
12027
|
u = o === void 0 ? {} : o;
|
|
12001
|
-
for (let a of d) yield*
|
|
12028
|
+
for (let a of d) yield* $m({
|
|
12002
12029
|
articleDefinitionByNumByTextId: c,
|
|
12003
12030
|
canutesDb: n,
|
|
12004
12031
|
context: e,
|
|
@@ -12010,7 +12037,7 @@ async function* Gm({ context: e, date: t, canutesDb: n, logIgnoredReferencesType
|
|
|
12010
12037
|
state: u
|
|
12011
12038
|
});
|
|
12012
12039
|
}
|
|
12013
|
-
function
|
|
12040
|
+
function qm({ context: e, logPartialReferences: t, reference: n, state: r, text: i }) {
|
|
12014
12041
|
switch (i.nature) {
|
|
12015
12042
|
case "ARRETE":
|
|
12016
12043
|
case "CIRCULAIRE":
|
|
@@ -12080,7 +12107,7 @@ function Km({ context: e, logPartialReferences: t, reference: n, state: r, text:
|
|
|
12080
12107
|
default: i.nature === void 0 ? delete r.textId : _e("nature", i.nature);
|
|
12081
12108
|
}
|
|
12082
12109
|
}
|
|
12083
|
-
async function*
|
|
12110
|
+
async function* Jm({ ancestors: e, article: t, canutesDb: n, context: r, date: i, originalPositionsFromTransformedIterator: a, reference: o, state: s }) {
|
|
12084
12111
|
if (t.present) return;
|
|
12085
12112
|
let c = [], l = t.implicitText?.cid ?? s.textId;
|
|
12086
12113
|
if (l !== void 0 && (c = [...await n`
|
|
@@ -12123,66 +12150,66 @@ async function* qm({ ancestors: e, article: t, canutesDb: n, context: r, date: i
|
|
|
12123
12150
|
yield Object.fromEntries(Object.entries({
|
|
12124
12151
|
article: t,
|
|
12125
12152
|
articleId: s.articleId,
|
|
12126
|
-
originalTransformation: a === void 0 ? void 0 :
|
|
12153
|
+
originalTransformation: a === void 0 ? void 0 : Dm(a, u),
|
|
12127
12154
|
position: u,
|
|
12128
12155
|
reference: o,
|
|
12129
12156
|
type: "external_article"
|
|
12130
12157
|
}).filter(([, e]) => e !== void 0));
|
|
12131
12158
|
}
|
|
12132
|
-
function*
|
|
12159
|
+
function* Ym(e, t, { citations: n = !1 } = {}) {
|
|
12133
12160
|
switch (t.type) {
|
|
12134
12161
|
case "bounded-interval":
|
|
12135
|
-
yield*
|
|
12162
|
+
yield* Ym(e, t.first, { citations: n }), yield* Ym(e, t.last, { citations: n });
|
|
12136
12163
|
break;
|
|
12137
12164
|
case "counted-interval":
|
|
12138
|
-
yield*
|
|
12165
|
+
yield* Ym(e, t.first, { citations: n });
|
|
12139
12166
|
break;
|
|
12140
12167
|
case "enumeration":
|
|
12141
12168
|
case "exclusion":
|
|
12142
|
-
yield*
|
|
12169
|
+
yield* Ym(e, t.left, { citations: n }), yield* Ym(e, t.right, { citations: n });
|
|
12143
12170
|
break;
|
|
12144
12171
|
case "reference_et_action":
|
|
12145
|
-
if (yield*
|
|
12172
|
+
if (yield* Ym(e, t.reference, { citations: n }), n) {
|
|
12146
12173
|
let { originalCitations: r } = t.action;
|
|
12147
12174
|
if (r !== void 0) {
|
|
12148
|
-
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield*
|
|
12175
|
+
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield* Ym(e, r, { citations: n });
|
|
12149
12176
|
}
|
|
12150
12177
|
}
|
|
12151
12178
|
break;
|
|
12152
12179
|
default: yield t;
|
|
12153
12180
|
}
|
|
12154
12181
|
}
|
|
12155
|
-
function*
|
|
12182
|
+
function* Xm(e, t) {
|
|
12156
12183
|
if (t.type === "texte") console.error(`iterDeepestDivisionsOrArticles must not be called with a text:\n${JSON.stringify(t, null, 2)}`);
|
|
12157
12184
|
else if (Et(t) || t.type === "article") yield t;
|
|
12158
12185
|
else if (!(Dt(t) || t.type === "incomplete-header")) switch (t.type) {
|
|
12159
12186
|
case "bounded-interval":
|
|
12160
|
-
yield*
|
|
12187
|
+
yield* Xm(e, t.first), yield* Xm(e, t.last);
|
|
12161
12188
|
break;
|
|
12162
12189
|
case "counted-interval":
|
|
12163
|
-
yield*
|
|
12190
|
+
yield* Xm(e, t.first);
|
|
12164
12191
|
break;
|
|
12165
12192
|
case "enumeration":
|
|
12166
12193
|
case "exclusion":
|
|
12167
|
-
yield*
|
|
12194
|
+
yield* Xm(e, t.left), yield* Xm(e, t.right);
|
|
12168
12195
|
break;
|
|
12169
12196
|
case "parent-enfant": {
|
|
12170
|
-
let n = [...
|
|
12171
|
-
n.length === 0 ? yield*
|
|
12197
|
+
let n = [...Xm(e, t.child)];
|
|
12198
|
+
n.length === 0 ? yield* Xm(e, t.parent) : yield* n;
|
|
12172
12199
|
break;
|
|
12173
12200
|
}
|
|
12174
12201
|
case "reference_et_action": {
|
|
12175
|
-
yield*
|
|
12202
|
+
yield* Xm(e, t.reference);
|
|
12176
12203
|
let { originalCitations: n } = t.action;
|
|
12177
12204
|
if (n !== void 0) {
|
|
12178
|
-
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield*
|
|
12205
|
+
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield* Xm(e, n);
|
|
12179
12206
|
}
|
|
12180
12207
|
break;
|
|
12181
12208
|
}
|
|
12182
12209
|
default: _e("iterDeepestDivisionsOrArticles reference.type", t);
|
|
12183
12210
|
}
|
|
12184
12211
|
}
|
|
12185
|
-
async function*
|
|
12212
|
+
async function* Zm({ ancestors: e, canutesDb: t, context: n, date: r, division: i, divisionChildReference: a, logIgnoredReferencesTypes: o, originalPositionsFromTransformedIterator: s, parentLiensSectionTa: c, reference: l, state: u }) {
|
|
12186
12213
|
if (i.present) return;
|
|
12187
12214
|
let d;
|
|
12188
12215
|
if (c === void 0 && u.textId !== void 0) {
|
|
@@ -12199,7 +12226,7 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12199
12226
|
let t = e["#text"]?.split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== "").join(" ");
|
|
12200
12227
|
if (t !== void 0) {
|
|
12201
12228
|
let n = !1;
|
|
12202
|
-
if (i.index !== void 0 && (n =
|
|
12229
|
+
if (i.index !== void 0 && (n = Qm(i.type, i.index).some((e) => e === t)), !n && i.num !== void 0 && (n = `${i.type} ${i.num.toLowerCase()}` === t), n) {
|
|
12203
12230
|
d = e;
|
|
12204
12231
|
break;
|
|
12205
12232
|
}
|
|
@@ -12212,7 +12239,7 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12212
12239
|
let e = d["#text"].split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== ""), t = {
|
|
12213
12240
|
start: i.position.stop,
|
|
12214
12241
|
stop: i.position.stop
|
|
12215
|
-
}, n = s === void 0 ? void 0 :
|
|
12242
|
+
}, n = s === void 0 ? void 0 : Dm(s, t), r = Object.fromEntries(Object.entries({
|
|
12216
12243
|
num: e[1],
|
|
12217
12244
|
originalTransformation: n,
|
|
12218
12245
|
position: t,
|
|
@@ -12227,8 +12254,8 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12227
12254
|
}).filter(([, e]) => e !== void 0)), i = r;
|
|
12228
12255
|
}
|
|
12229
12256
|
}
|
|
12230
|
-
let f = a === void 0 ? [] : [...
|
|
12231
|
-
if (a !== void 0) for (let c of
|
|
12257
|
+
let f = a === void 0 ? [] : [...Xm(n, a.child)], p = 0;
|
|
12258
|
+
if (a !== void 0) for (let c of Ym(n, a.child)) {
|
|
12232
12259
|
let m = c.type === "parent-enfant" ? c.parent : c, h = c.type === "parent-enfant" ? c : void 0;
|
|
12233
12260
|
switch (m.type) {
|
|
12234
12261
|
case "alinéa":
|
|
@@ -12236,7 +12263,7 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12236
12263
|
case "item":
|
|
12237
12264
|
case "phrase": break;
|
|
12238
12265
|
case "article":
|
|
12239
|
-
yield*
|
|
12266
|
+
yield* Jm({
|
|
12240
12267
|
ancestors: f.length === 1 ? [...e ?? [], i] : void 0,
|
|
12241
12268
|
article: m,
|
|
12242
12269
|
canutesDb: t,
|
|
@@ -12266,7 +12293,7 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12266
12293
|
`)[0]?.data;
|
|
12267
12294
|
e !== void 0 && (a = e.STRUCTURE_TA?.LIEN_SECTION_TA);
|
|
12268
12295
|
}
|
|
12269
|
-
yield*
|
|
12296
|
+
yield* Zm({
|
|
12270
12297
|
ancestors: f.length === 1 ? [...e ?? [], i] : void 0,
|
|
12271
12298
|
canutesDb: t,
|
|
12272
12299
|
context: n,
|
|
@@ -12295,7 +12322,7 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12295
12322
|
};
|
|
12296
12323
|
yield Object.fromEntries(Object.entries({
|
|
12297
12324
|
division: i,
|
|
12298
|
-
originalTransformation: s === void 0 ? void 0 :
|
|
12325
|
+
originalTransformation: s === void 0 ? void 0 : Dm(s, t),
|
|
12299
12326
|
position: t,
|
|
12300
12327
|
reference: l,
|
|
12301
12328
|
sectionTaId: u.sectionTaId,
|
|
@@ -12303,7 +12330,7 @@ async function* Xm({ ancestors: e, canutesDb: t, context: n, date: r, division:
|
|
|
12303
12330
|
}).filter(([, e]) => e !== void 0));
|
|
12304
12331
|
}
|
|
12305
12332
|
}
|
|
12306
|
-
function*
|
|
12333
|
+
function* Qm(e, t) {
|
|
12307
12334
|
let n = Math.floor(t), r = Math.floor((t - n) * 1e3);
|
|
12308
12335
|
if (r === 0) {
|
|
12309
12336
|
for (let t of ie(n)) yield `${t.toLowerCase()} ${e}`;
|
|
@@ -12313,9 +12340,9 @@ function* Zm(e, t) {
|
|
|
12313
12340
|
for (let r of ne(n)) yield `${e} ${t} ${r.toLowerCase()}`;
|
|
12314
12341
|
}
|
|
12315
12342
|
}
|
|
12316
|
-
async function*
|
|
12343
|
+
async function* $m({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n, date: r, logIgnoredReferencesTypes: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
12317
12344
|
let l = e ?? {}, u = c === void 0 ? {} : c;
|
|
12318
|
-
for (let e of
|
|
12345
|
+
for (let e of Ym(n, s)) {
|
|
12319
12346
|
let c = e.type === "parent-enfant" ? e.parent : e, d = e.type === "parent-enfant" ? e : void 0;
|
|
12320
12347
|
switch (c.type) {
|
|
12321
12348
|
case "alinéa":
|
|
@@ -12326,7 +12353,7 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12326
12353
|
if (c.definition && u.textId !== void 0) {
|
|
12327
12354
|
let e = l[u.textId]?.[c.num];
|
|
12328
12355
|
e !== void 0 && (yield e);
|
|
12329
|
-
} else yield*
|
|
12356
|
+
} else yield* Jm({
|
|
12330
12357
|
article: c,
|
|
12331
12358
|
canutesDb: t,
|
|
12332
12359
|
context: n,
|
|
@@ -12346,7 +12373,7 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12346
12373
|
case "sous-sous-paragraphe":
|
|
12347
12374
|
case "sous-titre":
|
|
12348
12375
|
case "titre":
|
|
12349
|
-
c.definition && u.textId !== void 0 || (yield*
|
|
12376
|
+
c.definition && u.textId !== void 0 || (yield* Zm({
|
|
12350
12377
|
canutesDb: t,
|
|
12351
12378
|
context: n,
|
|
12352
12379
|
date: r,
|
|
@@ -12359,15 +12386,15 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12359
12386
|
}));
|
|
12360
12387
|
break;
|
|
12361
12388
|
case "texte": {
|
|
12362
|
-
|
|
12389
|
+
qm({
|
|
12363
12390
|
context: n,
|
|
12364
12391
|
logPartialReferences: a,
|
|
12365
12392
|
reference: s,
|
|
12366
12393
|
state: u,
|
|
12367
12394
|
text: c
|
|
12368
12395
|
});
|
|
12369
|
-
let e = d === void 0 ? [] : [...
|
|
12370
|
-
if (d !== void 0) for (let a of
|
|
12396
|
+
let e = d === void 0 ? [] : [...Xm(n, d.child)], l = 0;
|
|
12397
|
+
if (d !== void 0) for (let a of Ym(n, d.child)) {
|
|
12371
12398
|
let f = a.type === "parent-enfant" ? a.parent : a, p = a.type === "parent-enfant" ? a : void 0;
|
|
12372
12399
|
switch (f.type) {
|
|
12373
12400
|
case "alinéa":
|
|
@@ -12375,7 +12402,7 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12375
12402
|
case "item":
|
|
12376
12403
|
case "phrase": break;
|
|
12377
12404
|
case "article":
|
|
12378
|
-
yield*
|
|
12405
|
+
yield* Jm({
|
|
12379
12406
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
12380
12407
|
article: f,
|
|
12381
12408
|
canutesDb: t,
|
|
@@ -12405,7 +12432,7 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12405
12432
|
`)[0]?.data;
|
|
12406
12433
|
e !== void 0 && (a = e.STRUCT?.LIEN_SECTION_TA);
|
|
12407
12434
|
}
|
|
12408
|
-
yield*
|
|
12435
|
+
yield* Zm({
|
|
12409
12436
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
12410
12437
|
canutesDb: t,
|
|
12411
12438
|
context: n,
|
|
@@ -12459,7 +12486,7 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12459
12486
|
if (e !== void 0) {
|
|
12460
12487
|
for (let s of e) if (s.references !== void 0) {
|
|
12461
12488
|
let e = structuredClone(u);
|
|
12462
|
-
for (let c of s.references) yield*
|
|
12489
|
+
for (let c of s.references) yield* $m({
|
|
12463
12490
|
articleDefinitionByNumByTextId: l,
|
|
12464
12491
|
canutesDb: t,
|
|
12465
12492
|
context: n,
|
|
@@ -12476,9 +12503,9 @@ async function* Qm({ articleDefinitionByNumByTextId: e, canutesDb: t, context: n
|
|
|
12476
12503
|
}
|
|
12477
12504
|
//#endregion
|
|
12478
12505
|
//#region src/lib/extractors/table_of_contents.ts
|
|
12479
|
-
function*
|
|
12480
|
-
let r = 0, i =
|
|
12481
|
-
for (let n of
|
|
12506
|
+
function* eh({ context: e, tableOfContents: t, transformation: n }) {
|
|
12507
|
+
let r = 0, i = Cm(n);
|
|
12508
|
+
for (let n of nh(t)) {
|
|
12482
12509
|
let t = n.line.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = RegExp(`^${t}$`, "m");
|
|
12483
12510
|
a.lastIndex = r;
|
|
12484
12511
|
let o = a.exec(e.input);
|
|
@@ -12486,11 +12513,11 @@ function* $m({ context: e, tableOfContents: t, transformation: n }) {
|
|
|
12486
12513
|
let s = {
|
|
12487
12514
|
start: o.index,
|
|
12488
12515
|
stop: o.index + o[0].length
|
|
12489
|
-
}, c =
|
|
12516
|
+
}, c = Dm(i, s), l = n;
|
|
12490
12517
|
l.originalTransformation = c, l.position = s, yield l, r = s.stop;
|
|
12491
12518
|
}
|
|
12492
12519
|
}
|
|
12493
|
-
function
|
|
12520
|
+
function th(e) {
|
|
12494
12521
|
let t = new Oe(e), n = {}, r = [];
|
|
12495
12522
|
for (let e of Jn(t)) if (Et(e)) {
|
|
12496
12523
|
let i = r.findIndex(({ type: t }) => t === e.type);
|
|
@@ -12511,13 +12538,13 @@ function eh(e) {
|
|
|
12511
12538
|
} else throw Error(`Unexpected type "${e.type}" in definition:\n${JSON.stringify(e, null, 2)}`);
|
|
12512
12539
|
return n;
|
|
12513
12540
|
}
|
|
12514
|
-
function*
|
|
12515
|
-
if (e.type !== void 0 && (yield e), e.articles !== void 0 && (yield* e.articles), e.divisions !== void 0) for (let t of e.divisions) yield*
|
|
12541
|
+
function* nh(e) {
|
|
12542
|
+
if (e.type !== void 0 && (yield e), e.articles !== void 0 && (yield* e.articles), e.divisions !== void 0) for (let t of e.divisions) yield* nh(t);
|
|
12516
12543
|
}
|
|
12517
12544
|
//#endregion
|
|
12518
12545
|
//#region src/lib/links.ts
|
|
12519
|
-
var
|
|
12520
|
-
function
|
|
12546
|
+
var rh = ["Exploratrice", "Forgejo"];
|
|
12547
|
+
function ih(e, t, n) {
|
|
12521
12548
|
let r = n.match(ce);
|
|
12522
12549
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
12523
12550
|
switch (e) {
|
|
@@ -12538,17 +12565,17 @@ function rh(e, t, n) {
|
|
|
12538
12565
|
}
|
|
12539
12566
|
//#endregion
|
|
12540
12567
|
//#region src/lib/linkers/html.ts
|
|
12541
|
-
function
|
|
12568
|
+
function ah(e, t) {
|
|
12542
12569
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
12543
12570
|
...e,
|
|
12544
12571
|
action: t.action
|
|
12545
12572
|
}) : JSON.stringify(e);
|
|
12546
12573
|
}
|
|
12547
|
-
async function
|
|
12548
|
-
let d =
|
|
12574
|
+
async function oh({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i, logIgnoredReferencesTypes: a, logPartialReferences: o, logReferences: s, onLink: c, previousContext: l, state: u }) {
|
|
12575
|
+
let d = Hm({ removeAWithHref: !0 })(n), f = new Oe(d.output);
|
|
12549
12576
|
f.currentArticle = l?.currentArticle, f.currentText = l?.currentText;
|
|
12550
12577
|
let p = n, m = 0, h = -1;
|
|
12551
|
-
for await (let n of
|
|
12578
|
+
for await (let n of Km({
|
|
12552
12579
|
canutesDb: e,
|
|
12553
12580
|
context: f,
|
|
12554
12581
|
date: t,
|
|
@@ -12561,7 +12588,7 @@ async function ah({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i,
|
|
|
12561
12588
|
case "article_definition": {
|
|
12562
12589
|
let { article: e, originalTransformation: t, textId: r } = n;
|
|
12563
12590
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(n, null, 2)}`);
|
|
12564
|
-
let i =
|
|
12591
|
+
let i = Om(p, t, m), a = km(t, `<span class="definition_article" id="definition_article_${r}_${e.num.replaceAll(" ", "_")}">${i}</span>`);
|
|
12565
12592
|
p = p.slice(0, t.position.start + m) + a + p.slice(t.position.stop + m), m += a.length - (t.position.stop - t.position.start);
|
|
12566
12593
|
break;
|
|
12567
12594
|
}
|
|
@@ -12569,7 +12596,7 @@ async function ah({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i,
|
|
|
12569
12596
|
let { articleId: e, originalTransformation: t } = n;
|
|
12570
12597
|
if (e !== void 0) {
|
|
12571
12598
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(n, null, 2)}`);
|
|
12572
|
-
let a =
|
|
12599
|
+
let a = Om(p, t, m), o = km(t, `<a class="lien_article_externe" href="${ih(i, r, e)}">${a}</a>`);
|
|
12573
12600
|
p = p.slice(0, t.position.start + m) + o + p.slice(t.position.stop + m), m += o.length - (t.position.stop - t.position.start);
|
|
12574
12601
|
}
|
|
12575
12602
|
break;
|
|
@@ -12578,7 +12605,7 @@ async function ah({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i,
|
|
|
12578
12605
|
let { originalTransformation: e, sectionTaId: t } = n;
|
|
12579
12606
|
if (t !== void 0) {
|
|
12580
12607
|
if (e === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(n, null, 2)}`);
|
|
12581
|
-
let a =
|
|
12608
|
+
let a = Om(p, e, m), o = km(e, `<a class="lien_division_externe" href="${ih(i, r, t)}">${a}</a>`);
|
|
12582
12609
|
p = p.slice(0, e.position.start + m) + o + p.slice(e.position.stop + m), m += o.length - (e.position.stop - e.position.start);
|
|
12583
12610
|
}
|
|
12584
12611
|
break;
|
|
@@ -12590,7 +12617,7 @@ async function ah({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i,
|
|
|
12590
12617
|
continue;
|
|
12591
12618
|
}
|
|
12592
12619
|
if (e === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(n, null, 2)}`);
|
|
12593
|
-
let a =
|
|
12620
|
+
let a = Om(p, e, m), o = km(e, `<a class="lien_texte_externe" href="${ih(i, r, t.cid)}">${a}</a>`);
|
|
12594
12621
|
p = p.slice(0, e.position.start + m) + o + p.slice(e.position.stop + m), m += o.length - (e.position.stop - e.position.start);
|
|
12595
12622
|
break;
|
|
12596
12623
|
}
|
|
@@ -12598,14 +12625,14 @@ async function ah({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i,
|
|
|
12598
12625
|
let { url: e, originalTransformation: t } = n;
|
|
12599
12626
|
if (e === void 0) continue;
|
|
12600
12627
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(n, null, 2)}`);
|
|
12601
|
-
let r =
|
|
12628
|
+
let r = km(t, `<a class="lien_texte_european" href="${e}" target="_blank">${Om(p, t, m)}</a>`);
|
|
12602
12629
|
p = p.slice(0, t.position.start + m) + r + p.slice(t.position.stop + m), m += r.length - (t.position.stop - t.position.start);
|
|
12603
12630
|
break;
|
|
12604
12631
|
}
|
|
12605
12632
|
case "internal_article": {
|
|
12606
12633
|
let { definition: e, originalTransformation: t } = n;
|
|
12607
12634
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(n, null, 2)}`);
|
|
12608
|
-
let r =
|
|
12635
|
+
let r = Om(p, t, m), i = km(t, `<a class="lien_article_interne" href="#definition_article_${e.textId}_${e.article.num.replaceAll(" ", "_")}" style="background-color: #eae462">${r}</a>`);
|
|
12609
12636
|
p = p.slice(0, t.position.start + m) + i + p.slice(t.position.stop + m), m += i.length - (t.position.stop - t.position.start);
|
|
12610
12637
|
break;
|
|
12611
12638
|
}
|
|
@@ -12616,23 +12643,23 @@ async function ah({ canutesDb: e, date: t, html: n, linkBaseUrl: r, linkType: i,
|
|
|
12616
12643
|
output: p === n ? null : p
|
|
12617
12644
|
};
|
|
12618
12645
|
}
|
|
12619
|
-
function
|
|
12646
|
+
function sh({ attributes: e, originalTransformation: t, outputByType: n }) {
|
|
12620
12647
|
let r = Object.entries(e).map(([e, t]) => `${e}="${ge(t, !0)}"`).join(" ");
|
|
12621
12648
|
for (let e of ["links", "links_or_references"]) {
|
|
12622
12649
|
let i = n[e];
|
|
12623
12650
|
if (i !== void 0) {
|
|
12624
|
-
let e =
|
|
12651
|
+
let e = km(t, `<a ${r}>${Om(i.html, t, i.offset)}</a>`);
|
|
12625
12652
|
i.html = i.html.slice(0, t.position.start + i.offset) + e + i.html.slice(t.position.stop + i.offset), i.offset += e.length - (t.position.stop - t.position.start);
|
|
12626
12653
|
}
|
|
12627
12654
|
}
|
|
12628
12655
|
}
|
|
12629
|
-
async function
|
|
12656
|
+
async function ch({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation: r, inputHtml: i, linkBaseUrl: a, linkType: o, logIgnoredReferencesTypes: s, logPartialReferences: c, logReferences: l, outputTypes: u, referredLegifranceTextsInfos: d }) {
|
|
12630
12657
|
let f = new Oe(r.output), p = mt(), m = {}, h = {};
|
|
12631
12658
|
for (let e of u) h[e] = {
|
|
12632
12659
|
html: i,
|
|
12633
12660
|
offset: 0
|
|
12634
12661
|
};
|
|
12635
|
-
for await (let i of
|
|
12662
|
+
for await (let i of Km({
|
|
12636
12663
|
canutesDb: e,
|
|
12637
12664
|
context: f,
|
|
12638
12665
|
date: t,
|
|
@@ -12646,7 +12673,7 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12646
12673
|
let { article: e, originalTransformation: t, textId: n } = i;
|
|
12647
12674
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(i, null, 2)}`);
|
|
12648
12675
|
for (let r of Object.values(h)) {
|
|
12649
|
-
let i =
|
|
12676
|
+
let i = Om(r.html, t, r.offset), a = km(t, `<span class="definition_article" id="definition_article_${n}_${e.num.replaceAll(" ", "_")}">${i}</span>`);
|
|
12650
12677
|
r.html = r.html.slice(0, t.position.start + r.offset) + a + r.html.slice(t.position.stop + r.offset), r.offset += a.length - (t.position.stop - t.position.start);
|
|
12651
12678
|
}
|
|
12652
12679
|
break;
|
|
@@ -12654,10 +12681,10 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12654
12681
|
case "external_article": {
|
|
12655
12682
|
let { article: t, articleId: n, originalTransformation: r } = i;
|
|
12656
12683
|
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(i, null, 2)}`);
|
|
12657
|
-
if (n !== void 0 && (
|
|
12684
|
+
if (n !== void 0 && (sh({
|
|
12658
12685
|
attributes: {
|
|
12659
12686
|
class: "lien_article_externe",
|
|
12660
|
-
href:
|
|
12687
|
+
href: ih(o, a, n)
|
|
12661
12688
|
},
|
|
12662
12689
|
originalTransformation: r,
|
|
12663
12690
|
outputByType: h
|
|
@@ -12665,11 +12692,11 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12665
12692
|
let t = (await ye(e, p, n))?.CONTEXTE.TEXTE["@cid"];
|
|
12666
12693
|
t != null && (m[t] = (m[t] ?? 0) + 1);
|
|
12667
12694
|
}
|
|
12668
|
-
|
|
12695
|
+
lh({
|
|
12669
12696
|
attributes: {
|
|
12670
12697
|
class: "reference_article",
|
|
12671
12698
|
style: "background-color: #eae462",
|
|
12672
|
-
title:
|
|
12699
|
+
title: ah(t, i.reference)
|
|
12673
12700
|
},
|
|
12674
12701
|
id: n,
|
|
12675
12702
|
originalTransformation: r,
|
|
@@ -12680,10 +12707,10 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12680
12707
|
case "external_division": {
|
|
12681
12708
|
let { division: t, originalTransformation: n, sectionTaId: r } = i;
|
|
12682
12709
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(i, null, 2)}`);
|
|
12683
|
-
if (r !== void 0 && (
|
|
12710
|
+
if (r !== void 0 && (sh({
|
|
12684
12711
|
attributes: {
|
|
12685
12712
|
class: "lien_division_externe",
|
|
12686
|
-
href:
|
|
12713
|
+
href: ih(o, a, r)
|
|
12687
12714
|
},
|
|
12688
12715
|
originalTransformation: n,
|
|
12689
12716
|
outputByType: h
|
|
@@ -12691,11 +12718,11 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12691
12718
|
let t = (await xe(e, p, r))?.CONTEXTE.TEXTE["@cid"];
|
|
12692
12719
|
t != null && (m[t] = (m[t] ?? 0) + 1);
|
|
12693
12720
|
}
|
|
12694
|
-
|
|
12721
|
+
lh({
|
|
12695
12722
|
attributes: {
|
|
12696
12723
|
class: "reference_division",
|
|
12697
12724
|
style: "background-color: #eae462",
|
|
12698
|
-
title:
|
|
12725
|
+
title: ah(t, i.reference)
|
|
12699
12726
|
},
|
|
12700
12727
|
id: r,
|
|
12701
12728
|
originalTransformation: n,
|
|
@@ -12706,7 +12733,7 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12706
12733
|
case "european_text": {
|
|
12707
12734
|
let { url: e, originalTransformation: t, text: n, titleId: r } = i;
|
|
12708
12735
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(i, null, 2)}`);
|
|
12709
|
-
|
|
12736
|
+
sh({
|
|
12710
12737
|
attributes: {
|
|
12711
12738
|
class: "lien_texte_european",
|
|
12712
12739
|
href: e,
|
|
@@ -12714,11 +12741,11 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12714
12741
|
},
|
|
12715
12742
|
originalTransformation: t,
|
|
12716
12743
|
outputByType: h
|
|
12717
|
-
}),
|
|
12744
|
+
}), lh({
|
|
12718
12745
|
attributes: {
|
|
12719
12746
|
class: "reference_texte",
|
|
12720
12747
|
style: "background-color: #eae462",
|
|
12721
|
-
title:
|
|
12748
|
+
title: ah(n, i.reference)
|
|
12722
12749
|
},
|
|
12723
12750
|
id: r,
|
|
12724
12751
|
originalTransformation: t,
|
|
@@ -12729,18 +12756,18 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12729
12756
|
case "external_text": {
|
|
12730
12757
|
let { originalTransformation: e, text: t } = i;
|
|
12731
12758
|
if (e === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(i, null, 2)}`);
|
|
12732
|
-
t.cid === void 0 ? t.present || console.error(`Link to text "${f.text(t.position)}" without CID: ${JSON.stringify(t, null, 2)}`) : (
|
|
12759
|
+
t.cid === void 0 ? t.present || console.error(`Link to text "${f.text(t.position)}" without CID: ${JSON.stringify(t, null, 2)}`) : (sh({
|
|
12733
12760
|
attributes: {
|
|
12734
12761
|
class: "lien_texte_externe",
|
|
12735
|
-
href:
|
|
12762
|
+
href: ih(o, a, t.cid)
|
|
12736
12763
|
},
|
|
12737
12764
|
originalTransformation: e,
|
|
12738
12765
|
outputByType: h
|
|
12739
|
-
}), d && (m[t.cid] = (m[t.cid] ?? 0) + 1)),
|
|
12766
|
+
}), d && (m[t.cid] = (m[t.cid] ?? 0) + 1)), lh({
|
|
12740
12767
|
attributes: {
|
|
12741
12768
|
class: "reference_texte",
|
|
12742
12769
|
style: "background-color: #eae462",
|
|
12743
|
-
title:
|
|
12770
|
+
title: ah(t, i.reference)
|
|
12744
12771
|
},
|
|
12745
12772
|
id: t.cid,
|
|
12746
12773
|
originalTransformation: e,
|
|
@@ -12752,7 +12779,7 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12752
12779
|
let { definition: e, originalTransformation: t } = i;
|
|
12753
12780
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(i, null, 2)}`);
|
|
12754
12781
|
for (let n of Object.values(h)) {
|
|
12755
|
-
let r =
|
|
12782
|
+
let r = Om(n.html, t, n.offset), i = km(t, `<a class="lien_article_interne" href="#definition_article_${e.textId}_${e.article.num.replaceAll(" ", "_")}" style="background-color: #eae462">${r}</a>`);
|
|
12756
12783
|
n.html = n.html.slice(0, t.position.start + n.offset) + i + n.html.slice(t.position.stop + n.offset), n.offset += i.length - (t.position.stop - t.position.start);
|
|
12757
12784
|
}
|
|
12758
12785
|
break;
|
|
@@ -12764,16 +12791,16 @@ async function sh({ canutesDb: e, date: t, defaultTextId: n, htmlTransformation:
|
|
|
12764
12791
|
referredLegifranceTextCountByCid: m
|
|
12765
12792
|
};
|
|
12766
12793
|
}
|
|
12767
|
-
function
|
|
12794
|
+
function lh({ attributes: e, id: t, originalTransformation: n, outputByType: r }) {
|
|
12768
12795
|
let i = Object.entries(e).map(([e, t]) => `${e}="${ge(t, !0)}"`).join(" ");
|
|
12769
12796
|
for (let e of ["links_or_references", "references"]) {
|
|
12770
12797
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
12771
12798
|
let a = r[e];
|
|
12772
12799
|
if (a !== void 0) {
|
|
12773
|
-
let e =
|
|
12800
|
+
let e = km(n, `<span ${i}>${Om(a.html, n, a.offset)}</span>`);
|
|
12774
12801
|
a.html = a.html.slice(0, n.position.start + a.offset) + e + a.html.slice(n.position.stop + a.offset), a.offset += e.length - (n.position.stop - n.position.start);
|
|
12775
12802
|
}
|
|
12776
12803
|
}
|
|
12777
12804
|
}
|
|
12778
12805
|
//#endregion
|
|
12779
|
-
export { Mp as $, ht as $t,
|
|
12806
|
+
export { Mp as $, ht as $t, Om as A, Se as An, zt as At, Jp as B, _t as Bt, Nm as C, S as Cn, Xt as Ct, wm as D, ye as Dn, Ht as Dt, Cm as E, ve as En, Vt as Et, cm as F, De as Fn, Mt as Ft, nm as G, Tt as Gt, qp as H, vt as Ht, om as I, _e as In, E as It, Rp as J, St as Jt, Zp as K, Et as Kt, Xp as L, D as Lt, _m as M, Ce as Mn, Ft as Mt, hm as N, Te as Nn, kt as Nt, Dm as O, be as On, Lt as Ot, gm as P, we as Pn, At as Pt, Ip as Q, mt as Qt, em as R, It as Rt, Mm as S, x as Sn, qt as St, ym as T, Ne as Tn, Ut as Tt, Yp as U, yt as Ut, $p as V, xt as Vt, im as W, bt as Wt, Np as X, Ct as Xt, Fp as Y, wt as Yt, Pp as Z, pt as Zt, Um as _, _ as _n, an as _t, eh as a, tt as an, In as at, Am as b, b as bn, on as bt, Km as c, We as cn, Nn as ct, Lm as d, w as dn, On as dt, lt as en, Jn as et, Rm as f, Fe as fn, An as ft, Hm as g, Oe as gn, vn as gt, Vm as h, T as hn, _n as ht, ih as i, nt as in, qn as it, km as j, Ee as jn, Bt as jt, Em as k, xe as kn, Rt as kt, $m as l, Ge as ln, En as lt, Bm as m, Le as mn, xn as mt, oh as n, $e as nn, Vn as nt, th as o, Ve as on, zn as ot, zm as p, Ie as pn, Cn as pt, rm as q, Dt as qt, rh as r, Ue as rn, Wn as rt, nh as s, He as sn, Fn as st, ch as t, dt as tn, Bn as tt, Im as u, Ke as un, Dn as ut, Wm as v, v as vn, hn as vt, Pm as w, C as wn, Qt as wt, jm as x, je as xn, Kt as xt, Gm as y, y as yn, gn as yt, Kp as z, gt as zt };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bt as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as h, F as g, Fn as ee, Ft as te, G as ne, Gt as re, H as ie, Ht as ae, I as oe, In as _, It as se, J as ce, Jt as le, K as ue, Kt as de, L as fe, Lt as v, M as pe, Mn as me, Mt as y, N as he, Nn as ge, Nt as b, O as _e, On as ve, Ot as ye, P as be, Pn as xe, Pt as Se, Q as Ce, Qt as we, R as Te, Rt as Ee, S as De, Sn as x, St as Oe, T as ke, Tn as Ae, Tt as je, U as Me, Ut as Ne, V as Pe, Vt as S, W as Fe, Wt as Ie, X as Le, Xt as Re, Y as ze, Yt as Be, Z as Ve, Zt as He, _ as Ue, _n as C, _t as We, a as Ge, an as Ke, at as qe, b as Je, bn as Ye, bt as Xe, c as Ze, cn as Qe, ct as $e, d as et, dn as tt, dt as nt, en as rt, et as it, f as at, fn as ot, ft as st, g as ct, gn as w, gt as lt, h as ut, hn as dt, ht as ft, i as T, in as pt, it as mt, j as E, jn as ht, jt as gt, k as _t, kn as D, kt as vt, l as yt, ln as bt, lt as xt, m as St, mn as Ct, mt as wt, n as Tt, nn as Et, nt as Dt, o as Ot, on as kt, ot as At, p as jt, pn as Mt, pt as Nt, q as Pt, qt as Ft, r as It, rn as Lt, rt as Rt, s as zt, sn as Bt, st as Vt, t as Ht, tn as Ut, tt as Wt, u as Gt, un as Kt, ut as qt, v as Jt, vn as O, vt as Yt, w as Xt, wn as Zt, wt as Qt, x as $t, xn as en, xt as tn, y as nn, yn as rn, yt as an, z as on, zt as sn } from "./html-
|
|
1
|
+
import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bt as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as h, F as g, Fn as ee, Ft as te, G as ne, Gt as re, H as ie, Ht as ae, I as oe, In as _, It as se, J as ce, Jt as le, K as ue, Kt as de, L as fe, Lt as v, M as pe, Mn as me, Mt as y, N as he, Nn as ge, Nt as b, O as _e, On as ve, Ot as ye, P as be, Pn as xe, Pt as Se, Q as Ce, Qt as we, R as Te, Rt as Ee, S as De, Sn as x, St as Oe, T as ke, Tn as Ae, Tt as je, U as Me, Ut as Ne, V as Pe, Vt as S, W as Fe, Wt as Ie, X as Le, Xt as Re, Y as ze, Yt as Be, Z as Ve, Zt as He, _ as Ue, _n as C, _t as We, a as Ge, an as Ke, at as qe, b as Je, bn as Ye, bt as Xe, c as Ze, cn as Qe, ct as $e, d as et, dn as tt, dt as nt, en as rt, et as it, f as at, fn as ot, ft as st, g as ct, gn as w, gt as lt, h as ut, hn as dt, ht as ft, i as T, in as pt, it as mt, j as E, jn as ht, jt as gt, k as _t, kn as D, kt as vt, l as yt, ln as bt, lt as xt, m as St, mn as Ct, mt as wt, n as Tt, nn as Et, nt as Dt, o as Ot, on as kt, ot as At, p as jt, pn as Mt, pt as Nt, q as Pt, qt as Ft, r as It, rn as Lt, rt as Rt, s as zt, sn as Bt, st as Vt, t as Ht, tn as Ut, tt as Wt, u as Gt, un as Kt, ut as qt, v as Jt, vn as O, vt as Yt, w as Xt, wn as Zt, wt as Qt, x as $t, xn as en, xt as tn, y as nn, yn as rn, yt as an, z as on, zt as sn } from "./html-C6wrEfXU.js";
|
|
2
2
|
//#region ../../node_modules/@tricoteuses/legifrance/dist/legal/index.js
|
|
3
3
|
function cn(e, t) {
|
|
4
4
|
if (e != null) {
|
package/dist/server.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|