@bagelink/blox 1.12.61 → 1.12.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PreviewApp-CV_Uh9-d.cjs → PreviewApp-DTES03XQ.cjs} +1 -1
- package/dist/{PreviewApp-BrthGx2F.js → PreviewApp-GXgDk2xP.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-BkGWMbsE.js → PreviewApp.vue_vue_type_style_index_0_lang-B9iqsIKI.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-CFS05Itn.cjs → PreviewApp.vue_vue_type_style_index_0_lang-Bp39MENi.cjs} +1 -1
- package/dist/{core-D1FiZJtz.cjs → core-D60gEgpD.cjs} +3 -3
- package/dist/{core-CPXNfJ-Z.js → core-Dgbxe2KR.js} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/{prerender-D3Q4jKXm.js → prerender-BZzd5T7y.js} +4 -4
- package/dist/{prerender-Bi7YtzSp.cjs → prerender-ZBDFjWPT.cjs} +4 -4
- package/dist/ssg/cli.cjs +1 -1
- package/dist/ssg/cli.mjs +1 -1
- package/dist/ssg/collection-cache.d.ts +1 -1
- package/dist/ssg/constants.d.ts +1 -1
- package/dist/ssg/constants.d.ts.map +1 -1
- package/dist/ssg/createSSREntry.d.ts.map +1 -1
- package/dist/ssg/index.cjs +4 -4
- package/dist/ssg/index.mjs +5 -5
- package/dist/ssg/render-resolved-page.d.ts +1 -1
- package/dist/ssg/render-resolved-page.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
3
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-Bp39MENi.cjs");
|
|
4
4
|
exports.default = PreviewApp_vue_vue_type_style_index_0_lang._sfc_main;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, h, provide, onMounted, onUnmounted, createElementBlock, openBlock, createVNode, unref, nextTick } from "vue";
|
|
2
|
-
import { e as BLOX_REGISTRY_KEY, u as useLocale } from "./core-
|
|
2
|
+
import { e as BLOX_REGISTRY_KEY, u as useLocale } from "./core-Dgbxe2KR.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(msg, "*");
|
|
5
5
|
}
|
|
@@ -35,7 +35,7 @@ async function getWebsiteId() {
|
|
|
35
35
|
return _websiteId;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
const websites = await request("/
|
|
38
|
+
const websites = await request("/blox/websites");
|
|
39
39
|
const website = websites.find((w) => w.name === _websiteName);
|
|
40
40
|
if (!website) throw new Error(`Website "${_websiteName}" not found. Run: npm run seed`);
|
|
41
41
|
_websiteId = website.id;
|
|
@@ -43,7 +43,7 @@ async function getWebsiteId() {
|
|
|
43
43
|
}
|
|
44
44
|
async function resolvePath(path, locale2) {
|
|
45
45
|
const websiteId = await getWebsiteId();
|
|
46
|
-
return request(`/
|
|
46
|
+
return request(`/blox/websites/${websiteId}/resolve-path`, {
|
|
47
47
|
locale: locale2,
|
|
48
48
|
params: { path }
|
|
49
49
|
});
|
|
@@ -398,7 +398,7 @@ class BloxInstance {
|
|
|
398
398
|
}
|
|
399
399
|
router.addRoute({
|
|
400
400
|
path: "/_blox_preview",
|
|
401
|
-
component: () => Promise.resolve().then(() => require("./PreviewApp-
|
|
401
|
+
component: () => Promise.resolve().then(() => require("./PreviewApp-DTES03XQ.cjs")),
|
|
402
402
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
403
403
|
});
|
|
404
404
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$1 });
|
|
@@ -34,7 +34,7 @@ async function getWebsiteId() {
|
|
|
34
34
|
return _websiteId;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
const websites = await request("/
|
|
37
|
+
const websites = await request("/blox/websites");
|
|
38
38
|
const website = websites.find((w) => w.name === _websiteName);
|
|
39
39
|
if (!website) throw new Error(`Website "${_websiteName}" not found. Run: npm run seed`);
|
|
40
40
|
_websiteId = website.id;
|
|
@@ -42,7 +42,7 @@ async function getWebsiteId() {
|
|
|
42
42
|
}
|
|
43
43
|
async function resolvePath(path, locale2) {
|
|
44
44
|
const websiteId = await getWebsiteId();
|
|
45
|
-
return request(`/
|
|
45
|
+
return request(`/blox/websites/${websiteId}/resolve-path`, {
|
|
46
46
|
locale: locale2,
|
|
47
47
|
params: { path }
|
|
48
48
|
});
|
|
@@ -397,7 +397,7 @@ class BloxInstance {
|
|
|
397
397
|
}
|
|
398
398
|
router.addRoute({
|
|
399
399
|
path: "/_blox_preview",
|
|
400
|
-
component: () => import("./PreviewApp-
|
|
400
|
+
component: () => import("./PreviewApp-GXgDk2xP.js"),
|
|
401
401
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
402
402
|
});
|
|
403
403
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$1 });
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const core = require("./core-
|
|
4
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
3
|
+
const core = require("./core-D60gEgpD.cjs");
|
|
4
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-Bp39MENi.cjs");
|
|
5
5
|
const vue = require("vue");
|
|
6
6
|
const vueRouter = require("vue-router");
|
|
7
7
|
const pinia = require("pinia");
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, c as createBlox } from "./core-
|
|
2
|
-
import { d, b, _, P, a, l, r } from "./core-
|
|
3
|
-
import { _ as _2, P as P2, s, a as a2 } from "./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { B as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, c as createBlox } from "./core-Dgbxe2KR.js";
|
|
2
|
+
import { d, b, _, P, a, l, r } from "./core-Dgbxe2KR.js";
|
|
3
|
+
import { _ as _2, P as P2, s, a as a2 } from "./PreviewApp.vue_vue_type_style_index_0_lang-B9iqsIKI.js";
|
|
4
4
|
import { inject, computed, createApp, markRaw } from "vue";
|
|
5
5
|
import { useRouter } from "vue-router";
|
|
6
6
|
import { createPinia } from "pinia";
|
|
@@ -3,24 +3,24 @@ import path from "node:path";
|
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
async function fetchCmsSiteData(apiBase, websiteName) {
|
|
6
|
-
const sitesRes = await fetch(`${apiBase}/
|
|
6
|
+
const sitesRes = await fetch(`${apiBase}/blox/websites`);
|
|
7
7
|
const sitesData = await sitesRes.json();
|
|
8
8
|
const sites = Array.isArray(sitesData) ? sitesData : sitesData.data ?? [];
|
|
9
9
|
const site = sites.find((s) => s.name === websiteName);
|
|
10
10
|
if ((site == null ? void 0 : site.id) == null || site.id === "") throw new Error(`Website "${websiteName}" not found at ${apiBase}`);
|
|
11
11
|
let website = site;
|
|
12
12
|
try {
|
|
13
|
-
const wRes = await fetch(`${apiBase}/
|
|
13
|
+
const wRes = await fetch(`${apiBase}/blox/websites/${site.id}`);
|
|
14
14
|
if (wRes.ok) website = await wRes.json();
|
|
15
15
|
} catch {
|
|
16
16
|
}
|
|
17
|
-
const pagesRes = await fetch(`${apiBase}/
|
|
17
|
+
const pagesRes = await fetch(`${apiBase}/blox/websites/${site.id}/pages?locale=${website.default_locale || "en"}`);
|
|
18
18
|
const pagesData = await pagesRes.json();
|
|
19
19
|
const pages = Array.isArray(pagesData) ? pagesData : pagesData.data ?? [];
|
|
20
20
|
const paths = await expandRoutes(apiBase, pages);
|
|
21
21
|
let redirects = [];
|
|
22
22
|
try {
|
|
23
|
-
const rRes = await fetch(`${apiBase}/
|
|
23
|
+
const rRes = await fetch(`${apiBase}/blox/websites/${site.id}/redirects`);
|
|
24
24
|
if (rRes.ok) {
|
|
25
25
|
const rData = await rRes.json();
|
|
26
26
|
const items = Array.isArray(rData) ? rData : rData.data ?? [];
|
|
@@ -26,24 +26,24 @@ const path = require("node:path");
|
|
|
26
26
|
const process = require("node:process");
|
|
27
27
|
const node_url = require("node:url");
|
|
28
28
|
async function fetchCmsSiteData(apiBase, websiteName) {
|
|
29
|
-
const sitesRes = await fetch(`${apiBase}/
|
|
29
|
+
const sitesRes = await fetch(`${apiBase}/blox/websites`);
|
|
30
30
|
const sitesData = await sitesRes.json();
|
|
31
31
|
const sites = Array.isArray(sitesData) ? sitesData : sitesData.data ?? [];
|
|
32
32
|
const site = sites.find((s) => s.name === websiteName);
|
|
33
33
|
if ((site == null ? void 0 : site.id) == null || site.id === "") throw new Error(`Website "${websiteName}" not found at ${apiBase}`);
|
|
34
34
|
let website = site;
|
|
35
35
|
try {
|
|
36
|
-
const wRes = await fetch(`${apiBase}/
|
|
36
|
+
const wRes = await fetch(`${apiBase}/blox/websites/${site.id}`);
|
|
37
37
|
if (wRes.ok) website = await wRes.json();
|
|
38
38
|
} catch {
|
|
39
39
|
}
|
|
40
|
-
const pagesRes = await fetch(`${apiBase}/
|
|
40
|
+
const pagesRes = await fetch(`${apiBase}/blox/websites/${site.id}/pages?locale=${website.default_locale || "en"}`);
|
|
41
41
|
const pagesData = await pagesRes.json();
|
|
42
42
|
const pages = Array.isArray(pagesData) ? pagesData : pagesData.data ?? [];
|
|
43
43
|
const paths = await expandRoutes(apiBase, pages);
|
|
44
44
|
let redirects = [];
|
|
45
45
|
try {
|
|
46
|
-
const rRes = await fetch(`${apiBase}/
|
|
46
|
+
const rRes = await fetch(`${apiBase}/blox/websites/${site.id}/redirects`);
|
|
47
47
|
if (rRes.ok) {
|
|
48
48
|
const rData = await rRes.json();
|
|
49
49
|
const items = Array.isArray(rData) ? rData : rData.data ?? [];
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
"use strict";
|
|
3
3
|
const process = require("node:process");
|
|
4
|
-
const prerender = require("../prerender-
|
|
4
|
+
const prerender = require("../prerender-ZBDFjWPT.cjs");
|
|
5
5
|
async function resolveApiBase(mode) {
|
|
6
6
|
if (process.env.BAGELINK_API_URL != null && process.env.BAGELINK_API_URL !== "") {
|
|
7
7
|
return { apiBase: process.env.BAGELINK_API_URL };
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-
|
|
3
|
+
import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-BZzd5T7y.js";
|
|
4
4
|
async function resolveApiBase(mode) {
|
|
5
5
|
if (process.env.BAGELINK_API_URL != null && process.env.BAGELINK_API_URL !== "") {
|
|
6
6
|
return { apiBase: process.env.BAGELINK_API_URL };
|
|
@@ -26,7 +26,7 @@ type CollectionCacheMap = Record<string, unknown[]>;
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function getCollectionCache(): CollectionCacheMap | null;
|
|
28
28
|
/**
|
|
29
|
-
* Get the pre-embedded website ID (avoids GET /
|
|
29
|
+
* Get the pre-embedded website ID (avoids GET /blox/websites on client).
|
|
30
30
|
* Returns empty string if not available.
|
|
31
31
|
*/
|
|
32
32
|
export declare function getEmbeddedWebsiteId(): string;
|
package/dist/ssg/constants.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
export declare const BLOX_STATE_WINDOW_KEY: "__BLOX_STATE__";
|
|
3
3
|
/** Global key for pre-fetched datastore collections (keyed by "store/collection"). */
|
|
4
4
|
export declare const BLOX_COLLECTIONS_WINDOW_KEY: "__BLOX_COLLECTIONS__";
|
|
5
|
-
/** Global key for the pre-resolved website ID (avoids GET /
|
|
5
|
+
/** Global key for the pre-resolved website ID (avoids GET /blox/websites on client). */
|
|
6
6
|
export declare const BLOX_WEBSITE_ID_WINDOW_KEY: "__BLOX_WEBSITE_ID__";
|
|
7
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/ssg/constants.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,EAAG,gBAAyB,CAAA;AAE9D,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAG,sBAA+B,CAAA;AAE1E,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/ssg/constants.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,EAAG,gBAAyB,CAAA;AAE9D,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAG,sBAA+B,CAAA;AAE1E,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,EAAG,qBAA8B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSSREntry.d.ts","sourceRoot":"","sources":["../../src/ssg/createSSREntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,SAAS,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO9D,MAAM,WAAW,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
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
const prerender = require("../prerender-
|
|
25
|
+
const prerender = require("../prerender-ZBDFjWPT.cjs");
|
|
26
26
|
const ssg_client = require("./client.cjs");
|
|
27
27
|
const pinia = require("pinia");
|
|
28
28
|
const vue = require("vue");
|
|
29
|
-
const core = require("../core-
|
|
29
|
+
const core = require("../core-D60gEgpD.cjs");
|
|
30
30
|
async function renderBloxSsgPage(options) {
|
|
31
31
|
const {
|
|
32
32
|
url,
|
|
@@ -85,7 +85,7 @@ function createBloxSSREntry(options) {
|
|
|
85
85
|
const apiBase = options.apiBase ?? (typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a.BAGELINK_API_URL : void 0) ?? "https://api.bagel.to";
|
|
86
86
|
async function getWebsiteId() {
|
|
87
87
|
if (_websiteId) return _websiteId;
|
|
88
|
-
const res = await fetch(`${apiBase}/
|
|
88
|
+
const res = await fetch(`${apiBase}/blox/websites`);
|
|
89
89
|
const data = await res.json();
|
|
90
90
|
const sites = Array.isArray(data) ? data : (data == null ? void 0 : data.data) ?? [];
|
|
91
91
|
const site = sites.find((s) => s.name === websiteName);
|
|
@@ -95,7 +95,7 @@ function createBloxSSREntry(options) {
|
|
|
95
95
|
}
|
|
96
96
|
async function fetchResolvedPage(urlPath) {
|
|
97
97
|
const websiteId = await getWebsiteId();
|
|
98
|
-
const url = `${apiBase}/
|
|
98
|
+
const url = `${apiBase}/blox/websites/${websiteId}/resolve-path?path=${encodeURIComponent(urlPath)}&locale=${locale}`;
|
|
99
99
|
const res = await fetch(url);
|
|
100
100
|
if (!res.ok) throw new Error(`resolve-path ${res.status}: ${urlPath}`);
|
|
101
101
|
return res.json();
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { b as buildPageHead } from "../prerender-
|
|
2
|
-
import { d, c, f, g, e, h, p, a } from "../prerender-
|
|
1
|
+
import { b as buildPageHead } from "../prerender-BZzd5T7y.js";
|
|
2
|
+
import { d, c, f, g, e, h, p, a } from "../prerender-BZzd5T7y.js";
|
|
3
3
|
import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
|
|
4
4
|
import { getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
|
6
6
|
import { createSSRApp, markRaw } from "vue";
|
|
7
|
-
import { c as createBlox } from "../core-
|
|
7
|
+
import { c as createBlox } from "../core-Dgbxe2KR.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
const {
|
|
10
10
|
url,
|
|
@@ -63,7 +63,7 @@ function createBloxSSREntry(options) {
|
|
|
63
63
|
const apiBase = options.apiBase ?? (typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a.BAGELINK_API_URL : void 0) ?? "https://api.bagel.to";
|
|
64
64
|
async function getWebsiteId() {
|
|
65
65
|
if (_websiteId) return _websiteId;
|
|
66
|
-
const res = await fetch(`${apiBase}/
|
|
66
|
+
const res = await fetch(`${apiBase}/blox/websites`);
|
|
67
67
|
const data = await res.json();
|
|
68
68
|
const sites = Array.isArray(data) ? data : (data == null ? void 0 : data.data) ?? [];
|
|
69
69
|
const site = sites.find((s) => s.name === websiteName);
|
|
@@ -73,7 +73,7 @@ function createBloxSSREntry(options) {
|
|
|
73
73
|
}
|
|
74
74
|
async function fetchResolvedPage(urlPath) {
|
|
75
75
|
const websiteId = await getWebsiteId();
|
|
76
|
-
const url = `${apiBase}/
|
|
76
|
+
const url = `${apiBase}/blox/websites/${websiteId}/resolve-path?path=${encodeURIComponent(urlPath)}&locale=${locale}`;
|
|
77
77
|
const res = await fetch(url);
|
|
78
78
|
if (!res.ok) throw new Error(`resolve-path ${res.status}: ${urlPath}`);
|
|
79
79
|
return res.json();
|
|
@@ -26,7 +26,7 @@ export declare function renderBloxSsgPage<TApp>(options: {
|
|
|
26
26
|
stateWindowKey?: string;
|
|
27
27
|
/** Website settings for SEO tags. If omitted, only state script is emitted. */
|
|
28
28
|
website?: WebsiteRead | null;
|
|
29
|
-
/** Resolved website ID — embedded so client skips GET /
|
|
29
|
+
/** Resolved website ID — embedded so client skips GET /blox/websites. */
|
|
30
30
|
websiteId?: string;
|
|
31
31
|
/** Pre-fetched datastore collections — embedded for zero-fetch hydration. */
|
|
32
32
|
collections?: Record<string, unknown[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-resolved-page.d.ts","sourceRoot":"","sources":["../../src/ssg/render-resolved-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAK/C,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE;IACtD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,OAAO,GAAG,IAAI,CAAA;IAC5B,cAAc,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9C,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,iBAAiB,CAAA;KAAE,CAAA;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC5B,
|
|
1
|
+
{"version":3,"file":"render-resolved-page.d.ts","sourceRoot":"","sources":["../../src/ssg/render-resolved-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,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