@genome-spy/app 1.1.1 → 1.3.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.
- package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
- package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
- package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
- package/dist/agentApi.es.js +6783 -5135
- package/dist/agentShared.es.js +433 -460
- package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
- package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
- package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
- package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
- package/dist/clipOptions-SrrxeAEU.js +4316 -0
- package/dist/clipOptions-clBEbkjv.js +4326 -0
- package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
- package/dist/color-uTRRsy8i.js +116 -0
- package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
- package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
- package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
- package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
- package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
- package/dist/dialog.es.js +1 -1
- package/dist/dist-CmY6iewb.js +1501 -0
- package/dist/dist-D6xbz5Ks.js +1501 -0
- package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
- package/dist/esm-BUkWqSr2.js +299 -0
- package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
- package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
- package/dist/esm-C6erfjPM.js +252 -0
- package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
- package/dist/esm-CqY5ezGz.js +1249 -0
- package/dist/esm-DfMIJ_N2.js +1522 -0
- package/dist/esm-Dls41IbZ.js +787 -0
- package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
- package/dist/esm-aGLCvYRP.js +238 -0
- package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
- package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
- package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
- package/dist/flowNode-BSjy0Wz3.js +1306 -0
- package/dist/flowOutput-D5qpxWe0.js +183 -0
- package/dist/index.es.js +4766 -5522
- package/dist/index.js +1089 -685
- package/dist/inflate-BdC5KvHn.js +886 -0
- package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
- package/dist/markUtils-RaatLEa-.js +78 -0
- package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
- package/dist/metadataUtils-DxEPe0vj.js +879 -0
- package/dist/order-BnKzKjt4.js +1151 -0
- package/dist/order-BpJnq_nV.js +1150 -0
- package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
- package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
- package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
- package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
- package/dist/rectangle-BAdoDPXu.js +194 -0
- package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
- package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
- package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
- package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
- package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
- package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
- package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
- package/dist/schema.json +33403 -16929
- package/dist/style.css +1 -1
- package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
- package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
- package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
- package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
- package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
- package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
- package/dist/url-DeOdSRrv.js +183 -0
- package/dist/viewError-B0TMfOpB.js +33 -0
- package/dist/viewError-D9aO90cI.js +33 -0
- package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
- package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
- package/dist/viewUtils-0SJOewM6.js +6195 -0
- package/dist/webgl-CXIO3OQz.js +5782 -0
- package/dist/webgl-Pdvfhio5.js +5783 -0
- package/package.json +7 -5
- package/src/agentApi/index.d.ts +3 -2
- package/src/agentShared/index.d.ts +2 -0
- package/src/appTypes.d.ts +1 -6
- package/src/embedTypes.d.ts +36 -1
- package/src/index.d.ts +6 -0
- package/src/spec/sampleView.d.ts +68 -13
- package/src/spec/view.d.ts +44 -5
- package/src/state/paramProvenanceTypes.d.ts +25 -2
- package/src/state.d.ts +14 -52
- package/dist/clipOptions-B5PibDq3.js +0 -2923
- package/dist/clipOptions-Cba4I0AO.js +0 -2903
- package/dist/esm-Dndm-NaA.js +0 -1193
- package/dist/order-B4uR9Q04.js +0 -1062
- package/dist/order-BSPy5DI8.js +0 -1062
- package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
- package/dist/vega-scale-Byaw1K8O.js +0 -2446
- package/dist/vega-scale-Ctz_wa3z.js +0 -2443
- package/dist/viewError-BiR9VCgL.js +0 -29
- package/dist/viewUtils-JX6CMEYH.js +0 -6664
- package/dist/webgl-DdmOwEH0.js +0 -5544
- package/dist/webgl-Dw8xqZpX.js +0 -5544
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rasterization-CFogVB3B.js";
|
|
2
|
-
import { t } from "./rectangle-
|
|
3
|
-
import {
|
|
4
|
-
import { t as r } from "./renderCanvas2D-
|
|
2
|
+
import { t } from "./rectangle-DZTR6NFQ.js";
|
|
3
|
+
import { n } from "./color-jETn8xK_.js";
|
|
4
|
+
import { t as r } from "./renderCanvas2D-Y7pkRzbC.js";
|
|
5
5
|
import { n as i, t as a } from "./rasterImage-B4rPLaW9.js";
|
|
6
6
|
//#region ../core/src/rendering/canvas2d/svgRasterizer.js
|
|
7
7
|
function o() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./rasterization-
|
|
2
|
-
import { t } from "./rectangle-
|
|
3
|
-
import {
|
|
4
|
-
import { t as r } from "./renderCanvas2D-
|
|
1
|
+
import { t as e } from "./rasterization-QktH8Sn2.js";
|
|
2
|
+
import { t } from "./rectangle-BAdoDPXu.js";
|
|
3
|
+
import { n } from "./color-uTRRsy8i.js";
|
|
4
|
+
import { t as r } from "./renderCanvas2D-CsRO78Pq.js";
|
|
5
5
|
import { n as i, t as a } from "./rasterImage-B4rPLaW9.js";
|
|
6
6
|
//#region ../core/src/rendering/canvas2d/svgRasterizer.js
|
|
7
7
|
function o() {
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { c as e, r as t, s as n } from "./flowOutput-D5qpxWe0.js";
|
|
2
|
+
import { c as r, i, l as a, o, r as s, s as c } from "./metadataUtils-DxEPe0vj.js";
|
|
3
|
+
//#region ../core/src/data/sources/inlineSource.js
|
|
4
|
+
function l(e) {
|
|
5
|
+
return "values" in e;
|
|
6
|
+
}
|
|
7
|
+
var u = class extends t {
|
|
8
|
+
constructor(e, t) {
|
|
9
|
+
if (super(t), this.params = e, typeof e.values == "string" && !e?.format?.type) throw Error("Data format type (csv, dsv, ...) must be specified if a string is provided!");
|
|
10
|
+
}
|
|
11
|
+
get label() {
|
|
12
|
+
return "inlineSource";
|
|
13
|
+
}
|
|
14
|
+
isTrivial() {
|
|
15
|
+
let e = this.params.values, t = Array.isArray(e) ? e[0] : e;
|
|
16
|
+
return !!(t && Object.keys(t).length == 0 && t.constructor === Object);
|
|
17
|
+
}
|
|
18
|
+
updateDynamicData(e) {
|
|
19
|
+
this.#e(e);
|
|
20
|
+
}
|
|
21
|
+
loadSynchronously() {
|
|
22
|
+
this.#e(this.params.values);
|
|
23
|
+
}
|
|
24
|
+
#e(e) {
|
|
25
|
+
let t = [], n = (e) => e;
|
|
26
|
+
if (Array.isArray(e)) e.length > 0 && (t = e, n = y(e[0]));
|
|
27
|
+
else if (typeof e == "object") t = [e];
|
|
28
|
+
else if (typeof e == "string") t = a(e, m(p(this.params)));
|
|
29
|
+
else throw Error("\"values\" in data configuration is not an array, object, or a string!");
|
|
30
|
+
this.reset(), this.beginBatch({ type: "file" });
|
|
31
|
+
for (let e of t) this._propagate(n(e));
|
|
32
|
+
this.complete();
|
|
33
|
+
}
|
|
34
|
+
async load() {
|
|
35
|
+
this.loadSynchronously();
|
|
36
|
+
}
|
|
37
|
+
}, d = /* @__PURE__ */ new Set([
|
|
38
|
+
"csv",
|
|
39
|
+
"tsv",
|
|
40
|
+
"dsv"
|
|
41
|
+
]), f = /* @__PURE__ */ new Set([
|
|
42
|
+
"gz",
|
|
43
|
+
"bgz",
|
|
44
|
+
"bgzf"
|
|
45
|
+
]);
|
|
46
|
+
function p(e, t = []) {
|
|
47
|
+
if (!l(e) && !w(e)) return;
|
|
48
|
+
let n = { ...e.format };
|
|
49
|
+
if (n.type ??= w(e) && g(t), n.parse === void 0 && T(n.type) && (n.parse = "auto"), !n.type) throw Error("Format for the data source was not defined and it could not be inferred: " + JSON.stringify(e));
|
|
50
|
+
return n;
|
|
51
|
+
}
|
|
52
|
+
function m(e) {
|
|
53
|
+
let t = { ...e };
|
|
54
|
+
return (S(t) || C(t)) && t.columns && !("header" in t) && (t.header = t.columns), t;
|
|
55
|
+
}
|
|
56
|
+
function h(e) {
|
|
57
|
+
return r(e)?.responseType ?? "text";
|
|
58
|
+
}
|
|
59
|
+
function g(e) {
|
|
60
|
+
if (Array.isArray(e) && (e = e[0]), e) {
|
|
61
|
+
let t = v(e).split("/").pop()?.toLowerCase();
|
|
62
|
+
if (!t) return;
|
|
63
|
+
let n = t.split(".");
|
|
64
|
+
for (; n.length > 1 && f.has(n.at(-1));) n.pop();
|
|
65
|
+
let i = n.at(-1);
|
|
66
|
+
if (i && r(i)) return i;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function _(e) {
|
|
70
|
+
let t = v(e).split("/").pop()?.toLowerCase();
|
|
71
|
+
if (!t) return !1;
|
|
72
|
+
let n = t.split(".").at(-1);
|
|
73
|
+
return !!n && f.has(n);
|
|
74
|
+
}
|
|
75
|
+
function v(e) {
|
|
76
|
+
return e.replace(/[?#].*$/, "");
|
|
77
|
+
}
|
|
78
|
+
var y = (e) => typeof e == "object" ? x : b, b = (e) => ({ data: e }), x = (e) => e;
|
|
79
|
+
function S(e) {
|
|
80
|
+
return e.type == "csv" || e.type == "tsv";
|
|
81
|
+
}
|
|
82
|
+
function C(e) {
|
|
83
|
+
return e.type == "dsv";
|
|
84
|
+
}
|
|
85
|
+
function w(e) {
|
|
86
|
+
return "url" in e;
|
|
87
|
+
}
|
|
88
|
+
function T(e) {
|
|
89
|
+
return d.has(e);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/sampleView/metadata/metadataValidation.js
|
|
93
|
+
function E(e, t) {
|
|
94
|
+
let n = /* @__PURE__ */ new Map();
|
|
95
|
+
function r(e, t = 1, r = null) {
|
|
96
|
+
let i = n.get(e);
|
|
97
|
+
i || (i = {
|
|
98
|
+
message: e,
|
|
99
|
+
count: 0,
|
|
100
|
+
cases: []
|
|
101
|
+
}, n.set(e, i)), i.count += t, r && i.cases.push(r);
|
|
102
|
+
}
|
|
103
|
+
let i = new Set(e), a = /* @__PURE__ */ new Set();
|
|
104
|
+
for (let e of t) {
|
|
105
|
+
if (!("sample" in e)) {
|
|
106
|
+
r(D);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (e.sample == null || e.sample === "") {
|
|
110
|
+
r(O);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
let t = String(e.sample);
|
|
114
|
+
a.has(t) && r(k, 1, t), a.add(t);
|
|
115
|
+
}
|
|
116
|
+
return a.size === 0 && r(A), n.size > 0 ? { error: Array.from(n.values()) } : { statistics: {
|
|
117
|
+
unknownSamples: a.difference(i),
|
|
118
|
+
notCoveredSamples: i.difference(a),
|
|
119
|
+
samplesInBoth: a.intersection(i)
|
|
120
|
+
} };
|
|
121
|
+
}
|
|
122
|
+
var D = "Missing sample field in metadata record", O = "Empty sample field in metadata record", k = "Duplicate sample IDs found in metadata", A = "No valid samples found in metadata";
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/sampleView/metadata/metadataSourceAttributes.js
|
|
125
|
+
function j(e, t) {
|
|
126
|
+
return t ? s(e, t, "/") : o([e], "/");
|
|
127
|
+
}
|
|
128
|
+
function M(e, t) {
|
|
129
|
+
let n = e.attributes;
|
|
130
|
+
if (!n) return {};
|
|
131
|
+
let r = e.attributeGroupSeparator, i = /* @__PURE__ */ new Set();
|
|
132
|
+
for (let e of t) {
|
|
133
|
+
let t = j(e, r), n = c(t, "/");
|
|
134
|
+
for (let e = 1; e <= n.length; e++) i.add(o(n.slice(0, e), "/"));
|
|
135
|
+
}
|
|
136
|
+
i.add("");
|
|
137
|
+
let a = {}, s = /* @__PURE__ */ new Map();
|
|
138
|
+
for (let [e, t] of Object.entries(n)) {
|
|
139
|
+
let n = j(e, r);
|
|
140
|
+
if (!i.has(n)) continue;
|
|
141
|
+
let o = s.get(n);
|
|
142
|
+
if (o) throw Error("Metadata source attributes has conflicting keys \"" + o + "\" and \"" + e + "\" that both resolve to \"" + n + "\".");
|
|
143
|
+
s.set(n, e), a[n] = { ...t };
|
|
144
|
+
}
|
|
145
|
+
return a;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region ../core/src/utils/topK.js
|
|
149
|
+
function N(e, t, r = (e) => +e, i = 0, a = e.length) {
|
|
150
|
+
let o = a - i;
|
|
151
|
+
if (t <= 0 || o <= 0) return [];
|
|
152
|
+
let s = new n(), c = 0;
|
|
153
|
+
for (; c < t && c < o; c++) s.push(c, r(e[i + c]));
|
|
154
|
+
for (; c < o; c++) {
|
|
155
|
+
let t = r(e[i + c]);
|
|
156
|
+
t > s.peekValue() && (s.push(c, t), s.pop());
|
|
157
|
+
}
|
|
158
|
+
let l = s.peekValue(), u = [], d = 0, f = 0;
|
|
159
|
+
for (c = 0; c < o; c++) r(e[i + c]) > l && d++;
|
|
160
|
+
let p = t - d;
|
|
161
|
+
for (c = 0; c < o; c++) {
|
|
162
|
+
let t = r(e[i + c]);
|
|
163
|
+
(t > l || t === l && f++ < p) && u.push(c);
|
|
164
|
+
}
|
|
165
|
+
return u.sort((t, n) => {
|
|
166
|
+
let a = r(e[i + t]), o = r(e[i + n]);
|
|
167
|
+
return a > o ? -1 : a < o ? 1 : t - n;
|
|
168
|
+
}), u.map((t) => e[i + t]);
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/sampleView/metadata/exampleValues.js
|
|
172
|
+
function P(e, t) {
|
|
173
|
+
return N(e.map((e) => String(e ?? "").trim()).filter(Boolean), t, F);
|
|
174
|
+
}
|
|
175
|
+
function F(e) {
|
|
176
|
+
let t = 2166136261;
|
|
177
|
+
for (let n = 0; n < e.length; n += 1) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
178
|
+
return t >>> 0;
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/sampleView/metadata/adapters/tableMetadataSourceAdapter.js
|
|
182
|
+
var I = class {
|
|
183
|
+
#e;
|
|
184
|
+
#t;
|
|
185
|
+
#n;
|
|
186
|
+
#r;
|
|
187
|
+
#i;
|
|
188
|
+
constructor(e, t = {}) {
|
|
189
|
+
this.#e = e, this.#t = t.sampleIdField ?? (e.backend.backend === "data" ? e.backend.sampleIdField ?? "sample" : "sample"), this.#n = t.baseUrl, this.#i = /* @__PURE__ */ new Set([
|
|
190
|
+
this.#t,
|
|
191
|
+
...t.excludedColumns ?? [],
|
|
192
|
+
...e.excludeColumns ?? []
|
|
193
|
+
]);
|
|
194
|
+
}
|
|
195
|
+
async listColumns(e) {
|
|
196
|
+
let t = await this.#a(e), n = this.#t, r = /* @__PURE__ */ new Set();
|
|
197
|
+
for (let e of t) for (let t of Object.keys(e)) t !== n && (this.#c(t) || r.add(t));
|
|
198
|
+
return Array.from(r).map((e) => ({ id: e }));
|
|
199
|
+
}
|
|
200
|
+
async listSampleIds(e) {
|
|
201
|
+
return (await this.#a(e)).map((e) => String(e[this.#t] ?? ""));
|
|
202
|
+
}
|
|
203
|
+
async listSamples(e = {}, t) {
|
|
204
|
+
let n = await this.#a(t), r = this.#t;
|
|
205
|
+
return n.map((t) => {
|
|
206
|
+
let n = String(t[r] ?? ""), i = e.displayNameField ? t[e.displayNameField] : void 0;
|
|
207
|
+
return {
|
|
208
|
+
id: n,
|
|
209
|
+
displayName: i == null ? n : String(i)
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async listIdentifierExamples(e, t) {
|
|
214
|
+
return [{
|
|
215
|
+
name: "column",
|
|
216
|
+
primary: !0,
|
|
217
|
+
examples: P((await this.listColumns(t)).map((e) => e.id), e)
|
|
218
|
+
}];
|
|
219
|
+
}
|
|
220
|
+
async resolveColumns(e, t) {
|
|
221
|
+
let n = await this.listColumns(t), r = new Set(n.map((e) => e.id)), i = [], a = /* @__PURE__ */ new Set();
|
|
222
|
+
for (let t of e) r.has(t) ? i.includes(t) || i.push(t) : a.add(t);
|
|
223
|
+
return {
|
|
224
|
+
columnIds: i,
|
|
225
|
+
missing: Array.from(a)
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
async fetchColumns(e, t) {
|
|
229
|
+
let n = await this.#a(t), r = this.#t, a = new Set(e.sampleIds);
|
|
230
|
+
for (let t of e.columnIds) if (this.#c(t)) throw Error("Column \"" + t + "\" is excluded by metadata source configuration.");
|
|
231
|
+
let o = [];
|
|
232
|
+
for (let t of n) {
|
|
233
|
+
let n = String(t[r] ?? "");
|
|
234
|
+
if (!a.has(n)) continue;
|
|
235
|
+
let i = { sample: n };
|
|
236
|
+
for (let n of e.columnIds) i[n] = t[n];
|
|
237
|
+
o.push(i);
|
|
238
|
+
}
|
|
239
|
+
if (o.length === 0) throw Error("Metadata source rows do not match any sample ids in the current view.");
|
|
240
|
+
let s = E(e.sampleIds, o);
|
|
241
|
+
if ("error" in s) {
|
|
242
|
+
let e = s.error[0];
|
|
243
|
+
throw Error("Invalid metadata source payload: " + String(e.message));
|
|
244
|
+
}
|
|
245
|
+
if (s.statistics.samplesInBoth.size === 0) throw Error("Metadata source rows do not match any sample ids in the current view.");
|
|
246
|
+
let c = M(this.#e, e.columnIds), l = e.groupPath ?? this.#e.groupPath, u = i(o, c, this.#e.attributeGroupSeparator, l);
|
|
247
|
+
return e.replace !== void 0 && (u.replace = e.replace), u;
|
|
248
|
+
}
|
|
249
|
+
async #a(e) {
|
|
250
|
+
return this.#r ||= this.loadRows(e).catch((e) => {
|
|
251
|
+
throw this.#r = void 0, e;
|
|
252
|
+
}), this.#r;
|
|
253
|
+
}
|
|
254
|
+
async loadRows(e) {
|
|
255
|
+
let t = this.#e.backend;
|
|
256
|
+
if (t.backend !== "data") throw Error("Table metadata loading requires a data backend.");
|
|
257
|
+
let n = t.data;
|
|
258
|
+
if ("url" in n) return this.#o(n, e);
|
|
259
|
+
if ("values" in n) return this.#s(n);
|
|
260
|
+
throw Error("Metadata source data backend supports only UrlData and InlineData.");
|
|
261
|
+
}
|
|
262
|
+
async #o(t, n) {
|
|
263
|
+
if (typeof t.url != "string") throw Error("Metadata source UrlData currently supports only string URLs.");
|
|
264
|
+
let r = e(this.#n, t.url), i = p(t, r), o = h(i.type), s;
|
|
265
|
+
try {
|
|
266
|
+
s = await fetch(r, { signal: n });
|
|
267
|
+
} catch (e) {
|
|
268
|
+
throw Error("Could not load metadata source: " + e.message, { cause: e });
|
|
269
|
+
}
|
|
270
|
+
if (!s.ok) throw Error("Could not load metadata source: " + s.status + " " + s.statusText);
|
|
271
|
+
let c;
|
|
272
|
+
return c = typeof s[o] == "function" ? await s[o]() : await s.text(), a(c, m(i));
|
|
273
|
+
}
|
|
274
|
+
async #s(e) {
|
|
275
|
+
let t = e.values, n = [];
|
|
276
|
+
if (Array.isArray(t)) {
|
|
277
|
+
if (t.length > 0) {
|
|
278
|
+
let e = y(t[0]);
|
|
279
|
+
n = t.map((t) => e(t));
|
|
280
|
+
}
|
|
281
|
+
} else if (typeof t == "object") n = [t];
|
|
282
|
+
else if (typeof t == "string") n = a(t, m(p(e)));
|
|
283
|
+
else throw Error("Inline metadata source values must be an array, object, or a string.");
|
|
284
|
+
return n;
|
|
285
|
+
}
|
|
286
|
+
#c(e) {
|
|
287
|
+
return this.#i.has(e);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
//#endregion
|
|
291
|
+
export { E as a, y as c, u as d, l as f, M as i, h as l, P as n, p as o, N as r, _ as s, I as t, m as u };
|