@unhead/schema-org 0.6.0 → 1.3.9

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.
@@ -0,0 +1,1970 @@
1
+ import { hasProtocol, joinURL, withBase, withoutTrailingSlash, hasTrailingSlash, withTrailingSlash } from 'ufo';
2
+ import { hashCode } from '@unhead/shared';
3
+
4
+ function defineSchemaOrgResolver(schema) {
5
+ return schema;
6
+ }
7
+
8
+ function idReference(node) {
9
+ return {
10
+ "@id": typeof node !== "string" ? node["@id"] : node
11
+ };
12
+ }
13
+ function resolvableDateToDate(val) {
14
+ try {
15
+ const date = val instanceof Date ? val : new Date(Date.parse(val));
16
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
17
+ } catch (e) {
18
+ }
19
+ return typeof val === "string" ? val : val.toString();
20
+ }
21
+ function resolvableDateToIso(val) {
22
+ if (!val)
23
+ return val;
24
+ try {
25
+ if (val instanceof Date)
26
+ return val.toISOString();
27
+ else
28
+ return new Date(Date.parse(val)).toISOString();
29
+ } catch (e) {
30
+ }
31
+ return typeof val === "string" ? val : val.toString();
32
+ }
33
+ const IdentityId = "#identity";
34
+ function setIfEmpty(node, field, value) {
35
+ if (!node?.[field] && value)
36
+ node[field] = value;
37
+ }
38
+ function asArray(input) {
39
+ return Array.isArray(input) ? input : [input];
40
+ }
41
+ function dedupeMerge(node, field, value) {
42
+ const dedupeMerge2 = [];
43
+ const input = asArray(node[field]);
44
+ dedupeMerge2.push(...input);
45
+ const data = new Set(dedupeMerge2);
46
+ data.add(value);
47
+ node[field] = [...data.values()].filter(Boolean);
48
+ }
49
+ function prefixId(url, id) {
50
+ if (hasProtocol(id))
51
+ return url;
52
+ if (!id.startsWith("#"))
53
+ id = `#${id}`;
54
+ return joinURL(url, id);
55
+ }
56
+ function trimLength(val, length) {
57
+ if (!val)
58
+ return val;
59
+ if (val.length > length) {
60
+ const trimmedString = val.substring(0, length);
61
+ return trimmedString.substring(0, Math.min(trimmedString.length, trimmedString.lastIndexOf(" ")));
62
+ }
63
+ return val;
64
+ }
65
+ function resolveDefaultType(node, defaultType) {
66
+ const val = node["@type"];
67
+ if (val === defaultType)
68
+ return;
69
+ const types = /* @__PURE__ */ new Set([
70
+ ...asArray(defaultType),
71
+ ...asArray(val)
72
+ ]);
73
+ node["@type"] = types.size === 1 ? val : [...types.values()];
74
+ }
75
+ function resolveWithBase(base, urlOrPath) {
76
+ if (!urlOrPath || hasProtocol(urlOrPath) || !urlOrPath.startsWith("/") && !urlOrPath.startsWith("#"))
77
+ return urlOrPath;
78
+ return withBase(urlOrPath, base);
79
+ }
80
+ function resolveAsGraphKey(key) {
81
+ if (!key)
82
+ return key;
83
+ return key.substring(key.lastIndexOf("#"));
84
+ }
85
+ function stripEmptyProperties(obj) {
86
+ Object.keys(obj).forEach((k) => {
87
+ if (obj[k] && typeof obj[k] === "object") {
88
+ if (obj[k].__v_isReadonly || obj[k].__v_isRef)
89
+ return;
90
+ stripEmptyProperties(obj[k]);
91
+ return;
92
+ }
93
+ if (obj[k] === "" || obj[k] === null || typeof obj[k] === "undefined")
94
+ delete obj[k];
95
+ });
96
+ return obj;
97
+ }
98
+
99
+ const offerResolver = defineSchemaOrgResolver({
100
+ cast(node) {
101
+ if (typeof node === "number" || typeof node === "string") {
102
+ return {
103
+ price: node
104
+ };
105
+ }
106
+ return node;
107
+ },
108
+ defaults: {
109
+ "@type": "Offer",
110
+ "availability": "InStock"
111
+ },
112
+ resolve(node, ctx) {
113
+ setIfEmpty(node, "priceCurrency", ctx.meta.currency);
114
+ setIfEmpty(node, "priceValidUntil", new Date(Date.UTC((/* @__PURE__ */ new Date()).getFullYear() + 1, 12, -1, 0, 0, 0)));
115
+ if (node.url)
116
+ resolveWithBase(ctx.meta.host, node.url);
117
+ if (node.availability)
118
+ node.availability = withBase(node.availability, "https://schema.org/");
119
+ if (node.priceValidUntil)
120
+ node.priceValidUntil = resolvableDateToIso(node.priceValidUntil);
121
+ return node;
122
+ }
123
+ });
124
+
125
+ const aggregateOfferResolver = defineSchemaOrgResolver({
126
+ defaults: {
127
+ "@type": "AggregateOffer"
128
+ },
129
+ inheritMeta: [
130
+ { meta: "currency", key: "priceCurrency" }
131
+ ],
132
+ resolve(node, ctx) {
133
+ node.offers = resolveRelation(node.offers, ctx, offerResolver);
134
+ if (node.offers)
135
+ setIfEmpty(node, "offerCount", asArray(node.offers).length);
136
+ return node;
137
+ }
138
+ });
139
+
140
+ const aggregateRatingResolver = defineSchemaOrgResolver({
141
+ defaults: {
142
+ "@type": "AggregateRating"
143
+ }
144
+ });
145
+
146
+ const searchActionResolver = defineSchemaOrgResolver({
147
+ defaults: {
148
+ "@type": "SearchAction",
149
+ "target": {
150
+ "@type": "EntryPoint"
151
+ },
152
+ "query-input": {
153
+ "@type": "PropertyValueSpecification",
154
+ "valueRequired": true,
155
+ "valueName": "search_term_string"
156
+ }
157
+ },
158
+ resolve(node, ctx) {
159
+ if (typeof node.target === "string") {
160
+ node.target = {
161
+ "@type": "EntryPoint",
162
+ "urlTemplate": resolveWithBase(ctx.meta.host, node.target)
163
+ };
164
+ }
165
+ return node;
166
+ }
167
+ });
168
+
169
+ const PrimaryWebSiteId = "#website";
170
+ const webSiteResolver = defineSchemaOrgResolver({
171
+ defaults: {
172
+ "@type": "WebSite"
173
+ },
174
+ inheritMeta: [
175
+ "inLanguage",
176
+ { meta: "host", key: "url" }
177
+ ],
178
+ idPrefix: ["host", PrimaryWebSiteId],
179
+ resolve(node, ctx) {
180
+ node.potentialAction = resolveRelation(node.potentialAction, ctx, searchActionResolver, {
181
+ array: true
182
+ });
183
+ node.publisher = resolveRelation(node.publisher, ctx);
184
+ return node;
185
+ },
186
+ resolveRootNode(node, { find }) {
187
+ if (resolveAsGraphKey(node["@id"]) === PrimaryWebSiteId) {
188
+ const identity = find(IdentityId);
189
+ if (identity)
190
+ setIfEmpty(node, "publisher", idReference(identity));
191
+ const webPage = find(PrimaryWebPageId);
192
+ if (webPage)
193
+ setIfEmpty(webPage, "isPartOf", idReference(node));
194
+ }
195
+ return node;
196
+ }
197
+ });
198
+
199
+ const listItemResolver = defineSchemaOrgResolver({
200
+ cast(node) {
201
+ if (typeof node === "string") {
202
+ node = {
203
+ name: node
204
+ };
205
+ }
206
+ return node;
207
+ },
208
+ defaults: {
209
+ "@type": "ListItem"
210
+ },
211
+ resolve(node, ctx) {
212
+ if (typeof node.item === "string")
213
+ node.item = resolveWithBase(ctx.meta.host, node.item);
214
+ else if (typeof node.item === "object")
215
+ node.item = resolveRelation(node.item, ctx);
216
+ return node;
217
+ }
218
+ });
219
+
220
+ const PrimaryBreadcrumbId = "#breadcrumb";
221
+ const breadcrumbResolver = defineSchemaOrgResolver({
222
+ defaults: {
223
+ "@type": "BreadcrumbList"
224
+ },
225
+ idPrefix: ["url", PrimaryBreadcrumbId],
226
+ resolve(breadcrumb, ctx) {
227
+ if (breadcrumb.itemListElement) {
228
+ let index = 1;
229
+ breadcrumb.itemListElement = resolveRelation(breadcrumb.itemListElement, ctx, listItemResolver, {
230
+ array: true,
231
+ afterResolve(node) {
232
+ setIfEmpty(node, "position", index++);
233
+ }
234
+ });
235
+ }
236
+ return breadcrumb;
237
+ },
238
+ resolveRootNode(node, { find }) {
239
+ const webPage = find(PrimaryWebPageId);
240
+ if (webPage)
241
+ setIfEmpty(webPage, "breadcrumb", idReference(node));
242
+ }
243
+ });
244
+
245
+ const imageResolver = defineSchemaOrgResolver({
246
+ alias: "image",
247
+ cast(input) {
248
+ if (typeof input === "string") {
249
+ input = {
250
+ url: input
251
+ };
252
+ }
253
+ return input;
254
+ },
255
+ defaults: {
256
+ "@type": "ImageObject"
257
+ },
258
+ inheritMeta: [
259
+ // @todo possibly only do if there's a caption
260
+ "inLanguage"
261
+ ],
262
+ idPrefix: "host",
263
+ resolve(image, { meta }) {
264
+ image.url = resolveWithBase(meta.host, image.url);
265
+ setIfEmpty(image, "contentUrl", image.url);
266
+ if (image.height && !image.width)
267
+ delete image.height;
268
+ if (image.width && !image.height)
269
+ delete image.width;
270
+ return image;
271
+ }
272
+ });
273
+
274
+ const addressResolver = defineSchemaOrgResolver({
275
+ defaults: {
276
+ "@type": "PostalAddress"
277
+ }
278
+ });
279
+
280
+ const organizationResolver = defineSchemaOrgResolver({
281
+ defaults: {
282
+ "@type": "Organization"
283
+ },
284
+ idPrefix: ["host", IdentityId],
285
+ inheritMeta: [
286
+ { meta: "host", key: "url" }
287
+ ],
288
+ resolve(node, ctx) {
289
+ resolveDefaultType(node, "Organization");
290
+ node.address = resolveRelation(node.address, ctx, addressResolver);
291
+ return node;
292
+ },
293
+ resolveRootNode(node, ctx) {
294
+ const isIdentity = resolveAsGraphKey(node["@id"]) === IdentityId;
295
+ const webPage = ctx.find(PrimaryWebPageId);
296
+ if (node.logo) {
297
+ node.logo = resolveRelation(node.logo, ctx, imageResolver, {
298
+ root: true,
299
+ afterResolve(logo) {
300
+ if (isIdentity)
301
+ logo["@id"] = prefixId(ctx.meta.host, "#logo");
302
+ setIfEmpty(logo, "caption", node.name);
303
+ }
304
+ });
305
+ if (webPage)
306
+ setIfEmpty(webPage, "primaryImageOfPage", idReference(node.logo));
307
+ }
308
+ if (isIdentity && webPage)
309
+ setIfEmpty(webPage, "about", idReference(node));
310
+ const webSite = ctx.find(PrimaryWebSiteId);
311
+ if (webSite)
312
+ setIfEmpty(webSite, "publisher", idReference(node));
313
+ }
314
+ });
315
+
316
+ const personResolver = defineSchemaOrgResolver({
317
+ cast(node) {
318
+ if (typeof node === "string") {
319
+ return {
320
+ name: node
321
+ };
322
+ }
323
+ return node;
324
+ },
325
+ defaults: {
326
+ "@type": "Person"
327
+ },
328
+ idPrefix: ["host", IdentityId],
329
+ resolve(node, ctx) {
330
+ if (node.url)
331
+ node.url = resolveWithBase(ctx.meta.host, node.url);
332
+ return node;
333
+ },
334
+ resolveRootNode(node, { find, meta }) {
335
+ if (resolveAsGraphKey(node["@id"]) === IdentityId) {
336
+ setIfEmpty(node, "url", meta.host);
337
+ const webPage = find(PrimaryWebPageId);
338
+ if (webPage)
339
+ setIfEmpty(webPage, "about", idReference(node));
340
+ const webSite = find(PrimaryWebSiteId);
341
+ if (webSite)
342
+ setIfEmpty(webSite, "publisher", idReference(node));
343
+ }
344
+ const article = find(PrimaryArticleId);
345
+ if (article)
346
+ setIfEmpty(article, "author", idReference(node));
347
+ }
348
+ });
349
+
350
+ const readActionResolver = defineSchemaOrgResolver({
351
+ defaults: {
352
+ "@type": "ReadAction"
353
+ },
354
+ resolve(node, ctx) {
355
+ if (!node.target.includes(ctx.meta.url))
356
+ node.target.unshift(ctx.meta.url);
357
+ return node;
358
+ }
359
+ });
360
+
361
+ const PrimaryWebPageId = "#webpage";
362
+ const webPageResolver = defineSchemaOrgResolver({
363
+ defaults({ meta }) {
364
+ const endPath = withoutTrailingSlash(meta.url.substring(meta.url.lastIndexOf("/") + 1));
365
+ let type = "WebPage";
366
+ switch (endPath) {
367
+ case "about":
368
+ case "about-us":
369
+ type = "AboutPage";
370
+ break;
371
+ case "search":
372
+ type = "SearchResultsPage";
373
+ break;
374
+ case "checkout":
375
+ type = "CheckoutPage";
376
+ break;
377
+ case "contact":
378
+ case "get-in-touch":
379
+ case "contact-us":
380
+ type = "ContactPage";
381
+ break;
382
+ case "faq":
383
+ type = "FAQPage";
384
+ break;
385
+ }
386
+ const defaults = {
387
+ "@type": type
388
+ };
389
+ return defaults;
390
+ },
391
+ idPrefix: ["url", PrimaryWebPageId],
392
+ inheritMeta: [
393
+ { meta: "title", key: "name" },
394
+ "description",
395
+ "datePublished",
396
+ "dateModified",
397
+ "url"
398
+ ],
399
+ resolve(node, ctx) {
400
+ node.dateModified = resolvableDateToIso(node.dateModified);
401
+ node.datePublished = resolvableDateToIso(node.datePublished);
402
+ resolveDefaultType(node, "WebPage");
403
+ node.about = resolveRelation(node.about, ctx, organizationResolver);
404
+ node.breadcrumb = resolveRelation(node.breadcrumb, ctx, breadcrumbResolver);
405
+ node.author = resolveRelation(node.author, ctx, personResolver);
406
+ node.primaryImageOfPage = resolveRelation(node.primaryImageOfPage, ctx, imageResolver);
407
+ node.potentialAction = resolveRelation(node.potentialAction, ctx, readActionResolver);
408
+ if (node["@type"] === "WebPage") {
409
+ setIfEmpty(node, "potentialAction", [
410
+ {
411
+ "@type": "ReadAction",
412
+ "target": [ctx.meta.url]
413
+ }
414
+ ]);
415
+ }
416
+ return node;
417
+ },
418
+ resolveRootNode(webPage, { find, meta }) {
419
+ const identity = find(IdentityId);
420
+ const webSite = find(PrimaryWebSiteId);
421
+ const logo = find("#logo");
422
+ if (identity && meta.url === meta.host)
423
+ setIfEmpty(webPage, "about", idReference(identity));
424
+ if (logo)
425
+ setIfEmpty(webPage, "primaryImageOfPage", idReference(logo));
426
+ if (webSite)
427
+ setIfEmpty(webPage, "isPartOf", idReference(webSite));
428
+ const breadcrumb = find(PrimaryBreadcrumbId);
429
+ if (breadcrumb)
430
+ setIfEmpty(webPage, "breadcrumb", idReference(breadcrumb));
431
+ return webPage;
432
+ }
433
+ });
434
+
435
+ const PrimaryArticleId = "#article";
436
+ const articleResolver = defineSchemaOrgResolver({
437
+ defaults: {
438
+ "@type": "Article"
439
+ },
440
+ inheritMeta: [
441
+ "inLanguage",
442
+ "description",
443
+ "image",
444
+ "dateModified",
445
+ "datePublished",
446
+ { meta: "title", key: "headline" }
447
+ ],
448
+ idPrefix: ["url", PrimaryArticleId],
449
+ resolve(node, ctx) {
450
+ node.author = resolveRelation(node.author, ctx, personResolver, {
451
+ root: true
452
+ });
453
+ node.publisher = resolveRelation(node.publisher, ctx);
454
+ node.dateModified = resolvableDateToIso(node.dateModified);
455
+ node.datePublished = resolvableDateToIso(node.datePublished);
456
+ resolveDefaultType(node, "Article");
457
+ node.headline = trimLength(node.headline, 110);
458
+ return node;
459
+ },
460
+ resolveRootNode(node, { find, meta }) {
461
+ const webPage = find(PrimaryWebPageId);
462
+ const identity = find(IdentityId);
463
+ if (node.image && !node.thumbnailUrl) {
464
+ const firstImage = asArray(node.image)[0];
465
+ if (typeof firstImage === "string")
466
+ setIfEmpty(node, "thumbnailUrl", resolveWithBase(meta.host, firstImage));
467
+ else if (firstImage?.["@id"])
468
+ setIfEmpty(node, "thumbnailUrl", find(firstImage["@id"])?.url);
469
+ }
470
+ if (identity) {
471
+ setIfEmpty(node, "publisher", idReference(identity));
472
+ setIfEmpty(node, "author", idReference(identity));
473
+ }
474
+ if (webPage) {
475
+ setIfEmpty(node, "isPartOf", idReference(webPage));
476
+ setIfEmpty(node, "mainEntityOfPage", idReference(webPage));
477
+ setIfEmpty(webPage, "potentialAction", [
478
+ {
479
+ "@type": "ReadAction",
480
+ "target": [meta.url]
481
+ }
482
+ ]);
483
+ setIfEmpty(webPage, "dateModified", node.dateModified);
484
+ setIfEmpty(webPage, "datePublished", node.datePublished);
485
+ }
486
+ return node;
487
+ }
488
+ });
489
+
490
+ const bookEditionResolver = defineSchemaOrgResolver({
491
+ defaults: {
492
+ "@type": "Book"
493
+ },
494
+ inheritMeta: [
495
+ "inLanguage"
496
+ ],
497
+ resolve(node, ctx) {
498
+ if (node.bookFormat)
499
+ node.bookFormat = withBase(node.bookFormat, "https://schema.org/");
500
+ if (node.datePublished)
501
+ node.datePublished = resolvableDateToDate(node.datePublished);
502
+ node.author = resolveRelation(node.author, ctx);
503
+ return node;
504
+ },
505
+ resolveRootNode(node, { find }) {
506
+ const identity = find(IdentityId);
507
+ if (identity)
508
+ setIfEmpty(node, "provider", idReference(identity));
509
+ return node;
510
+ }
511
+ });
512
+ const PrimaryBookId = "#book";
513
+ const bookResolver = defineSchemaOrgResolver({
514
+ defaults: {
515
+ "@type": "Book"
516
+ },
517
+ inheritMeta: [
518
+ "description",
519
+ "url",
520
+ { meta: "title", key: "name" }
521
+ ],
522
+ idPrefix: ["url", PrimaryBookId],
523
+ resolve(node, ctx) {
524
+ node.workExample = resolveRelation(node.workExample, ctx, bookEditionResolver);
525
+ node.author = resolveRelation(node.author, ctx);
526
+ if (node.url)
527
+ withBase(node.url, ctx.meta.host);
528
+ return node;
529
+ },
530
+ resolveRootNode(node, { find }) {
531
+ const identity = find(IdentityId);
532
+ if (identity)
533
+ setIfEmpty(node, "author", idReference(identity));
534
+ return node;
535
+ }
536
+ });
537
+
538
+ const commentResolver = defineSchemaOrgResolver({
539
+ defaults: {
540
+ "@type": "Comment"
541
+ },
542
+ idPrefix: "url",
543
+ resolve(node, ctx) {
544
+ node.author = resolveRelation(node.author, ctx, personResolver, {
545
+ root: true
546
+ });
547
+ return node;
548
+ },
549
+ resolveRootNode(node, { find }) {
550
+ const article = find(PrimaryArticleId);
551
+ if (article)
552
+ setIfEmpty(node, "about", idReference(article));
553
+ }
554
+ });
555
+
556
+ const courseResolver = defineSchemaOrgResolver({
557
+ defaults: {
558
+ "@type": "Course"
559
+ },
560
+ resolve(node, ctx) {
561
+ node.provider = resolveRelation(node.provider, ctx, organizationResolver, {
562
+ root: true
563
+ });
564
+ return node;
565
+ },
566
+ resolveRootNode(node, { find }) {
567
+ const identity = find(IdentityId);
568
+ if (identity)
569
+ setIfEmpty(node, "provider", idReference(identity));
570
+ return node;
571
+ }
572
+ });
573
+
574
+ const placeResolver = defineSchemaOrgResolver({
575
+ defaults: {
576
+ "@type": "Place"
577
+ },
578
+ resolve(node, ctx) {
579
+ if (typeof node.address !== "string")
580
+ node.address = resolveRelation(node.address, ctx, addressResolver);
581
+ return node;
582
+ }
583
+ });
584
+
585
+ const virtualLocationResolver = defineSchemaOrgResolver({
586
+ cast(node) {
587
+ if (typeof node === "string") {
588
+ return {
589
+ url: node
590
+ };
591
+ }
592
+ return node;
593
+ },
594
+ defaults: {
595
+ "@type": "VirtualLocation"
596
+ }
597
+ });
598
+
599
+ const PrimaryEventId = "#event";
600
+ const eventResolver = defineSchemaOrgResolver({
601
+ defaults: {
602
+ "@type": "Event"
603
+ },
604
+ inheritMeta: [
605
+ "inLanguage",
606
+ "description",
607
+ "image",
608
+ { meta: "title", key: "name" }
609
+ ],
610
+ idPrefix: ["url", PrimaryEventId],
611
+ resolve(node, ctx) {
612
+ if (node.location) {
613
+ const isVirtual = node.location === "string" || node.location?.url !== "undefined";
614
+ node.location = resolveRelation(node.location, ctx, isVirtual ? virtualLocationResolver : placeResolver);
615
+ }
616
+ node.performer = resolveRelation(node.performer, ctx, personResolver, {
617
+ root: true
618
+ });
619
+ node.organizer = resolveRelation(node.organizer, ctx, organizationResolver, {
620
+ root: true
621
+ });
622
+ node.offers = resolveRelation(node.offers, ctx, offerResolver);
623
+ if (node.eventAttendanceMode)
624
+ node.eventAttendanceMode = withBase(node.eventAttendanceMode, "https://schema.org/");
625
+ if (node.eventStatus)
626
+ node.eventStatus = withBase(node.eventStatus, "https://schema.org/");
627
+ const isOnline = node.eventStatus === "https://schema.org/EventMovedOnline";
628
+ const dates = ["startDate", "previousStartDate", "endDate"];
629
+ dates.forEach((date) => {
630
+ if (!isOnline) {
631
+ if (node[date] instanceof Date && node[date].getHours() === 0 && node[date].getMinutes() === 0)
632
+ node[date] = resolvableDateToDate(node[date]);
633
+ } else {
634
+ node[date] = resolvableDateToIso(node[date]);
635
+ }
636
+ });
637
+ setIfEmpty(node, "endDate", node.startDate);
638
+ return node;
639
+ },
640
+ resolveRootNode(node, { find }) {
641
+ const identity = find(IdentityId);
642
+ if (identity)
643
+ setIfEmpty(node, "organizer", idReference(identity));
644
+ }
645
+ });
646
+
647
+ const howToStepDirectionResolver = defineSchemaOrgResolver({
648
+ cast(node) {
649
+ if (typeof node === "string") {
650
+ return {
651
+ text: node
652
+ };
653
+ }
654
+ return node;
655
+ },
656
+ defaults: {
657
+ "@type": "HowToDirection"
658
+ }
659
+ });
660
+
661
+ const howToStepResolver = defineSchemaOrgResolver({
662
+ cast(node) {
663
+ if (typeof node === "string") {
664
+ return {
665
+ text: node
666
+ };
667
+ }
668
+ return node;
669
+ },
670
+ defaults: {
671
+ "@type": "HowToStep"
672
+ },
673
+ resolve(step, ctx) {
674
+ if (step.url)
675
+ step.url = resolveWithBase(ctx.meta.url, step.url);
676
+ if (step.image) {
677
+ step.image = resolveRelation(step.image, ctx, imageResolver, {
678
+ root: true
679
+ });
680
+ }
681
+ if (step.itemListElement)
682
+ step.itemListElement = resolveRelation(step.itemListElement, ctx, howToStepDirectionResolver);
683
+ return step;
684
+ }
685
+ });
686
+
687
+ const HowToId = "#howto";
688
+ const howToResolver = defineSchemaOrgResolver({
689
+ defaults: {
690
+ "@type": "HowTo"
691
+ },
692
+ inheritMeta: [
693
+ "description",
694
+ "image",
695
+ "inLanguage",
696
+ { meta: "title", key: "name" }
697
+ ],
698
+ idPrefix: ["url", HowToId],
699
+ resolve(node, ctx) {
700
+ node.step = resolveRelation(node.step, ctx, howToStepResolver);
701
+ return node;
702
+ },
703
+ resolveRootNode(node, { find }) {
704
+ const webPage = find(PrimaryWebPageId);
705
+ if (webPage)
706
+ setIfEmpty(node, "mainEntityOfPage", idReference(webPage));
707
+ }
708
+ });
709
+
710
+ const itemListResolver = defineSchemaOrgResolver({
711
+ defaults: {
712
+ "@type": "ItemList"
713
+ },
714
+ resolve(node, ctx) {
715
+ if (node.itemListElement) {
716
+ let index = 1;
717
+ node.itemListElement = resolveRelation(node.itemListElement, ctx, listItemResolver, {
718
+ array: true,
719
+ afterResolve(node2) {
720
+ setIfEmpty(node2, "position", index++);
721
+ }
722
+ });
723
+ }
724
+ return node;
725
+ }
726
+ });
727
+
728
+ const quantitativeValueResolver = defineSchemaOrgResolver({
729
+ defaults: {
730
+ "@type": "QuantitativeValue"
731
+ }
732
+ });
733
+ const monetaryAmountResolver = defineSchemaOrgResolver({
734
+ defaults: {
735
+ "@type": "MonetaryAmount"
736
+ },
737
+ resolve(node, ctx) {
738
+ node.value = resolveRelation(node.value, ctx, quantitativeValueResolver);
739
+ return node;
740
+ }
741
+ });
742
+
743
+ const jobPostingResolver = defineSchemaOrgResolver({
744
+ defaults: {
745
+ "@type": "JobPosting"
746
+ },
747
+ resolve(node, ctx) {
748
+ node.datePosted = resolvableDateToIso(node.datePosted);
749
+ node.hiringOrganization = resolveRelation(node.hiringOrganization, ctx, organizationResolver);
750
+ node.jobLocation = resolveRelation(node.jobLocation, ctx, placeResolver);
751
+ node.baseSalary = resolveRelation(node.baseSalary, ctx, monetaryAmountResolver);
752
+ node.validThrough = resolvableDateToIso(node.validThrough);
753
+ return node;
754
+ }
755
+ });
756
+
757
+ const openingHoursResolver = defineSchemaOrgResolver({
758
+ defaults: {
759
+ "@type": "OpeningHoursSpecification",
760
+ "opens": "00:00",
761
+ "closes": "23:59"
762
+ }
763
+ });
764
+
765
+ const localBusinessResolver = defineSchemaOrgResolver({
766
+ defaults: {
767
+ "@type": ["Organization", "LocalBusiness"]
768
+ },
769
+ inheritMeta: [
770
+ { key: "url", meta: "host" },
771
+ { key: "currenciesAccepted", meta: "currency" }
772
+ ],
773
+ idPrefix: ["host", IdentityId],
774
+ resolve(node, ctx) {
775
+ resolveDefaultType(node, ["Organization", "LocalBusiness"]);
776
+ node.address = resolveRelation(node.address, ctx, addressResolver);
777
+ node.openingHoursSpecification = resolveRelation(node.openingHoursSpecification, ctx, openingHoursResolver);
778
+ node.logo = resolveRelation(node.logo, ctx, imageResolver, {
779
+ afterResolve(logo) {
780
+ const hasLogo = !!ctx.find("#logo");
781
+ if (!hasLogo)
782
+ logo["@id"] = prefixId(ctx.meta.host, "#logo");
783
+ setIfEmpty(logo, "caption", node.name);
784
+ }
785
+ });
786
+ return node;
787
+ }
788
+ });
789
+
790
+ const ratingResolver = defineSchemaOrgResolver({
791
+ cast(node) {
792
+ if (node === "number") {
793
+ return {
794
+ ratingValue: node
795
+ };
796
+ }
797
+ return node;
798
+ },
799
+ defaults: {
800
+ "@type": "Rating",
801
+ "bestRating": 5,
802
+ "worstRating": 1
803
+ }
804
+ });
805
+
806
+ const reviewResolver = defineSchemaOrgResolver({
807
+ defaults: {
808
+ "@type": "Review"
809
+ },
810
+ inheritMeta: [
811
+ "inLanguage"
812
+ ],
813
+ resolve(review, ctx) {
814
+ review.reviewRating = resolveRelation(review.reviewRating, ctx, ratingResolver);
815
+ review.author = resolveRelation(review.author, ctx, personResolver);
816
+ return review;
817
+ }
818
+ });
819
+
820
+ const videoResolver = defineSchemaOrgResolver({
821
+ cast(input) {
822
+ if (typeof input === "string") {
823
+ input = {
824
+ url: input
825
+ };
826
+ }
827
+ return input;
828
+ },
829
+ alias: "video",
830
+ defaults: {
831
+ "@type": "VideoObject"
832
+ },
833
+ inheritMeta: [
834
+ { meta: "title", key: "name" },
835
+ "description",
836
+ "image",
837
+ "inLanguage",
838
+ { meta: "datePublished", key: "uploadDate" }
839
+ ],
840
+ idPrefix: "host",
841
+ resolve(video, ctx) {
842
+ if (video.uploadDate)
843
+ video.uploadDate = resolvableDateToIso(video.uploadDate);
844
+ video.url = resolveWithBase(ctx.meta.host, video.url);
845
+ if (video.caption && !video.description)
846
+ video.description = video.caption;
847
+ if (!video.description)
848
+ video.description = "No description";
849
+ if (video.thumbnailUrl)
850
+ video.thumbnailUrl = resolveRelation(video.thumbnailUrl, ctx, imageResolver);
851
+ return video;
852
+ },
853
+ resolveRootNode(video, { find }) {
854
+ if (video.image && !video.thumbnailUrl) {
855
+ const firstImage = asArray(video.image)[0];
856
+ setIfEmpty(video, "thumbnailUrl", find(firstImage["@id"])?.url);
857
+ }
858
+ }
859
+ });
860
+
861
+ const movieResolver = defineSchemaOrgResolver({
862
+ defaults: {
863
+ "@type": "Movie"
864
+ },
865
+ resolve(node, ctx) {
866
+ node.aggregateRating = resolveRelation(node.aggregateRating, ctx, aggregateRatingResolver);
867
+ node.review = resolveRelation(node.review, ctx, reviewResolver);
868
+ node.director = resolveRelation(node.director, ctx, personResolver);
869
+ node.actor = resolveRelation(node.actor, ctx, personResolver);
870
+ node.trailer = resolveRelation(node.trailer, ctx, videoResolver);
871
+ if (node.dateCreated)
872
+ node.dateCreated = resolvableDateToDate(node.dateCreated);
873
+ return node;
874
+ }
875
+ });
876
+
877
+ const defaults = Object.freeze({
878
+ ignoreUnknown: false,
879
+ respectType: false,
880
+ respectFunctionNames: false,
881
+ respectFunctionProperties: false,
882
+ unorderedObjects: true,
883
+ unorderedArrays: false,
884
+ unorderedSets: false,
885
+ excludeKeys: void 0,
886
+ excludeValues: void 0,
887
+ replacer: void 0
888
+ });
889
+ function objectHash(object, options) {
890
+ if (options) {
891
+ options = { ...defaults, ...options };
892
+ } else {
893
+ options = defaults;
894
+ }
895
+ const hasher = createHasher(options);
896
+ hasher.dispatch(object);
897
+ return hasher.toString();
898
+ }
899
+ const defaultPrototypesKeys = Object.freeze([
900
+ "prototype",
901
+ "__proto__",
902
+ "constructor"
903
+ ]);
904
+ function createHasher(options) {
905
+ let buff = "";
906
+ let context = /* @__PURE__ */ new Map();
907
+ const write = (str) => {
908
+ buff += str;
909
+ };
910
+ return {
911
+ toString() {
912
+ return buff;
913
+ },
914
+ getContext() {
915
+ return context;
916
+ },
917
+ dispatch(value) {
918
+ if (options.replacer) {
919
+ value = options.replacer(value);
920
+ }
921
+ const type = value === null ? "null" : typeof value;
922
+ return this[type](value);
923
+ },
924
+ object(object) {
925
+ if (object && typeof object.toJSON === "function") {
926
+ return this.object(object.toJSON());
927
+ }
928
+ const objString = Object.prototype.toString.call(object);
929
+ let objType = "";
930
+ const objectLength = objString.length;
931
+ if (objectLength < 10) {
932
+ objType = "unknown:[" + objString + "]";
933
+ } else {
934
+ objType = objString.slice(8, objectLength - 1);
935
+ }
936
+ objType = objType.toLowerCase();
937
+ let objectNumber = null;
938
+ if ((objectNumber = context.get(object)) === void 0) {
939
+ context.set(object, context.size);
940
+ } else {
941
+ return this.dispatch("[CIRCULAR:" + objectNumber + "]");
942
+ }
943
+ if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
944
+ write("buffer:");
945
+ return write(object.toString("utf8"));
946
+ }
947
+ if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
948
+ if (this[objType]) {
949
+ this[objType](object);
950
+ } else if (!options.ignoreUnknown) {
951
+ this.unkown(object, objType);
952
+ }
953
+ } else {
954
+ let keys = Object.keys(object);
955
+ if (options.unorderedObjects) {
956
+ keys = keys.sort();
957
+ }
958
+ let extraKeys = [];
959
+ if (options.respectType !== false && !isNativeFunction(object)) {
960
+ extraKeys = defaultPrototypesKeys;
961
+ }
962
+ if (options.excludeKeys) {
963
+ keys = keys.filter((key) => {
964
+ return !options.excludeKeys(key);
965
+ });
966
+ extraKeys = extraKeys.filter((key) => {
967
+ return !options.excludeKeys(key);
968
+ });
969
+ }
970
+ write("object:" + (keys.length + extraKeys.length) + ":");
971
+ const dispatchForKey = (key) => {
972
+ this.dispatch(key);
973
+ write(":");
974
+ if (!options.excludeValues) {
975
+ this.dispatch(object[key]);
976
+ }
977
+ write(",");
978
+ };
979
+ for (const key of keys) {
980
+ dispatchForKey(key);
981
+ }
982
+ for (const key of extraKeys) {
983
+ dispatchForKey(key);
984
+ }
985
+ }
986
+ },
987
+ array(arr, unordered) {
988
+ unordered = unordered === void 0 ? options.unorderedArrays !== false : unordered;
989
+ write("array:" + arr.length + ":");
990
+ if (!unordered || arr.length <= 1) {
991
+ for (const entry of arr) {
992
+ this.dispatch(entry);
993
+ }
994
+ return;
995
+ }
996
+ const contextAdditions = /* @__PURE__ */ new Map();
997
+ const entries = arr.map((entry) => {
998
+ const hasher = createHasher(options);
999
+ hasher.dispatch(entry);
1000
+ for (const [key, value] of hasher.getContext()) {
1001
+ contextAdditions.set(key, value);
1002
+ }
1003
+ return hasher.toString();
1004
+ });
1005
+ context = contextAdditions;
1006
+ entries.sort();
1007
+ return this.array(entries, false);
1008
+ },
1009
+ date(date) {
1010
+ return write("date:" + date.toJSON());
1011
+ },
1012
+ symbol(sym) {
1013
+ return write("symbol:" + sym.toString());
1014
+ },
1015
+ unkown(value, type) {
1016
+ write(type);
1017
+ if (!value) {
1018
+ return;
1019
+ }
1020
+ write(":");
1021
+ if (value && typeof value.entries === "function") {
1022
+ return this.array(
1023
+ Array.from(value.entries()),
1024
+ true
1025
+ /* ordered */
1026
+ );
1027
+ }
1028
+ },
1029
+ error(err) {
1030
+ return write("error:" + err.toString());
1031
+ },
1032
+ boolean(bool) {
1033
+ return write("bool:" + bool);
1034
+ },
1035
+ string(string) {
1036
+ write("string:" + string.length + ":");
1037
+ write(string);
1038
+ },
1039
+ function(fn) {
1040
+ write("fn:");
1041
+ if (isNativeFunction(fn)) {
1042
+ this.dispatch("[native]");
1043
+ } else {
1044
+ this.dispatch(fn.toString());
1045
+ }
1046
+ if (options.respectFunctionNames !== false) {
1047
+ this.dispatch("function-name:" + String(fn.name));
1048
+ }
1049
+ if (options.respectFunctionProperties) {
1050
+ this.object(fn);
1051
+ }
1052
+ },
1053
+ number(number) {
1054
+ return write("number:" + number);
1055
+ },
1056
+ xml(xml) {
1057
+ return write("xml:" + xml.toString());
1058
+ },
1059
+ null() {
1060
+ return write("Null");
1061
+ },
1062
+ undefined() {
1063
+ return write("Undefined");
1064
+ },
1065
+ regexp(regex) {
1066
+ return write("regex:" + regex.toString());
1067
+ },
1068
+ uint8array(arr) {
1069
+ write("uint8array:");
1070
+ return this.dispatch(Array.prototype.slice.call(arr));
1071
+ },
1072
+ uint8clampedarray(arr) {
1073
+ write("uint8clampedarray:");
1074
+ return this.dispatch(Array.prototype.slice.call(arr));
1075
+ },
1076
+ int8array(arr) {
1077
+ write("int8array:");
1078
+ return this.dispatch(Array.prototype.slice.call(arr));
1079
+ },
1080
+ uint16array(arr) {
1081
+ write("uint16array:");
1082
+ return this.dispatch(Array.prototype.slice.call(arr));
1083
+ },
1084
+ int16array(arr) {
1085
+ write("int16array:");
1086
+ return this.dispatch(Array.prototype.slice.call(arr));
1087
+ },
1088
+ uint32array(arr) {
1089
+ write("uint32array:");
1090
+ return this.dispatch(Array.prototype.slice.call(arr));
1091
+ },
1092
+ int32array(arr) {
1093
+ write("int32array:");
1094
+ return this.dispatch(Array.prototype.slice.call(arr));
1095
+ },
1096
+ float32array(arr) {
1097
+ write("float32array:");
1098
+ return this.dispatch(Array.prototype.slice.call(arr));
1099
+ },
1100
+ float64array(arr) {
1101
+ write("float64array:");
1102
+ return this.dispatch(Array.prototype.slice.call(arr));
1103
+ },
1104
+ arraybuffer(arr) {
1105
+ write("arraybuffer:");
1106
+ return this.dispatch(new Uint8Array(arr));
1107
+ },
1108
+ url(url) {
1109
+ return write("url:" + url.toString());
1110
+ },
1111
+ map(map) {
1112
+ write("map:");
1113
+ const arr = [...map];
1114
+ return this.array(arr, options.unorderedSets !== false);
1115
+ },
1116
+ set(set) {
1117
+ write("set:");
1118
+ const arr = [...set];
1119
+ return this.array(arr, options.unorderedSets !== false);
1120
+ },
1121
+ file(file) {
1122
+ write("file:");
1123
+ return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
1124
+ },
1125
+ blob() {
1126
+ if (options.ignoreUnknown) {
1127
+ return write("[blob]");
1128
+ }
1129
+ throw new Error(
1130
+ 'Hashing Blob objects is currently not supported\nUse "options.replacer" or "options.ignoreUnknown"\n'
1131
+ );
1132
+ },
1133
+ domwindow() {
1134
+ return write("domwindow");
1135
+ },
1136
+ bigint(number) {
1137
+ return write("bigint:" + number.toString());
1138
+ },
1139
+ /* Node.js standard native objects */
1140
+ process() {
1141
+ return write("process");
1142
+ },
1143
+ timer() {
1144
+ return write("timer");
1145
+ },
1146
+ pipe() {
1147
+ return write("pipe");
1148
+ },
1149
+ tcp() {
1150
+ return write("tcp");
1151
+ },
1152
+ udp() {
1153
+ return write("udp");
1154
+ },
1155
+ tty() {
1156
+ return write("tty");
1157
+ },
1158
+ statwatcher() {
1159
+ return write("statwatcher");
1160
+ },
1161
+ securecontext() {
1162
+ return write("securecontext");
1163
+ },
1164
+ connection() {
1165
+ return write("connection");
1166
+ },
1167
+ zlib() {
1168
+ return write("zlib");
1169
+ },
1170
+ context() {
1171
+ return write("context");
1172
+ },
1173
+ nodescript() {
1174
+ return write("nodescript");
1175
+ },
1176
+ httpparser() {
1177
+ return write("httpparser");
1178
+ },
1179
+ dataview() {
1180
+ return write("dataview");
1181
+ },
1182
+ signal() {
1183
+ return write("signal");
1184
+ },
1185
+ fsevent() {
1186
+ return write("fsevent");
1187
+ },
1188
+ tlswrap() {
1189
+ return write("tlswrap");
1190
+ }
1191
+ };
1192
+ }
1193
+ const nativeFunc = "[native code] }";
1194
+ const nativeFuncLength = nativeFunc.length;
1195
+ function isNativeFunction(f) {
1196
+ if (typeof f !== "function") {
1197
+ return false;
1198
+ }
1199
+ return Function.prototype.toString.call(f).slice(-nativeFuncLength) === nativeFunc;
1200
+ }
1201
+
1202
+ class WordArray {
1203
+ constructor(words, sigBytes) {
1204
+ words = this.words = words || [];
1205
+ this.sigBytes = sigBytes === void 0 ? words.length * 4 : sigBytes;
1206
+ }
1207
+ toString(encoder) {
1208
+ return (encoder || Hex).stringify(this);
1209
+ }
1210
+ concat(wordArray) {
1211
+ this.clamp();
1212
+ if (this.sigBytes % 4) {
1213
+ for (let i = 0; i < wordArray.sigBytes; i++) {
1214
+ const thatByte = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
1215
+ this.words[this.sigBytes + i >>> 2] |= thatByte << 24 - (this.sigBytes + i) % 4 * 8;
1216
+ }
1217
+ } else {
1218
+ for (let j = 0; j < wordArray.sigBytes; j += 4) {
1219
+ this.words[this.sigBytes + j >>> 2] = wordArray.words[j >>> 2];
1220
+ }
1221
+ }
1222
+ this.sigBytes += wordArray.sigBytes;
1223
+ return this;
1224
+ }
1225
+ clamp() {
1226
+ this.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8;
1227
+ this.words.length = Math.ceil(this.sigBytes / 4);
1228
+ }
1229
+ clone() {
1230
+ return new WordArray([...this.words]);
1231
+ }
1232
+ }
1233
+ const Hex = {
1234
+ stringify(wordArray) {
1235
+ const hexChars = [];
1236
+ for (let i = 0; i < wordArray.sigBytes; i++) {
1237
+ const bite = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
1238
+ hexChars.push((bite >>> 4).toString(16), (bite & 15).toString(16));
1239
+ }
1240
+ return hexChars.join("");
1241
+ }
1242
+ };
1243
+ const Base64 = {
1244
+ stringify(wordArray) {
1245
+ const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
1246
+ const base64Chars = [];
1247
+ for (let i = 0; i < wordArray.sigBytes; i += 3) {
1248
+ const byte1 = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
1249
+ const byte2 = wordArray.words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
1250
+ const byte3 = wordArray.words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
1251
+ const triplet = byte1 << 16 | byte2 << 8 | byte3;
1252
+ for (let j = 0; j < 4 && i * 8 + j * 6 < wordArray.sigBytes * 8; j++) {
1253
+ base64Chars.push(keyStr.charAt(triplet >>> 6 * (3 - j) & 63));
1254
+ }
1255
+ }
1256
+ return base64Chars.join("");
1257
+ }
1258
+ };
1259
+ const Latin1 = {
1260
+ parse(latin1Str) {
1261
+ const latin1StrLength = latin1Str.length;
1262
+ const words = [];
1263
+ for (let i = 0; i < latin1StrLength; i++) {
1264
+ words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
1265
+ }
1266
+ return new WordArray(words, latin1StrLength);
1267
+ }
1268
+ };
1269
+ const Utf8 = {
1270
+ parse(utf8Str) {
1271
+ return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
1272
+ }
1273
+ };
1274
+ class BufferedBlockAlgorithm {
1275
+ constructor() {
1276
+ this._data = new WordArray();
1277
+ this._nDataBytes = 0;
1278
+ this._minBufferSize = 0;
1279
+ this.blockSize = 512 / 32;
1280
+ }
1281
+ reset() {
1282
+ this._data = new WordArray();
1283
+ this._nDataBytes = 0;
1284
+ }
1285
+ _append(data) {
1286
+ if (typeof data === "string") {
1287
+ data = Utf8.parse(data);
1288
+ }
1289
+ this._data.concat(data);
1290
+ this._nDataBytes += data.sigBytes;
1291
+ }
1292
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1293
+ _doProcessBlock(_dataWords, _offset) {
1294
+ }
1295
+ _process(doFlush) {
1296
+ let processedWords;
1297
+ let nBlocksReady = this._data.sigBytes / (this.blockSize * 4);
1298
+ if (doFlush) {
1299
+ nBlocksReady = Math.ceil(nBlocksReady);
1300
+ } else {
1301
+ nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
1302
+ }
1303
+ const nWordsReady = nBlocksReady * this.blockSize;
1304
+ const nBytesReady = Math.min(nWordsReady * 4, this._data.sigBytes);
1305
+ if (nWordsReady) {
1306
+ for (let offset = 0; offset < nWordsReady; offset += this.blockSize) {
1307
+ this._doProcessBlock(this._data.words, offset);
1308
+ }
1309
+ processedWords = this._data.words.splice(0, nWordsReady);
1310
+ this._data.sigBytes -= nBytesReady;
1311
+ }
1312
+ return new WordArray(processedWords, nBytesReady);
1313
+ }
1314
+ }
1315
+ class Hasher extends BufferedBlockAlgorithm {
1316
+ update(messageUpdate) {
1317
+ this._append(messageUpdate);
1318
+ this._process();
1319
+ return this;
1320
+ }
1321
+ finalize(messageUpdate) {
1322
+ if (messageUpdate) {
1323
+ this._append(messageUpdate);
1324
+ }
1325
+ }
1326
+ }
1327
+
1328
+ const H = [
1329
+ 1779033703,
1330
+ -1150833019,
1331
+ 1013904242,
1332
+ -1521486534,
1333
+ 1359893119,
1334
+ -1694144372,
1335
+ 528734635,
1336
+ 1541459225
1337
+ ];
1338
+ const K = [
1339
+ 1116352408,
1340
+ 1899447441,
1341
+ -1245643825,
1342
+ -373957723,
1343
+ 961987163,
1344
+ 1508970993,
1345
+ -1841331548,
1346
+ -1424204075,
1347
+ -670586216,
1348
+ 310598401,
1349
+ 607225278,
1350
+ 1426881987,
1351
+ 1925078388,
1352
+ -2132889090,
1353
+ -1680079193,
1354
+ -1046744716,
1355
+ -459576895,
1356
+ -272742522,
1357
+ 264347078,
1358
+ 604807628,
1359
+ 770255983,
1360
+ 1249150122,
1361
+ 1555081692,
1362
+ 1996064986,
1363
+ -1740746414,
1364
+ -1473132947,
1365
+ -1341970488,
1366
+ -1084653625,
1367
+ -958395405,
1368
+ -710438585,
1369
+ 113926993,
1370
+ 338241895,
1371
+ 666307205,
1372
+ 773529912,
1373
+ 1294757372,
1374
+ 1396182291,
1375
+ 1695183700,
1376
+ 1986661051,
1377
+ -2117940946,
1378
+ -1838011259,
1379
+ -1564481375,
1380
+ -1474664885,
1381
+ -1035236496,
1382
+ -949202525,
1383
+ -778901479,
1384
+ -694614492,
1385
+ -200395387,
1386
+ 275423344,
1387
+ 430227734,
1388
+ 506948616,
1389
+ 659060556,
1390
+ 883997877,
1391
+ 958139571,
1392
+ 1322822218,
1393
+ 1537002063,
1394
+ 1747873779,
1395
+ 1955562222,
1396
+ 2024104815,
1397
+ -2067236844,
1398
+ -1933114872,
1399
+ -1866530822,
1400
+ -1538233109,
1401
+ -1090935817,
1402
+ -965641998
1403
+ ];
1404
+ const W = [];
1405
+ class SHA256 extends Hasher {
1406
+ constructor() {
1407
+ super(...arguments);
1408
+ this._hash = new WordArray([...H]);
1409
+ }
1410
+ reset() {
1411
+ super.reset();
1412
+ this._hash = new WordArray([...H]);
1413
+ }
1414
+ _doProcessBlock(M, offset) {
1415
+ const H2 = this._hash.words;
1416
+ let a = H2[0];
1417
+ let b = H2[1];
1418
+ let c = H2[2];
1419
+ let d = H2[3];
1420
+ let e = H2[4];
1421
+ let f = H2[5];
1422
+ let g = H2[6];
1423
+ let h = H2[7];
1424
+ for (let i = 0; i < 64; i++) {
1425
+ if (i < 16) {
1426
+ W[i] = M[offset + i] | 0;
1427
+ } else {
1428
+ const gamma0x = W[i - 15];
1429
+ const gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
1430
+ const gamma1x = W[i - 2];
1431
+ const gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
1432
+ W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
1433
+ }
1434
+ const ch = e & f ^ ~e & g;
1435
+ const maj = a & b ^ a & c ^ b & c;
1436
+ const sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
1437
+ const sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
1438
+ const t1 = h + sigma1 + ch + K[i] + W[i];
1439
+ const t2 = sigma0 + maj;
1440
+ h = g;
1441
+ g = f;
1442
+ f = e;
1443
+ e = d + t1 | 0;
1444
+ d = c;
1445
+ c = b;
1446
+ b = a;
1447
+ a = t1 + t2 | 0;
1448
+ }
1449
+ H2[0] = H2[0] + a | 0;
1450
+ H2[1] = H2[1] + b | 0;
1451
+ H2[2] = H2[2] + c | 0;
1452
+ H2[3] = H2[3] + d | 0;
1453
+ H2[4] = H2[4] + e | 0;
1454
+ H2[5] = H2[5] + f | 0;
1455
+ H2[6] = H2[6] + g | 0;
1456
+ H2[7] = H2[7] + h | 0;
1457
+ }
1458
+ finalize(messageUpdate) {
1459
+ super.finalize(messageUpdate);
1460
+ const nBitsTotal = this._nDataBytes * 8;
1461
+ const nBitsLeft = this._data.sigBytes * 8;
1462
+ this._data.words[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
1463
+ this._data.words[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(
1464
+ nBitsTotal / 4294967296
1465
+ );
1466
+ this._data.words[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
1467
+ this._data.sigBytes = this._data.words.length * 4;
1468
+ this._process();
1469
+ return this._hash;
1470
+ }
1471
+ }
1472
+ function sha256base64(message) {
1473
+ return new SHA256().finalize(message).toString(Base64);
1474
+ }
1475
+
1476
+ function hash(object, options = {}) {
1477
+ const hashed = typeof object === "string" ? object : objectHash(object, options);
1478
+ return sha256base64(hashed).slice(0, 10);
1479
+ }
1480
+
1481
+ const ProductId = "#product";
1482
+ const productResolver = defineSchemaOrgResolver({
1483
+ defaults: {
1484
+ "@type": "Product"
1485
+ },
1486
+ inheritMeta: [
1487
+ "description",
1488
+ "image",
1489
+ { meta: "title", key: "name" }
1490
+ ],
1491
+ idPrefix: ["url", ProductId],
1492
+ resolve(node, ctx) {
1493
+ setIfEmpty(node, "sku", hash(node.name));
1494
+ node.aggregateOffer = resolveRelation(node.aggregateOffer, ctx, aggregateOfferResolver);
1495
+ node.aggregateRating = resolveRelation(node.aggregateRating, ctx, aggregateRatingResolver);
1496
+ node.offers = resolveRelation(node.offers, ctx, offerResolver);
1497
+ node.review = resolveRelation(node.review, ctx, reviewResolver);
1498
+ return node;
1499
+ },
1500
+ resolveRootNode(product, { find }) {
1501
+ const webPage = find(PrimaryWebPageId);
1502
+ const identity = find(IdentityId);
1503
+ if (identity)
1504
+ setIfEmpty(product, "brand", idReference(identity));
1505
+ if (webPage)
1506
+ setIfEmpty(product, "mainEntityOfPage", idReference(webPage));
1507
+ return product;
1508
+ }
1509
+ });
1510
+
1511
+ const answerResolver = defineSchemaOrgResolver({
1512
+ cast(node) {
1513
+ if (typeof node === "string") {
1514
+ return {
1515
+ text: node
1516
+ };
1517
+ }
1518
+ return node;
1519
+ },
1520
+ defaults: {
1521
+ "@type": "Answer"
1522
+ }
1523
+ });
1524
+
1525
+ const questionResolver = defineSchemaOrgResolver({
1526
+ defaults: {
1527
+ "@type": "Question"
1528
+ },
1529
+ inheritMeta: [
1530
+ "inLanguage"
1531
+ ],
1532
+ idPrefix: "url",
1533
+ resolve(question, ctx) {
1534
+ if (question.question)
1535
+ question.name = question.question;
1536
+ if (question.answer)
1537
+ question.acceptedAnswer = question.answer;
1538
+ question.acceptedAnswer = resolveRelation(question.acceptedAnswer, ctx, answerResolver);
1539
+ return question;
1540
+ },
1541
+ resolveRootNode(question, { find }) {
1542
+ const webPage = find(PrimaryWebPageId);
1543
+ if (webPage && asArray(webPage["@type"]).includes("FAQPage"))
1544
+ dedupeMerge(webPage, "mainEntity", idReference(question));
1545
+ }
1546
+ });
1547
+
1548
+ const RecipeId = "#recipe";
1549
+ const recipeResolver = defineSchemaOrgResolver({
1550
+ defaults: {
1551
+ "@type": "Recipe"
1552
+ },
1553
+ inheritMeta: [
1554
+ { meta: "title", key: "name" },
1555
+ "description",
1556
+ "image",
1557
+ "datePublished"
1558
+ ],
1559
+ idPrefix: ["url", RecipeId],
1560
+ resolve(node, ctx) {
1561
+ node.recipeInstructions = resolveRelation(node.recipeInstructions, ctx, howToStepResolver);
1562
+ return node;
1563
+ },
1564
+ resolveRootNode(node, { find }) {
1565
+ const article = find(PrimaryArticleId);
1566
+ const webPage = find(PrimaryWebPageId);
1567
+ if (article)
1568
+ setIfEmpty(node, "mainEntityOfPage", idReference(article));
1569
+ else if (webPage)
1570
+ setIfEmpty(node, "mainEntityOfPage", idReference(webPage));
1571
+ if (article?.author)
1572
+ setIfEmpty(node, "author", article.author);
1573
+ return node;
1574
+ }
1575
+ });
1576
+
1577
+ const softwareAppResolver = defineSchemaOrgResolver({
1578
+ defaults: {
1579
+ "@type": "SoftwareApplication"
1580
+ },
1581
+ resolve(node, ctx) {
1582
+ resolveDefaultType(node, "SoftwareApplication");
1583
+ node.offers = resolveRelation(node.offers, ctx, offerResolver);
1584
+ node.aggregateRating = resolveRelation(node.aggregateRating, ctx, aggregateRatingResolver);
1585
+ node.review = resolveRelation(node.review, ctx, reviewResolver);
1586
+ return node;
1587
+ }
1588
+ });
1589
+
1590
+ function loadResolver(resolver) {
1591
+ switch (resolver) {
1592
+ case "address":
1593
+ return addressResolver;
1594
+ case "aggregateOffer":
1595
+ return aggregateOfferResolver;
1596
+ case "aggregateRating":
1597
+ return aggregateRatingResolver;
1598
+ case "article":
1599
+ return articleResolver;
1600
+ case "breadcrumb":
1601
+ return breadcrumbResolver;
1602
+ case "comment":
1603
+ return commentResolver;
1604
+ case "event":
1605
+ return eventResolver;
1606
+ case "virtualLocation":
1607
+ return virtualLocationResolver;
1608
+ case "place":
1609
+ return placeResolver;
1610
+ case "howTo":
1611
+ return howToResolver;
1612
+ case "howToStep":
1613
+ return howToStepResolver;
1614
+ case "image":
1615
+ return imageResolver;
1616
+ case "localBusiness":
1617
+ return localBusinessResolver;
1618
+ case "offer":
1619
+ return offerResolver;
1620
+ case "openingHours":
1621
+ return openingHoursResolver;
1622
+ case "organization":
1623
+ return organizationResolver;
1624
+ case "person":
1625
+ return personResolver;
1626
+ case "product":
1627
+ return productResolver;
1628
+ case "question":
1629
+ return questionResolver;
1630
+ case "recipe":
1631
+ return recipeResolver;
1632
+ case "review":
1633
+ return reviewResolver;
1634
+ case "video":
1635
+ return videoResolver;
1636
+ case "webPage":
1637
+ return webPageResolver;
1638
+ case "webSite":
1639
+ return webSiteResolver;
1640
+ case "book":
1641
+ return bookResolver;
1642
+ case "course":
1643
+ return courseResolver;
1644
+ case "itemList":
1645
+ return itemListResolver;
1646
+ case "jobPosting":
1647
+ return jobPostingResolver;
1648
+ case "listItem":
1649
+ return listItemResolver;
1650
+ case "movie":
1651
+ return movieResolver;
1652
+ case "searchAction":
1653
+ return searchActionResolver;
1654
+ case "readAction":
1655
+ return readActionResolver;
1656
+ case "softwareApp":
1657
+ return softwareAppResolver;
1658
+ case "bookEdition":
1659
+ return bookEditionResolver;
1660
+ }
1661
+ return null;
1662
+ }
1663
+
1664
+ const resolver = {
1665
+ __proto__: null,
1666
+ loadResolver: loadResolver
1667
+ };
1668
+
1669
+ function resolveMeta(meta) {
1670
+ if (!meta.host && meta.canonicalHost)
1671
+ meta.host = meta.canonicalHost;
1672
+ if (!meta.tagPosition && meta.position)
1673
+ meta.tagPosition = meta.position;
1674
+ if (!meta.currency && meta.defaultCurrency)
1675
+ meta.currency = meta.defaultCurrency;
1676
+ if (!meta.inLanguage && meta.defaultLanguage)
1677
+ meta.inLanguage = meta.defaultLanguage;
1678
+ if (!meta.path)
1679
+ meta.path = "/";
1680
+ if (!meta.host && typeof document !== "undefined")
1681
+ meta.host = document.location.host;
1682
+ if (!meta.url && meta.canonicalUrl)
1683
+ meta.url = meta.canonicalUrl;
1684
+ if (meta.path !== "/") {
1685
+ if (meta.trailingSlash && !hasTrailingSlash(meta.path))
1686
+ meta.path = withTrailingSlash(meta.path);
1687
+ else if (!meta.trailingSlash && hasTrailingSlash(meta.path))
1688
+ meta.path = withoutTrailingSlash(meta.path);
1689
+ }
1690
+ meta.url = joinURL(meta.host, meta.path);
1691
+ return {
1692
+ ...meta,
1693
+ host: meta.host,
1694
+ url: meta.url,
1695
+ currency: meta.currency,
1696
+ image: meta.image,
1697
+ inLanguage: meta.inLanguage,
1698
+ title: meta.title,
1699
+ description: meta.description,
1700
+ datePublished: meta.datePublished,
1701
+ dateModified: meta.dateModified
1702
+ };
1703
+ }
1704
+ function resolveNode(node, ctx, resolver) {
1705
+ if (resolver?.cast)
1706
+ node = resolver.cast(node, ctx);
1707
+ if (resolver?.defaults) {
1708
+ let defaults = resolver.defaults || {};
1709
+ if (typeof defaults === "function")
1710
+ defaults = defaults(ctx);
1711
+ node = {
1712
+ ...defaults,
1713
+ ...node
1714
+ };
1715
+ }
1716
+ resolver.inheritMeta?.forEach((entry) => {
1717
+ if (typeof entry === "string")
1718
+ setIfEmpty(node, entry, ctx.meta[entry]);
1719
+ else
1720
+ setIfEmpty(node, entry.key, ctx.meta[entry.meta]);
1721
+ });
1722
+ if (resolver?.resolve)
1723
+ node = resolver.resolve(node, ctx);
1724
+ for (const k in node) {
1725
+ const v = node[k];
1726
+ if (typeof v === "object" && v?._resolver)
1727
+ node[k] = resolveRelation(v, ctx, v._resolver);
1728
+ }
1729
+ stripEmptyProperties(node);
1730
+ return node;
1731
+ }
1732
+ function resolveNodeId(node, ctx, resolver, resolveAsRoot = false) {
1733
+ const prefix = Array.isArray(resolver.idPrefix) ? resolver.idPrefix[0] : resolver.idPrefix;
1734
+ if (!prefix)
1735
+ return node;
1736
+ if (node["@id"] && !node["@id"].startsWith(ctx.meta.host)) {
1737
+ node["@id"] = prefixId(ctx.meta[prefix], node["@id"]);
1738
+ return node;
1739
+ }
1740
+ const rootId = Array.isArray(resolver.idPrefix) ? resolver.idPrefix?.[1] : void 0;
1741
+ if (resolveAsRoot && rootId) {
1742
+ node["@id"] = prefixId(ctx.meta[prefix], rootId);
1743
+ }
1744
+ if (!node["@id"]) {
1745
+ let alias = resolver?.alias;
1746
+ if (!alias) {
1747
+ const type = asArray(node["@type"])?.[0] || "";
1748
+ alias = type.toLowerCase();
1749
+ }
1750
+ const hashNodeData = {};
1751
+ Object.entries(node).forEach(([key, val]) => {
1752
+ if (!key.startsWith("_"))
1753
+ hashNodeData[key] = val;
1754
+ });
1755
+ node["@id"] = prefixId(ctx.meta[prefix], `#/schema/${alias}/${hashCode(JSON.stringify(hashNodeData))}`);
1756
+ }
1757
+ return node;
1758
+ }
1759
+ function resolveRelation(input, ctx, fallbackResolver, options = {}) {
1760
+ if (!input)
1761
+ return input;
1762
+ const ids = asArray(input).map((a) => {
1763
+ if (Object.keys(a).length === 1 && a["@id"])
1764
+ return a;
1765
+ let resolver = fallbackResolver;
1766
+ if (a._resolver) {
1767
+ resolver = a._resolver;
1768
+ if (typeof resolver === "string")
1769
+ resolver = loadResolver(resolver);
1770
+ delete a._resolver;
1771
+ }
1772
+ if (!resolver)
1773
+ return a;
1774
+ let node = resolveNode(a, ctx, resolver);
1775
+ if (options.afterResolve)
1776
+ options.afterResolve(node);
1777
+ if (options.generateId || options.root)
1778
+ node = resolveNodeId(node, ctx, resolver, false);
1779
+ if (options.root) {
1780
+ if (resolver.resolveRootNode)
1781
+ resolver.resolveRootNode(node, ctx);
1782
+ ctx.push(node);
1783
+ return idReference(node["@id"]);
1784
+ }
1785
+ return node;
1786
+ });
1787
+ if (!options.array && ids.length === 1)
1788
+ return ids[0];
1789
+ return ids;
1790
+ }
1791
+
1792
+ function isObject(value) {
1793
+ return value !== null && typeof value === "object";
1794
+ }
1795
+ function _defu(baseObject, defaults, namespace = ".", merger) {
1796
+ if (!isObject(defaults)) {
1797
+ return _defu(baseObject, {}, namespace, merger);
1798
+ }
1799
+ const object = Object.assign({}, defaults);
1800
+ for (const key in baseObject) {
1801
+ if (key === "__proto__" || key === "constructor") {
1802
+ continue;
1803
+ }
1804
+ const value = baseObject[key];
1805
+ if (value === null || value === void 0) {
1806
+ continue;
1807
+ }
1808
+ if (merger && merger(object, key, value, namespace)) {
1809
+ continue;
1810
+ }
1811
+ if (Array.isArray(value) && Array.isArray(object[key])) {
1812
+ object[key] = [...value, ...object[key]];
1813
+ } else if (isObject(value) && isObject(object[key])) {
1814
+ object[key] = _defu(
1815
+ value,
1816
+ object[key],
1817
+ (namespace ? `${namespace}.` : "") + key.toString(),
1818
+ merger
1819
+ );
1820
+ } else {
1821
+ object[key] = value;
1822
+ }
1823
+ }
1824
+ return object;
1825
+ }
1826
+ function createDefu(merger) {
1827
+ return (...arguments_) => (
1828
+ // eslint-disable-next-line unicorn/no-array-reduce
1829
+ arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
1830
+ );
1831
+ }
1832
+ const defu = createDefu();
1833
+
1834
+ function groupBy(array, predicate) {
1835
+ return array.reduce((acc, value, index, array2) => {
1836
+ const key = predicate(value, index, array2);
1837
+ if (!acc[key])
1838
+ acc[key] = [];
1839
+ acc[key].push(value);
1840
+ return acc;
1841
+ }, {});
1842
+ }
1843
+ function dedupeNodes(nodes) {
1844
+ const dedupedNodes = {};
1845
+ for (const key of nodes.keys()) {
1846
+ const n = nodes[key];
1847
+ const nodeKey = resolveAsGraphKey(n["@id"] || hash(n));
1848
+ if (dedupedNodes[nodeKey])
1849
+ dedupedNodes[nodeKey] = defu(nodes[key], dedupedNodes[nodeKey]);
1850
+ else
1851
+ dedupedNodes[nodeKey] = nodes[key];
1852
+ }
1853
+ return Object.values(dedupedNodes);
1854
+ }
1855
+ function normaliseNodes(nodes) {
1856
+ const sortedNodeKeys = nodes.keys();
1857
+ const dedupedNodes = {};
1858
+ for (const key of sortedNodeKeys) {
1859
+ const n = nodes[key];
1860
+ const nodeKey = resolveAsGraphKey(n["@id"] || hash(n));
1861
+ const groupedKeys = groupBy(Object.keys(n), (key2) => {
1862
+ const val = n[key2];
1863
+ if (key2.startsWith("_"))
1864
+ return "ignored";
1865
+ if (Array.isArray(val) || typeof val === "object")
1866
+ return "relations";
1867
+ return "primitives";
1868
+ });
1869
+ const keys = [
1870
+ ...(groupedKeys.primitives || []).sort(),
1871
+ ...(groupedKeys.relations || []).sort()
1872
+ ];
1873
+ let newNode = {};
1874
+ for (const key2 of keys)
1875
+ newNode[key2] = n[key2];
1876
+ if (dedupedNodes[nodeKey])
1877
+ newNode = defu(newNode, dedupedNodes[nodeKey]);
1878
+ dedupedNodes[nodeKey] = newNode;
1879
+ }
1880
+ return Object.values(dedupedNodes);
1881
+ }
1882
+
1883
+ function createSchemaOrgGraph() {
1884
+ const ctx = {
1885
+ find(id) {
1886
+ const key = resolveAsGraphKey(id);
1887
+ return ctx.nodes.filter((n) => !!n["@id"]).find((n) => resolveAsGraphKey(n["@id"]) === key);
1888
+ },
1889
+ push(input) {
1890
+ asArray(input).forEach((node) => {
1891
+ const registeredNode = node;
1892
+ ctx.nodes.push(registeredNode);
1893
+ });
1894
+ },
1895
+ resolveGraph(meta) {
1896
+ ctx.meta = resolveMeta({ ...meta });
1897
+ ctx.nodes.forEach((node, key) => {
1898
+ const resolver = node._resolver;
1899
+ if (resolver) {
1900
+ node = resolveNode(node, ctx, resolver);
1901
+ node = resolveNodeId(node, ctx, resolver, true);
1902
+ }
1903
+ ctx.nodes[key] = node;
1904
+ });
1905
+ ctx.nodes = dedupeNodes(ctx.nodes);
1906
+ ctx.nodes.forEach((node) => {
1907
+ if (node.image && typeof node.image === "string") {
1908
+ node.image = resolveRelation(node.image, ctx, imageResolver, {
1909
+ root: true
1910
+ });
1911
+ }
1912
+ if (node._resolver?.resolveRootNode)
1913
+ node._resolver.resolveRootNode(node, ctx);
1914
+ delete node._resolver;
1915
+ });
1916
+ return normaliseNodes(ctx.nodes);
1917
+ },
1918
+ nodes: [],
1919
+ meta: {}
1920
+ };
1921
+ return ctx;
1922
+ }
1923
+
1924
+ function SchemaOrgUnheadPlugin(config, meta) {
1925
+ config = resolveMeta({ ...config });
1926
+ let graph;
1927
+ const resolvedMeta = {};
1928
+ return {
1929
+ hooks: {
1930
+ "entries:resolve": function() {
1931
+ graph = createSchemaOrgGraph();
1932
+ },
1933
+ "tag:normalise": async function({ tag }) {
1934
+ if (tag.key === "schema-org-graph") {
1935
+ const { loadResolver } = await Promise.resolve().then(function () { return resolver; });
1936
+ const nodes = await tag.props.nodes;
1937
+ for (const node of Array.isArray(nodes) ? nodes : [nodes]) {
1938
+ const newNode = {
1939
+ ...node,
1940
+ _resolver: loadResolver(await node._resolver)
1941
+ };
1942
+ graph.push(newNode);
1943
+ }
1944
+ tag.tagPosition = config.tagPosition === "head" ? "head" : "bodyClose";
1945
+ }
1946
+ if (tag.tag === "title")
1947
+ resolvedMeta.title = tag.textContent;
1948
+ else if (tag.tag === "meta" && tag.props.name === "description")
1949
+ resolvedMeta.description = tag.props.content;
1950
+ else if (tag.tag === "link" && tag.props.rel === "canonical")
1951
+ resolvedMeta.url = tag.props.href;
1952
+ else if (tag.tag === "meta" && tag.props.property === "og:image")
1953
+ resolvedMeta.image = tag.props.content;
1954
+ },
1955
+ "tags:resolve": async function(ctx) {
1956
+ for (const tag of ctx.tags) {
1957
+ if (tag.tag === "script" && tag.key === "schema-org-graph") {
1958
+ tag.innerHTML = JSON.stringify({
1959
+ "@context": "https://schema.org",
1960
+ "@graph": graph.resolveGraph({ ...config, ...resolvedMeta, ...await meta() })
1961
+ }, null, 2);
1962
+ delete tag.props.nodes;
1963
+ }
1964
+ }
1965
+ }
1966
+ }
1967
+ };
1968
+ }
1969
+
1970
+ export { SchemaOrgUnheadPlugin as $, imageResolver as A, jobPostingResolver as B, listItemResolver as C, localBusinessResolver as D, movieResolver as E, offerResolver as F, openingHoursResolver as G, HowToId as H, organizationResolver as I, personResolver as J, addressResolver as K, ProductId as L, productResolver as M, questionResolver as N, ratingResolver as O, PrimaryArticleId as P, recipeResolver as Q, RecipeId as R, softwareAppResolver as S, reviewResolver as T, videoResolver as U, PrimaryWebPageId as V, webPageResolver as W, readActionResolver as X, PrimaryWebSiteId as Y, webSiteResolver as Z, searchActionResolver as _, dedupeNodes as a, resolveNode as b, createSchemaOrgGraph as c, defineSchemaOrgResolver as d, resolveNodeId as e, resolveRelation as f, aggregateOfferResolver as g, aggregateRatingResolver as h, articleResolver as i, bookEditionResolver as j, PrimaryBookId as k, bookResolver as l, PrimaryBreadcrumbId as m, normaliseNodes as n, breadcrumbResolver as o, commentResolver as p, courseResolver as q, resolveMeta as r, PrimaryEventId as s, eventResolver as t, placeResolver as u, virtualLocationResolver as v, howToResolver as w, howToStepResolver as x, howToStepDirectionResolver as y, itemListResolver as z };