@mindbowser_inc/ui-feedback-plugin 0.2.0 → 0.3.1

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.
Files changed (32) hide show
  1. package/README.md +310 -61
  2. package/dist/aws-CkWYvUhs.mjs +134 -0
  3. package/dist/aws-CkWYvUhs.mjs.map +1 -0
  4. package/dist/html2canvas-pro.esm-QETbiPYt.mjs +7587 -0
  5. package/dist/html2canvas-pro.esm-QETbiPYt.mjs.map +1 -0
  6. package/dist/index-B-1NC_TX.mjs +12047 -0
  7. package/dist/index-B-1NC_TX.mjs.map +1 -0
  8. package/dist/index-ClYqXfVs.mjs +183 -0
  9. package/dist/index-ClYqXfVs.mjs.map +1 -0
  10. package/dist/{index-BcqBbswO.mjs → index-D6dCjvzy.mjs} +147 -181
  11. package/dist/index-D6dCjvzy.mjs.map +1 -0
  12. package/dist/index.browser-CKeO7JYa.mjs +190 -0
  13. package/dist/index.browser-CKeO7JYa.mjs.map +1 -0
  14. package/dist/index.d.ts +27 -23
  15. package/dist/loadCognitoIdentity-V6H3EoBY.mjs +957 -0
  16. package/dist/loadCognitoIdentity-V6H3EoBY.mjs.map +1 -0
  17. package/dist/stream-collector-mh16BUWl.mjs +4032 -0
  18. package/dist/stream-collector-mh16BUWl.mjs.map +1 -0
  19. package/dist/{supabase-BUHP2OkK.mjs → supabase-CbB80UVb.mjs} +2 -2
  20. package/dist/{supabase-BUHP2OkK.mjs.map → supabase-CbB80UVb.mjs.map} +1 -1
  21. package/dist/tslib.es6-BNkLP3y-.mjs +112 -0
  22. package/dist/tslib.es6-BNkLP3y-.mjs.map +1 -0
  23. package/dist/ui-feedback-plugin.es.js +4 -4
  24. package/dist/ui-feedback-plugin.es.js.map +1 -1
  25. package/dist/ui-feedback-plugin.umd.js +253 -243
  26. package/dist/ui-feedback-plugin.umd.js.map +1 -1
  27. package/package.json +9 -5
  28. package/dist/html2canvas.esm-d2sM-0Wm.mjs +0 -4871
  29. package/dist/html2canvas.esm-d2sM-0Wm.mjs.map +0 -1
  30. package/dist/index-BcqBbswO.mjs.map +0 -1
  31. package/dist/s3-4V57aJiZ.mjs +0 -66
  32. package/dist/s3-4V57aJiZ.mjs.map +0 -1
@@ -1,38 +1,4 @@
1
- function We(t, e) {
2
- var r = {};
3
- for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && e.indexOf(s) < 0 && (r[s] = t[s]);
4
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
5
- for (var n = 0, s = Object.getOwnPropertySymbols(t); n < s.length; n++)
6
- e.indexOf(s[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, s[n]) && (r[s[n]] = t[s[n]]);
7
- return r;
8
- }
9
- function mr(t, e, r, s) {
10
- function n(i) {
11
- return i instanceof r ? i : new r(function(a) {
12
- a(i);
13
- });
14
- }
15
- return new (r || (r = Promise))(function(i, a) {
16
- function o(u) {
17
- try {
18
- c(s.next(u));
19
- } catch (h) {
20
- a(h);
21
- }
22
- }
23
- function l(u) {
24
- try {
25
- c(s.throw(u));
26
- } catch (h) {
27
- a(h);
28
- }
29
- }
30
- function c(u) {
31
- u.done ? i(u.value) : n(u.value).then(o, l);
32
- }
33
- c((s = s.apply(t, e || [])).next());
34
- });
35
- }
1
+ import { _ as mr, a as We } from "./tslib.es6-BNkLP3y-.mjs";
36
2
  const wr = (t) => t ? (...e) => t(...e) : (...e) => fetch(...e);
37
3
  class ht extends Error {
38
4
  constructor(e, r = "FunctionsError", s) {
@@ -56,7 +22,7 @@ class ft extends ht {
56
22
  super("Relay Error invoking the Edge Function", "FunctionsRelayError", e);
57
23
  }
58
24
  }
59
- class pt extends ht {
25
+ class gt extends ht {
60
26
  constructor(e) {
61
27
  super("Edge Function returned a non-2xx status code", "FunctionsHttpError", e);
62
28
  }
@@ -239,20 +205,20 @@ class br {
239
205
  const { headers: o, method: l, body: c, signal: u, timeout: h } = s;
240
206
  let d = {}, { region: f } = s;
241
207
  f || (f = this.region);
242
- const p = new URL(`${this.url}/${r}`);
243
- f && f !== "any" && (d["x-region"] = f, p.searchParams.set("forceFunctionRegion", f));
244
- let g;
245
- c && (o && !Object.prototype.hasOwnProperty.call(o, "Content-Type") || !o) ? typeof Blob < "u" && c instanceof Blob || c instanceof ArrayBuffer ? (d["Content-Type"] = "application/octet-stream", g = c) : typeof c == "string" ? (d["Content-Type"] = "text/plain", g = c) : typeof FormData < "u" && c instanceof FormData ? g = c : (d["Content-Type"] = "application/json", g = JSON.stringify(c)) : c && typeof c != "string" && !(typeof Blob < "u" && c instanceof Blob) && !(c instanceof ArrayBuffer) && !(typeof FormData < "u" && c instanceof FormData) ? g = JSON.stringify(c) : g = c;
208
+ const g = new URL(`${this.url}/${r}`);
209
+ f && f !== "any" && (d["x-region"] = f, g.searchParams.set("forceFunctionRegion", f));
210
+ let p;
211
+ c && (o && !Object.prototype.hasOwnProperty.call(o, "Content-Type") || !o) ? typeof Blob < "u" && c instanceof Blob || c instanceof ArrayBuffer ? (d["Content-Type"] = "application/octet-stream", p = c) : typeof c == "string" ? (d["Content-Type"] = "text/plain", p = c) : typeof FormData < "u" && c instanceof FormData ? p = c : (d["Content-Type"] = "application/json", p = JSON.stringify(c)) : c && typeof c != "string" && !(typeof Blob < "u" && c instanceof Blob) && !(c instanceof ArrayBuffer) && !(typeof FormData < "u" && c instanceof FormData) ? p = JSON.stringify(c) : p = c;
246
212
  let _ = u;
247
213
  h && (a = new AbortController(), i = setTimeout(() => a.abort(), h), u ? (_ = a.signal, u.addEventListener("abort", () => a.abort())) : _ = a.signal);
248
- const w = yield this.fetch(p.toString(), {
214
+ const w = yield this.fetch(g.toString(), {
249
215
  method: l || "POST",
250
216
  // headers priority is (high to low):
251
217
  // 1. invoke-level headers
252
218
  // 2. client-level headers
253
219
  // 3. default Content-Type header
254
220
  headers: Object.assign(Object.assign(Object.assign({}, d), this.headers), o),
255
- body: g,
221
+ body: p,
256
222
  signal: _
257
223
  }).catch(($) => {
258
224
  throw new _r($);
@@ -260,14 +226,14 @@ class br {
260
226
  if (b && b === "true")
261
227
  throw new ft(w);
262
228
  if (!w.ok)
263
- throw new pt(w);
229
+ throw new gt(w);
264
230
  let v = ((n = w.headers.get("Content-Type")) !== null && n !== void 0 ? n : "text/plain").split(";")[0].trim(), S;
265
231
  return v === "application/json" ? S = yield w.json() : v === "application/octet-stream" || v === "application/pdf" ? S = yield w.blob() : v === "text/event-stream" ? S = w : v === "multipart/form-data" ? S = yield w.formData() : S = yield w.text(), { data: S, error: null, response: w };
266
232
  } catch (o) {
267
233
  return {
268
234
  data: null,
269
235
  error: o,
270
- response: o instanceof pt || o instanceof ft ? o.context : void 0
236
+ response: o instanceof gt || o instanceof ft ? o.context : void 0
271
237
  };
272
238
  } finally {
273
239
  i && clearTimeout(i);
@@ -275,7 +241,7 @@ class br {
275
241
  });
276
242
  }
277
243
  }
278
- const Gt = 3, gt = (t) => Math.min(1e3 * 2 ** t, 3e4), kr = [520, 503], zt = [
244
+ const Gt = 3, pt = (t) => Math.min(1e3 * 2 ** t, 3e4), kr = [520, 503], zt = [
279
245
  "GET",
280
246
  "HEAD",
281
247
  "OPTIONS"
@@ -487,7 +453,7 @@ var Er = class {
487
453
  } catch (h) {
488
454
  if ((h == null ? void 0 : h.name) === "AbortError" || (h == null ? void 0 : h.code) === "ABORT_ERR" || !zt.includes(r.method)) throw h;
489
455
  if (r.retryEnabled && a < Gt) {
490
- const d = gt(a);
456
+ const d = pt(a);
491
457
  a++, await vt(d, r.signal);
492
458
  continue;
493
459
  }
@@ -495,7 +461,7 @@ var Er = class {
495
461
  }
496
462
  if (Sr(r.method, u.status, a, r.retryEnabled)) {
497
463
  var o, l;
498
- const h = (o = (l = u.headers) === null || l === void 0 ? void 0 : l.get("Retry-After")) !== null && o !== void 0 ? o : null, d = h !== null ? Math.max(0, parseInt(h, 10) || 0) * 1e3 : gt(a);
464
+ const h = (o = (l = u.headers) === null || l === void 0 ? void 0 : l.get("Retry-After")) !== null && o !== void 0 ? o : null, d = h !== null ? Math.max(0, parseInt(h, 10) || 0) * 1e3 : pt(a);
499
465
  await u.text(), a++, await vt(d, r.signal);
500
466
  continue;
501
467
  }
@@ -507,11 +473,11 @@ var Er = class {
507
473
  let l = "", c = "", u = "";
508
474
  const h = a == null ? void 0 : a.cause;
509
475
  if (h) {
510
- var d, f, p, g;
476
+ var d, f, g, p;
511
477
  const b = (d = h == null ? void 0 : h.message) !== null && d !== void 0 ? d : "", v = (f = h == null ? void 0 : h.code) !== null && f !== void 0 ? f : "";
512
- l = `${(p = a == null ? void 0 : a.name) !== null && p !== void 0 ? p : "FetchError"}: ${a == null ? void 0 : a.message}`, l += `
478
+ l = `${(g = a == null ? void 0 : a.name) !== null && g !== void 0 ? g : "FetchError"}: ${a == null ? void 0 : a.message}`, l += `
513
479
 
514
- Caused by: ${(g = h == null ? void 0 : h.name) !== null && g !== void 0 ? g : "Error"}: ${b}`, v && (l += ` (${v})`), h != null && h.stack && (l += `
480
+ Caused by: ${(p = h == null ? void 0 : h.name) !== null && p !== void 0 ? p : "Error"}: ${b}`, v && (l += ` (${v})`), h != null && h.stack && (l += `
515
481
  ${h.stack}`);
516
482
  } else {
517
483
  var _;
@@ -4897,11 +4863,11 @@ var Pr = class Yt {
4897
4863
  if (f) {
4898
4864
  if (f.aborted)
4899
4865
  return clearTimeout(d), l(c, u);
4900
- const p = () => {
4866
+ const g = () => {
4901
4867
  clearTimeout(d), h.abort();
4902
4868
  };
4903
- return f.addEventListener("abort", p, { once: !0 }), l(c, Re(Re({}, u), {}, { signal: h.signal })).finally(() => {
4904
- clearTimeout(d), f.removeEventListener("abort", p);
4869
+ return f.addEventListener("abort", g, { once: !0 }), l(c, Re(Re({}, u), {}, { signal: h.signal })).finally(() => {
4870
+ clearTimeout(d), f.removeEventListener("abort", g);
4905
4871
  });
4906
4872
  }
4907
4873
  return l(c, Re(Re({}, u), {}, { signal: h.signal })).finally(() => clearTimeout(d));
@@ -5113,8 +5079,8 @@ var Pr = class Yt {
5113
5079
  const l = new URL(`${this.url}/rpc/${e}`);
5114
5080
  let c;
5115
5081
  const u = (f) => f !== null && typeof f == "object" && (!Array.isArray(f) || f.some(u)), h = s && Object.values(r).some(u);
5116
- h ? (o = "POST", c = r) : s || n ? (o = s ? "HEAD" : "GET", Object.entries(r).filter(([f, p]) => p !== void 0).map(([f, p]) => [f, Array.isArray(p) ? `{${p.join(",")}}` : `${p}`]).forEach(([f, p]) => {
5117
- l.searchParams.append(f, p);
5082
+ h ? (o = "POST", c = r) : s || n ? (o = s ? "HEAD" : "GET", Object.entries(r).filter(([f, g]) => g !== void 0).map(([f, g]) => [f, Array.isArray(g) ? `{${g.join(",")}}` : `${g}`]).forEach(([f, g]) => {
5083
+ l.searchParams.append(f, g);
5118
5084
  })) : (o = "POST", c = r);
5119
5085
  const d = new Headers(this.headers);
5120
5086
  return h ? d.set("Prefer", i ? `count=${i},return=minimal` : "return=minimal") : i && d.set("Prefer", `count=${i}`), new ie({
@@ -5282,8 +5248,8 @@ class Dr {
5282
5248
  if (h.length > 255)
5283
5249
  throw new Error(`metadata length ${h.length} exceeds maximum of 255`);
5284
5250
  const d = this.USER_BROADCAST_PUSH_META_LENGTH + l.length + o.length + a.length + c.length + h.length, f = new ArrayBuffer(this.HEADER_LENGTH + d);
5285
- let p = new DataView(f), g = 0;
5286
- p.setUint8(g++, this.KINDS.userBroadcastPush), p.setUint8(g++, l.length), p.setUint8(g++, o.length), p.setUint8(g++, a.length), p.setUint8(g++, c.length), p.setUint8(g++, h.length), p.setUint8(g++, r), Array.from(l, (w) => p.setUint8(g++, w.charCodeAt(0))), Array.from(o, (w) => p.setUint8(g++, w.charCodeAt(0))), Array.from(a, (w) => p.setUint8(g++, w.charCodeAt(0))), Array.from(c, (w) => p.setUint8(g++, w.charCodeAt(0))), Array.from(h, (w) => p.setUint8(g++, w.charCodeAt(0)));
5251
+ let g = new DataView(f), p = 0;
5252
+ g.setUint8(p++, this.KINDS.userBroadcastPush), g.setUint8(p++, l.length), g.setUint8(p++, o.length), g.setUint8(p++, a.length), g.setUint8(p++, c.length), g.setUint8(p++, h.length), g.setUint8(p++, r), Array.from(l, (w) => g.setUint8(p++, w.charCodeAt(0))), Array.from(o, (w) => g.setUint8(p++, w.charCodeAt(0))), Array.from(a, (w) => g.setUint8(p++, w.charCodeAt(0))), Array.from(c, (w) => g.setUint8(p++, w.charCodeAt(0))), Array.from(h, (w) => g.setUint8(p++, w.charCodeAt(0)));
5287
5253
  var _ = new Uint8Array(f.byteLength + s.byteLength);
5288
5254
  return _.set(new Uint8Array(f), 0), _.set(new Uint8Array(s), f.byteLength), _.buffer;
5289
5255
  }
@@ -5314,12 +5280,12 @@ class Dr {
5314
5280
  l = l + i;
5315
5281
  const h = s.decode(e.slice(l, l + a));
5316
5282
  l = l + a;
5317
- const d = e.slice(l, e.byteLength), f = o === this.JSON_ENCODING ? JSON.parse(s.decode(d)) : d, p = {
5283
+ const d = e.slice(l, e.byteLength), f = o === this.JSON_ENCODING ? JSON.parse(s.decode(d)) : d, g = {
5318
5284
  type: this.BROADCAST_EVENT,
5319
5285
  event: u,
5320
5286
  payload: f
5321
5287
  };
5322
- return a > 0 && (p.meta = JSON.parse(h)), { join_ref: null, ref: null, topic: c, event: this.BROADCAST_EVENT, payload: p };
5288
+ return a > 0 && (g.meta = JSON.parse(h)), { join_ref: null, ref: null, topic: c, event: this.BROADCAST_EVENT, payload: g };
5323
5289
  }
5324
5290
  _isArrayBuffer(e) {
5325
5291
  var r;
@@ -5421,7 +5387,7 @@ const _t = (t, e, r = {}) => {
5421
5387
  const e = new URL(t);
5422
5388
  return e.protocol = e.protocol.replace(/^ws/i, "http"), e.pathname = e.pathname.replace(/\/+$/, "").replace(/\/socket\/websocket$/i, "").replace(/\/socket$/i, "").replace(/\/websocket$/i, ""), e.pathname === "" || e.pathname === "/" ? e.pathname = "/api/broadcast" : e.pathname = e.pathname + "/api/broadcast", e.href;
5423
5389
  };
5424
- var ge = (t) => typeof t == "function" ? (
5390
+ var pe = (t) => typeof t == "function" ? (
5425
5391
  /** @type {() => T} */
5426
5392
  t
5427
5393
  ) : function() {
@@ -5561,7 +5527,7 @@ var ge = (t) => typeof t == "function" ? (
5561
5527
  * @param {Socket} socket
5562
5528
  */
5563
5529
  constructor(t, e, r) {
5564
- this.state = I.closed, this.topic = t, this.params = ge(e || {}), this.socket = r, this.bindings = [], this.bindingRef = 0, this.timeout = this.socket.timeout, this.joinedOnce = !1, this.joinPush = new Oe(this, V.join, this.params, this.timeout), this.pushBuffer = [], this.stateChangeRefs = [], this.rejoinTimer = new tr(() => {
5530
+ this.state = I.closed, this.topic = t, this.params = pe(e || {}), this.socket = r, this.bindings = [], this.bindingRef = 0, this.timeout = this.socket.timeout, this.joinedOnce = !1, this.joinPush = new Oe(this, V.join, this.params, this.timeout), this.pushBuffer = [], this.stateChangeRefs = [], this.rejoinTimer = new tr(() => {
5565
5531
  this.socket.isConnected() && this.rejoin();
5566
5532
  }, this.socket.rejoinAfterMs), this.stateChangeRefs.push(this.socket.onError(() => this.rejoinTimer.reset())), this.stateChangeRefs.push(
5567
5533
  this.socket.onOpen(() => {
@@ -5576,7 +5542,7 @@ var ge = (t) => typeof t == "function" ? (
5576
5542
  }), this.onError((s) => {
5577
5543
  this.socket.hasLogger() && this.socket.log("channel", `error ${this.topic}`, s), this.isJoining() && this.joinPush.reset(), this.state = I.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
5578
5544
  }), this.joinPush.receive("timeout", () => {
5579
- this.socket.hasLogger() && this.socket.log("channel", `timeout ${this.topic}`, this.joinPush.timeout), new Oe(this, V.leave, ge({}), this.timeout).send(), this.state = I.errored, this.joinPush.reset(), this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
5545
+ this.socket.hasLogger() && this.socket.log("channel", `timeout ${this.topic}`, this.joinPush.timeout), new Oe(this, V.leave, pe({}), this.timeout).send(), this.state = I.errored, this.joinPush.reset(), this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
5580
5546
  }), this.on(V.reply, (s, n) => {
5581
5547
  this.trigger(this.replyEventName(n), s);
5582
5548
  });
@@ -5706,7 +5672,7 @@ var ge = (t) => typeof t == "function" ? (
5706
5672
  this.rejoinTimer.reset(), this.joinPush.cancelTimeout(), this.state = I.leaving;
5707
5673
  let e = () => {
5708
5674
  this.socket.hasLogger() && this.socket.log("channel", `leave ${this.topic}`), this.trigger(V.close, "leave");
5709
- }, r = new Oe(this, V.leave, ge({}), t);
5675
+ }, r = new Oe(this, V.leave, pe({}), t);
5710
5676
  return r.receive("ok", () => e()).receive("timeout", () => e()), r.send(), this.canPush() || r.trigger("ok", {}), r;
5711
5677
  }
5712
5678
  /**
@@ -6017,8 +5983,8 @@ var ge = (t) => typeof t == "function" ? (
6017
5983
  }), this.map(r, (l, c) => {
6018
5984
  let u = i[l];
6019
5985
  if (u) {
6020
- let h = c.metas.map((g) => g.phx_ref), d = u.metas.map((g) => g.phx_ref), f = c.metas.filter((g) => d.indexOf(g.phx_ref) < 0), p = u.metas.filter((g) => h.indexOf(g.phx_ref) < 0);
6021
- f.length > 0 && (a[l] = c, a[l].metas = f), p.length > 0 && (o[l] = this.clone(u), o[l].metas = p);
5986
+ let h = c.metas.map((p) => p.phx_ref), d = u.metas.map((p) => p.phx_ref), f = c.metas.filter((p) => d.indexOf(p.phx_ref) < 0), g = u.metas.filter((p) => h.indexOf(p.phx_ref) < 0);
5987
+ f.length > 0 && (a[l] = c, a[l].metas = f), g.length > 0 && (o[l] = this.clone(u), o[l].metas = g);
6022
5988
  } else
6023
5989
  a[l] = c;
6024
5990
  }), this.syncDiff(i, { joins: a, leaves: o }, s, n);
@@ -6202,7 +6168,7 @@ var ge = (t) => typeof t == "function" ? (
6202
6168
  })), this.heartbeatIntervalMs = e.heartbeatIntervalMs || 3e4, this.autoSendHeartbeat = e.autoSendHeartbeat ?? !0, this.heartbeatCallback = e.heartbeatCallback ?? (() => {
6203
6169
  }), this.rejoinAfterMs = (n) => e.rejoinAfterMs ? e.rejoinAfterMs(n) : [1e3, 2e3, 5e3][n - 1] || 1e4, this.reconnectAfterMs = (n) => e.reconnectAfterMs ? e.reconnectAfterMs(n) : [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][n - 1] || 5e3, this.logger = e.logger || null, !this.logger && e.debug && (this.logger = (n, i, a) => {
6204
6170
  console.log(`${n}: ${i}`, a);
6205
- }), this.longpollerTimeout = e.longpollerTimeout || 2e4, this.params = ge(e.params || {}), this.endPoint = `${t}/${st.websocket}`, this.vsn = e.vsn || Vr, this.heartbeatTimeoutTimer = null, this.heartbeatTimer = null, this.heartbeatSentAt = null, this.pendingHeartbeatRef = null, this.reconnectTimer = new tr(() => {
6171
+ }), this.longpollerTimeout = e.longpollerTimeout || 2e4, this.params = pe(e.params || {}), this.endPoint = `${t}/${st.websocket}`, this.vsn = e.vsn || Vr, this.heartbeatTimeoutTimer = null, this.heartbeatTimer = null, this.heartbeatSentAt = null, this.pendingHeartbeatRef = null, this.reconnectTimer = new tr(() => {
6206
6172
  if (this.pageHidden) {
6207
6173
  this.log("Not reconnecting as page is hidden!"), this.teardown();
6208
6174
  return;
@@ -6268,7 +6234,7 @@ var ge = (t) => typeof t == "function" ? (
6268
6234
  * `new Socket("/socket", {params: {user_id: userToken}})`.
6269
6235
  */
6270
6236
  connect(t) {
6271
- t && (console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"), this.params = ge(t)), !(this.conn && !this.disconnecting) && (this.longPollFallbackMs && this.transport !== te ? this.connectWithFallback(te, this.longPollFallbackMs) : this.transportConnect());
6237
+ t && (console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"), this.params = pe(t)), !(this.conn && !this.disconnecting) && (this.longPollFallbackMs && this.transport !== te ? this.connectWithFallback(te, this.longPollFallbackMs) : this.transportConnect());
6272
6238
  }
6273
6239
  /**
6274
6240
  * Logs the message. Override `this.logger` for specialized logging. noops by default
@@ -6843,7 +6809,7 @@ var J;
6843
6809
  (function(t) {
6844
6810
  t.SUBSCRIBED = "SUBSCRIBED", t.TIMED_OUT = "TIMED_OUT", t.CLOSED = "CLOSED", t.CHANNEL_ERROR = "CHANNEL_ERROR";
6845
6811
  })(J || (J = {}));
6846
- const mi = z;
6812
+ const wi = z;
6847
6813
  class ve {
6848
6814
  get state() {
6849
6815
  return this.channelAdapter.state;
@@ -6941,8 +6907,8 @@ class ve {
6941
6907
  this._updatePostgresBindings(f, e);
6942
6908
  }).receive("error", (f) => {
6943
6909
  this.state = z.errored;
6944
- const p = Object.values(f).join(", ") || "error";
6945
- e == null || e(J.CHANNEL_ERROR, new Error(p, { cause: f }));
6910
+ const g = Object.values(f).join(", ") || "error";
6911
+ e == null || e(J.CHANNEL_ERROR, new Error(g, { cause: f }));
6946
6912
  }).receive("timeout", () => {
6947
6913
  e == null || e(J.TIMED_OUT);
6948
6914
  });
@@ -7367,8 +7333,8 @@ class ve {
7367
7333
  return !0;
7368
7334
  if (["broadcast", "presence", "postgres_changes"].includes(h))
7369
7335
  if ("id" in d) {
7370
- const f = d.id, p = (i = d.filter) === null || i === void 0 ? void 0 : i.event;
7371
- return f && ((a = r.ids) === null || a === void 0 ? void 0 : a.includes(f)) && (p === "*" || (p == null ? void 0 : p.toLocaleLowerCase()) === ((o = r.data) === null || o === void 0 ? void 0 : o.type.toLocaleLowerCase()));
7336
+ const f = d.id, g = (i = d.filter) === null || i === void 0 ? void 0 : i.event;
7337
+ return f && ((a = r.ids) === null || a === void 0 ? void 0 : a.includes(f)) && (g === "*" || (g == null ? void 0 : g.toLocaleLowerCase()) === ((o = r.data) === null || o === void 0 ? void 0 : o.type.toLocaleLowerCase()));
7372
7338
  } else {
7373
7339
  const f = (c = (l = d == null ? void 0 : d.filter) === null || l === void 0 ? void 0 : l.event) === null || c === void 0 ? void 0 : c.toLocaleLowerCase();
7374
7340
  return f === "*" || f === ((u = r == null ? void 0 : r.event) === null || u === void 0 ? void 0 : u.toLocaleLowerCase());
@@ -8005,26 +7971,26 @@ Option 2: Install and provide the "ws" package:
8005
7971
  _initializeOptions(e) {
8006
7972
  var r, s, n, i, a, o, l, c, u, h, d, f;
8007
7973
  this.worker = (r = e == null ? void 0 : e.worker) !== null && r !== void 0 ? r : !1, this.accessToken = (s = e == null ? void 0 : e.accessToken) !== null && s !== void 0 ? s : null;
8008
- const p = {};
8009
- p.timeout = (n = e == null ? void 0 : e.timeout) !== null && n !== void 0 ? n : Ur, p.heartbeatIntervalMs = (i = e == null ? void 0 : e.heartbeatIntervalMs) !== null && i !== void 0 ? i : Et.HEARTBEAT_INTERVAL, this._disconnectOnEmptyChannelsAfterMs = (a = e == null ? void 0 : e.disconnectOnEmptyChannelsAfterMs) !== null && a !== void 0 ? a : 2 * ((o = e == null ? void 0 : e.heartbeatIntervalMs) !== null && o !== void 0 ? o : Et.HEARTBEAT_INTERVAL), p.transport = (l = e == null ? void 0 : e.transport) !== null && l !== void 0 ? l : jr.getWebSocketConstructor(), p.params = e == null ? void 0 : e.params, p.logger = e == null ? void 0 : e.logger, p.heartbeatCallback = this._wrapHeartbeatCallback(e == null ? void 0 : e.heartbeatCallback), p.sessionStorage = (c = e == null ? void 0 : e.sessionStorage) !== null && c !== void 0 ? c : us(), p.reconnectAfterMs = (u = e == null ? void 0 : e.reconnectAfterMs) !== null && u !== void 0 ? u : (b) => os[b - 1] || ls;
8010
- let g, _;
7974
+ const g = {};
7975
+ g.timeout = (n = e == null ? void 0 : e.timeout) !== null && n !== void 0 ? n : Ur, g.heartbeatIntervalMs = (i = e == null ? void 0 : e.heartbeatIntervalMs) !== null && i !== void 0 ? i : Et.HEARTBEAT_INTERVAL, this._disconnectOnEmptyChannelsAfterMs = (a = e == null ? void 0 : e.disconnectOnEmptyChannelsAfterMs) !== null && a !== void 0 ? a : 2 * ((o = e == null ? void 0 : e.heartbeatIntervalMs) !== null && o !== void 0 ? o : Et.HEARTBEAT_INTERVAL), g.transport = (l = e == null ? void 0 : e.transport) !== null && l !== void 0 ? l : jr.getWebSocketConstructor(), g.params = e == null ? void 0 : e.params, g.logger = e == null ? void 0 : e.logger, g.heartbeatCallback = this._wrapHeartbeatCallback(e == null ? void 0 : e.heartbeatCallback), g.sessionStorage = (c = e == null ? void 0 : e.sessionStorage) !== null && c !== void 0 ? c : us(), g.reconnectAfterMs = (u = e == null ? void 0 : e.reconnectAfterMs) !== null && u !== void 0 ? u : (b) => os[b - 1] || ls;
7976
+ let p, _;
8011
7977
  const w = (h = e == null ? void 0 : e.vsn) !== null && h !== void 0 ? h : Nr;
8012
7978
  switch (w) {
8013
7979
  case xr:
8014
- g = (b, v) => v(JSON.stringify(b)), _ = (b, v) => v(JSON.parse(b));
7980
+ p = (b, v) => v(JSON.stringify(b)), _ = (b, v) => v(JSON.parse(b));
8015
7981
  break;
8016
7982
  case Xt:
8017
- g = this.serializer.encode.bind(this.serializer), _ = this.serializer.decode.bind(this.serializer);
7983
+ p = this.serializer.encode.bind(this.serializer), _ = this.serializer.decode.bind(this.serializer);
8018
7984
  break;
8019
7985
  default:
8020
- throw new Error(`Unsupported serializer version: ${p.vsn}`);
7986
+ throw new Error(`Unsupported serializer version: ${g.vsn}`);
8021
7987
  }
8022
- if (p.vsn = w, p.encode = (d = e == null ? void 0 : e.encode) !== null && d !== void 0 ? d : g, p.decode = (f = e == null ? void 0 : e.decode) !== null && f !== void 0 ? f : _, p.beforeReconnect = this._reconnectAuth.bind(this), (e != null && e.logLevel || e != null && e.log_level) && (this.logLevel = e.logLevel || e.log_level, p.params = Object.assign(Object.assign({}, p.params), { log_level: this.logLevel })), this.worker) {
7988
+ if (g.vsn = w, g.encode = (d = e == null ? void 0 : e.encode) !== null && d !== void 0 ? d : p, g.decode = (f = e == null ? void 0 : e.decode) !== null && f !== void 0 ? f : _, g.beforeReconnect = this._reconnectAuth.bind(this), (e != null && e.logLevel || e != null && e.log_level) && (this.logLevel = e.logLevel || e.log_level, g.params = Object.assign(Object.assign({}, g.params), { log_level: this.logLevel })), this.worker) {
8023
7989
  if (typeof window < "u" && !window.Worker)
8024
7990
  throw new Error("Web Worker is not supported");
8025
- this.workerUrl = e == null ? void 0 : e.workerUrl, p.autoSendHeartbeat = !this.worker;
7991
+ this.workerUrl = e == null ? void 0 : e.workerUrl, g.autoSendHeartbeat = !this.worker;
8026
7992
  }
8027
- return p;
7993
+ return g;
8028
7994
  }
8029
7995
  /** @internal */
8030
7996
  async _reconnectAuth() {
@@ -8062,10 +8028,10 @@ function fs(t, e, r) {
8062
8028
  i !== void 0 && s.searchParams.set(n, i);
8063
8029
  return s.toString();
8064
8030
  }
8065
- async function ps(t) {
8031
+ async function gs(t) {
8066
8032
  return !t || t.type === "none" ? {} : t.type === "bearer" ? { Authorization: `Bearer ${t.token}` } : t.type === "header" ? { [t.name]: t.value } : t.type === "custom" ? await t.getHeaders() : {};
8067
8033
  }
8068
- function gs(t) {
8034
+ function ps(t) {
8069
8035
  const e = t.fetchImpl ?? globalThis.fetch;
8070
8036
  return {
8071
8037
  async request({
@@ -8075,7 +8041,7 @@ function gs(t) {
8075
8041
  body: i,
8076
8042
  headers: a
8077
8043
  }) {
8078
- const o = fs(t.baseUrl, s, n), l = await ps(t.auth), c = await e(o, {
8044
+ const o = fs(t.baseUrl, s, n), l = await gs(t.auth), c = await e(o, {
8079
8045
  method: r,
8080
8046
  headers: {
8081
8047
  ...i ? { "Content-Type": "application/json" } : {},
@@ -8085,13 +8051,13 @@ function gs(t) {
8085
8051
  body: i ? JSON.stringify(i) : void 0
8086
8052
  }), u = await c.text(), h = (c.headers.get("content-type") || "").includes("application/json"), d = h && u ? JSON.parse(u) : u;
8087
8053
  if (!c.ok) {
8088
- const f = h ? d : void 0, p = f == null ? void 0 : f.error;
8054
+ const f = h ? d : void 0, g = f == null ? void 0 : f.error;
8089
8055
  throw new we(
8090
- (p == null ? void 0 : p.message) ?? `Request failed with status ${c.status}`,
8056
+ (g == null ? void 0 : g.message) ?? `Request failed with status ${c.status}`,
8091
8057
  {
8092
8058
  status: c.status,
8093
- icebergType: p == null ? void 0 : p.type,
8094
- icebergCode: p == null ? void 0 : p.code,
8059
+ icebergType: g == null ? void 0 : g.type,
8060
+ icebergCode: g == null ? void 0 : g.code,
8095
8061
  details: f
8096
8062
  }
8097
8063
  );
@@ -8245,7 +8211,7 @@ var vs = class {
8245
8211
  let e = "v1";
8246
8212
  t.catalogName && (e += `/${t.catalogName}`);
8247
8213
  const r = t.baseUrl.endsWith("/") ? t.baseUrl : `${t.baseUrl}/`;
8248
- this.client = gs({
8214
+ this.client = ps({
8249
8215
  baseUrl: r,
8250
8216
  auth: t.auth,
8251
8217
  fetchImpl: t.fetch
@@ -11080,7 +11046,7 @@ class Zs extends F {
11080
11046
  super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.", "AuthPKCECodeVerifierMissingError", 400, "pkce_code_verifier_not_found");
11081
11047
  }
11082
11048
  }
11083
- function wi(t) {
11049
+ function _i(t) {
11084
11050
  return y(t) && t.name === "AuthPKCECodeVerifierMissingError";
11085
11051
  }
11086
11052
  class ct extends F {
@@ -11107,7 +11073,7 @@ class jt extends F {
11107
11073
  return Object.assign(Object.assign({}, super.toJSON()), { reasons: this.reasons });
11108
11074
  }
11109
11075
  }
11110
- function _i(t) {
11076
+ function bi(t) {
11111
11077
  return y(t) && t.name === "AuthWeakPasswordError";
11112
11078
  }
11113
11079
  class De extends F {
@@ -11340,7 +11306,7 @@ function dn(t, e) {
11340
11306
  function fn(t) {
11341
11307
  return ("0" + t.toString(16)).substr(-2);
11342
11308
  }
11343
- function pn() {
11309
+ function gn() {
11344
11310
  const e = new Uint32Array(56);
11345
11311
  if (typeof crypto > "u") {
11346
11312
  const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", s = r.length;
@@ -11351,18 +11317,18 @@ function pn() {
11351
11317
  }
11352
11318
  return crypto.getRandomValues(e), Array.from(e, fn).join("");
11353
11319
  }
11354
- async function gn(t) {
11320
+ async function pn(t) {
11355
11321
  const r = new TextEncoder().encode(t), s = await crypto.subtle.digest("SHA-256", r), n = new Uint8Array(s);
11356
11322
  return Array.from(n).map((i) => String.fromCharCode(i)).join("");
11357
11323
  }
11358
11324
  async function yn(t) {
11359
11325
  if (!(typeof crypto < "u" && typeof crypto.subtle < "u" && typeof TextEncoder < "u"))
11360
11326
  return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."), t;
11361
- const r = await gn(t);
11327
+ const r = await pn(t);
11362
11328
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
11363
11329
  }
11364
11330
  async function Q(t, e, r = !1) {
11365
- const s = pn();
11331
+ const s = gn();
11366
11332
  let n = s;
11367
11333
  r && (n += "/recovery"), await oe(t, `${e}-code-verifier`, n);
11368
11334
  const i = await yn(s);
@@ -11994,9 +11960,9 @@ class hr {
11994
11960
  if (u.error)
11995
11961
  throw u.error;
11996
11962
  const h = await u.json(), d = (a = u.headers.get("x-total-count")) !== null && a !== void 0 ? a : 0, f = (l = (o = u.headers.get("link")) === null || o === void 0 ? void 0 : o.split(",")) !== null && l !== void 0 ? l : [];
11997
- return f.length > 0 && (f.forEach((p) => {
11998
- const g = parseInt(p.split(";")[0].split("=")[1].substring(0, 1)), _ = JSON.parse(p.split(";")[1].split("=")[1]);
11999
- c[`${_}Page`] = g;
11963
+ return f.length > 0 && (f.forEach((g) => {
11964
+ const p = parseInt(g.split(";")[0].split("=")[1].substring(0, 1)), _ = JSON.parse(g.split(";")[1].split("=")[1]);
11965
+ c[`${_}Page`] = p;
12000
11966
  }), c.total = parseInt(d)), { data: Object.assign(Object.assign({}, h), c), error: null };
12001
11967
  } catch (c) {
12002
11968
  if (y(c))
@@ -12332,9 +12298,9 @@ class hr {
12332
12298
  if (u.error)
12333
12299
  throw u.error;
12334
12300
  const h = await u.json(), d = (a = u.headers.get("x-total-count")) !== null && a !== void 0 ? a : 0, f = (l = (o = u.headers.get("link")) === null || o === void 0 ? void 0 : o.split(",")) !== null && l !== void 0 ? l : [];
12335
- return f.length > 0 && (f.forEach((p) => {
12336
- const g = parseInt(p.split(";")[0].split("=")[1].substring(0, 1)), _ = JSON.parse(p.split(";")[1].split("=")[1]);
12337
- c[`${_}Page`] = g;
12301
+ return f.length > 0 && (f.forEach((g) => {
12302
+ const p = parseInt(g.split(";")[0].split("=")[1].substring(0, 1)), _ = JSON.parse(g.split(";")[1].split("=")[1]);
12303
+ c[`${_}Page`] = p;
12338
12304
  }), c.total = parseInt(d)), { data: Object.assign(Object.assign({}, h), c), error: null };
12339
12305
  } catch (c) {
12340
12306
  if (y(c))
@@ -12598,7 +12564,7 @@ class qt extends Se {
12598
12564
  }
12599
12565
  class Cn extends Se {
12600
12566
  }
12601
- async function bi(t, e, r) {
12567
+ async function ki(t, e, r) {
12602
12568
  q.debug && console.log("@supabase/gotrue-js: navigatorLock: acquire lock", t, e);
12603
12569
  const s = new globalThis.AbortController();
12604
12570
  let n;
@@ -12656,7 +12622,7 @@ async function bi(t, e, r) {
12656
12622
  }
12657
12623
  }
12658
12624
  const Ht = {};
12659
- async function ki(t, e, r) {
12625
+ async function Si(t, e, r) {
12660
12626
  var s;
12661
12627
  const n = (s = Ht[t]) !== null && s !== void 0 ? s : Promise.resolve(), i = (async () => {
12662
12628
  try {
@@ -12737,11 +12703,11 @@ function $n(t) {
12737
12703
  `))
12738
12704
  throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`);
12739
12705
  }
12740
- const f = dr(t.address), p = u ? `${u}://${s}` : s, g = t.statement ? `${t.statement}
12741
- ` : "", _ = `${p} wants you to sign in with your Ethereum account:
12706
+ const f = dr(t.address), g = u ? `${u}://${s}` : s, p = t.statement ? `${t.statement}
12707
+ ` : "", _ = `${g} wants you to sign in with your Ethereum account:
12742
12708
  ${f}
12743
12709
 
12744
- ${g}`;
12710
+ ${p}`;
12745
12711
  let w = `URI: ${h}
12746
12712
  Version: ${d}
12747
12713
  Chain ID: ${r}${a ? `
@@ -13053,7 +13019,7 @@ function He() {
13053
13019
  var t, e;
13054
13020
  return !!(j() && "PublicKeyCredential" in window && window.PublicKeyCredential && "credentials" in navigator && typeof ((t = navigator == null ? void 0 : navigator.credentials) === null || t === void 0 ? void 0 : t.create) == "function" && typeof ((e = navigator == null ? void 0 : navigator.credentials) === null || e === void 0 ? void 0 : e.get) == "function");
13055
13021
  }
13056
- async function pr(t) {
13022
+ async function gr(t) {
13057
13023
  try {
13058
13024
  const e = await navigator.credentials.create(
13059
13025
  /** we assert the type here until typescript types are updated */
@@ -13076,7 +13042,7 @@ async function pr(t) {
13076
13042
  };
13077
13043
  }
13078
13044
  }
13079
- async function gr(t) {
13045
+ async function pr(t) {
13080
13046
  try {
13081
13047
  const e = await navigator.credentials.get(
13082
13048
  /** we assert the type here until typescript types are updated */
@@ -13187,15 +13153,15 @@ class Hn {
13187
13153
  if (h)
13188
13154
  u.name = `${u.id}:${h}`;
13189
13155
  else {
13190
- const f = (await this.client.getUser()).data.user, p = ((a = f == null ? void 0 : f.user_metadata) === null || a === void 0 ? void 0 : a.name) || (f == null ? void 0 : f.email) || (f == null ? void 0 : f.id) || "User";
13191
- u.name = `${u.id}:${p}`;
13156
+ const f = (await this.client.getUser()).data.user, g = ((a = f == null ? void 0 : f.user_metadata) === null || a === void 0 ? void 0 : a.name) || (f == null ? void 0 : f.email) || (f == null ? void 0 : f.id) || "User";
13157
+ u.name = `${u.id}:${g}`;
13192
13158
  }
13193
13159
  }
13194
13160
  u.displayName || (u.displayName = u.name);
13195
13161
  }
13196
13162
  switch (o.webauthn.type) {
13197
13163
  case "create": {
13198
- const u = Bn(o.webauthn.credential_options.publicKey, i == null ? void 0 : i.create), { data: h, error: d } = await pr({
13164
+ const u = Bn(o.webauthn.credential_options.publicKey, i == null ? void 0 : i.create), { data: h, error: d } = await gr({
13199
13165
  publicKey: u,
13200
13166
  signal: c
13201
13167
  });
@@ -13212,7 +13178,7 @@ class Hn {
13212
13178
  } : { data: null, error: d };
13213
13179
  }
13214
13180
  case "request": {
13215
- const u = qn(o.webauthn.credential_options.publicKey, i == null ? void 0 : i.request), { data: h, error: d } = await gr(Object.assign(Object.assign({}, o.webauthn.credential_options), { publicKey: u, signal: c }));
13181
+ const u = qn(o.webauthn.credential_options.publicKey, i == null ? void 0 : i.request), { data: h, error: d } = await pr(Object.assign(Object.assign({}, o.webauthn.credential_options), { publicKey: u, signal: c }));
13216
13182
  return h ? {
13217
13183
  data: {
13218
13184
  factorId: e,
@@ -13832,8 +13798,8 @@ class Ee {
13832
13798
  let i;
13833
13799
  if ("email" in e) {
13834
13800
  const { email: u, password: h, options: d } = e;
13835
- let f = null, p = null;
13836
- this.flowType === "pkce" && ([f, p] = await Q(this.storage, this.storageKey)), i = await m(this.fetch, "POST", `${this.url}/signup`, {
13801
+ let f = null, g = null;
13802
+ this.flowType === "pkce" && ([f, g] = await Q(this.storage, this.storageKey)), i = await m(this.fetch, "POST", `${this.url}/signup`, {
13837
13803
  headers: this.headers,
13838
13804
  redirectTo: d == null ? void 0 : d.emailRedirectTo,
13839
13805
  body: {
@@ -13842,7 +13808,7 @@ class Ee {
13842
13808
  data: (r = d == null ? void 0 : d.data) !== null && r !== void 0 ? r : {},
13843
13809
  gotrue_meta_security: { captcha_token: d == null ? void 0 : d.captchaToken },
13844
13810
  code_challenge: f,
13845
- code_challenge_method: p
13811
+ code_challenge_method: g
13846
13812
  },
13847
13813
  xform: N
13848
13814
  });
@@ -14410,11 +14376,11 @@ class Ee {
14410
14376
  }
14411
14377
  async signInWithEthereum(e) {
14412
14378
  var r, s, n, i, a, o, l, c, u, h, d;
14413
- let f, p;
14379
+ let f, g;
14414
14380
  if ("message" in e)
14415
- f = e.message, p = e.signature;
14381
+ f = e.message, g = e.signature;
14416
14382
  else {
14417
- const { chain: g, wallet: _, statement: w, options: b } = e;
14383
+ const { chain: p, wallet: _, statement: w, options: b } = e;
14418
14384
  let v;
14419
14385
  if (j())
14420
14386
  if (typeof _ == "object")
@@ -14460,39 +14426,39 @@ class Ee {
14460
14426
  requestId: (c = b == null ? void 0 : b.signInWithEthereum) === null || c === void 0 ? void 0 : c.requestId,
14461
14427
  resources: (u = b == null ? void 0 : b.signInWithEthereum) === null || u === void 0 ? void 0 : u.resources
14462
14428
  };
14463
- f = $n(vr), p = await v.request({
14429
+ f = $n(vr), g = await v.request({
14464
14430
  method: "personal_sign",
14465
14431
  params: [In(f), T]
14466
14432
  });
14467
14433
  }
14468
14434
  try {
14469
- const { data: g, error: _ } = await m(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
14435
+ const { data: p, error: _ } = await m(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
14470
14436
  headers: this.headers,
14471
14437
  body: Object.assign({
14472
14438
  chain: "ethereum",
14473
14439
  message: f,
14474
- signature: p
14440
+ signature: g
14475
14441
  }, !((h = e.options) === null || h === void 0) && h.captchaToken ? { gotrue_meta_security: { captcha_token: (d = e.options) === null || d === void 0 ? void 0 : d.captchaToken } } : null),
14476
14442
  xform: N
14477
14443
  });
14478
14444
  if (_)
14479
14445
  throw _;
14480
- if (!g || !g.session || !g.user) {
14446
+ if (!p || !p.session || !p.user) {
14481
14447
  const w = new se();
14482
14448
  return this._returnResult({ data: { user: null, session: null }, error: w });
14483
14449
  }
14484
- return g.session && (await this._saveSession(g.session), await this._notifyAllSubscribers("SIGNED_IN", g.session)), this._returnResult({ data: Object.assign({}, g), error: _ });
14485
- } catch (g) {
14486
- if (y(g))
14487
- return this._returnResult({ data: { user: null, session: null }, error: g });
14488
- throw g;
14450
+ return p.session && (await this._saveSession(p.session), await this._notifyAllSubscribers("SIGNED_IN", p.session)), this._returnResult({ data: Object.assign({}, p), error: _ });
14451
+ } catch (p) {
14452
+ if (y(p))
14453
+ return this._returnResult({ data: { user: null, session: null }, error: p });
14454
+ throw p;
14489
14455
  }
14490
14456
  }
14491
14457
  async signInWithSolana(e) {
14492
14458
  var r, s, n, i, a, o, l, c, u, h, d, f;
14493
- let p, g;
14459
+ let g, p;
14494
14460
  if ("message" in e)
14495
- p = e.message, g = e.signature;
14461
+ g = e.message, p = e.signature;
14496
14462
  else {
14497
14463
  const { chain: _, wallet: w, statement: b, options: v } = e;
14498
14464
  let S;
@@ -14527,13 +14493,13 @@ class Ee {
14527
14493
  else
14528
14494
  throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");
14529
14495
  if ("signedMessage" in P && "signature" in P && (typeof P.signedMessage == "string" || P.signedMessage instanceof Uint8Array) && P.signature instanceof Uint8Array)
14530
- p = typeof P.signedMessage == "string" ? P.signedMessage : new TextDecoder().decode(P.signedMessage), g = P.signature;
14496
+ g = typeof P.signedMessage == "string" ? P.signedMessage : new TextDecoder().decode(P.signedMessage), p = P.signature;
14531
14497
  else
14532
14498
  throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields");
14533
14499
  } else {
14534
14500
  if (!("signMessage" in S) || typeof S.signMessage != "function" || !("publicKey" in S) || typeof S != "object" || !S.publicKey || !("toBase58" in S.publicKey) || typeof S.publicKey.toBase58 != "function")
14535
14501
  throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");
14536
- p = [
14502
+ g = [
14537
14503
  `${$.host} wants you to sign in with your Solana account:`,
14538
14504
  S.publicKey.toBase58(),
14539
14505
  ...b ? ["", b, ""] : [""],
@@ -14551,16 +14517,16 @@ class Ee {
14551
14517
  ] : []
14552
14518
  ].join(`
14553
14519
  `);
14554
- const T = await S.signMessage(new TextEncoder().encode(p), "utf8");
14520
+ const T = await S.signMessage(new TextEncoder().encode(g), "utf8");
14555
14521
  if (!T || !(T instanceof Uint8Array))
14556
14522
  throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");
14557
- g = T;
14523
+ p = T;
14558
14524
  }
14559
14525
  }
14560
14526
  try {
14561
14527
  const { data: _, error: w } = await m(this.fetch, "POST", `${this.url}/token?grant_type=web3`, {
14562
14528
  headers: this.headers,
14563
- body: Object.assign({ chain: "solana", message: p, signature: ee(g) }, !((d = e.options) === null || d === void 0) && d.captchaToken ? { gotrue_meta_security: { captcha_token: (f = e.options) === null || f === void 0 ? void 0 : f.captchaToken } } : null),
14529
+ body: Object.assign({ chain: "solana", message: g, signature: ee(p) }, !((d = e.options) === null || d === void 0) && d.captchaToken ? { gotrue_meta_security: { captcha_token: (f = e.options) === null || f === void 0 ? void 0 : f.captchaToken } } : null),
14564
14530
  xform: N
14565
14531
  });
14566
14532
  if (w)
@@ -15988,10 +15954,10 @@ class Ee {
15988
15954
  const h = Math.round(Date.now() / 1e3), d = parseInt(l);
15989
15955
  let f = h + d;
15990
15956
  c && (f = parseInt(c));
15991
- const p = f - h;
15992
- p * 1e3 <= G && console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);
15993
- const g = f - d;
15994
- h - g >= 120 ? console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale", g, f, h) : h - g < 0 && console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew", g, f, h);
15957
+ const g = f - h;
15958
+ g * 1e3 <= G && console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${d}s`);
15959
+ const p = f - d;
15960
+ h - p >= 120 ? console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale", p, f, h) : h - p < 0 && console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew", p, f, h);
15995
15961
  const { data: _, error: w } = await this._getUser(a);
15996
15962
  if (w)
15997
15963
  throw w;
@@ -17173,15 +17139,15 @@ class Ee {
17173
17139
  if (e)
17174
17140
  try {
17175
17141
  const { payload: f } = xe(e);
17176
- let p = null;
17177
- f.aal && (p = f.aal);
17178
- let g = p;
17142
+ let g = null;
17143
+ f.aal && (g = f.aal);
17144
+ let p = g;
17179
17145
  const { data: { user: _ }, error: w } = await this.getUser(e);
17180
17146
  if (w)
17181
17147
  return this._returnResult({ data: null, error: w });
17182
- ((s = (r = _ == null ? void 0 : _.factors) === null || r === void 0 ? void 0 : r.filter((S) => S.status === "verified")) !== null && s !== void 0 ? s : []).length > 0 && (g = "aal2");
17148
+ ((s = (r = _ == null ? void 0 : _.factors) === null || r === void 0 ? void 0 : r.filter((S) => S.status === "verified")) !== null && s !== void 0 ? s : []).length > 0 && (p = "aal2");
17183
17149
  const v = f.amr || [];
17184
- return { data: { currentLevel: p, nextLevel: g, currentAuthenticationMethods: v }, error: null };
17150
+ return { data: { currentLevel: g, nextLevel: p, currentAuthenticationMethods: v }, error: null };
17185
17151
  } catch (f) {
17186
17152
  if (y(f))
17187
17153
  return this._returnResult({ data: null, error: f });
@@ -17403,9 +17369,9 @@ class Ee {
17403
17369
  try {
17404
17370
  let s = e;
17405
17371
  if (!s) {
17406
- const { data: f, error: p } = await this.getSession();
17407
- if (p || !f.session)
17408
- return this._returnResult({ data: null, error: p });
17372
+ const { data: f, error: g } = await this.getSession();
17373
+ if (g || !f.session)
17374
+ return this._returnResult({ data: null, error: g });
17409
17375
  s = f.session.access_token;
17410
17376
  }
17411
17377
  const { header: n, payload: i, signature: a, raw: { header: o, payload: l } } = xe(s);
@@ -17473,7 +17439,7 @@ class Ee {
17473
17439
  });
17474
17440
  if (a || !i)
17475
17441
  return this._returnResult({ data: null, error: a });
17476
- const o = Ft(i.options), l = (n = (s = e == null ? void 0 : e.options) === null || s === void 0 ? void 0 : s.signal) !== null && n !== void 0 ? n : ut.createNewAbortSignal(), { data: c, error: u } = await gr({
17442
+ const o = Ft(i.options), l = (n = (s = e == null ? void 0 : e.options) === null || s === void 0 ? void 0 : s.signal) !== null && n !== void 0 ? n : ut.createNewAbortSignal(), { data: c, error: u } = await pr({
17477
17443
  publicKey: o,
17478
17444
  signal: l
17479
17445
  });
@@ -17515,7 +17481,7 @@ class Ee {
17515
17481
  const { data: n, error: i } = await this._startPasskeyRegistration();
17516
17482
  if (i || !n)
17517
17483
  return this._returnResult({ data: null, error: i });
17518
- const a = Mt(n.options), o = (s = (r = e == null ? void 0 : e.options) === null || r === void 0 ? void 0 : r.signal) !== null && s !== void 0 ? s : ut.createNewAbortSignal(), { data: l, error: c } = await pr({
17484
+ const a = Mt(n.options), o = (s = (r = e == null ? void 0 : e.options) === null || r === void 0 ? void 0 : r.signal) !== null && s !== void 0 ? s : ut.createNewAbortSignal(), { data: l, error: c } = await gr({
17519
17485
  publicKey: a,
17520
17486
  signal: o
17521
17487
  });
@@ -17710,18 +17676,18 @@ class Ee {
17710
17676
  }
17711
17677
  }
17712
17678
  Ee.nextInstanceID = {};
17713
- const Si = hr, Fn = Ee, Wn = "2.108.2";
17714
- let pe = "", Fe;
17679
+ const Ei = hr, Fn = Ee, Wn = "2.108.2";
17680
+ let ge = "", Fe;
17715
17681
  if (typeof Deno < "u") {
17716
17682
  var Xe;
17717
- pe = "deno", Fe = (Xe = Deno.version) === null || Xe === void 0 ? void 0 : Xe.deno;
17718
- } else if (typeof document < "u") pe = "web";
17719
- else if (typeof navigator < "u" && navigator.product === "ReactNative") pe = "react-native";
17683
+ ge = "deno", Fe = (Xe = Deno.version) === null || Xe === void 0 ? void 0 : Xe.deno;
17684
+ } else if (typeof document < "u") ge = "web";
17685
+ else if (typeof navigator < "u" && navigator.product === "ReactNative") ge = "react-native";
17720
17686
  else {
17721
17687
  var Qe;
17722
- pe = "node", Fe = typeof process < "u" ? (Qe = process.version) === null || Qe === void 0 ? void 0 : Qe.replace(/^v/, "") : void 0;
17688
+ ge = "node", Fe = typeof process < "u" ? (Qe = process.version) === null || Qe === void 0 ? void 0 : Qe.replace(/^v/, "") : void 0;
17723
17689
  }
17724
- const yr = [`runtime=${pe}`];
17690
+ const yr = [`runtime=${ge}`];
17725
17691
  Fe && yr.push(`runtime-version=${Fe}`);
17726
17692
  const Kn = { "X-Client-Info": `supabase-js/${Wn}; ${yr.join("; ")}` }, Vn = { headers: Kn }, Jn = { schema: "public" }, Gn = {
17727
17693
  autoRefreshToken: !0,
@@ -17897,12 +17863,12 @@ const li = (t) => t ? (...e) => t(...e) : (...e) => fetch(...e), ci = () => Head
17897
17863
  return async (u, h) => {
17898
17864
  var d;
17899
17865
  const f = (d = await r()) !== null && d !== void 0 ? d : t;
17900
- let p = new a(h == null ? void 0 : h.headers);
17901
- if (p.has("apikey") || p.set("apikey", t), p.has("Authorization") || p.set("Authorization", `Bearer ${f}`), c) {
17902
- const g = await hi(u, c, l);
17903
- g && (g.traceparent && !p.has("traceparent") && p.set("traceparent", g.traceparent), g.tracestate && !p.has("tracestate") && p.set("tracestate", g.tracestate), g.baggage && !p.has("baggage") && p.set("baggage", g.baggage));
17866
+ let g = new a(h == null ? void 0 : h.headers);
17867
+ if (g.has("apikey") || g.set("apikey", t), g.has("Authorization") || g.set("Authorization", `Bearer ${f}`), c) {
17868
+ const p = await hi(u, c, l);
17869
+ p && (p.traceparent && !g.has("traceparent") && g.set("traceparent", p.traceparent), p.tracestate && !g.has("tracestate") && g.set("tracestate", p.tracestate), p.baggage && !g.has("baggage") && g.set("baggage", p.baggage));
17904
17870
  }
17905
- return i(u, A(A({}, h), {}, { headers: p }));
17871
+ return i(u, A(A({}, h), {}, { headers: g }));
17906
17872
  };
17907
17873
  };
17908
17874
  async function hi(t, e, r) {
@@ -17923,12 +17889,12 @@ function di(t) {
17923
17889
  }
17924
17890
  function fi(t, e) {
17925
17891
  var r, s, n, i, a, o;
17926
- const { db: l, auth: c, realtime: u, global: h } = t, { db: d, auth: f, realtime: p, global: g } = e, _ = Jt(t.tracePropagation), w = Jt(e.tracePropagation), b = {
17892
+ const { db: l, auth: c, realtime: u, global: h } = t, { db: d, auth: f, realtime: g, global: p } = e, _ = Jt(t.tracePropagation), w = Jt(e.tracePropagation), b = {
17927
17893
  db: A(A({}, d), l),
17928
17894
  auth: A(A({}, f), c),
17929
- realtime: A(A({}, p), u),
17895
+ realtime: A(A({}, g), u),
17930
17896
  storage: {},
17931
- global: A(A(A({}, g), h), {}, { headers: A(A({}, (r = g == null ? void 0 : g.headers) !== null && r !== void 0 ? r : {}), (s = h == null ? void 0 : h.headers) !== null && s !== void 0 ? s : {}) }),
17897
+ global: A(A(A({}, p), h), {}, { headers: A(A({}, (r = p == null ? void 0 : p.headers) !== null && r !== void 0 ? r : {}), (s = h == null ? void 0 : h.headers) !== null && s !== void 0 ? s : {}) }),
17932
17898
  tracePropagation: {
17933
17899
  enabled: (n = (i = _ == null ? void 0 : _.enabled) !== null && i !== void 0 ? i : w == null ? void 0 : w.enabled) !== null && n !== void 0 ? n : !1,
17934
17900
  respectSamplingDecision: (a = (o = _ == null ? void 0 : _.respectSamplingDecision) !== null && o !== void 0 ? o : w == null ? void 0 : w.respectSamplingDecision) !== null && a !== void 0 ? a : !0
@@ -17937,7 +17903,7 @@ function fi(t, e) {
17937
17903
  };
17938
17904
  return t.accessToken ? b.accessToken = t.accessToken : delete b.accessToken, b;
17939
17905
  }
17940
- function pi(t) {
17906
+ function gi(t) {
17941
17907
  const e = t == null ? void 0 : t.trim();
17942
17908
  if (!e) throw new Error("supabaseUrl is required.");
17943
17909
  if (!e.match(/^https?:\/\//i)) throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");
@@ -17947,7 +17913,7 @@ function pi(t) {
17947
17913
  throw Error("Invalid supabaseUrl: Provided URL is malformed.");
17948
17914
  }
17949
17915
  }
17950
- var gi = class extends Fn {
17916
+ var pi = class extends Fn {
17951
17917
  constructor(t) {
17952
17918
  super(t);
17953
17919
  }
@@ -18166,7 +18132,7 @@ var gi = class extends Fn {
18166
18132
  constructor(t, e, r) {
18167
18133
  var s, n;
18168
18134
  this.supabaseUrl = t, this.supabaseKey = e;
18169
- const i = pi(t);
18135
+ const i = gi(t);
18170
18136
  if (!e) throw new Error("supabaseKey is required.");
18171
18137
  this.realtimeUrl = new URL("realtime/v1", i), this.realtimeUrl.protocol = this.realtimeUrl.protocol.replace("http", "ws"), this.authUrl = new URL("auth/v1", i), this.storageUrl = new URL("storage/v1", i), this.functionsUrl = new URL("functions/v1", i);
18172
18138
  const a = `sb-${i.hostname.split(".")[0]}-auth-token`, o = {
@@ -18318,14 +18284,14 @@ var gi = class extends Fn {
18318
18284
  const { data: s } = await t.auth.getSession();
18319
18285
  return (e = (r = s.session) === null || r === void 0 ? void 0 : r.access_token) !== null && e !== void 0 ? e : t.supabaseKey;
18320
18286
  }
18321
- _initSupabaseAuthClient({ autoRefreshToken: t, persistSession: e, detectSessionInUrl: r, storage: s, userStorage: n, storageKey: i, flowType: a, lock: o, debug: l, throwOnError: c, experimental: u, lockAcquireTimeout: h, skipAutoInitialize: d }, f, p) {
18322
- const g = {
18287
+ _initSupabaseAuthClient({ autoRefreshToken: t, persistSession: e, detectSessionInUrl: r, storage: s, userStorage: n, storageKey: i, flowType: a, lock: o, debug: l, throwOnError: c, experimental: u, lockAcquireTimeout: h, skipAutoInitialize: d }, f, g) {
18288
+ const p = {
18323
18289
  Authorization: `Bearer ${this.supabaseKey}`,
18324
18290
  apikey: `${this.supabaseKey}`
18325
18291
  };
18326
- return new gi({
18292
+ return new pi({
18327
18293
  url: this.authUrl.href,
18328
- headers: A(A({}, g), f),
18294
+ headers: A(A({}, p), f),
18329
18295
  storageKey: i,
18330
18296
  autoRefreshToken: t,
18331
18297
  persistSession: e,
@@ -18337,7 +18303,7 @@ var gi = class extends Fn {
18337
18303
  debug: l,
18338
18304
  throwOnError: c,
18339
18305
  experimental: u,
18340
- fetch: p,
18306
+ fetch: g,
18341
18307
  lockAcquireTimeout: h,
18342
18308
  skipAutoInitialize: d,
18343
18309
  hasCustomAuthorizationHeader: Object.keys(this.headers).some((_) => _.toLowerCase() === "authorization")
@@ -18355,7 +18321,7 @@ var gi = class extends Fn {
18355
18321
  (t === "TOKEN_REFRESHED" || t === "SIGNED_IN") && this.changedAccessToken !== r ? (this.changedAccessToken = r, this.realtime.setAuth(r)) : t === "SIGNED_OUT" && (this.realtime.setAuth(), e == "STORAGE" && this.auth.signOut(), this.changedAccessToken = void 0);
18356
18322
  }
18357
18323
  };
18358
- const Ei = (t, e, r) => new yi(t, e, r);
18324
+ const Ti = (t, e, r) => new yi(t, e, r);
18359
18325
  function vi() {
18360
18326
  if (typeof window < "u") return !1;
18361
18327
  const t = globalThis.process;
@@ -18367,7 +18333,7 @@ function vi() {
18367
18333
  }
18368
18334
  vi() && console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");
18369
18335
  export {
18370
- Si as AuthAdminApi,
18336
+ Ei as AuthAdminApi,
18371
18337
  Ys as AuthApiError,
18372
18338
  Fn as AuthClient,
18373
18339
  ke as AuthError,
@@ -18386,13 +18352,13 @@ export {
18386
18352
  et as FunctionRegion,
18387
18353
  ht as FunctionsError,
18388
18354
  _r as FunctionsFetchError,
18389
- pt as FunctionsHttpError,
18355
+ gt as FunctionsHttpError,
18390
18356
  ft as FunctionsRelayError,
18391
18357
  hr as GoTrueAdminApi,
18392
18358
  Ee as GoTrueClient,
18393
18359
  qt as NavigatorLockAcquireTimeoutError,
18394
18360
  yt as PostgrestError,
18395
- mi as REALTIME_CHANNEL_STATES,
18361
+ wi as REALTIME_CHANNEL_STATES,
18396
18362
  le as REALTIME_LISTEN_TYPES,
18397
18363
  St as REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
18398
18364
  kt as REALTIME_PRESENCE_LISTEN_EVENTS,
@@ -18404,17 +18370,17 @@ export {
18404
18370
  it as StorageApiError,
18405
18371
  yi as SupabaseClient,
18406
18372
  jr as WebSocketFactory,
18407
- Ei as createClient,
18373
+ Ti as createClient,
18408
18374
  Xs as isAuthApiError,
18409
18375
  y as isAuthError,
18410
18376
  Qs as isAuthImplicitGrantRedirectError,
18411
- wi as isAuthPKCECodeVerifierMissingError,
18377
+ _i as isAuthPKCECodeVerifierMissingError,
18412
18378
  en as isAuthRefreshDiscardedError,
18413
18379
  Ct as isAuthRetryableFetchError,
18414
18380
  je as isAuthSessionMissingError,
18415
- _i as isAuthWeakPasswordError,
18381
+ bi as isAuthWeakPasswordError,
18416
18382
  q as lockInternals,
18417
- bi as navigatorLock,
18418
- ki as processLock
18383
+ ki as navigatorLock,
18384
+ Si as processLock
18419
18385
  };
18420
- //# sourceMappingURL=index-BcqBbswO.mjs.map
18386
+ //# sourceMappingURL=index-D6dCjvzy.mjs.map