@sevenfold/setto-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +369 -0
- package/dist/SettoBlock.d.ts +10 -0
- package/dist/SettoSection.d.ts +11 -0
- package/dist/T.d.ts +9 -0
- package/dist/admin/App.d.ts +12 -0
- package/dist/edit-mode/auth-gate.d.ts +10 -0
- package/dist/edit-mode/build-status.d.ts +13 -0
- package/dist/edit-mode/constants.d.ts +2 -0
- package/dist/edit-mode/document-layout.d.ts +5 -0
- package/dist/edit-mode/link-hint.d.ts +5 -0
- package/dist/edit-mode/mount.d.ts +14 -0
- package/dist/edit-mode/publish-utils.d.ts +4 -0
- package/dist/edit-mode/section-toolbar.d.ts +1 -0
- package/dist/edit-mode/toolbar.d.ts +1 -0
- package/dist/edit-mode/use-edit-baseline.d.ts +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib/api.d.ts +15 -0
- package/dist/lib/color-utils.d.ts +4 -0
- package/dist/lib/i18n-store.d.ts +75 -0
- package/dist/lib/supabase.d.ts +9 -0
- package/dist/lib/theme-store.d.ts +35 -0
- package/dist/provider.d.ts +40 -0
- package/dist/section-context.d.ts +10 -0
- package/dist/section-schema.d.ts +10 -0
- package/dist/setto-client.js +22378 -0
- package/dist/setto-client.js.map +1 -0
- package/dist/theme-target-utils.d.ts +7 -0
- package/dist/types.d.ts +62 -0
- package/dist/use-section-theme.d.ts +2 -0
- package/package.json +49 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setto-client.js","sources":["../node_modules/tslib/tslib.es6.mjs","../node_modules/@supabase/functions-js/dist/module/helper.js","../node_modules/@supabase/functions-js/dist/module/types.js","../node_modules/@supabase/functions-js/dist/module/FunctionsClient.js","../node_modules/@supabase/postgrest-js/dist/index.mjs","../node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js","../node_modules/@supabase/realtime-js/dist/module/lib/version.js","../node_modules/@supabase/realtime-js/dist/module/lib/constants.js","../node_modules/@supabase/realtime-js/dist/module/lib/serializer.js","../node_modules/@supabase/realtime-js/dist/module/lib/transformers.js","../node_modules/@supabase/phoenix/priv/static/phoenix.mjs","../node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js","../node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js","../node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js","../node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js","../node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js","../node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js","../node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js","../node_modules/iceberg-js/dist/index.mjs","../node_modules/@supabase/storage-js/dist/index.mjs","../node_modules/@supabase/auth-js/dist/module/lib/version.js","../node_modules/@supabase/auth-js/dist/module/lib/constants.js","../node_modules/@supabase/auth-js/dist/module/lib/errors.js","../node_modules/@supabase/auth-js/dist/module/lib/base64url.js","../node_modules/@supabase/auth-js/dist/module/lib/helpers.js","../node_modules/@supabase/auth-js/dist/module/lib/fetch.js","../node_modules/@supabase/auth-js/dist/module/lib/types.js","../node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js","../node_modules/@supabase/auth-js/dist/module/lib/local-storage.js","../node_modules/@supabase/auth-js/dist/module/lib/locks.js","../node_modules/@supabase/auth-js/dist/module/lib/polyfills.js","../node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js","../node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js","../node_modules/@supabase/auth-js/dist/module/lib/webauthn.js","../node_modules/@supabase/auth-js/dist/module/GoTrueClient.js","../node_modules/@supabase/auth-js/dist/module/AuthClient.js","../node_modules/@supabase/supabase-js/dist/index.mjs","../src/lib/supabase.ts","../src/lib/api.ts","../src/lib/i18n-store.ts","../src/lib/theme-store.ts","../src/edit-mode/constants.ts","../src/edit-mode/document-layout.ts","../src/edit-mode/link-hint.tsx","../src/lib/color-utils.ts","../src/section-context.tsx","../src/edit-mode/section-toolbar.tsx","../src/edit-mode/build-status.tsx","../src/edit-mode/publish-utils.ts","../src/edit-mode/use-edit-baseline.ts","../src/edit-mode/toolbar.tsx","../src/edit-mode/mount.tsx","../src/provider.tsx","../src/T.tsx","../src/theme-target-utils.ts","../src/use-section-theme.ts","../src/SettoSection.tsx","../src/SettoBlock.tsx","../src/edit-mode/auth-gate.tsx","../src/admin/App.tsx"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export const resolveFetch = (customFetch) => {\n if (customFetch) {\n return (...args) => customFetch(...args);\n }\n return (...args) => fetch(...args);\n};\n//# sourceMappingURL=helper.js.map","/**\n * Base error for Supabase Edge Function invocations.\n *\n * @example\n * ```ts\n * import { FunctionsError } from '@supabase/functions-js'\n *\n * throw new FunctionsError('Unexpected error invoking function', 'FunctionsError', {\n * requestId: 'abc123',\n * })\n * ```\n */\nexport class FunctionsError extends Error {\n constructor(message, name = 'FunctionsError', context) {\n super(message);\n this.name = name;\n this.context = context;\n }\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n context: this.context,\n };\n }\n}\n/**\n * Error thrown when the network request to an Edge Function fails.\n *\n * @example\n * ```ts\n * import { FunctionsFetchError } from '@supabase/functions-js'\n *\n * throw new FunctionsFetchError({ requestId: 'abc123' })\n * ```\n */\nexport class FunctionsFetchError extends FunctionsError {\n constructor(context) {\n super('Failed to send a request to the Edge Function', 'FunctionsFetchError', context);\n }\n}\n/**\n * Error thrown when the Supabase relay cannot reach the Edge Function.\n *\n * @example\n * ```ts\n * import { FunctionsRelayError } from '@supabase/functions-js'\n *\n * throw new FunctionsRelayError({ region: 'us-east-1' })\n * ```\n */\nexport class FunctionsRelayError extends FunctionsError {\n constructor(context) {\n super('Relay Error invoking the Edge Function', 'FunctionsRelayError', context);\n }\n}\n/**\n * Error thrown when the Edge Function returns a non-2xx status code.\n *\n * @example\n * ```ts\n * import { FunctionsHttpError } from '@supabase/functions-js'\n *\n * throw new FunctionsHttpError({ status: 500 })\n * ```\n */\nexport class FunctionsHttpError extends FunctionsError {\n constructor(context) {\n super('Edge Function returned a non-2xx status code', 'FunctionsHttpError', context);\n }\n}\n// Define the enum for the 'region' property\nexport var FunctionRegion;\n(function (FunctionRegion) {\n FunctionRegion[\"Any\"] = \"any\";\n FunctionRegion[\"ApNortheast1\"] = \"ap-northeast-1\";\n FunctionRegion[\"ApNortheast2\"] = \"ap-northeast-2\";\n FunctionRegion[\"ApSouth1\"] = \"ap-south-1\";\n FunctionRegion[\"ApSoutheast1\"] = \"ap-southeast-1\";\n FunctionRegion[\"ApSoutheast2\"] = \"ap-southeast-2\";\n FunctionRegion[\"CaCentral1\"] = \"ca-central-1\";\n FunctionRegion[\"EuCentral1\"] = \"eu-central-1\";\n FunctionRegion[\"EuWest1\"] = \"eu-west-1\";\n FunctionRegion[\"EuWest2\"] = \"eu-west-2\";\n FunctionRegion[\"EuWest3\"] = \"eu-west-3\";\n FunctionRegion[\"SaEast1\"] = \"sa-east-1\";\n FunctionRegion[\"UsEast1\"] = \"us-east-1\";\n FunctionRegion[\"UsWest1\"] = \"us-west-1\";\n FunctionRegion[\"UsWest2\"] = \"us-west-2\";\n})(FunctionRegion || (FunctionRegion = {}));\n//# sourceMappingURL=types.js.map","import { __awaiter } from \"tslib\";\nimport { resolveFetch } from './helper';\nimport { FunctionRegion, FunctionsFetchError, FunctionsHttpError, FunctionsRelayError, } from './types';\n/**\n * Client for invoking Supabase Edge Functions.\n */\nexport class FunctionsClient {\n /**\n * Creates a new Functions client bound to an Edge Functions URL.\n *\n * @example Using supabase-js (recommended)\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n * const { data, error } = await supabase.functions.invoke('hello-world')\n * ```\n *\n * @category Edge Functions\n *\n * @example Standalone import for bundle-sensitive environments\n * ```ts\n * import { FunctionsClient, FunctionRegion } from '@supabase/functions-js'\n *\n * const functions = new FunctionsClient('https://xyzcompany.supabase.co/functions/v1', {\n * headers: { apikey: 'your-publishable-key' },\n * region: FunctionRegion.UsEast1,\n * })\n * ```\n */\n constructor(url, { headers = {}, customFetch, region = FunctionRegion.Any, } = {}) {\n this.url = url;\n this.headers = headers;\n this.region = region;\n this.fetch = resolveFetch(customFetch);\n }\n /**\n * Updates the authorization header\n * @param token - the new jwt token sent in the authorisation header\n *\n * @category Edge Functions\n *\n * @example Setting the authorization header\n * ```ts\n * functions.setAuth(session.access_token)\n * ```\n */\n setAuth(token) {\n this.headers.Authorization = `Bearer ${token}`;\n }\n /**\n * Invokes a function\n * @param functionName - The name of the Function to invoke.\n * @param options - Options for invoking the Function.\n * @example\n * ```ts\n * const { data, error } = await functions.invoke('hello-world', {\n * body: { name: 'Ada' },\n * })\n * ```\n *\n * @category Edge Functions\n *\n * @remarks\n * - Requires an Authorization header.\n * - Invoke params generally match the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) spec.\n * - When you pass in a body to your function, we automatically attach the Content-Type header for `Blob`, `ArrayBuffer`, `File`, `FormData` and `String`. If it doesn't match any of these types we assume the payload is `json`, serialize it and attach the `Content-Type` header as `application/json`. You can override this behavior by passing in a `Content-Type` header of your own.\n * - Responses are automatically parsed as `json`, `blob` and `form-data` depending on the `Content-Type` header sent by your function. Responses are parsed as `text` by default.\n *\n * @example Basic invocation\n * ```js\n * const { data, error } = await supabase.functions.invoke('hello', {\n * body: { foo: 'bar' }\n * })\n * ```\n *\n * @exampleDescription Error handling\n * A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function.\n *\n * @example Error handling\n * ```js\n * import { FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from \"@supabase/supabase-js\";\n *\n * const { data, error } = await supabase.functions.invoke('hello', {\n * headers: {\n * \"my-custom-header\": 'my-custom-header-value'\n * },\n * body: { foo: 'bar' }\n * })\n *\n * if (error instanceof FunctionsHttpError) {\n * const errorMessage = await error.context.json()\n * console.log('Function returned an error', errorMessage)\n * } else if (error instanceof FunctionsRelayError) {\n * console.log('Relay error:', error.message)\n * } else if (error instanceof FunctionsFetchError) {\n * console.log('Fetch error:', error.message)\n * }\n * ```\n *\n * @exampleDescription Passing custom headers\n * You can pass custom headers to your function. Note: supabase-js automatically passes the `Authorization` header with the signed in user's JWT.\n *\n * @example Passing custom headers\n * ```js\n * const { data, error } = await supabase.functions.invoke('hello', {\n * headers: {\n * \"my-custom-header\": 'my-custom-header-value'\n * },\n * body: { foo: 'bar' }\n * })\n * ```\n *\n * @exampleDescription Calling with DELETE HTTP verb\n * You can also set the HTTP verb to `DELETE` when calling your Edge Function.\n *\n * @example Calling with DELETE HTTP verb\n * ```js\n * const { data, error } = await supabase.functions.invoke('hello', {\n * headers: {\n * \"my-custom-header\": 'my-custom-header-value'\n * },\n * body: { foo: 'bar' },\n * method: 'DELETE'\n * })\n * ```\n *\n * @exampleDescription Invoking a Function in the UsEast1 region\n * Here are the available regions:\n * - `FunctionRegion.Any`\n * - `FunctionRegion.ApNortheast1`\n * - `FunctionRegion.ApNortheast2`\n * - `FunctionRegion.ApSouth1`\n * - `FunctionRegion.ApSoutheast1`\n * - `FunctionRegion.ApSoutheast2`\n * - `FunctionRegion.CaCentral1`\n * - `FunctionRegion.EuCentral1`\n * - `FunctionRegion.EuWest1`\n * - `FunctionRegion.EuWest2`\n * - `FunctionRegion.EuWest3`\n * - `FunctionRegion.SaEast1`\n * - `FunctionRegion.UsEast1`\n * - `FunctionRegion.UsWest1`\n * - `FunctionRegion.UsWest2`\n *\n * @example Invoking a Function in the UsEast1 region\n * ```js\n * import { createClient, FunctionRegion } from '@supabase/supabase-js'\n *\n * const { data, error } = await supabase.functions.invoke('hello', {\n * body: { foo: 'bar' },\n * region: FunctionRegion.UsEast1\n * })\n * ```\n *\n * @exampleDescription Calling with GET HTTP verb\n * You can also set the HTTP verb to `GET` when calling your Edge Function.\n *\n * @example Calling with GET HTTP verb\n * ```js\n * const { data, error } = await supabase.functions.invoke('hello', {\n * headers: {\n * \"my-custom-header\": 'my-custom-header-value'\n * },\n * method: 'GET'\n * })\n * ```\n *\n * @example Standalone client invoke\n * ```ts\n * const { data, error } = await functions.invoke('hello-world', {\n * body: { name: 'Ada' },\n * })\n * ```\n */\n invoke(functionName_1) {\n return __awaiter(this, arguments, void 0, function* (functionName, options = {}) {\n var _a;\n let timeoutId;\n let timeoutController;\n try {\n const { headers, method, body: functionArgs, signal, timeout } = options;\n let _headers = {};\n let { region } = options;\n if (!region) {\n region = this.region;\n }\n // Add region as query parameter using URL API\n const url = new URL(`${this.url}/${functionName}`);\n if (region && region !== 'any') {\n _headers['x-region'] = region;\n url.searchParams.set('forceFunctionRegion', region);\n }\n let body;\n if (functionArgs &&\n ((headers && !Object.prototype.hasOwnProperty.call(headers, 'Content-Type')) || !headers)) {\n if ((typeof Blob !== 'undefined' && functionArgs instanceof Blob) ||\n functionArgs instanceof ArrayBuffer) {\n // will work for File as File inherits Blob\n // also works for ArrayBuffer as it is the same underlying structure as a Blob\n _headers['Content-Type'] = 'application/octet-stream';\n body = functionArgs;\n }\n else if (typeof functionArgs === 'string') {\n // plain string\n _headers['Content-Type'] = 'text/plain';\n body = functionArgs;\n }\n else if (typeof FormData !== 'undefined' && functionArgs instanceof FormData) {\n // don't set content-type headers\n // Request will automatically add the right boundary value\n body = functionArgs;\n }\n else {\n // default, assume this is JSON\n _headers['Content-Type'] = 'application/json';\n body = JSON.stringify(functionArgs);\n }\n }\n else {\n if (functionArgs &&\n typeof functionArgs !== 'string' &&\n !(typeof Blob !== 'undefined' && functionArgs instanceof Blob) &&\n !(functionArgs instanceof ArrayBuffer) &&\n !(typeof FormData !== 'undefined' && functionArgs instanceof FormData)) {\n body = JSON.stringify(functionArgs);\n }\n else {\n body = functionArgs;\n }\n }\n // Handle timeout by creating an AbortController\n let effectiveSignal = signal;\n if (timeout) {\n timeoutController = new AbortController();\n timeoutId = setTimeout(() => timeoutController.abort(), timeout);\n // If user provided their own signal, we need to respect both\n if (signal) {\n effectiveSignal = timeoutController.signal;\n // If the user's signal is aborted, abort our timeout controller too\n signal.addEventListener('abort', () => timeoutController.abort());\n }\n else {\n effectiveSignal = timeoutController.signal;\n }\n }\n const response = yield this.fetch(url.toString(), {\n method: method || 'POST',\n // headers priority is (high to low):\n // 1. invoke-level headers\n // 2. client-level headers\n // 3. default Content-Type header\n headers: Object.assign(Object.assign(Object.assign({}, _headers), this.headers), headers),\n body,\n signal: effectiveSignal,\n }).catch((fetchError) => {\n throw new FunctionsFetchError(fetchError);\n });\n const isRelayError = response.headers.get('x-relay-error');\n if (isRelayError && isRelayError === 'true') {\n throw new FunctionsRelayError(response);\n }\n if (!response.ok) {\n throw new FunctionsHttpError(response);\n }\n let responseType = ((_a = response.headers.get('Content-Type')) !== null && _a !== void 0 ? _a : 'text/plain').split(';')[0].trim();\n let data;\n if (responseType === 'application/json') {\n data = yield response.json();\n }\n else if (responseType === 'application/octet-stream' ||\n responseType === 'application/pdf') {\n data = yield response.blob();\n }\n else if (responseType === 'text/event-stream') {\n data = response;\n }\n else if (responseType === 'multipart/form-data') {\n data = yield response.formData();\n }\n else {\n // default to text\n data = yield response.text();\n }\n return { data, error: null, response };\n }\n catch (error) {\n return {\n data: null,\n error,\n response: error instanceof FunctionsHttpError || error instanceof FunctionsRelayError\n ? error.context\n : undefined,\n };\n }\n finally {\n // Clear the timeout if it was set\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n }\n });\n }\n}\n//# sourceMappingURL=FunctionsClient.js.map","//#region src/types/common/common.ts\n/**\n* Default number of retry attempts.\n*/\nconst DEFAULT_MAX_RETRIES = 3;\n/**\n* Default exponential backoff delay function.\n* Delays: 1s, 2s, 4s, 8s, ... (max 30s)\n*\n* @param attemptIndex - Zero-based index of the retry attempt\n* @returns Delay in milliseconds before the next retry\n*/\nconst getRetryDelay = (attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 3e4);\n/**\n* Status codes that are safe to retry.\n* 520 = Cloudflare timeout/connection errors (transient)\n* 503 = PostgREST schema cache not yet loaded (transient, signals retry via Retry-After header)\n*/\nconst RETRYABLE_STATUS_CODES = [520, 503];\n/**\n* HTTP methods that are safe to retry (idempotent operations).\n*/\nconst RETRYABLE_METHODS = [\n\t\"GET\",\n\t\"HEAD\",\n\t\"OPTIONS\"\n];\n\n//#endregion\n//#region src/PostgrestError.ts\n/**\n* Error format\n*\n* {@link https://postgrest.org/en/stable/api.html?highlight=options#errors-and-http-status-codes}\n*/\nvar PostgrestError = class extends Error {\n\t/**\n\t* @example\n\t* ```ts\n\t* import PostgrestError from '@supabase/postgrest-js'\n\t*\n\t* throw new PostgrestError({\n\t* message: 'Row level security prevented the request',\n\t* details: 'RLS denied the insert',\n\t* hint: 'Check your policies',\n\t* code: 'PGRST301',\n\t* })\n\t* ```\n\t*/\n\tconstructor(context) {\n\t\tsuper(context.message);\n\t\tthis.name = \"PostgrestError\";\n\t\tthis.details = context.details;\n\t\tthis.hint = context.hint;\n\t\tthis.code = context.code;\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tmessage: this.message,\n\t\t\tdetails: this.details,\n\t\t\thint: this.hint,\n\t\t\tcode: this.code\n\t\t};\n\t}\n};\n\n//#endregion\n//#region src/PostgrestBuilder.ts\n/**\n* Sleep for a given number of milliseconds.\n* If an AbortSignal is provided, the sleep resolves early when the signal is aborted.\n*/\nfunction sleep(ms, signal) {\n\treturn new Promise((resolve) => {\n\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\t\tconst id = setTimeout(() => {\n\t\t\tsignal === null || signal === void 0 || signal.removeEventListener(\"abort\", onAbort);\n\t\t\tresolve();\n\t\t}, ms);\n\t\tfunction onAbort() {\n\t\t\tclearTimeout(id);\n\t\t\tresolve();\n\t\t}\n\t\tsignal === null || signal === void 0 || signal.addEventListener(\"abort\", onAbort);\n\t});\n}\n/**\n* Check if a request should be retried based on method and status code.\n*/\nfunction shouldRetry(method, status, attemptCount, retryEnabled) {\n\tif (!retryEnabled || attemptCount >= DEFAULT_MAX_RETRIES) return false;\n\tif (!RETRYABLE_METHODS.includes(method)) return false;\n\tif (!RETRYABLE_STATUS_CODES.includes(status)) return false;\n\treturn true;\n}\nvar PostgrestBuilder = class {\n\t/**\n\t* Creates a builder configured for a specific PostgREST request.\n\t*\n\t* @example Using supabase-js (recommended)\n\t* ```ts\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* const { data, error } = await supabase.from('users').select('*')\n\t* ```\n\t*\n\t* @category Database\n\t*\n\t* @example Standalone import for bundle-sensitive environments\n\t* ```ts\n\t* import { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\t*\n\t* const builder = new PostgrestQueryBuilder(\n\t* new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n\t* { headers: new Headers({ apikey: 'your-publishable-key' }) }\n\t* )\n\t* ```\n\t*/\n\tconstructor(builder) {\n\t\tvar _builder$shouldThrowO, _builder$isMaybeSingl, _builder$shouldStripN, _builder$urlLengthLim, _builder$retry;\n\t\tthis.shouldThrowOnError = false;\n\t\tthis.retryEnabled = true;\n\t\tthis.method = builder.method;\n\t\tthis.url = builder.url;\n\t\tthis.headers = new Headers(builder.headers);\n\t\tthis.schema = builder.schema;\n\t\tthis.body = builder.body;\n\t\tthis.shouldThrowOnError = (_builder$shouldThrowO = builder.shouldThrowOnError) !== null && _builder$shouldThrowO !== void 0 ? _builder$shouldThrowO : false;\n\t\tthis.signal = builder.signal;\n\t\tthis.isMaybeSingle = (_builder$isMaybeSingl = builder.isMaybeSingle) !== null && _builder$isMaybeSingl !== void 0 ? _builder$isMaybeSingl : false;\n\t\tthis.shouldStripNulls = (_builder$shouldStripN = builder.shouldStripNulls) !== null && _builder$shouldStripN !== void 0 ? _builder$shouldStripN : false;\n\t\tthis.urlLengthLimit = (_builder$urlLengthLim = builder.urlLengthLimit) !== null && _builder$urlLengthLim !== void 0 ? _builder$urlLengthLim : 8e3;\n\t\tthis.retryEnabled = (_builder$retry = builder.retry) !== null && _builder$retry !== void 0 ? _builder$retry : true;\n\t\tif (builder.fetch) this.fetch = builder.fetch;\n\t\telse this.fetch = fetch;\n\t}\n\t/**\n\t* If there's an error with the query, throwOnError will reject the promise by\n\t* throwing the error instead of returning it as part of a successful response.\n\t*\n\t* {@link https://github.com/supabase/supabase-js/issues/92}\n\t*\n\t* @category Database\n\t*/\n\tthrowOnError() {\n\t\tthis.shouldThrowOnError = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Strip null values from the response data. Properties with `null` values\n\t* will be omitted from the returned JSON objects.\n\t*\n\t* Requires PostgREST 11.2.0+.\n\t*\n\t* {@link https://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls}\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .stripNulls()\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text, bio text);\n\t*\n\t* insert into\n\t* characters (id, name, bio)\n\t* values\n\t* (1, 'Luke', null),\n\t* (2, 'Leia', 'Princess of Alderaan');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* },\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Leia\",\n\t* \"bio\": \"Princess of Alderaan\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tstripNulls() {\n\t\tif (this.headers.get(\"Accept\") === \"text/csv\") throw new Error(\"stripNulls() cannot be used with csv()\");\n\t\tthis.shouldStripNulls = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Set an HTTP header for the request.\n\t*\n\t* @category Database\n\t*/\n\tsetHeader(name, value) {\n\t\tthis.headers = new Headers(this.headers);\n\t\tthis.headers.set(name, value);\n\t\treturn this;\n\t}\n\t/**\n\t* @category Database\n\t*\n\t* Configure retry behavior for this request.\n\t*\n\t* By default, retries are enabled for idempotent requests (GET, HEAD, OPTIONS)\n\t* that fail with network errors or specific HTTP status codes (503, 520).\n\t* Retries use exponential backoff (1s, 2s, 4s) with a maximum of 3 attempts.\n\t*\n\t* @param enabled - Whether to enable retries for this request\n\t*\n\t* @example\n\t* ```ts\n\t* // Disable retries for a specific query\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .select()\n\t* .retry(false)\n\t* ```\n\t*/\n\tretry(enabled) {\n\t\tthis.retryEnabled = enabled;\n\t\treturn this;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\tvar _this = this;\n\t\tif (this.schema === void 0) {} else if ([\"GET\", \"HEAD\"].includes(this.method)) this.headers.set(\"Accept-Profile\", this.schema);\n\t\telse this.headers.set(\"Content-Profile\", this.schema);\n\t\tif (this.method !== \"GET\" && this.method !== \"HEAD\") this.headers.set(\"Content-Type\", \"application/json\");\n\t\tif (this.shouldStripNulls) {\n\t\t\tconst currentAccept = this.headers.get(\"Accept\");\n\t\t\tif (currentAccept === \"application/vnd.pgrst.object+json\") this.headers.set(\"Accept\", \"application/vnd.pgrst.object+json;nulls=stripped\");\n\t\t\telse if (!currentAccept || currentAccept === \"application/json\") this.headers.set(\"Accept\", \"application/vnd.pgrst.array+json;nulls=stripped\");\n\t\t}\n\t\tconst _fetch = this.fetch;\n\t\tconst executeWithRetry = async () => {\n\t\t\tlet attemptCount = 0;\n\t\t\twhile (true) {\n\t\t\t\tconst requestHeaders = new Headers(_this.headers);\n\t\t\t\tif (attemptCount > 0) requestHeaders.set(\"X-Retry-Count\", String(attemptCount));\n\t\t\t\tlet res$1;\n\t\t\t\ttry {\n\t\t\t\t\tres$1 = await _fetch(_this.url.toString(), {\n\t\t\t\t\t\tmethod: _this.method,\n\t\t\t\t\t\theaders: requestHeaders,\n\t\t\t\t\t\tbody: JSON.stringify(_this.body, (_, value) => typeof value === \"bigint\" ? value.toString() : value),\n\t\t\t\t\t\tsignal: _this.signal\n\t\t\t\t\t});\n\t\t\t\t} catch (fetchError) {\n\t\t\t\t\tif ((fetchError === null || fetchError === void 0 ? void 0 : fetchError.name) === \"AbortError\" || (fetchError === null || fetchError === void 0 ? void 0 : fetchError.code) === \"ABORT_ERR\") throw fetchError;\n\t\t\t\t\tif (!RETRYABLE_METHODS.includes(_this.method)) throw fetchError;\n\t\t\t\t\tif (_this.retryEnabled && attemptCount < DEFAULT_MAX_RETRIES) {\n\t\t\t\t\t\tconst delay = getRetryDelay(attemptCount);\n\t\t\t\t\t\tattemptCount++;\n\t\t\t\t\t\tawait sleep(delay, _this.signal);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tthrow fetchError;\n\t\t\t\t}\n\t\t\t\tif (shouldRetry(_this.method, res$1.status, attemptCount, _this.retryEnabled)) {\n\t\t\t\t\tvar _res$headers$get, _res$headers;\n\t\t\t\t\tconst retryAfterHeader = (_res$headers$get = (_res$headers = res$1.headers) === null || _res$headers === void 0 ? void 0 : _res$headers.get(\"Retry-After\")) !== null && _res$headers$get !== void 0 ? _res$headers$get : null;\n\t\t\t\t\tconst delay = retryAfterHeader !== null ? Math.max(0, parseInt(retryAfterHeader, 10) || 0) * 1e3 : getRetryDelay(attemptCount);\n\t\t\t\t\tawait res$1.text();\n\t\t\t\t\tattemptCount++;\n\t\t\t\t\tawait sleep(delay, _this.signal);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\treturn await _this.processResponse(res$1);\n\t\t\t}\n\t\t};\n\t\tlet res = executeWithRetry();\n\t\tif (!this.shouldThrowOnError) res = res.catch((fetchError) => {\n\t\t\tvar _fetchError$name2;\n\t\t\tlet errorDetails = \"\";\n\t\t\tlet hint = \"\";\n\t\t\tlet code = \"\";\n\t\t\tconst cause = fetchError === null || fetchError === void 0 ? void 0 : fetchError.cause;\n\t\t\tif (cause) {\n\t\t\t\tvar _cause$message, _cause$code, _fetchError$name, _cause$name;\n\t\t\t\tconst causeMessage = (_cause$message = cause === null || cause === void 0 ? void 0 : cause.message) !== null && _cause$message !== void 0 ? _cause$message : \"\";\n\t\t\t\tconst causeCode = (_cause$code = cause === null || cause === void 0 ? void 0 : cause.code) !== null && _cause$code !== void 0 ? _cause$code : \"\";\n\t\t\t\terrorDetails = `${(_fetchError$name = fetchError === null || fetchError === void 0 ? void 0 : fetchError.name) !== null && _fetchError$name !== void 0 ? _fetchError$name : \"FetchError\"}: ${fetchError === null || fetchError === void 0 ? void 0 : fetchError.message}`;\n\t\t\t\terrorDetails += `\\n\\nCaused by: ${(_cause$name = cause === null || cause === void 0 ? void 0 : cause.name) !== null && _cause$name !== void 0 ? _cause$name : \"Error\"}: ${causeMessage}`;\n\t\t\t\tif (causeCode) errorDetails += ` (${causeCode})`;\n\t\t\t\tif (cause === null || cause === void 0 ? void 0 : cause.stack) errorDetails += `\\n${cause.stack}`;\n\t\t\t} else {\n\t\t\t\tvar _fetchError$stack;\n\t\t\t\terrorDetails = (_fetchError$stack = fetchError === null || fetchError === void 0 ? void 0 : fetchError.stack) !== null && _fetchError$stack !== void 0 ? _fetchError$stack : \"\";\n\t\t\t}\n\t\t\tconst urlLength = this.url.toString().length;\n\t\t\tif ((fetchError === null || fetchError === void 0 ? void 0 : fetchError.name) === \"AbortError\" || (fetchError === null || fetchError === void 0 ? void 0 : fetchError.code) === \"ABORT_ERR\") {\n\t\t\t\tcode = \"\";\n\t\t\t\thint = \"Request was aborted (timeout or manual cancellation)\";\n\t\t\t\tif (urlLength > this.urlLengthLimit) hint += `. Note: Your request URL is ${urlLength} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`;\n\t\t\t} else if ((cause === null || cause === void 0 ? void 0 : cause.name) === \"HeadersOverflowError\" || (cause === null || cause === void 0 ? void 0 : cause.code) === \"UND_ERR_HEADERS_OVERFLOW\") {\n\t\t\t\tcode = \"\";\n\t\t\t\thint = \"HTTP headers exceeded server limits (typically 16KB)\";\n\t\t\t\tif (urlLength > this.urlLengthLimit) hint += `. Your request URL is ${urlLength} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tmessage: `${(_fetchError$name2 = fetchError === null || fetchError === void 0 ? void 0 : fetchError.name) !== null && _fetchError$name2 !== void 0 ? _fetchError$name2 : \"FetchError\"}: ${fetchError === null || fetchError === void 0 ? void 0 : fetchError.message}`,\n\t\t\t\t\tdetails: errorDetails,\n\t\t\t\t\thint,\n\t\t\t\t\tcode\n\t\t\t\t},\n\t\t\t\tdata: null,\n\t\t\t\tcount: null,\n\t\t\t\tstatus: 0,\n\t\t\t\tstatusText: \"\"\n\t\t\t};\n\t\t});\n\t\treturn res.then(onfulfilled, onrejected);\n\t}\n\t/**\n\t* Process a fetch response and return the standardized postgrest response.\n\t*/\n\tasync processResponse(res) {\n\t\tvar _this2 = this;\n\t\tlet error = null;\n\t\tlet data = null;\n\t\tlet count = null;\n\t\tlet status = res.status;\n\t\tlet statusText = res.statusText;\n\t\tif (res.ok) {\n\t\t\tvar _this$headers$get2, _res$headers$get2;\n\t\t\tif (_this2.method !== \"HEAD\") {\n\t\t\t\tvar _this$headers$get;\n\t\t\t\tconst body = await res.text();\n\t\t\t\tif (body === \"\") {} else if (_this2.headers.get(\"Accept\") === \"text/csv\") data = body;\n\t\t\t\telse if (_this2.headers.get(\"Accept\") && ((_this$headers$get = _this2.headers.get(\"Accept\")) === null || _this$headers$get === void 0 ? void 0 : _this$headers$get.includes(\"application/vnd.pgrst.plan+text\"))) data = body;\n\t\t\t\telse data = JSON.parse(body);\n\t\t\t}\n\t\t\tconst countHeader = (_this$headers$get2 = _this2.headers.get(\"Prefer\")) === null || _this$headers$get2 === void 0 ? void 0 : _this$headers$get2.match(/count=(exact|planned|estimated)/);\n\t\t\tconst contentRange = (_res$headers$get2 = res.headers.get(\"content-range\")) === null || _res$headers$get2 === void 0 ? void 0 : _res$headers$get2.split(\"/\");\n\t\t\tif (countHeader && contentRange && contentRange.length > 1) count = parseInt(contentRange[1]);\n\t\t\tif (_this2.isMaybeSingle && Array.isArray(data)) if (data.length > 1) {\n\t\t\t\terror = {\n\t\t\t\t\tcode: \"PGRST116\",\n\t\t\t\t\tdetails: `Results contain ${data.length} rows, application/vnd.pgrst.object+json requires 1 row`,\n\t\t\t\t\thint: null,\n\t\t\t\t\tmessage: \"JSON object requested, multiple (or no) rows returned\"\n\t\t\t\t};\n\t\t\t\tdata = null;\n\t\t\t\tcount = null;\n\t\t\t\tstatus = 406;\n\t\t\t\tstatusText = \"Not Acceptable\";\n\t\t\t} else if (data.length === 1) data = data[0];\n\t\t\telse data = null;\n\t\t} else {\n\t\t\tconst body = await res.text();\n\t\t\ttry {\n\t\t\t\terror = JSON.parse(body);\n\t\t\t\tif (Array.isArray(error) && res.status === 404) {\n\t\t\t\t\tdata = [];\n\t\t\t\t\terror = null;\n\t\t\t\t\tstatus = 200;\n\t\t\t\t\tstatusText = \"OK\";\n\t\t\t\t}\n\t\t\t} catch (_unused) {\n\t\t\t\tif (res.status === 404 && body === \"\") {\n\t\t\t\t\tstatus = 204;\n\t\t\t\t\tstatusText = \"No Content\";\n\t\t\t\t} else error = { message: body };\n\t\t\t}\n\t\t\tif (error && _this2.shouldThrowOnError) throw new PostgrestError(error);\n\t\t}\n\t\treturn {\n\t\t\tsuccess: error === null,\n\t\t\terror,\n\t\t\tdata,\n\t\t\tcount,\n\t\t\tstatus,\n\t\t\tstatusText\n\t\t};\n\t}\n\t/**\n\t* Override the type of the returned `data`.\n\t*\n\t* @typeParam NewResult - The new result type to override with\n\t* @deprecated Use overrideTypes<yourType, { merge: false }>() method at the end of your call chain instead\n\t*\n\t* @category Database\n\t*/\n\treturns() {\n\t\t/* istanbul ignore next */\n\t\treturn this;\n\t}\n\t/**\n\t* Override the type of the returned `data` field in the response.\n\t*\n\t* @typeParam NewResult - The new type to cast the response data to\n\t* @typeParam Options - Optional type configuration (defaults to { merge: true })\n\t* @typeParam Options.merge - When true, merges the new type with existing return type. When false, replaces the existing types entirely (defaults to true)\n\t* @example\n\t* ```typescript\n\t* // Merge with existing types (default behavior)\n\t* const query = supabase\n\t* .from('users')\n\t* .select()\n\t* .overrideTypes<{ custom_field: string }>()\n\t*\n\t* // Replace existing types completely\n\t* const replaceQuery = supabase\n\t* .from('users')\n\t* .select()\n\t* .overrideTypes<{ id: number; name: string }, { merge: false }>()\n\t* ```\n\t* @returns A PostgrestBuilder instance with the new type\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example Complete Override type of successful response\n\t* ```ts\n\t* const { data } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .overrideTypes<Array<MyType>, { merge: false }>()\n\t* ```\n\t*\n\t* @exampleResponse Complete Override type of successful response\n\t* ```ts\n\t* let x: typeof data // MyType[]\n\t* ```\n\t*\n\t* @example Complete Override type of object response\n\t* ```ts\n\t* const { data } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .maybeSingle()\n\t* .overrideTypes<MyType, { merge: false }>()\n\t* ```\n\t*\n\t* @exampleResponse Complete Override type of object response\n\t* ```ts\n\t* let x: typeof data // MyType | null\n\t* ```\n\t*\n\t* @example Partial Override type of successful response\n\t* ```ts\n\t* const { data } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .overrideTypes<Array<{ status: \"A\" | \"B\" }>>()\n\t* ```\n\t*\n\t* @exampleResponse Partial Override type of successful response\n\t* ```ts\n\t* let x: typeof data // Array<CountryRowProperties & { status: \"A\" | \"B\" }>\n\t* ```\n\t*\n\t* @example Partial Override type of object response\n\t* ```ts\n\t* const { data } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .maybeSingle()\n\t* .overrideTypes<{ status: \"A\" | \"B\" }>()\n\t* ```\n\t*\n\t* @exampleResponse Partial Override type of object response\n\t* ```ts\n\t* let x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n\t* ```\n\t*\n\t* @example Merge vs replace existing types\n\t* ```typescript\n\t* // Merge with existing types (default behavior)\n\t* const query = supabase\n\t* .from('users')\n\t* .select()\n\t* .overrideTypes<{ custom_field: string }>()\n\t*\n\t* // Replace existing types completely\n\t* const replaceQuery = supabase\n\t* .from('users')\n\t* .select()\n\t* .overrideTypes<{ id: number; name: string }, { merge: false }>()\n\t* ```\n\t*/\n\toverrideTypes() {\n\t\treturn this;\n\t}\n};\n\n//#endregion\n//#region src/PostgrestTransformBuilder.ts\nvar PostgrestTransformBuilder = class extends PostgrestBuilder {\n\t/**\n\t* Perform a SELECT on the query result.\n\t*\n\t* By default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\n\t* return modified rows. By calling this method, modified rows are returned in\n\t* `data`.\n\t*\n\t* @param columns - The columns to retrieve, separated by commas\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `upsert()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .upsert({ id: 1, name: 'Han Solo' })\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql With `upsert()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `upsert()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Han Solo\"\n\t* }\n\t* ],\n\t* \"status\": 201,\n\t* \"statusText\": \"Created\"\n\t* }\n\t* ```\n\t*/\n\tselect(columns) {\n\t\tlet quoted = false;\n\t\tconst cleanedColumns = (columns !== null && columns !== void 0 ? columns : \"*\").split(\"\").map((c) => {\n\t\t\tif (/\\s/.test(c) && !quoted) return \"\";\n\t\t\tif (c === \"\\\"\") quoted = !quoted;\n\t\t\treturn c;\n\t\t}).join(\"\");\n\t\tthis.url.searchParams.set(\"select\", cleanedColumns);\n\t\tthis.headers.append(\"Prefer\", \"return=representation\");\n\t\treturn this;\n\t}\n\t/**\n\t* Order the query result by `column`.\n\t*\n\t* You can call this method multiple times to order by multiple columns.\n\t*\n\t* You can order referenced tables, but it only affects the ordering of the\n\t* parent table if you use `!inner` in the query.\n\t*\n\t* @param column - The column to order by\n\t* @param options - Named parameters\n\t* @param options.ascending - If `true`, the result will be in ascending order\n\t* @param options.nullsFirst - If `true`, `null`s appear first. If `false`,\n\t* `null`s appear last.\n\t* @param options.referencedTable - Set this to order a referenced table by\n\t* its columns\n\t* @param options.foreignTable - Deprecated, use `options.referencedTable`\n\t* instead\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('id, name')\n\t* .order('id', { ascending: false })\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Han\"\n\t* },\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Leia\"\n\t* },\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription On a referenced table\n\t* Ordering with `referencedTable` doesn't affect the ordering of the\n\t* parent table.\n\t*\n\t* @example On a referenced table\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('orchestral_sections')\n\t* .select(`\n\t* name,\n\t* instruments (\n\t* name\n\t* )\n\t* `)\n\t* .order('name', { referencedTable: 'instruments', ascending: false })\n\t*\n\t* ```\n\t*\n\t* @exampleSql On a referenced table\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 1, 'harp'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse On a referenced table\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"strings\",\n\t* \"instruments\": [\n\t* {\n\t* \"name\": \"violin\"\n\t* },\n\t* {\n\t* \"name\": \"harp\"\n\t* }\n\t* ]\n\t* },\n\t* {\n\t* \"name\": \"woodwinds\",\n\t* \"instruments\": []\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Order parent table by a referenced table\n\t* Ordering with `referenced_table(col)` affects the ordering of the\n\t* parent table.\n\t*\n\t* @example Order parent table by a referenced table\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('instruments')\n\t* .select(`\n\t* name,\n\t* section:orchestral_sections (\n\t* name\n\t* )\n\t* `)\n\t* .order('section(name)', { ascending: true })\n\t*\n\t* ```\n\t*\n\t* @exampleSql Order parent table by a referenced table\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 2, 'flute'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse Order parent table by a referenced table\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"violin\",\n\t* \"orchestral_sections\": {\"name\": \"strings\"}\n\t* },\n\t* {\n\t* \"name\": \"flute\",\n\t* \"orchestral_sections\": {\"name\": \"woodwinds\"}\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\torder(column, { ascending = true, nullsFirst, foreignTable, referencedTable = foreignTable } = {}) {\n\t\tconst key = referencedTable ? `${referencedTable}.order` : \"order\";\n\t\tconst existingOrder = this.url.searchParams.get(key);\n\t\tthis.url.searchParams.set(key, `${existingOrder ? `${existingOrder},` : \"\"}${column}.${ascending ? \"asc\" : \"desc\"}${nullsFirst === void 0 ? \"\" : nullsFirst ? \".nullsfirst\" : \".nullslast\"}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Limit the query result by `count`.\n\t*\n\t* @param count - The maximum number of rows to return\n\t* @param options - Named parameters\n\t* @param options.referencedTable - Set this to limit rows of referenced\n\t* tables instead of the parent table\n\t* @param options.foreignTable - Deprecated, use `options.referencedTable`\n\t* instead\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* .limit(1)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Luke\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example On a referenced table\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('orchestral_sections')\n\t* .select(`\n\t* name,\n\t* instruments (\n\t* name\n\t* )\n\t* `)\n\t* .limit(1, { referencedTable: 'instruments' })\n\t* ```\n\t*\n\t* @exampleSql On a referenced table\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 1, 'harp'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse On a referenced table\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"strings\",\n\t* \"instruments\": [\n\t* {\n\t* \"name\": \"violin\"\n\t* }\n\t* ]\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tlimit(count, { foreignTable, referencedTable = foreignTable } = {}) {\n\t\tconst key = typeof referencedTable === \"undefined\" ? \"limit\" : `${referencedTable}.limit`;\n\t\tthis.url.searchParams.set(key, `${count}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Limit the query result by starting at an offset `from` and ending at the offset `to`.\n\t* Only records within this range are returned.\n\t* This respects the query order and if there is no order clause the range could behave unexpectedly.\n\t* The `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\n\t* and fourth rows of the query.\n\t*\n\t* @param from - The starting index from which to limit the result\n\t* @param to - The last index to which to limit the result\n\t* @param options - Named parameters\n\t* @param options.referencedTable - Set this to limit rows of referenced\n\t* tables instead of the parent table\n\t* @param options.foreignTable - Deprecated, use `options.referencedTable`\n\t* instead\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* .range(0, 1)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Luke\"\n\t* },\n\t* {\n\t* \"name\": \"Leia\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\trange(from, to, { foreignTable, referencedTable = foreignTable } = {}) {\n\t\tconst keyOffset = typeof referencedTable === \"undefined\" ? \"offset\" : `${referencedTable}.offset`;\n\t\tconst keyLimit = typeof referencedTable === \"undefined\" ? \"limit\" : `${referencedTable}.limit`;\n\t\tthis.url.searchParams.set(keyOffset, `${from}`);\n\t\tthis.url.searchParams.set(keyLimit, `${to - from + 1}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Set the AbortSignal for the fetch request.\n\t*\n\t* @param signal - The AbortSignal to use for the fetch request\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @remarks\n\t* You can use this to set a timeout for the request.\n\t*\n\t* @exampleDescription Aborting requests in-flight\n\t* You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\n\t* Note that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.\n\t*\n\t* @example Aborting requests in-flight\n\t* ```ts\n\t* const ac = new AbortController()\n\t*\n\t* const { data, error } = await supabase\n\t* .from('very_big_table')\n\t* .select()\n\t* .abortSignal(ac.signal)\n\t*\n\t* // Abort the request after 100 ms\n\t* setTimeout(() => ac.abort(), 100)\n\t* ```\n\t*\n\t* @exampleResponse Aborting requests in-flight\n\t* ```json\n\t* {\n\t* \"error\": {\n\t* \"message\": \"AbortError: The user aborted a request.\",\n\t* \"details\": \"\",\n\t* \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n\t* \"code\": \"\"\n\t* },\n\t* \"status\": 0,\n\t* \"statusText\": \"\"\n\t* }\n\t*\n\t* ```\n\t*\n\t* @example Set a timeout\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('very_big_table')\n\t* .select()\n\t* .abortSignal(AbortSignal.timeout(1000 /* ms *\\/))\n\t* ```\n\t*\n\t* @exampleResponse Set a timeout\n\t* ```json\n\t* {\n\t* \"error\": {\n\t* \"message\": \"FetchError: The user aborted a request.\",\n\t* \"details\": \"\",\n\t* \"hint\": \"\",\n\t* \"code\": \"\"\n\t* },\n\t* \"status\": 400,\n\t* \"statusText\": \"Bad Request\"\n\t* }\n\t*\n\t* ```\n\t*/\n\tabortSignal(signal) {\n\t\tthis.signal = signal;\n\t\treturn this;\n\t}\n\t/**\n\t* Return `data` as a single object instead of an array of objects.\n\t*\n\t* Query result must be one row (e.g. using `.limit(1)`), otherwise this\n\t* returns an error.\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* .limit(1)\n\t* .single()\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"name\": \"Luke\"\n\t* },\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tsingle() {\n\t\tthis.headers.set(\"Accept\", \"application/vnd.pgrst.object+json\");\n\t\treturn this;\n\t}\n\t/**\n\t* Return `data` as a single object instead of an array of objects.\n\t*\n\t* Query result must be zero or one row (e.g. using `.limit(1)`), otherwise\n\t* this returns an error.\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .eq('name', 'Katniss')\n\t* .maybeSingle()\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tmaybeSingle() {\n\t\tthis.isMaybeSingle = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Return `data` as a string in CSV format.\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @exampleDescription Return data as CSV\n\t* By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.\n\t*\n\t* @example Return data as CSV\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .csv()\n\t* ```\n\t*\n\t* @exampleSql Return data as CSV\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse Return data as CSV\n\t* ```json\n\t* {\n\t* \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tcsv() {\n\t\tthis.headers.set(\"Accept\", \"text/csv\");\n\t\treturn this;\n\t}\n\t/**\n\t* Return `data` as an object in [GeoJSON](https://geojson.org) format.\n\t*\n\t* @category Database\n\t*/\n\tgeojson() {\n\t\tthis.headers.set(\"Accept\", \"application/geo+json\");\n\t\treturn this;\n\t}\n\t/**\n\t* Return `data` as the EXPLAIN plan for the query.\n\t*\n\t* You need to enable the\n\t* [db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\n\t* setting before using this method.\n\t*\n\t* @param options - Named parameters\n\t*\n\t* @param options.analyze - If `true`, the query will be executed and the\n\t* actual run time will be returned\n\t*\n\t* @param options.verbose - If `true`, the query identifier will be returned\n\t* and `data` will include the output columns of the query\n\t*\n\t* @param options.settings - If `true`, include information on configuration\n\t* parameters that affect query planning\n\t*\n\t* @param options.buffers - If `true`, include information on buffer usage\n\t*\n\t* @param options.wal - If `true`, include information on WAL record generation\n\t*\n\t* @param options.format - The format of the output, can be `\"text\"` (default)\n\t* or `\"json\"`\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @exampleDescription Get the execution plan\n\t* By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.\n\t*\n\t* @example Get the execution plan\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .explain()\n\t* ```\n\t*\n\t* @exampleSql Get the execution plan\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse Get the execution plan\n\t* ```js\n\t* Aggregate (cost=33.34..33.36 rows=1 width=112)\n\t* -> Limit (cost=0.00..18.33 rows=1000 width=40)\n\t* -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n\t* ```\n\t*\n\t* @exampleDescription Get the execution plan with analyze and verbose\n\t* By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.\n\t*\n\t* @example Get the execution plan with analyze and verbose\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .explain({analyze:true,verbose:true})\n\t* ```\n\t*\n\t* @exampleSql Get the execution plan with analyze and verbose\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse Get the execution plan with analyze and verbose\n\t* ```js\n\t* Aggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n\t* Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n\t* -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n\t* Output: characters.id, characters.name\n\t* -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n\t* Output: characters.id, characters.name\n\t* Query Identifier: -4730654291623321173\n\t* Planning Time: 0.407 ms\n\t* Execution Time: 0.119 ms\n\t* ```\n\t*/\n\texplain({ analyze = false, verbose = false, settings = false, buffers = false, wal = false, format = \"text\" } = {}) {\n\t\tvar _this$headers$get;\n\t\tconst options = [\n\t\t\tanalyze ? \"analyze\" : null,\n\t\t\tverbose ? \"verbose\" : null,\n\t\t\tsettings ? \"settings\" : null,\n\t\t\tbuffers ? \"buffers\" : null,\n\t\t\twal ? \"wal\" : null\n\t\t].filter(Boolean).join(\"|\");\n\t\tconst forMediatype = (_this$headers$get = this.headers.get(\"Accept\")) !== null && _this$headers$get !== void 0 ? _this$headers$get : \"application/json\";\n\t\tthis.headers.set(\"Accept\", `application/vnd.pgrst.plan+${format}; for=\"${forMediatype}\"; options=${options};`);\n\t\tif (format === \"json\") return this;\n\t\telse return this;\n\t}\n\t/**\n\t* Rollback the query.\n\t*\n\t* `data` will still be returned, but the query is not committed.\n\t*\n\t* @category Database\n\t*/\n\trollback() {\n\t\tthis.headers.append(\"Prefer\", \"tx=rollback\");\n\t\treturn this;\n\t}\n\t/**\n\t* Override the type of the returned `data`.\n\t*\n\t* @typeParam NewResult - The new result type to override with\n\t* @deprecated Use overrideTypes<yourType, { merge: false }>() method at the end of your call chain instead\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @remarks\n\t* - Deprecated: use overrideTypes method instead\n\t*\n\t* @example Override type of successful response\n\t* ```ts\n\t* const { data } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .returns<Array<MyType>>()\n\t* ```\n\t*\n\t* @exampleResponse Override type of successful response\n\t* ```js\n\t* let x: typeof data // MyType[]\n\t* ```\n\t*\n\t* @example Override type of object response\n\t* ```ts\n\t* const { data } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .maybeSingle()\n\t* .returns<MyType>()\n\t* ```\n\t*\n\t* @exampleResponse Override type of object response\n\t* ```js\n\t* let x: typeof data // MyType | null\n\t* ```\n\t*/\n\treturns() {\n\t\treturn this;\n\t}\n\t/**\n\t* Set the maximum number of rows that can be affected by the query.\n\t* Only available in PostgREST v13+ and only works with PATCH and DELETE methods.\n\t*\n\t* @param value - The maximum number of rows that can be affected\n\t*\n\t* @category Database\n\t*/\n\tmaxAffected(value) {\n\t\tthis.headers.append(\"Prefer\", \"handling=strict\");\n\t\tthis.headers.append(\"Prefer\", `max-affected=${value}`);\n\t\treturn this;\n\t}\n};\n\n//#endregion\n//#region src/PostgrestFilterBuilder.ts\nconst PostgrestReservedCharsRegexp = /* @__PURE__ */ new RegExp(\"[,()]\");\nvar PostgrestFilterBuilder = class extends PostgrestTransformBuilder {\n\t/**\n\t* Match only rows where `column` is equal to `value`.\n\t*\n\t* To check if the value of `column` is NULL, you should use `.is()` instead.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .eq('name', 'Leia')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Leia\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\teq(column, value) {\n\t\tthis.url.searchParams.append(column, `eq.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is not equal to `value`.\n\t*\n\t* This filter does not include rows where `column` is `NULL`. To match null\n\t* values, use `.is(column, null)` instead.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .neq('name', 'Leia')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* },\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Han\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tneq(column, value) {\n\t\tthis.url.searchParams.append(column, `neq.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is greater than `value`.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription With `select()`\n\t* When using [reserved words](https://www.postgresql.org/docs/current/sql-keywords-appendix.html) for column names you need\n\t* to add double quotes e.g. `.gt('\"order\"', 2)`\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .gt('id', 2)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Han\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tgt(column, value) {\n\t\tthis.url.searchParams.append(column, `gt.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is greater than or equal to `value`.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .gte('id', 2)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Leia\"\n\t* },\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Han\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tgte(column, value) {\n\t\tthis.url.searchParams.append(column, `gte.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is less than `value`.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .lt('id', 2)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tlt(column, value) {\n\t\tthis.url.searchParams.append(column, `lt.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is less than or equal to `value`.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .lte('id', 2)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* },\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Leia\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tlte(column, value) {\n\t\tthis.url.searchParams.append(column, `lte.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches `pattern` case-sensitively.\n\t*\n\t* @param column - The column to filter on\n\t* @param pattern - The pattern to match with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .like('name', '%Lu%')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tlike(column, pattern) {\n\t\tthis.url.searchParams.append(column, `like.${pattern}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches all of `patterns` case-sensitively.\n\t*\n\t* @param column - The column to filter on\n\t* @param patterns - The patterns to match with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*/\n\tlikeAllOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `like(all).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches any of `patterns` case-sensitively.\n\t*\n\t* @param column - The column to filter on\n\t* @param patterns - The patterns to match with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*/\n\tlikeAnyOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `like(any).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches `pattern` case-insensitively.\n\t*\n\t* @param column - The column to filter on\n\t* @param pattern - The pattern to match with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .ilike('name', '%lu%')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Luke\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tilike(column, pattern) {\n\t\tthis.url.searchParams.append(column, `ilike.${pattern}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches all of `patterns` case-insensitively.\n\t*\n\t* @param column - The column to filter on\n\t* @param patterns - The patterns to match with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*/\n\tilikeAllOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `ilike(all).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches any of `patterns` case-insensitively.\n\t*\n\t* @param column - The column to filter on\n\t* @param patterns - The patterns to match with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*/\n\tilikeAnyOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `ilike(any).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches the PostgreSQL regex `pattern`\n\t* case-sensitively (using the `~` operator).\n\t*\n\t* @param column - The column to filter on\n\t* @param pattern - The PostgreSQL regular expression pattern to match with\n\t*/\n\tregexMatch(column, pattern) {\n\t\tthis.url.searchParams.append(column, `match.${pattern}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` matches the PostgreSQL regex `pattern`\n\t* case-insensitively (using the `~*` operator).\n\t*\n\t* @param column - The column to filter on\n\t* @param pattern - The PostgreSQL regular expression pattern to match with\n\t*/\n\tregexIMatch(column, pattern) {\n\t\tthis.url.searchParams.append(column, `imatch.${pattern}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` IS `value`.\n\t*\n\t* For non-boolean columns, this is only relevant for checking if the value of\n\t* `column` is NULL by setting `value` to `null`.\n\t*\n\t* For boolean columns, you can also set `value` to `true` or `false` and it\n\t* will behave the same way as `.eq()`.\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription Checking for nullness, true or false\n\t* Using the `eq()` filter doesn't work when filtering for `null`.\n\t*\n\t* Instead, you need to use `is()`.\n\t*\n\t* @example Checking for nullness, true or false\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .is('name', null)\n\t* ```\n\t*\n\t* @exampleSql Checking for nullness, true or false\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* countries (id, name)\n\t* values\n\t* (1, 'null'),\n\t* (2, null);\n\t* ```\n\t*\n\t* @exampleResponse Checking for nullness, true or false\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"null\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tis(column, value) {\n\t\tthis.url.searchParams.append(column, `is.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` IS DISTINCT FROM `value`.\n\t*\n\t* Unlike `.neq()`, this treats `NULL` as a comparable value. Two `NULL` values\n\t* are considered equal (not distinct), and comparing `NULL` with any non-NULL\n\t* value returns true (distinct).\n\t*\n\t* @param column - The column to filter on\n\t* @param value - The value to filter with\n\t*/\n\tisDistinct(column, value) {\n\t\tthis.url.searchParams.append(column, `isdistinct.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is included in the `values` array.\n\t*\n\t* @param column - The column to filter on\n\t* @param values - The values array to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .in('name', ['Leia', 'Han'])\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Leia\"\n\t* },\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Han\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tin(column, values) {\n\t\tconst cleanedValues = Array.from(new Set(values)).map((s) => {\n\t\t\tif (typeof s === \"string\" && PostgrestReservedCharsRegexp.test(s)) return `\"${s}\"`;\n\t\t\telse return `${s}`;\n\t\t}).join(\",\");\n\t\tthis.url.searchParams.append(column, `in.(${cleanedValues})`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where `column` is NOT included in the `values` array.\n\t*\n\t* @param column - The column to filter on\n\t* @param values - The values array to filter with\n\t*/\n\tnotIn(column, values) {\n\t\tconst cleanedValues = Array.from(new Set(values)).map((s) => {\n\t\t\tif (typeof s === \"string\" && PostgrestReservedCharsRegexp.test(s)) return `\"${s}\"`;\n\t\t\telse return `${s}`;\n\t\t}).join(\",\");\n\t\tthis.url.searchParams.append(column, `not.in.(${cleanedValues})`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for jsonb, array, and range columns. Match only rows where\n\t* `column` contains every element appearing in `value`.\n\t*\n\t* @param column - The jsonb, array, or range column to filter on\n\t* @param value - The jsonb, array, or range value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example On array columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('issues')\n\t* .select()\n\t* .contains('tags', ['is:open', 'priority:low'])\n\t* ```\n\t*\n\t* @exampleSql On array columns\n\t* ```sql\n\t* create table\n\t* issues (\n\t* id int8 primary key,\n\t* title text,\n\t* tags text[]\n\t* );\n\t*\n\t* insert into\n\t* issues (id, title, tags)\n\t* values\n\t* (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),\n\t* (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);\n\t* ```\n\t*\n\t* @exampleResponse On array columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"title\": \"Cache invalidation is not working\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription On range columns\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example On range columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .contains('during', '[2000-01-01 13:00, 2000-01-01 13:30)')\n\t* ```\n\t*\n\t* @exampleSql On range columns\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse On range columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"room_name\": \"Emerald\",\n\t* \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example On `jsonb` columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .select('name')\n\t* .contains('address', { postcode: 90210 })\n\t* ```\n\t*\n\t* @exampleSql On `jsonb` columns\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 primary key,\n\t* name text,\n\t* address jsonb\n\t* );\n\t*\n\t* insert into\n\t* users (id, name, address)\n\t* values\n\t* (1, 'Michael', '{ \"postcode\": 90210, \"street\": \"Melrose Place\" }'),\n\t* (2, 'Jane', '{}');\n\t* ```\n\t*\n\t* @exampleResponse On `jsonb` columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Michael\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tcontains(column, value) {\n\t\tif (typeof value === \"string\") this.url.searchParams.append(column, `cs.${value}`);\n\t\telse if (Array.isArray(value)) this.url.searchParams.append(column, `cs.{${value.join(\",\")}}`);\n\t\telse this.url.searchParams.append(column, `cs.${JSON.stringify(value)}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for jsonb, array, and range columns. Match only rows where\n\t* every element appearing in `column` is contained by `value`.\n\t*\n\t* @param column - The jsonb, array, or range column to filter on\n\t* @param value - The jsonb, array, or range value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example On array columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('classes')\n\t* .select('name')\n\t* .containedBy('days', ['monday', 'tuesday', 'wednesday', 'friday'])\n\t* ```\n\t*\n\t* @exampleSql On array columns\n\t* ```sql\n\t* create table\n\t* classes (\n\t* id int8 primary key,\n\t* name text,\n\t* days text[]\n\t* );\n\t*\n\t* insert into\n\t* classes (id, name, days)\n\t* values\n\t* (1, 'Chemistry', array['monday', 'friday']),\n\t* (2, 'History', array['monday', 'wednesday', 'thursday']);\n\t* ```\n\t*\n\t* @exampleResponse On array columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Chemistry\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription On range columns\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example On range columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .containedBy('during', '[2000-01-01 00:00, 2000-01-01 23:59)')\n\t* ```\n\t*\n\t* @exampleSql On range columns\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse On range columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"room_name\": \"Emerald\",\n\t* \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example On `jsonb` columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .select('name')\n\t* .containedBy('address', {})\n\t* ```\n\t*\n\t* @exampleSql On `jsonb` columns\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 primary key,\n\t* name text,\n\t* address jsonb\n\t* );\n\t*\n\t* insert into\n\t* users (id, name, address)\n\t* values\n\t* (1, 'Michael', '{ \"postcode\": 90210, \"street\": \"Melrose Place\" }'),\n\t* (2, 'Jane', '{}');\n\t* ```\n\t*\n\t* @exampleResponse On `jsonb` columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Jane\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t*\n\t* ```\n\t*/\n\tcontainedBy(column, value) {\n\t\tif (typeof value === \"string\") this.url.searchParams.append(column, `cd.${value}`);\n\t\telse if (Array.isArray(value)) this.url.searchParams.append(column, `cd.{${value.join(\",\")}}`);\n\t\telse this.url.searchParams.append(column, `cd.${JSON.stringify(value)}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for range columns. Match only rows where every element in\n\t* `column` is greater than any element in `range`.\n\t*\n\t* @param column - The range column to filter on\n\t* @param range - The range to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription With `select()`\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .rangeGt('during', '[2000-01-02 08:00, 2000-01-02 09:00)')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 2,\n\t* \"room_name\": \"Topaz\",\n\t* \"during\": \"[\\\"2000-01-02 09:00:00\\\",\\\"2000-01-02 10:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t*\n\t* ```\n\t*/\n\trangeGt(column, range) {\n\t\tthis.url.searchParams.append(column, `sr.${range}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for range columns. Match only rows where every element in\n\t* `column` is either contained in `range` or greater than any element in\n\t* `range`.\n\t*\n\t* @param column - The range column to filter on\n\t* @param range - The range to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription With `select()`\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .rangeGte('during', '[2000-01-02 08:30, 2000-01-02 09:30)')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 2,\n\t* \"room_name\": \"Topaz\",\n\t* \"during\": \"[\\\"2000-01-02 09:00:00\\\",\\\"2000-01-02 10:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t*\n\t* ```\n\t*/\n\trangeGte(column, range) {\n\t\tthis.url.searchParams.append(column, `nxl.${range}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for range columns. Match only rows where every element in\n\t* `column` is less than any element in `range`.\n\t*\n\t* @param column - The range column to filter on\n\t* @param range - The range to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription With `select()`\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .rangeLt('during', '[2000-01-01 15:00, 2000-01-01 16:00)')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"room_name\": \"Emerald\",\n\t* \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\trangeLt(column, range) {\n\t\tthis.url.searchParams.append(column, `sl.${range}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for range columns. Match only rows where every element in\n\t* `column` is either contained in `range` or less than any element in\n\t* `range`.\n\t*\n\t* @param column - The range column to filter on\n\t* @param range - The range to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription With `select()`\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .rangeLte('during', '[2000-01-01 14:00, 2000-01-01 16:00)')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"room_name\": \"Emerald\",\n\t* \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t*\n\t* ```\n\t*/\n\trangeLte(column, range) {\n\t\tthis.url.searchParams.append(column, `nxr.${range}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for range columns. Match only rows where `column` is\n\t* mutually exclusive to `range` and there can be no element between the two\n\t* ranges.\n\t*\n\t* @param column - The range column to filter on\n\t* @param range - The range to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @exampleDescription With `select()`\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .rangeAdjacent('during', '[2000-01-01 12:00, 2000-01-01 13:00)')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"room_name\": \"Emerald\",\n\t* \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\trangeAdjacent(column, range) {\n\t\tthis.url.searchParams.append(column, `adj.${range}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for array and range columns. Match only rows where\n\t* `column` and `value` have an element in common.\n\t*\n\t* @param column - The array or range column to filter on\n\t* @param value - The array or range value to filter with\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example On array columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('issues')\n\t* .select('title')\n\t* .overlaps('tags', ['is:closed', 'severity:high'])\n\t* ```\n\t*\n\t* @exampleSql On array columns\n\t* ```sql\n\t* create table\n\t* issues (\n\t* id int8 primary key,\n\t* title text,\n\t* tags text[]\n\t* );\n\t*\n\t* insert into\n\t* issues (id, title, tags)\n\t* values\n\t* (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),\n\t* (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);\n\t* ```\n\t*\n\t* @exampleResponse On array columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"title\": \"Cache invalidation is not working\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription On range columns\n\t* Postgres supports a number of [range\n\t* types](https://www.postgresql.org/docs/current/rangetypes.html). You\n\t* can filter on range columns using the string representation of range\n\t* values.\n\t*\n\t* @example On range columns\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('reservations')\n\t* .select()\n\t* .overlaps('during', '[2000-01-01 12:45, 2000-01-01 13:15)')\n\t* ```\n\t*\n\t* @exampleSql On range columns\n\t* ```sql\n\t* create table\n\t* reservations (\n\t* id int8 primary key,\n\t* room_name text,\n\t* during tsrange\n\t* );\n\t*\n\t* insert into\n\t* reservations (id, room_name, during)\n\t* values\n\t* (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n\t* (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n\t* ```\n\t*\n\t* @exampleResponse On range columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"room_name\": \"Emerald\",\n\t* \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\toverlaps(column, value) {\n\t\tif (typeof value === \"string\") this.url.searchParams.append(column, `ov.${value}`);\n\t\telse this.url.searchParams.append(column, `ov.{${value.join(\",\")}}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Only relevant for text and tsvector columns. Match only rows where\n\t* `column` matches the query string in `query`.\n\t*\n\t* @param column - The text or tsvector column to filter on\n\t* @param query - The query text to match with\n\t* @param options - Named parameters\n\t* @param options.config - The text search configuration to use\n\t* @param options.type - Change how the `query` text is interpreted\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @remarks\n\t* - For more information, see [Postgres full text search](/docs/guides/database/full-text-search).\n\t*\n\t* @example Text search\n\t* ```ts\n\t* const result = await supabase\n\t* .from(\"texts\")\n\t* .select(\"content\")\n\t* .textSearch(\"content\", `'eggs' & 'ham'`, {\n\t* config: \"english\",\n\t* });\n\t* ```\n\t*\n\t* @exampleSql Text search\n\t* ```sql\n\t* create table texts (\n\t* id bigint\n\t* primary key\n\t* generated always as identity,\n\t* content text\n\t* );\n\t*\n\t* insert into texts (content) values\n\t* ('Four score and seven years ago'),\n\t* ('The road goes ever on and on'),\n\t* ('Green eggs and ham')\n\t* ;\n\t* ```\n\t*\n\t* @exampleResponse Text search\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"content\": \"Green eggs and ham\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Basic normalization\n\t* Uses PostgreSQL's `plainto_tsquery` function.\n\t*\n\t* @example Basic normalization\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('quotes')\n\t* .select('catchphrase')\n\t* .textSearch('catchphrase', `'fat' & 'cat'`, {\n\t* type: 'plain',\n\t* config: 'english'\n\t* })\n\t* ```\n\t*\n\t* @exampleDescription Full normalization\n\t* Uses PostgreSQL's `phraseto_tsquery` function.\n\t*\n\t* @example Full normalization\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('quotes')\n\t* .select('catchphrase')\n\t* .textSearch('catchphrase', `'fat' & 'cat'`, {\n\t* type: 'phrase',\n\t* config: 'english'\n\t* })\n\t* ```\n\t*\n\t* @exampleDescription Websearch\n\t* Uses PostgreSQL's `websearch_to_tsquery` function.\n\t* This function will never raise syntax errors, which makes it possible to use raw user-supplied input for search, and can be used\n\t* with advanced operators.\n\t*\n\t* - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery.\n\t* - `\"quoted text\"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery.\n\t* - `OR`: the word “or” will be converted to the | operator.\n\t* - `-`: a dash will be converted to the ! operator.\n\t*\n\t* @example Websearch\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('quotes')\n\t* .select('catchphrase')\n\t* .textSearch('catchphrase', `'fat or cat'`, {\n\t* type: 'websearch',\n\t* config: 'english'\n\t* })\n\t* ```\n\t*/\n\ttextSearch(column, query, { config, type } = {}) {\n\t\tlet typePart = \"\";\n\t\tif (type === \"plain\") typePart = \"pl\";\n\t\telse if (type === \"phrase\") typePart = \"ph\";\n\t\telse if (type === \"websearch\") typePart = \"w\";\n\t\tconst configPart = config === void 0 ? \"\" : `(${config})`;\n\t\tthis.url.searchParams.append(column, `${typePart}fts${configPart}.${query}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows where each column in `query` keys is equal to its\n\t* associated value. Shorthand for multiple `.eq()`s.\n\t*\n\t* @param query - The object to filter with, with column names as keys mapped\n\t* to their filter values\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* .match({ id: 2, name: 'Leia' })\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Leia\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tmatch(query) {\n\t\tObject.entries(query).filter(([_, value]) => value !== void 0).forEach(([column, value]) => {\n\t\t\tthis.url.searchParams.append(column, `eq.${value}`);\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows which doesn't satisfy the filter.\n\t*\n\t* Unlike most filters, `opearator` and `value` are used as-is and need to\n\t* follow [PostgREST\n\t* syntax](https://postgrest.org/en/stable/api.html#operators). You also need\n\t* to make sure they are properly sanitized.\n\t*\n\t* @param column - The column to filter on\n\t* @param operator - The operator to be negated to filter with, following\n\t* PostgREST syntax\n\t* @param value - The value to filter with, following PostgREST syntax\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @remarks\n\t* not() expects you to use the raw PostgREST syntax for the filter values.\n\t*\n\t* ```ts\n\t* .not('id', 'in', '(5,6,7)') // Use `()` for `in` filter\n\t* .not('arraycol', 'cs', '{\"a\",\"b\"}') // Use `cs` for `contains()`, `{}` for array values\n\t* ```\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('countries')\n\t* .select()\n\t* .not('name', 'is', null)\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* countries (id, name)\n\t* values\n\t* (1, 'null'),\n\t* (2, null);\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"null\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t*\n\t* ```\n\t*/\n\tnot(column, operator, value) {\n\t\tthis.url.searchParams.append(column, `not.${operator}.${value}`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows which satisfy at least one of the filters.\n\t*\n\t* Unlike most filters, `filters` is used as-is and needs to follow [PostgREST\n\t* syntax](https://postgrest.org/en/stable/api.html#operators). You also need\n\t* to make sure it's properly sanitized.\n\t*\n\t* It's currently not possible to do an `.or()` filter across multiple tables.\n\t*\n\t* @param filters - The filters to use, following PostgREST syntax\n\t* @param options - Named parameters\n\t* @param options.referencedTable - Set this to filter on referenced tables\n\t* instead of the parent table\n\t* @param options.foreignTable - Deprecated, use `referencedTable` instead\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @remarks\n\t* or() expects you to use the raw PostgREST syntax for the filter names and values.\n\t*\n\t* ```ts\n\t* .or('id.in.(5,6,7), arraycol.cs.{\"a\",\"b\"}') // Use `()` for `in` filter, `{}` for array values and `cs` for `contains()`.\n\t* .or('id.in.(5,6,7), arraycol.cd.{\"a\",\"b\"}') // Use `cd` for `containedBy()`\n\t* ```\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* .or('id.eq.2,name.eq.Han')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Leia\"\n\t* },\n\t* {\n\t* \"name\": \"Han\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example Use `or` with `and`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* .or('id.gt.3,and(id.eq.1,name.eq.Luke)')\n\t* ```\n\t*\n\t* @exampleSql Use `or` with `and`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse Use `or` with `and`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Luke\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example Use `or` on referenced tables\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('orchestral_sections')\n\t* .select(`\n\t* name,\n\t* instruments!inner (\n\t* name\n\t* )\n\t* `)\n\t* .or('section_id.eq.1,name.eq.guzheng', { referencedTable: 'instruments' })\n\t* ```\n\t*\n\t* @exampleSql Use `or` on referenced tables\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 2, 'flute'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse Use `or` on referenced tables\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"strings\",\n\t* \"instruments\": [\n\t* {\n\t* \"name\": \"violin\"\n\t* }\n\t* ]\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tor(filters, { foreignTable, referencedTable = foreignTable } = {}) {\n\t\tconst key = referencedTable ? `${referencedTable}.or` : \"or\";\n\t\tthis.url.searchParams.append(key, `(${filters})`);\n\t\treturn this;\n\t}\n\t/**\n\t* Match only rows which satisfy the filter. This is an escape hatch - you\n\t* should use the specific filter methods wherever possible.\n\t*\n\t* Unlike most filters, `opearator` and `value` are used as-is and need to\n\t* follow [PostgREST\n\t* syntax](https://postgrest.org/en/stable/api.html#operators). You also need\n\t* to make sure they are properly sanitized.\n\t*\n\t* @param column - The column to filter on\n\t* @param operator - The operator to filter with, following PostgREST syntax\n\t* @param value - The value to filter with, following PostgREST syntax\n\t*\n\t* @category Database\n\t* @subcategory Using filters\n\t*\n\t* @remarks\n\t* filter() expects you to use the raw PostgREST syntax for the filter values.\n\t*\n\t* ```ts\n\t* .filter('id', 'in', '(5,6,7)') // Use `()` for `in` filter\n\t* .filter('arraycol', 'cs', '{\"a\",\"b\"}') // Use `cs` for `contains()`, `{}` for array values\n\t* ```\n\t*\n\t* @example With `select()`\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* .filter('name', 'in', '(\"Han\",\"Yoda\")')\n\t* ```\n\t*\n\t* @exampleSql With `select()`\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse With `select()`\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Han\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example On a referenced table\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('orchestral_sections')\n\t* .select(`\n\t* name,\n\t* instruments!inner (\n\t* name\n\t* )\n\t* `)\n\t* .filter('instruments.name', 'eq', 'flute')\n\t* ```\n\t*\n\t* @exampleSql On a referenced table\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 2, 'flute'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse On a referenced table\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"woodwinds\",\n\t* \"instruments\": [\n\t* {\n\t* \"name\": \"flute\"\n\t* }\n\t* ]\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tfilter(column, operator, value) {\n\t\tthis.url.searchParams.append(column, `${operator}.${value}`);\n\t\treturn this;\n\t}\n};\n\n//#endregion\n//#region src/PostgrestQueryBuilder.ts\nvar PostgrestQueryBuilder = class {\n\t/**\n\t* Creates a query builder scoped to a Postgres table or view.\n\t*\n\t* @category Database\n\t*\n\t* @param url - The URL for the query\n\t* @param options - Named parameters\n\t* @param options.headers - Custom headers\n\t* @param options.schema - Postgres schema to use\n\t* @param options.fetch - Custom fetch implementation\n\t* @param options.urlLengthLimit - Maximum URL length before warning\n\t* @param options.retry - Enable automatic retries for transient errors (default: true)\n\t*\n\t* @example Using supabase-js (recommended)\n\t* ```ts\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* const { data, error } = await supabase.from('users').select('*')\n\t* ```\n\t*\n\t* @example Standalone import for bundle-sensitive environments\n\t* ```ts\n\t* import { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\t*\n\t* const query = new PostgrestQueryBuilder(\n\t* new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n\t* { headers: { apikey: 'your-publishable-key' }, retry: true }\n\t* )\n\t* ```\n\t*/\n\tconstructor(url, { headers = {}, schema, fetch: fetch$1, urlLengthLimit = 8e3, retry }) {\n\t\tthis.url = url;\n\t\tthis.headers = new Headers(headers);\n\t\tthis.schema = schema;\n\t\tthis.fetch = fetch$1;\n\t\tthis.urlLengthLimit = urlLengthLimit;\n\t\tthis.retry = retry;\n\t}\n\t/**\n\t* Clone URL and headers to prevent shared state between operations.\n\t*/\n\tcloneRequestState() {\n\t\treturn {\n\t\t\turl: new URL(this.url.toString()),\n\t\t\theaders: new Headers(this.headers)\n\t\t};\n\t}\n\t/**\n\t* Perform a SELECT query on the table or view.\n\t*\n\t* @param columns - The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`\n\t*\n\t* @param options - Named parameters\n\t*\n\t* @param options.head - When set to `true`, `data` will not be returned.\n\t* Useful if you only need the count.\n\t*\n\t* @param options.count - Count algorithm to use to count rows in the table or view.\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*\n\t* @remarks\n\t* When using `count` with `.range()` or `.limit()`, the returned `count` is the total number of rows\n\t* that match your filters, not the number of rows in the current page. Use this to build pagination UI.\n\t\n\t* - By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's [API settings](/dashboard/project/_/settings/api). It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data.\n\t* - `select()` can be combined with [Filters](/docs/reference/javascript/using-filters)\n\t* - `select()` can be combined with [Modifiers](/docs/reference/javascript/using-modifiers)\n\t* - `apikey` is a reserved keyword if you're using the [Supabase Platform](/docs/guides/platform) and [should be avoided as a column name](https://github.com/supabase/supabase/issues/5465). *\n\t* @category Database\n\t*\n\t* @example Getting your data\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Getting your data\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Harry'),\n\t* (2, 'Frodo'),\n\t* (3, 'Katniss');\n\t* ```\n\t*\n\t* @exampleResponse Getting your data\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Harry\"\n\t* },\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Frodo\"\n\t* },\n\t* {\n\t* \"id\": 3,\n\t* \"name\": \"Katniss\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example Selecting specific columns\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .from('characters')\n\t* .select('name')\n\t* ```\n\t*\n\t* @exampleSql Selecting specific columns\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Frodo'),\n\t* (2, 'Harry'),\n\t* (3, 'Katniss');\n\t* ```\n\t*\n\t* @exampleResponse Selecting specific columns\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Frodo\"\n\t* },\n\t* {\n\t* \"name\": \"Harry\"\n\t* },\n\t* {\n\t* \"name\": \"Katniss\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Query referenced tables\n\t* If your database has foreign key relationships, you can query related tables too.\n\t*\n\t* @example Query referenced tables\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .from('orchestral_sections')\n\t* .select(`\n\t* name,\n\t* instruments (\n\t* name\n\t* )\n\t* `)\n\t* ```\n\t*\n\t* @exampleSql Query referenced tables\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 2, 'flute'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse Query referenced tables\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"strings\",\n\t* \"instruments\": [\n\t* {\n\t* \"name\": \"violin\"\n\t* }\n\t* ]\n\t* },\n\t* {\n\t* \"name\": \"woodwinds\",\n\t* \"instruments\": [\n\t* {\n\t* \"name\": \"flute\"\n\t* }\n\t* ]\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Query referenced tables with spaces in their names\n\t* If your table name contains spaces, you must use double quotes in the `select` statement to reference the table.\n\t*\n\t* @example Query referenced tables with spaces in their names\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .from('orchestral sections')\n\t* .select(`\n\t* name,\n\t* \"musical instruments\" (\n\t* name\n\t* )\n\t* `)\n\t* ```\n\t*\n\t* @exampleSql Query referenced tables with spaces in their names\n\t* ```sql\n\t* create table\n\t* \"orchestral sections\" (id int8 primary key, name text);\n\t* create table\n\t* \"musical instruments\" (\n\t* id int8 primary key,\n\t* section_id int8 not null references \"orchestral sections\",\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* \"orchestral sections\" (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* \"musical instruments\" (id, section_id, name)\n\t* values\n\t* (1, 2, 'flute'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse Query referenced tables with spaces in their names\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"strings\",\n\t* \"musical instruments\": [\n\t* {\n\t* \"name\": \"violin\"\n\t* }\n\t* ]\n\t* },\n\t* {\n\t* \"name\": \"woodwinds\",\n\t* \"musical instruments\": [\n\t* {\n\t* \"name\": \"flute\"\n\t* }\n\t* ]\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Query referenced tables through a join table\n\t* If you're in a situation where your tables are **NOT** directly\n\t* related, but instead are joined by a _join table_, you can still use\n\t* the `select()` method to query the related data. The join table needs\n\t* to have the foreign keys as part of its composite primary key.\n\t*\n\t* @example Query referenced tables through a join table\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .select(`\n\t* name,\n\t* teams (\n\t* name\n\t* )\n\t* `)\n\t* \n\t* ```\n\t*\n\t* @exampleSql Query referenced tables through a join table\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 primary key,\n\t* name text\n\t* );\n\t* create table\n\t* teams (\n\t* id int8 primary key,\n\t* name text\n\t* );\n\t* -- join table\n\t* create table\n\t* users_teams (\n\t* user_id int8 not null references users,\n\t* team_id int8 not null references teams,\n\t* -- both foreign keys must be part of a composite primary key\n\t* primary key (user_id, team_id)\n\t* );\n\t*\n\t* insert into\n\t* users (id, name)\n\t* values\n\t* (1, 'Kiran'),\n\t* (2, 'Evan');\n\t* insert into\n\t* teams (id, name)\n\t* values\n\t* (1, 'Green'),\n\t* (2, 'Blue');\n\t* insert into\n\t* users_teams (user_id, team_id)\n\t* values\n\t* (1, 1),\n\t* (1, 2),\n\t* (2, 2);\n\t* ```\n\t*\n\t* @exampleResponse Query referenced tables through a join table\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"Kiran\",\n\t* \"teams\": [\n\t* {\n\t* \"name\": \"Green\"\n\t* },\n\t* {\n\t* \"name\": \"Blue\"\n\t* }\n\t* ]\n\t* },\n\t* {\n\t* \"name\": \"Evan\",\n\t* \"teams\": [\n\t* {\n\t* \"name\": \"Blue\"\n\t* }\n\t* ]\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* \n\t* ```\n\t*\n\t* @exampleDescription Query the same referenced table multiple times\n\t* If you need to query the same referenced table twice, use the name of the\n\t* joined column to identify which join to use. You can also give each\n\t* column an alias.\n\t*\n\t* @example Query the same referenced table multiple times\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('messages')\n\t* .select(`\n\t* content,\n\t* from:sender_id(name),\n\t* to:receiver_id(name)\n\t* `)\n\t*\n\t* // To infer types, use the name of the table (in this case `users`) and\n\t* // the name of the foreign key constraint.\n\t* const { data, error } = await supabase\n\t* .from('messages')\n\t* .select(`\n\t* content,\n\t* from:users!messages_sender_id_fkey(name),\n\t* to:users!messages_receiver_id_fkey(name)\n\t* `)\n\t* ```\n\t*\n\t* @exampleSql Query the same referenced table multiple times\n\t* ```sql\n\t* create table\n\t* users (id int8 primary key, name text);\n\t*\n\t* create table\n\t* messages (\n\t* sender_id int8 not null references users,\n\t* receiver_id int8 not null references users,\n\t* content text\n\t* );\n\t*\n\t* insert into\n\t* users (id, name)\n\t* values\n\t* (1, 'Kiran'),\n\t* (2, 'Evan');\n\t*\n\t* insert into\n\t* messages (sender_id, receiver_id, content)\n\t* values\n\t* (1, 2, '👋');\n\t* ```\n\t* ```\n\t*\n\t* @exampleResponse Query the same referenced table multiple times\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"content\": \"👋\",\n\t* \"from\": {\n\t* \"name\": \"Kiran\"\n\t* },\n\t* \"to\": {\n\t* \"name\": \"Evan\"\n\t* }\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Query nested foreign tables through a join table\n\t* You can use the result of a joined table to gather data in\n\t* another foreign table. With multiple references to the same foreign\n\t* table you must specify the column on which to conduct the join.\n\t*\n\t* @example Query nested foreign tables through a join table\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('games')\n\t* .select(`\n\t* game_id:id,\n\t* away_team:teams!games_away_team_fkey (\n\t* users (\n\t* id,\n\t* name\n\t* )\n\t* )\n\t* `)\n\t* \n\t* ```\n\t*\n\t* @exampleSql Query nested foreign tables through a join table\n\t* ```sql\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 primary key,\n\t* name text\n\t* );\n\t* create table\n\t* teams (\n\t* id int8 primary key,\n\t* name text\n\t* );\n\t* -- join table\n\t* create table\n\t* users_teams (\n\t* user_id int8 not null references users,\n\t* team_id int8 not null references teams,\n\t*\n\t* primary key (user_id, team_id)\n\t* );\n\t* create table\n\t* games (\n\t* id int8 primary key,\n\t* home_team int8 not null references teams,\n\t* away_team int8 not null references teams,\n\t* name text\n\t* );\n\t*\n\t* insert into users (id, name)\n\t* values\n\t* (1, 'Kiran'),\n\t* (2, 'Evan');\n\t* insert into\n\t* teams (id, name)\n\t* values\n\t* (1, 'Green'),\n\t* (2, 'Blue');\n\t* insert into\n\t* users_teams (user_id, team_id)\n\t* values\n\t* (1, 1),\n\t* (1, 2),\n\t* (2, 2);\n\t* insert into\n\t* games (id, home_team, away_team, name)\n\t* values\n\t* (1, 1, 2, 'Green vs Blue'),\n\t* (2, 2, 1, 'Blue vs Green');\n\t* ```\n\t*\n\t* @exampleResponse Query nested foreign tables through a join table\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"game_id\": 1,\n\t* \"away_team\": {\n\t* \"users\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Kiran\"\n\t* },\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"Evan\"\n\t* }\n\t* ]\n\t* }\n\t* },\n\t* {\n\t* \"game_id\": 2,\n\t* \"away_team\": {\n\t* \"users\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Kiran\"\n\t* }\n\t* ]\n\t* }\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* \n\t* ```\n\t*\n\t* @exampleDescription Filtering through referenced tables\n\t* If the filter on a referenced table's column is not satisfied, the referenced\n\t* table returns `[]` or `null` but the parent table is not filtered out.\n\t* If you want to filter out the parent table rows, use the `!inner` hint\n\t*\n\t* @example Filtering through referenced tables\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('instruments')\n\t* .select('name, orchestral_sections(*)')\n\t* .eq('orchestral_sections.name', 'percussion')\n\t* ```\n\t*\n\t* @exampleSql Filtering through referenced tables\n\t* ```sql\n\t* create table\n\t* orchestral_sections (id int8 primary key, name text);\n\t* create table\n\t* instruments (\n\t* id int8 primary key,\n\t* section_id int8 not null references orchestral_sections,\n\t* name text\n\t* );\n\t*\n\t* insert into\n\t* orchestral_sections (id, name)\n\t* values\n\t* (1, 'strings'),\n\t* (2, 'woodwinds');\n\t* insert into\n\t* instruments (id, section_id, name)\n\t* values\n\t* (1, 2, 'flute'),\n\t* (2, 1, 'violin');\n\t* ```\n\t*\n\t* @exampleResponse Filtering through referenced tables\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"flute\",\n\t* \"orchestral_sections\": null\n\t* },\n\t* {\n\t* \"name\": \"violin\",\n\t* \"orchestral_sections\": null\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Querying referenced table with count\n\t* You can get the number of rows in a related table by using the\n\t* **count** property.\n\t*\n\t* @example Querying referenced table with count\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('orchestral_sections')\n\t* .select(`*, instruments(count)`)\n\t* ```\n\t*\n\t* @exampleSql Querying referenced table with count\n\t* ```sql\n\t* create table orchestral_sections (\n\t* \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n\t* \"name\" text\n\t* );\n\t*\n\t* create table characters (\n\t* \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n\t* \"name\" text,\n\t* \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n\t* );\n\t*\n\t* with section as (\n\t* insert into orchestral_sections (name)\n\t* values ('strings') returning id\n\t* )\n\t* insert into instruments (name, section_id) values\n\t* ('violin', (select id from section)),\n\t* ('viola', (select id from section)),\n\t* ('cello', (select id from section)),\n\t* ('double bass', (select id from section));\n\t* ```\n\t*\n\t* @exampleResponse Querying referenced table with count\n\t* ```json\n\t* [\n\t* {\n\t* \"id\": \"693694e7-d993-4360-a6d7-6294e325d9b6\",\n\t* \"name\": \"strings\",\n\t* \"instruments\": [\n\t* {\n\t* \"count\": 4\n\t* }\n\t* ]\n\t* }\n\t* ]\n\t* ```\n\t*\n\t* @exampleDescription Querying with count option\n\t* You can get the number of rows by using the\n\t* [count](/docs/reference/javascript/select#parameters) option.\n\t*\n\t* @example Querying with count option\n\t* ```ts\n\t* const { count, error } = await supabase\n\t* .from('characters')\n\t* .select('*', { count: 'exact', head: true })\n\t* ```\n\t*\n\t* @exampleSql Querying with count option\n\t* ```sql\n\t* create table\n\t* characters (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* characters (id, name)\n\t* values\n\t* (1, 'Luke'),\n\t* (2, 'Leia'),\n\t* (3, 'Han');\n\t* ```\n\t*\n\t* @exampleResponse Querying with count option\n\t* ```json\n\t* {\n\t* \"count\": 3,\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Querying JSON data\n\t* You can select and filter data inside of\n\t* [JSON](/docs/guides/database/json) columns. Postgres offers some\n\t* [operators](/docs/guides/database/json#query-the-jsonb-data) for\n\t* querying JSON data.\n\t*\n\t* @example Querying JSON data\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .select(`\n\t* id, name,\n\t* address->city\n\t* `)\n\t* ```\n\t*\n\t* @exampleSql Querying JSON data\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 primary key,\n\t* name text,\n\t* address jsonb\n\t* );\n\t*\n\t* insert into\n\t* users (id, name, address)\n\t* values\n\t* (1, 'Frodo', '{\"city\":\"Hobbiton\"}');\n\t* ```\n\t*\n\t* @exampleResponse Querying JSON data\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Frodo\",\n\t* \"city\": \"Hobbiton\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Querying referenced table with inner join\n\t* If you don't want to return the referenced table contents, you can leave the parenthesis empty.\n\t* Like `.select('name, orchestral_sections!inner()')`.\n\t*\n\t* @example Querying referenced table with inner join\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('instruments')\n\t* .select('name, orchestral_sections!inner(name)')\n\t* .eq('orchestral_sections.name', 'woodwinds')\n\t* .limit(1)\n\t* ```\n\t*\n\t* @exampleSql Querying referenced table with inner join\n\t* ```sql\n\t* create table orchestral_sections (\n\t* \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n\t* \"name\" text\n\t* );\n\t*\n\t* create table instruments (\n\t* \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n\t* \"name\" text,\n\t* \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n\t* );\n\t*\n\t* with section as (\n\t* insert into orchestral_sections (name)\n\t* values ('woodwinds') returning id\n\t* )\n\t* insert into instruments (name, section_id) values\n\t* ('flute', (select id from section)),\n\t* ('clarinet', (select id from section)),\n\t* ('bassoon', (select id from section)),\n\t* ('piccolo', (select id from section));\n\t* ```\n\t*\n\t* @exampleResponse Querying referenced table with inner join\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"flute\",\n\t* \"orchestral_sections\": {\"name\": \"woodwinds\"}\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Switching schemas per query\n\t* In addition to setting the schema during initialization, you can also switch schemas on a per-query basis.\n\t* Make sure you've set up your [database privileges and API settings](/docs/guides/api/using-custom-schemas).\n\t*\n\t* @example Switching schemas per query\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .schema('myschema')\n\t* .from('mytable')\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Switching schemas per query\n\t* ```sql\n\t* create schema myschema;\n\t*\n\t* create table myschema.mytable (\n\t* id uuid primary key default gen_random_uuid(),\n\t* data text\n\t* );\n\t*\n\t* insert into myschema.mytable (data) values ('mydata');\n\t* ```\n\t*\n\t* @exampleResponse Switching schemas per query\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": \"4162e008-27b0-4c0f-82dc-ccaeee9a624d\",\n\t* \"data\": \"mydata\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tselect(columns, options) {\n\t\tconst { head = false, count } = options !== null && options !== void 0 ? options : {};\n\t\tconst method = head ? \"HEAD\" : \"GET\";\n\t\tlet quoted = false;\n\t\tconst cleanedColumns = (columns !== null && columns !== void 0 ? columns : \"*\").split(\"\").map((c) => {\n\t\t\tif (/\\s/.test(c) && !quoted) return \"\";\n\t\t\tif (c === \"\\\"\") quoted = !quoted;\n\t\t\treturn c;\n\t\t}).join(\"\");\n\t\tconst { url, headers } = this.cloneRequestState();\n\t\turl.searchParams.set(\"select\", cleanedColumns);\n\t\tif (count) headers.append(\"Prefer\", `count=${count}`);\n\t\treturn new PostgrestFilterBuilder({\n\t\t\tmethod,\n\t\t\turl,\n\t\t\theaders,\n\t\t\tschema: this.schema,\n\t\t\tfetch: this.fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n\t/**\n\t* Perform an INSERT into the table or view.\n\t*\n\t* By default, inserted rows are not returned. To return it, chain the call\n\t* with `.select()`.\n\t*\n\t* @param values - The values to insert. Pass an object to insert a single row\n\t* or an array to insert multiple rows.\n\t*\n\t* @param options - Named parameters\n\t*\n\t* @param options.count - Count algorithm to use to count inserted rows.\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*\n\t* @param options.defaultToNull - Make missing fields default to `null`.\n\t* Otherwise, use the default value for the column. Only applies for bulk\n\t* inserts.\n\t*\n\t* @category Database\n\t*\n\t* @example Create a record\n\t* ```ts\n\t* const { error } = await supabase\n\t* .from('countries')\n\t* .insert({ id: 1, name: 'Mordor' })\n\t* ```\n\t*\n\t* @exampleSql Create a record\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t* ```\n\t*\n\t* @exampleResponse Create a record\n\t* ```json\n\t* {\n\t* \"status\": 201,\n\t* \"statusText\": \"Created\"\n\t* }\n\t* ```\n\t*\n\t* @example Create a record and return it\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('countries')\n\t* .insert({ id: 1, name: 'Mordor' })\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Create a record and return it\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t* ```\n\t*\n\t* @exampleResponse Create a record and return it\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Mordor\"\n\t* }\n\t* ],\n\t* \"status\": 201,\n\t* \"statusText\": \"Created\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Bulk create\n\t* A bulk create operation is handled in a single transaction.\n\t* If any of the inserts fail, none of the rows are inserted.\n\t*\n\t* @example Bulk create\n\t* ```ts\n\t* const { error } = await supabase\n\t* .from('countries')\n\t* .insert([\n\t* { id: 1, name: 'Mordor' },\n\t* { id: 1, name: 'The Shire' },\n\t* ])\n\t* ```\n\t*\n\t* @exampleSql Bulk create\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t* ```\n\t*\n\t* @exampleResponse Bulk create\n\t* ```json\n\t* {\n\t* \"error\": {\n\t* \"code\": \"23505\",\n\t* \"details\": \"Key (id)=(1) already exists.\",\n\t* \"hint\": null,\n\t* \"message\": \"duplicate key value violates unique constraint \\\"countries_pkey\\\"\"\n\t* },\n\t* \"status\": 409,\n\t* \"statusText\": \"Conflict\"\n\t* }\n\t* ```\n\t*/\n\tinsert(values, { count, defaultToNull = true } = {}) {\n\t\tvar _this$fetch;\n\t\tconst method = \"POST\";\n\t\tconst { url, headers } = this.cloneRequestState();\n\t\tif (count) headers.append(\"Prefer\", `count=${count}`);\n\t\tif (!defaultToNull) headers.append(\"Prefer\", `missing=default`);\n\t\tif (Array.isArray(values)) {\n\t\t\tconst columns = values.reduce((acc, x) => acc.concat(Object.keys(x)), []);\n\t\t\tif (columns.length > 0) {\n\t\t\t\tconst uniqueColumns = [...new Set(columns)].map((column) => `\"${column}\"`);\n\t\t\t\turl.searchParams.set(\"columns\", uniqueColumns.join(\",\"));\n\t\t\t}\n\t\t}\n\t\treturn new PostgrestFilterBuilder({\n\t\t\tmethod,\n\t\t\turl,\n\t\t\theaders,\n\t\t\tschema: this.schema,\n\t\t\tbody: values,\n\t\t\tfetch: (_this$fetch = this.fetch) !== null && _this$fetch !== void 0 ? _this$fetch : fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n\t/**\n\t* Perform an UPSERT on the table or view. Depending on the column(s) passed\n\t* to `onConflict`, `.upsert()` allows you to perform the equivalent of\n\t* `.insert()` if a row with the corresponding `onConflict` columns doesn't\n\t* exist, or if it does exist, perform an alternative action depending on\n\t* `ignoreDuplicates`.\n\t*\n\t* By default, upserted rows are not returned. To return it, chain the call\n\t* with `.select()`.\n\t*\n\t* @param values - The values to upsert with. Pass an object to upsert a\n\t* single row or an array to upsert multiple rows.\n\t*\n\t* @param options - Named parameters\n\t*\n\t* @param options.onConflict - Comma-separated UNIQUE column(s) to specify how\n\t* duplicate rows are determined. Two rows are duplicates if all the\n\t* `onConflict` columns are equal.\n\t*\n\t* @param options.ignoreDuplicates - If `true`, duplicate rows are ignored. If\n\t* `false`, duplicate rows are merged with existing rows.\n\t*\n\t* @param options.count - Count algorithm to use to count upserted rows.\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*\n\t* @param options.defaultToNull - Make missing fields default to `null`.\n\t* Otherwise, use the default value for the column. This only applies when\n\t* inserting new rows, not when merging with existing rows under\n\t* `ignoreDuplicates: false`. This also only applies when doing bulk upserts.\n\t*\n\t* @example Upsert a single row using a unique key\n\t* ```ts\n\t* // Upserting a single row, overwriting based on the 'username' unique column\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .upsert({ username: 'supabot' }, { onConflict: 'username' })\n\t*\n\t* // Example response:\n\t* // {\n\t* // data: [\n\t* // { id: 4, message: 'bar', username: 'supabot' }\n\t* // ],\n\t* // error: null\n\t* // }\n\t* ```\n\t*\n\t* @example Upsert with conflict resolution and exact row counting\n\t* ```ts\n\t* // Upserting and returning exact count\n\t* const { data, error, count } = await supabase\n\t* .from('users')\n\t* .upsert(\n\t* {\n\t* id: 3,\n\t* message: 'foo',\n\t* username: 'supabot'\n\t* },\n\t* {\n\t* onConflict: 'username',\n\t* count: 'exact'\n\t* }\n\t* )\n\t*\n\t* // Example response:\n\t* // {\n\t* // data: [\n\t* // {\n\t* // id: 42,\n\t* // handle: \"saoirse\",\n\t* // display_name: \"Saoirse\"\n\t* // }\n\t* // ],\n\t* // count: 1,\n\t* // error: null\n\t* // }\n\t* ```\n\t*\n\t* @category Database\n\t*\n\t* @remarks\n\t* - Primary keys must be included in `values` to use upsert.\n\t*\n\t* @example Upsert your data\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('instruments')\n\t* .upsert({ id: 1, name: 'piano' })\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Upsert your data\n\t* ```sql\n\t* create table\n\t* instruments (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* instruments (id, name)\n\t* values\n\t* (1, 'harpsichord');\n\t* ```\n\t*\n\t* @exampleResponse Upsert your data\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"piano\"\n\t* }\n\t* ],\n\t* \"status\": 201,\n\t* \"statusText\": \"Created\"\n\t* }\n\t* ```\n\t*\n\t* @example Bulk Upsert your data\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('instruments')\n\t* .upsert([\n\t* { id: 1, name: 'piano' },\n\t* { id: 2, name: 'harp' },\n\t* ])\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Bulk Upsert your data\n\t* ```sql\n\t* create table\n\t* instruments (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* instruments (id, name)\n\t* values\n\t* (1, 'harpsichord');\n\t* ```\n\t*\n\t* @exampleResponse Bulk Upsert your data\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"piano\"\n\t* },\n\t* {\n\t* \"id\": 2,\n\t* \"name\": \"harp\"\n\t* }\n\t* ],\n\t* \"status\": 201,\n\t* \"statusText\": \"Created\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Upserting into tables with constraints\n\t* In the following query, `upsert()` implicitly uses the `id`\n\t* (primary key) column to determine conflicts. If there is no existing\n\t* row with the same `id`, `upsert()` inserts a new row, which\n\t* will fail in this case as there is already a row with `handle` `\"saoirse\"`.\n\t* Using the `onConflict` option, you can instruct `upsert()` to use\n\t* another column with a unique constraint to determine conflicts.\n\t*\n\t* @example Upserting into tables with constraints\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .upsert({ id: 42, handle: 'saoirse', display_name: 'Saoirse' })\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Upserting into tables with constraints\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 generated by default as identity primary key,\n\t* handle text not null unique,\n\t* display_name text\n\t* );\n\t*\n\t* insert into\n\t* users (id, handle, display_name)\n\t* values\n\t* (1, 'saoirse', null);\n\t* ```\n\t*\n\t* @exampleResponse Upserting into tables with constraints\n\t* ```json\n\t* {\n\t* \"error\": {\n\t* \"code\": \"23505\",\n\t* \"details\": \"Key (handle)=(saoirse) already exists.\",\n\t* \"hint\": null,\n\t* \"message\": \"duplicate key value violates unique constraint \\\"users_handle_key\\\"\"\n\t* },\n\t* \"status\": 409,\n\t* \"statusText\": \"Conflict\"\n\t* }\n\t* ```\n\t*/\n\tupsert(values, { onConflict, ignoreDuplicates = false, count, defaultToNull = true } = {}) {\n\t\tvar _this$fetch2;\n\t\tconst method = \"POST\";\n\t\tconst { url, headers } = this.cloneRequestState();\n\t\theaders.append(\"Prefer\", `resolution=${ignoreDuplicates ? \"ignore\" : \"merge\"}-duplicates`);\n\t\tif (onConflict !== void 0) url.searchParams.set(\"on_conflict\", onConflict);\n\t\tif (count) headers.append(\"Prefer\", `count=${count}`);\n\t\tif (!defaultToNull) headers.append(\"Prefer\", \"missing=default\");\n\t\tif (Array.isArray(values)) {\n\t\t\tconst columns = values.reduce((acc, x) => acc.concat(Object.keys(x)), []);\n\t\t\tif (columns.length > 0) {\n\t\t\t\tconst uniqueColumns = [...new Set(columns)].map((column) => `\"${column}\"`);\n\t\t\t\turl.searchParams.set(\"columns\", uniqueColumns.join(\",\"));\n\t\t\t}\n\t\t}\n\t\treturn new PostgrestFilterBuilder({\n\t\t\tmethod,\n\t\t\turl,\n\t\t\theaders,\n\t\t\tschema: this.schema,\n\t\t\tbody: values,\n\t\t\tfetch: (_this$fetch2 = this.fetch) !== null && _this$fetch2 !== void 0 ? _this$fetch2 : fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n\t/**\n\t* Perform an UPDATE on the table or view.\n\t*\n\t* By default, updated rows are not returned. To return it, chain the call\n\t* with `.select()` after filters.\n\t*\n\t* @param values - The values to update with\n\t*\n\t* @param options - Named parameters\n\t*\n\t* @param options.count - Count algorithm to use to count updated rows.\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*\n\t* @category Database\n\t*\n\t* @remarks\n\t* - `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update.\n\t*\n\t* @example Updating your data\n\t* ```ts\n\t* const { error } = await supabase\n\t* .from('instruments')\n\t* .update({ name: 'piano' })\n\t* .eq('id', 1)\n\t* ```\n\t*\n\t* @exampleSql Updating your data\n\t* ```sql\n\t* create table\n\t* instruments (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* instruments (id, name)\n\t* values\n\t* (1, 'harpsichord');\n\t* ```\n\t*\n\t* @exampleResponse Updating your data\n\t* ```json\n\t* {\n\t* \"status\": 204,\n\t* \"statusText\": \"No Content\"\n\t* }\n\t* ```\n\t*\n\t* @example Update a record and return it\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('instruments')\n\t* .update({ name: 'piano' })\n\t* .eq('id', 1)\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Update a record and return it\n\t* ```sql\n\t* create table\n\t* instruments (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* instruments (id, name)\n\t* values\n\t* (1, 'harpsichord');\n\t* ```\n\t*\n\t* @exampleResponse Update a record and return it\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"piano\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Updating JSON data\n\t* Postgres offers some\n\t* [operators](/docs/guides/database/json#query-the-jsonb-data) for\n\t* working with JSON data. Currently, it is only possible to update the entire JSON document.\n\t*\n\t* @example Updating JSON data\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('users')\n\t* .update({\n\t* address: {\n\t* street: 'Melrose Place',\n\t* postcode: 90210\n\t* }\n\t* })\n\t* .eq('address->postcode', 90210)\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Updating JSON data\n\t* ```sql\n\t* create table\n\t* users (\n\t* id int8 primary key,\n\t* name text,\n\t* address jsonb\n\t* );\n\t*\n\t* insert into\n\t* users (id, name, address)\n\t* values\n\t* (1, 'Michael', '{ \"postcode\": 90210 }');\n\t* ```\n\t*\n\t* @exampleResponse Updating JSON data\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Michael\",\n\t* \"address\": {\n\t* \"street\": \"Melrose Place\",\n\t* \"postcode\": 90210\n\t* }\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\tupdate(values, { count } = {}) {\n\t\tvar _this$fetch3;\n\t\tconst method = \"PATCH\";\n\t\tconst { url, headers } = this.cloneRequestState();\n\t\tif (count) headers.append(\"Prefer\", `count=${count}`);\n\t\treturn new PostgrestFilterBuilder({\n\t\t\tmethod,\n\t\t\turl,\n\t\t\theaders,\n\t\t\tschema: this.schema,\n\t\t\tbody: values,\n\t\t\tfetch: (_this$fetch3 = this.fetch) !== null && _this$fetch3 !== void 0 ? _this$fetch3 : fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n\t/**\n\t* Perform a DELETE on the table or view.\n\t*\n\t* By default, deleted rows are not returned. To return it, chain the call\n\t* with `.select()` after filters.\n\t*\n\t* @param options - Named parameters\n\t*\n\t* @param options.count - Count algorithm to use to count deleted rows.\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*\n\t* @category Database\n\t*\n\t* @remarks\n\t* - `delete()` should always be combined with [filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.\n\t* - If you use `delete()` with filters and you have\n\t* [RLS](/docs/learn/auth-deep-dive/auth-row-level-security) enabled, only\n\t* rows visible through `SELECT` policies are deleted. Note that by default\n\t* no rows are visible, so you need at least one `SELECT`/`ALL` policy that\n\t* makes the rows visible.\n\t* - When using `delete().in()`, specify an array of values to target multiple rows with a single query. This is particularly useful for batch deleting entries that share common criteria, such as deleting users by their IDs. Ensure that the array you provide accurately represents all records you intend to delete to avoid unintended data removal.\n\t*\n\t* @example Delete a single record\n\t* ```ts\n\t* const response = await supabase\n\t* .from('countries')\n\t* .delete()\n\t* .eq('id', 1)\n\t* ```\n\t*\n\t* @exampleSql Delete a single record\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* countries (id, name)\n\t* values\n\t* (1, 'Mordor');\n\t* ```\n\t*\n\t* @exampleResponse Delete a single record\n\t* ```json\n\t* {\n\t* \"status\": 204,\n\t* \"statusText\": \"No Content\"\n\t* }\n\t* ```\n\t*\n\t* @example Delete a record and return it\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('countries')\n\t* .delete()\n\t* .eq('id', 1)\n\t* .select()\n\t* ```\n\t*\n\t* @exampleSql Delete a record and return it\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* countries (id, name)\n\t* values\n\t* (1, 'Mordor');\n\t* ```\n\t*\n\t* @exampleResponse Delete a record and return it\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"id\": 1,\n\t* \"name\": \"Mordor\"\n\t* }\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example Delete multiple records\n\t* ```ts\n\t* const response = await supabase\n\t* .from('countries')\n\t* .delete()\n\t* .in('id', [1, 2, 3])\n\t* ```\n\t*\n\t* @exampleSql Delete multiple records\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* countries (id, name)\n\t* values\n\t* (1, 'Rohan'), (2, 'The Shire'), (3, 'Mordor');\n\t* ```\n\t*\n\t* @exampleResponse Delete multiple records\n\t* ```json\n\t* {\n\t* \"status\": 204,\n\t* \"statusText\": \"No Content\"\n\t* }\n\t* ```\n\t*/\n\tdelete({ count } = {}) {\n\t\tvar _this$fetch4;\n\t\tconst method = \"DELETE\";\n\t\tconst { url, headers } = this.cloneRequestState();\n\t\tif (count) headers.append(\"Prefer\", `count=${count}`);\n\t\treturn new PostgrestFilterBuilder({\n\t\t\tmethod,\n\t\t\turl,\n\t\t\theaders,\n\t\t\tschema: this.schema,\n\t\t\tfetch: (_this$fetch4 = this.fetch) !== null && _this$fetch4 !== void 0 ? _this$fetch4 : fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n};\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\treturn typeof o$1;\n\t} : function(o$1) {\n\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t}, _typeof(o);\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/objectSpread2.js\nfunction ownKeys(e, r) {\n\tvar t = Object.keys(e);\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\tr && (o = o.filter(function(r$1) {\n\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t})), t.push.apply(t, o);\n\t}\n\treturn t;\n}\nfunction _objectSpread2(e) {\n\tfor (var r = 1; r < arguments.length; r++) {\n\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t_defineProperty(e, r$1, t[r$1]);\n\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t});\n\t}\n\treturn e;\n}\n\n//#endregion\n//#region src/PostgrestClient.ts\n/**\n* PostgREST client.\n*\n* @typeParam Database - Types for the schema from the [type\n* generator](https://supabase.com/docs/reference/javascript/next/typescript-support)\n*\n* @typeParam SchemaName - Postgres schema to switch to. Must be a string\n* literal, the same one passed to the constructor. If the schema is not\n* `\"public\"`, this must be supplied manually.\n*/\nvar PostgrestClient = class PostgrestClient {\n\t/**\n\t* Creates a PostgREST client.\n\t*\n\t* @param url - URL of the PostgREST endpoint\n\t* @param options - Named parameters\n\t* @param options.headers - Custom headers\n\t* @param options.schema - Postgres schema to switch to\n\t* @param options.fetch - Custom fetch\n\t* @param options.timeout - Optional timeout in milliseconds for all requests. When set, requests will automatically abort after this duration to prevent indefinite hangs.\n\t* @param options.urlLengthLimit - Maximum URL length in characters before warnings/errors are triggered. Defaults to 8000.\n\t* @param options.retry - Enable or disable automatic retries for transient errors.\n\t* When enabled, idempotent requests (GET, HEAD, OPTIONS) that fail with network\n\t* errors or HTTP 503/520 responses will be automatically retried up to 3 times\n\t* with exponential backoff (1s, 2s, 4s). Defaults to `true`.\n\t* @example Using supabase-js (recommended)\n\t* ```ts\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* const { data, error } = await supabase.from('profiles').select('*')\n\t* ```\n\t*\n\t* @category Database\n\t*\n\t* @remarks\n\t* - A `timeout` option (in milliseconds) can be set to automatically abort requests that take too long.\n\t* - A `urlLengthLimit` option (default: 8000) can be set to control when URL length warnings are included in error messages for aborted requests.\n\t*\n\t* @example Standalone import for bundle-sensitive environments\n\t* ```ts\n\t* import { PostgrestClient } from '@supabase/postgrest-js'\n\t*\n\t* const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {\n\t* headers: { apikey: 'your-publishable-key' },\n\t* schema: 'public',\n\t* timeout: 30000, // 30 second timeout\n\t* })\n\t* ```\n\t*/\n\tconstructor(url, { headers = {}, schema, fetch: fetch$1, timeout, urlLengthLimit = 8e3, retry } = {}) {\n\t\tthis.url = url;\n\t\tthis.headers = new Headers(headers);\n\t\tthis.schemaName = schema;\n\t\tthis.urlLengthLimit = urlLengthLimit;\n\t\tconst originalFetch = fetch$1 !== null && fetch$1 !== void 0 ? fetch$1 : globalThis.fetch;\n\t\tif (timeout !== void 0 && timeout > 0) this.fetch = (input, init) => {\n\t\t\tconst controller = new AbortController();\n\t\t\tconst timeoutId = setTimeout(() => controller.abort(), timeout);\n\t\t\tconst existingSignal = init === null || init === void 0 ? void 0 : init.signal;\n\t\t\tif (existingSignal) {\n\t\t\t\tif (existingSignal.aborted) {\n\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\treturn originalFetch(input, init);\n\t\t\t\t}\n\t\t\t\tconst abortHandler = () => {\n\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\tcontroller.abort();\n\t\t\t\t};\n\t\t\t\texistingSignal.addEventListener(\"abort\", abortHandler, { once: true });\n\t\t\t\treturn originalFetch(input, _objectSpread2(_objectSpread2({}, init), {}, { signal: controller.signal })).finally(() => {\n\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\texistingSignal.removeEventListener(\"abort\", abortHandler);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn originalFetch(input, _objectSpread2(_objectSpread2({}, init), {}, { signal: controller.signal })).finally(() => clearTimeout(timeoutId));\n\t\t};\n\t\telse this.fetch = originalFetch;\n\t\tthis.retry = retry;\n\t}\n\t/**\n\t* Perform a query on a table or a view.\n\t*\n\t* @param relation - The table or view name to query\n\t*\n\t* @category Database\n\t*/\n\tfrom(relation) {\n\t\tif (!relation || typeof relation !== \"string\" || relation.trim() === \"\") throw new Error(\"Invalid relation name: relation must be a non-empty string.\");\n\t\treturn new PostgrestQueryBuilder(new URL(`${this.url}/${relation}`), {\n\t\t\theaders: new Headers(this.headers),\n\t\t\tschema: this.schemaName,\n\t\t\tfetch: this.fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n\t/**\n\t* Select a schema to query or perform an function (rpc) call.\n\t*\n\t* The schema needs to be on the list of exposed schemas inside Supabase.\n\t*\n\t* @param schema - The schema to query\n\t*\n\t* @category Database\n\t*/\n\tschema(schema) {\n\t\treturn new PostgrestClient(this.url, {\n\t\t\theaders: this.headers,\n\t\t\tschema,\n\t\t\tfetch: this.fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n\t/**\n\t* Perform a function call.\n\t*\n\t* @param fn - The function name to call\n\t* @param args - The arguments to pass to the function call\n\t* @param options - Named parameters\n\t* @param options.head - When set to `true`, `data` will not be returned.\n\t* Useful if you only need the count.\n\t* @param options.get - When set to `true`, the function will be called with\n\t* read-only access mode.\n\t* @param options.count - Count algorithm to use to count rows returned by the\n\t* function. Only applicable for [set-returning\n\t* functions](https://www.postgresql.org/docs/current/functions-srf.html).\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*\n\t* @example\n\t* ```ts\n\t* // For cross-schema functions where type inference fails, use overrideTypes:\n\t* const { data } = await supabase\n\t* .schema('schema_b')\n\t* .rpc('function_a', {})\n\t* .overrideTypes<{ id: string; user_id: string }[]>()\n\t* ```\n\t*\n\t* @category Database\n\t*\n\t* @example Call a Postgres function without arguments\n\t* ```ts\n\t* const { data, error } = await supabase.rpc('hello_world')\n\t* ```\n\t*\n\t* @exampleSql Call a Postgres function without arguments\n\t* ```sql\n\t* create function hello_world() returns text as $$\n\t* select 'Hello world';\n\t* $$ language sql;\n\t* ```\n\t*\n\t* @exampleResponse Call a Postgres function without arguments\n\t* ```json\n\t* {\n\t* \"data\": \"Hello world\",\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example Call a Postgres function with arguments\n\t* ```ts\n\t* const { data, error } = await supabase.rpc('echo', { say: '👋' })\n\t* ```\n\t*\n\t* @exampleSql Call a Postgres function with arguments\n\t* ```sql\n\t* create function echo(say text) returns text as $$\n\t* select say;\n\t* $$ language sql;\n\t* ```\n\t*\n\t* @exampleResponse Call a Postgres function with arguments\n\t* ```json\n\t* {\n\t* \"data\": \"👋\",\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t*\n\t* ```\n\t*\n\t* @exampleDescription Bulk processing\n\t* You can process large payloads by passing in an array as an argument.\n\t*\n\t* @example Bulk processing\n\t* ```ts\n\t* const { data, error } = await supabase.rpc('add_one_each', { arr: [1, 2, 3] })\n\t* ```\n\t*\n\t* @exampleSql Bulk processing\n\t* ```sql\n\t* create function add_one_each(arr int[]) returns int[] as $$\n\t* select array_agg(n + 1) from unnest(arr) as n;\n\t* $$ language sql;\n\t* ```\n\t*\n\t* @exampleResponse Bulk processing\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* 2,\n\t* 3,\n\t* 4\n\t* ],\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Call a Postgres function with filters\n\t* Postgres functions that return tables can also be combined with [Filters](/docs/reference/javascript/using-filters) and [Modifiers](/docs/reference/javascript/using-modifiers).\n\t*\n\t* @example Call a Postgres function with filters\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .rpc('list_stored_countries')\n\t* .eq('id', 1)\n\t* .single()\n\t* ```\n\t*\n\t* @exampleSql Call a Postgres function with filters\n\t* ```sql\n\t* create table\n\t* countries (id int8 primary key, name text);\n\t*\n\t* insert into\n\t* countries (id, name)\n\t* values\n\t* (1, 'Rohan'),\n\t* (2, 'The Shire');\n\t*\n\t* create function list_stored_countries() returns setof countries as $$\n\t* select * from countries;\n\t* $$ language sql;\n\t* ```\n\t*\n\t* @exampleResponse Call a Postgres function with filters\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"id\": 1,\n\t* \"name\": \"Rohan\"\n\t* },\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*\n\t* @example Call a read-only Postgres function\n\t* ```ts\n\t* const { data, error } = await supabase.rpc('hello_world', undefined, { get: true })\n\t* ```\n\t*\n\t* @exampleSql Call a read-only Postgres function\n\t* ```sql\n\t* create function hello_world() returns text as $$\n\t* select 'Hello world';\n\t* $$ language sql;\n\t* ```\n\t*\n\t* @exampleResponse Call a read-only Postgres function\n\t* ```json\n\t* {\n\t* \"data\": \"Hello world\",\n\t* \"status\": 200,\n\t* \"statusText\": \"OK\"\n\t* }\n\t* ```\n\t*/\n\trpc(fn, args = {}, { head = false, get = false, count } = {}) {\n\t\tvar _this$fetch;\n\t\tlet method;\n\t\tconst url = new URL(`${this.url}/rpc/${fn}`);\n\t\tlet body;\n\t\tconst _isObject = (v) => v !== null && typeof v === \"object\" && (!Array.isArray(v) || v.some(_isObject));\n\t\tconst _hasObjectArg = head && Object.values(args).some(_isObject);\n\t\tif (_hasObjectArg) {\n\t\t\tmethod = \"POST\";\n\t\t\tbody = args;\n\t\t} else if (head || get) {\n\t\t\tmethod = head ? \"HEAD\" : \"GET\";\n\t\t\tObject.entries(args).filter(([_, value]) => value !== void 0).map(([name, value]) => [name, Array.isArray(value) ? `{${value.join(\",\")}}` : `${value}`]).forEach(([name, value]) => {\n\t\t\t\turl.searchParams.append(name, value);\n\t\t\t});\n\t\t} else {\n\t\t\tmethod = \"POST\";\n\t\t\tbody = args;\n\t\t}\n\t\tconst headers = new Headers(this.headers);\n\t\tif (_hasObjectArg) headers.set(\"Prefer\", count ? `count=${count},return=minimal` : \"return=minimal\");\n\t\telse if (count) headers.set(\"Prefer\", `count=${count}`);\n\t\treturn new PostgrestFilterBuilder({\n\t\t\tmethod,\n\t\t\turl,\n\t\t\theaders,\n\t\t\tschema: this.schemaName,\n\t\t\tbody,\n\t\t\tfetch: (_this$fetch = this.fetch) !== null && _this$fetch !== void 0 ? _this$fetch : fetch,\n\t\t\turlLengthLimit: this.urlLengthLimit,\n\t\t\tretry: this.retry\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/index.ts\nvar src_default = {\n\tPostgrestClient,\n\tPostgrestQueryBuilder,\n\tPostgrestFilterBuilder,\n\tPostgrestTransformBuilder,\n\tPostgrestBuilder,\n\tPostgrestError\n};\n\n//#endregion\nexport { PostgrestBuilder, PostgrestClient, PostgrestError, PostgrestFilterBuilder, PostgrestQueryBuilder, PostgrestTransformBuilder, src_default as default };\n//# sourceMappingURL=index.mjs.map","/**\n * Utilities for creating WebSocket instances across runtimes.\n */\nexport class WebSocketFactory {\n /**\n * Static-only utility – prevent instantiation.\n */\n constructor() { }\n static detectEnvironment() {\n var _a;\n if (typeof WebSocket !== 'undefined') {\n return { type: 'native', wsConstructor: WebSocket };\n }\n const gt = globalThis;\n if (typeof globalThis !== 'undefined' && typeof gt.WebSocket !== 'undefined') {\n return { type: 'native', wsConstructor: gt.WebSocket };\n }\n const gl = typeof global !== 'undefined' ? global : undefined;\n if (gl && typeof gl.WebSocket !== 'undefined') {\n return { type: 'native', wsConstructor: gl.WebSocket };\n }\n if (typeof globalThis !== 'undefined' &&\n typeof gt.WebSocketPair !== 'undefined' &&\n typeof globalThis.WebSocket === 'undefined') {\n return {\n type: 'cloudflare',\n error: 'Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.',\n workaround: 'Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.',\n };\n }\n if ((typeof globalThis !== 'undefined' && gt.EdgeRuntime) ||\n (typeof navigator !== 'undefined' && ((_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes('Vercel-Edge')))) {\n return {\n type: 'unsupported',\n error: 'Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.',\n workaround: 'Use serverless functions or a different deployment target for WebSocket functionality.',\n };\n }\n // Use dynamic property access to avoid Next.js Edge Runtime static analysis warnings\n const _process = globalThis['process'];\n if (_process) {\n const processVersions = _process['versions'];\n if (processVersions && processVersions['node']) {\n // Remove 'v' prefix if present and parse the major version\n const versionString = processVersions['node'];\n const nodeVersion = parseInt(versionString.replace(/^v/, '').split('.')[0]);\n // Node.js 22+ should have native WebSocket\n if (nodeVersion >= 22) {\n // Check if native WebSocket is available (should be in Node.js 22+)\n if (typeof globalThis.WebSocket !== 'undefined') {\n return { type: 'native', wsConstructor: globalThis.WebSocket };\n }\n // If not available, user needs to provide it\n return {\n type: 'unsupported',\n error: `Node.js ${nodeVersion} detected but native WebSocket not found.`,\n workaround: 'Provide a WebSocket implementation via the transport option.',\n };\n }\n // Node.js < 22 doesn't have native WebSocket\n return {\n type: 'unsupported',\n error: `Node.js ${nodeVersion} detected without native WebSocket support.`,\n workaround: 'For Node.js < 22, install \"ws\" package and provide it via the transport option:\\n' +\n 'import ws from \"ws\"\\n' +\n 'new RealtimeClient(url, { transport: ws })',\n };\n }\n }\n return {\n type: 'unsupported',\n error: 'Unknown JavaScript runtime without WebSocket support.',\n workaround: \"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.\",\n };\n }\n /**\n * Returns the best available WebSocket constructor for the current runtime.\n *\n * @category Realtime\n *\n * @example Example with error handling\n * ```ts\n * try {\n * const WS = WebSocketFactory.getWebSocketConstructor()\n * const socket = new WS('wss://example.com/socket')\n * } catch (error) {\n * console.error('WebSocket not available in this environment.', error)\n * }\n * ```\n */\n static getWebSocketConstructor() {\n const env = this.detectEnvironment();\n if (env.wsConstructor) {\n return env.wsConstructor;\n }\n let errorMessage = env.error || 'WebSocket not supported in this environment.';\n if (env.workaround) {\n errorMessage += `\\n\\nSuggested solution: ${env.workaround}`;\n }\n throw new Error(errorMessage);\n }\n /**\n * Detects whether the runtime can establish WebSocket connections.\n *\n * @category Realtime\n *\n * @example Example in a Node.js script\n * ```ts\n * if (!WebSocketFactory.isWebSocketSupported()) {\n * console.error('WebSockets are required for this script.')\n * process.exitCode = 1\n * }\n * ```\n */\n static isWebSocketSupported() {\n try {\n const env = this.detectEnvironment();\n return env.type === 'native' || env.type === 'ws';\n }\n catch (_a) {\n return false;\n }\n }\n}\nexport default WebSocketFactory;\n//# sourceMappingURL=websocket-factory.js.map","// Generated automatically during releases by scripts/update-version-files.ts\n// This file provides runtime access to the package version for:\n// - HTTP request headers (e.g., X-Client-Info header for API requests)\n// - Debugging and support (identifying which version is running)\n// - Telemetry and logging (version reporting in errors/analytics)\n// - Ensuring build artifacts match the published package version\nexport const version = '2.106.2';\n//# sourceMappingURL=version.js.map","import { version } from './version';\nexport const DEFAULT_VERSION = `realtime-js/${version}`;\nexport const VSN_1_0_0 = '1.0.0';\nexport const VSN_2_0_0 = '2.0.0';\nexport const DEFAULT_VSN = VSN_2_0_0;\nexport const VERSION = version;\nexport const DEFAULT_TIMEOUT = 10000;\nexport const WS_CLOSE_NORMAL = 1000;\nexport const MAX_PUSH_BUFFER_SIZE = 100;\nexport const SOCKET_STATES = {\n connecting: 0,\n open: 1,\n closing: 2,\n closed: 3,\n};\nexport const CHANNEL_STATES = {\n closed: 'closed',\n errored: 'errored',\n joined: 'joined',\n joining: 'joining',\n leaving: 'leaving',\n};\nexport const CHANNEL_EVENTS = {\n close: 'phx_close',\n error: 'phx_error',\n join: 'phx_join',\n reply: 'phx_reply',\n leave: 'phx_leave',\n access_token: 'access_token',\n};\nexport const TRANSPORTS = {\n websocket: 'websocket',\n};\nexport const CONNECTION_STATE = {\n connecting: 'connecting',\n open: 'open',\n closing: 'closing',\n closed: 'closed',\n};\n//# sourceMappingURL=constants.js.map","export default class Serializer {\n constructor(allowedMetadataKeys) {\n this.HEADER_LENGTH = 1;\n this.USER_BROADCAST_PUSH_META_LENGTH = 6;\n this.KINDS = { userBroadcastPush: 3, userBroadcast: 4 };\n this.BINARY_ENCODING = 0;\n this.JSON_ENCODING = 1;\n this.BROADCAST_EVENT = 'broadcast';\n this.allowedMetadataKeys = [];\n this.allowedMetadataKeys = allowedMetadataKeys !== null && allowedMetadataKeys !== void 0 ? allowedMetadataKeys : [];\n }\n encode(msg, callback) {\n if (msg.event === this.BROADCAST_EVENT &&\n !(msg.payload instanceof ArrayBuffer) &&\n typeof msg.payload.event === 'string') {\n return callback(this._binaryEncodeUserBroadcastPush(msg));\n }\n let payload = [msg.join_ref, msg.ref, msg.topic, msg.event, msg.payload];\n return callback(JSON.stringify(payload));\n }\n _binaryEncodeUserBroadcastPush(message) {\n var _a;\n if (this._isArrayBuffer((_a = message.payload) === null || _a === void 0 ? void 0 : _a.payload)) {\n return this._encodeBinaryUserBroadcastPush(message);\n }\n else {\n return this._encodeJsonUserBroadcastPush(message);\n }\n }\n _encodeBinaryUserBroadcastPush(message) {\n var _a, _b;\n const userPayload = (_b = (_a = message.payload) === null || _a === void 0 ? void 0 : _a.payload) !== null && _b !== void 0 ? _b : new ArrayBuffer(0);\n return this._encodeUserBroadcastPush(message, this.BINARY_ENCODING, userPayload);\n }\n _encodeJsonUserBroadcastPush(message) {\n var _a, _b;\n const userPayload = (_b = (_a = message.payload) === null || _a === void 0 ? void 0 : _a.payload) !== null && _b !== void 0 ? _b : {};\n const encoder = new TextEncoder();\n const encodedUserPayload = encoder.encode(JSON.stringify(userPayload)).buffer;\n return this._encodeUserBroadcastPush(message, this.JSON_ENCODING, encodedUserPayload);\n }\n _encodeUserBroadcastPush(message, encodingType, encodedPayload) {\n var _a, _b;\n const topic = message.topic;\n const ref = (_a = message.ref) !== null && _a !== void 0 ? _a : '';\n const joinRef = (_b = message.join_ref) !== null && _b !== void 0 ? _b : '';\n const userEvent = message.payload.event;\n // Filter metadata based on allowed keys\n const rest = this.allowedMetadataKeys\n ? this._pick(message.payload, this.allowedMetadataKeys)\n : {};\n const metadata = Object.keys(rest).length === 0 ? '' : JSON.stringify(rest);\n // Validate lengths don't exceed uint8 max value (255)\n if (joinRef.length > 255) {\n throw new Error(`joinRef length ${joinRef.length} exceeds maximum of 255`);\n }\n if (ref.length > 255) {\n throw new Error(`ref length ${ref.length} exceeds maximum of 255`);\n }\n if (topic.length > 255) {\n throw new Error(`topic length ${topic.length} exceeds maximum of 255`);\n }\n if (userEvent.length > 255) {\n throw new Error(`userEvent length ${userEvent.length} exceeds maximum of 255`);\n }\n if (metadata.length > 255) {\n throw new Error(`metadata length ${metadata.length} exceeds maximum of 255`);\n }\n const metaLength = this.USER_BROADCAST_PUSH_META_LENGTH +\n joinRef.length +\n ref.length +\n topic.length +\n userEvent.length +\n metadata.length;\n const header = new ArrayBuffer(this.HEADER_LENGTH + metaLength);\n let view = new DataView(header);\n let offset = 0;\n view.setUint8(offset++, this.KINDS.userBroadcastPush); // kind\n view.setUint8(offset++, joinRef.length);\n view.setUint8(offset++, ref.length);\n view.setUint8(offset++, topic.length);\n view.setUint8(offset++, userEvent.length);\n view.setUint8(offset++, metadata.length);\n view.setUint8(offset++, encodingType);\n Array.from(joinRef, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(ref, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(topic, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(userEvent, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(metadata, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n var combined = new Uint8Array(header.byteLength + encodedPayload.byteLength);\n combined.set(new Uint8Array(header), 0);\n combined.set(new Uint8Array(encodedPayload), header.byteLength);\n return combined.buffer;\n }\n decode(rawPayload, callback) {\n if (this._isArrayBuffer(rawPayload)) {\n let result = this._binaryDecode(rawPayload);\n return callback(result);\n }\n if (typeof rawPayload === 'string') {\n const jsonPayload = JSON.parse(rawPayload);\n const [join_ref, ref, topic, event, payload] = jsonPayload;\n return callback({ join_ref, ref, topic, event, payload });\n }\n return callback({});\n }\n _binaryDecode(buffer) {\n const view = new DataView(buffer);\n const kind = view.getUint8(0);\n const decoder = new TextDecoder();\n switch (kind) {\n case this.KINDS.userBroadcast:\n return this._decodeUserBroadcast(buffer, view, decoder);\n }\n }\n _decodeUserBroadcast(buffer, view, decoder) {\n const topicSize = view.getUint8(1);\n const userEventSize = view.getUint8(2);\n const metadataSize = view.getUint8(3);\n const payloadEncoding = view.getUint8(4);\n let offset = this.HEADER_LENGTH + 4;\n const topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n const userEvent = decoder.decode(buffer.slice(offset, offset + userEventSize));\n offset = offset + userEventSize;\n const metadata = decoder.decode(buffer.slice(offset, offset + metadataSize));\n offset = offset + metadataSize;\n const payload = buffer.slice(offset, buffer.byteLength);\n const parsedPayload = payloadEncoding === this.JSON_ENCODING ? JSON.parse(decoder.decode(payload)) : payload;\n const data = {\n type: this.BROADCAST_EVENT,\n event: userEvent,\n payload: parsedPayload,\n };\n // Metadata is optional and always JSON encoded\n if (metadataSize > 0) {\n data['meta'] = JSON.parse(metadata);\n }\n return { join_ref: null, ref: null, topic: topic, event: this.BROADCAST_EVENT, payload: data };\n }\n _isArrayBuffer(buffer) {\n var _a;\n return buffer instanceof ArrayBuffer || ((_a = buffer === null || buffer === void 0 ? void 0 : buffer.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'ArrayBuffer';\n }\n _pick(obj, keys) {\n if (!obj || typeof obj !== 'object') {\n return {};\n }\n return Object.fromEntries(Object.entries(obj).filter(([key]) => keys.includes(key)));\n }\n}\n//# sourceMappingURL=serializer.js.map","/**\n * Helpers to convert the change Payload into native JS types.\n */\n// Adapted from epgsql (src/epgsql_binary.erl), this module licensed under\n// 3-clause BSD found here: https://raw.githubusercontent.com/epgsql/epgsql/devel/LICENSE\nexport var PostgresTypes;\n(function (PostgresTypes) {\n PostgresTypes[\"abstime\"] = \"abstime\";\n PostgresTypes[\"bool\"] = \"bool\";\n PostgresTypes[\"date\"] = \"date\";\n PostgresTypes[\"daterange\"] = \"daterange\";\n PostgresTypes[\"float4\"] = \"float4\";\n PostgresTypes[\"float8\"] = \"float8\";\n PostgresTypes[\"int2\"] = \"int2\";\n PostgresTypes[\"int4\"] = \"int4\";\n PostgresTypes[\"int4range\"] = \"int4range\";\n PostgresTypes[\"int8\"] = \"int8\";\n PostgresTypes[\"int8range\"] = \"int8range\";\n PostgresTypes[\"json\"] = \"json\";\n PostgresTypes[\"jsonb\"] = \"jsonb\";\n PostgresTypes[\"money\"] = \"money\";\n PostgresTypes[\"numeric\"] = \"numeric\";\n PostgresTypes[\"oid\"] = \"oid\";\n PostgresTypes[\"reltime\"] = \"reltime\";\n PostgresTypes[\"text\"] = \"text\";\n PostgresTypes[\"time\"] = \"time\";\n PostgresTypes[\"timestamp\"] = \"timestamp\";\n PostgresTypes[\"timestamptz\"] = \"timestamptz\";\n PostgresTypes[\"timetz\"] = \"timetz\";\n PostgresTypes[\"tsrange\"] = \"tsrange\";\n PostgresTypes[\"tstzrange\"] = \"tstzrange\";\n})(PostgresTypes || (PostgresTypes = {}));\n/**\n * Takes an array of columns and an object of string values then converts each string value\n * to its mapped type.\n *\n * @param {{name: String, type: String}[]} columns\n * @param {Object} record\n * @param {Object} options The map of various options that can be applied to the mapper\n * @param {Array} options.skipTypes The array of types that should not be converted\n *\n * @example convertChangeData([{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {first_name: 'Paul', age:'33'}, {})\n * //=>{ first_name: 'Paul', age: 33 }\n */\nexport const convertChangeData = (columns, record, options = {}) => {\n var _a;\n const skipTypes = (_a = options.skipTypes) !== null && _a !== void 0 ? _a : [];\n if (!record) {\n return {};\n }\n return Object.keys(record).reduce((acc, rec_key) => {\n acc[rec_key] = convertColumn(rec_key, columns, record, skipTypes);\n return acc;\n }, {});\n};\n/**\n * Converts the value of an individual column.\n *\n * @param {String} columnName The column that you want to convert\n * @param {{name: String, type: String}[]} columns All of the columns\n * @param {Object} record The map of string values\n * @param {Array} skipTypes An array of types that should not be converted\n * @return {object} Useless information\n *\n * @example convertColumn('age', [{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {first_name: 'Paul', age: '33'}, [])\n * //=> 33\n * @example convertColumn('age', [{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {first_name: 'Paul', age: '33'}, ['int4'])\n * //=> \"33\"\n */\nexport const convertColumn = (columnName, columns, record, skipTypes) => {\n const column = columns.find((x) => x.name === columnName);\n const colType = column === null || column === void 0 ? void 0 : column.type;\n const value = record[columnName];\n if (colType && !skipTypes.includes(colType)) {\n return convertCell(colType, value);\n }\n return noop(value);\n};\n/**\n * If the value of the cell is `null`, returns null.\n * Otherwise converts the string value to the correct type.\n * @param {String} type A postgres column type\n * @param {String} value The cell value\n *\n * @example convertCell('bool', 't')\n * //=> true\n * @example convertCell('int8', '10')\n * //=> 10\n * @example convertCell('_int4', '{1,2,3,4}')\n * //=> [1,2,3,4]\n */\nexport const convertCell = (type, value) => {\n // if data type is an array\n if (type.charAt(0) === '_') {\n const dataType = type.slice(1, type.length);\n return toArray(value, dataType);\n }\n // If not null, convert to correct type.\n switch (type) {\n case PostgresTypes.bool:\n return toBoolean(value);\n case PostgresTypes.float4:\n case PostgresTypes.float8:\n case PostgresTypes.int2:\n case PostgresTypes.int4:\n case PostgresTypes.int8:\n case PostgresTypes.numeric:\n case PostgresTypes.oid:\n return toNumber(value);\n case PostgresTypes.json:\n case PostgresTypes.jsonb:\n return toJson(value);\n case PostgresTypes.timestamp:\n return toTimestampString(value); // Format to be consistent with PostgREST\n case PostgresTypes.abstime: // To allow users to cast it based on Timezone\n case PostgresTypes.date: // To allow users to cast it based on Timezone\n case PostgresTypes.daterange:\n case PostgresTypes.int4range:\n case PostgresTypes.int8range:\n case PostgresTypes.money:\n case PostgresTypes.reltime: // To allow users to cast it based on Timezone\n case PostgresTypes.text:\n case PostgresTypes.time: // To allow users to cast it based on Timezone\n case PostgresTypes.timestamptz: // To allow users to cast it based on Timezone\n case PostgresTypes.timetz: // To allow users to cast it based on Timezone\n case PostgresTypes.tsrange:\n case PostgresTypes.tstzrange:\n return noop(value);\n default:\n // Return the value for remaining types\n return noop(value);\n }\n};\nconst noop = (value) => {\n return value;\n};\nexport const toBoolean = (value) => {\n switch (value) {\n case 't':\n return true;\n case 'f':\n return false;\n default:\n return value;\n }\n};\nexport const toNumber = (value) => {\n if (typeof value === 'string') {\n const parsedValue = parseFloat(value);\n if (!Number.isNaN(parsedValue)) {\n return parsedValue;\n }\n }\n return value;\n};\nexport const toJson = (value) => {\n if (typeof value === 'string') {\n try {\n return JSON.parse(value);\n }\n catch (_a) {\n return value;\n }\n }\n return value;\n};\n/**\n * Converts a Postgres Array into a native JS array\n *\n * @example toArray('{}', 'int4')\n * //=> []\n * @example toArray('{\"[2021-01-01,2021-12-31)\",\"(2021-01-01,2021-12-32]\"}', 'daterange')\n * //=> ['[2021-01-01,2021-12-31)', '(2021-01-01,2021-12-32]']\n * @example toArray([1,2,3,4], 'int4')\n * //=> [1,2,3,4]\n */\nexport const toArray = (value, type) => {\n if (typeof value !== 'string') {\n return value;\n }\n const lastIdx = value.length - 1;\n const closeBrace = value[lastIdx];\n const openBrace = value[0];\n // Confirm value is a Postgres array by checking curly brackets\n if (openBrace === '{' && closeBrace === '}') {\n let arr;\n const valTrim = value.slice(1, lastIdx);\n // TODO: find a better solution to separate Postgres array data\n try {\n arr = JSON.parse('[' + valTrim + ']');\n }\n catch (_) {\n // WARNING: splitting on comma does not cover all edge cases\n arr = valTrim ? valTrim.split(',') : [];\n }\n return arr.map((val) => convertCell(type, val));\n }\n return value;\n};\n/**\n * Fixes timestamp to be ISO-8601. Swaps the space between the date and time for a 'T'\n * See https://github.com/supabase/supabase/issues/18\n *\n * @example toTimestampString('2019-09-10 00:00:00')\n * //=> '2019-09-10T00:00:00'\n */\nexport const toTimestampString = (value) => {\n if (typeof value === 'string') {\n return value.replace(' ', 'T');\n }\n return value;\n};\nexport const httpEndpointURL = (socketUrl) => {\n const wsUrl = new URL(socketUrl);\n wsUrl.protocol = wsUrl.protocol.replace(/^ws/i, 'http');\n wsUrl.pathname = wsUrl.pathname\n .replace(/\\/+$/, '') // remove all trailing slashes\n .replace(/\\/socket\\/websocket$/i, '') // remove the socket/websocket path\n .replace(/\\/socket$/i, '') // remove the socket path\n .replace(/\\/websocket$/i, ''); // remove the websocket path\n if (wsUrl.pathname === '' || wsUrl.pathname === '/') {\n wsUrl.pathname = '/api/broadcast';\n }\n else {\n wsUrl.pathname = wsUrl.pathname + '/api/broadcast';\n }\n return wsUrl.href;\n};\n//# sourceMappingURL=transformers.js.map","// js/phoenix/utils.js\nvar closure = (value) => {\n if (typeof value === \"function\") {\n return (\n /** @type {() => T} */\n value\n );\n } else {\n let closure2 = function() {\n return value;\n };\n return closure2;\n }\n};\n\n// js/phoenix/constants.js\nvar globalSelf = typeof self !== \"undefined\" ? self : null;\nvar phxWindow = typeof window !== \"undefined\" ? window : null;\nvar global = globalSelf || phxWindow || globalThis;\nvar DEFAULT_VSN = \"2.0.0\";\nvar DEFAULT_TIMEOUT = 1e4;\nvar WS_CLOSE_NORMAL = 1e3;\nvar SOCKET_STATES = (\n /** @type {const} */\n { connecting: 0, open: 1, closing: 2, closed: 3 }\n);\nvar CHANNEL_STATES = (\n /** @type {const} */\n {\n closed: \"closed\",\n errored: \"errored\",\n joined: \"joined\",\n joining: \"joining\",\n leaving: \"leaving\"\n }\n);\nvar CHANNEL_EVENTS = (\n /** @type {const} */\n {\n close: \"phx_close\",\n error: \"phx_error\",\n join: \"phx_join\",\n reply: \"phx_reply\",\n leave: \"phx_leave\"\n }\n);\nvar TRANSPORTS = (\n /** @type {const} */\n {\n longpoll: \"longpoll\",\n websocket: \"websocket\"\n }\n);\nvar XHR_STATES = (\n /** @type {const} */\n {\n complete: 4\n }\n);\nvar AUTH_TOKEN_PREFIX = \"base64url.bearer.phx.\";\n\n// js/phoenix/push.js\nvar Push = class {\n /**\n * Initializes the Push\n * @param {Channel} channel - The Channel\n * @param {ChannelEvent} event - The event, for example `\"phx_join\"`\n * @param {() => Record<string, unknown>} payload - The payload, for example `{user_id: 123}`\n * @param {number} timeout - The push timeout in milliseconds\n */\n constructor(channel, event, payload, timeout) {\n this.channel = channel;\n this.event = event;\n this.payload = payload || function() {\n return {};\n };\n this.receivedResp = null;\n this.timeout = timeout;\n this.timeoutTimer = null;\n this.recHooks = [];\n this.sent = false;\n this.ref = void 0;\n }\n /**\n *\n * @param {number} timeout\n */\n resend(timeout) {\n this.timeout = timeout;\n this.reset();\n this.send();\n }\n /**\n *\n */\n send() {\n if (this.hasReceived(\"timeout\")) {\n return;\n }\n this.startTimeout();\n this.sent = true;\n this.channel.socket.push({\n topic: this.channel.topic,\n event: this.event,\n payload: this.payload(),\n ref: this.ref,\n join_ref: this.channel.joinRef()\n });\n }\n /**\n *\n * @param {string} status\n * @param {(response: any) => void} callback\n */\n receive(status, callback) {\n if (this.hasReceived(status)) {\n callback(this.receivedResp.response);\n }\n this.recHooks.push({ status, callback });\n return this;\n }\n reset() {\n this.cancelRefEvent();\n this.ref = null;\n this.refEvent = null;\n this.receivedResp = null;\n this.sent = false;\n }\n destroy() {\n this.cancelRefEvent();\n this.cancelTimeout();\n }\n /**\n * @private\n */\n matchReceive({ status, response, _ref }) {\n this.recHooks.filter((h) => h.status === status).forEach((h) => h.callback(response));\n }\n /**\n * @private\n */\n cancelRefEvent() {\n if (!this.refEvent) {\n return;\n }\n this.channel.off(this.refEvent);\n }\n cancelTimeout() {\n clearTimeout(this.timeoutTimer);\n this.timeoutTimer = null;\n }\n startTimeout() {\n if (this.timeoutTimer) {\n this.cancelTimeout();\n }\n this.ref = this.channel.socket.makeRef();\n this.refEvent = this.channel.replyEventName(this.ref);\n this.channel.on(this.refEvent, (payload) => {\n this.cancelRefEvent();\n this.cancelTimeout();\n this.receivedResp = payload;\n this.matchReceive(payload);\n });\n this.timeoutTimer = setTimeout(() => {\n this.trigger(\"timeout\", {});\n }, this.timeout);\n }\n /**\n * @private\n */\n hasReceived(status) {\n return this.receivedResp && this.receivedResp.status === status;\n }\n trigger(status, response) {\n this.channel.trigger(this.refEvent, { status, response });\n }\n};\n\n// js/phoenix/timer.js\nvar Timer = class {\n /**\n * @param {() => void} callback\n * @param {(tries: number) => number} timerCalc\n */\n constructor(callback, timerCalc) {\n this.callback = callback;\n this.timerCalc = timerCalc;\n this.timer = void 0;\n this.tries = 0;\n }\n reset() {\n this.tries = 0;\n clearTimeout(this.timer);\n }\n /**\n * Cancels any previous scheduleTimeout and schedules callback\n */\n scheduleTimeout() {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => {\n this.tries = this.tries + 1;\n this.callback();\n }, this.timerCalc(this.tries + 1));\n }\n};\n\n// js/phoenix/channel.js\nvar Channel = class {\n /**\n * @param {string} topic\n * @param {Params | (() => Params)} params\n * @param {Socket} socket\n */\n constructor(topic, params, socket) {\n this.state = CHANNEL_STATES.closed;\n this.topic = topic;\n this.params = closure(params || {});\n this.socket = socket;\n this.bindings = [];\n this.bindingRef = 0;\n this.timeout = this.socket.timeout;\n this.joinedOnce = false;\n this.joinPush = new Push(this, CHANNEL_EVENTS.join, this.params, this.timeout);\n this.pushBuffer = [];\n this.stateChangeRefs = [];\n this.rejoinTimer = new Timer(() => {\n if (this.socket.isConnected()) {\n this.rejoin();\n }\n }, this.socket.rejoinAfterMs);\n this.stateChangeRefs.push(this.socket.onError(() => this.rejoinTimer.reset()));\n this.stateChangeRefs.push(\n this.socket.onOpen(() => {\n this.rejoinTimer.reset();\n if (this.isErrored()) {\n this.rejoin();\n }\n })\n );\n this.joinPush.receive(\"ok\", () => {\n this.state = CHANNEL_STATES.joined;\n this.rejoinTimer.reset();\n this.pushBuffer.forEach((pushEvent) => pushEvent.send());\n this.pushBuffer = [];\n });\n this.joinPush.receive(\"error\", (reason) => {\n this.state = CHANNEL_STATES.errored;\n if (this.socket.hasLogger()) this.socket.log(\"channel\", `error ${this.topic}`, reason);\n if (this.socket.isConnected()) {\n this.rejoinTimer.scheduleTimeout();\n }\n });\n this.onClose(() => {\n this.rejoinTimer.reset();\n if (this.socket.hasLogger()) this.socket.log(\"channel\", `close ${this.topic}`);\n this.state = CHANNEL_STATES.closed;\n this.socket.remove(this);\n });\n this.onError((reason) => {\n if (this.socket.hasLogger()) this.socket.log(\"channel\", `error ${this.topic}`, reason);\n if (this.isJoining()) {\n this.joinPush.reset();\n }\n this.state = CHANNEL_STATES.errored;\n if (this.socket.isConnected()) {\n this.rejoinTimer.scheduleTimeout();\n }\n });\n this.joinPush.receive(\"timeout\", () => {\n if (this.socket.hasLogger()) this.socket.log(\"channel\", `timeout ${this.topic}`, this.joinPush.timeout);\n let leavePush = new Push(this, CHANNEL_EVENTS.leave, closure({}), this.timeout);\n leavePush.send();\n this.state = CHANNEL_STATES.errored;\n this.joinPush.reset();\n if (this.socket.isConnected()) {\n this.rejoinTimer.scheduleTimeout();\n }\n });\n this.on(CHANNEL_EVENTS.reply, (payload, ref) => {\n this.trigger(this.replyEventName(ref), payload);\n });\n }\n /**\n * Join the channel\n * @param {number} timeout\n * @returns {Push}\n */\n join(timeout = this.timeout) {\n if (this.joinedOnce) {\n throw new Error(\"tried to join multiple times. 'join' can only be called a single time per channel instance\");\n } else {\n this.timeout = timeout;\n this.joinedOnce = true;\n this.rejoin();\n return this.joinPush;\n }\n }\n /**\n * Teardown the channel.\n *\n * Destroys and stops related timers.\n */\n teardown() {\n this.pushBuffer.forEach((push) => push.destroy());\n this.pushBuffer = [];\n this.rejoinTimer.reset();\n this.joinPush.destroy();\n this.state = CHANNEL_STATES.closed;\n this.bindings = [];\n }\n /**\n * Hook into channel close\n * @param {ChannelBindingCallback} callback\n */\n onClose(callback) {\n this.on(CHANNEL_EVENTS.close, callback);\n }\n /**\n * Hook into channel errors\n * @param {ChannelOnErrorCallback} callback\n * @return {number}\n */\n onError(callback) {\n return this.on(CHANNEL_EVENTS.error, (reason) => callback(reason));\n }\n /**\n * Subscribes on channel events\n *\n * Subscription returns a ref counter, which can be used later to\n * unsubscribe the exact event listener\n *\n * @example\n * const ref1 = channel.on(\"event\", do_stuff)\n * const ref2 = channel.on(\"event\", do_other_stuff)\n * channel.off(\"event\", ref1)\n * // Since unsubscription, do_stuff won't fire,\n * // while do_other_stuff will keep firing on the \"event\"\n *\n * @param {string} event\n * @param {ChannelBindingCallback} callback\n * @returns {number} ref\n */\n on(event, callback) {\n let ref = this.bindingRef++;\n this.bindings.push({ event, ref, callback });\n return ref;\n }\n /**\n * Unsubscribes off of channel events\n *\n * Use the ref returned from a channel.on() to unsubscribe one\n * handler, or pass nothing for the ref to unsubscribe all\n * handlers for the given event.\n *\n * @example\n * // Unsubscribe the do_stuff handler\n * const ref1 = channel.on(\"event\", do_stuff)\n * channel.off(\"event\", ref1)\n *\n * // Unsubscribe all handlers from event\n * channel.off(\"event\")\n *\n * @param {string} event\n * @param {number} [ref]\n */\n off(event, ref) {\n this.bindings = this.bindings.filter((bind) => {\n return !(bind.event === event && (typeof ref === \"undefined\" || ref === bind.ref));\n });\n }\n /**\n * @private\n */\n canPush() {\n return this.socket.isConnected() && this.isJoined();\n }\n /**\n * Sends a message `event` to phoenix with the payload `payload`.\n * Phoenix receives this in the `handle_in(event, payload, socket)`\n * function. if phoenix replies or it times out (default 10000ms),\n * then optionally the reply can be received.\n *\n * @example\n * channel.push(\"event\")\n * .receive(\"ok\", payload => console.log(\"phoenix replied:\", payload))\n * .receive(\"error\", err => console.log(\"phoenix errored\", err))\n * .receive(\"timeout\", () => console.log(\"timed out pushing\"))\n * @param {string} event\n * @param {Object} payload\n * @param {number} [timeout]\n * @returns {Push}\n */\n push(event, payload, timeout = this.timeout) {\n payload = payload || {};\n if (!this.joinedOnce) {\n throw new Error(`tried to push '${event}' to '${this.topic}' before joining. Use channel.join() before pushing events`);\n }\n let pushEvent = new Push(this, event, function() {\n return payload;\n }, timeout);\n if (this.canPush()) {\n pushEvent.send();\n } else {\n pushEvent.startTimeout();\n this.pushBuffer.push(pushEvent);\n }\n return pushEvent;\n }\n /** Leaves the channel\n *\n * Unsubscribes from server events, and\n * instructs channel to terminate on server\n *\n * Triggers onClose() hooks\n *\n * To receive leave acknowledgements, use the `receive`\n * hook to bind to the server ack, ie:\n *\n * @example\n * channel.leave().receive(\"ok\", () => alert(\"left!\") )\n *\n * @param {number} timeout\n * @returns {Push}\n */\n leave(timeout = this.timeout) {\n this.rejoinTimer.reset();\n this.joinPush.cancelTimeout();\n this.state = CHANNEL_STATES.leaving;\n let onClose = () => {\n if (this.socket.hasLogger()) this.socket.log(\"channel\", `leave ${this.topic}`);\n this.trigger(CHANNEL_EVENTS.close, \"leave\");\n };\n let leavePush = new Push(this, CHANNEL_EVENTS.leave, closure({}), timeout);\n leavePush.receive(\"ok\", () => onClose()).receive(\"timeout\", () => onClose());\n leavePush.send();\n if (!this.canPush()) {\n leavePush.trigger(\"ok\", {});\n }\n return leavePush;\n }\n /**\n * Overridable message hook\n *\n * Receives all events for specialized message handling\n * before dispatching to the channel callbacks.\n *\n * Must return the payload, modified or unmodified\n * @type{ChannelOnMessage}\n */\n onMessage(_event, payload, _ref) {\n return payload;\n }\n /**\n * Overridable filter hook\n *\n * If this function returns `true`, `binding`'s callback will be called.\n *\n * @type{ChannelFilterBindings}\n */\n filterBindings(_binding, _payload, _ref) {\n return true;\n }\n isMember(topic, event, payload, joinRef) {\n if (this.topic !== topic) {\n return false;\n }\n if (joinRef && joinRef !== this.joinRef()) {\n if (this.socket.hasLogger()) this.socket.log(\"channel\", \"dropping outdated message\", { topic, event, payload, joinRef });\n return false;\n } else {\n return true;\n }\n }\n joinRef() {\n return this.joinPush.ref;\n }\n /**\n * @private\n */\n rejoin(timeout = this.timeout) {\n if (this.isLeaving()) {\n return;\n }\n this.socket.leaveOpenTopic(this.topic);\n this.state = CHANNEL_STATES.joining;\n this.joinPush.resend(timeout);\n }\n /**\n * @param {string} event\n * @param {unknown} [payload]\n * @param {?string} [ref]\n * @param {?string} [joinRef]\n */\n trigger(event, payload, ref, joinRef) {\n let handledPayload = this.onMessage(event, payload, ref, joinRef);\n if (payload && !handledPayload) {\n throw new Error(\"channel onMessage callbacks must return the payload, modified or unmodified\");\n }\n let eventBindings = this.bindings.filter((bind) => bind.event === event && this.filterBindings(bind, payload, ref));\n for (let i = 0; i < eventBindings.length; i++) {\n let bind = eventBindings[i];\n bind.callback(handledPayload, ref, joinRef || this.joinRef());\n }\n }\n /**\n * @param {string} ref\n */\n replyEventName(ref) {\n return `chan_reply_${ref}`;\n }\n isClosed() {\n return this.state === CHANNEL_STATES.closed;\n }\n isErrored() {\n return this.state === CHANNEL_STATES.errored;\n }\n isJoined() {\n return this.state === CHANNEL_STATES.joined;\n }\n isJoining() {\n return this.state === CHANNEL_STATES.joining;\n }\n isLeaving() {\n return this.state === CHANNEL_STATES.leaving;\n }\n};\n\n// js/phoenix/ajax.js\nvar Ajax = class {\n static request(method, endPoint, headers, body, timeout, ontimeout, callback) {\n if (global.XDomainRequest) {\n let req = new global.XDomainRequest();\n return this.xdomainRequest(req, method, endPoint, body, timeout, ontimeout, callback);\n } else if (global.XMLHttpRequest) {\n let req = new global.XMLHttpRequest();\n return this.xhrRequest(req, method, endPoint, headers, body, timeout, ontimeout, callback);\n } else if (global.fetch && global.AbortController) {\n return this.fetchRequest(method, endPoint, headers, body, timeout, ontimeout, callback);\n } else {\n throw new Error(\"No suitable XMLHttpRequest implementation found\");\n }\n }\n static fetchRequest(method, endPoint, headers, body, timeout, ontimeout, callback) {\n let options = {\n method,\n headers,\n body\n };\n let controller = null;\n if (timeout) {\n controller = new AbortController();\n const _timeoutId = setTimeout(() => controller.abort(), timeout);\n options.signal = controller.signal;\n }\n global.fetch(endPoint, options).then((response) => response.text()).then((data) => this.parseJSON(data)).then((data) => callback && callback(data)).catch((err) => {\n if (err.name === \"AbortError\" && ontimeout) {\n ontimeout();\n } else {\n callback && callback(null);\n }\n });\n return controller;\n }\n static xdomainRequest(req, method, endPoint, body, timeout, ontimeout, callback) {\n req.timeout = timeout;\n req.open(method, endPoint);\n req.onload = () => {\n let response = this.parseJSON(req.responseText);\n callback && callback(response);\n };\n if (ontimeout) {\n req.ontimeout = ontimeout;\n }\n req.onprogress = () => {\n };\n req.send(body);\n return req;\n }\n static xhrRequest(req, method, endPoint, headers, body, timeout, ontimeout, callback) {\n req.open(method, endPoint, true);\n req.timeout = timeout;\n for (let [key, value] of Object.entries(headers)) {\n req.setRequestHeader(key, value);\n }\n req.onerror = () => callback && callback(null);\n req.onreadystatechange = () => {\n if (req.readyState === XHR_STATES.complete && callback) {\n let response = this.parseJSON(req.responseText);\n callback(response);\n }\n };\n if (ontimeout) {\n req.ontimeout = ontimeout;\n }\n req.send(body);\n return req;\n }\n static parseJSON(resp) {\n if (!resp || resp === \"\") {\n return null;\n }\n try {\n return JSON.parse(resp);\n } catch {\n console && console.log(\"failed to parse JSON response\", resp);\n return null;\n }\n }\n static serialize(obj, parentKey) {\n let queryStr = [];\n for (var key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n continue;\n }\n let paramKey = parentKey ? `${parentKey}[${key}]` : key;\n let paramVal = obj[key];\n if (typeof paramVal === \"object\") {\n queryStr.push(this.serialize(paramVal, paramKey));\n } else {\n queryStr.push(encodeURIComponent(paramKey) + \"=\" + encodeURIComponent(paramVal));\n }\n }\n return queryStr.join(\"&\");\n }\n static appendParams(url, params) {\n if (Object.keys(params).length === 0) {\n return url;\n }\n let prefix = url.match(/\\?/) ? \"&\" : \"?\";\n return `${url}${prefix}${this.serialize(params)}`;\n }\n};\n\n// js/phoenix/longpoll.js\nvar arrayBufferToBase64 = (buffer) => {\n let binary = \"\";\n let bytes = new Uint8Array(buffer);\n let len = bytes.byteLength;\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n};\nvar LongPoll = class {\n constructor(endPoint, protocols) {\n if (protocols && protocols.length === 2 && protocols[1].startsWith(AUTH_TOKEN_PREFIX)) {\n this.authToken = atob(protocols[1].slice(AUTH_TOKEN_PREFIX.length));\n }\n this.endPoint = null;\n this.token = null;\n this.skipHeartbeat = true;\n this.reqs = /* @__PURE__ */ new Set();\n this.awaitingBatchAck = false;\n this.currentBatch = null;\n this.currentBatchTimer = null;\n this.batchBuffer = [];\n this.onopen = function() {\n };\n this.onerror = function() {\n };\n this.onmessage = function() {\n };\n this.onclose = function() {\n };\n this.pollEndpoint = this.normalizeEndpoint(endPoint);\n this.readyState = SOCKET_STATES.connecting;\n setTimeout(() => this.poll(), 0);\n }\n normalizeEndpoint(endPoint) {\n return endPoint.replace(\"ws://\", \"http://\").replace(\"wss://\", \"https://\").replace(new RegExp(\"(.*)/\" + TRANSPORTS.websocket), \"$1/\" + TRANSPORTS.longpoll);\n }\n endpointURL() {\n return Ajax.appendParams(this.pollEndpoint, { token: this.token });\n }\n closeAndRetry(code, reason, wasClean) {\n this.close(code, reason, wasClean);\n this.readyState = SOCKET_STATES.connecting;\n }\n ontimeout() {\n this.onerror(\"timeout\");\n this.closeAndRetry(1005, \"timeout\", false);\n }\n isActive() {\n return this.readyState === SOCKET_STATES.open || this.readyState === SOCKET_STATES.connecting;\n }\n poll() {\n const headers = { \"Accept\": \"application/json\" };\n if (this.authToken) {\n headers[\"X-Phoenix-AuthToken\"] = this.authToken;\n }\n this.ajax(\"GET\", headers, null, () => this.ontimeout(), (resp) => {\n if (resp) {\n var { status, token, messages } = resp;\n if (status === 410 && this.token !== null) {\n this.onerror(410);\n this.closeAndRetry(3410, \"session_gone\", false);\n return;\n }\n this.token = token;\n } else {\n status = 0;\n }\n switch (status) {\n case 200:\n messages.forEach((msg) => {\n setTimeout(() => this.onmessage({ data: msg }), 0);\n });\n this.poll();\n break;\n case 204:\n this.poll();\n break;\n case 410:\n this.readyState = SOCKET_STATES.open;\n this.onopen({});\n this.poll();\n break;\n case 403:\n this.onerror(403);\n this.close(1008, \"forbidden\", false);\n break;\n case 0:\n case 500:\n this.onerror(500);\n this.closeAndRetry(1011, \"internal server error\", 500);\n break;\n default:\n throw new Error(`unhandled poll status ${status}`);\n }\n });\n }\n // we collect all pushes within the current event loop by\n // setTimeout 0, which optimizes back-to-back procedural\n // pushes against an empty buffer\n send(body) {\n if (typeof body !== \"string\") {\n body = arrayBufferToBase64(body);\n }\n if (this.currentBatch) {\n this.currentBatch.push(body);\n } else if (this.awaitingBatchAck) {\n this.batchBuffer.push(body);\n } else {\n this.currentBatch = [body];\n this.currentBatchTimer = setTimeout(() => {\n this.batchSend(this.currentBatch);\n this.currentBatch = null;\n }, 0);\n }\n }\n batchSend(messages) {\n this.awaitingBatchAck = true;\n this.ajax(\"POST\", { \"Content-Type\": \"application/x-ndjson\" }, messages.join(\"\\n\"), () => this.onerror(\"timeout\"), (resp) => {\n this.awaitingBatchAck = false;\n if (!resp || resp.status !== 200) {\n this.onerror(resp && resp.status);\n this.closeAndRetry(1011, \"internal server error\", false);\n } else if (this.batchBuffer.length > 0) {\n this.batchSend(this.batchBuffer);\n this.batchBuffer = [];\n }\n });\n }\n close(code, reason, wasClean) {\n for (let req of this.reqs) {\n req.abort();\n }\n this.readyState = SOCKET_STATES.closed;\n let opts = Object.assign({ code: 1e3, reason: void 0, wasClean: true }, { code, reason, wasClean });\n this.batchBuffer = [];\n clearTimeout(this.currentBatchTimer);\n this.currentBatchTimer = null;\n if (typeof CloseEvent !== \"undefined\") {\n this.onclose(new CloseEvent(\"close\", opts));\n } else {\n this.onclose(opts);\n }\n }\n ajax(method, headers, body, onCallerTimeout, callback) {\n let req;\n let ontimeout = () => {\n this.reqs.delete(req);\n onCallerTimeout();\n };\n req = Ajax.request(method, this.endpointURL(), headers, body, this.timeout, ontimeout, (resp) => {\n this.reqs.delete(req);\n if (this.isActive()) {\n callback(resp);\n }\n });\n this.reqs.add(req);\n }\n};\n\n// js/phoenix/presence.js\nvar Presence = class _Presence {\n /**\n * Initializes the Presence\n * @param {Channel} channel - The Channel\n * @param {PresenceOptions} [opts] - The options, for example `{events: {state: \"state\", diff: \"diff\"}}`\n */\n constructor(channel, opts = {}) {\n let events = opts.events || /** @type {PresenceEvents} */\n { state: \"presence_state\", diff: \"presence_diff\" };\n this.state = {};\n this.pendingDiffs = [];\n this.channel = channel;\n this.joinRef = null;\n this.caller = {\n onJoin: function() {\n },\n onLeave: function() {\n },\n onSync: function() {\n }\n };\n this.channel.on(events.state, (newState) => {\n let { onJoin, onLeave, onSync } = this.caller;\n this.joinRef = this.channel.joinRef();\n this.state = _Presence.syncState(this.state, newState, onJoin, onLeave);\n this.pendingDiffs.forEach((diff) => {\n this.state = _Presence.syncDiff(this.state, diff, onJoin, onLeave);\n });\n this.pendingDiffs = [];\n onSync();\n });\n this.channel.on(events.diff, (diff) => {\n let { onJoin, onLeave, onSync } = this.caller;\n if (this.inPendingSyncState()) {\n this.pendingDiffs.push(diff);\n } else {\n this.state = _Presence.syncDiff(this.state, diff, onJoin, onLeave);\n onSync();\n }\n });\n }\n /**\n * @param {PresenceOnJoin} callback\n */\n onJoin(callback) {\n this.caller.onJoin = callback;\n }\n /**\n * @param {PresenceOnLeave} callback\n */\n onLeave(callback) {\n this.caller.onLeave = callback;\n }\n /**\n * @param {PresenceOnSync} callback\n */\n onSync(callback) {\n this.caller.onSync = callback;\n }\n /**\n * Returns the array of presences, with selected metadata.\n *\n * @template [T=PresenceState]\n * @param {((key: string, obj: PresenceState) => T)} [by]\n *\n * @returns {T[]}\n */\n list(by) {\n return _Presence.list(this.state, by);\n }\n inPendingSyncState() {\n return !this.joinRef || this.joinRef !== this.channel.joinRef();\n }\n // lower-level public static API\n /**\n * Used to sync the list of presences on the server\n * with the client's state. An optional `onJoin` and `onLeave` callback can\n * be provided to react to changes in the client's local presences across\n * disconnects and reconnects with the server.\n *\n * @param {Record<string, PresenceState>} currentState\n * @param {Record<string, PresenceState>} newState\n * @param {PresenceOnJoin} onJoin\n * @param {PresenceOnLeave} onLeave\n *\n * @returns {Record<string, PresenceState>}\n */\n static syncState(currentState, newState, onJoin, onLeave) {\n let state = this.clone(currentState);\n let joins = {};\n let leaves = {};\n this.map(state, (key, presence) => {\n if (!newState[key]) {\n leaves[key] = presence;\n }\n });\n this.map(newState, (key, newPresence) => {\n let currentPresence = state[key];\n if (currentPresence) {\n let newRefs = newPresence.metas.map((m) => m.phx_ref);\n let curRefs = currentPresence.metas.map((m) => m.phx_ref);\n let joinedMetas = newPresence.metas.filter((m) => curRefs.indexOf(m.phx_ref) < 0);\n let leftMetas = currentPresence.metas.filter((m) => newRefs.indexOf(m.phx_ref) < 0);\n if (joinedMetas.length > 0) {\n joins[key] = newPresence;\n joins[key].metas = joinedMetas;\n }\n if (leftMetas.length > 0) {\n leaves[key] = this.clone(currentPresence);\n leaves[key].metas = leftMetas;\n }\n } else {\n joins[key] = newPresence;\n }\n });\n return this.syncDiff(state, { joins, leaves }, onJoin, onLeave);\n }\n /**\n *\n * Used to sync a diff of presence join and leave\n * events from the server, as they happen. Like `syncState`, `syncDiff`\n * accepts optional `onJoin` and `onLeave` callbacks to react to a user\n * joining or leaving from a device.\n *\n * @param {Record<string, PresenceState>} state\n * @param {PresenceDiff} diff\n * @param {PresenceOnJoin} onJoin\n * @param {PresenceOnLeave} onLeave\n *\n * @returns {Record<string, PresenceState>}\n */\n static syncDiff(state, diff, onJoin, onLeave) {\n let { joins, leaves } = this.clone(diff);\n if (!onJoin) {\n onJoin = function() {\n };\n }\n if (!onLeave) {\n onLeave = function() {\n };\n }\n this.map(joins, (key, newPresence) => {\n let currentPresence = state[key];\n state[key] = this.clone(newPresence);\n if (currentPresence) {\n let joinedRefs = state[key].metas.map((m) => m.phx_ref);\n let curMetas = currentPresence.metas.filter((m) => joinedRefs.indexOf(m.phx_ref) < 0);\n state[key].metas.unshift(...curMetas);\n }\n onJoin(key, currentPresence, newPresence);\n });\n this.map(leaves, (key, leftPresence) => {\n let currentPresence = state[key];\n if (!currentPresence) {\n return;\n }\n let refsToRemove = leftPresence.metas.map((m) => m.phx_ref);\n currentPresence.metas = currentPresence.metas.filter((p) => {\n return refsToRemove.indexOf(p.phx_ref) < 0;\n });\n onLeave(key, currentPresence, leftPresence);\n if (currentPresence.metas.length === 0) {\n delete state[key];\n }\n });\n return state;\n }\n /**\n * Returns the array of presences, with selected metadata.\n *\n * @template [T=PresenceState]\n * @param {Record<string, PresenceState>} presences\n * @param {((key: string, obj: PresenceState) => T)} [chooser]\n *\n * @returns {T[]}\n */\n static list(presences, chooser) {\n if (!chooser) {\n chooser = function(key, pres) {\n return pres;\n };\n }\n return this.map(presences, (key, presence) => {\n return chooser(key, presence);\n });\n }\n // private\n /**\n * @template T\n * @param {Record<string, PresenceState>} obj\n * @param {(key: string, obj: PresenceState) => T} func\n */\n static map(obj, func) {\n return Object.getOwnPropertyNames(obj).map((key) => func(key, obj[key]));\n }\n /**\n * @template T\n * @param {T} obj\n * @returns {T}\n */\n static clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n};\n\n// js/phoenix/serializer.js\nvar serializer_default = {\n HEADER_LENGTH: 1,\n META_LENGTH: 4,\n KINDS: { push: 0, reply: 1, broadcast: 2 },\n /**\n * @template T\n * @param {Message<Record<string, any>>} msg\n * @param {(msg: ArrayBuffer | string) => T} callback\n * @returns {T}\n */\n encode(msg, callback) {\n if (msg.payload.constructor === ArrayBuffer) {\n return callback(this.binaryEncode(msg));\n } else {\n let payload = [msg.join_ref, msg.ref, msg.topic, msg.event, msg.payload];\n return callback(JSON.stringify(payload));\n }\n },\n /**\n * @template T\n * @param {ArrayBuffer | string} rawPayload\n * @param {(msg: Message<unknown>) => T} callback\n * @returns {T}\n */\n decode(rawPayload, callback) {\n if (rawPayload.constructor === ArrayBuffer) {\n return callback(this.binaryDecode(rawPayload));\n } else {\n let [join_ref, ref, topic, event, payload] = JSON.parse(rawPayload);\n return callback({ join_ref, ref, topic, event, payload });\n }\n },\n /** @private */\n binaryEncode(message) {\n let { join_ref, ref, event, topic, payload } = message;\n let metaLength = this.META_LENGTH + join_ref.length + ref.length + topic.length + event.length;\n let header = new ArrayBuffer(this.HEADER_LENGTH + metaLength);\n let view = new DataView(header);\n let offset = 0;\n view.setUint8(offset++, this.KINDS.push);\n view.setUint8(offset++, join_ref.length);\n view.setUint8(offset++, ref.length);\n view.setUint8(offset++, topic.length);\n view.setUint8(offset++, event.length);\n Array.from(join_ref, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(ref, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(topic, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n Array.from(event, (char) => view.setUint8(offset++, char.charCodeAt(0)));\n var combined = new Uint8Array(header.byteLength + payload.byteLength);\n combined.set(new Uint8Array(header), 0);\n combined.set(new Uint8Array(payload), header.byteLength);\n return combined.buffer;\n },\n /**\n * @private\n */\n binaryDecode(buffer) {\n let view = new DataView(buffer);\n let kind = view.getUint8(0);\n let decoder = new TextDecoder();\n switch (kind) {\n case this.KINDS.push:\n return this.decodePush(buffer, view, decoder);\n case this.KINDS.reply:\n return this.decodeReply(buffer, view, decoder);\n case this.KINDS.broadcast:\n return this.decodeBroadcast(buffer, view, decoder);\n }\n },\n /** @private */\n decodePush(buffer, view, decoder) {\n let joinRefSize = view.getUint8(1);\n let topicSize = view.getUint8(2);\n let eventSize = view.getUint8(3);\n let offset = this.HEADER_LENGTH + this.META_LENGTH - 1;\n let joinRef = decoder.decode(buffer.slice(offset, offset + joinRefSize));\n offset = offset + joinRefSize;\n let topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n let event = decoder.decode(buffer.slice(offset, offset + eventSize));\n offset = offset + eventSize;\n let data = buffer.slice(offset, buffer.byteLength);\n return { join_ref: joinRef, ref: null, topic, event, payload: data };\n },\n /** @private */\n decodeReply(buffer, view, decoder) {\n let joinRefSize = view.getUint8(1);\n let refSize = view.getUint8(2);\n let topicSize = view.getUint8(3);\n let eventSize = view.getUint8(4);\n let offset = this.HEADER_LENGTH + this.META_LENGTH;\n let joinRef = decoder.decode(buffer.slice(offset, offset + joinRefSize));\n offset = offset + joinRefSize;\n let ref = decoder.decode(buffer.slice(offset, offset + refSize));\n offset = offset + refSize;\n let topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n let event = decoder.decode(buffer.slice(offset, offset + eventSize));\n offset = offset + eventSize;\n let data = buffer.slice(offset, buffer.byteLength);\n let payload = { status: event, response: data };\n return { join_ref: joinRef, ref, topic, event: CHANNEL_EVENTS.reply, payload };\n },\n /** @private */\n decodeBroadcast(buffer, view, decoder) {\n let topicSize = view.getUint8(1);\n let eventSize = view.getUint8(2);\n let offset = this.HEADER_LENGTH + 2;\n let topic = decoder.decode(buffer.slice(offset, offset + topicSize));\n offset = offset + topicSize;\n let event = decoder.decode(buffer.slice(offset, offset + eventSize));\n offset = offset + eventSize;\n let data = buffer.slice(offset, buffer.byteLength);\n return { join_ref: null, ref: null, topic, event, payload: data };\n }\n};\n\n// js/phoenix/socket.js\nvar Socket = class {\n /** Initializes the Socket *\n *\n * For IE8 support use an ES5-shim (https://github.com/es-shims/es5-shim)\n *\n * @constructor\n * @param {string} endPoint - The string WebSocket endpoint, ie, `\"ws://example.com/socket\"`,\n * `\"wss://example.com\"`\n * `\"/socket\"` (inherited host & protocol)\n * @param {SocketOptions} [opts] - Optional configuration\n */\n constructor(endPoint, opts = {}) {\n this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] };\n this.channels = [];\n this.sendBuffer = [];\n this.ref = 0;\n this.fallbackRef = null;\n this.timeout = opts.timeout || DEFAULT_TIMEOUT;\n this.transport = opts.transport || global.WebSocket || LongPoll;\n this.conn = void 0;\n this.primaryPassedHealthCheck = false;\n this.longPollFallbackMs = opts.longPollFallbackMs;\n this.fallbackTimer = null;\n let envSessionStorage = null;\n try {\n envSessionStorage = global && global.sessionStorage;\n } catch {\n }\n this.sessionStore = opts.sessionStorage || envSessionStorage;\n this.establishedConnections = 0;\n this.defaultEncoder = serializer_default.encode.bind(serializer_default);\n this.defaultDecoder = serializer_default.decode.bind(serializer_default);\n this.closeWasClean = true;\n this.disconnecting = false;\n this.binaryType = opts.binaryType || \"arraybuffer\";\n this.connectClock = 1;\n this.pageHidden = false;\n this.encode = void 0;\n this.decode = void 0;\n if (this.transport !== LongPoll) {\n this.encode = opts.encode || this.defaultEncoder;\n this.decode = opts.decode || this.defaultDecoder;\n } else {\n this.encode = this.defaultEncoder;\n this.decode = this.defaultDecoder;\n }\n let awaitingConnectionOnPageShow = null;\n if (phxWindow && phxWindow.addEventListener) {\n phxWindow.addEventListener(\"pagehide\", (_e) => {\n if (this.conn) {\n this.disconnect();\n awaitingConnectionOnPageShow = this.connectClock;\n }\n });\n phxWindow.addEventListener(\"pageshow\", (_e) => {\n if (awaitingConnectionOnPageShow === this.connectClock) {\n awaitingConnectionOnPageShow = null;\n this.connect();\n }\n });\n phxWindow.addEventListener(\"visibilitychange\", () => {\n if (document.visibilityState === \"hidden\") {\n this.pageHidden = true;\n } else {\n this.pageHidden = false;\n if (!this.isConnected() && !this.closeWasClean) {\n this.teardown(() => this.connect());\n }\n }\n });\n }\n this.heartbeatIntervalMs = opts.heartbeatIntervalMs || 3e4;\n this.autoSendHeartbeat = opts.autoSendHeartbeat ?? true;\n this.heartbeatCallback = opts.heartbeatCallback ?? (() => {\n });\n this.rejoinAfterMs = (tries) => {\n if (opts.rejoinAfterMs) {\n return opts.rejoinAfterMs(tries);\n } else {\n return [1e3, 2e3, 5e3][tries - 1] || 1e4;\n }\n };\n this.reconnectAfterMs = (tries) => {\n if (opts.reconnectAfterMs) {\n return opts.reconnectAfterMs(tries);\n } else {\n return [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][tries - 1] || 5e3;\n }\n };\n this.logger = opts.logger || null;\n if (!this.logger && opts.debug) {\n this.logger = (kind, msg, data) => {\n console.log(`${kind}: ${msg}`, data);\n };\n }\n this.longpollerTimeout = opts.longpollerTimeout || 2e4;\n this.params = closure(opts.params || {});\n this.endPoint = `${endPoint}/${TRANSPORTS.websocket}`;\n this.vsn = opts.vsn || DEFAULT_VSN;\n this.heartbeatTimeoutTimer = null;\n this.heartbeatTimer = null;\n this.heartbeatSentAt = null;\n this.pendingHeartbeatRef = null;\n this.reconnectTimer = new Timer(() => {\n if (this.pageHidden) {\n this.log(\"Not reconnecting as page is hidden!\");\n this.teardown();\n return;\n }\n this.teardown(async () => {\n if (opts.beforeReconnect) await opts.beforeReconnect();\n this.connect();\n });\n }, this.reconnectAfterMs);\n this.authToken = opts.authToken;\n }\n /**\n * Returns the LongPoll transport reference\n */\n getLongPollTransport() {\n return LongPoll;\n }\n /**\n * Disconnects and replaces the active transport\n *\n * @param {SocketTransport} newTransport - The new transport class to instantiate\n *\n */\n replaceTransport(newTransport) {\n this.connectClock++;\n this.closeWasClean = true;\n clearTimeout(this.fallbackTimer);\n this.reconnectTimer.reset();\n if (this.conn) {\n this.conn.close();\n this.conn = null;\n }\n this.transport = newTransport;\n }\n /**\n * Returns the socket protocol\n *\n * @returns {\"wss\" | \"ws\"}\n */\n protocol() {\n return location.protocol.match(/^https/) ? \"wss\" : \"ws\";\n }\n /**\n * The fully qualified socket url\n *\n * @returns {string}\n */\n endPointURL() {\n let uri = Ajax.appendParams(\n Ajax.appendParams(this.endPoint, this.params()),\n { vsn: this.vsn }\n );\n if (uri.charAt(0) !== \"/\") {\n return uri;\n }\n if (uri.charAt(1) === \"/\") {\n return `${this.protocol()}:${uri}`;\n }\n return `${this.protocol()}://${location.host}${uri}`;\n }\n /**\n * Disconnects the socket\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes for valid status codes.\n *\n * @param {() => void} [callback] - Optional callback which is called after socket is disconnected.\n * @param {number} [code] - A status code for disconnection (Optional).\n * @param {string} [reason] - A textual description of the reason to disconnect. (Optional)\n */\n disconnect(callback, code, reason) {\n this.connectClock++;\n this.disconnecting = true;\n this.closeWasClean = true;\n clearTimeout(this.fallbackTimer);\n this.reconnectTimer.reset();\n this.teardown(() => {\n this.disconnecting = false;\n callback && callback();\n }, code, reason);\n }\n /**\n * @param {Params} [params] - [DEPRECATED] The params to send when connecting, for example `{user_id: userToken}`\n *\n * Passing params to connect is deprecated; pass them in the Socket constructor instead:\n * `new Socket(\"/socket\", {params: {user_id: userToken}})`.\n */\n connect(params) {\n if (params) {\n console && console.log(\"passing params to connect is deprecated. Instead pass :params to the Socket constructor\");\n this.params = closure(params);\n }\n if (this.conn && !this.disconnecting) {\n return;\n }\n if (this.longPollFallbackMs && this.transport !== LongPoll) {\n this.connectWithFallback(LongPoll, this.longPollFallbackMs);\n } else {\n this.transportConnect();\n }\n }\n /**\n * Logs the message. Override `this.logger` for specialized logging. noops by default\n * @param {string} kind\n * @param {string} msg\n * @param {Object} data\n */\n log(kind, msg, data) {\n this.logger && this.logger(kind, msg, data);\n }\n /**\n * Returns true if a logger has been set on this socket.\n */\n hasLogger() {\n return this.logger !== null;\n }\n /**\n * Registers callbacks for connection open events\n *\n * @example socket.onOpen(function(){ console.info(\"the socket was opened\") })\n *\n * @param {SocketOnOpen} callback\n */\n onOpen(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.open.push([ref, callback]);\n return ref;\n }\n /**\n * Registers callbacks for connection close events\n * @param {SocketOnClose} callback\n * @returns {string}\n */\n onClose(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.close.push([ref, callback]);\n return ref;\n }\n /**\n * Registers callbacks for connection error events\n *\n * @example socket.onError(function(error){ alert(\"An error occurred\") })\n *\n * @param {SocketOnError} callback\n * @returns {string}\n */\n onError(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.error.push([ref, callback]);\n return ref;\n }\n /**\n * Registers callbacks for connection message events\n * @param {SocketOnMessage} callback\n * @returns {string}\n */\n onMessage(callback) {\n let ref = this.makeRef();\n this.stateChangeCallbacks.message.push([ref, callback]);\n return ref;\n }\n /**\n * Sets a callback that receives lifecycle events for internal heartbeat messages.\n * Useful for instrumenting connection health (e.g. sent/ok/timeout/disconnected).\n * @param {HeartbeatCallback} callback\n */\n onHeartbeat(callback) {\n this.heartbeatCallback = callback;\n }\n /**\n * Pings the server and invokes the callback with the RTT in milliseconds\n * @param {(timeDelta: number) => void} callback\n *\n * Returns true if the ping was pushed or false if unable to be pushed.\n */\n ping(callback) {\n if (!this.isConnected()) {\n return false;\n }\n let ref = this.makeRef();\n let startTime = Date.now();\n this.push({ topic: \"phoenix\", event: \"heartbeat\", payload: {}, ref });\n let onMsgRef = this.onMessage((msg) => {\n if (msg.ref === ref) {\n this.off([onMsgRef]);\n callback(Date.now() - startTime);\n }\n });\n return true;\n }\n /**\n * @private\n *\n * @param {Function}\n */\n transportName(transport) {\n switch (transport) {\n case LongPoll:\n return \"LongPoll\";\n default:\n return transport.name;\n }\n }\n /**\n * @private\n */\n transportConnect() {\n this.connectClock++;\n this.closeWasClean = false;\n let protocols = void 0;\n if (this.authToken) {\n protocols = [\"phoenix\", `${AUTH_TOKEN_PREFIX}${btoa(this.authToken).replace(/=/g, \"\")}`];\n }\n this.conn = new this.transport(this.endPointURL(), protocols);\n this.conn.binaryType = this.binaryType;\n this.conn.timeout = this.longpollerTimeout;\n this.conn.onopen = () => this.onConnOpen();\n this.conn.onerror = (error) => this.onConnError(error);\n this.conn.onmessage = (event) => this.onConnMessage(event);\n this.conn.onclose = (event) => this.onConnClose(event);\n }\n getSession(key) {\n return this.sessionStore && this.sessionStore.getItem(key);\n }\n storeSession(key, val) {\n this.sessionStore && this.sessionStore.setItem(key, val);\n }\n connectWithFallback(fallbackTransport, fallbackThreshold = 2500) {\n clearTimeout(this.fallbackTimer);\n let established = false;\n let primaryTransport = true;\n let openRef, errorRef;\n let fallbackTransportName = this.transportName(fallbackTransport);\n let fallback = (reason) => {\n this.log(\"transport\", `falling back to ${fallbackTransportName}...`, reason);\n this.off([openRef, errorRef]);\n primaryTransport = false;\n this.replaceTransport(fallbackTransport);\n this.transportConnect();\n };\n if (this.getSession(`phx:fallback:${fallbackTransportName}`)) {\n return fallback(\"memorized\");\n }\n this.fallbackTimer = setTimeout(fallback, fallbackThreshold);\n errorRef = this.onError((reason) => {\n this.log(\"transport\", \"error\", reason);\n if (primaryTransport && !established) {\n clearTimeout(this.fallbackTimer);\n fallback(reason);\n }\n });\n if (this.fallbackRef) {\n this.off([this.fallbackRef]);\n }\n this.fallbackRef = this.onOpen(() => {\n established = true;\n if (!primaryTransport) {\n let fallbackTransportName2 = this.transportName(fallbackTransport);\n if (!this.primaryPassedHealthCheck) {\n this.storeSession(`phx:fallback:${fallbackTransportName2}`, \"true\");\n }\n return this.log(\"transport\", `established ${fallbackTransportName2} fallback`);\n }\n clearTimeout(this.fallbackTimer);\n this.fallbackTimer = setTimeout(fallback, fallbackThreshold);\n this.ping((rtt) => {\n this.log(\"transport\", \"connected to primary after\", rtt);\n this.primaryPassedHealthCheck = true;\n clearTimeout(this.fallbackTimer);\n });\n });\n this.transportConnect();\n }\n clearHeartbeats() {\n clearTimeout(this.heartbeatTimer);\n clearTimeout(this.heartbeatTimeoutTimer);\n }\n onConnOpen() {\n if (this.hasLogger()) this.log(\"transport\", `connected to ${this.endPointURL()}`);\n this.closeWasClean = false;\n this.disconnecting = false;\n this.establishedConnections++;\n this.flushSendBuffer();\n this.reconnectTimer.reset();\n if (this.autoSendHeartbeat) {\n this.resetHeartbeat();\n }\n this.triggerStateCallbacks(\"open\");\n }\n /**\n * @private\n */\n heartbeatTimeout() {\n if (this.pendingHeartbeatRef) {\n this.pendingHeartbeatRef = null;\n this.heartbeatSentAt = null;\n if (this.hasLogger()) {\n this.log(\"transport\", \"heartbeat timeout. Attempting to re-establish connection\");\n }\n try {\n this.heartbeatCallback(\"timeout\");\n } catch (e) {\n this.log(\"error\", \"error in heartbeat callback\", e);\n }\n this.triggerChanError(new Error(\"heartbeat timeout\"));\n this.closeWasClean = false;\n this.teardown(() => this.reconnectTimer.scheduleTimeout(), WS_CLOSE_NORMAL, \"heartbeat timeout\");\n }\n }\n resetHeartbeat() {\n if (this.conn && this.conn.skipHeartbeat) {\n return;\n }\n this.pendingHeartbeatRef = null;\n this.clearHeartbeats();\n this.heartbeatTimer = setTimeout(() => this.sendHeartbeat(), this.heartbeatIntervalMs);\n }\n teardown(callback, code, reason) {\n if (!this.conn) {\n return callback && callback();\n }\n const connToClose = this.conn;\n this.waitForBufferDone(connToClose, () => {\n if (code) {\n connToClose.close(code, reason || \"\");\n } else {\n connToClose.close();\n }\n this.waitForSocketClosed(connToClose, () => {\n if (this.conn === connToClose) {\n this.conn.onopen = function() {\n };\n this.conn.onerror = function() {\n };\n this.conn.onmessage = function() {\n };\n this.conn.onclose = function() {\n };\n this.conn = null;\n }\n callback && callback();\n });\n });\n }\n waitForBufferDone(conn, callback, tries = 1) {\n if (tries === 5 || !conn.bufferedAmount) {\n callback();\n return;\n }\n setTimeout(() => {\n this.waitForBufferDone(conn, callback, tries + 1);\n }, 150 * tries);\n }\n waitForSocketClosed(conn, callback, tries = 1) {\n if (tries === 5 || conn.readyState === SOCKET_STATES.closed) {\n callback();\n return;\n }\n setTimeout(() => {\n this.waitForSocketClosed(conn, callback, tries + 1);\n }, 150 * tries);\n }\n /**\n * @param {CloseEvent} event\n */\n onConnClose(event) {\n if (this.conn) this.conn.onclose = () => {\n };\n if (this.hasLogger()) this.log(\"transport\", \"close\", event);\n this.triggerChanError(event);\n this.clearHeartbeats();\n if (!this.closeWasClean) {\n this.reconnectTimer.scheduleTimeout();\n }\n this.triggerStateCallbacks(\"close\", event);\n }\n /**\n * @private\n * @param {Event} error\n */\n onConnError(error) {\n if (this.hasLogger()) this.log(\"transport\", \"error\", error);\n let transportBefore = this.transport;\n let establishedBefore = this.establishedConnections;\n this.triggerStateCallbacks(\"error\", error, transportBefore, establishedBefore);\n if (transportBefore === this.transport || establishedBefore > 0) {\n this.triggerChanError(error);\n }\n }\n /**\n * @private\n * @param {unknown} [reason] underlying close/error event forwarded to channel error listeners\n */\n triggerChanError(reason) {\n this.channels.forEach((channel) => {\n if (!(channel.isErrored() || channel.isLeaving() || channel.isClosed())) {\n channel.trigger(CHANNEL_EVENTS.error, reason);\n }\n });\n }\n /**\n * @returns {string}\n */\n connectionState() {\n switch (this.conn && this.conn.readyState) {\n case SOCKET_STATES.connecting:\n return \"connecting\";\n case SOCKET_STATES.open:\n return \"open\";\n case SOCKET_STATES.closing:\n return \"closing\";\n default:\n return \"closed\";\n }\n }\n /**\n * @returns {boolean}\n */\n isConnected() {\n return this.connectionState() === \"open\";\n }\n /**\n *\n * @param {Channel} channel\n */\n remove(channel) {\n this.off(channel.stateChangeRefs);\n this.channels = this.channels.filter((c) => c !== channel);\n }\n /**\n * Removes `onOpen`, `onClose`, `onError,` and `onMessage` registrations.\n *\n * @param {string[]} refs - list of refs returned by calls to\n * `onOpen`, `onClose`, `onError,` and `onMessage`\n */\n off(refs) {\n for (let key in this.stateChangeCallbacks) {\n this.stateChangeCallbacks[key] = this.stateChangeCallbacks[key].filter(([ref]) => {\n return refs.indexOf(ref) === -1;\n });\n }\n }\n /**\n * Initiates a new channel for the given topic\n *\n * @param {string} topic\n * @param {Params | (() => Params)} [chanParams]- Parameters for the channel\n * @returns {Channel}\n */\n channel(topic, chanParams = {}) {\n let chan = new Channel(topic, chanParams, this);\n this.channels.push(chan);\n return chan;\n }\n /**\n * @param {Message<Record<string, any>>} data\n */\n push(data) {\n if (this.hasLogger()) {\n let { topic, event, payload, ref, join_ref } = data;\n this.log(\"push\", `${topic} ${event} (${join_ref}, ${ref})`, payload);\n }\n if (this.isConnected()) {\n this.encode(data, (result) => this.conn.send(result));\n } else {\n this.sendBuffer.push(() => this.encode(data, (result) => this.conn.send(result)));\n }\n }\n /**\n * Return the next message ref, accounting for overflows\n * @returns {string}\n */\n makeRef() {\n let newRef = this.ref + 1;\n if (newRef === this.ref) {\n this.ref = 0;\n } else {\n this.ref = newRef;\n }\n return this.ref.toString();\n }\n sendHeartbeat() {\n if (!this.isConnected()) {\n try {\n this.heartbeatCallback(\"disconnected\");\n } catch (e) {\n this.log(\"error\", \"error in heartbeat callback\", e);\n }\n return;\n }\n if (this.pendingHeartbeatRef) {\n this.heartbeatTimeout();\n return;\n }\n this.pendingHeartbeatRef = this.makeRef();\n this.heartbeatSentAt = Date.now();\n this.push({ topic: \"phoenix\", event: \"heartbeat\", payload: {}, ref: this.pendingHeartbeatRef });\n try {\n this.heartbeatCallback(\"sent\");\n } catch (e) {\n this.log(\"error\", \"error in heartbeat callback\", e);\n }\n this.heartbeatTimeoutTimer = setTimeout(() => this.heartbeatTimeout(), this.heartbeatIntervalMs);\n }\n flushSendBuffer() {\n if (this.isConnected() && this.sendBuffer.length > 0) {\n this.sendBuffer.forEach((callback) => callback());\n this.sendBuffer = [];\n }\n }\n /**\n * @param {MessageEvent<any>} rawMessage\n */\n onConnMessage(rawMessage) {\n this.decode(rawMessage.data, (msg) => {\n let { topic, event, payload, ref, join_ref } = msg;\n if (ref && ref === this.pendingHeartbeatRef) {\n const latency = this.heartbeatSentAt ? Date.now() - this.heartbeatSentAt : void 0;\n this.clearHeartbeats();\n try {\n this.heartbeatCallback(payload.status === \"ok\" ? \"ok\" : \"error\", latency);\n } catch (e) {\n this.log(\"error\", \"error in heartbeat callback\", e);\n }\n this.pendingHeartbeatRef = null;\n this.heartbeatSentAt = null;\n if (this.autoSendHeartbeat) {\n this.heartbeatTimer = setTimeout(() => this.sendHeartbeat(), this.heartbeatIntervalMs);\n }\n }\n if (this.hasLogger()) this.log(\"receive\", `${payload.status || \"\"} ${topic} ${event} ${ref && \"(\" + ref + \")\" || \"\"}`.trim(), payload);\n for (let i = 0; i < this.channels.length; i++) {\n const channel = this.channels[i];\n if (!channel.isMember(topic, event, payload, join_ref)) {\n continue;\n }\n channel.trigger(event, payload, ref, join_ref);\n }\n this.triggerStateCallbacks(\"message\", msg);\n });\n }\n /**\n * @private\n * @template {keyof SocketStateChangeCallbacks} K\n * @param {K} event\n * @param {...Parameters<SocketStateChangeCallbacks[K][number][1]>} args\n * @returns {void}\n */\n triggerStateCallbacks(event, ...args) {\n try {\n this.stateChangeCallbacks[event].forEach(([_, callback]) => {\n try {\n callback(...args);\n } catch (e) {\n this.log(\"error\", `error in ${event} callback`, e);\n }\n });\n } catch (e) {\n this.log(\"error\", `error triggering ${event} callbacks`, e);\n }\n }\n leaveOpenTopic(topic) {\n let dupChannel = this.channels.find((c) => c.topic === topic && (c.isJoined() || c.isJoining()));\n if (dupChannel) {\n if (this.hasLogger()) this.log(\"transport\", `leaving duplicate topic \"${topic}\"`);\n dupChannel.leave();\n }\n }\n};\nexport {\n Channel,\n LongPoll,\n Presence,\n Push,\n serializer_default as Serializer,\n Socket,\n Timer\n};\n//# sourceMappingURL=phoenix.mjs.map\n","import { Presence } from '@supabase/phoenix';\nexport default class PresenceAdapter {\n constructor(channel, opts) {\n const phoenixOptions = phoenixPresenceOptions(opts);\n this.presence = new Presence(channel.getChannel(), phoenixOptions);\n this.presence.onJoin((key, currentPresence, newPresence) => {\n const onJoinPayload = PresenceAdapter.onJoinPayload(key, currentPresence, newPresence);\n channel.getChannel().trigger('presence', onJoinPayload);\n });\n this.presence.onLeave((key, currentPresence, leftPresence) => {\n const onLeavePayload = PresenceAdapter.onLeavePayload(key, currentPresence, leftPresence);\n channel.getChannel().trigger('presence', onLeavePayload);\n });\n this.presence.onSync(() => {\n channel.getChannel().trigger('presence', { event: 'sync' });\n });\n }\n get state() {\n return PresenceAdapter.transformState(this.presence.state);\n }\n /**\n * @private\n * Remove 'metas' key\n * Change 'phx_ref' to 'presence_ref'\n * Remove 'phx_ref' and 'phx_ref_prev'\n *\n * @example Transform state\n * // returns {\n * abc123: [\n * { presence_ref: '2', user_id: 1 },\n * { presence_ref: '3', user_id: 2 }\n * ]\n * }\n * RealtimePresence.transformState({\n * abc123: {\n * metas: [\n * { phx_ref: '2', phx_ref_prev: '1' user_id: 1 },\n * { phx_ref: '3', user_id: 2 }\n * ]\n * }\n * })\n *\n */\n static transformState(state) {\n state = cloneState(state);\n return Object.getOwnPropertyNames(state).reduce((newState, key) => {\n const presences = state[key];\n newState[key] = transformState(presences);\n return newState;\n }, {});\n }\n static onJoinPayload(key, currentPresence, newPresence) {\n const currentPresences = parseCurrentPresences(currentPresence);\n const newPresences = transformState(newPresence);\n return {\n event: 'join',\n key,\n currentPresences,\n newPresences,\n };\n }\n static onLeavePayload(key, currentPresence, leftPresence) {\n const currentPresences = parseCurrentPresences(currentPresence);\n const leftPresences = transformState(leftPresence);\n return {\n event: 'leave',\n key,\n currentPresences,\n leftPresences,\n };\n }\n}\nfunction transformState(presences) {\n return presences.metas.map((presence) => {\n presence['presence_ref'] = presence['phx_ref'];\n delete presence['phx_ref'];\n delete presence['phx_ref_prev'];\n return presence;\n });\n}\nfunction cloneState(state) {\n return JSON.parse(JSON.stringify(state));\n}\nfunction phoenixPresenceOptions(opts) {\n return (opts === null || opts === void 0 ? void 0 : opts.events) && { events: opts.events };\n}\nfunction parseCurrentPresences(currentPresences) {\n return (currentPresences === null || currentPresences === void 0 ? void 0 : currentPresences.metas) ? transformState(currentPresences) : [];\n}\n//# sourceMappingURL=presenceAdapter.js.map","/*\n This file draws heavily from https://github.com/phoenixframework/phoenix/blob/d344ec0a732ab4ee204215b31de69cf4be72e3bf/assets/js/phoenix/presence.js\n License: https://github.com/phoenixframework/phoenix/blob/d344ec0a732ab4ee204215b31de69cf4be72e3bf/LICENSE.md\n*/\nimport PresenceAdapter from './phoenix/presenceAdapter';\nexport var REALTIME_PRESENCE_LISTEN_EVENTS;\n(function (REALTIME_PRESENCE_LISTEN_EVENTS) {\n REALTIME_PRESENCE_LISTEN_EVENTS[\"SYNC\"] = \"sync\";\n REALTIME_PRESENCE_LISTEN_EVENTS[\"JOIN\"] = \"join\";\n REALTIME_PRESENCE_LISTEN_EVENTS[\"LEAVE\"] = \"leave\";\n})(REALTIME_PRESENCE_LISTEN_EVENTS || (REALTIME_PRESENCE_LISTEN_EVENTS = {}));\nexport default class RealtimePresence {\n get state() {\n return this.presenceAdapter.state;\n }\n /**\n * Creates a Presence helper that keeps the local presence state in sync with the server.\n *\n * @param channel - The realtime channel to bind to.\n * @param opts - Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`.\n *\n * @category Realtime\n *\n * @example Example for a presence channel\n * ```ts\n * const presence = new RealtimePresence(channel)\n *\n * channel.on('presence', ({ event, key }) => {\n * console.log(`Presence ${event} on ${key}`)\n * })\n * ```\n */\n constructor(channel, opts) {\n this.channel = channel;\n this.presenceAdapter = new PresenceAdapter(this.channel.channelAdapter, opts);\n }\n}\n//# sourceMappingURL=RealtimePresence.js.map","/**\n * Normalize the various shapes a channel error reason can take into a real `Error`.\n *\n * Transport-level channel errors arrive as a `CloseEvent`, a transport `Event`, an `Error`,\n * a string, or `undefined` depending on which path in the underlying socket fired. Server-reply\n * errors arrive as a payload object. This helper produces a consistent `Error` for every case\n * and preserves the original via `cause` so callers can still inspect the raw event.\n */\nexport function normalizeChannelError(reason) {\n if (reason instanceof Error) {\n return reason;\n }\n if (typeof reason === 'string') {\n return new Error(reason);\n }\n if (reason && typeof reason === 'object') {\n const obj = reason;\n if (typeof obj.code === 'number') {\n const detail = typeof obj.reason === 'string' && obj.reason ? ` (${obj.reason})` : '';\n return new Error(`socket closed: ${obj.code}${detail}`, { cause: reason });\n }\n return new Error('channel error: transport failure', { cause: reason });\n }\n return new Error('channel error: connection lost');\n}\n//# sourceMappingURL=normalizeChannelError.js.map","import { CHANNEL_STATES, MAX_PUSH_BUFFER_SIZE } from '../lib/constants';\nexport default class ChannelAdapter {\n constructor(socket, topic, params) {\n const phoenixParams = phoenixChannelParams(params);\n this.channel = socket.getSocket().channel(topic, phoenixParams);\n this.socket = socket;\n }\n get state() {\n return this.channel.state;\n }\n set state(state) {\n this.channel.state = state;\n }\n get joinedOnce() {\n return this.channel.joinedOnce;\n }\n get joinPush() {\n return this.channel.joinPush;\n }\n get rejoinTimer() {\n return this.channel.rejoinTimer;\n }\n on(event, callback) {\n return this.channel.on(event, callback);\n }\n off(event, refNumber) {\n this.channel.off(event, refNumber);\n }\n subscribe(timeout) {\n return this.channel.join(timeout);\n }\n unsubscribe(timeout) {\n return this.channel.leave(timeout);\n }\n teardown() {\n this.channel.teardown();\n }\n onClose(callback) {\n this.channel.onClose(callback);\n }\n onError(callback) {\n return this.channel.onError(callback);\n }\n push(event, payload, timeout) {\n let push;\n try {\n push = this.channel.push(event, payload, timeout);\n }\n catch (error) {\n throw new Error(`tried to push '${event}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`);\n }\n if (this.channel.pushBuffer.length > MAX_PUSH_BUFFER_SIZE) {\n const removedPush = this.channel.pushBuffer.shift();\n removedPush.cancelTimeout();\n this.socket.log('channel', `discarded push due to buffer overflow: ${removedPush.event}`, removedPush.payload());\n }\n return push;\n }\n updateJoinPayload(payload) {\n const oldPayload = this.channel.joinPush.payload();\n this.channel.joinPush.payload = () => (Object.assign(Object.assign({}, oldPayload), payload));\n }\n canPush() {\n return this.socket.isConnected() && this.state === CHANNEL_STATES.joined;\n }\n isJoined() {\n return this.state === CHANNEL_STATES.joined;\n }\n isJoining() {\n return this.state === CHANNEL_STATES.joining;\n }\n isClosed() {\n return this.state === CHANNEL_STATES.closed;\n }\n isLeaving() {\n return this.state === CHANNEL_STATES.leaving;\n }\n updateFilterBindings(filterBindings) {\n this.channel.filterBindings = filterBindings;\n }\n updatePayloadTransform(callback) {\n this.channel.onMessage = callback;\n }\n /**\n * @internal\n */\n getChannel() {\n return this.channel;\n }\n}\nfunction phoenixChannelParams(options) {\n return {\n config: Object.assign({\n broadcast: { ack: false, self: false },\n presence: { key: '', enabled: false },\n private: false,\n }, options.config),\n };\n}\n//# sourceMappingURL=channelAdapter.js.map","import { CHANNEL_EVENTS, CHANNEL_STATES } from './lib/constants';\nimport RealtimePresence from './RealtimePresence';\nimport * as Transformers from './lib/transformers';\nimport { httpEndpointURL } from './lib/transformers';\nimport { normalizeChannelError } from './lib/normalizeChannelError';\nimport ChannelAdapter from './phoenix/channelAdapter';\nexport var REALTIME_POSTGRES_CHANGES_LISTEN_EVENT;\n(function (REALTIME_POSTGRES_CHANGES_LISTEN_EVENT) {\n REALTIME_POSTGRES_CHANGES_LISTEN_EVENT[\"ALL\"] = \"*\";\n REALTIME_POSTGRES_CHANGES_LISTEN_EVENT[\"INSERT\"] = \"INSERT\";\n REALTIME_POSTGRES_CHANGES_LISTEN_EVENT[\"UPDATE\"] = \"UPDATE\";\n REALTIME_POSTGRES_CHANGES_LISTEN_EVENT[\"DELETE\"] = \"DELETE\";\n})(REALTIME_POSTGRES_CHANGES_LISTEN_EVENT || (REALTIME_POSTGRES_CHANGES_LISTEN_EVENT = {}));\nexport var REALTIME_LISTEN_TYPES;\n(function (REALTIME_LISTEN_TYPES) {\n REALTIME_LISTEN_TYPES[\"BROADCAST\"] = \"broadcast\";\n REALTIME_LISTEN_TYPES[\"PRESENCE\"] = \"presence\";\n REALTIME_LISTEN_TYPES[\"POSTGRES_CHANGES\"] = \"postgres_changes\";\n REALTIME_LISTEN_TYPES[\"SYSTEM\"] = \"system\";\n})(REALTIME_LISTEN_TYPES || (REALTIME_LISTEN_TYPES = {}));\nexport var REALTIME_SUBSCRIBE_STATES;\n(function (REALTIME_SUBSCRIBE_STATES) {\n REALTIME_SUBSCRIBE_STATES[\"SUBSCRIBED\"] = \"SUBSCRIBED\";\n REALTIME_SUBSCRIBE_STATES[\"TIMED_OUT\"] = \"TIMED_OUT\";\n REALTIME_SUBSCRIBE_STATES[\"CLOSED\"] = \"CLOSED\";\n REALTIME_SUBSCRIBE_STATES[\"CHANNEL_ERROR\"] = \"CHANNEL_ERROR\";\n})(REALTIME_SUBSCRIBE_STATES || (REALTIME_SUBSCRIBE_STATES = {}));\nexport const REALTIME_CHANNEL_STATES = CHANNEL_STATES;\n/** A channel is the basic building block of Realtime\n * and narrows the scope of data flow to subscribed clients.\n * You can think of a channel as a chatroom where participants are able to see who's online\n * and send and receive messages.\n */\nexport default class RealtimeChannel {\n get state() {\n return this.channelAdapter.state;\n }\n set state(state) {\n this.channelAdapter.state = state;\n }\n get joinedOnce() {\n return this.channelAdapter.joinedOnce;\n }\n get timeout() {\n return this.socket.timeout;\n }\n get joinPush() {\n return this.channelAdapter.joinPush;\n }\n get rejoinTimer() {\n return this.channelAdapter.rejoinTimer;\n }\n /**\n * Creates a channel that can broadcast messages, sync presence, and listen to Postgres changes.\n *\n * The topic determines which realtime stream you are subscribing to. Config options let you\n * enable acknowledgement for broadcasts, presence tracking, or private channels.\n *\n * @category Realtime\n *\n * @example Using supabase-js (recommended)\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n * const channel = supabase.channel('room1')\n * channel\n * .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n * .subscribe()\n * ```\n *\n * @example Standalone import for bundle-sensitive environments\n * ```ts\n * import RealtimeClient from '@supabase/realtime-js'\n *\n * const client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n * params: { apikey: 'your-publishable-key' },\n * })\n * const channel = new RealtimeChannel('realtime:public:messages', { config: {} }, client)\n * ```\n */\n constructor(\n /** Topic name can be any string. */\n topic, params = { config: {} }, socket) {\n var _a, _b;\n this.topic = topic;\n this.params = params;\n this.socket = socket;\n this.bindings = {};\n this.subTopic = topic.replace(/^realtime:/i, '');\n this.params.config = Object.assign({\n broadcast: { ack: false, self: false },\n presence: { key: '', enabled: false },\n private: false,\n }, params.config);\n this.channelAdapter = new ChannelAdapter(this.socket.socketAdapter, topic, this.params);\n this.presence = new RealtimePresence(this);\n this._onClose(() => {\n this.socket._remove(this);\n });\n this._updateFilterTransform();\n this.broadcastEndpointURL = httpEndpointURL(this.socket.socketAdapter.endPointURL());\n this.private = this.params.config.private || false;\n if (!this.private && ((_b = (_a = this.params.config) === null || _a === void 0 ? void 0 : _a.broadcast) === null || _b === void 0 ? void 0 : _b.replay)) {\n throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`);\n }\n }\n /**\n * Subscribe registers your client with the server\n * @category Realtime\n */\n subscribe(callback, timeout = this.timeout) {\n var _a, _b, _c;\n if (!this.socket.isConnected()) {\n this.socket.connect();\n }\n if (this.channelAdapter.isClosed()) {\n const { config: { broadcast, presence, private: isPrivate }, } = this.params;\n const postgres_changes = (_b = (_a = this.bindings.postgres_changes) === null || _a === void 0 ? void 0 : _a.map((r) => r.filter)) !== null && _b !== void 0 ? _b : [];\n const presence_enabled = (!!this.bindings[REALTIME_LISTEN_TYPES.PRESENCE] &&\n this.bindings[REALTIME_LISTEN_TYPES.PRESENCE].length > 0) ||\n ((_c = this.params.config.presence) === null || _c === void 0 ? void 0 : _c.enabled) === true;\n const accessTokenPayload = {};\n const config = {\n broadcast,\n presence: Object.assign(Object.assign({}, presence), { enabled: presence_enabled }),\n postgres_changes,\n private: isPrivate,\n };\n if (this.socket.accessTokenValue) {\n accessTokenPayload.access_token = this.socket.accessTokenValue;\n }\n this._onError((reason) => {\n callback === null || callback === void 0 ? void 0 : callback(REALTIME_SUBSCRIBE_STATES.CHANNEL_ERROR, normalizeChannelError(reason));\n });\n this._onClose(() => callback === null || callback === void 0 ? void 0 : callback(REALTIME_SUBSCRIBE_STATES.CLOSED));\n this.updateJoinPayload(Object.assign({ config }, accessTokenPayload));\n this._updateFilterMessage();\n this.channelAdapter\n .subscribe(timeout)\n .receive('ok', async ({ postgres_changes }) => {\n // Only refresh auth if using callback-based tokens\n if (!this.socket._isManualToken()) {\n this.socket.setAuth();\n }\n if (postgres_changes === undefined) {\n callback === null || callback === void 0 ? void 0 : callback(REALTIME_SUBSCRIBE_STATES.SUBSCRIBED);\n return;\n }\n this._updatePostgresBindings(postgres_changes, callback);\n })\n .receive('error', (error) => {\n this.state = CHANNEL_STATES.errored;\n const message = Object.values(error).join(', ') || 'error';\n callback === null || callback === void 0 ? void 0 : callback(REALTIME_SUBSCRIBE_STATES.CHANNEL_ERROR, new Error(message, { cause: error }));\n })\n .receive('timeout', () => {\n callback === null || callback === void 0 ? void 0 : callback(REALTIME_SUBSCRIBE_STATES.TIMED_OUT);\n });\n }\n return this;\n }\n _updatePostgresBindings(postgres_changes, callback) {\n var _a;\n const clientPostgresBindings = this.bindings.postgres_changes;\n const bindingsLen = (_a = clientPostgresBindings === null || clientPostgresBindings === void 0 ? void 0 : clientPostgresBindings.length) !== null && _a !== void 0 ? _a : 0;\n const newPostgresBindings = [];\n for (let i = 0; i < bindingsLen; i++) {\n const clientPostgresBinding = clientPostgresBindings[i];\n const { filter: { event, schema, table, filter }, } = clientPostgresBinding;\n const serverPostgresFilter = postgres_changes && postgres_changes[i];\n if (serverPostgresFilter &&\n serverPostgresFilter.event === event &&\n RealtimeChannel.isFilterValueEqual(serverPostgresFilter.schema, schema) &&\n RealtimeChannel.isFilterValueEqual(serverPostgresFilter.table, table) &&\n RealtimeChannel.isFilterValueEqual(serverPostgresFilter.filter, filter)) {\n newPostgresBindings.push(Object.assign(Object.assign({}, clientPostgresBinding), { id: serverPostgresFilter.id }));\n }\n else {\n this.unsubscribe();\n this.state = CHANNEL_STATES.errored;\n callback === null || callback === void 0 ? void 0 : callback(REALTIME_SUBSCRIBE_STATES.CHANNEL_ERROR, new Error('mismatch between server and client bindings for postgres changes'));\n return;\n }\n }\n this.bindings.postgres_changes = newPostgresBindings;\n if (this.state != CHANNEL_STATES.errored && callback) {\n callback(REALTIME_SUBSCRIBE_STATES.SUBSCRIBED);\n }\n }\n /**\n * Returns the current presence state for this channel.\n *\n * The shape is a map keyed by presence key (for example a user id) where each entry contains the\n * tracked metadata for that user.\n *\n * @category Realtime\n */\n presenceState() {\n return this.presence.state;\n }\n /**\n * Sends the supplied payload to the presence tracker so other subscribers can see that this\n * client is online. Use `untrack` to stop broadcasting presence for the same key.\n *\n * @category Realtime\n */\n async track(payload, opts = {}) {\n return await this.send({\n type: 'presence',\n event: 'track',\n payload,\n }, opts.timeout || this.timeout);\n }\n /**\n * Removes the current presence state for this client.\n *\n * @category Realtime\n */\n async untrack(opts = {}) {\n return await this.send({\n type: 'presence',\n event: 'untrack',\n }, opts);\n }\n /**\n * Listen to realtime events on this channel.\n * @category Realtime\n *\n * @remarks\n * - By default, Broadcast and Presence are enabled for all projects.\n * - By default, listening to database changes is disabled for new projects due to database performance and security concerns. You can turn it on by managing Realtime's [replication](/docs/guides/api#realtime-api-overview).\n * - You can receive the \"previous\" data for updates and deletes by setting the table's `REPLICA IDENTITY` to `FULL` (e.g., `ALTER TABLE your_table REPLICA IDENTITY FULL;`).\n * - Row level security is not applied to delete statements. When RLS is enabled and replica identity is set to full, only the primary key is sent to clients.\n *\n * @example Listen to broadcast messages\n * ```js\n * const channel = supabase.channel(\"room1\")\n *\n * channel.on(\"broadcast\", { event: \"cursor-pos\" }, (payload) => {\n * console.log(\"Cursor position received!\", payload);\n * }).subscribe((status) => {\n * if (status === \"SUBSCRIBED\") {\n * channel.send({\n * type: \"broadcast\",\n * event: \"cursor-pos\",\n * payload: { x: Math.random(), y: Math.random() },\n * });\n * }\n * });\n * ```\n *\n * @example Listen to presence sync\n * ```js\n * const channel = supabase.channel('room1')\n * channel\n * .on('presence', { event: 'sync' }, () => {\n * console.log('Synced presence state: ', channel.presenceState())\n * })\n * .subscribe(async (status) => {\n * if (status === 'SUBSCRIBED') {\n * await channel.track({ online_at: new Date().toISOString() })\n * }\n * })\n * ```\n *\n * @example Listen to presence join\n * ```js\n * const channel = supabase.channel('room1')\n * channel\n * .on('presence', { event: 'join' }, ({ newPresences }) => {\n * console.log('Newly joined presences: ', newPresences)\n * })\n * .subscribe(async (status) => {\n * if (status === 'SUBSCRIBED') {\n * await channel.track({ online_at: new Date().toISOString() })\n * }\n * })\n * ```\n *\n * @example Listen to presence leave\n * ```js\n * const channel = supabase.channel('room1')\n * channel\n * .on('presence', { event: 'leave' }, ({ leftPresences }) => {\n * console.log('Newly left presences: ', leftPresences)\n * })\n * .subscribe(async (status) => {\n * if (status === 'SUBSCRIBED') {\n * await channel.track({ online_at: new Date().toISOString() })\n * await channel.untrack()\n * }\n * })\n * ```\n *\n * @example Listen to all database changes\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: '*', schema: '*' }, payload => {\n * console.log('Change received!', payload)\n * })\n * .subscribe()\n * ```\n *\n * @example Listen to a specific table\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: '*', schema: 'public', table: 'countries' }, payload => {\n * console.log('Change received!', payload)\n * })\n * .subscribe()\n * ```\n *\n * @example Listen to inserts\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, payload => {\n * console.log('Change received!', payload)\n * })\n * .subscribe()\n * ```\n *\n * @exampleDescription Listen to updates\n * By default, Supabase will send only the updated record. If you want to receive the previous values as well you can\n * enable full replication for the table you are listening to:\n *\n * ```sql\n * alter table \"your_table\" replica identity full;\n * ```\n *\n * @example Listen to updates\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries' }, payload => {\n * console.log('Change received!', payload)\n * })\n * .subscribe()\n * ```\n *\n * @exampleDescription Listen to deletes\n * By default, Supabase does not send deleted records. If you want to receive the deleted record you can\n * enable full replication for the table you are listening to:\n *\n * ```sql\n * alter table \"your_table\" replica identity full;\n * ```\n *\n * @example Listen to deletes\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, payload => {\n * console.log('Change received!', payload)\n * })\n * .subscribe()\n * ```\n *\n * @exampleDescription Listen to multiple events\n * You can chain listeners if you want to listen to multiple events for each table.\n *\n * @example Listen to multiple events\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, handleRecordInserted)\n * .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, handleRecordDeleted)\n * .subscribe()\n * ```\n *\n * @exampleDescription Listen to row level changes\n * You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match.\n *\n * @example Listen to row level changes\n * ```js\n * supabase\n * .channel('room1')\n * .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries', filter: 'id=eq.200' }, handleRecordUpdated)\n * .subscribe()\n * ```\n */\n on(type, filter, callback) {\n const stateCheck = this.channelAdapter.isJoined() || this.channelAdapter.isJoining();\n const typeCheck = type === REALTIME_LISTEN_TYPES.PRESENCE || type === REALTIME_LISTEN_TYPES.POSTGRES_CHANGES;\n if (stateCheck && typeCheck) {\n this.socket.log('channel', `cannot add \\`${type}\\` callbacks for ${this.topic} after \\`subscribe()\\`.`);\n throw new Error(`cannot add \\`${type}\\` callbacks for ${this.topic} after \\`subscribe()\\`.`);\n }\n return this._on(type, filter, callback);\n }\n /**\n * Sends a broadcast message explicitly via REST API.\n *\n * This method always uses the REST API endpoint regardless of WebSocket connection state.\n * Useful when you want to guarantee REST delivery or when gradually migrating from implicit REST fallback.\n *\n * @param event The name of the broadcast event\n * @param payload Payload to be sent (required)\n * @param opts Options including timeout\n * @returns Promise resolving to object with success status, and error details if failed\n *\n * @category Realtime\n */\n async httpSend(event, payload, opts = {}) {\n var _a;\n if (payload === undefined || payload === null) {\n return Promise.reject(new Error('Payload is required for httpSend()'));\n }\n const headers = {\n apikey: this.socket.apiKey ? this.socket.apiKey : '',\n 'Content-Type': 'application/json',\n };\n if (this.socket.accessTokenValue) {\n headers['Authorization'] = `Bearer ${this.socket.accessTokenValue}`;\n }\n const options = {\n method: 'POST',\n headers,\n body: JSON.stringify({\n messages: [\n {\n topic: this.subTopic,\n event,\n payload: payload,\n private: this.private,\n },\n ],\n }),\n };\n const response = await this._fetchWithTimeout(this.broadcastEndpointURL, options, (_a = opts.timeout) !== null && _a !== void 0 ? _a : this.timeout);\n if (response.status === 202) {\n return { success: true };\n }\n let errorMessage = response.statusText;\n try {\n const errorBody = await response.json();\n errorMessage = errorBody.error || errorBody.message || errorMessage;\n }\n catch (_b) { }\n return Promise.reject(new Error(errorMessage));\n }\n /**\n * Sends a message into the channel.\n *\n * @param args Arguments to send to channel\n * @param args.type The type of event to send\n * @param args.event The name of the event being sent\n * @param args.payload Payload to be sent\n * @param opts Options to be used during the send process\n *\n * @category Realtime\n *\n * @remarks\n * - When using REST you don't need to subscribe to the channel\n * - REST calls are only available from 2.37.0 onwards\n * - If you create a channel only to send a REST broadcast, remove it from\n * the client when the send completes\n *\n * @example Send a message via websocket\n * ```js\n * const channel = supabase.channel('room1')\n *\n * channel.subscribe((status) => {\n * if (status === 'SUBSCRIBED') {\n * channel.send({\n * type: 'broadcast',\n * event: 'cursor-pos',\n * payload: { x: Math.random(), y: Math.random() },\n * })\n * }\n * })\n * ```\n *\n * @exampleResponse Send a message via websocket\n * ```js\n * ok | timed out | error\n * ```\n *\n * @example Send a message via REST\n * ```js\n * const channel = supabase.channel('room1')\n *\n * try {\n * await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() })\n * } finally {\n * await supabase.removeChannel(channel)\n * }\n * ```\n */\n async send(args, opts = {}) {\n var _a, _b;\n if (!this.channelAdapter.canPush() && args.type === 'broadcast') {\n console.warn('Realtime send() is automatically falling back to REST API. ' +\n 'This behavior will be deprecated in the future. ' +\n 'Please use httpSend() explicitly for REST delivery.');\n const { event, payload: endpoint_payload } = args;\n const headers = {\n apikey: this.socket.apiKey ? this.socket.apiKey : '',\n 'Content-Type': 'application/json',\n };\n if (this.socket.accessTokenValue) {\n headers['Authorization'] = `Bearer ${this.socket.accessTokenValue}`;\n }\n const options = {\n method: 'POST',\n headers,\n body: JSON.stringify({\n messages: [\n {\n topic: this.subTopic,\n event,\n payload: endpoint_payload,\n private: this.private,\n },\n ],\n }),\n };\n try {\n const response = await this._fetchWithTimeout(this.broadcastEndpointURL, options, (_a = opts.timeout) !== null && _a !== void 0 ? _a : this.timeout);\n await ((_b = response.body) === null || _b === void 0 ? void 0 : _b.cancel());\n return response.ok ? 'ok' : 'error';\n }\n catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n return 'timed out';\n }\n else {\n return 'error';\n }\n }\n }\n else {\n return new Promise((resolve) => {\n var _a, _b, _c;\n const push = this.channelAdapter.push(args.type, args, opts.timeout || this.timeout);\n if (args.type === 'broadcast' && !((_c = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.broadcast) === null || _c === void 0 ? void 0 : _c.ack)) {\n resolve('ok');\n }\n push.receive('ok', () => resolve('ok'));\n push.receive('error', () => resolve('error'));\n push.receive('timeout', () => resolve('timed out'));\n });\n }\n }\n /**\n * Updates the payload that will be sent the next time the channel joins (reconnects).\n * Useful for rotating access tokens or updating config without re-creating the channel.\n *\n * @category Realtime\n */\n updateJoinPayload(payload) {\n this.channelAdapter.updateJoinPayload(payload);\n }\n /**\n * Leaves the channel.\n *\n * Unsubscribes from server events, and instructs channel to terminate on server.\n * Triggers onClose() hooks.\n *\n * To receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie:\n * channel.unsubscribe().receive(\"ok\", () => alert(\"left!\") )\n *\n * @category Realtime\n */\n async unsubscribe(timeout = this.timeout) {\n return new Promise((resolve) => {\n this.channelAdapter\n .unsubscribe(timeout)\n .receive('ok', () => resolve('ok'))\n .receive('timeout', () => resolve('timed out'))\n .receive('error', () => resolve('error'));\n });\n }\n /**\n * Destroys and stops related timers.\n *\n * @category Realtime\n */\n teardown() {\n this.channelAdapter.teardown();\n }\n /** @internal */\n async _fetchWithTimeout(url, options, timeout) {\n const controller = new AbortController();\n const id = setTimeout(() => controller.abort(), timeout);\n const response = await this.socket.fetch(url, Object.assign(Object.assign({}, options), { signal: controller.signal }));\n clearTimeout(id);\n return response;\n }\n /** @internal */\n _on(type, filter, callback) {\n const typeLower = type.toLocaleLowerCase();\n const ref = this.channelAdapter.on(type, callback);\n const binding = {\n type: typeLower,\n filter: filter,\n callback: callback,\n ref: ref,\n };\n if (this.bindings[typeLower]) {\n this.bindings[typeLower].push(binding);\n }\n else {\n this.bindings[typeLower] = [binding];\n }\n this._updateFilterMessage();\n return this;\n }\n /**\n * Registers a callback that will be executed when the channel closes.\n *\n * @internal\n */\n _onClose(callback) {\n this.channelAdapter.onClose(callback);\n }\n /**\n * Registers a callback that will be executed when the channel encounteres an error.\n *\n * @internal\n */\n _onError(callback) {\n this.channelAdapter.onError(callback);\n }\n /** @internal */\n _updateFilterMessage() {\n this.channelAdapter.updateFilterBindings((binding, payload, ref) => {\n var _a, _b, _c, _d, _e, _f, _g;\n const typeLower = binding.event.toLocaleLowerCase();\n if (this._notThisChannelEvent(typeLower, ref)) {\n return false;\n }\n const bind = (_a = this.bindings[typeLower]) === null || _a === void 0 ? void 0 : _a.find((bind) => bind.ref === binding.ref);\n if (!bind) {\n return true;\n }\n if (['broadcast', 'presence', 'postgres_changes'].includes(typeLower)) {\n if ('id' in bind) {\n const bindId = bind.id;\n const bindEvent = (_b = bind.filter) === null || _b === void 0 ? void 0 : _b.event;\n return (bindId &&\n ((_c = payload.ids) === null || _c === void 0 ? void 0 : _c.includes(bindId)) &&\n (bindEvent === '*' ||\n (bindEvent === null || bindEvent === void 0 ? void 0 : bindEvent.toLocaleLowerCase()) === ((_d = payload.data) === null || _d === void 0 ? void 0 : _d.type.toLocaleLowerCase())));\n }\n else {\n const bindEvent = (_f = (_e = bind === null || bind === void 0 ? void 0 : bind.filter) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.toLocaleLowerCase();\n return bindEvent === '*' || bindEvent === ((_g = payload === null || payload === void 0 ? void 0 : payload.event) === null || _g === void 0 ? void 0 : _g.toLocaleLowerCase());\n }\n }\n else {\n return bind.type.toLocaleLowerCase() === typeLower;\n }\n });\n }\n /** @internal */\n _notThisChannelEvent(event, ref) {\n const { close, error, leave, join } = CHANNEL_EVENTS;\n const events = [close, error, leave, join];\n return ref && events.includes(event) && ref !== this.joinPush.ref;\n }\n /** @internal */\n _updateFilterTransform() {\n this.channelAdapter.updatePayloadTransform((event, payload, ref) => {\n if (typeof payload === 'object' && 'ids' in payload) {\n const postgresChanges = payload.data;\n const { schema, table, commit_timestamp, type, errors } = postgresChanges;\n const enrichedPayload = {\n schema: schema,\n table: table,\n commit_timestamp: commit_timestamp,\n eventType: type,\n new: {},\n old: {},\n errors: errors,\n };\n return Object.assign(Object.assign({}, enrichedPayload), this._getPayloadRecords(postgresChanges));\n }\n return payload;\n });\n }\n copyBindings(other) {\n if (this.joinedOnce) {\n throw new Error('cannot copy bindings into joined channel');\n }\n for (const kind in other.bindings) {\n for (const binding of other.bindings[kind]) {\n this._on(binding.type, binding.filter, binding.callback);\n }\n }\n }\n /**\n * Compares two optional filter values for equality.\n * Treats undefined, null, and empty string as equivalent empty values.\n * @internal\n */\n static isFilterValueEqual(serverValue, clientValue) {\n const normalizedServer = serverValue !== null && serverValue !== void 0 ? serverValue : undefined;\n const normalizedClient = clientValue !== null && clientValue !== void 0 ? clientValue : undefined;\n return normalizedServer === normalizedClient;\n }\n /** @internal */\n _getPayloadRecords(payload) {\n const records = {\n new: {},\n old: {},\n };\n if (payload.type === 'INSERT' || payload.type === 'UPDATE') {\n records.new = Transformers.convertChangeData(payload.columns, payload.record);\n }\n if (payload.type === 'UPDATE' || payload.type === 'DELETE') {\n records.old = Transformers.convertChangeData(payload.columns, payload.old_record);\n }\n return records;\n }\n}\n//# sourceMappingURL=RealtimeChannel.js.map","import { Socket } from '@supabase/phoenix';\nimport { CONNECTION_STATE } from '../lib/constants';\nexport default class SocketAdapter {\n constructor(endPoint, options) {\n this.socket = new Socket(endPoint, options);\n }\n get timeout() {\n return this.socket.timeout;\n }\n get endPoint() {\n return this.socket.endPoint;\n }\n get transport() {\n return this.socket.transport;\n }\n get heartbeatIntervalMs() {\n return this.socket.heartbeatIntervalMs;\n }\n get heartbeatCallback() {\n return this.socket.heartbeatCallback;\n }\n set heartbeatCallback(callback) {\n this.socket.heartbeatCallback = callback;\n }\n get heartbeatTimer() {\n return this.socket.heartbeatTimer;\n }\n get pendingHeartbeatRef() {\n return this.socket.pendingHeartbeatRef;\n }\n get reconnectTimer() {\n return this.socket.reconnectTimer;\n }\n get vsn() {\n return this.socket.vsn;\n }\n get encode() {\n return this.socket.encode;\n }\n get decode() {\n return this.socket.decode;\n }\n get reconnectAfterMs() {\n return this.socket.reconnectAfterMs;\n }\n get sendBuffer() {\n return this.socket.sendBuffer;\n }\n get stateChangeCallbacks() {\n return this.socket.stateChangeCallbacks;\n }\n connect() {\n this.socket.connect();\n }\n disconnect(callback, code, reason, timeout = 10000) {\n return new Promise((resolve) => {\n setTimeout(() => resolve('timeout'), timeout);\n this.socket.disconnect(() => {\n callback();\n resolve('ok');\n }, code, reason);\n });\n }\n push(data) {\n this.socket.push(data);\n }\n log(kind, msg, data) {\n this.socket.log(kind, msg, data);\n }\n makeRef() {\n return this.socket.makeRef();\n }\n onOpen(callback) {\n this.socket.onOpen(callback);\n }\n onClose(callback) {\n this.socket.onClose(callback);\n }\n onError(callback) {\n this.socket.onError(callback);\n }\n onMessage(callback) {\n this.socket.onMessage(callback);\n }\n isConnected() {\n return this.socket.isConnected();\n }\n isConnecting() {\n return this.socket.connectionState() == CONNECTION_STATE.connecting;\n }\n isDisconnecting() {\n return this.socket.connectionState() == CONNECTION_STATE.closing;\n }\n connectionState() {\n // @ts-ignore - requires better typing and exposing type in phoenix\n return this.socket.connectionState();\n }\n endPointURL() {\n return this.socket.endPointURL();\n }\n sendHeartbeat() {\n this.socket.sendHeartbeat();\n }\n /**\n * @internal\n */\n getSocket() {\n return this.socket;\n }\n}\n//# sourceMappingURL=socketAdapter.js.map","import WebSocketFactory from './lib/websocket-factory';\nimport { CHANNEL_EVENTS, CONNECTION_STATE, DEFAULT_VERSION, DEFAULT_TIMEOUT, DEFAULT_VSN, VSN_1_0_0, VSN_2_0_0, } from './lib/constants';\nimport Serializer from './lib/serializer';\nimport { httpEndpointURL } from './lib/transformers';\nimport RealtimeChannel from './RealtimeChannel';\nimport SocketAdapter from './phoenix/socketAdapter';\n// Connection-related constants\nconst CONNECTION_TIMEOUTS = {\n HEARTBEAT_INTERVAL: 25000,\n RECONNECT_DELAY: 10,\n HEARTBEAT_TIMEOUT_FALLBACK: 100,\n};\nconst RECONNECT_INTERVALS = [1000, 2000, 5000, 10000];\nconst DEFAULT_RECONNECT_FALLBACK = 10000;\nfunction createMemorySessionStorage() {\n const store = new Map();\n return {\n get length() {\n return store.size;\n },\n clear() {\n store.clear();\n },\n getItem(key) {\n return store.has(key) ? store.get(key) : null;\n },\n key(index) {\n var _a;\n return (_a = Array.from(store.keys())[index]) !== null && _a !== void 0 ? _a : null;\n },\n removeItem(key) {\n store.delete(key);\n },\n setItem(key, value) {\n store.set(key, String(value));\n },\n };\n}\nfunction resolveSessionStorage() {\n try {\n if (typeof globalThis !== 'undefined' && globalThis.sessionStorage) {\n return globalThis.sessionStorage;\n }\n }\n catch (_a) {\n // Property access on `sessionStorage` itself throws in restricted-storage browsers.\n }\n return createMemorySessionStorage();\n}\nconst WORKER_SCRIPT = `\n addEventListener(\"message\", (e) => {\n if (e.data.event === \"start\") {\n setInterval(() => postMessage({ event: \"keepAlive\" }), e.data.interval);\n }\n });`;\nexport default class RealtimeClient {\n get endPoint() {\n return this.socketAdapter.endPoint;\n }\n get timeout() {\n return this.socketAdapter.timeout;\n }\n get transport() {\n return this.socketAdapter.transport;\n }\n get heartbeatCallback() {\n return this.socketAdapter.heartbeatCallback;\n }\n get heartbeatIntervalMs() {\n return this.socketAdapter.heartbeatIntervalMs;\n }\n get heartbeatTimer() {\n if (this.worker) {\n return this._workerHeartbeatTimer;\n }\n return this.socketAdapter.heartbeatTimer;\n }\n get pendingHeartbeatRef() {\n if (this.worker) {\n return this._pendingWorkerHeartbeatRef;\n }\n return this.socketAdapter.pendingHeartbeatRef;\n }\n get reconnectTimer() {\n return this.socketAdapter.reconnectTimer;\n }\n get vsn() {\n return this.socketAdapter.vsn;\n }\n get encode() {\n return this.socketAdapter.encode;\n }\n get decode() {\n return this.socketAdapter.decode;\n }\n get reconnectAfterMs() {\n return this.socketAdapter.reconnectAfterMs;\n }\n get sendBuffer() {\n return this.socketAdapter.sendBuffer;\n }\n get stateChangeCallbacks() {\n return this.socketAdapter.stateChangeCallbacks;\n }\n /**\n * Initializes the Socket.\n *\n * @param endPoint The string WebSocket endpoint, ie, \"ws://example.com/socket\", \"wss://example.com\", \"/socket\" (inherited host & protocol)\n * @param httpEndpoint The string HTTP endpoint, ie, \"https://example.com\", \"/\" (inherited host & protocol)\n * @param options.transport The Websocket Transport, for example WebSocket. This can be a custom implementation\n * @param options.timeout The default timeout in milliseconds to trigger push timeouts.\n * @param options.params The optional params to pass when connecting.\n * @param options.headers Deprecated: headers cannot be set on websocket connections and this option will be removed in the future.\n * @param options.heartbeatIntervalMs The millisec interval to send a heartbeat message.\n * @param options.heartbeatCallback The optional function to handle heartbeat status and latency.\n * @param options.logger The optional function for specialized logging, ie: logger: (kind, msg, data) => { console.log(`${kind}: ${msg}`, data) }\n * @param options.logLevel Sets the log level for Realtime\n * @param options.encode The function to encode outgoing messages. Defaults to JSON: (payload, callback) => callback(JSON.stringify(payload))\n * @param options.decode The function to decode incoming messages. Defaults to Serializer's decode.\n * @param options.reconnectAfterMs he optional function that returns the millsec reconnect interval. Defaults to stepped backoff off.\n * @param options.worker Use Web Worker to set a side flow. Defaults to false.\n * @param options.workerUrl The URL of the worker script. Defaults to https://realtime.supabase.com/worker.js that includes a heartbeat event call to keep the connection alive.\n * @param options.vsn The protocol version to use when connecting. Supported versions are \"1.0.0\" and \"2.0.0\". Defaults to \"2.0.0\".\n *\n * @category Realtime\n *\n * @example Using supabase-js (recommended)\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n * const channel = supabase.channel('room1')\n * channel\n * .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n * .subscribe()\n * ```\n *\n * @example Standalone import for bundle-sensitive environments\n * ```ts\n * import RealtimeClient from '@supabase/realtime-js'\n *\n * const client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n * params: { apikey: 'your-publishable-key' },\n * })\n * client.connect()\n * ```\n */\n constructor(endPoint, options) {\n var _a;\n this.channels = new Array();\n this.accessTokenValue = null;\n this.accessToken = null;\n this.apiKey = null;\n this.httpEndpoint = '';\n /** @deprecated headers cannot be set on websocket connections */\n this.headers = {};\n this.params = {};\n this.ref = 0;\n this.serializer = new Serializer();\n this._manuallySetToken = false;\n this._authPromise = null;\n this._workerHeartbeatTimer = undefined;\n this._pendingWorkerHeartbeatRef = null;\n this._pendingDisconnectTimer = null;\n this._disconnectOnEmptyChannelsAfterMs = 0;\n /**\n * Use either custom fetch, if provided, or default fetch to make HTTP requests\n *\n * @internal\n */\n this._resolveFetch = (customFetch) => {\n if (customFetch) {\n return (...args) => customFetch(...args);\n }\n return (...args) => fetch(...args);\n };\n // Validate required parameters\n if (!((_a = options === null || options === void 0 ? void 0 : options.params) === null || _a === void 0 ? void 0 : _a.apikey)) {\n throw new Error('API key is required to connect to Realtime');\n }\n this.apiKey = options.params.apikey;\n const socketAdapterOptions = this._initializeOptions(options);\n this.socketAdapter = new SocketAdapter(endPoint, socketAdapterOptions);\n this.httpEndpoint = httpEndpointURL(endPoint);\n this.fetch = this._resolveFetch(options === null || options === void 0 ? void 0 : options.fetch);\n }\n /**\n * Connects the socket, unless already connected.\n *\n * @category Realtime\n */\n connect() {\n // Skip if already connecting, disconnecting, or connected\n if (this.isConnecting() || this.isDisconnecting() || this.isConnected()) {\n return;\n }\n // Trigger auth if needed and not already in progress\n // This ensures auth is called for standalone RealtimeClient usage\n // while avoiding race conditions with SupabaseClient's immediate setAuth call\n if (this.accessToken && !this._authPromise) {\n this._setAuthSafely('connect');\n }\n this._setupConnectionHandlers();\n try {\n this.socketAdapter.connect();\n }\n catch (error) {\n const errorMessage = error.message;\n // Provide helpful error message based on environment\n if (errorMessage.includes('Node.js')) {\n throw new Error(`${errorMessage}\\n\\n` +\n 'To use Realtime in Node.js, you need to provide a WebSocket implementation:\\n\\n' +\n 'Option 1: Use Node.js 22+ which has native WebSocket support\\n' +\n 'Option 2: Install and provide the \"ws\" package:\\n\\n' +\n ' npm install ws\\n\\n' +\n ' import ws from \"ws\"\\n' +\n ' const client = new RealtimeClient(url, {\\n' +\n ' ...options,\\n' +\n ' transport: ws\\n' +\n ' })');\n }\n throw new Error(`WebSocket not available: ${errorMessage}`);\n }\n this._handleNodeJsRaceCondition();\n }\n /**\n * Returns the URL of the websocket.\n * @returns string The URL of the websocket.\n *\n * @category Realtime\n */\n endpointURL() {\n return this.socketAdapter.endPointURL();\n }\n /**\n * Disconnects the socket.\n *\n * @param code A numeric status code to send on disconnect.\n * @param reason A custom reason for the disconnect.\n *\n * @category Realtime\n */\n async disconnect(code, reason) {\n this._cancelPendingDisconnect();\n if (this.isDisconnecting()) {\n return 'ok';\n }\n return await this.socketAdapter.disconnect(() => {\n clearInterval(this._workerHeartbeatTimer);\n this._terminateWorker();\n }, code, reason);\n }\n /**\n * Returns all created channels\n *\n * @category Realtime\n */\n getChannels() {\n return this.channels;\n }\n /**\n * Unsubscribes, removes and tears down a single channel\n * @param channel A RealtimeChannel instance\n *\n * @category Realtime\n */\n async removeChannel(channel) {\n const status = await channel.unsubscribe();\n if (status === 'ok') {\n channel.teardown();\n }\n return status;\n }\n /**\n * Unsubscribes, removes and tears down all channels\n *\n * @category Realtime\n */\n async removeAllChannels() {\n const promises = this.channels.map(async (channel) => {\n const result = await channel.unsubscribe();\n channel.teardown();\n return result;\n });\n const result = await Promise.all(promises);\n await this.disconnect();\n return result;\n }\n /**\n * Logs the message.\n *\n * For customized logging, `this.logger` can be overridden in Client constructor.\n *\n * @category Realtime\n */\n log(kind, msg, data) {\n this.socketAdapter.log(kind, msg, data);\n }\n /**\n * Returns the current state of the socket.\n *\n * @category Realtime\n */\n connectionState() {\n return this.socketAdapter.connectionState() || CONNECTION_STATE.closed;\n }\n /**\n * Returns `true` is the connection is open.\n *\n * @category Realtime\n */\n isConnected() {\n return this.socketAdapter.isConnected();\n }\n /**\n * Returns `true` if the connection is currently connecting.\n *\n * @category Realtime\n */\n isConnecting() {\n return this.socketAdapter.isConnecting();\n }\n /**\n * Returns `true` if the connection is currently disconnecting.\n *\n * @category Realtime\n */\n isDisconnecting() {\n return this.socketAdapter.isDisconnecting();\n }\n /**\n * Creates (or reuses) a {@link RealtimeChannel} for the provided topic.\n *\n * Topics are automatically prefixed with `realtime:` to match the Realtime service.\n * If a channel with the same topic already exists it will be returned instead of creating\n * a duplicate connection.\n *\n * @category Realtime\n */\n channel(topic, params = { config: {} }) {\n const realtimeTopic = `realtime:${topic}`;\n const exists = this.getChannels().find((c) => c.topic === realtimeTopic);\n if (!exists) {\n const chan = new RealtimeChannel(`realtime:${topic}`, params, this);\n this._cancelPendingDisconnect();\n this.channels.push(chan);\n return chan;\n }\n else {\n return exists;\n }\n }\n /**\n * Push out a message if the socket is connected.\n *\n * If the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established.\n *\n * @category Realtime\n */\n push(data) {\n this.socketAdapter.push(data);\n }\n /**\n * Sets the JWT access token used for channel subscription authorization and Realtime RLS.\n *\n * If param is null it will use the `accessToken` callback function or the token set on the client.\n *\n * On callback used, it will set the value of the token internal to the client.\n *\n * When a token is explicitly provided, it will be preserved across channel operations\n * (including removeChannel and resubscribe). The `accessToken` callback will not be\n * invoked until `setAuth()` is called without arguments.\n *\n * @param token A JWT string to override the token set on the client.\n *\n * @example Setting the authorization header\n * // Use a manual token (preserved across resubscribes, ignores accessToken callback)\n * client.realtime.setAuth('my-custom-jwt')\n *\n * // Switch back to using the accessToken callback\n * client.realtime.setAuth()\n *\n * @category Realtime\n */\n async setAuth(token = null) {\n this._authPromise = this._performAuth(token);\n try {\n await this._authPromise;\n }\n finally {\n this._authPromise = null;\n }\n }\n /**\n * Returns true if the current access token was explicitly set via setAuth(token),\n * false if it was obtained via the accessToken callback.\n * @internal\n */\n _isManualToken() {\n return this._manuallySetToken;\n }\n /**\n * Sends a heartbeat message if the socket is connected.\n *\n * @category Realtime\n */\n async sendHeartbeat() {\n this.socketAdapter.sendHeartbeat();\n }\n /**\n * Sets a callback that receives lifecycle events for internal heartbeat messages.\n * Useful for instrumenting connection health (e.g. sent/ok/timeout/disconnected).\n *\n * @category Realtime\n */\n onHeartbeat(callback) {\n this.socketAdapter.heartbeatCallback = this._wrapHeartbeatCallback(callback);\n }\n /**\n * Return the next message ref, accounting for overflows\n *\n * @internal\n */\n _makeRef() {\n return this.socketAdapter.makeRef();\n }\n /**\n * Removes a channel from RealtimeClient\n *\n * @param channel An open subscription.\n *\n * @internal\n */\n _remove(channel) {\n this.channels = this.channels.filter((c) => c.topic !== channel.topic);\n if (this.channels.length === 0) {\n this.log('transport', 'no channels remaining, scheduling disconnect');\n this._schedulePendingDisconnect();\n }\n }\n /** @internal */\n _schedulePendingDisconnect() {\n this._cancelPendingDisconnect();\n if (this._disconnectOnEmptyChannelsAfterMs === 0) {\n this.log('transport', 'disconnecting immediately - no channels');\n this.disconnect();\n return;\n }\n this._pendingDisconnectTimer = setTimeout(() => {\n this._pendingDisconnectTimer = null;\n if (this.channels.length === 0) {\n this.log('transport', 'deferred disconnect fired - no channels, disconnecting');\n this.disconnect();\n }\n }, this._disconnectOnEmptyChannelsAfterMs);\n this.log('transport', `deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`);\n }\n /** @internal */\n _cancelPendingDisconnect() {\n if (this._pendingDisconnectTimer !== null) {\n this.log('transport', 'pending disconnect cancelled - channel activity detected');\n clearTimeout(this._pendingDisconnectTimer);\n this._pendingDisconnectTimer = null;\n }\n }\n /**\n * Perform the actual auth operation\n * @internal\n */\n async _performAuth(token = null) {\n let tokenToSend;\n let isManualToken = false;\n if (token) {\n tokenToSend = token;\n // Track if this is a manually-provided token\n isManualToken = true;\n }\n else if (this.accessToken) {\n // Call the accessToken callback to get fresh token\n try {\n tokenToSend = await this.accessToken();\n }\n catch (e) {\n this.log('error', 'Error fetching access token from callback', e);\n // Fall back to cached value if callback fails\n tokenToSend = this.accessTokenValue;\n }\n }\n else {\n tokenToSend = this.accessTokenValue;\n }\n // Track whether this token was manually set or fetched via callback\n if (isManualToken) {\n this._manuallySetToken = true;\n }\n else if (this.accessToken) {\n // If we used the callback, clear the manual flag\n this._manuallySetToken = false;\n }\n if (this.accessTokenValue != tokenToSend) {\n this.accessTokenValue = tokenToSend;\n this.channels.forEach((channel) => {\n const payload = {\n access_token: tokenToSend,\n version: DEFAULT_VERSION,\n };\n tokenToSend && channel.updateJoinPayload(payload);\n if (channel.joinedOnce && channel.channelAdapter.isJoined()) {\n channel.channelAdapter.push(CHANNEL_EVENTS.access_token, {\n access_token: tokenToSend,\n });\n }\n });\n }\n }\n /**\n * Wait for any in-flight auth operations to complete\n * @internal\n */\n async _waitForAuthIfNeeded() {\n if (this._authPromise) {\n await this._authPromise;\n }\n }\n /**\n * Safely call setAuth with standardized error handling\n * @internal\n */\n _setAuthSafely(context = 'general') {\n // Only refresh auth if using callback-based tokens\n if (!this._isManualToken()) {\n this.setAuth().catch((e) => {\n this.log('error', `Error setting auth in ${context}`, e);\n });\n }\n }\n /** @internal */\n _setupConnectionHandlers() {\n this.socketAdapter.onOpen(() => {\n const authPromise = this._authPromise ||\n (this.accessToken && !this.accessTokenValue ? this.setAuth() : Promise.resolve());\n authPromise.catch((e) => {\n this.log('error', 'error waiting for auth on connect', e);\n });\n if (this.worker && !this.workerRef) {\n this._startWorkerHeartbeat();\n }\n });\n this.socketAdapter.onClose(() => {\n if (this.worker && this.workerRef) {\n this._terminateWorker();\n }\n });\n this.socketAdapter.onMessage((message) => {\n if (message.ref && message.ref === this._pendingWorkerHeartbeatRef) {\n this._pendingWorkerHeartbeatRef = null;\n }\n });\n }\n /** @internal */\n _handleNodeJsRaceCondition() {\n if (this.socketAdapter.isConnected()) {\n // hack: ensure onConnOpen is called\n this.socketAdapter.getSocket().onConnOpen();\n }\n }\n /** @internal */\n _wrapHeartbeatCallback(heartbeatCallback) {\n return (status, latency) => {\n if (status == 'sent')\n this._setAuthSafely();\n if (heartbeatCallback)\n heartbeatCallback(status, latency);\n };\n }\n /** @internal */\n _startWorkerHeartbeat() {\n if (this.workerUrl) {\n this.log('worker', `starting worker for from ${this.workerUrl}`);\n }\n else {\n this.log('worker', `starting default worker`);\n }\n const objectUrl = this._workerObjectUrl(this.workerUrl);\n this.workerRef = new Worker(objectUrl);\n this.workerRef.onerror = (error) => {\n this.log('worker', 'worker error', error.message);\n this._terminateWorker();\n this.disconnect();\n };\n this.workerRef.onmessage = (event) => {\n if (event.data.event === 'keepAlive') {\n this.sendHeartbeat();\n }\n };\n this.workerRef.postMessage({\n event: 'start',\n interval: this.heartbeatIntervalMs,\n });\n }\n /**\n * Terminate the Web Worker and clear the reference\n * @internal\n */\n _terminateWorker() {\n if (this.workerRef) {\n this.log('worker', 'terminating worker');\n this.workerRef.terminate();\n this.workerRef = undefined;\n }\n }\n /** @internal */\n _workerObjectUrl(url) {\n let result_url;\n if (url) {\n result_url = url;\n }\n else {\n const blob = new Blob([WORKER_SCRIPT], { type: 'application/javascript' });\n result_url = URL.createObjectURL(blob);\n }\n return result_url;\n }\n /**\n * Initialize socket options with defaults\n * @internal\n */\n _initializeOptions(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;\n this.worker = (_a = options === null || options === void 0 ? void 0 : options.worker) !== null && _a !== void 0 ? _a : false;\n this.accessToken = (_b = options === null || options === void 0 ? void 0 : options.accessToken) !== null && _b !== void 0 ? _b : null;\n const result = {};\n result.timeout = (_c = options === null || options === void 0 ? void 0 : options.timeout) !== null && _c !== void 0 ? _c : DEFAULT_TIMEOUT;\n result.heartbeatIntervalMs =\n (_d = options === null || options === void 0 ? void 0 : options.heartbeatIntervalMs) !== null && _d !== void 0 ? _d : CONNECTION_TIMEOUTS.HEARTBEAT_INTERVAL;\n this._disconnectOnEmptyChannelsAfterMs =\n (_e = options === null || options === void 0 ? void 0 : options.disconnectOnEmptyChannelsAfterMs) !== null && _e !== void 0 ? _e : 2 * ((_f = options === null || options === void 0 ? void 0 : options.heartbeatIntervalMs) !== null && _f !== void 0 ? _f : CONNECTION_TIMEOUTS.HEARTBEAT_INTERVAL);\n // @ts-ignore - mismatch between phoenix and supabase\n result.transport = (_g = options === null || options === void 0 ? void 0 : options.transport) !== null && _g !== void 0 ? _g : WebSocketFactory.getWebSocketConstructor();\n result.params = options === null || options === void 0 ? void 0 : options.params;\n result.logger = options === null || options === void 0 ? void 0 : options.logger;\n result.heartbeatCallback = this._wrapHeartbeatCallback(options === null || options === void 0 ? void 0 : options.heartbeatCallback);\n result.sessionStorage = (_h = options === null || options === void 0 ? void 0 : options.sessionStorage) !== null && _h !== void 0 ? _h : resolveSessionStorage();\n result.reconnectAfterMs =\n (_j = options === null || options === void 0 ? void 0 : options.reconnectAfterMs) !== null && _j !== void 0 ? _j : ((tries) => {\n return RECONNECT_INTERVALS[tries - 1] || DEFAULT_RECONNECT_FALLBACK;\n });\n let defaultEncode;\n let defaultDecode;\n const vsn = (_k = options === null || options === void 0 ? void 0 : options.vsn) !== null && _k !== void 0 ? _k : DEFAULT_VSN;\n switch (vsn) {\n case VSN_1_0_0:\n defaultEncode = (payload, callback) => {\n return callback(JSON.stringify(payload));\n };\n defaultDecode = (payload, callback) => {\n return callback(JSON.parse(payload));\n };\n break;\n case VSN_2_0_0:\n defaultEncode = this.serializer.encode.bind(this.serializer);\n defaultDecode = this.serializer.decode.bind(this.serializer);\n break;\n default:\n throw new Error(`Unsupported serializer version: ${result.vsn}`);\n }\n result.vsn = vsn;\n result.encode = (_l = options === null || options === void 0 ? void 0 : options.encode) !== null && _l !== void 0 ? _l : defaultEncode;\n result.decode = (_m = options === null || options === void 0 ? void 0 : options.decode) !== null && _m !== void 0 ? _m : defaultDecode;\n result.beforeReconnect = this._reconnectAuth.bind(this);\n if ((options === null || options === void 0 ? void 0 : options.logLevel) || (options === null || options === void 0 ? void 0 : options.log_level)) {\n this.logLevel = options.logLevel || options.log_level;\n result.params = Object.assign(Object.assign({}, result.params), { log_level: this.logLevel });\n }\n // Handle worker setup\n if (this.worker) {\n if (typeof window !== 'undefined' && !window.Worker) {\n throw new Error('Web Worker is not supported');\n }\n this.workerUrl = options === null || options === void 0 ? void 0 : options.workerUrl;\n result.autoSendHeartbeat = !this.worker;\n }\n return result;\n }\n /** @internal */\n async _reconnectAuth() {\n await this._waitForAuthIfNeeded();\n if (!this.isConnected()) {\n this.connect();\n }\n }\n}\n//# sourceMappingURL=RealtimeClient.js.map","// src/errors/IcebergError.ts\nvar IcebergError = class extends Error {\n constructor(message, opts) {\n super(message);\n this.name = \"IcebergError\";\n this.status = opts.status;\n this.icebergType = opts.icebergType;\n this.icebergCode = opts.icebergCode;\n this.details = opts.details;\n this.isCommitStateUnknown = opts.icebergType === \"CommitStateUnknownException\" || [500, 502, 504].includes(opts.status) && opts.icebergType?.includes(\"CommitState\") === true;\n }\n /**\n * Returns true if the error is a 404 Not Found error.\n */\n isNotFound() {\n return this.status === 404;\n }\n /**\n * Returns true if the error is a 409 Conflict error.\n */\n isConflict() {\n return this.status === 409;\n }\n /**\n * Returns true if the error is a 419 Authentication Timeout error.\n */\n isAuthenticationTimeout() {\n return this.status === 419;\n }\n};\n\n// src/utils/url.ts\nfunction buildUrl(baseUrl, path, query) {\n const url = new URL(path, baseUrl);\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== void 0) {\n url.searchParams.set(key, value);\n }\n }\n }\n return url.toString();\n}\n\n// src/http/createFetchClient.ts\nasync function buildAuthHeaders(auth) {\n if (!auth || auth.type === \"none\") {\n return {};\n }\n if (auth.type === \"bearer\") {\n return { Authorization: `Bearer ${auth.token}` };\n }\n if (auth.type === \"header\") {\n return { [auth.name]: auth.value };\n }\n if (auth.type === \"custom\") {\n return await auth.getHeaders();\n }\n return {};\n}\nfunction createFetchClient(options) {\n const fetchFn = options.fetchImpl ?? globalThis.fetch;\n return {\n async request({\n method,\n path,\n query,\n body,\n headers\n }) {\n const url = buildUrl(options.baseUrl, path, query);\n const authHeaders = await buildAuthHeaders(options.auth);\n const res = await fetchFn(url, {\n method,\n headers: {\n ...body ? { \"Content-Type\": \"application/json\" } : {},\n ...authHeaders,\n ...headers\n },\n body: body ? JSON.stringify(body) : void 0\n });\n const text = await res.text();\n const isJson = (res.headers.get(\"content-type\") || \"\").includes(\"application/json\");\n const data = isJson && text ? JSON.parse(text) : text;\n if (!res.ok) {\n const errBody = isJson ? data : void 0;\n const errorDetail = errBody?.error;\n throw new IcebergError(\n errorDetail?.message ?? `Request failed with status ${res.status}`,\n {\n status: res.status,\n icebergType: errorDetail?.type,\n icebergCode: errorDetail?.code,\n details: errBody\n }\n );\n }\n return { status: res.status, headers: res.headers, data };\n }\n };\n}\n\n// src/catalog/namespaces.ts\nfunction namespaceToPath(namespace) {\n return namespace.join(\"\u001f\");\n}\nvar NamespaceOperations = class {\n constructor(client, prefix = \"\") {\n this.client = client;\n this.prefix = prefix;\n }\n async listNamespaces(parent) {\n const query = parent ? { parent: namespaceToPath(parent.namespace) } : void 0;\n const response = await this.client.request({\n method: \"GET\",\n path: `${this.prefix}/namespaces`,\n query\n });\n return response.data.namespaces.map((ns) => ({ namespace: ns }));\n }\n async createNamespace(id, metadata) {\n const request = {\n namespace: id.namespace,\n properties: metadata?.properties\n };\n const response = await this.client.request({\n method: \"POST\",\n path: `${this.prefix}/namespaces`,\n body: request\n });\n return response.data;\n }\n async dropNamespace(id) {\n await this.client.request({\n method: \"DELETE\",\n path: `${this.prefix}/namespaces/${namespaceToPath(id.namespace)}`\n });\n }\n async loadNamespaceMetadata(id) {\n const response = await this.client.request({\n method: \"GET\",\n path: `${this.prefix}/namespaces/${namespaceToPath(id.namespace)}`\n });\n return {\n properties: response.data.properties\n };\n }\n async namespaceExists(id) {\n try {\n await this.client.request({\n method: \"HEAD\",\n path: `${this.prefix}/namespaces/${namespaceToPath(id.namespace)}`\n });\n return true;\n } catch (error) {\n if (error instanceof IcebergError && error.status === 404) {\n return false;\n }\n throw error;\n }\n }\n async createNamespaceIfNotExists(id, metadata) {\n try {\n return await this.createNamespace(id, metadata);\n } catch (error) {\n if (error instanceof IcebergError && error.status === 409) {\n return;\n }\n throw error;\n }\n }\n};\n\n// src/catalog/tables.ts\nfunction namespaceToPath2(namespace) {\n return namespace.join(\"\u001f\");\n}\nvar TableOperations = class {\n constructor(client, prefix = \"\", accessDelegation) {\n this.client = client;\n this.prefix = prefix;\n this.accessDelegation = accessDelegation;\n }\n async listTables(namespace) {\n const response = await this.client.request({\n method: \"GET\",\n path: `${this.prefix}/namespaces/${namespaceToPath2(namespace.namespace)}/tables`\n });\n return response.data.identifiers;\n }\n async createTable(namespace, request) {\n const headers = {};\n if (this.accessDelegation) {\n headers[\"X-Iceberg-Access-Delegation\"] = this.accessDelegation;\n }\n const response = await this.client.request({\n method: \"POST\",\n path: `${this.prefix}/namespaces/${namespaceToPath2(namespace.namespace)}/tables`,\n body: request,\n headers\n });\n return response.data.metadata;\n }\n async updateTable(id, request) {\n const response = await this.client.request({\n method: \"POST\",\n path: `${this.prefix}/namespaces/${namespaceToPath2(id.namespace)}/tables/${id.name}`,\n body: request\n });\n return {\n \"metadata-location\": response.data[\"metadata-location\"],\n metadata: response.data.metadata\n };\n }\n async dropTable(id, options) {\n await this.client.request({\n method: \"DELETE\",\n path: `${this.prefix}/namespaces/${namespaceToPath2(id.namespace)}/tables/${id.name}`,\n query: { purgeRequested: String(options?.purge ?? false) }\n });\n }\n async loadTable(id) {\n const headers = {};\n if (this.accessDelegation) {\n headers[\"X-Iceberg-Access-Delegation\"] = this.accessDelegation;\n }\n const response = await this.client.request({\n method: \"GET\",\n path: `${this.prefix}/namespaces/${namespaceToPath2(id.namespace)}/tables/${id.name}`,\n headers\n });\n return response.data.metadata;\n }\n async tableExists(id) {\n const headers = {};\n if (this.accessDelegation) {\n headers[\"X-Iceberg-Access-Delegation\"] = this.accessDelegation;\n }\n try {\n await this.client.request({\n method: \"HEAD\",\n path: `${this.prefix}/namespaces/${namespaceToPath2(id.namespace)}/tables/${id.name}`,\n headers\n });\n return true;\n } catch (error) {\n if (error instanceof IcebergError && error.status === 404) {\n return false;\n }\n throw error;\n }\n }\n async createTableIfNotExists(namespace, request) {\n try {\n return await this.createTable(namespace, request);\n } catch (error) {\n if (error instanceof IcebergError && error.status === 409) {\n return await this.loadTable({ namespace: namespace.namespace, name: request.name });\n }\n throw error;\n }\n }\n};\n\n// src/catalog/IcebergRestCatalog.ts\nvar IcebergRestCatalog = class {\n /**\n * Creates a new Iceberg REST Catalog client.\n *\n * @param options - Configuration options for the catalog client\n */\n constructor(options) {\n let prefix = \"v1\";\n if (options.catalogName) {\n prefix += `/${options.catalogName}`;\n }\n const baseUrl = options.baseUrl.endsWith(\"/\") ? options.baseUrl : `${options.baseUrl}/`;\n this.client = createFetchClient({\n baseUrl,\n auth: options.auth,\n fetchImpl: options.fetch\n });\n this.accessDelegation = options.accessDelegation?.join(\",\");\n this.namespaceOps = new NamespaceOperations(this.client, prefix);\n this.tableOps = new TableOperations(this.client, prefix, this.accessDelegation);\n }\n /**\n * Lists all namespaces in the catalog.\n *\n * @param parent - Optional parent namespace to list children under\n * @returns Array of namespace identifiers\n *\n * @example\n * ```typescript\n * // List all top-level namespaces\n * const namespaces = await catalog.listNamespaces();\n *\n * // List namespaces under a parent\n * const children = await catalog.listNamespaces({ namespace: ['analytics'] });\n * ```\n */\n async listNamespaces(parent) {\n return this.namespaceOps.listNamespaces(parent);\n }\n /**\n * Creates a new namespace in the catalog.\n *\n * @param id - Namespace identifier to create\n * @param metadata - Optional metadata properties for the namespace\n * @returns Response containing the created namespace and its properties\n *\n * @example\n * ```typescript\n * const response = await catalog.createNamespace(\n * { namespace: ['analytics'] },\n * { properties: { owner: 'data-team' } }\n * );\n * console.log(response.namespace); // ['analytics']\n * console.log(response.properties); // { owner: 'data-team', ... }\n * ```\n */\n async createNamespace(id, metadata) {\n return this.namespaceOps.createNamespace(id, metadata);\n }\n /**\n * Drops a namespace from the catalog.\n *\n * The namespace must be empty (contain no tables) before it can be dropped.\n *\n * @param id - Namespace identifier to drop\n *\n * @example\n * ```typescript\n * await catalog.dropNamespace({ namespace: ['analytics'] });\n * ```\n */\n async dropNamespace(id) {\n await this.namespaceOps.dropNamespace(id);\n }\n /**\n * Loads metadata for a namespace.\n *\n * @param id - Namespace identifier to load\n * @returns Namespace metadata including properties\n *\n * @example\n * ```typescript\n * const metadata = await catalog.loadNamespaceMetadata({ namespace: ['analytics'] });\n * console.log(metadata.properties);\n * ```\n */\n async loadNamespaceMetadata(id) {\n return this.namespaceOps.loadNamespaceMetadata(id);\n }\n /**\n * Lists all tables in a namespace.\n *\n * @param namespace - Namespace identifier to list tables from\n * @returns Array of table identifiers\n *\n * @example\n * ```typescript\n * const tables = await catalog.listTables({ namespace: ['analytics'] });\n * console.log(tables); // [{ namespace: ['analytics'], name: 'events' }, ...]\n * ```\n */\n async listTables(namespace) {\n return this.tableOps.listTables(namespace);\n }\n /**\n * Creates a new table in the catalog.\n *\n * @param namespace - Namespace to create the table in\n * @param request - Table creation request including name, schema, partition spec, etc.\n * @returns Table metadata for the created table\n *\n * @example\n * ```typescript\n * const metadata = await catalog.createTable(\n * { namespace: ['analytics'] },\n * {\n * name: 'events',\n * schema: {\n * type: 'struct',\n * fields: [\n * { id: 1, name: 'id', type: 'long', required: true },\n * { id: 2, name: 'timestamp', type: 'timestamp', required: true }\n * ],\n * 'schema-id': 0\n * },\n * 'partition-spec': {\n * 'spec-id': 0,\n * fields: [\n * { source_id: 2, field_id: 1000, name: 'ts_day', transform: 'day' }\n * ]\n * }\n * }\n * );\n * ```\n */\n async createTable(namespace, request) {\n return this.tableOps.createTable(namespace, request);\n }\n /**\n * Updates an existing table's metadata.\n *\n * Can update the schema, partition spec, or properties of a table.\n *\n * @param id - Table identifier to update\n * @param request - Update request with fields to modify\n * @returns Response containing the metadata location and updated table metadata\n *\n * @example\n * ```typescript\n * const response = await catalog.updateTable(\n * { namespace: ['analytics'], name: 'events' },\n * {\n * properties: { 'read.split.target-size': '134217728' }\n * }\n * );\n * console.log(response['metadata-location']); // s3://...\n * console.log(response.metadata); // TableMetadata object\n * ```\n */\n async updateTable(id, request) {\n return this.tableOps.updateTable(id, request);\n }\n /**\n * Drops a table from the catalog.\n *\n * @param id - Table identifier to drop\n *\n * @example\n * ```typescript\n * await catalog.dropTable({ namespace: ['analytics'], name: 'events' });\n * ```\n */\n async dropTable(id, options) {\n await this.tableOps.dropTable(id, options);\n }\n /**\n * Loads metadata for a table.\n *\n * @param id - Table identifier to load\n * @returns Table metadata including schema, partition spec, location, etc.\n *\n * @example\n * ```typescript\n * const metadata = await catalog.loadTable({ namespace: ['analytics'], name: 'events' });\n * console.log(metadata.schema);\n * console.log(metadata.location);\n * ```\n */\n async loadTable(id) {\n return this.tableOps.loadTable(id);\n }\n /**\n * Checks if a namespace exists in the catalog.\n *\n * @param id - Namespace identifier to check\n * @returns True if the namespace exists, false otherwise\n *\n * @example\n * ```typescript\n * const exists = await catalog.namespaceExists({ namespace: ['analytics'] });\n * console.log(exists); // true or false\n * ```\n */\n async namespaceExists(id) {\n return this.namespaceOps.namespaceExists(id);\n }\n /**\n * Checks if a table exists in the catalog.\n *\n * @param id - Table identifier to check\n * @returns True if the table exists, false otherwise\n *\n * @example\n * ```typescript\n * const exists = await catalog.tableExists({ namespace: ['analytics'], name: 'events' });\n * console.log(exists); // true or false\n * ```\n */\n async tableExists(id) {\n return this.tableOps.tableExists(id);\n }\n /**\n * Creates a namespace if it does not exist.\n *\n * If the namespace already exists, returns void. If created, returns the response.\n *\n * @param id - Namespace identifier to create\n * @param metadata - Optional metadata properties for the namespace\n * @returns Response containing the created namespace and its properties, or void if it already exists\n *\n * @example\n * ```typescript\n * const response = await catalog.createNamespaceIfNotExists(\n * { namespace: ['analytics'] },\n * { properties: { owner: 'data-team' } }\n * );\n * if (response) {\n * console.log('Created:', response.namespace);\n * } else {\n * console.log('Already exists');\n * }\n * ```\n */\n async createNamespaceIfNotExists(id, metadata) {\n return this.namespaceOps.createNamespaceIfNotExists(id, metadata);\n }\n /**\n * Creates a table if it does not exist.\n *\n * If the table already exists, returns its metadata instead.\n *\n * @param namespace - Namespace to create the table in\n * @param request - Table creation request including name, schema, partition spec, etc.\n * @returns Table metadata for the created or existing table\n *\n * @example\n * ```typescript\n * const metadata = await catalog.createTableIfNotExists(\n * { namespace: ['analytics'] },\n * {\n * name: 'events',\n * schema: {\n * type: 'struct',\n * fields: [\n * { id: 1, name: 'id', type: 'long', required: true },\n * { id: 2, name: 'timestamp', type: 'timestamp', required: true }\n * ],\n * 'schema-id': 0\n * }\n * }\n * );\n * ```\n */\n async createTableIfNotExists(namespace, request) {\n return this.tableOps.createTableIfNotExists(namespace, request);\n }\n};\n\n// src/catalog/types.ts\nvar DECIMAL_REGEX = /^decimal\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/;\nvar FIXED_REGEX = /^fixed\\s*\\[\\s*(\\d+)\\s*\\]$/;\nfunction parseDecimalType(type) {\n const match = type.match(DECIMAL_REGEX);\n if (!match) return null;\n return {\n precision: parseInt(match[1], 10),\n scale: parseInt(match[2], 10)\n };\n}\nfunction parseFixedType(type) {\n const match = type.match(FIXED_REGEX);\n if (!match) return null;\n return {\n length: parseInt(match[1], 10)\n };\n}\nfunction isDecimalType(type) {\n return DECIMAL_REGEX.test(type);\n}\nfunction isFixedType(type) {\n return FIXED_REGEX.test(type);\n}\nfunction typesEqual(a, b) {\n const decimalA = parseDecimalType(a);\n const decimalB = parseDecimalType(b);\n if (decimalA && decimalB) {\n return decimalA.precision === decimalB.precision && decimalA.scale === decimalB.scale;\n }\n const fixedA = parseFixedType(a);\n const fixedB = parseFixedType(b);\n if (fixedA && fixedB) {\n return fixedA.length === fixedB.length;\n }\n return a === b;\n}\nfunction getCurrentSchema(metadata) {\n return metadata.schemas.find((s) => s[\"schema-id\"] === metadata[\"current-schema-id\"]);\n}\n\nexport { IcebergError, IcebergRestCatalog, getCurrentSchema, isDecimalType, isFixedType, parseDecimalType, parseFixedType, typesEqual };\n//# sourceMappingURL=index.mjs.map\n//# sourceMappingURL=index.mjs.map","import { IcebergRestCatalog } from \"iceberg-js\";\n\n//#region \\0@oxc-project+runtime@0.103.0/helpers/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\treturn typeof o$1;\n\t} : function(o$1) {\n\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t}, _typeof(o);\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/objectSpread2.js\nfunction ownKeys(e, r) {\n\tvar t = Object.keys(e);\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\tr && (o = o.filter(function(r$1) {\n\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t})), t.push.apply(t, o);\n\t}\n\treturn t;\n}\nfunction _objectSpread2(e) {\n\tfor (var r = 1; r < arguments.length; r++) {\n\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t_defineProperty(e, r$1, t[r$1]);\n\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t});\n\t}\n\treturn e;\n}\n\n//#endregion\n//#region src/lib/common/errors.ts\n/**\n* Base error class for all Storage errors\n* Supports both 'storage' and 'vectors' namespaces\n*/\nvar StorageError = class extends Error {\n\tconstructor(message, namespace = \"storage\", status, statusCode) {\n\t\tsuper(message);\n\t\tthis.__isStorageError = true;\n\t\tthis.namespace = namespace;\n\t\tthis.name = namespace === \"vectors\" ? \"StorageVectorsError\" : \"StorageError\";\n\t\tthis.status = status;\n\t\tthis.statusCode = statusCode;\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tmessage: this.message,\n\t\t\tstatus: this.status,\n\t\t\tstatusCode: this.statusCode\n\t\t};\n\t}\n};\n/**\n* Type guard to check if an error is a StorageError\n* @param error - The error to check\n* @returns True if the error is a StorageError\n*/\nfunction isStorageError(error) {\n\treturn typeof error === \"object\" && error !== null && \"__isStorageError\" in error;\n}\n/**\n* API error returned from Storage service\n* Includes HTTP status code and service-specific error code\n*/\nvar StorageApiError = class extends StorageError {\n\tconstructor(message, status, statusCode, namespace = \"storage\") {\n\t\tsuper(message, namespace, status, statusCode);\n\t\tthis.name = namespace === \"vectors\" ? \"StorageVectorsApiError\" : \"StorageApiError\";\n\t\tthis.status = status;\n\t\tthis.statusCode = statusCode;\n\t}\n\ttoJSON() {\n\t\treturn _objectSpread2({}, super.toJSON());\n\t}\n};\n/**\n* Unknown error that doesn't match expected error patterns\n* Wraps the original error for debugging\n*/\nvar StorageUnknownError = class extends StorageError {\n\tconstructor(message, originalError, namespace = \"storage\") {\n\t\tsuper(message, namespace);\n\t\tthis.name = namespace === \"vectors\" ? \"StorageVectorsUnknownError\" : \"StorageUnknownError\";\n\t\tthis.originalError = originalError;\n\t}\n};\n/**\n* @deprecated Use StorageError with namespace='vectors' instead\n* Alias for backward compatibility with existing vector storage code\n*/\nvar StorageVectorsError = class extends StorageError {\n\tconstructor(message) {\n\t\tsuper(message, \"vectors\");\n\t}\n};\n/**\n* Type guard to check if an error is a StorageVectorsError\n* @param error - The error to check\n* @returns True if the error is a StorageVectorsError\n*/\nfunction isStorageVectorsError(error) {\n\treturn isStorageError(error) && error[\"namespace\"] === \"vectors\";\n}\n/**\n* @deprecated Use StorageApiError with namespace='vectors' instead\n* Alias for backward compatibility with existing vector storage code\n*/\nvar StorageVectorsApiError = class extends StorageApiError {\n\tconstructor(message, status, statusCode) {\n\t\tsuper(message, status, statusCode, \"vectors\");\n\t}\n};\n/**\n* @deprecated Use StorageUnknownError with namespace='vectors' instead\n* Alias for backward compatibility with existing vector storage code\n*/\nvar StorageVectorsUnknownError = class extends StorageUnknownError {\n\tconstructor(message, originalError) {\n\t\tsuper(message, originalError, \"vectors\");\n\t}\n};\n/**\n* Error codes specific to S3 Vectors API\n* Maps AWS service errors to application-friendly error codes\n*/\nlet StorageVectorsErrorCode = /* @__PURE__ */ function(StorageVectorsErrorCode$1) {\n\t/** Internal server fault (HTTP 500) */\n\tStorageVectorsErrorCode$1[\"InternalError\"] = \"InternalError\";\n\t/** Resource already exists / conflict (HTTP 409) */\n\tStorageVectorsErrorCode$1[\"S3VectorConflictException\"] = \"S3VectorConflictException\";\n\t/** Resource not found (HTTP 404) */\n\tStorageVectorsErrorCode$1[\"S3VectorNotFoundException\"] = \"S3VectorNotFoundException\";\n\t/** Delete bucket while not empty (HTTP 400) */\n\tStorageVectorsErrorCode$1[\"S3VectorBucketNotEmpty\"] = \"S3VectorBucketNotEmpty\";\n\t/** Exceeds bucket quota/limit (HTTP 400) */\n\tStorageVectorsErrorCode$1[\"S3VectorMaxBucketsExceeded\"] = \"S3VectorMaxBucketsExceeded\";\n\t/** Exceeds index quota/limit (HTTP 400) */\n\tStorageVectorsErrorCode$1[\"S3VectorMaxIndexesExceeded\"] = \"S3VectorMaxIndexesExceeded\";\n\treturn StorageVectorsErrorCode$1;\n}({});\n\n//#endregion\n//#region src/lib/common/headers.ts\n/**\n* Sets a header with case-insensitive deduplication.\n* Removes any existing headers whose name matches (case-insensitive),\n* then sets the value under the lowercase key. Does not mutate the input object.\n*\n* @param headers - Existing headers object\n* @param name - Header name to set (stored as lowercase)\n* @param value - Header value\n* @returns New headers object with the header set\n*/\nfunction setHeader(headers, name, value) {\n\tconst result = _objectSpread2({}, headers);\n\tconst nameLower = name.toLowerCase();\n\tfor (const key of Object.keys(result)) if (key.toLowerCase() === nameLower) delete result[key];\n\tresult[nameLower] = value;\n\treturn result;\n}\n/**\n* Normalizes all header keys to lowercase with case-insensitive deduplication.\n* When duplicate keys exist (differing only in case), the last value wins.\n* Does not mutate the input object.\n*\n* @param headers - Headers object to normalize\n* @returns New headers object with all keys lowercased\n*/\nfunction normalizeHeaders(headers) {\n\tconst result = {};\n\tfor (const [key, value] of Object.entries(headers)) result[key.toLowerCase()] = value;\n\treturn result;\n}\n\n//#endregion\n//#region src/lib/common/helpers.ts\n/**\n* Resolves the fetch implementation to use\n* Uses custom fetch if provided, otherwise uses native fetch\n*\n* @param customFetch - Optional custom fetch implementation\n* @returns Resolved fetch function\n*/\nconst resolveFetch = (customFetch) => {\n\tif (customFetch) return (...args) => customFetch(...args);\n\treturn (...args) => fetch(...args);\n};\n/**\n* Determine if input is a plain object\n* An object is plain if it's created by either {}, new Object(), or Object.create(null)\n*\n* @param value - Value to check\n* @returns True if value is a plain object\n* @source https://github.com/sindresorhus/is-plain-obj\n*/\nconst isPlainObject = (value) => {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n};\n/**\n* Recursively converts object keys from snake_case to camelCase\n* Used for normalizing API responses\n*\n* @param item - Object to convert\n* @returns Converted object with camelCase keys\n*/\nconst recursiveToCamel = (item) => {\n\tif (Array.isArray(item)) return item.map((el) => recursiveToCamel(el));\n\telse if (typeof item === \"function\" || item !== Object(item)) return item;\n\tconst result = {};\n\tObject.entries(item).forEach(([key, value]) => {\n\t\tconst newKey = key.replace(/([-_][a-z])/gi, (c) => c.toUpperCase().replace(/[-_]/g, \"\"));\n\t\tresult[newKey] = recursiveToCamel(value);\n\t});\n\treturn result;\n};\n/**\n* Validates if a given bucket name is valid according to Supabase Storage API rules\n* Mirrors backend validation from: storage/src/storage/limits.ts:isValidBucketName()\n*\n* Rules:\n* - Length: 1-100 characters\n* - Allowed characters: alphanumeric (a-z, A-Z, 0-9), underscore (_), and safe special characters\n* - Safe special characters: ! - . * ' ( ) space & $ @ = ; : + , ?\n* - Forbidden: path separators (/, \\), path traversal (..), leading/trailing whitespace\n*\n* AWS S3 Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html\n*\n* @param bucketName - The bucket name to validate\n* @returns true if valid, false otherwise\n*/\nconst isValidBucketName = (bucketName) => {\n\tif (!bucketName || typeof bucketName !== \"string\") return false;\n\tif (bucketName.length === 0 || bucketName.length > 100) return false;\n\tif (bucketName.trim() !== bucketName) return false;\n\tif (bucketName.includes(\"/\") || bucketName.includes(\"\\\\\")) return false;\n\treturn /^[\\w!.\\*'() &$@=;:+,?-]+$/.test(bucketName);\n};\n\n//#endregion\n//#region src/lib/common/fetch.ts\n/**\n* Extracts error message from various error response formats\n* @param err - Error object from API\n* @returns Human-readable error message\n*/\nconst _getErrorMessage = (err) => {\n\tif (typeof err === \"object\" && err !== null) {\n\t\tconst e = err;\n\t\tif (typeof e.msg === \"string\") return e.msg;\n\t\tif (typeof e.message === \"string\") return e.message;\n\t\tif (typeof e.error_description === \"string\") return e.error_description;\n\t\tif (typeof e.error === \"string\") return e.error;\n\t\tif (typeof e.error === \"object\" && e.error !== null) {\n\t\t\tconst nested = e.error;\n\t\t\tif (typeof nested.message === \"string\") return nested.message;\n\t\t}\n\t}\n\treturn JSON.stringify(err);\n};\n/**\n* Handles fetch errors and converts them to Storage error types\n* @param error - The error caught from fetch\n* @param reject - Promise rejection function\n* @param options - Fetch options that may affect error handling\n* @param namespace - Error namespace ('storage' or 'vectors')\n*/\nconst handleError = async (error, reject, options, namespace) => {\n\tif (error !== null && typeof error === \"object\" && \"json\" in error && typeof error.json === \"function\") {\n\t\tconst responseError = error;\n\t\tlet status = parseInt(String(responseError.status), 10);\n\t\tif (!Number.isFinite(status)) status = 500;\n\t\tresponseError.json().then((err) => {\n\t\t\tconst statusCode = (err === null || err === void 0 ? void 0 : err.statusCode) || (err === null || err === void 0 ? void 0 : err.code) || status + \"\";\n\t\t\treject(new StorageApiError(_getErrorMessage(err), status, statusCode, namespace));\n\t\t}).catch(() => {\n\t\t\tconst statusCode = status + \"\";\n\t\t\treject(new StorageApiError(responseError.statusText || `HTTP ${status} error`, status, statusCode, namespace));\n\t\t});\n\t} else reject(new StorageUnknownError(_getErrorMessage(error), error, namespace));\n};\n/**\n* Builds request parameters for fetch calls\n* @param method - HTTP method\n* @param options - Custom fetch options\n* @param parameters - Additional fetch parameters like AbortSignal\n* @param body - Request body (will be JSON stringified if plain object)\n* @returns Complete fetch request parameters\n*/\nconst _getRequestParams = (method, options, parameters, body) => {\n\tconst params = {\n\t\tmethod,\n\t\theaders: (options === null || options === void 0 ? void 0 : options.headers) || {}\n\t};\n\tif (method === \"GET\" || method === \"HEAD\" || !body) return _objectSpread2(_objectSpread2({}, params), parameters);\n\tif (isPlainObject(body)) {\n\t\tvar _contentType;\n\t\tconst headers = (options === null || options === void 0 ? void 0 : options.headers) || {};\n\t\tlet contentType;\n\t\tfor (const [key, value] of Object.entries(headers)) if (key.toLowerCase() === \"content-type\") contentType = value;\n\t\tparams.headers = setHeader(headers, \"Content-Type\", (_contentType = contentType) !== null && _contentType !== void 0 ? _contentType : \"application/json\");\n\t\tparams.body = JSON.stringify(body);\n\t} else params.body = body;\n\tif (options === null || options === void 0 ? void 0 : options.duplex) params.duplex = options.duplex;\n\treturn _objectSpread2(_objectSpread2({}, params), parameters);\n};\n/**\n* Internal request handler that wraps fetch with error handling\n* @param fetcher - Fetch function to use\n* @param method - HTTP method\n* @param url - Request URL\n* @param options - Custom fetch options\n* @param parameters - Additional fetch parameters\n* @param body - Request body\n* @param namespace - Error namespace ('storage' or 'vectors')\n* @returns Promise with parsed response or error\n*/\nasync function _handleRequest(fetcher, method, url, options, parameters, body, namespace) {\n\treturn new Promise((resolve, reject) => {\n\t\tfetcher(url, _getRequestParams(method, options, parameters, body)).then((result) => {\n\t\t\tif (!result.ok) throw result;\n\t\t\tif (options === null || options === void 0 ? void 0 : options.noResolveJson) return result;\n\t\t\tif (namespace === \"vectors\") {\n\t\t\t\tconst contentType = result.headers.get(\"content-type\");\n\t\t\t\tif (result.headers.get(\"content-length\") === \"0\" || result.status === 204) return {};\n\t\t\t\tif (!contentType || !contentType.includes(\"application/json\")) return {};\n\t\t\t}\n\t\t\treturn result.json();\n\t\t}).then((data) => resolve(data)).catch((error) => handleError(error, reject, options, namespace));\n\t});\n}\n/**\n* Creates a fetch API with the specified namespace\n* @param namespace - Error namespace ('storage' or 'vectors')\n* @returns Object with HTTP method functions\n*/\nfunction createFetchApi(namespace = \"storage\") {\n\treturn {\n\t\tget: async (fetcher, url, options, parameters) => {\n\t\t\treturn _handleRequest(fetcher, \"GET\", url, options, parameters, void 0, namespace);\n\t\t},\n\t\tpost: async (fetcher, url, body, options, parameters) => {\n\t\t\treturn _handleRequest(fetcher, \"POST\", url, options, parameters, body, namespace);\n\t\t},\n\t\tput: async (fetcher, url, body, options, parameters) => {\n\t\t\treturn _handleRequest(fetcher, \"PUT\", url, options, parameters, body, namespace);\n\t\t},\n\t\thead: async (fetcher, url, options, parameters) => {\n\t\t\treturn _handleRequest(fetcher, \"HEAD\", url, _objectSpread2(_objectSpread2({}, options), {}, { noResolveJson: true }), parameters, void 0, namespace);\n\t\t},\n\t\tremove: async (fetcher, url, body, options, parameters) => {\n\t\t\treturn _handleRequest(fetcher, \"DELETE\", url, options, parameters, body, namespace);\n\t\t}\n\t};\n}\nconst defaultApi = createFetchApi(\"storage\");\nconst { get, post, put, head, remove } = defaultApi;\nconst vectorsApi = createFetchApi(\"vectors\");\n\n//#endregion\n//#region src/lib/common/BaseApiClient.ts\n/**\n* @ignore\n* Base API client class for all Storage API classes\n* Provides common infrastructure for error handling and configuration\n*\n* @typeParam TError - The error type (StorageError or subclass)\n*/\nvar BaseApiClient = class {\n\t/**\n\t* Creates a new BaseApiClient instance\n\t* @param url - Base URL for API requests\n\t* @param headers - Default headers for API requests\n\t* @param fetch - Optional custom fetch implementation\n\t* @param namespace - Error namespace ('storage' or 'vectors')\n\t*/\n\tconstructor(url, headers = {}, fetch$1, namespace = \"storage\") {\n\t\tthis.shouldThrowOnError = false;\n\t\tthis.url = url;\n\t\tthis.headers = normalizeHeaders(headers);\n\t\tthis.fetch = resolveFetch(fetch$1);\n\t\tthis.namespace = namespace;\n\t}\n\t/**\n\t* Enable throwing errors instead of returning them.\n\t* When enabled, errors are thrown instead of returned in { data, error } format.\n\t*\n\t* @returns this - For method chaining\n\t*/\n\tthrowOnError() {\n\t\tthis.shouldThrowOnError = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Set an HTTP header for the request.\n\t* Creates a shallow copy of headers to avoid mutating shared state.\n\t*\n\t* @param name - Header name\n\t* @param value - Header value\n\t* @returns this - For method chaining\n\t*/\n\tsetHeader(name, value) {\n\t\tthis.headers = setHeader(this.headers, name, value);\n\t\treturn this;\n\t}\n\t/**\n\t* Handles API operation with standardized error handling\n\t* Eliminates repetitive try-catch blocks across all API methods\n\t*\n\t* This wrapper:\n\t* 1. Executes the operation\n\t* 2. Returns { data, error: null } on success\n\t* 3. Returns { data: null, error } on failure (if shouldThrowOnError is false)\n\t* 4. Throws error on failure (if shouldThrowOnError is true)\n\t*\n\t* @typeParam T - The expected data type from the operation\n\t* @param operation - Async function that performs the API call\n\t* @returns Promise with { data, error } tuple\n\t*\n\t* @example Handling an operation\n\t* ```typescript\n\t* async listBuckets() {\n\t* return this.handleOperation(async () => {\n\t* return await get(this.fetch, `${this.url}/bucket`, {\n\t* headers: this.headers,\n\t* })\n\t* })\n\t* }\n\t* ```\n\t*/\n\tasync handleOperation(operation) {\n\t\tvar _this = this;\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tdata: await operation(),\n\t\t\t\terror: null\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (_this.shouldThrowOnError) throw error;\n\t\t\tif (isStorageError(error)) return {\n\t\t\t\tdata: null,\n\t\t\t\terror\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/packages/StreamDownloadBuilder.ts\nlet _Symbol$toStringTag$1;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar StreamDownloadBuilder = class {\n\tconstructor(downloadFn, shouldThrowOnError) {\n\t\tthis.downloadFn = downloadFn;\n\t\tthis.shouldThrowOnError = shouldThrowOnError;\n\t\tthis[_Symbol$toStringTag$1] = \"StreamDownloadBuilder\";\n\t\tthis.promise = null;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this.getPromise().then(onfulfilled, onrejected);\n\t}\n\tcatch(onrejected) {\n\t\treturn this.getPromise().catch(onrejected);\n\t}\n\tfinally(onfinally) {\n\t\treturn this.getPromise().finally(onfinally);\n\t}\n\tgetPromise() {\n\t\tif (!this.promise) this.promise = this.execute();\n\t\treturn this.promise;\n\t}\n\tasync execute() {\n\t\tvar _this = this;\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tdata: (await _this.downloadFn()).body,\n\t\t\t\terror: null\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (_this.shouldThrowOnError) throw error;\n\t\t\tif (isStorageError(error)) return {\n\t\t\t\tdata: null,\n\t\t\t\terror\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/packages/BlobDownloadBuilder.ts\nlet _Symbol$toStringTag;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar BlobDownloadBuilder = class {\n\tconstructor(downloadFn, shouldThrowOnError) {\n\t\tthis.downloadFn = downloadFn;\n\t\tthis.shouldThrowOnError = shouldThrowOnError;\n\t\tthis[_Symbol$toStringTag] = \"BlobDownloadBuilder\";\n\t\tthis.promise = null;\n\t}\n\tasStream() {\n\t\treturn new StreamDownloadBuilder(this.downloadFn, this.shouldThrowOnError);\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this.getPromise().then(onfulfilled, onrejected);\n\t}\n\tcatch(onrejected) {\n\t\treturn this.getPromise().catch(onrejected);\n\t}\n\tfinally(onfinally) {\n\t\treturn this.getPromise().finally(onfinally);\n\t}\n\tgetPromise() {\n\t\tif (!this.promise) this.promise = this.execute();\n\t\treturn this.promise;\n\t}\n\tasync execute() {\n\t\tvar _this = this;\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tdata: await (await _this.downloadFn()).blob(),\n\t\t\t\terror: null\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (_this.shouldThrowOnError) throw error;\n\t\t\tif (isStorageError(error)) return {\n\t\t\t\tdata: null,\n\t\t\t\terror\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/packages/StorageFileApi.ts\nconst DEFAULT_SEARCH_OPTIONS = {\n\tlimit: 100,\n\toffset: 0,\n\tsortBy: {\n\t\tcolumn: \"name\",\n\t\torder: \"asc\"\n\t}\n};\nconst DEFAULT_FILE_OPTIONS = {\n\tcacheControl: \"3600\",\n\tcontentType: \"text/plain;charset=UTF-8\",\n\tupsert: false\n};\nvar StorageFileApi = class extends BaseApiClient {\n\tconstructor(url, headers = {}, bucketId, fetch$1) {\n\t\tsuper(url, headers, fetch$1, \"storage\");\n\t\tthis.bucketId = bucketId;\n\t}\n\t/**\n\t* Uploads a file to an existing bucket or replaces an existing file at the specified path with a new one.\n\t*\n\t* @param method HTTP method.\n\t* @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.\n\t* @param fileBody The body of the file to be stored in the bucket.\n\t*/\n\tasync uploadOrUpdate(method, path, fileBody, fileOptions) {\n\t\tvar _this = this;\n\t\treturn _this.handleOperation(async () => {\n\t\t\tlet body;\n\t\t\tconst options = _objectSpread2(_objectSpread2({}, DEFAULT_FILE_OPTIONS), fileOptions);\n\t\t\tlet headers = _objectSpread2(_objectSpread2({}, _this.headers), method === \"POST\" && { \"x-upsert\": String(options.upsert) });\n\t\t\tconst metadata = options.metadata;\n\t\t\tif (typeof Blob !== \"undefined\" && fileBody instanceof Blob) {\n\t\t\t\tbody = new FormData();\n\t\t\t\tbody.append(\"cacheControl\", options.cacheControl);\n\t\t\t\tif (metadata) body.append(\"metadata\", _this.encodeMetadata(metadata));\n\t\t\t\tbody.append(\"\", fileBody);\n\t\t\t} else if (typeof FormData !== \"undefined\" && fileBody instanceof FormData) {\n\t\t\t\tbody = fileBody;\n\t\t\t\tif (!body.has(\"cacheControl\")) body.append(\"cacheControl\", options.cacheControl);\n\t\t\t\tif (metadata && !body.has(\"metadata\")) body.append(\"metadata\", _this.encodeMetadata(metadata));\n\t\t\t} else {\n\t\t\t\tbody = fileBody;\n\t\t\t\theaders[\"cache-control\"] = `max-age=${options.cacheControl}`;\n\t\t\t\theaders[\"content-type\"] = options.contentType;\n\t\t\t\tif (metadata) headers[\"x-metadata\"] = _this.toBase64(_this.encodeMetadata(metadata));\n\t\t\t\tif ((typeof ReadableStream !== \"undefined\" && body instanceof ReadableStream || body && typeof body === \"object\" && \"pipe\" in body && typeof body.pipe === \"function\") && !options.duplex) options.duplex = \"half\";\n\t\t\t}\n\t\t\tif (fileOptions === null || fileOptions === void 0 ? void 0 : fileOptions.headers) for (const [key, value] of Object.entries(fileOptions.headers)) headers = setHeader(headers, key, value);\n\t\t\tconst cleanPath = _this._removeEmptyFolders(path);\n\t\t\tconst _path = _this._getFinalPath(cleanPath);\n\t\t\tconst data = await (method == \"PUT\" ? put : post)(_this.fetch, `${_this.url}/object/${_path}`, body, _objectSpread2({ headers }, (options === null || options === void 0 ? void 0 : options.duplex) ? { duplex: options.duplex } : {}));\n\t\t\treturn {\n\t\t\t\tpath: cleanPath,\n\t\t\t\tid: data.Id,\n\t\t\t\tfullPath: data.Key\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Uploads a file to an existing bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.\n\t* @param fileBody The body of the file to be stored in the bucket.\n\t* @param fileOptions Optional file upload options including cacheControl, contentType, upsert, and metadata.\n\t* @returns Promise with response containing file path, id, and fullPath or error\n\t*\n\t* @example Upload file\n\t* ```js\n\t* const avatarFile = event.target.files[0]\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .upload('public/avatar1.png', avatarFile, {\n\t* cacheControl: '3600',\n\t* upsert: false\n\t* })\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"path\": \"public/avatar1.png\",\n\t* \"fullPath\": \"avatars/public/avatar1.png\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @example Upload file using `ArrayBuffer` from base64 file data\n\t* ```js\n\t* import { decode } from 'base64-arraybuffer'\n\t*\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .upload('public/avatar1.png', decode('base64FileData'), {\n\t* contentType: 'image/png'\n\t* })\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: only `insert` when you are uploading new files and `select`, `insert` and `update` when you are upserting files\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.\n\t*/\n\tasync upload(path, fileBody, fileOptions) {\n\t\treturn this.uploadOrUpdate(\"POST\", path, fileBody, fileOptions);\n\t}\n\t/**\n\t* Upload a file with a token generated from `createSignedUploadUrl`.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.\n\t* @param token The token generated from `createSignedUploadUrl`\n\t* @param fileBody The body of the file to be stored in the bucket.\n\t* @param fileOptions HTTP headers (cacheControl, contentType, etc.).\n\t* **Note:** The `upsert` option has no effect here. To enable upsert behavior,\n\t* pass `{ upsert: true }` when calling `createSignedUploadUrl()` instead.\n\t* @returns Promise with response containing file path and fullPath or error\n\t*\n\t* @example Upload to a signed URL\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .uploadToSignedUrl('folder/cat.jpg', 'token-from-createSignedUploadUrl', file)\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"path\": \"folder/cat.jpg\",\n\t* \"fullPath\": \"avatars/folder/cat.jpg\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync uploadToSignedUrl(path, token, fileBody, fileOptions) {\n\t\tvar _this3 = this;\n\t\tconst cleanPath = _this3._removeEmptyFolders(path);\n\t\tconst _path = _this3._getFinalPath(cleanPath);\n\t\tconst url = new URL(_this3.url + `/object/upload/sign/${_path}`);\n\t\turl.searchParams.set(\"token\", token);\n\t\treturn _this3.handleOperation(async () => {\n\t\t\tlet body;\n\t\t\tconst options = _objectSpread2(_objectSpread2({}, DEFAULT_FILE_OPTIONS), fileOptions);\n\t\t\tlet headers = _objectSpread2(_objectSpread2({}, _this3.headers), { \"x-upsert\": String(options.upsert) });\n\t\t\tconst metadata = options.metadata;\n\t\t\tif (typeof Blob !== \"undefined\" && fileBody instanceof Blob) {\n\t\t\t\tbody = new FormData();\n\t\t\t\tbody.append(\"cacheControl\", options.cacheControl);\n\t\t\t\tif (metadata) body.append(\"metadata\", _this3.encodeMetadata(metadata));\n\t\t\t\tbody.append(\"\", fileBody);\n\t\t\t} else if (typeof FormData !== \"undefined\" && fileBody instanceof FormData) {\n\t\t\t\tbody = fileBody;\n\t\t\t\tif (!body.has(\"cacheControl\")) body.append(\"cacheControl\", options.cacheControl);\n\t\t\t\tif (metadata && !body.has(\"metadata\")) body.append(\"metadata\", _this3.encodeMetadata(metadata));\n\t\t\t} else {\n\t\t\t\tbody = fileBody;\n\t\t\t\theaders[\"cache-control\"] = `max-age=${options.cacheControl}`;\n\t\t\t\theaders[\"content-type\"] = options.contentType;\n\t\t\t\tif (metadata) headers[\"x-metadata\"] = _this3.toBase64(_this3.encodeMetadata(metadata));\n\t\t\t\tif ((typeof ReadableStream !== \"undefined\" && body instanceof ReadableStream || body && typeof body === \"object\" && \"pipe\" in body && typeof body.pipe === \"function\") && !options.duplex) options.duplex = \"half\";\n\t\t\t}\n\t\t\tif (fileOptions === null || fileOptions === void 0 ? void 0 : fileOptions.headers) for (const [key, value] of Object.entries(fileOptions.headers)) headers = setHeader(headers, key, value);\n\t\t\treturn {\n\t\t\t\tpath: cleanPath,\n\t\t\t\tfullPath: (await put(_this3.fetch, url.toString(), body, _objectSpread2({ headers }, (options === null || options === void 0 ? void 0 : options.duplex) ? { duplex: options.duplex } : {}))).Key\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Creates a signed upload URL.\n\t* Signed upload URLs can be used to upload files to the bucket without further authentication.\n\t* They are valid for 2 hours.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The file path, including the current file name. For example `folder/image.png`.\n\t* @param options.upsert If set to true, allows the file to be overwritten if it already exists.\n\t* @returns Promise with response containing signed upload URL, token, and path or error\n\t*\n\t* @example Create Signed Upload URL\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .createSignedUploadUrl('folder/cat.jpg')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"signedUrl\": \"https://example.supabase.co/storage/v1/object/upload/sign/avatars/folder/cat.jpg?token=<TOKEN>\",\n\t* \"path\": \"folder/cat.jpg\",\n\t* \"token\": \"<TOKEN>\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `insert`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync createSignedUploadUrl(path, options) {\n\t\tvar _this4 = this;\n\t\treturn _this4.handleOperation(async () => {\n\t\t\tlet _path = _this4._getFinalPath(path);\n\t\t\tconst headers = _objectSpread2({}, _this4.headers);\n\t\t\tif (options === null || options === void 0 ? void 0 : options.upsert) headers[\"x-upsert\"] = \"true\";\n\t\t\tconst data = await post(_this4.fetch, `${_this4.url}/object/upload/sign/${_path}`, {}, { headers });\n\t\t\tconst url = new URL(_this4.url + data.url);\n\t\t\tconst token = url.searchParams.get(\"token\");\n\t\t\tif (!token) throw new StorageError(\"No token returned by API\");\n\t\t\treturn {\n\t\t\t\tsignedUrl: url.toString(),\n\t\t\t\tpath,\n\t\t\t\ttoken\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Replaces an existing file at the specified path with a new one.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update.\n\t* @param fileBody The body of the file to be stored in the bucket.\n\t* @param fileOptions Optional file upload options including cacheControl, contentType, and metadata.\n\t* **Note:** The `upsert` option has no effect here. `update()` always replaces the\n\t* file at the given path, so the `x-upsert` header is not sent. To control upsert\n\t* behavior, use `upload()` instead.\n\t* @returns Promise with response containing file path, id, and fullPath or error\n\t*\n\t* @example Update file\n\t* ```js\n\t* const avatarFile = event.target.files[0]\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .update('public/avatar1.png', avatarFile, {\n\t* cacheControl: '3600'\n\t* })\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"path\": \"public/avatar1.png\",\n\t* \"fullPath\": \"avatars/public/avatar1.png\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @example Update file using `ArrayBuffer` from base64 file data\n\t* ```js\n\t* import {decode} from 'base64-arraybuffer'\n\t*\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .update('public/avatar1.png', decode('base64FileData'), {\n\t* contentType: 'image/png'\n\t* })\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `update` and `select`\n\t* - `update()` always replaces the file at the given path regardless of the `upsert` option.\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.\n\t*/\n\tasync update(path, fileBody, fileOptions) {\n\t\treturn this.uploadOrUpdate(\"PUT\", path, fileBody, fileOptions);\n\t}\n\t/**\n\t* Moves an existing file to a new path in the same bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param fromPath The original file path, including the current file name. For example `folder/image.png`.\n\t* @param toPath The new file path, including the new file name. For example `folder/image-new.png`.\n\t* @param options The destination options.\n\t* @returns Promise with response containing success message or error\n\t*\n\t* @example Move file\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .move('public/avatar1.png', 'private/avatar2.png')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"message\": \"Successfully moved\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `update` and `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync move(fromPath, toPath, options) {\n\t\tvar _this6 = this;\n\t\treturn _this6.handleOperation(async () => {\n\t\t\treturn await post(_this6.fetch, `${_this6.url}/object/move`, {\n\t\t\t\tbucketId: _this6.bucketId,\n\t\t\t\tsourceKey: fromPath,\n\t\t\t\tdestinationKey: toPath,\n\t\t\t\tdestinationBucket: options === null || options === void 0 ? void 0 : options.destinationBucket\n\t\t\t}, { headers: _this6.headers });\n\t\t});\n\t}\n\t/**\n\t* Copies an existing file to a new path in the same bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param fromPath The original file path, including the current file name. For example `folder/image.png`.\n\t* @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.\n\t* @param options The destination options.\n\t* @returns Promise with response containing copied file path or error\n\t*\n\t* @example Copy file\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .copy('public/avatar1.png', 'private/avatar2.png')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"path\": \"avatars/private/avatar2.png\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `insert` and `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync copy(fromPath, toPath, options) {\n\t\tvar _this7 = this;\n\t\treturn _this7.handleOperation(async () => {\n\t\t\treturn { path: (await post(_this7.fetch, `${_this7.url}/object/copy`, {\n\t\t\t\tbucketId: _this7.bucketId,\n\t\t\t\tsourceKey: fromPath,\n\t\t\t\tdestinationKey: toPath,\n\t\t\t\tdestinationBucket: options === null || options === void 0 ? void 0 : options.destinationBucket\n\t\t\t}, { headers: _this7.headers })).Key };\n\t\t});\n\t}\n\t/**\n\t* Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The file path, including the current file name. For example `folder/image.png`.\n\t* @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.\n\t* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.\n\t* @param options.transform Transform the asset before serving it to the client.\n\t* @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.\n\t* @returns Promise with response containing signed URL or error\n\t*\n\t* @example Create Signed URL\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .createSignedUrl('folder/avatar1.png', 60)\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=<TOKEN>\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @example Create a signed URL for an asset with transformations\n\t* ```js\n\t* const { data } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .createSignedUrl('folder/avatar1.png', 60, {\n\t* transform: {\n\t* width: 100,\n\t* height: 100,\n\t* }\n\t* })\n\t* ```\n\t*\n\t* @example Create a signed URL which triggers the download of the asset\n\t* ```js\n\t* const { data } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .createSignedUrl('folder/avatar1.png', 60, {\n\t* download: true,\n\t* })\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync createSignedUrl(path, expiresIn, options) {\n\t\tvar _this8 = this;\n\t\treturn _this8.handleOperation(async () => {\n\t\t\tlet _path = _this8._getFinalPath(path);\n\t\t\tconst hasTransform = typeof (options === null || options === void 0 ? void 0 : options.transform) === \"object\" && options.transform !== null && Object.keys(options.transform).length > 0;\n\t\t\tlet data = await post(_this8.fetch, `${_this8.url}/object/sign/${_path}`, _objectSpread2({ expiresIn }, hasTransform ? { transform: options.transform } : {}), { headers: _this8.headers });\n\t\t\tconst query = new URLSearchParams();\n\t\t\tif (options === null || options === void 0 ? void 0 : options.download) query.set(\"download\", options.download === true ? \"\" : options.download);\n\t\t\tif ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set(\"cacheNonce\", String(options.cacheNonce));\n\t\t\tconst queryString = query.toString();\n\t\t\treturn { signedUrl: encodeURI(`${_this8.url}${data.signedURL}${queryString ? `&${queryString}` : \"\"}`) };\n\t\t});\n\t}\n\t/**\n\t* Creates multiple signed URLs. Use a signed URL to share a file for a fixed amount of time.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param paths The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`.\n\t* @param expiresIn The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute.\n\t* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.\n\t* @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.\n\t* @returns Promise with response containing array of objects with signedUrl, path, and error or error\n\t*\n\t* @example Create Signed URLs\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"error\": null,\n\t* \"path\": \"folder/avatar1.png\",\n\t* \"signedURL\": \"/object/sign/avatars/folder/avatar1.png?token=<TOKEN>\",\n\t* \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=<TOKEN>\"\n\t* },\n\t* {\n\t* \"error\": null,\n\t* \"path\": \"folder/avatar2.png\",\n\t* \"signedURL\": \"/object/sign/avatars/folder/avatar2.png?token=<TOKEN>\",\n\t* \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar2.png?token=<TOKEN>\"\n\t* }\n\t* ],\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync createSignedUrls(paths, expiresIn, options) {\n\t\tvar _this9 = this;\n\t\treturn _this9.handleOperation(async () => {\n\t\t\tconst data = await post(_this9.fetch, `${_this9.url}/object/sign/${_this9.bucketId}`, {\n\t\t\t\texpiresIn,\n\t\t\t\tpaths\n\t\t\t}, { headers: _this9.headers });\n\t\t\tconst query = new URLSearchParams();\n\t\t\tif (options === null || options === void 0 ? void 0 : options.download) query.set(\"download\", options.download === true ? \"\" : options.download);\n\t\t\tif ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set(\"cacheNonce\", String(options.cacheNonce));\n\t\t\tconst queryString = query.toString();\n\t\t\treturn data.map((datum) => _objectSpread2(_objectSpread2({}, datum), {}, { signedUrl: datum.signedURL ? encodeURI(`${_this9.url}${datum.signedURL}${queryString ? `&${queryString}` : \"\"}`) : null }));\n\t\t});\n\t}\n\t/**\n\t* Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.\n\t* @param options.transform Transform the asset before serving it to the client.\n\t* @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.\n\t* @param parameters Additional fetch parameters like signal for cancellation. Supports standard fetch options including cache control.\n\t* @returns BlobDownloadBuilder instance for downloading the file\n\t*\n\t* @example Download file\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .download('folder/avatar1.png')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": <BLOB>,\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @example Download file with transformations\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .download('folder/avatar1.png', {\n\t* transform: {\n\t* width: 100,\n\t* height: 100,\n\t* quality: 80\n\t* }\n\t* })\n\t* ```\n\t*\n\t* @example Download with cache control (useful in Edge Functions)\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .download('folder/avatar1.png', {}, { cache: 'no-store' })\n\t* ```\n\t*\n\t* @example Download with abort signal\n\t* ```js\n\t* const controller = new AbortController()\n\t* setTimeout(() => controller.abort(), 5000)\n\t*\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .download('folder/avatar1.png', {}, { signal: controller.signal })\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tdownload(path, options, parameters) {\n\t\tconst renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) === \"object\" && options.transform !== null && Object.keys(options.transform).length > 0 ? \"render/image/authenticated\" : \"object\";\n\t\tconst query = new URLSearchParams();\n\t\tif (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);\n\t\tif ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set(\"cacheNonce\", String(options.cacheNonce));\n\t\tconst queryString = query.toString();\n\t\tconst _path = this._getFinalPath(path);\n\t\tconst downloadFn = () => get(this.fetch, `${this.url}/${renderPath}/${_path}${queryString ? `?${queryString}` : \"\"}`, {\n\t\t\theaders: this.headers,\n\t\t\tnoResolveJson: true\n\t\t}, parameters);\n\t\treturn new BlobDownloadBuilder(downloadFn, this.shouldThrowOnError);\n\t}\n\t/**\n\t* Retrieves the details of an existing file.\n\t*\n\t* Returns detailed file metadata including size, content type, and timestamps.\n\t* Note: The API returns `last_modified` field, not `updated_at`.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The file path, including the file name. For example `folder/image.png`.\n\t* @returns Promise with response containing file metadata or error\n\t*\n\t* @example Get file info\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .info('folder/avatar1.png')\n\t*\n\t* if (data) {\n\t* console.log('Last modified:', data.lastModified)\n\t* console.log('Size:', data.size)\n\t* }\n\t* ```\n\t*/\n\tasync info(path) {\n\t\tvar _this10 = this;\n\t\tconst _path = _this10._getFinalPath(path);\n\t\treturn _this10.handleOperation(async () => {\n\t\t\treturn recursiveToCamel(await get(_this10.fetch, `${_this10.url}/object/info/${_path}`, { headers: _this10.headers }));\n\t\t});\n\t}\n\t/**\n\t* Checks the existence of a file.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The file path, including the file name. For example `folder/image.png`.\n\t* @returns Promise with response containing boolean indicating file existence or error\n\t*\n\t* @example Check file existence\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .exists('folder/avatar1.png')\n\t* ```\n\t*/\n\tasync exists(path) {\n\t\tvar _this11 = this;\n\t\tconst _path = _this11._getFinalPath(path);\n\t\ttry {\n\t\t\tawait head(_this11.fetch, `${_this11.url}/object/${_path}`, { headers: _this11.headers });\n\t\t\treturn {\n\t\t\t\tdata: true,\n\t\t\t\terror: null\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (_this11.shouldThrowOnError) throw error;\n\t\t\tif (isStorageError(error)) {\n\t\t\t\tvar _error$originalError;\n\t\t\t\tconst status = error instanceof StorageApiError ? error.status : error instanceof StorageUnknownError ? (_error$originalError = error.originalError) === null || _error$originalError === void 0 ? void 0 : _error$originalError.status : void 0;\n\t\t\t\tif (status !== void 0 && [400, 404].includes(status)) return {\n\t\t\t\t\tdata: false,\n\t\t\t\t\terror\n\t\t\t\t};\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\t/**\n\t* A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.\n\t* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.\n\t* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.\n\t* @param options.transform Transform the asset before serving it to the client.\n\t* @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.\n\t* @returns Object with public URL\n\t*\n\t* @example Returns the URL for an asset in a public bucket\n\t* ```js\n\t* const { data } = supabase\n\t* .storage\n\t* .from('public-bucket')\n\t* .getPublicUrl('folder/avatar1.png')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"publicUrl\": \"https://example.supabase.co/storage/v1/object/public/public-bucket/folder/avatar1.png\"\n\t* }\n\t* }\n\t* ```\n\t*\n\t* @example Returns the URL for an asset in a public bucket with transformations\n\t* ```js\n\t* const { data } = supabase\n\t* .storage\n\t* .from('public-bucket')\n\t* .getPublicUrl('folder/avatar1.png', {\n\t* transform: {\n\t* width: 100,\n\t* height: 100,\n\t* }\n\t* })\n\t* ```\n\t*\n\t* @example Returns the URL which triggers the download of an asset in a public bucket\n\t* ```js\n\t* const { data } = supabase\n\t* .storage\n\t* .from('public-bucket')\n\t* .getPublicUrl('folder/avatar1.png', {\n\t* download: true,\n\t* })\n\t* ```\n\t*\n\t* @remarks\n\t* - The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [supabase.com/dashboard](https://supabase.com/dashboard), clicking the overflow menu on a bucket and choosing \"Make public\"\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tgetPublicUrl(path, options) {\n\t\tconst _path = this._getFinalPath(path);\n\t\tconst query = new URLSearchParams();\n\t\tif (options === null || options === void 0 ? void 0 : options.download) query.set(\"download\", options.download === true ? \"\" : options.download);\n\t\tif (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);\n\t\tif ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set(\"cacheNonce\", String(options.cacheNonce));\n\t\tconst queryString = query.toString();\n\t\tconst renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) === \"object\" && options.transform !== null && Object.keys(options.transform).length > 0 ? \"render/image\" : \"object\";\n\t\treturn { data: { publicUrl: encodeURI(`${this.url}/${renderPath}/public/${_path}`) + (queryString ? `?${queryString}` : \"\") } };\n\t}\n\t/**\n\t* Deletes files within the same bucket\n\t*\n\t* Returns an array of FileObject entries for the deleted files. Note that deprecated\n\t* fields like `bucket_id` may or may not be present in the response - do not rely on them.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param paths An array of files to delete, including the path and file name. For example [`'folder/image.png'`].\n\t* @returns Promise with response containing array of deleted file objects or error\n\t*\n\t* @example Delete file\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .remove(['folder/avatar1.png'])\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": [],\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `delete` and `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync remove(paths) {\n\t\tvar _this12 = this;\n\t\treturn _this12.handleOperation(async () => {\n\t\t\treturn await remove(_this12.fetch, `${_this12.url}/object/${_this12.bucketId}`, { prefixes: paths }, { headers: _this12.headers });\n\t\t});\n\t}\n\t/**\n\t* Get file metadata\n\t* @param id the file id to retrieve metadata\n\t*/\n\t/**\n\t* Update file metadata\n\t* @param id the file id to update metadata\n\t* @param meta the new file metadata\n\t*/\n\t/**\n\t* Lists all the files and folders within a path of the bucket.\n\t*\n\t* **Important:** For folder entries, fields like `id`, `updated_at`, `created_at`,\n\t* `last_accessed_at`, and `metadata` will be `null`. Only files have these fields populated.\n\t* Additionally, deprecated fields like `bucket_id`, `owner`, and `buckets` are NOT returned\n\t* by this method.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The folder path.\n\t* @param options Search options including limit (defaults to 100), offset, sortBy, and search\n\t* @param parameters Optional fetch parameters including signal for cancellation\n\t* @returns Promise with response containing array of files/folders or error\n\t*\n\t* @example List files in a bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .list('folder', {\n\t* limit: 100,\n\t* offset: 0,\n\t* sortBy: { column: 'name', order: 'asc' },\n\t* })\n\t*\n\t* // Handle files vs folders\n\t* data?.forEach(item => {\n\t* if (item.id !== null) {\n\t* // It's a file\n\t* console.log('File:', item.name, 'Size:', item.metadata?.size)\n\t* } else {\n\t* // It's a folder\n\t* console.log('Folder:', item.name)\n\t* }\n\t* })\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"avatar1.png\",\n\t* \"id\": \"e668cf7f-821b-4a2f-9dce-7dfa5dd1cfd2\",\n\t* \"updated_at\": \"2024-05-22T23:06:05.580Z\",\n\t* \"created_at\": \"2024-05-22T23:04:34.443Z\",\n\t* \"last_accessed_at\": \"2024-05-22T23:04:34.443Z\",\n\t* \"metadata\": {\n\t* \"eTag\": \"\\\"c5e8c553235d9af30ef4f6e280790b92\\\"\",\n\t* \"size\": 32175,\n\t* \"mimetype\": \"image/png\",\n\t* \"cacheControl\": \"max-age=3600\",\n\t* \"lastModified\": \"2024-05-22T23:06:05.574Z\",\n\t* \"contentLength\": 32175,\n\t* \"httpStatusCode\": 200\n\t* }\n\t* }\n\t* ],\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @example Search files in a bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .list('folder', {\n\t* limit: 100,\n\t* offset: 0,\n\t* sortBy: { column: 'name', order: 'asc' },\n\t* search: 'jon'\n\t* })\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: none\n\t* - `objects` table permissions: `select`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync list(path, options, parameters) {\n\t\tvar _this13 = this;\n\t\treturn _this13.handleOperation(async () => {\n\t\t\tconst body = _objectSpread2(_objectSpread2(_objectSpread2({}, DEFAULT_SEARCH_OPTIONS), options), {}, { prefix: path || \"\" });\n\t\t\treturn await post(_this13.fetch, `${_this13.url}/object/list/${_this13.bucketId}`, body, { headers: _this13.headers }, parameters);\n\t\t});\n\t}\n\t/**\n\t* Lists all the files and folders within a bucket using the V2 API with pagination support.\n\t*\n\t* **Important:** Folder entries in the `folders` array only contain `name` and optionally `key` —\n\t* they have no `id`, timestamps, or `metadata` fields. Full file metadata is only available\n\t* on entries in the `objects` array.\n\t*\n\t* @experimental this method signature might change in the future\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param options Search options including prefix, cursor for pagination, limit, with_delimiter\n\t* @param parameters Optional fetch parameters including signal for cancellation\n\t* @returns Promise with response containing folders/objects arrays with pagination info or error\n\t*\n\t* @example List files with pagination\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .listV2({\n\t* prefix: 'folder/',\n\t* limit: 100,\n\t* })\n\t*\n\t* // Handle pagination\n\t* if (data?.hasNext) {\n\t* const nextPage = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .listV2({\n\t* prefix: 'folder/',\n\t* cursor: data.nextCursor,\n\t* })\n\t* }\n\t*\n\t* // Handle files vs folders\n\t* data?.objects.forEach(file => {\n\t* if (file.id !== null) {\n\t* console.log('File:', file.name, 'Size:', file.metadata?.size)\n\t* }\n\t* })\n\t* data?.folders.forEach(folder => {\n\t* console.log('Folder:', folder.name)\n\t* })\n\t* ```\n\t*/\n\tasync listV2(options, parameters) {\n\t\tvar _this14 = this;\n\t\treturn _this14.handleOperation(async () => {\n\t\t\tconst body = _objectSpread2({}, options);\n\t\t\treturn await post(_this14.fetch, `${_this14.url}/object/list-v2/${_this14.bucketId}`, body, { headers: _this14.headers }, parameters);\n\t\t});\n\t}\n\tencodeMetadata(metadata) {\n\t\treturn JSON.stringify(metadata);\n\t}\n\ttoBase64(data) {\n\t\tif (typeof Buffer !== \"undefined\") return Buffer.from(data).toString(\"base64\");\n\t\treturn btoa(data);\n\t}\n\t_getFinalPath(path) {\n\t\treturn `${this.bucketId}/${path.replace(/^\\/+/, \"\")}`;\n\t}\n\t_removeEmptyFolders(path) {\n\t\treturn path.replace(/^\\/|\\/$/g, \"\").replace(/\\/+/g, \"/\");\n\t}\n\t/** Modifies the `query`, appending values the from `transform` */\n\tapplyTransformOptsToQuery(query, transform) {\n\t\tif (transform.width) query.set(\"width\", transform.width.toString());\n\t\tif (transform.height) query.set(\"height\", transform.height.toString());\n\t\tif (transform.resize) query.set(\"resize\", transform.resize);\n\t\tif (transform.format) query.set(\"format\", transform.format);\n\t\tif (transform.quality) query.set(\"quality\", transform.quality.toString());\n\t\treturn query;\n\t}\n};\n\n//#endregion\n//#region src/lib/version.ts\nconst version = \"2.106.2\";\n\n//#endregion\n//#region src/lib/constants.ts\nconst DEFAULT_HEADERS = { \"X-Client-Info\": `storage-js/${version}` };\n\n//#endregion\n//#region src/packages/StorageBucketApi.ts\nvar StorageBucketApi = class extends BaseApiClient {\n\tconstructor(url, headers = {}, fetch$1, opts) {\n\t\tconst baseUrl = new URL(url);\n\t\tif (opts === null || opts === void 0 ? void 0 : opts.useNewHostname) {\n\t\t\tif (/supabase\\.(co|in|red)$/.test(baseUrl.hostname) && !baseUrl.hostname.includes(\"storage.supabase.\")) baseUrl.hostname = baseUrl.hostname.replace(\"supabase.\", \"storage.supabase.\");\n\t\t}\n\t\tconst finalUrl = baseUrl.href.replace(/\\/$/, \"\");\n\t\tconst finalHeaders = _objectSpread2(_objectSpread2({}, DEFAULT_HEADERS), headers);\n\t\tsuper(finalUrl, finalHeaders, fetch$1, \"storage\");\n\t}\n\t/**\n\t* Retrieves the details of all Storage buckets within an existing project.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param options Query parameters for listing buckets\n\t* @param options.limit Maximum number of buckets to return\n\t* @param options.offset Number of buckets to skip\n\t* @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')\n\t* @param options.sortOrder Sort order ('asc' or 'desc')\n\t* @param options.search Search term to filter bucket names\n\t* @returns Promise with response containing array of buckets or error\n\t*\n\t* @example List buckets\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .listBuckets()\n\t* ```\n\t*\n\t* @example List buckets with options\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .listBuckets({\n\t* limit: 10,\n\t* offset: 0,\n\t* sortColumn: 'created_at',\n\t* sortOrder: 'desc',\n\t* search: 'prod'\n\t* })\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: `select`\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync listBuckets(options) {\n\t\tvar _this = this;\n\t\treturn _this.handleOperation(async () => {\n\t\t\tconst queryString = _this.listBucketOptionsToQueryString(options);\n\t\t\treturn await get(_this.fetch, `${_this.url}/bucket${queryString}`, { headers: _this.headers });\n\t\t});\n\t}\n\t/**\n\t* Retrieves the details of an existing Storage bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id The unique identifier of the bucket you would like to retrieve.\n\t* @returns Promise with response containing bucket details or error\n\t*\n\t* @example Get bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .getBucket('avatars')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"id\": \"avatars\",\n\t* \"name\": \"avatars\",\n\t* \"owner\": \"\",\n\t* \"public\": false,\n\t* \"file_size_limit\": 1024,\n\t* \"allowed_mime_types\": [\n\t* \"image/png\"\n\t* ],\n\t* \"created_at\": \"2024-05-22T22:26:05.100Z\",\n\t* \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: `select`\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync getBucket(id) {\n\t\tvar _this2 = this;\n\t\treturn _this2.handleOperation(async () => {\n\t\t\treturn await get(_this2.fetch, `${_this2.url}/bucket/${id}`, { headers: _this2.headers });\n\t\t});\n\t}\n\t/**\n\t* Creates a new Storage bucket\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id A unique identifier for the bucket you are creating.\n\t* @param options.public The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private.\n\t* @param options.fileSizeLimit specifies the max file size in bytes that can be uploaded to this bucket.\n\t* The global file size limit takes precedence over this value.\n\t* The default value is null, which doesn't set a per bucket file size limit.\n\t* @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload.\n\t* The default value is null, which allows files with all mime types to be uploaded.\n\t* Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.\n\t* @param options.type (private-beta) specifies the bucket type. see `BucketType` for more details.\n\t* - default bucket type is `STANDARD`\n\t* @returns Promise with response containing newly created bucket name or error\n\t*\n\t* @example Create bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .createBucket('avatars', {\n\t* public: false,\n\t* allowedMimeTypes: ['image/png'],\n\t* fileSizeLimit: 1024\n\t* })\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"name\": \"avatars\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: `insert`\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync createBucket(id, options = { public: false }) {\n\t\tvar _this3 = this;\n\t\treturn _this3.handleOperation(async () => {\n\t\t\treturn await post(_this3.fetch, `${_this3.url}/bucket`, {\n\t\t\t\tid,\n\t\t\t\tname: id,\n\t\t\t\ttype: options.type,\n\t\t\t\tpublic: options.public,\n\t\t\t\tfile_size_limit: options.fileSizeLimit,\n\t\t\t\tallowed_mime_types: options.allowedMimeTypes\n\t\t\t}, { headers: _this3.headers });\n\t\t});\n\t}\n\t/**\n\t* Updates a Storage bucket\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id A unique identifier for the bucket you are updating.\n\t* @param options.public The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations.\n\t* @param options.fileSizeLimit specifies the max file size in bytes that can be uploaded to this bucket.\n\t* The global file size limit takes precedence over this value.\n\t* The default value is null, which doesn't set a per bucket file size limit.\n\t* @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload.\n\t* The default value is null, which allows files with all mime types to be uploaded.\n\t* Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.\n\t* @returns Promise with response containing success message or error\n\t*\n\t* @example Update bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .updateBucket('avatars', {\n\t* public: false,\n\t* allowedMimeTypes: ['image/png'],\n\t* fileSizeLimit: 1024\n\t* })\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"message\": \"Successfully updated\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: `select` and `update`\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync updateBucket(id, options) {\n\t\tvar _this4 = this;\n\t\treturn _this4.handleOperation(async () => {\n\t\t\treturn await put(_this4.fetch, `${_this4.url}/bucket/${id}`, {\n\t\t\t\tid,\n\t\t\t\tname: id,\n\t\t\t\tpublic: options.public,\n\t\t\t\tfile_size_limit: options.fileSizeLimit,\n\t\t\t\tallowed_mime_types: options.allowedMimeTypes\n\t\t\t}, { headers: _this4.headers });\n\t\t});\n\t}\n\t/**\n\t* Removes all objects inside a single bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id The unique identifier of the bucket you would like to empty.\n\t* @returns Promise with success message or error\n\t*\n\t* @example Empty bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .emptyBucket('avatars')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"message\": \"Successfully emptied\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: `select`\n\t* - `objects` table permissions: `select` and `delete`\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync emptyBucket(id) {\n\t\tvar _this5 = this;\n\t\treturn _this5.handleOperation(async () => {\n\t\t\treturn await post(_this5.fetch, `${_this5.url}/bucket/${id}/empty`, {}, { headers: _this5.headers });\n\t\t});\n\t}\n\t/**\n\t* Deletes an existing bucket. A bucket can't be deleted with existing objects inside it.\n\t* You must first `empty()` the bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id The unique identifier of the bucket you would like to delete.\n\t* @returns Promise with success message or error\n\t*\n\t* @example Delete bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .deleteBucket('avatars')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"message\": \"Successfully deleted\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - RLS policy permissions required:\n\t* - `buckets` table permissions: `select` and `delete`\n\t* - `objects` table permissions: none\n\t* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n\t*/\n\tasync deleteBucket(id) {\n\t\tvar _this6 = this;\n\t\treturn _this6.handleOperation(async () => {\n\t\t\treturn await remove(_this6.fetch, `${_this6.url}/bucket/${id}`, {}, { headers: _this6.headers });\n\t\t});\n\t}\n\tlistBucketOptionsToQueryString(options) {\n\t\tconst params = {};\n\t\tif (options) {\n\t\t\tif (\"limit\" in options) params.limit = String(options.limit);\n\t\t\tif (\"offset\" in options) params.offset = String(options.offset);\n\t\t\tif (options.search) params.search = options.search;\n\t\t\tif (options.sortColumn) params.sortColumn = options.sortColumn;\n\t\t\tif (options.sortOrder) params.sortOrder = options.sortOrder;\n\t\t}\n\t\treturn Object.keys(params).length > 0 ? \"?\" + new URLSearchParams(params).toString() : \"\";\n\t}\n};\n\n//#endregion\n//#region src/packages/StorageAnalyticsClient.ts\n/**\n* Client class for managing Analytics Buckets using Iceberg tables\n* Provides methods for creating, listing, and deleting analytics buckets\n*/\nvar StorageAnalyticsClient = class extends BaseApiClient {\n\t/**\n\t* @alpha\n\t*\n\t* Creates a new StorageAnalyticsClient instance\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Analytics Buckets\n\t* @param url - The base URL for the storage API\n\t* @param headers - HTTP headers to include in requests\n\t* @param fetch - Optional custom fetch implementation\n\t*\n\t* @example Using supabase-js (recommended)\n\t* ```typescript\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* const { data, error } = await supabase.storage.analytics.listBuckets()\n\t* ```\n\t*\n\t* @example Standalone import for bundle-sensitive environments\n\t* ```typescript\n\t* import { StorageAnalyticsClient } from '@supabase/storage-js'\n\t*\n\t* const client = new StorageAnalyticsClient(url, headers)\n\t* ```\n\t*/\n\tconstructor(url, headers = {}, fetch$1) {\n\t\tconst finalUrl = url.replace(/\\/$/, \"\");\n\t\tconst finalHeaders = _objectSpread2(_objectSpread2({}, DEFAULT_HEADERS), headers);\n\t\tsuper(finalUrl, finalHeaders, fetch$1, \"storage\");\n\t}\n\t/**\n\t* @alpha\n\t*\n\t* Creates a new analytics bucket using Iceberg tables\n\t* Analytics buckets are optimized for analytical queries and data processing\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Analytics Buckets\n\t* @param name A unique name for the bucket you are creating\n\t* @returns Promise with response containing newly created analytics bucket or error\n\t*\n\t* @example Create analytics bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .analytics\n\t* .createBucket('analytics-data')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"name\": \"analytics-data\",\n\t* \"type\": \"ANALYTICS\",\n\t* \"format\": \"iceberg\",\n\t* \"created_at\": \"2024-05-22T22:26:05.100Z\",\n\t* \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - Creates a new analytics bucket using Iceberg tables\n\t* - Analytics buckets are optimized for analytical queries and data processing\n\t*/\n\tasync createBucket(name) {\n\t\tvar _this = this;\n\t\treturn _this.handleOperation(async () => {\n\t\t\treturn await post(_this.fetch, `${_this.url}/bucket`, { name }, { headers: _this.headers });\n\t\t});\n\t}\n\t/**\n\t* @alpha\n\t*\n\t* Retrieves the details of all Analytics Storage buckets within an existing project\n\t* Only returns buckets of type 'ANALYTICS'\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Analytics Buckets\n\t* @param options Query parameters for listing buckets\n\t* @param options.limit Maximum number of buckets to return\n\t* @param options.offset Number of buckets to skip\n\t* @param options.sortColumn Column to sort by ('name', 'created_at', 'updated_at')\n\t* @param options.sortOrder Sort order ('asc' or 'desc')\n\t* @param options.search Search term to filter bucket names\n\t* @returns Promise with response containing array of analytics buckets or error\n\t*\n\t* @example List analytics buckets\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .analytics\n\t* .listBuckets({\n\t* limit: 10,\n\t* offset: 0,\n\t* sortColumn: 'created_at',\n\t* sortOrder: 'desc'\n\t* })\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": [\n\t* {\n\t* \"name\": \"analytics-data\",\n\t* \"type\": \"ANALYTICS\",\n\t* \"format\": \"iceberg\",\n\t* \"created_at\": \"2024-05-22T22:26:05.100Z\",\n\t* \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n\t* }\n\t* ],\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - Retrieves the details of all Analytics Storage buckets within an existing project\n\t* - Only returns buckets of type 'ANALYTICS'\n\t*/\n\tasync listBuckets(options) {\n\t\tvar _this2 = this;\n\t\treturn _this2.handleOperation(async () => {\n\t\t\tconst queryParams = new URLSearchParams();\n\t\t\tif ((options === null || options === void 0 ? void 0 : options.limit) !== void 0) queryParams.set(\"limit\", options.limit.toString());\n\t\t\tif ((options === null || options === void 0 ? void 0 : options.offset) !== void 0) queryParams.set(\"offset\", options.offset.toString());\n\t\t\tif (options === null || options === void 0 ? void 0 : options.sortColumn) queryParams.set(\"sortColumn\", options.sortColumn);\n\t\t\tif (options === null || options === void 0 ? void 0 : options.sortOrder) queryParams.set(\"sortOrder\", options.sortOrder);\n\t\t\tif (options === null || options === void 0 ? void 0 : options.search) queryParams.set(\"search\", options.search);\n\t\t\tconst queryString = queryParams.toString();\n\t\t\tconst url = queryString ? `${_this2.url}/bucket?${queryString}` : `${_this2.url}/bucket`;\n\t\t\treturn await get(_this2.fetch, url, { headers: _this2.headers });\n\t\t});\n\t}\n\t/**\n\t* @alpha\n\t*\n\t* Deletes an existing analytics bucket\n\t* A bucket can't be deleted with existing objects inside it\n\t* You must first empty the bucket before deletion\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Analytics Buckets\n\t* @param bucketName The unique identifier of the bucket you would like to delete\n\t* @returns Promise with response containing success message or error\n\t*\n\t* @example Delete analytics bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .analytics\n\t* .deleteBucket('analytics-data')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"message\": \"Successfully deleted\"\n\t* },\n\t* \"error\": null\n\t* }\n\t* ```\n\t*\n\t* @remarks\n\t* - Deletes an analytics bucket\n\t*/\n\tasync deleteBucket(bucketName) {\n\t\tvar _this3 = this;\n\t\treturn _this3.handleOperation(async () => {\n\t\t\treturn await remove(_this3.fetch, `${_this3.url}/bucket/${bucketName}`, {}, { headers: _this3.headers });\n\t\t});\n\t}\n\t/**\n\t* @alpha\n\t*\n\t* Get an Iceberg REST Catalog client configured for a specific analytics bucket\n\t* Use this to perform advanced table and namespace operations within the bucket\n\t* The returned client provides full access to the Apache Iceberg REST Catalog API\n\t* with the Supabase `{ data, error }` pattern for consistent error handling on all operations.\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Analytics Buckets\n\t* @param bucketName - The name of the analytics bucket (warehouse) to connect to\n\t* @returns The wrapped Iceberg catalog client\n\t* @throws {StorageError} If the bucket name is invalid\n\t*\n\t* @example Get catalog and create table\n\t* ```js\n\t* // First, create an analytics bucket\n\t* const { data: bucket, error: bucketError } = await supabase\n\t* .storage\n\t* .analytics\n\t* .createBucket('analytics-data')\n\t*\n\t* // Get the Iceberg catalog for that bucket\n\t* const catalog = supabase.storage.analytics.from('analytics-data')\n\t*\n\t* // Create a namespace\n\t* const { error: nsError } = await catalog.createNamespace({ namespace: ['default'] })\n\t*\n\t* // Create a table with schema\n\t* const { data: tableMetadata, error: tableError } = await catalog.createTable(\n\t* { namespace: ['default'] },\n\t* {\n\t* name: 'events',\n\t* schema: {\n\t* type: 'struct',\n\t* fields: [\n\t* { id: 1, name: 'id', type: 'long', required: true },\n\t* { id: 2, name: 'timestamp', type: 'timestamp', required: true },\n\t* { id: 3, name: 'user_id', type: 'string', required: false }\n\t* ],\n\t* 'schema-id': 0,\n\t* 'identifier-field-ids': [1]\n\t* },\n\t* 'partition-spec': {\n\t* 'spec-id': 0,\n\t* fields: []\n\t* },\n\t* 'write-order': {\n\t* 'order-id': 0,\n\t* fields: []\n\t* },\n\t* properties: {\n\t* 'write.format.default': 'parquet'\n\t* }\n\t* }\n\t* )\n\t* ```\n\t*\n\t* @example List tables in namespace\n\t* ```js\n\t* const catalog = supabase.storage.analytics.from('analytics-data')\n\t*\n\t* // List all tables in the default namespace\n\t* const { data: tables, error: listError } = await catalog.listTables({ namespace: ['default'] })\n\t* if (listError) {\n\t* if (listError.isNotFound()) {\n\t* console.log('Namespace not found')\n\t* }\n\t* return\n\t* }\n\t* console.log(tables) // [{ namespace: ['default'], name: 'events' }]\n\t* ```\n\t*\n\t* @example Working with namespaces\n\t* ```js\n\t* const catalog = supabase.storage.analytics.from('analytics-data')\n\t*\n\t* // List all namespaces\n\t* const { data: namespaces } = await catalog.listNamespaces()\n\t*\n\t* // Create namespace with properties\n\t* await catalog.createNamespace(\n\t* { namespace: ['production'] },\n\t* { properties: { owner: 'data-team', env: 'prod' } }\n\t* )\n\t* ```\n\t*\n\t* @example Cleanup operations\n\t* ```js\n\t* const catalog = supabase.storage.analytics.from('analytics-data')\n\t*\n\t* // Drop table with purge option (removes all data)\n\t* const { error: dropError } = await catalog.dropTable(\n\t* { namespace: ['default'], name: 'events' },\n\t* { purge: true }\n\t* )\n\t*\n\t* if (dropError?.isNotFound()) {\n\t* console.log('Table does not exist')\n\t* }\n\t*\n\t* // Drop namespace (must be empty)\n\t* await catalog.dropNamespace({ namespace: ['default'] })\n\t* ```\n\t*\n\t* @remarks\n\t* This method provides a bridge between Supabase's bucket management and the standard\n\t* Apache Iceberg REST Catalog API. The bucket name maps to the Iceberg warehouse parameter.\n\t* All authentication and configuration is handled automatically using your Supabase credentials.\n\t*\n\t* **Error Handling**: Invalid bucket names throw immediately. All catalog\n\t* operations return `{ data, error }` where errors are `IcebergError` instances from iceberg-js.\n\t* Use helper methods like `error.isNotFound()` or check `error.status` for specific error handling.\n\t* Use `.throwOnError()` on the analytics client if you prefer exceptions for catalog operations.\n\t*\n\t* **Cleanup Operations**: When using `dropTable`, the `purge: true` option permanently\n\t* deletes all table data. Without it, the table is marked as deleted but data remains.\n\t*\n\t* **Library Dependency**: The returned catalog wraps `IcebergRestCatalog` from iceberg-js.\n\t* For complete API documentation and advanced usage, refer to the\n\t* [iceberg-js documentation](https://supabase.github.io/iceberg-js/).\n\t*/\n\tfrom(bucketName) {\n\t\tvar _this4 = this;\n\t\tif (!isValidBucketName(bucketName)) throw new StorageError(\"Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.\");\n\t\tconst catalog = new IcebergRestCatalog({\n\t\t\tbaseUrl: this.url,\n\t\t\tcatalogName: bucketName,\n\t\t\tauth: {\n\t\t\t\ttype: \"custom\",\n\t\t\t\tgetHeaders: async () => _this4.headers\n\t\t\t},\n\t\t\tfetch: this.fetch\n\t\t});\n\t\tconst shouldThrowOnError = this.shouldThrowOnError;\n\t\treturn new Proxy(catalog, { get(target, prop) {\n\t\t\tconst value = target[prop];\n\t\t\tif (typeof value !== \"function\") return value;\n\t\t\treturn async (...args) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: await value.apply(target, args),\n\t\t\t\t\t\terror: null\n\t\t\t\t\t};\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (shouldThrowOnError) throw error;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: null,\n\t\t\t\t\t\terror\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\t\t} });\n\t}\n};\n\n//#endregion\n//#region src/packages/VectorIndexApi.ts\n/**\n* @hidden\n* Base implementation for vector index operations.\n* Use {@link VectorBucketScope} via `supabase.storage.vectors.from('bucket')` instead.\n*/\nvar VectorIndexApi = class extends BaseApiClient {\n\t/** Creates a new VectorIndexApi instance */\n\tconstructor(url, headers = {}, fetch$1) {\n\t\tconst finalUrl = url.replace(/\\/$/, \"\");\n\t\tconst finalHeaders = _objectSpread2(_objectSpread2({}, DEFAULT_HEADERS), {}, { \"Content-Type\": \"application/json\" }, headers);\n\t\tsuper(finalUrl, finalHeaders, fetch$1, \"vectors\");\n\t}\n\t/** Creates a new vector index within a bucket */\n\tasync createIndex(options) {\n\t\tvar _this = this;\n\t\treturn _this.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this.fetch, `${_this.url}/CreateIndex`, options, { headers: _this.headers }) || {};\n\t\t});\n\t}\n\t/** Retrieves metadata for a specific vector index */\n\tasync getIndex(vectorBucketName, indexName) {\n\t\tvar _this2 = this;\n\t\treturn _this2.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this2.fetch, `${_this2.url}/GetIndex`, {\n\t\t\t\tvectorBucketName,\n\t\t\t\tindexName\n\t\t\t}, { headers: _this2.headers });\n\t\t});\n\t}\n\t/** Lists vector indexes within a bucket with optional filtering and pagination */\n\tasync listIndexes(options) {\n\t\tvar _this3 = this;\n\t\treturn _this3.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this3.fetch, `${_this3.url}/ListIndexes`, options, { headers: _this3.headers });\n\t\t});\n\t}\n\t/** Deletes a vector index and all its data */\n\tasync deleteIndex(vectorBucketName, indexName) {\n\t\tvar _this4 = this;\n\t\treturn _this4.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this4.fetch, `${_this4.url}/DeleteIndex`, {\n\t\t\t\tvectorBucketName,\n\t\t\t\tindexName\n\t\t\t}, { headers: _this4.headers }) || {};\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/packages/VectorDataApi.ts\n/**\n* @hidden\n* Base implementation for vector data operations.\n* Use {@link VectorIndexScope} via `supabase.storage.vectors.from('bucket').index('idx')` instead.\n*/\nvar VectorDataApi = class extends BaseApiClient {\n\t/** Creates a new VectorDataApi instance */\n\tconstructor(url, headers = {}, fetch$1) {\n\t\tconst finalUrl = url.replace(/\\/$/, \"\");\n\t\tconst finalHeaders = _objectSpread2(_objectSpread2({}, DEFAULT_HEADERS), {}, { \"Content-Type\": \"application/json\" }, headers);\n\t\tsuper(finalUrl, finalHeaders, fetch$1, \"vectors\");\n\t}\n\t/** Inserts or updates vectors in batch (1-500 per request) */\n\tasync putVectors(options) {\n\t\tvar _this = this;\n\t\tif (options.vectors.length < 1 || options.vectors.length > 500) throw new Error(\"Vector batch size must be between 1 and 500 items\");\n\t\treturn _this.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this.fetch, `${_this.url}/PutVectors`, options, { headers: _this.headers }) || {};\n\t\t});\n\t}\n\t/** Retrieves vectors by their keys in batch */\n\tasync getVectors(options) {\n\t\tvar _this2 = this;\n\t\treturn _this2.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this2.fetch, `${_this2.url}/GetVectors`, options, { headers: _this2.headers });\n\t\t});\n\t}\n\t/** Lists vectors in an index with pagination */\n\tasync listVectors(options) {\n\t\tvar _this3 = this;\n\t\tif (options.segmentCount !== void 0) {\n\t\t\tif (options.segmentCount < 1 || options.segmentCount > 16) throw new Error(\"segmentCount must be between 1 and 16\");\n\t\t\tif (options.segmentIndex !== void 0) {\n\t\t\t\tif (options.segmentIndex < 0 || options.segmentIndex >= options.segmentCount) throw new Error(`segmentIndex must be between 0 and ${options.segmentCount - 1}`);\n\t\t\t}\n\t\t}\n\t\treturn _this3.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this3.fetch, `${_this3.url}/ListVectors`, options, { headers: _this3.headers });\n\t\t});\n\t}\n\t/** Queries for similar vectors using approximate nearest neighbor search */\n\tasync queryVectors(options) {\n\t\tvar _this4 = this;\n\t\treturn _this4.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this4.fetch, `${_this4.url}/QueryVectors`, options, { headers: _this4.headers });\n\t\t});\n\t}\n\t/** Deletes vectors by their keys in batch (1-500 per request) */\n\tasync deleteVectors(options) {\n\t\tvar _this5 = this;\n\t\tif (options.keys.length < 1 || options.keys.length > 500) throw new Error(\"Keys batch size must be between 1 and 500 items\");\n\t\treturn _this5.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this5.fetch, `${_this5.url}/DeleteVectors`, options, { headers: _this5.headers }) || {};\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/packages/VectorBucketApi.ts\n/**\n* @hidden\n* Base implementation for vector bucket operations.\n* Use {@link StorageVectorsClient} via `supabase.storage.vectors` instead.\n*/\nvar VectorBucketApi = class extends BaseApiClient {\n\t/** Creates a new VectorBucketApi instance */\n\tconstructor(url, headers = {}, fetch$1) {\n\t\tconst finalUrl = url.replace(/\\/$/, \"\");\n\t\tconst finalHeaders = _objectSpread2(_objectSpread2({}, DEFAULT_HEADERS), {}, { \"Content-Type\": \"application/json\" }, headers);\n\t\tsuper(finalUrl, finalHeaders, fetch$1, \"vectors\");\n\t}\n\t/** Creates a new vector bucket */\n\tasync createBucket(vectorBucketName) {\n\t\tvar _this = this;\n\t\treturn _this.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this.fetch, `${_this.url}/CreateVectorBucket`, { vectorBucketName }, { headers: _this.headers }) || {};\n\t\t});\n\t}\n\t/** Retrieves metadata for a specific vector bucket */\n\tasync getBucket(vectorBucketName) {\n\t\tvar _this2 = this;\n\t\treturn _this2.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this2.fetch, `${_this2.url}/GetVectorBucket`, { vectorBucketName }, { headers: _this2.headers });\n\t\t});\n\t}\n\t/** Lists vector buckets with optional filtering and pagination */\n\tasync listBuckets(options = {}) {\n\t\tvar _this3 = this;\n\t\treturn _this3.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this3.fetch, `${_this3.url}/ListVectorBuckets`, options, { headers: _this3.headers });\n\t\t});\n\t}\n\t/** Deletes a vector bucket (must be empty first) */\n\tasync deleteBucket(vectorBucketName) {\n\t\tvar _this4 = this;\n\t\treturn _this4.handleOperation(async () => {\n\t\t\treturn await vectorsApi.post(_this4.fetch, `${_this4.url}/DeleteVectorBucket`, { vectorBucketName }, { headers: _this4.headers }) || {};\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/packages/StorageVectorsClient.ts\n/**\n*\n* @alpha\n*\n* Main client for interacting with S3 Vectors API\n* Provides access to bucket, index, and vector data operations\n*\n* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n*\n* **Usage Patterns:**\n*\n* ```typescript\n* const { data, error } = await supabase\n* .storage\n* .vectors\n* .createBucket('embeddings-prod')\n*\n* // Access index operations via buckets\n* const bucket = supabase.storage.vectors.from('embeddings-prod')\n* await bucket.createIndex({\n* indexName: 'documents',\n* dataType: 'float32',\n* dimension: 1536,\n* distanceMetric: 'cosine'\n* })\n*\n* // Access vector operations via index\n* const index = bucket.index('documents')\n* await index.putVectors({\n* vectors: [\n* { key: 'doc-1', data: { float32: [...] }, metadata: { title: 'Intro' } }\n* ]\n* })\n*\n* // Query similar vectors\n* const { data } = await index.queryVectors({\n* queryVector: { float32: [...] },\n* topK: 5,\n* returnDistance: true\n* })\n* ```\n*/\nvar StorageVectorsClient = class extends VectorBucketApi {\n\t/**\n\t* @alpha\n\t*\n\t* Creates a StorageVectorsClient that can manage buckets, indexes, and vectors.\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param url - Base URL of the Storage Vectors REST API.\n\t* @param options.headers - Optional headers (for example `Authorization`) applied to every request.\n\t* @param options.fetch - Optional custom `fetch` implementation for non-browser runtimes.\n\t*\n\t* @example Using supabase-js (recommended)\n\t* ```typescript\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* ```\n\t*\n\t* @example Standalone import for bundle-sensitive environments\n\t* ```typescript\n\t* import { StorageVectorsClient } from '@supabase/storage-js'\n\t*\n\t* const client = new StorageVectorsClient(url, options)\n\t* ```\n\t*/\n\tconstructor(url, options = {}) {\n\t\tsuper(url, options.headers || {}, options.fetch);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Access operations for a specific vector bucket\n\t* Returns a scoped client for index and vector operations within the bucket\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param vectorBucketName - Name of the vector bucket\n\t* @returns Bucket-scoped client with index and vector operations\n\t*\n\t* @example Accessing a vector bucket\n\t* ```typescript\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* ```\n\t*/\n\tfrom(vectorBucketName) {\n\t\treturn new VectorBucketScope(this.url, this.headers, vectorBucketName, this.fetch);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Creates a new vector bucket\n\t* Vector buckets are containers for vector indexes and their data\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param vectorBucketName - Unique name for the vector bucket\n\t* @returns Promise with empty response on success or error\n\t*\n\t* @example Creating a vector bucket\n\t* ```typescript\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .vectors\n\t* .createBucket('embeddings-prod')\n\t* ```\n\t*/\n\tasync createBucket(vectorBucketName) {\n\t\tvar _superprop_getCreateBucket = () => super.createBucket, _this = this;\n\t\treturn _superprop_getCreateBucket().call(_this, vectorBucketName);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Retrieves metadata for a specific vector bucket\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param vectorBucketName - Name of the vector bucket\n\t* @returns Promise with bucket metadata or error\n\t*\n\t* @example Get bucket metadata\n\t* ```typescript\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .vectors\n\t* .getBucket('embeddings-prod')\n\t*\n\t* console.log('Bucket created:', data?.vectorBucket.creationTime)\n\t* ```\n\t*/\n\tasync getBucket(vectorBucketName) {\n\t\tvar _superprop_getGetBucket = () => super.getBucket, _this2 = this;\n\t\treturn _superprop_getGetBucket().call(_this2, vectorBucketName);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Lists all vector buckets with optional filtering and pagination\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Optional filters (prefix, maxResults, nextToken)\n\t* @returns Promise with list of buckets or error\n\t*\n\t* @example List vector buckets\n\t* ```typescript\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .vectors\n\t* .listBuckets({ prefix: 'embeddings-' })\n\t*\n\t* data?.vectorBuckets.forEach(bucket => {\n\t* console.log(bucket.vectorBucketName)\n\t* })\n\t* ```\n\t*/\n\tasync listBuckets(options = {}) {\n\t\tvar _superprop_getListBuckets = () => super.listBuckets, _this3 = this;\n\t\treturn _superprop_getListBuckets().call(_this3, options);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Deletes a vector bucket (bucket must be empty)\n\t* All indexes must be deleted before deleting the bucket\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param vectorBucketName - Name of the vector bucket to delete\n\t* @returns Promise with empty response on success or error\n\t*\n\t* @example Delete a vector bucket\n\t* ```typescript\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .vectors\n\t* .deleteBucket('embeddings-old')\n\t* ```\n\t*/\n\tasync deleteBucket(vectorBucketName) {\n\t\tvar _superprop_getDeleteBucket = () => super.deleteBucket, _this4 = this;\n\t\treturn _superprop_getDeleteBucket().call(_this4, vectorBucketName);\n\t}\n};\n/**\n*\n* @alpha\n*\n* Scoped client for operations within a specific vector bucket\n* Provides index management and access to vector operations\n*\n* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n*/\nvar VectorBucketScope = class extends VectorIndexApi {\n\t/**\n\t* @alpha\n\t*\n\t* Creates a helper that automatically scopes all index operations to the provided bucket.\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @example Creating a vector bucket scope\n\t* ```typescript\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* ```\n\t*/\n\tconstructor(url, headers, vectorBucketName, fetch$1) {\n\t\tsuper(url, headers, fetch$1);\n\t\tthis.vectorBucketName = vectorBucketName;\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Creates a new vector index in this bucket\n\t* Convenience method that automatically includes the bucket name\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Index configuration (vectorBucketName is automatically set)\n\t* @returns Promise with empty response on success or error\n\t*\n\t* @example Creating a vector index\n\t* ```typescript\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* await bucket.createIndex({\n\t* indexName: 'documents-openai',\n\t* dataType: 'float32',\n\t* dimension: 1536,\n\t* distanceMetric: 'cosine',\n\t* metadataConfiguration: {\n\t* nonFilterableMetadataKeys: ['raw_text']\n\t* }\n\t* })\n\t* ```\n\t*/\n\tasync createIndex(options) {\n\t\tvar _superprop_getCreateIndex = () => super.createIndex, _this5 = this;\n\t\treturn _superprop_getCreateIndex().call(_this5, _objectSpread2(_objectSpread2({}, options), {}, { vectorBucketName: _this5.vectorBucketName }));\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Lists indexes in this bucket\n\t* Convenience method that automatically includes the bucket name\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Listing options (vectorBucketName is automatically set)\n\t* @returns Promise with response containing indexes array and pagination token or error\n\t*\n\t* @example List indexes\n\t* ```typescript\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* const { data } = await bucket.listIndexes({ prefix: 'documents-' })\n\t* ```\n\t*/\n\tasync listIndexes(options = {}) {\n\t\tvar _superprop_getListIndexes = () => super.listIndexes, _this6 = this;\n\t\treturn _superprop_getListIndexes().call(_this6, _objectSpread2(_objectSpread2({}, options), {}, { vectorBucketName: _this6.vectorBucketName }));\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Retrieves metadata for a specific index in this bucket\n\t* Convenience method that automatically includes the bucket name\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param indexName - Name of the index to retrieve\n\t* @returns Promise with index metadata or error\n\t*\n\t* @example Get index metadata\n\t* ```typescript\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* const { data } = await bucket.getIndex('documents-openai')\n\t* console.log('Dimension:', data?.index.dimension)\n\t* ```\n\t*/\n\tasync getIndex(indexName) {\n\t\tvar _superprop_getGetIndex = () => super.getIndex, _this7 = this;\n\t\treturn _superprop_getGetIndex().call(_this7, _this7.vectorBucketName, indexName);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Deletes an index from this bucket\n\t* Convenience method that automatically includes the bucket name\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param indexName - Name of the index to delete\n\t* @returns Promise with empty response on success or error\n\t*\n\t* @example Delete an index\n\t* ```typescript\n\t* const bucket = supabase.storage.vectors.from('embeddings-prod')\n\t* await bucket.deleteIndex('old-index')\n\t* ```\n\t*/\n\tasync deleteIndex(indexName) {\n\t\tvar _superprop_getDeleteIndex = () => super.deleteIndex, _this8 = this;\n\t\treturn _superprop_getDeleteIndex().call(_this8, _this8.vectorBucketName, indexName);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Access operations for a specific index within this bucket\n\t* Returns a scoped client for vector data operations\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param indexName - Name of the index\n\t* @returns Index-scoped client with vector data operations\n\t*\n\t* @example Accessing an index\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t*\n\t* // Insert vectors\n\t* await index.putVectors({\n\t* vectors: [\n\t* { key: 'doc-1', data: { float32: [...] }, metadata: { title: 'Intro' } }\n\t* ]\n\t* })\n\t*\n\t* // Query similar vectors\n\t* const { data } = await index.queryVectors({\n\t* queryVector: { float32: [...] },\n\t* topK: 5\n\t* })\n\t* ```\n\t*/\n\tindex(indexName) {\n\t\treturn new VectorIndexScope(this.url, this.headers, this.vectorBucketName, indexName, this.fetch);\n\t}\n};\n/**\n*\n* @alpha\n*\n* Scoped client for operations within a specific vector index\n* Provides vector data operations (put, get, list, query, delete)\n*\n* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n*/\nvar VectorIndexScope = class extends VectorDataApi {\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Creates a helper that automatically scopes all vector operations to the provided bucket/index names.\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @example Creating a vector index scope\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t* ```\n\t*/\n\tconstructor(url, headers, vectorBucketName, indexName, fetch$1) {\n\t\tsuper(url, headers, fetch$1);\n\t\tthis.vectorBucketName = vectorBucketName;\n\t\tthis.indexName = indexName;\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Inserts or updates vectors in this index\n\t* Convenience method that automatically includes bucket and index names\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Vector insertion options (bucket and index names automatically set)\n\t* @returns Promise with empty response on success or error\n\t*\n\t* @example Insert vectors into an index\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t* await index.putVectors({\n\t* vectors: [\n\t* {\n\t* key: 'doc-1',\n\t* data: { float32: [0.1, 0.2, ...] },\n\t* metadata: { title: 'Introduction', page: 1 }\n\t* }\n\t* ]\n\t* })\n\t* ```\n\t*/\n\tasync putVectors(options) {\n\t\tvar _superprop_getPutVectors = () => super.putVectors, _this9 = this;\n\t\treturn _superprop_getPutVectors().call(_this9, _objectSpread2(_objectSpread2({}, options), {}, {\n\t\t\tvectorBucketName: _this9.vectorBucketName,\n\t\t\tindexName: _this9.indexName\n\t\t}));\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Retrieves vectors by keys from this index\n\t* Convenience method that automatically includes bucket and index names\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Vector retrieval options (bucket and index names automatically set)\n\t* @returns Promise with response containing vectors array or error\n\t*\n\t* @example Get vectors by keys\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t* const { data } = await index.getVectors({\n\t* keys: ['doc-1', 'doc-2'],\n\t* returnMetadata: true\n\t* })\n\t* ```\n\t*/\n\tasync getVectors(options) {\n\t\tvar _superprop_getGetVectors = () => super.getVectors, _this10 = this;\n\t\treturn _superprop_getGetVectors().call(_this10, _objectSpread2(_objectSpread2({}, options), {}, {\n\t\t\tvectorBucketName: _this10.vectorBucketName,\n\t\t\tindexName: _this10.indexName\n\t\t}));\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Lists vectors in this index with pagination\n\t* Convenience method that automatically includes bucket and index names\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Listing options (bucket and index names automatically set)\n\t* @returns Promise with response containing vectors array and pagination token or error\n\t*\n\t* @example List vectors with pagination\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t* const { data } = await index.listVectors({\n\t* maxResults: 500,\n\t* returnMetadata: true\n\t* })\n\t* ```\n\t*/\n\tasync listVectors(options = {}) {\n\t\tvar _superprop_getListVectors = () => super.listVectors, _this11 = this;\n\t\treturn _superprop_getListVectors().call(_this11, _objectSpread2(_objectSpread2({}, options), {}, {\n\t\t\tvectorBucketName: _this11.vectorBucketName,\n\t\t\tindexName: _this11.indexName\n\t\t}));\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Queries for similar vectors in this index\n\t* Convenience method that automatically includes bucket and index names\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Query options (bucket and index names automatically set)\n\t* @returns Promise with response containing matches array of similar vectors ordered by distance or error\n\t*\n\t* @example Query similar vectors\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t* const { data } = await index.queryVectors({\n\t* queryVector: { float32: [0.1, 0.2, ...] },\n\t* topK: 5,\n\t* filter: { category: 'technical' },\n\t* returnDistance: true,\n\t* returnMetadata: true\n\t* })\n\t* ```\n\t*/\n\tasync queryVectors(options) {\n\t\tvar _superprop_getQueryVectors = () => super.queryVectors, _this12 = this;\n\t\treturn _superprop_getQueryVectors().call(_this12, _objectSpread2(_objectSpread2({}, options), {}, {\n\t\t\tvectorBucketName: _this12.vectorBucketName,\n\t\t\tindexName: _this12.indexName\n\t\t}));\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Deletes vectors by keys from this index\n\t* Convenience method that automatically includes bucket and index names\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t* @param options - Deletion options (bucket and index names automatically set)\n\t* @returns Promise with empty response on success or error\n\t*\n\t* @example Delete vectors by keys\n\t* ```typescript\n\t* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\t* await index.deleteVectors({\n\t* keys: ['doc-1', 'doc-2', 'doc-3']\n\t* })\n\t* ```\n\t*/\n\tasync deleteVectors(options) {\n\t\tvar _superprop_getDeleteVectors = () => super.deleteVectors, _this13 = this;\n\t\treturn _superprop_getDeleteVectors().call(_this13, _objectSpread2(_objectSpread2({}, options), {}, {\n\t\t\tvectorBucketName: _this13.vectorBucketName,\n\t\t\tindexName: _this13.indexName\n\t\t}));\n\t}\n};\n\n//#endregion\n//#region src/StorageClient.ts\nvar StorageClient = class extends StorageBucketApi {\n\t/**\n\t* Creates a client for Storage buckets, files, analytics, and vectors.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t*\n\t* @example Using supabase-js (recommended)\n\t* ```ts\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* const avatars = supabase.storage.from('avatars')\n\t* ```\n\t*\n\t* @example Standalone import for bundle-sensitive environments\n\t* ```ts\n\t* import { StorageClient } from '@supabase/storage-js'\n\t*\n\t* const storage = new StorageClient('https://xyzcompany.supabase.co/storage/v1', {\n\t* apikey: 'your-publishable-key',\n\t* })\n\t* const avatars = storage.from('avatars')\n\t* ```\n\t*/\n\tconstructor(url, headers = {}, fetch$1, opts) {\n\t\tsuper(url, headers, fetch$1, opts);\n\t}\n\t/**\n\t* Perform file operation in a bucket.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t*\n\t* @param id The bucket id to operate on.\n\t*\n\t* @example Accessing a bucket\n\t* ```typescript\n\t* const avatars = supabase.storage.from('avatars')\n\t* ```\n\t*/\n\tfrom(id) {\n\t\treturn new StorageFileApi(this.url, this.headers, id, this.fetch);\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Access vector storage operations.\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Vector Buckets\n\t*\n\t* @returns A StorageVectorsClient instance configured with the current storage settings.\n\t*/\n\tget vectors() {\n\t\treturn new StorageVectorsClient(this.url + \"/vector\", {\n\t\t\theaders: this.headers,\n\t\t\tfetch: this.fetch\n\t\t});\n\t}\n\t/**\n\t*\n\t* @alpha\n\t*\n\t* Access analytics storage operations using Iceberg tables.\n\t*\n\t* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.\n\t*\n\t* @category Storage\n\t* @subcategory Analytics Buckets\n\t*\n\t* @returns A StorageAnalyticsClient instance configured with the current storage settings.\n\t*/\n\tget analytics() {\n\t\treturn new StorageAnalyticsClient(this.url + \"/iceberg\", this.headers, this.fetch);\n\t}\n};\n\n//#endregion\nexport { StorageAnalyticsClient, StorageApiError, StorageClient, StorageError, StorageUnknownError, StorageVectorsApiError, StorageVectorsClient, StorageVectorsError, StorageVectorsErrorCode, StorageVectorsUnknownError, VectorBucketApi, VectorBucketScope, VectorDataApi, VectorIndexApi, VectorIndexScope, isStorageError, isStorageVectorsError };\n//# sourceMappingURL=index.mjs.map","// Generated automatically during releases by scripts/update-version-files.ts\n// This file provides runtime access to the package version for:\n// - HTTP request headers (e.g., X-Client-Info header for API requests)\n// - Debugging and support (identifying which version is running)\n// - Telemetry and logging (version reporting in errors/analytics)\n// - Ensuring build artifacts match the published package version\nexport const version = '2.106.2';\n//# sourceMappingURL=version.js.map","import { version } from './version';\n/** Current session will be checked for refresh at this interval. */\nexport const AUTO_REFRESH_TICK_DURATION_MS = 30 * 1000;\n/**\n * A token refresh will be attempted this many ticks before the current session expires. */\nexport const AUTO_REFRESH_TICK_THRESHOLD = 3;\n/*\n * Earliest time before an access token expires that the session should be refreshed.\n */\nexport const EXPIRY_MARGIN_MS = AUTO_REFRESH_TICK_THRESHOLD * AUTO_REFRESH_TICK_DURATION_MS;\nexport const GOTRUE_URL = 'http://localhost:9999';\nexport const STORAGE_KEY = 'supabase.auth.token';\nexport const AUDIENCE = '';\nexport const DEFAULT_HEADERS = { 'X-Client-Info': `gotrue-js/${version}` };\nexport const NETWORK_FAILURE = {\n MAX_RETRIES: 10,\n RETRY_INTERVAL: 2, // in deciseconds\n};\nexport const API_VERSION_HEADER_NAME = 'X-Supabase-Api-Version';\nexport const API_VERSIONS = {\n '2024-01-01': {\n timestamp: Date.parse('2024-01-01T00:00:00.0Z'),\n name: '2024-01-01',\n },\n};\nexport const BASE64URL_REGEX = /^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;\nexport const JWKS_TTL = 10 * 60 * 1000; // 10 minutes\n//# sourceMappingURL=constants.js.map","/**\n * Base error thrown by Supabase Auth helpers.\n *\n * @example\n * ```ts\n * import { AuthError } from '@supabase/auth-js'\n *\n * throw new AuthError('Unexpected auth error', 500, 'unexpected')\n * ```\n */\nexport class AuthError extends Error {\n constructor(message, status, code) {\n super(message);\n this.__isAuthError = true;\n this.name = 'AuthError';\n this.status = status;\n this.code = code;\n }\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n status: this.status,\n code: this.code,\n };\n }\n}\nexport function isAuthError(error) {\n return typeof error === 'object' && error !== null && '__isAuthError' in error;\n}\n/**\n * Error returned directly from the GoTrue REST API.\n *\n * @example\n * ```ts\n * import { AuthApiError } from '@supabase/auth-js'\n *\n * throw new AuthApiError('Invalid credentials', 400, 'invalid_credentials')\n * ```\n */\nexport class AuthApiError extends AuthError {\n constructor(message, status, code) {\n super(message, status, code);\n this.name = 'AuthApiError';\n this.status = status;\n this.code = code;\n }\n}\nexport function isAuthApiError(error) {\n return isAuthError(error) && error.name === 'AuthApiError';\n}\n/**\n * Wraps non-standard errors so callers can inspect the root cause.\n *\n * @example\n * ```ts\n * import { AuthUnknownError } from '@supabase/auth-js'\n *\n * try {\n * await someAuthCall()\n * } catch (err) {\n * throw new AuthUnknownError('Auth failed', err)\n * }\n * ```\n */\nexport class AuthUnknownError extends AuthError {\n constructor(message, originalError) {\n super(message);\n this.name = 'AuthUnknownError';\n this.originalError = originalError;\n }\n}\n/**\n * Flexible error class used to create named auth errors at runtime.\n *\n * @example\n * ```ts\n * import { CustomAuthError } from '@supabase/auth-js'\n *\n * throw new CustomAuthError('My custom auth error', 'MyAuthError', 400, 'custom_code')\n * ```\n */\nexport class CustomAuthError extends AuthError {\n constructor(message, name, status, code) {\n super(message, status, code);\n this.name = name;\n this.status = status;\n }\n}\n/**\n * Error thrown when an operation requires a session but none is present.\n *\n * @example\n * ```ts\n * import { AuthSessionMissingError } from '@supabase/auth-js'\n *\n * throw new AuthSessionMissingError()\n * ```\n */\nexport class AuthSessionMissingError extends CustomAuthError {\n constructor() {\n super('Auth session missing!', 'AuthSessionMissingError', 400, undefined);\n }\n}\nexport function isAuthSessionMissingError(error) {\n return isAuthError(error) && error.name === 'AuthSessionMissingError';\n}\n/**\n * Error thrown when the token response is malformed.\n *\n * @example\n * ```ts\n * import { AuthInvalidTokenResponseError } from '@supabase/auth-js'\n *\n * throw new AuthInvalidTokenResponseError()\n * ```\n */\nexport class AuthInvalidTokenResponseError extends CustomAuthError {\n constructor() {\n super('Auth session or user missing', 'AuthInvalidTokenResponseError', 500, undefined);\n }\n}\n/**\n * Error thrown when email/password credentials are invalid.\n *\n * @example\n * ```ts\n * import { AuthInvalidCredentialsError } from '@supabase/auth-js'\n *\n * throw new AuthInvalidCredentialsError('Email or password is incorrect')\n * ```\n */\nexport class AuthInvalidCredentialsError extends CustomAuthError {\n constructor(message) {\n super(message, 'AuthInvalidCredentialsError', 400, undefined);\n }\n}\n/**\n * Error thrown when implicit grant redirects contain an error.\n *\n * @example\n * ```ts\n * import { AuthImplicitGrantRedirectError } from '@supabase/auth-js'\n *\n * throw new AuthImplicitGrantRedirectError('OAuth redirect failed', {\n * error: 'access_denied',\n * code: 'oauth_error',\n * })\n * ```\n */\nexport class AuthImplicitGrantRedirectError extends CustomAuthError {\n constructor(message, details = null) {\n super(message, 'AuthImplicitGrantRedirectError', 500, undefined);\n this.details = null;\n this.details = details;\n }\n toJSON() {\n return Object.assign(Object.assign({}, super.toJSON()), { details: this.details });\n }\n}\nexport function isAuthImplicitGrantRedirectError(error) {\n return isAuthError(error) && error.name === 'AuthImplicitGrantRedirectError';\n}\n/**\n * Error thrown during PKCE code exchanges.\n *\n * @example\n * ```ts\n * import { AuthPKCEGrantCodeExchangeError } from '@supabase/auth-js'\n *\n * throw new AuthPKCEGrantCodeExchangeError('PKCE exchange failed')\n * ```\n */\nexport class AuthPKCEGrantCodeExchangeError extends CustomAuthError {\n constructor(message, details = null) {\n super(message, 'AuthPKCEGrantCodeExchangeError', 500, undefined);\n this.details = null;\n this.details = details;\n }\n toJSON() {\n return Object.assign(Object.assign({}, super.toJSON()), { details: this.details });\n }\n}\n/**\n * Error thrown when the PKCE code verifier is not found in storage.\n * This typically happens when the auth flow was initiated in a different\n * browser, device, or the storage was cleared.\n *\n * @example\n * ```ts\n * import { AuthPKCECodeVerifierMissingError } from '@supabase/auth-js'\n *\n * throw new AuthPKCECodeVerifierMissingError()\n * ```\n */\nexport class AuthPKCECodeVerifierMissingError extends CustomAuthError {\n constructor() {\n super('PKCE code verifier not found in storage. ' +\n 'This can happen if the auth flow was initiated in a different browser or device, ' +\n 'or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), ' +\n 'use @supabase/ssr on both the server and client to store the code verifier in cookies.', 'AuthPKCECodeVerifierMissingError', 400, 'pkce_code_verifier_not_found');\n }\n}\nexport function isAuthPKCECodeVerifierMissingError(error) {\n return isAuthError(error) && error.name === 'AuthPKCECodeVerifierMissingError';\n}\n/**\n * Error thrown when a transient fetch issue occurs.\n *\n * @example\n * ```ts\n * import { AuthRetryableFetchError } from '@supabase/auth-js'\n *\n * throw new AuthRetryableFetchError('Service temporarily unavailable', 503)\n * ```\n */\nexport class AuthRetryableFetchError extends CustomAuthError {\n constructor(message, status) {\n super(message, 'AuthRetryableFetchError', status, undefined);\n }\n}\nexport function isAuthRetryableFetchError(error) {\n return isAuthError(error) && error.name === 'AuthRetryableFetchError';\n}\n/**\n * This error is thrown on certain methods when the password used is deemed\n * weak. Inspect the reasons to identify what password strength rules are\n * inadequate.\n */\n/**\n * Error thrown when a supplied password is considered weak.\n *\n * @example\n * ```ts\n * import { AuthWeakPasswordError } from '@supabase/auth-js'\n *\n * throw new AuthWeakPasswordError('Password too short', 400, ['min_length'])\n * ```\n */\nexport class AuthWeakPasswordError extends CustomAuthError {\n constructor(message, status, reasons) {\n super(message, 'AuthWeakPasswordError', status, 'weak_password');\n this.reasons = reasons;\n }\n toJSON() {\n return Object.assign(Object.assign({}, super.toJSON()), { reasons: this.reasons });\n }\n}\nexport function isAuthWeakPasswordError(error) {\n return isAuthError(error) && error.name === 'AuthWeakPasswordError';\n}\n/**\n * Error thrown when a JWT cannot be verified or parsed.\n *\n * @example\n * ```ts\n * import { AuthInvalidJwtError } from '@supabase/auth-js'\n *\n * throw new AuthInvalidJwtError('Token signature is invalid')\n * ```\n */\nexport class AuthInvalidJwtError extends CustomAuthError {\n constructor(message) {\n super(message, 'AuthInvalidJwtError', 400, 'invalid_jwt');\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Avoid modifying this file. It's part of\n * https://github.com/supabase-community/base64url-js. Submit all fixes on\n * that repo!\n */\n/**\n * An array of characters that encode 6 bits into a Base64-URL alphabet\n * character.\n */\nconst TO_BASE64URL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'.split('');\n/**\n * An array of characters that can appear in a Base64-URL encoded string but\n * should be ignored.\n */\nconst IGNORE_BASE64URL = ' \\t\\n\\r='.split('');\n/**\n * An array of 128 numbers that map a Base64-URL character to 6 bits, or if -2\n * used to skip the character, or if -1 used to error out.\n */\nconst FROM_BASE64URL = (() => {\n const charMap = new Array(128);\n for (let i = 0; i < charMap.length; i += 1) {\n charMap[i] = -1;\n }\n for (let i = 0; i < IGNORE_BASE64URL.length; i += 1) {\n charMap[IGNORE_BASE64URL[i].charCodeAt(0)] = -2;\n }\n for (let i = 0; i < TO_BASE64URL.length; i += 1) {\n charMap[TO_BASE64URL[i].charCodeAt(0)] = i;\n }\n return charMap;\n})();\n/**\n * Converts a byte to a Base64-URL string.\n *\n * @param byte The byte to convert, or null to flush at the end of the byte sequence.\n * @param state The Base64 conversion state. Pass an initial value of `{ queue: 0, queuedBits: 0 }`.\n * @param emit A function called with the next Base64 character when ready.\n */\nexport function byteToBase64URL(byte, state, emit) {\n if (byte !== null) {\n state.queue = (state.queue << 8) | byte;\n state.queuedBits += 8;\n while (state.queuedBits >= 6) {\n const pos = (state.queue >> (state.queuedBits - 6)) & 63;\n emit(TO_BASE64URL[pos]);\n state.queuedBits -= 6;\n }\n }\n else if (state.queuedBits > 0) {\n state.queue = state.queue << (6 - state.queuedBits);\n state.queuedBits = 6;\n while (state.queuedBits >= 6) {\n const pos = (state.queue >> (state.queuedBits - 6)) & 63;\n emit(TO_BASE64URL[pos]);\n state.queuedBits -= 6;\n }\n }\n}\n/**\n * Converts a String char code (extracted using `string.charCodeAt(position)`) to a sequence of Base64-URL characters.\n *\n * @param charCode The char code of the JavaScript string.\n * @param state The Base64 state. Pass an initial value of `{ queue: 0, queuedBits: 0 }`.\n * @param emit A function called with the next byte.\n */\nexport function byteFromBase64URL(charCode, state, emit) {\n const bits = FROM_BASE64URL[charCode];\n if (bits > -1) {\n // valid Base64-URL character\n state.queue = (state.queue << 6) | bits;\n state.queuedBits += 6;\n while (state.queuedBits >= 8) {\n emit((state.queue >> (state.queuedBits - 8)) & 0xff);\n state.queuedBits -= 8;\n }\n }\n else if (bits === -2) {\n // ignore spaces, tabs, newlines, =\n return;\n }\n else {\n throw new Error(`Invalid Base64-URL character \"${String.fromCharCode(charCode)}\"`);\n }\n}\n/**\n * Converts a JavaScript string (which may include any valid character) into a\n * Base64-URL encoded string. The string is first encoded in UTF-8 which is\n * then encoded as Base64-URL.\n *\n * @param str The string to convert.\n */\nexport function stringToBase64URL(str) {\n const base64 = [];\n const emitter = (char) => {\n base64.push(char);\n };\n const state = { queue: 0, queuedBits: 0 };\n stringToUTF8(str, (byte) => {\n byteToBase64URL(byte, state, emitter);\n });\n byteToBase64URL(null, state, emitter);\n return base64.join('');\n}\n/**\n * Converts a Base64-URL encoded string into a JavaScript string. It is assumed\n * that the underlying string has been encoded as UTF-8.\n *\n * @param str The Base64-URL encoded string.\n */\nexport function stringFromBase64URL(str) {\n const conv = [];\n const utf8Emit = (codepoint) => {\n conv.push(String.fromCodePoint(codepoint));\n };\n const utf8State = {\n utf8seq: 0,\n codepoint: 0,\n };\n const b64State = { queue: 0, queuedBits: 0 };\n const byteEmit = (byte) => {\n stringFromUTF8(byte, utf8State, utf8Emit);\n };\n for (let i = 0; i < str.length; i += 1) {\n byteFromBase64URL(str.charCodeAt(i), b64State, byteEmit);\n }\n return conv.join('');\n}\n/**\n * Converts a Unicode codepoint to a multi-byte UTF-8 sequence.\n *\n * @param codepoint The Unicode codepoint.\n * @param emit Function which will be called for each UTF-8 byte that represents the codepoint.\n */\nexport function codepointToUTF8(codepoint, emit) {\n if (codepoint <= 0x7f) {\n emit(codepoint);\n return;\n }\n else if (codepoint <= 0x7ff) {\n emit(0xc0 | (codepoint >> 6));\n emit(0x80 | (codepoint & 0x3f));\n return;\n }\n else if (codepoint <= 0xffff) {\n emit(0xe0 | (codepoint >> 12));\n emit(0x80 | ((codepoint >> 6) & 0x3f));\n emit(0x80 | (codepoint & 0x3f));\n return;\n }\n else if (codepoint <= 0x10ffff) {\n emit(0xf0 | (codepoint >> 18));\n emit(0x80 | ((codepoint >> 12) & 0x3f));\n emit(0x80 | ((codepoint >> 6) & 0x3f));\n emit(0x80 | (codepoint & 0x3f));\n return;\n }\n throw new Error(`Unrecognized Unicode codepoint: ${codepoint.toString(16)}`);\n}\n/**\n * Converts a JavaScript string to a sequence of UTF-8 bytes.\n *\n * @param str The string to convert to UTF-8.\n * @param emit Function which will be called for each UTF-8 byte of the string.\n */\nexport function stringToUTF8(str, emit) {\n for (let i = 0; i < str.length; i += 1) {\n let codepoint = str.charCodeAt(i);\n if (codepoint > 0xd7ff && codepoint <= 0xdbff) {\n // most UTF-16 codepoints are Unicode codepoints, except values in this\n // range where the next UTF-16 codepoint needs to be combined with the\n // current one to get the Unicode codepoint\n const highSurrogate = ((codepoint - 0xd800) * 0x400) & 0xffff;\n const lowSurrogate = (str.charCodeAt(i + 1) - 0xdc00) & 0xffff;\n codepoint = (lowSurrogate | highSurrogate) + 0x10000;\n i += 1;\n }\n codepointToUTF8(codepoint, emit);\n }\n}\n/**\n * Converts a UTF-8 byte to a Unicode codepoint.\n *\n * @param byte The UTF-8 byte next in the sequence.\n * @param state The shared state between consecutive UTF-8 bytes in the\n * sequence, an object with the shape `{ utf8seq: 0, codepoint: 0 }`.\n * @param emit Function which will be called for each codepoint.\n */\nexport function stringFromUTF8(byte, state, emit) {\n if (state.utf8seq === 0) {\n if (byte <= 0x7f) {\n emit(byte);\n return;\n }\n // count the number of 1 leading bits until you reach 0\n for (let leadingBit = 1; leadingBit < 6; leadingBit += 1) {\n if (((byte >> (7 - leadingBit)) & 1) === 0) {\n state.utf8seq = leadingBit;\n break;\n }\n }\n if (state.utf8seq === 2) {\n state.codepoint = byte & 31;\n }\n else if (state.utf8seq === 3) {\n state.codepoint = byte & 15;\n }\n else if (state.utf8seq === 4) {\n state.codepoint = byte & 7;\n }\n else {\n throw new Error('Invalid UTF-8 sequence');\n }\n state.utf8seq -= 1;\n }\n else if (state.utf8seq > 0) {\n if (byte <= 0x7f) {\n throw new Error('Invalid UTF-8 sequence');\n }\n state.codepoint = (state.codepoint << 6) | (byte & 63);\n state.utf8seq -= 1;\n if (state.utf8seq === 0) {\n emit(state.codepoint);\n }\n }\n}\n/**\n * Helper functions to convert different types of strings to Uint8Array\n */\nexport function base64UrlToUint8Array(str) {\n const result = [];\n const state = { queue: 0, queuedBits: 0 };\n const onByte = (byte) => {\n result.push(byte);\n };\n for (let i = 0; i < str.length; i += 1) {\n byteFromBase64URL(str.charCodeAt(i), state, onByte);\n }\n return new Uint8Array(result);\n}\nexport function stringToUint8Array(str) {\n const result = [];\n stringToUTF8(str, (byte) => result.push(byte));\n return new Uint8Array(result);\n}\nexport function bytesToBase64URL(bytes) {\n const result = [];\n const state = { queue: 0, queuedBits: 0 };\n const onChar = (char) => {\n result.push(char);\n };\n bytes.forEach((byte) => byteToBase64URL(byte, state, onChar));\n // always call with `null` after processing all bytes\n byteToBase64URL(null, state, onChar);\n return result.join('');\n}\n//# sourceMappingURL=base64url.js.map","import { API_VERSION_HEADER_NAME, BASE64URL_REGEX } from './constants';\nimport { AuthInvalidJwtError } from './errors';\nimport { base64UrlToUint8Array, stringFromBase64URL } from './base64url';\nexport function expiresAt(expiresIn) {\n const timeNow = Math.round(Date.now() / 1000);\n return timeNow + expiresIn;\n}\n/**\n * Generates a unique identifier for internal callback subscriptions.\n *\n * This function uses JavaScript Symbols to create guaranteed-unique identifiers\n * for auth state change callbacks. Symbols are ideal for this use case because:\n * - They are guaranteed unique by the JavaScript runtime\n * - They work in all environments (browser, SSR, Node.js)\n * - They avoid issues with Next.js 16 deterministic rendering requirements\n * - They are perfect for internal, non-serializable identifiers\n *\n * Note: This function is only used for internal subscription management,\n * not for security-critical operations like session tokens.\n */\nexport function generateCallbackId() {\n return Symbol('auth-callback');\n}\nexport const isBrowser = () => typeof window !== 'undefined' && typeof document !== 'undefined';\nconst localStorageWriteTests = {\n tested: false,\n writable: false,\n};\n/**\n * Checks whether localStorage is supported on this browser.\n */\nexport const supportsLocalStorage = () => {\n if (!isBrowser()) {\n return false;\n }\n try {\n if (typeof globalThis.localStorage !== 'object') {\n return false;\n }\n }\n catch (e) {\n // DOM exception when accessing `localStorage`\n return false;\n }\n if (localStorageWriteTests.tested) {\n return localStorageWriteTests.writable;\n }\n const randomKey = `lswt-${Math.random()}${Math.random()}`;\n try {\n globalThis.localStorage.setItem(randomKey, randomKey);\n globalThis.localStorage.removeItem(randomKey);\n localStorageWriteTests.tested = true;\n localStorageWriteTests.writable = true;\n }\n catch (e) {\n // localStorage can't be written to\n // https://www.chromium.org/for-testers/bug-reporting-guidelines/uncaught-securityerror-failed-to-read-the-localstorage-property-from-window-access-is-denied-for-this-document\n localStorageWriteTests.tested = true;\n localStorageWriteTests.writable = false;\n }\n return localStorageWriteTests.writable;\n};\n/**\n * Extracts parameters encoded in the URL both in the query and fragment.\n */\nexport function parseParametersFromURL(href) {\n const result = {};\n const url = new URL(href);\n if (url.hash && url.hash[0] === '#') {\n try {\n const hashSearchParams = new URLSearchParams(url.hash.substring(1));\n hashSearchParams.forEach((value, key) => {\n result[key] = value;\n });\n }\n catch (_e) {\n // hash is not a query string\n }\n }\n // search parameters take precedence over hash parameters\n url.searchParams.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n}\nexport const resolveFetch = (customFetch) => {\n if (customFetch) {\n return (...args) => customFetch(...args);\n }\n return (...args) => fetch(...args);\n};\nexport const looksLikeFetchResponse = (maybeResponse) => {\n return (typeof maybeResponse === 'object' &&\n maybeResponse !== null &&\n 'status' in maybeResponse &&\n 'ok' in maybeResponse &&\n 'json' in maybeResponse &&\n typeof maybeResponse.json === 'function');\n};\n// Storage helpers\nexport const setItemAsync = async (storage, key, data) => {\n await storage.setItem(key, JSON.stringify(data));\n};\nexport const getItemAsync = async (storage, key) => {\n const value = await storage.getItem(key);\n if (!value) {\n return null;\n }\n try {\n return JSON.parse(value);\n }\n catch (_a) {\n // Storage values are always written as JSON via setItemAsync. A non-JSON\n // value means the entry is corrupted (e.g. mismatched chunked cookies in\n // SSR contexts). Treat as absent so callers do not mutate or re-save the\n // garbage, which would otherwise trigger a TypeError downstream and\n // leak the raw value into error logs.\n return null;\n }\n};\nexport const removeItemAsync = async (storage, key) => {\n await storage.removeItem(key);\n};\n/**\n * A deferred represents some asynchronous work that is not yet finished, which\n * may or may not culminate in a value.\n * Taken from: https://github.com/mike-north/types/blob/master/src/async.ts\n */\nexport class Deferred {\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-extra-semi\n ;\n this.promise = new Deferred.promiseConstructor((res, rej) => {\n // eslint-disable-next-line @typescript-eslint/no-extra-semi\n ;\n this.resolve = res;\n this.reject = rej;\n });\n }\n}\nDeferred.promiseConstructor = Promise;\nexport function decodeJWT(token) {\n const parts = token.split('.');\n if (parts.length !== 3) {\n throw new AuthInvalidJwtError('Invalid JWT structure');\n }\n // Regex checks for base64url format\n for (let i = 0; i < parts.length; i++) {\n if (!BASE64URL_REGEX.test(parts[i])) {\n throw new AuthInvalidJwtError('JWT not in base64url format');\n }\n }\n const data = {\n // using base64url lib\n header: JSON.parse(stringFromBase64URL(parts[0])),\n payload: JSON.parse(stringFromBase64URL(parts[1])),\n signature: base64UrlToUint8Array(parts[2]),\n raw: {\n header: parts[0],\n payload: parts[1],\n },\n };\n return data;\n}\n/**\n * Creates a promise that resolves to null after some time.\n */\nexport async function sleep(time) {\n return await new Promise((accept) => {\n setTimeout(() => accept(null), time);\n });\n}\n/**\n * Converts the provided async function into a retryable function. Each result\n * or thrown error is sent to the isRetryable function which should return true\n * if the function should run again.\n */\nexport function retryable(fn, isRetryable) {\n const promise = new Promise((accept, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-extra-semi\n ;\n (async () => {\n for (let attempt = 0; attempt < Infinity; attempt++) {\n try {\n const result = await fn(attempt);\n if (!isRetryable(attempt, null, result)) {\n accept(result);\n return;\n }\n }\n catch (e) {\n if (!isRetryable(attempt, e)) {\n reject(e);\n return;\n }\n }\n }\n })();\n });\n return promise;\n}\nfunction dec2hex(dec) {\n return ('0' + dec.toString(16)).substr(-2);\n}\n// Functions below taken from: https://stackoverflow.com/questions/63309409/creating-a-code-verifier-and-challenge-for-pkce-auth-on-spotify-api-in-reactjs\nexport function generatePKCEVerifier() {\n const verifierLength = 56;\n const array = new Uint32Array(verifierLength);\n if (typeof crypto === 'undefined') {\n const charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n const charSetLen = charSet.length;\n let verifier = '';\n for (let i = 0; i < verifierLength; i++) {\n verifier += charSet.charAt(Math.floor(Math.random() * charSetLen));\n }\n return verifier;\n }\n crypto.getRandomValues(array);\n return Array.from(array, dec2hex).join('');\n}\nasync function sha256(randomString) {\n const encoder = new TextEncoder();\n const encodedData = encoder.encode(randomString);\n const hash = await crypto.subtle.digest('SHA-256', encodedData);\n const bytes = new Uint8Array(hash);\n return Array.from(bytes)\n .map((c) => String.fromCharCode(c))\n .join('');\n}\nexport async function generatePKCEChallenge(verifier) {\n const hasCryptoSupport = typeof crypto !== 'undefined' &&\n typeof crypto.subtle !== 'undefined' &&\n typeof TextEncoder !== 'undefined';\n if (!hasCryptoSupport) {\n console.warn('WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.');\n return verifier;\n }\n const hashed = await sha256(verifier);\n return btoa(hashed).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nexport async function getCodeChallengeAndMethod(storage, storageKey, isPasswordRecovery = false) {\n const codeVerifier = generatePKCEVerifier();\n let storedCodeVerifier = codeVerifier;\n if (isPasswordRecovery) {\n storedCodeVerifier += '/recovery';\n }\n await setItemAsync(storage, `${storageKey}-code-verifier`, storedCodeVerifier);\n const codeChallenge = await generatePKCEChallenge(codeVerifier);\n const codeChallengeMethod = codeVerifier === codeChallenge ? 'plain' : 's256';\n return [codeChallenge, codeChallengeMethod];\n}\n/** Parses the API version which is 2YYY-MM-DD. */\nconst API_VERSION_REGEX = /^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;\nexport function parseResponseAPIVersion(response) {\n const apiVersion = response.headers.get(API_VERSION_HEADER_NAME);\n if (!apiVersion) {\n return null;\n }\n if (!apiVersion.match(API_VERSION_REGEX)) {\n return null;\n }\n try {\n const date = new Date(`${apiVersion}T00:00:00.0Z`);\n return date;\n }\n catch (_e) {\n return null;\n }\n}\nexport function validateExp(exp) {\n if (!exp) {\n throw new Error('Missing exp claim');\n }\n const timeNow = Math.floor(Date.now() / 1000);\n if (exp <= timeNow) {\n throw new Error('JWT has expired');\n }\n}\nexport function getAlgorithm(alg) {\n switch (alg) {\n case 'RS256':\n return {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n case 'ES256':\n return {\n name: 'ECDSA',\n namedCurve: 'P-256',\n hash: { name: 'SHA-256' },\n };\n default:\n throw new Error('Invalid alg claim');\n }\n}\nconst UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\nexport function validateUUID(str) {\n if (!UUID_REGEX.test(str)) {\n throw new Error('@supabase/auth-js: Expected parameter to be UUID but is not');\n }\n}\nexport function assertPasskeyExperimentalEnabled(experimental) {\n if (!experimental.passkey) {\n throw new Error('@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).');\n }\n}\nexport function userNotAvailableProxy() {\n const proxyTarget = {};\n return new Proxy(proxyTarget, {\n get: (target, prop) => {\n if (prop === '__isUserNotAvailableProxy') {\n return true;\n }\n // Preventative check for common problematic symbols during cloning/inspection\n // These symbols might be accessed by structuredClone or other internal mechanisms.\n if (typeof prop === 'symbol') {\n const sProp = prop.toString();\n if (sProp === 'Symbol(Symbol.toPrimitive)' ||\n sProp === 'Symbol(Symbol.toStringTag)' ||\n sProp === 'Symbol(util.inspect.custom)') {\n // Node.js util.inspect\n return undefined;\n }\n }\n throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the \"${prop}\" property of the session object is not supported. Please use getUser() instead.`);\n },\n set: (_target, prop) => {\n throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the \"${prop}\" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`);\n },\n deleteProperty: (_target, prop) => {\n throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the \"${prop}\" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`);\n },\n });\n}\n/**\n * Creates a proxy around a user object that warns when properties are accessed on the server.\n * This is used to alert developers that using user data from getSession() on the server is insecure.\n *\n * @param user The actual user object to wrap\n * @param suppressWarningRef An object with a 'value' property that controls warning suppression\n * @returns A proxied user object that warns on property access\n */\nexport function insecureUserWarningProxy(user, suppressWarningRef) {\n return new Proxy(user, {\n get: (target, prop, receiver) => {\n // Allow internal checks without warning\n if (prop === '__isInsecureUserWarningProxy') {\n return true;\n }\n // Preventative check for common problematic symbols during cloning/inspection\n // These symbols might be accessed by structuredClone or other internal mechanisms\n if (typeof prop === 'symbol') {\n const sProp = prop.toString();\n if (sProp === 'Symbol(Symbol.toPrimitive)' ||\n sProp === 'Symbol(Symbol.toStringTag)' ||\n sProp === 'Symbol(util.inspect.custom)' ||\n sProp === 'Symbol(nodejs.util.inspect.custom)') {\n // Return the actual value for these symbols to allow proper inspection\n return Reflect.get(target, prop, receiver);\n }\n }\n // Emit warning on first property access\n if (!suppressWarningRef.value && typeof prop === 'string') {\n console.warn('Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.');\n suppressWarningRef.value = true;\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n/**\n * Deep clones a JSON-serializable object using JSON.parse(JSON.stringify(obj)).\n * Note: Only works for JSON-safe data.\n */\nexport function deepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n//# sourceMappingURL=helpers.js.map","import { __rest } from \"tslib\";\nimport { API_VERSIONS, API_VERSION_HEADER_NAME } from './constants';\nimport { expiresAt, looksLikeFetchResponse, parseResponseAPIVersion } from './helpers';\nimport { AuthApiError, AuthRetryableFetchError, AuthWeakPasswordError, AuthUnknownError, AuthSessionMissingError, } from './errors';\nconst _getErrorMessage = (err) => {\n if (typeof err === 'object' && err !== null) {\n const e = err;\n if (typeof e.msg === 'string')\n return e.msg;\n if (typeof e.message === 'string')\n return e.message;\n if (typeof e.error_description === 'string')\n return e.error_description;\n if (typeof e.error === 'string')\n return e.error;\n }\n return JSON.stringify(err);\n};\n// 502, 503, 504: Standard server/gateway errors\n// 520-524, 530: Cloudflare-specific error codes (web server down, connection timed out, etc.)\n// These are infrastructure errors and should not cause session invalidation.\nconst NETWORK_ERROR_CODES = [502, 503, 504, 520, 521, 522, 523, 524, 530];\nexport async function handleError(error) {\n var _a;\n if (!looksLikeFetchResponse(error)) {\n throw new AuthRetryableFetchError(_getErrorMessage(error), 0);\n }\n if (NETWORK_ERROR_CODES.includes(error.status)) {\n // status in 500...599 range - server had an error, request might be retryed.\n throw new AuthRetryableFetchError(_getErrorMessage(error), error.status);\n }\n let data;\n try {\n data = await error.json();\n }\n catch (e) {\n throw new AuthUnknownError(_getErrorMessage(e), e);\n }\n let errorCode = undefined;\n const responseAPIVersion = parseResponseAPIVersion(error);\n if (responseAPIVersion &&\n responseAPIVersion.getTime() >= API_VERSIONS['2024-01-01'].timestamp &&\n typeof data === 'object' &&\n data &&\n typeof data.code === 'string') {\n errorCode = data.code;\n }\n else if (typeof data === 'object' && data && typeof data.error_code === 'string') {\n errorCode = data.error_code;\n }\n if (!errorCode) {\n // Legacy support for weak password errors, when there were no error codes\n if (typeof data === 'object' &&\n data &&\n typeof data.weak_password === 'object' &&\n data.weak_password &&\n Array.isArray(data.weak_password.reasons) &&\n data.weak_password.reasons.length &&\n data.weak_password.reasons.reduce((a, i) => a && typeof i === 'string', true)) {\n throw new AuthWeakPasswordError(_getErrorMessage(data), error.status, data.weak_password.reasons);\n }\n }\n else if (errorCode === 'weak_password') {\n throw new AuthWeakPasswordError(_getErrorMessage(data), error.status, ((_a = data.weak_password) === null || _a === void 0 ? void 0 : _a.reasons) || []);\n }\n else if (errorCode === 'session_not_found') {\n // The `session_id` inside the JWT does not correspond to a row in the\n // `sessions` table. This usually means the user has signed out, has been\n // deleted, or their session has somehow been terminated.\n throw new AuthSessionMissingError();\n }\n throw new AuthApiError(_getErrorMessage(data), error.status || 500, errorCode);\n}\nconst _getRequestParams = (method, options, parameters, body) => {\n const params = { method, headers: (options === null || options === void 0 ? void 0 : options.headers) || {} };\n if (method === 'GET') {\n return params;\n }\n params.headers = Object.assign({ 'Content-Type': 'application/json;charset=UTF-8' }, options === null || options === void 0 ? void 0 : options.headers);\n params.body = JSON.stringify(body);\n return Object.assign(Object.assign({}, params), parameters);\n};\nexport async function _request(fetcher, method, url, options) {\n var _a;\n const headers = Object.assign({}, options === null || options === void 0 ? void 0 : options.headers);\n if (!headers[API_VERSION_HEADER_NAME]) {\n headers[API_VERSION_HEADER_NAME] = API_VERSIONS['2024-01-01'].name;\n }\n if (options === null || options === void 0 ? void 0 : options.jwt) {\n headers['Authorization'] = `Bearer ${options.jwt}`;\n }\n const qs = (_a = options === null || options === void 0 ? void 0 : options.query) !== null && _a !== void 0 ? _a : {};\n if (options === null || options === void 0 ? void 0 : options.redirectTo) {\n qs['redirect_to'] = options.redirectTo;\n }\n const queryString = Object.keys(qs).length ? '?' + new URLSearchParams(qs).toString() : '';\n const data = await _handleRequest(fetcher, method, url + queryString, {\n headers,\n noResolveJson: options === null || options === void 0 ? void 0 : options.noResolveJson,\n }, {}, options === null || options === void 0 ? void 0 : options.body);\n return (options === null || options === void 0 ? void 0 : options.xform) ? options === null || options === void 0 ? void 0 : options.xform(data) : { data: Object.assign({}, data), error: null };\n}\nasync function _handleRequest(fetcher, method, url, options, parameters, body) {\n const requestParams = _getRequestParams(method, options, parameters, body);\n let result;\n try {\n result = await fetcher(url, Object.assign({}, requestParams));\n }\n catch (e) {\n console.error(e);\n // fetch failed, likely due to a network or CORS error\n throw new AuthRetryableFetchError(_getErrorMessage(e), 0);\n }\n if (!result.ok) {\n await handleError(result);\n }\n if (options === null || options === void 0 ? void 0 : options.noResolveJson) {\n return result;\n }\n try {\n return await result.json();\n }\n catch (e) {\n await handleError(e);\n }\n}\nexport function _sessionResponse(data) {\n var _a;\n let session = null;\n if (hasSession(data)) {\n session = Object.assign({}, data);\n if (!data.expires_at) {\n session.expires_at = expiresAt(data.expires_in);\n }\n }\n // Some /verify responses (e.g. secure email_change first-confirmation) return\n // only `{ msg, code }` with no user and no session. Treat those as null user.\n const user = (_a = data.user) !== null && _a !== void 0 ? _a : (typeof (data === null || data === void 0 ? void 0 : data.id) === 'string' ? data : null);\n return { data: { session, user }, error: null };\n}\nexport function _sessionResponsePassword(data) {\n const response = _sessionResponse(data);\n if (!response.error &&\n data.weak_password &&\n typeof data.weak_password === 'object' &&\n Array.isArray(data.weak_password.reasons) &&\n data.weak_password.reasons.length &&\n data.weak_password.message &&\n typeof data.weak_password.message === 'string' &&\n data.weak_password.reasons.reduce((a, i) => a && typeof i === 'string', true)) {\n response.data.weak_password = data.weak_password;\n }\n return response;\n}\nexport function _userResponse(data) {\n var _a;\n const user = (_a = data.user) !== null && _a !== void 0 ? _a : data;\n return { data: { user }, error: null };\n}\nexport function _ssoResponse(data) {\n return { data, error: null };\n}\nexport function _generateLinkResponse(data) {\n const { action_link, email_otp, hashed_token, redirect_to, verification_type } = data, rest = __rest(data, [\"action_link\", \"email_otp\", \"hashed_token\", \"redirect_to\", \"verification_type\"]);\n const properties = {\n action_link,\n email_otp,\n hashed_token,\n redirect_to,\n verification_type,\n };\n const user = Object.assign({}, rest);\n return {\n data: {\n properties,\n user,\n },\n error: null,\n };\n}\nexport function _noResolveJsonResponse(data) {\n return data;\n}\n/**\n * hasSession checks if the response object contains a valid session\n * @param data A response object\n * @returns true if a session is in the response\n */\nfunction hasSession(data) {\n return !!data.access_token && !!data.refresh_token && !!data.expires_in;\n}\n//# sourceMappingURL=fetch.js.map","const WeakPasswordReasons = ['length', 'characters', 'pwned'];\nconst AMRMethods = [\n 'password',\n 'otp',\n 'oauth',\n 'totp',\n 'mfa/totp',\n 'mfa/phone',\n 'mfa/webauthn',\n 'anonymous',\n 'sso/saml',\n 'magiclink',\n 'web3',\n 'oauth_provider/authorization_code',\n];\nconst FactorTypes = ['totp', 'phone', 'webauthn'];\nconst FactorVerificationStatuses = ['verified', 'unverified'];\nconst MFATOTPChannels = ['sms', 'whatsapp'];\nexport const SIGN_OUT_SCOPES = ['global', 'local', 'others'];\n//# sourceMappingURL=types.js.map","import { __rest } from \"tslib\";\nimport { _generateLinkResponse, _noResolveJsonResponse, _request, _userResponse, } from './lib/fetch';\nimport { assertPasskeyExperimentalEnabled, resolveFetch, validateUUID } from './lib/helpers';\nimport { SIGN_OUT_SCOPES, } from './lib/types';\nimport { AuthError, isAuthError } from './lib/errors';\nexport default class GoTrueAdminApi {\n _encodePathSegment(segment) {\n if (segment === '.' || segment === '..') {\n throw new AuthError('Invalid path segment');\n }\n return encodeURIComponent(segment);\n }\n /**\n * Creates an admin API client that can be used to manage users and OAuth clients.\n *\n * @example Using supabase-js (recommended)\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-secret-key')\n * const { data, error } = await supabase.auth.admin.listUsers()\n * ```\n *\n * @example Standalone import for bundle-sensitive environments\n * ```ts\n * import { GoTrueAdminApi } from '@supabase/auth-js'\n *\n * const admin = new GoTrueAdminApi({\n * url: 'https://xyzcompany.supabase.co/auth/v1',\n * headers: { Authorization: `Bearer ${process.env.SUPABASE_SECRET_KEY}` },\n * })\n * ```\n */\n constructor({ url = '', headers = {}, fetch, experimental, }) {\n this.url = url;\n this.headers = headers;\n this.fetch = resolveFetch(fetch);\n this.experimental = experimental !== null && experimental !== void 0 ? experimental : {};\n this.mfa = {\n listFactors: this._listFactors.bind(this),\n deleteFactor: this._deleteFactor.bind(this),\n };\n this.oauth = {\n listClients: this._listOAuthClients.bind(this),\n createClient: this._createOAuthClient.bind(this),\n getClient: this._getOAuthClient.bind(this),\n updateClient: this._updateOAuthClient.bind(this),\n deleteClient: this._deleteOAuthClient.bind(this),\n regenerateClientSecret: this._regenerateOAuthClientSecret.bind(this),\n };\n this.customProviders = {\n listProviders: this._listCustomProviders.bind(this),\n createProvider: this._createCustomProvider.bind(this),\n getProvider: this._getCustomProvider.bind(this),\n updateProvider: this._updateCustomProvider.bind(this),\n deleteProvider: this._deleteCustomProvider.bind(this),\n };\n this.passkey = {\n listPasskeys: this._adminListPasskeys.bind(this),\n deletePasskey: this._adminDeletePasskey.bind(this),\n };\n }\n /**\n * Removes a logged-in session.\n * @param jwt A valid, logged-in JWT.\n * @param scope The logout sope.\n *\n * @category Auth\n * @subcategory Auth Admin\n */\n async signOut(jwt, scope = SIGN_OUT_SCOPES[0]) {\n if (SIGN_OUT_SCOPES.indexOf(scope) < 0) {\n throw new Error(`@supabase/auth-js: Parameter scope must be one of ${SIGN_OUT_SCOPES.join(', ')}`);\n }\n try {\n await _request(this.fetch, 'POST', `${this.url}/logout?scope=${scope}`, {\n headers: this.headers,\n jwt,\n noResolveJson: true,\n });\n return { data: null, error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Sends an invite link to an email address.\n * @param email The email address of the user.\n * @param options Additional options to be included when inviting.\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @remarks\n * - Sends an invite link to the user's email address.\n * - The `inviteUserByEmail()` method is typically used by administrators to invite users to join the application.\n * - Note that PKCE is not supported when using `inviteUserByEmail`. This is because the browser initiating the invite is often different from the browser accepting the invite which makes it difficult to provide the security guarantees required of the PKCE flow.\n *\n * @example Invite a user\n * ```js\n * const { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com')\n * ```\n *\n * @exampleResponse Invite a user\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"invited_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {},\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * },\n * \"error\": null\n * }\n * ```\n */\n async inviteUserByEmail(email, options = {}) {\n try {\n return await _request(this.fetch, 'POST', `${this.url}/invite`, {\n body: { email, data: options.data },\n headers: this.headers,\n redirectTo: options.redirectTo,\n xform: _userResponse,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { user: null }, error };\n }\n throw error;\n }\n }\n /**\n * Generates email links and OTPs to be sent via a custom email provider.\n * @param email The user's email.\n * @param options.password User password. For signup only.\n * @param options.data Optional user metadata. For signup only.\n * @param options.redirectTo The redirect url which should be appended to the generated link\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @remarks\n * - The following types can be passed into `generateLink()`: `signup`, `magiclink`, `invite`, `recovery`, `email_change_current`, `email_change_new`, `phone_change`.\n * - `generateLink()` only generates the email link for `email_change_email` if the **Secure email change** is enabled in your project's [email auth provider settings](/dashboard/project/_/auth/providers).\n * - `generateLink()` handles the creation of the user for `signup`, `invite` and `magiclink`.\n *\n * @example Generate a signup link\n * ```js\n * const { data, error } = await supabase.auth.admin.generateLink({\n * type: 'signup',\n * email: 'email@example.com',\n * password: 'secret'\n * })\n * ```\n *\n * @exampleResponse Generate a signup link\n * ```json\n * {\n * \"data\": {\n * \"properties\": {\n * \"action_link\": \"<LINK_TO_SEND_TO_USER>\",\n * \"email_otp\": \"999999\",\n * \"hashed_token\": \"<HASHED_TOKEN\",\n * \"redirect_to\": \"<REDIRECT_URL>\",\n * \"verification_type\": \"signup\"\n * },\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"email@example.com\",\n * \"phone\": \"\",\n * \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {},\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"email@example.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"email@example.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Generate an invite link\n * ```js\n * const { data, error } = await supabase.auth.admin.generateLink({\n * type: 'invite',\n * email: 'email@example.com'\n * })\n * ```\n *\n * @example Generate a magic link\n * ```js\n * const { data, error } = await supabase.auth.admin.generateLink({\n * type: 'magiclink',\n * email: 'email@example.com'\n * })\n * ```\n *\n * @example Generate a recovery link\n * ```js\n * const { data, error } = await supabase.auth.admin.generateLink({\n * type: 'recovery',\n * email: 'email@example.com'\n * })\n * ```\n *\n * @example Generate links to change current email address\n * ```js\n * // generate an email change link to be sent to the current email address\n * const { data, error } = await supabase.auth.admin.generateLink({\n * type: 'email_change_current',\n * email: 'current.email@example.com',\n * newEmail: 'new.email@example.com'\n * })\n *\n * // generate an email change link to be sent to the new email address\n * const { data, error } = await supabase.auth.admin.generateLink({\n * type: 'email_change_new',\n * email: 'current.email@example.com',\n * newEmail: 'new.email@example.com'\n * })\n * ```\n */\n async generateLink(params) {\n try {\n const { options } = params, rest = __rest(params, [\"options\"]);\n const body = Object.assign(Object.assign({}, rest), options);\n if ('newEmail' in rest) {\n // replace newEmail with new_email in request body\n body.new_email = rest === null || rest === void 0 ? void 0 : rest.newEmail;\n delete body['newEmail'];\n }\n return await _request(this.fetch, 'POST', `${this.url}/admin/generate_link`, {\n body: body,\n headers: this.headers,\n xform: _generateLinkResponse,\n redirectTo: options === null || options === void 0 ? void 0 : options.redirectTo,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return {\n data: {\n properties: null,\n user: null,\n },\n error,\n };\n }\n throw error;\n }\n }\n // User Admin API\n /**\n * Creates a new user.\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @remarks\n * - To confirm the user's email address or phone number, set `email_confirm` or `phone_confirm` to true. Both arguments default to false.\n * - `createUser()` will not send a confirmation email to the user. You can use [`inviteUserByEmail()`](/docs/reference/javascript/auth-admin-inviteuserbyemail) if you want to send them an email invite instead.\n * - If you are sure that the created user's email or phone number is legitimate and verified, you can set the `email_confirm` or `phone_confirm` param to `true`.\n *\n * @example With custom user metadata\n * ```js\n * const { data, error } = await supabase.auth.admin.createUser({\n * email: 'user@email.com',\n * password: 'password',\n * user_metadata: { name: 'Yoda' }\n * })\n * ```\n *\n * @exampleResponse With custom user metadata\n * ```json\n * {\n * data: {\n * user: {\n * id: '1',\n * aud: 'authenticated',\n * role: 'authenticated',\n * email: 'example@email.com',\n * email_confirmed_at: '2024-01-01T00:00:00Z',\n * phone: '',\n * confirmation_sent_at: '2024-01-01T00:00:00Z',\n * confirmed_at: '2024-01-01T00:00:00Z',\n * last_sign_in_at: '2024-01-01T00:00:00Z',\n * app_metadata: {},\n * user_metadata: {},\n * identities: [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"1\",\n * \"user_id\": \"1\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": true,\n * \"phone_verified\": false,\n * \"sub\": \"1\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"email@example.com\"\n * },\n * ],\n * created_at: '2024-01-01T00:00:00Z',\n * updated_at: '2024-01-01T00:00:00Z',\n * is_anonymous: false,\n * }\n * }\n * error: null\n * }\n * ```\n *\n * @example Auto-confirm the user's email\n * ```js\n * const { data, error } = await supabase.auth.admin.createUser({\n * email: 'user@email.com',\n * email_confirm: true\n * })\n * ```\n *\n * @example Auto-confirm the user's phone number\n * ```js\n * const { data, error } = await supabase.auth.admin.createUser({\n * phone: '1234567890',\n * phone_confirm: true\n * })\n * ```\n */\n async createUser(attributes) {\n try {\n return await _request(this.fetch, 'POST', `${this.url}/admin/users`, {\n body: attributes,\n headers: this.headers,\n xform: _userResponse,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { user: null }, error };\n }\n throw error;\n }\n }\n /**\n * Get a list of users.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n * @param params An object which supports `page` and `perPage` as numbers, to alter the paginated results.\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @remarks\n * - Defaults to return 50 users per page.\n *\n * @example Get a page of users\n * ```js\n * const { data: { users }, error } = await supabase.auth.admin.listUsers()\n * ```\n *\n * @example Paginated list of users\n * ```js\n * const { data: { users }, error } = await supabase.auth.admin.listUsers({\n * page: 1,\n * perPage: 1000\n * })\n * ```\n */\n async listUsers(params) {\n var _a, _b, _c, _d, _e, _f, _g;\n try {\n const pagination = { nextPage: null, lastPage: 0, total: 0 };\n const response = await _request(this.fetch, 'GET', `${this.url}/admin/users`, {\n headers: this.headers,\n noResolveJson: true,\n query: {\n page: (_b = (_a = params === null || params === void 0 ? void 0 : params.page) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',\n per_page: (_d = (_c = params === null || params === void 0 ? void 0 : params.perPage) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '',\n },\n xform: _noResolveJsonResponse,\n });\n if (response.error)\n throw response.error;\n const users = await response.json();\n const total = (_e = response.headers.get('x-total-count')) !== null && _e !== void 0 ? _e : 0;\n const links = (_g = (_f = response.headers.get('link')) === null || _f === void 0 ? void 0 : _f.split(',')) !== null && _g !== void 0 ? _g : [];\n if (links.length > 0) {\n links.forEach((link) => {\n const page = parseInt(link.split(';')[0].split('=')[1].substring(0, 1));\n const rel = JSON.parse(link.split(';')[1].split('=')[1]);\n pagination[`${rel}Page`] = page;\n });\n pagination.total = parseInt(total);\n }\n return { data: Object.assign(Object.assign({}, users), pagination), error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { users: [] }, error };\n }\n throw error;\n }\n }\n /**\n * Get user by id.\n *\n * @param uid The user's unique identifier\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @remarks\n * - Fetches the user object from the database based on the user's id.\n * - The `getUserById()` method requires the user's id which maps to the `auth.users.id` column.\n *\n * @example Fetch the user object using the access_token jwt\n * ```js\n * const { data, error } = await supabase.auth.admin.getUserById(1)\n * ```\n *\n * @exampleResponse Fetch the user object using the access_token jwt\n * ```json\n * {\n * data: {\n * user: {\n * id: '1',\n * aud: 'authenticated',\n * role: 'authenticated',\n * email: 'example@email.com',\n * email_confirmed_at: '2024-01-01T00:00:00Z',\n * phone: '',\n * confirmation_sent_at: '2024-01-01T00:00:00Z',\n * confirmed_at: '2024-01-01T00:00:00Z',\n * last_sign_in_at: '2024-01-01T00:00:00Z',\n * app_metadata: {},\n * user_metadata: {},\n * identities: [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"1\",\n * \"user_id\": \"1\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": true,\n * \"phone_verified\": false,\n * \"sub\": \"1\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"email@example.com\"\n * },\n * ],\n * created_at: '2024-01-01T00:00:00Z',\n * updated_at: '2024-01-01T00:00:00Z',\n * is_anonymous: false,\n * }\n * }\n * error: null\n * }\n * ```\n */\n async getUserById(uid) {\n validateUUID(uid);\n try {\n return await _request(this.fetch, 'GET', `${this.url}/admin/users/${uid}`, {\n headers: this.headers,\n xform: _userResponse,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { user: null }, error };\n }\n throw error;\n }\n }\n /**\n * Updates the user data. Changes are applied directly without confirmation flows.\n *\n * @param uid The user's unique identifier\n * @param attributes The data you want to update.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n *\n * @remarks\n * **Important:** This is a server-side operation and does **not** trigger client-side\n * `onAuthStateChange` listeners. The admin API has no connection to client state.\n *\n * To sync changes to the client after calling this method:\n * 1. On the client, call `supabase.auth.refreshSession()` to fetch the updated user data\n * 2. This will trigger the `TOKEN_REFRESHED` event and notify all listeners\n *\n * @example\n * ```typescript\n * // Server-side (Edge Function)\n * const { data, error } = await supabase.auth.admin.updateUserById(\n * userId,\n * { user_metadata: { preferences: { theme: 'dark' } } }\n * )\n *\n * // Client-side (to sync the changes)\n * const { data, error } = await supabase.auth.refreshSession()\n * // onAuthStateChange listeners will now be notified with updated user\n * ```\n *\n * @see {@link GoTrueClient.refreshSession} for syncing admin changes to the client\n * @see {@link GoTrueClient.updateUser} for client-side user updates (triggers listeners automatically)\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @example Updates a user's email\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '11111111-1111-1111-1111-111111111111',\n * { email: 'new@email.com' }\n * )\n * ```\n *\n * @exampleResponse Updates a user's email\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"new@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Updates a user's password\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n * { password: 'new_password' }\n * )\n * ```\n *\n * @example Updates a user's metadata\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n * { user_metadata: { hello: 'world' } }\n * )\n * ```\n *\n * @example Updates a user's app_metadata\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n * { app_metadata: { plan: 'trial' } }\n * )\n * ```\n *\n * @example Confirms a user's email address\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n * { email_confirm: true }\n * )\n * ```\n *\n * @example Confirms a user's phone number\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n * { phone_confirm: true }\n * )\n * ```\n *\n * @example Ban a user for 100 years\n * ```js\n * const { data: user, error } = await supabase.auth.admin.updateUserById(\n * '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n * { ban_duration: '876000h' }\n * )\n * ```\n */\n async updateUserById(uid, attributes) {\n validateUUID(uid);\n try {\n return await _request(this.fetch, 'PUT', `${this.url}/admin/users/${uid}`, {\n body: attributes,\n headers: this.headers,\n xform: _userResponse,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { user: null }, error };\n }\n throw error;\n }\n }\n /**\n * Delete a user. Requires a `service_role` key.\n *\n * @param id The user id you want to remove.\n * @param shouldSoftDelete If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible.\n * Defaults to false for backward compatibility.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n *\n * @category Auth\n * @subcategory Auth Admin\n *\n * @remarks\n * - The `deleteUser()` method requires the user's ID, which maps to the `auth.users.id` column.\n *\n * @example Removes a user\n * ```js\n * const { data, error } = await supabase.auth.admin.deleteUser(\n * '715ed5db-f090-4b8c-a067-640ecee36aa0'\n * )\n * ```\n *\n * @exampleResponse Removes a user\n * ```json\n * {\n * \"data\": {\n * \"user\": {}\n * },\n * \"error\": null\n * }\n * ```\n */\n async deleteUser(id, shouldSoftDelete = false) {\n validateUUID(id);\n try {\n return await _request(this.fetch, 'DELETE', `${this.url}/admin/users/${id}`, {\n headers: this.headers,\n body: {\n should_soft_delete: shouldSoftDelete,\n },\n xform: _userResponse,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { user: null }, error };\n }\n throw error;\n }\n }\n async _listFactors(params) {\n validateUUID(params.userId);\n try {\n const { data, error } = await _request(this.fetch, 'GET', `${this.url}/admin/users/${params.userId}/factors`, {\n headers: this.headers,\n xform: (factors) => {\n return { data: { factors }, error: null };\n },\n });\n return { data, error };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n async _deleteFactor(params) {\n validateUUID(params.userId);\n validateUUID(params.id);\n try {\n const data = await _request(this.fetch, 'DELETE', `${this.url}/admin/users/${params.userId}/factors/${params.id}`, {\n headers: this.headers,\n });\n return { data, error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Lists all OAuth clients with optional pagination.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _listOAuthClients(params) {\n var _a, _b, _c, _d, _e, _f, _g;\n try {\n const pagination = { nextPage: null, lastPage: 0, total: 0 };\n const response = await _request(this.fetch, 'GET', `${this.url}/admin/oauth/clients`, {\n headers: this.headers,\n noResolveJson: true,\n query: {\n page: (_b = (_a = params === null || params === void 0 ? void 0 : params.page) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',\n per_page: (_d = (_c = params === null || params === void 0 ? void 0 : params.perPage) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '',\n },\n xform: _noResolveJsonResponse,\n });\n if (response.error)\n throw response.error;\n const clients = await response.json();\n const total = (_e = response.headers.get('x-total-count')) !== null && _e !== void 0 ? _e : 0;\n const links = (_g = (_f = response.headers.get('link')) === null || _f === void 0 ? void 0 : _f.split(',')) !== null && _g !== void 0 ? _g : [];\n if (links.length > 0) {\n links.forEach((link) => {\n const page = parseInt(link.split(';')[0].split('=')[1].substring(0, 1));\n const rel = JSON.parse(link.split(';')[1].split('=')[1]);\n pagination[`${rel}Page`] = page;\n });\n pagination.total = parseInt(total);\n }\n return { data: Object.assign(Object.assign({}, clients), pagination), error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { clients: [] }, error };\n }\n throw error;\n }\n }\n /**\n * Creates a new OAuth client.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _createOAuthClient(params) {\n try {\n return await _request(this.fetch, 'POST', `${this.url}/admin/oauth/clients`, {\n body: params,\n headers: this.headers,\n xform: (client) => {\n return { data: client, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Gets details of a specific OAuth client.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _getOAuthClient(clientId) {\n try {\n const encodedClientId = this._encodePathSegment(clientId);\n return await _request(this.fetch, 'GET', `${this.url}/admin/oauth/clients/${encodedClientId}`, {\n headers: this.headers,\n xform: (client) => {\n return { data: client, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Updates an existing OAuth client.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _updateOAuthClient(clientId, params) {\n try {\n const encodedClientId = this._encodePathSegment(clientId);\n return await _request(this.fetch, 'PUT', `${this.url}/admin/oauth/clients/${encodedClientId}`, {\n body: params,\n headers: this.headers,\n xform: (client) => {\n return { data: client, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Deletes an OAuth client.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _deleteOAuthClient(clientId) {\n try {\n const encodedClientId = this._encodePathSegment(clientId);\n await _request(this.fetch, 'DELETE', `${this.url}/admin/oauth/clients/${encodedClientId}`, {\n headers: this.headers,\n noResolveJson: true,\n });\n return { data: null, error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Regenerates the secret for an OAuth client.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _regenerateOAuthClientSecret(clientId) {\n try {\n const encodedClientId = this._encodePathSegment(clientId);\n return await _request(this.fetch, 'POST', `${this.url}/admin/oauth/clients/${encodedClientId}/regenerate_secret`, {\n headers: this.headers,\n xform: (client) => {\n return { data: client, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Lists all custom providers with optional type filter.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _listCustomProviders(params) {\n try {\n const query = {};\n if (params === null || params === void 0 ? void 0 : params.type) {\n query.type = params.type;\n }\n return await _request(this.fetch, 'GET', `${this.url}/admin/custom-providers`, {\n headers: this.headers,\n query,\n xform: (data) => {\n var _a;\n return { data: { providers: (_a = data === null || data === void 0 ? void 0 : data.providers) !== null && _a !== void 0 ? _a : [] }, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { providers: [] }, error };\n }\n throw error;\n }\n }\n /**\n * Creates a new custom OIDC/OAuth provider.\n *\n * For OIDC providers, the server fetches and validates the OpenID Connect discovery document\n * from the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.\n * This may return a validation error (`error_code: \"validation_failed\"`) if the discovery\n * document is unreachable, not valid JSON, missing required fields, or if the issuer\n * in the document does not match the expected issuer.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _createCustomProvider(params) {\n try {\n return await _request(this.fetch, 'POST', `${this.url}/admin/custom-providers`, {\n body: params,\n headers: this.headers,\n xform: (provider) => {\n return { data: provider, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Gets details of a specific custom provider by identifier.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _getCustomProvider(identifier) {\n try {\n const encodedIdentifier = this._encodePathSegment(identifier);\n return await _request(this.fetch, 'GET', `${this.url}/admin/custom-providers/${encodedIdentifier}`, {\n headers: this.headers,\n xform: (provider) => {\n return { data: provider, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Updates an existing custom provider.\n *\n * When `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and\n * validates the discovery document before persisting. This may return a validation error\n * (`error_code: \"validation_failed\"`) if the discovery document is unreachable, invalid, or\n * the issuer does not match.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _updateCustomProvider(identifier, params) {\n try {\n const encodedIdentifier = this._encodePathSegment(identifier);\n return await _request(this.fetch, 'PUT', `${this.url}/admin/custom-providers/${encodedIdentifier}`, {\n body: params,\n headers: this.headers,\n xform: (provider) => {\n return { data: provider, error: null };\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Deletes a custom provider.\n *\n * This function should only be called on a server. Never expose your `service_role` key in the browser.\n */\n async _deleteCustomProvider(identifier) {\n try {\n const encodedIdentifier = this._encodePathSegment(identifier);\n await _request(this.fetch, 'DELETE', `${this.url}/admin/custom-providers/${encodedIdentifier}`, {\n headers: this.headers,\n noResolveJson: true,\n });\n return { data: null, error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Lists all passkeys for a user.\n *\n * This function should only be called on a server. Never expose your secret key in the browser.\n *\n * Requires `auth.experimental.passkey: true`.\n */\n async _adminListPasskeys(params) {\n assertPasskeyExperimentalEnabled(this.experimental);\n validateUUID(params.userId);\n try {\n return await _request(this.fetch, 'GET', `${this.url}/admin/users/${params.userId}/passkeys`, { headers: this.headers, xform: (data) => ({ data, error: null }) });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n /**\n * Deletes a user's passkey.\n *\n * This function should only be called on a server. Never expose your secret key in the browser.\n *\n * Requires `auth.experimental.passkey: true`.\n */\n async _adminDeletePasskey(params) {\n assertPasskeyExperimentalEnabled(this.experimental);\n validateUUID(params.userId);\n validateUUID(params.passkeyId);\n try {\n await _request(this.fetch, 'DELETE', `${this.url}/admin/users/${params.userId}/passkeys/${params.passkeyId}`, { headers: this.headers, noResolveJson: true });\n return { data: null, error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n }\n}\n//# sourceMappingURL=GoTrueAdminApi.js.map","/**\n * Returns a localStorage-like object that stores the key-value pairs in\n * memory.\n */\nexport function memoryLocalStorageAdapter(store = {}) {\n return {\n getItem: (key) => {\n return store[key] || null;\n },\n setItem: (key, value) => {\n store[key] = value;\n },\n removeItem: (key) => {\n delete store[key];\n },\n };\n}\n//# sourceMappingURL=local-storage.js.map","import { supportsLocalStorage } from './helpers';\n/**\n * @experimental\n */\nexport const internals = {\n /**\n * @experimental\n */\n debug: !!(globalThis &&\n supportsLocalStorage() &&\n globalThis.localStorage &&\n globalThis.localStorage.getItem('supabase.gotrue-js.locks.debug') === 'true'),\n};\n/**\n * An error thrown when a lock cannot be acquired after some amount of time.\n *\n * Use the {@link #isAcquireTimeout} property instead of checking with `instanceof`.\n *\n * @example\n * ```ts\n * import { LockAcquireTimeoutError } from '@supabase/auth-js'\n *\n * class CustomLockError extends LockAcquireTimeoutError {\n * constructor() {\n * super('Lock timed out')\n * }\n * }\n * ```\n */\nexport class LockAcquireTimeoutError extends Error {\n constructor(message) {\n super(message);\n this.isAcquireTimeout = true;\n }\n}\n/**\n * Error thrown when the browser Navigator Lock API fails to acquire a lock.\n *\n * @example\n * ```ts\n * import { NavigatorLockAcquireTimeoutError } from '@supabase/auth-js'\n *\n * throw new NavigatorLockAcquireTimeoutError('Lock timed out')\n * ```\n */\nexport class NavigatorLockAcquireTimeoutError extends LockAcquireTimeoutError {\n}\n/**\n * Error thrown when the process-level lock helper cannot acquire a lock.\n *\n * @example\n * ```ts\n * import { ProcessLockAcquireTimeoutError } from '@supabase/auth-js'\n *\n * throw new ProcessLockAcquireTimeoutError('Lock timed out')\n * ```\n */\nexport class ProcessLockAcquireTimeoutError extends LockAcquireTimeoutError {\n}\n/**\n * Implements a global exclusive lock using the Navigator LockManager API. It\n * is available on all browsers released after 2022-03-15 with Safari being the\n * last one to release support. If the API is not available, this function will\n * throw. Make sure you check availablility before configuring {@link\n * GoTrueClient}.\n *\n * You can turn on debugging by setting the `supabase.gotrue-js.locks.debug`\n * local storage item to `true`.\n *\n * Internals:\n *\n * Since the LockManager API does not preserve stack traces for the async\n * function passed in the `request` method, a trick is used where acquiring the\n * lock releases a previously started promise to run the operation in the `fn`\n * function. The lock waits for that promise to finish (with or without error),\n * while the function will finally wait for the result anyway.\n *\n * @param name Name of the lock to be acquired.\n * @param acquireTimeout If negative, no timeout. If 0 an error is thrown if\n * the lock can't be acquired without waiting. If positive, the lock acquire\n * will time out after so many milliseconds. An error is\n * a timeout if it has `isAcquireTimeout` set to true.\n * @param fn The operation to run once the lock is acquired.\n * @example\n * ```ts\n * await navigatorLock('sync-user', 1000, async () => {\n * await refreshSession()\n * })\n * ```\n */\nexport async function navigatorLock(name, acquireTimeout, fn) {\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: acquire lock', name, acquireTimeout);\n }\n const abortController = new globalThis.AbortController();\n let acquireTimeoutTimer;\n if (acquireTimeout > 0) {\n acquireTimeoutTimer = setTimeout(() => {\n abortController.abort();\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock acquire timed out', name);\n }\n }, acquireTimeout);\n }\n // MDN article: https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request\n // Wrapping navigator.locks.request() with a plain Promise is done as some\n // libraries like zone.js patch the Promise object to track the execution\n // context. However, it appears that most browsers use an internal promise\n // implementation when using the navigator.locks.request() API causing them\n // to lose context and emit confusing log messages or break certain features.\n // This wrapping is believed to help zone.js track the execution context\n // better.\n await Promise.resolve();\n try {\n return await globalThis.navigator.locks.request(name, acquireTimeout === 0\n ? {\n mode: 'exclusive',\n ifAvailable: true,\n }\n : {\n mode: 'exclusive',\n signal: abortController.signal,\n }, async (lock) => {\n if (lock) {\n // Lock acquired — cancel the acquire-timeout timer so it cannot fire\n // while fn() is running. Without this, a delayed timeout abort would\n // set signal.aborted = true even though we already hold the lock,\n // causing a subsequent steal to be misclassified as \"our timeout\n // fired\" and triggering a spurious steal-back cascade.\n clearTimeout(acquireTimeoutTimer);\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: acquired', name, lock.name);\n }\n try {\n return await fn();\n }\n finally {\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: released', name, lock.name);\n }\n }\n }\n else {\n if (acquireTimeout === 0) {\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: not immediately available', name);\n }\n throw new NavigatorLockAcquireTimeoutError(`Acquiring an exclusive Navigator LockManager lock \"${name}\" immediately failed`);\n }\n else {\n if (internals.debug) {\n try {\n const result = await globalThis.navigator.locks.query();\n console.log('@supabase/gotrue-js: Navigator LockManager state', JSON.stringify(result, null, ' '));\n }\n catch (e) {\n console.warn('@supabase/gotrue-js: Error when querying Navigator LockManager state', e);\n }\n }\n // Browser is not following the Navigator LockManager spec, it\n // returned a null lock when we didn't use ifAvailable. So we can\n // pretend the lock is acquired in the name of backward compatibility\n // and user experience and just run the function.\n console.warn('@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request');\n clearTimeout(acquireTimeoutTimer);\n return await fn();\n }\n }\n });\n }\n catch (e) {\n // Always clear the acquire timeout once the request settles, so it cannot\n // fire later and incorrectly abort/log after a rejection.\n if (acquireTimeout > 0) {\n clearTimeout(acquireTimeoutTimer);\n }\n // DOMException does not extend Error in Node.js, so use structural check\n if (e !== null &&\n typeof e === 'object' &&\n 'name' in e &&\n e.name === 'AbortError' &&\n acquireTimeout > 0) {\n if (abortController.signal.aborted) {\n // OUR timeout fired — the lock is genuinely orphaned. Steal it.\n //\n // The lock acquisition was aborted because the timeout fired while the\n // request was still pending. This typically means another lock holder is\n // not releasing the lock, possibly due to React Strict Mode's\n // double-mount/unmount behavior or a component unmounting mid-operation,\n // leaving an orphaned lock.\n //\n // Recovery: use { steal: true } to forcefully acquire the lock. Per the\n // Web Locks API spec, this releases any currently held lock with the same\n // name and grants the request immediately, preempting any queued requests.\n // The previous holder's callback continues running to completion but no\n // longer holds the lock for exclusion purposes.\n //\n // See: https://github.com/supabase/supabase/issues/42505\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock', name);\n }\n console.warn(`@supabase/gotrue-js: Lock \"${name}\" was not released within ${acquireTimeout}ms. ` +\n 'This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). ' +\n 'Forcefully acquiring the lock to recover.');\n return await Promise.resolve().then(() => globalThis.navigator.locks.request(name, {\n mode: 'exclusive',\n steal: true,\n }, async (lock) => {\n if (lock) {\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: recovered (stolen)', name, lock.name);\n }\n try {\n return await fn();\n }\n finally {\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: released (stolen)', name, lock.name);\n }\n }\n }\n else {\n // This should not happen with steal: true, but handle gracefully.\n console.warn('@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true');\n return await fn();\n }\n }));\n }\n else {\n // We HELD the lock but another request stole it from us.\n // Per the Web Locks spec, our fn() callback is still running as an\n // orphaned background task — do NOT steal back. Stealing back would\n // cause a cascade (A steals B, B steals A, ...) and run fn() a second\n // time concurrently, corrupting auth state.\n // Convert to a typed error so callers (e.g. _autoRefreshTokenTick)\n // can handle/filter it without it leaking to Sentry as a raw AbortError.\n if (internals.debug) {\n console.log('@supabase/gotrue-js: navigatorLock: lock was stolen by another request', name);\n }\n throw new NavigatorLockAcquireTimeoutError(`Lock \"${name}\" was released because another request stole it`);\n }\n }\n throw e;\n }\n}\nconst PROCESS_LOCKS = {};\n/**\n * Implements a global exclusive lock that works only in the current process.\n * Useful for environments like React Native or other non-browser\n * single-process (i.e. no concept of \"tabs\") environments.\n *\n * Use {@link #navigatorLock} in browser environments.\n *\n * @param name Name of the lock to be acquired.\n * @param acquireTimeout If negative, no timeout. If 0 an error is thrown if\n * the lock can't be acquired without waiting. If positive, the lock acquire\n * will time out after so many milliseconds. An error is\n * a timeout if it has `isAcquireTimeout` set to true.\n * @param fn The operation to run once the lock is acquired.\n * @example\n * ```ts\n * await processLock('migrate', 5000, async () => {\n * await runMigration()\n * })\n * ```\n */\nexport async function processLock(name, acquireTimeout, fn) {\n var _a;\n const previousOperation = (_a = PROCESS_LOCKS[name]) !== null && _a !== void 0 ? _a : Promise.resolve();\n // Wrap previousOperation to handle errors without using .catch()\n // This avoids Firefox content script security errors\n const previousOperationHandled = (async () => {\n try {\n await previousOperation;\n return null;\n }\n catch (e) {\n // ignore error of previous operation that we're waiting to finish\n return null;\n }\n })();\n const currentOperation = (async () => {\n let timeoutId = null;\n try {\n // Wait for either previous operation or timeout\n const timeoutPromise = acquireTimeout >= 0\n ? new Promise((_, reject) => {\n timeoutId = setTimeout(() => {\n console.warn(`@supabase/gotrue-js: Lock \"${name}\" acquisition timed out after ${acquireTimeout}ms. ` +\n 'This may be caused by another operation holding the lock. ' +\n 'Consider increasing lockAcquireTimeout or checking for stuck operations.');\n reject(new ProcessLockAcquireTimeoutError(`Acquiring process lock with name \"${name}\" timed out`));\n }, acquireTimeout);\n })\n : null;\n await Promise.race([previousOperationHandled, timeoutPromise].filter((x) => x));\n // If we reach here, previousOperationHandled won the race\n // Clear the timeout to prevent false warnings\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n }\n catch (e) {\n // Clear the timeout on error path as well\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n // Re-throw timeout errors, ignore others\n if (e instanceof LockAcquireTimeoutError) {\n throw e;\n }\n // Fall through to run fn() - previous operation finished with error\n }\n // Previous operations finished and we didn't get a race on the acquire\n // timeout, so the current operation can finally start\n return await fn();\n })();\n PROCESS_LOCKS[name] = (async () => {\n try {\n return await currentOperation;\n }\n catch (e) {\n if (e instanceof LockAcquireTimeoutError) {\n // if the current operation timed out, it doesn't mean that the previous\n // operation finished, so we need continue waiting for it to finish\n try {\n await previousOperation;\n }\n catch (prevError) {\n // Ignore previous operation errors\n }\n return null;\n }\n throw e;\n }\n })();\n // finally wait for the current operation to finish successfully, with an\n // error or with an acquire timeout error\n return await currentOperation;\n}\n//# sourceMappingURL=locks.js.map","/**\n * https://mathiasbynens.be/notes/globalthis\n */\nexport function polyfillGlobalThis() {\n if (typeof globalThis === 'object')\n return;\n try {\n Object.defineProperty(Object.prototype, '__magic__', {\n get: function () {\n return this;\n },\n configurable: true,\n });\n // @ts-expect-error 'Allow access to magic'\n __magic__.globalThis = __magic__;\n // @ts-expect-error 'Allow access to magic'\n delete Object.prototype.__magic__;\n }\n catch (e) {\n if (typeof self !== 'undefined') {\n // @ts-expect-error 'Allow access to globals'\n self.globalThis = self;\n }\n }\n}\n//# sourceMappingURL=polyfills.js.map","// types and functions copied over from viem so this library doesn't depend on it\nexport function getAddress(address) {\n if (!/^0x[a-fA-F0-9]{40}$/.test(address)) {\n throw new Error(`@supabase/auth-js: Address \"${address}\" is invalid.`);\n }\n return address.toLowerCase();\n}\nexport function fromHex(hex) {\n return parseInt(hex, 16);\n}\nexport function toHex(value) {\n const bytes = new TextEncoder().encode(value);\n const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');\n return ('0x' + hex);\n}\n/**\n * Creates EIP-4361 formatted message.\n */\nexport function createSiweMessage(parameters) {\n var _a;\n const { chainId, domain, expirationTime, issuedAt = new Date(), nonce, notBefore, requestId, resources, scheme, uri, version, } = parameters;\n // Validate fields\n {\n if (!Number.isInteger(chainId))\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"chainId\". Chain ID must be a EIP-155 chain ID. Provided value: ${chainId}`);\n if (!domain)\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"domain\". Domain must be provided.`);\n if (nonce && nonce.length < 8)\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"nonce\". Nonce must be at least 8 characters. Provided value: ${nonce}`);\n if (!uri)\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"uri\". URI must be provided.`);\n if (version !== '1')\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"version\". Version must be '1'. Provided value: ${version}`);\n if ((_a = parameters.statement) === null || _a === void 0 ? void 0 : _a.includes('\\n'))\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"statement\". Statement must not include '\\\\n'. Provided value: ${parameters.statement}`);\n }\n // Construct message\n const address = getAddress(parameters.address);\n const origin = scheme ? `${scheme}://${domain}` : domain;\n const statement = parameters.statement ? `${parameters.statement}\\n` : '';\n const prefix = `${origin} wants you to sign in with your Ethereum account:\\n${address}\\n\\n${statement}`;\n let suffix = `URI: ${uri}\\nVersion: ${version}\\nChain ID: ${chainId}${nonce ? `\\nNonce: ${nonce}` : ''}\\nIssued At: ${issuedAt.toISOString()}`;\n if (expirationTime)\n suffix += `\\nExpiration Time: ${expirationTime.toISOString()}`;\n if (notBefore)\n suffix += `\\nNot Before: ${notBefore.toISOString()}`;\n if (requestId)\n suffix += `\\nRequest ID: ${requestId}`;\n if (resources) {\n let content = '\\nResources:';\n for (const resource of resources) {\n if (!resource || typeof resource !== 'string')\n throw new Error(`@supabase/auth-js: Invalid SIWE message field \"resources\". Every resource must be a valid string. Provided value: ${resource}`);\n content += `\\n- ${resource}`;\n }\n suffix += content;\n }\n return `${prefix}\\n${suffix}`;\n}\n//# sourceMappingURL=ethereum.js.map","/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { isValidDomain } from './webauthn';\n/**\n * A custom Error used to return a more nuanced error detailing _why_ one of the eight documented\n * errors in the spec was raised after calling `navigator.credentials.create()` or\n * `navigator.credentials.get()`:\n *\n * - `AbortError`\n * - `ConstraintError`\n * - `InvalidStateError`\n * - `NotAllowedError`\n * - `NotSupportedError`\n * - `SecurityError`\n * - `TypeError`\n * - `UnknownError`\n *\n * Error messages were determined through investigation of the spec to determine under which\n * scenarios a given error would be raised.\n */\nexport class WebAuthnError extends Error {\n constructor({ message, code, cause, name, }) {\n var _a;\n // @ts-ignore: help Rollup understand that `cause` is okay to set\n super(message, { cause });\n this.__isWebAuthnError = true;\n this.name = (_a = name !== null && name !== void 0 ? name : (cause instanceof Error ? cause.name : undefined)) !== null && _a !== void 0 ? _a : 'Unknown Error';\n this.code = code;\n }\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n };\n }\n}\n/**\n * Error class for unknown WebAuthn errors.\n * Wraps unexpected errors that don't match known WebAuthn error conditions.\n */\nexport class WebAuthnUnknownError extends WebAuthnError {\n constructor(message, originalError) {\n super({\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: originalError,\n message,\n });\n this.name = 'WebAuthnUnknownError';\n this.originalError = originalError;\n }\n}\n/**\n * Type guard to check if an error is a WebAuthnError.\n * @param {unknown} error - The error to check\n * @returns {boolean} True if the error is a WebAuthnError\n */\nexport function isWebAuthnError(error) {\n return typeof error === 'object' && error !== null && '__isWebAuthnError' in error;\n}\n/**\n * Attempt to intuit _why_ an error was raised after calling `navigator.credentials.create()`.\n * Maps browser errors to specific WebAuthn error codes for better debugging.\n * @param {Object} params - Error identification parameters\n * @param {Error} params.error - The error thrown by the browser\n * @param {CredentialCreationOptions} params.options - The options passed to credentials.create()\n * @returns {WebAuthnError} A WebAuthnError with a specific error code\n * @see {@link https://w3c.github.io/webauthn/#sctn-createCredential W3C WebAuthn Spec - Create Credential}\n */\nexport function identifyRegistrationError({ error, options, }) {\n var _a, _b, _c;\n const { publicKey } = options;\n if (!publicKey) {\n throw Error('options was missing required publicKey property');\n }\n if (error.name === 'AbortError') {\n if (options.signal instanceof AbortSignal) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 16)\n return new WebAuthnError({\n message: 'Registration ceremony was sent an abort signal',\n code: 'ERROR_CEREMONY_ABORTED',\n cause: error,\n });\n }\n }\n else if (error.name === 'ConstraintError') {\n if (((_a = publicKey.authenticatorSelection) === null || _a === void 0 ? void 0 : _a.requireResidentKey) === true) {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 4)\n return new WebAuthnError({\n message: 'Discoverable credentials were required but no available authenticator supported it',\n code: 'ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT',\n cause: error,\n });\n }\n else if (\n // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024\n options.mediation === 'conditional' &&\n ((_b = publicKey.authenticatorSelection) === null || _b === void 0 ? void 0 : _b.userVerification) === 'required') {\n // https://w3c.github.io/webauthn/#sctn-createCredential (Step 22.4)\n return new WebAuthnError({\n message: 'User verification was required during automatic registration but it could not be performed',\n code: 'ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE',\n cause: error,\n });\n }\n else if (((_c = publicKey.authenticatorSelection) === null || _c === void 0 ? void 0 : _c.userVerification) === 'required') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 5)\n return new WebAuthnError({\n message: 'User verification was required but no available authenticator supported it',\n code: 'ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT',\n cause: error,\n });\n }\n }\n else if (error.name === 'InvalidStateError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 20)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 3)\n return new WebAuthnError({\n message: 'The authenticator was previously registered',\n code: 'ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED',\n cause: error,\n });\n }\n else if (error.name === 'NotAllowedError') {\n /**\n * Pass the error directly through. Platforms are overloading this error beyond what the spec\n * defines and we don't want to overwrite potentially useful error messages.\n */\n return new WebAuthnError({\n message: error.message,\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n }\n else if (error.name === 'NotSupportedError') {\n const validPubKeyCredParams = publicKey.pubKeyCredParams.filter((param) => param.type === 'public-key');\n if (validPubKeyCredParams.length === 0) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 10)\n return new WebAuthnError({\n message: 'No entry in pubKeyCredParams was of type \"public-key\"',\n code: 'ERROR_MALFORMED_PUBKEYCREDPARAMS',\n cause: error,\n });\n }\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 2)\n return new WebAuthnError({\n message: 'No available authenticator supported any of the specified pubKeyCredParams algorithms',\n code: 'ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG',\n cause: error,\n });\n }\n else if (error.name === 'SecurityError') {\n const effectiveDomain = window.location.hostname;\n if (!isValidDomain(effectiveDomain)) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 7)\n return new WebAuthnError({\n message: `${window.location.hostname} is an invalid domain`,\n code: 'ERROR_INVALID_DOMAIN',\n cause: error,\n });\n }\n else if (publicKey.rp.id !== effectiveDomain) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 8)\n return new WebAuthnError({\n message: `The RP ID \"${publicKey.rp.id}\" is invalid for this domain`,\n code: 'ERROR_INVALID_RP_ID',\n cause: error,\n });\n }\n }\n else if (error.name === 'TypeError') {\n if (publicKey.user.id.byteLength < 1 || publicKey.user.id.byteLength > 64) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 5)\n return new WebAuthnError({\n message: 'User ID was not between 1 and 64 characters',\n code: 'ERROR_INVALID_USER_ID_LENGTH',\n cause: error,\n });\n }\n }\n else if (error.name === 'UnknownError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 1)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 8)\n return new WebAuthnError({\n message: 'The authenticator was unable to process the specified options, or could not create a new credential',\n code: 'ERROR_AUTHENTICATOR_GENERAL_ERROR',\n cause: error,\n });\n }\n return new WebAuthnError({\n message: 'a Non-Webauthn related error has occurred',\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n}\n/**\n * Attempt to intuit _why_ an error was raised after calling `navigator.credentials.get()`.\n * Maps browser errors to specific WebAuthn error codes for better debugging.\n * @param {Object} params - Error identification parameters\n * @param {Error} params.error - The error thrown by the browser\n * @param {CredentialRequestOptions} params.options - The options passed to credentials.get()\n * @returns {WebAuthnError} A WebAuthnError with a specific error code\n * @see {@link https://w3c.github.io/webauthn/#sctn-getAssertion W3C WebAuthn Spec - Get Assertion}\n */\nexport function identifyAuthenticationError({ error, options, }) {\n const { publicKey } = options;\n if (!publicKey) {\n throw Error('options was missing required publicKey property');\n }\n if (error.name === 'AbortError') {\n if (options.signal instanceof AbortSignal) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 16)\n return new WebAuthnError({\n message: 'Authentication ceremony was sent an abort signal',\n code: 'ERROR_CEREMONY_ABORTED',\n cause: error,\n });\n }\n }\n else if (error.name === 'NotAllowedError') {\n /**\n * Pass the error directly through. Platforms are overloading this error beyond what the spec\n * defines and we don't want to overwrite potentially useful error messages.\n */\n return new WebAuthnError({\n message: error.message,\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n }\n else if (error.name === 'SecurityError') {\n const effectiveDomain = window.location.hostname;\n if (!isValidDomain(effectiveDomain)) {\n // https://www.w3.org/TR/webauthn-2/#sctn-discover-from-external-source (Step 5)\n return new WebAuthnError({\n message: `${window.location.hostname} is an invalid domain`,\n code: 'ERROR_INVALID_DOMAIN',\n cause: error,\n });\n }\n else if (publicKey.rpId !== effectiveDomain) {\n // https://www.w3.org/TR/webauthn-2/#sctn-discover-from-external-source (Step 6)\n return new WebAuthnError({\n message: `The RP ID \"${publicKey.rpId}\" is invalid for this domain`,\n code: 'ERROR_INVALID_RP_ID',\n cause: error,\n });\n }\n }\n else if (error.name === 'UnknownError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-get-assertion (Step 1)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-get-assertion (Step 12)\n return new WebAuthnError({\n message: 'The authenticator was unable to process the specified options, or could not create a new assertion signature',\n code: 'ERROR_AUTHENTICATOR_GENERAL_ERROR',\n cause: error,\n });\n }\n return new WebAuthnError({\n message: 'a Non-Webauthn related error has occurred',\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n}\n//# sourceMappingURL=webauthn.errors.js.map","import { __rest } from \"tslib\";\nimport { base64UrlToUint8Array, bytesToBase64URL } from './base64url';\nimport { AuthError, AuthUnknownError, isAuthError } from './errors';\nimport { isBrowser } from './helpers';\nimport { identifyAuthenticationError, identifyRegistrationError, isWebAuthnError, WebAuthnError, WebAuthnUnknownError, } from './webauthn.errors';\nexport { WebAuthnError, isWebAuthnError, identifyRegistrationError, identifyAuthenticationError };\n/**\n * WebAuthn abort service to manage ceremony cancellation.\n * Ensures only one WebAuthn ceremony is active at a time to prevent \"operation already in progress\" errors.\n *\n * @experimental This class is experimental and may change in future releases\n * @see {@link https://w3c.github.io/webauthn/#sctn-automation-webdriver-capability W3C WebAuthn Spec - Aborting Ceremonies}\n */\nexport class WebAuthnAbortService {\n /**\n * Create an abort signal for a new WebAuthn operation.\n * Automatically cancels any existing operation.\n *\n * @returns {AbortSignal} Signal to pass to navigator.credentials.create() or .get()\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal MDN - AbortSignal}\n */\n createNewAbortSignal() {\n // Abort any existing calls to navigator.credentials.create() or navigator.credentials.get()\n if (this.controller) {\n const abortError = new Error('Cancelling existing WebAuthn API call for new one');\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n }\n const newController = new AbortController();\n this.controller = newController;\n return newController.signal;\n }\n /**\n * Manually cancel the current WebAuthn operation.\n * Useful for cleaning up when user cancels or navigates away.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort MDN - AbortController.abort}\n */\n cancelCeremony() {\n if (this.controller) {\n const abortError = new Error('Manually cancelling existing WebAuthn API call');\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n this.controller = undefined;\n }\n }\n}\n/**\n * Singleton instance to ensure only one WebAuthn ceremony is active at a time.\n * This prevents \"operation already in progress\" errors when retrying WebAuthn operations.\n *\n * @experimental This instance is experimental and may change in future releases\n */\nexport const webAuthnAbortService = new WebAuthnAbortService();\n/**\n * Convert base64url encoded strings in WebAuthn credential creation options to ArrayBuffers\n * as required by the WebAuthn browser API.\n * Supports both native WebAuthn Level 3 parseCreationOptionsFromJSON and manual fallback.\n *\n * @param {ServerCredentialCreationOptions} options - JSON options from server with base64url encoded fields\n * @returns {PublicKeyCredentialCreationOptionsFuture} Options ready for navigator.credentials.create()\n * @see {@link https://w3c.github.io/webauthn/#sctn-parseCreationOptionsFromJSON W3C WebAuthn Spec - parseCreationOptionsFromJSON}\n */\nexport function deserializeCredentialCreationOptions(options) {\n if (!options) {\n throw new Error('Credential creation options are required');\n }\n // Check if the native parseCreationOptionsFromJSON method is available\n if (typeof PublicKeyCredential !== 'undefined' &&\n 'parseCreationOptionsFromJSON' in PublicKeyCredential &&\n typeof PublicKeyCredential\n .parseCreationOptionsFromJSON === 'function') {\n // Use the native WebAuthn Level 3 method\n return PublicKeyCredential.parseCreationOptionsFromJSON(\n /** we assert the options here as typescript still doesn't know about future webauthn types */\n options);\n }\n // Fallback to manual parsing for browsers that don't support the native method\n // Destructure to separate fields that need transformation\n const { challenge: challengeStr, user: userOpts, excludeCredentials } = options, restOptions = __rest(options\n // Convert challenge from base64url to ArrayBuffer\n , [\"challenge\", \"user\", \"excludeCredentials\"]);\n // Convert challenge from base64url to ArrayBuffer\n const challenge = base64UrlToUint8Array(challengeStr).buffer;\n // Convert user.id from base64url to ArrayBuffer\n const user = Object.assign(Object.assign({}, userOpts), { id: base64UrlToUint8Array(userOpts.id).buffer });\n // Build the result object\n const result = Object.assign(Object.assign({}, restOptions), { challenge,\n user });\n // Only add excludeCredentials if it exists\n if (excludeCredentials && excludeCredentials.length > 0) {\n result.excludeCredentials = new Array(excludeCredentials.length);\n for (let i = 0; i < excludeCredentials.length; i++) {\n const cred = excludeCredentials[i];\n result.excludeCredentials[i] = Object.assign(Object.assign({}, cred), { id: base64UrlToUint8Array(cred.id).buffer, type: cred.type || 'public-key', \n // Cast transports to handle future transport types like \"cable\"\n transports: cred.transports });\n }\n }\n return result;\n}\n/**\n * Convert base64url encoded strings in WebAuthn credential request options to ArrayBuffers\n * as required by the WebAuthn browser API.\n * Supports both native WebAuthn Level 3 parseRequestOptionsFromJSON and manual fallback.\n *\n * @param {ServerCredentialRequestOptions} options - JSON options from server with base64url encoded fields\n * @returns {PublicKeyCredentialRequestOptionsFuture} Options ready for navigator.credentials.get()\n * @see {@link https://w3c.github.io/webauthn/#sctn-parseRequestOptionsFromJSON W3C WebAuthn Spec - parseRequestOptionsFromJSON}\n */\nexport function deserializeCredentialRequestOptions(options) {\n if (!options) {\n throw new Error('Credential request options are required');\n }\n // Check if the native parseRequestOptionsFromJSON method is available\n if (typeof PublicKeyCredential !== 'undefined' &&\n 'parseRequestOptionsFromJSON' in PublicKeyCredential &&\n typeof PublicKeyCredential\n .parseRequestOptionsFromJSON === 'function') {\n // Use the native WebAuthn Level 3 method\n return PublicKeyCredential.parseRequestOptionsFromJSON(options);\n }\n // Fallback to manual parsing for browsers that don't support the native method\n // Destructure to separate fields that need transformation\n const { challenge: challengeStr, allowCredentials } = options, restOptions = __rest(options\n // Convert challenge from base64url to ArrayBuffer\n , [\"challenge\", \"allowCredentials\"]);\n // Convert challenge from base64url to ArrayBuffer\n const challenge = base64UrlToUint8Array(challengeStr).buffer;\n // Build the result object\n const result = Object.assign(Object.assign({}, restOptions), { challenge });\n // Only add allowCredentials if it exists\n if (allowCredentials && allowCredentials.length > 0) {\n result.allowCredentials = new Array(allowCredentials.length);\n for (let i = 0; i < allowCredentials.length; i++) {\n const cred = allowCredentials[i];\n result.allowCredentials[i] = Object.assign(Object.assign({}, cred), { id: base64UrlToUint8Array(cred.id).buffer, type: cred.type || 'public-key', \n // Cast transports to handle future transport types like \"cable\"\n transports: cred.transports });\n }\n }\n return result;\n}\n/**\n * Convert a registration/enrollment credential response to server format.\n * Serializes binary fields to base64url for JSON transmission.\n * Supports both native WebAuthn Level 3 toJSON and manual fallback.\n *\n * @param {RegistrationCredential} credential - Credential from navigator.credentials.create()\n * @returns {RegistrationResponseJSON} JSON-serializable credential for server\n * @see {@link https://w3c.github.io/webauthn/#dom-publickeycredential-tojson W3C WebAuthn Spec - toJSON}\n */\nexport function serializeCredentialCreationResponse(credential) {\n var _a;\n // Check if the credential instance has the toJSON method\n if ('toJSON' in credential && typeof credential.toJSON === 'function') {\n // Use the native WebAuthn Level 3 method\n return credential.toJSON();\n }\n const credentialWithAttachment = credential;\n return {\n id: credential.id,\n rawId: credential.id,\n response: {\n attestationObject: bytesToBase64URL(new Uint8Array(credential.response.attestationObject)),\n clientDataJSON: bytesToBase64URL(new Uint8Array(credential.response.clientDataJSON)),\n },\n type: 'public-key',\n clientExtensionResults: credential.getClientExtensionResults(),\n // Convert null to undefined and cast to AuthenticatorAttachment type\n authenticatorAttachment: ((_a = credentialWithAttachment.authenticatorAttachment) !== null && _a !== void 0 ? _a : undefined),\n };\n}\n/**\n * Convert an authentication/verification credential response to server format.\n * Serializes binary fields to base64url for JSON transmission.\n * Supports both native WebAuthn Level 3 toJSON and manual fallback.\n *\n * @param {AuthenticationCredential} credential - Credential from navigator.credentials.get()\n * @returns {AuthenticationResponseJSON} JSON-serializable credential for server\n * @see {@link https://w3c.github.io/webauthn/#dom-publickeycredential-tojson W3C WebAuthn Spec - toJSON}\n */\nexport function serializeCredentialRequestResponse(credential) {\n var _a;\n // Check if the credential instance has the toJSON method\n if ('toJSON' in credential && typeof credential.toJSON === 'function') {\n // Use the native WebAuthn Level 3 method\n return credential.toJSON();\n }\n // Fallback to manual conversion for browsers that don't support toJSON\n // Access authenticatorAttachment via type assertion to handle TypeScript version differences\n // @simplewebauthn/types includes this property but base TypeScript 4.7.4 doesn't\n const credentialWithAttachment = credential;\n const clientExtensionResults = credential.getClientExtensionResults();\n const assertionResponse = credential.response;\n return {\n id: credential.id,\n rawId: credential.id, // W3C spec expects rawId to match id for JSON format\n response: {\n authenticatorData: bytesToBase64URL(new Uint8Array(assertionResponse.authenticatorData)),\n clientDataJSON: bytesToBase64URL(new Uint8Array(assertionResponse.clientDataJSON)),\n signature: bytesToBase64URL(new Uint8Array(assertionResponse.signature)),\n userHandle: assertionResponse.userHandle\n ? bytesToBase64URL(new Uint8Array(assertionResponse.userHandle))\n : undefined,\n },\n type: 'public-key',\n clientExtensionResults,\n // Convert null to undefined and cast to AuthenticatorAttachment type\n authenticatorAttachment: ((_a = credentialWithAttachment.authenticatorAttachment) !== null && _a !== void 0 ? _a : undefined),\n };\n}\n/**\n * A simple test to determine if a hostname is a properly-formatted domain name.\n * Considers localhost valid for development environments.\n *\n * A \"valid domain\" is defined here: https://url.spec.whatwg.org/#valid-domain\n *\n * Regex sourced from here:\n * https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html\n *\n * @param {string} hostname - The hostname to validate\n * @returns {boolean} True if valid domain or localhost\n * @see {@link https://url.spec.whatwg.org/#valid-domain WHATWG URL Spec - Valid Domain}\n */\nexport function isValidDomain(hostname) {\n return (\n // Consider localhost valid as well since it's okay wrt Secure Contexts\n hostname === 'localhost' || /^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}$/i.test(hostname));\n}\n/**\n * Determine if the browser is capable of WebAuthn.\n * Checks for necessary Web APIs: PublicKeyCredential and Credential Management.\n *\n * @returns {boolean} True if browser supports WebAuthn\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential#browser_compatibility MDN - PublicKeyCredential Browser Compatibility}\n */\nexport function browserSupportsWebAuthn() {\n var _a, _b;\n return !!(isBrowser() &&\n 'PublicKeyCredential' in window &&\n window.PublicKeyCredential &&\n 'credentials' in navigator &&\n typeof ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.credentials) === null || _a === void 0 ? void 0 : _a.create) === 'function' &&\n typeof ((_b = navigator === null || navigator === void 0 ? void 0 : navigator.credentials) === null || _b === void 0 ? void 0 : _b.get) === 'function');\n}\n/**\n * Create a WebAuthn credential using the browser's credentials API.\n * Wraps navigator.credentials.create() with error handling.\n *\n * @param {CredentialCreationOptions} options - Options including publicKey parameters\n * @returns {Promise<RequestResult<RegistrationCredential, WebAuthnError>>} Created credential or error\n * @see {@link https://w3c.github.io/webauthn/#sctn-createCredential W3C WebAuthn Spec - Create Credential}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create MDN - credentials.create}\n */\nexport async function createCredential(options) {\n try {\n const response = await navigator.credentials.create(\n /** we assert the type here until typescript types are updated */\n options);\n if (!response) {\n return {\n data: null,\n error: new WebAuthnUnknownError('Empty credential response', response),\n };\n }\n if (!(response instanceof PublicKeyCredential)) {\n return {\n data: null,\n error: new WebAuthnUnknownError('Browser returned unexpected credential type', response),\n };\n }\n return { data: response, error: null };\n }\n catch (err) {\n return {\n data: null,\n error: identifyRegistrationError({\n error: err,\n options,\n }),\n };\n }\n}\n/**\n * Get a WebAuthn credential using the browser's credentials API.\n * Wraps navigator.credentials.get() with error handling.\n *\n * @param {CredentialRequestOptions} options - Options including publicKey parameters\n * @returns {Promise<RequestResult<AuthenticationCredential, WebAuthnError>>} Retrieved credential or error\n * @see {@link https://w3c.github.io/webauthn/#sctn-getAssertion W3C WebAuthn Spec - Get Assertion}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get MDN - credentials.get}\n */\nexport async function getCredential(options) {\n try {\n const response = await navigator.credentials.get(\n /** we assert the type here until typescript types are updated */\n options);\n if (!response) {\n return {\n data: null,\n error: new WebAuthnUnknownError('Empty credential response', response),\n };\n }\n if (!(response instanceof PublicKeyCredential)) {\n return {\n data: null,\n error: new WebAuthnUnknownError('Browser returned unexpected credential type', response),\n };\n }\n return { data: response, error: null };\n }\n catch (err) {\n return {\n data: null,\n error: identifyAuthenticationError({\n error: err,\n options,\n }),\n };\n }\n}\nexport const DEFAULT_CREATION_OPTIONS = {\n hints: ['security-key'],\n authenticatorSelection: {\n authenticatorAttachment: 'cross-platform',\n requireResidentKey: false,\n /** set to preferred because older yubikeys don't have PIN/Biometric */\n userVerification: 'preferred',\n residentKey: 'discouraged',\n },\n attestation: 'direct',\n};\nexport const DEFAULT_REQUEST_OPTIONS = {\n /** set to preferred because older yubikeys don't have PIN/Biometric */\n userVerification: 'preferred',\n hints: ['security-key'],\n attestation: 'direct',\n};\nfunction deepMerge(...sources) {\n const isObject = (val) => val !== null && typeof val === 'object' && !Array.isArray(val);\n const isArrayBufferLike = (val) => val instanceof ArrayBuffer || ArrayBuffer.isView(val);\n const result = {};\n for (const source of sources) {\n if (!source)\n continue;\n for (const key in source) {\n const value = source[key];\n if (value === undefined)\n continue;\n if (Array.isArray(value)) {\n // preserve array reference, including unions like AuthenticatorTransport[]\n result[key] = value;\n }\n else if (isArrayBufferLike(value)) {\n result[key] = value;\n }\n else if (isObject(value)) {\n const existing = result[key];\n if (isObject(existing)) {\n result[key] = deepMerge(existing, value);\n }\n else {\n result[key] = deepMerge(value);\n }\n }\n else {\n result[key] = value;\n }\n }\n }\n return result;\n}\n/**\n * Merges WebAuthn credential creation options with overrides.\n * Sets sensible defaults for authenticator selection and extensions.\n *\n * @param {PublicKeyCredentialCreationOptionsFuture} baseOptions - The base options from the server\n * @param {PublicKeyCredentialCreationOptionsFuture} overrides - Optional overrides to apply\n * @param {string} friendlyName - Optional friendly name for the credential\n * @returns {PublicKeyCredentialCreationOptionsFuture} Merged credential creation options\n * @see {@link https://w3c.github.io/webauthn/#dictdef-authenticatorselectioncriteria W3C WebAuthn Spec - AuthenticatorSelectionCriteria}\n */\nexport function mergeCredentialCreationOptions(baseOptions, overrides) {\n return deepMerge(DEFAULT_CREATION_OPTIONS, baseOptions, overrides || {});\n}\n/**\n * Merges WebAuthn credential request options with overrides.\n * Sets sensible defaults for user verification and hints.\n *\n * @param {PublicKeyCredentialRequestOptionsFuture} baseOptions - The base options from the server\n * @param {PublicKeyCredentialRequestOptionsFuture} overrides - Optional overrides to apply\n * @returns {PublicKeyCredentialRequestOptionsFuture} Merged credential request options\n * @see {@link https://w3c.github.io/webauthn/#dictdef-publickeycredentialrequestoptions W3C WebAuthn Spec - PublicKeyCredentialRequestOptions}\n */\nexport function mergeCredentialRequestOptions(baseOptions, overrides) {\n return deepMerge(DEFAULT_REQUEST_OPTIONS, baseOptions, overrides || {});\n}\n/**\n * WebAuthn API wrapper for Supabase Auth.\n * Provides methods for enrolling, challenging, verifying, authenticating, and registering WebAuthn credentials.\n *\n * @experimental This API is experimental and may change in future releases\n * @see {@link https://w3c.github.io/webauthn/ W3C WebAuthn Specification}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API MDN - Web Authentication API}\n */\nexport class WebAuthnApi {\n constructor(client) {\n this.client = client;\n // Bind all methods so they can be destructured\n this.enroll = this._enroll.bind(this);\n this.challenge = this._challenge.bind(this);\n this.verify = this._verify.bind(this);\n this.authenticate = this._authenticate.bind(this);\n this.register = this._register.bind(this);\n }\n /**\n * Enroll a new WebAuthn factor.\n * Creates an unverified WebAuthn factor that must be verified with a credential.\n *\n * @experimental This method is experimental and may change in future releases\n * @param {Omit<MFAEnrollWebauthnParams, 'factorType'>} params - Enrollment parameters (friendlyName required)\n * @returns {Promise<AuthMFAEnrollWebauthnResponse>} Enrolled factor details or error\n * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}\n */\n async _enroll(params) {\n return this.client.mfa.enroll(Object.assign(Object.assign({}, params), { factorType: 'webauthn' }));\n }\n /**\n * Challenge for WebAuthn credential creation or authentication.\n * Combines server challenge with browser credential operations.\n * Handles both registration (create) and authentication (request) flows.\n *\n * @experimental This method is experimental and may change in future releases\n * @param {MFAChallengeWebauthnParams & { friendlyName?: string; signal?: AbortSignal }} params - Challenge parameters including factorId\n * @param {Object} overrides - Allows you to override the parameters passed to navigator.credentials\n * @param {PublicKeyCredentialCreationOptionsFuture} overrides.create - Override options for credential creation\n * @param {PublicKeyCredentialRequestOptionsFuture} overrides.request - Override options for credential request\n * @returns {Promise<RequestResult>} Challenge response with credential or error\n * @see {@link https://w3c.github.io/webauthn/#sctn-credential-creation W3C WebAuthn Spec - Credential Creation}\n * @see {@link https://w3c.github.io/webauthn/#sctn-verifying-assertion W3C WebAuthn Spec - Verifying Assertion}\n */\n async _challenge({ factorId, webauthn, friendlyName, signal, }, overrides) {\n var _a;\n try {\n // Get challenge from server using the client's MFA methods\n const { data: challengeResponse, error: challengeError } = await this.client.mfa.challenge({\n factorId,\n webauthn,\n });\n if (!challengeResponse) {\n return { data: null, error: challengeError };\n }\n const abortSignal = signal !== null && signal !== void 0 ? signal : webAuthnAbortService.createNewAbortSignal();\n /** webauthn will fail if either of the name/displayname are blank */\n if (challengeResponse.webauthn.type === 'create') {\n const { user } = challengeResponse.webauthn.credential_options.publicKey;\n if (!user.name) {\n // Preserve original format: use friendlyName if provided, otherwise fetch fallback\n // This maintains backward compatibility with the ${user.id}:${name} format\n const nameToUse = friendlyName;\n if (!nameToUse) {\n // Only fetch user data if friendlyName is not provided (bug fix for null friendlyName)\n const currentUser = await this.client.getUser();\n const userData = currentUser.data.user;\n const fallbackName = ((_a = userData === null || userData === void 0 ? void 0 : userData.user_metadata) === null || _a === void 0 ? void 0 : _a.name) || (userData === null || userData === void 0 ? void 0 : userData.email) || (userData === null || userData === void 0 ? void 0 : userData.id) || 'User';\n user.name = `${user.id}:${fallbackName}`;\n }\n else {\n user.name = `${user.id}:${nameToUse}`;\n }\n }\n if (!user.displayName) {\n user.displayName = user.name;\n }\n }\n switch (challengeResponse.webauthn.type) {\n case 'create': {\n const options = mergeCredentialCreationOptions(challengeResponse.webauthn.credential_options.publicKey, overrides === null || overrides === void 0 ? void 0 : overrides.create);\n const { data, error } = await createCredential({\n publicKey: options,\n signal: abortSignal,\n });\n if (data) {\n return {\n data: {\n factorId,\n challengeId: challengeResponse.id,\n webauthn: {\n type: challengeResponse.webauthn.type,\n credential_response: data,\n },\n },\n error: null,\n };\n }\n return { data: null, error };\n }\n case 'request': {\n const options = mergeCredentialRequestOptions(challengeResponse.webauthn.credential_options.publicKey, overrides === null || overrides === void 0 ? void 0 : overrides.request);\n const { data, error } = await getCredential(Object.assign(Object.assign({}, challengeResponse.webauthn.credential_options), { publicKey: options, signal: abortSignal }));\n if (data) {\n return {\n data: {\n factorId,\n challengeId: challengeResponse.id,\n webauthn: {\n type: challengeResponse.webauthn.type,\n credential_response: data,\n },\n },\n error: null,\n };\n }\n return { data: null, error };\n }\n }\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n return {\n data: null,\n error: new AuthUnknownError('Unexpected error in challenge', error),\n };\n }\n }\n /**\n * Verify a WebAuthn credential with the server.\n * Completes the WebAuthn ceremony by sending the credential to the server for verification.\n *\n * @experimental This method is experimental and may change in future releases\n * @param {Object} params - Verification parameters\n * @param {string} params.challengeId - ID of the challenge being verified\n * @param {string} params.factorId - ID of the WebAuthn factor\n * @param {MFAVerifyWebauthnParams<T>['webauthn']} params.webauthn - WebAuthn credential response\n * @returns {Promise<AuthMFAVerifyResponse>} Verification result with session or error\n * @see {@link https://w3c.github.io/webauthn/#sctn-verifying-assertion W3C WebAuthn Spec - Verifying an Authentication Assertion}\n * */\n async _verify({ challengeId, factorId, webauthn, }) {\n return this.client.mfa.verify({\n factorId,\n challengeId,\n webauthn: webauthn,\n });\n }\n /**\n * Complete WebAuthn authentication flow.\n * Performs challenge and verification in a single operation for existing credentials.\n *\n * @experimental This method is experimental and may change in future releases\n * @param {Object} params - Authentication parameters\n * @param {string} params.factorId - ID of the WebAuthn factor to authenticate with\n * @param {Object} params.webauthn - WebAuthn configuration\n * @param {string} params.webauthn.rpId - Relying Party ID (defaults to current hostname)\n * @param {string[]} params.webauthn.rpOrigins - Allowed origins (defaults to current origin)\n * @param {AbortSignal} params.webauthn.signal - Optional abort signal\n * @param {PublicKeyCredentialRequestOptionsFuture} overrides - Override options for navigator.credentials.get\n * @returns {Promise<RequestResult<AuthMFAVerifyResponseData, WebAuthnError | AuthError>>} Authentication result\n * @see {@link https://w3c.github.io/webauthn/#sctn-authentication W3C WebAuthn Spec - Authentication Ceremony}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialRequestOptions MDN - PublicKeyCredentialRequestOptions}\n */\n async _authenticate({ factorId, webauthn: { rpId = typeof window !== 'undefined' ? window.location.hostname : undefined, rpOrigins = typeof window !== 'undefined' ? [window.location.origin] : undefined, signal, } = {}, }, overrides) {\n if (!rpId) {\n return {\n data: null,\n error: new AuthError('rpId is required for WebAuthn authentication'),\n };\n }\n try {\n if (!browserSupportsWebAuthn()) {\n return {\n data: null,\n error: new AuthUnknownError('Browser does not support WebAuthn', null),\n };\n }\n // Get challenge and credential\n const { data: challengeResponse, error: challengeError } = await this.challenge({\n factorId,\n webauthn: { rpId, rpOrigins },\n signal,\n }, { request: overrides });\n if (!challengeResponse) {\n return { data: null, error: challengeError };\n }\n const { webauthn } = challengeResponse;\n // Verify credential\n return this._verify({\n factorId,\n challengeId: challengeResponse.challengeId,\n webauthn: {\n type: webauthn.type,\n rpId,\n rpOrigins,\n credential_response: webauthn.credential_response,\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n return {\n data: null,\n error: new AuthUnknownError('Unexpected error in authenticate', error),\n };\n }\n }\n /**\n * Complete WebAuthn registration flow.\n * Performs enrollment, challenge, and verification in a single operation for new credentials.\n *\n * @experimental This method is experimental and may change in future releases\n * @param {Object} params - Registration parameters\n * @param {string} params.friendlyName - User-friendly name for the credential\n * @param {string} params.rpId - Relying Party ID (defaults to current hostname)\n * @param {string[]} params.rpOrigins - Allowed origins (defaults to current origin)\n * @param {AbortSignal} params.signal - Optional abort signal\n * @param {PublicKeyCredentialCreationOptionsFuture} overrides - Override options for navigator.credentials.create\n * @returns {Promise<RequestResult<AuthMFAVerifyResponseData, WebAuthnError | AuthError>>} Registration result\n * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registration Ceremony}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialCreationOptions MDN - PublicKeyCredentialCreationOptions}\n */\n async _register({ friendlyName, webauthn: { rpId = typeof window !== 'undefined' ? window.location.hostname : undefined, rpOrigins = typeof window !== 'undefined' ? [window.location.origin] : undefined, signal, } = {}, }, overrides) {\n if (!rpId) {\n return {\n data: null,\n error: new AuthError('rpId is required for WebAuthn registration'),\n };\n }\n try {\n if (!browserSupportsWebAuthn()) {\n return {\n data: null,\n error: new AuthUnknownError('Browser does not support WebAuthn', null),\n };\n }\n // Enroll factor\n const { data: factor, error: enrollError } = await this._enroll({\n friendlyName,\n });\n if (!factor) {\n await this.client.mfa\n .listFactors()\n .then((factors) => {\n var _a;\n return (_a = factors.data) === null || _a === void 0 ? void 0 : _a.all.find((v) => v.factor_type === 'webauthn' &&\n v.friendly_name === friendlyName &&\n v.status !== 'unverified');\n })\n .then((factor) => (factor ? this.client.mfa.unenroll({ factorId: factor === null || factor === void 0 ? void 0 : factor.id }) : void 0));\n return { data: null, error: enrollError };\n }\n // Get challenge and create credential\n const { data: challengeResponse, error: challengeError } = await this._challenge({\n factorId: factor.id,\n friendlyName: factor.friendly_name,\n webauthn: { rpId, rpOrigins },\n signal,\n }, {\n create: overrides,\n });\n if (!challengeResponse) {\n return { data: null, error: challengeError };\n }\n return this._verify({\n factorId: factor.id,\n challengeId: challengeResponse.challengeId,\n webauthn: {\n rpId,\n rpOrigins,\n type: challengeResponse.webauthn.type,\n credential_response: challengeResponse.webauthn.credential_response,\n },\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: null, error };\n }\n return {\n data: null,\n error: new AuthUnknownError('Unexpected error in register', error),\n };\n }\n }\n}\n//# sourceMappingURL=webauthn.js.map","import GoTrueAdminApi from './GoTrueAdminApi';\nimport { AUTO_REFRESH_TICK_DURATION_MS, AUTO_REFRESH_TICK_THRESHOLD, DEFAULT_HEADERS, EXPIRY_MARGIN_MS, GOTRUE_URL, JWKS_TTL, STORAGE_KEY, } from './lib/constants';\nimport { AuthImplicitGrantRedirectError, AuthInvalidCredentialsError, AuthInvalidJwtError, AuthInvalidTokenResponseError, AuthPKCECodeVerifierMissingError, AuthPKCEGrantCodeExchangeError, AuthSessionMissingError, AuthUnknownError, isAuthApiError, isAuthError, isAuthImplicitGrantRedirectError, isAuthRetryableFetchError, isAuthSessionMissingError, } from './lib/errors';\nimport { _request, _sessionResponse, _sessionResponsePassword, _ssoResponse, _userResponse, } from './lib/fetch';\nimport { assertPasskeyExperimentalEnabled, decodeJWT, deepClone, Deferred, generateCallbackId, getAlgorithm, getCodeChallengeAndMethod, getItemAsync, insecureUserWarningProxy, isBrowser, parseParametersFromURL, removeItemAsync, resolveFetch, retryable, setItemAsync, sleep, supportsLocalStorage, userNotAvailableProxy, validateExp, } from './lib/helpers';\nimport { memoryLocalStorageAdapter } from './lib/local-storage';\nimport { LockAcquireTimeoutError, navigatorLock } from './lib/locks';\nimport { polyfillGlobalThis } from './lib/polyfills';\nimport { version } from './lib/version';\nimport { bytesToBase64URL, stringToUint8Array } from './lib/base64url';\nimport { createSiweMessage, fromHex, getAddress, toHex, } from './lib/web3/ethereum';\nimport { createCredential, deserializeCredentialCreationOptions, deserializeCredentialRequestOptions, getCredential, serializeCredentialCreationResponse, serializeCredentialRequestResponse, browserSupportsWebAuthn, webAuthnAbortService, WebAuthnApi, } from './lib/webauthn';\npolyfillGlobalThis(); // Make \"globalThis\" available\nconst DEFAULT_OPTIONS = {\n url: GOTRUE_URL,\n storageKey: STORAGE_KEY,\n autoRefreshToken: true,\n persistSession: true,\n detectSessionInUrl: true,\n headers: DEFAULT_HEADERS,\n flowType: 'implicit',\n debug: false,\n hasCustomAuthorizationHeader: false,\n throwOnError: false,\n lockAcquireTimeout: 5000, // 5 seconds\n skipAutoInitialize: false,\n experimental: {},\n};\nasync function lockNoOp(name, acquireTimeout, fn) {\n return await fn();\n}\n/**\n * Caches JWKS values for all clients created in the same environment. This is\n * especially useful for shared-memory execution environments such as Vercel's\n * Fluid Compute, AWS Lambda or Supabase's Edge Functions. Regardless of how\n * many clients are created, if they share the same storage key they will use\n * the same JWKS cache, significantly speeding up getClaims() with asymmetric\n * JWTs.\n */\nconst GLOBAL_JWKS = {};\nclass GoTrueClient {\n /**\n * The JWKS used for verifying asymmetric JWTs\n */\n get jwks() {\n var _a, _b;\n return (_b = (_a = GLOBAL_JWKS[this.storageKey]) === null || _a === void 0 ? void 0 : _a.jwks) !== null && _b !== void 0 ? _b : { keys: [] };\n }\n set jwks(value) {\n GLOBAL_JWKS[this.storageKey] = Object.assign(Object.assign({}, GLOBAL_JWKS[this.storageKey]), { jwks: value });\n }\n get jwks_cached_at() {\n var _a, _b;\n return (_b = (_a = GLOBAL_JWKS[this.storageKey]) === null || _a === void 0 ? void 0 : _a.cachedAt) !== null && _b !== void 0 ? _b : Number.MIN_SAFE_INTEGER;\n }\n set jwks_cached_at(value) {\n GLOBAL_JWKS[this.storageKey] = Object.assign(Object.assign({}, GLOBAL_JWKS[this.storageKey]), { cachedAt: value });\n }\n /**\n * Create a new client for use in the browser.\n *\n * @example Using supabase-js (recommended)\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n * const { data, error } = await supabase.auth.getUser()\n * ```\n *\n * @example Standalone import for bundle-sensitive environments\n * ```ts\n * import { GoTrueClient } from '@supabase/auth-js'\n *\n * const auth = new GoTrueClient({\n * url: 'https://xyzcompany.supabase.co/auth/v1',\n * headers: { apikey: 'your-publishable-key' },\n * storageKey: 'supabase-auth',\n * })\n * ```\n */\n constructor(options) {\n var _a, _b, _c, _d;\n /**\n * @experimental\n */\n this.userStorage = null;\n this.memoryStorage = null;\n this.stateChangeEmitters = new Map();\n this.autoRefreshTicker = null;\n this.autoRefreshTickTimeout = null;\n this.visibilityChangedCallback = null;\n this.refreshingDeferred = null;\n /**\n * Keeps track of the async client initialization.\n * When null or not yet resolved the auth state is `unknown`\n * Once resolved the auth state is known and it's safe to call any further client methods.\n * Keep extra care to never reject or throw uncaught errors\n */\n this.initializePromise = null;\n this.detectSessionInUrl = true;\n this.hasCustomAuthorizationHeader = false;\n this.suppressGetSessionWarning = false;\n this.lockAcquired = false;\n this.pendingInLock = [];\n /**\n * Used to broadcast state change events to other tabs listening.\n */\n this.broadcastChannel = null;\n this.logger = console.log;\n const settings = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);\n this.storageKey = settings.storageKey;\n this.instanceID = (_a = GoTrueClient.nextInstanceID[this.storageKey]) !== null && _a !== void 0 ? _a : 0;\n GoTrueClient.nextInstanceID[this.storageKey] = this.instanceID + 1;\n this.logDebugMessages = !!settings.debug;\n if (typeof settings.debug === 'function') {\n this.logger = settings.debug;\n }\n if (this.instanceID > 0 && isBrowser()) {\n const message = `${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;\n console.warn(message);\n if (this.logDebugMessages) {\n console.trace(message);\n }\n }\n this.persistSession = settings.persistSession;\n this.autoRefreshToken = settings.autoRefreshToken;\n this.experimental = (_b = settings.experimental) !== null && _b !== void 0 ? _b : {};\n this.admin = new GoTrueAdminApi({\n url: settings.url,\n headers: settings.headers,\n fetch: settings.fetch,\n experimental: this.experimental,\n });\n this.url = settings.url;\n this.headers = settings.headers;\n this.fetch = resolveFetch(settings.fetch);\n this.lock = settings.lock || lockNoOp;\n this.detectSessionInUrl = settings.detectSessionInUrl;\n this.flowType = settings.flowType;\n this.hasCustomAuthorizationHeader = settings.hasCustomAuthorizationHeader;\n this.throwOnError = settings.throwOnError;\n this.lockAcquireTimeout = settings.lockAcquireTimeout;\n if (settings.lock) {\n this.lock = settings.lock;\n }\n else if (this.persistSession && isBrowser() && ((_c = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _c === void 0 ? void 0 : _c.locks)) {\n this.lock = navigatorLock;\n }\n else {\n this.lock = lockNoOp;\n }\n if (!this.jwks) {\n this.jwks = { keys: [] };\n this.jwks_cached_at = Number.MIN_SAFE_INTEGER;\n }\n this.mfa = {\n verify: this._verify.bind(this),\n enroll: this._enroll.bind(this),\n unenroll: this._unenroll.bind(this),\n challenge: this._challenge.bind(this),\n listFactors: this._listFactors.bind(this),\n challengeAndVerify: this._challengeAndVerify.bind(this),\n getAuthenticatorAssuranceLevel: this._getAuthenticatorAssuranceLevel.bind(this),\n webauthn: new WebAuthnApi(this),\n };\n this.oauth = {\n getAuthorizationDetails: this._getAuthorizationDetails.bind(this),\n approveAuthorization: this._approveAuthorization.bind(this),\n denyAuthorization: this._denyAuthorization.bind(this),\n listGrants: this._listOAuthGrants.bind(this),\n revokeGrant: this._revokeOAuthGrant.bind(this),\n };\n this.passkey = {\n startRegistration: this._startPasskeyRegistration.bind(this),\n verifyRegistration: this._verifyPasskeyRegistration.bind(this),\n startAuthentication: this._startPasskeyAuthentication.bind(this),\n verifyAuthentication: this._verifyPasskeyAuthentication.bind(this),\n list: this._listPasskeys.bind(this),\n update: this._updatePasskey.bind(this),\n delete: this._deletePasskey.bind(this),\n };\n if (this.persistSession) {\n if (settings.storage) {\n this.storage = settings.storage;\n }\n else {\n if (supportsLocalStorage()) {\n this.storage = globalThis.localStorage;\n }\n else {\n this.memoryStorage = {};\n this.storage = memoryLocalStorageAdapter(this.memoryStorage);\n }\n }\n if (settings.userStorage) {\n this.userStorage = settings.userStorage;\n }\n }\n else {\n this.memoryStorage = {};\n this.storage = memoryLocalStorageAdapter(this.memoryStorage);\n }\n if (isBrowser() && globalThis.BroadcastChannel && this.persistSession && this.storageKey) {\n try {\n this.broadcastChannel = new globalThis.BroadcastChannel(this.storageKey);\n }\n catch (e) {\n console.error('Failed to create a new BroadcastChannel, multi-tab state changes will not be available', e);\n }\n (_d = this.broadcastChannel) === null || _d === void 0 ? void 0 : _d.addEventListener('message', async (event) => {\n this._debug('received broadcast notification from other tab or client', event);\n try {\n await this._notifyAllSubscribers(event.data.event, event.data.session, false); // broadcast = false so we don't get an endless loop of messages\n }\n catch (error) {\n this._debug('#broadcastChannel', 'error', error);\n }\n });\n }\n // Only auto-initialize if not explicitly disabled. Skipped in SSR contexts\n // where initialization timing must be controlled. All public methods have\n // lazy initialization, so the client remains fully functional.\n if (!settings.skipAutoInitialize) {\n this.initialize().catch((error) => {\n this._debug('#initialize()', 'error', error);\n });\n }\n }\n /**\n * Returns whether error throwing mode is enabled for this client.\n */\n isThrowOnErrorEnabled() {\n return this.throwOnError;\n }\n /**\n * Centralizes return handling with optional error throwing. When `throwOnError` is enabled\n * and the provided result contains a non-nullish error, the error is thrown instead of\n * being returned. This ensures consistent behavior across all public API methods.\n */\n _returnResult(result) {\n if (this.throwOnError && result && result.error) {\n throw result.error;\n }\n return result;\n }\n _logPrefix() {\n return ('GoTrueClient@' +\n `${this.storageKey}:${this.instanceID} (${version}) ${new Date().toISOString()}`);\n }\n _debug(...args) {\n if (this.logDebugMessages) {\n this.logger(this._logPrefix(), ...args);\n }\n return this;\n }\n /**\n * Initializes the client session either from the url or from storage.\n * This method is automatically called when instantiating the client, but should also be called\n * manually when checking for an error from an auth redirect (oauth, magiclink, password recovery, etc).\n *\n * @category Auth\n */\n async initialize() {\n if (this.initializePromise) {\n return await this.initializePromise;\n }\n this.initializePromise = (async () => {\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._initialize();\n });\n })();\n return await this.initializePromise;\n }\n /**\n * IMPORTANT:\n * 1. Never throw in this method, as it is called from the constructor\n * 2. Never return a session from this method as it would be cached over\n * the whole lifetime of the client\n */\n async _initialize() {\n var _a;\n try {\n let params = {};\n let callbackUrlType = 'none';\n if (isBrowser()) {\n params = parseParametersFromURL(window.location.href);\n if (this._isImplicitGrantCallback(params)) {\n callbackUrlType = 'implicit';\n }\n else if (await this._isPKCECallback(params)) {\n callbackUrlType = 'pkce';\n }\n }\n /**\n * Attempt to get the session from the URL only if these conditions are fulfilled\n *\n * Note: If the URL isn't one of the callback url types (implicit or pkce),\n * then there could be an existing session so we don't want to prematurely remove it\n */\n if (isBrowser() && this.detectSessionInUrl && callbackUrlType !== 'none') {\n const { data, error } = await this._getSessionFromURL(params, callbackUrlType);\n if (error) {\n this._debug('#_initialize()', 'error detecting session from URL', error);\n if (isAuthImplicitGrantRedirectError(error)) {\n const errorCode = (_a = error.details) === null || _a === void 0 ? void 0 : _a.code;\n if (errorCode === 'identity_already_exists' ||\n errorCode === 'identity_not_found' ||\n errorCode === 'single_identity_not_deletable') {\n return { error };\n }\n }\n // Don't remove existing session on URL login failure.\n // A failed attempt (e.g. reused magic link) shouldn't invalidate a valid session.\n return { error };\n }\n const { session, redirectType } = data;\n this._debug('#_initialize()', 'detected session in URL', session, 'redirect type', redirectType);\n await this._saveSession(session);\n setTimeout(async () => {\n if (redirectType === 'recovery') {\n await this._notifyAllSubscribers('PASSWORD_RECOVERY', session);\n }\n else {\n await this._notifyAllSubscribers('SIGNED_IN', session);\n }\n }, 0);\n return { error: null };\n }\n // no login attempt via callback url try to recover session from storage\n await this._recoverAndRefresh();\n return { error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ error });\n }\n return this._returnResult({\n error: new AuthUnknownError('Unexpected error during initialization', error),\n });\n }\n finally {\n await this._handleVisibilityChange();\n this._debug('#_initialize()', 'end');\n }\n }\n /**\n * Creates a new anonymous user.\n *\n * @returns A session where the is_anonymous claim in the access token JWT set to true\n *\n * @category Auth\n *\n * @remarks\n * - Returns an anonymous user\n * - It is recommended to set up captcha for anonymous sign-ins to prevent abuse. You can pass in the captcha token in the `options` param.\n *\n * @example Create an anonymous user\n * ```js\n * const { data, error } = await supabase.auth.signInAnonymously({\n * options: {\n * captchaToken\n * }\n * });\n * ```\n *\n * @exampleResponse Create an anonymous user\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {},\n * \"user_metadata\": {},\n * \"identities\": [],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": true\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {},\n * \"user_metadata\": {},\n * \"identities\": [],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": true\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Create an anonymous user with custom user metadata\n * ```js\n * const { data, error } = await supabase.auth.signInAnonymously({\n * options: {\n * data\n * }\n * })\n * ```\n */\n async signInAnonymously(credentials) {\n var _a, _b, _c;\n try {\n const res = await _request(this.fetch, 'POST', `${this.url}/signup`, {\n headers: this.headers,\n body: {\n data: (_b = (_a = credentials === null || credentials === void 0 ? void 0 : credentials.options) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {},\n gotrue_meta_security: { captcha_token: (_c = credentials === null || credentials === void 0 ? void 0 : credentials.options) === null || _c === void 0 ? void 0 : _c.captchaToken },\n },\n xform: _sessionResponse,\n });\n const { data, error } = res;\n if (error || !data) {\n return this._returnResult({ data: { user: null, session: null }, error: error });\n }\n const session = data.session;\n const user = data.user;\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', session);\n }\n return this._returnResult({ data: { user, session }, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Creates a new user.\n *\n * Be aware that if a user account exists in the system you may get back an\n * error message that attempts to hide this information from the user.\n * This method has support for PKCE via email signups. The PKCE flow cannot be used when autoconfirm is enabled.\n *\n * @returns A logged-in session if the server has \"autoconfirm\" ON\n * @returns A user if the server has \"autoconfirm\" OFF\n *\n * @category Auth\n *\n * @remarks\n * - By default, the user needs to verify their email address before logging in. To turn this off, disable **Confirm email** in [your project](/dashboard/project/_/auth/providers).\n * - **Confirm email** determines if users need to confirm their email address after signing up.\n * - If **Confirm email** is enabled, a `user` is returned but `session` is null.\n * - If **Confirm email** is disabled, both a `user` and a `session` are returned.\n * - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration).\n * - If signUp() is called for an existing confirmed user:\n * - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned.\n * - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned.\n * - To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser).\n *\n * @example Sign up with an email and password\n * ```js\n * const { data, error } = await supabase.auth.signUp({\n * email: 'example@email.com',\n * password: 'example-password',\n * })\n * ```\n *\n * @exampleResponse Sign up with an email and password\n * ```json\n * // Some fields may be null if \"confirm email\" is enabled.\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {},\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\"\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {},\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\"\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Sign up with a phone number and password (SMS)\n * ```js\n * const { data, error } = await supabase.auth.signUp({\n * phone: '123456789',\n * password: 'example-password',\n * options: {\n * channel: 'sms'\n * }\n * })\n * ```\n *\n * @exampleDescription Sign up with a phone number and password (whatsapp)\n * The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature.\n *\n * @example Sign up with a phone number and password (whatsapp)\n * ```js\n * const { data, error } = await supabase.auth.signUp({\n * phone: '123456789',\n * password: 'example-password',\n * options: {\n * channel: 'whatsapp'\n * }\n * })\n * ```\n *\n * @example Sign up with additional user metadata\n * ```js\n * const { data, error } = await supabase.auth.signUp(\n * {\n * email: 'example@email.com',\n * password: 'example-password',\n * options: {\n * data: {\n * first_name: 'John',\n * age: 27,\n * }\n * }\n * }\n * )\n * ```\n *\n * @exampleDescription Sign up with a redirect URL\n * - See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n *\n * @example Sign up with a redirect URL\n * ```js\n * const { data, error } = await supabase.auth.signUp(\n * {\n * email: 'example@email.com',\n * password: 'example-password',\n * options: {\n * emailRedirectTo: 'https://example.com/welcome'\n * }\n * }\n * )\n * ```\n */\n async signUp(credentials) {\n var _a, _b, _c;\n try {\n let res;\n if ('email' in credentials) {\n const { email, password, options } = credentials;\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod(this.storage, this.storageKey);\n }\n res = await _request(this.fetch, 'POST', `${this.url}/signup`, {\n headers: this.headers,\n redirectTo: options === null || options === void 0 ? void 0 : options.emailRedirectTo,\n body: {\n email,\n password,\n data: (_a = options === null || options === void 0 ? void 0 : options.data) !== null && _a !== void 0 ? _a : {},\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n code_challenge: codeChallenge,\n code_challenge_method: codeChallengeMethod,\n },\n xform: _sessionResponse,\n });\n }\n else if ('phone' in credentials) {\n const { phone, password, options } = credentials;\n res = await _request(this.fetch, 'POST', `${this.url}/signup`, {\n headers: this.headers,\n body: {\n phone,\n password,\n data: (_b = options === null || options === void 0 ? void 0 : options.data) !== null && _b !== void 0 ? _b : {},\n channel: (_c = options === null || options === void 0 ? void 0 : options.channel) !== null && _c !== void 0 ? _c : 'sms',\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n xform: _sessionResponse,\n });\n }\n else {\n throw new AuthInvalidCredentialsError('You must provide either an email or phone number and a password');\n }\n const { data, error } = res;\n if (error || !data) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n return this._returnResult({ data: { user: null, session: null }, error: error });\n }\n const session = data.session;\n const user = data.user;\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', session);\n }\n return this._returnResult({ data: { user, session }, error: null });\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Log in an existing user with an email and password or phone and password.\n *\n * Be aware that you may get back an error message that will not distinguish\n * between the cases where the account does not exist or that the\n * email/phone and password combination is wrong or that the account can only\n * be accessed via social login.\n *\n * @category Auth\n *\n * @remarks\n * - Requires either an email and password or a phone number and password.\n *\n * @example Sign in with email and password\n * ```js\n * const { data, error } = await supabase.auth.signInWithPassword({\n * email: 'example@email.com',\n * password: 'example-password',\n * })\n * ```\n *\n * @exampleResponse Sign in with email and password\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {},\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\"\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {},\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\"\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Sign in with phone and password\n * ```js\n * const { data, error } = await supabase.auth.signInWithPassword({\n * phone: '+13334445555',\n * password: 'some-password',\n * })\n * ```\n */\n async signInWithPassword(credentials) {\n try {\n let res;\n if ('email' in credentials) {\n const { email, password, options } = credentials;\n res = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=password`, {\n headers: this.headers,\n body: {\n email,\n password,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n xform: _sessionResponsePassword,\n });\n }\n else if ('phone' in credentials) {\n const { phone, password, options } = credentials;\n res = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=password`, {\n headers: this.headers,\n body: {\n phone,\n password,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n xform: _sessionResponsePassword,\n });\n }\n else {\n throw new AuthInvalidCredentialsError('You must provide either an email or phone number and a password');\n }\n const { data, error } = res;\n if (error) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n else if (!data || !data.session || !data.user) {\n const invalidTokenError = new AuthInvalidTokenResponseError();\n return this._returnResult({ data: { user: null, session: null }, error: invalidTokenError });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', data.session);\n }\n return this._returnResult({\n data: Object.assign({ user: data.user, session: data.session }, (data.weak_password ? { weakPassword: data.weak_password } : null)),\n error,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Log in an existing user via a third-party provider.\n * This method supports the PKCE flow.\n *\n * @category Auth\n *\n * @remarks\n * - This method is used for signing in using [Social Login (OAuth) providers](/docs/guides/auth#configure-third-party-providers).\n * - It works by redirecting your application to the provider's authorization screen, before bringing back the user to your app.\n *\n * @example Sign in using a third-party provider\n * ```js\n * const { data, error } = await supabase.auth.signInWithOAuth({\n * provider: 'github'\n * })\n * ```\n *\n * @exampleResponse Sign in using a third-party provider\n * ```json\n * {\n * data: {\n * provider: 'github',\n * url: <PROVIDER_URL_TO_REDIRECT_TO>\n * },\n * error: null\n * }\n * ```\n *\n * @exampleDescription Sign in using a third-party provider with redirect\n * - When the OAuth provider successfully authenticates the user, they are redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls). It does not redirect the user immediately after invoking this method.\n * - See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n *\n * @example Sign in using a third-party provider with redirect\n * ```js\n * const { data, error } = await supabase.auth.signInWithOAuth({\n * provider: 'github',\n * options: {\n * redirectTo: 'https://example.com/welcome'\n * }\n * })\n * ```\n *\n * @exampleDescription Sign in with scopes and access provider tokens\n * If you need additional access from an OAuth provider, in order to access provider specific APIs in the name of the user, you can do this by passing in the scopes the user should authorize for your application. Note that the `scopes` option takes in **a space-separated list** of scopes.\n *\n * Because OAuth sign-in often includes redirects, you should register an `onAuthStateChange` callback immediately after you create the Supabase client. This callback will listen for the presence of `provider_token` and `provider_refresh_token` properties on the `session` object and store them in local storage. The client library will emit these values **only once** immediately after the user signs in. You can then access them by looking them up in local storage, or send them to your backend servers for further processing.\n *\n * Finally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend.\n *\n * @example Sign in with scopes and access provider tokens\n * ```js\n * // Register this immediately after calling createClient!\n * // Because signInWithOAuth causes a redirect, you need to fetch the\n * // provider tokens from the callback.\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (session && session.provider_token) {\n * window.localStorage.setItem('oauth_provider_token', session.provider_token)\n * }\n *\n * if (session && session.provider_refresh_token) {\n * window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n * }\n *\n * if (event === 'SIGNED_OUT') {\n * window.localStorage.removeItem('oauth_provider_token')\n * window.localStorage.removeItem('oauth_provider_refresh_token')\n * }\n * })\n *\n * // Call this on your Sign in with GitHub button to initiate OAuth\n * // with GitHub with the requested elevated scopes.\n * await supabase.auth.signInWithOAuth({\n * provider: 'github',\n * options: {\n * scopes: 'repo gist notifications'\n * }\n * })\n * ```\n */\n async signInWithOAuth(credentials) {\n var _a, _b, _c, _d;\n return await this._handleProviderSignIn(credentials.provider, {\n redirectTo: (_a = credentials.options) === null || _a === void 0 ? void 0 : _a.redirectTo,\n scopes: (_b = credentials.options) === null || _b === void 0 ? void 0 : _b.scopes,\n queryParams: (_c = credentials.options) === null || _c === void 0 ? void 0 : _c.queryParams,\n skipBrowserRedirect: (_d = credentials.options) === null || _d === void 0 ? void 0 : _d.skipBrowserRedirect,\n });\n }\n /**\n * Log in an existing user by exchanging an Auth Code issued during the PKCE flow.\n *\n * @category Auth\n *\n * @remarks\n * - Used when `flowType` is set to `pkce` in client options.\n *\n * @example Exchange Auth Code\n * ```js\n * supabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225')\n * ```\n *\n * @exampleResponse Exchange Auth Code\n * ```json\n * {\n * \"data\": {\n * session: {\n * access_token: '<ACCESS_TOKEN>',\n * token_type: 'bearer',\n * expires_in: 3600,\n * expires_at: 1700000000,\n * refresh_token: '<REFRESH_TOKEN>',\n * user: {\n * id: '11111111-1111-1111-1111-111111111111',\n * aud: 'authenticated',\n * role: 'authenticated',\n * email: 'example@email.com'\n * email_confirmed_at: '2024-01-01T00:00:00Z',\n * phone: '',\n * confirmation_sent_at: '2024-01-01T00:00:00Z',\n * confirmed_at: '2024-01-01T00:00:00Z',\n * last_sign_in_at: '2024-01-01T00:00:00Z',\n * app_metadata: {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\",\n * \"<OTHER_PROVIDER>\"\n * ]\n * },\n * user_metadata: {\n * email: 'email@email.com',\n * email_verified: true,\n * full_name: 'User Name',\n * iss: '<ISS>',\n * name: 'User Name',\n * phone_verified: false,\n * provider_id: '<PROVIDER_ID>',\n * sub: '<SUB>'\n * },\n * identities: [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"email@example.com\"\n * },\n * {\n * \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n * \"id\": \"<ID>\",\n * \"user_id\": \"<USER_ID>\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": true,\n * \"full_name\": \"User Name\",\n * \"iss\": \"<ISS>\",\n * \"name\": \"User Name\",\n * \"phone_verified\": false,\n * \"provider_id\": \"<PROVIDER_ID>\",\n * \"sub\": \"<SUB>\"\n * },\n * \"provider\": \"<PROVIDER>\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * created_at: '2024-01-01T00:00:00Z',\n * updated_at: '2024-01-01T00:00:00Z',\n * is_anonymous: false\n * },\n * provider_token: '<PROVIDER_TOKEN>',\n * provider_refresh_token: '<PROVIDER_REFRESH_TOKEN>'\n * },\n * user: {\n * id: '11111111-1111-1111-1111-111111111111',\n * aud: 'authenticated',\n * role: 'authenticated',\n * email: 'example@email.com',\n * email_confirmed_at: '2024-01-01T00:00:00Z',\n * phone: '',\n * confirmation_sent_at: '2024-01-01T00:00:00Z',\n * confirmed_at: '2024-01-01T00:00:00Z',\n * last_sign_in_at: '2024-01-01T00:00:00Z',\n * app_metadata: {\n * provider: 'email',\n * providers: [\n * \"email\",\n * \"<OTHER_PROVIDER>\"\n * ]\n * },\n * user_metadata: {\n * email: 'email@email.com',\n * email_verified: true,\n * full_name: 'User Name',\n * iss: '<ISS>',\n * name: 'User Name',\n * phone_verified: false,\n * provider_id: '<PROVIDER_ID>',\n * sub: '<SUB>'\n * },\n * identities: [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"email@example.com\"\n * },\n * {\n * \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n * \"id\": \"<ID>\",\n * \"user_id\": \"<USER_ID>\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": true,\n * \"full_name\": \"User Name\",\n * \"iss\": \"<ISS>\",\n * \"name\": \"User Name\",\n * \"phone_verified\": false,\n * \"provider_id\": \"<PROVIDER_ID>\",\n * \"sub\": \"<SUB>\"\n * },\n * \"provider\": \"<PROVIDER>\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * created_at: '2024-01-01T00:00:00Z',\n * updated_at: '2024-01-01T00:00:00Z',\n * is_anonymous: false\n * },\n * redirectType: null\n * },\n * \"error\": null\n * }\n * ```\n */\n async exchangeCodeForSession(authCode) {\n await this.initializePromise;\n return this._acquireLock(this.lockAcquireTimeout, async () => {\n return this._exchangeCodeForSession(authCode);\n });\n }\n /**\n * Signs in a user by verifying a message signed by the user's private key.\n * Supports Ethereum (via Sign-In-With-Ethereum) & Solana (Sign-In-With-Solana) standards,\n * both of which derive from the EIP-4361 standard\n * With slight variation on Solana's side.\n * @reference https://eips.ethereum.org/EIPS/eip-4361\n *\n * @category Auth\n *\n * @remarks\n * - Uses a Web3 (Ethereum, Solana) wallet to sign a user in.\n * - Read up on the [potential for abuse](/docs/guides/auth/auth-web3#potential-for-abuse) before using it.\n *\n * @example Sign in with Solana or Ethereum (Window API)\n * ```js\n * // uses window.ethereum for the wallet\n * const { data, error } = await supabase.auth.signInWithWeb3({\n * chain: 'ethereum',\n * statement: 'I accept the Terms of Service at https://example.com/tos'\n * })\n *\n * // uses window.solana for the wallet\n * const { data, error } = await supabase.auth.signInWithWeb3({\n * chain: 'solana',\n * statement: 'I accept the Terms of Service at https://example.com/tos'\n * })\n * ```\n *\n * @example Sign in with Ethereum (Message and Signature)\n * ```js\n * const { data, error } = await supabase.auth.signInWithWeb3({\n * chain: 'ethereum',\n * message: '<sign in with ethereum message>',\n * signature: '<hex of the ethereum signature over the message>',\n * })\n * ```\n *\n * @example Sign in with Solana (Brave)\n * ```js\n * const { data, error } = await supabase.auth.signInWithWeb3({\n * chain: 'solana',\n * statement: 'I accept the Terms of Service at https://example.com/tos',\n * wallet: window.braveSolana\n * })\n * ```\n *\n * @example Sign in with Solana (Wallet Adapter)\n * ```jsx\n * function SignInButton() {\n * const wallet = useWallet()\n *\n * return (\n * <>\n * {wallet.connected ? (\n * <button\n * onClick={() => {\n * supabase.auth.signInWithWeb3({\n * chain: 'solana',\n * statement: 'I accept the Terms of Service at https://example.com/tos',\n * wallet,\n * })\n * }}\n * >\n * Sign in with Solana\n * </button>\n * ) : (\n * <WalletMultiButton />\n * )}\n * </>\n * )\n * }\n *\n * function App() {\n * const endpoint = clusterApiUrl('devnet')\n * const wallets = useMemo(() => [], [])\n *\n * return (\n * <ConnectionProvider endpoint={endpoint}>\n * <WalletProvider wallets={wallets}>\n * <WalletModalProvider>\n * <SignInButton />\n * </WalletModalProvider>\n * </WalletProvider>\n * </ConnectionProvider>\n * )\n * }\n * ```\n */\n async signInWithWeb3(credentials) {\n const { chain } = credentials;\n switch (chain) {\n case 'ethereum':\n return await this.signInWithEthereum(credentials);\n case 'solana':\n return await this.signInWithSolana(credentials);\n default:\n throw new Error(`@supabase/auth-js: Unsupported chain \"${chain}\"`);\n }\n }\n async signInWithEthereum(credentials) {\n var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m;\n // TODO: flatten type\n let message;\n let signature;\n if ('message' in credentials) {\n message = credentials.message;\n signature = credentials.signature;\n }\n else {\n const { chain, wallet, statement, options } = credentials;\n let resolvedWallet;\n if (!isBrowser()) {\n if (typeof wallet !== 'object' || !(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('@supabase/auth-js: Both wallet and url must be specified in non-browser environments.');\n }\n resolvedWallet = wallet;\n }\n else if (typeof wallet === 'object') {\n resolvedWallet = wallet;\n }\n else {\n const windowAny = window;\n if ('ethereum' in windowAny &&\n typeof windowAny.ethereum === 'object' &&\n 'request' in windowAny.ethereum &&\n typeof windowAny.ethereum.request === 'function') {\n resolvedWallet = windowAny.ethereum;\n }\n else {\n throw new Error(`@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.`);\n }\n }\n const url = new URL((_a = options === null || options === void 0 ? void 0 : options.url) !== null && _a !== void 0 ? _a : window.location.href);\n const accounts = await resolvedWallet\n .request({\n method: 'eth_requestAccounts',\n })\n .then((accs) => accs)\n .catch(() => {\n throw new Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`);\n });\n if (!accounts || accounts.length === 0) {\n throw new Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);\n }\n const address = getAddress(accounts[0]);\n let chainId = (_b = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _b === void 0 ? void 0 : _b.chainId;\n if (!chainId) {\n const chainIdHex = await resolvedWallet.request({\n method: 'eth_chainId',\n });\n chainId = fromHex(chainIdHex);\n }\n const siweMessage = {\n domain: url.host,\n address: address,\n statement: statement,\n uri: url.href,\n version: '1',\n chainId: chainId,\n nonce: (_c = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _c === void 0 ? void 0 : _c.nonce,\n issuedAt: (_f = (_d = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _d === void 0 ? void 0 : _d.issuedAt) !== null && _f !== void 0 ? _f : new Date(),\n expirationTime: (_g = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _g === void 0 ? void 0 : _g.expirationTime,\n notBefore: (_h = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _h === void 0 ? void 0 : _h.notBefore,\n requestId: (_j = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _j === void 0 ? void 0 : _j.requestId,\n resources: (_k = options === null || options === void 0 ? void 0 : options.signInWithEthereum) === null || _k === void 0 ? void 0 : _k.resources,\n };\n message = createSiweMessage(siweMessage);\n // Sign message\n signature = (await resolvedWallet.request({\n method: 'personal_sign',\n params: [toHex(message), address],\n }));\n }\n try {\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=web3`, {\n headers: this.headers,\n body: Object.assign({ chain: 'ethereum', message,\n signature }, (((_l = credentials.options) === null || _l === void 0 ? void 0 : _l.captchaToken)\n ? { gotrue_meta_security: { captcha_token: (_m = credentials.options) === null || _m === void 0 ? void 0 : _m.captchaToken } }\n : null)),\n xform: _sessionResponse,\n });\n if (error) {\n throw error;\n }\n if (!data || !data.session || !data.user) {\n const invalidTokenError = new AuthInvalidTokenResponseError();\n return this._returnResult({ data: { user: null, session: null }, error: invalidTokenError });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', data.session);\n }\n return this._returnResult({ data: Object.assign({}, data), error });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n async signInWithSolana(credentials) {\n var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o;\n let message;\n let signature;\n if ('message' in credentials) {\n message = credentials.message;\n signature = credentials.signature;\n }\n else {\n const { chain, wallet, statement, options } = credentials;\n let resolvedWallet;\n if (!isBrowser()) {\n if (typeof wallet !== 'object' || !(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('@supabase/auth-js: Both wallet and url must be specified in non-browser environments.');\n }\n resolvedWallet = wallet;\n }\n else if (typeof wallet === 'object') {\n resolvedWallet = wallet;\n }\n else {\n const windowAny = window;\n if ('solana' in windowAny &&\n typeof windowAny.solana === 'object' &&\n (('signIn' in windowAny.solana && typeof windowAny.solana.signIn === 'function') ||\n ('signMessage' in windowAny.solana &&\n typeof windowAny.solana.signMessage === 'function'))) {\n resolvedWallet = windowAny.solana;\n }\n else {\n throw new Error(`@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.`);\n }\n }\n const url = new URL((_a = options === null || options === void 0 ? void 0 : options.url) !== null && _a !== void 0 ? _a : window.location.href);\n if ('signIn' in resolvedWallet && resolvedWallet.signIn) {\n const output = await resolvedWallet.signIn(Object.assign(Object.assign(Object.assign({ issuedAt: new Date().toISOString() }, options === null || options === void 0 ? void 0 : options.signInWithSolana), { \n // non-overridable properties\n version: '1', domain: url.host, uri: url.href }), (statement ? { statement } : null)));\n let outputToProcess;\n if (Array.isArray(output) && output[0] && typeof output[0] === 'object') {\n outputToProcess = output[0];\n }\n else if (output &&\n typeof output === 'object' &&\n 'signedMessage' in output &&\n 'signature' in output) {\n outputToProcess = output;\n }\n else {\n throw new Error('@supabase/auth-js: Wallet method signIn() returned unrecognized value');\n }\n if ('signedMessage' in outputToProcess &&\n 'signature' in outputToProcess &&\n (typeof outputToProcess.signedMessage === 'string' ||\n outputToProcess.signedMessage instanceof Uint8Array) &&\n outputToProcess.signature instanceof Uint8Array) {\n message =\n typeof outputToProcess.signedMessage === 'string'\n ? outputToProcess.signedMessage\n : new TextDecoder().decode(outputToProcess.signedMessage);\n signature = outputToProcess.signature;\n }\n else {\n throw new Error('@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields');\n }\n }\n else {\n if (!('signMessage' in resolvedWallet) ||\n typeof resolvedWallet.signMessage !== 'function' ||\n !('publicKey' in resolvedWallet) ||\n typeof resolvedWallet !== 'object' ||\n !resolvedWallet.publicKey ||\n !('toBase58' in resolvedWallet.publicKey) ||\n typeof resolvedWallet.publicKey.toBase58 !== 'function') {\n throw new Error('@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API');\n }\n message = [\n `${url.host} wants you to sign in with your Solana account:`,\n resolvedWallet.publicKey.toBase58(),\n ...(statement ? ['', statement, ''] : ['']),\n 'Version: 1',\n `URI: ${url.href}`,\n `Issued At: ${(_c = (_b = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _b === void 0 ? void 0 : _b.issuedAt) !== null && _c !== void 0 ? _c : new Date().toISOString()}`,\n ...(((_d = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _d === void 0 ? void 0 : _d.notBefore)\n ? [`Not Before: ${options.signInWithSolana.notBefore}`]\n : []),\n ...(((_f = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _f === void 0 ? void 0 : _f.expirationTime)\n ? [`Expiration Time: ${options.signInWithSolana.expirationTime}`]\n : []),\n ...(((_g = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _g === void 0 ? void 0 : _g.chainId)\n ? [`Chain ID: ${options.signInWithSolana.chainId}`]\n : []),\n ...(((_h = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _h === void 0 ? void 0 : _h.nonce) ? [`Nonce: ${options.signInWithSolana.nonce}`] : []),\n ...(((_j = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _j === void 0 ? void 0 : _j.requestId)\n ? [`Request ID: ${options.signInWithSolana.requestId}`]\n : []),\n ...(((_l = (_k = options === null || options === void 0 ? void 0 : options.signInWithSolana) === null || _k === void 0 ? void 0 : _k.resources) === null || _l === void 0 ? void 0 : _l.length)\n ? [\n 'Resources',\n ...options.signInWithSolana.resources.map((resource) => `- ${resource}`),\n ]\n : []),\n ].join('\\n');\n const maybeSignature = await resolvedWallet.signMessage(new TextEncoder().encode(message), 'utf8');\n if (!maybeSignature || !(maybeSignature instanceof Uint8Array)) {\n throw new Error('@supabase/auth-js: Wallet signMessage() API returned an recognized value');\n }\n signature = maybeSignature;\n }\n }\n try {\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=web3`, {\n headers: this.headers,\n body: Object.assign({ chain: 'solana', message, signature: bytesToBase64URL(signature) }, (((_m = credentials.options) === null || _m === void 0 ? void 0 : _m.captchaToken)\n ? { gotrue_meta_security: { captcha_token: (_o = credentials.options) === null || _o === void 0 ? void 0 : _o.captchaToken } }\n : null)),\n xform: _sessionResponse,\n });\n if (error) {\n throw error;\n }\n if (!data || !data.session || !data.user) {\n const invalidTokenError = new AuthInvalidTokenResponseError();\n return this._returnResult({ data: { user: null, session: null }, error: invalidTokenError });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', data.session);\n }\n return this._returnResult({ data: Object.assign({}, data), error });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n async _exchangeCodeForSession(authCode) {\n const storageItem = await getItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n const [codeVerifier, redirectType] = (storageItem !== null && storageItem !== void 0 ? storageItem : '').split('/');\n try {\n if (!codeVerifier && this.flowType === 'pkce') {\n throw new AuthPKCECodeVerifierMissingError();\n }\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=pkce`, {\n headers: this.headers,\n body: {\n auth_code: authCode,\n code_verifier: codeVerifier,\n },\n xform: _sessionResponse,\n });\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (error) {\n throw error;\n }\n if (!data || !data.session || !data.user) {\n const invalidTokenError = new AuthInvalidTokenResponseError();\n return this._returnResult({\n data: { user: null, session: null, redirectType: null },\n error: invalidTokenError,\n });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers(redirectType === 'recovery' ? 'PASSWORD_RECOVERY' : 'SIGNED_IN', data.session);\n }\n return this._returnResult({ data: Object.assign(Object.assign({}, data), { redirectType: redirectType !== null && redirectType !== void 0 ? redirectType : null }), error });\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({\n data: { user: null, session: null, redirectType: null },\n error,\n });\n }\n throw error;\n }\n }\n /**\n * Allows signing in with an OIDC ID token. The authentication provider used\n * should be enabled and configured.\n *\n * @category Auth\n *\n * @remarks\n * - Use an ID token to sign in.\n * - Especially useful when implementing sign in using native platform dialogs in mobile or desktop apps using Sign in with Apple or Sign in with Google on iOS and Android.\n * - You can also use Google's [One Tap](https://developers.google.com/identity/gsi/web/guides/display-google-one-tap) and [Automatic sign-in](https://developers.google.com/identity/gsi/web/guides/automatic-sign-in-sign-out) via this API.\n *\n * @example Sign In using ID Token\n * ```js\n * const { data, error } = await supabase.auth.signInWithIdToken({\n * provider: 'google',\n * token: 'your-id-token'\n * })\n * ```\n *\n * @exampleResponse Sign In using ID Token\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * ...\n * },\n * \"user_metadata\": {\n * ...\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"provider\": \"google\",\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * ...\n * },\n * \"user_metadata\": {\n * ...\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"provider\": \"google\",\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n */\n async signInWithIdToken(credentials) {\n try {\n const { options, provider, token, access_token, nonce } = credentials;\n const res = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=id_token`, {\n headers: this.headers,\n body: {\n provider,\n id_token: token,\n access_token,\n nonce,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n xform: _sessionResponse,\n });\n const { data, error } = res;\n if (error) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n else if (!data || !data.session || !data.user) {\n const invalidTokenError = new AuthInvalidTokenResponseError();\n return this._returnResult({ data: { user: null, session: null }, error: invalidTokenError });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', data.session);\n }\n return this._returnResult({ data, error });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Log in a user using magiclink or a one-time password (OTP).\n *\n * If the `{{ .ConfirmationURL }}` variable is specified in the email template, a magiclink will be sent.\n * If the `{{ .Token }}` variable is specified in the email template, an OTP will be sent.\n * If you're using phone sign-ins, only an OTP will be sent. You won't be able to send a magiclink for phone sign-ins.\n *\n * Be aware that you may get back an error message that will not distinguish\n * between the cases where the account does not exist or, that the account\n * can only be accessed via social login.\n *\n * Do note that you will need to configure a Whatsapp sender on Twilio\n * if you are using phone sign in with the 'whatsapp' channel. The whatsapp\n * channel is not supported on other providers\n * at this time.\n * This method supports PKCE when an email is passed.\n *\n * @category Auth\n *\n * @remarks\n * - Requires either an email or phone number.\n * - This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number.\n * - If the user doesn't exist, `signInWithOtp()` will signup the user instead. To restrict this behavior, you can set `shouldCreateUser` in `SignInWithPasswordlessCredentials.options` to `false`.\n * - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP.\n * - If you're using phone, you can configure whether you want the user to receive a OTP.\n * - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls).\n * - See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n * - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`.\n * - See our [Twilio Phone Auth Guide](/docs/guides/auth/phone-login?showSMSProvider=Twilio) for details about configuring WhatsApp sign in.\n *\n * @exampleDescription Sign in with email\n * The user will be sent an email which contains either a magiclink or a OTP or both. By default, a given user can only request a OTP once every 60 seconds.\n *\n * @example Sign in with email\n * ```js\n * const { data, error } = await supabase.auth.signInWithOtp({\n * email: 'example@email.com',\n * options: {\n * emailRedirectTo: 'https://example.com/welcome'\n * }\n * })\n * ```\n *\n * @exampleResponse Sign in with email\n * ```json\n * {\n * \"data\": {\n * \"user\": null,\n * \"session\": null\n * },\n * \"error\": null\n * }\n * ```\n *\n * @exampleDescription Sign in with SMS OTP\n * The user will be sent a SMS which contains a OTP. By default, a given user can only request a OTP once every 60 seconds.\n *\n * @example Sign in with SMS OTP\n * ```js\n * const { data, error } = await supabase.auth.signInWithOtp({\n * phone: '+13334445555',\n * })\n * ```\n *\n * @exampleDescription Sign in with WhatsApp OTP\n * The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature.\n *\n * @example Sign in with WhatsApp OTP\n * ```js\n * const { data, error } = await supabase.auth.signInWithOtp({\n * phone: '+13334445555',\n * options: {\n * channel:'whatsapp',\n * }\n * })\n * ```\n */\n async signInWithOtp(credentials) {\n var _a, _b, _c, _d, _f;\n try {\n if ('email' in credentials) {\n const { email, options } = credentials;\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod(this.storage, this.storageKey);\n }\n const { error } = await _request(this.fetch, 'POST', `${this.url}/otp`, {\n headers: this.headers,\n body: {\n email,\n data: (_a = options === null || options === void 0 ? void 0 : options.data) !== null && _a !== void 0 ? _a : {},\n create_user: (_b = options === null || options === void 0 ? void 0 : options.shouldCreateUser) !== null && _b !== void 0 ? _b : true,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n code_challenge: codeChallenge,\n code_challenge_method: codeChallengeMethod,\n },\n redirectTo: options === null || options === void 0 ? void 0 : options.emailRedirectTo,\n });\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n if ('phone' in credentials) {\n const { phone, options } = credentials;\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/otp`, {\n headers: this.headers,\n body: {\n phone,\n data: (_c = options === null || options === void 0 ? void 0 : options.data) !== null && _c !== void 0 ? _c : {},\n create_user: (_d = options === null || options === void 0 ? void 0 : options.shouldCreateUser) !== null && _d !== void 0 ? _d : true,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n channel: (_f = options === null || options === void 0 ? void 0 : options.channel) !== null && _f !== void 0 ? _f : 'sms',\n },\n });\n return this._returnResult({\n data: { user: null, session: null, messageId: data === null || data === void 0 ? void 0 : data.message_id },\n error,\n });\n }\n throw new AuthInvalidCredentialsError('You must provide either an email or phone number.');\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Log in a user given a User supplied OTP or TokenHash received through mobile or email.\n *\n * @category Auth\n *\n * @remarks\n * - The `verifyOtp` method takes in different verification types.\n * - If a phone number is used, the type can either be:\n * 1. `sms` – Used when verifying a one-time password (OTP) sent via SMS during sign-up or sign-in.\n * 2. `phone_change` – Used when verifying an OTP sent to a new phone number during a phone number update process.\n * - If an email address is used, the type can be one of the following (note: `signup` and `magiclink` types are deprecated):\n * 1. `email` – Used when verifying an OTP sent to the user's email during sign-up or sign-in.\n * 2. `recovery` – Used when verifying an OTP sent for account recovery, typically after a password reset request.\n * 3. `invite` – Used when verifying an OTP sent as part of an invitation to join a project or organization.\n * 4. `email_change` – Used when verifying an OTP sent to a new email address during an email update process.\n * - The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user.\n * - The `TokenHash` is contained in the [email templates](/docs/guides/auth/auth-email-templates) and can be used to sign in. You may wish to use the hash for the PKCE flow for Server Side Auth. Read [the Password-based Auth guide](/docs/guides/auth/passwords) for more details.\n *\n * @example Verify Signup One-Time Password (OTP)\n * ```js\n * const { data, error } = await supabase.auth.verifyOtp({ email, token, type: 'email'})\n * ```\n *\n * @exampleResponse Verify Signup One-Time Password (OTP)\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Verify SMS One-Time Password (OTP)\n * ```js\n * const { data, error } = await supabase.auth.verifyOtp({ phone, token, type: 'sms'})\n * ```\n *\n * @example Verify Email Auth (Token Hash)\n * ```js\n * const { data, error } = await supabase.auth.verifyOtp({ token_hash: tokenHash, type: 'email'})\n * ```\n */\n async verifyOtp(params) {\n var _a, _b;\n try {\n let redirectTo = undefined;\n let captchaToken = undefined;\n if ('options' in params) {\n redirectTo = (_a = params.options) === null || _a === void 0 ? void 0 : _a.redirectTo;\n captchaToken = (_b = params.options) === null || _b === void 0 ? void 0 : _b.captchaToken;\n }\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/verify`, {\n headers: this.headers,\n body: Object.assign(Object.assign({}, params), { gotrue_meta_security: { captcha_token: captchaToken } }),\n redirectTo,\n xform: _sessionResponse,\n });\n if (error) {\n throw error;\n }\n if (!data) {\n const tokenVerificationError = new Error('An error occurred on token verification.');\n throw tokenVerificationError;\n }\n const session = data.session;\n const user = data.user;\n if (session === null || session === void 0 ? void 0 : session.access_token) {\n await this._saveSession(session);\n await this._notifyAllSubscribers(params.type == 'recovery' ? 'PASSWORD_RECOVERY' : 'SIGNED_IN', session);\n }\n return this._returnResult({ data: { user, session }, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Attempts a single-sign on using an enterprise Identity Provider. A\n * successful SSO attempt will redirect the current page to the identity\n * provider authorization page. The redirect URL is implementation and SSO\n * protocol specific.\n *\n * You can use it by providing a SSO domain. Typically you can extract this\n * domain by asking users for their email address. If this domain is\n * registered on the Auth instance the redirect will use that organization's\n * currently active SSO Identity Provider for the login.\n *\n * If you have built an organization-specific login page, you can use the\n * organization's SSO Identity Provider UUID directly instead.\n *\n * @category Auth\n *\n * @remarks\n * - Before you can call this method you need to [establish a connection](/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to an identity provider. Use the [CLI commands](/docs/reference/cli/supabase-sso) to do this.\n * - If you've associated an email domain to the identity provider, you can use the `domain` property to start a sign-in flow.\n * - In case you need to use a different way to start the authentication flow with an identity provider, you can use the `providerId` property. For example:\n * - Mapping specific user email addresses with an identity provider.\n * - Using different hints to identity the identity provider to be used by the user, like a company-specific page, IP address or other tracking information.\n *\n * @example Sign in with email domain\n * ```js\n * // You can extract the user's email domain and use it to trigger the\n * // authentication flow with the correct identity provider.\n *\n * const { data, error } = await supabase.auth.signInWithSSO({\n * domain: 'company.com'\n * })\n *\n * if (data?.url) {\n * // redirect the user to the identity provider's authentication flow\n * window.location.href = data.url\n * }\n * ```\n *\n * @example Sign in with provider UUID\n * ```js\n * // Useful when you need to map a user's sign in request according\n * // to different rules that can't use email domains.\n *\n * const { data, error } = await supabase.auth.signInWithSSO({\n * providerId: '21648a9d-8d5a-4555-a9d1-d6375dc14e92'\n * })\n *\n * if (data?.url) {\n * // redirect the user to the identity provider's authentication flow\n * window.location.href = data.url\n * }\n * ```\n */\n async signInWithSSO(params) {\n var _a, _b, _c, _d, _f;\n try {\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod(this.storage, this.storageKey);\n }\n const result = await _request(this.fetch, 'POST', `${this.url}/sso`, {\n body: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ('providerId' in params ? { provider_id: params.providerId } : null)), ('domain' in params ? { domain: params.domain } : null)), { redirect_to: (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.redirectTo) !== null && _b !== void 0 ? _b : undefined }), (((_c = params === null || params === void 0 ? void 0 : params.options) === null || _c === void 0 ? void 0 : _c.captchaToken)\n ? { gotrue_meta_security: { captcha_token: params.options.captchaToken } }\n : null)), { skip_http_redirect: true, code_challenge: codeChallenge, code_challenge_method: codeChallengeMethod }),\n headers: this.headers,\n xform: _ssoResponse,\n });\n // Automatically redirect in browser unless skipBrowserRedirect is true\n if (((_d = result.data) === null || _d === void 0 ? void 0 : _d.url) && isBrowser() && !((_f = params.options) === null || _f === void 0 ? void 0 : _f.skipBrowserRedirect)) {\n window.location.assign(result.data.url);\n }\n return this._returnResult(result);\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Sends a reauthentication OTP to the user's email or phone number.\n * Requires the user to be signed-in.\n *\n * @category Auth\n *\n * @remarks\n * - This method is used together with `updateUser()` when a user's password needs to be updated.\n * - If you require your user to reauthenticate before updating their password, you need to enable the **Secure password change** option in your [project's email provider settings](/dashboard/project/_/auth/providers).\n * - A user is only require to reauthenticate before updating their password if **Secure password change** is enabled and the user **hasn't recently signed in**. A user is deemed recently signed in if the session was created in the last 24 hours.\n * - This method will send a nonce to the user's email. If the user doesn't have a confirmed email address, the method will send the nonce to the user's confirmed phone number instead.\n * - After receiving the OTP, include it as the `nonce` in your `updateUser()` call to finalize the password change.\n *\n * @exampleDescription Send reauthentication nonce\n * Sends a reauthentication nonce to the user's email or phone number.\n *\n * @example Send reauthentication nonce\n * ```js\n * const { error } = await supabase.auth.reauthenticate()\n * ```\n */\n async reauthenticate() {\n await this.initializePromise;\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._reauthenticate();\n });\n }\n async _reauthenticate() {\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError)\n throw sessionError;\n if (!session)\n throw new AuthSessionMissingError();\n const { error } = await _request(this.fetch, 'GET', `${this.url}/reauthenticate`, {\n headers: this.headers,\n jwt: session.access_token,\n });\n return this._returnResult({ data: { user: null, session: null }, error });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Resends an existing signup confirmation email, email change email, SMS OTP or phone change OTP.\n *\n * @category Auth\n *\n * @remarks\n * - Resends a signup confirmation, email change or phone change email to the user.\n * - Passwordless sign-ins can be resent by calling the `signInWithOtp()` method again.\n * - Password recovery emails can be resent by calling the `resetPasswordForEmail()` method again.\n * - This method will only resend an email or phone OTP to the user if there was an initial signup, email change or phone change request being made(note: For existing users signing in with OTP, you should use `signInWithOtp()` again to resend the OTP).\n * - You can specify a redirect url when you resend an email link using the `emailRedirectTo` option.\n *\n * @exampleDescription Resend an email signup confirmation\n * Resends the email signup confirmation to the user\n *\n * @example Resend an email signup confirmation\n * ```js\n * const { error } = await supabase.auth.resend({\n * type: 'signup',\n * email: 'email@example.com',\n * options: {\n * emailRedirectTo: 'https://example.com/welcome'\n * }\n * })\n * ```\n *\n * @exampleDescription Resend a phone signup confirmation\n * Resends the phone signup confirmation email to the user\n *\n * @example Resend a phone signup confirmation\n * ```js\n * const { error } = await supabase.auth.resend({\n * type: 'sms',\n * phone: '1234567890'\n * })\n * ```\n *\n * @exampleDescription Resend email change email\n * Resends the email change email to the user\n *\n * @example Resend email change email\n * ```js\n * const { error } = await supabase.auth.resend({\n * type: 'email_change',\n * email: 'email@example.com'\n * })\n * ```\n *\n * @exampleDescription Resend phone change OTP\n * Resends the phone change OTP to the user\n *\n * @example Resend phone change OTP\n * ```js\n * const { error } = await supabase.auth.resend({\n * type: 'phone_change',\n * phone: '1234567890'\n * })\n * ```\n */\n async resend(credentials) {\n try {\n const endpoint = `${this.url}/resend`;\n if ('email' in credentials) {\n const { email, type, options } = credentials;\n const { error } = await _request(this.fetch, 'POST', endpoint, {\n headers: this.headers,\n body: {\n email,\n type,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n redirectTo: options === null || options === void 0 ? void 0 : options.emailRedirectTo,\n });\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n else if ('phone' in credentials) {\n const { phone, type, options } = credentials;\n const { data, error } = await _request(this.fetch, 'POST', endpoint, {\n headers: this.headers,\n body: {\n phone,\n type,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n });\n return this._returnResult({\n data: { user: null, session: null, messageId: data === null || data === void 0 ? void 0 : data.message_id },\n error,\n });\n }\n throw new AuthInvalidCredentialsError('You must provide either an email or phone number and a type');\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Returns the session, refreshing it if necessary.\n *\n * The session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out.\n *\n * **IMPORTANT:** This method loads values directly from the storage attached\n * to the client. If that storage is based on request cookies for example,\n * the values in it may not be authentic and therefore it's strongly advised\n * against using this method and its results in such circumstances. A warning\n * will be emitted if this is detected. Use {@link #getUser()} instead.\n *\n * @category Auth\n *\n * @remarks\n * - Since the introduction of [asymmetric JWT signing keys](/docs/guides/auth/signing-keys), this method is considered low-level and we encourage you to use `getClaims()` or `getUser()` instead.\n * - Retrieves the current [user session](/docs/guides/auth/sessions) from the storage medium (local storage, cookies).\n * - The session contains an access token (signed JWT), a refresh token and the user object.\n * - If the session's access token is expired or is about to expire, this method will use the refresh token to refresh the session.\n * - When using in a browser, or you've called `startAutoRefresh()` in your environment (React Native, etc.) this function always returns a valid access token without refreshing the session itself, as this is done in the background. This function returns very fast.\n * - **IMPORTANT SECURITY NOTICE:** If using an insecure storage medium, such as cookies or request headers, the user object returned by this function **must not be trusted**. Always verify the JWT using `getClaims()` or your own JWT verification library to securely establish the user's identity and access. You can also use `getUser()` to fetch the user object directly from the Auth server for this purpose.\n * - When using in a browser, this function is synchronized across all tabs using the [LockManager](https://developer.mozilla.org/en-US/docs/Web/API/LockManager) API. In other environments make sure you've defined a proper `lock` property, if necessary, to make sure there are no race conditions while the session is being refreshed.\n *\n * @example Get the session data\n * ```js\n * const { data, error } = await supabase.auth.getSession()\n * ```\n *\n * @exampleResponse Get the session data\n * ```json\n * {\n * \"data\": {\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n */\n async getSession() {\n await this.initializePromise;\n const result = await this._acquireLock(this.lockAcquireTimeout, async () => {\n return this._useSession(async (result) => {\n return result;\n });\n });\n return result;\n }\n /**\n * Acquires a global lock based on the storage key.\n */\n async _acquireLock(acquireTimeout, fn) {\n this._debug('#_acquireLock', 'begin', acquireTimeout);\n try {\n if (this.lockAcquired) {\n const last = this.pendingInLock.length\n ? this.pendingInLock[this.pendingInLock.length - 1]\n : Promise.resolve();\n const result = (async () => {\n await last;\n return await fn();\n })();\n this.pendingInLock.push((async () => {\n try {\n await result;\n }\n catch (_e) {\n // we just care if it finished\n }\n })());\n return result;\n }\n return await this.lock(`lock:${this.storageKey}`, acquireTimeout, async () => {\n this._debug('#_acquireLock', 'lock acquired for storage key', this.storageKey);\n try {\n this.lockAcquired = true;\n const result = fn();\n this.pendingInLock.push((async () => {\n try {\n await result;\n }\n catch (e) {\n // we just care if it finished\n }\n })());\n await result;\n // keep draining the queue until there's nothing to wait on\n while (this.pendingInLock.length) {\n const waitOn = [...this.pendingInLock];\n await Promise.all(waitOn);\n this.pendingInLock.splice(0, waitOn.length);\n }\n return await result;\n }\n finally {\n this._debug('#_acquireLock', 'lock released for storage key', this.storageKey);\n this.lockAcquired = false;\n }\n });\n }\n finally {\n this._debug('#_acquireLock', 'end');\n }\n }\n /**\n * Use instead of {@link #getSession} inside the library. It is\n * semantically usually what you want, as getting a session involves some\n * processing afterwards that requires only one client operating on the\n * session at once across multiple tabs or processes.\n */\n async _useSession(fn) {\n this._debug('#_useSession', 'begin');\n try {\n // the use of __loadSession here is the only correct use of the function!\n const result = await this.__loadSession();\n return await fn(result);\n }\n finally {\n this._debug('#_useSession', 'end');\n }\n }\n /**\n * NEVER USE DIRECTLY!\n *\n * Always use {@link #_useSession}.\n */\n async __loadSession() {\n this._debug('#__loadSession()', 'begin');\n if (!this.lockAcquired) {\n this._debug('#__loadSession()', 'used outside of an acquired lock!', new Error().stack);\n }\n try {\n let currentSession = null;\n const maybeSession = await getItemAsync(this.storage, this.storageKey);\n this._debug('#getSession()', 'session from storage', maybeSession);\n if (maybeSession !== null) {\n if (this._isValidSession(maybeSession)) {\n currentSession = maybeSession;\n }\n else {\n this._debug('#getSession()', 'session from storage is not valid');\n await this._removeSession();\n }\n }\n if (!currentSession) {\n return { data: { session: null }, error: null };\n }\n // A session is considered expired before the access token _actually_\n // expires. When the autoRefreshToken option is off (or when the tab is\n // in the background), very eager users of getSession() -- like\n // realtime-js -- might send a valid JWT which will expire by the time it\n // reaches the server.\n const hasExpired = currentSession.expires_at\n ? currentSession.expires_at * 1000 - Date.now() < EXPIRY_MARGIN_MS\n : false;\n this._debug('#__loadSession()', `session has${hasExpired ? '' : ' not'} expired`, 'expires_at', currentSession.expires_at);\n if (!hasExpired) {\n if (this.userStorage) {\n const maybeUser = (await getItemAsync(this.userStorage, this.storageKey + '-user'));\n if (maybeUser === null || maybeUser === void 0 ? void 0 : maybeUser.user) {\n currentSession.user = maybeUser.user;\n }\n else {\n currentSession.user = userNotAvailableProxy();\n }\n }\n // Wrap the user object with a warning proxy on the server\n // This warns when properties of the user are accessed, not when session.user itself is accessed\n if (this.storage.isServer &&\n currentSession.user &&\n !currentSession.user.__isUserNotAvailableProxy) {\n const suppressWarningRef = { value: this.suppressGetSessionWarning };\n currentSession.user = insecureUserWarningProxy(currentSession.user, suppressWarningRef);\n // Update the client-level suppression flag when the proxy suppresses the warning\n if (suppressWarningRef.value) {\n this.suppressGetSessionWarning = true;\n }\n }\n return { data: { session: currentSession }, error: null };\n }\n const { data: session, error } = await this._callRefreshToken(currentSession.refresh_token);\n if (error) {\n return this._returnResult({ data: { session: null }, error });\n }\n return this._returnResult({ data: { session }, error: null });\n }\n finally {\n this._debug('#__loadSession()', 'end');\n }\n }\n /**\n * Gets the current user details if there is an existing session. This method\n * performs a network request to the Supabase Auth server, so the returned\n * value is authentic and can be used to base authorization rules on.\n *\n * @param jwt Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used.\n *\n * @category Auth\n *\n * @remarks\n * - This method fetches the user object from the database instead of local session.\n * - This method is useful for checking if the user is authorized because it validates the user's access token JWT on the server.\n * - Should always be used when checking for user authorization on the server. On the client, you can instead use `getSession().session.user` for faster results. `getSession` is insecure on the server.\n *\n * @example Get the logged in user with the current existing session\n * ```js\n * const { data: { user } } = await supabase.auth.getUser()\n * ```\n *\n * @exampleResponse Get the logged in user with the current existing session\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Get the logged in user with a custom access token jwt\n * ```js\n * const { data: { user } } = await supabase.auth.getUser(jwt)\n * ```\n */\n async getUser(jwt) {\n if (jwt) {\n return await this._getUser(jwt);\n }\n await this.initializePromise;\n const result = await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._getUser();\n });\n if (result.data.user) {\n this.suppressGetSessionWarning = true;\n }\n return result;\n }\n async _getUser(jwt) {\n try {\n if (jwt) {\n return await _request(this.fetch, 'GET', `${this.url}/user`, {\n headers: this.headers,\n jwt: jwt,\n xform: _userResponse,\n });\n }\n return await this._useSession(async (result) => {\n var _a, _b, _c;\n const { data, error } = result;\n if (error) {\n throw error;\n }\n // returns an error if there is no access_token or custom authorization header\n if (!((_a = data.session) === null || _a === void 0 ? void 0 : _a.access_token) && !this.hasCustomAuthorizationHeader) {\n return { data: { user: null }, error: new AuthSessionMissingError() };\n }\n return await _request(this.fetch, 'GET', `${this.url}/user`, {\n headers: this.headers,\n jwt: (_c = (_b = data.session) === null || _b === void 0 ? void 0 : _b.access_token) !== null && _c !== void 0 ? _c : undefined,\n xform: _userResponse,\n });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n if (isAuthSessionMissingError(error)) {\n // JWT contains a `session_id` which does not correspond to an active\n // session in the database, indicating the user is signed out.\n await this._removeSession();\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n }\n return this._returnResult({ data: { user: null }, error });\n }\n throw error;\n }\n }\n /**\n * Updates user data for a logged in user.\n *\n * @category Auth\n *\n * @remarks\n * - In order to use the `updateUser()` method, the user needs to be signed in first.\n * - By default, email updates sends a confirmation link to both the user's current and new email.\n * To only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](/dashboard/project/_/auth/providers).\n *\n * @exampleDescription Update the email for an authenticated user\n * Sends a \"Confirm Email Change\" email to the new address. If **Secure Email Change** is enabled (default), confirmation is also required from the **old email** before the change is applied. To skip dual confirmation and apply the change after only the new email is verified, disable **Secure Email Change** in the [Email Auth Provider settings](/dashboard/project/_/auth/providers?provider=Email).\n *\n * @example Update the email for an authenticated user\n * ```js\n * const { data, error } = await supabase.auth.updateUser({\n * email: 'new@email.com'\n * })\n * ```\n *\n * @exampleResponse Update the email for an authenticated user\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"new_email\": \"new@email.com\",\n * \"email_change_sent_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @exampleDescription Update the phone number for an authenticated user\n * Sends a one-time password (OTP) to the new phone number.\n *\n * @example Update the phone number for an authenticated user\n * ```js\n * const { data, error } = await supabase.auth.updateUser({\n * phone: '123456789'\n * })\n * ```\n *\n * @example Update the password for an authenticated user\n * ```js\n * const { data, error } = await supabase.auth.updateUser({\n * password: 'new password'\n * })\n * ```\n *\n * @exampleDescription Update the user's metadata\n * Updates the user's custom metadata.\n *\n * **Note**: The `data` field maps to the `auth.users.raw_user_meta_data` column in your Supabase database. When calling `getUser()`, the data will be available as `user.user_metadata`.\n *\n * @example Update the user's metadata\n * ```js\n * const { data, error } = await supabase.auth.updateUser({\n * data: { hello: 'world' }\n * })\n * ```\n *\n * @exampleDescription Update the user's password with a nonce\n * If **Secure password change** is enabled in your [project's email provider settings](/dashboard/project/_/auth/providers), updating the user's password would require a nonce if the user **hasn't recently signed in**. The nonce is sent to the user's email or phone number. A user is deemed recently signed in if the session was created in the last 24 hours.\n *\n * @example Update the user's password with a nonce\n * ```js\n * const { data, error } = await supabase.auth.updateUser({\n * password: 'new password',\n * nonce: '123456'\n * })\n * ```\n */\n async updateUser(attributes, options = {}) {\n await this.initializePromise;\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._updateUser(attributes, options);\n });\n }\n async _updateUser(attributes, options = {}) {\n try {\n return await this._useSession(async (result) => {\n const { data: sessionData, error: sessionError } = result;\n if (sessionError) {\n throw sessionError;\n }\n if (!sessionData.session) {\n throw new AuthSessionMissingError();\n }\n const session = sessionData.session;\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce' && attributes.email != null) {\n ;\n [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod(this.storage, this.storageKey);\n }\n const { data, error: userError } = await _request(this.fetch, 'PUT', `${this.url}/user`, {\n headers: this.headers,\n redirectTo: options === null || options === void 0 ? void 0 : options.emailRedirectTo,\n body: Object.assign(Object.assign({}, attributes), { code_challenge: codeChallenge, code_challenge_method: codeChallengeMethod }),\n jwt: session.access_token,\n xform: _userResponse,\n });\n if (userError) {\n throw userError;\n }\n session.user = data.user;\n await this._saveSession(session);\n await this._notifyAllSubscribers('USER_UPDATED', session);\n return this._returnResult({ data: { user: session.user }, error: null });\n });\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null }, error });\n }\n throw error;\n }\n }\n /**\n * Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.\n * If the refresh token or access token in the current session is invalid, an error will be thrown.\n * @param currentSession The current session that minimally contains an access token and refresh token.\n *\n * @category Auth\n *\n * @remarks\n * - This method sets the session using an `access_token` and `refresh_token`.\n * - If successful, a `SIGNED_IN` event is emitted.\n *\n * @exampleDescription Set the session\n * Sets the session data from an access_token and refresh_token, then returns an auth response or error.\n *\n * @example Set the session\n * ```js\n * const { data, error } = await supabase.auth.setSession({\n * access_token,\n * refresh_token\n * })\n * ```\n *\n * @exampleResponse Set the session\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"11111111-1111-1111-1111-111111111111\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"2024-01-01T00:00:00Z\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * },\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3500,\n * \"expires_at\": 1700000000\n * }\n * },\n * \"error\": null\n * }\n * ```\n */\n async setSession(currentSession) {\n await this.initializePromise;\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._setSession(currentSession);\n });\n }\n async _setSession(currentSession) {\n try {\n if (!currentSession.access_token || !currentSession.refresh_token) {\n throw new AuthSessionMissingError();\n }\n const timeNow = Date.now() / 1000;\n let expiresAt = timeNow;\n let hasExpired = true;\n let session = null;\n const { payload } = decodeJWT(currentSession.access_token);\n if (payload.exp) {\n expiresAt = payload.exp;\n hasExpired = expiresAt <= timeNow;\n }\n if (hasExpired) {\n const { data: refreshedSession, error } = await this._callRefreshToken(currentSession.refresh_token);\n if (error) {\n return this._returnResult({ data: { user: null, session: null }, error: error });\n }\n if (!refreshedSession) {\n return { data: { user: null, session: null }, error: null };\n }\n session = refreshedSession;\n }\n else {\n const { data, error } = await this._getUser(currentSession.access_token);\n if (error) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n session = {\n access_token: currentSession.access_token,\n refresh_token: currentSession.refresh_token,\n user: data.user,\n token_type: 'bearer',\n expires_in: expiresAt - timeNow,\n expires_at: expiresAt,\n };\n await this._saveSession(session);\n await this._notifyAllSubscribers('SIGNED_IN', session);\n }\n return this._returnResult({ data: { user: session.user, session }, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { session: null, user: null }, error });\n }\n throw error;\n }\n }\n /**\n * Returns a new session, regardless of expiry status.\n * Takes in an optional current session. If not passed in, then refreshSession() will attempt to retrieve it from getSession().\n * If the current session's refresh token is invalid, an error will be thrown.\n * @param currentSession The current session. If passed in, it must contain a refresh token.\n *\n * @category Auth\n *\n * @remarks\n * - This method will refresh and return a new session whether the current one is expired or not.\n *\n * @example Refresh session using the current session\n * ```js\n * const { data, error } = await supabase.auth.refreshSession()\n * const { session, user } = data\n * ```\n *\n * @exampleResponse Refresh session using the current session\n * ```json\n * {\n * \"data\": {\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * },\n * \"session\": {\n * \"access_token\": \"<ACCESS_TOKEN>\",\n * \"token_type\": \"bearer\",\n * \"expires_in\": 3600,\n * \"expires_at\": 1700000000,\n * \"refresh_token\": \"<REFRESH_TOKEN>\",\n * \"user\": {\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"aud\": \"authenticated\",\n * \"role\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"phone\": \"\",\n * \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"app_metadata\": {\n * \"provider\": \"email\",\n * \"providers\": [\n * \"email\"\n * ]\n * },\n * \"user_metadata\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ],\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"is_anonymous\": false\n * }\n * }\n * },\n * \"error\": null\n * }\n * ```\n *\n * @example Refresh session using a refresh token\n * ```js\n * const { data, error } = await supabase.auth.refreshSession({ refresh_token })\n * const { session, user } = data\n * ```\n */\n async refreshSession(currentSession) {\n await this.initializePromise;\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._refreshSession(currentSession);\n });\n }\n async _refreshSession(currentSession) {\n try {\n return await this._useSession(async (result) => {\n var _a;\n if (!currentSession) {\n const { data, error } = result;\n if (error) {\n throw error;\n }\n currentSession = (_a = data.session) !== null && _a !== void 0 ? _a : undefined;\n }\n if (!(currentSession === null || currentSession === void 0 ? void 0 : currentSession.refresh_token)) {\n throw new AuthSessionMissingError();\n }\n const { data: session, error } = await this._callRefreshToken(currentSession.refresh_token);\n if (error) {\n return this._returnResult({ data: { user: null, session: null }, error: error });\n }\n if (!session) {\n return this._returnResult({ data: { user: null, session: null }, error: null });\n }\n return this._returnResult({ data: { user: session.user, session }, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n }\n /**\n * Gets the session data from a URL string\n */\n async _getSessionFromURL(params, callbackUrlType) {\n var _a;\n try {\n if (!isBrowser())\n throw new AuthImplicitGrantRedirectError('No browser detected.');\n // If there's an error in the URL, it doesn't matter what flow it is, we just return the error.\n if (params.error || params.error_description || params.error_code) {\n // The error class returned implies that the redirect is from an implicit grant flow\n // but it could also be from a redirect error from a PKCE flow.\n throw new AuthImplicitGrantRedirectError(params.error_description || 'Error in URL with unspecified error_description', {\n error: params.error || 'unspecified_error',\n code: params.error_code || 'unspecified_code',\n });\n }\n // Checks for mismatches between the flowType initialised in the client and the URL parameters\n switch (callbackUrlType) {\n case 'implicit':\n if (this.flowType === 'pkce') {\n throw new AuthPKCEGrantCodeExchangeError('Not a valid PKCE flow url.');\n }\n break;\n case 'pkce':\n if (this.flowType === 'implicit') {\n throw new AuthImplicitGrantRedirectError('Not a valid implicit grant flow url.');\n }\n break;\n default:\n // there's no mismatch so we continue\n }\n // Since this is a redirect for PKCE, we attempt to retrieve the code from the URL for the code exchange\n if (callbackUrlType === 'pkce') {\n this._debug('#_initialize()', 'begin', 'is PKCE flow', true);\n if (!params.code)\n throw new AuthPKCEGrantCodeExchangeError('No code detected.');\n const { data, error } = await this._exchangeCodeForSession(params.code);\n if (error)\n throw error;\n const url = new URL(window.location.href);\n url.searchParams.delete('code');\n window.history.replaceState(window.history.state, '', url.toString());\n return {\n data: { session: data.session, redirectType: (_a = data.redirectType) !== null && _a !== void 0 ? _a : null },\n error: null,\n };\n }\n const { provider_token, provider_refresh_token, access_token, refresh_token, expires_in, expires_at, token_type, } = params;\n if (!access_token || !expires_in || !refresh_token || !token_type) {\n throw new AuthImplicitGrantRedirectError('No session defined in URL');\n }\n const timeNow = Math.round(Date.now() / 1000);\n const expiresIn = parseInt(expires_in);\n let expiresAt = timeNow + expiresIn;\n if (expires_at) {\n expiresAt = parseInt(expires_at);\n }\n const actuallyExpiresIn = expiresAt - timeNow;\n if (actuallyExpiresIn * 1000 <= AUTO_REFRESH_TICK_DURATION_MS) {\n console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${actuallyExpiresIn}s, should have been closer to ${expiresIn}s`);\n }\n const issuedAt = expiresAt - expiresIn;\n if (timeNow - issuedAt >= 120) {\n console.warn('@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale', issuedAt, expiresAt, timeNow);\n }\n else if (timeNow - issuedAt < 0) {\n console.warn('@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew', issuedAt, expiresAt, timeNow);\n }\n const { data, error } = await this._getUser(access_token);\n if (error)\n throw error;\n const session = {\n provider_token,\n provider_refresh_token,\n access_token,\n expires_in: expiresIn,\n expires_at: expiresAt,\n refresh_token,\n token_type: token_type,\n user: data.user,\n };\n // Remove tokens from URL\n window.location.hash = '';\n this._debug('#_getSessionFromURL()', 'clearing window.location.hash');\n return this._returnResult({ data: { session, redirectType: params.type }, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { session: null, redirectType: null }, error });\n }\n throw error;\n }\n }\n /**\n * Checks if the current URL contains parameters given by an implicit oauth grant flow (https://www.rfc-editor.org/rfc/rfc6749.html#section-4.2)\n *\n * If `detectSessionInUrl` is a function, it will be called with the URL and params to determine\n * if the URL should be processed as a Supabase auth callback. This allows users to exclude\n * URLs from other OAuth providers (e.g., Facebook Login) that also return access_token in the fragment.\n */\n _isImplicitGrantCallback(params) {\n if (typeof this.detectSessionInUrl === 'function') {\n return this.detectSessionInUrl(new URL(window.location.href), params);\n }\n return Boolean(params.access_token || params.error_description);\n }\n /**\n * Checks if the current URL and backing storage contain parameters given by a PKCE flow\n */\n async _isPKCECallback(params) {\n const currentStorageContent = await getItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n return !!(params.code && currentStorageContent);\n }\n /**\n * Inside a browser context, `signOut()` will remove the logged in user from the browser session and log them out - removing all items from localstorage and then trigger a `\"SIGNED_OUT\"` event.\n *\n * For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.\n * There is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.\n *\n * If using `others` scope, no `SIGNED_OUT` event is fired!\n *\n * **Warning:** the default `scope` is `'global'`. This signs the user out of\n * **every device they are currently signed in on**, not just the current\n * tab/session. If you only want to sign the user out of the current session\n * (the behavior most other auth libraries default to), pass\n * `{ scope: 'local' }` explicitly.\n *\n * @category Auth\n *\n * @remarks\n * - In order to use the `signOut()` method, the user needs to be signed in first.\n * - By default, `signOut()` uses the **global** scope, which signs out the user\n * on every device they are signed in on (not just the current one). Pass\n * `{ scope: 'local' }` to only sign out the current session. This is\n * usually what apps want on a \"Sign out\" button, especially when users\n * sign in from multiple devices and do not expect signing out of one to\n * terminate the others.\n * - Since Supabase Auth uses JWTs for authentication, the access token JWT will be valid until it's expired. When the user signs out, Supabase revokes the refresh token and deletes the JWT from the client-side. This does not revoke the JWT and it will still be valid until it expires.\n *\n * @example Sign out of every device (global – default)\n * ```js\n * const { error } = await supabase.auth.signOut()\n * ```\n *\n * @example Sign out only the current session (recommended for most apps)\n * ```js\n * const { error } = await supabase.auth.signOut({ scope: 'local' })\n * ```\n *\n * @example Sign out of all other sessions, keep the current one\n * ```js\n * const { error } = await supabase.auth.signOut({ scope: 'others' })\n * ```\n */\n async signOut(options = { scope: 'global' }) {\n await this.initializePromise;\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._signOut(options);\n });\n }\n async _signOut({ scope } = { scope: 'global' }) {\n return await this._useSession(async (result) => {\n var _a;\n const { data, error: sessionError } = result;\n if (sessionError && !isAuthSessionMissingError(sessionError)) {\n return this._returnResult({ error: sessionError });\n }\n const accessToken = (_a = data.session) === null || _a === void 0 ? void 0 : _a.access_token;\n if (accessToken) {\n const { error } = await this.admin.signOut(accessToken, scope);\n if (error) {\n // ignore 404s since user might not exist anymore\n // ignore 401s since an invalid or expired JWT should sign out the current session\n if (!((isAuthApiError(error) &&\n (error.status === 404 || error.status === 401 || error.status === 403)) ||\n isAuthSessionMissingError(error))) {\n return this._returnResult({ error });\n }\n }\n }\n if (scope !== 'others') {\n await this._removeSession();\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n }\n return this._returnResult({ error: null });\n });\n }\n /** *\n * @category Auth\n *\n * @remarks\n * - Subscribes to important events occurring on the user's session.\n * - Use on the frontend/client. It is less useful on the server.\n * - Events are emitted across tabs to keep your application's UI up-to-date. Some events can fire very frequently, based on the number of tabs open. Use a quick and efficient callback function, and defer or debounce as many operations as you can to be performed outside of the callback.\n * - **Important:** A callback can be an `async` function and it runs synchronously during the processing of the changes causing the event. You can easily create a dead-lock by using `await` on a call to another method of the Supabase library.\n * - Avoid using `async` functions as callbacks.\n * - Limit the number of `await` calls in `async` callbacks.\n * - Do not use other Supabase functions in the callback function. If you must, dispatch the functions once the callback has finished executing. Use this as a quick way to achieve this:\n * ```js\n * supabase.auth.onAuthStateChange((event, session) => {\n * setTimeout(async () => {\n * // await on other Supabase function here\n * // this runs right after the callback has finished\n * }, 0)\n * })\n * ```\n * - Emitted events:\n * - `INITIAL_SESSION`\n * - Emitted right after the Supabase client is constructed and the initial session from storage is loaded.\n * - `SIGNED_IN`\n * - Emitted each time a user session is confirmed or re-established, including on user sign in and when refocusing a tab.\n * - Avoid making assumptions as to when this event is fired, this may occur even when the user is already signed in. Instead, check the user object attached to the event to see if a new user has signed in and update your application's UI.\n * - This event can fire very frequently depending on the number of tabs open in your application.\n * - `SIGNED_OUT`\n * - Emitted when the user signs out. This can be after:\n * - A call to `supabase.auth.signOut()`.\n * - After the user's session has expired for any reason:\n * - User has signed out on another device.\n * - The session has reached its timebox limit or inactivity timeout.\n * - User has signed in on another device with single session per user enabled.\n * - Check the [User Sessions](/docs/guides/auth/sessions) docs for more information.\n * - Use this to clean up any local storage your application has associated with the user.\n * - `TOKEN_REFRESHED`\n * - Emitted each time a new access and refresh token are fetched for the signed in user.\n * - It's best practice and highly recommended to extract the access token (JWT) and store it in memory for further use in your application.\n * - Avoid frequent calls to `supabase.auth.getSession()` for the same purpose.\n * - There is a background process that keeps track of when the session should be refreshed so you will always receive valid tokens by listening to this event.\n * - The frequency of this event is related to the JWT expiry limit configured on your project.\n * - `USER_UPDATED`\n * - Emitted each time the `supabase.auth.updateUser()` method finishes successfully. Listen to it to update your application's UI based on new profile information.\n * - `PASSWORD_RECOVERY`\n * - Emitted instead of the `SIGNED_IN` event when the user lands on a page that includes a password recovery link in the URL.\n * - Use it to show a UI to the user where they can [reset their password](/docs/guides/auth/passwords#resetting-a-users-password-forgot-password).\n *\n * @example Listen to auth changes\n * ```js\n * const { data } = supabase.auth.onAuthStateChange((event, session) => {\n * console.log(event, session)\n *\n * if (event === 'INITIAL_SESSION') {\n * // handle initial session\n * } else if (event === 'SIGNED_IN') {\n * // handle sign in event\n * } else if (event === 'SIGNED_OUT') {\n * // handle sign out event\n * } else if (event === 'PASSWORD_RECOVERY') {\n * // handle password recovery event\n * } else if (event === 'TOKEN_REFRESHED') {\n * // handle token refreshed event\n * } else if (event === 'USER_UPDATED') {\n * // handle user updated event\n * }\n * })\n *\n * // call unsubscribe to remove the callback\n * data.subscription.unsubscribe()\n * ```\n *\n * @exampleDescription Listen to sign out\n * Make sure you clear out any local data, such as local and session storage, after the client library has detected the user's sign out.\n *\n * @example Listen to sign out\n * ```js\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (event === 'SIGNED_OUT') {\n * console.log('SIGNED_OUT', session)\n *\n * // clear local and session storage\n * [\n * window.localStorage,\n * window.sessionStorage,\n * ].forEach((storage) => {\n * Object.entries(storage)\n * .forEach(([key]) => {\n * storage.removeItem(key)\n * })\n * })\n * }\n * })\n * ```\n *\n * @exampleDescription Store OAuth provider tokens on sign in\n * When using [OAuth (Social Login)](/docs/guides/auth/social-login) you sometimes wish to get access to the provider's access token and refresh token, in order to call provider APIs in the name of the user.\n *\n * For example, if you are using [Sign in with Google](/docs/guides/auth/social-login/auth-google) you may want to use the provider token to call Google APIs on behalf of the user. Supabase Auth does not keep track of the provider access and refresh token, but does return them for you once, immediately after sign in. You can use the `onAuthStateChange` method to listen for the presence of the provider tokens and store them in local storage. You can further send them to your server's APIs for use on the backend.\n *\n * Finally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend.\n *\n * @example Store OAuth provider tokens on sign in\n * ```js\n * // Register this immediately after calling createClient!\n * // Because signInWithOAuth causes a redirect, you need to fetch the\n * // provider tokens from the callback.\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (session && session.provider_token) {\n * window.localStorage.setItem('oauth_provider_token', session.provider_token)\n * }\n *\n * if (session && session.provider_refresh_token) {\n * window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n * }\n *\n * if (event === 'SIGNED_OUT') {\n * window.localStorage.removeItem('oauth_provider_token')\n * window.localStorage.removeItem('oauth_provider_refresh_token')\n * }\n * })\n * ```\n *\n * @exampleDescription Use React Context for the User's session\n * Instead of relying on `supabase.auth.getSession()` within your React components, you can use a [React Context](https://react.dev/reference/react/createContext) to store the latest session information from the `onAuthStateChange` callback and access it that way.\n *\n * @example Use React Context for the User's session\n * ```js\n * const SessionContext = React.createContext(null)\n *\n * function main() {\n * const [session, setSession] = React.useState(null)\n *\n * React.useEffect(() => {\n * const {data: { subscription }} = supabase.auth.onAuthStateChange(\n * (event, session) => {\n * if (event === 'SIGNED_OUT') {\n * setSession(null)\n * } else if (session) {\n * setSession(session)\n * }\n * })\n *\n * return () => {\n * subscription.unsubscribe()\n * }\n * }, [])\n *\n * return (\n * <SessionContext.Provider value={session}>\n * <App />\n * </SessionContext.Provider>\n * )\n * }\n * ```\n *\n * @example Listen to password recovery events\n * ```js\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (event === 'PASSWORD_RECOVERY') {\n * console.log('PASSWORD_RECOVERY', session)\n * // show screen to update user's password\n * showPasswordResetScreen(true)\n * }\n * })\n * ```\n *\n * @example Listen to sign in\n * ```js\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (event === 'SIGNED_IN') console.log('SIGNED_IN', session)\n * })\n * ```\n *\n * @example Listen to token refresh\n * ```js\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (event === 'TOKEN_REFRESHED') console.log('TOKEN_REFRESHED', session)\n * })\n * ```\n *\n * @example Listen to user updates\n * ```js\n * supabase.auth.onAuthStateChange((event, session) => {\n * if (event === 'USER_UPDATED') console.log('USER_UPDATED', session)\n * })\n * ```\n */\n onAuthStateChange(callback) {\n const id = generateCallbackId();\n const subscription = {\n id,\n callback,\n unsubscribe: () => {\n this._debug('#unsubscribe()', 'state change callback with id removed', id);\n this.stateChangeEmitters.delete(id);\n },\n };\n this._debug('#onAuthStateChange()', 'registered callback with id', id);\n this.stateChangeEmitters.set(id, subscription);\n (async () => {\n await this.initializePromise;\n await this._acquireLock(this.lockAcquireTimeout, async () => {\n this._emitInitialSession(id);\n });\n })();\n return { data: { subscription } };\n }\n async _emitInitialSession(id) {\n return await this._useSession(async (result) => {\n var _a, _b;\n try {\n const { data: { session }, error, } = result;\n if (error)\n throw error;\n await ((_a = this.stateChangeEmitters.get(id)) === null || _a === void 0 ? void 0 : _a.callback('INITIAL_SESSION', session));\n this._debug('INITIAL_SESSION', 'callback id', id, 'session', session);\n }\n catch (err) {\n await ((_b = this.stateChangeEmitters.get(id)) === null || _b === void 0 ? void 0 : _b.callback('INITIAL_SESSION', null));\n this._debug('INITIAL_SESSION', 'callback id', id, 'error', err);\n if (isAuthSessionMissingError(err)) {\n console.warn(err);\n }\n else {\n console.error(err);\n }\n }\n });\n }\n /**\n * Sends a password reset request to an email address. This method supports the PKCE flow.\n *\n * @param email The email address of the user.\n * @param options.redirectTo The URL to send the user to after they click the password reset link.\n * @param options.captchaToken Verification token received when the user completes the captcha on the site.\n *\n * @category Auth\n *\n * @remarks\n * - The password reset flow consist of 2 broad steps: (i) Allow the user to login via the password reset link; (ii) Update the user's password.\n * - The `resetPasswordForEmail()` only sends a password reset link to the user's email.\n * To update the user's password, see [`updateUser()`](/docs/reference/javascript/auth-updateuser).\n * - A `PASSWORD_RECOVERY` event will be emitted when the password recovery link is clicked.\n * You can use [`onAuthStateChange()`](/docs/reference/javascript/auth-onauthstatechange) to listen and invoke a callback function on these events.\n * - When the user clicks the reset link in the email they are redirected back to your application.\n * You can configure the URL that the user is redirected to with the `redirectTo` parameter.\n * See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n * - After the user has been redirected successfully, prompt them for a new password and call `updateUser()`:\n * ```js\n * const { data, error } = await supabase.auth.updateUser({\n * password: new_password\n * })\n * ```\n *\n * @example Reset password\n * ```js\n * const { data, error } = await supabase.auth.resetPasswordForEmail(email, {\n * redirectTo: 'https://example.com/update-password',\n * })\n * ```\n *\n * @exampleResponse Reset password\n * ```json\n * {\n * data: {}\n * error: null\n * }\n * ```\n *\n * @example Reset password (React)\n * ```js\n * /**\n * * Step 1: Send the user an email to get a password reset token.\n * * This email contains a link which sends the user back to your application.\n * *\\/\n * const { data, error } = await supabase.auth\n * .resetPasswordForEmail('user@email.com')\n *\n * /**\n * * Step 2: Once the user is redirected back to your application,\n * * ask the user to reset their password.\n * *\\/\n * useEffect(() => {\n * supabase.auth.onAuthStateChange(async (event, session) => {\n * if (event == \"PASSWORD_RECOVERY\") {\n * const newPassword = prompt(\"What would you like your new password to be?\");\n * const { data, error } = await supabase.auth\n * .updateUser({ password: newPassword })\n *\n * if (data) alert(\"Password updated successfully!\")\n * if (error) alert(\"There was an error updating your password.\")\n * }\n * })\n * }, [])\n * ```\n */\n async resetPasswordForEmail(email, options = {}) {\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod(this.storage, this.storageKey, true // isPasswordRecovery\n );\n }\n try {\n return await _request(this.fetch, 'POST', `${this.url}/recover`, {\n body: {\n email,\n code_challenge: codeChallenge,\n code_challenge_method: codeChallengeMethod,\n gotrue_meta_security: { captcha_token: options.captchaToken },\n },\n headers: this.headers,\n redirectTo: options.redirectTo,\n });\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Gets all the identities linked to a user.\n *\n * @category Auth\n *\n * @remarks\n * - The user needs to be signed in to call `getUserIdentities()`.\n *\n * @example Returns a list of identities linked to the user\n * ```js\n * const { data, error } = await supabase.auth.getUserIdentities()\n * ```\n *\n * @exampleResponse Returns a list of identities linked to the user\n * ```json\n * {\n * \"data\": {\n * \"identities\": [\n * {\n * \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n * \"id\": \"2024-01-01T00:00:00Z\",\n * \"user_id\": \"2024-01-01T00:00:00Z\",\n * \"identity_data\": {\n * \"email\": \"example@email.com\",\n * \"email_verified\": false,\n * \"phone_verified\": false,\n * \"sub\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"provider\": \"email\",\n * \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n * \"created_at\": \"2024-01-01T00:00:00Z\",\n * \"updated_at\": \"2024-01-01T00:00:00Z\",\n * \"email\": \"example@email.com\"\n * }\n * ]\n * },\n * \"error\": null\n * }\n * ```\n */\n async getUserIdentities() {\n var _a;\n try {\n const { data, error } = await this.getUser();\n if (error)\n throw error;\n return this._returnResult({ data: { identities: (_a = data.user.identities) !== null && _a !== void 0 ? _a : [] }, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /** *\n * @category Auth\n *\n * @remarks\n * - The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers).\n * - The user needs to be signed in to call `linkIdentity()`.\n * - If the candidate identity is already linked to the existing user or another user, `linkIdentity()` will fail.\n * - If `linkIdentity` is run in the browser, the user is automatically redirected to the returned URL. On the server, you should handle the redirect.\n *\n * @example Link an identity to a user\n * ```js\n * const { data, error } = await supabase.auth.linkIdentity({\n * provider: 'github'\n * })\n * ```\n *\n * @exampleResponse Link an identity to a user\n * ```json\n * {\n * data: {\n * provider: 'github',\n * url: <PROVIDER_URL_TO_REDIRECT_TO>\n * },\n * error: null\n * }\n * ```\n */\n async linkIdentity(credentials) {\n if ('token' in credentials) {\n return this.linkIdentityIdToken(credentials);\n }\n return this.linkIdentityOAuth(credentials);\n }\n async linkIdentityOAuth(credentials) {\n var _a;\n try {\n const { data, error } = await this._useSession(async (result) => {\n var _a, _b, _c, _d, _f;\n const { data, error } = result;\n if (error)\n throw error;\n const url = await this._getUrlForProvider(`${this.url}/user/identities/authorize`, credentials.provider, {\n redirectTo: (_a = credentials.options) === null || _a === void 0 ? void 0 : _a.redirectTo,\n scopes: (_b = credentials.options) === null || _b === void 0 ? void 0 : _b.scopes,\n queryParams: (_c = credentials.options) === null || _c === void 0 ? void 0 : _c.queryParams,\n skipBrowserRedirect: true,\n });\n return await _request(this.fetch, 'GET', url, {\n headers: this.headers,\n jwt: (_f = (_d = data.session) === null || _d === void 0 ? void 0 : _d.access_token) !== null && _f !== void 0 ? _f : undefined,\n });\n });\n if (error)\n throw error;\n if (isBrowser() && !((_a = credentials.options) === null || _a === void 0 ? void 0 : _a.skipBrowserRedirect)) {\n window.location.assign(data === null || data === void 0 ? void 0 : data.url);\n }\n return this._returnResult({\n data: { provider: credentials.provider, url: data === null || data === void 0 ? void 0 : data.url },\n error: null,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: { provider: credentials.provider, url: null }, error });\n }\n throw error;\n }\n }\n async linkIdentityIdToken(credentials) {\n return await this._useSession(async (result) => {\n var _a;\n try {\n const { error: sessionError, data: { session }, } = result;\n if (sessionError)\n throw sessionError;\n const { options, provider, token, access_token, nonce } = credentials;\n const res = await _request(this.fetch, 'POST', `${this.url}/token?grant_type=id_token`, {\n headers: this.headers,\n jwt: (_a = session === null || session === void 0 ? void 0 : session.access_token) !== null && _a !== void 0 ? _a : undefined,\n body: {\n provider,\n id_token: token,\n access_token,\n nonce,\n link_identity: true,\n gotrue_meta_security: { captcha_token: options === null || options === void 0 ? void 0 : options.captchaToken },\n },\n xform: _sessionResponse,\n });\n const { data, error } = res;\n if (error) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n else if (!data || !data.session || !data.user) {\n return this._returnResult({\n data: { user: null, session: null },\n error: new AuthInvalidTokenResponseError(),\n });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('USER_UPDATED', data.session);\n }\n return this._returnResult({ data, error });\n }\n catch (error) {\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n if (isAuthError(error)) {\n return this._returnResult({ data: { user: null, session: null }, error });\n }\n throw error;\n }\n });\n }\n /**\n * Unlinks an identity from a user by deleting it. The user will no longer be able to sign in with that identity once it's unlinked.\n *\n * @category Auth\n *\n * @remarks\n * - The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers).\n * - The user needs to be signed in to call `unlinkIdentity()`.\n * - The user must have at least 2 identities in order to unlink an identity.\n * - The identity to be unlinked must belong to the user.\n *\n * @example Unlink an identity\n * ```js\n * // retrieve all identities linked to a user\n * const identities = await supabase.auth.getUserIdentities()\n *\n * // find the google identity\n * const googleIdentity = identities.find(\n * identity => identity.provider === 'google'\n * )\n *\n * // unlink the google identity\n * const { error } = await supabase.auth.unlinkIdentity(googleIdentity)\n * ```\n */\n async unlinkIdentity(identity) {\n try {\n return await this._useSession(async (result) => {\n var _a, _b;\n const { data, error } = result;\n if (error) {\n throw error;\n }\n return await _request(this.fetch, 'DELETE', `${this.url}/user/identities/${identity.identity_id}`, {\n headers: this.headers,\n jwt: (_b = (_a = data.session) === null || _a === void 0 ? void 0 : _a.access_token) !== null && _b !== void 0 ? _b : undefined,\n });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Generates a new JWT.\n * @param refreshToken A valid refresh token that was returned on login.\n */\n async _refreshAccessToken(refreshToken) {\n const debugName = `#_refreshAccessToken(${refreshToken.substring(0, 5)}...)`;\n this._debug(debugName, 'begin');\n try {\n const startedAt = Date.now();\n // will attempt to refresh the token with exponential backoff\n return await retryable(async (attempt) => {\n if (attempt > 0) {\n await sleep(200 * Math.pow(2, attempt - 1)); // 200, 400, 800, ...\n }\n this._debug(debugName, 'refreshing attempt', attempt);\n return await _request(this.fetch, 'POST', `${this.url}/token?grant_type=refresh_token`, {\n body: { refresh_token: refreshToken },\n headers: this.headers,\n xform: _sessionResponse,\n });\n }, (attempt, error) => {\n const nextBackOffInterval = 200 * Math.pow(2, attempt);\n return (error &&\n isAuthRetryableFetchError(error) &&\n // retryable only if the request can be sent before the backoff overflows the tick duration\n Date.now() + nextBackOffInterval - startedAt < AUTO_REFRESH_TICK_DURATION_MS);\n });\n }\n catch (error) {\n this._debug(debugName, 'error', error);\n if (isAuthError(error)) {\n return this._returnResult({ data: { session: null, user: null }, error });\n }\n throw error;\n }\n finally {\n this._debug(debugName, 'end');\n }\n }\n _isValidSession(maybeSession) {\n const isValidSession = typeof maybeSession === 'object' &&\n maybeSession !== null &&\n 'access_token' in maybeSession &&\n 'refresh_token' in maybeSession &&\n 'expires_at' in maybeSession;\n return isValidSession;\n }\n async _handleProviderSignIn(provider, options) {\n const url = await this._getUrlForProvider(`${this.url}/authorize`, provider, {\n redirectTo: options.redirectTo,\n scopes: options.scopes,\n queryParams: options.queryParams,\n });\n this._debug('#_handleProviderSignIn()', 'provider', provider, 'options', options, 'url', url);\n // try to open on the browser\n if (isBrowser() && !options.skipBrowserRedirect) {\n window.location.assign(url);\n }\n return { data: { provider, url }, error: null };\n }\n /**\n * Recovers the session from LocalStorage and refreshes the token\n * Note: this method is async to accommodate for AsyncStorage e.g. in React native.\n */\n async _recoverAndRefresh() {\n var _a, _b;\n const debugName = '#_recoverAndRefresh()';\n this._debug(debugName, 'begin');\n try {\n const currentSession = (await getItemAsync(this.storage, this.storageKey));\n if (currentSession && this.userStorage) {\n let maybeUser = (await getItemAsync(this.userStorage, this.storageKey + '-user'));\n if (!this.storage.isServer && Object.is(this.storage, this.userStorage) && !maybeUser) {\n // storage and userStorage are the same storage medium, for example\n // window.localStorage if userStorage does not have the user from\n // storage stored, store it first thereby migrating the user object\n // from storage -> userStorage\n maybeUser = { user: currentSession.user };\n await setItemAsync(this.userStorage, this.storageKey + '-user', maybeUser);\n }\n currentSession.user = (_a = maybeUser === null || maybeUser === void 0 ? void 0 : maybeUser.user) !== null && _a !== void 0 ? _a : userNotAvailableProxy();\n }\n else if (currentSession && !currentSession.user) {\n // user storage is not set, let's check if it was previously enabled so\n // we bring back the storage as it should be\n if (!currentSession.user) {\n // test if userStorage was previously enabled and the storage medium was the same, to move the user back under the same key\n const separateUser = (await getItemAsync(this.storage, this.storageKey + '-user'));\n if (separateUser && (separateUser === null || separateUser === void 0 ? void 0 : separateUser.user)) {\n currentSession.user = separateUser.user;\n await removeItemAsync(this.storage, this.storageKey + '-user');\n await setItemAsync(this.storage, this.storageKey, currentSession);\n }\n else {\n currentSession.user = userNotAvailableProxy();\n }\n }\n }\n this._debug(debugName, 'session from storage', currentSession);\n if (!this._isValidSession(currentSession)) {\n this._debug(debugName, 'session is not valid');\n if (currentSession !== null) {\n await this._removeSession();\n }\n return;\n }\n const expiresWithMargin = ((_b = currentSession.expires_at) !== null && _b !== void 0 ? _b : Infinity) * 1000 - Date.now() < EXPIRY_MARGIN_MS;\n this._debug(debugName, `session has${expiresWithMargin ? '' : ' not'} expired with margin of ${EXPIRY_MARGIN_MS}s`);\n if (expiresWithMargin) {\n if (this.autoRefreshToken && currentSession.refresh_token) {\n const { error } = await this._callRefreshToken(currentSession.refresh_token);\n if (error) {\n console.error(error);\n if (!isAuthRetryableFetchError(error)) {\n this._debug(debugName, 'refresh failed with a non-retryable error, removing the session', error);\n await this._removeSession();\n }\n }\n }\n }\n else if (currentSession.user &&\n currentSession.user.__isUserNotAvailableProxy === true) {\n // If we have a proxy user, try to get the real user data\n try {\n const { data, error: userError } = await this._getUser(currentSession.access_token);\n if (!userError && (data === null || data === void 0 ? void 0 : data.user)) {\n currentSession.user = data.user;\n await this._saveSession(currentSession);\n await this._notifyAllSubscribers('SIGNED_IN', currentSession);\n }\n else {\n this._debug(debugName, 'could not get user data, skipping SIGNED_IN notification');\n }\n }\n catch (getUserError) {\n console.error('Error getting user data:', getUserError);\n this._debug(debugName, 'error getting user data, skipping SIGNED_IN notification', getUserError);\n }\n }\n else {\n // no need to persist currentSession again, as we just loaded it from\n // local storage; persisting it again may overwrite a value saved by\n // another client with access to the same local storage\n await this._notifyAllSubscribers('SIGNED_IN', currentSession);\n }\n }\n catch (err) {\n this._debug(debugName, 'error', err);\n console.error(err);\n return;\n }\n finally {\n this._debug(debugName, 'end');\n }\n }\n async _callRefreshToken(refreshToken) {\n var _a, _b;\n if (!refreshToken) {\n throw new AuthSessionMissingError();\n }\n // refreshing is already in progress\n if (this.refreshingDeferred) {\n return this.refreshingDeferred.promise;\n }\n const debugName = `#_callRefreshToken(${refreshToken.substring(0, 5)}...)`;\n this._debug(debugName, 'begin');\n try {\n this.refreshingDeferred = new Deferred();\n const { data, error } = await this._refreshAccessToken(refreshToken);\n if (error)\n throw error;\n if (!data.session)\n throw new AuthSessionMissingError();\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('TOKEN_REFRESHED', data.session);\n const result = { data: data.session, error: null };\n this.refreshingDeferred.resolve(result);\n return result;\n }\n catch (error) {\n this._debug(debugName, 'error', error);\n if (isAuthError(error)) {\n const result = { data: null, error };\n if (!isAuthRetryableFetchError(error)) {\n await this._removeSession();\n }\n (_a = this.refreshingDeferred) === null || _a === void 0 ? void 0 : _a.resolve(result);\n return result;\n }\n (_b = this.refreshingDeferred) === null || _b === void 0 ? void 0 : _b.reject(error);\n throw error;\n }\n finally {\n this.refreshingDeferred = null;\n this._debug(debugName, 'end');\n }\n }\n async _notifyAllSubscribers(event, session, broadcast = true) {\n const debugName = `#_notifyAllSubscribers(${event})`;\n this._debug(debugName, 'begin', session, `broadcast = ${broadcast}`);\n try {\n if (this.broadcastChannel && broadcast) {\n this.broadcastChannel.postMessage({ event, session });\n }\n const errors = [];\n const promises = Array.from(this.stateChangeEmitters.values()).map(async (x) => {\n try {\n await x.callback(event, session);\n }\n catch (e) {\n errors.push(e);\n }\n });\n await Promise.all(promises);\n if (errors.length > 0) {\n for (let i = 0; i < errors.length; i += 1) {\n console.error(errors[i]);\n }\n throw errors[0];\n }\n }\n finally {\n this._debug(debugName, 'end');\n }\n }\n /**\n * set currentSession and currentUser\n * process to _startAutoRefreshToken if possible\n */\n async _saveSession(session) {\n this._debug('#_saveSession()', session);\n // _saveSession is always called whenever a new session has been acquired\n // so we can safely suppress the warning returned by future getSession calls\n this.suppressGetSessionWarning = true;\n await removeItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n // Create a shallow copy to work with, to avoid mutating the original session object if it's used elsewhere\n const sessionToProcess = Object.assign({}, session);\n const userIsProxy = sessionToProcess.user && sessionToProcess.user.__isUserNotAvailableProxy === true;\n if (this.userStorage) {\n if (!userIsProxy && sessionToProcess.user) {\n // If it's a real user object, save it to userStorage.\n await setItemAsync(this.userStorage, this.storageKey + '-user', {\n user: sessionToProcess.user,\n });\n }\n else if (userIsProxy) {\n // If it's the proxy, it means user was not found in userStorage.\n // We should ensure no stale user data for this key exists in userStorage if we were to save null,\n // or simply not save the proxy. For now, we don't save the proxy here.\n // If there's a need to clear userStorage if user becomes proxy, that logic would go here.\n }\n // Prepare the main session data for primary storage: remove the user property before cloning\n // This is important because the original session.user might be the proxy\n const mainSessionData = Object.assign({}, sessionToProcess);\n delete mainSessionData.user; // Remove user (real or proxy) before cloning for main storage\n const clonedMainSessionData = deepClone(mainSessionData);\n await setItemAsync(this.storage, this.storageKey, clonedMainSessionData);\n }\n else {\n // No userStorage is configured.\n // In this case, session.user should ideally not be a proxy.\n // If it were, structuredClone would fail. This implies an issue elsewhere if user is a proxy here\n const clonedSession = deepClone(sessionToProcess); // sessionToProcess still has its original user property\n await setItemAsync(this.storage, this.storageKey, clonedSession);\n }\n }\n async _removeSession() {\n this._debug('#_removeSession()');\n this.suppressGetSessionWarning = false;\n await removeItemAsync(this.storage, this.storageKey);\n await removeItemAsync(this.storage, this.storageKey + '-code-verifier');\n await removeItemAsync(this.storage, this.storageKey + '-user');\n if (this.userStorage) {\n await removeItemAsync(this.userStorage, this.storageKey + '-user');\n }\n await this._notifyAllSubscribers('SIGNED_OUT', null);\n }\n /**\n * Removes any registered visibilitychange callback.\n *\n * {@see #startAutoRefresh}\n * {@see #stopAutoRefresh}\n */\n _removeVisibilityChangedCallback() {\n this._debug('#_removeVisibilityChangedCallback()');\n const callback = this.visibilityChangedCallback;\n this.visibilityChangedCallback = null;\n try {\n if (callback && isBrowser() && (window === null || window === void 0 ? void 0 : window.removeEventListener)) {\n window.removeEventListener('visibilitychange', callback);\n }\n }\n catch (e) {\n console.error('removing visibilitychange callback failed', e);\n }\n }\n /**\n * This is the private implementation of {@link #startAutoRefresh}. Use this\n * within the library.\n */\n async _startAutoRefresh() {\n await this._stopAutoRefresh();\n this._debug('#_startAutoRefresh()');\n const ticker = setInterval(() => this._autoRefreshTokenTick(), AUTO_REFRESH_TICK_DURATION_MS);\n this.autoRefreshTicker = ticker;\n if (ticker && typeof ticker === 'object' && typeof ticker.unref === 'function') {\n // ticker is a NodeJS Timeout object that has an `unref` method\n // https://nodejs.org/api/timers.html#timeoutunref\n // When auto refresh is used in NodeJS (like for testing) the\n // `setInterval` is preventing the process from being marked as\n // finished and tests run endlessly. This can be prevented by calling\n // `unref()` on the returned object.\n ticker.unref();\n // @ts-expect-error TS has no context of Deno\n }\n else if (typeof Deno !== 'undefined' && typeof Deno.unrefTimer === 'function') {\n // similar like for NodeJS, but with the Deno API\n // https://deno.land/api@latest?unstable&s=Deno.unrefTimer\n // @ts-expect-error TS has no context of Deno\n Deno.unrefTimer(ticker);\n }\n // run the tick immediately, but in the next pass of the event loop so that\n // #_initialize can be allowed to complete without recursively waiting on\n // itself\n const timeout = setTimeout(async () => {\n await this.initializePromise;\n await this._autoRefreshTokenTick();\n }, 0);\n this.autoRefreshTickTimeout = timeout;\n if (timeout && typeof timeout === 'object' && typeof timeout.unref === 'function') {\n timeout.unref();\n // @ts-expect-error TS has no context of Deno\n }\n else if (typeof Deno !== 'undefined' && typeof Deno.unrefTimer === 'function') {\n // @ts-expect-error TS has no context of Deno\n Deno.unrefTimer(timeout);\n }\n }\n /**\n * This is the private implementation of {@link #stopAutoRefresh}. Use this\n * within the library.\n */\n async _stopAutoRefresh() {\n this._debug('#_stopAutoRefresh()');\n const ticker = this.autoRefreshTicker;\n this.autoRefreshTicker = null;\n if (ticker) {\n clearInterval(ticker);\n }\n const timeout = this.autoRefreshTickTimeout;\n this.autoRefreshTickTimeout = null;\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n /**\n * Starts an auto-refresh process in the background. The session is checked\n * every few seconds. Close to the time of expiration a process is started to\n * refresh the session. If refreshing fails it will be retried for as long as\n * necessary.\n *\n * If you set the {@link GoTrueClientOptions#autoRefreshToken} you don't need\n * to call this function, it will be called for you.\n *\n * On browsers the refresh process works only when the tab/window is in the\n * foreground to conserve resources as well as prevent race conditions and\n * flooding auth with requests. If you call this method any managed\n * visibility change callback will be removed and you must manage visibility\n * changes on your own.\n *\n * On non-browser platforms the refresh process works *continuously* in the\n * background, which may not be desirable. You should hook into your\n * platform's foreground indication mechanism and call these methods\n * appropriately to conserve resources.\n *\n * {@see #stopAutoRefresh}\n *\n * @category Auth\n *\n * @remarks\n * - Only useful in non-browser environments such as React Native or Electron.\n * - The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n * - On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n * - To give this hint to the application, you should be calling this method when the app is in focus and calling `supabase.auth.stopAutoRefresh()` when it's out of focus.\n *\n * @example Start and stop auto refresh in React Native\n * ```js\n * import { AppState } from 'react-native'\n *\n * // make sure you register this only once!\n * AppState.addEventListener('change', (state) => {\n * if (state === 'active') {\n * supabase.auth.startAutoRefresh()\n * } else {\n * supabase.auth.stopAutoRefresh()\n * }\n * })\n * ```\n */\n async startAutoRefresh() {\n this._removeVisibilityChangedCallback();\n await this._startAutoRefresh();\n }\n /**\n * Stops an active auto refresh process running in the background (if any).\n *\n * If you call this method any managed visibility change callback will be\n * removed and you must manage visibility changes on your own.\n *\n * See {@link #startAutoRefresh} for more details.\n *\n * @category Auth\n *\n * @remarks\n * - Only useful in non-browser environments such as React Native or Electron.\n * - The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n * - On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n * - When your application goes in the background or out of focus, call this method to stop the proactive refreshing of the session.\n *\n * @example Start and stop auto refresh in React Native\n * ```js\n * import { AppState } from 'react-native'\n *\n * // make sure you register this only once!\n * AppState.addEventListener('change', (state) => {\n * if (state === 'active') {\n * supabase.auth.startAutoRefresh()\n * } else {\n * supabase.auth.stopAutoRefresh()\n * }\n * })\n * ```\n */\n async stopAutoRefresh() {\n this._removeVisibilityChangedCallback();\n await this._stopAutoRefresh();\n }\n /**\n * Runs the auto refresh token tick.\n */\n async _autoRefreshTokenTick() {\n this._debug('#_autoRefreshTokenTick()', 'begin');\n try {\n await this._acquireLock(0, async () => {\n try {\n const now = Date.now();\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, } = result;\n if (!session || !session.refresh_token || !session.expires_at) {\n this._debug('#_autoRefreshTokenTick()', 'no session');\n return;\n }\n // session will expire in this many ticks (or has already expired if <= 0)\n const expiresInTicks = Math.floor((session.expires_at * 1000 - now) / AUTO_REFRESH_TICK_DURATION_MS);\n this._debug('#_autoRefreshTokenTick()', `access token expires in ${expiresInTicks} ticks, a tick lasts ${AUTO_REFRESH_TICK_DURATION_MS}ms, refresh threshold is ${AUTO_REFRESH_TICK_THRESHOLD} ticks`);\n if (expiresInTicks <= AUTO_REFRESH_TICK_THRESHOLD) {\n await this._callRefreshToken(session.refresh_token);\n }\n });\n }\n catch (e) {\n console.error('Auto refresh tick failed with error. This is likely a transient error.', e);\n }\n }\n finally {\n this._debug('#_autoRefreshTokenTick()', 'end');\n }\n });\n }\n catch (e) {\n if (e instanceof LockAcquireTimeoutError) {\n this._debug('auto refresh token tick lock not available');\n }\n else {\n throw e;\n }\n }\n }\n /**\n * Registers callbacks on the browser / platform, which in-turn run\n * algorithms when the browser window/tab are in foreground. On non-browser\n * platforms it assumes always foreground.\n */\n async _handleVisibilityChange() {\n this._debug('#_handleVisibilityChange()');\n if (!isBrowser() || !(window === null || window === void 0 ? void 0 : window.addEventListener)) {\n if (this.autoRefreshToken) {\n // in non-browser environments the refresh token ticker runs always\n this.startAutoRefresh();\n }\n return false;\n }\n try {\n this.visibilityChangedCallback = async () => {\n try {\n await this._onVisibilityChanged(false);\n }\n catch (error) {\n this._debug('#visibilityChangedCallback', 'error', error);\n }\n };\n window === null || window === void 0 ? void 0 : window.addEventListener('visibilitychange', this.visibilityChangedCallback);\n // now immediately call the visbility changed callback to setup with the\n // current visbility state\n await this._onVisibilityChanged(true); // initial call\n }\n catch (error) {\n console.error('_handleVisibilityChange', error);\n }\n }\n /**\n * Callback registered with `window.addEventListener('visibilitychange')`.\n */\n async _onVisibilityChanged(calledFromInitialize) {\n const methodName = `#_onVisibilityChanged(${calledFromInitialize})`;\n this._debug(methodName, 'visibilityState', document.visibilityState);\n if (document.visibilityState === 'visible') {\n if (this.autoRefreshToken) {\n // in browser environments the refresh token ticker runs only on focused tabs\n // which prevents race conditions\n this._startAutoRefresh();\n }\n if (!calledFromInitialize) {\n // called when the visibility has changed, i.e. the browser\n // transitioned from hidden -> visible so we need to see if the session\n // should be recovered immediately... but to do that we need to acquire\n // the lock first asynchronously\n await this.initializePromise;\n await this._acquireLock(this.lockAcquireTimeout, async () => {\n if (document.visibilityState !== 'visible') {\n this._debug(methodName, 'acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting');\n // visibility has changed while waiting for the lock, abort\n return;\n }\n // recover the session\n await this._recoverAndRefresh();\n });\n }\n }\n else if (document.visibilityState === 'hidden') {\n if (this.autoRefreshToken) {\n this._stopAutoRefresh();\n }\n }\n }\n /**\n * Generates the relevant login URL for a third-party provider.\n * @param options.redirectTo A URL or mobile address to send the user to after they are confirmed.\n * @param options.scopes A space-separated list of scopes granted to the OAuth application.\n * @param options.queryParams An object of key-value pairs containing query parameters granted to the OAuth application.\n */\n async _getUrlForProvider(url, provider, options) {\n const urlParams = [`provider=${encodeURIComponent(provider)}`];\n if (options === null || options === void 0 ? void 0 : options.redirectTo) {\n urlParams.push(`redirect_to=${encodeURIComponent(options.redirectTo)}`);\n }\n if (options === null || options === void 0 ? void 0 : options.scopes) {\n urlParams.push(`scopes=${encodeURIComponent(options.scopes)}`);\n }\n if (this.flowType === 'pkce') {\n const [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod(this.storage, this.storageKey);\n const flowParams = new URLSearchParams({\n code_challenge: `${encodeURIComponent(codeChallenge)}`,\n code_challenge_method: `${encodeURIComponent(codeChallengeMethod)}`,\n });\n urlParams.push(flowParams.toString());\n }\n if (options === null || options === void 0 ? void 0 : options.queryParams) {\n const query = new URLSearchParams(options.queryParams);\n urlParams.push(query.toString());\n }\n if (options === null || options === void 0 ? void 0 : options.skipBrowserRedirect) {\n urlParams.push(`skip_http_redirect=${options.skipBrowserRedirect}`);\n }\n return `${url}?${urlParams.join('&')}`;\n }\n async _unenroll(params) {\n try {\n return await this._useSession(async (result) => {\n var _a;\n const { data: sessionData, error: sessionError } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n return await _request(this.fetch, 'DELETE', `${this.url}/factors/${params.factorId}`, {\n headers: this.headers,\n jwt: (_a = sessionData === null || sessionData === void 0 ? void 0 : sessionData.session) === null || _a === void 0 ? void 0 : _a.access_token,\n });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n async _enroll(params) {\n try {\n return await this._useSession(async (result) => {\n var _a, _b;\n const { data: sessionData, error: sessionError } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n const body = Object.assign({ friendly_name: params.friendlyName, factor_type: params.factorType }, (params.factorType === 'phone'\n ? { phone: params.phone }\n : params.factorType === 'totp'\n ? { issuer: params.issuer }\n : {}));\n const { data, error } = (await _request(this.fetch, 'POST', `${this.url}/factors`, {\n body,\n headers: this.headers,\n jwt: (_a = sessionData === null || sessionData === void 0 ? void 0 : sessionData.session) === null || _a === void 0 ? void 0 : _a.access_token,\n }));\n if (error) {\n return this._returnResult({ data: null, error });\n }\n if (params.factorType === 'totp' && data.type === 'totp' && ((_b = data === null || data === void 0 ? void 0 : data.totp) === null || _b === void 0 ? void 0 : _b.qr_code)) {\n data.totp.qr_code = `data:image/svg+xml;utf-8,${data.totp.qr_code}`;\n }\n return this._returnResult({ data, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n async _verify(params) {\n return this._acquireLock(this.lockAcquireTimeout, async () => {\n try {\n return await this._useSession(async (result) => {\n var _a;\n const { data: sessionData, error: sessionError } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n const body = Object.assign({ challenge_id: params.challengeId }, ('webauthn' in params\n ? {\n webauthn: Object.assign(Object.assign({}, params.webauthn), { credential_response: params.webauthn.type === 'create'\n ? serializeCredentialCreationResponse(params.webauthn.credential_response)\n : serializeCredentialRequestResponse(params.webauthn.credential_response) }),\n }\n : { code: params.code }));\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/factors/${params.factorId}/verify`, {\n body,\n headers: this.headers,\n jwt: (_a = sessionData === null || sessionData === void 0 ? void 0 : sessionData.session) === null || _a === void 0 ? void 0 : _a.access_token,\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n await this._saveSession(Object.assign({ expires_at: Math.round(Date.now() / 1000) + data.expires_in }, data));\n await this._notifyAllSubscribers('MFA_CHALLENGE_VERIFIED', data);\n return this._returnResult({ data, error });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n });\n }\n async _challenge(params) {\n return this._acquireLock(this.lockAcquireTimeout, async () => {\n try {\n return await this._useSession(async (result) => {\n var _a;\n const { data: sessionData, error: sessionError } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n const response = (await _request(this.fetch, 'POST', `${this.url}/factors/${params.factorId}/challenge`, {\n body: params,\n headers: this.headers,\n jwt: (_a = sessionData === null || sessionData === void 0 ? void 0 : sessionData.session) === null || _a === void 0 ? void 0 : _a.access_token,\n }));\n if (response.error) {\n return response;\n }\n const { data } = response;\n if (data.type !== 'webauthn') {\n return { data, error: null };\n }\n switch (data.webauthn.type) {\n case 'create':\n return {\n data: Object.assign(Object.assign({}, data), { webauthn: Object.assign(Object.assign({}, data.webauthn), { credential_options: Object.assign(Object.assign({}, data.webauthn.credential_options), { publicKey: deserializeCredentialCreationOptions(data.webauthn.credential_options.publicKey) }) }) }),\n error: null,\n };\n case 'request':\n return {\n data: Object.assign(Object.assign({}, data), { webauthn: Object.assign(Object.assign({}, data.webauthn), { credential_options: Object.assign(Object.assign({}, data.webauthn.credential_options), { publicKey: deserializeCredentialRequestOptions(data.webauthn.credential_options.publicKey) }) }) }),\n error: null,\n };\n }\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n });\n }\n /**\n * {@see GoTrueMFAApi#challengeAndVerify}\n */\n async _challengeAndVerify(params) {\n // both _challenge and _verify independently acquire the lock, so no need\n // to acquire it here\n const { data: challengeData, error: challengeError } = await this._challenge({\n factorId: params.factorId,\n });\n if (challengeError) {\n return this._returnResult({ data: null, error: challengeError });\n }\n return await this._verify({\n factorId: params.factorId,\n challengeId: challengeData.id,\n code: params.code,\n });\n }\n /**\n * {@see GoTrueMFAApi#listFactors}\n */\n async _listFactors() {\n var _a;\n // use #getUser instead of #_getUser as the former acquires a lock\n const { data: { user }, error: userError, } = await this.getUser();\n if (userError) {\n return { data: null, error: userError };\n }\n const data = {\n all: [],\n phone: [],\n totp: [],\n webauthn: [],\n };\n // loop over the factors ONCE\n for (const factor of (_a = user === null || user === void 0 ? void 0 : user.factors) !== null && _a !== void 0 ? _a : []) {\n data.all.push(factor);\n if (factor.status === 'verified') {\n ;\n data[factor.factor_type].push(factor);\n }\n }\n return {\n data,\n error: null,\n };\n }\n /**\n * {@see GoTrueMFAApi#getAuthenticatorAssuranceLevel}\n */\n async _getAuthenticatorAssuranceLevel(jwt) {\n var _a, _b, _c, _d;\n if (jwt) {\n try {\n const { payload } = decodeJWT(jwt);\n let currentLevel = null;\n if (payload.aal) {\n currentLevel = payload.aal;\n }\n let nextLevel = currentLevel;\n const { data: { user }, error: userError, } = await this.getUser(jwt);\n if (userError) {\n return this._returnResult({ data: null, error: userError });\n }\n const verifiedFactors = (_b = (_a = user === null || user === void 0 ? void 0 : user.factors) === null || _a === void 0 ? void 0 : _a.filter((factor) => factor.status === 'verified')) !== null && _b !== void 0 ? _b : [];\n if (verifiedFactors.length > 0) {\n nextLevel = 'aal2';\n }\n const currentAuthenticationMethods = payload.amr || [];\n return { data: { currentLevel, nextLevel, currentAuthenticationMethods }, error: null };\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n const { data: { session }, error: sessionError, } = await this.getSession();\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return {\n data: { currentLevel: null, nextLevel: null, currentAuthenticationMethods: [] },\n error: null,\n };\n }\n const { payload } = decodeJWT(session.access_token);\n let currentLevel = null;\n if (payload.aal) {\n currentLevel = payload.aal;\n }\n let nextLevel = currentLevel;\n const verifiedFactors = (_d = (_c = session.user.factors) === null || _c === void 0 ? void 0 : _c.filter((factor) => factor.status === 'verified')) !== null && _d !== void 0 ? _d : [];\n if (verifiedFactors.length > 0) {\n nextLevel = 'aal2';\n }\n const currentAuthenticationMethods = payload.amr || [];\n return { data: { currentLevel, nextLevel, currentAuthenticationMethods }, error: null };\n }\n /**\n * Retrieves details about an OAuth authorization request.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n *\n * Returns authorization details including client info, scopes, and user information.\n * If the response includes only a redirect_url field, it means consent was already given - the caller\n * should handle the redirect manually if needed.\n */\n async _getAuthorizationDetails(authorizationId) {\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n return await _request(this.fetch, 'GET', `${this.url}/oauth/authorizations/${authorizationId}`, {\n headers: this.headers,\n jwt: session.access_token,\n xform: (data) => ({ data, error: null }),\n });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Approves an OAuth authorization request.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n */\n async _approveAuthorization(authorizationId, options) {\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const response = await _request(this.fetch, 'POST', `${this.url}/oauth/authorizations/${authorizationId}/consent`, {\n headers: this.headers,\n jwt: session.access_token,\n body: { action: 'approve' },\n xform: (data) => ({ data, error: null }),\n });\n if (response.data && response.data.redirect_url) {\n // Automatically redirect in browser unless skipBrowserRedirect is true\n if (isBrowser() && !(options === null || options === void 0 ? void 0 : options.skipBrowserRedirect)) {\n window.location.assign(response.data.redirect_url);\n }\n }\n return response;\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Denies an OAuth authorization request.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n */\n async _denyAuthorization(authorizationId, options) {\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const response = await _request(this.fetch, 'POST', `${this.url}/oauth/authorizations/${authorizationId}/consent`, {\n headers: this.headers,\n jwt: session.access_token,\n body: { action: 'deny' },\n xform: (data) => ({ data, error: null }),\n });\n if (response.data && response.data.redirect_url) {\n // Automatically redirect in browser unless skipBrowserRedirect is true\n if (isBrowser() && !(options === null || options === void 0 ? void 0 : options.skipBrowserRedirect)) {\n window.location.assign(response.data.redirect_url);\n }\n }\n return response;\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Lists all OAuth grants that the authenticated user has authorized.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n */\n async _listOAuthGrants() {\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n return await _request(this.fetch, 'GET', `${this.url}/user/oauth/grants`, {\n headers: this.headers,\n jwt: session.access_token,\n xform: (data) => ({ data, error: null }),\n });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Revokes a user's OAuth grant for a specific client.\n * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n */\n async _revokeOAuthGrant(options) {\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n await _request(this.fetch, 'DELETE', `${this.url}/user/oauth/grants`, {\n headers: this.headers,\n jwt: session.access_token,\n query: { client_id: options.clientId },\n noResolveJson: true,\n });\n return { data: {}, error: null };\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n async fetchJwk(kid, jwks = { keys: [] }) {\n // try fetching from the supplied jwks\n let jwk = jwks.keys.find((key) => key.kid === kid);\n if (jwk) {\n return jwk;\n }\n const now = Date.now();\n // try fetching from cache\n jwk = this.jwks.keys.find((key) => key.kid === kid);\n // jwk exists and jwks isn't stale\n if (jwk && this.jwks_cached_at + JWKS_TTL > now) {\n return jwk;\n }\n // jwk isn't cached in memory so we need to fetch it from the well-known endpoint\n const { data, error } = await _request(this.fetch, 'GET', `${this.url}/.well-known/jwks.json`, {\n headers: this.headers,\n });\n if (error) {\n throw error;\n }\n if (!data.keys || data.keys.length === 0) {\n return null;\n }\n this.jwks = data;\n this.jwks_cached_at = now;\n // Find the signing key\n jwk = data.keys.find((key) => key.kid === kid);\n if (!jwk) {\n return null;\n }\n return jwk;\n }\n /**\n * Extracts the JWT claims present in the access token by first verifying the\n * JWT against the server's JSON Web Key Set endpoint\n * `/.well-known/jwks.json` which is often cached, resulting in significantly\n * faster responses. Prefer this method over {@link #getUser} which always\n * sends a request to the Auth server for each JWT.\n *\n * If the project is not using an asymmetric JWT signing key (like ECC or\n * RSA) it always sends a request to the Auth server (similar to {@link\n * #getUser}) to verify the JWT.\n *\n * @param jwt An optional specific JWT you wish to verify, not the one you\n * can obtain from {@link #getSession}.\n * @param options Various additional options that allow you to customize the\n * behavior of this method.\n *\n * @category Auth\n *\n * @remarks\n * - Parses the user's [access token](/docs/guides/auth/sessions#access-token-jwt-claims) as a [JSON Web Token (JWT)](/docs/guides/auth/jwts) and returns its components if valid and not expired.\n * - If your project is using asymmetric JWT signing keys, then the verification is done locally usually without a network request using the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).\n * - A network request is sent to your project's JWT signing key discovery endpoint `https://project-id.supabase.co/auth/v1/.well-known/jwks.json`, which is cached locally. If your environment is ephemeral, such as a Lambda function that is destroyed after every request, a network request will be sent for each new invocation. Supabase provides a network-edge cache providing fast responses for these situations.\n * - If the user's access token is about to expire when calling this function, the user's session will first be refreshed before validating the JWT.\n * - If your project is using a symmetric secret to sign the JWT, it always sends a request similar to `getUser()` to validate the JWT at the server before returning the decoded token. This is also used if the WebCrypto API is not available in the environment. Make sure you polyfill it in such situations.\n * - The returned claims can be customized per project using the [Custom Access Token Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook).\n *\n * @example Get JWT claims, header and signature\n * ```js\n * const { data, error } = await supabase.auth.getClaims()\n * ```\n *\n * @exampleResponse Get JWT claims, header and signature\n * ```json\n * {\n * \"data\": {\n * \"claims\": {\n * \"aal\": \"aal1\",\n * \"amr\": [{\n * \"method\": \"email\",\n * \"timestamp\": 1715766000\n * }],\n * \"app_metadata\": {},\n * \"aud\": \"authenticated\",\n * \"email\": \"example@email.com\",\n * \"exp\": 1715769600,\n * \"iat\": 1715766000,\n * \"is_anonymous\": false,\n * \"iss\": \"https://project-id.supabase.co/auth/v1\",\n * \"phone\": \"+13334445555\",\n * \"role\": \"authenticated\",\n * \"session_id\": \"11111111-1111-1111-1111-111111111111\",\n * \"sub\": \"11111111-1111-1111-1111-111111111111\",\n * \"user_metadata\": {}\n * },\n * \"header\": {\n * \"alg\": \"RS256\",\n * \"typ\": \"JWT\",\n * \"kid\": \"11111111-1111-1111-1111-111111111111\"\n * },\n * \"signature\": [/** Uint8Array *\\/],\n * },\n * \"error\": null\n * }\n * ```\n */\n async getClaims(jwt, options = {}) {\n try {\n let token = jwt;\n if (!token) {\n const { data, error } = await this.getSession();\n if (error || !data.session) {\n return this._returnResult({ data: null, error });\n }\n token = data.session.access_token;\n }\n const { header, payload, signature, raw: { header: rawHeader, payload: rawPayload }, } = decodeJWT(token);\n if (!(options === null || options === void 0 ? void 0 : options.allowExpired)) {\n // Reject expired JWTs should only happen if jwt argument was passed\n validateExp(payload.exp);\n }\n const signingKey = !header.alg ||\n header.alg.startsWith('HS') ||\n !header.kid ||\n !('crypto' in globalThis && 'subtle' in globalThis.crypto)\n ? null\n : await this.fetchJwk(header.kid, (options === null || options === void 0 ? void 0 : options.keys) ? { keys: options.keys } : options === null || options === void 0 ? void 0 : options.jwks);\n // If symmetric algorithm or WebCrypto API is unavailable, fallback to getUser()\n if (!signingKey) {\n const { error } = await this.getUser(token);\n if (error) {\n throw error;\n }\n // getUser succeeds so the claims in the JWT can be trusted\n return {\n data: {\n claims: payload,\n header,\n signature,\n },\n error: null,\n };\n }\n const algorithm = getAlgorithm(header.alg);\n // Convert JWK to CryptoKey\n const publicKey = await crypto.subtle.importKey('jwk', signingKey, algorithm, true, [\n 'verify',\n ]);\n // Verify the signature\n const isValid = await crypto.subtle.verify(algorithm, publicKey, signature, stringToUint8Array(`${rawHeader}.${rawPayload}`));\n if (!isValid) {\n throw new AuthInvalidJwtError('Invalid JWT signature');\n }\n // If verification succeeds, decode and return claims\n return {\n data: {\n claims: payload,\n header,\n signature,\n },\n error: null,\n };\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n // --- Passkey Methods ---\n /**\n * Sign in with a passkey. Handles the full WebAuthn ceremony:\n * 1. Fetches authentication challenge from server\n * 2. Prompts user via navigator.credentials.get()\n * 3. Verifies credential with server and creates session\n *\n * Requires `auth.experimental.passkey: true`.\n *\n * @category Auth\n */\n async signInWithPasskey(credentials) {\n var _a, _b, _c;\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n if (!browserSupportsWebAuthn()) {\n return this._returnResult({\n data: null,\n error: new AuthUnknownError('Browser does not support WebAuthn', null),\n });\n }\n // 1. Get challenge options from server\n const { data: options, error: optionsError } = await this._startPasskeyAuthentication({\n options: { captchaToken: (_a = credentials === null || credentials === void 0 ? void 0 : credentials.options) === null || _a === void 0 ? void 0 : _a.captchaToken },\n });\n if (optionsError || !options) {\n return this._returnResult({ data: null, error: optionsError });\n }\n // 2. Deserialize and prompt user via browser WebAuthn API\n const publicKeyOptions = deserializeCredentialRequestOptions(options.options);\n const signal = (_c = (_b = credentials === null || credentials === void 0 ? void 0 : credentials.options) === null || _b === void 0 ? void 0 : _b.signal) !== null && _c !== void 0 ? _c : webAuthnAbortService.createNewAbortSignal();\n const { data: credential, error: credentialError } = await getCredential({\n publicKey: publicKeyOptions,\n signal,\n });\n if (credentialError || !credential) {\n return this._returnResult({\n data: null,\n error: credentialError !== null && credentialError !== void 0 ? credentialError : new AuthUnknownError('WebAuthn ceremony failed', null),\n });\n }\n // 3. Serialize and verify with server\n const serialized = serializeCredentialRequestResponse(credential);\n return this._verifyPasskeyAuthentication({\n challengeId: options.challenge_id,\n credential: serialized,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Register a passkey for the current authenticated user. Handles the full WebAuthn ceremony:\n * 1. Fetches registration challenge from server\n * 2. Prompts user via navigator.credentials.create()\n * 3. Verifies credential with server\n *\n * Requires an active session. Requires `auth.experimental.passkey: true`.\n *\n * @category Auth\n */\n async registerPasskey(credentials) {\n var _a, _b;\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n if (!browserSupportsWebAuthn()) {\n return this._returnResult({\n data: null,\n error: new AuthUnknownError('Browser does not support WebAuthn', null),\n });\n }\n // 1. Get challenge options from server\n const { data: options, error: optionsError } = await this._startPasskeyRegistration();\n if (optionsError || !options) {\n return this._returnResult({ data: null, error: optionsError });\n }\n // 2. Deserialize and prompt user via browser WebAuthn API\n const publicKeyOptions = deserializeCredentialCreationOptions(options.options);\n const signal = (_b = (_a = credentials === null || credentials === void 0 ? void 0 : credentials.options) === null || _a === void 0 ? void 0 : _a.signal) !== null && _b !== void 0 ? _b : webAuthnAbortService.createNewAbortSignal();\n const { data: credential, error: credentialError } = await createCredential({\n publicKey: publicKeyOptions,\n signal,\n });\n if (credentialError || !credential) {\n return this._returnResult({\n data: null,\n error: credentialError !== null && credentialError !== void 0 ? credentialError : new AuthUnknownError('WebAuthn ceremony failed', null),\n });\n }\n // 3. Serialize and verify with server\n const serialized = serializeCredentialCreationResponse(credential);\n return this._verifyPasskeyRegistration({\n challengeId: options.challenge_id,\n credential: serialized,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Start passkey registration for the current authenticated user.\n * Returns WebAuthn credential creation options to pass to navigator.credentials.create().\n */\n async _startPasskeyRegistration() {\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/passkeys/registration/options`, {\n headers: this.headers,\n jwt: session.access_token,\n body: {},\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n return this._returnResult({ data, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Verify passkey registration with the credential response.\n * The credentialResponse should be the serialized output of navigator.credentials.create().\n */\n async _verifyPasskeyRegistration(params) {\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/passkeys/registration/verify`, {\n headers: this.headers,\n jwt: session.access_token,\n body: {\n challenge_id: params.challengeId,\n credential: params.credential,\n },\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n return this._returnResult({ data, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Start passkey authentication.\n * Returns WebAuthn credential request options to pass to navigator.credentials.get().\n */\n async _startPasskeyAuthentication(params) {\n var _a;\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/passkeys/authentication/options`, {\n headers: this.headers,\n body: {\n gotrue_meta_security: { captcha_token: (_a = params === null || params === void 0 ? void 0 : params.options) === null || _a === void 0 ? void 0 : _a.captchaToken },\n },\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n return this._returnResult({ data, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Verify passkey authentication and create a session.\n * The credential should be the serialized output of navigator.credentials.get().\n */\n async _verifyPasskeyAuthentication(params) {\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n const { data, error } = await _request(this.fetch, 'POST', `${this.url}/passkeys/authentication/verify`, {\n headers: this.headers,\n body: {\n challenge_id: params.challengeId,\n credential: params.credential,\n },\n xform: _sessionResponse,\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n if (data.session) {\n await this._saveSession(data.session);\n await this._notifyAllSubscribers('SIGNED_IN', data.session);\n }\n return this._returnResult({ data, error: null });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * List all passkeys for the current user.\n */\n async _listPasskeys() {\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const { data, error } = await _request(this.fetch, 'GET', `${this.url}/passkeys`, {\n headers: this.headers,\n jwt: session.access_token,\n xform: (data) => ({ data, error: null }),\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n return this._returnResult({ data, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Update a passkey.\n */\n async _updatePasskey(params) {\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const { data, error } = await _request(this.fetch, 'PATCH', `${this.url}/passkeys/${params.passkeyId}`, {\n headers: this.headers,\n jwt: session.access_token,\n body: { friendly_name: params.friendlyName },\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n return this._returnResult({ data, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n /**\n * Delete a passkey.\n */\n async _deletePasskey(params) {\n assertPasskeyExperimentalEnabled(this.experimental);\n try {\n return await this._useSession(async (result) => {\n const { data: { session }, error: sessionError, } = result;\n if (sessionError) {\n return this._returnResult({ data: null, error: sessionError });\n }\n if (!session) {\n return this._returnResult({ data: null, error: new AuthSessionMissingError() });\n }\n const { error } = await _request(this.fetch, 'DELETE', `${this.url}/passkeys/${params.passkeyId}`, {\n headers: this.headers,\n jwt: session.access_token,\n noResolveJson: true,\n });\n if (error) {\n return this._returnResult({ data: null, error });\n }\n return this._returnResult({ data: null, error: null });\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({ data: null, error });\n }\n throw error;\n }\n }\n}\nGoTrueClient.nextInstanceID = {};\nexport default GoTrueClient;\n//# sourceMappingURL=GoTrueClient.js.map","import GoTrueClient from './GoTrueClient';\nconst AuthClient = GoTrueClient;\nexport default AuthClient;\n//# sourceMappingURL=AuthClient.js.map","import { FunctionRegion, FunctionsClient, FunctionsError, FunctionsFetchError, FunctionsHttpError, FunctionsRelayError } from \"@supabase/functions-js\";\nimport { PostgrestClient, PostgrestError } from \"@supabase/postgrest-js\";\nimport { RealtimeClient } from \"@supabase/realtime-js\";\nimport { StorageApiError, StorageClient } from \"@supabase/storage-js\";\nimport { AuthClient } from \"@supabase/auth-js\";\n\nexport * from \"@supabase/realtime-js\"\n\nexport * from \"@supabase/auth-js\"\n\n//#region src/lib/version.ts\nconst version = \"2.106.2\";\n\n//#endregion\n//#region src/lib/constants.ts\nlet JS_ENV = \"\";\nif (typeof Deno !== \"undefined\") JS_ENV = \"deno\";\nelse if (typeof document !== \"undefined\") JS_ENV = \"web\";\nelse if (typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\") JS_ENV = \"react-native\";\nelse JS_ENV = \"node\";\nconst DEFAULT_HEADERS = { \"X-Client-Info\": `supabase-js-${JS_ENV}/${version}` };\nconst DEFAULT_GLOBAL_OPTIONS = { headers: DEFAULT_HEADERS };\nconst DEFAULT_DB_OPTIONS = { schema: \"public\" };\nconst DEFAULT_AUTH_OPTIONS = {\n\tautoRefreshToken: true,\n\tpersistSession: true,\n\tdetectSessionInUrl: true,\n\tflowType: \"implicit\"\n};\nconst DEFAULT_REALTIME_OPTIONS = {};\nconst DEFAULT_TRACE_PROPAGATION_OPTIONS = {\n\tenabled: false,\n\trespectSamplingDecision: true\n};\n\n//#endregion\n//#region ../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs\nfunction __awaiter(thisArg, _arguments, P, generator) {\n\tfunction adopt(value) {\n\t\treturn value instanceof P ? value : new P(function(resolve) {\n\t\t\tresolve(value);\n\t\t});\n\t}\n\treturn new (P || (P = Promise))(function(resolve, reject) {\n\t\tfunction fulfilled(value) {\n\t\t\ttry {\n\t\t\t\tstep(generator.next(value));\n\t\t\t} catch (e) {\n\t\t\t\treject(e);\n\t\t\t}\n\t\t}\n\t\tfunction rejected(value) {\n\t\t\ttry {\n\t\t\t\tstep(generator[\"throw\"](value));\n\t\t\t} catch (e) {\n\t\t\t\treject(e);\n\t\t\t}\n\t\t}\n\t\tfunction step(result) {\n\t\t\tresult.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n\t\t}\n\t\tstep((generator = generator.apply(thisArg, _arguments || [])).next());\n\t});\n}\n\n//#endregion\n//#region ../../shared/tracing/dist/module/extract.js\nlet otelModulePromise = null;\nconst OTEL_PKG = \"@opentelemetry/api\";\nfunction loadOtel() {\n\tif (otelModulePromise === null) otelModulePromise = import(/* webpackIgnore: true */ /* turbopackIgnore: true */ /* @vite-ignore */ OTEL_PKG).catch(() => null);\n\treturn otelModulePromise;\n}\n/**\n* Extract trace context from the OpenTelemetry API.\n*\n* Returns null if `@opentelemetry/api` is not installed or there is no active\n* trace context. The dynamic import is cached after the first call.\n*\n* @returns Trace context with traceparent, tracestate, and baggage headers, or null if unavailable\n*/\nfunction extractTraceContext() {\n\treturn __awaiter(this, void 0, void 0, function* () {\n\t\ttry {\n\t\t\tconst otel = yield loadOtel();\n\t\t\tif (!otel || !otel.propagation || !otel.context) return null;\n\t\t\tconst carrier = {};\n\t\t\totel.propagation.inject(otel.context.active(), carrier);\n\t\t\tconst traceparent = carrier[\"traceparent\"];\n\t\t\tif (!traceparent) return null;\n\t\t\treturn {\n\t\t\t\ttraceparent,\n\t\t\t\ttracestate: carrier[\"tracestate\"],\n\t\t\t\tbaggage: carrier[\"baggage\"]\n\t\t\t};\n\t\t} catch (_a) {\n\t\t\treturn null;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region ../../shared/tracing/dist/module/parse.js\n/**\n* Parse W3C traceparent header according to the specification.\n*\n* The traceparent header format is: version-traceid-parentid-traceflags\n* - version: 2 hex digits (currently always \"00\")\n* - traceid: 32 hex digits (128-bit trace identifier)\n* - parentid: 16 hex digits (64-bit span/parent identifier)\n* - traceflags: 2 hex digits (8-bit flags, bit 0 is sampled flag)\n*\n* @param traceparent - The traceparent header value\n* @returns Parsed traceparent object, or null if invalid format\n*\n* @see https://www.w3.org/TR/trace-context/#traceparent-header\n*\n* @example\n* ```typescript\n* const parsed = parseTraceParent('00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01')\n*\n* console.log(parsed)\n* // {\n* // version: '00',\n* // traceId: '0af7651916cd43dd8448eb211c80319c',\n* // parentId: 'b7ad6b7169203331',\n* // traceFlags: '01',\n* // isSampled: true\n* // }\n* ```\n*/\nfunction parseTraceParent(traceparent) {\n\tif (!traceparent || typeof traceparent !== \"string\") return null;\n\tconst parts = traceparent.split(\"-\");\n\tif (parts.length !== 4) return null;\n\tconst [version$1, traceId, parentId, traceFlags] = parts;\n\tif (version$1.length !== 2 || traceId.length !== 32 || parentId.length !== 16 || traceFlags.length !== 2) return null;\n\tconst hexRegex = /^[0-9a-f]+$/i;\n\tif (!hexRegex.test(version$1) || !hexRegex.test(traceId) || !hexRegex.test(parentId) || !hexRegex.test(traceFlags)) return null;\n\tif (traceId === \"00000000000000000000000000000000\" || parentId === \"0000000000000000\") return null;\n\treturn {\n\t\tversion: version$1,\n\t\ttraceId,\n\t\tparentId,\n\t\ttraceFlags,\n\t\tisSampled: (parseInt(traceFlags, 16) & 1) === 1\n\t};\n}\n\n//#endregion\n//#region ../../shared/tracing/dist/module/validate.js\n/**\n* Check if trace context should be propagated to the target URL.\n*\n* This function checks if the target URL matches any of the configured\n* propagation targets. Targets can be:\n* - String: Exact hostname match or wildcard domain (*.example.com)\n* - RegExp: Pattern matching hostname\n* - Function: Custom logic to determine if URL should receive trace context\n*\n* @param targetUrl - The URL to check\n* @param targets - Array of propagation targets\n* @returns True if trace context should be propagated, false otherwise\n*\n* @example\n* ```typescript\n* const targets = [\n* 'myproject.supabase.co', // Exact match\n* '*.supabase.co', // Wildcard domain\n* /.*\\.supabase\\.co$/, // Regex pattern\n* (url) => url.hostname === 'localhost' // Custom function\n* ]\n*\n* shouldPropagateToTarget('https://myproject.supabase.co/rest/v1/table', targets)\n* // true\n*\n* shouldPropagateToTarget('https://evil.com/api', targets)\n* // false\n* ```\n*/\nfunction shouldPropagateToTarget(targetUrl, targets) {\n\tif (!targetUrl || !targets || targets.length === 0) return false;\n\tlet url;\n\tif (targetUrl instanceof URL) url = targetUrl;\n\telse try {\n\t\turl = new URL(targetUrl);\n\t} catch (error) {\n\t\treturn false;\n\t}\n\tfor (const target of targets) try {\n\t\tif (typeof target === \"string\") {\n\t\t\tif (matchStringTarget(url.hostname, target)) return true;\n\t\t} else if (target instanceof RegExp) {\n\t\t\tif (target.test(url.hostname)) return true;\n\t\t} else if (typeof target === \"function\") {\n\t\t\tif (target(url)) return true;\n\t\t}\n\t} catch (error) {\n\t\tcontinue;\n\t}\n\treturn false;\n}\n/**\n* Match hostname against string target (exact match or wildcard)\n*\n* @param hostname - The hostname to check\n* @param target - The target pattern (exact or wildcard)\n* @returns True if hostname matches target\n*/\nfunction matchStringTarget(hostname, target) {\n\tif (target === hostname) return true;\n\tif (target.startsWith(\"*.\")) {\n\t\tconst domain = target.slice(2);\n\t\tif (hostname.endsWith(domain)) {\n\t\t\tif (hostname === domain || hostname.endsWith(\".\" + domain)) return true;\n\t\t}\n\t}\n\treturn false;\n}\n\n//#endregion\n//#region ../../shared/tracing/dist/module/defaults.js\n/**\n* Generate default propagation targets based on the Supabase project URL.\n*\n* By default, trace context is only propagated to Supabase domains for\n* security. This prevents leaking trace context to potentially malicious\n* third-party services.\n*\n* Wildcard strings (e.g. `*.supabase.co`) are matched with linear string\n* operations rather than regex, avoiding ReDoS risk.\n*\n* @param supabaseUrl - The Supabase project URL\n* @returns Array of default propagation targets\n*/\nfunction getDefaultPropagationTargets(supabaseUrl) {\n\tconst targets = [];\n\ttry {\n\t\tconst url = new URL(supabaseUrl);\n\t\ttargets.push(url.hostname);\n\t} catch (error) {}\n\ttargets.push(\"*.supabase.co\", \"*.supabase.in\");\n\ttargets.push(\"localhost\", \"127.0.0.1\", \"[::1]\");\n\treturn targets;\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\treturn typeof o$1;\n\t} : function(o$1) {\n\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t}, _typeof(o);\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n\n//#endregion\n//#region \\0@oxc-project+runtime@0.103.0/helpers/objectSpread2.js\nfunction ownKeys(e, r) {\n\tvar t = Object.keys(e);\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\tr && (o = o.filter(function(r$1) {\n\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t})), t.push.apply(t, o);\n\t}\n\treturn t;\n}\nfunction _objectSpread2(e) {\n\tfor (var r = 1; r < arguments.length; r++) {\n\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t_defineProperty(e, r$1, t[r$1]);\n\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t});\n\t}\n\treturn e;\n}\n\n//#endregion\n//#region src/lib/fetch.ts\nconst resolveFetch = (customFetch) => {\n\tif (customFetch) return (...args) => customFetch(...args);\n\treturn (...args) => fetch(...args);\n};\nconst resolveHeadersConstructor = () => {\n\treturn Headers;\n};\nconst fetchWithAuth = (supabaseKey, supabaseUrl, getAccessToken, customFetch, tracePropagationOptions) => {\n\tconst fetch$1 = resolveFetch(customFetch);\n\tconst HeadersConstructor = resolveHeadersConstructor();\n\tconst traceEnabled = (tracePropagationOptions === null || tracePropagationOptions === void 0 ? void 0 : tracePropagationOptions.enabled) === true;\n\tconst respectSampling = (tracePropagationOptions === null || tracePropagationOptions === void 0 ? void 0 : tracePropagationOptions.respectSamplingDecision) !== false;\n\tconst traceTargets = traceEnabled ? getDefaultPropagationTargets(supabaseUrl) : null;\n\treturn async (input, init) => {\n\t\tvar _await$getAccessToken;\n\t\tconst accessToken = (_await$getAccessToken = await getAccessToken()) !== null && _await$getAccessToken !== void 0 ? _await$getAccessToken : supabaseKey;\n\t\tlet headers = new HeadersConstructor(init === null || init === void 0 ? void 0 : init.headers);\n\t\tif (!headers.has(\"apikey\")) headers.set(\"apikey\", supabaseKey);\n\t\tif (!headers.has(\"Authorization\")) headers.set(\"Authorization\", `Bearer ${accessToken}`);\n\t\tif (traceTargets) {\n\t\t\tconst traceHeaders = await getTraceHeaders(input, traceTargets, respectSampling);\n\t\t\tif (traceHeaders) {\n\t\t\t\tif (traceHeaders.traceparent && !headers.has(\"traceparent\")) headers.set(\"traceparent\", traceHeaders.traceparent);\n\t\t\t\tif (traceHeaders.tracestate && !headers.has(\"tracestate\")) headers.set(\"tracestate\", traceHeaders.tracestate);\n\t\t\t\tif (traceHeaders.baggage && !headers.has(\"baggage\")) headers.set(\"baggage\", traceHeaders.baggage);\n\t\t\t}\n\t\t}\n\t\treturn fetch$1(input, _objectSpread2(_objectSpread2({}, init), {}, { headers }));\n\t};\n};\nasync function getTraceHeaders(input, targets, respectSampling) {\n\tif (!shouldPropagateToTarget(typeof input === \"string\" ? input : input instanceof URL ? input : input.url, targets)) return null;\n\tconst traceContext = await extractTraceContext();\n\tif (!traceContext || !traceContext.traceparent) return null;\n\tif (respectSampling) {\n\t\tconst parsed = parseTraceParent(traceContext.traceparent);\n\t\tif (parsed && !parsed.isSampled) return null;\n\t}\n\treturn traceContext;\n}\n\n//#endregion\n//#region src/lib/helpers.ts\nfunction normalizeTracePropagation(value) {\n\treturn typeof value === \"boolean\" ? { enabled: value } : value;\n}\nfunction ensureTrailingSlash(url) {\n\treturn url.endsWith(\"/\") ? url : url + \"/\";\n}\nfunction applySettingDefaults(options, defaults) {\n\tvar _DEFAULT_GLOBAL_OPTIO, _globalOptions$header, _ref, _tracePropagationOpti, _ref2, _tracePropagationOpti2;\n\tconst { db: dbOptions, auth: authOptions, realtime: realtimeOptions, global: globalOptions } = options;\n\tconst { db: DEFAULT_DB_OPTIONS$1, auth: DEFAULT_AUTH_OPTIONS$1, realtime: DEFAULT_REALTIME_OPTIONS$1, global: DEFAULT_GLOBAL_OPTIONS$1 } = defaults;\n\tconst tracePropagationOptions = normalizeTracePropagation(options.tracePropagation);\n\tconst DEFAULT_TRACE_PROPAGATION_OPTIONS$1 = normalizeTracePropagation(defaults.tracePropagation);\n\tconst result = {\n\t\tdb: _objectSpread2(_objectSpread2({}, DEFAULT_DB_OPTIONS$1), dbOptions),\n\t\tauth: _objectSpread2(_objectSpread2({}, DEFAULT_AUTH_OPTIONS$1), authOptions),\n\t\trealtime: _objectSpread2(_objectSpread2({}, DEFAULT_REALTIME_OPTIONS$1), realtimeOptions),\n\t\tstorage: {},\n\t\tglobal: _objectSpread2(_objectSpread2(_objectSpread2({}, DEFAULT_GLOBAL_OPTIONS$1), globalOptions), {}, { headers: _objectSpread2(_objectSpread2({}, (_DEFAULT_GLOBAL_OPTIO = DEFAULT_GLOBAL_OPTIONS$1 === null || DEFAULT_GLOBAL_OPTIONS$1 === void 0 ? void 0 : DEFAULT_GLOBAL_OPTIONS$1.headers) !== null && _DEFAULT_GLOBAL_OPTIO !== void 0 ? _DEFAULT_GLOBAL_OPTIO : {}), (_globalOptions$header = globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.headers) !== null && _globalOptions$header !== void 0 ? _globalOptions$header : {}) }),\n\t\ttracePropagation: {\n\t\t\tenabled: (_ref = (_tracePropagationOpti = tracePropagationOptions === null || tracePropagationOptions === void 0 ? void 0 : tracePropagationOptions.enabled) !== null && _tracePropagationOpti !== void 0 ? _tracePropagationOpti : DEFAULT_TRACE_PROPAGATION_OPTIONS$1 === null || DEFAULT_TRACE_PROPAGATION_OPTIONS$1 === void 0 ? void 0 : DEFAULT_TRACE_PROPAGATION_OPTIONS$1.enabled) !== null && _ref !== void 0 ? _ref : false,\n\t\t\trespectSamplingDecision: (_ref2 = (_tracePropagationOpti2 = tracePropagationOptions === null || tracePropagationOptions === void 0 ? void 0 : tracePropagationOptions.respectSamplingDecision) !== null && _tracePropagationOpti2 !== void 0 ? _tracePropagationOpti2 : DEFAULT_TRACE_PROPAGATION_OPTIONS$1 === null || DEFAULT_TRACE_PROPAGATION_OPTIONS$1 === void 0 ? void 0 : DEFAULT_TRACE_PROPAGATION_OPTIONS$1.respectSamplingDecision) !== null && _ref2 !== void 0 ? _ref2 : true\n\t\t},\n\t\taccessToken: async () => \"\"\n\t};\n\tif (options.accessToken) result.accessToken = options.accessToken;\n\telse delete result.accessToken;\n\treturn result;\n}\n/**\n* Validates a Supabase client URL\n*\n* @param {string} supabaseUrl - The Supabase client URL string.\n* @returns {URL} - The validated base URL.\n* @throws {Error}\n*/\nfunction validateSupabaseUrl(supabaseUrl) {\n\tconst trimmedUrl = supabaseUrl === null || supabaseUrl === void 0 ? void 0 : supabaseUrl.trim();\n\tif (!trimmedUrl) throw new Error(\"supabaseUrl is required.\");\n\tif (!trimmedUrl.match(/^https?:\\/\\//i)) throw new Error(\"Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.\");\n\ttry {\n\t\treturn new URL(ensureTrailingSlash(trimmedUrl));\n\t} catch (_unused) {\n\t\tthrow Error(\"Invalid supabaseUrl: Provided URL is malformed.\");\n\t}\n}\n\n//#endregion\n//#region src/lib/SupabaseAuthClient.ts\nvar SupabaseAuthClient = class extends AuthClient {\n\tconstructor(options) {\n\t\tsuper(options);\n\t}\n};\n\n//#endregion\n//#region src/SupabaseClient.ts\n/**\n* Supabase Client.\n*\n* An isomorphic Javascript client for interacting with Postgres.\n*/\nvar SupabaseClient = class {\n\t/**\n\t* Create a new client for use in the browser.\n\t*\n\t* @category Initializing\n\t*\n\t* @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.\n\t* @param supabaseKey The unique Supabase Key which is supplied when you create a new project in your project dashboard.\n\t* @param options.db.schema You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n\t* @param options.auth.autoRefreshToken Set to \"true\" if you want to automatically refresh the token before expiring.\n\t* @param options.auth.persistSession Set to \"true\" if you want to automatically save the user session into local storage.\n\t* @param options.auth.detectSessionInUrl Set to \"true\" if you want to automatically detects OAuth grants in the URL and signs in the user.\n\t* @param options.realtime Options passed along to realtime-js constructor.\n\t* @param options.storage Options passed along to the storage-js constructor.\n\t* @param options.global.fetch A custom fetch implementation.\n\t* @param options.global.headers Any additional headers to send with each network request.\n\t*\n\t* @example Creating a client\n\t* ```js\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* // Create a single supabase client for interacting with your database\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t* ```\n\t*\n\t* @example With a custom domain\n\t* ```js\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* // Use a custom domain as the supabase URL\n\t* const supabase = createClient('https://my-custom-domain.com', 'your-publishable-key')\n\t* ```\n\t*\n\t* @example With additional parameters\n\t* ```js\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const options = {\n\t* db: {\n\t* schema: 'public',\n\t* },\n\t* auth: {\n\t* autoRefreshToken: true,\n\t* persistSession: true,\n\t* detectSessionInUrl: true\n\t* },\n\t* global: {\n\t* headers: { 'x-my-custom-header': 'my-app-name' },\n\t* },\n\t* }\n\t* const supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", options)\n\t* ```\n\t*\n\t* @exampleDescription With custom schemas\n\t* By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.\n\t* Go to [Settings > API > Exposed schemas](/dashboard/project/_/settings/api) and add the schema which you want to expose to the API.\n\t*\n\t* Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.\n\t*\n\t* @example With custom schemas\n\t* ```js\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n\t* // Provide a custom schema. Defaults to \"public\".\n\t* db: { schema: 'other_schema' }\n\t* })\n\t* ```\n\t*\n\t* @exampleDescription Custom fetch implementation\n\t* `supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,\n\t* but an alternative `fetch` implementation can be provided as an option.\n\t* This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).\n\t*\n\t* @example Custom fetch implementation\n\t* ```js\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n\t* global: { fetch: fetch.bind(globalThis) }\n\t* })\n\t* ```\n\t*\n\t* @exampleDescription React Native options with AsyncStorage\n\t* For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth.\n\t*\n\t* @example React Native options with AsyncStorage\n\t* ```js\n\t* import 'react-native-url-polyfill/auto'\n\t* import { createClient } from '@supabase/supabase-js'\n\t* import AsyncStorage from \"@react-native-async-storage/async-storage\";\n\t*\n\t* const supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", {\n\t* auth: {\n\t* storage: AsyncStorage,\n\t* autoRefreshToken: true,\n\t* persistSession: true,\n\t* detectSessionInUrl: false,\n\t* },\n\t* });\n\t* ```\n\t*\n\t* @exampleDescription React Native options with Expo SecureStore\n\t* If you wish to encrypt the user's session information, you can use `aes-js` and store the encryption key in Expo SecureStore.\n\t* The `aes-js` library, a reputable JavaScript-only implementation of the AES encryption algorithm in CTR mode.\n\t* A new 256-bit encryption key is generated using the `react-native-get-random-values` library.\n\t* This key is stored inside Expo's SecureStore, while the value is encrypted and placed inside AsyncStorage.\n\t*\n\t* Please make sure that:\n\t* - You keep the `expo-secure-store`, `aes-js` and `react-native-get-random-values` libraries up-to-date.\n\t* - Choose the correct [`SecureStoreOptions`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestoreoptions) for your app's needs.\n\t* E.g. [`SecureStore.WHEN_UNLOCKED`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestorewhen_unlocked) regulates when the data can be accessed.\n\t* - Carefully consider optimizations or other modifications to the above example, as those can lead to introducing subtle security vulnerabilities.\n\t*\n\t* @example React Native options with Expo SecureStore\n\t* ```ts\n\t* import 'react-native-url-polyfill/auto'\n\t* import { createClient } from '@supabase/supabase-js'\n\t* import AsyncStorage from '@react-native-async-storage/async-storage';\n\t* import * as SecureStore from 'expo-secure-store';\n\t* import * as aesjs from 'aes-js';\n\t* import 'react-native-get-random-values';\n\t*\n\t* // As Expo's SecureStore does not support values larger than 2048\n\t* // bytes, an AES-256 key is generated and stored in SecureStore, while\n\t* // it is used to encrypt/decrypt values stored in AsyncStorage.\n\t* class LargeSecureStore {\n\t* private async _encrypt(key: string, value: string) {\n\t* const encryptionKey = crypto.getRandomValues(new Uint8Array(256 / 8));\n\t*\n\t* const cipher = new aesjs.ModeOfOperation.ctr(encryptionKey, new aesjs.Counter(1));\n\t* const encryptedBytes = cipher.encrypt(aesjs.utils.utf8.toBytes(value));\n\t*\n\t* await SecureStore.setItemAsync(key, aesjs.utils.hex.fromBytes(encryptionKey));\n\t*\n\t* return aesjs.utils.hex.fromBytes(encryptedBytes);\n\t* }\n\t*\n\t* private async _decrypt(key: string, value: string) {\n\t* const encryptionKeyHex = await SecureStore.getItemAsync(key);\n\t* if (!encryptionKeyHex) {\n\t* return encryptionKeyHex;\n\t* }\n\t*\n\t* const cipher = new aesjs.ModeOfOperation.ctr(aesjs.utils.hex.toBytes(encryptionKeyHex), new aesjs.Counter(1));\n\t* const decryptedBytes = cipher.decrypt(aesjs.utils.hex.toBytes(value));\n\t*\n\t* return aesjs.utils.utf8.fromBytes(decryptedBytes);\n\t* }\n\t*\n\t* async getItem(key: string) {\n\t* const encrypted = await AsyncStorage.getItem(key);\n\t* if (!encrypted) { return encrypted; }\n\t*\n\t* return await this._decrypt(key, encrypted);\n\t* }\n\t*\n\t* async removeItem(key: string) {\n\t* await AsyncStorage.removeItem(key);\n\t* await SecureStore.deleteItemAsync(key);\n\t* }\n\t*\n\t* async setItem(key: string, value: string) {\n\t* const encrypted = await this._encrypt(key, value);\n\t*\n\t* await AsyncStorage.setItem(key, encrypted);\n\t* }\n\t* }\n\t*\n\t* const supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", {\n\t* auth: {\n\t* storage: new LargeSecureStore(),\n\t* autoRefreshToken: true,\n\t* persistSession: true,\n\t* detectSessionInUrl: false,\n\t* },\n\t* });\n\t* ```\n\t*\n\t* @example With a database query\n\t* ```ts\n\t* import { createClient } from '@supabase/supabase-js'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\t*\n\t* const { data } = await supabase.from('profiles').select('*')\n\t* ```\n\t*\n\t* @exampleDescription With OpenTelemetry tracing\n\t* Opt in to W3C trace context propagation so the `trace_id` from your\n\t* client-side spans is attached to Supabase requests and appears in API\n\t* Gateway and Edge Function logs. Requires `@opentelemetry/api` to be\n\t* installed in your application. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing).\n\t*\n\t* @example With OpenTelemetry tracing\n\t* ```ts\n\t* import { createClient } from '@supabase/supabase-js'\n\t* import { trace } from '@opentelemetry/api'\n\t*\n\t* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n\t* tracePropagation: true,\n\t* })\n\t*\n\t* const tracer = trace.getTracer('my-app')\n\t*\n\t* await tracer.startActiveSpan('fetch-users', async (span) => {\n\t* // Outgoing request carries the active trace context.\n\t* const { data, error } = await supabase.from('users').select('*')\n\t* span.end()\n\t* })\n\t* ```\n\t*/\n\tconstructor(supabaseUrl, supabaseKey, options) {\n\t\tvar _settings$auth$storag, _settings$global$head;\n\t\tthis.supabaseUrl = supabaseUrl;\n\t\tthis.supabaseKey = supabaseKey;\n\t\tconst baseUrl = validateSupabaseUrl(supabaseUrl);\n\t\tif (!supabaseKey) throw new Error(\"supabaseKey is required.\");\n\t\tthis.realtimeUrl = new URL(\"realtime/v1\", baseUrl);\n\t\tthis.realtimeUrl.protocol = this.realtimeUrl.protocol.replace(\"http\", \"ws\");\n\t\tthis.authUrl = new URL(\"auth/v1\", baseUrl);\n\t\tthis.storageUrl = new URL(\"storage/v1\", baseUrl);\n\t\tthis.functionsUrl = new URL(\"functions/v1\", baseUrl);\n\t\tconst defaultStorageKey = `sb-${baseUrl.hostname.split(\".\")[0]}-auth-token`;\n\t\tconst DEFAULTS = {\n\t\t\tdb: DEFAULT_DB_OPTIONS,\n\t\t\trealtime: DEFAULT_REALTIME_OPTIONS,\n\t\t\tauth: _objectSpread2(_objectSpread2({}, DEFAULT_AUTH_OPTIONS), {}, { storageKey: defaultStorageKey }),\n\t\t\tglobal: DEFAULT_GLOBAL_OPTIONS,\n\t\t\ttracePropagation: DEFAULT_TRACE_PROPAGATION_OPTIONS\n\t\t};\n\t\tconst settings = applySettingDefaults(options !== null && options !== void 0 ? options : {}, DEFAULTS);\n\t\tthis.settings = settings;\n\t\tthis.storageKey = (_settings$auth$storag = settings.auth.storageKey) !== null && _settings$auth$storag !== void 0 ? _settings$auth$storag : \"\";\n\t\tthis.headers = (_settings$global$head = settings.global.headers) !== null && _settings$global$head !== void 0 ? _settings$global$head : {};\n\t\tif (!settings.accessToken) {\n\t\t\tvar _settings$auth;\n\t\t\tthis.auth = this._initSupabaseAuthClient((_settings$auth = settings.auth) !== null && _settings$auth !== void 0 ? _settings$auth : {}, this.headers, settings.global.fetch);\n\t\t} else {\n\t\t\tthis.accessToken = settings.accessToken;\n\t\t\tthis.auth = new Proxy({}, { get: (_, prop) => {\n\t\t\t\tthrow new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(prop)} is not possible`);\n\t\t\t} });\n\t\t}\n\t\tthis.fetch = fetchWithAuth(supabaseKey, supabaseUrl, this._getAccessToken.bind(this), settings.global.fetch, settings.tracePropagation);\n\t\tthis.realtime = this._initRealtimeClient(_objectSpread2({\n\t\t\theaders: this.headers,\n\t\t\taccessToken: this._getAccessToken.bind(this),\n\t\t\tfetch: this.fetch\n\t\t}, settings.realtime));\n\t\tif (this.accessToken) Promise.resolve(this.accessToken()).then((token) => this.realtime.setAuth(token)).catch((e) => console.warn(\"Failed to set initial Realtime auth token:\", e));\n\t\tthis.rest = new PostgrestClient(new URL(\"rest/v1\", baseUrl).href, {\n\t\t\theaders: this.headers,\n\t\t\tschema: settings.db.schema,\n\t\t\tfetch: this.fetch,\n\t\t\ttimeout: settings.db.timeout,\n\t\t\turlLengthLimit: settings.db.urlLengthLimit\n\t\t});\n\t\tthis.storage = new StorageClient(this.storageUrl.href, this.headers, this.fetch, options === null || options === void 0 ? void 0 : options.storage);\n\t\tif (!settings.accessToken) this._listenForAuthEvents();\n\t}\n\t/**\n\t* Supabase Functions allows you to deploy and invoke edge functions.\n\t*/\n\tget functions() {\n\t\treturn new FunctionsClient(this.functionsUrl.href, {\n\t\t\theaders: this.headers,\n\t\t\tcustomFetch: this.fetch\n\t\t});\n\t}\n\t/**\n\t* Perform a query on a table or a view.\n\t*\n\t* @param relation - The table or view name to query\n\t*/\n\tfrom(relation) {\n\t\treturn this.rest.from(relation);\n\t}\n\t/**\n\t* Select a schema to query or perform an function (rpc) call.\n\t*\n\t* The schema needs to be on the list of exposed schemas inside Supabase.\n\t*\n\t* @param schema - The schema to query\n\t*/\n\tschema(schema) {\n\t\treturn this.rest.schema(schema);\n\t}\n\t/**\n\t* Perform a function call.\n\t*\n\t* @param fn - The function name to call\n\t* @param args - The arguments to pass to the function call\n\t* @param options - Named parameters\n\t* @param options.head - When set to `true`, `data` will not be returned.\n\t* Useful if you only need the count.\n\t* @param options.get - When set to `true`, the function will be called with\n\t* read-only access mode.\n\t* @param options.count - Count algorithm to use to count rows returned by the\n\t* function. Only applicable for [set-returning\n\t* functions](https://www.postgresql.org/docs/current/functions-srf.html).\n\t*\n\t* `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n\t* hood.\n\t*\n\t* `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n\t* statistics under the hood.\n\t*\n\t* `\"estimated\"`: Uses exact count for low numbers and planned count for high\n\t* numbers.\n\t*/\n\trpc(fn, args = {}, options = {\n\t\thead: false,\n\t\tget: false,\n\t\tcount: void 0\n\t}) {\n\t\treturn this.rest.rpc(fn, args, options);\n\t}\n\t/**\n\t* Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.\n\t*\n\t* @param {string} name - The name of the Realtime channel.\n\t* @param {Object} opts - The options to pass to the Realtime channel.\n\t*\n\t* @category Realtime\n\t*/\n\tchannel(name, opts = { config: {} }) {\n\t\treturn this.realtime.channel(name, opts);\n\t}\n\t/**\n\t* Returns all Realtime channels.\n\t*\n\t* @category Realtime\n\t*\n\t* @example Get all channels\n\t* ```js\n\t* const channels = supabase.getChannels()\n\t* ```\n\t*/\n\tgetChannels() {\n\t\treturn this.realtime.getChannels();\n\t}\n\t/**\n\t* Unsubscribes and removes Realtime channel from Realtime client.\n\t*\n\t* @param {RealtimeChannel} channel - The name of the Realtime channel.\n\t*\n\t*\n\t* @category Realtime\n\t*\n\t* @remarks\n\t* - Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n\t*\n\t* @example Removes a channel\n\t* ```js\n\t* supabase.removeChannel(myChannel)\n\t* ```\n\t*/\n\tremoveChannel(channel) {\n\t\treturn this.realtime.removeChannel(channel);\n\t}\n\t/**\n\t* Unsubscribes and removes all Realtime channels from Realtime client.\n\t*\n\t* @category Realtime\n\t*\n\t* @remarks\n\t* - Removing channels is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n\t*\n\t* @example Remove all channels\n\t* ```js\n\t* supabase.removeAllChannels()\n\t* ```\n\t*/\n\tremoveAllChannels() {\n\t\treturn this.realtime.removeAllChannels();\n\t}\n\tasync _getAccessToken() {\n\t\tvar _this = this;\n\t\tvar _data$session$access_, _data$session;\n\t\tif (_this.accessToken) return await _this.accessToken();\n\t\tconst { data } = await _this.auth.getSession();\n\t\treturn (_data$session$access_ = (_data$session = data.session) === null || _data$session === void 0 ? void 0 : _data$session.access_token) !== null && _data$session$access_ !== void 0 ? _data$session$access_ : _this.supabaseKey;\n\t}\n\t_initSupabaseAuthClient({ autoRefreshToken, persistSession, detectSessionInUrl, storage, userStorage, storageKey, flowType, lock, debug, throwOnError, experimental, lockAcquireTimeout, skipAutoInitialize }, headers, fetch$1) {\n\t\tconst authHeaders = {\n\t\t\tAuthorization: `Bearer ${this.supabaseKey}`,\n\t\t\tapikey: `${this.supabaseKey}`\n\t\t};\n\t\treturn new SupabaseAuthClient({\n\t\t\turl: this.authUrl.href,\n\t\t\theaders: _objectSpread2(_objectSpread2({}, authHeaders), headers),\n\t\t\tstorageKey,\n\t\t\tautoRefreshToken,\n\t\t\tpersistSession,\n\t\t\tdetectSessionInUrl,\n\t\t\tstorage,\n\t\t\tuserStorage,\n\t\t\tflowType,\n\t\t\tlock,\n\t\t\tdebug,\n\t\t\tthrowOnError,\n\t\t\texperimental,\n\t\t\tfetch: fetch$1,\n\t\t\tlockAcquireTimeout,\n\t\t\tskipAutoInitialize,\n\t\t\thasCustomAuthorizationHeader: Object.keys(this.headers).some((key) => key.toLowerCase() === \"authorization\")\n\t\t});\n\t}\n\t_initRealtimeClient(options) {\n\t\treturn new RealtimeClient(this.realtimeUrl.href, _objectSpread2(_objectSpread2({}, options), {}, { params: _objectSpread2(_objectSpread2({}, { apikey: this.supabaseKey }), options === null || options === void 0 ? void 0 : options.params) }));\n\t}\n\t_listenForAuthEvents() {\n\t\treturn this.auth.onAuthStateChange((event, session) => {\n\t\t\tthis._handleTokenChanged(event, \"CLIENT\", session === null || session === void 0 ? void 0 : session.access_token);\n\t\t});\n\t}\n\t_handleTokenChanged(event, source, token) {\n\t\tif ((event === \"TOKEN_REFRESHED\" || event === \"SIGNED_IN\") && this.changedAccessToken !== token) {\n\t\t\tthis.changedAccessToken = token;\n\t\t\tthis.realtime.setAuth(token);\n\t\t} else if (event === \"SIGNED_OUT\") {\n\t\t\tthis.realtime.setAuth();\n\t\t\tif (source == \"STORAGE\") this.auth.signOut();\n\t\t\tthis.changedAccessToken = void 0;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/index.ts\n/**\n* Creates a new Supabase Client.\n*\n* @example Creating a Supabase client\n* ```ts\n* import { createClient } from '@supabase/supabase-js'\n*\n* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n* const { data, error } = await supabase.from('profiles').select('*')\n* ```\n*/\nconst createClient = (supabaseUrl, supabaseKey, options) => {\n\treturn new SupabaseClient(supabaseUrl, supabaseKey, options);\n};\nfunction shouldShowDeprecationWarning() {\n\tif (typeof window !== \"undefined\") return false;\n\tconst _process = globalThis[\"process\"];\n\tif (!_process) return false;\n\tconst processVersion = _process[\"version\"];\n\tif (processVersion === void 0 || processVersion === null) return false;\n\tconst versionMatch = processVersion.match(/^v(\\d+)\\./);\n\tif (!versionMatch) return false;\n\treturn parseInt(versionMatch[1], 10) <= 18;\n}\nif (shouldShowDeprecationWarning()) 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\");\n\n//#endregion\nexport { FunctionRegion, FunctionsError, FunctionsFetchError, FunctionsHttpError, FunctionsRelayError, PostgrestError, StorageApiError, SupabaseClient, createClient };\n//# sourceMappingURL=index.mjs.map","import { createClient, type SupabaseClient } from '@supabase/supabase-js';\n\nconst cache = new WeakMap<object, SupabaseClient>();\n\n/**\n * Returns a Supabase client for a given (url, anonKey) pair.\n * Memoised so we never create more than one client per provider mount.\n */\nexport function getSupabase(config: { url: string; anonKey: string }): SupabaseClient {\n const key = { url: config.url, anonKey: config.anonKey };\n // Cache via a per-call key — providers will keep their own ref to the result.\n // Practical effect: one SettoProvider mount = one client.\n const hit = cache.get(key);\n if (hit) return hit;\n const client = createClient(config.url, config.anonKey, {\n auth: {\n persistSession: true,\n autoRefreshToken: true,\n storageKey: `setto-auth-${config.url}`,\n },\n });\n cache.set(key, client);\n return client;\n}\n","import type { SupabaseClient } from '@supabase/supabase-js';\nimport type { ContentFile, PublishResult } from '../types';\n\n/** Returns a fresh access token from the current Supabase session. */\nasync function bearer(sb: SupabaseClient): Promise<string> {\n const { data } = await sb.auth.getSession();\n const token = data.session?.access_token;\n if (!token) throw new Error('not_authenticated');\n return token;\n}\n\nasync function parseJson<T>(res: Response): Promise<T> {\n const contentType = res.headers.get('content-type') ?? '';\n if (!contentType.includes('application/json')) {\n const text = await res.text();\n throw new Error(\n `expected JSON from ${res.url}, got ${contentType || 'unknown content-type'}: ${text.slice(0, 120)}`,\n );\n }\n return (await res.json()) as T;\n}\n\nasync function asError(res: Response, fallback: string): Promise<Error> {\n try {\n const body = await parseJson<{ error?: unknown; detail?: unknown }>(res);\n const detail =\n body.error != null\n ? String(body.error)\n : body.detail != null\n ? String(body.detail)\n : fallback;\n return new Error(`${fallback}: ${res.status} ${detail}`);\n } catch (err) {\n if (err instanceof Error && err.message.startsWith('expected JSON')) {\n return new Error(`${fallback}: ${res.status} ${err.message}`);\n }\n return new Error(`${fallback}: ${res.status}`);\n }\n}\n\nexport function createApi(args: { apiUrl: string; supabase: SupabaseClient }) {\n const { apiUrl, supabase } = args;\n\n return {\n async getContent(siteId: string): Promise<{ files: ContentFile[] }> {\n const token = await bearer(supabase);\n const res = await fetch(`${apiUrl}/sites/${encodeURIComponent(siteId)}/content`, {\n headers: { Authorization: `Bearer ${token}` },\n });\n if (!res.ok) throw await asError(res, 'getContent failed');\n return parseJson<{ files: ContentFile[] }>(res);\n },\n\n async publish(\n siteId: string,\n files: Array<{ path: string; content: string }>,\n message?: string,\n ): Promise<PublishResult> {\n const token = await bearer(supabase);\n const res = await fetch(`${apiUrl}/sites/${encodeURIComponent(siteId)}/publish`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${token}`,\n },\n body: JSON.stringify({ files, message }),\n });\n if (!res.ok) throw await asError(res, 'publish failed');\n return parseJson<PublishResult>(res);\n },\n };\n}\n\nexport type SettoApi = ReturnType<typeof createApi>;\n","import type { i18n as I18nType } from 'i18next';\n\n/**\n * Tracks an in-memory layer of edits on top of a loaded i18next instance.\n *\n * On disk, a site has one JSON file per language under `content_paths`. At\n * runtime, i18next holds those JSONs as resource bundles in\n * `i18n.store.data[lng].translation`.\n *\n * The draft store mutates the resource bundles directly so the page re-renders\n * with the editor's text immediately. When the user publishes, we serialise\n * the merged resource bundles back to JSON and POST them to setto-server.\n */\nexport interface DraftEntry {\n /** Dotted key path, e.g. 'hero.headline'. */\n key: string;\n /** Language code, e.g. 'no'. */\n lng: string;\n /** Value before any edits in this session — used for diff and revert. */\n original: string;\n /** Current draft value. */\n current: string;\n}\n\nexport interface I18nStoreSnapshot {\n /** All edits made in this session, keyed by `${lng}::${key}`. */\n drafts: Map<string, DraftEntry>;\n /** Bumps every time the store changes; React components subscribe to this. */\n version: number;\n}\n\n/** Stable empty snapshot for useSyncExternalStore when the store is not ready. */\nexport const EMPTY_I18N_STORE_SNAPSHOT: I18nStoreSnapshot = {\n drafts: new Map(),\n version: 0,\n};\n\ntype Listener = (snap: I18nStoreSnapshot) => void;\n\nexport class I18nStore {\n private drafts = new Map<string, DraftEntry>();\n private version = 0;\n private listeners = new Set<Listener>();\n /** Stable namespace used by react-i18next defaults. */\n private ns: string;\n private i18n: I18nType;\n /** Cached reference — useSyncExternalStore requires referential stability. */\n private cachedSnapshot: I18nStoreSnapshot = {\n drafts: this.drafts,\n version: 0,\n };\n\n constructor(i18n: I18nType, options?: { namespace?: string }) {\n this.i18n = i18n;\n this.ns = options?.namespace ?? 'translation';\n }\n\n snapshot(): I18nStoreSnapshot {\n return this.cachedSnapshot;\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /**\n * Returns the current rendered value for a key in a given language,\n * reading through any draft layer.\n */\n get(key: string, lng: string): string {\n const id = `${lng}::${key}`;\n const draft = this.drafts.get(id);\n if (draft) return draft.current;\n return String(this.i18n.getResource(lng, this.ns, key) ?? '');\n }\n\n /** Returns the original (pre-edit) value for a key. */\n original(key: string, lng: string): string {\n const id = `${lng}::${key}`;\n const draft = this.drafts.get(id);\n if (draft) return draft.original;\n return String(this.i18n.getResource(lng, this.ns, key) ?? '');\n }\n\n /**\n * Records an edit. Mutates the live i18next bundle so consumers re-render.\n * If the value is set back to the original, the draft entry is cleared.\n */\n set(key: string, lng: string, value: string): void {\n const id = `${lng}::${key}`;\n const existing = this.drafts.get(id);\n const original = existing?.original ?? String(this.i18n.getResource(lng, this.ns, key) ?? '');\n\n if (value === original) {\n this.drafts.delete(id);\n } else {\n this.drafts.set(id, { key, lng, original, current: value });\n }\n\n this.i18n.addResource(lng, this.ns, key, value);\n // Trigger consumers of useTranslation to re-render. i18next exposes\n // languageChanged for this but a manual emit is simpler and side-effect-free.\n this.i18n.emit('languageChanged', this.i18n.language);\n this.bump();\n }\n\n /** Resets a single draft back to its original value. */\n revert(key: string, lng: string): void {\n const id = `${lng}::${key}`;\n const draft = this.drafts.get(id);\n if (!draft) return;\n this.i18n.addResource(lng, this.ns, key, draft.original);\n this.drafts.delete(id);\n this.i18n.emit('languageChanged', this.i18n.language);\n this.bump();\n }\n\n /** Resets every draft. */\n revertAll(): void {\n for (const draft of this.drafts.values()) {\n this.i18n.addResource(draft.lng, this.ns, draft.key, draft.original);\n }\n this.drafts.clear();\n this.i18n.emit('languageChanged', this.i18n.language);\n this.bump();\n }\n\n /** Marks the current state as the new baseline (after a successful publish). */\n commit(): void {\n this.drafts.clear();\n this.bump();\n }\n\n /** Number of pending draft entries across all languages. */\n size(): number {\n return this.drafts.size;\n }\n\n /**\n * Serialises the full resource bundle per language as it currently looks in\n * i18next (with drafts applied). Used as the payload for /publish.\n *\n * The caller maps language → file path via `sites.content_paths`.\n */\n serialiseBundles(): Record<string, unknown> {\n const langs = this.i18n.languages?.length ? this.i18n.languages : ['no', 'en'];\n const out: Record<string, unknown> = {};\n for (const lng of langs) {\n const bundle = this.i18n.getResourceBundle(lng, this.ns);\n if (bundle) out[lng] = bundle;\n }\n return out;\n }\n\n private bump(): void {\n this.version += 1;\n this.cachedSnapshot = { drafts: this.drafts, version: this.version };\n for (const fn of this.listeners) fn(this.cachedSnapshot);\n }\n}\n","/** Section colour theme — keyed by section id, then colour token. */\nexport type SectionsTheme = Record<string, Record<string, string>>;\n\nexport interface ThemeDraftEntry {\n sectionId: string;\n field: string;\n original: string;\n current: string;\n}\n\nexport interface ThemeStoreSnapshot {\n drafts: Map<string, ThemeDraftEntry>;\n version: number;\n}\n\nexport const EMPTY_THEME_STORE_SNAPSHOT: ThemeStoreSnapshot = {\n drafts: new Map(),\n version: 0,\n};\n\ntype Listener = (snap: ThemeStoreSnapshot) => void;\n\nexport class ThemeStore {\n private data: SectionsTheme;\n private baseline: SectionsTheme;\n private drafts = new Map<string, ThemeDraftEntry>();\n private version = 0;\n private listeners = new Set<Listener>();\n private cachedSnapshot: ThemeStoreSnapshot = {\n drafts: this.drafts,\n version: 0,\n };\n\n constructor(initial: SectionsTheme) {\n this.data = structuredClone(initial);\n this.baseline = structuredClone(initial);\n }\n\n snapshot(): ThemeStoreSnapshot {\n return this.cachedSnapshot;\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n getSection(sectionId: string): Record<string, string> {\n return this.data[sectionId] ?? {};\n }\n\n get(sectionId: string, field: string): string {\n return this.data[sectionId]?.[field] ?? '';\n }\n\n set(sectionId: string, field: string, value: string): void {\n const id = `${sectionId}::${field}`;\n const original =\n this.drafts.get(id)?.original ??\n this.baseline[sectionId]?.[field] ??\n '';\n\n if (!this.data[sectionId]) this.data[sectionId] = {};\n this.data[sectionId][field] = value;\n\n if (value === original) {\n this.drafts.delete(id);\n } else {\n this.drafts.set(id, { sectionId, field, original, current: value });\n }\n this.bump();\n }\n\n /** Replace baseline from GitHub without creating drafts. */\n loadBaseline(next: SectionsTheme): void {\n this.data = structuredClone(next);\n this.baseline = structuredClone(next);\n this.drafts.clear();\n this.bump();\n }\n\n commit(): void {\n this.baseline = structuredClone(this.data);\n this.drafts.clear();\n this.bump();\n }\n\n size(): number {\n return this.drafts.size;\n }\n\n serialise(): SectionsTheme {\n return structuredClone(this.data);\n }\n\n private bump(): void {\n this.version += 1;\n this.cachedSnapshot = { drafts: this.drafts, version: this.version };\n for (const fn of this.listeners) fn(this.cachedSnapshot);\n }\n}\n","/** Height of the fixed edit toolbar (px). */\nexport const TOOLBAR_HEIGHT = 44;\n","import { useEffect } from 'react';\nimport { TOOLBAR_HEIGHT } from './constants';\n\nconst STYLE_ID = 'setto-edit-layout';\nconst HTML_CLASS = 'setto-edit-mode';\n\n/**\n * Reserves space at the top of the viewport for the Setto edit toolbar.\n * The host site keeps full width — only vertical offset is applied.\n */\nexport function useSettoDocumentLayout(active: boolean): void {\n useEffect(() => {\n if (!active) return;\n\n const html = document.documentElement;\n html.classList.add(HTML_CLASS);\n html.style.setProperty('--setto-toolbar-height', `${TOOLBAR_HEIGHT}px`);\n\n let styleEl = document.getElementById(STYLE_ID) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = document.createElement('style');\n styleEl.id = STYLE_ID;\n styleEl.textContent = `\n html.setto-edit-mode {\n width: 100%;\n overflow-x: clip;\n }\n\n html.setto-edit-mode body {\n padding-top: var(--setto-toolbar-height);\n }\n\n html.setto-edit-mode #root {\n width: 100%;\n min-height: calc(100dvh - var(--setto-toolbar-height));\n transform: translateZ(0);\n }\n\n html.setto-edit-mode #setto-toolbar-root {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: var(--setto-toolbar-height);\n z-index: 2147483647;\n }\n\n html.setto-edit-mode #setto-hint-root {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 2147483645;\n }\n\n html.setto-edit-mode #setto-section-toolbar-root {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 2147483646;\n }\n\n html.setto-edit-mode #setto-section-toolbar-root [data-setto-ui] {\n pointer-events: auto;\n }\n\n html.setto-edit-mode [data-setto-key]:hover {\n outline: 1px dashed rgba(100, 10, 255, 0.45);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n html.setto-edit-mode [data-setto-section]:hover {\n box-shadow: inset 0 0 0 1px rgba(100, 10, 255, 0.25);\n }\n `;\n document.head.appendChild(styleEl);\n }\n\n notifyLayoutChange();\n\n return () => {\n html.classList.remove(HTML_CLASS);\n html.style.removeProperty('--setto-toolbar-height');\n styleEl?.remove();\n notifyLayoutChange();\n };\n }, [active]);\n}\n\nfunction notifyLayoutChange(): void {\n requestAnimationFrame(() => {\n window.dispatchEvent(new Event('resize'));\n });\n}\n","import { useEffect, useLayoutEffect, useRef, useState } from 'react';\n\ninterface HintAnchor {\n x: number;\n y: number;\n}\n\nconst MARGIN = 10;\nconst OFFSET = 14;\n\nfunction hintLabel(): string {\n const isMac = navigator.platform.toUpperCase().includes('MAC');\n return isMac ? '⌘+klikk for å åpne' : 'Ctrl+klikk for å åpne';\n}\n\nfunction isActionContext(editable: HTMLElement): boolean {\n const key = editable.getAttribute('data-setto-key');\n // Language toggles switch locale — not navigation targets.\n if (key?.startsWith('lang.')) return false;\n if (editable.closest('[data-setto-no-hint]')) return false;\n return !!(editable.closest('a[href]') || editable.closest('button'));\n}\n\nfunction placeTooltip(\n anchor: HintAnchor,\n width: number,\n height: number,\n): { left: number; top: number } {\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n // Prefer below and to the right of the cursor.\n let left = anchor.x + OFFSET;\n let top = anchor.y + OFFSET;\n\n if (left + width > vw - MARGIN) {\n left = anchor.x - width - OFFSET;\n }\n if (left < MARGIN) {\n left = MARGIN;\n }\n\n if (top + height > vh - MARGIN) {\n top = anchor.y - height - OFFSET;\n }\n if (top < MARGIN) {\n top = MARGIN;\n }\n\n return { left, top };\n}\n\n/**\n * Tooltip when hovering editable text inside a link or button (except language\n * toggles). Flips to stay within the viewport.\n */\nexport function EditLinkHint() {\n const [anchor, setAnchor] = useState<HintAnchor | null>(null);\n const [position, setPosition] = useState<{ left: number; top: number } | null>(null);\n const tipRef = useRef<HTMLDivElement>(null);\n const text = hintLabel();\n\n useEffect(() => {\n const onMove = (e: MouseEvent) => {\n const target = e.target;\n if (!(target instanceof Element)) {\n setAnchor(null);\n return;\n }\n const editable = target.closest('[data-setto-key]');\n if (!(editable instanceof HTMLElement) || !isActionContext(editable)) {\n setAnchor(null);\n return;\n }\n setAnchor({ x: e.clientX, y: e.clientY });\n };\n\n document.addEventListener('mousemove', onMove, true);\n return () => document.removeEventListener('mousemove', onMove, true);\n }, []);\n\n useLayoutEffect(() => {\n if (!anchor || !tipRef.current) {\n setPosition(null);\n return;\n }\n const { width, height } = tipRef.current.getBoundingClientRect();\n setPosition(placeTooltip(anchor, width, height));\n }, [anchor, text]);\n\n if (!anchor) return null;\n\n const style: React.CSSProperties = {\n position: 'fixed',\n left: position?.left ?? anchor.x + OFFSET,\n top: position?.top ?? anchor.y + OFFSET,\n visibility: position ? 'visible' : 'hidden',\n background: '#1a1a1a',\n color: '#fff',\n fontSize: 11,\n padding: '4px 8px',\n borderRadius: 4,\n pointerEvents: 'none',\n whiteSpace: 'nowrap',\n fontFamily: 'system-ui, sans-serif',\n boxShadow: '0 2px 8px rgba(0,0,0,0.15)',\n };\n\n return (\n <div ref={tipRef} style={style}>\n {text}\n </div>\n );\n}\n","/** Returns true when two CSS colour strings represent the same sRGB value. */\nexport function colorsMatch(a: string, b: string): boolean {\n const na = normalizeColor(a);\n const nb = normalizeColor(b);\n if (!na || !nb) return false;\n return na === nb;\n}\n\nfunction normalizeColor(color: string): string | null {\n const trimmed = color.trim().toLowerCase();\n if (/^#[0-9a-f]{3}$/.test(trimmed)) {\n const [, r, g, b] = trimmed.match(/^#(.)(.)(.)$/) ?? [];\n return `#${r}${r}${g}${g}${b}${b}`;\n }\n if (/^#[0-9a-f]{6}$/.test(trimmed)) return trimmed;\n\n const rgb = trimmed.match(/^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)/);\n if (rgb) {\n const [, r, g, b] = rgb;\n if (r === undefined || g === undefined || b === undefined) return null;\n const hex = (n: string) => Number(n).toString(16).padStart(2, '0');\n return `#${hex(r)}${hex(g)}${hex(b)}`;\n }\n return null;\n}\n\n/** Pick a visible border colour for a swatch on white UI chrome. */\nexport function swatchBorder(color: string): string {\n const n = normalizeColor(color);\n if (n === '#ffffff' || n === '#e6dccf') return '#ccc';\n return 'transparent';\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\n\ninterface SectionEditContextValue {\n selectedId: string | null;\n selectSection: (id: string | null) => void;\n}\n\nconst SectionEditContext = createContext<SectionEditContextValue | null>(null);\n\nexport function SectionEditProvider({ children }: { children: ReactNode }) {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n\n const selectSection = useCallback((id: string | null) => {\n setSelectedId(id);\n }, []);\n\n const value = useMemo(\n () => ({ selectedId, selectSection }),\n [selectedId, selectSection],\n );\n\n return (\n <SectionEditContext.Provider value={value}>{children}</SectionEditContext.Provider>\n );\n}\n\nexport function useSectionEdit(): SectionEditContextValue {\n const ctx = useContext(SectionEditContext);\n if (!ctx) {\n throw new Error('useSectionEdit() must be used inside SectionEditProvider');\n }\n return ctx;\n}\n","import { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { BrandColor } from '../types';\nimport { colorsMatch, swatchBorder } from '../lib/color-utils';\nimport { useSetto } from '../provider';\nimport { useSectionEdit } from '../section-context';\nimport { TOOLBAR_HEIGHT } from './constants';\n\nconst SECTION_TOOLBAR_HEIGHT = 44;\nconst GAP = 8;\nconst MARGIN = 8;\n\ninterface ToolbarPosition {\n top: number;\n left: number;\n}\n\nfunction computePosition(\n targetEl: HTMLElement,\n toolbarW: number,\n toolbarH: number,\n): ToolbarPosition {\n const rect = targetEl.getBoundingClientRect();\n\n let left = rect.left + (rect.width - toolbarW) / 2;\n left = Math.max(MARGIN, Math.min(left, window.innerWidth - toolbarW - MARGIN));\n\n // Always above the target; clamp below the main edit toolbar if needed.\n const minTop = TOOLBAR_HEIGHT + GAP;\n const top = Math.max(minTop, rect.top - toolbarH - GAP);\n\n return { top, left };\n}\n\ninterface PopoverPosition {\n top: number;\n left: number;\n}\n\ninterface BrandColorPickerProps {\n label: string;\n value: string;\n brandColors: BrandColor[];\n open: boolean;\n onToggle: () => void;\n onSelect: (value: string) => void;\n popoverPlacement: 'above' | 'below';\n}\n\nfunction BrandColorPicker({\n label,\n value,\n brandColors,\n open,\n onToggle,\n onSelect,\n popoverPlacement,\n}: BrandColorPickerProps) {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const [popoverPos, setPopoverPos] = useState<PopoverPosition | null>(null);\n\n const matched = brandColors.find((b) => colorsMatch(value, b.value));\n const displayColor = matched?.value ?? (value || '#cccccc');\n const displayLabel = matched?.label ?? label;\n\n useLayoutEffect(() => {\n if (!open || !buttonRef.current) {\n setPopoverPos(null);\n return;\n }\n\n const update = () => {\n const btn = buttonRef.current;\n const pop = popoverRef.current;\n if (!btn) return;\n\n const rect = btn.getBoundingClientRect();\n const popoverH = pop?.offsetHeight ?? 120;\n const popoverW = pop?.offsetWidth ?? 180;\n\n let top =\n popoverPlacement === 'above'\n ? rect.top - popoverH - 6\n : rect.bottom + 6;\n let left = rect.left;\n\n if (left + popoverW > window.innerWidth - 8) {\n left = window.innerWidth - popoverW - 8;\n }\n if (left < 8) left = 8;\n if (top < TOOLBAR_HEIGHT + 4) top = rect.bottom + 6;\n if (top + popoverH > window.innerHeight - 8) {\n top = rect.top - popoverH - 6;\n }\n\n setPopoverPos({ top, left });\n };\n\n update();\n requestAnimationFrame(update);\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n return () => {\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [open, popoverPlacement, brandColors.length]);\n\n const popover =\n open ? (\n <div\n ref={popoverRef}\n role=\"listbox\"\n aria-label={label}\n data-setto-ui\n style={{\n position: 'fixed',\n top: popoverPos?.top ?? -9999,\n left: popoverPos?.left ?? 0,\n visibility: popoverPos ? 'visible' : 'hidden',\n zIndex: 2147483647,\n display: 'grid',\n gridTemplateColumns: 'repeat(4, 1fr)',\n gap: 4,\n padding: 8,\n background: '#fff',\n border: '1px solid #e0e0e0',\n borderRadius: 8,\n boxShadow: '0 8px 24px rgba(0,0,0,0.15)',\n minWidth: 160,\n }}\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => e.stopPropagation()}\n >\n {brandColors.map((brand) => {\n const selected = colorsMatch(value, brand.value);\n return (\n <button\n key={brand.value}\n type=\"button\"\n role=\"option\"\n aria-selected={selected}\n title={brand.label}\n onClick={() => onSelect(brand.value)}\n style={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 4,\n padding: 6,\n background: selected ? '#f5f3ff' : 'transparent',\n border: selected ? '1px solid #640AFF' : '1px solid transparent',\n borderRadius: 6,\n cursor: 'pointer',\n }}\n >\n <span\n aria-hidden\n style={{\n width: 24,\n height: 24,\n borderRadius: '50%',\n background: brand.value,\n border: `1px solid ${swatchBorder(brand.value)}`,\n }}\n />\n <span style={{ fontSize: 10, color: '#666', lineHeight: 1.2 }}>\n {brand.label}\n </span>\n </button>\n );\n })}\n </div>\n ) : null;\n\n return (\n <>\n <button\n ref={buttonRef}\n type=\"button\"\n data-setto-ui\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => {\n e.stopPropagation();\n onToggle();\n }}\n aria-expanded={open}\n aria-haspopup=\"listbox\"\n aria-label={`${label}: ${displayLabel}`}\n title={`${label}: ${displayLabel}`}\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: 6,\n padding: '4px 8px 4px 6px',\n background: open ? '#f5f3ff' : '#f7f7f7',\n border: open ? '1px solid #640AFF' : '1px solid #e0e0e0',\n borderRadius: 6,\n cursor: 'pointer',\n fontSize: 11,\n color: '#444',\n whiteSpace: 'nowrap',\n flexShrink: 0,\n }}\n >\n <span\n aria-hidden\n style={{\n width: 18,\n height: 18,\n borderRadius: '50%',\n background: displayColor,\n border: `1px solid ${swatchBorder(displayColor)}`,\n flexShrink: 0,\n }}\n />\n <span>{label}</span>\n <span aria-hidden style={{ color: '#999', fontSize: 10, lineHeight: 1 }}>\n ▾\n </span>\n </button>\n {popover ? createPortal(popover, document.body) : null}\n </>\n );\n}\n\nexport function SectionToolbar() {\n const { themeStore, config } = useSetto();\n const { selectedId, selectSection } = useSectionEdit();\n const [pos, setPos] = useState<ToolbarPosition | null>(null);\n const [openField, setOpenField] = useState<string | null>(null);\n const barRef = useRef<HTMLDivElement>(null);\n\n const schema = selectedId ? config.sectionSchemas?.[selectedId] : null;\n const brandColors = config.brandColors ?? [];\n\n useLayoutEffect(() => {\n if (!selectedId) {\n setPos(null);\n return;\n }\n\n const el = document.querySelector<HTMLElement>(\n `[data-setto-section=\"${selectedId}\"]`,\n );\n if (!el) {\n setPos(null);\n return;\n }\n\n const update = () => {\n const bar = barRef.current;\n if (!bar) return;\n const w = bar.offsetWidth;\n const h = bar.offsetHeight || SECTION_TOOLBAR_HEIGHT;\n setPos(computePosition(el, w, h));\n };\n\n update();\n requestAnimationFrame(update);\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n return () => {\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [selectedId, openField, schema?.fields.length]);\n\n useEffect(() => {\n setOpenField(null);\n }, [selectedId]);\n\n useEffect(() => {\n if (!openField) return;\n\n const close = (e: MouseEvent) => {\n const target = e.target as Node;\n if (barRef.current?.contains(target)) return;\n if (target instanceof Element && target.closest('[data-setto-ui]')) return;\n setOpenField(null);\n };\n document.addEventListener('mousedown', close);\n return () => document.removeEventListener('mousedown', close);\n }, [openField]);\n\n useEffect(() => {\n if (!selectedId) return;\n\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== 'Escape') return;\n if (openField) {\n setOpenField(null);\n return;\n }\n selectSection(null);\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [selectedId, selectSection, openField]);\n\n if (!selectedId || !schema || !themeStore || brandColors.length === 0) {\n return null;\n }\n\n const colors = themeStore.getSection(selectedId);\n\n return (\n <div\n ref={barRef}\n role=\"toolbar\"\n data-setto-ui\n data-setto-theme-id={selectedId}\n aria-label={`Farger — ${schema.label}`}\n style={{\n position: 'fixed',\n top: pos?.top ?? -9999,\n left: pos?.left ?? 0,\n width: 'max-content',\n maxWidth: `calc(100vw - ${MARGIN * 2}px)`,\n minHeight: SECTION_TOOLBAR_HEIGHT,\n zIndex: 2147483646,\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '0 12px',\n background: '#ffffff',\n border: '1px solid #e0e0e0',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0,0,0,0.12)',\n fontFamily: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n fontSize: 12,\n pointerEvents: 'auto',\n userSelect: 'none',\n visibility: pos ? 'visible' : 'hidden',\n }}\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => e.stopPropagation()}\n >\n <span style={{ fontWeight: 600, whiteSpace: 'nowrap', flexShrink: 0 }}>\n {schema.label}\n </span>\n <span style={{ color: '#ccc', flexShrink: 0 }}>·</span>\n\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: 6,\n flexWrap: 'nowrap',\n }}\n >\n {schema.fields.map((field) => (\n <BrandColorPicker\n key={field.key}\n label={field.label}\n value={colors[field.key] ?? ''}\n brandColors={brandColors}\n open={openField === field.key}\n popoverPlacement=\"below\"\n onToggle={() =>\n setOpenField((prev) => (prev === field.key ? null : field.key))\n }\n onSelect={(v) => {\n themeStore.set(selectedId, field.key, v);\n setOpenField(null);\n }}\n />\n ))}\n </div>\n\n <button\n type=\"button\"\n data-setto-ui\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => {\n e.stopPropagation();\n selectSection(null);\n }}\n aria-label=\"Lukk\"\n style={{\n flexShrink: 0,\n background: 'transparent',\n border: 'none',\n color: '#999',\n cursor: 'pointer',\n fontSize: 16,\n lineHeight: 1,\n padding: '2px 6px',\n }}\n >\n ×\n </button>\n </div>\n );\n}\n","import { useEffect, useState } from 'react';\nimport type { RealtimeChannel, SupabaseClient } from '@supabase/supabase-js';\nimport type { DeploymentRow } from '../types';\n\ninterface BuildStatusProps {\n supabase: SupabaseClient;\n deploymentId: string;\n onDone?: (status: DeploymentRow['status']) => void;\n}\n\nconst STEPS: Array<{ key: DeploymentRow['status']; label: string }> = [\n { key: 'pending', label: 'Committed' },\n { key: 'building', label: 'Building' },\n { key: 'ready', label: 'Deployed' },\n];\n\n/**\n * Subscribes to a single row in `deployments` via Supabase Realtime.\n * Renders the three-step progress and an error state on failure.\n */\nexport function BuildStatus({ supabase, deploymentId, onDone }: BuildStatusProps) {\n const [row, setRow] = useState<DeploymentRow | null>(null);\n\n useEffect(() => {\n let channel: RealtimeChannel | null = null;\n let cancelled = false;\n\n const load = async () => {\n const { data } = await supabase\n .from('deployments')\n .select('*')\n .eq('id', deploymentId)\n .maybeSingle();\n if (!cancelled && data) setRow(data as DeploymentRow);\n };\n\n void load();\n\n channel = supabase\n .channel(`setto-dep-${deploymentId}`)\n .on(\n 'postgres_changes',\n {\n event: 'UPDATE',\n schema: 'public',\n table: 'deployments',\n filter: `id=eq.${deploymentId}`,\n },\n (payload) => {\n const next = payload.new as DeploymentRow;\n setRow(next);\n if (next.status === 'ready' || next.status === 'error' || next.status === 'canceled') {\n onDone?.(next.status);\n }\n },\n )\n .subscribe();\n\n return () => {\n cancelled = true;\n if (channel) supabase.removeChannel(channel);\n };\n }, [supabase, deploymentId, onDone]);\n\n const status: DeploymentRow['status'] = row?.status ?? 'pending';\n const errored = status === 'error' || status === 'canceled';\n\n return (\n <div style={{ fontSize: 12 }}>\n <div style={{ display: 'flex', justifyContent: 'space-between', gap: 4, marginBottom: 8 }}>\n {STEPS.map((step, i) => {\n const reached = isStepReached(status, i);\n const active = currentStepIndex(status) === i && !errored;\n return (\n <div key={step.key} style={{ flex: 1, textAlign: 'center' }}>\n <div\n style={{\n height: 4,\n borderRadius: 2,\n background: errored\n ? '#fca5a5'\n : reached\n ? '#640AFF'\n : '#e5e5e5',\n marginBottom: 4,\n }}\n />\n <span style={{ color: active ? '#1a1a1a' : '#888' }}>\n {step.label}\n {active ? ' …' : ''}\n </span>\n </div>\n );\n })}\n </div>\n {errored ? (\n <div style={{ color: '#dc2626' }}>\n {status === 'error' ? 'Bygg feilet.' : 'Avbrutt.'}\n {row?.error_message ? ` ${row.error_message}` : ''}\n </div>\n ) : null}\n {status === 'ready' && row?.url ? (\n <a\n href={row.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ color: '#640AFF', fontSize: 12 }}\n >\n Åpne deploy →\n </a>\n ) : null}\n </div>\n );\n}\n\nfunction currentStepIndex(status: DeploymentRow['status']): number {\n switch (status) {\n case 'pending':\n return 0;\n case 'building':\n return 1;\n case 'ready':\n return 2;\n default:\n return -1;\n }\n}\n\nfunction isStepReached(status: DeploymentRow['status'], i: number): boolean {\n return currentStepIndex(status) >= i;\n}\n","export function guessLangFromPath(path: string, languages: string[]): string | null {\n for (const lng of languages) {\n if (path.includes(`/${lng}.`) || path.includes(`/${lng}/`)) return lng;\n }\n const last = path.split('/').pop()?.split('.')[0];\n return last && languages.includes(last) ? last : null;\n}\n\nexport function pathForLang(_siteId: string, lng: string, _languages: string[]): string {\n return `src/i18n/locales/${lng}.json`;\n}\n\nexport function pathForTheme(_siteId: string, themePath?: string): string {\n return themePath ?? 'src/theme/sections.json';\n}\n\nexport function isThemePath(path: string, themePath?: string): boolean {\n return path === pathForTheme('', themePath) || path.endsWith('/sections.json');\n}\n","import { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useSetto } from '../provider';\nimport { guessLangFromPath, isThemePath } from './publish-utils';\n\n/** Loads locale and theme files from GitHub once per session to seed the draft baseline. */\nexport function useEditBaseline(): void {\n const { store, themeStore, api, config, session } = useSetto();\n const { i18n } = useTranslation();\n const [, setLoaded] = useState(false);\n\n useEffect(() => {\n if (!session || !store) return;\n const languages: string[] = i18n.languages?.length\n ? Array.from(new Set(i18n.languages))\n : ['no', 'en'];\n\n let cancelled = false;\n api\n .getContent(config.siteId)\n .then(({ files }) => {\n if (cancelled) return;\n for (const file of files) {\n try {\n const parsed = JSON.parse(file.content);\n if (isThemePath(file.path, config.themePath)) {\n themeStore?.loadBaseline(parsed);\n continue;\n }\n const lng = guessLangFromPath(file.path, languages);\n if (lng) i18n.addResourceBundle(lng, 'translation', parsed, true, true);\n } catch (err) {\n console.warn('[setto] failed to parse', file.path, err);\n }\n }\n setLoaded(true);\n })\n .catch((err) => {\n console.warn('[setto] getContent failed (using bundled JSON)', err);\n setLoaded(true);\n });\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [session, store, config.siteId]);\n}\n","import { useState, useSyncExternalStore } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useSetto } from '../provider';\nimport { EMPTY_I18N_STORE_SNAPSHOT } from '../lib/i18n-store';\nimport { BuildStatus } from './build-status';\nimport { useEditBaseline } from './use-edit-baseline';\nimport { pathForLang, pathForTheme } from './publish-utils';\n\nexport function EditToolbar() {\n const { store, themeStore, api, config, supabase } = useSetto();\n const { i18n } = useTranslation();\n useEditBaseline();\n\n const snap = useSyncExternalStore(\n (cb) => store?.subscribe(() => cb()) ?? (() => {}),\n () => store?.snapshot() ?? EMPTY_I18N_STORE_SNAPSHOT,\n () => EMPTY_I18N_STORE_SNAPSHOT,\n );\n\n const themeVersion = useSyncExternalStore(\n (cb) => themeStore?.subscribe(() => cb()) ?? (() => {}),\n () => themeStore?.snapshot().version ?? 0,\n () => 0,\n );\n\n void themeVersion;\n\n const [publishing, setPublishing] = useState(false);\n const [activeDeployment, setActiveDeployment] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n const textDraftCount = snap.drafts.size;\n const themeDraftCount = themeStore?.size() ?? 0;\n const draftCount = textDraftCount + themeDraftCount;\n const languages: string[] = i18n.languages?.length\n ? Array.from(new Set(i18n.languages))\n : ['no', 'en'];\n\n const publish = async () => {\n if (!store) return;\n setPublishing(true);\n setError(null);\n try {\n const bundles = store.serialiseBundles();\n const files = Object.entries(bundles).map(([lng, data]) => ({\n path: pathForLang(config.siteId, lng, languages),\n content: JSON.stringify(data, null, 2) + '\\n',\n }));\n if (themeStore && themeDraftCount > 0) {\n files.push({\n path: pathForTheme(config.siteId, config.themePath),\n content: JSON.stringify(themeStore.serialise(), null, 2) + '\\n',\n });\n }\n const result = await api.publish(config.siteId, files);\n store.commit();\n themeStore?.commit();\n setActiveDeployment(result.deploymentId);\n } catch (err) {\n setError(err instanceof Error ? err.message : 'unknown error');\n } finally {\n setPublishing(false);\n }\n };\n\n return (\n <header style={barStyle} role=\"toolbar\" aria-label=\"Setto editor\">\n <div style={leftStyle}>\n <strong style={{ fontSize: 13 }}>Setto</strong>\n <span style={sepStyle}>·</span>\n <span style={mutedStyle}>{config.siteId}</span>\n <span style={hintStyle}>Klikk tekst for å redigere · klikk seksjon for farger</span>\n </div>\n\n <div style={rightStyle}>\n {error ? <span style={errorStyle}>{error}</span> : null}\n {activeDeployment ? (\n <div style={{ minWidth: 200 }}>\n <BuildStatus\n supabase={supabase}\n deploymentId={activeDeployment}\n onDone={() => setActiveDeployment(null)}\n />\n </div>\n ) : (\n <>\n {draftCount > 0 ? (\n <span style={draftStyle}>\n {draftCount} {draftCount === 1 ? 'endring' : 'endringer'}\n </span>\n ) : null}\n <button\n type=\"button\"\n onClick={publish}\n disabled={draftCount === 0 || publishing}\n style={{\n ...publishBtnStyle,\n opacity: draftCount === 0 || publishing ? 0.5 : 1,\n }}\n >\n {publishing ? 'Publiserer …' : 'Publiser'}\n </button>\n </>\n )}\n <button type=\"button\" onClick={exitEditMode} style={exitBtnStyle}>\n Avslutt\n </button>\n </div>\n </header>\n );\n}\n\nfunction exitEditMode(): void {\n const u = new URL(window.location.href);\n u.searchParams.delete('setto');\n window.history.replaceState({}, '', u.toString());\n window.dispatchEvent(new PopStateEvent('popstate'));\n}\n\nconst barStyle: React.CSSProperties = {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 16,\n padding: '0 16px',\n background: '#ffffff',\n color: '#1a1a1a',\n fontFamily: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n fontSize: 13,\n borderBottom: '1px solid #e8e8e8',\n boxShadow: '0 1px 8px rgba(0, 0, 0, 0.06)',\n};\n\nconst leftStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 6,\n minWidth: 0,\n};\n\nconst rightStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 10,\n flexShrink: 0,\n};\n\nconst sepStyle: React.CSSProperties = { color: '#ccc' };\n\nconst mutedStyle: React.CSSProperties = { color: '#666', fontSize: 12 };\n\nconst hintStyle: React.CSSProperties = {\n color: '#999',\n fontSize: 12,\n marginLeft: 8,\n};\n\nconst draftStyle: React.CSSProperties = { color: '#666', fontSize: 12 };\n\nconst errorStyle: React.CSSProperties = { color: '#dc2626', fontSize: 12 };\n\nconst publishBtnStyle: React.CSSProperties = {\n background: '#640AFF',\n color: '#fff',\n border: 'none',\n borderRadius: 6,\n padding: '6px 14px',\n fontSize: 13,\n fontWeight: 500,\n cursor: 'pointer',\n};\n\nconst exitBtnStyle: React.CSSProperties = {\n background: 'transparent',\n color: '#666',\n border: '1px solid #ddd',\n borderRadius: 6,\n padding: '6px 10px',\n fontSize: 12,\n cursor: 'pointer',\n};\n","import { useEffect, useState, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { ThemeStore } from '../lib/theme-store';\nimport { useSettoDocumentLayout } from './document-layout';\nimport { EditLinkHint } from './link-hint';\nimport { SectionToolbar } from './section-toolbar';\nimport { EditToolbar } from './toolbar';\n\ninterface EditModeShellProps {\n children: ReactNode;\n themeStore: ThemeStore | null;\n}\n\n/**\n * Edit mode: full-width page with a fixed toolbar at the top. Text is edited\n * inline via contentEditable on `<T>` — no sidebar.\n */\nexport function EditModeShell({ children, themeStore }: EditModeShellProps) {\n useSettoDocumentLayout(true);\n\n const [toolbarRoot, setToolbarRoot] = useState<HTMLDivElement | null>(null);\n const [hintRoot, setHintRoot] = useState<HTMLDivElement | null>(null);\n const [sectionToolbarRoot, setSectionToolbarRoot] = useState<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const toolbar = document.createElement('div');\n toolbar.id = 'setto-toolbar-root';\n document.body.appendChild(toolbar);\n\n const hint = document.createElement('div');\n hint.id = 'setto-hint-root';\n hint.style.pointerEvents = 'none';\n document.body.appendChild(hint);\n\n const sectionBar = document.createElement('div');\n sectionBar.id = 'setto-section-toolbar-root';\n sectionBar.style.pointerEvents = 'none';\n document.body.appendChild(sectionBar);\n\n setToolbarRoot(toolbar);\n setHintRoot(hint);\n setSectionToolbarRoot(sectionBar);\n\n return () => {\n toolbar.remove();\n hint.remove();\n sectionBar.remove();\n };\n }, []);\n\n return (\n <>\n {children}\n {toolbarRoot ? createPortal(<EditToolbar />, toolbarRoot) : null}\n {hintRoot ? createPortal(<EditLinkHint />, hintRoot) : null}\n {sectionToolbarRoot && themeStore\n ? createPortal(<SectionToolbar />, sectionToolbarRoot)\n : null}\n </>\n );\n}\n\n/** @deprecated Use EditModeShell */\nexport const EditModeMount = EditModeShell;\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport type { SupabaseClient, Session } from '@supabase/supabase-js';\nimport { useTranslation } from 'react-i18next';\nimport { getSupabase } from './lib/supabase';\nimport { createApi, type SettoApi } from './lib/api';\nimport { I18nStore } from './lib/i18n-store';\nimport { ThemeStore } from './lib/theme-store';\nimport type { SettoConfig } from './types';\nimport { EditModeShell } from './edit-mode/mount';\nimport { SectionEditProvider } from './section-context';\n\ninterface SettoContextValue {\n config: SettoConfig;\n supabase: SupabaseClient;\n api: SettoApi;\n session: Session | null;\n /** True while the initial auth state is being read from local storage. */\n authLoading: boolean;\n /** True when inline edit mode is active (`?setto=edit` + session). */\n editMode: boolean;\n /**\n * Lazily created when i18next is initialised. Components that need it\n * should `if (!store) return null;` until then.\n */\n store: I18nStore | null;\n themeStore: ThemeStore | null;\n}\n\nconst SettoContext = createContext<SettoContextValue | null>(null);\n\nexport interface SettoProviderProps {\n config: SettoConfig;\n children: ReactNode;\n}\n\n/**\n * Wraps the host app. Initialises Supabase, the API client, and listens for\n * auth changes. Mounts the edit toolbar and enables inline editing when active.\n *\n * Edit mode is on when ALL of:\n * 1. There is an authenticated Supabase session.\n * 2. The URL contains `?setto=edit`.\n *\n * The /admin dashboard does not activate edit mode — use \"Begynn å redigere\"\n * which navigates to `/?setto=edit`.\n */\nexport function SettoProvider({ config, children }: SettoProviderProps) {\n const supabase = useMemo(() => getSupabase(config.supabase), [config.supabase]);\n const api = useMemo(() => createApi({ apiUrl: config.apiUrl, supabase }), [config.apiUrl, supabase]);\n\n const [session, setSession] = useState<Session | null>(null);\n const [authLoading, setAuthLoading] = useState(true);\n const [editParam, setEditParam] = useState(false);\n\n // Read auth session and subscribe to changes.\n useEffect(() => {\n let cancelled = false;\n supabase.auth.getSession().then(({ data }) => {\n if (cancelled) return;\n setSession(data.session ?? null);\n setAuthLoading(false);\n });\n const { data: sub } = supabase.auth.onAuthStateChange((_event, session) => {\n setSession(session);\n });\n return () => {\n cancelled = true;\n sub.subscription.unsubscribe();\n };\n }, [supabase]);\n\n // Track the ?setto=edit query parameter (history.pushState aware).\n useEffect(() => {\n const compute = () => {\n try {\n const params = new URLSearchParams(window.location.search);\n setEditParam(params.get('setto') === 'edit');\n } catch {\n setEditParam(false);\n }\n };\n compute();\n window.addEventListener('popstate', compute);\n return () => window.removeEventListener('popstate', compute);\n }, []);\n\n // The i18n store hangs off the live i18next instance from react-i18next.\n const { i18n } = useTranslation();\n const storeRef = useRef<I18nStore | null>(null);\n const themeStoreRef = useRef<ThemeStore | null>(null);\n const [storeReady, setStoreReady] = useState(false);\n\n useEffect(() => {\n if (!i18n) return;\n storeRef.current = new I18nStore(i18n);\n themeStoreRef.current = new ThemeStore(config.theme ?? {});\n setStoreReady(true);\n }, [i18n, config.theme]);\n\n const editMode = !!session && editParam;\n\n const value: SettoContextValue = {\n config,\n supabase,\n api,\n session,\n authLoading,\n editMode,\n store: storeReady ? storeRef.current : null,\n themeStore: storeReady ? themeStoreRef.current : null,\n };\n\n return (\n <SettoContext.Provider value={value}>\n <SectionEditProvider>\n {editMode && value.store ? (\n <EditModeShell themeStore={value.themeStore}>{children}</EditModeShell>\n ) : (\n children\n )}\n </SectionEditProvider>\n </SettoContext.Provider>\n );\n}\n\nexport function useSetto(): SettoContextValue {\n const ctx = useContext(SettoContext);\n if (!ctx) {\n throw new Error('useSetto() must be used inside <SettoProvider>');\n }\n return ctx;\n}\n","import { useTranslation } from 'react-i18next';\nimport { useEffect, useRef, useState, type FocusEvent, type FormEvent, type MouseEvent } from 'react';\nimport { useSetto } from './provider';\n\nexport interface TProps {\n /** The dotted translation key, e.g. 'hero.headline'. */\n k: string;\n}\n\nfunction isLinkContext(el: HTMLElement): boolean {\n const key = el.getAttribute('data-setto-key');\n if (key?.startsWith('lang.')) return false;\n if (el.closest('[data-setto-no-hint]')) return false;\n return !!(el.closest('a[href]') || el.closest('button'));\n}\n\n/**\n * Renders a translation key. In edit mode the text is contentEditable inline;\n * changes flow into the draft store for the active language.\n */\nexport function T({ k }: TProps) {\n const { t, i18n } = useTranslation();\n const { editMode, store } = useSetto();\n const ref = useRef<HTMLSpanElement>(null);\n const [focused, setFocused] = useState(false);\n\n const [, force] = useState(0);\n useEffect(() => {\n if (!store) return;\n return store.subscribe(() => force((x) => x + 1));\n }, [store]);\n\n const value = store ? store.get(k, i18n.language) : t(k);\n\n useEffect(() => {\n const el = ref.current;\n if (!el || focused || !editMode) return;\n if (el.textContent !== value) el.textContent = value;\n }, [value, focused, editMode]);\n\n if (!editMode) return <>{value}</>;\n\n const handleMouseDown = (e: MouseEvent<HTMLSpanElement>) => {\n e.stopPropagation();\n const el = e.currentTarget;\n if (!isLinkContext(el)) return;\n if (e.ctrlKey || e.metaKey) return;\n e.preventDefault();\n };\n\n const handleClick = (e: MouseEvent<HTMLSpanElement>) => {\n e.stopPropagation();\n const el = e.currentTarget;\n if (isLinkContext(el) && (e.ctrlKey || e.metaKey)) return;\n if (isLinkContext(el)) {\n e.preventDefault();\n }\n el.focus();\n };\n\n const commit = (el: HTMLSpanElement) => {\n const text = el.textContent ?? '';\n store?.set(k, i18n.language, text);\n };\n\n const handleBlur = (e: FocusEvent<HTMLSpanElement>) => {\n setFocused(false);\n commit(e.currentTarget);\n };\n\n const handleInput = (e: FormEvent<HTMLSpanElement>) => {\n store?.set(k, i18n.language, e.currentTarget.textContent ?? '');\n };\n\n return (\n <span\n ref={ref}\n data-setto-key={k}\n contentEditable\n suppressContentEditableWarning\n role=\"textbox\"\n tabIndex={0}\n onFocus={() => setFocused(true)}\n onBlur={handleBlur}\n onInput={handleInput}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n style={{\n cursor: 'text',\n outline: focused ? '2px solid #640AFF' : undefined,\n outlineOffset: 2,\n borderRadius: 2,\n transition: 'outline-color 120ms',\n }}\n />\n );\n}\n","import type { CSSProperties, MouseEvent } from 'react';\n\n/** Returns true when the click target is editable text or Setto UI chrome. */\nexport function isTextEditClick(target: HTMLElement): boolean {\n if (target.closest('[data-setto-key]')) return true;\n if (target.closest('[data-setto-ui]')) return true;\n let node: HTMLElement | null = target;\n while (node) {\n if (\n node.matches('h1,h2,h3,h4,h5,h6,p,li,figcaption') &&\n node.querySelector('[data-setto-key]')\n ) {\n return true;\n }\n node = node.parentElement;\n }\n return false;\n}\n\n/** True when the click landed on a nested theme target inside `container`. */\nexport function isNestedThemeTarget(\n target: HTMLElement,\n container: HTMLElement,\n): boolean {\n const hit = target.closest('[data-setto-section]');\n return !!(hit && hit !== container);\n}\n\nexport function handleThemeTargetClick(\n e: MouseEvent<HTMLElement>,\n editMode: boolean,\n themeId: string,\n selected: boolean,\n selectSection: (id: string | null) => void,\n onClick?: (e: MouseEvent<HTMLElement>) => void,\n): void {\n onClick?.(e);\n if (!editMode || e.defaultPrevented) return;\n\n const target = e.target as HTMLElement;\n if (isTextEditClick(target)) return;\n if (target.closest('a[href], button, input, textarea, select')) return;\n\n e.preventDefault();\n e.stopPropagation();\n selectSection(selected ? null : themeId);\n}\n\nexport function themeTargetEditStyle(\n editMode: boolean,\n selected: boolean,\n): CSSProperties {\n if (!editMode) return {};\n return {\n cursor: 'pointer',\n outline: selected ? '2px solid #640AFF' : undefined,\n outlineOffset: selected ? -2 : undefined,\n };\n}\n","import { useSyncExternalStore } from 'react';\nimport { useSetto } from './provider';\nimport { EMPTY_THEME_STORE_SNAPSHOT } from './lib/theme-store';\n\n/** Returns the current colour tokens for a section (live in edit mode). */\nexport function useSectionTheme(sectionId: string): Record<string, string> {\n const { themeStore, config } = useSetto();\n\n const version = useSyncExternalStore(\n (cb) => themeStore?.subscribe(() => cb()) ?? (() => {}),\n () => themeStore?.snapshot().version ?? EMPTY_THEME_STORE_SNAPSHOT.version,\n () => EMPTY_THEME_STORE_SNAPSHOT.version,\n );\n\n void version;\n\n if (themeStore) return themeStore.getSection(sectionId);\n return config.theme?.[sectionId] ?? {};\n}\n","import {\n forwardRef,\n useCallback,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n} from 'react';\nimport { useSetto } from './provider';\nimport { useSectionEdit } from './section-context';\nimport {\n handleThemeTargetClick,\n isNestedThemeTarget,\n themeTargetEditStyle,\n} from './theme-target-utils';\nimport { useSectionTheme } from './use-section-theme';\n\nexport interface SettoSectionProps extends ComponentPropsWithoutRef<'section'> {\n /** Theme key, e.g. 'values'. */\n sectionId: string;\n}\n\n/**\n * Wraps a page section with theme-driven background colour and edit-mode\n * selection. Click the section chrome (not editable text or nested blocks)\n * to open the colour toolbar.\n */\nexport const SettoSection = forwardRef<HTMLElement, SettoSectionProps>(\n function SettoSection({ sectionId, className, style, children, onClick, ...rest }, ref) {\n const { editMode } = useSetto();\n const { selectedId, selectSection } = useSectionEdit();\n const colors = useSectionTheme(sectionId);\n const selected = selectedId === sectionId;\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLElement>) => {\n if (editMode) {\n const target = e.target as HTMLElement;\n if (isNestedThemeTarget(target, e.currentTarget)) return;\n }\n handleThemeTargetClick(e, editMode, sectionId, selected, selectSection, onClick);\n },\n [editMode, onClick, selectSection, selected, sectionId],\n );\n\n const mergedStyle = {\n ...style,\n ...(colors.background ? { backgroundColor: colors.background } : {}),\n ...themeTargetEditStyle(editMode, selected),\n };\n\n return (\n <section\n ref={ref}\n data-setto-section={sectionId}\n className={className}\n style={mergedStyle}\n onClick={handleClick}\n {...rest}\n >\n {children}\n </section>\n );\n },\n);\n","import {\n forwardRef,\n useCallback,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n} from 'react';\nimport { useSetto } from './provider';\nimport { useSectionEdit } from './section-context';\nimport { handleThemeTargetClick, themeTargetEditStyle } from './theme-target-utils';\nimport { useSectionTheme } from './use-section-theme';\n\nexport interface SettoBlockProps extends ComponentPropsWithoutRef<'div'> {\n /** Theme key in sections.json, e.g. 'innovationCard'. */\n blockId: string;\n}\n\n/**\n * Themeable block (card, panel) inside a section. Click the block chrome to\n * edit its colours; click text to edit copy.\n */\nexport const SettoBlock = forwardRef<HTMLDivElement, SettoBlockProps>(\n function SettoBlock({ blockId, className, style, children, onClick, ...rest }, ref) {\n const { editMode } = useSetto();\n const { selectedId, selectSection } = useSectionEdit();\n const colors = useSectionTheme(blockId);\n const selected = selectedId === blockId;\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n handleThemeTargetClick(\n e as MouseEvent<HTMLElement>,\n editMode,\n blockId,\n selected,\n selectSection,\n onClick as ((e: MouseEvent<HTMLElement>) => void) | undefined,\n );\n },\n [editMode, blockId, selected, selectSection, onClick],\n );\n\n const mergedStyle = {\n ...style,\n ...(colors.background ? { backgroundColor: colors.background } : {}),\n ...themeTargetEditStyle(editMode, selected),\n };\n\n return (\n <div\n ref={ref}\n data-setto-section={blockId}\n className={className}\n style={mergedStyle}\n onClick={handleClick}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n","import { useState, type ReactNode } from 'react';\nimport { useSetto } from '../provider';\n\ntype Mode = 'signin' | 'signup';\n\nexport interface AuthGateProps {\n /** Rendered after a session is established. */\n children: ReactNode;\n}\n\n/**\n * Wraps `children` with a Supabase email/password login screen. Returns the\n * children only when a session exists.\n */\nexport function AuthGate({ children }: AuthGateProps) {\n const { supabase, session, authLoading } = useSetto();\n const [mode, setMode] = useState<Mode>('signin');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [error, setError] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n\n if (authLoading) {\n return <div style={loadingStyle}>Laster …</div>;\n }\n if (session) return <>{children}</>;\n\n const submit = async (e: React.FormEvent) => {\n e.preventDefault();\n setBusy(true);\n setError(null);\n try {\n const result =\n mode === 'signin'\n ? await supabase.auth.signInWithPassword({ email, password })\n : await supabase.auth.signUp({ email, password });\n if (result.error) throw result.error;\n // Ensure listeners run — signIn can succeed before onAuthStateChange fires.\n if (result.data.session) {\n await supabase.auth.setSession({\n access_token: result.data.session.access_token,\n refresh_token: result.data.session.refresh_token,\n });\n }\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Ukjent feil');\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div style={shellStyle}>\n <form onSubmit={submit} style={formStyle}>\n <h1 style={{ margin: 0, fontSize: 22 }}>Setto</h1>\n <p style={{ margin: 0, color: '#888', fontSize: 13 }}>\n {mode === 'signin' ? 'Logg inn for å redigere innholdet.' : 'Opprett konto.'}\n </p>\n <input\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"E-post\"\n autoComplete=\"email\"\n required\n style={inputStyle}\n />\n <input\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Passord\"\n autoComplete={mode === 'signin' ? 'current-password' : 'new-password'}\n required\n style={inputStyle}\n />\n {error ? <div style={{ color: '#ff7a7a', fontSize: 12 }}>{error}</div> : null}\n <button type=\"submit\" disabled={busy} style={btnStyle}>\n {busy ? '...' : mode === 'signin' ? 'Logg inn' : 'Opprett konto'}\n </button>\n <button\n type=\"button\"\n onClick={() => setMode((m) => (m === 'signin' ? 'signup' : 'signin'))}\n style={linkStyle}\n >\n {mode === 'signin' ? 'Ny her? Opprett konto' : 'Har konto? Logg inn'}\n </button>\n </form>\n </div>\n );\n}\n\nconst shellStyle: React.CSSProperties = {\n minHeight: '100dvh',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: '#0a0a0d',\n color: '#fff',\n fontFamily: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n};\n\nconst formStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n width: 320,\n background: '#15151a',\n padding: 24,\n borderRadius: 12,\n boxShadow: '0 12px 40px rgba(0,0,0,0.4)',\n};\n\nconst inputStyle: React.CSSProperties = {\n background: '#1f1f25',\n color: '#fff',\n border: '1px solid #2a2a32',\n borderRadius: 6,\n padding: '10px 12px',\n fontSize: 14,\n};\n\nconst btnStyle: React.CSSProperties = {\n background: '#640AFF',\n color: '#fff',\n border: 'none',\n borderRadius: 6,\n padding: '10px 12px',\n fontSize: 14,\n fontWeight: 500,\n cursor: 'pointer',\n};\n\nconst linkStyle: React.CSSProperties = {\n background: 'transparent',\n color: '#bda6ff',\n border: 'none',\n fontSize: 12,\n cursor: 'pointer',\n};\n\nconst loadingStyle: React.CSSProperties = {\n ...shellStyle,\n fontSize: 14,\n color: '#888',\n};\n","import { useEffect, useMemo, useState } from 'react';\nimport { AuthGate } from '../edit-mode/auth-gate';\nimport { useSetto } from '../provider';\nimport type { SiteRow, DeploymentRow } from '../types';\n\n/**\n * Drop-in admin SPA. Mount under a route like `<Route path=\"/admin/*\" .../>`.\n *\n * Behaviour after login:\n * - Lists sites the user is a member of (read via Supabase RLS).\n * - Single-site sites: redirect to `/?setto=edit` automatically.\n * - Multi-site: show a picker.\n *\n * While the user is on `/admin`, this component shows the site dashboard.\n * Editing happens on the public site at `/?setto=edit` via \"Begynn å redigere\".\n */\nexport function SettoAdminApp() {\n return (\n <AuthGate>\n <SiteList />\n </AuthGate>\n );\n}\n\nfunction SiteList() {\n const { supabase, session, config } = useSetto();\n const [sites, setSites] = useState<SiteRow[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n if (!session) return;\n let cancelled = false;\n supabase\n .from('sites')\n .select('*')\n .then(({ data, error: err }) => {\n if (cancelled) return;\n if (err) {\n setError(err.message);\n setSites([]);\n return;\n }\n setSites((data ?? []) as SiteRow[]);\n });\n return () => {\n cancelled = true;\n };\n }, [supabase, session]);\n\n const currentSite = useMemo(\n () => sites?.find((s) => s.id === config.siteId) ?? null,\n [sites, config.siteId],\n );\n\n return (\n <div style={shellStyle}>\n <header style={headerStyle}>\n <h1 style={{ margin: 0, fontSize: 22 }}>Setto</h1>\n <SignOutButton />\n </header>\n\n <main style={mainStyle}>\n {error ? <p style={errStyle}>{error}</p> : null}\n {sites === null ? <p style={mutedStyle}>Laster sider…</p> : null}\n\n {currentSite ? (\n <section style={cardStyle}>\n <h2 style={{ margin: 0, fontSize: 18 }}>{currentSite.display_name}</h2>\n <p style={mutedStyle}>\n {currentSite.repo_owner}/{currentSite.repo_name} · branch {currentSite.branch}\n </p>\n <div style={{ display: 'flex', gap: 8 }}>\n <a href={editUrl()} style={primaryBtnLinkStyle}>\n Begynn å redigere\n </a>\n </div>\n <DeploymentList siteId={currentSite.id} />\n </section>\n ) : sites && sites.length === 0 ? (\n <p style={mutedStyle}>\n Du er ikke medlem av noen sider ennå. Be administratoren legge deg\n til.\n </p>\n ) : null}\n\n {sites && !currentSite && sites.length > 0 ? (\n <section style={cardStyle}>\n <h2 style={{ margin: 0, fontSize: 16 }}>Andre sider du har tilgang til</h2>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>\n {sites.map((s) => (\n <li key={s.id} style={{ padding: '6px 0' }}>\n <code style={{ color: '#bda6ff' }}>{s.id}</code> — {s.display_name}\n </li>\n ))}\n </ul>\n <p style={mutedStyle}>\n Du er logget inn på denne siden ({config.siteId}), men er ikke\n medlem her. Spør administrator om tilgang.\n </p>\n </section>\n ) : null}\n </main>\n </div>\n );\n}\n\nfunction DeploymentList({ siteId }: { siteId: string }) {\n const { supabase } = useSetto();\n const [rows, setRows] = useState<DeploymentRow[] | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n supabase\n .from('deployments')\n .select('*')\n .eq('site_id', siteId)\n .order('started_at', { ascending: false })\n .limit(10)\n .then(({ data }) => {\n if (!cancelled) setRows((data ?? []) as DeploymentRow[]);\n });\n\n const channel = supabase\n .channel(`setto-site-deps-${siteId}`)\n .on(\n 'postgres_changes',\n { event: '*', schema: 'public', table: 'deployments', filter: `site_id=eq.${siteId}` },\n (payload) => {\n const next = payload.new as DeploymentRow | undefined;\n if (!next) return;\n setRows((prev) => {\n if (!prev) return [next];\n const without = prev.filter((r) => r.id !== next.id);\n return [next, ...without].slice(0, 10);\n });\n },\n )\n .subscribe();\n\n return () => {\n cancelled = true;\n supabase.removeChannel(channel);\n };\n }, [supabase, siteId]);\n\n if (!rows) return <p style={mutedStyle}>Laster deploys…</p>;\n if (rows.length === 0) return <p style={mutedStyle}>Ingen deploys ennå.</p>;\n\n return (\n <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 6 }}>\n {rows.map((r) => (\n <li key={r.id} style={depRowStyle}>\n <span style={depDotStyle(r.status)} />\n <code style={{ fontSize: 12, color: '#aaa' }}>{r.commit_sha.slice(0, 7)}</code>\n <span style={{ flex: 1, fontSize: 12 }}>{r.status}</span>\n <time style={{ fontSize: 11, color: '#888' }}>{new Date(r.started_at).toLocaleString()}</time>\n </li>\n ))}\n </ul>\n );\n}\n\nfunction SignOutButton() {\n const { supabase } = useSetto();\n return (\n <button onClick={() => supabase.auth.signOut()} style={signOutBtnStyle}>\n Logg ut\n </button>\n );\n}\n\nfunction editUrl(): string {\n const u = new URL(window.location.href);\n u.pathname = '/';\n u.searchParams.set('setto', 'edit');\n return u.toString();\n}\n\n// ───────── styles ─────────\n\nconst shellStyle: React.CSSProperties = {\n minHeight: '100dvh',\n background: '#0a0a0d',\n color: '#fff',\n fontFamily: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n};\n\nconst headerStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 24px',\n borderBottom: '1px solid #1c1c22',\n};\n\nconst mainStyle: React.CSSProperties = {\n maxWidth: 720,\n margin: '0 auto',\n padding: 24,\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n};\n\nconst cardStyle: React.CSSProperties = {\n background: '#15151a',\n borderRadius: 12,\n padding: 20,\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n};\n\nconst mutedStyle: React.CSSProperties = {\n color: '#888',\n fontSize: 13,\n margin: 0,\n};\n\nconst errStyle: React.CSSProperties = {\n color: '#ff7a7a',\n fontSize: 13,\n margin: 0,\n};\n\nconst primaryBtnLinkStyle: React.CSSProperties = {\n display: 'inline-block',\n background: '#640AFF',\n color: '#fff',\n border: 'none',\n borderRadius: 6,\n padding: '10px 14px',\n fontSize: 14,\n fontWeight: 500,\n textDecoration: 'none',\n};\n\nconst signOutBtnStyle: React.CSSProperties = {\n background: 'transparent',\n color: '#bda6ff',\n border: '1px solid #2a2a32',\n borderRadius: 6,\n padding: '6px 10px',\n fontSize: 12,\n cursor: 'pointer',\n};\n\nconst depRowStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 10,\n background: '#1a1a20',\n padding: '6px 10px',\n borderRadius: 6,\n};\n\nfunction depDotStyle(status: DeploymentRow['status']): React.CSSProperties {\n const colour =\n status === 'ready'\n ? '#34d399'\n : status === 'error' || status === 'canceled'\n ? '#ff7a7a'\n : status === 'building'\n ? '#fbbf24'\n : '#888';\n return {\n width: 8,\n height: 8,\n borderRadius: '50%',\n background: colour,\n flexShrink: 0,\n };\n}\n"],"names":["__awaiter","resolveFetch","FunctionRegion","sleep","head","_typeof","toPrimitive","toPropertyKey","_defineProperty","ownKeys","_objectSpread2","PostgrestClient","get","version","DEFAULT_VSN","DEFAULT_TIMEOUT","CHANNEL_STATES","CHANNEL_EVENTS","PostgresTypes","global","REALTIME_PRESENCE_LISTEN_EVENTS","REALTIME_POSTGRES_CHANGES_LISTEN_EVENT","REALTIME_LISTEN_TYPES","REALTIME_SUBSCRIBE_STATES","postgres_changes","_a","_b","bind","Transformers.convertChangeData","result","_getErrorMessage","handleError","_getRequestParams","_handleRequest","DEFAULT_HEADERS","fetch","factor","expiresAt","error","data","payload","currentLevel","nextLevel","verifiedFactors","currentAuthenticationMethods","version$1","MARGIN","mutedStyle","session","SettoSection","SettoBlock","shellStyle"],"mappings":";;;;AA0CO,SAAS,OAAO,GAAG,GAAG;AAC3B,MAAI,IAAI,CAAA;AACR,WAAS,KAAK,EAAG,KAAI,OAAO,UAAU,eAAe,KAAK,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI;AAC9E,MAAE,CAAC,IAAI,EAAE,CAAC;AACd,MAAI,KAAK,QAAQ,OAAO,OAAO,0BAA0B;AACrD,aAAS,IAAI,GAAG,IAAI,OAAO,sBAAsB,CAAC,GAAG,IAAI,EAAE,QAAQ,KAAK;AACpE,UAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,UAAU,qBAAqB,KAAK,GAAG,EAAE,CAAC,CAAC;AACzE,UAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAAA,IACxB;AACJ,SAAO;AACT;AA8DO,SAASA,YAAU,SAAS,YAAY,GAAG,WAAW;AAC3D,WAAS,MAAM,OAAO;AAAE,WAAO,iBAAiB,IAAI,QAAQ,IAAI,EAAE,SAAU,SAAS;AAAE,cAAQ,KAAK;AAAA,IAAG,CAAC;AAAA,EAAG;AAC3G,SAAO,KAAK,MAAM,IAAI,UAAU,SAAU,SAAS,QAAQ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