@qaecy/cue-sdk 0.0.38 → 0.0.39

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.
@@ -1,14 +1,14 @@
1
1
  import { getApps as Me, initializeApp as qe } from "firebase/app";
2
- import { ref as k, getDownloadURL as tt, getMetadata as z, getBlob as _e, updateMetadata as ze, uploadBytesResumable as Et, uploadBytes as ht, StringFormat as Fe, uploadString as Be, listAll as F, getStorage as S, connectStorageEmulator as B } from "firebase/storage";
2
+ import { ref as k, getDownloadURL as tt, getMetadata as z, getBlob as Ee, updateMetadata as ze, uploadBytesResumable as Tt, uploadBytes as ht, StringFormat as Fe, uploadString as Be, listAll as F, getStorage as S, connectStorageEmulator as B } from "firebase/storage";
3
3
  import { Writer as Ge, DataFactory as M } from "n3";
4
4
  import { getFirestore as He, connectFirestoreEmulator as We, doc as Ve, setDoc as Xe, serverTimestamp as Qe, increment as Ke } from "firebase/firestore";
5
- import { getAuth as Ye, connectAuthEmulator as Je, onIdTokenChanged as Ze, getIdTokenResult as K, signInWithEmailAndPassword as to, GoogleAuthProvider as dt, OAuthProvider as ut, signInWithPopup as eo, signInWithRedirect as oo, getRedirectResult as ro, signInWithCustomToken as Tt, signOut as so, onAuthStateChanged as ao, fetchSignInMethodsForEmail as io, linkWithPopup as no, unlink as po, reauthenticateWithCredential as kt, EmailAuthProvider as et, updatePassword as co, linkWithCredential as lo, verifyBeforeUpdateEmail as ho, sendEmailVerification as uo } from "firebase/auth";
5
+ import { getAuth as Ye, connectAuthEmulator as Je, onIdTokenChanged as Ze, getIdTokenResult as K, signInWithEmailAndPassword as to, GoogleAuthProvider as dt, OAuthProvider as ut, signInWithPopup as eo, signInWithRedirect as oo, getRedirectResult as ro, signInWithCustomToken as kt, signOut as so, onAuthStateChanged as ao, fetchSignInMethodsForEmail as io, linkWithPopup as no, unlink as po, reauthenticateWithCredential as St, EmailAuthProvider as et, updatePassword as co, linkWithCredential as lo, verifyBeforeUpdateEmail as ho, sendEmailVerification as uo } from "firebase/auth";
6
6
  import { Client as go } from "@modelcontextprotocol/sdk/client/index.js";
7
7
  import { StreamableHTTPClientTransport as mo } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
8
8
  import { getFunctions as wo, connectFunctionsEmulator as fo, httpsCallable as yo } from "firebase/functions";
9
9
  import { v5 as bo } from "uuid";
10
10
  import "spark-md5";
11
- class ft {
11
+ class yt {
12
12
  queryEndpoint;
13
13
  updateEndpoint;
14
14
  baseHeaders;
@@ -20,7 +20,7 @@ class ft {
20
20
  constructor(t) {
21
21
  this.queryEndpoint = t.queryEndpoint, this.updateEndpoint = t.updateEndpoint, this.baseHeaders = Object.fromEntries(
22
22
  Object.entries(t.originalHeaders || {}).filter(
23
- ([e]) => ft.RELEVANT_HEADER_KEYS.includes(e)
23
+ ([e]) => yt.RELEVANT_HEADER_KEYS.includes(e)
24
24
  )
25
25
  ), t.authHeader !== void 0 && (this.baseHeaders.Authorization = t.authHeader);
26
26
  }
@@ -84,7 +84,7 @@ class ft {
84
84
  }
85
85
  }
86
86
  const vo = [423, 429, 503];
87
- class Ee extends Error {
87
+ class Te extends Error {
88
88
  constructor(t, e, o) {
89
89
  super(`QLever throttled the request (HTTP ${e}): ${t}`), this.status = e, this.retryAfterSeconds = o, this.name = "QLeverThrottledError";
90
90
  }
@@ -102,7 +102,7 @@ function _o(s) {
102
102
  async function G(s) {
103
103
  const t = await s.text();
104
104
  if (vo.includes(s.status))
105
- throw new Ee(t, s.status, _o(s));
105
+ throw new Te(t, s.status, _o(s));
106
106
  return t;
107
107
  }
108
108
  class R {
@@ -154,7 +154,7 @@ class R {
154
154
  try {
155
155
  return await t();
156
156
  } catch (i) {
157
- if (r = i, i instanceof Ee && a < e) {
157
+ if (r = i, i instanceof Te && a < e) {
158
158
  const n = i.retryAfterSeconds !== void 0 ? i.retryAfterSeconds * 1e3 : void 0, p = Math.min(
159
159
  n ?? o * Math.pow(2, a),
160
160
  R.LOCKED_MAX_DELAY_MS
@@ -290,7 +290,7 @@ class R {
290
290
  } : {
291
291
  method: "POST",
292
292
  headers: o,
293
- body: await So(Buffer.from(await Te(t), "utf-8"))
293
+ body: await So(Buffer.from(await ke(t), "utf-8"))
294
294
  }, a = await fetch(e, r);
295
295
  if (!a.ok) {
296
296
  const i = await G(a);
@@ -299,7 +299,7 @@ class R {
299
299
  });
300
300
  }
301
301
  }
302
- function Te(s) {
302
+ function ke(s) {
303
303
  return new Promise((t, e) => {
304
304
  const o = new Ge({ format: "application/n-quads" });
305
305
  o.addQuads(s), o.end((r, a) => r ? e(r) : t(a));
@@ -316,7 +316,7 @@ function To(s) {
316
316
  return;
317
317
  }
318
318
  const r = s.slice(e, e + Eo);
319
- e += r.length, o.enqueue(t.encode(await Te(r)));
319
+ e += r.length, o.enqueue(t.encode(await ke(r)));
320
320
  }
321
321
  });
322
322
  }
@@ -362,7 +362,7 @@ class Io {
362
362
  this._db = new R(this.options);
363
363
  break;
364
364
  case "fuseki":
365
- this._db = new ft(this.options);
365
+ this._db = new yt(this.options);
366
366
  break;
367
367
  default:
368
368
  throw new Error(`Unsupported graph type: ${this.options.graphType}`);
@@ -410,7 +410,7 @@ class Io {
410
410
  return this.options.graphType === "qlever" ? this._db.deleteData(t) : Promise.reject(new Error("deleteData not supported for Fuseki — use update() with SPARQL DELETE DATA"));
411
411
  }
412
412
  }
413
- class St {
413
+ class It {
414
414
  constructor(t) {
415
415
  this.options = t;
416
416
  }
@@ -470,7 +470,7 @@ class St {
470
470
  async getFile(t, e) {
471
471
  const o = k(this._bucket(t), e);
472
472
  try {
473
- return await _e(o);
473
+ return await Ee(o);
474
474
  } catch (r) {
475
475
  if (r?.code === "storage/object-not-found") return;
476
476
  throw r;
@@ -537,7 +537,7 @@ class St {
537
537
  * upload progress needs to be surfaced in the UI.
538
538
  */
539
539
  uploadResumable(t, e, o, r) {
540
- const a = k(this._bucket(t), e), i = Et(a, o, r ? { customMetadata: r } : void 0);
540
+ const a = k(this._bucket(t), e), i = Tt(a, o, r ? { customMetadata: r } : void 0);
541
541
  return {
542
542
  complete: () => new Promise((n, p) => i.then(() => n(), p)),
543
543
  pause: () => i.pause(),
@@ -613,7 +613,7 @@ class St {
613
613
  d(new DOMException("Upload cancelled", "AbortError"));
614
614
  return;
615
615
  }
616
- const u = Et(n, e, { customMetadata: o }), m = () => {
616
+ const u = Tt(n, e, { customMetadata: o }), m = () => {
617
617
  u.cancel(), d(new DOMException("Upload cancelled", "AbortError"));
618
618
  };
619
619
  a?.addEventListener("abort", m, { once: !0 }), u.on(
@@ -675,7 +675,7 @@ class E {
675
675
  return this;
676
676
  }
677
677
  }
678
- function yt(s, t) {
678
+ function bt(s, t) {
679
679
  const e = /* @__PURE__ */ new Set();
680
680
  let o = t(), r = !1;
681
681
  const a = [], i = () => {
@@ -701,8 +701,8 @@ const ot = {
701
701
  apiKey: "AIzaSyAiW42QBx9HS4Khu88pCW7MV66IhBAQul0",
702
702
  appId: "1:151132927589:web:d2ffdb377dfadfd23ab88c",
703
703
  measurementId: "G-YT4PK6HGZD"
704
- }, It = "qaecy-mvp-406413", Co = "734737865998", xo = "europe-west6", Ct = "sessions_eu_west6", xt = "spaces_chats_eu_west6", Rt = "spaces_raw_eu_west6", At = "spaces_processed_eu_west6", Ot = "logs_eu_west6", Pt = "cue_public_eu_west6", Dt = "db_persistence_eu_west6", Ro = "/data-views/admin/consumption", Ao = "/data-views/admin/profile/organizations", $t = "/data-views/admin/profile/api-keys", Nt = "/commands/admin/profile/api-keys", Oo = "/commands/admin/profile/terms", Po = "/commands/admin/profile/analytics-notice", Do = "/commands/admin/usage/view", $o = (s) => `/data-views/admin/organizations/${s}/members`, No = (s) => `/data-views/admin/organizations/${s}/admins`, jt = (s) => `/data-views/admin/organizations/${s}/credits`, jo = (s) => `/data-views/admin/organizations/${s}/credits/report`, Lo = (s, t) => `/data-views/admin/organizations/${s}/credits/report/${t}/by-file-type`, Uo = (s, t) => `/data-views/admin/organizations/${s}/traffic/report/${t}`, Mo = (s, t) => `/data-views/admin/organizations/${s}/usage/report/${t}`, qo = "/commands/admin/user/signup", zo = "/commands/admin/user/signup/resend", Fo = "/commands/admin/user/settings", Bo = "/data-views/admin/users/settings", Go = "/commands/admin/organization/signup", Ho = (s) => `/commands/admin/organization/${s}/credits`, Wo = (s) => `/commands/admin/organization/${s}/plan`, Vo = (s) => `/commands/admin/organization/${s}/checkout`, Xo = (s) => `/commands/admin/organization/${s}/billing-portal`, Qo = (s) => `/commands/admin/organization/${s}/members`, Ko = (s, t) => `/commands/admin/organization/${s}/members/${t}/role`, Yo = (s, t) => `/commands/admin/organization/${s}/members/${t}`, Lt = "/data-views/admin/projects", Jo = "/data-views/admin/organizations", Zo = "/data-views/admin/organizations/search", tr = (s) => `/data-views/admin/organizations/${s}/projects`, er = "/data-views/admin/projects/search", or = "/data-views/admin/users/search", rr = (s) => `/data-views/admin/users/${s}/detail`, sr = "/data-views/admin/users/superadmins", ar = "/data-views/admin/users/deleted", ir = (s) => `/commands/admin/user/${s}`, nr = (s) => `/commands/admin/user/${s}/restore`, Ut = (s) => `/commands/admin/user/${s}/superadmin`, pr = "/commands/admin/user", cr = "/commands/admin/organization", lr = (s) => `/commands/admin/organization/${s}`, hr = (s) => `/commands/admin/organization/${s}/restore`, dr = (s) => `/commands/admin/organization/${s}/domains`, ur = "/data-views/admin/organizations/deleted", gr = "/data-views/admin/users/without-org", mr = "/data-views/admin/users/without-project", wr = "/data-views/admin/projects/without-users", fr = "/data-views/admin/projects/without-admins", yr = "/data-views/admin/organizations/without-users", br = "/data-views/admin/organizations/without-admins", vr = "/commands/admin/project", _r = (s) => `/commands/admin/project/${s}`, Er = (s) => `/commands/admin/project/${s}/restore`, Tr = (s) => `/commands/admin/project/${s}/members`, kr = (s, t) => `/commands/admin/project/${s}/members/${t}/role`, Sr = (s, t) => `/commands/admin/project/${s}/members/${t}`, Ir = (s) => `/data-views/admin/projects/${s}/metadata`, Cr = (s) => `/commands/admin/project/${s}/metadata`, xr = "/assistant/search", Rr = "/mcp", Ar = "/index/search", Or = "/index/lookup", Pr = "/index/available-filters", ke = "/triplestore/query", Dr = "/triplestore/update", $r = "/triplestore/shacl", Se = "/qlever-server/qlever/query", Nr = "/qlever-server/qlever/update", jr = "/qlever-server/qlever/shacl", Lr = "/qlever-server/qlever/admin/rebuild", Ur = "/qlever-server/admin/stats/refresh", Mt = "/commands/file-system-structure/batch", Mr = "/commands/dms-sync/providers", qr = (s) => `/commands/dms-sync/${s}/preview`, zr = (s) => `/commands/dms-sync/${s}/sync`, Fr = "/storage/sessions", Br = "/storage/raw", Ie = "/storage/processed", Gr = "/data-views/processing-status", Hr = "/data-views/processing-status/mine", qt = "microsoft.com", zt = "superadmin", bt = "https://cue.qaecy.com/r/";
705
- class Ft {
704
+ }, Ct = "qaecy-mvp-406413", Co = "734737865998", xo = "europe-west6", xt = "sessions_eu_west6", Rt = "spaces_chats_eu_west6", At = "spaces_raw_eu_west6", Ot = "spaces_processed_eu_west6", Pt = "logs_eu_west6", Dt = "cue_public_eu_west6", $t = "db_persistence_eu_west6", Ro = "/data-views/admin/consumption", Ao = "/data-views/admin/profile/organizations", Nt = "/data-views/admin/profile/api-keys", jt = "/commands/admin/profile/api-keys", Oo = "/commands/admin/profile/terms", Po = "/commands/admin/profile/analytics-notice", Do = "/commands/admin/usage/view", $o = (s) => `/data-views/admin/organizations/${s}/members`, No = (s) => `/data-views/admin/organizations/${s}/admins`, Lt = (s) => `/data-views/admin/organizations/${s}/credits`, jo = (s) => `/data-views/admin/organizations/${s}/credits/report`, Lo = (s, t) => `/data-views/admin/organizations/${s}/credits/report/${t}/by-file-type`, Uo = (s, t) => `/data-views/admin/organizations/${s}/traffic/report/${t}`, Mo = (s, t) => `/data-views/admin/organizations/${s}/usage/report/${t}`, qo = "/commands/admin/user/signup", zo = "/commands/admin/user/signup/resend", Fo = "/commands/admin/user/settings", Bo = "/data-views/admin/users/settings", Go = "/commands/admin/organization/signup", Ho = (s) => `/commands/admin/organization/${s}/credits`, Wo = (s) => `/commands/admin/organization/${s}/plan`, Vo = (s) => `/commands/admin/organization/${s}/checkout`, Xo = (s) => `/commands/admin/organization/${s}/billing-portal`, Qo = (s) => `/commands/admin/organization/${s}/members`, Ko = (s, t) => `/commands/admin/organization/${s}/members/${t}/role`, Yo = (s, t) => `/commands/admin/organization/${s}/members/${t}`, Ut = "/data-views/admin/projects", Jo = "/data-views/admin/organizations", Zo = "/data-views/admin/organizations/search", tr = (s) => `/data-views/admin/organizations/${s}/projects`, er = "/data-views/admin/projects/search", or = "/data-views/admin/users/search", rr = (s) => `/data-views/admin/users/${s}/detail`, sr = "/data-views/admin/users/superadmins", ar = "/data-views/admin/users/deleted", ir = (s) => `/commands/admin/user/${s}`, nr = (s) => `/commands/admin/user/${s}/restore`, Mt = (s) => `/commands/admin/user/${s}/superadmin`, pr = "/commands/admin/user", cr = "/commands/admin/organization", lr = (s) => `/commands/admin/organization/${s}`, hr = (s) => `/commands/admin/organization/${s}/restore`, dr = (s) => `/commands/admin/organization/${s}/domains`, ur = "/data-views/admin/organizations/deleted", gr = "/data-views/admin/users/without-org", mr = "/data-views/admin/users/without-project", wr = "/data-views/admin/projects/without-users", fr = "/data-views/admin/projects/without-admins", yr = "/data-views/admin/organizations/without-users", br = "/data-views/admin/organizations/without-admins", vr = "/commands/admin/project", _r = (s) => `/commands/admin/project/${s}`, Er = (s) => `/commands/admin/project/${s}/restore`, Tr = (s) => `/commands/admin/project/${s}/members`, kr = (s, t) => `/commands/admin/project/${s}/members/${t}/role`, Sr = (s, t) => `/commands/admin/project/${s}/members/${t}`, Ir = (s) => `/data-views/admin/projects/${s}/metadata`, Cr = (s) => `/commands/admin/project/${s}/metadata`, xr = "/assistant/search", Rr = "/mcp", Ar = "/index/search", Or = "/index/lookup", Pr = "/index/available-filters", Se = "/triplestore/query", Dr = "/triplestore/update", $r = "/triplestore/shacl", Ie = "/qlever-server/qlever/query", Nr = "/qlever-server/qlever/update", jr = "/qlever-server/qlever/shacl", Lr = "/qlever-server/qlever/admin/rebuild", Ur = "/qlever-server/admin/stats/refresh", qt = "/commands/file-system-structure/batch", Mr = "/commands/dms-sync/providers", qr = (s) => `/commands/dms-sync/${s}/preview`, zr = (s) => `/commands/dms-sync/${s}/sync`, Fr = "/storage/sessions", Br = "/storage/raw", Ce = "/storage/processed", Gr = "/data-views/processing-status", Hr = "/data-views/processing-status/mine", zt = "microsoft.com", Ft = "superadmin", vt = "https://cue.qaecy.com/r/";
705
+ class Bt {
706
706
  _auth;
707
707
  _endpoints;
708
708
  _userSignal = new E(null);
@@ -721,7 +721,7 @@ class Ft {
721
721
  constructor(t, e = !1, o) {
722
722
  this._auth = Ye(t), this._endpoints = o, e && Je(this._auth, o.authEmulatorUrl, {
723
723
  disableWarnings: !0
724
- }), this.user = this._userSignal.asReadonly(), this.token = this._tokenSignal.asReadonly(), this.isSuperAdmin = this._isSuperAdminSignal.asReadonly(), this._userIdsSignal = yt([this._userSignal], () => {
724
+ }), this.user = this._userSignal.asReadonly(), this.token = this._tokenSignal.asReadonly(), this.isSuperAdmin = this._isSuperAdminSignal.asReadonly(), this._userIdsSignal = bt([this._userSignal], () => {
725
725
  const r = this._userSignal.get();
726
726
  if (!r) return [];
727
727
  const a = /* @__PURE__ */ new Set([r.uid]);
@@ -731,7 +731,7 @@ class Ft {
731
731
  const a = await r.getIdToken();
732
732
  this._tokenSignal.set(a);
733
733
  const i = await K(r);
734
- this._isSuperAdminSignal.set(i.claims.role === zt);
734
+ this._isSuperAdminSignal.set(i.claims.role === Ft);
735
735
  } else
736
736
  this._tokenSignal.set(null), this._isSuperAdminSignal.set(!1);
737
737
  });
@@ -750,7 +750,7 @@ class Ft {
750
750
  e.password
751
751
  )).user;
752
752
  }
753
- const o = t === "google" ? new dt() : new ut(qt);
753
+ const o = t === "google" ? new dt() : new ut(zt);
754
754
  return (await eo(this._auth, o)).user;
755
755
  }
756
756
  /**
@@ -759,7 +759,7 @@ class Ft {
759
759
  * retrieve the result.
760
760
  */
761
761
  async signInWithRedirect(t) {
762
- const e = t === "google" ? new dt() : new ut(qt);
762
+ const e = t === "google" ? new dt() : new ut(zt);
763
763
  await oo(this._auth, e);
764
764
  }
765
765
  /**
@@ -777,7 +777,7 @@ class Ft {
777
777
  */
778
778
  async checkSuperAdmin() {
779
779
  const t = this._auth.currentUser;
780
- return t ? (await K(t)).claims.role === zt : !1;
780
+ return t ? (await K(t)).claims.role === Ft : !1;
781
781
  }
782
782
  /** Sign in with a Cue API key. `projectId` is optional — omit it when no project context is available (e.g. admin flows). */
783
783
  async signInWithApiKey(t, e) {
@@ -790,11 +790,11 @@ class Ft {
790
790
  if (!r.ok)
791
791
  throw new Error(`Failed to fetch custom token: ${r.statusText}`);
792
792
  const { token: a } = await r.json();
793
- return (await Tt(this._auth, a)).user;
793
+ return (await kt(this._auth, a)).user;
794
794
  }
795
795
  /** Sign in with a Firebase custom token (e.g. minted server-side for MCP/OAuth flows). */
796
796
  async signInWithCustomToken(t) {
797
- return (await Tt(this._auth, t)).user;
797
+ return (await kt(this._auth, t)).user;
798
798
  }
799
799
  /**
800
800
  * Mint a short-lived Firebase custom token for the current user, scoped to
@@ -866,7 +866,7 @@ class Wr extends Error {
866
866
  status;
867
867
  code;
868
868
  }
869
- class Bt {
869
+ class Gt {
870
870
  constructor(t) {
871
871
  this._gatewayUrl = t;
872
872
  }
@@ -921,9 +921,9 @@ class Bt {
921
921
  }
922
922
  const Vr = {
923
923
  raw: Br,
924
- processed: Ie
924
+ processed: Ce
925
925
  };
926
- class Gt {
926
+ class Ht {
927
927
  constructor(t, e) {
928
928
  this._auth = t, this._gatewayUrl = e;
929
929
  }
@@ -954,7 +954,7 @@ class Gt {
954
954
  * e.g. `{projectId}/fragments/{uuid}.fragments`.
955
955
  */
956
956
  getAltRepDownloadUrl(t) {
957
- return `${this._gatewayUrl}${Ie}/${t}`;
957
+ return `${this._gatewayUrl}${Ce}/${t}`;
958
958
  }
959
959
  /**
960
960
  * Fetch a file through the gateway and return it as a Blob.
@@ -1191,7 +1191,7 @@ function rs(s) {
1191
1191
  t[o] = e;
1192
1192
  }), t;
1193
1193
  }
1194
- function Ce(s) {
1194
+ function xe(s) {
1195
1195
  return s.filter((t) => t.type === "text").map((t) => t.text).join(`
1196
1196
  `);
1197
1197
  }
@@ -1201,7 +1201,7 @@ function ss(s) {
1201
1201
  function as(s) {
1202
1202
  const t = s.structuredContent;
1203
1203
  if (t != null) return t;
1204
- const e = Ce(s.content);
1204
+ const e = xe(s.content);
1205
1205
  try {
1206
1206
  return JSON.parse(e);
1207
1207
  } catch {
@@ -1234,7 +1234,7 @@ class is {
1234
1234
  o?.signal ? { signal: o.signal } : void 0
1235
1235
  );
1236
1236
  if (i.isError)
1237
- throw new Error(`MCP tool '${t}' failed: ${Ce(i.content) || "unknown error"}`);
1237
+ throw new Error(`MCP tool '${t}' failed: ${xe(i.content) || "unknown error"}`);
1238
1238
  const n = as(i);
1239
1239
  if (ss(n))
1240
1240
  throw new Error(`MCP tool '${t}' failed: ${n.error}`);
@@ -1291,7 +1291,7 @@ class cs {
1291
1291
  }
1292
1292
  }
1293
1293
  }
1294
- const Ht = "/data-views/custom-apps", rt = "/commands/custom-apps";
1294
+ const Wt = "/data-views/custom-apps", rt = "/commands/custom-apps";
1295
1295
  class ls {
1296
1296
  constructor(t, e) {
1297
1297
  this._auth = t, this._gatewayUrl = e;
@@ -1301,7 +1301,7 @@ class ls {
1301
1301
  /** List every custom app shared within the given organization (metadata only, no HTML). */
1302
1302
  async list(t) {
1303
1303
  const e = await this._auth.authenticatedFetch(
1304
- `${this._gatewayUrl}${Ht}?organizationId=${encodeURIComponent(t)}`
1304
+ `${this._gatewayUrl}${Wt}?organizationId=${encodeURIComponent(t)}`
1305
1305
  );
1306
1306
  if (!e.ok)
1307
1307
  throw new Error(`Failed to list custom apps: ${e.status} ${e.statusText}`);
@@ -1310,7 +1310,7 @@ class ls {
1310
1310
  /** Fetch a single custom app's full record, including its HTML body. */
1311
1311
  async get(t) {
1312
1312
  const e = await this._auth.authenticatedFetch(
1313
- `${this._gatewayUrl}${Ht}/${encodeURIComponent(t)}`
1313
+ `${this._gatewayUrl}${Wt}/${encodeURIComponent(t)}`
1314
1314
  );
1315
1315
  if (!e.ok)
1316
1316
  throw new Error(`Failed to fetch custom app: ${e.status} ${e.statusText}`);
@@ -1607,7 +1607,7 @@ class ws {
1607
1607
  return e.json();
1608
1608
  }
1609
1609
  }
1610
- const $ = "/commands/data-sources", Wt = "/data-views/data-sources";
1610
+ const $ = "/commands/data-sources", Vt = "/data-views/data-sources";
1611
1611
  class fs {
1612
1612
  constructor(t, e) {
1613
1613
  this._auth = t, this._gatewayUrl = e;
@@ -1731,7 +1731,7 @@ class fs {
1731
1731
  return r;
1732
1732
  }
1733
1733
  async listDataSources(t) {
1734
- const e = await this._auth.authenticatedFetch(`${this._gatewayUrl}${Wt}`, {
1734
+ const e = await this._auth.authenticatedFetch(`${this._gatewayUrl}${Vt}`, {
1735
1735
  headers: { "x-project-id": t, "cue-project-id": t }
1736
1736
  });
1737
1737
  if (!e.ok)
@@ -1739,7 +1739,7 @@ class fs {
1739
1739
  return e.json();
1740
1740
  }
1741
1741
  async getDataSource(t, e) {
1742
- const o = await this._auth.authenticatedFetch(`${this._gatewayUrl}${Wt}/${e}`, {
1742
+ const o = await this._auth.authenticatedFetch(`${this._gatewayUrl}${Vt}/${e}`, {
1743
1743
  headers: { "x-project-id": t, "cue-project-id": t }
1744
1744
  });
1745
1745
  if (!o.ok)
@@ -1751,7 +1751,7 @@ class fs {
1751
1751
  return `${t}: ${e.status} ${e.statusText}${o ? " — " + o.slice(0, 300) : ""}`;
1752
1752
  }
1753
1753
  }
1754
- class Vt {
1754
+ class Xt {
1755
1755
  constructor(t, e, o, r) {
1756
1756
  this._auth = t, this._gatewayUrl = e, this.projects = o, this.sync = r, this.tables = new Kr(t, e), this.extraction = new Jr(t, e), this.contexts = new Zr(t, e), this.index = new ts(t, e), this.mcp = new is(t, e), this.appData = new cs(t, e), this.apps = new ls(t, e), this.userSettings = new hs(t, e), this.processing = new ds(t, e), this.dms = new us(t, e), this.llmTools = new ws(t, e), this.dataSources = new fs(t, e);
1757
1757
  }
@@ -1830,7 +1830,7 @@ class Vt {
1830
1830
  */
1831
1831
  async sparql(t, e, o) {
1832
1832
  o || (o = (await this.projects.getProject(e))?.projectSettings?.graph?.type ?? "qlever");
1833
- const r = o === "fuseki" ? ke : Se;
1833
+ const r = o === "fuseki" ? Se : Ie;
1834
1834
  console.log(`Executing SPARQL query against ${r} for project ${e} with graph type ${o}`);
1835
1835
  const a = new URLSearchParams();
1836
1836
  a.append("query", t);
@@ -1951,7 +1951,7 @@ const gt = [
1951
1951
  "railway",
1952
1952
  "natural",
1953
1953
  "manmade"
1954
- ], xe = [
1954
+ ], mt = [
1955
1955
  "address",
1956
1956
  "poi",
1957
1957
  "railway",
@@ -2093,7 +2093,7 @@ class ks {
2093
2093
  }
2094
2094
  async listFeatureCategoryDescriptors(t) {
2095
2095
  return (await Promise.allSettled(
2096
- xe.map(async (o) => {
2096
+ mt.map(async (o) => {
2097
2097
  const r = await this.search(t, o);
2098
2098
  return { category: o, hasResults: r.length > 0 };
2099
2099
  })
@@ -2129,7 +2129,7 @@ class ks {
2129
2129
  extratags: "1",
2130
2130
  dedupe: "1"
2131
2131
  });
2132
- e && p.set("layer", e), this.email && p.set("email", this.email);
2132
+ e && mt.includes(e) && p.set("layer", e), this.email && p.set("email", this.email);
2133
2133
  const c = `${this.baseUrl}/search?${p.toString()}`, h = await fetch(c, {
2134
2134
  headers: {
2135
2135
  "User-Agent": this.userAgent,
@@ -2162,7 +2162,7 @@ class ks {
2162
2162
  };
2163
2163
  }
2164
2164
  }
2165
- const Xt = {
2165
+ const Qt = {
2166
2166
  // 100s – Residential
2167
2167
  110: "residential",
2168
2168
  120: "residential",
@@ -2241,7 +2241,7 @@ const Xt = {
2241
2241
  960: "agricultural",
2242
2242
  970: "agricultural",
2243
2243
  990: "other"
2244
- }, Qt = {
2244
+ }, Kt = {
2245
2245
  1010: "residential",
2246
2246
  1020: "mixed",
2247
2247
  1030: "residential",
@@ -2353,7 +2353,7 @@ function j(s) {
2353
2353
  function Cs(s, t) {
2354
2354
  if (s == null) return;
2355
2355
  const e = String(s).trim();
2356
- return t === "swiss-gwr" ? Ss[e] ?? j(e) : t === "danish-matrikel" ? Xt[e] ?? j(e) : t === "zurich-wfs" || t === "swiss-av-wfs" ? Qt[e] ?? j(e) : Qt[e] ?? Xt[e] ?? j(e);
2356
+ return t === "swiss-gwr" ? Ss[e] ?? j(e) : t === "danish-matrikel" ? Qt[e] ?? j(e) : t === "zurich-wfs" || t === "swiss-av-wfs" ? Kt[e] ?? j(e) : Kt[e] ?? Qt[e] ?? j(e);
2357
2357
  }
2358
2358
  function xs(s, t) {
2359
2359
  if (s != null)
@@ -2385,7 +2385,7 @@ function Ae(s) {
2385
2385
  if (s)
2386
2386
  return Rs[Re(s)];
2387
2387
  }
2388
- const Kt = {
2388
+ const Yt = {
2389
2389
  // Swiss Nutzungsplanung (typ_gde_bezeichnung and common variants)
2390
2390
  grundnutzungszonenplan: "land-use-plan",
2391
2391
  nutzungszonenplan: "land-use-plan",
@@ -2482,7 +2482,7 @@ const Kt = {
2482
2482
  function Oe(s) {
2483
2483
  if (!s) return;
2484
2484
  const t = Re(s);
2485
- if (t in Kt) return Kt[t];
2485
+ if (t in Yt) return Yt[t];
2486
2486
  for (const [e, o] of As)
2487
2487
  if (e.test(s)) return o;
2488
2488
  console.warn(
@@ -2720,7 +2720,10 @@ class pt {
2720
2720
  }
2721
2721
  const Pe = [8, 54.5, 15.2, 57.8], De = {
2722
2722
  building: [
2723
+ { source: "danish-matrikel", typename: "gdk60:Bygning" },
2724
+ // Footprint polygons (GeoDanmark Vektor)
2723
2725
  { source: "danish-matrikel", typename: "bbr_v001:bygning_current" }
2726
+ // Centroid + registry attributes (BBR)
2724
2727
  ],
2725
2728
  cadastre: [
2726
2729
  { source: "danish-matrikel", typename: "mat_v001:lodflade_current" },
@@ -2855,12 +2858,15 @@ class Ks {
2855
2858
  }
2856
2859
  async getFeaturesOfCategory(t, e) {
2857
2860
  const o = this.categoryMap[e] ?? [];
2858
- return (await Promise.all(
2861
+ return (await Promise.allSettled(
2859
2862
  o.map((a) => {
2860
2863
  const i = ct(this.sourceId, e, a);
2861
2864
  return this.getFeaturesForLayer(t, i.id);
2862
2865
  })
2863
- )).flat();
2866
+ )).flatMap((a, i) => a.status === "fulfilled" ? a.value : (console.warn(
2867
+ `[CueSdkGisAdapter] Layer "${o[i].source}/${o[i].typename}" failed:`,
2868
+ a.reason
2869
+ ), []));
2864
2870
  }
2865
2871
  // ─── Private helpers ────────────────────────────────────────────────────────
2866
2872
  _findLayerById(t) {
@@ -3012,7 +3018,7 @@ const Ys = {
3012
3018
  })
3013
3019
  }
3014
3020
  ];
3015
- function Yt(s) {
3021
+ function Jt(s) {
3016
3022
  return [...s].sort(
3017
3023
  (t, e) => gt.indexOf(t.category) - gt.indexOf(e.category)
3018
3024
  );
@@ -3053,12 +3059,12 @@ class Js {
3053
3059
  for (const i of e)
3054
3060
  for (const n of i.supportedCategories ?? [])
3055
3061
  r.has(n) || (r.add(n), a.push(A(n)));
3056
- for (const i of xe)
3062
+ for (const i of mt)
3057
3063
  r.has(i) || a.push(A(i));
3058
- return Yt(a);
3064
+ return Jt(a);
3059
3065
  }
3060
3066
  const o = await this._adapterFor(t).listFeatureCategoryDescriptors(t);
3061
- return Yt(o);
3067
+ return Jt(o);
3062
3068
  }
3063
3069
  /**
3064
3070
  * Return the feature categories that have at least one result within the
@@ -3131,7 +3137,7 @@ class Js {
3131
3137
  const { features: n, idx: p } = await Promise.race(i.values());
3132
3138
  i.delete(p);
3133
3139
  for (const c of n) {
3134
- const h = Jt(c), d = Y(c), u = a.get(h);
3140
+ const h = Zt(c), d = Y(c), u = a.get(h);
3135
3141
  (u === void 0 || d > u) && (a.set(h, d), yield c);
3136
3142
  }
3137
3143
  }
@@ -3167,7 +3173,7 @@ class Js {
3167
3173
  d.status === "fulfilled" && (d.value.isNominatim ? n.push(...d.value.features) : i.push(...d.value.features));
3168
3174
  const p = ea(i, n), c = /* @__PURE__ */ new Map(), h = [];
3169
3175
  for (const d of p) {
3170
- const u = Jt(d), m = Y(d), w = c.get(u);
3176
+ const u = Zt(d), m = Y(d), w = c.get(u);
3171
3177
  (w === void 0 || m > w) && (c.set(u, m), h.push(d));
3172
3178
  }
3173
3179
  return h;
@@ -3185,7 +3191,7 @@ function Y(s) {
3185
3191
  const t = s.geometry?.type;
3186
3192
  return t === "Polygon" || t === "MultiPolygon" ? 3 : t === "LineString" || t === "MultiLineString" ? 2 : 1;
3187
3193
  }
3188
- function Jt(s) {
3194
+ function Zt(s) {
3189
3195
  const t = Math.round(s.lat * 1e3) / 1e3, e = Math.round(s.lon * 1e3) / 1e3;
3190
3196
  return `${(s.name ?? s.id ?? "").toLowerCase().trim()}|${t}|${e}`;
3191
3197
  }
@@ -3360,7 +3366,7 @@ class sa {
3360
3366
  this._loadListeners.forEach((e) => e(t));
3361
3367
  }
3362
3368
  }
3363
- class Zt {
3369
+ class te {
3364
3370
  constructor(t, e, o = !1, r) {
3365
3371
  if (this._auth = t, this._db = He(e), this._gatewayUrl = r?.gatewayUrl ?? "", o) {
3366
3372
  const a = r?.firestoreEmulatorHost ?? "localhost", i = r?.firestoreEmulatorPort ?? 8080;
@@ -3395,7 +3401,7 @@ class Zt {
3395
3401
  }
3396
3402
  /** List all projects where the authenticated user appears in the members array. */
3397
3403
  async listProjects() {
3398
- const t = await this._auth.authenticatedFetch(`${this._gatewayUrl}${Lt}`);
3404
+ const t = await this._auth.authenticatedFetch(`${this._gatewayUrl}${Ut}`);
3399
3405
  if (!t.ok) {
3400
3406
  const o = await t.text().catch(() => "");
3401
3407
  throw new Error(`Failed to list projects: ${t.status} ${t.statusText}${o ? ` — ${o}` : ""}`);
@@ -3406,7 +3412,7 @@ class Zt {
3406
3412
  /** Fetch a single project by ID. Returns null if not found or user lacks access. */
3407
3413
  async getProject(t) {
3408
3414
  const e = await this._auth.authenticatedFetch(
3409
- `${this._gatewayUrl}${Lt}?projectId=${encodeURIComponent(t)}`
3415
+ `${this._gatewayUrl}${Ut}?projectId=${encodeURIComponent(t)}`
3410
3416
  );
3411
3417
  if (!e.ok) {
3412
3418
  if (e.status === 404) return null;
@@ -3551,7 +3557,7 @@ class Zt {
3551
3557
  }
3552
3558
  }
3553
3559
  }
3554
- class te {
3560
+ class ee {
3555
3561
  constructor(t, e, o, r) {
3556
3562
  this._auth = t, this._gatewayUrl = r, this._functions = wo(e, xo), o && fo(this._functions, "localhost", 5001);
3557
3563
  }
@@ -3580,7 +3586,7 @@ class te {
3580
3586
  }
3581
3587
  /** Whether the current user has an active API key. */
3582
3588
  async hasAPIKey() {
3583
- return await this._fetch($t) !== null;
3589
+ return await this._fetch(Nt) !== null;
3584
3590
  }
3585
3591
  /** Returns the sign-in methods registered for the current user's email. */
3586
3592
  async getSignInMethods() {
@@ -3612,7 +3618,7 @@ class te {
3612
3618
  async updatePassword(t, e) {
3613
3619
  const o = this._requireUser();
3614
3620
  if (!o.email) throw new Error("User has no e-mail");
3615
- await kt(
3621
+ await St(
3616
3622
  o,
3617
3623
  et.credential(o.email, t)
3618
3624
  ), await co(o, e);
@@ -3627,14 +3633,14 @@ class te {
3627
3633
  async updateEmail(t, e) {
3628
3634
  const o = this._requireUser();
3629
3635
  if (!o.email) throw new Error("User e-mail not available");
3630
- await kt(
3636
+ await St(
3631
3637
  o,
3632
3638
  et.credential(o.email, e)
3633
3639
  ), await ho(o, t), await uo(o);
3634
3640
  }
3635
3641
  /** Creates a new API key for the current user. */
3636
3642
  async createAPIKey(t) {
3637
- return this._fetch(Nt, {
3643
+ return this._fetch(jt, {
3638
3644
  method: "POST",
3639
3645
  headers: { "Content-Type": "application/json" },
3640
3646
  body: JSON.stringify({ expiration: t })
@@ -3643,7 +3649,7 @@ class te {
3643
3649
  /** Revokes the current user's API key. */
3644
3650
  async revokeAPIKey() {
3645
3651
  const t = await this._auth.authenticatedFetch(
3646
- this._url(Nt),
3652
+ this._url(jt),
3647
3653
  { method: "DELETE" }
3648
3654
  );
3649
3655
  if (!t.ok)
@@ -3651,7 +3657,7 @@ class te {
3651
3657
  }
3652
3658
  /** Fetches the current user's existing API key. */
3653
3659
  async requestAPIKey() {
3654
- const t = await this._fetch($t);
3660
+ const t = await this._fetch(Nt);
3655
3661
  if (!t) throw new Error("No API key found");
3656
3662
  return t;
3657
3663
  }
@@ -3702,7 +3708,7 @@ class te {
3702
3708
  * and accept that the call then takes as long as the computation does.
3703
3709
  */
3704
3710
  async getOrgCredits(t, e) {
3705
- const o = e?.refresh ? `${jt(t)}?refresh=true` : jt(t), r = await this._fetch(o);
3711
+ const o = e?.refresh ? `${Lt(t)}?refresh=true` : Lt(t), r = await this._fetch(o);
3706
3712
  return this._orgCredits.set(r), r;
3707
3713
  }
3708
3714
  /**
@@ -3860,7 +3866,7 @@ class te {
3860
3866
  return t ? (await K(t)).claims.analyticsNotice ?? null : null;
3861
3867
  }
3862
3868
  }
3863
- class ee {
3869
+ class oe {
3864
3870
  constructor(t, e) {
3865
3871
  this._auth = t, this._gatewayUrl = e;
3866
3872
  }
@@ -3880,7 +3886,7 @@ class ee {
3880
3886
  }).catch((o) => console.warn("Failed to record usage view", o));
3881
3887
  }
3882
3888
  }
3883
- class oe {
3889
+ class re {
3884
3890
  constructor(t, e) {
3885
3891
  this._auth = t, this._gatewayUrl = e;
3886
3892
  }
@@ -3966,11 +3972,11 @@ class oe {
3966
3972
  }
3967
3973
  /** Grants the `superadmin` custom claim. The user must sign in again for it to take effect. */
3968
3974
  grantSuperadmin(t) {
3969
- return this._fetch(Ut(t), { method: "PUT" });
3975
+ return this._fetch(Mt(t), { method: "PUT" });
3970
3976
  }
3971
3977
  /** Revokes the `superadmin` custom claim. */
3972
3978
  revokeSuperadmin(t) {
3973
- return this._fetch(Ut(t), { method: "DELETE" });
3979
+ return this._fetch(Mt(t), { method: "DELETE" });
3974
3980
  }
3975
3981
  /** Creates a new organisation with `adminUserId` as its sole admin/member. */
3976
3982
  createOrganization(t) {
@@ -4031,7 +4037,7 @@ class oe {
4031
4037
  return this._fetch(br);
4032
4038
  }
4033
4039
  }
4034
- const re = ["superadmin", "admin", "syncer", "member"], se = {
4040
+ const se = ["superadmin", "admin", "syncer", "member"], ae = {
4035
4041
  createEntities: "admin",
4036
4042
  createProvider: "superadmin",
4037
4043
  changeContentCategories: "syncer",
@@ -4082,9 +4088,9 @@ function aa() {
4082
4088
  viewEntities: !1
4083
4089
  };
4084
4090
  }
4085
- class ae {
4091
+ class ie {
4086
4092
  constructor(t) {
4087
- this._isSuperAdmin = t, this._projectRoles = new E([]), this._orgRole = new E(null), this.privileges = yt(
4093
+ this._isSuperAdmin = t, this._projectRoles = new E([]), this._orgRole = new E(null), this.privileges = bt(
4088
4094
  [this._projectRoles, this._orgRole, t],
4089
4095
  () => this._compute()
4090
4096
  );
@@ -4121,17 +4127,17 @@ class ae {
4121
4127
  _expand(t) {
4122
4128
  if (this._isSuperAdmin.get())
4123
4129
  return ["superadmin", "admin", "syncer", "member"];
4124
- const e = re.findIndex((o) => t.includes(o));
4125
- return e === -1 ? [] : Array.from(re.slice(e));
4130
+ const e = se.findIndex((o) => t.includes(o));
4131
+ return e === -1 ? [] : Array.from(se.slice(e));
4126
4132
  }
4127
4133
  _compute() {
4128
4134
  const t = this._projectRoles.get(), e = this._isSuperAdmin.get(), o = aa();
4129
- for (const r of Object.keys(se))
4130
- o[r] = t.includes(se[r]);
4135
+ for (const r of Object.keys(ae))
4136
+ o[r] = t.includes(ae[r]);
4131
4137
  return o.createProject = e || this._orgRole.get() === "admin", o;
4132
4138
  }
4133
4139
  }
4134
- class ie {
4140
+ class ne {
4135
4141
  constructor(t) {
4136
4142
  this._storage = t;
4137
4143
  }
@@ -4164,7 +4170,7 @@ class ie {
4164
4170
  // ── Internal helpers ───────────────────────────────────────────────────────
4165
4171
  async _get(t, e) {
4166
4172
  try {
4167
- const r = await (await _e(k(this._storage, `${t}/${e}.json.gz`))).arrayBuffer(), a = new DecompressionStream("gzip"), i = a.writable.getWriter(), n = a.readable.getReader();
4173
+ const r = await (await Ee(k(this._storage, `${t}/${e}.json.gz`))).arrayBuffer(), a = new DecompressionStream("gzip"), i = a.writable.getWriter(), n = a.readable.getReader();
4168
4174
  i.write(new Uint8Array(r)), i.close();
4169
4175
  const p = [];
4170
4176
  let c = await n.read();
@@ -4202,7 +4208,7 @@ function ia(s) {
4202
4208
  return typeof s == "object" && s !== null && "code" in s && s.code === "storage/object-not-found";
4203
4209
  }
4204
4210
  const qa = ["CHF", "DKK", "EUR"], za = "CHF", na = 3600 * 1e3, pa = "https://api.frankfurter.dev/v1/latest?from=CHF&to=DKK,EUR";
4205
- class ne {
4211
+ class pe {
4206
4212
  _cached = null;
4207
4213
  _pending = null;
4208
4214
  /**
@@ -7630,7 +7636,7 @@ class ua {
7630
7636
  }
7631
7637
  /** Projects a language-independent {@link SchemaNode} into a {@link CategoryDef}. */
7632
7638
  _toDef(t, e) {
7633
- const o = le(t.labels, e) ?? t.iri.split("#").at(-1) ?? t.iri, r = le(t.definitions, e), a = Object.keys(t.definitions).length > 0;
7639
+ const o = he(t.labels, e) ?? t.iri.split("#").at(-1) ?? t.iri, r = he(t.definitions, e), a = Object.keys(t.definitions).length > 0;
7634
7640
  return {
7635
7641
  iri: t.iri,
7636
7642
  label: o,
@@ -7685,7 +7691,7 @@ WHERE {
7685
7691
  let p = o.get(i);
7686
7692
  p || (p = { iri: i, type: n, labels: {}, definitions: {} }, o.set(i, p)), p.parent === void 0 && a.parent?.value && (p.parent = a.parent.value);
7687
7693
  const c = a.deprecated?.value;
7688
- c !== void 0 && (p.deprecated = c === "true" || c === "1"), pe(p.labels, a.label), pe(p.definitions, a.definition);
7694
+ c !== void 0 && (p.deprecated = c === "true" || c === "1"), ce(p.labels, a.label), ce(p.definitions, a.definition);
7689
7695
  }
7690
7696
  const r = {
7691
7697
  contentCategories: [],
@@ -7693,16 +7699,16 @@ WHERE {
7693
7699
  relationships: []
7694
7700
  };
7695
7701
  for (const a of o.values())
7696
- ce(a.labels), ce(a.definitions), a.type === ca ? r.contentCategories.push(a) : a.type === la ? r.entityCategories.push(a) : a.type === ha && r.relationships.push(a);
7702
+ le(a.labels), le(a.definitions), a.type === ca ? r.contentCategories.push(a) : a.type === la ? r.entityCategories.push(a) : a.type === ha && r.relationships.push(a);
7697
7703
  return r;
7698
7704
  }
7699
7705
  }
7700
- function pe(s, t) {
7706
+ function ce(s, t) {
7701
7707
  if (!t || t.value === void 0) return;
7702
7708
  const e = t["xml:lang"], o = e && e.length > 0 ? e : "default";
7703
7709
  s[o] === void 0 && (s[o] = t.value);
7704
7710
  }
7705
- function ce(s) {
7711
+ function le(s) {
7706
7712
  if (s.en !== void 0) {
7707
7713
  s.default = s.en;
7708
7714
  return;
@@ -7711,12 +7717,12 @@ function ce(s) {
7711
7717
  const t = Object.values(s)[0];
7712
7718
  t !== void 0 && (s.default = t);
7713
7719
  }
7714
- function le(s, t) {
7720
+ function he(s, t) {
7715
7721
  return s[t] ?? s.default;
7716
7722
  }
7717
7723
  const ga = "https://qlever.dev/api/osm-planet";
7718
7724
  class Ne {
7719
- constructor(t, e, o = bt, r, a = !1) {
7725
+ constructor(t, e, o = vt, r, a = !1) {
7720
7726
  this._api = t, this._projectId = e, this._graphType = r, this._verbose = a, this.baseURL = `${o}${e}/`, this.entityInfoMap = this._entityInfoMapComputed, this.entityGraph = this._entityGraph.asReadonly(), this._entityOSMMap.subscribe(() => this._checkPendingOSMFetches()), this._fetchEntityGraph().catch(
7721
7727
  (i) => console.error("[CueProjectEntities] Entity graph fetch failed:", i)
7722
7728
  );
@@ -7754,7 +7760,7 @@ class Ne {
7754
7760
  */
7755
7761
  _categoryCountsCache;
7756
7762
  // ── Derived signals ────────────────────────────────────────────────────────
7757
- _entityInfoMapComputed = yt(
7763
+ _entityInfoMapComputed = bt(
7758
7764
  [
7759
7765
  this._entityDetails,
7760
7766
  this._entityDocuments,
@@ -8311,7 +8317,7 @@ SELECT * WHERE {
8311
8317
  }
8312
8318
  }
8313
8319
  var l = /* @__PURE__ */ ((s) => (s.AUTOMATION = "automation", s.ARCHIVE = "archive", s.AUDIO = "audio", s.BACKUP = "backup", s.BINARY = "binary", s.BIM = "bim", s.CAD = "cad", s.DATA = "data", s.EMAIL = "email", s.FONT = "font", s.GEOSPATIAL = "geospatial", s.IMAGE = "image", s.INSTALLER = "installer", s.MARKUP = "markup", s.MULTIMEDIA = "multimedia", s.PLANNING = "planning", s.PRESENTATION = "presentation", s.SCRIPT = "script", s.SPREADSHEET = "spreadsheet", s.TEXT = "text", s.THREE_D = "3d", s.UNKNOWN = "unknown", s.VIDEO = "video", s))(l || {});
8314
- const mt = {
8320
+ const wt = {
8315
8321
  ".aac": {
8316
8322
  type: l.AUDIO,
8317
8323
  open: !0,
@@ -9195,8 +9201,8 @@ WHERE {
9195
9201
  _:cfg view:column-count ?count .
9196
9202
  }
9197
9203
  }`;
9198
- class wt {
9199
- constructor(t, e, o, r = bt, a, i = !1) {
9204
+ class ft {
9205
+ constructor(t, e, o, r = vt, a, i = !1) {
9200
9206
  this._api = t, this._projectId = e, this._graphType = a, this._verbose = i, this.baseURL = `${r}${e}/`, this._currentLang = o ?? this._api.language, this.documentInfoMap = this._documentInfoMap.asReadonly(), this.projectDocumentsData = this._projectDocumentsData.asReadonly();
9201
9207
  }
9202
9208
  _api;
@@ -9409,7 +9415,7 @@ WHERE {
9409
9415
  });
9410
9416
  }
9411
9417
  documentsByFileType(t, e = !1) {
9412
- const o = new Set(t), r = Object.values(mt).filter((a) => o.has(a.type)).map((a) => a.suffix);
9418
+ const o = new Set(t), r = Object.values(wt).filter((a) => o.has(a.type)).map((a) => a.suffix);
9413
9419
  return this.documentsBySuffix(r, e);
9414
9420
  }
9415
9421
  async documentsByContentCategory(t, e = !1) {
@@ -9447,7 +9453,7 @@ WHERE {
9447
9453
  });
9448
9454
  }
9449
9455
  documentsByMime(t, e = !1) {
9450
- const o = new Set(t), r = Object.values(mt).filter((a) => o.has(a.mime)).map((a) => a.suffix);
9456
+ const o = new Set(t), r = Object.values(wt).filter((a) => o.has(a.mime)).map((a) => a.suffix);
9451
9457
  return this.documentsBySuffix(r, e);
9452
9458
  }
9453
9459
  // ── Private helpers ────────────────────────────────────────────────────────
@@ -9636,8 +9642,8 @@ WHERE {
9636
9642
  }
9637
9643
  }
9638
9644
  class ya {
9639
- constructor(t, e, { language: o, rdfBase: r = bt, graphType: a, verbose: i }) {
9640
- this._api = t, this._projectId = e, this.schema = new ua(t, e, o, a, i), this.entities = new Ne(t, e, r, a, i), this.documents = new wt(t, e, o, r, a, i), this.availableContentCategories = this.schema.availableContentCategories, this.availableEntityCategories = this.schema.availableEntityCategories, this.availableEntityRelationships = this.schema.availableEntityRelationships, this.schemaReady = this.schema.ready, this.entityInfoMap = this.entities.entityInfoMap, this.entityGraph = this.entities.entityGraph, this.documentInfoMap = this.documents.documentInfoMap, this.projectDocumentsData = this.documents.projectDocumentsData, this.searchResults = this._searchResults.asReadonly(), this.documents.fetchOverview().catch((n) => console.error("[CueProjectView] fetchOverview failed:", n));
9645
+ constructor(t, e, { language: o, rdfBase: r = vt, graphType: a, verbose: i }) {
9646
+ this._api = t, this._projectId = e, this.schema = new ua(t, e, o, a, i), this.entities = new Ne(t, e, r, a, i), this.documents = new ft(t, e, o, r, a, i), this.availableContentCategories = this.schema.availableContentCategories, this.availableEntityCategories = this.schema.availableEntityCategories, this.availableEntityRelationships = this.schema.availableEntityRelationships, this.schemaReady = this.schema.ready, this.entityInfoMap = this.entities.entityInfoMap, this.entityGraph = this.entities.entityGraph, this.documentInfoMap = this.documents.documentInfoMap, this.projectDocumentsData = this.documents.projectDocumentsData, this.searchResults = this._searchResults.asReadonly(), this.documents.fetchOverview().catch((n) => console.error("[CueProjectView] fetchOverview failed:", n));
9641
9647
  }
9642
9648
  _api;
9643
9649
  _projectId;
@@ -9755,7 +9761,7 @@ class ya {
9755
9761
  this._destroyed = !0, this._searchResults.set(void 0);
9756
9762
  }
9757
9763
  }
9758
- function he(s, t) {
9764
+ function de(s, t) {
9759
9765
  return new Promise((e) => {
9760
9766
  const o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
9761
9767
  for (const f of s)
@@ -9790,7 +9796,7 @@ function he(s, t) {
9790
9796
  });
9791
9797
  });
9792
9798
  }
9793
- const de = {
9799
+ const ue = {
9794
9800
  ä: "ae",
9795
9801
  ä: "ae",
9796
9802
  Ä: "AE",
@@ -9830,8 +9836,8 @@ function je(s, t = !1) {
9830
9836
  }
9831
9837
  function ba(s, t = !1) {
9832
9838
  let e = s;
9833
- for (const o in de)
9834
- e = e.replace(new RegExp(o, "g"), de[o]);
9839
+ for (const o in ue)
9840
+ e = e.replace(new RegExp(o, "g"), ue[o]);
9835
9841
  return t && e !== s && console.info(`${s} -> ${e}`), e;
9836
9842
  }
9837
9843
  function va(s, t = "") {
@@ -9849,9 +9855,9 @@ const { namedNode: ka, literal: Ha } = M;
9849
9855
  ka("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
9850
9856
  const { namedNode: Sa, literal: Wa } = M;
9851
9857
  Sa("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
9852
- function ue(s, t, e, o, r, a, i, n = !1, p = !1) {
9858
+ function ge(s, t, e, o, r, a, i, n = !1, p = !1) {
9853
9859
  const c = Ta(s), h = je(o), d = `${t}/${h}${c}`;
9854
- i === void 0 && (i = mt[c]?.mime ?? "application/octet-stream");
9860
+ i === void 0 && (i = wt[c]?.mime ?? "application/octet-stream");
9855
9861
  const u = va(s, r);
9856
9862
  return {
9857
9863
  name: s,
@@ -9878,7 +9884,7 @@ async function q() {
9878
9884
  "fs/promises"
9879
9885
  );
9880
9886
  }
9881
- async function ge(s) {
9887
+ async function me(s) {
9882
9888
  if (typeof window < "u")
9883
9889
  throw new Error(
9884
9890
  `Cannot read file from path "${s}" in a browser environment. Provide file.data (Uint8Array) instead.`
@@ -9912,8 +9918,8 @@ async function Ia() {
9912
9918
  await i.default({ module_or_path: r }), U = i.scan;
9913
9919
  }
9914
9920
  }
9915
- const Ca = "qlever", W = 1e3, vt = "cue:pending:";
9916
- async function _t(s) {
9921
+ const Ca = "qlever", W = 1e3, _t = "cue:pending:";
9922
+ async function Et(s) {
9917
9923
  const { tmpdir: t } = await import(
9918
9924
  /* webpackIgnore: true */
9919
9925
  "os"
@@ -9923,37 +9929,37 @@ async function _t(s) {
9923
9929
  );
9924
9930
  return e(t(), `cue-sync-pending-${s}.json`);
9925
9931
  }
9926
- async function me(s) {
9932
+ async function we(s) {
9927
9933
  if (typeof window < "u") {
9928
- const t = window.localStorage.getItem(`${vt}${s}`);
9934
+ const t = window.localStorage.getItem(`${_t}${s}`);
9929
9935
  return t ? JSON.parse(t) : null;
9930
9936
  }
9931
9937
  try {
9932
- const t = await (await q()).readFile(await _t(s), "utf-8");
9938
+ const t = await (await q()).readFile(await Et(s), "utf-8");
9933
9939
  return JSON.parse(t);
9934
9940
  } catch {
9935
9941
  return null;
9936
9942
  }
9937
9943
  }
9938
- async function we(s) {
9944
+ async function fe(s) {
9939
9945
  const t = JSON.stringify(s);
9940
9946
  if (typeof window < "u") {
9941
- window.localStorage.setItem(`${vt}${s.spaceId}`, t);
9947
+ window.localStorage.setItem(`${_t}${s.spaceId}`, t);
9942
9948
  return;
9943
9949
  }
9944
- await (await q()).writeFile(await _t(s.spaceId), t, "utf-8");
9950
+ await (await q()).writeFile(await Et(s.spaceId), t, "utf-8");
9945
9951
  }
9946
9952
  async function xa(s) {
9947
9953
  if (typeof window < "u") {
9948
- window.localStorage.removeItem(`${vt}${s}`);
9954
+ window.localStorage.removeItem(`${_t}${s}`);
9949
9955
  return;
9950
9956
  }
9951
9957
  try {
9952
- await (await q()).unlink(await _t(s));
9958
+ await (await q()).unlink(await Et(s));
9953
9959
  } catch {
9954
9960
  }
9955
9961
  }
9956
- class fe {
9962
+ class ye {
9957
9963
  constructor(t, e, o, r) {
9958
9964
  this._auth = t, this._projects = e, this._blob = o, this._gatewayUrl = r;
9959
9965
  }
@@ -10031,7 +10037,7 @@ class fe {
10031
10037
  */
10032
10038
  async flushPendingMetadata(t, e, o) {
10033
10039
  this._legacy = o ?? !1;
10034
- const r = await me(t);
10040
+ const r = await we(t);
10035
10041
  if (!(!r || r.items.length === 0)) {
10036
10042
  console.info(`Trying to upload metadata (${r.items.length} item(s))...`), e && console.info(`Flushing ${r.items.length} pending file location(s) from previous sync ⏳`);
10037
10043
  try {
@@ -10054,7 +10060,7 @@ class fe {
10054
10060
  this._getAvailableCredits(p?.organizationID),
10055
10061
  this._fetchUnitCreditMap(a),
10056
10062
  this._fetchTierNames()
10057
- ]), w = await he(t, h), g = w.localNotOnRemote ?? [], _ = g.length > 0 ? await this.scanCost(g) : [];
10063
+ ]), w = await de(t, h), g = w.localNotOnRemote ?? [], _ = g.length > 0 ? await this.scanCost(g) : [];
10058
10064
  let f = 0, T = 0;
10059
10065
  for (const b of _) {
10060
10066
  f += b.units;
@@ -10087,7 +10093,7 @@ class fe {
10087
10093
  const [u, m] = await Promise.all([
10088
10094
  this._listRemoteFiles(h, o, r, i),
10089
10095
  this._getAvailableCredits(d?.organizationID)
10090
- ]), { unitsAvailable: w } = m, g = await he(t, u);
10096
+ ]), { unitsAvailable: w } = m, g = await de(t, u);
10091
10097
  i && (console.info(`Total local files: ${t.length}`), console.info(`Total remote files: ${u.length}`), console.info(
10092
10098
  `Total files to sync: ${(g.localNotOnRemote?.length ?? 0) + g.localNotOnRemotePathOnly.length}`
10093
10099
  ));
@@ -10103,7 +10109,7 @@ class fe {
10103
10109
  await this._initPendingBatch(o, i), i && b.length && console.info("Syncing missing files ⏳");
10104
10110
  for (const v of b)
10105
10111
  try {
10106
- const I = ue(
10112
+ const I = ge(
10107
10113
  v.relativePath,
10108
10114
  o,
10109
10115
  a,
@@ -10111,7 +10117,7 @@ class fe {
10111
10117
  r
10112
10118
  );
10113
10119
  if (!I.blob_name) throw new Error(`blob_name missing for ${v.relativePath}`);
10114
- const D = v.data ?? new Uint8Array(await ge(v.fullPath));
10120
+ const D = v.data ?? new Uint8Array(await me(v.fullPath));
10115
10121
  await this._blob.uploadRaw(
10116
10122
  I.blob_name,
10117
10123
  D,
@@ -10150,7 +10156,7 @@ class fe {
10150
10156
  async _getOrCreateGraph(t, e) {
10151
10157
  const o = this._graphMap.get(t);
10152
10158
  if (o) return o;
10153
- const a = (await this._projects.getProject(t))?.projectSettings?.graph?.type ?? Ca, i = a === "qlever" ? `${this._gatewayUrl}${Se}` : `${this._gatewayUrl}${ke}`, n = a === "qlever" ? `${this._gatewayUrl}${Nr}` : `${this._gatewayUrl}${Dr}`, p = new Io({
10159
+ const a = (await this._projects.getProject(t))?.projectSettings?.graph?.type ?? Ca, i = a === "qlever" ? `${this._gatewayUrl}${Ie}` : `${this._gatewayUrl}${Se}`, n = a === "qlever" ? `${this._gatewayUrl}${Nr}` : `${this._gatewayUrl}${Dr}`, p = new Io({
10154
10160
  graphType: a,
10155
10161
  queryEndpoint: i,
10156
10162
  updateEndpoint: n,
@@ -10216,7 +10222,7 @@ WHERE {
10216
10222
  }
10217
10223
  async _initPendingBatch(t, e) {
10218
10224
  this._flushTimer !== null && (clearInterval(this._flushTimer), this._flushTimer = null), this._pendingSpaceId = t, this._pendingItems = [];
10219
- const o = await me(t);
10225
+ const o = await we(t);
10220
10226
  if (o && o.items.length > 0) {
10221
10227
  console.info(`Trying to upload metadata from interrupted sync (${o.items.length} item(s))...`), e && console.info(`Flushing ${o.items.length} pending file location(s) from previous sync ⏳`);
10222
10228
  try {
@@ -10237,7 +10243,7 @@ WHERE {
10237
10243
  typeof r == "object" && typeof r.unref == "function" && r.unref(), this._flushTimer = r;
10238
10244
  }
10239
10245
  async _queueFileLocation(t) {
10240
- this._pendingItems.push(t), this._pendingSpaceId && await we({ spaceId: this._pendingSpaceId, items: this._pendingItems });
10246
+ this._pendingItems.push(t), this._pendingSpaceId && await fe({ spaceId: this._pendingSpaceId, items: this._pendingItems });
10241
10247
  }
10242
10248
  /**
10243
10249
  * Flush all queued file-location items to the commands API in a single batch.
@@ -10269,11 +10275,11 @@ WHERE {
10269
10275
  o && console.info(`Wrote ${r.length} file location(s) to commands API ✅`);
10270
10276
  } catch (a) {
10271
10277
  const i = [...r, ...this._pendingItems];
10272
- throw this._pendingItems = i, await we({ spaceId: e, items: i }), a;
10278
+ throw this._pendingItems = i, await fe({ spaceId: e, items: i }), a;
10273
10279
  }
10274
10280
  }
10275
10281
  async _postFssBatch(t, e) {
10276
- const o = this._legacy ? `${this._gatewayUrl}${Mt}?blob=true` : `${this._gatewayUrl}${Mt}`;
10282
+ const o = this._legacy ? `${this._gatewayUrl}${qt}?blob=true` : `${this._gatewayUrl}${qt}`;
10277
10283
  let r;
10278
10284
  try {
10279
10285
  r = await this._auth.authenticatedFetch(o, {
@@ -10310,7 +10316,7 @@ WHERE {
10310
10316
  a.map(async (p) => ({
10311
10317
  originalPath: p.relativePath,
10312
10318
  // Use pre-loaded data if available (browser), otherwise read from disk (Node.js).
10313
- data: p.data ?? new Uint8Array(await ge(p.fullPath))
10319
+ data: p.data ?? new Uint8Array(await me(p.fullPath))
10314
10320
  }))
10315
10321
  ), n = U(i);
10316
10322
  for (const p of n) {
@@ -10370,7 +10376,7 @@ WHERE {
10370
10376
  const { spaceId: o, providerId: r, userId: a, signal: i, onProgress: n } = e;
10371
10377
  if (!t.data)
10372
10378
  throw new Error("syncBrowserFile requires file.data (Uint8Array). Read the file with File.arrayBuffer() first.");
10373
- const p = ue(t.relativePath, o, a, t.md5, r);
10379
+ const p = ge(t.relativePath, o, a, t.md5, r);
10374
10380
  if (!p.blob_name) throw new Error(`blob_name missing for ${t.relativePath}`);
10375
10381
  await this._blob.uploadRaw(
10376
10382
  p.blob_name,
@@ -10423,7 +10429,7 @@ WHERE {
10423
10429
  a({ percent: i, syncCount: t, totalCount: e, syncSize: o, totalSize: r });
10424
10430
  }
10425
10431
  }
10426
- const ye = {
10432
+ const be = {
10427
10433
  production: {
10428
10434
  gatewayUrl: "https://accessors-api-gateway-ueyeemwf2a-oa.a.run.app",
10429
10435
  tokenUrl: "https://accessors-api-gateway-ueyeemwf2a-oa.a.run.app/token",
@@ -10455,7 +10461,7 @@ class Le {
10455
10461
  privileges;
10456
10462
  cache;
10457
10463
  storage;
10458
- currency = new ne();
10464
+ currency = new pe();
10459
10465
  _app;
10460
10466
  _endpoints;
10461
10467
  _isEmulator;
@@ -10486,17 +10492,17 @@ class Le {
10486
10492
  "Using default SDK app settings. Contact QAECY for your own configuration for any production code."
10487
10493
  );
10488
10494
  const o = t.apiKey ?? ot.apiKey, r = t.appId ?? ot.appId, a = t.measurementId ?? ot.measurementId, i = t.environment ?? "production";
10489
- this._endpoints = { ...ye[i], ...t.endpoints }, this._isEmulator = i === "emulator", this._verbose = t.verbose ?? !1, this._app = Me().find((m) => m.name === "[DEFAULT]") ?? qe({
10495
+ this._endpoints = { ...be[i], ...t.endpoints }, this._isEmulator = i === "emulator", this._verbose = t.verbose ?? !1, this._app = Me().find((m) => m.name === "[DEFAULT]") ?? qe({
10490
10496
  apiKey: o,
10491
10497
  appId: r,
10492
10498
  measurementId: a,
10493
- authDomain: `${It}.firebaseapp.com`,
10494
- projectId: It,
10499
+ authDomain: `${Ct}.firebaseapp.com`,
10500
+ projectId: Ct,
10495
10501
  messagingSenderId: Co
10496
- }), this.auth = new Ft(this._app, this._isEmulator, this._endpoints), this.signup = new Bt(this._endpoints.gatewayUrl), this.projects = new Zt(this.auth, this._app, this._isEmulator, this._endpoints), this._storageRaw = S(this._app, Rt), this._storageProcessed = S(this._app, At);
10497
- const n = S(this._app, Pt), p = S(this._app, Ot), c = S(this._app, xt), h = S(this._app, Dt), d = S(this._app, Ct);
10502
+ }), this.auth = new Bt(this._app, this._isEmulator, this._endpoints), this.signup = new Gt(this._endpoints.gatewayUrl), this.projects = new te(this.auth, this._app, this._isEmulator, this._endpoints), this._storageRaw = S(this._app, At), this._storageProcessed = S(this._app, Ot);
10503
+ const n = S(this._app, Dt), p = S(this._app, Pt), c = S(this._app, Rt), h = S(this._app, $t), d = S(this._app, xt);
10498
10504
  this._isEmulator && (B(this._storageRaw, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort), B(this._storageProcessed, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort), B(n, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort));
10499
- const u = new St({
10505
+ const u = new It({
10500
10506
  storageRaw: this._storageRaw,
10501
10507
  storageProcessed: this._storageProcessed,
10502
10508
  storagePublic: n,
@@ -10505,12 +10511,12 @@ class Le {
10505
10511
  storagePersistence: h,
10506
10512
  storageSessions: d
10507
10513
  });
10508
- this.api = this._buildApi(this.projects, u), this.storage = new Gt(this.auth, this._endpoints.gatewayUrl), this.profile = new te(
10514
+ this.api = this._buildApi(this.projects, u), this.storage = new Ht(this.auth, this._endpoints.gatewayUrl), this.profile = new ee(
10509
10515
  this.auth,
10510
10516
  this._app,
10511
10517
  this._isEmulator,
10512
10518
  this._endpoints.gatewayUrl
10513
- ), this.usageStats = new ee(this.auth, this._endpoints.gatewayUrl), this.api.sync?._bindProfile(this.profile), this.admin = new oe(this.auth, this._endpoints.gatewayUrl), this.privileges = new ae(this.auth.isSuperAdmin), this._isEmulator && B(h, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort), this.cache = new ie(h);
10519
+ ), this.usageStats = new oe(this.auth, this._endpoints.gatewayUrl), this.api.sync?._bindProfile(this.profile), this.admin = new re(this.auth, this._endpoints.gatewayUrl), this.privileges = new ie(this.auth.isSuperAdmin), this._isEmulator && B(h, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort), this.cache = new ne(h);
10514
10520
  }
10515
10521
  /**
10516
10522
  * Create a `Cue` instance from an already-initialized Firebase app.
@@ -10529,7 +10535,7 @@ class Le {
10529
10535
  * });
10530
10536
  */
10531
10537
  static fromApp(t, e = {}) {
10532
- const o = e.environment ?? "production", r = { ...ye[o], ...e.endpoints }, a = new Ft(t, !1, r), i = new Bt(r.gatewayUrl), n = new Zt(a, t, !1, r), p = S(t, Rt), c = S(t, At), h = S(t, Pt), d = S(t, Ot), u = S(t, xt), m = S(t, Dt), w = S(t, Ct), g = new St({
10538
+ const o = e.environment ?? "production", r = { ...be[o], ...e.endpoints }, a = new Bt(t, !1, r), i = new Gt(r.gatewayUrl), n = new te(a, t, !1, r), p = S(t, At), c = S(t, Ot), h = S(t, Dt), d = S(t, Pt), u = S(t, Rt), m = S(t, $t), w = S(t, xt), g = new It({
10533
10539
  storageRaw: p,
10534
10540
  storageProcessed: c,
10535
10541
  storagePublic: h,
@@ -10537,11 +10543,11 @@ class Le {
10537
10543
  storageChatSessions: u,
10538
10544
  storagePersistence: m,
10539
10545
  storageSessions: w
10540
- }), _ = new fe(a, n, g, r.gatewayUrl), f = new Vt(a, r.gatewayUrl, n, _);
10546
+ }), _ = new ye(a, n, g, r.gatewayUrl), f = new Xt(a, r.gatewayUrl, n, _);
10541
10547
  _._bindApi(f);
10542
- const T = new te(a, t, !1, r.gatewayUrl);
10548
+ const T = new ee(a, t, !1, r.gatewayUrl);
10543
10549
  _._bindProfile(T);
10544
- const C = new ee(a, r.gatewayUrl), b = new oe(a, r.gatewayUrl), x = Object.create(Le.prototype), v = new ae(a.isSuperAdmin), I = new ie(m), D = new Gt(a, r.gatewayUrl), Z = new ne();
10550
+ const C = new oe(a, r.gatewayUrl), b = new re(a, r.gatewayUrl), x = Object.create(Le.prototype), v = new ie(a.isSuperAdmin), I = new ne(m), D = new Ht(a, r.gatewayUrl), Z = new pe();
10545
10551
  return Object.assign(x, {
10546
10552
  _app: t,
10547
10553
  _endpoints: r,
@@ -10562,7 +10568,7 @@ class Le {
10562
10568
  }), x;
10563
10569
  }
10564
10570
  _buildApi(t, e) {
10565
- const o = new fe(this.auth, t, e, this._endpoints.gatewayUrl), r = new Vt(this.auth, this._endpoints.gatewayUrl, t, o);
10571
+ const o = new ye(this.auth, t, e, this._endpoints.gatewayUrl), r = new Xt(this.auth, this._endpoints.gatewayUrl, t, o);
10566
10572
  return o._bindApi(r), r;
10567
10573
  }
10568
10574
  /** Convenience: get the current user's Firebase ID token */
@@ -10625,7 +10631,7 @@ class Le {
10625
10631
  const r = this._projectDocuments.get(t);
10626
10632
  if (r)
10627
10633
  return r.setLanguage(this.api.language), r;
10628
- const a = new wt(
10634
+ const a = new ft(
10629
10635
  this.api,
10630
10636
  t,
10631
10637
  this.api.language,
@@ -10635,7 +10641,7 @@ class Le {
10635
10641
  );
10636
10642
  return this._projectDocuments.set(t, a), a;
10637
10643
  }
10638
- return new wt(
10644
+ return new ft(
10639
10645
  this.api,
10640
10646
  t,
10641
10647
  e?.language ?? this.api.language,
@@ -10670,7 +10676,7 @@ class Xa {
10670
10676
  this._api.sparql(this._buildViewDimQuery("mime", e), this._projectId, this._graphType),
10671
10677
  this._api.sparql(this._buildViewDimQuery("content", e), this._projectId, this._graphType),
10672
10678
  this._api.sparql(this._buildViewDimQuery("entity", e), this._projectId, this._graphType)
10673
- ]), h = ve(n, p, c);
10679
+ ]), h = _e(n, p, c);
10674
10680
  if (h.mimes.length + h.contents.length + h.entityCategories.length > 0)
10675
10681
  return h;
10676
10682
  console.warn(
@@ -10683,7 +10689,7 @@ class Xa {
10683
10689
  this._api.sparql(this._buildLiveDimQuery("content", e), this._projectId, this._graphType),
10684
10690
  this._api.sparql(this._buildLiveDimQuery("entity", e), this._projectId, this._graphType)
10685
10691
  ]);
10686
- return ve(r, a, i);
10692
+ return _e(r, a, i);
10687
10693
  }
10688
10694
  /**
10689
10695
  * Lists the *specific* entities (e.g. "John Doe") of a given entity category
@@ -10695,7 +10701,7 @@ class Xa {
10695
10701
  * list shrinks as other filters are added.
10696
10702
  */
10697
10703
  async availableEntities(t, e) {
10698
- const r = be(e ?? {}).join(`
10704
+ const r = ve(e ?? {}).join(`
10699
10705
  `), a = `PREFIX qcy: <${N}>
10700
10706
  SELECT DISTINCT ?entity ?val
10701
10707
  WHERE {
@@ -10765,7 +10771,7 @@ WHERE {
10765
10771
  }
10766
10772
  /** Single-dimension available-filters query using live triple patterns. */
10767
10773
  _buildLiveDimQuery(t, e) {
10768
- const r = be(e).join(`
10774
+ const r = ve(e).join(`
10769
10775
  `);
10770
10776
  return `PREFIX qcy: <${N}>
10771
10777
  SELECT DISTINCT ${t === "mime" ? "?mimeCat" : t === "content" ? "?contentCat" : "?entityCat"}
@@ -10885,7 +10891,7 @@ function Ra(s) {
10885
10891
  }
10886
10892
  return t;
10887
10893
  }
10888
- function be(s) {
10894
+ function ve(s) {
10889
10895
  const t = [];
10890
10896
  for (const e of s.entities ?? [])
10891
10897
  t.push(`?doc qcy:about <${e}> .`);
@@ -10915,7 +10921,7 @@ function be(s) {
10915
10921
  function Ue(s) {
10916
10922
  return s.split("#").pop()?.split("/").pop() ?? s;
10917
10923
  }
10918
- function ve(s, t, e) {
10924
+ function _e(s, t, e) {
10919
10925
  const o = (r, a) => {
10920
10926
  const i = /* @__PURE__ */ new Set(), n = [];
10921
10927
  for (const p of r) {
@@ -10934,22 +10940,22 @@ export {
10934
10940
  E as A,
10935
10941
  za as B,
10936
10942
  Le as C,
10937
- Gt as D,
10938
- fe as E,
10943
+ Ht as D,
10944
+ ye as E,
10939
10945
  Kr as F,
10940
10946
  hs as G,
10941
10947
  Va as H,
10942
- yt as I,
10943
- se as R,
10948
+ bt as I,
10949
+ ae as R,
10944
10950
  qa as S,
10945
- oe as a,
10946
- Vt as b,
10951
+ re as a,
10952
+ Xt as b,
10947
10953
  cs as c,
10948
10954
  ls as d,
10949
- Ft as e,
10950
- ie as f,
10955
+ Bt as e,
10956
+ ne as f,
10951
10957
  Zr as g,
10952
- ne as h,
10958
+ pe as h,
10953
10959
  fs as i,
10954
10960
  us as j,
10955
10961
  Xa as k,
@@ -10958,14 +10964,14 @@ export {
10958
10964
  ts as n,
10959
10965
  ws as o,
10960
10966
  is as p,
10961
- ae as q,
10967
+ ie as q,
10962
10968
  ds as r,
10963
- te as s,
10964
- wt as t,
10969
+ ee as s,
10970
+ ft as t,
10965
10971
  Ne as u,
10966
10972
  ua as v,
10967
10973
  ya as w,
10968
- Zt as x,
10974
+ te as x,
10969
10975
  Wr as y,
10970
- Bt as z
10976
+ Gt as z
10971
10977
  };