@talisdev/bibliographic-resource-parsers-lib 5.36.0 → 5.37.0
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.
|
@@ -405,7 +405,8 @@ export declare enum ParserType {
|
|
|
405
405
|
Informit = "Informit",
|
|
406
406
|
Brill = "Brill",
|
|
407
407
|
HeinOnline = "HeinOnline",
|
|
408
|
-
PrimoNde = "PrimoNde"
|
|
408
|
+
PrimoNde = "PrimoNde",
|
|
409
|
+
MichiganLaw = "MichiganLaw"
|
|
409
410
|
}
|
|
410
411
|
|
|
411
412
|
export declare type ParsingFn = (resourceData: ResourceData) => ParsingResult;
|
|
@@ -5157,9 +5157,17 @@ var yp = (e) => {
|
|
|
5157
5157
|
}, um = (e) => e.querySelector(".record-type")?.textContent.trim() ?? void 0, dm = hd(am, (e, t) => {
|
|
5158
5158
|
let n = um(e) ?? lm(t);
|
|
5159
5159
|
return n ? cm[n] : void 0;
|
|
5160
|
-
}),
|
|
5161
|
-
|
|
5162
|
-
|
|
5160
|
+
}), fm = (e) => {
|
|
5161
|
+
let t = V(e, "name", "bepress_citation_doi");
|
|
5162
|
+
if (t) return t.replace("https://doi.org/", "").trim();
|
|
5163
|
+
}, pm = (e) => {
|
|
5164
|
+
let { document: t } = e, n = ns(e);
|
|
5165
|
+
if (!Jc(n)) return n;
|
|
5166
|
+
let r = V(t, "name", "bepress_citation_date"), i = V(t, "name", "bepress_citation_pdf_url"), a = fm(t);
|
|
5167
|
+
return r && (n.resource.date = r), i && (n.resource.uri = i), a && (n.resource.rft_id = [a]), n;
|
|
5168
|
+
}, X = /* @__PURE__ */ function(e) {
|
|
5169
|
+
return e.NoResourceFound = "NoResourceFound", e.Z3988 = "Z3988", e.Z3988SearchResult = "Z3988SearchResult", e.Amazon = "Amazon", e.CupOfJo = "CupOfJo", e.IngentaConnect = "IngentaConnect", e.Jstor = "Jstor", e.Milne = "Milne", e.Primo = "Primo", e.SagePub = "SagePub", e.SageVideo = "SageVideo", e.ScienceDirect = "ScienceDirect", e.Springer = "Springer", e.Youtube = "Youtube", e.TaylorFrancis = "TaylorFrancis", e.Wiley = "Wiley", e.VuFind = "VuFind", e.ClinicalKey = "ClinicalKey", e.DOAJ = "DOAJ", e.Ebscohost = "Ebscohost", e.OpenStax = "OpenStax", e.CambridgeJournalsOnline = "CambridgeJournalsOnline", e.OpenTextbook = "OpenTextbook", e.AhaJournals = "AhaJournals", e.Ijees = "Ijees", e.BloomsburyCollections = "BloomsburyCollections", e.HeritageCirqa = "HeritageCirqa", e.BritishMedicalJournal = "BritishMedicalJournal", e.SummonSearchResult = "SummonSearchResult", e.ApplePodcasts = "ApplePodcasts", e.Arxiv = "Arxiv", e.KanopyVideo = "KanopyVideo", e.LaTrobeOpal = "LaTrobeOpal", e.BYUScholarsArchive = "BYUScholarsArchive", e.Informit = "Informit", e.Brill = "Brill", e.HeinOnline = "HeinOnline", e.PrimoNde = "PrimoNde", e.MichiganLaw = "MichiganLaw", e;
|
|
5170
|
+
}({}), mm = {
|
|
5163
5171
|
[X.NoResourceFound]: cc,
|
|
5164
5172
|
[X.Z3988]: ns,
|
|
5165
5173
|
[X.Z3988SearchResult]: nu,
|
|
@@ -5197,8 +5205,9 @@ var yp = (e) => {
|
|
|
5197
5205
|
[X.Informit]: Pp,
|
|
5198
5206
|
[X.Brill]: Qp,
|
|
5199
5207
|
[X.HeinOnline]: em,
|
|
5200
|
-
[X.PrimoNde]: dm
|
|
5201
|
-
|
|
5208
|
+
[X.PrimoNde]: dm,
|
|
5209
|
+
[X.MichiganLaw]: pm
|
|
5210
|
+
}, hm = "5.37.0", gm = () => hm, _m = [
|
|
5202
5211
|
"com.au",
|
|
5203
5212
|
"com",
|
|
5204
5213
|
"ca",
|
|
@@ -5206,8 +5215,8 @@ var yp = (e) => {
|
|
|
5206
5215
|
"de",
|
|
5207
5216
|
"fr",
|
|
5208
5217
|
"nl"
|
|
5209
|
-
].flatMap((e) => [`amazon.${e}`, `www.amazon.${e}`]),
|
|
5210
|
-
version:
|
|
5218
|
+
].flatMap((e) => [`amazon.${e}`, `www.amazon.${e}`]), vm = {
|
|
5219
|
+
version: gm(),
|
|
5211
5220
|
siteRegistrations: [
|
|
5212
5221
|
{
|
|
5213
5222
|
matcher: { regexp: "^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search" },
|
|
@@ -5235,7 +5244,7 @@ var yp = (e) => {
|
|
|
5235
5244
|
parsers: [X.ScienceDirect]
|
|
5236
5245
|
},
|
|
5237
5246
|
{
|
|
5238
|
-
matcher: { hostnames:
|
|
5247
|
+
matcher: { hostnames: _m },
|
|
5239
5248
|
name: "Amazon",
|
|
5240
5249
|
parsers: [X.Amazon]
|
|
5241
5250
|
},
|
|
@@ -5408,20 +5417,25 @@ var yp = (e) => {
|
|
|
5408
5417
|
matcher: { regexp: "/(discovery|primo-explore)/fulldisplay" },
|
|
5409
5418
|
name: "Primo",
|
|
5410
5419
|
parsers: [X.Primo]
|
|
5420
|
+
},
|
|
5421
|
+
{
|
|
5422
|
+
matcher: { hostnames: ["repository.law.umich.edu"] },
|
|
5423
|
+
name: "Michigan Law Repository",
|
|
5424
|
+
parsers: [X.MichiganLaw]
|
|
5411
5425
|
}
|
|
5412
5426
|
]
|
|
5413
|
-
},
|
|
5414
|
-
matcher:
|
|
5427
|
+
}, ym = j({ hostnames: A(O()).min(1) }), bm = j({ regexp: O() }), xm = M([ym, bm]), Sm = j({
|
|
5428
|
+
matcher: xm,
|
|
5415
5429
|
name: O(),
|
|
5416
5430
|
parsers: A(O()),
|
|
5417
5431
|
libraryVersionRange: O().optional()
|
|
5418
|
-
}),
|
|
5419
|
-
siteRegistrations: A(
|
|
5432
|
+
}), Cm = j({
|
|
5433
|
+
siteRegistrations: A(Sm),
|
|
5420
5434
|
version: O()
|
|
5421
|
-
}),
|
|
5435
|
+
}), wm = (e) => Cm.safeParse(e).success, Tm = (e) => Sm.safeParse(e).success, Em = (e) => xm.safeParse(e).success, Dm = (e) => Object.values(X).includes(e), Om = j({
|
|
5422
5436
|
url: O(),
|
|
5423
5437
|
document: eo((e) => typeof e == "object" && !!e)
|
|
5424
|
-
}),
|
|
5438
|
+
}), km = (e) => Om.safeParse(e).success, Am = /* @__PURE__ */ e(((e, t) => {
|
|
5425
5439
|
var n = "2.0.0", r = 256;
|
|
5426
5440
|
t.exports = {
|
|
5427
5441
|
MAX_LENGTH: r,
|
|
@@ -5441,10 +5455,10 @@ var yp = (e) => {
|
|
|
5441
5455
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
5442
5456
|
FLAG_LOOSE: 2
|
|
5443
5457
|
};
|
|
5444
|
-
})),
|
|
5458
|
+
})), jm = /* @__PURE__ */ e(((e, t) => {
|
|
5445
5459
|
t.exports = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {};
|
|
5446
|
-
})),
|
|
5447
|
-
var { MAX_SAFE_COMPONENT_LENGTH: n, MAX_SAFE_BUILD_LENGTH: r, MAX_LENGTH: i } =
|
|
5460
|
+
})), Mm = /* @__PURE__ */ e(((e, t) => {
|
|
5461
|
+
var { MAX_SAFE_COMPONENT_LENGTH: n, MAX_SAFE_BUILD_LENGTH: r, MAX_LENGTH: i } = Am(), a = jm();
|
|
5448
5462
|
e = t.exports = {};
|
|
5449
5463
|
var o = e.re = [], s = e.safeRe = [], c = e.src = [], l = e.safeSrc = [], u = e.t = {}, d = 0, f = "[a-zA-Z0-9-]", p = [
|
|
5450
5464
|
["\\s", 1],
|
|
@@ -5458,10 +5472,10 @@ var yp = (e) => {
|
|
|
5458
5472
|
a(e, i, t), u[e] = i, c[i] = t, l[i] = r, o[i] = new RegExp(t, n ? "g" : void 0), s[i] = new RegExp(r, n ? "g" : void 0);
|
|
5459
5473
|
};
|
|
5460
5474
|
h("NUMERICIDENTIFIER", "0|[1-9]\\d*"), h("NUMERICIDENTIFIERLOOSE", "\\d+"), h("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), h("MAINVERSION", `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), h("MAINVERSIONLOOSE", `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASEIDENTIFIER", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), h("PRERELEASEIDENTIFIERLOOSE", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASE", `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), h("PRERELEASELOOSE", `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), h("BUILDIDENTIFIER", `${f}+`), h("BUILD", `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), h("FULLPLAIN", `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), h("FULL", `^${c[u.FULLPLAIN]}$`), h("LOOSEPLAIN", `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), h("LOOSE", `^${c[u.LOOSEPLAIN]}$`), h("GTLT", "((?:<|>)?=?)"), h("XRANGEIDENTIFIERLOOSE", `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h("XRANGEIDENTIFIER", `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), h("XRANGEPLAIN", `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), h("XRANGEPLAINLOOSE", `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), h("XRANGE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), h("XRANGELOOSE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), h("COERCEPLAIN", `(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`), h("COERCE", `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), h("COERCEFULL", c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), h("COERCERTL", c[u.COERCE], !0), h("COERCERTLFULL", c[u.COERCEFULL], !0), h("LONETILDE", "(?:~>?)"), h("TILDETRIM", `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", h("TILDE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), h("TILDELOOSE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), h("LONECARET", "(?:\\^)"), h("CARETTRIM", `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", h("CARET", `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), h("CARETLOOSE", `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), h("COMPARATORLOOSE", `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), h("COMPARATOR", `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), h("COMPARATORTRIM", `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", h("HYPHENRANGE", `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), h("HYPHENRANGELOOSE", `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), h("STAR", "(<|>)?=?\\s*\\*"), h("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), h("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
5461
|
-
})),
|
|
5475
|
+
})), Nm = /* @__PURE__ */ e(((e, t) => {
|
|
5462
5476
|
var n = Object.freeze({ loose: !0 }), r = Object.freeze({});
|
|
5463
5477
|
t.exports = (e) => e ? typeof e == "object" ? e : n : r;
|
|
5464
|
-
})),
|
|
5478
|
+
})), Pm = /* @__PURE__ */ e(((e, t) => {
|
|
5465
5479
|
var n = /^[0-9]+$/, r = (e, t) => {
|
|
5466
5480
|
if (typeof e == "number" && typeof t == "number") return e === t ? 0 : e < t ? -1 : 1;
|
|
5467
5481
|
let r = n.test(e), i = n.test(t);
|
|
@@ -5472,7 +5486,7 @@ var yp = (e) => {
|
|
|
5472
5486
|
rcompareIdentifiers: (e, t) => r(t, e)
|
|
5473
5487
|
};
|
|
5474
5488
|
})), Z = /* @__PURE__ */ e(((e, t) => {
|
|
5475
|
-
var n =
|
|
5489
|
+
var n = jm(), { MAX_LENGTH: r, MAX_SAFE_INTEGER: i } = Am(), { safeRe: a, t: o } = Mm(), s = Nm(), { compareIdentifiers: c } = Pm();
|
|
5476
5490
|
t.exports = class e {
|
|
5477
5491
|
constructor(t, c) {
|
|
5478
5492
|
if (c = s(c), t instanceof e) {
|
|
@@ -5592,7 +5606,7 @@ var yp = (e) => {
|
|
|
5592
5606
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
5593
5607
|
}
|
|
5594
5608
|
};
|
|
5595
|
-
})),
|
|
5609
|
+
})), Fm = /* @__PURE__ */ e(((e, t) => {
|
|
5596
5610
|
var n = Z();
|
|
5597
5611
|
t.exports = (e, t, r = !1) => {
|
|
5598
5612
|
if (e instanceof n) return e;
|
|
@@ -5603,19 +5617,19 @@ var yp = (e) => {
|
|
|
5603
5617
|
throw e;
|
|
5604
5618
|
}
|
|
5605
5619
|
};
|
|
5606
|
-
})),
|
|
5607
|
-
var n =
|
|
5620
|
+
})), Im = /* @__PURE__ */ e(((e, t) => {
|
|
5621
|
+
var n = Fm();
|
|
5608
5622
|
t.exports = (e, t) => {
|
|
5609
5623
|
let r = n(e, t);
|
|
5610
5624
|
return r ? r.version : null;
|
|
5611
5625
|
};
|
|
5612
|
-
})),
|
|
5613
|
-
var n =
|
|
5626
|
+
})), Lm = /* @__PURE__ */ e(((e, t) => {
|
|
5627
|
+
var n = Fm();
|
|
5614
5628
|
t.exports = (e, t) => {
|
|
5615
5629
|
let r = n(e.trim().replace(/^[=v]+/, ""), t);
|
|
5616
5630
|
return r ? r.version : null;
|
|
5617
5631
|
};
|
|
5618
|
-
})),
|
|
5632
|
+
})), Rm = /* @__PURE__ */ e(((e, t) => {
|
|
5619
5633
|
var n = Z();
|
|
5620
5634
|
t.exports = (e, t, r, i, a) => {
|
|
5621
5635
|
typeof r == "string" && (a = i, i = r, r = void 0);
|
|
@@ -5625,8 +5639,8 @@ var yp = (e) => {
|
|
|
5625
5639
|
return null;
|
|
5626
5640
|
}
|
|
5627
5641
|
};
|
|
5628
|
-
})),
|
|
5629
|
-
var n =
|
|
5642
|
+
})), zm = /* @__PURE__ */ e(((e, t) => {
|
|
5643
|
+
var n = Fm();
|
|
5630
5644
|
t.exports = (e, t) => {
|
|
5631
5645
|
let r = n(e, null, !0), i = n(t, null, !0), a = r.compare(i);
|
|
5632
5646
|
if (a === 0) return null;
|
|
@@ -5638,17 +5652,17 @@ var yp = (e) => {
|
|
|
5638
5652
|
let u = l ? "pre" : "";
|
|
5639
5653
|
return r.major === i.major ? r.minor === i.minor ? r.patch === i.patch ? "prerelease" : u + "patch" : u + "minor" : u + "major";
|
|
5640
5654
|
};
|
|
5641
|
-
})),
|
|
5655
|
+
})), Bm = /* @__PURE__ */ e(((e, t) => {
|
|
5642
5656
|
var n = Z();
|
|
5643
5657
|
t.exports = (e, t) => new n(e, t).major;
|
|
5644
|
-
})),
|
|
5658
|
+
})), Vm = /* @__PURE__ */ e(((e, t) => {
|
|
5645
5659
|
var n = Z();
|
|
5646
5660
|
t.exports = (e, t) => new n(e, t).minor;
|
|
5647
|
-
})),
|
|
5661
|
+
})), Hm = /* @__PURE__ */ e(((e, t) => {
|
|
5648
5662
|
var n = Z();
|
|
5649
5663
|
t.exports = (e, t) => new n(e, t).patch;
|
|
5650
|
-
})),
|
|
5651
|
-
var n =
|
|
5664
|
+
})), Um = /* @__PURE__ */ e(((e, t) => {
|
|
5665
|
+
var n = Fm();
|
|
5652
5666
|
t.exports = (e, t) => {
|
|
5653
5667
|
let r = n(e, t);
|
|
5654
5668
|
return r && r.prerelease.length ? r.prerelease : null;
|
|
@@ -5656,44 +5670,44 @@ var yp = (e) => {
|
|
|
5656
5670
|
})), Q = /* @__PURE__ */ e(((e, t) => {
|
|
5657
5671
|
var n = Z();
|
|
5658
5672
|
t.exports = (e, t, r) => new n(e, r).compare(new n(t, r));
|
|
5659
|
-
})),
|
|
5673
|
+
})), Wm = /* @__PURE__ */ e(((e, t) => {
|
|
5660
5674
|
var n = Q();
|
|
5661
5675
|
t.exports = (e, t, r) => n(t, e, r);
|
|
5662
|
-
})),
|
|
5676
|
+
})), Gm = /* @__PURE__ */ e(((e, t) => {
|
|
5663
5677
|
var n = Q();
|
|
5664
5678
|
t.exports = (e, t) => n(e, t, !0);
|
|
5665
|
-
})),
|
|
5679
|
+
})), Km = /* @__PURE__ */ e(((e, t) => {
|
|
5666
5680
|
var n = Z();
|
|
5667
5681
|
t.exports = (e, t, r) => {
|
|
5668
5682
|
let i = new n(e, r), a = new n(t, r);
|
|
5669
5683
|
return i.compare(a) || i.compareBuild(a);
|
|
5670
5684
|
};
|
|
5671
|
-
})),
|
|
5672
|
-
var n =
|
|
5685
|
+
})), qm = /* @__PURE__ */ e(((e, t) => {
|
|
5686
|
+
var n = Km();
|
|
5673
5687
|
t.exports = (e, t) => e.sort((e, r) => n(e, r, t));
|
|
5674
|
-
})),
|
|
5675
|
-
var n =
|
|
5688
|
+
})), Jm = /* @__PURE__ */ e(((e, t) => {
|
|
5689
|
+
var n = Km();
|
|
5676
5690
|
t.exports = (e, t) => e.sort((e, r) => n(r, e, t));
|
|
5677
|
-
})),
|
|
5691
|
+
})), Ym = /* @__PURE__ */ e(((e, t) => {
|
|
5678
5692
|
var n = Q();
|
|
5679
5693
|
t.exports = (e, t, r) => n(e, t, r) > 0;
|
|
5680
|
-
})),
|
|
5694
|
+
})), Xm = /* @__PURE__ */ e(((e, t) => {
|
|
5681
5695
|
var n = Q();
|
|
5682
5696
|
t.exports = (e, t, r) => n(e, t, r) < 0;
|
|
5683
|
-
})),
|
|
5697
|
+
})), Zm = /* @__PURE__ */ e(((e, t) => {
|
|
5684
5698
|
var n = Q();
|
|
5685
5699
|
t.exports = (e, t, r) => n(e, t, r) === 0;
|
|
5686
|
-
})),
|
|
5700
|
+
})), Qm = /* @__PURE__ */ e(((e, t) => {
|
|
5687
5701
|
var n = Q();
|
|
5688
5702
|
t.exports = (e, t, r) => n(e, t, r) !== 0;
|
|
5689
|
-
})),
|
|
5703
|
+
})), $m = /* @__PURE__ */ e(((e, t) => {
|
|
5690
5704
|
var n = Q();
|
|
5691
5705
|
t.exports = (e, t, r) => n(e, t, r) >= 0;
|
|
5692
|
-
})),
|
|
5706
|
+
})), eh = /* @__PURE__ */ e(((e, t) => {
|
|
5693
5707
|
var n = Q();
|
|
5694
5708
|
t.exports = (e, t, r) => n(e, t, r) <= 0;
|
|
5695
|
-
})),
|
|
5696
|
-
var n =
|
|
5709
|
+
})), th = /* @__PURE__ */ e(((e, t) => {
|
|
5710
|
+
var n = Zm(), r = Qm(), i = Ym(), a = $m(), o = Xm(), s = eh();
|
|
5697
5711
|
t.exports = (e, t, c, l) => {
|
|
5698
5712
|
switch (t) {
|
|
5699
5713
|
case "===": return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e === c;
|
|
@@ -5709,8 +5723,8 @@ var yp = (e) => {
|
|
|
5709
5723
|
default: throw TypeError(`Invalid operator: ${t}`);
|
|
5710
5724
|
}
|
|
5711
5725
|
};
|
|
5712
|
-
})),
|
|
5713
|
-
var n = Z(), r =
|
|
5726
|
+
})), nh = /* @__PURE__ */ e(((e, t) => {
|
|
5727
|
+
var n = Z(), r = Fm(), { safeRe: i, t: a } = Mm();
|
|
5714
5728
|
t.exports = (e, t) => {
|
|
5715
5729
|
if (e instanceof n) return e;
|
|
5716
5730
|
if (typeof e == "number" && (e = String(e)), typeof e != "string") return null;
|
|
@@ -5726,7 +5740,7 @@ var yp = (e) => {
|
|
|
5726
5740
|
let s = o[2];
|
|
5727
5741
|
return r(`${s}.${o[3] || "0"}.${o[4] || "0"}${t.includePrerelease && o[5] ? `-${o[5]}` : ""}${t.includePrerelease && o[6] ? `+${o[6]}` : ""}`, t);
|
|
5728
5742
|
};
|
|
5729
|
-
})),
|
|
5743
|
+
})), rh = /* @__PURE__ */ e(((e, t) => {
|
|
5730
5744
|
t.exports = class {
|
|
5731
5745
|
constructor() {
|
|
5732
5746
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
@@ -5816,7 +5830,7 @@ var yp = (e) => {
|
|
|
5816
5830
|
return !1;
|
|
5817
5831
|
}
|
|
5818
5832
|
};
|
|
5819
|
-
var r = new (
|
|
5833
|
+
var r = new (rh())(), i = Nm(), a = ih(), o = jm(), s = Z(), { safeRe: c, t: l, comparatorTrimReplace: u, tildeTrimReplace: d, caretTrimReplace: f } = Mm(), { FLAG_INCLUDE_PRERELEASE: p, FLAG_LOOSE: m } = Am(), h = (e) => e.value === "<0.0.0-0", g = (e) => e.value === "", _ = (e, t) => {
|
|
5820
5834
|
let n = !0, r = e.slice(), i = r.pop();
|
|
5821
5835
|
for (; n && r.length;) n = r.every((e) => i.intersects(e, t)), i = r.pop();
|
|
5822
5836
|
return n;
|
|
@@ -5854,7 +5868,7 @@ var yp = (e) => {
|
|
|
5854
5868
|
}
|
|
5855
5869
|
return !0;
|
|
5856
5870
|
};
|
|
5857
|
-
})),
|
|
5871
|
+
})), ih = /* @__PURE__ */ e(((e, t) => {
|
|
5858
5872
|
var n = Symbol("SemVer ANY");
|
|
5859
5873
|
t.exports = class e {
|
|
5860
5874
|
static get ANY() {
|
|
@@ -5889,8 +5903,8 @@ var yp = (e) => {
|
|
|
5889
5903
|
return this.operator === "" ? this.value === "" ? !0 : new l(t.value, n).test(this.value) : t.operator === "" ? t.value === "" ? !0 : new l(this.value, n).test(t.semver) : (n = r(n), n.includePrerelease && (this.value === "<0.0.0-0" || t.value === "<0.0.0-0") || !n.includePrerelease && (this.value.startsWith("<0.0.0") || t.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && t.operator.startsWith(">") || this.operator.startsWith("<") && t.operator.startsWith("<") || this.semver.version === t.semver.version && this.operator.includes("=") && t.operator.includes("=") || o(this.semver, "<", t.semver, n) && this.operator.startsWith(">") && t.operator.startsWith("<") || o(this.semver, ">", t.semver, n) && this.operator.startsWith("<") && t.operator.startsWith(">")));
|
|
5890
5904
|
}
|
|
5891
5905
|
};
|
|
5892
|
-
var r =
|
|
5893
|
-
})),
|
|
5906
|
+
var r = Nm(), { safeRe: i, t: a } = Mm(), o = th(), s = jm(), c = Z(), l = $();
|
|
5907
|
+
})), ah = /* @__PURE__ */ e(((e, t) => {
|
|
5894
5908
|
var n = $();
|
|
5895
5909
|
t.exports = (e, t, r) => {
|
|
5896
5910
|
try {
|
|
@@ -5900,10 +5914,10 @@ var yp = (e) => {
|
|
|
5900
5914
|
}
|
|
5901
5915
|
return t.test(e);
|
|
5902
5916
|
};
|
|
5903
|
-
})),
|
|
5917
|
+
})), oh = /* @__PURE__ */ e(((e, t) => {
|
|
5904
5918
|
var n = $();
|
|
5905
5919
|
t.exports = (e, t) => new n(e, t).set.map((e) => e.map((e) => e.value).join(" ").trim().split(" "));
|
|
5906
|
-
})),
|
|
5920
|
+
})), sh = /* @__PURE__ */ e(((e, t) => {
|
|
5907
5921
|
var n = Z(), r = $();
|
|
5908
5922
|
t.exports = (e, t, i) => {
|
|
5909
5923
|
let a = null, o = null, s = null;
|
|
@@ -5916,7 +5930,7 @@ var yp = (e) => {
|
|
|
5916
5930
|
s.test(e) && (!a || o.compare(e) === -1) && (a = e, o = new n(a, i));
|
|
5917
5931
|
}), a;
|
|
5918
5932
|
};
|
|
5919
|
-
})),
|
|
5933
|
+
})), ch = /* @__PURE__ */ e(((e, t) => {
|
|
5920
5934
|
var n = Z(), r = $();
|
|
5921
5935
|
t.exports = (e, t, i) => {
|
|
5922
5936
|
let a = null, o = null, s = null;
|
|
@@ -5929,8 +5943,8 @@ var yp = (e) => {
|
|
|
5929
5943
|
s.test(e) && (!a || o.compare(e) === 1) && (a = e, o = new n(a, i));
|
|
5930
5944
|
}), a;
|
|
5931
5945
|
};
|
|
5932
|
-
})),
|
|
5933
|
-
var n = Z(), r = $(), i =
|
|
5946
|
+
})), lh = /* @__PURE__ */ e(((e, t) => {
|
|
5947
|
+
var n = Z(), r = $(), i = Ym();
|
|
5934
5948
|
t.exports = (e, t) => {
|
|
5935
5949
|
e = new r(e, t);
|
|
5936
5950
|
let a = new n("0.0.0");
|
|
@@ -5954,7 +5968,7 @@ var yp = (e) => {
|
|
|
5954
5968
|
}
|
|
5955
5969
|
return a && e.test(a) ? a : null;
|
|
5956
5970
|
};
|
|
5957
|
-
})),
|
|
5971
|
+
})), uh = /* @__PURE__ */ e(((e, t) => {
|
|
5958
5972
|
var n = $();
|
|
5959
5973
|
t.exports = (e, t) => {
|
|
5960
5974
|
try {
|
|
@@ -5963,8 +5977,8 @@ var yp = (e) => {
|
|
|
5963
5977
|
return null;
|
|
5964
5978
|
}
|
|
5965
5979
|
};
|
|
5966
|
-
})),
|
|
5967
|
-
var n = Z(), r =
|
|
5980
|
+
})), dh = /* @__PURE__ */ e(((e, t) => {
|
|
5981
|
+
var n = Z(), r = ih(), { ANY: i } = r, a = $(), o = ah(), s = Ym(), c = Xm(), l = eh(), u = $m();
|
|
5968
5982
|
t.exports = (e, t, d, f) => {
|
|
5969
5983
|
e = new n(e, f), t = new a(t, f);
|
|
5970
5984
|
let p, m, h, g, _;
|
|
@@ -5986,17 +6000,17 @@ var yp = (e) => {
|
|
|
5986
6000
|
}
|
|
5987
6001
|
return !0;
|
|
5988
6002
|
};
|
|
5989
|
-
})),
|
|
5990
|
-
var n =
|
|
6003
|
+
})), fh = /* @__PURE__ */ e(((e, t) => {
|
|
6004
|
+
var n = dh();
|
|
5991
6005
|
t.exports = (e, t, r) => n(e, t, ">", r);
|
|
5992
|
-
})),
|
|
5993
|
-
var n =
|
|
6006
|
+
})), ph = /* @__PURE__ */ e(((e, t) => {
|
|
6007
|
+
var n = dh();
|
|
5994
6008
|
t.exports = (e, t, r) => n(e, t, "<", r);
|
|
5995
|
-
})),
|
|
6009
|
+
})), mh = /* @__PURE__ */ e(((e, t) => {
|
|
5996
6010
|
var n = $();
|
|
5997
6011
|
t.exports = (e, t, r) => (e = new n(e, r), t = new n(t, r), e.intersects(t, r));
|
|
5998
|
-
})),
|
|
5999
|
-
var n =
|
|
6012
|
+
})), hh = /* @__PURE__ */ e(((e, t) => {
|
|
6013
|
+
var n = ah(), r = Q();
|
|
6000
6014
|
t.exports = (e, t, i) => {
|
|
6001
6015
|
let a = [], o = null, s = null, c = e.sort((e, t) => r(e, t, i));
|
|
6002
6016
|
for (let e of c) n(e, t, i) ? (s = e, o ||= e) : (s && a.push([o, s]), s = null, o = null);
|
|
@@ -6006,8 +6020,8 @@ var yp = (e) => {
|
|
|
6006
6020
|
let u = l.join(" || "), d = typeof t.raw == "string" ? t.raw : String(t);
|
|
6007
6021
|
return u.length < d.length ? u : t;
|
|
6008
6022
|
};
|
|
6009
|
-
})),
|
|
6010
|
-
var n = $(), r =
|
|
6023
|
+
})), gh = /* @__PURE__ */ e(((e, t) => {
|
|
6024
|
+
var n = $(), r = ih(), { ANY: i } = r, a = ah(), o = Q(), s = (e, t, r = {}) => {
|
|
6011
6025
|
if (e === t) return !0;
|
|
6012
6026
|
e = new n(e, r), t = new n(t, r);
|
|
6013
6027
|
let i = !1;
|
|
@@ -6065,46 +6079,46 @@ var yp = (e) => {
|
|
|
6065
6079
|
return r < 0 ? e : r > 0 || t.operator === "<" && e.operator === "<=" ? t : e;
|
|
6066
6080
|
};
|
|
6067
6081
|
t.exports = s;
|
|
6068
|
-
})),
|
|
6069
|
-
var n =
|
|
6082
|
+
})), _h = (/* @__PURE__ */ e(((e, t) => {
|
|
6083
|
+
var n = Mm(), r = Am(), i = Z(), a = Pm();
|
|
6070
6084
|
t.exports = {
|
|
6071
|
-
parse:
|
|
6072
|
-
valid:
|
|
6073
|
-
clean:
|
|
6074
|
-
inc:
|
|
6075
|
-
diff:
|
|
6076
|
-
major:
|
|
6077
|
-
minor:
|
|
6078
|
-
patch:
|
|
6079
|
-
prerelease:
|
|
6085
|
+
parse: Fm(),
|
|
6086
|
+
valid: Im(),
|
|
6087
|
+
clean: Lm(),
|
|
6088
|
+
inc: Rm(),
|
|
6089
|
+
diff: zm(),
|
|
6090
|
+
major: Bm(),
|
|
6091
|
+
minor: Vm(),
|
|
6092
|
+
patch: Hm(),
|
|
6093
|
+
prerelease: Um(),
|
|
6080
6094
|
compare: Q(),
|
|
6081
|
-
rcompare:
|
|
6082
|
-
compareLoose:
|
|
6083
|
-
compareBuild:
|
|
6084
|
-
sort:
|
|
6085
|
-
rsort:
|
|
6086
|
-
gt:
|
|
6087
|
-
lt:
|
|
6088
|
-
eq:
|
|
6089
|
-
neq:
|
|
6090
|
-
gte:
|
|
6091
|
-
lte:
|
|
6092
|
-
cmp:
|
|
6093
|
-
coerce:
|
|
6094
|
-
Comparator:
|
|
6095
|
+
rcompare: Wm(),
|
|
6096
|
+
compareLoose: Gm(),
|
|
6097
|
+
compareBuild: Km(),
|
|
6098
|
+
sort: qm(),
|
|
6099
|
+
rsort: Jm(),
|
|
6100
|
+
gt: Ym(),
|
|
6101
|
+
lt: Xm(),
|
|
6102
|
+
eq: Zm(),
|
|
6103
|
+
neq: Qm(),
|
|
6104
|
+
gte: $m(),
|
|
6105
|
+
lte: eh(),
|
|
6106
|
+
cmp: th(),
|
|
6107
|
+
coerce: nh(),
|
|
6108
|
+
Comparator: ih(),
|
|
6095
6109
|
Range: $(),
|
|
6096
|
-
satisfies:
|
|
6097
|
-
toComparators:
|
|
6098
|
-
maxSatisfying:
|
|
6099
|
-
minSatisfying:
|
|
6100
|
-
minVersion:
|
|
6101
|
-
validRange:
|
|
6102
|
-
outside:
|
|
6103
|
-
gtr:
|
|
6104
|
-
ltr:
|
|
6105
|
-
intersects:
|
|
6106
|
-
simplifyRange:
|
|
6107
|
-
subset:
|
|
6110
|
+
satisfies: ah(),
|
|
6111
|
+
toComparators: oh(),
|
|
6112
|
+
maxSatisfying: sh(),
|
|
6113
|
+
minSatisfying: ch(),
|
|
6114
|
+
minVersion: lh(),
|
|
6115
|
+
validRange: uh(),
|
|
6116
|
+
outside: dh(),
|
|
6117
|
+
gtr: fh(),
|
|
6118
|
+
ltr: ph(),
|
|
6119
|
+
intersects: mh(),
|
|
6120
|
+
simplifyRange: hh(),
|
|
6121
|
+
subset: gh(),
|
|
6108
6122
|
SemVer: i,
|
|
6109
6123
|
re: n.re,
|
|
6110
6124
|
src: n.src,
|
|
@@ -6114,12 +6128,12 @@ var yp = (e) => {
|
|
|
6114
6128
|
compareIdentifiers: a.compareIdentifiers,
|
|
6115
6129
|
rcompareIdentifiers: a.rcompareIdentifiers
|
|
6116
6130
|
};
|
|
6117
|
-
})))(),
|
|
6118
|
-
parser:
|
|
6131
|
+
})))(), vh = (e, t) => yh(t) ? t.hostnames.includes(new URL(e).hostname) : bh(t) ? !!e.match(t.regexp) : !1, yh = (e) => ym.safeParse(e).success, bh = (e) => bm.safeParse(e).success, xh = (e, t) => t ? (0, _h.satisfies)(e, t) : !0, Sh = (e, t, n) => xh(t, n.libraryVersionRange) && vh(e, n.matcher), Ch = (e, t) => e.siteRegistrations.filter((e) => Sh(t, gm(), e)), wh = (e, t) => Ch(e, t).flatMap(({ parsers: e, name: t }) => e.filter((e) => Dm(e) && e in mm).map((e) => ({
|
|
6132
|
+
parser: mm[e],
|
|
6119
6133
|
parserType: e,
|
|
6120
6134
|
name: t
|
|
6121
|
-
}))),
|
|
6122
|
-
let n =
|
|
6135
|
+
}))), Th = (e, t) => {
|
|
6136
|
+
let n = wh(e, t.url);
|
|
6123
6137
|
for (let { parser: e, parserType: r, name: i } of n) {
|
|
6124
6138
|
let n = e(t);
|
|
6125
6139
|
if (Jc(n) || Yc(n) || Xc(n)) return {
|
|
@@ -6139,19 +6153,19 @@ var yp = (e) => {
|
|
|
6139
6153
|
referrer: t.url
|
|
6140
6154
|
}
|
|
6141
6155
|
};
|
|
6142
|
-
},
|
|
6156
|
+
}, Eh = (e, t) => {
|
|
6143
6157
|
switch (t) {
|
|
6144
6158
|
case Ao.CA: return new URL(`https://${e}.rl.ca.talis.com`);
|
|
6145
6159
|
default: return new URL(`https://${e}.rl.talis.com`);
|
|
6146
6160
|
}
|
|
6147
|
-
},
|
|
6148
|
-
let n =
|
|
6161
|
+
}, Dh = (e, t) => {
|
|
6162
|
+
let n = Eh(e, t);
|
|
6149
6163
|
return new URL("/ui/forms/bookmarklet.html", n);
|
|
6150
|
-
},
|
|
6164
|
+
}, Oh = (e, t, n) => {
|
|
6151
6165
|
let r = To(t);
|
|
6152
6166
|
r.append("fast", "true"), r.append("breakout", "true"), n && (n.parserName && r.append("targetTitle", n.parserName), r.append("referrer", n.referrer));
|
|
6153
6167
|
let i = new URL(e.toString());
|
|
6154
6168
|
return i.search = r.toString(), i;
|
|
6155
6169
|
};
|
|
6156
6170
|
//#endregion
|
|
6157
|
-
export { ro as BookGenresSchema, Lo as CustomerListSchema, Io as CustomerSchema, Ko as DirectLinkOnlyResultSchema, F as Genre,
|
|
6171
|
+
export { ro as BookGenresSchema, Lo as CustomerListSchema, Io as CustomerSchema, Ko as DirectLinkOnlyResultSchema, F as Genre, ym as HostnamesMatcherSchema, io as JournalGenresSchema, bo as NON_OPENURL_PROPERTIES, oo as NonOpenUrlPropertiesSchema, Go as NothingParsedResultSchema, yo as OPENURL_KEYS, lo as OpenUrlAudioVisualResourceSchema, so as OpenUrlBookResourceSchema, fo as OpenUrlDocumentResourceSchema, uo as OpenUrlImageResourceSchema, co as OpenUrlJournalResourceSchema, ao as OpenUrlResourceSchema, qo as OpenUrlResultSchema, po as OpenUrlWebpageResourceSchema, mm as PARSERS, Cm as ParserRegistrySchema, X as ParserType, Wo as ParsingMetadataSchema, Po as ParsingRequestSchema, Zo as ParsingResponseSchema, Xo as ParsingResultSchema, vm as REGISTRY, bm as RegExpMatcherSchema, Om as ResourceDataSchema, mo as ResourceSchema, Sm as SiteRegistrationSchema, Yo as SummonSearchResultSchema, Ao as TenantRegion, Mo as TenantRegistrySchema, jo as TenantSchema, xm as UrlMatcherSchema, Jo as Z3988SearchResultSchema, Ho as convertCustomerListToTenantRegistry, R as createAudioVisual, I as createBook, go as createDocument, ho as createImage, L as createJournal, _o as createWebpage, Qo as directLinkOnly, Do as fromOpenUrl, Dh as getBaseBookmarkingUrl, gm as getLibraryVersion, Ro as isCustomer, zo as isCustomerList, qc as isDirectLinkOnlyResult, ko as isGenre, Zc as isNothingParsedResult, Jc as isOpenUrlResult, wm as isParserRegistry, Dm as isParserType, Kc as isParsingMetadata, Fo as isParsingRequest, Gc as isParsingResponse, Wc as isParsingResult, km as isResourceData, Tm as isSiteRegistration, Xc as isSummonSearchResult, Bo as isTenant, Vo as isTenantRegion, Em as isUrlMatcher, Yc as isZ3988SearchResult, z as nothingParsed, B as openUrlResource, Th as parseResource, es as summonSearchResult, Oh as toBookmarkingWorkflowUrl, To as toOpenUrl, $o as z3988SearchResult };
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
|
|
37
37
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=ee,c=!a.jitless,u=c&&te.value,d=t.catchall,f;e._zod.parse=(a,l)=>{f??=r.value;let p=a.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=i(t.shape),a=o(a,l),d?vn([],p,a,l,f,e):a):n(a,l):(a.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),a)}});function xn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ge(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ye(e,r,o())))}),t)}var Sn=n(`$ZodUnion`,(e,t)=>{S.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>xn(t,i,e,a)):xn(s,i,e,a)}}),Cn=n(`$ZodIntersection`,(e,t)=>{S.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Tn(e,t,n)):Tn(e,i,a)}});function wn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ne(e)&&ne(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=wn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=wn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Tn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ge(e))return e;let o=wn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var En=n(`$ZodRecord`,(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ne(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s){n.value={};let o=new Set;for(let e of s)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){o.add(typeof e==`number`?e.toString():e);let s=t.valueType._zod.run({value:i[e],issues:[]},r);s instanceof Promise?a.push(s.then(t=>{t.issues.length&&n.issues.push(..._e(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(..._e(e,s.issues)),n.value[e]=s.value)}let c;for(let e in i)o.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`)continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&pt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>ye(e,r,o())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(..._e(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(..._e(s,l.issues)),n.value[c.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Dn=n(`$ZodEnum`,(e,t)=>{S.init(e,t);let n=s(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ie.has(typeof e)).map(e=>typeof e==`string`?ae(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),On=n(`$ZodLiteral`,(e,t)=>{if(S.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ae(e):e?ae(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),kn=n(`$ZodTransform`,(e,t)=>{S.init(e,t),e._zod.parse=(n,a)=>{if(a.direction===`backward`)throw new i(e.constructor.name);let o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new r;return n.value=o,n}});function An(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var jn=n(`$ZodOptional`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>An(t,e.value)):An(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Mn=n(`$ZodExactOptional`,(e,t)=>{jn.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nn=n(`$ZodNullable`,(e,t)=>{S.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)}|null)$`):void 0}),m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pn=n(`$ZodDefault`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fn(e,t)):Fn(r,t)}});function Fn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var In=n(`$ZodPrefault`,(e,t)=>{S.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ln=n(`$ZodNonOptional`,(e,t)=>{S.init(e,t),m(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rn(t,e)):Rn(i,e)}});function Rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var zn=n(`$ZodCatch`,(e,t)=>{S.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ye(e,n,o()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ye(e,n,o()))},input:e.value}),e.issues=[]),e)}}),Bn=n(`$ZodPipe`,(e,t)=>{S.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Vn(e,t.in,n)):Vn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Vn(e,t.out,n)):Vn(r,t.out,n)}});function Vn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Hn=n(`$ZodReadonly`,(e,t)=>{S.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Un):Un(r)}});function Un(e){return e.value=Object.freeze(e.value),e}var Wn=n(`$ZodCustom`,(e,t)=>{x.init(e,t),S.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Gn(t,n,r,e));Gn(i,n,r,e)}});function Gn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xe(e))}}var Kn,qn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Jn(){return new qn}(Kn=globalThis).__zod_globalRegistry??(Kn.__zod_globalRegistry=Jn());var Yn=globalThis.__zod_globalRegistry;function Xn(e,t){return new e({type:`string`,...b(t)})}function Zn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function Qn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function $n(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function tr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function rr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function ir(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function ar(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function or(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function sr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function cr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function lr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function ur(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function dr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function fr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function pr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function mr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function hr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function gr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function _r(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function vr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function yr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function br(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function xr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function Sr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function Cr(e,t){return new e({type:`number`,checks:[],...b(t)})}function wr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Tr(e,t){return new e({type:`null`,...b(t)})}function Er(e){return new e({type:`unknown`})}function Dr(e,t){return new e({type:`never`,...b(t)})}function Or(e,t){return new vt({check:`less_than`,...b(t),value:e,inclusive:!1})}function kr(e,t){return new vt({check:`less_than`,...b(t),value:e,inclusive:!0})}function Ar(e,t){return new yt({check:`greater_than`,...b(t),value:e,inclusive:!1})}function jr(e,t){return new yt({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Mr(e,t){return new bt({check:`multiple_of`,...b(t),value:e})}function Nr(e,t){return new St({check:`max_length`,...b(t),maximum:e})}function Pr(e,t){return new Ct({check:`min_length`,...b(t),minimum:e})}function Fr(e,t){return new wt({check:`length_equals`,...b(t),length:e})}function Ir(e,t){return new Et({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Lr(e){return new Dt({check:`string_format`,format:`lowercase`,...b(e)})}function Rr(e){return new Ot({check:`string_format`,format:`uppercase`,...b(e)})}function zr(e,t){return new kt({check:`string_format`,format:`includes`,...b(t),includes:e})}function Br(e,t){return new At({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function Vr(e,t){return new jt({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function Hr(e){return new Mt({check:`overwrite`,tx:e})}function Ur(e){return Hr(t=>t.normalize(e))}function Wr(){return Hr(e=>e.trim())}function Gr(){return Hr(e=>e.toLowerCase())}function Kr(){return Hr(e=>e.toUpperCase())}function qr(){return Hr(e=>v(e))}function Jr(e,t,n){return new e({type:`array`,element:t,...b(n)})}function Yr(e,t,n){let r=b(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Xr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function Zr(e){let t=Qr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(xe(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(xe(r))}},e(n.value,n)));return t}function Qr(e,t){let n=new x({check:`custom`,...b(t)});return n._zod.check=e,n}function $r(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Yn,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function w(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,w(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&T(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ei(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
38
38
|
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ti(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:ri(t,`input`,e.processors),output:ri(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function T(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return T(r.element,n);if(r.type===`set`)return T(r.valueType,n);if(r.type===`lazy`)return T(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return T(r.innerType,n);if(r.type===`intersection`)return T(r.left,n)||T(r.right,n);if(r.type===`record`||r.type===`map`)return T(r.keyType,n)||T(r.valueType,n);if(r.type===`pipe`)return T(r.in,n)||T(r.out,n);if(r.type===`object`){for(let e in r.shape)if(T(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(T(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(T(e,n))return!0;return!!(r.rest&&T(r.rest,n))}return!1}var ni=(e,t={})=>n=>{let r=$r({...n,processors:t});return w(e,r),ei(r,e),ti(r,e)},ri=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$r({...i??{},target:a,io:t,processors:n});return w(e,o),ei(o,e),ti(o,e)},ii={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ai=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ii[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},oi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},si=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ci=(e,t,n,r)=>{n.not={}},li=(e,t,n,r)=>{let i=e._zod.def,a=s(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ui=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},pi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=w(a.element,t,{...r,path:[...r.path,`items`]})},mi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=w(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=w(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},hi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>w(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},gi=(e,t,n,r)=>{let i=e._zod.def,a=w(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=w(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},_i=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=w(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=w(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=w(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},vi=(e,t,n,r)=>{let i=e._zod.def,a=w(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},yi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Si=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ci=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;w(a,t,r);let o=t.seen.get(e);o.ref=a},wi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ti=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=n(`ZodISODateTime`,(e,t)=>{qt.init(e,t),k.init(e,t)});function Di(e){return yr(Ei,e)}var Oi=n(`ZodISODate`,(e,t)=>{Jt.init(e,t),k.init(e,t)});function ki(e){return br(Oi,e)}var Ai=n(`ZodISOTime`,(e,t)=>{Yt.init(e,t),k.init(e,t)});function ji(e){return xr(Ai,e)}var Mi=n(`ZodISODuration`,(e,t)=>{Xt.init(e,t),k.init(e,t)});function Ni(e){return Sr(Mi,e)}var Pi=(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get(){return e.issues.length===0}}})};n(`ZodError`,Pi);var E=n(`ZodError`,Pi,{Parent:Error}),Fi=De(E),Ii=Oe(E),Li=ke(E),Ri=je(E),zi=Ne(E),Bi=Pe(E),Vi=Fe(E),Hi=Ie(E),Ui=Le(E),Wi=Re(E),Gi=ze(E),Ki=Be(E),D=n(`ZodType`,(e,t)=>(S.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ri(e,`input`),output:ri(e,`output`)}}),e.toJSONSchema=ni(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(g(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>oe(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Fi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Li(e,t,n),e.parseAsync=async(t,n)=>Ii(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ri(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zi(e,t,n),e.decode=(t,n)=>Bi(e,t,n),e.encodeAsync=async(t,n)=>Vi(e,t,n),e.decodeAsync=async(t,n)=>Hi(e,t,n),e.safeEncode=(t,n)=>Ui(e,t,n),e.safeDecode=(t,n)=>Wi(e,t,n),e.safeEncodeAsync=async(t,n)=>Gi(e,t,n),e.safeDecodeAsync=async(t,n)=>Ki(e,t,n),e.refine=(t,n)=>e.check(no(t,n)),e.superRefine=t=>e.check(ro(t)),e.overwrite=t=>e.check(Hr(t)),e.optional=()=>P(e),e.exactOptional=()=>za(e),e.nullable=()=>Va(e),e.nullish=()=>P(Va(e)),e.nonoptional=t=>qa(e,t),e.array=()=>A(e),e.or=t=>M([e,t]),e.and=t=>ka(e,t),e.transform=t=>Za(e,Ia(t)),e.default=t=>Ua(e,t),e.prefault=t=>Ga(e,t),e.catch=t=>Ya(e,t),e.pipe=t=>Za(e,t),e.readonly=()=>$a(e),e.describe=t=>{let n=e.clone();return Yn.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Yn.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Yn.get(e);let n=e.clone();return Yn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),qi=n(`_ZodString`,(e,t)=>{Ft.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ir(...t)),e.includes=(...t)=>e.check(zr(...t)),e.startsWith=(...t)=>e.check(Br(...t)),e.endsWith=(...t)=>e.check(Vr(...t)),e.min=(...t)=>e.check(Pr(...t)),e.max=(...t)=>e.check(Nr(...t)),e.length=(...t)=>e.check(Fr(...t)),e.nonempty=(...t)=>e.check(Pr(1,...t)),e.lowercase=t=>e.check(Lr(t)),e.uppercase=t=>e.check(Rr(t)),e.trim=()=>e.check(Wr()),e.normalize=(...t)=>e.check(Ur(...t)),e.toLowerCase=()=>e.check(Gr()),e.toUpperCase=()=>e.check(Kr()),e.slugify=()=>e.check(qr())}),Ji=n(`ZodString`,(e,t)=>{Ft.init(e,t),qi.init(e,t),e.email=t=>e.check(Zn(Yi,t)),e.url=t=>e.check(rr(Qi,t)),e.jwt=t=>e.check(vr(ma,t)),e.emoji=t=>e.check(ir(ea,t)),e.guid=t=>e.check(Qn(Xi,t)),e.uuid=t=>e.check($n(Zi,t)),e.uuidv4=t=>e.check(er(Zi,t)),e.uuidv6=t=>e.check(tr(Zi,t)),e.uuidv7=t=>e.check(nr(Zi,t)),e.nanoid=t=>e.check(ar(ta,t)),e.guid=t=>e.check(Qn(Xi,t)),e.cuid=t=>e.check(or(na,t)),e.cuid2=t=>e.check(sr(ra,t)),e.ulid=t=>e.check(cr(ia,t)),e.base64=t=>e.check(hr(da,t)),e.base64url=t=>e.check(gr(fa,t)),e.xid=t=>e.check(lr(aa,t)),e.ksuid=t=>e.check(ur(oa,t)),e.ipv4=t=>e.check(dr(sa,t)),e.ipv6=t=>e.check(fr(ca,t)),e.cidrv4=t=>e.check(pr(la,t)),e.cidrv6=t=>e.check(mr(ua,t)),e.e164=t=>e.check(_r(pa,t)),e.datetime=t=>e.check(Di(t)),e.date=t=>e.check(ki(t)),e.time=t=>e.check(ji(t)),e.duration=t=>e.check(Ni(t))});function O(e){return Xn(Ji,e)}var k=n(`ZodStringFormat`,(e,t)=>{C.init(e,t),qi.init(e,t)}),Yi=n(`ZodEmail`,(e,t)=>{Rt.init(e,t),k.init(e,t)}),Xi=n(`ZodGUID`,(e,t)=>{It.init(e,t),k.init(e,t)}),Zi=n(`ZodUUID`,(e,t)=>{Lt.init(e,t),k.init(e,t)}),Qi=n(`ZodURL`,(e,t)=>{zt.init(e,t),k.init(e,t)});function $i(e){return rr(Qi,e)}var ea=n(`ZodEmoji`,(e,t)=>{Bt.init(e,t),k.init(e,t)}),ta=n(`ZodNanoID`,(e,t)=>{Vt.init(e,t),k.init(e,t)}),na=n(`ZodCUID`,(e,t)=>{Ht.init(e,t),k.init(e,t)}),ra=n(`ZodCUID2`,(e,t)=>{Ut.init(e,t),k.init(e,t)}),ia=n(`ZodULID`,(e,t)=>{Wt.init(e,t),k.init(e,t)}),aa=n(`ZodXID`,(e,t)=>{Gt.init(e,t),k.init(e,t)}),oa=n(`ZodKSUID`,(e,t)=>{Kt.init(e,t),k.init(e,t)}),sa=n(`ZodIPv4`,(e,t)=>{Zt.init(e,t),k.init(e,t)}),ca=n(`ZodIPv6`,(e,t)=>{Qt.init(e,t),k.init(e,t)}),la=n(`ZodCIDRv4`,(e,t)=>{$t.init(e,t),k.init(e,t)}),ua=n(`ZodCIDRv6`,(e,t)=>{en.init(e,t),k.init(e,t)}),da=n(`ZodBase64`,(e,t)=>{nn.init(e,t),k.init(e,t)}),fa=n(`ZodBase64URL`,(e,t)=>{an.init(e,t),k.init(e,t)}),pa=n(`ZodE164`,(e,t)=>{on.init(e,t),k.init(e,t)}),ma=n(`ZodJWT`,(e,t)=>{cn.init(e,t),k.init(e,t)}),ha=n(`ZodNumber`,(e,t)=>{ln.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r),e.gt=(t,n)=>e.check(Ar(t,n)),e.gte=(t,n)=>e.check(jr(t,n)),e.min=(t,n)=>e.check(jr(t,n)),e.lt=(t,n)=>e.check(Or(t,n)),e.lte=(t,n)=>e.check(kr(t,n)),e.max=(t,n)=>e.check(kr(t,n)),e.int=t=>e.check(va(t)),e.safe=t=>e.check(va(t)),e.positive=t=>e.check(Ar(0,t)),e.nonnegative=t=>e.check(jr(0,t)),e.negative=t=>e.check(Or(0,t)),e.nonpositive=t=>e.check(kr(0,t)),e.multipleOf=(t,n)=>e.check(Mr(t,n)),e.step=(t,n)=>e.check(Mr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ga(e){return Cr(ha,e)}var _a=n(`ZodNumberFormat`,(e,t)=>{un.init(e,t),ha.init(e,t)});function va(e){return wr(_a,e)}var ya=n(`ZodNull`,(e,t)=>{dn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r)});function ba(e){return Tr(ya,e)}var xa=n(`ZodUnknown`,(e,t)=>{fn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Sa(){return Er(xa)}var Ca=n(`ZodNever`,(e,t)=>{pn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r)});function wa(e){return Dr(Ca,e)}var Ta=n(`ZodArray`,(e,t)=>{hn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Pr(t,n)),e.nonempty=t=>e.check(Pr(1,t)),e.max=(t,n)=>e.check(Nr(t,n)),e.length=(t,n)=>e.check(Fr(t,n)),e.unwrap=()=>e.element});function A(e,t){return Jr(Ta,e,t)}var Ea=n(`ZodObject`,(e,t)=>{bn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),m(e,`shape`,()=>t.shape),e.keyof=()=>Na(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Sa()}),e.loose=()=>e.clone({...e._zod.def,catchall:Sa()}),e.strict=()=>e.clone({...e._zod.def,catchall:wa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>de(e,t),e.safeExtend=t=>fe(e,t),e.merge=t=>pe(e,t),e.pick=t=>le(e,t),e.omit=t=>ue(e,t),e.partial=(...t)=>me(La,e,t[0]),e.required=(...t)=>he(Ka,e,t[0])});function j(e,t){return new Ea({type:`object`,shape:e??{},...b(t)})}var Da=n(`ZodUnion`,(e,t)=>{Sn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.options=t.options});function M(e,t){return new Da({type:`union`,options:e,...b(t)})}var Oa=n(`ZodIntersection`,(e,t)=>{Cn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function ka(e,t){return new Oa({type:`intersection`,left:e,right:t})}var Aa=n(`ZodRecord`,(e,t)=>{En.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ja(e,t,n){return new Aa({type:`record`,keyType:e,valueType:t,...b(n)})}var Ma=n(`ZodEnum`,(e,t)=>{Dn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ma({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ma({...t,checks:[],...b(r),entries:i})}});function Na(e,t){return new Ma({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var Pa=n(`ZodLiteral`,(e,t)=>{On.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function N(e,t){return new Pa({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var Fa=n(`ZodTransform`,(e,t)=>{kn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new i(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xe(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}});function Ia(e){return new Fa({type:`transform`,transform:e})}var La=n(`ZodOptional`,(e,t)=>{jn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function P(e){return new La({type:`optional`,innerType:e})}var Ra=n(`ZodExactOptional`,(e,t)=>{Mn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function za(e){return new Ra({type:`optional`,innerType:e})}var Ba=n(`ZodNullable`,(e,t)=>{Nn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Va(e){return new Ba({type:`nullable`,innerType:e})}var Ha=n(`ZodDefault`,(e,t)=>{Pn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ua(e,t){return new Ha({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():re(t)}})}var Wa=n(`ZodPrefault`,(e,t)=>{In.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e,t){return new Wa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():re(t)}})}var Ka=n(`ZodNonOptional`,(e,t)=>{Ln.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e,t){return new Ka({type:`nonoptional`,innerType:e,...b(t)})}var Ja=n(`ZodCatch`,(e,t)=>{zn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ya(e,t){return new Ja({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Xa=n(`ZodPipe`,(e,t)=>{Bn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.in=t.in,e.out=t.out});function Za(e,t){return new Xa({type:`pipe`,in:e,out:t})}var Qa=n(`ZodReadonly`,(e,t)=>{Hn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e){return new Qa({type:`readonly`,innerType:e})}var eo=n(`ZodCustom`,(e,t)=>{Wn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r)});function to(e,t){return Yr(eo,e??(()=>!0),t)}function no(e,t={}){return Xr(eo,e,t)}function ro(e){return Zr(e)}var F=function(e){return e.Article=`article`,e.AudioDocument=`audiodocument`,e.AudioVisualDocument=`audiovisualdocument`,e.Book=`book`,e.Bookitem=`bookitem`,e.Conference=`conference`,e.Document=`document`,e.Image=`image`,e.Issue=`issue`,e.Journal=`journal`,e.Preprint=`preprint`,e.Proceeding=`proceeding`,e.Report=`report`,e.Unknown=`unknown`,e.Webpage=`webpage`,e}({}),io=M([N(F.Book),N(F.Bookitem),N(F.Conference),N(F.Document),N(F.Report),N(F.Proceeding),N(F.Unknown)]),ao=M([N(F.Article),N(F.Conference),N(F.Issue),N(F.Journal),N(F.Preprint),N(F.Proceeding),N(F.Unknown)]),oo=j({artnum:O(),atitle:O(),aufirst:O(),aulast:O(),auinit:O(),auinit1:O(),auinitm:O(),ausuffix:O(),au:A(O()),aucorp:O(),bici:O(),btitle:O(),chron:O(),coden:O(),date:O(),edition:O(),eissn:O(),epage:O(),externalDBID:O(),externalDocID:O(),genre:Na(F),id:O(),isbn:O(),issn:O(),issue:O(),jtitle:O(),pages:O(),part:O(),place:O(),pub:O(),quarter:O(),rft_id:A(O()),series:O(),sici:O(),spage:O(),ssn:O(),stitle:O(),title:O(),tpages:O(),volume:O()}).partial(),so=j({bibid:O(),doi:O(),uri:O()}).partial(),co=oo.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),lo=oo.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),uo=oo.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),fo=oo.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),po=oo.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),mo=oo.pick({au:!0,date:!0,title:!0}).partial(),ho=j({...oo.shape,...so.shape}),I=(e,t)=>({...t,genre:e}),L=(e,t)=>({...t,genre:e}),R=e=>({...e,genre:F.AudioVisualDocument}),go=e=>({...e,genre:F.Image}),_o=e=>({...e,genre:F.Document}),vo=e=>({...e,genre:F.Webpage}),yo=e=>Object.keys(e.shape),bo=yo(oo),xo=yo(so),So=(e,t,n)=>{if(n.length>0&&typeof n[0]==`string`){let r=t.startsWith(`rft_`)?t:`rft.${t}`;e.append(r,n[0])}},Co=(e,t,n)=>{e.append(t,n)},wo=(e,t,n)=>{e.append(`rft.${t}`,n)},To=e=>xo.includes(e),Eo=e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{Array.isArray(n)?So(t,e,n):typeof n==`string`&&n&&(To(e)?Co(t,e,n):wo(t,e,n))}),t},Do=(e,t,n,r)=>{let i=t.getAll(n).filter(e=>!!e).map(e=>e.trim());return i.length===0?e:{...e,[r]:i}},Oo=e=>{let t=ko(e),n=(e,n)=>{if(n===`au`)return Do(e,t,`rft.au`,`au`);if(n===`rft_id`)return Do(e,t,`rft_id`,`rft_id`);let r=To(n)?n:`rft.${n}`,i=t.get(r);return i?{...e,[n]:i.trim()}:e},r=[...bo,...xo].reduce(n,{});return Object.keys(r).length===0?null:r},ko=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Ao(e){return typeof e==`string`?Object.values(F).includes(e):!1}var jo=function(e){return e.CA=`CA`,e.EUAPAC=`EUAPAC`,e}({}),Mo=j({id:O(),name:O(),region:Na(jo)}),No=j({tenants:A(Mo)}),Po=9*1024*1024,Fo=j({url:$i({error:e=>e.input===void 0?`should have the required string property "url"`:`"url" must be a string`}),html:O({error:e=>e.input===void 0?`should have the required string property "html"`:void 0}).max(Po,{error:`"html" should be a string with a MAX Length of ${Po}`}),tenantCode:O({error:e=>e.input===void 0?`should have the required string property "tenantCode"`:void 0}).min(1,{error:`"tenantCode" must be a string`}),region:Na([jo.EUAPAC,jo.CA],{error:e=>e.input===void 0?`should have the required string property "region"`:`"region" must be a string of EUAPAC or CA`})});function Io(e){return Fo.safeParse(e).success}var Lo=j({name:O(),region:Na(jo),apps:ja(O(),O())}),Ro=ja(O(),Lo),zo=e=>Lo.safeParse(e).success,Bo=e=>Ro.safeParse(e).success;function Vo(e){return Mo.safeParse(e).success}function Ho(e){return typeof e==`string`&&Object.keys(jo).includes(e)}var Uo=e=>{if(!Bo(e))throw Error(`Error: the customer list data is invalid.`);return{tenants:Object.entries(e).map(([e,t])=>Wo(e,t))}},Wo=(e,t)=>{if(!zo(t))throw Error(`Invalid customer: ${t}`);let{name:n,region:r}=t,i={id:e,name:n,region:r};if(!Vo(i))throw Error(`Invalid tenant: ${JSON.stringify(i)}`);return i},Go=j({parserType:O(),parserName:O().nullable(),referrer:O()}),Ko=j({bookmarkingWorkflowUrl:ba(),resource:ba()}),qo=j({bookmarkingWorkflowUrl:O(),resource:ba()}),Jo=j({bookmarkingWorkflowUrl:ba(),resource:ho}),Yo=j({z3988SearchResult:N(!0)}),Xo=j({summonSearchResult:N(!0)}),Zo=M([qo,Ko,Jo,Yo,Xo]),Qo=j({meta:Go}).and(Zo);function $o(e){return{bookmarkingWorkflowUrl:e,resource:null}}function z(){return{bookmarkingWorkflowUrl:null,resource:null}}function B(e){return{bookmarkingWorkflowUrl:null,resource:e}}function es(){return{z3988SearchResult:!0}}function ts(){return{summonSearchResult:!0}}var ns=e=>{let t=e.getAttribute(`title`);return t?Oo(t):null},rs=({document:e})=>{let t=Array.from(e.querySelectorAll(`.Z3988`));if(t.length===0)return z();let n=t.map(ns).find(e=>e!==null);return n?B(n):z()},is=e=>{let t=Array.from(e.querySelectorAll(`.author > a`)).map(e=>e.textContent.trim()).filter(Boolean);return t.length?t:void 0},as=e=>e.querySelector(`#rpi-attribute-book_details-edition > .rpi-attribute-value > span`)?.textContent??void 0,os=e=>{let t=e.querySelector(`#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span`)?.textContent??void 0,n=e.querySelector(`#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span`)?.textContent??void 0;if(t&&n)return`${t},${n}`;if(t)return t;if(n)return n},ss=e=>e.querySelector(`#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span`)?.textContent??void 0,cs=e=>e.querySelector(`#rpi-attribute-book_details-publisher > .rpi-attribute-value > span`)?.textContent??void 0,ls=e=>e.querySelector(`#rpi-attribute-book_details-series > .rpi-attribute-value > a`)?.textContent??void 0,us=e=>{let t=e.querySelector(`#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span`)?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},ds=({document:e})=>{let t=is(e),n=as(e),r=os(e),i=ss(e),a=cs(e),o=ls(e),s=e.getElementById(`productTitle`)?.textContent.trim()??void 0,c=us(e);return{bookmarkingWorkflowUrl:null,resource:I(F.Book,{au:t,date:i,edition:n,isbn:r,pub:a,series:o,title:s,tpages:c})}},V=(e,t,n)=>{let r=H(e,t,n);return r.length>0?r[0]:void 0},H=(e,t,n)=>Array.from(e.querySelectorAll(`meta[${t}='${n}']`)).map(e=>e.getAttribute(`content`)).filter(e=>!!e?.trim()),fs=e=>{let t=new Map,n=e.split(`;`).filter(e=>!!e);for(let e of n){let[n,r,i]=e.split(`:`);t.set(n,{type:r,value:i})}return t},U=function(e){return e[e.None=0]=`None`,e[e.Book=1]=`Book`,e[e.Chapter=2]=`Chapter`,e[e.Journal=3]=`Journal`,e[e.Article=4]=`Article`,e[e.AudioVisual=5]=`AudioVisual`,e[e.Webpage=6]=`Webpage`,e[e.Document=7]=`Document`,e}({}),ps=e=>{if(!e)return;let t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},ms=e=>ps(e.querySelector(`#publication_date p`)?.textContent.trim()??V(e,`name`,`bepress_citation_date`)),hs=e=>({spage:V(e,`name`,`bepress_citation_firstpage`),epage:V(e,`name`,`bepress_citation_lastpage`)}),gs=e=>{let t=/https?:\/\/doi\.org\/(.+)/i,n=(e.querySelector(`#source p`)?.textContent.trim())?.match(t);if(n?.length===2)return n[1];let r=(e.querySelector(`#recommended_citation p a`)?.textContent.trim())?.match(t);if(r?.length===2)return r[1]},_s=e=>{let t=[],n=e.querySelectorAll(`tbody td`);for(let e of n){let n=e.querySelector(`strong`);if(n&&!n.querySelector(`a`)){let e=n.textContent.trim();e&&t.push(e)}}return t},vs=e=>V(e,`name`,`bepress_citation_title`)??e.querySelector(`title`)?.textContent.trim(),ys=e=>H(e,`name`,`author`),bs=e=>V(e,`name`,`bepress_citation_publisher`),xs=e=>V(e,`name`,`bepress_citation_pdf_url`),Ss=(e,t)=>{if(t.includes(`/etd/`))return U.Document;if(t.includes(`/sophpm_music/`)||t.includes(`/streaming/`))return U.AudioVisual;if(t.includes(`/vol`))return U.Article;if(t.includes(`/facpub`)||t.includes(`/studentpub/`)){let t={"book chapter":U.Book,"conference paper":U.Book,"peer-reviewed article":U.Article,other:U.Document},n=e.querySelector(`#document_type p`)?.textContent.toLowerCase().trim();return n?t[n]:void 0}return U.Journal},Cs=e=>{let t=vs(e),n=ys(e),r=ms(e),i=V(e,`name`,`bepress_citation_journal_title`),a=V(e,`name`,`bepress_citation_volume`),o=V(e,`name`,`bepress_citation_issue`),{epage:s,spage:c}=hs(e),l=xs(e),u=gs(e);return L(F.Article,{atitle:t,jtitle:i,au:n,date:r,volume:a,issue:o,epage:s,spage:c,doi:u,uri:l})},ws=(e,t)=>{let n=e.querySelector(`.inherit-title a`)?.textContent.trim()??vs(e),r=_s(e),i=ms(e),a=bs(e),o=gs(e);return L(F.Journal,{jtitle:n,au:r,date:i,pub:a,doi:o,uri:t})},Ts=e=>{let t=vs(e),n=ys(e),r=ms(e),i=bs(e),a=xs(e),o=e.querySelector(`#document_type p`)?.textContent.toLowerCase().trim();if(o===`book chapter`){let o=e.querySelector(`#source p`)?.textContent.trim();return I(F.Bookitem,{pub:i,atitle:t,btitle:o,au:n,date:r,uri:a})}let s=gs(e);return I(o===`conference paper`?F.Conference:F.Document,{pub:i,title:t,au:n,date:r,doi:s,uri:a})},Es=(e,t)=>R({title:vs(e),au:ys(e),date:ms(e),pub:bs(e),uri:t}),Ds=e=>{let t=vs(e),n=ys(e),r=ms(e);return _o({pub:bs(e),title:t,au:n,date:r,uri:xs(e)})},Os=({url:e,document:t})=>{switch(Ss(t,e)){case U.Article:return B(Cs(t));case U.Journal:return B(ws(t,e));case U.Book:return B(Ts(t));case U.AudioVisual:return B(Es(t,e));case U.Document:return B(Ds(t));default:return z()}},ks=e=>{if(e)return e.replace(/[^0-9]/g,``)},As=e=>Array.from(e.querySelectorAll(`.author-source-list li a`)).filter(e=>e.childNodes.length>0).map(e=>e.childNodes[0].textContent?.trim()).filter(e=>!!e),js=e=>e.querySelector(`.article-header`)?.querySelector(`h1 span`)?.textContent.trim(),Ms=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:`Elsevier Inc.`}),Ns=e=>{let t=e.querySelector(`.article-meta`);if(!t)return{};let n=t.querySelector(`.issue`)?.textContent??void 0,r=t.querySelector(`.title`)?.textContent.trim()??void 0,[i,a]=(n?.split(`,`)??[]).map(e=>e.trim());return{volume:ks(i),issue:ks(a),jtitle:r}},Ps=e=>{let t=e.querySelector(`.article-header .source`)?.textContent,n=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],[r,i]=((t?.match(/Pages (\d+-\d+)/))?.[1].split(`-`)??[]).map(e=>e.trim()),{jtitle:a,volume:o,issue:s}=Ns(e);return B(L(F.Article,{au:As(e),atitle:js(e),spage:r,epage:i,date:n,jtitle:a,volume:o,issue:s}))},Fs=e=>{let[t,n]=e.querySelectorAll(`.source`),{date:r,pub:i}=Ms(n),[a,o]=(e.querySelector(`.browse__book-toc`)?.querySelector(`h1`)?.textContent.split(`,`)??[]).map(e=>e.trim());return B(I(F.Book,{btitle:a,edition:o,pub:i,au:t.textContent?[t.textContent]:void 0,date:r}))},Is=e=>{let t=e.querySelector(`.article-meta`);if(!t)return{};let n=t.querySelector(`.edition`)?.textContent??void 0,r=t.querySelector(`.title`)?.textContent.trim()??void 0,{date:i,pub:a}=Ms(t.querySelector(`.copyright`));return{edition:n,btitle:r,date:i,pub:a}},Ls=e=>{let{edition:t,btitle:n,date:r,pub:i}=Is(e),[a,o]=(((e.querySelector(`.article-header .source`)?.textContent)?.match(/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i))?.[1].split(`-`)??[]).map(e=>e.trim());return B(I(F.Bookitem,{au:As(e),atitle:js(e),btitle:n,edition:t,pub:i,date:r,spage:a,epage:o}))},Rs=/^[0-9X]$/,zs=e=>{if(!e)return;let t=``;for(let n of e)Rs.test(n)&&(t+=n);if(t)return t},Bs=(e,t)=>{let n=e.querySelector(`.c-cksc-content-header__title`)?.textContent.trim(),r=e.querySelector(`.c-cksc-content-nice__button`)?.textContent.trim(),i=e.querySelector(`.c-cksc-content-nice__date`)?.textContent.trim(),a=zs(e.evaluate(`//p[contains(text(), "ISBN")]`,e,null,XPathResult.ANY_TYPE).iterateNext()?.textContent);return B({genre:F.Document,title:n,pub:r,date:i,uri:t,isbn:a})},Vs=e=>e.querySelector(`.browse-toc`)??e.querySelector(`.browse__journal`),Hs=e=>(Vs(e)?.querySelector(`h1`)?.firstElementChild)?.textContent.trim(),Us=e=>{let t=Vs(e),n=t?.querySelector(`figure figcaption.source`);if(n){let[e,t,r]=n.textContent.split(`,`).map(e=>e.trim());return{date:e,volume:ks(t),issue:ks(r)}}let[r,i]=(t?.querySelector(`p`)?.textContent)?.split(`,`)??[];return{date:t?.querySelector(`.source span`)?.textContent??void 0,volume:ks(r),issue:ks(i)}},Ws=e=>{let{date:t,volume:n,issue:r}=Us(e);return B(L(F.Journal,{jtitle:Hs(e),date:t,volume:n,issue:r}))},Gs=function(e){return e.Book=`Book`,e.Chapter=`Book Chapter`,e.Article=`Full Text Article`,e.Journal=`Journal`,e.Guideline=`Guideline`,e}(Gs||{}),Ks=e=>Object.values(Gs).includes(e),qs=(e,t)=>{let n=e.querySelector(`.content-type`)??e.querySelector(`.c-cksc-content-header__content-type`);if(!n)return t.includes(`journal`)?Gs.Journal:void 0;let r=n.textContent;if(r&&Ks(r))return r},Js=({url:e,document:t})=>{switch(qs(t,e)){case Gs.Book:return Fs(t);case Gs.Chapter:return Ls(t);case Gs.Article:return Ps(t);case Gs.Journal:return Ws(t);case Gs.Guideline:return Bs(t,e);case void 0:return z()}},Ys=j({"@context":O()}),Xs=e=>Ys.safeParse(e).success,Zs=`script[type="application/ld+json"]`,Qs=e=>Array.from(e.querySelectorAll(Zs)),$s=e=>e.querySelector(Zs),ec=e=>{let t=e.textContent;if(!t)return null;try{let e=JSON.parse(t);if(Xs(e))return e}catch{return null}return null},tc=j({"@id":O(),"@type":O(),author:j({"@id":O()}).optional(),datePublished:O().optional(),dateModified:O().optional(),description:O().optional(),inLanguage:O().optional(),isPartOf:j({"@id":O()}).optional(),name:O().optional(),url:O().optional()}),nc=Ys.extend({"@graph":A(tc)}),rc=e=>nc.safeParse(e).success,ic=e=>{let t=Qs(e);if(t.length===0)return null;let n=t.map(ec).filter(rc).map(e=>e[`@graph`]);return n.length===1?n[0]:null},ac=(e,t)=>e.find(e=>e[`@type`]===t)??null,oc=(e,t)=>e.find(e=>e[`@id`]===t)??null,sc=e=>{let t=ac(e,`WebPage`);if(!t)return null;let n=t.author?oc(e,t.author[`@id`]):void 0;return vo({au:n?.name?[n.name]:void 0,date:t.datePublished,title:t.name})},cc=({document:e})=>{let t=ic(e);return t?{bookmarkingWorkflowUrl:null,resource:sc(t)}:z()},lc=()=>z(),uc=function(e){return e.Journal=`journal`,e.Article=`article`,e}(uc||{}),dc=e=>{let{pathname:t}=new URL(e);if(t.startsWith(`/toc/`))return uc.Journal;if(t.startsWith(`/article/`))return uc.Article},fc=e=>{let t=e.querySelector(`header h1 span`)?.firstChild?.textContent?.trim(),n=(e.querySelector(`header p span`)?.textContent.trim())?.match(/\d{4}-\d{3}[\dX]/g)??[],[r,i]=[n[0],n[1]],a=e.evaluate(`//dt[contains(text(), "Publisher")]/following-sibling::dd/a`,e,null,XPathResult.STRING_TYPE).stringValue.trim();return B(L(F.Journal,{pub:a,jtitle:t,issn:r,eissn:i}))},pc=e=>{let t,n,r=H(e,`name`,`citation_issn`);return r.length===2?(t=r[1],n=r[0]):t=r[0],{eissn:t,issn:n}},mc=e=>{let t=V(e,`name`,`citation_journal_title`),n=V(e,`name`,`citation_title`),r=H(e,`name`,`citation_author`),i=V(e,`name`,`citation_doi`),{eissn:a,issn:o}=pc(e),s=V(e,`name`,`citation_publisher`),c=V(e,`name`,`citation_publication_date`),l=V(e,`name`,`citation_volume`),u=V(e,`name`,`citation_issue`),d=V(e,`name`,`citation_firstpage`),f=V(e,`name`,`citation_lastpage`);return B(L(F.Article,{jtitle:t,atitle:n,au:r,doi:i,eissn:a,issn:o,pub:s,date:c,volume:l,issue:u,spage:d,epage:f}))},hc=({document:e,url:t})=>{switch(dc(t)){case uc.Journal:return fc(e);case uc.Article:return mc(e);case void 0:return z()}},gc=e=>{let t=V(e,`name`,`pbContext`);if(!t)return U.None;let n=fs(t);switch(n.has(`page`)?n.get(`page`)?.value:null){case`Article/Chapter View`:return U.Article;case`Table of Contents`:return U.Journal;default:return U.None}},_c=e=>{let t=e.querySelector(`meta[property="article:author"]`)?.getAttribute(`content`)?.split(`,`).map(e=>e.trim());return t&&t.length>0?t:void 0},vc=e=>{let t=new Map,n=Array.from(e.querySelectorAll(`.rlist>li>span`)).map(e=>e.textContent.trim()).join(``),r=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(n);r&&t.set(`issn`,r[1]);let i=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(n);return i&&t.set(`eissn`,i[1]),t},yc=e=>e.querySelector(`span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]`)?.textContent??void 0,bc=e=>e.querySelector(`span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]`)?.textContent??void 0,xc=e=>e.querySelector(`meta[name="dc.Identifier"][scheme="doi"]`)?.getAttribute(`content`)??void 0,Sc=e=>e.querySelector(`h1`)?.textContent??void 0,Cc=e=>{let t=new Map,n=e.querySelector(`h2.heading-m`)?.textContent,r=n?.match(/Issue\s+(\d+(?:-\d+)?)/);r&&t.set(`issue`,r[1]);let i=n?.match(/Volume\s+(\d+)/);i&&t.set(`volume`,i[1]);let a=n?.match(/(\d{4})$/);return a&&t.set(`date`,a[1]),t},wc=e=>{let t=_c(e.document),n=V(e.document,`name`,`dc.Date`),r=xc(e.document),i=vc(e.document),a=i.get(`issn`),o=i.get(`eissn`),s=bc(e.document),c=V(e.document,`name`,`citation_journal_title`),l=V(e.document,`name`,`dc.Publisher`),u=V(e.document,`name`,`dc.Title`),d=yc(e.document);return L(F.Article,{au:t,date:n,eissn:o,issn:a,issue:s,jtitle:c,pub:l,title:u,volume:d,doi:r})},Tc=e=>{let t=vc(e.document),n=t.get(`issn`),r=t.get(`eissn`),i=Sc(e.document),a=Cc(e.document),o=a.get(`issue`),s=a.get(`volume`),c=a.get(`date`);return L(F.Journal,{eissn:r,issn:n,jtitle:i,title:i,issue:o,volume:s,date:c})},Ec=e=>{switch(gc(e.document)){case U.Article:return B(wc(e));case U.Journal:return B(Tc(e));default:return z()}},Dc=e=>{let t=V(e,`name`,`citation_type`),n=V(e,`name`,`citation_article_type`);return t===`JOUR`&&n?U.Article:t===`CHP`?U.Chapter:e.querySelector(`.book-edition-year`)?.textContent.includes(`Book`)?U.Book:e.getElementById(`journal-title`)?U.Journal:U.None},Oc=e=>V(e,`name`,`citation_doi`)??V(e,`name`,`dc.identifier`)??e.querySelector(`.doi .anchor-text`)?.textContent??void 0,kc=e=>{let t=Array.from(e.querySelectorAll(`.kf-details .kf-detail-item:has(h3)`)),n=new Map;for(let e of t){let t=e.querySelector(`h3`)?.textContent,r=e.querySelector(`p`)?.textContent;t&&r&&n.set(t,r)}return n},Ac=(e,t)=>{let n=Array.from(e.querySelectorAll(t)).map(e=>e.textContent).filter(e=>!!e);return n.length>0?n:void 0},jc=e=>{let t=e.querySelector(`.js-issn`)?.textContent;if(t)return t.replace(`Online ISSN: `,``)},Mc=e=>{let t=e.get(`DOI`);if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},Nc=e=>{let t=kc(e),n=V(e,`property`,`og:title`),r=V(e,`property`,`og:book:isbn`),i=t.get(`Published`),a=Ac(e,`.authors-container .author-detail h3`),o=Oc(e)??Mc(t);return I(F.Book,{au:a,date:i,doi:o,isbn:r,title:n})},Pc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`property`,`og:book:isbn`),r=V(e,`name`,`citation_publication_date`),i=Ac(e,`.author-group .button-link-text`),a=V(e,`name`,`citation_firstpage`),o=V(e,`name`,`citation_lastpage`),s=V(e,`name`,`citation_publisher`),c=Oc(e),l=V(e,`name`,`citation_inbook_title`)??e.querySelector(`.publication-title`)?.textContent??void 0;return I(F.Bookitem,{au:i,btitle:l,date:r,doi:c,epage:o,isbn:n,pub:s,spage:a,title:t})},Fc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`name`,`citation_issn`),r=V(e,`name`,`citation_publication_date`),i=Ac(e,`.author-group .button-link-text`),a=V(e,`name`,`citation_publisher`),o=V(e,`name`,`citation_firstpage`),s=V(e,`name`,`citation_issue`),c=V(e,`name`,`citation_volume`),l=Oc(e),u=V(e,`name`,`citation_journal_title`)??e.querySelector(`.publication-title`)?.textContent??void 0;return L(F.Article,{au:i,jtitle:u,date:r,doi:l,issn:n,issue:s,pub:a,spage:o,title:t,volume:c})},Ic=e=>{let t=e.getElementById(`journal-title`)?.textContent??void 0,n=jc(e);return L(F.Journal,{issn:n,title:t})},Lc=({document:e})=>{switch(Dc(e)){case U.Book:return B(Nc(e));case U.Chapter:return B(Pc(e));case U.Article:return B(Fc(e));case U.Journal:return B(Ic(e));default:return z()}},Rc=e=>{let t=V(e,`name`,`pbContext`);return t&&fs(t).has(`article`)?U.Article:U.Journal},zc=e=>{let t=e.querySelector(`.itemPageRangeHistory`);if(!t)return;let n=Array.from(t.childNodes).find(e=>e.textContent?.trim().startsWith(`Page`));if(n)return n.textContent?.replace(/Pages?/,``).trim()??void 0},Bc=e=>{let t=e.querySelector(`.issue-heading`)?.textContent;if(t)return t.split(`,`)[0]?.replace(`Volume`,``).trim()},Vc=e=>{let t=e.querySelector(`.issue-heading .nav-toc-list`)?.textContent;if(t)return t.replace(`Issue`,``).trim()},Hc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`name`,`dc.Publisher`),r=V(e,`name`,`dc.Date`),i=V(e,`name`,`publication_doi`),a=V(e,`name`,`citation_journal_title`),o=H(e,`name`,`dc.Creator`),s=Bc(e),c=Vc(e),l=zc(e),u=l?.includes(`-`)?l.split(`-`)[0]:l,d=l?.includes(`-`)?l.split(`-`)[1]:l;return L(F.Article,{au:o,jtitle:a,date:r,doi:i,issue:c,pub:n,spage:u,epage:d,title:t,volume:s})},Uc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`name`,`publication_doi`);return L(F.Journal,{doi:n,title:t})},Wc=({document:e})=>{switch(Rc(e)){case U.Article:return B(Hc(e));case U.Journal:return B(Uc(e));default:return z()}},Gc=e=>Zo.safeParse(e).success,Kc=e=>Qo.safeParse(e).success,qc=e=>Go.safeParse(e).success;function Jc(e){return qo.safeParse(e).success}function Yc(e){return Jo.safeParse(e).success}function Xc(e){return Yo.safeParse(e).success}function Zc(e){return Xo.safeParse(e).success}function Qc(e){return Ko.safeParse(e).success}var $c=e=>Array.from(e.querySelectorAll(`tr th`)).find(e=>e.textContent.trim()===`DOI:`)?.nextElementSibling?.querySelector(`span[property="identifier"]`)?.textContent??void 0,el=e=>{let t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},tl=e=>{let{url:t,document:n}=e,r=rs(e);if(!Yc(r))return r;let i=$c(n);return i&&(r.resource.rft_id=[`info:doi/${i}`]),r.resource.bibid=el(t),r},nl=Ys.extend({"@type":N(`VideoObject`),name:O(),author:O(),genre:O(),description:O(),uploadDate:O(),duration:O(),thumbnailUrl:A(O())}),rl=e=>nl.safeParse(e).success,il=e=>{let t=Qs(e);if(t.length===0)return null;let n=t.map(ec).filter(rl);return n.length===1?n[0]:null},al=({url:e,document:t})=>{let n=il(t);return n?{bookmarkingWorkflowUrl:null,resource:R({au:[n.author],date:n.uploadDate,title:n.name,uri:e})}:z()},ol=e=>V(e,`name`,`doi`)??V(e,`name`,`DOI`)??V(e,`name`,`citation_doi`)??V(e,`name`,`dc.identifier`)??V(e,`name`,`prism.doi`)??void 0,sl=e=>{let t=e.editor?.map(e=>e.name)??[],n=[...e.author?.map(e=>e.name)??[],...t];if(n.length!==0)return n},cl=function(e){return e.Book=`Book`,e.Journal=`Journal`,e.Periodical=`Periodical`,e.PublicationVolume=`PublicationVolume`,e.ScholarlyArticle=`ScholarlyArticle`,e.VideoObject=`VideoObject`,e.WebPage=`WebPage`,e}({}),ll=function(e){return e.Article=`article`,e.Book=`book`,e.Paper=`Paper`,e.Video=`video.other`,e.Website=`website`,e}({}),W=function(e){return e.Article=`/article/`,e.Book=`/book/`,e.Chapter=`/chapter/`,e.Video=`/video/`,e.ReferenceWorkEntry=`/referenceworkentry/`,e.ReferenceWork=`/referencework/`,e.Protocol=`/protocol/`,e.Collections=`/collections/`,e.Journal=`/journal/`,e.JournalIssue=`/volumes-and-issues/`,e}({}),ul=j({"@type":N(cl.ScholarlyArticle),author:A(j({"@type":O(),name:O()})).optional(),editor:A(j({"@type":O(),name:O()})).optional(),datePublished:O().optional(),headline:O().optional(),issn:A(O()).optional(),pageStart:O().optional(),pageEnd:O().optional(),isPartOf:j({"@type":M([O(),A(O())]),name:O(),issn:A(O()).optional(),volumeNumber:O().optional(),isbn:A(O()).optional()}),publisher:j({"@type":O(),name:O()}).optional()}),dl=e=>ul.safeParse(e).success,fl=Ys.extend({"@type":N(cl.WebPage),mainEntity:ul}),pl=e=>fl.safeParse(e).success,ml=j({"@type":A(O()),name:O().optional(),issn:A(O()),volumeNumber:O().optional()}),hl=e=>ml.safeParse(e).success,gl=(e,t)=>V(e,`name`,`citation_issn`)??V(e,`name`,`prism.issn`)??(dl(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),_l=(e,t)=>{let n=sl(t),r=V(e,`name`,`citation_online_date`),i=ol(e),a=V(e,`name`,`citation_issue`),o=gl(e,t),s=hl(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,l=t.pageEnd,u=t.headline,d=t.isPartOf.name,f=hl(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return L(F.Article,{au:n,date:r,doi:i,issue:a,eissn:o,issn:s,spage:c,epage:l,atitle:u,jtitle:d,volume:f})},vl=Ys.extend({"@type":N(cl.Book),copyrightYear:O().optional(),author:A(j({"@type":O(),name:O()})).optional(),editor:A(j({"@type":O(),name:O()})).optional(),isbn:O().optional(),name:O().optional(),numberOfPages:ga().optional(),publisher:j({"@type":O(),name:O()}).optional()}),yl=e=>vl.safeParse(e).success,bl=function(e){return e.BOOK_TITLE=`Book Title`,e.AUTHORS=`Authors`,e.SERIES_TITLE=`Series Title`,e.DOI=`DOI`,e.PUBLISHER=`Publisher`,e.SOFTCOVER_ISBN=`Softcover ISBN`,e.EBOOK_ISBN=`eBook ISBN`,e.SERIES_ISSN=`Series ISSN`,e.SERIES_EISSN=`Series E-ISSN`,e.EDITION_NUMBER=`Edition Number`,e.NUMBER_OF_PAGES=`Number of Pages`,e}(bl||{}),xl=e=>{let t=e.querySelectorAll(`.c-bibliographic-information__list-item`),n=new Map;return t.forEach(e=>{let t=e.querySelector(`.u-text-bold`)?.textContent.trim(),r=e.querySelector(`.c-bibliographic-information__value`)?.textContent.trim();t&&r&&n.set(t,r)}),n},Sl=(e,t)=>{let n=xl(e),r=sl(t),i=t.copyrightYear?.toString(),a=ol(e)??n.get(bl.DOI),o=t.name??n.get(bl.BOOK_TITLE),s=t.isbn??n.get(bl.SOFTCOVER_ISBN),c=t.numberOfPages?.toString()??n.get(bl.NUMBER_OF_PAGES),l=t.publisher?.name??n.get(bl.PUBLISHER);return I(F.Book,{au:r,date:i,doi:a,title:o,isbn:s,tpages:c,pub:l})},Cl=j({"@type":N(`Periodical`),name:O(),url:O(),issn:A(O()),editor:A(j({givenName:O(),familyName:O()})),publisher:j({name:O()}),description:O()}),wl=e=>Cl.safeParse(e).success,Tl=e=>{let t=e.editor.map(({givenName:e,familyName:t})=>`${e} ${t}`),n=e.name,[r,i]=e.issn,a=e.publisher.name;return L(F.Journal,{au:t,jtitle:n,eissn:r,issn:i,pub:a})},El=j({"@type":N(cl.VideoObject),name:O().optional(),description:O().optional(),thumbnailUrl:O().optional(),uploadDate:O().optional(),contentUrl:O().optional(),duration:O().optional()}),Dl=e=>El.safeParse(e).success,Ol=(e,t)=>{let n=Array.from(e.querySelectorAll(`dd[data-test="video-segment-author"]`)).map(e=>e.textContent.trim()).filter(e=>!!e),r=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,i=t?.name??V(e,`property`,`og:title`)??void 0,a=e.querySelector(`video-about-doi`)?.textContent??void 0;return R({au:n.length>0?n:void 0,date:r,doi:a,title:i})},kl=e=>vo({title:V(e,`property`,`og:title`)}),Al=(e,t)=>{let n=V(t,`property`,`og:type`);return n===ll.Article&&e.includes(W.Article)?U.Article:n===ll.Book&&(e.includes(W.Book)||e.includes(W.ReferenceWork))?U.Book:n===ll.Paper&&e.includes(W.Chapter)?U.Chapter:n===ll.Paper&&(e.includes(W.ReferenceWorkEntry)||e.includes(W.Protocol))?U.Article:n===ll.Video&&e.includes(W.Video)?U.AudioVisual:n===ll.Website&&(e.includes(W.Collections)||e.includes(W.JournalIssue))?U.Webpage:n===ll.Website&&e.includes(W.Journal)?U.Journal:U.None},jl=(e,t,n)=>e===U.AudioVisual&&Dl(n)?B(Ol(t,n)):e===U.Book&&yl(n)?B(Sl(t,n)):(e===U.Chapter||e===U.Article)&&dl(n)?B(_l(t,n)):e===U.Article&&pl(n)?B(_l(t,n.mainEntity)):e===U.Journal&&wl(n)?B(Tl(n)):z(),Ml=({url:e,document:t})=>{let n=Al(e,t);if(n===U.Webpage)return B(kl(t));let r=$s(t);if(!r)return z();let i=ec(r);return i?jl(n,t,i):z()},G=function(e){return e.PrintIsbn=`Print ISBN`,e.OnlineIsbn=`Online ISBN`,e.Doi=`DOI`,e.FirstPublished=`First published`,e.OnlineIssn=`Online ISSN`,e.PrintIssn=`Print ISSN`,e}(G||{}),Nl=new Set([G.PrintIsbn,G.OnlineIsbn,G.Doi,G.FirstPublished,G.OnlineIssn,G.PrintIssn]),Pl=j({content:j({item:j({title:O(),"published-date":O()}),group:j({volume:O(),issue:O()}),series:j({title:O(),type:O(),eissn:O()})}).optional()}),Fl=(e,t)=>{if(!e)return;let n=e.indexOf(t);return n>-1?e.substring(0,n):e},Il=e=>{let t=/\d+/.exec(e);if(t?.[0])return t[0]},Ll=e=>{let t=e.querySelectorAll(`script`),n=Array.from(t).find(e=>e.textContent.includes(`adobeDataLayerJson`))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(n?.length===2)try{let e=JSON.parse(n[1]);return Pl.parse(e)}catch{return}},Rl=(e,t)=>{let n=V(e,`property`,`og:type`),r=t.includes(`epdf`);return n===`Book`||n===`books.book`?U.Book:n===`Chapter`?U.Chapter:n===`Journal`?U.Journal:n===`Article`||r?U.Article:U.None},zl=e=>{let t=H(e,`name`,`citation_author`),n=Array.from(e.querySelectorAll(`#product-details-content .product-authors`)).map(e=>e.textContent).filter(e=>!!e),r=new Set([...t,...n]);return r.size>0?[...r]:void 0},Bl=e=>{let t=Array.from(e.querySelectorAll(`#product-details-content .text-piped p`)).map(e=>e.textContent).find(e=>e.endsWith(` pages`));if(t)return Il(t)},Vl=e=>{let t=new Map,n=Array.from(e.querySelectorAll(`.journal-info-container .info-block`)).flatMap(e=>Array.from(e.querySelectorAll(`.info_label`)));for(let e of n){let n=e.nextElementSibling;if(!n?.classList.contains(`info_value`))continue;let r=Fl(e.textContent,`:`),i=Fl(n.textContent,`:`);!r||!i||Nl.has(r)&&t.set(r,i)}return t},Hl=(e,t)=>V(e,`property`,`books:release_date`)??V(e,`name`,`citation_online_date`)??t.get(G.FirstPublished)??void 0,Ul=(e,t)=>V(e,`name`,`dc.identifier`)??V(e,`name`,`citation_doi`)??V(e,`name`,`publication_doi`)??t.get(G.Doi)??void 0,Wl=(e,t)=>{let n=new Set([V(e,`property`,`books:isbn`),t.get(G.PrintIsbn),t.get(G.OnlineIsbn)].filter(e=>!!e));return n.size>0?[...n].join(`,`):void 0},Gl=e=>{let t,n,r=e.querySelector(`.cover-image__details div:first-of-type`);if(r?.childNodes.length===2){let[e,i]=r.childNodes;e.textContent&&(t=Il(e.textContent)),i.textContent&&(n=Il(i.textContent))}return{volume:t,issue:n}},Kl=e=>{let t=Array.from(e.querySelectorAll(`.authors .author`)).map(e=>e.textContent.trim().replace(`,`,``)).filter(e=>!!e);return t.length>0?t:void 0},ql=e=>{let t=Array.from(e.querySelectorAll(`.details-section .details-entry`)),n=t.find(e=>e.querySelector(`.details-label`)?.textContent.trim()===`ISSN`),r=t.find(e=>e.querySelector(`.details-label`)?.textContent.trim()===`eISSN`),i,a;return n&&(i=n.querySelector(`.details-value`)?.textContent.trim()),r&&(a=r.querySelector(`.details-value`)?.textContent.trim()),{issn:i,eissn:a}},Jl=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};let t=e.content.group.volume,n=e.content.group.issue;return n===`0`&&t===`0`?{volume:void 0,issue:void 0}:{volume:t,issue:n}},Yl=e=>{let[t,n]=((Array.from(e.querySelectorAll(`.details-section .details-entry`)).find(e=>e.querySelector(`.details-label`)?.textContent.trim()===`Pages`)?.querySelector(`.details-value`)?.textContent.trim())?.split(`-`)??[void 0,void 0]).map(e=>e?.trim());return t?.toLowerCase()===`n/a`&&n?.toLowerCase()===`n/a`?{spage:void 0,epage:void 0}:{spage:t,epage:n}},Xl=e=>{let t=Vl(e),n=zl(e),r=V(e,`property`,`og:title`),i=Hl(e,t),a=Ul(e,t),o=Wl(e,t),s=Bl(e);return I(F.Book,{au:n,date:i,doi:a,isbn:o,pages:s,title:r})},Zl=e=>{let t=Vl(e),n=zl(e),r=V(e,`name`,`citation_book_title`),i=Hl(e,t),a=Ul(e,t),o=Wl(e,t),s=V(e,`name`,`citation_publisher`),c=V(e,`property`,`og:title`);return I(F.Bookitem,{au:n,btitle:r,date:i,doi:a,isbn:o,pub:s,title:c})},Ql=e=>{let t=Vl(e),n=zl(e),r=Hl(e,t),i=t.get(G.OnlineIssn),a=t.get(G.PrintIssn),o=V(e,`property`,`og:title`),{volume:s,issue:c}=Gl(e);return L(F.Journal,{au:n,date:r,eissn:i,issn:a,issue:c,title:o,volume:s})},$l=e=>{let t=Vl(e),n=Ll(e),r=zl(e)??Kl(e),i=Hl(e,t)??n?.content?.item[`published-date`],a=Ul(e,t),{issn:o,eissn:s}=ql(e),{volume:c,issue:l}=Jl(n),u=V(e,`property`,`og:title`)??n?.content?.item.title,d=V(e,`name`,`citation_journal_title`)??n?.content?.series.title,{spage:f,epage:p}=Yl(e);return L(F.Article,{au:r,date:i,doi:a,eissn:s,issn:o??V(e,`name`,`citation_issn`),issue:l,jtitle:d,title:u,volume:c,spage:f,epage:p})},eu=({document:e,url:t})=>{switch(Rl(e,t)){case U.Book:return B(Xl(e));case U.Chapter:return B(Zl(e));case U.Journal:return B(Ql(e));case U.Article:return B($l(e));default:return z()}},tu=e=>{let t=H(e,`name`,`citation_author`);return t.length>0?t:void 0},nu=({document:e})=>B(R({au:tu(e),date:V(e,`name`,`citation_publication_date`),doi:V(e,`name`,`citation_doi`),isbn:V(e,`name`,`citation_isbn`),pub:V(e,`name`,`citation_publisher`),title:V(e,`name`,`citation_title`)??e.title})),ru=({document:e})=>Array.from(e.querySelectorAll(`.Z3988`)).length<=1?z():es(),iu=e=>{if(!(!e||e.length===0))return e[0]};function au(e,t){return iu(t.map(t=>{let n=e.querySelector(t)?.textContent??null;if(n&&n.trim()!==``)return n}).filter(e=>e))??null}function ou(e,t){let n=t.flatMap(t=>Array.from(e.querySelectorAll(t)).flatMap(e=>{let t=e.textContent;return t&&t.trim()!==``?t.split(`;`).map(e=>e.trim()).filter(e=>e.length>0):[]}));return n.length>0?n:null}var su=(e,t)=>au(e,[t])?.trim(),cu=e=>{let t=e.querySelector(`.content-meta-data__authors`)?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(e=>!!e)},lu=e=>{let t=Array.from(e.querySelectorAll(`.tombstone-metadata [data-qa="item-authors"]`)).map(e=>e.textContent).filter(e=>!!e);return t.length?t:void 0},uu=e=>{let t=Array.from(e.querySelectorAll(`.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]`)).map(e=>e.textContent).filter(e=>!!e);return t.length?t:void 0},du=e=>{let t=Array.from(e.querySelectorAll(`.contrib-type-author .name`)).map(e=>e.textContent).filter(e=>!!e);return t.length?t:void 0},fu=e=>{let t=new Set([...uu(e)??[],...cu(e)??[],...du(e)??[],...lu(e)??[]]);return t.size?[...t]:void 0},pu=(e,t)=>e.querySelector(`[data-qa="published-date"]`)?.textContent??e.querySelector(`.summary-image`)?.textContent??_u(t?.get(`date`))??_u(t?.get(`copyright date`))??_u(t?.get(`published date`)),mu=e=>{let t=e.find(e=>e.startsWith(`https://doi.org/`));if(t)return t.replace(`https://doi.org/`,``)},hu=e=>{let t=e.get(`local identifier`);if(t?.length)return mu(t)},gu=e=>e.querySelector(`.doi`)?.getAttribute(`href`)??void 0,_u=e=>{if(e?.length)return e[0]},vu=e=>{let t=new Map;return Array.from(e.querySelectorAll(`.metadata-element, .metadata`)).map(e=>({name:e.querySelector(`.metadata-label`)?.textContent.trim().toLowerCase(),values:Array.from(e.querySelectorAll(`.metadata-value`)).map(e=>e.textContent).filter(e=>!!e)})).forEach(({name:e,values:n})=>{!e||!n.length||t.set(e,n)}),t},yu=e=>{let t=vu(e),n=e.querySelector(`.summary-journal`),r=Array.from(n?.childNodes??[]),i=r[0]?.textContent??e.querySelector(`.journal-link`)?.textContent??void 0,a=r[2]?.textContent?.replace(/Published By:\s+?/i,``)??_u(t.get(`publisher`))??e.querySelector(`.publisher-link`)?.textContent??void 0;return{pub:a&&a.trim()!==``?a:void 0,jtitle:i&&i.trim()!==``?i:void 0}},bu=e=>{let t=au(e,[`[data-qa="journal"]:first-child cite`,`[data-qa="copyright-statement"] > cite`,`[data-qa="collection-links"] mfe-content-details-pharos-link`]);return t&&t.trim()!==``?t:void 0},xu=e=>ks(e.querySelector(`[data-qa="page-count"]`)?.textContent),Su=(e,t)=>e.querySelector(`.publisher-link`)?.textContent??_u(t?.get(`publisher`)),Cu=e=>e.querySelector(`[data-qa="item-title"]`)?.textContent.trim()??e.querySelector(`mfe-turnaway-pharos-heading`)?.textContent.trim()??e.querySelector(`.metadata mfe-toc-pharos-heading`)?.textContent.trim()??e.querySelector(`.journal_header-title`)?.textContent.trim()??void 0,wu=e=>{if(!URL.canParse(e))return;let t=new URL(e);return t.origin+t.pathname},Tu=e=>{let t=e.querySelector(`.ccda-container > :first-child`),n,r;if(t?.textContent.includes(`Volume`)||t?.textContent.includes(`Issue`)){let e=t.textContent.trim().split(/,\s+/);for(let t of e)t.startsWith(`Volume`)?r=ks(t):t.startsWith(`Issue`)&&(n=ks(t))}return{issue:n,volume:r}},Eu=e=>{let t=e.querySelector(`[data-qa="item-src-info"]`)?.textContent??V(e,`property`,`og:description`)??V(e,`name`,`description`);if(!t)return{};let n=/Vol\.\s*(\d+)/.exec(t),r=n?n[1]:void 0,i=/No\.\s*(\d+)/.exec(t),a=i?i[1]:void 0,o=/pp\.\s*(\d+)-(\d+)/.exec(t),s=o?o[1]:void 0,c=o?o[2]:void 0,l=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t);return{issue:a,volume:r,spage:s,epage:c,pages:l?l[1]:void 0}},Du=e=>{let t=au(e,[`mfe-turnaway-pharos-link`,`[data-qa="item-src-info"]`]);if(!t)return;let n=/\(.+\)/.exec(t)?.map(e=>{let t=/\d{4}/.exec(e);return t?t[0]:void 0});return iu(n)},Ou=(e,t)=>{let n=Cu(e),r=fu(e),i=pu(e)??Du(e),a=yu(e),o=a.jtitle??bu(e)??void 0,s=a.pub,c=Tu(e),l=Eu(e),u=c.issue??l.issue,d=c.volume??l.volume,f=xu(e)??l.pages,p=l.spage,m=l.epage,h=wu(t),g=mu(Array.from(e.querySelector(`.content-meta-data-stables`)?.childNodes??[]).map(e=>e.textContent??``))??gu(e);return L(F.Article,{atitle:n,au:r,date:i,doi:g,epage:m,issue:u,jtitle:o,pages:f,pub:s,spage:p,uri:h,volume:d})},ku=(e,t)=>{let n=vu(e),r=fu(e),i=pu(e,n),a=Cu(e);return R({au:r,date:i,pub:Su(e,n),title:a,uri:wu(t)})},Au=(e,t)=>{let n=vu(e),r=fu(e),i=Cu(e),a=pu(e),o=xu(e),s=Su(e,n),c=wu(t),l=hu(n);return I(F.Book,{au:r,date:a,doi:l,pages:o,pub:s,title:i,uri:c})},ju=(e,t)=>{let n=vu(e),r=fu(e),i=Cu(e),a=e.querySelector(`.book-title-link`)?.textContent??void 0,o=pu(e,n),s=Array.from(e.querySelectorAll(`[data-qa="book"] > span`)).map(e=>e.textContent),c=xu(e),l=s.find(e=>e.includes(`pp.`))?.match(/(\d+)-(\d+)/)??void 0,u=Su(e,n),d=wu(t);return I(F.Bookitem,{atitle:i,au:r,btitle:a,date:o,epage:l?.[2],pub:u,pages:c,spage:l?.[1],uri:d})},Mu=(e,t)=>{let n=vu(e),r=fu(e),i=Cu(e),a=pu(e),o=xu(e),s=Su(e,n),c=wu(t),l=hu(n);return I(F.Document,{au:r,date:a,doi:l,pages:o,pub:s,title:i,uri:c})},Nu=(e,t)=>{let n=vu(e);return go({au:fu(e),date:pu(e,n),title:Cu(e),uri:wu(t)})},Pu=(e,t)=>{let{pub:n}=yu(e),r=Cu(e),i=e.querySelector(`.eissn`)?.textContent.replace(/EISSN\s+/,``).trim()??void 0,a=e.querySelector(`.issn`)?.textContent.replace(/ISSN\s+/,``).trim()??void 0,o=wu(t);return L(F.Journal,{eissn:i,issn:a,jtitle:r,pub:n,uri:o})},K=function(e){return e.Article=`journal article`,e.Audio=`audio`,e.Book=`book`,e.Chapter=`book chapter`,e.Document=`document`,e.Image=`image`,e.Journal=`journal`,e.ResearchReport=`research report`,e.Serial=`serial`,e.Video=`video`,e}({}),Fu=(e,t)=>{let n=vu(e),r=fu(e),i=pu(e,n),a=Cu(e);return R({au:r,date:i,pub:Su(e,n),title:a,uri:wu(t)})},Iu=e=>Object.values(K).includes(e),Lu=e=>{if(e.querySelector(`.journal_header-title`))return K.Journal;if(e.querySelector(`.journal-link`))return K.Article;let t=e.querySelector(`.content-type > span`)?.textContent.toLowerCase().trim()??e.querySelector(`.content-meta-data-label`)?.textContent.toLowerCase().trim();return Iu(t)?t:null},Ru=(e,t)=>{switch(Lu(e)){case K.Article:case K.Serial:return Ou(e,t);case K.Audio:return ku(e,t);case K.Book:return Au(e,t);case K.Chapter:case K.ResearchReport:return ju(e,t);case K.Document:return Mu(e,t);case K.Image:return Nu(e,t);case K.Journal:return Pu(e,t);case K.Video:return Fu(e,t);default:return null}},zu=({document:e,url:t})=>{let n=Ru(e,t);return n?B(n):z()},Bu=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,Vu=/(E?ISBN|E?ISSN|DOI)\s*:\s*/gi,Hu=e=>{if(!e)return;let t=Bu.exec(e);if(t)return t.length>1?t[1]:void 0},Uu=e=>{let t={};return e.forEach(e=>{let n=[],r;for(Vu.lastIndex=0;(r=Vu.exec(e))!==null;)n.push({id:r[1].toLowerCase(),index:r.index,start:Vu.lastIndex});n.forEach(({id:r,start:i},a)=>{t[r]??=[],t[r].push(e.substring(i,n[a+1]?.index).trim())})}),t},Wu=e=>[...e.isbn??[],...e.eisbn??[]].map(e=>zs(e)).filter(e=>!!e),Gu=e=>{if(e){if(typeof e==`string`)return e;if(e.length>0)return e[0]}},Ku=e=>{if(e)return typeof e==`string`?e:Array.isArray(e)?e.length===0?void 0:Gu(e[0].name):Gu(e.name)},qu=(...e)=>{let t=new Set(e.filter(e=>!!e));if(t.size!==0)return[...t]},Ju=e=>{let t=Uu(e.identifierValues),[n]=e.isPartOf?.split(`,`)??[],r=Hu(e.publicationDate??e.creationDate),i=Wu(t);return{authors:e.authors,date:r,dois:t.doi,edition:e.edition,eissns:t.eissn,isbns:i,issns:t.issn,jtitle:n,lcn:e.lcn,publisher:e.publisher,title:e.title}},Yu=({lcn:e,title:t})=>({bibid:e,title:t}),Xu=e=>{let t=e.mainEntity.creator;if(t)return typeof t==`string`?[t]:Array.isArray(t)?t.map(e=>Gu(e.name)).filter(e=>!!e):[Gu(t.name)].filter(e=>!!e)},Zu=e=>{let t=e.mainEntity.issn;return t?typeof t==`string`?[t]:t:[]},Qu=e=>{let t=e.mainEntity.datePublished;if(t)return t.replace(/-$/,``)||void 0},$u=e=>e.replace(/[.,;]+$/,``).trim(),ed=(e,t)=>{let n=$u(e),r=$u(t);return n.startsWith(r)||r.startsWith(n)},td=e=>{let t=[];for(let n of e)n&&(t.some(e=>ed(e,n))||t.push(n));return t.length>0?t:void 0},nd=(e,t)=>{let n=td([...(e&&Xu(e))??[],...t.authors??[]]),r=qu(...t.eissns??[]),i=qu(e?.mainEntity.isbn?zs(e.mainEntity.isbn):void 0,...t.isbns??[]),a=qu(...e?Zu(e):[],...t.issns??[]),[o,s]=e?.mainEntity.pagination?.split(`-`)??[];return{authors:n,btitle:e?.mainEntity.isPartOf?.name??t.jtitle,date:t.date??(e?Qu(e):void 0),doi:Gu(t.dois),edition:e?.mainEntity.edition??t.edition,eissn:Gu(r),epage:s,isbn:i?.join(`,`),issn:Gu(a),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,lcn:t.lcn??e?.identifier.value,publisher:t.publisher??Ku(e?.mainEntity.publisher),spage:o,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},rd=j({"@type":N(`Organization`),name:M([O(),A(O())])}),id=j({"@type":N(`Person`),name:M([O(),A(O())])}),ad=j({"@type":M([O(),A(O())]),"@id":O().optional(),issn:O().optional(),name:O().optional(),volume:O().optional()}),od=Ys.extend({identifier:j({"@type":O(),propertyID:O(),value:O()}),mainEntity:j({"@type":O(),"@id":O(),bookFormat:P(O()),creator:P(M([O(),id,A(id)])),datePublished:P(O()),description:P(M([O(),A(O())])),edition:P(O()),inLanguage:P(O()),isbn:P(O()),issn:P(M([O(),A(O())])),isPartOf:P(ad),issueNumber:P(O()),pagination:P(O()),publisher:P(M([O(),rd,A(rd)])),volumeNumber:P(O())}),name:O()}),sd=e=>{let t=$s(e);if(!t)return null;let n=ec(t),r=od.safeParse(n);return r.success?r.data:null},cd=e=>L(F.Article,{...Yu(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),ld=e=>I(F.Book,{...Yu(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),ud=e=>I(F.Bookitem,{bibid:e.lcn,atitle:e.title,btitle:e.btitle,au:e.authors,date:e.date,doi:e.doi,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),dd=e=>I(F.Conference,{...Yu(e),au:e.authors,date:e.date,doi:e.doi,isbn:e.isbn,pub:e.publisher}),fd=e=>_o({...Yu(e),au:e.authors,date:e.date,pub:e.publisher}),pd=e=>L(F.Journal,{...Yu(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),md=e=>R({...Yu(e),au:e.authors,date:e.date,pub:e.publisher}),hd=e=>R({...Yu(e),au:e.authors,date:e.date,pub:e.publisher}),q=function(e){return e.Article=`Article`,e.Audio=`Audio`,e.Book=`Book`,e.BookChapter=`BookChapter`,e.Conference=`Conference`,e.Dissertation=`Dissertation`,e.Journal=`Journal`,e.Video=`Video`,e}({}),gd=(e,t)=>({document:n})=>{let r=sd(n),i=nd(r,e(n));switch(t(n,r)){case q.Article:return B(cd(i));case q.Book:return B(ld(i));case q.BookChapter:return B(ud(i));case q.Conference:return B(dd(i));case q.Dissertation:return B(fd(i));case q.Journal:return B(pd(i));case q.Audio:return B(hd(i));case q.Video:return B(md(i));default:return z()}},_d=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,vd=e=>Array.from(e.querySelectorAll(_d(`Identifier`))).map(e=>e.textContent).filter(e=>!!e),yd=e=>Array.from(e.querySelectorAll(_d(`Author`))).filter(e=>!!e.textContent&&e.parentElement!==null&&e.parentElement.getAttribute(`aria-hidden`)!==`true`).map(e=>e.textContent.trim()),bd=(e,t)=>e.querySelector(_d(t))?.textContent.trim(),xd=e=>Ju({authors:yd(e),title:bd(e,`Title`),publisher:bd(e,`Publisher`),creationDate:bd(e,`Creation Date`),publicationDate:bd(e,`Publication Date`),edition:bd(e,`Edition`),isPartOf:bd(e,`Is Part Of`),identifierValues:vd(e),lcn:bd(e,`MMS ID`)??bd(e,`Record ID`)}),Sd={Article:q.Article,Book:q.Book,"Book Chapter":q.BookChapter,Chapter:q.BookChapter,Periodical:q.Journal,Journal:q.Journal,"Audio CD":q.Audio,CreativeWork:q.Audio,Movie:q.Video,Video:q.Video},Cd=gd(xd,(e,t)=>{let n=t?.mainEntity[`@type`]??e.querySelector(`.media-content-type`)?.textContent??void 0;return n?Sd[n]:void 0}),wd=e=>{let t=e.querySelectorAll(`[id="Info"] > p`),n=Array.from(t).find(e=>e.textContent.includes(`Document Type`))?.textContent,r=V(e,`name`,`DC.identifier`);if(r?.startsWith(`info:doi/`)||n?.includes(`Article`))return U.Article;if(r?.startsWith(`urn:issn:`))return U.Journal},Td=e=>{let[t,n,r,i]=V(e,`name`,`DCTERMS.bibliographicCitation`)?.split(`,`)??[];return{journalTitle:t,volume:n,issue:r,pages:i}},Ed=e=>{let t=V(e,`name`,`DC.identifier`);return(t?t.split(`info:doi/`):null)?.[1]??void 0},Dd=e=>e.evaluate(`//*[@id="altLayoutPublisherLogo"]/p/a[1]`,e,null,XPathResult.STRING_TYPE,null).stringValue,Od=e=>{let[t,n]=e?e.trim().split(`-`):[void 0,void 0];return{spage:t,epage:n?.replace(/\(\d+\)/,``).trim()}},kd=e=>{let t=V(e,`name`,`DCTERMS.issued`);if(!t)return;let n=/\d{4}/.exec(t);return n?n[0]:void 0},Ad=e=>{let t=V(e,`name`,`DC.title`),n=V(e,`name`,`DC.publisher`),r=kd(e),i=Td(e),a=i.journalTitle?.trim(),o=i.volume?.trim(),s=i.issue?.trim(),c=i.pages?Od(i.pages):void 0,l=c?.spage,u=c?.epage,d=H(e,`name`,`DC.creator`),f=Ed(e);return L(F.Article,{au:d,jtitle:a,date:r,doi:f,issue:s,pub:n,spage:l,epage:u,atitle:t,volume:o})},jd=e=>{let t=V(e,`name`,`DC.title`),n=V(e,`name`,`DC.publisher`),r=Dd(e);return L(F.Journal,{issn:r,title:t,pub:n})},Md=({document:e})=>{switch(wd(e)){case U.Article:return B(Ad(e));case U.Journal:return B(jd(e));default:return z()}},Nd=/^\d{4}-\d{3}[\dX]$/i,Pd=e=>Nd.test(e),Fd=e=>{let t=e.filter(Pd);return t.length?t:void 0},Id=e=>{let t=H(e,`name`,`citation_author`);return t.length?t:void 0},Ld=e=>V(e,`name`,`citation_publication_date`)?.match(/^\d{4}/)?.[0],Rd=e=>V(e,`name`,`citation_doi`),zd=e=>{let t=H(e,`name`,`citation_isbn`);return t.length?t.join(`,`):void 0},Bd=e=>Fd(H(e,`name`,`citation_issn`)),Vd=e=>V(e,`name`,`citation_journal_title`),Hd=e=>V(e,`name`,`citation_publisher`),Ud=e=>V(e,`name`,`citation_title`),Wd=e=>V(e,`name`,`citation_doi`),Gd=e=>V(e,`name`,`citation_firstpage`),Kd=e=>V(e,`name`,`citation_lastpage`),qd=e=>V(e,`name`,`citation_issue`),Jd=e=>V(e,`name`,`citation_volume`),Yd=e=>L(F.Article,{atitle:Ud(e),au:Id(e),date:Ld(e),doi:Rd(e),issn:Bd(e)?.[0],issue:qd(e),jtitle:Vd(e),pub:Hd(e),volume:Jd(e),spage:Gd(e),epage:Kd(e)}),Xd=e=>I(F.Bookitem,{atitle:Ud(e),au:Id(e),btitle:Vd(e),date:Ld(e),isbn:zd(e),pub:Hd(e),spage:Gd(e),epage:Kd(e)}),Zd=e=>_o({title:Ud(e),au:Id(e),date:Ld(e),pub:Hd(e),spage:Gd(e),epage:Kd(e)}),Qd=e=>!!e.isbn,$d=e=>!!e.issn||e.type===`Article`&&!!e.journalTitle||!Qd(e)&&!!e.journalTitle,ef=e=>!!e.title,tf=e=>{let t={type:Wd(e),isbn:zd(e),issn:Bd(e),journalTitle:Vd(e),title:Ud(e)};return Qd(t)?Xd(e):$d(t)?Yd(e):ef(t)?Zd(e):null},nf=({url:e,document:t})=>{let n=tf(t);return n?B({...n,uri:e}):z()},rf=j({"@content":O(),datePublished:O().optional(),mainEntity:j({type:O().optional(),name:O().optional(),author:A(j({name:O()})).optional(),publisher:j({type:O(),name:O()}).optional(),isbn:O().optional()})}),af=e=>rf.safeParse(e).success,of=e=>{let t=e.textContent;if(!t)return null;try{let e=JSON.parse(t);if(af(e))return e}catch{return null}return null},sf=({document:e})=>{let t=$s(e);if(!t)return z();let n=of(t);if(!n)return z();let r=n.mainEntity.type,i=n.mainEntity.author?.map(e=>e.name),a=n.datePublished?.substring(0,4),o=n.mainEntity.name,s=n.mainEntity.isbn,c=n.mainEntity.publisher?.name;switch(r){case`Book`:return B(I(F.Book,{au:i,date:a,title:o,isbn:s,pub:c}));default:return z()}},cf=Ys.extend({"@type":O().optional(),name:O().optional(),copyrightYear:ga().optional(),author:A(j({name:O()})).optional(),publisher:A(j({name:O()})).optional()}),lf=e=>cf.safeParse(e).success,uf=({document:e,url:t})=>{let n=$s(e);if(!n)return z();let r=ec(n);if(!r||!lf(r))return z();let i=r[`@type`],a=r.author?.map(e=>e.name),o=r.copyrightYear?.toString()??V(e,`property`,`og:book:release_date`),s=r.name,c=iu(r.publisher?.map(e=>e.name)),l=V(e,`property`,`og:book:isbn`);switch(i){case`Book`:return B(I(F.Book,{au:a,date:o,title:s,isbn:l,pub:c,uri:t}));default:return z()}},df=e=>{let t=Array.from(e.querySelectorAll(`a[rel=author]`)).map(e=>e.textContent.trim()).filter(Boolean);return t.length?t:void 0},ff=e=>{let t=Array.from(e.querySelectorAll(`strong`)).filter(e=>e.textContent.startsWith(`ISBN`)).map(e=>e.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,`,`)},pf=({url:e,document:t})=>{let n=t.querySelector(`h3.page-title`)?.textContent.trim()??void 0,r=df(t),i=V(t,`property`,`article:published_time`),a=ff(t);return B(I(F.Book,{au:r,date:i?.substring(0,4),isbn:a,pub:`Milne Open Textbooks`,title:n,uri:e}))},mf=({document:e,url:t})=>{switch(gf(t)){case U.Chapter:return B(xf(e));case U.Book:return B(Sf(e));case U.Article:return B(_f(e));case U.Journal:return B(vf(e));default:return z()}},hf=function(e){return e.Print=`Print`,e.Online=`Online`,e}(hf||{}),gf=e=>{let{pathname:t}=new URL(e);return t.includes(`/books/abs/`)?U.Chapter:t.includes(`/books/`)?U.Book:/\/journals\/.+\/article\//.exec(t)==null?t.includes(`/journals/`)?U.Journal:U.None:U.Article},_f=e=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_journal_title`),r=V(e,`name`,`citation_doi`),i=V(e,`name`,`citation_volume`),a=V(e,`name`,`citation_issue`),o=V(e,`name`,`citation_firstpage`),s=V(e,`name`,`citation_lastpage`),c=V(e,`name`,`citation_publication_date`)?.substring(0,4),l=V(e,`name`,`citation_publisher`),u=Cf(e),d=Fd(H(e,`name`,`citation_issn`));return L(F.Article,{atitle:t,au:u,jtitle:n,doi:r,volume:i,issue:a,issn:d?.[0],spage:o,epage:s,date:c,pub:l})},vf=e=>{let t=yf(e),n=bf(e),r=n.find(e=>e.type===hf.Print),i=n.find(e=>e.type===hf.Online),a=r?r.value:void 0,o=i?i.value:void 0;return L(F.Journal,{title:t,issn:a,eissn:o})},yf=e=>e.querySelector(`h1.title`)?.textContent.trim()??void 0,bf=e=>{let t=Array.from(e.querySelectorAll(`span.bold`)).find(e=>e.textContent.trim()===`ISSN:`),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,r=[];return t&&(t.parentElement?.querySelectorAll(`span.value`))?.forEach(e=>{let t=e.textContent.trim(),i=n.exec(t);i&&r.push({value:i[1],type:i[2]})}),r},xf=e=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_inbook_title`),r=V(e,`name`,`citation_doi`),i=V(e,`name`,`citation_publication_date`)?.substring(0,4),a=V(e,`name`,`citation_publisher`);return I(F.Bookitem,{atitle:t,btitle:n,doi:r,date:i,pub:a})},Sf=e=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_doi`),r=V(e,`name`,`citation_isbn`),i=V(e,`name`,`citation_publication_date`)?.substring(0,4),a=V(e,`name`,`citation_publisher`),o=Cf(e);return I(F.Book,{title:t,au:o,doi:n,isbn:r,date:i,pub:a})},Cf=e=>{let t=H(e,`name`,`citation_author`);return t.length?t:void 0},wf=function(e){return e.Journal=`Journal`,e.Article=`Article`,e}(wf||{}),Tf=e=>{switch(V(e,`property`,`og:type`)){case`Article`:return wf.Article;case`Journal`:return wf.Journal;default:return}};function Ef(e){let t=V(e,`property`,`og:title`),n=V(e,`name`,`dc.Publisher`),r=V(e,`name`,`publication_doi`);return B(L(F.Journal,{jtitle:t,pub:n,doi:r}))}function Df(e){let t=V(e,`name`,`dc.Title`),n=H(e,`name`,`dc.Creator`),r=V(e,`name`,`dc.Date`)?.substring(0,4),i=V(e,`name`,`publication_doi`),a=V(e,`name`,`citation_journal_title`),o=V(e,`name`,`dc.Publisher`);return B(L(F.Article,{atitle:t,au:n,date:r,doi:i,jtitle:a,pub:o}))}var Of=({document:e})=>{switch(Tf(e)){case wf.Journal:return Ef(e);case wf.Article:return Df(e);default:return z()}},kf=e=>{if(!e)return;let[t,n]=e.trim().split(`-`);return{spage:t,epage:n}},Af=e=>{let{pathname:t}=new URL(e);if(t.includes(`/article/`))return U.Article},jf=e=>{let t=V(e,`name`,`DC.Source`),n=V(e,`name`,`DC.Title`),r=H(e,`name`,`DC.Creator.PersonalName`),i=V(e,`name`,`DC.Source.ISSN`),a=V(e,`name`,`citation_date`)?.substring(0,4),o=V(e,`name`,`DC.Source.Volume`),s=V(e,`name`,`DC.Source.Issue`),c=V(e,`name`,`DC.Identifier.URI`),l=V(e,`name`,`DC.Identifier.pageNumber`),u=l?kf(l):void 0,d=u?.spage,f=u?.epage;return L(F.Article,{jtitle:t,atitle:n,au:r,issn:i,date:a,spage:d,epage:f,volume:o,issue:s,uri:c})},Mf=({document:e,url:t})=>{switch(Af(t)){case U.Article:return B(jf(e));default:return z()}},Nf=function(e){return e.Book=`Book`,e.Chapter=`Chapter`,e}(Nf||{}),Pf=e=>{switch(Ff(e)){case`eBook`:return Nf.Book;case`Reference`:return Nf.Chapter;default:return}},Ff=e=>e.querySelector(`#vol-contentType a`)?.textContent??void 0;function If(e,t){let n=Rf(e),r=Vf(e),i=Uf(e),a=Wf(e),o=Gf(e),s=Kf(e),c=Vf(e),l=t,{startPage:u,endPage:d}=qf(e)??{};return B(I(F.Book,{au:n,btitle:r,date:i,doi:a,epage:d,isbn:o,pub:s,spage:u,title:c,uri:l}))}function Lf(e,t){let n=Rf(e),r=Hf(e),i=Vf(e),a=Uf(e),o=Wf(e),s=Gf(e),c=Kf(e),l=Hf(e),u=t,{startPage:d,endPage:f}=qf(e)??{};return B(I(F.Book,{au:n,atitle:r,btitle:i,date:a,doi:o,epage:f,isbn:s,pub:c,spage:d,title:l,uri:u}))}var Rf=e=>{let t=e.querySelectorAll(`div#article_author p.author-bio b`),n=Array.from(t).map(e=>e.textContent).filter(e=>!!e).map(e=>e.trim());return n.length>0?n:void 0},zf=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute(`value`)??void 0,Bf=e=>V(e,`property`,`og:title`),Vf=e=>zf(e,`titlevalue`)??Bf(e),Hf=e=>zf(e,`chapter-title-squid`),Uf=e=>zf(e,`pubdate-squid`),Wf=e=>zf(e,`doi-squid`),Gf=e=>zf(e,`isbn-squid`),Kf=e=>zf(e,`pubname-squid`),qf=e=>{let t=e.querySelector(`#pageRange`)?.textContent??void 0;if(!t)return;let n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},Jf=({document:e,url:t})=>{switch(Pf(e)){case Nf.Book:return If(e,t);case Nf.Chapter:return Lf(e,t);default:return z()}},Yf=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),Xf=e=>{switch(Yf(e,`Medium`)){case`book`:case`e-book`:return F.Book;case`e-journal`:return F.Journal;default:return F.Unknown}},Zf=e=>{delete e.rft_id},Qf=e=>{let t=rs(e);if(Yc(t)){let n=Xf(e.document);t.resource.genre=n,Zf(t.resource)}return t},$f=e=>{let t=V(e,`name`,`type`)?.toLowerCase(),n=V(e,`name`,`og:type`)?.toLowerCase(),r=V(e,`name`,`citation_article_type`)?.toLowerCase();if(t===`article`||r===`article`||n===`article`)return U.Article;let i=V(e,`name`,`twitter:title`)?.trim(),a=V(e,`name`,`description`)?.trim();if(i||a)return U.Webpage},ep=e=>{let t=V(e,`name`,`DC.Title`),n=V(e,`name`,`DC.Publisher`),r=V(e,`name`,`DC.Date`),i=V(e,`name`,`DC.Identifier`),a=V(e,`name`,`citation_journal_title`),o=V(e,`name`,`citation_volume`),s=V(e,`name`,`citation_issn`),c=H(e,`name`,`citation_author`);return L(F.Article,{au:c,jtitle:a,date:r,doi:i,issn:s,pub:n,title:t,volume:o})},tp=(e,t)=>vo({uri:e,title:V(t,`name`,`twitter:title`)}),np=({url:e,document:t})=>{switch($f(t)){case U.Article:return B(ep(t));case U.Webpage:return B(tp(e,t))}return z()},rp=({document:e})=>Array.from(e.querySelectorAll(`.availability.documentSummaryAvailability.availabilityContent`)).length===0?z():ts(),ip=/([0-9]{4})\s+at/;function ap(e){if(!e)return;let t=ip.exec(e);if(t&&t.length>1)return t[1]}function op(e,t){let n=e.getElementsByClassName(t);if(n.length!==0)return n[0].textContent}function sp(e){return Array.from(e.getElementsByTagName(`li`)).reduce((e,t)=>{let n=op(t,`title`),r=op(t,`content`);return n&&r&&(e[n]=r),e},{})}function cp(e){let t=e.getElementsByClassName(`information`);if(t.length===0)return{};let n=sp(t[0]);return{date:ap(n.Published),series:n.Show}}var lp=({url:e,document:t})=>{if(!new URL(e).searchParams.has(`i`))return z();let n=F.AudioDocument;return B({genre:n,pub:V(t,`property`,`og:site_name`),title:V(t,`property`,`og:title`),uri:e,...cp(t)})},up=e=>{let t=V(e,`name`,`citation_date`);if(t)return t.split(`/`).find(e=>/^\d{4}/.test(e))??void 0},dp=e=>{let t=e.querySelector(`#arxiv-doi-link`)?.textContent;if(t)return t.replace(`https://doi.org/`,``).trim()},fp=({document:e})=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_pdf_url`),r=H(e,`name`,`citation_author`),i=up(e),a=dp(e);return!t&&r.length===0&&!i&&!a?z():B(L(F.Article,{au:r,date:i,doi:a,title:t,uri:n}))},pp=e=>{let t=su(e,`div.director-section div.term-info-section-items`);if(!t)return;let n=t.split(`,`).map(e=>e.replace(/\s+/g,` `).trim()).filter(e=>e.length>0);return n.length>0?n:void 0},mp=e=>{let t=new Map;return Array.from(e.querySelectorAll(`.info-section-container`)).forEach(e=>{let n=e.querySelector(`.info-section-header .info-section-title`)?.textContent.trim().toLowerCase();if(!n)return;let r=Array.from(e.querySelectorAll(`.term-info-section-item`)).map(e=>e.textContent.replace(`,`,``).trim()).filter(e=>!!e);r.length&&t.set(n,r)}),t},hp=({url:e,document:t})=>{let n=mp(t);return B(R({au:pp(t)??n.get(`director`),date:su(t,`div.product-release-year`),pub:su(t,`div.studio-section div.term-info-section-item`)??_u(n.get(`supplier`)),title:su(t,`.product-title`)??su(t,`.movie-title`),uri:e}))},gp=e=>{if(V(e,`property`,`og:type`)===`article`)return U.Article};function _p(e){let t={},n=e.querySelector(`[data-id=layout-form]`);return n&&Array.from(n.getElementsByTagName(`h2`)).forEach(e=>{let n=e.textContent.toLowerCase(),r=Array.from(e.parentElement?.getElementsByTagName(`span`)??[]).map(e=>e.textContent||``);n&&(t[n]=r[0])}),t}function vp(e,t,n){return n.includes(`publisher`)?t.publisher:n.includes(`place of publication, exhibition, or creation`)?t[`place of publication, exhibition, or creation`]:V(e,`name`,`DC.publisher`)}function yp(e){let t=V(e,`name`,`citation_publication_date`);return t?t.substring(0,4):V(e,`name`,`citation_online_date`)?.substring(0,4)}var bp=e=>{let t=_p(e),n=V(e,`name`,`DataCite.title`),r=H(e,`name`,`DataCite.contributor`),i=yp(e),a=V(e,`name`,`DC.identifier.DOI`),o=Object.keys(t),s=vp(e,t,o),c=o.includes(`journal`)?t.journal:void 0,l=o.includes(`volume`)?t.volume:void 0,u=o.includes(`issue`)?t.issue:void 0,d=o.includes(`issn`)?t.issn:void 0,f=o.includes(`electronic location (url)`)?t[`electronic location (url)`]:void 0;return L(F.Article,{jtitle:c,atitle:n,pub:s,au:r,date:i,doi:a,volume:l,issue:u,issn:d,uri:f})},xp=({document:e})=>{switch(gp(e)){case U.Article:return B(bp(e));default:return z()}},J=function(e){return e.ISSN=`issn (print)`,e.EISSN=`issn (electronic)`,e.ISBN=`isbn (print)`,e.VOLUME=`volume`,e.ISSUE=`issue`,e.PUBLISHER=`publisher`,e.DATE_OF_PUBLICATION=`date of publication`,e.RESOURCE_TYPE=`resource type`,e.JOURNAL_TITLE=`journal`,e.BOOK_TITLE=`book title`,e.PAGE_RANGE=`page range`,e}(J||{}),Sp=e=>{let t=Y(e,J.RESOURCE_TYPE);return t?t===`Other Journal Article`||t===`Journal Article`||t===`Journal Item`||t===`Book Review`?U.Article:t===`Book Chapter`||t===`Book Part`||t===`Conference Abstract`||t===`Book ChapterConference Paper`||t===`Conference Paper`||t===`Other Book Part`?U.Document:U.None:U.None},Cp=e=>e.replace(`:`,``).replace(` | `,``).trim().toLowerCase(),wp=e=>{let t=new Map,n=e.querySelector(`ul.rlist.publication-details__list`);return n&&Array.from(n.querySelectorAll(`li`)).forEach(e=>{let n=Array.from(e.querySelectorAll(`span.label`)),r=Array.from(e.querySelectorAll(`span.info`));n.forEach((e,n)=>{let i=Cp(e.textContent),a=r[n]?.textContent?.trim();i&&a&&(t.has(i)||t.set(i,[]),t.get(i)?.push(a))})}),t},Y=(e,t)=>{let n=e.get(t);if(n)return iu(n)},Tp=e=>H(e,`name`,`dc.Creator`).map(e=>e.trim()),Ep=e=>{let t=ou(e,[`.loa-accordion a.author-name`]);if(t)return t.map(e=>e.replace(`Authors:`,``).trim())},Dp=e=>{let t=Tp(e);return t.length>0?t:Ep(e)},Op=e=>V(e,`name`,`dc.Title`)??V(e,`property`,`og:title`),kp=e=>V(e,`name`,`publication_doi`),Ap=(e,t)=>Y(t,J.DATE_OF_PUBLICATION)??V(e,`name`,`dc.Date`),jp=e=>{let t=Y(e,J.PAGE_RANGE),n,r;return t?.includes(`-`)&&(n=t?t.split(`-`)[0].trim():void 0,r=t?t.split(`-`)[1].trim():void 0),{pages:t,spage:n,epage:r}},Mp=(e,t,n)=>{let r=Op(e),i=Y(t,J.JOURNAL_TITLE),a=V(e,`name`,`citation_journal_title`),o=i??a,s=kp(e),c=Ap(e,t),l=Y(t,J.PUBLISHER),u=Dp(e),d=Y(t,J.VOLUME),f=Y(t,J.ISSUE),p=jp(t),m=Y(t,J.ISSN),h=Y(t,J.EISSN);return L(F.Article,{title:r,jtitle:o,doi:s,date:c,pub:l,au:u,volume:d,issue:f,pages:p.pages,spage:p.spage,epage:p.epage,issn:m,eissn:h,uri:n})},Np=(e,t,n)=>{let r=Op(e),i=Y(t,J.BOOK_TITLE),a=kp(e),o=Ap(e,t),s=Y(t,J.PUBLISHER),c=Dp(e),l=jp(t),u=Y(t,J.ISBN);return I(F.Conference,{title:r,btitle:i,doi:a,date:o,pub:s,au:c,pages:l.pages,spage:l.spage,epage:l.epage,isbn:u,uri:n})},Pp=(e,t,n)=>{let r=Op(e),i=kp(e),a=Ap(e,t),o=Y(t,J.PUBLISHER),s=Dp(e),c=Y(t,J.ISBN);return I(F.Document,{title:r,doi:i,date:a,pub:o,au:s,uri:n,isbn:c})},Fp=({url:e,document:t})=>{let n=wp(t);switch(Sp(n)){case U.Article:return B(Mp(t,n,e));case U.Document:return B(Np(t,n,e));case U.None:return B(Pp(t,n,e));default:return z()}},Ip=e=>V(e,`property`,`og:title`)?.trim()??void 0,Lp=e=>V(e,`name`,`dc.identifier`)??V(e,`name`,`citation_doi`),Rp=e=>{let t=Ip(e),n=t,r=Wp(e),i=Up(e),a=Vp(e),o=Hp(e),{issn:s,eissn:c}=Bp(e);return B(L(F.Journal,{date:r,eissn:c,issn:s,issue:i,jtitle:n,pub:a,title:t,volume:o}))},zp=e=>e.includes(`/journals/`)&&e.includes(`issue`),Bp=e=>({issn:e.querySelector(`dd.printissn.text-metadata-value > span`)?.textContent.trim(),eissn:e.querySelector(`dd.onlineissn.text-metadata-value > span`)?.textContent.trim()}),Vp=e=>e.querySelector(`dd.publisher.text-metadata-value span`)?.textContent.trim()??void 0,Hp=e=>Ip(e)?.match(/Volume\s+(\d+)/i)?.[1],Up=e=>Ip(e)?.match(/Issue\s+(\d+)/i)?.[1],Wp=e=>Ip(e)?.match(/\((\d{4})\)/)?.[1],Gp=e=>{let t=Ip(e),n=V(e,`name`,`citation_title`)??t,r=H(e,`property`,`article:author`),i=Kp(e),a=Lp(e),o=V(e,`name`,`citation_lastpage`),s=V(e,`name`,`citation_issn`),c=V(e,`name`,`citation_issue`),l=V(e,`name`,`citation_journal_title`),u=V(e,`name`,`citation_publisher`),d=V(e,`name`,`citation_firstpage`),f=V(e,`name`,`citation_volume`);return B(L(F.Article,{atitle:n,au:r,date:i,doi:a,epage:o,issn:s,issue:c,jtitle:l,pub:u,spage:d,title:t,volume:f}))},Kp=e=>V(e,`property`,`article:published_time`)??V(e,`name`,`citation_publication_date`),qp=e=>{let t=Ip(e),n=V(e,`name`,`citation_title`)??t,r=Jp(e),i=Xp(e),a=Lp(e),o=Zp(e),s=V(e,`name`,`citation_publisher`);return B(I(F.Book,{au:r,btitle:n,date:i,doi:a,isbn:o,pub:s,title:t}))},Jp=e=>{let t=H(e,`property`,`book:author`);if(t.length>0)return t;let n=H(e,`name`,`citation_author`);return n.length>0?n:Yp(e)},Yp=e=>Array.from(e.querySelectorAll(`.contributor-details span[data-testid="author-name"]`)).map(e=>(e.textContent||``).trim()).filter(e=>e.length>0),Xp=e=>V(e,`property`,`book:release_date`)??V(e,`name`,`citation_publication_date`),Zp=e=>V(e,`property`,`book:isbn`)??V(e,`name`,`citation_isbn`),Qp=(e,t)=>{switch(V(e,`property`,`og:type`)){case`article`:return U.Article;case`book`:return U.Book;default:break}return zp(t)?U.Journal:U.None},$p=({document:e,url:t})=>{switch(Qp(e,t)){case U.Article:return Gp(e);case U.Journal:return Rp(e);case U.Book:return qp(e);default:return z()}},em=e=>{let t=e.getAttribute(`title`);return t?Oo(t):null},tm=({url:e,document:t})=>{let n=t.querySelector(`.Z3988`);if(!n)return z();let r=em(n);return r?(r.genre===F.Article&&!r.jtitle&&r.title&&(r.jtitle=r.title),B({...r,uri:e})):z()},nm=e=>`[data-qa="detail_${e}"]`,rm=(e,t)=>{let n=e.querySelector(nm(t));return n?Array.from(n.querySelectorAll(`nde-highlight`)).map(e=>e.textContent.trim()).filter(e=>!!e):[]},im=(e,t)=>{let n=rm(e,t);return n.length>0?n[0]:void 0},am=e=>{let t=e.querySelector(nm(`creator`));if(!t)return[];let n=Array.from(t.querySelectorAll(`nde-highlight`)).map(e=>e.textContent.trim()).filter(e=>!!e).map(e=>e.replace(/,?\s*author\s*$/i,``).trim());return n.length>0?n:[]},om=e=>{let t=rm(e,`identifier`),n=rm(e,`ispartof`),r=t.find(e=>e.startsWith(`LC:`));return Ju({authors:am(e),title:im(e,`title`),publisher:im(e,`publisher`),creationDate:im(e,`creationdate`),isPartOf:n.length>0?n[0]:void 0,identifierValues:t,lcn:r?.replace(`LC:`,``).trim()})},sm={Article:q.Article,Audio:q.Audio,Book:q.Book,"Book Chapter":q.BookChapter,"Conference Paper":q.Conference,Dissertation:q.Dissertation,Journal:q.Journal,"Magazine Article":q.Article,Newspaper:q.Journal,Video:q.Video},cm={CreativeWork:q.Audio,Movie:q.Video,Periodical:q.Journal,Thesis:q.Dissertation},lm={...sm,...cm},um=e=>{if(e)return e.mainEntity[`@type`]},dm=e=>e.querySelector(`.record-type`)?.textContent.trim()??void 0,fm=gd(om,(e,t)=>{let n=dm(e)??um(t);return n?lm[n]:void 0}),X=function(e){return e.NoResourceFound=`NoResourceFound`,e.Z3988=`Z3988`,e.Z3988SearchResult=`Z3988SearchResult`,e.Amazon=`Amazon`,e.CupOfJo=`CupOfJo`,e.IngentaConnect=`IngentaConnect`,e.Jstor=`Jstor`,e.Milne=`Milne`,e.Primo=`Primo`,e.SagePub=`SagePub`,e.SageVideo=`SageVideo`,e.ScienceDirect=`ScienceDirect`,e.Springer=`Springer`,e.Youtube=`Youtube`,e.TaylorFrancis=`TaylorFrancis`,e.Wiley=`Wiley`,e.VuFind=`VuFind`,e.ClinicalKey=`ClinicalKey`,e.DOAJ=`DOAJ`,e.Ebscohost=`Ebscohost`,e.OpenStax=`OpenStax`,e.CambridgeJournalsOnline=`CambridgeJournalsOnline`,e.OpenTextbook=`OpenTextbook`,e.AhaJournals=`AhaJournals`,e.Ijees=`Ijees`,e.BloomsburyCollections=`BloomsburyCollections`,e.HeritageCirqa=`HeritageCirqa`,e.BritishMedicalJournal=`BritishMedicalJournal`,e.SummonSearchResult=`SummonSearchResult`,e.ApplePodcasts=`ApplePodcasts`,e.Arxiv=`Arxiv`,e.KanopyVideo=`KanopyVideo`,e.LaTrobeOpal=`LaTrobeOpal`,e.BYUScholarsArchive=`BYUScholarsArchive`,e.Informit=`Informit`,e.Brill=`Brill`,e.HeinOnline=`HeinOnline`,e.PrimoNde=`PrimoNde`,e}({}),pm={[X.NoResourceFound]:lc,[X.Z3988]:rs,[X.Z3988SearchResult]:ru,[X.Amazon]:ds,[X.CupOfJo]:cc,[X.Jstor]:zu,[X.Youtube]:al,[X.SagePub]:Ec,[X.SageVideo]:nu,[X.ScienceDirect]:Lc,[X.Springer]:Ml,[X.TaylorFrancis]:Wc,[X.Wiley]:eu,[X.VuFind]:tl,[X.ClinicalKey]:Js,[X.DOAJ]:hc,[X.Primo]:Cd,[X.IngentaConnect]:Md,[X.Ebscohost]:nf,[X.OpenStax]:sf,[X.OpenTextbook]:uf,[X.Milne]:pf,[X.CambridgeJournalsOnline]:mf,[X.AhaJournals]:Of,[X.Ijees]:Mf,[X.BloomsburyCollections]:Jf,[X.HeritageCirqa]:Qf,[X.BritishMedicalJournal]:np,[X.SummonSearchResult]:rp,[X.ApplePodcasts]:lp,[X.Arxiv]:fp,[X.KanopyVideo]:hp,[X.LaTrobeOpal]:xp,[X.BYUScholarsArchive]:Os,[X.Informit]:Fp,[X.Brill]:$p,[X.HeinOnline]:tm,[X.PrimoNde]:fm},mm=`5.36.0`,hm=()=>mm,gm=[`com.au`,`com`,`ca`,`co.uk`,`de`,`fr`,`nl`].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),_m={version:hm(),siteRegistrations:[{matcher:{regexp:`^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search`},name:`Worldcat Search Results`,parsers:[X.Z3988SearchResult]},{matcher:{regexp:`^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/`},name:`Summon Search Results`,parsers:[X.SummonSearchResult]},{matcher:{regexp:`cupofjo[.-]com`},name:`Cup of Jo`,parsers:[X.CupOfJo]},{matcher:{hostnames:[`youtube.com`,`www.youtube.com`]},name:`Youtube`,parsers:[X.Youtube]},{matcher:{regexp:`www[-.]sciencedirect[.-]com`},name:`Science Direct`,parsers:[X.ScienceDirect]},{matcher:{hostnames:gm},name:`Amazon`,parsers:[X.Amazon]},{matcher:{regexp:`^https://sk\\.sagepub\\.com/video/`},name:`Sage Video`,parsers:[X.SageVideo]},{matcher:{regexp:`[/.-]((www|journals)[.-])?sagepub[.-]com`},name:`Sage Publishing`,parsers:[X.SagePub]},{matcher:{regexp:`www[.-]tandfonline[.-]com`},name:`Taylor & Francis`,parsers:[X.TaylorFrancis]},{matcher:{regexp:`[/.-]((www|onlinelibrary)[.-])?wiley[.-]com`},name:`Wiley`,parsers:[X.Wiley]},{matcher:{regexp:`^https://[a-z0-9\\-]+[.-]on[.-]worldcat[.-]org`},name:`Worldcat`,parsers:[X.Z3988]},{matcher:{hostnames:[`catalogue.rau.ac.uk`]},name:`Royal Agricultural University Library`,parsers:[X.Z3988]},{matcher:{regexp:`link[.-]springer[.-]com`},name:`Springer`,parsers:[X.Springer]},{matcher:{regexp:`^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)`},name:`VuFind`,parsers:[X.VuFind]},{matcher:{regexp:`www[.-]clinicalkey[.-]com`},name:`ClinicalKey`,parsers:[X.ClinicalKey]},{matcher:{regexp:`www[.-]jstor[.-]org`},name:`JSTOR`,parsers:[X.Jstor]},{matcher:{regexp:`doaj[.-]org`},name:`DOAJ`,parsers:[X.DOAJ]},{matcher:{regexp:`[/.-]ingentaconnect[.-]com`},name:`IngentaConnect`,parsers:[X.IngentaConnect]},{matcher:{regexp:`research[.-]ebsco[.-]com`},name:`EBSCOHost`,parsers:[X.Ebscohost]},{matcher:{regexp:`openstax[-.]org`},name:`OpenStax`,parsers:[X.OpenStax]},{matcher:{regexp:`open[.-]umn[.-]edu`},name:`OpenTextbook`,parsers:[X.OpenTextbook]},{matcher:{regexp:`milneopentextbooks[-.]org`},name:`Milne Open Textbooks`,parsers:[X.Milne]},{matcher:{regexp:`www[.-]perlego[.-]com`},name:`Perlego`,parsers:[X.Z3988]},{matcher:{regexp:`www[.-]ahajournals[.-]org`},name:`AHA Journals`,parsers:[X.AhaJournals]},{matcher:{regexp:`www[.-]cambridge[.-]org`},name:`Cambridge Journals Online`,parsers:[X.CambridgeJournalsOnline]},{matcher:{regexp:`www[.-]nieindia[.-]org`},name:`International Journal of Ecology and Environmental Sciences`,parsers:[X.Ijees]},{matcher:{regexp:`www[.-]bloomsburycollections[.-]com`},name:`Bloomsbury Collections`,parsers:[X.BloomsburyCollections]},{matcher:{regexp:`cirqahosting[.-]com`},name:`Heritage Cirqa`,parsers:[X.HeritageCirqa]},{matcher:{regexp:`www[.-]bmj[.-]com`},name:`British Medical Journal`,parsers:[X.BritishMedicalJournal]},{matcher:{regexp:`podcasts[.-]apple[.-]com`},name:`Apple Podcasts`,parsers:[X.ApplePodcasts]},{matcher:{regexp:`arxiv[.-]org`},name:`arxiv`,parsers:[X.Arxiv]},{matcher:{regexp:`kanopy[.-]com`},name:`Kanopy Video`,parsers:[X.KanopyVideo]},{matcher:{regexp:`opal[.-]latrobe[.-]edu[.-]au`},name:`La Trobe Opal`,parsers:[X.LaTrobeOpal]},{matcher:{hostnames:[`scholarsarchive.byu.edu`]},name:`BYU Scholars Archive`,parsers:[X.BYUScholarsArchive]},{matcher:{regexp:`informit[.-]org`},name:`Informit`,parsers:[X.Informit]},{matcher:{regexp:`brill[.-]com`},name:`Brill`,parsers:[X.Brill]},{matcher:{regexp:`^https://heinonline[.-]org+.+HOL/LuceneSearch+.*`},name:`HeinOnline Search Results`,parsers:[X.Z3988SearchResult]},{matcher:{regexp:`^https://heinonline[.-]org+.+HOL/Page+.*`},name:`HeinOnline`,parsers:[X.HeinOnline]},{matcher:{regexp:`/nde/fulldisplay`},name:`Primo NDE`,parsers:[X.PrimoNde]},{matcher:{regexp:`/(discovery|primo-explore)/fulldisplay`},name:`Primo`,parsers:[X.Primo]}]},vm=j({hostnames:A(O()).min(1)}),ym=j({regexp:O()}),bm=M([vm,ym]),xm=j({matcher:bm,name:O(),parsers:A(O()),libraryVersionRange:O().optional()}),Sm=j({siteRegistrations:A(xm),version:O()}),Cm=e=>Sm.safeParse(e).success,wm=e=>xm.safeParse(e).success,Tm=e=>bm.safeParse(e).success,Em=e=>Object.values(X).includes(e),Dm=j({url:O(),document:to(e=>typeof e==`object`&&!!e)}),Om=e=>Dm.safeParse(e).success,km=t(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Am=t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),jm=t(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=km(),a=Am();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Mm=t(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Nm=t(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Z=t(((e,t)=>{var n=Am(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=km(),{safeRe:a,t:o}=jm(),s=Mm(),{compareIdentifiers:c}=Nm();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Pm=t(((e,t)=>{var n=Z();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Fm=t(((e,t)=>{var n=Pm();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Im=t(((e,t)=>{var n=Pm();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Lm=t(((e,t)=>{var n=Z();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Rm=t(((e,t)=>{var n=Pm();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),zm=t(((e,t)=>{var n=Z();t.exports=(e,t)=>new n(e,t).major})),Bm=t(((e,t)=>{var n=Z();t.exports=(e,t)=>new n(e,t).minor})),Vm=t(((e,t)=>{var n=Z();t.exports=(e,t)=>new n(e,t).patch})),Hm=t(((e,t)=>{var n=Pm();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Q=t(((e,t)=>{var n=Z();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Um=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(t,e,r)})),Wm=t(((e,t)=>{var n=Q();t.exports=(e,t)=>n(e,t,!0)})),Gm=t(((e,t)=>{var n=Z();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Km=t(((e,t)=>{var n=Gm();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),qm=t(((e,t)=>{var n=Gm();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Jm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)>0})),Ym=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)<0})),Xm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)===0})),Zm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)!==0})),Qm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)>=0})),$m=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)<=0})),eh=t(((e,t)=>{var n=Xm(),r=Zm(),i=Jm(),a=Qm(),o=Ym(),s=$m();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),th=t(((e,t)=>{var n=Z(),r=Pm(),{safeRe:i,t:a}=jm();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),nh=t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),$=t(((e,t)=>{var n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,se(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>b(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let ee=[..._.values()];return r.set(t,ee),ee}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ce(this.set[t],e,this.options))return!0;return!1}};var r=new(nh()),i=Mm(),a=rh(),o=Am(),s=Z(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=jm(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=km(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=ne(e,t),o(`caret`,e),e=ee(e,t),o(`tildes`,e),e=ie(e,t),o(`xrange`,e),e=oe(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,ee=(e,t)=>e.trim().split(/\s+/).map(e=>te(e,t)).join(` `),te=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},ne=(e,t)=>e.trim().split(/\s+/).map(e=>re(e,t)).join(` `),re=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},ie=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ae(e,t)).join(` `)),ae=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},oe=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),b=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),se=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ce=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),rh=t(((e,t)=>{var n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var r=Mm(),{safeRe:i,t:a}=jm(),o=eh(),s=Am(),c=Z(),l=$()})),ih=t(((e,t)=>{var n=$();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),ah=t(((e,t)=>{var n=$();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),oh=t(((e,t)=>{var n=Z(),r=$();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),sh=t(((e,t)=>{var n=Z(),r=$();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),ch=t(((e,t)=>{var n=Z(),r=$(),i=Jm();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),lh=t(((e,t)=>{var n=$();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),uh=t(((e,t)=>{var n=Z(),r=rh(),{ANY:i}=r,a=$(),o=ih(),s=Jm(),c=Ym(),l=$m(),u=Qm();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),dh=t(((e,t)=>{var n=uh();t.exports=(e,t,r)=>n(e,t,`>`,r)})),fh=t(((e,t)=>{var n=uh();t.exports=(e,t,r)=>n(e,t,`<`,r)})),ph=t(((e,t)=>{var n=$();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),mh=t(((e,t)=>{var n=ih(),r=Q();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),hh=t(((e,t)=>{var n=$(),r=rh(),{ANY:i}=r,a=ih(),o=Q(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),gh=t(((e,t)=>{var n=jm(),r=km(),i=Z(),a=Nm();t.exports={parse:Pm(),valid:Fm(),clean:Im(),inc:Lm(),diff:Rm(),major:zm(),minor:Bm(),patch:Vm(),prerelease:Hm(),compare:Q(),rcompare:Um(),compareLoose:Wm(),compareBuild:Gm(),sort:Km(),rsort:qm(),gt:Jm(),lt:Ym(),eq:Xm(),neq:Zm(),gte:Qm(),lte:$m(),cmp:eh(),coerce:th(),Comparator:rh(),Range:$(),satisfies:ih(),toComparators:ah(),maxSatisfying:oh(),minSatisfying:sh(),minVersion:ch(),validRange:lh(),outside:uh(),gtr:dh(),ltr:fh(),intersects:ph(),simplifyRange:mh(),subset:hh(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),_h=(e,t)=>vh(t)?t.hostnames.includes(new URL(e).hostname):yh(t)?!!e.match(t.regexp):!1,vh=e=>vm.safeParse(e).success,yh=e=>ym.safeParse(e).success,bh=(e,t)=>t?(0,gh.satisfies)(e,t):!0,xh=(e,t,n)=>bh(t,n.libraryVersionRange)&&_h(e,n.matcher),Sh=(e,t)=>e.siteRegistrations.filter(e=>xh(t,hm(),e)),Ch=(e,t)=>Sh(e,t).flatMap(({parsers:e,name:t})=>e.filter(e=>Em(e)&&e in pm).map(e=>({parser:pm[e],parserType:e,name:t}))),wh=(e,t)=>{let n=Ch(e,t.url);for(let{parser:e,parserType:r,name:i}of n){let n=e(t);if(Yc(n)||Xc(n)||Zc(n))return{...n,meta:{parserName:i,parserType:r,referrer:t.url}}}return{...lc(t),meta:{parserName:null,parserType:X.NoResourceFound,referrer:t.url}}},Th=(e,t)=>{switch(t){case jo.CA:return new URL(`https://${e}.rl.ca.talis.com`);default:return new URL(`https://${e}.rl.talis.com`)}};e.BookGenresSchema=io,e.CustomerListSchema=Ro,e.CustomerSchema=Lo,e.DirectLinkOnlyResultSchema=qo,e.Genre=F,e.HostnamesMatcherSchema=vm,e.JournalGenresSchema=ao,e.NON_OPENURL_PROPERTIES=xo,e.NonOpenUrlPropertiesSchema=so,e.NothingParsedResultSchema=Ko,e.OPENURL_KEYS=bo,e.OpenUrlAudioVisualResourceSchema=uo,e.OpenUrlBookResourceSchema=co,e.OpenUrlDocumentResourceSchema=po,e.OpenUrlImageResourceSchema=fo,e.OpenUrlJournalResourceSchema=lo,e.OpenUrlResourceSchema=oo,e.OpenUrlResultSchema=Jo,e.OpenUrlWebpageResourceSchema=mo,e.PARSERS=pm,e.ParserRegistrySchema=Sm,e.ParserType=X,e.ParsingMetadataSchema=Go,e.ParsingRequestSchema=Fo,e.ParsingResponseSchema=Qo,e.ParsingResultSchema=Zo,e.REGISTRY=_m,e.RegExpMatcherSchema=ym,e.ResourceDataSchema=Dm,e.ResourceSchema=ho,e.SiteRegistrationSchema=xm,e.SummonSearchResultSchema=Xo,e.TenantRegion=jo,e.TenantRegistrySchema=No,e.TenantSchema=Mo,e.UrlMatcherSchema=bm,e.Z3988SearchResultSchema=Yo,e.convertCustomerListToTenantRegistry=Uo,e.createAudioVisual=R,e.createBook=I,e.createDocument=_o,e.createImage=go,e.createJournal=L,e.createWebpage=vo,e.directLinkOnly=$o,e.fromOpenUrl=Oo,e.getBaseBookmarkingUrl=(e,t)=>{let n=Th(e,t);return new URL(`/ui/forms/bookmarklet.html`,n)},e.getLibraryVersion=hm,e.isCustomer=zo,e.isCustomerList=Bo,e.isDirectLinkOnlyResult=Jc,e.isGenre=Ao,e.isNothingParsedResult=Qc,e.isOpenUrlResult=Yc,e.isParserRegistry=Cm,e.isParserType=Em,e.isParsingMetadata=qc,e.isParsingRequest=Io,e.isParsingResponse=Kc,e.isParsingResult=Gc,e.isResourceData=Om,e.isSiteRegistration=wm,e.isSummonSearchResult=Zc,e.isTenant=Vo,e.isTenantRegion=Ho,e.isUrlMatcher=Tm,e.isZ3988SearchResult=Xc,e.nothingParsed=z,e.openUrlResource=B,e.parseResource=wh,e.summonSearchResult=ts,e.toBookmarkingWorkflowUrl=(e,t,n)=>{let r=Eo(t);r.append(`fast`,`true`),r.append(`breakout`,`true`),n&&(n.parserName&&r.append(`targetTitle`,n.parserName),r.append(`referrer`,n.referrer));let i=new URL(e.toString());return i.search=r.toString(),i},e.toOpenUrl=Eo,e.z3988SearchResult=es});
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ti(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:ri(t,`input`,e.processors),output:ri(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function T(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return T(r.element,n);if(r.type===`set`)return T(r.valueType,n);if(r.type===`lazy`)return T(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return T(r.innerType,n);if(r.type===`intersection`)return T(r.left,n)||T(r.right,n);if(r.type===`record`||r.type===`map`)return T(r.keyType,n)||T(r.valueType,n);if(r.type===`pipe`)return T(r.in,n)||T(r.out,n);if(r.type===`object`){for(let e in r.shape)if(T(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(T(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(T(e,n))return!0;return!!(r.rest&&T(r.rest,n))}return!1}var ni=(e,t={})=>n=>{let r=$r({...n,processors:t});return w(e,r),ei(r,e),ti(r,e)},ri=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$r({...i??{},target:a,io:t,processors:n});return w(e,o),ei(o,e),ti(o,e)},ii={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ai=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ii[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},oi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},si=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ci=(e,t,n,r)=>{n.not={}},li=(e,t,n,r)=>{let i=e._zod.def,a=s(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ui=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},pi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=w(a.element,t,{...r,path:[...r.path,`items`]})},mi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=w(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=w(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},hi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>w(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},gi=(e,t,n,r)=>{let i=e._zod.def,a=w(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=w(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},_i=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=w(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=w(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=w(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},vi=(e,t,n,r)=>{let i=e._zod.def,a=w(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},yi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Si=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ci=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;w(a,t,r);let o=t.seen.get(e);o.ref=a},wi=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ti=(e,t,n,r)=>{let i=e._zod.def;w(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=n(`ZodISODateTime`,(e,t)=>{qt.init(e,t),k.init(e,t)});function Di(e){return yr(Ei,e)}var Oi=n(`ZodISODate`,(e,t)=>{Jt.init(e,t),k.init(e,t)});function ki(e){return br(Oi,e)}var Ai=n(`ZodISOTime`,(e,t)=>{Yt.init(e,t),k.init(e,t)});function ji(e){return xr(Ai,e)}var Mi=n(`ZodISODuration`,(e,t)=>{Xt.init(e,t),k.init(e,t)});function Ni(e){return Sr(Mi,e)}var Pi=(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get(){return e.issues.length===0}}})};n(`ZodError`,Pi);var E=n(`ZodError`,Pi,{Parent:Error}),Fi=De(E),Ii=Oe(E),Li=ke(E),Ri=je(E),zi=Ne(E),Bi=Pe(E),Vi=Fe(E),Hi=Ie(E),Ui=Le(E),Wi=Re(E),Gi=ze(E),Ki=Be(E),D=n(`ZodType`,(e,t)=>(S.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ri(e,`input`),output:ri(e,`output`)}}),e.toJSONSchema=ni(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(g(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>oe(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Fi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Li(e,t,n),e.parseAsync=async(t,n)=>Ii(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ri(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zi(e,t,n),e.decode=(t,n)=>Bi(e,t,n),e.encodeAsync=async(t,n)=>Vi(e,t,n),e.decodeAsync=async(t,n)=>Hi(e,t,n),e.safeEncode=(t,n)=>Ui(e,t,n),e.safeDecode=(t,n)=>Wi(e,t,n),e.safeEncodeAsync=async(t,n)=>Gi(e,t,n),e.safeDecodeAsync=async(t,n)=>Ki(e,t,n),e.refine=(t,n)=>e.check(no(t,n)),e.superRefine=t=>e.check(ro(t)),e.overwrite=t=>e.check(Hr(t)),e.optional=()=>P(e),e.exactOptional=()=>za(e),e.nullable=()=>Va(e),e.nullish=()=>P(Va(e)),e.nonoptional=t=>qa(e,t),e.array=()=>A(e),e.or=t=>M([e,t]),e.and=t=>ka(e,t),e.transform=t=>Za(e,Ia(t)),e.default=t=>Ua(e,t),e.prefault=t=>Ga(e,t),e.catch=t=>Ya(e,t),e.pipe=t=>Za(e,t),e.readonly=()=>$a(e),e.describe=t=>{let n=e.clone();return Yn.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Yn.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Yn.get(e);let n=e.clone();return Yn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),qi=n(`_ZodString`,(e,t)=>{Ft.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ir(...t)),e.includes=(...t)=>e.check(zr(...t)),e.startsWith=(...t)=>e.check(Br(...t)),e.endsWith=(...t)=>e.check(Vr(...t)),e.min=(...t)=>e.check(Pr(...t)),e.max=(...t)=>e.check(Nr(...t)),e.length=(...t)=>e.check(Fr(...t)),e.nonempty=(...t)=>e.check(Pr(1,...t)),e.lowercase=t=>e.check(Lr(t)),e.uppercase=t=>e.check(Rr(t)),e.trim=()=>e.check(Wr()),e.normalize=(...t)=>e.check(Ur(...t)),e.toLowerCase=()=>e.check(Gr()),e.toUpperCase=()=>e.check(Kr()),e.slugify=()=>e.check(qr())}),Ji=n(`ZodString`,(e,t)=>{Ft.init(e,t),qi.init(e,t),e.email=t=>e.check(Zn(Yi,t)),e.url=t=>e.check(rr(Qi,t)),e.jwt=t=>e.check(vr(ma,t)),e.emoji=t=>e.check(ir(ea,t)),e.guid=t=>e.check(Qn(Xi,t)),e.uuid=t=>e.check($n(Zi,t)),e.uuidv4=t=>e.check(er(Zi,t)),e.uuidv6=t=>e.check(tr(Zi,t)),e.uuidv7=t=>e.check(nr(Zi,t)),e.nanoid=t=>e.check(ar(ta,t)),e.guid=t=>e.check(Qn(Xi,t)),e.cuid=t=>e.check(or(na,t)),e.cuid2=t=>e.check(sr(ra,t)),e.ulid=t=>e.check(cr(ia,t)),e.base64=t=>e.check(hr(da,t)),e.base64url=t=>e.check(gr(fa,t)),e.xid=t=>e.check(lr(aa,t)),e.ksuid=t=>e.check(ur(oa,t)),e.ipv4=t=>e.check(dr(sa,t)),e.ipv6=t=>e.check(fr(ca,t)),e.cidrv4=t=>e.check(pr(la,t)),e.cidrv6=t=>e.check(mr(ua,t)),e.e164=t=>e.check(_r(pa,t)),e.datetime=t=>e.check(Di(t)),e.date=t=>e.check(ki(t)),e.time=t=>e.check(ji(t)),e.duration=t=>e.check(Ni(t))});function O(e){return Xn(Ji,e)}var k=n(`ZodStringFormat`,(e,t)=>{C.init(e,t),qi.init(e,t)}),Yi=n(`ZodEmail`,(e,t)=>{Rt.init(e,t),k.init(e,t)}),Xi=n(`ZodGUID`,(e,t)=>{It.init(e,t),k.init(e,t)}),Zi=n(`ZodUUID`,(e,t)=>{Lt.init(e,t),k.init(e,t)}),Qi=n(`ZodURL`,(e,t)=>{zt.init(e,t),k.init(e,t)});function $i(e){return rr(Qi,e)}var ea=n(`ZodEmoji`,(e,t)=>{Bt.init(e,t),k.init(e,t)}),ta=n(`ZodNanoID`,(e,t)=>{Vt.init(e,t),k.init(e,t)}),na=n(`ZodCUID`,(e,t)=>{Ht.init(e,t),k.init(e,t)}),ra=n(`ZodCUID2`,(e,t)=>{Ut.init(e,t),k.init(e,t)}),ia=n(`ZodULID`,(e,t)=>{Wt.init(e,t),k.init(e,t)}),aa=n(`ZodXID`,(e,t)=>{Gt.init(e,t),k.init(e,t)}),oa=n(`ZodKSUID`,(e,t)=>{Kt.init(e,t),k.init(e,t)}),sa=n(`ZodIPv4`,(e,t)=>{Zt.init(e,t),k.init(e,t)}),ca=n(`ZodIPv6`,(e,t)=>{Qt.init(e,t),k.init(e,t)}),la=n(`ZodCIDRv4`,(e,t)=>{$t.init(e,t),k.init(e,t)}),ua=n(`ZodCIDRv6`,(e,t)=>{en.init(e,t),k.init(e,t)}),da=n(`ZodBase64`,(e,t)=>{nn.init(e,t),k.init(e,t)}),fa=n(`ZodBase64URL`,(e,t)=>{an.init(e,t),k.init(e,t)}),pa=n(`ZodE164`,(e,t)=>{on.init(e,t),k.init(e,t)}),ma=n(`ZodJWT`,(e,t)=>{cn.init(e,t),k.init(e,t)}),ha=n(`ZodNumber`,(e,t)=>{ln.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r),e.gt=(t,n)=>e.check(Ar(t,n)),e.gte=(t,n)=>e.check(jr(t,n)),e.min=(t,n)=>e.check(jr(t,n)),e.lt=(t,n)=>e.check(Or(t,n)),e.lte=(t,n)=>e.check(kr(t,n)),e.max=(t,n)=>e.check(kr(t,n)),e.int=t=>e.check(va(t)),e.safe=t=>e.check(va(t)),e.positive=t=>e.check(Ar(0,t)),e.nonnegative=t=>e.check(jr(0,t)),e.negative=t=>e.check(Or(0,t)),e.nonpositive=t=>e.check(kr(0,t)),e.multipleOf=(t,n)=>e.check(Mr(t,n)),e.step=(t,n)=>e.check(Mr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ga(e){return Cr(ha,e)}var _a=n(`ZodNumberFormat`,(e,t)=>{un.init(e,t),ha.init(e,t)});function va(e){return wr(_a,e)}var ya=n(`ZodNull`,(e,t)=>{dn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r)});function ba(e){return Tr(ya,e)}var xa=n(`ZodUnknown`,(e,t)=>{fn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Sa(){return Er(xa)}var Ca=n(`ZodNever`,(e,t)=>{pn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r)});function wa(e){return Dr(Ca,e)}var Ta=n(`ZodArray`,(e,t)=>{hn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Pr(t,n)),e.nonempty=t=>e.check(Pr(1,t)),e.max=(t,n)=>e.check(Nr(t,n)),e.length=(t,n)=>e.check(Fr(t,n)),e.unwrap=()=>e.element});function A(e,t){return Jr(Ta,e,t)}var Ea=n(`ZodObject`,(e,t)=>{bn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),m(e,`shape`,()=>t.shape),e.keyof=()=>Na(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Sa()}),e.loose=()=>e.clone({...e._zod.def,catchall:Sa()}),e.strict=()=>e.clone({...e._zod.def,catchall:wa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>de(e,t),e.safeExtend=t=>fe(e,t),e.merge=t=>pe(e,t),e.pick=t=>le(e,t),e.omit=t=>ue(e,t),e.partial=(...t)=>me(La,e,t[0]),e.required=(...t)=>he(Ka,e,t[0])});function j(e,t){return new Ea({type:`object`,shape:e??{},...b(t)})}var Da=n(`ZodUnion`,(e,t)=>{Sn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.options=t.options});function M(e,t){return new Da({type:`union`,options:e,...b(t)})}var Oa=n(`ZodIntersection`,(e,t)=>{Cn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function ka(e,t){return new Oa({type:`intersection`,left:e,right:t})}var Aa=n(`ZodRecord`,(e,t)=>{En.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ja(e,t,n){return new Aa({type:`record`,keyType:e,valueType:t,...b(n)})}var Ma=n(`ZodEnum`,(e,t)=>{Dn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ma({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ma({...t,checks:[],...b(r),entries:i})}});function Na(e,t){return new Ma({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var Pa=n(`ZodLiteral`,(e,t)=>{On.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function N(e,t){return new Pa({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var Fa=n(`ZodTransform`,(e,t)=>{kn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new i(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xe(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}});function Ia(e){return new Fa({type:`transform`,transform:e})}var La=n(`ZodOptional`,(e,t)=>{jn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function P(e){return new La({type:`optional`,innerType:e})}var Ra=n(`ZodExactOptional`,(e,t)=>{Mn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function za(e){return new Ra({type:`optional`,innerType:e})}var Ba=n(`ZodNullable`,(e,t)=>{Nn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Va(e){return new Ba({type:`nullable`,innerType:e})}var Ha=n(`ZodDefault`,(e,t)=>{Pn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ua(e,t){return new Ha({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():re(t)}})}var Wa=n(`ZodPrefault`,(e,t)=>{In.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e,t){return new Wa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():re(t)}})}var Ka=n(`ZodNonOptional`,(e,t)=>{Ln.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e,t){return new Ka({type:`nonoptional`,innerType:e,...b(t)})}var Ja=n(`ZodCatch`,(e,t)=>{zn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ya(e,t){return new Ja({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Xa=n(`ZodPipe`,(e,t)=>{Bn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.in=t.in,e.out=t.out});function Za(e,t){return new Xa({type:`pipe`,in:e,out:t})}var Qa=n(`ZodReadonly`,(e,t)=>{Hn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e){return new Qa({type:`readonly`,innerType:e})}var eo=n(`ZodCustom`,(e,t)=>{Wn.init(e,t),D.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r)});function to(e,t){return Yr(eo,e??(()=>!0),t)}function no(e,t={}){return Xr(eo,e,t)}function ro(e){return Zr(e)}var F=function(e){return e.Article=`article`,e.AudioDocument=`audiodocument`,e.AudioVisualDocument=`audiovisualdocument`,e.Book=`book`,e.Bookitem=`bookitem`,e.Conference=`conference`,e.Document=`document`,e.Image=`image`,e.Issue=`issue`,e.Journal=`journal`,e.Preprint=`preprint`,e.Proceeding=`proceeding`,e.Report=`report`,e.Unknown=`unknown`,e.Webpage=`webpage`,e}({}),io=M([N(F.Book),N(F.Bookitem),N(F.Conference),N(F.Document),N(F.Report),N(F.Proceeding),N(F.Unknown)]),ao=M([N(F.Article),N(F.Conference),N(F.Issue),N(F.Journal),N(F.Preprint),N(F.Proceeding),N(F.Unknown)]),oo=j({artnum:O(),atitle:O(),aufirst:O(),aulast:O(),auinit:O(),auinit1:O(),auinitm:O(),ausuffix:O(),au:A(O()),aucorp:O(),bici:O(),btitle:O(),chron:O(),coden:O(),date:O(),edition:O(),eissn:O(),epage:O(),externalDBID:O(),externalDocID:O(),genre:Na(F),id:O(),isbn:O(),issn:O(),issue:O(),jtitle:O(),pages:O(),part:O(),place:O(),pub:O(),quarter:O(),rft_id:A(O()),series:O(),sici:O(),spage:O(),ssn:O(),stitle:O(),title:O(),tpages:O(),volume:O()}).partial(),so=j({bibid:O(),doi:O(),uri:O()}).partial(),co=oo.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),lo=oo.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),uo=oo.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),fo=oo.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),po=oo.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),mo=oo.pick({au:!0,date:!0,title:!0}).partial(),ho=j({...oo.shape,...so.shape}),I=(e,t)=>({...t,genre:e}),L=(e,t)=>({...t,genre:e}),R=e=>({...e,genre:F.AudioVisualDocument}),go=e=>({...e,genre:F.Image}),_o=e=>({...e,genre:F.Document}),vo=e=>({...e,genre:F.Webpage}),yo=e=>Object.keys(e.shape),bo=yo(oo),xo=yo(so),So=(e,t,n)=>{if(n.length>0&&typeof n[0]==`string`){let r=t.startsWith(`rft_`)?t:`rft.${t}`;e.append(r,n[0])}},Co=(e,t,n)=>{e.append(t,n)},wo=(e,t,n)=>{e.append(`rft.${t}`,n)},To=e=>xo.includes(e),Eo=e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{Array.isArray(n)?So(t,e,n):typeof n==`string`&&n&&(To(e)?Co(t,e,n):wo(t,e,n))}),t},Do=(e,t,n,r)=>{let i=t.getAll(n).filter(e=>!!e).map(e=>e.trim());return i.length===0?e:{...e,[r]:i}},Oo=e=>{let t=ko(e),n=(e,n)=>{if(n===`au`)return Do(e,t,`rft.au`,`au`);if(n===`rft_id`)return Do(e,t,`rft_id`,`rft_id`);let r=To(n)?n:`rft.${n}`,i=t.get(r);return i?{...e,[n]:i.trim()}:e},r=[...bo,...xo].reduce(n,{});return Object.keys(r).length===0?null:r},ko=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Ao(e){return typeof e==`string`?Object.values(F).includes(e):!1}var jo=function(e){return e.CA=`CA`,e.EUAPAC=`EUAPAC`,e}({}),Mo=j({id:O(),name:O(),region:Na(jo)}),No=j({tenants:A(Mo)}),Po=9*1024*1024,Fo=j({url:$i({error:e=>e.input===void 0?`should have the required string property "url"`:`"url" must be a string`}),html:O({error:e=>e.input===void 0?`should have the required string property "html"`:void 0}).max(Po,{error:`"html" should be a string with a MAX Length of ${Po}`}),tenantCode:O({error:e=>e.input===void 0?`should have the required string property "tenantCode"`:void 0}).min(1,{error:`"tenantCode" must be a string`}),region:Na([jo.EUAPAC,jo.CA],{error:e=>e.input===void 0?`should have the required string property "region"`:`"region" must be a string of EUAPAC or CA`})});function Io(e){return Fo.safeParse(e).success}var Lo=j({name:O(),region:Na(jo),apps:ja(O(),O())}),Ro=ja(O(),Lo),zo=e=>Lo.safeParse(e).success,Bo=e=>Ro.safeParse(e).success;function Vo(e){return Mo.safeParse(e).success}function Ho(e){return typeof e==`string`&&Object.keys(jo).includes(e)}var Uo=e=>{if(!Bo(e))throw Error(`Error: the customer list data is invalid.`);return{tenants:Object.entries(e).map(([e,t])=>Wo(e,t))}},Wo=(e,t)=>{if(!zo(t))throw Error(`Invalid customer: ${t}`);let{name:n,region:r}=t,i={id:e,name:n,region:r};if(!Vo(i))throw Error(`Invalid tenant: ${JSON.stringify(i)}`);return i},Go=j({parserType:O(),parserName:O().nullable(),referrer:O()}),Ko=j({bookmarkingWorkflowUrl:ba(),resource:ba()}),qo=j({bookmarkingWorkflowUrl:O(),resource:ba()}),Jo=j({bookmarkingWorkflowUrl:ba(),resource:ho}),Yo=j({z3988SearchResult:N(!0)}),Xo=j({summonSearchResult:N(!0)}),Zo=M([qo,Ko,Jo,Yo,Xo]),Qo=j({meta:Go}).and(Zo);function $o(e){return{bookmarkingWorkflowUrl:e,resource:null}}function z(){return{bookmarkingWorkflowUrl:null,resource:null}}function B(e){return{bookmarkingWorkflowUrl:null,resource:e}}function es(){return{z3988SearchResult:!0}}function ts(){return{summonSearchResult:!0}}var ns=e=>{let t=e.getAttribute(`title`);return t?Oo(t):null},rs=({document:e})=>{let t=Array.from(e.querySelectorAll(`.Z3988`));if(t.length===0)return z();let n=t.map(ns).find(e=>e!==null);return n?B(n):z()},is=e=>{let t=Array.from(e.querySelectorAll(`.author > a`)).map(e=>e.textContent.trim()).filter(Boolean);return t.length?t:void 0},as=e=>e.querySelector(`#rpi-attribute-book_details-edition > .rpi-attribute-value > span`)?.textContent??void 0,os=e=>{let t=e.querySelector(`#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span`)?.textContent??void 0,n=e.querySelector(`#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span`)?.textContent??void 0;if(t&&n)return`${t},${n}`;if(t)return t;if(n)return n},ss=e=>e.querySelector(`#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span`)?.textContent??void 0,cs=e=>e.querySelector(`#rpi-attribute-book_details-publisher > .rpi-attribute-value > span`)?.textContent??void 0,ls=e=>e.querySelector(`#rpi-attribute-book_details-series > .rpi-attribute-value > a`)?.textContent??void 0,us=e=>{let t=e.querySelector(`#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span`)?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},ds=({document:e})=>{let t=is(e),n=as(e),r=os(e),i=ss(e),a=cs(e),o=ls(e),s=e.getElementById(`productTitle`)?.textContent.trim()??void 0,c=us(e);return{bookmarkingWorkflowUrl:null,resource:I(F.Book,{au:t,date:i,edition:n,isbn:r,pub:a,series:o,title:s,tpages:c})}},V=(e,t,n)=>{let r=H(e,t,n);return r.length>0?r[0]:void 0},H=(e,t,n)=>Array.from(e.querySelectorAll(`meta[${t}='${n}']`)).map(e=>e.getAttribute(`content`)).filter(e=>!!e?.trim()),fs=e=>{let t=new Map,n=e.split(`;`).filter(e=>!!e);for(let e of n){let[n,r,i]=e.split(`:`);t.set(n,{type:r,value:i})}return t},U=function(e){return e[e.None=0]=`None`,e[e.Book=1]=`Book`,e[e.Chapter=2]=`Chapter`,e[e.Journal=3]=`Journal`,e[e.Article=4]=`Article`,e[e.AudioVisual=5]=`AudioVisual`,e[e.Webpage=6]=`Webpage`,e[e.Document=7]=`Document`,e}({}),ps=e=>{if(!e)return;let t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},ms=e=>ps(e.querySelector(`#publication_date p`)?.textContent.trim()??V(e,`name`,`bepress_citation_date`)),hs=e=>({spage:V(e,`name`,`bepress_citation_firstpage`),epage:V(e,`name`,`bepress_citation_lastpage`)}),gs=e=>{let t=/https?:\/\/doi\.org\/(.+)/i,n=(e.querySelector(`#source p`)?.textContent.trim())?.match(t);if(n?.length===2)return n[1];let r=(e.querySelector(`#recommended_citation p a`)?.textContent.trim())?.match(t);if(r?.length===2)return r[1]},_s=e=>{let t=[],n=e.querySelectorAll(`tbody td`);for(let e of n){let n=e.querySelector(`strong`);if(n&&!n.querySelector(`a`)){let e=n.textContent.trim();e&&t.push(e)}}return t},vs=e=>V(e,`name`,`bepress_citation_title`)??e.querySelector(`title`)?.textContent.trim(),ys=e=>H(e,`name`,`author`),bs=e=>V(e,`name`,`bepress_citation_publisher`),xs=e=>V(e,`name`,`bepress_citation_pdf_url`),Ss=(e,t)=>{if(t.includes(`/etd/`))return U.Document;if(t.includes(`/sophpm_music/`)||t.includes(`/streaming/`))return U.AudioVisual;if(t.includes(`/vol`))return U.Article;if(t.includes(`/facpub`)||t.includes(`/studentpub/`)){let t={"book chapter":U.Book,"conference paper":U.Book,"peer-reviewed article":U.Article,other:U.Document},n=e.querySelector(`#document_type p`)?.textContent.toLowerCase().trim();return n?t[n]:void 0}return U.Journal},Cs=e=>{let t=vs(e),n=ys(e),r=ms(e),i=V(e,`name`,`bepress_citation_journal_title`),a=V(e,`name`,`bepress_citation_volume`),o=V(e,`name`,`bepress_citation_issue`),{epage:s,spage:c}=hs(e),l=xs(e),u=gs(e);return L(F.Article,{atitle:t,jtitle:i,au:n,date:r,volume:a,issue:o,epage:s,spage:c,doi:u,uri:l})},ws=(e,t)=>{let n=e.querySelector(`.inherit-title a`)?.textContent.trim()??vs(e),r=_s(e),i=ms(e),a=bs(e),o=gs(e);return L(F.Journal,{jtitle:n,au:r,date:i,pub:a,doi:o,uri:t})},Ts=e=>{let t=vs(e),n=ys(e),r=ms(e),i=bs(e),a=xs(e),o=e.querySelector(`#document_type p`)?.textContent.toLowerCase().trim();if(o===`book chapter`){let o=e.querySelector(`#source p`)?.textContent.trim();return I(F.Bookitem,{pub:i,atitle:t,btitle:o,au:n,date:r,uri:a})}let s=gs(e);return I(o===`conference paper`?F.Conference:F.Document,{pub:i,title:t,au:n,date:r,doi:s,uri:a})},Es=(e,t)=>R({title:vs(e),au:ys(e),date:ms(e),pub:bs(e),uri:t}),Ds=e=>{let t=vs(e),n=ys(e),r=ms(e);return _o({pub:bs(e),title:t,au:n,date:r,uri:xs(e)})},Os=({url:e,document:t})=>{switch(Ss(t,e)){case U.Article:return B(Cs(t));case U.Journal:return B(ws(t,e));case U.Book:return B(Ts(t));case U.AudioVisual:return B(Es(t,e));case U.Document:return B(Ds(t));default:return z()}},ks=e=>{if(e)return e.replace(/[^0-9]/g,``)},As=e=>Array.from(e.querySelectorAll(`.author-source-list li a`)).filter(e=>e.childNodes.length>0).map(e=>e.childNodes[0].textContent?.trim()).filter(e=>!!e),js=e=>e.querySelector(`.article-header`)?.querySelector(`h1 span`)?.textContent.trim(),Ms=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:`Elsevier Inc.`}),Ns=e=>{let t=e.querySelector(`.article-meta`);if(!t)return{};let n=t.querySelector(`.issue`)?.textContent??void 0,r=t.querySelector(`.title`)?.textContent.trim()??void 0,[i,a]=(n?.split(`,`)??[]).map(e=>e.trim());return{volume:ks(i),issue:ks(a),jtitle:r}},Ps=e=>{let t=e.querySelector(`.article-header .source`)?.textContent,n=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],[r,i]=((t?.match(/Pages (\d+-\d+)/))?.[1].split(`-`)??[]).map(e=>e.trim()),{jtitle:a,volume:o,issue:s}=Ns(e);return B(L(F.Article,{au:As(e),atitle:js(e),spage:r,epage:i,date:n,jtitle:a,volume:o,issue:s}))},Fs=e=>{let[t,n]=e.querySelectorAll(`.source`),{date:r,pub:i}=Ms(n),[a,o]=(e.querySelector(`.browse__book-toc`)?.querySelector(`h1`)?.textContent.split(`,`)??[]).map(e=>e.trim());return B(I(F.Book,{btitle:a,edition:o,pub:i,au:t.textContent?[t.textContent]:void 0,date:r}))},Is=e=>{let t=e.querySelector(`.article-meta`);if(!t)return{};let n=t.querySelector(`.edition`)?.textContent??void 0,r=t.querySelector(`.title`)?.textContent.trim()??void 0,{date:i,pub:a}=Ms(t.querySelector(`.copyright`));return{edition:n,btitle:r,date:i,pub:a}},Ls=e=>{let{edition:t,btitle:n,date:r,pub:i}=Is(e),[a,o]=(((e.querySelector(`.article-header .source`)?.textContent)?.match(/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i))?.[1].split(`-`)??[]).map(e=>e.trim());return B(I(F.Bookitem,{au:As(e),atitle:js(e),btitle:n,edition:t,pub:i,date:r,spage:a,epage:o}))},Rs=/^[0-9X]$/,zs=e=>{if(!e)return;let t=``;for(let n of e)Rs.test(n)&&(t+=n);if(t)return t},Bs=(e,t)=>{let n=e.querySelector(`.c-cksc-content-header__title`)?.textContent.trim(),r=e.querySelector(`.c-cksc-content-nice__button`)?.textContent.trim(),i=e.querySelector(`.c-cksc-content-nice__date`)?.textContent.trim(),a=zs(e.evaluate(`//p[contains(text(), "ISBN")]`,e,null,XPathResult.ANY_TYPE).iterateNext()?.textContent);return B({genre:F.Document,title:n,pub:r,date:i,uri:t,isbn:a})},Vs=e=>e.querySelector(`.browse-toc`)??e.querySelector(`.browse__journal`),Hs=e=>(Vs(e)?.querySelector(`h1`)?.firstElementChild)?.textContent.trim(),Us=e=>{let t=Vs(e),n=t?.querySelector(`figure figcaption.source`);if(n){let[e,t,r]=n.textContent.split(`,`).map(e=>e.trim());return{date:e,volume:ks(t),issue:ks(r)}}let[r,i]=(t?.querySelector(`p`)?.textContent)?.split(`,`)??[];return{date:t?.querySelector(`.source span`)?.textContent??void 0,volume:ks(r),issue:ks(i)}},Ws=e=>{let{date:t,volume:n,issue:r}=Us(e);return B(L(F.Journal,{jtitle:Hs(e),date:t,volume:n,issue:r}))},Gs=function(e){return e.Book=`Book`,e.Chapter=`Book Chapter`,e.Article=`Full Text Article`,e.Journal=`Journal`,e.Guideline=`Guideline`,e}(Gs||{}),Ks=e=>Object.values(Gs).includes(e),qs=(e,t)=>{let n=e.querySelector(`.content-type`)??e.querySelector(`.c-cksc-content-header__content-type`);if(!n)return t.includes(`journal`)?Gs.Journal:void 0;let r=n.textContent;if(r&&Ks(r))return r},Js=({url:e,document:t})=>{switch(qs(t,e)){case Gs.Book:return Fs(t);case Gs.Chapter:return Ls(t);case Gs.Article:return Ps(t);case Gs.Journal:return Ws(t);case Gs.Guideline:return Bs(t,e);case void 0:return z()}},Ys=j({"@context":O()}),Xs=e=>Ys.safeParse(e).success,Zs=`script[type="application/ld+json"]`,Qs=e=>Array.from(e.querySelectorAll(Zs)),$s=e=>e.querySelector(Zs),ec=e=>{let t=e.textContent;if(!t)return null;try{let e=JSON.parse(t);if(Xs(e))return e}catch{return null}return null},tc=j({"@id":O(),"@type":O(),author:j({"@id":O()}).optional(),datePublished:O().optional(),dateModified:O().optional(),description:O().optional(),inLanguage:O().optional(),isPartOf:j({"@id":O()}).optional(),name:O().optional(),url:O().optional()}),nc=Ys.extend({"@graph":A(tc)}),rc=e=>nc.safeParse(e).success,ic=e=>{let t=Qs(e);if(t.length===0)return null;let n=t.map(ec).filter(rc).map(e=>e[`@graph`]);return n.length===1?n[0]:null},ac=(e,t)=>e.find(e=>e[`@type`]===t)??null,oc=(e,t)=>e.find(e=>e[`@id`]===t)??null,sc=e=>{let t=ac(e,`WebPage`);if(!t)return null;let n=t.author?oc(e,t.author[`@id`]):void 0;return vo({au:n?.name?[n.name]:void 0,date:t.datePublished,title:t.name})},cc=({document:e})=>{let t=ic(e);return t?{bookmarkingWorkflowUrl:null,resource:sc(t)}:z()},lc=()=>z(),uc=function(e){return e.Journal=`journal`,e.Article=`article`,e}(uc||{}),dc=e=>{let{pathname:t}=new URL(e);if(t.startsWith(`/toc/`))return uc.Journal;if(t.startsWith(`/article/`))return uc.Article},fc=e=>{let t=e.querySelector(`header h1 span`)?.firstChild?.textContent?.trim(),n=(e.querySelector(`header p span`)?.textContent.trim())?.match(/\d{4}-\d{3}[\dX]/g)??[],[r,i]=[n[0],n[1]],a=e.evaluate(`//dt[contains(text(), "Publisher")]/following-sibling::dd/a`,e,null,XPathResult.STRING_TYPE).stringValue.trim();return B(L(F.Journal,{pub:a,jtitle:t,issn:r,eissn:i}))},pc=e=>{let t,n,r=H(e,`name`,`citation_issn`);return r.length===2?(t=r[1],n=r[0]):t=r[0],{eissn:t,issn:n}},mc=e=>{let t=V(e,`name`,`citation_journal_title`),n=V(e,`name`,`citation_title`),r=H(e,`name`,`citation_author`),i=V(e,`name`,`citation_doi`),{eissn:a,issn:o}=pc(e),s=V(e,`name`,`citation_publisher`),c=V(e,`name`,`citation_publication_date`),l=V(e,`name`,`citation_volume`),u=V(e,`name`,`citation_issue`),d=V(e,`name`,`citation_firstpage`),f=V(e,`name`,`citation_lastpage`);return B(L(F.Article,{jtitle:t,atitle:n,au:r,doi:i,eissn:a,issn:o,pub:s,date:c,volume:l,issue:u,spage:d,epage:f}))},hc=({document:e,url:t})=>{switch(dc(t)){case uc.Journal:return fc(e);case uc.Article:return mc(e);case void 0:return z()}},gc=e=>{let t=V(e,`name`,`pbContext`);if(!t)return U.None;let n=fs(t);switch(n.has(`page`)?n.get(`page`)?.value:null){case`Article/Chapter View`:return U.Article;case`Table of Contents`:return U.Journal;default:return U.None}},_c=e=>{let t=e.querySelector(`meta[property="article:author"]`)?.getAttribute(`content`)?.split(`,`).map(e=>e.trim());return t&&t.length>0?t:void 0},vc=e=>{let t=new Map,n=Array.from(e.querySelectorAll(`.rlist>li>span`)).map(e=>e.textContent.trim()).join(``),r=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(n);r&&t.set(`issn`,r[1]);let i=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(n);return i&&t.set(`eissn`,i[1]),t},yc=e=>e.querySelector(`span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]`)?.textContent??void 0,bc=e=>e.querySelector(`span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]`)?.textContent??void 0,xc=e=>e.querySelector(`meta[name="dc.Identifier"][scheme="doi"]`)?.getAttribute(`content`)??void 0,Sc=e=>e.querySelector(`h1`)?.textContent??void 0,Cc=e=>{let t=new Map,n=e.querySelector(`h2.heading-m`)?.textContent,r=n?.match(/Issue\s+(\d+(?:-\d+)?)/);r&&t.set(`issue`,r[1]);let i=n?.match(/Volume\s+(\d+)/);i&&t.set(`volume`,i[1]);let a=n?.match(/(\d{4})$/);return a&&t.set(`date`,a[1]),t},wc=e=>{let t=_c(e.document),n=V(e.document,`name`,`dc.Date`),r=xc(e.document),i=vc(e.document),a=i.get(`issn`),o=i.get(`eissn`),s=bc(e.document),c=V(e.document,`name`,`citation_journal_title`),l=V(e.document,`name`,`dc.Publisher`),u=V(e.document,`name`,`dc.Title`),d=yc(e.document);return L(F.Article,{au:t,date:n,eissn:o,issn:a,issue:s,jtitle:c,pub:l,title:u,volume:d,doi:r})},Tc=e=>{let t=vc(e.document),n=t.get(`issn`),r=t.get(`eissn`),i=Sc(e.document),a=Cc(e.document),o=a.get(`issue`),s=a.get(`volume`),c=a.get(`date`);return L(F.Journal,{eissn:r,issn:n,jtitle:i,title:i,issue:o,volume:s,date:c})},Ec=e=>{switch(gc(e.document)){case U.Article:return B(wc(e));case U.Journal:return B(Tc(e));default:return z()}},Dc=e=>{let t=V(e,`name`,`citation_type`),n=V(e,`name`,`citation_article_type`);return t===`JOUR`&&n?U.Article:t===`CHP`?U.Chapter:e.querySelector(`.book-edition-year`)?.textContent.includes(`Book`)?U.Book:e.getElementById(`journal-title`)?U.Journal:U.None},Oc=e=>V(e,`name`,`citation_doi`)??V(e,`name`,`dc.identifier`)??e.querySelector(`.doi .anchor-text`)?.textContent??void 0,kc=e=>{let t=Array.from(e.querySelectorAll(`.kf-details .kf-detail-item:has(h3)`)),n=new Map;for(let e of t){let t=e.querySelector(`h3`)?.textContent,r=e.querySelector(`p`)?.textContent;t&&r&&n.set(t,r)}return n},Ac=(e,t)=>{let n=Array.from(e.querySelectorAll(t)).map(e=>e.textContent).filter(e=>!!e);return n.length>0?n:void 0},jc=e=>{let t=e.querySelector(`.js-issn`)?.textContent;if(t)return t.replace(`Online ISSN: `,``)},Mc=e=>{let t=e.get(`DOI`);if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},Nc=e=>{let t=kc(e),n=V(e,`property`,`og:title`),r=V(e,`property`,`og:book:isbn`),i=t.get(`Published`),a=Ac(e,`.authors-container .author-detail h3`),o=Oc(e)??Mc(t);return I(F.Book,{au:a,date:i,doi:o,isbn:r,title:n})},Pc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`property`,`og:book:isbn`),r=V(e,`name`,`citation_publication_date`),i=Ac(e,`.author-group .button-link-text`),a=V(e,`name`,`citation_firstpage`),o=V(e,`name`,`citation_lastpage`),s=V(e,`name`,`citation_publisher`),c=Oc(e),l=V(e,`name`,`citation_inbook_title`)??e.querySelector(`.publication-title`)?.textContent??void 0;return I(F.Bookitem,{au:i,btitle:l,date:r,doi:c,epage:o,isbn:n,pub:s,spage:a,title:t})},Fc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`name`,`citation_issn`),r=V(e,`name`,`citation_publication_date`),i=Ac(e,`.author-group .button-link-text`),a=V(e,`name`,`citation_publisher`),o=V(e,`name`,`citation_firstpage`),s=V(e,`name`,`citation_issue`),c=V(e,`name`,`citation_volume`),l=Oc(e),u=V(e,`name`,`citation_journal_title`)??e.querySelector(`.publication-title`)?.textContent??void 0;return L(F.Article,{au:i,jtitle:u,date:r,doi:l,issn:n,issue:s,pub:a,spage:o,title:t,volume:c})},Ic=e=>{let t=e.getElementById(`journal-title`)?.textContent??void 0,n=jc(e);return L(F.Journal,{issn:n,title:t})},Lc=({document:e})=>{switch(Dc(e)){case U.Book:return B(Nc(e));case U.Chapter:return B(Pc(e));case U.Article:return B(Fc(e));case U.Journal:return B(Ic(e));default:return z()}},Rc=e=>{let t=V(e,`name`,`pbContext`);return t&&fs(t).has(`article`)?U.Article:U.Journal},zc=e=>{let t=e.querySelector(`.itemPageRangeHistory`);if(!t)return;let n=Array.from(t.childNodes).find(e=>e.textContent?.trim().startsWith(`Page`));if(n)return n.textContent?.replace(/Pages?/,``).trim()??void 0},Bc=e=>{let t=e.querySelector(`.issue-heading`)?.textContent;if(t)return t.split(`,`)[0]?.replace(`Volume`,``).trim()},Vc=e=>{let t=e.querySelector(`.issue-heading .nav-toc-list`)?.textContent;if(t)return t.replace(`Issue`,``).trim()},Hc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`name`,`dc.Publisher`),r=V(e,`name`,`dc.Date`),i=V(e,`name`,`publication_doi`),a=V(e,`name`,`citation_journal_title`),o=H(e,`name`,`dc.Creator`),s=Bc(e),c=Vc(e),l=zc(e),u=l?.includes(`-`)?l.split(`-`)[0]:l,d=l?.includes(`-`)?l.split(`-`)[1]:l;return L(F.Article,{au:o,jtitle:a,date:r,doi:i,issue:c,pub:n,spage:u,epage:d,title:t,volume:s})},Uc=e=>{let t=V(e,`property`,`og:title`),n=V(e,`name`,`publication_doi`);return L(F.Journal,{doi:n,title:t})},Wc=({document:e})=>{switch(Rc(e)){case U.Article:return B(Hc(e));case U.Journal:return B(Uc(e));default:return z()}},Gc=e=>Zo.safeParse(e).success,Kc=e=>Qo.safeParse(e).success,qc=e=>Go.safeParse(e).success;function Jc(e){return qo.safeParse(e).success}function Yc(e){return Jo.safeParse(e).success}function Xc(e){return Yo.safeParse(e).success}function Zc(e){return Xo.safeParse(e).success}function Qc(e){return Ko.safeParse(e).success}var $c=e=>Array.from(e.querySelectorAll(`tr th`)).find(e=>e.textContent.trim()===`DOI:`)?.nextElementSibling?.querySelector(`span[property="identifier"]`)?.textContent??void 0,el=e=>{let t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},tl=e=>{let{url:t,document:n}=e,r=rs(e);if(!Yc(r))return r;let i=$c(n);return i&&(r.resource.rft_id=[`info:doi/${i}`]),r.resource.bibid=el(t),r},nl=Ys.extend({"@type":N(`VideoObject`),name:O(),author:O(),genre:O(),description:O(),uploadDate:O(),duration:O(),thumbnailUrl:A(O())}),rl=e=>nl.safeParse(e).success,il=e=>{let t=Qs(e);if(t.length===0)return null;let n=t.map(ec).filter(rl);return n.length===1?n[0]:null},al=({url:e,document:t})=>{let n=il(t);return n?{bookmarkingWorkflowUrl:null,resource:R({au:[n.author],date:n.uploadDate,title:n.name,uri:e})}:z()},ol=e=>V(e,`name`,`doi`)??V(e,`name`,`DOI`)??V(e,`name`,`citation_doi`)??V(e,`name`,`dc.identifier`)??V(e,`name`,`prism.doi`)??void 0,sl=e=>{let t=e.editor?.map(e=>e.name)??[],n=[...e.author?.map(e=>e.name)??[],...t];if(n.length!==0)return n},cl=function(e){return e.Book=`Book`,e.Journal=`Journal`,e.Periodical=`Periodical`,e.PublicationVolume=`PublicationVolume`,e.ScholarlyArticle=`ScholarlyArticle`,e.VideoObject=`VideoObject`,e.WebPage=`WebPage`,e}({}),ll=function(e){return e.Article=`article`,e.Book=`book`,e.Paper=`Paper`,e.Video=`video.other`,e.Website=`website`,e}({}),W=function(e){return e.Article=`/article/`,e.Book=`/book/`,e.Chapter=`/chapter/`,e.Video=`/video/`,e.ReferenceWorkEntry=`/referenceworkentry/`,e.ReferenceWork=`/referencework/`,e.Protocol=`/protocol/`,e.Collections=`/collections/`,e.Journal=`/journal/`,e.JournalIssue=`/volumes-and-issues/`,e}({}),ul=j({"@type":N(cl.ScholarlyArticle),author:A(j({"@type":O(),name:O()})).optional(),editor:A(j({"@type":O(),name:O()})).optional(),datePublished:O().optional(),headline:O().optional(),issn:A(O()).optional(),pageStart:O().optional(),pageEnd:O().optional(),isPartOf:j({"@type":M([O(),A(O())]),name:O(),issn:A(O()).optional(),volumeNumber:O().optional(),isbn:A(O()).optional()}),publisher:j({"@type":O(),name:O()}).optional()}),dl=e=>ul.safeParse(e).success,fl=Ys.extend({"@type":N(cl.WebPage),mainEntity:ul}),pl=e=>fl.safeParse(e).success,ml=j({"@type":A(O()),name:O().optional(),issn:A(O()),volumeNumber:O().optional()}),hl=e=>ml.safeParse(e).success,gl=(e,t)=>V(e,`name`,`citation_issn`)??V(e,`name`,`prism.issn`)??(dl(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),_l=(e,t)=>{let n=sl(t),r=V(e,`name`,`citation_online_date`),i=ol(e),a=V(e,`name`,`citation_issue`),o=gl(e,t),s=hl(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,l=t.pageEnd,u=t.headline,d=t.isPartOf.name,f=hl(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return L(F.Article,{au:n,date:r,doi:i,issue:a,eissn:o,issn:s,spage:c,epage:l,atitle:u,jtitle:d,volume:f})},vl=Ys.extend({"@type":N(cl.Book),copyrightYear:O().optional(),author:A(j({"@type":O(),name:O()})).optional(),editor:A(j({"@type":O(),name:O()})).optional(),isbn:O().optional(),name:O().optional(),numberOfPages:ga().optional(),publisher:j({"@type":O(),name:O()}).optional()}),yl=e=>vl.safeParse(e).success,bl=function(e){return e.BOOK_TITLE=`Book Title`,e.AUTHORS=`Authors`,e.SERIES_TITLE=`Series Title`,e.DOI=`DOI`,e.PUBLISHER=`Publisher`,e.SOFTCOVER_ISBN=`Softcover ISBN`,e.EBOOK_ISBN=`eBook ISBN`,e.SERIES_ISSN=`Series ISSN`,e.SERIES_EISSN=`Series E-ISSN`,e.EDITION_NUMBER=`Edition Number`,e.NUMBER_OF_PAGES=`Number of Pages`,e}(bl||{}),xl=e=>{let t=e.querySelectorAll(`.c-bibliographic-information__list-item`),n=new Map;return t.forEach(e=>{let t=e.querySelector(`.u-text-bold`)?.textContent.trim(),r=e.querySelector(`.c-bibliographic-information__value`)?.textContent.trim();t&&r&&n.set(t,r)}),n},Sl=(e,t)=>{let n=xl(e),r=sl(t),i=t.copyrightYear?.toString(),a=ol(e)??n.get(bl.DOI),o=t.name??n.get(bl.BOOK_TITLE),s=t.isbn??n.get(bl.SOFTCOVER_ISBN),c=t.numberOfPages?.toString()??n.get(bl.NUMBER_OF_PAGES),l=t.publisher?.name??n.get(bl.PUBLISHER);return I(F.Book,{au:r,date:i,doi:a,title:o,isbn:s,tpages:c,pub:l})},Cl=j({"@type":N(`Periodical`),name:O(),url:O(),issn:A(O()),editor:A(j({givenName:O(),familyName:O()})),publisher:j({name:O()}),description:O()}),wl=e=>Cl.safeParse(e).success,Tl=e=>{let t=e.editor.map(({givenName:e,familyName:t})=>`${e} ${t}`),n=e.name,[r,i]=e.issn,a=e.publisher.name;return L(F.Journal,{au:t,jtitle:n,eissn:r,issn:i,pub:a})},El=j({"@type":N(cl.VideoObject),name:O().optional(),description:O().optional(),thumbnailUrl:O().optional(),uploadDate:O().optional(),contentUrl:O().optional(),duration:O().optional()}),Dl=e=>El.safeParse(e).success,Ol=(e,t)=>{let n=Array.from(e.querySelectorAll(`dd[data-test="video-segment-author"]`)).map(e=>e.textContent.trim()).filter(e=>!!e),r=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,i=t?.name??V(e,`property`,`og:title`)??void 0,a=e.querySelector(`video-about-doi`)?.textContent??void 0;return R({au:n.length>0?n:void 0,date:r,doi:a,title:i})},kl=e=>vo({title:V(e,`property`,`og:title`)}),Al=(e,t)=>{let n=V(t,`property`,`og:type`);return n===ll.Article&&e.includes(W.Article)?U.Article:n===ll.Book&&(e.includes(W.Book)||e.includes(W.ReferenceWork))?U.Book:n===ll.Paper&&e.includes(W.Chapter)?U.Chapter:n===ll.Paper&&(e.includes(W.ReferenceWorkEntry)||e.includes(W.Protocol))?U.Article:n===ll.Video&&e.includes(W.Video)?U.AudioVisual:n===ll.Website&&(e.includes(W.Collections)||e.includes(W.JournalIssue))?U.Webpage:n===ll.Website&&e.includes(W.Journal)?U.Journal:U.None},jl=(e,t,n)=>e===U.AudioVisual&&Dl(n)?B(Ol(t,n)):e===U.Book&&yl(n)?B(Sl(t,n)):(e===U.Chapter||e===U.Article)&&dl(n)?B(_l(t,n)):e===U.Article&&pl(n)?B(_l(t,n.mainEntity)):e===U.Journal&&wl(n)?B(Tl(n)):z(),Ml=({url:e,document:t})=>{let n=Al(e,t);if(n===U.Webpage)return B(kl(t));let r=$s(t);if(!r)return z();let i=ec(r);return i?jl(n,t,i):z()},G=function(e){return e.PrintIsbn=`Print ISBN`,e.OnlineIsbn=`Online ISBN`,e.Doi=`DOI`,e.FirstPublished=`First published`,e.OnlineIssn=`Online ISSN`,e.PrintIssn=`Print ISSN`,e}(G||{}),Nl=new Set([G.PrintIsbn,G.OnlineIsbn,G.Doi,G.FirstPublished,G.OnlineIssn,G.PrintIssn]),Pl=j({content:j({item:j({title:O(),"published-date":O()}),group:j({volume:O(),issue:O()}),series:j({title:O(),type:O(),eissn:O()})}).optional()}),Fl=(e,t)=>{if(!e)return;let n=e.indexOf(t);return n>-1?e.substring(0,n):e},Il=e=>{let t=/\d+/.exec(e);if(t?.[0])return t[0]},Ll=e=>{let t=e.querySelectorAll(`script`),n=Array.from(t).find(e=>e.textContent.includes(`adobeDataLayerJson`))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(n?.length===2)try{let e=JSON.parse(n[1]);return Pl.parse(e)}catch{return}},Rl=(e,t)=>{let n=V(e,`property`,`og:type`),r=t.includes(`epdf`);return n===`Book`||n===`books.book`?U.Book:n===`Chapter`?U.Chapter:n===`Journal`?U.Journal:n===`Article`||r?U.Article:U.None},zl=e=>{let t=H(e,`name`,`citation_author`),n=Array.from(e.querySelectorAll(`#product-details-content .product-authors`)).map(e=>e.textContent).filter(e=>!!e),r=new Set([...t,...n]);return r.size>0?[...r]:void 0},Bl=e=>{let t=Array.from(e.querySelectorAll(`#product-details-content .text-piped p`)).map(e=>e.textContent).find(e=>e.endsWith(` pages`));if(t)return Il(t)},Vl=e=>{let t=new Map,n=Array.from(e.querySelectorAll(`.journal-info-container .info-block`)).flatMap(e=>Array.from(e.querySelectorAll(`.info_label`)));for(let e of n){let n=e.nextElementSibling;if(!n?.classList.contains(`info_value`))continue;let r=Fl(e.textContent,`:`),i=Fl(n.textContent,`:`);!r||!i||Nl.has(r)&&t.set(r,i)}return t},Hl=(e,t)=>V(e,`property`,`books:release_date`)??V(e,`name`,`citation_online_date`)??t.get(G.FirstPublished)??void 0,Ul=(e,t)=>V(e,`name`,`dc.identifier`)??V(e,`name`,`citation_doi`)??V(e,`name`,`publication_doi`)??t.get(G.Doi)??void 0,Wl=(e,t)=>{let n=new Set([V(e,`property`,`books:isbn`),t.get(G.PrintIsbn),t.get(G.OnlineIsbn)].filter(e=>!!e));return n.size>0?[...n].join(`,`):void 0},Gl=e=>{let t,n,r=e.querySelector(`.cover-image__details div:first-of-type`);if(r?.childNodes.length===2){let[e,i]=r.childNodes;e.textContent&&(t=Il(e.textContent)),i.textContent&&(n=Il(i.textContent))}return{volume:t,issue:n}},Kl=e=>{let t=Array.from(e.querySelectorAll(`.authors .author`)).map(e=>e.textContent.trim().replace(`,`,``)).filter(e=>!!e);return t.length>0?t:void 0},ql=e=>{let t=Array.from(e.querySelectorAll(`.details-section .details-entry`)),n=t.find(e=>e.querySelector(`.details-label`)?.textContent.trim()===`ISSN`),r=t.find(e=>e.querySelector(`.details-label`)?.textContent.trim()===`eISSN`),i,a;return n&&(i=n.querySelector(`.details-value`)?.textContent.trim()),r&&(a=r.querySelector(`.details-value`)?.textContent.trim()),{issn:i,eissn:a}},Jl=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};let t=e.content.group.volume,n=e.content.group.issue;return n===`0`&&t===`0`?{volume:void 0,issue:void 0}:{volume:t,issue:n}},Yl=e=>{let[t,n]=((Array.from(e.querySelectorAll(`.details-section .details-entry`)).find(e=>e.querySelector(`.details-label`)?.textContent.trim()===`Pages`)?.querySelector(`.details-value`)?.textContent.trim())?.split(`-`)??[void 0,void 0]).map(e=>e?.trim());return t?.toLowerCase()===`n/a`&&n?.toLowerCase()===`n/a`?{spage:void 0,epage:void 0}:{spage:t,epage:n}},Xl=e=>{let t=Vl(e),n=zl(e),r=V(e,`property`,`og:title`),i=Hl(e,t),a=Ul(e,t),o=Wl(e,t),s=Bl(e);return I(F.Book,{au:n,date:i,doi:a,isbn:o,pages:s,title:r})},Zl=e=>{let t=Vl(e),n=zl(e),r=V(e,`name`,`citation_book_title`),i=Hl(e,t),a=Ul(e,t),o=Wl(e,t),s=V(e,`name`,`citation_publisher`),c=V(e,`property`,`og:title`);return I(F.Bookitem,{au:n,btitle:r,date:i,doi:a,isbn:o,pub:s,title:c})},Ql=e=>{let t=Vl(e),n=zl(e),r=Hl(e,t),i=t.get(G.OnlineIssn),a=t.get(G.PrintIssn),o=V(e,`property`,`og:title`),{volume:s,issue:c}=Gl(e);return L(F.Journal,{au:n,date:r,eissn:i,issn:a,issue:c,title:o,volume:s})},$l=e=>{let t=Vl(e),n=Ll(e),r=zl(e)??Kl(e),i=Hl(e,t)??n?.content?.item[`published-date`],a=Ul(e,t),{issn:o,eissn:s}=ql(e),{volume:c,issue:l}=Jl(n),u=V(e,`property`,`og:title`)??n?.content?.item.title,d=V(e,`name`,`citation_journal_title`)??n?.content?.series.title,{spage:f,epage:p}=Yl(e);return L(F.Article,{au:r,date:i,doi:a,eissn:s,issn:o??V(e,`name`,`citation_issn`),issue:l,jtitle:d,title:u,volume:c,spage:f,epage:p})},eu=({document:e,url:t})=>{switch(Rl(e,t)){case U.Book:return B(Xl(e));case U.Chapter:return B(Zl(e));case U.Journal:return B(Ql(e));case U.Article:return B($l(e));default:return z()}},tu=e=>{let t=H(e,`name`,`citation_author`);return t.length>0?t:void 0},nu=({document:e})=>B(R({au:tu(e),date:V(e,`name`,`citation_publication_date`),doi:V(e,`name`,`citation_doi`),isbn:V(e,`name`,`citation_isbn`),pub:V(e,`name`,`citation_publisher`),title:V(e,`name`,`citation_title`)??e.title})),ru=({document:e})=>Array.from(e.querySelectorAll(`.Z3988`)).length<=1?z():es(),iu=e=>{if(!(!e||e.length===0))return e[0]};function au(e,t){return iu(t.map(t=>{let n=e.querySelector(t)?.textContent??null;if(n&&n.trim()!==``)return n}).filter(e=>e))??null}function ou(e,t){let n=t.flatMap(t=>Array.from(e.querySelectorAll(t)).flatMap(e=>{let t=e.textContent;return t&&t.trim()!==``?t.split(`;`).map(e=>e.trim()).filter(e=>e.length>0):[]}));return n.length>0?n:null}var su=(e,t)=>au(e,[t])?.trim(),cu=e=>{let t=e.querySelector(`.content-meta-data__authors`)?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(e=>!!e)},lu=e=>{let t=Array.from(e.querySelectorAll(`.tombstone-metadata [data-qa="item-authors"]`)).map(e=>e.textContent).filter(e=>!!e);return t.length?t:void 0},uu=e=>{let t=Array.from(e.querySelectorAll(`.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]`)).map(e=>e.textContent).filter(e=>!!e);return t.length?t:void 0},du=e=>{let t=Array.from(e.querySelectorAll(`.contrib-type-author .name`)).map(e=>e.textContent).filter(e=>!!e);return t.length?t:void 0},fu=e=>{let t=new Set([...uu(e)??[],...cu(e)??[],...du(e)??[],...lu(e)??[]]);return t.size?[...t]:void 0},pu=(e,t)=>e.querySelector(`[data-qa="published-date"]`)?.textContent??e.querySelector(`.summary-image`)?.textContent??_u(t?.get(`date`))??_u(t?.get(`copyright date`))??_u(t?.get(`published date`)),mu=e=>{let t=e.find(e=>e.startsWith(`https://doi.org/`));if(t)return t.replace(`https://doi.org/`,``)},hu=e=>{let t=e.get(`local identifier`);if(t?.length)return mu(t)},gu=e=>e.querySelector(`.doi`)?.getAttribute(`href`)??void 0,_u=e=>{if(e?.length)return e[0]},vu=e=>{let t=new Map;return Array.from(e.querySelectorAll(`.metadata-element, .metadata`)).map(e=>({name:e.querySelector(`.metadata-label`)?.textContent.trim().toLowerCase(),values:Array.from(e.querySelectorAll(`.metadata-value`)).map(e=>e.textContent).filter(e=>!!e)})).forEach(({name:e,values:n})=>{!e||!n.length||t.set(e,n)}),t},yu=e=>{let t=vu(e),n=e.querySelector(`.summary-journal`),r=Array.from(n?.childNodes??[]),i=r[0]?.textContent??e.querySelector(`.journal-link`)?.textContent??void 0,a=r[2]?.textContent?.replace(/Published By:\s+?/i,``)??_u(t.get(`publisher`))??e.querySelector(`.publisher-link`)?.textContent??void 0;return{pub:a&&a.trim()!==``?a:void 0,jtitle:i&&i.trim()!==``?i:void 0}},bu=e=>{let t=au(e,[`[data-qa="journal"]:first-child cite`,`[data-qa="copyright-statement"] > cite`,`[data-qa="collection-links"] mfe-content-details-pharos-link`]);return t&&t.trim()!==``?t:void 0},xu=e=>ks(e.querySelector(`[data-qa="page-count"]`)?.textContent),Su=(e,t)=>e.querySelector(`.publisher-link`)?.textContent??_u(t?.get(`publisher`)),Cu=e=>e.querySelector(`[data-qa="item-title"]`)?.textContent.trim()??e.querySelector(`mfe-turnaway-pharos-heading`)?.textContent.trim()??e.querySelector(`.metadata mfe-toc-pharos-heading`)?.textContent.trim()??e.querySelector(`.journal_header-title`)?.textContent.trim()??void 0,wu=e=>{if(!URL.canParse(e))return;let t=new URL(e);return t.origin+t.pathname},Tu=e=>{let t=e.querySelector(`.ccda-container > :first-child`),n,r;if(t?.textContent.includes(`Volume`)||t?.textContent.includes(`Issue`)){let e=t.textContent.trim().split(/,\s+/);for(let t of e)t.startsWith(`Volume`)?r=ks(t):t.startsWith(`Issue`)&&(n=ks(t))}return{issue:n,volume:r}},Eu=e=>{let t=e.querySelector(`[data-qa="item-src-info"]`)?.textContent??V(e,`property`,`og:description`)??V(e,`name`,`description`);if(!t)return{};let n=/Vol\.\s*(\d+)/.exec(t),r=n?n[1]:void 0,i=/No\.\s*(\d+)/.exec(t),a=i?i[1]:void 0,o=/pp\.\s*(\d+)-(\d+)/.exec(t),s=o?o[1]:void 0,c=o?o[2]:void 0,l=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t);return{issue:a,volume:r,spage:s,epage:c,pages:l?l[1]:void 0}},Du=e=>{let t=au(e,[`mfe-turnaway-pharos-link`,`[data-qa="item-src-info"]`]);if(!t)return;let n=/\(.+\)/.exec(t)?.map(e=>{let t=/\d{4}/.exec(e);return t?t[0]:void 0});return iu(n)},Ou=(e,t)=>{let n=Cu(e),r=fu(e),i=pu(e)??Du(e),a=yu(e),o=a.jtitle??bu(e)??void 0,s=a.pub,c=Tu(e),l=Eu(e),u=c.issue??l.issue,d=c.volume??l.volume,f=xu(e)??l.pages,p=l.spage,m=l.epage,h=wu(t),g=mu(Array.from(e.querySelector(`.content-meta-data-stables`)?.childNodes??[]).map(e=>e.textContent??``))??gu(e);return L(F.Article,{atitle:n,au:r,date:i,doi:g,epage:m,issue:u,jtitle:o,pages:f,pub:s,spage:p,uri:h,volume:d})},ku=(e,t)=>{let n=vu(e),r=fu(e),i=pu(e,n),a=Cu(e);return R({au:r,date:i,pub:Su(e,n),title:a,uri:wu(t)})},Au=(e,t)=>{let n=vu(e),r=fu(e),i=Cu(e),a=pu(e),o=xu(e),s=Su(e,n),c=wu(t),l=hu(n);return I(F.Book,{au:r,date:a,doi:l,pages:o,pub:s,title:i,uri:c})},ju=(e,t)=>{let n=vu(e),r=fu(e),i=Cu(e),a=e.querySelector(`.book-title-link`)?.textContent??void 0,o=pu(e,n),s=Array.from(e.querySelectorAll(`[data-qa="book"] > span`)).map(e=>e.textContent),c=xu(e),l=s.find(e=>e.includes(`pp.`))?.match(/(\d+)-(\d+)/)??void 0,u=Su(e,n),d=wu(t);return I(F.Bookitem,{atitle:i,au:r,btitle:a,date:o,epage:l?.[2],pub:u,pages:c,spage:l?.[1],uri:d})},Mu=(e,t)=>{let n=vu(e),r=fu(e),i=Cu(e),a=pu(e),o=xu(e),s=Su(e,n),c=wu(t),l=hu(n);return I(F.Document,{au:r,date:a,doi:l,pages:o,pub:s,title:i,uri:c})},Nu=(e,t)=>{let n=vu(e);return go({au:fu(e),date:pu(e,n),title:Cu(e),uri:wu(t)})},Pu=(e,t)=>{let{pub:n}=yu(e),r=Cu(e),i=e.querySelector(`.eissn`)?.textContent.replace(/EISSN\s+/,``).trim()??void 0,a=e.querySelector(`.issn`)?.textContent.replace(/ISSN\s+/,``).trim()??void 0,o=wu(t);return L(F.Journal,{eissn:i,issn:a,jtitle:r,pub:n,uri:o})},K=function(e){return e.Article=`journal article`,e.Audio=`audio`,e.Book=`book`,e.Chapter=`book chapter`,e.Document=`document`,e.Image=`image`,e.Journal=`journal`,e.ResearchReport=`research report`,e.Serial=`serial`,e.Video=`video`,e}({}),Fu=(e,t)=>{let n=vu(e),r=fu(e),i=pu(e,n),a=Cu(e);return R({au:r,date:i,pub:Su(e,n),title:a,uri:wu(t)})},Iu=e=>Object.values(K).includes(e),Lu=e=>{if(e.querySelector(`.journal_header-title`))return K.Journal;if(e.querySelector(`.journal-link`))return K.Article;let t=e.querySelector(`.content-type > span`)?.textContent.toLowerCase().trim()??e.querySelector(`.content-meta-data-label`)?.textContent.toLowerCase().trim();return Iu(t)?t:null},Ru=(e,t)=>{switch(Lu(e)){case K.Article:case K.Serial:return Ou(e,t);case K.Audio:return ku(e,t);case K.Book:return Au(e,t);case K.Chapter:case K.ResearchReport:return ju(e,t);case K.Document:return Mu(e,t);case K.Image:return Nu(e,t);case K.Journal:return Pu(e,t);case K.Video:return Fu(e,t);default:return null}},zu=({document:e,url:t})=>{let n=Ru(e,t);return n?B(n):z()},Bu=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,Vu=/(E?ISBN|E?ISSN|DOI)\s*:\s*/gi,Hu=e=>{if(!e)return;let t=Bu.exec(e);if(t)return t.length>1?t[1]:void 0},Uu=e=>{let t={};return e.forEach(e=>{let n=[],r;for(Vu.lastIndex=0;(r=Vu.exec(e))!==null;)n.push({id:r[1].toLowerCase(),index:r.index,start:Vu.lastIndex});n.forEach(({id:r,start:i},a)=>{t[r]??=[],t[r].push(e.substring(i,n[a+1]?.index).trim())})}),t},Wu=e=>[...e.isbn??[],...e.eisbn??[]].map(e=>zs(e)).filter(e=>!!e),Gu=e=>{if(e){if(typeof e==`string`)return e;if(e.length>0)return e[0]}},Ku=e=>{if(e)return typeof e==`string`?e:Array.isArray(e)?e.length===0?void 0:Gu(e[0].name):Gu(e.name)},qu=(...e)=>{let t=new Set(e.filter(e=>!!e));if(t.size!==0)return[...t]},Ju=e=>{let t=Uu(e.identifierValues),[n]=e.isPartOf?.split(`,`)??[],r=Hu(e.publicationDate??e.creationDate),i=Wu(t);return{authors:e.authors,date:r,dois:t.doi,edition:e.edition,eissns:t.eissn,isbns:i,issns:t.issn,jtitle:n,lcn:e.lcn,publisher:e.publisher,title:e.title}},Yu=({lcn:e,title:t})=>({bibid:e,title:t}),Xu=e=>{let t=e.mainEntity.creator;if(t)return typeof t==`string`?[t]:Array.isArray(t)?t.map(e=>Gu(e.name)).filter(e=>!!e):[Gu(t.name)].filter(e=>!!e)},Zu=e=>{let t=e.mainEntity.issn;return t?typeof t==`string`?[t]:t:[]},Qu=e=>{let t=e.mainEntity.datePublished;if(t)return t.replace(/-$/,``)||void 0},$u=e=>e.replace(/[.,;]+$/,``).trim(),ed=(e,t)=>{let n=$u(e),r=$u(t);return n.startsWith(r)||r.startsWith(n)},td=e=>{let t=[];for(let n of e)n&&(t.some(e=>ed(e,n))||t.push(n));return t.length>0?t:void 0},nd=(e,t)=>{let n=td([...(e&&Xu(e))??[],...t.authors??[]]),r=qu(...t.eissns??[]),i=qu(e?.mainEntity.isbn?zs(e.mainEntity.isbn):void 0,...t.isbns??[]),a=qu(...e?Zu(e):[],...t.issns??[]),[o,s]=e?.mainEntity.pagination?.split(`-`)??[];return{authors:n,btitle:e?.mainEntity.isPartOf?.name??t.jtitle,date:t.date??(e?Qu(e):void 0),doi:Gu(t.dois),edition:e?.mainEntity.edition??t.edition,eissn:Gu(r),epage:s,isbn:i?.join(`,`),issn:Gu(a),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,lcn:t.lcn??e?.identifier.value,publisher:t.publisher??Ku(e?.mainEntity.publisher),spage:o,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},rd=j({"@type":N(`Organization`),name:M([O(),A(O())])}),id=j({"@type":N(`Person`),name:M([O(),A(O())])}),ad=j({"@type":M([O(),A(O())]),"@id":O().optional(),issn:O().optional(),name:O().optional(),volume:O().optional()}),od=Ys.extend({identifier:j({"@type":O(),propertyID:O(),value:O()}),mainEntity:j({"@type":O(),"@id":O(),bookFormat:P(O()),creator:P(M([O(),id,A(id)])),datePublished:P(O()),description:P(M([O(),A(O())])),edition:P(O()),inLanguage:P(O()),isbn:P(O()),issn:P(M([O(),A(O())])),isPartOf:P(ad),issueNumber:P(O()),pagination:P(O()),publisher:P(M([O(),rd,A(rd)])),volumeNumber:P(O())}),name:O()}),sd=e=>{let t=$s(e);if(!t)return null;let n=ec(t),r=od.safeParse(n);return r.success?r.data:null},cd=e=>L(F.Article,{...Yu(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),ld=e=>I(F.Book,{...Yu(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),ud=e=>I(F.Bookitem,{bibid:e.lcn,atitle:e.title,btitle:e.btitle,au:e.authors,date:e.date,doi:e.doi,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),dd=e=>I(F.Conference,{...Yu(e),au:e.authors,date:e.date,doi:e.doi,isbn:e.isbn,pub:e.publisher}),fd=e=>_o({...Yu(e),au:e.authors,date:e.date,pub:e.publisher}),pd=e=>L(F.Journal,{...Yu(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),md=e=>R({...Yu(e),au:e.authors,date:e.date,pub:e.publisher}),hd=e=>R({...Yu(e),au:e.authors,date:e.date,pub:e.publisher}),q=function(e){return e.Article=`Article`,e.Audio=`Audio`,e.Book=`Book`,e.BookChapter=`BookChapter`,e.Conference=`Conference`,e.Dissertation=`Dissertation`,e.Journal=`Journal`,e.Video=`Video`,e}({}),gd=(e,t)=>({document:n})=>{let r=sd(n),i=nd(r,e(n));switch(t(n,r)){case q.Article:return B(cd(i));case q.Book:return B(ld(i));case q.BookChapter:return B(ud(i));case q.Conference:return B(dd(i));case q.Dissertation:return B(fd(i));case q.Journal:return B(pd(i));case q.Audio:return B(hd(i));case q.Video:return B(md(i));default:return z()}},_d=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,vd=e=>Array.from(e.querySelectorAll(_d(`Identifier`))).map(e=>e.textContent).filter(e=>!!e),yd=e=>Array.from(e.querySelectorAll(_d(`Author`))).filter(e=>!!e.textContent&&e.parentElement!==null&&e.parentElement.getAttribute(`aria-hidden`)!==`true`).map(e=>e.textContent.trim()),bd=(e,t)=>e.querySelector(_d(t))?.textContent.trim(),xd=e=>Ju({authors:yd(e),title:bd(e,`Title`),publisher:bd(e,`Publisher`),creationDate:bd(e,`Creation Date`),publicationDate:bd(e,`Publication Date`),edition:bd(e,`Edition`),isPartOf:bd(e,`Is Part Of`),identifierValues:vd(e),lcn:bd(e,`MMS ID`)??bd(e,`Record ID`)}),Sd={Article:q.Article,Book:q.Book,"Book Chapter":q.BookChapter,Chapter:q.BookChapter,Periodical:q.Journal,Journal:q.Journal,"Audio CD":q.Audio,CreativeWork:q.Audio,Movie:q.Video,Video:q.Video},Cd=gd(xd,(e,t)=>{let n=t?.mainEntity[`@type`]??e.querySelector(`.media-content-type`)?.textContent??void 0;return n?Sd[n]:void 0}),wd=e=>{let t=e.querySelectorAll(`[id="Info"] > p`),n=Array.from(t).find(e=>e.textContent.includes(`Document Type`))?.textContent,r=V(e,`name`,`DC.identifier`);if(r?.startsWith(`info:doi/`)||n?.includes(`Article`))return U.Article;if(r?.startsWith(`urn:issn:`))return U.Journal},Td=e=>{let[t,n,r,i]=V(e,`name`,`DCTERMS.bibliographicCitation`)?.split(`,`)??[];return{journalTitle:t,volume:n,issue:r,pages:i}},Ed=e=>{let t=V(e,`name`,`DC.identifier`);return(t?t.split(`info:doi/`):null)?.[1]??void 0},Dd=e=>e.evaluate(`//*[@id="altLayoutPublisherLogo"]/p/a[1]`,e,null,XPathResult.STRING_TYPE,null).stringValue,Od=e=>{let[t,n]=e?e.trim().split(`-`):[void 0,void 0];return{spage:t,epage:n?.replace(/\(\d+\)/,``).trim()}},kd=e=>{let t=V(e,`name`,`DCTERMS.issued`);if(!t)return;let n=/\d{4}/.exec(t);return n?n[0]:void 0},Ad=e=>{let t=V(e,`name`,`DC.title`),n=V(e,`name`,`DC.publisher`),r=kd(e),i=Td(e),a=i.journalTitle?.trim(),o=i.volume?.trim(),s=i.issue?.trim(),c=i.pages?Od(i.pages):void 0,l=c?.spage,u=c?.epage,d=H(e,`name`,`DC.creator`),f=Ed(e);return L(F.Article,{au:d,jtitle:a,date:r,doi:f,issue:s,pub:n,spage:l,epage:u,atitle:t,volume:o})},jd=e=>{let t=V(e,`name`,`DC.title`),n=V(e,`name`,`DC.publisher`),r=Dd(e);return L(F.Journal,{issn:r,title:t,pub:n})},Md=({document:e})=>{switch(wd(e)){case U.Article:return B(Ad(e));case U.Journal:return B(jd(e));default:return z()}},Nd=/^\d{4}-\d{3}[\dX]$/i,Pd=e=>Nd.test(e),Fd=e=>{let t=e.filter(Pd);return t.length?t:void 0},Id=e=>{let t=H(e,`name`,`citation_author`);return t.length?t:void 0},Ld=e=>V(e,`name`,`citation_publication_date`)?.match(/^\d{4}/)?.[0],Rd=e=>V(e,`name`,`citation_doi`),zd=e=>{let t=H(e,`name`,`citation_isbn`);return t.length?t.join(`,`):void 0},Bd=e=>Fd(H(e,`name`,`citation_issn`)),Vd=e=>V(e,`name`,`citation_journal_title`),Hd=e=>V(e,`name`,`citation_publisher`),Ud=e=>V(e,`name`,`citation_title`),Wd=e=>V(e,`name`,`citation_doi`),Gd=e=>V(e,`name`,`citation_firstpage`),Kd=e=>V(e,`name`,`citation_lastpage`),qd=e=>V(e,`name`,`citation_issue`),Jd=e=>V(e,`name`,`citation_volume`),Yd=e=>L(F.Article,{atitle:Ud(e),au:Id(e),date:Ld(e),doi:Rd(e),issn:Bd(e)?.[0],issue:qd(e),jtitle:Vd(e),pub:Hd(e),volume:Jd(e),spage:Gd(e),epage:Kd(e)}),Xd=e=>I(F.Bookitem,{atitle:Ud(e),au:Id(e),btitle:Vd(e),date:Ld(e),isbn:zd(e),pub:Hd(e),spage:Gd(e),epage:Kd(e)}),Zd=e=>_o({title:Ud(e),au:Id(e),date:Ld(e),pub:Hd(e),spage:Gd(e),epage:Kd(e)}),Qd=e=>!!e.isbn,$d=e=>!!e.issn||e.type===`Article`&&!!e.journalTitle||!Qd(e)&&!!e.journalTitle,ef=e=>!!e.title,tf=e=>{let t={type:Wd(e),isbn:zd(e),issn:Bd(e),journalTitle:Vd(e),title:Ud(e)};return Qd(t)?Xd(e):$d(t)?Yd(e):ef(t)?Zd(e):null},nf=({url:e,document:t})=>{let n=tf(t);return n?B({...n,uri:e}):z()},rf=j({"@content":O(),datePublished:O().optional(),mainEntity:j({type:O().optional(),name:O().optional(),author:A(j({name:O()})).optional(),publisher:j({type:O(),name:O()}).optional(),isbn:O().optional()})}),af=e=>rf.safeParse(e).success,of=e=>{let t=e.textContent;if(!t)return null;try{let e=JSON.parse(t);if(af(e))return e}catch{return null}return null},sf=({document:e})=>{let t=$s(e);if(!t)return z();let n=of(t);if(!n)return z();let r=n.mainEntity.type,i=n.mainEntity.author?.map(e=>e.name),a=n.datePublished?.substring(0,4),o=n.mainEntity.name,s=n.mainEntity.isbn,c=n.mainEntity.publisher?.name;switch(r){case`Book`:return B(I(F.Book,{au:i,date:a,title:o,isbn:s,pub:c}));default:return z()}},cf=Ys.extend({"@type":O().optional(),name:O().optional(),copyrightYear:ga().optional(),author:A(j({name:O()})).optional(),publisher:A(j({name:O()})).optional()}),lf=e=>cf.safeParse(e).success,uf=({document:e,url:t})=>{let n=$s(e);if(!n)return z();let r=ec(n);if(!r||!lf(r))return z();let i=r[`@type`],a=r.author?.map(e=>e.name),o=r.copyrightYear?.toString()??V(e,`property`,`og:book:release_date`),s=r.name,c=iu(r.publisher?.map(e=>e.name)),l=V(e,`property`,`og:book:isbn`);switch(i){case`Book`:return B(I(F.Book,{au:a,date:o,title:s,isbn:l,pub:c,uri:t}));default:return z()}},df=e=>{let t=Array.from(e.querySelectorAll(`a[rel=author]`)).map(e=>e.textContent.trim()).filter(Boolean);return t.length?t:void 0},ff=e=>{let t=Array.from(e.querySelectorAll(`strong`)).filter(e=>e.textContent.startsWith(`ISBN`)).map(e=>e.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,`,`)},pf=({url:e,document:t})=>{let n=t.querySelector(`h3.page-title`)?.textContent.trim()??void 0,r=df(t),i=V(t,`property`,`article:published_time`),a=ff(t);return B(I(F.Book,{au:r,date:i?.substring(0,4),isbn:a,pub:`Milne Open Textbooks`,title:n,uri:e}))},mf=({document:e,url:t})=>{switch(gf(t)){case U.Chapter:return B(xf(e));case U.Book:return B(Sf(e));case U.Article:return B(_f(e));case U.Journal:return B(vf(e));default:return z()}},hf=function(e){return e.Print=`Print`,e.Online=`Online`,e}(hf||{}),gf=e=>{let{pathname:t}=new URL(e);return t.includes(`/books/abs/`)?U.Chapter:t.includes(`/books/`)?U.Book:/\/journals\/.+\/article\//.exec(t)==null?t.includes(`/journals/`)?U.Journal:U.None:U.Article},_f=e=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_journal_title`),r=V(e,`name`,`citation_doi`),i=V(e,`name`,`citation_volume`),a=V(e,`name`,`citation_issue`),o=V(e,`name`,`citation_firstpage`),s=V(e,`name`,`citation_lastpage`),c=V(e,`name`,`citation_publication_date`)?.substring(0,4),l=V(e,`name`,`citation_publisher`),u=Cf(e),d=Fd(H(e,`name`,`citation_issn`));return L(F.Article,{atitle:t,au:u,jtitle:n,doi:r,volume:i,issue:a,issn:d?.[0],spage:o,epage:s,date:c,pub:l})},vf=e=>{let t=yf(e),n=bf(e),r=n.find(e=>e.type===hf.Print),i=n.find(e=>e.type===hf.Online),a=r?r.value:void 0,o=i?i.value:void 0;return L(F.Journal,{title:t,issn:a,eissn:o})},yf=e=>e.querySelector(`h1.title`)?.textContent.trim()??void 0,bf=e=>{let t=Array.from(e.querySelectorAll(`span.bold`)).find(e=>e.textContent.trim()===`ISSN:`),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,r=[];return t&&(t.parentElement?.querySelectorAll(`span.value`))?.forEach(e=>{let t=e.textContent.trim(),i=n.exec(t);i&&r.push({value:i[1],type:i[2]})}),r},xf=e=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_inbook_title`),r=V(e,`name`,`citation_doi`),i=V(e,`name`,`citation_publication_date`)?.substring(0,4),a=V(e,`name`,`citation_publisher`);return I(F.Bookitem,{atitle:t,btitle:n,doi:r,date:i,pub:a})},Sf=e=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_doi`),r=V(e,`name`,`citation_isbn`),i=V(e,`name`,`citation_publication_date`)?.substring(0,4),a=V(e,`name`,`citation_publisher`),o=Cf(e);return I(F.Book,{title:t,au:o,doi:n,isbn:r,date:i,pub:a})},Cf=e=>{let t=H(e,`name`,`citation_author`);return t.length?t:void 0},wf=function(e){return e.Journal=`Journal`,e.Article=`Article`,e}(wf||{}),Tf=e=>{switch(V(e,`property`,`og:type`)){case`Article`:return wf.Article;case`Journal`:return wf.Journal;default:return}};function Ef(e){let t=V(e,`property`,`og:title`),n=V(e,`name`,`dc.Publisher`),r=V(e,`name`,`publication_doi`);return B(L(F.Journal,{jtitle:t,pub:n,doi:r}))}function Df(e){let t=V(e,`name`,`dc.Title`),n=H(e,`name`,`dc.Creator`),r=V(e,`name`,`dc.Date`)?.substring(0,4),i=V(e,`name`,`publication_doi`),a=V(e,`name`,`citation_journal_title`),o=V(e,`name`,`dc.Publisher`);return B(L(F.Article,{atitle:t,au:n,date:r,doi:i,jtitle:a,pub:o}))}var Of=({document:e})=>{switch(Tf(e)){case wf.Journal:return Ef(e);case wf.Article:return Df(e);default:return z()}},kf=e=>{if(!e)return;let[t,n]=e.trim().split(`-`);return{spage:t,epage:n}},Af=e=>{let{pathname:t}=new URL(e);if(t.includes(`/article/`))return U.Article},jf=e=>{let t=V(e,`name`,`DC.Source`),n=V(e,`name`,`DC.Title`),r=H(e,`name`,`DC.Creator.PersonalName`),i=V(e,`name`,`DC.Source.ISSN`),a=V(e,`name`,`citation_date`)?.substring(0,4),o=V(e,`name`,`DC.Source.Volume`),s=V(e,`name`,`DC.Source.Issue`),c=V(e,`name`,`DC.Identifier.URI`),l=V(e,`name`,`DC.Identifier.pageNumber`),u=l?kf(l):void 0,d=u?.spage,f=u?.epage;return L(F.Article,{jtitle:t,atitle:n,au:r,issn:i,date:a,spage:d,epage:f,volume:o,issue:s,uri:c})},Mf=({document:e,url:t})=>{switch(Af(t)){case U.Article:return B(jf(e));default:return z()}},Nf=function(e){return e.Book=`Book`,e.Chapter=`Chapter`,e}(Nf||{}),Pf=e=>{switch(Ff(e)){case`eBook`:return Nf.Book;case`Reference`:return Nf.Chapter;default:return}},Ff=e=>e.querySelector(`#vol-contentType a`)?.textContent??void 0;function If(e,t){let n=Rf(e),r=Vf(e),i=Uf(e),a=Wf(e),o=Gf(e),s=Kf(e),c=Vf(e),l=t,{startPage:u,endPage:d}=qf(e)??{};return B(I(F.Book,{au:n,btitle:r,date:i,doi:a,epage:d,isbn:o,pub:s,spage:u,title:c,uri:l}))}function Lf(e,t){let n=Rf(e),r=Hf(e),i=Vf(e),a=Uf(e),o=Wf(e),s=Gf(e),c=Kf(e),l=Hf(e),u=t,{startPage:d,endPage:f}=qf(e)??{};return B(I(F.Book,{au:n,atitle:r,btitle:i,date:a,doi:o,epage:f,isbn:s,pub:c,spage:d,title:l,uri:u}))}var Rf=e=>{let t=e.querySelectorAll(`div#article_author p.author-bio b`),n=Array.from(t).map(e=>e.textContent).filter(e=>!!e).map(e=>e.trim());return n.length>0?n:void 0},zf=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute(`value`)??void 0,Bf=e=>V(e,`property`,`og:title`),Vf=e=>zf(e,`titlevalue`)??Bf(e),Hf=e=>zf(e,`chapter-title-squid`),Uf=e=>zf(e,`pubdate-squid`),Wf=e=>zf(e,`doi-squid`),Gf=e=>zf(e,`isbn-squid`),Kf=e=>zf(e,`pubname-squid`),qf=e=>{let t=e.querySelector(`#pageRange`)?.textContent??void 0;if(!t)return;let n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},Jf=({document:e,url:t})=>{switch(Pf(e)){case Nf.Book:return If(e,t);case Nf.Chapter:return Lf(e,t);default:return z()}},Yf=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),Xf=e=>{switch(Yf(e,`Medium`)){case`book`:case`e-book`:return F.Book;case`e-journal`:return F.Journal;default:return F.Unknown}},Zf=e=>{delete e.rft_id},Qf=e=>{let t=rs(e);if(Yc(t)){let n=Xf(e.document);t.resource.genre=n,Zf(t.resource)}return t},$f=e=>{let t=V(e,`name`,`type`)?.toLowerCase(),n=V(e,`name`,`og:type`)?.toLowerCase(),r=V(e,`name`,`citation_article_type`)?.toLowerCase();if(t===`article`||r===`article`||n===`article`)return U.Article;let i=V(e,`name`,`twitter:title`)?.trim(),a=V(e,`name`,`description`)?.trim();if(i||a)return U.Webpage},ep=e=>{let t=V(e,`name`,`DC.Title`),n=V(e,`name`,`DC.Publisher`),r=V(e,`name`,`DC.Date`),i=V(e,`name`,`DC.Identifier`),a=V(e,`name`,`citation_journal_title`),o=V(e,`name`,`citation_volume`),s=V(e,`name`,`citation_issn`),c=H(e,`name`,`citation_author`);return L(F.Article,{au:c,jtitle:a,date:r,doi:i,issn:s,pub:n,title:t,volume:o})},tp=(e,t)=>vo({uri:e,title:V(t,`name`,`twitter:title`)}),np=({url:e,document:t})=>{switch($f(t)){case U.Article:return B(ep(t));case U.Webpage:return B(tp(e,t))}return z()},rp=({document:e})=>Array.from(e.querySelectorAll(`.availability.documentSummaryAvailability.availabilityContent`)).length===0?z():ts(),ip=/([0-9]{4})\s+at/;function ap(e){if(!e)return;let t=ip.exec(e);if(t&&t.length>1)return t[1]}function op(e,t){let n=e.getElementsByClassName(t);if(n.length!==0)return n[0].textContent}function sp(e){return Array.from(e.getElementsByTagName(`li`)).reduce((e,t)=>{let n=op(t,`title`),r=op(t,`content`);return n&&r&&(e[n]=r),e},{})}function cp(e){let t=e.getElementsByClassName(`information`);if(t.length===0)return{};let n=sp(t[0]);return{date:ap(n.Published),series:n.Show}}var lp=({url:e,document:t})=>{if(!new URL(e).searchParams.has(`i`))return z();let n=F.AudioDocument;return B({genre:n,pub:V(t,`property`,`og:site_name`),title:V(t,`property`,`og:title`),uri:e,...cp(t)})},up=e=>{let t=V(e,`name`,`citation_date`);if(t)return t.split(`/`).find(e=>/^\d{4}/.test(e))??void 0},dp=e=>{let t=e.querySelector(`#arxiv-doi-link`)?.textContent;if(t)return t.replace(`https://doi.org/`,``).trim()},fp=({document:e})=>{let t=V(e,`name`,`citation_title`),n=V(e,`name`,`citation_pdf_url`),r=H(e,`name`,`citation_author`),i=up(e),a=dp(e);return!t&&r.length===0&&!i&&!a?z():B(L(F.Article,{au:r,date:i,doi:a,title:t,uri:n}))},pp=e=>{let t=su(e,`div.director-section div.term-info-section-items`);if(!t)return;let n=t.split(`,`).map(e=>e.replace(/\s+/g,` `).trim()).filter(e=>e.length>0);return n.length>0?n:void 0},mp=e=>{let t=new Map;return Array.from(e.querySelectorAll(`.info-section-container`)).forEach(e=>{let n=e.querySelector(`.info-section-header .info-section-title`)?.textContent.trim().toLowerCase();if(!n)return;let r=Array.from(e.querySelectorAll(`.term-info-section-item`)).map(e=>e.textContent.replace(`,`,``).trim()).filter(e=>!!e);r.length&&t.set(n,r)}),t},hp=({url:e,document:t})=>{let n=mp(t);return B(R({au:pp(t)??n.get(`director`),date:su(t,`div.product-release-year`),pub:su(t,`div.studio-section div.term-info-section-item`)??_u(n.get(`supplier`)),title:su(t,`.product-title`)??su(t,`.movie-title`),uri:e}))},gp=e=>{if(V(e,`property`,`og:type`)===`article`)return U.Article};function _p(e){let t={},n=e.querySelector(`[data-id=layout-form]`);return n&&Array.from(n.getElementsByTagName(`h2`)).forEach(e=>{let n=e.textContent.toLowerCase(),r=Array.from(e.parentElement?.getElementsByTagName(`span`)??[]).map(e=>e.textContent||``);n&&(t[n]=r[0])}),t}function vp(e,t,n){return n.includes(`publisher`)?t.publisher:n.includes(`place of publication, exhibition, or creation`)?t[`place of publication, exhibition, or creation`]:V(e,`name`,`DC.publisher`)}function yp(e){let t=V(e,`name`,`citation_publication_date`);return t?t.substring(0,4):V(e,`name`,`citation_online_date`)?.substring(0,4)}var bp=e=>{let t=_p(e),n=V(e,`name`,`DataCite.title`),r=H(e,`name`,`DataCite.contributor`),i=yp(e),a=V(e,`name`,`DC.identifier.DOI`),o=Object.keys(t),s=vp(e,t,o),c=o.includes(`journal`)?t.journal:void 0,l=o.includes(`volume`)?t.volume:void 0,u=o.includes(`issue`)?t.issue:void 0,d=o.includes(`issn`)?t.issn:void 0,f=o.includes(`electronic location (url)`)?t[`electronic location (url)`]:void 0;return L(F.Article,{jtitle:c,atitle:n,pub:s,au:r,date:i,doi:a,volume:l,issue:u,issn:d,uri:f})},xp=({document:e})=>{switch(gp(e)){case U.Article:return B(bp(e));default:return z()}},J=function(e){return e.ISSN=`issn (print)`,e.EISSN=`issn (electronic)`,e.ISBN=`isbn (print)`,e.VOLUME=`volume`,e.ISSUE=`issue`,e.PUBLISHER=`publisher`,e.DATE_OF_PUBLICATION=`date of publication`,e.RESOURCE_TYPE=`resource type`,e.JOURNAL_TITLE=`journal`,e.BOOK_TITLE=`book title`,e.PAGE_RANGE=`page range`,e}(J||{}),Sp=e=>{let t=Y(e,J.RESOURCE_TYPE);return t?t===`Other Journal Article`||t===`Journal Article`||t===`Journal Item`||t===`Book Review`?U.Article:t===`Book Chapter`||t===`Book Part`||t===`Conference Abstract`||t===`Book ChapterConference Paper`||t===`Conference Paper`||t===`Other Book Part`?U.Document:U.None:U.None},Cp=e=>e.replace(`:`,``).replace(` | `,``).trim().toLowerCase(),wp=e=>{let t=new Map,n=e.querySelector(`ul.rlist.publication-details__list`);return n&&Array.from(n.querySelectorAll(`li`)).forEach(e=>{let n=Array.from(e.querySelectorAll(`span.label`)),r=Array.from(e.querySelectorAll(`span.info`));n.forEach((e,n)=>{let i=Cp(e.textContent),a=r[n]?.textContent?.trim();i&&a&&(t.has(i)||t.set(i,[]),t.get(i)?.push(a))})}),t},Y=(e,t)=>{let n=e.get(t);if(n)return iu(n)},Tp=e=>H(e,`name`,`dc.Creator`).map(e=>e.trim()),Ep=e=>{let t=ou(e,[`.loa-accordion a.author-name`]);if(t)return t.map(e=>e.replace(`Authors:`,``).trim())},Dp=e=>{let t=Tp(e);return t.length>0?t:Ep(e)},Op=e=>V(e,`name`,`dc.Title`)??V(e,`property`,`og:title`),kp=e=>V(e,`name`,`publication_doi`),Ap=(e,t)=>Y(t,J.DATE_OF_PUBLICATION)??V(e,`name`,`dc.Date`),jp=e=>{let t=Y(e,J.PAGE_RANGE),n,r;return t?.includes(`-`)&&(n=t?t.split(`-`)[0].trim():void 0,r=t?t.split(`-`)[1].trim():void 0),{pages:t,spage:n,epage:r}},Mp=(e,t,n)=>{let r=Op(e),i=Y(t,J.JOURNAL_TITLE),a=V(e,`name`,`citation_journal_title`),o=i??a,s=kp(e),c=Ap(e,t),l=Y(t,J.PUBLISHER),u=Dp(e),d=Y(t,J.VOLUME),f=Y(t,J.ISSUE),p=jp(t),m=Y(t,J.ISSN),h=Y(t,J.EISSN);return L(F.Article,{title:r,jtitle:o,doi:s,date:c,pub:l,au:u,volume:d,issue:f,pages:p.pages,spage:p.spage,epage:p.epage,issn:m,eissn:h,uri:n})},Np=(e,t,n)=>{let r=Op(e),i=Y(t,J.BOOK_TITLE),a=kp(e),o=Ap(e,t),s=Y(t,J.PUBLISHER),c=Dp(e),l=jp(t),u=Y(t,J.ISBN);return I(F.Conference,{title:r,btitle:i,doi:a,date:o,pub:s,au:c,pages:l.pages,spage:l.spage,epage:l.epage,isbn:u,uri:n})},Pp=(e,t,n)=>{let r=Op(e),i=kp(e),a=Ap(e,t),o=Y(t,J.PUBLISHER),s=Dp(e),c=Y(t,J.ISBN);return I(F.Document,{title:r,doi:i,date:a,pub:o,au:s,uri:n,isbn:c})},Fp=({url:e,document:t})=>{let n=wp(t);switch(Sp(n)){case U.Article:return B(Mp(t,n,e));case U.Document:return B(Np(t,n,e));case U.None:return B(Pp(t,n,e));default:return z()}},Ip=e=>V(e,`property`,`og:title`)?.trim()??void 0,Lp=e=>V(e,`name`,`dc.identifier`)??V(e,`name`,`citation_doi`),Rp=e=>{let t=Ip(e),n=t,r=Wp(e),i=Up(e),a=Vp(e),o=Hp(e),{issn:s,eissn:c}=Bp(e);return B(L(F.Journal,{date:r,eissn:c,issn:s,issue:i,jtitle:n,pub:a,title:t,volume:o}))},zp=e=>e.includes(`/journals/`)&&e.includes(`issue`),Bp=e=>({issn:e.querySelector(`dd.printissn.text-metadata-value > span`)?.textContent.trim(),eissn:e.querySelector(`dd.onlineissn.text-metadata-value > span`)?.textContent.trim()}),Vp=e=>e.querySelector(`dd.publisher.text-metadata-value span`)?.textContent.trim()??void 0,Hp=e=>Ip(e)?.match(/Volume\s+(\d+)/i)?.[1],Up=e=>Ip(e)?.match(/Issue\s+(\d+)/i)?.[1],Wp=e=>Ip(e)?.match(/\((\d{4})\)/)?.[1],Gp=e=>{let t=Ip(e),n=V(e,`name`,`citation_title`)??t,r=H(e,`property`,`article:author`),i=Kp(e),a=Lp(e),o=V(e,`name`,`citation_lastpage`),s=V(e,`name`,`citation_issn`),c=V(e,`name`,`citation_issue`),l=V(e,`name`,`citation_journal_title`),u=V(e,`name`,`citation_publisher`),d=V(e,`name`,`citation_firstpage`),f=V(e,`name`,`citation_volume`);return B(L(F.Article,{atitle:n,au:r,date:i,doi:a,epage:o,issn:s,issue:c,jtitle:l,pub:u,spage:d,title:t,volume:f}))},Kp=e=>V(e,`property`,`article:published_time`)??V(e,`name`,`citation_publication_date`),qp=e=>{let t=Ip(e),n=V(e,`name`,`citation_title`)??t,r=Jp(e),i=Xp(e),a=Lp(e),o=Zp(e),s=V(e,`name`,`citation_publisher`);return B(I(F.Book,{au:r,btitle:n,date:i,doi:a,isbn:o,pub:s,title:t}))},Jp=e=>{let t=H(e,`property`,`book:author`);if(t.length>0)return t;let n=H(e,`name`,`citation_author`);return n.length>0?n:Yp(e)},Yp=e=>Array.from(e.querySelectorAll(`.contributor-details span[data-testid="author-name"]`)).map(e=>(e.textContent||``).trim()).filter(e=>e.length>0),Xp=e=>V(e,`property`,`book:release_date`)??V(e,`name`,`citation_publication_date`),Zp=e=>V(e,`property`,`book:isbn`)??V(e,`name`,`citation_isbn`),Qp=(e,t)=>{switch(V(e,`property`,`og:type`)){case`article`:return U.Article;case`book`:return U.Book;default:break}return zp(t)?U.Journal:U.None},$p=({document:e,url:t})=>{switch(Qp(e,t)){case U.Article:return Gp(e);case U.Journal:return Rp(e);case U.Book:return qp(e);default:return z()}},em=e=>{let t=e.getAttribute(`title`);return t?Oo(t):null},tm=({url:e,document:t})=>{let n=t.querySelector(`.Z3988`);if(!n)return z();let r=em(n);return r?(r.genre===F.Article&&!r.jtitle&&r.title&&(r.jtitle=r.title),B({...r,uri:e})):z()},nm=e=>`[data-qa="detail_${e}"]`,rm=(e,t)=>{let n=e.querySelector(nm(t));return n?Array.from(n.querySelectorAll(`nde-highlight`)).map(e=>e.textContent.trim()).filter(e=>!!e):[]},im=(e,t)=>{let n=rm(e,t);return n.length>0?n[0]:void 0},am=e=>{let t=e.querySelector(nm(`creator`));if(!t)return[];let n=Array.from(t.querySelectorAll(`nde-highlight`)).map(e=>e.textContent.trim()).filter(e=>!!e).map(e=>e.replace(/,?\s*author\s*$/i,``).trim());return n.length>0?n:[]},om=e=>{let t=rm(e,`identifier`),n=rm(e,`ispartof`),r=t.find(e=>e.startsWith(`LC:`));return Ju({authors:am(e),title:im(e,`title`),publisher:im(e,`publisher`),creationDate:im(e,`creationdate`),isPartOf:n.length>0?n[0]:void 0,identifierValues:t,lcn:r?.replace(`LC:`,``).trim()})},sm={Article:q.Article,Audio:q.Audio,Book:q.Book,"Book Chapter":q.BookChapter,"Conference Paper":q.Conference,Dissertation:q.Dissertation,Journal:q.Journal,"Magazine Article":q.Article,Newspaper:q.Journal,Video:q.Video},cm={CreativeWork:q.Audio,Movie:q.Video,Periodical:q.Journal,Thesis:q.Dissertation},lm={...sm,...cm},um=e=>{if(e)return e.mainEntity[`@type`]},dm=e=>e.querySelector(`.record-type`)?.textContent.trim()??void 0,fm=gd(om,(e,t)=>{let n=dm(e)??um(t);return n?lm[n]:void 0}),pm=e=>{let t=V(e,`name`,`bepress_citation_doi`);if(t)return t.replace(`https://doi.org/`,``).trim()},mm=e=>{let{document:t}=e,n=rs(e);if(!Yc(n))return n;let r=V(t,`name`,`bepress_citation_date`),i=V(t,`name`,`bepress_citation_pdf_url`),a=pm(t);return r&&(n.resource.date=r),i&&(n.resource.uri=i),a&&(n.resource.rft_id=[a]),n},X=function(e){return e.NoResourceFound=`NoResourceFound`,e.Z3988=`Z3988`,e.Z3988SearchResult=`Z3988SearchResult`,e.Amazon=`Amazon`,e.CupOfJo=`CupOfJo`,e.IngentaConnect=`IngentaConnect`,e.Jstor=`Jstor`,e.Milne=`Milne`,e.Primo=`Primo`,e.SagePub=`SagePub`,e.SageVideo=`SageVideo`,e.ScienceDirect=`ScienceDirect`,e.Springer=`Springer`,e.Youtube=`Youtube`,e.TaylorFrancis=`TaylorFrancis`,e.Wiley=`Wiley`,e.VuFind=`VuFind`,e.ClinicalKey=`ClinicalKey`,e.DOAJ=`DOAJ`,e.Ebscohost=`Ebscohost`,e.OpenStax=`OpenStax`,e.CambridgeJournalsOnline=`CambridgeJournalsOnline`,e.OpenTextbook=`OpenTextbook`,e.AhaJournals=`AhaJournals`,e.Ijees=`Ijees`,e.BloomsburyCollections=`BloomsburyCollections`,e.HeritageCirqa=`HeritageCirqa`,e.BritishMedicalJournal=`BritishMedicalJournal`,e.SummonSearchResult=`SummonSearchResult`,e.ApplePodcasts=`ApplePodcasts`,e.Arxiv=`Arxiv`,e.KanopyVideo=`KanopyVideo`,e.LaTrobeOpal=`LaTrobeOpal`,e.BYUScholarsArchive=`BYUScholarsArchive`,e.Informit=`Informit`,e.Brill=`Brill`,e.HeinOnline=`HeinOnline`,e.PrimoNde=`PrimoNde`,e.MichiganLaw=`MichiganLaw`,e}({}),hm={[X.NoResourceFound]:lc,[X.Z3988]:rs,[X.Z3988SearchResult]:ru,[X.Amazon]:ds,[X.CupOfJo]:cc,[X.Jstor]:zu,[X.Youtube]:al,[X.SagePub]:Ec,[X.SageVideo]:nu,[X.ScienceDirect]:Lc,[X.Springer]:Ml,[X.TaylorFrancis]:Wc,[X.Wiley]:eu,[X.VuFind]:tl,[X.ClinicalKey]:Js,[X.DOAJ]:hc,[X.Primo]:Cd,[X.IngentaConnect]:Md,[X.Ebscohost]:nf,[X.OpenStax]:sf,[X.OpenTextbook]:uf,[X.Milne]:pf,[X.CambridgeJournalsOnline]:mf,[X.AhaJournals]:Of,[X.Ijees]:Mf,[X.BloomsburyCollections]:Jf,[X.HeritageCirqa]:Qf,[X.BritishMedicalJournal]:np,[X.SummonSearchResult]:rp,[X.ApplePodcasts]:lp,[X.Arxiv]:fp,[X.KanopyVideo]:hp,[X.LaTrobeOpal]:xp,[X.BYUScholarsArchive]:Os,[X.Informit]:Fp,[X.Brill]:$p,[X.HeinOnline]:tm,[X.PrimoNde]:fm,[X.MichiganLaw]:mm},gm=`5.37.0`,_m=()=>gm,vm=[`com.au`,`com`,`ca`,`co.uk`,`de`,`fr`,`nl`].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),ym={version:_m(),siteRegistrations:[{matcher:{regexp:`^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search`},name:`Worldcat Search Results`,parsers:[X.Z3988SearchResult]},{matcher:{regexp:`^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/`},name:`Summon Search Results`,parsers:[X.SummonSearchResult]},{matcher:{regexp:`cupofjo[.-]com`},name:`Cup of Jo`,parsers:[X.CupOfJo]},{matcher:{hostnames:[`youtube.com`,`www.youtube.com`]},name:`Youtube`,parsers:[X.Youtube]},{matcher:{regexp:`www[-.]sciencedirect[.-]com`},name:`Science Direct`,parsers:[X.ScienceDirect]},{matcher:{hostnames:vm},name:`Amazon`,parsers:[X.Amazon]},{matcher:{regexp:`^https://sk\\.sagepub\\.com/video/`},name:`Sage Video`,parsers:[X.SageVideo]},{matcher:{regexp:`[/.-]((www|journals)[.-])?sagepub[.-]com`},name:`Sage Publishing`,parsers:[X.SagePub]},{matcher:{regexp:`www[.-]tandfonline[.-]com`},name:`Taylor & Francis`,parsers:[X.TaylorFrancis]},{matcher:{regexp:`[/.-]((www|onlinelibrary)[.-])?wiley[.-]com`},name:`Wiley`,parsers:[X.Wiley]},{matcher:{regexp:`^https://[a-z0-9\\-]+[.-]on[.-]worldcat[.-]org`},name:`Worldcat`,parsers:[X.Z3988]},{matcher:{hostnames:[`catalogue.rau.ac.uk`]},name:`Royal Agricultural University Library`,parsers:[X.Z3988]},{matcher:{regexp:`link[.-]springer[.-]com`},name:`Springer`,parsers:[X.Springer]},{matcher:{regexp:`^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)`},name:`VuFind`,parsers:[X.VuFind]},{matcher:{regexp:`www[.-]clinicalkey[.-]com`},name:`ClinicalKey`,parsers:[X.ClinicalKey]},{matcher:{regexp:`www[.-]jstor[.-]org`},name:`JSTOR`,parsers:[X.Jstor]},{matcher:{regexp:`doaj[.-]org`},name:`DOAJ`,parsers:[X.DOAJ]},{matcher:{regexp:`[/.-]ingentaconnect[.-]com`},name:`IngentaConnect`,parsers:[X.IngentaConnect]},{matcher:{regexp:`research[.-]ebsco[.-]com`},name:`EBSCOHost`,parsers:[X.Ebscohost]},{matcher:{regexp:`openstax[-.]org`},name:`OpenStax`,parsers:[X.OpenStax]},{matcher:{regexp:`open[.-]umn[.-]edu`},name:`OpenTextbook`,parsers:[X.OpenTextbook]},{matcher:{regexp:`milneopentextbooks[-.]org`},name:`Milne Open Textbooks`,parsers:[X.Milne]},{matcher:{regexp:`www[.-]perlego[.-]com`},name:`Perlego`,parsers:[X.Z3988]},{matcher:{regexp:`www[.-]ahajournals[.-]org`},name:`AHA Journals`,parsers:[X.AhaJournals]},{matcher:{regexp:`www[.-]cambridge[.-]org`},name:`Cambridge Journals Online`,parsers:[X.CambridgeJournalsOnline]},{matcher:{regexp:`www[.-]nieindia[.-]org`},name:`International Journal of Ecology and Environmental Sciences`,parsers:[X.Ijees]},{matcher:{regexp:`www[.-]bloomsburycollections[.-]com`},name:`Bloomsbury Collections`,parsers:[X.BloomsburyCollections]},{matcher:{regexp:`cirqahosting[.-]com`},name:`Heritage Cirqa`,parsers:[X.HeritageCirqa]},{matcher:{regexp:`www[.-]bmj[.-]com`},name:`British Medical Journal`,parsers:[X.BritishMedicalJournal]},{matcher:{regexp:`podcasts[.-]apple[.-]com`},name:`Apple Podcasts`,parsers:[X.ApplePodcasts]},{matcher:{regexp:`arxiv[.-]org`},name:`arxiv`,parsers:[X.Arxiv]},{matcher:{regexp:`kanopy[.-]com`},name:`Kanopy Video`,parsers:[X.KanopyVideo]},{matcher:{regexp:`opal[.-]latrobe[.-]edu[.-]au`},name:`La Trobe Opal`,parsers:[X.LaTrobeOpal]},{matcher:{hostnames:[`scholarsarchive.byu.edu`]},name:`BYU Scholars Archive`,parsers:[X.BYUScholarsArchive]},{matcher:{regexp:`informit[.-]org`},name:`Informit`,parsers:[X.Informit]},{matcher:{regexp:`brill[.-]com`},name:`Brill`,parsers:[X.Brill]},{matcher:{regexp:`^https://heinonline[.-]org+.+HOL/LuceneSearch+.*`},name:`HeinOnline Search Results`,parsers:[X.Z3988SearchResult]},{matcher:{regexp:`^https://heinonline[.-]org+.+HOL/Page+.*`},name:`HeinOnline`,parsers:[X.HeinOnline]},{matcher:{regexp:`/nde/fulldisplay`},name:`Primo NDE`,parsers:[X.PrimoNde]},{matcher:{regexp:`/(discovery|primo-explore)/fulldisplay`},name:`Primo`,parsers:[X.Primo]},{matcher:{hostnames:[`repository.law.umich.edu`]},name:`Michigan Law Repository`,parsers:[X.MichiganLaw]}]},bm=j({hostnames:A(O()).min(1)}),xm=j({regexp:O()}),Sm=M([bm,xm]),Cm=j({matcher:Sm,name:O(),parsers:A(O()),libraryVersionRange:O().optional()}),wm=j({siteRegistrations:A(Cm),version:O()}),Tm=e=>wm.safeParse(e).success,Em=e=>Cm.safeParse(e).success,Dm=e=>Sm.safeParse(e).success,Om=e=>Object.values(X).includes(e),km=j({url:O(),document:to(e=>typeof e==`object`&&!!e)}),Am=e=>km.safeParse(e).success,jm=t(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Mm=t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Nm=t(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=jm(),a=Mm();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Pm=t(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Fm=t(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Z=t(((e,t)=>{var n=Mm(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=jm(),{safeRe:a,t:o}=Nm(),s=Pm(),{compareIdentifiers:c}=Fm();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Im=t(((e,t)=>{var n=Z();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Lm=t(((e,t)=>{var n=Im();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Rm=t(((e,t)=>{var n=Im();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),zm=t(((e,t)=>{var n=Z();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Bm=t(((e,t)=>{var n=Im();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),Vm=t(((e,t)=>{var n=Z();t.exports=(e,t)=>new n(e,t).major})),Hm=t(((e,t)=>{var n=Z();t.exports=(e,t)=>new n(e,t).minor})),Um=t(((e,t)=>{var n=Z();t.exports=(e,t)=>new n(e,t).patch})),Wm=t(((e,t)=>{var n=Im();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Q=t(((e,t)=>{var n=Z();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Gm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(t,e,r)})),Km=t(((e,t)=>{var n=Q();t.exports=(e,t)=>n(e,t,!0)})),qm=t(((e,t)=>{var n=Z();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),Jm=t(((e,t)=>{var n=qm();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Ym=t(((e,t)=>{var n=qm();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Xm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)>0})),Zm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)<0})),Qm=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)===0})),$m=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)!==0})),eh=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)>=0})),th=t(((e,t)=>{var n=Q();t.exports=(e,t,r)=>n(e,t,r)<=0})),nh=t(((e,t)=>{var n=Qm(),r=$m(),i=Xm(),a=eh(),o=Zm(),s=th();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),rh=t(((e,t)=>{var n=Z(),r=Im(),{safeRe:i,t:a}=Nm();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),ih=t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),$=t(((e,t)=>{var n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,se(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>b(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let ee=[..._.values()];return r.set(t,ee),ee}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ce(this.set[t],e,this.options))return!0;return!1}};var r=new(ih()),i=Pm(),a=ah(),o=Mm(),s=Z(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=Nm(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=jm(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=ne(e,t),o(`caret`,e),e=ee(e,t),o(`tildes`,e),e=ie(e,t),o(`xrange`,e),e=oe(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,ee=(e,t)=>e.trim().split(/\s+/).map(e=>te(e,t)).join(` `),te=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},ne=(e,t)=>e.trim().split(/\s+/).map(e=>re(e,t)).join(` `),re=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},ie=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ae(e,t)).join(` `)),ae=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},oe=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),b=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),se=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ce=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),ah=t(((e,t)=>{var n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var r=Pm(),{safeRe:i,t:a}=Nm(),o=nh(),s=Mm(),c=Z(),l=$()})),oh=t(((e,t)=>{var n=$();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),sh=t(((e,t)=>{var n=$();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),ch=t(((e,t)=>{var n=Z(),r=$();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),lh=t(((e,t)=>{var n=Z(),r=$();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),uh=t(((e,t)=>{var n=Z(),r=$(),i=Xm();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),dh=t(((e,t)=>{var n=$();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),fh=t(((e,t)=>{var n=Z(),r=ah(),{ANY:i}=r,a=$(),o=oh(),s=Xm(),c=Zm(),l=th(),u=eh();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),ph=t(((e,t)=>{var n=fh();t.exports=(e,t,r)=>n(e,t,`>`,r)})),mh=t(((e,t)=>{var n=fh();t.exports=(e,t,r)=>n(e,t,`<`,r)})),hh=t(((e,t)=>{var n=$();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),gh=t(((e,t)=>{var n=oh(),r=Q();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),_h=t(((e,t)=>{var n=$(),r=ah(),{ANY:i}=r,a=oh(),o=Q(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),vh=t(((e,t)=>{var n=Nm(),r=jm(),i=Z(),a=Fm();t.exports={parse:Im(),valid:Lm(),clean:Rm(),inc:zm(),diff:Bm(),major:Vm(),minor:Hm(),patch:Um(),prerelease:Wm(),compare:Q(),rcompare:Gm(),compareLoose:Km(),compareBuild:qm(),sort:Jm(),rsort:Ym(),gt:Xm(),lt:Zm(),eq:Qm(),neq:$m(),gte:eh(),lte:th(),cmp:nh(),coerce:rh(),Comparator:ah(),Range:$(),satisfies:oh(),toComparators:sh(),maxSatisfying:ch(),minSatisfying:lh(),minVersion:uh(),validRange:dh(),outside:fh(),gtr:ph(),ltr:mh(),intersects:hh(),simplifyRange:gh(),subset:_h(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),yh=(e,t)=>bh(t)?t.hostnames.includes(new URL(e).hostname):xh(t)?!!e.match(t.regexp):!1,bh=e=>bm.safeParse(e).success,xh=e=>xm.safeParse(e).success,Sh=(e,t)=>t?(0,vh.satisfies)(e,t):!0,Ch=(e,t,n)=>Sh(t,n.libraryVersionRange)&&yh(e,n.matcher),wh=(e,t)=>e.siteRegistrations.filter(e=>Ch(t,_m(),e)),Th=(e,t)=>wh(e,t).flatMap(({parsers:e,name:t})=>e.filter(e=>Om(e)&&e in hm).map(e=>({parser:hm[e],parserType:e,name:t}))),Eh=(e,t)=>{let n=Th(e,t.url);for(let{parser:e,parserType:r,name:i}of n){let n=e(t);if(Yc(n)||Xc(n)||Zc(n))return{...n,meta:{parserName:i,parserType:r,referrer:t.url}}}return{...lc(t),meta:{parserName:null,parserType:X.NoResourceFound,referrer:t.url}}},Dh=(e,t)=>{switch(t){case jo.CA:return new URL(`https://${e}.rl.ca.talis.com`);default:return new URL(`https://${e}.rl.talis.com`)}};e.BookGenresSchema=io,e.CustomerListSchema=Ro,e.CustomerSchema=Lo,e.DirectLinkOnlyResultSchema=qo,e.Genre=F,e.HostnamesMatcherSchema=bm,e.JournalGenresSchema=ao,e.NON_OPENURL_PROPERTIES=xo,e.NonOpenUrlPropertiesSchema=so,e.NothingParsedResultSchema=Ko,e.OPENURL_KEYS=bo,e.OpenUrlAudioVisualResourceSchema=uo,e.OpenUrlBookResourceSchema=co,e.OpenUrlDocumentResourceSchema=po,e.OpenUrlImageResourceSchema=fo,e.OpenUrlJournalResourceSchema=lo,e.OpenUrlResourceSchema=oo,e.OpenUrlResultSchema=Jo,e.OpenUrlWebpageResourceSchema=mo,e.PARSERS=hm,e.ParserRegistrySchema=wm,e.ParserType=X,e.ParsingMetadataSchema=Go,e.ParsingRequestSchema=Fo,e.ParsingResponseSchema=Qo,e.ParsingResultSchema=Zo,e.REGISTRY=ym,e.RegExpMatcherSchema=xm,e.ResourceDataSchema=km,e.ResourceSchema=ho,e.SiteRegistrationSchema=Cm,e.SummonSearchResultSchema=Xo,e.TenantRegion=jo,e.TenantRegistrySchema=No,e.TenantSchema=Mo,e.UrlMatcherSchema=Sm,e.Z3988SearchResultSchema=Yo,e.convertCustomerListToTenantRegistry=Uo,e.createAudioVisual=R,e.createBook=I,e.createDocument=_o,e.createImage=go,e.createJournal=L,e.createWebpage=vo,e.directLinkOnly=$o,e.fromOpenUrl=Oo,e.getBaseBookmarkingUrl=(e,t)=>{let n=Dh(e,t);return new URL(`/ui/forms/bookmarklet.html`,n)},e.getLibraryVersion=_m,e.isCustomer=zo,e.isCustomerList=Bo,e.isDirectLinkOnlyResult=Jc,e.isGenre=Ao,e.isNothingParsedResult=Qc,e.isOpenUrlResult=Yc,e.isParserRegistry=Tm,e.isParserType=Om,e.isParsingMetadata=qc,e.isParsingRequest=Io,e.isParsingResponse=Kc,e.isParsingResult=Gc,e.isResourceData=Am,e.isSiteRegistration=Em,e.isSummonSearchResult=Zc,e.isTenant=Vo,e.isTenantRegion=Ho,e.isUrlMatcher=Dm,e.isZ3988SearchResult=Xc,e.nothingParsed=z,e.openUrlResource=B,e.parseResource=Eh,e.summonSearchResult=ts,e.toBookmarkingWorkflowUrl=(e,t,n)=>{let r=Eo(t);r.append(`fast`,`true`),r.append(`breakout`,`true`),n&&(n.parserName&&r.append(`targetTitle`,n.parserName),r.append(`referrer`,n.referrer));let i=new URL(e.toString());return i.search=r.toString(),i},e.toOpenUrl=Eo,e.z3988SearchResult=es});
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "5.
|
|
11
|
+
"version": "5.37.0",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"@types/eslint": "9.6.1",
|
|
43
43
|
"@types/node": "24.12.0",
|
|
44
44
|
"@types/semver": "7.7.1",
|
|
45
|
-
"@vitest/coverage-v8": "4.1.
|
|
45
|
+
"@vitest/coverage-v8": "4.1.1",
|
|
46
46
|
"camelcase": "9.0.0",
|
|
47
|
-
"eslint": "10.0
|
|
47
|
+
"eslint": "10.1.0",
|
|
48
48
|
"eslint-config-prettier": "10.1.8",
|
|
49
|
-
"@vitest/eslint-plugin": "1.6.
|
|
50
|
-
"jsdom": "29.0.
|
|
49
|
+
"@vitest/eslint-plugin": "1.6.13",
|
|
50
|
+
"jsdom": "29.0.1",
|
|
51
51
|
"prettier": "3.8.1",
|
|
52
52
|
"puppeteer": "24.40.0",
|
|
53
53
|
"tsx": "4.21.0",
|
|
54
54
|
"typescript": "5.9.3",
|
|
55
|
-
"typescript-eslint": "8.57.
|
|
56
|
-
"vite": "8.0.
|
|
55
|
+
"typescript-eslint": "8.57.2",
|
|
56
|
+
"vite": "8.0.2",
|
|
57
57
|
"vite-plugin-dts": "4.5.4",
|
|
58
|
-
"vitest": "4.1.
|
|
58
|
+
"vitest": "4.1.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"semver": "^7.6.3",
|