@ascentstudio/cue-console 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-build-manifest.json +360 -0
- package/.next/app-path-routes-manifest.json +38 -0
- package/.next/build-manifest.json +33 -0
- package/.next/diagnostics/build-diagnostics.json +6 -0
- package/.next/diagnostics/framework.json +1 -0
- package/.next/export-marker.json +6 -0
- package/.next/images-manifest.json +58 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +11 -0
- package/.next/react-loadable-manifest.json +1 -0
- package/.next/required-server-files.json +325 -0
- package/.next/routes-manifest.json +307 -0
- package/.next/server/app/_not-found/page.js +2 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/account/edge/page.js +2 -0
- package/.next/server/app/account/edge/page.js.nft.json +1 -0
- package/.next/server/app/account/edge/page_client-reference-manifest.js +1 -0
- package/.next/server/app/account/page.js +2 -0
- package/.next/server/app/account/page.js.nft.json +1 -0
- package/.next/server/app/account/page_client-reference-manifest.js +1 -0
- package/.next/server/app/api/queues/[[...path]]/route.js +139 -0
- package/.next/server/app/api/queues/[[...path]]/route.js.nft.json +1 -0
- package/.next/server/app/api/queues/[[...path]]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/revision-archive/route.js +1 -0
- package/.next/server/app/api/revision-archive/route.js.nft.json +1 -0
- package/.next/server/app/api/revision-archive/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/run-file/route.js +1 -0
- package/.next/server/app/api/run-file/route.js.nft.json +1 -0
- package/.next/server/app/api/run-file/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/transient-file/route.js +1 -0
- package/.next/server/app/api/transient-file/route.js.nft.json +1 -0
- package/.next/server/app/api/transient-file/route_client-reference-manifest.js +1 -0
- package/.next/server/app/auth/callback/route.js +1 -0
- package/.next/server/app/auth/callback/route.js.nft.json +1 -0
- package/.next/server/app/auth/callback/route_client-reference-manifest.js +1 -0
- package/.next/server/app/entities/[...entityId]/page.js +2 -0
- package/.next/server/app/entities/[...entityId]/page.js.nft.json +1 -0
- package/.next/server/app/entities/[...entityId]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/login/page.js +2 -0
- package/.next/server/app/login/page.js.nft.json +1 -0
- package/.next/server/app/login/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/danger/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/advanced/danger/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/danger/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/files/[[...path]]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/advanced/files/[[...path]]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/files/[[...path]]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/queues/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/advanced/queues/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/queues/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/runtimes/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/advanced/runtimes/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/advanced/runtimes/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/crons/[cron]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/crons/[cron]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/crons/[cron]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/crons/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/crons/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/crons/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/developers/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/developers/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/developers/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/entities/[...identity]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/entities/[...identity]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/entities/[...identity]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/import/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/import/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/import/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/kinds/[kind]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/kinds/[kind]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/kinds/[kind]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/[environment]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/environments/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/environments/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/files/[[...path]]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/files/[[...path]]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/files/[[...path]]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/flows/[flow]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/flows/[flow]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/flows/[flow]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/flows/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/flows/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/flows/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/queues/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/queues/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/queues/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/runs/[...run]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/runs/[...run]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/runs/[...run]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/runs/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/runs/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/runs/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/steps/[step]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/steps/[step]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/steps/[step]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/steps/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/steps/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/steps/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/supervisors/[...supervisorId]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/supervisors/[...supervisorId]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/supervisors/[...supervisorId]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/supervisors/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/supervisors/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/supervisors/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/workers/[...workerId]/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/workers/[...workerId]/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/workers/[...workerId]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/organizations/[organizationId]/workers/page.js +2 -0
- package/.next/server/app/organizations/[organizationId]/workers/page.js.nft.json +1 -0
- package/.next/server/app/organizations/[organizationId]/workers/page_client-reference-manifest.js +1 -0
- package/.next/server/app/page.js +2 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app-paths-manifest.json +38 -0
- package/.next/server/chunks/118.js +28 -0
- package/.next/server/chunks/1227.js +1 -0
- package/.next/server/chunks/2745.js +22 -0
- package/.next/server/chunks/3471.js +1 -0
- package/.next/server/chunks/3945.js +28 -0
- package/.next/server/chunks/4951.js +1 -0
- package/.next/server/chunks/5134.js +39 -0
- package/.next/server/chunks/5307.js +1 -0
- package/.next/server/chunks/5544.js +4 -0
- package/.next/server/chunks/5650.js +11 -0
- package/.next/server/chunks/5830.js +1 -0
- package/.next/server/chunks/6269.js +1 -0
- package/.next/server/chunks/6785.js +1 -0
- package/.next/server/chunks/688.js +1 -0
- package/.next/server/chunks/7090.js +12 -0
- package/.next/server/chunks/7860.js +1 -0
- package/.next/server/chunks/9775.js +6 -0
- package/.next/server/edge-runtime-webpack.js +2 -0
- package/.next/server/edge-runtime-webpack.js.map +1 -0
- package/.next/server/functions-config-manifest.json +6 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +32 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages/_app.js +1 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +1 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +19 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +5 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/src/middleware.js +41 -0
- package/.next/server/src/middleware.js.map +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/chunks/1960-c6e56b942a49e961.js +28 -0
- package/.next/static/chunks/3583-7a56b73280ed778d.js +1 -0
- package/.next/static/chunks/4013-3f45637d88477c77.js +1 -0
- package/.next/static/chunks/4208-b4aa7c9c0d952566.js +1 -0
- package/.next/static/chunks/4623-63127b62a8a72903.js +1 -0
- package/.next/static/chunks/4676-57f27fd7212dbb4c.js +1 -0
- package/.next/static/chunks/6-95f9f7f8524a131c.js +1 -0
- package/.next/static/chunks/6314-b31a7a56d6a402fb.js +1 -0
- package/.next/static/chunks/644-37687fe0d6f751c0.js +1 -0
- package/.next/static/chunks/68d6572c-f283d2faa40588f2.js +1 -0
- package/.next/static/chunks/9863f86b-1206839a9b6caaa6.js +1 -0
- package/.next/static/chunks/app/_not-found/page-ffc618da93d34e0e.js +1 -0
- package/.next/static/chunks/app/account/edge/page-9fb085dfc03572a5.js +1 -0
- package/.next/static/chunks/app/account/page-cc2e848665ce94fc.js +1 -0
- package/.next/static/chunks/app/api/queues/[[...path]]/route-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/api/revision-archive/route-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/api/run-file/route-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/api/transient-file/route-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/auth/callback/route-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/entities/[...entityId]/page-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/layout-2fcefb7fa6af5176.js +1 -0
- package/.next/static/chunks/app/login/page-e27f2054aac555c5.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/advanced/danger/page-0175a9a98ea9986c.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/advanced/files/[[...path]]/page-359b309c015000c9.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/advanced/queues/page-8d749ffb3bc4734f.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/advanced/runtimes/page-923797cc996adbe2.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/crons/[cron]/page-13f170b4f8a0ce14.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/crons/page-4986caf57d2c35b4.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/developers/page-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/entities/[...identity]/page-e0241442edba96e7.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/environments/[environment]/import/page-0c7c6e02b60dd0f1.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/environments/[environment]/kinds/[kind]/page-eb4992865971dd4c.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/environments/[environment]/page-5f0fd596e8424211.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/environments/page-040b34a033e847f4.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/files/[[...path]]/page-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/flows/[flow]/page-528eb9e28c9c79cf.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/flows/page-f635b0aa92431824.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/page-204a1429b9601965.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/queues/page-30bb7141897b22c1.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/runs/[...run]/page-4c3fd3a59380f414.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/runs/page-2c523bf23dc3ab9e.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/steps/[step]/page-2791149a21c18814.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/steps/page-2791149a21c18814.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/supervisors/[...supervisorId]/page-c7b82d9359a2ec25.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/supervisors/page-d622f4cb91d97ba5.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/workers/[...workerId]/page-9fe141cf11db8c39.js +1 -0
- package/.next/static/chunks/app/organizations/[organizationId]/workers/page-fe66e894882cc417.js +1 -0
- package/.next/static/chunks/app/page-5d4f444f72ffd898.js +1 -0
- package/.next/static/chunks/framework-5441844c055e8ad4.js +1 -0
- package/.next/static/chunks/main-777df5cd01757e8d.js +1 -0
- package/.next/static/chunks/main-app-7efc3aa24cb65686.js +1 -0
- package/.next/static/chunks/pages/_app-cef802c6256b034a.js +1 -0
- package/.next/static/chunks/pages/_error-ab37b1ec243afbed.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-34f7615e411b77e4.js +1 -0
- package/.next/static/css/97f395f0adbd1da3.css +1 -0
- package/.next/static/hztPDtxkg-AYXDOJLSokI/_buildManifest.js +1 -0
- package/.next/static/hztPDtxkg-AYXDOJLSokI/_ssgManifest.js +1 -0
- package/.next/trace +25 -0
- package/.next/types/app/account/edge/page.ts +84 -0
- package/.next/types/app/account/page.ts +84 -0
- package/.next/types/app/api/queues/[[...path]]/route.ts +347 -0
- package/.next/types/app/api/revision-archive/route.ts +347 -0
- package/.next/types/app/api/run-file/route.ts +347 -0
- package/.next/types/app/api/transient-file/route.ts +347 -0
- package/.next/types/app/auth/callback/route.ts +347 -0
- package/.next/types/app/entities/[...entityId]/page.ts +84 -0
- package/.next/types/app/layout.ts +84 -0
- package/.next/types/app/login/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/advanced/danger/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/advanced/files/[[...path]]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/advanced/queues/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/advanced/runtimes/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/crons/[cron]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/crons/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/developers/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/entities/[...identity]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/environments/[environment]/import/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/environments/[environment]/kinds/[kind]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/environments/[environment]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/environments/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/files/[[...path]]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/flows/[flow]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/flows/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/queues/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/runs/[...run]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/runs/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/steps/[step]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/steps/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/supervisors/[...supervisorId]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/supervisors/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/workers/[...workerId]/page.ts +84 -0
- package/.next/types/app/organizations/[organizationId]/workers/page.ts +84 -0
- package/.next/types/app/page.ts +84 -0
- package/.next/types/cache-life.d.ts +141 -0
- package/.next/types/package.json +1 -0
- package/.next/types/routes.d.ts +106 -0
- package/.next/types/validator.ts +376 -0
- package/bin/console.mjs +35 -0
- package/next.config.ts +44 -0
- package/package.json +30 -4
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src/middleware.js","mappings":"yFAGE,gBAAkE,mBCHpE,QAAM,OAAO,mBAAkB,cAAe,aAAa,2MAAuO,uOAAqQ,gBAAyB,SAAS,eAAgB,uBAA4B,uBAAuB,CAAK,SAAW,SAAS,eAAgC,QAAT,KAAS,IAAY,WAAW,IAAK,2BAA2B,SAAS,iBAAmB,6CAAgE,eAAsB,uBAAuB,CAAkF,gBAAoB,gBAAyC,OAAxB,qBAAj8B,IAAy9B,6BAAz9B,IAAy9B,EAAyC,gBAAgD,IAApB,oBAAoB,iBAAsB,oBAA0B,IAAN,MAAM,gBAAsB,MAAU,GAAM,iBAAyB,QAAQ,WAAW,IAAK,SAAgB,OAAP,OAAO,iBAA6B,GAAiB,CAAjB,SAAiB,eAAmB,6BAA6B,IAAK,YAAiB,GAAsB,CAAtB,SAAsB,sCAAwF,kCAAv8C,GAA4+C,EAA5+C,EAA45C,oCAA55C,EAAk8C,GAAl8C,EAA4+C,eAAsB,qDAA0D,CAAL,GAAK,SAAiB,MAAM,iBAAyB,eAAgB,mCAAmC,YAAY,cAAc,IAAK,gBAAmB,mBAAmB,iBAAqB,kBAAkB,UAAgH,GAAI,sKAAsK,GAAO,2JAA2J,IAAI,w3BAAw3B,IAAI,q2BAAq2B,gBAAgB,khBAAkhB,GAAG,+NAA5rF,CAAO,+FAA+F,CAAslF,gHAAyV,2fAA2f,qHAAqH,gCAAgC,kCAAyC,gJAAgJ,IAAI,mDAAmD,mBAA9oL,GAA8oL,gBAA4C,yCAAyC,0CAA0C,sHAA6H,IAAI,WAAW,IAAI,oMAAoM,gCAAgC,SAAS,oEAAoE,0CAA0C,6GAA6G,EAAE,8DAA8D,sBAAsB,IAAI,qGAAqG,8TAA8T,iCAAiC,EAAE,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MADA,mEAAmF,UAAY,EAC/F,CACA,CAEA,CACO,uBACP,gBACA,IACA,KACA,kEACA,CAAM,SAEN,2DACA,CACA,CACA,WACO,aAIP,OAHA,GACA,QAEA,CACA,CACA,cAEA,oDAAyD,EAAO;AAChE,0EAyCA,UAAoB,GAAM,WAE1B,YAAsB,GAAM,aACpB,GAAM,kBAId,IACA,yDACA,MAhDA,YACA,4BAAyC,EACzC,SACA,cACA,QAEA,8DACA,aACA,cACA,eACA,CAAa,CACb,CAAS,CACT,YACA,6DACA,aACA,cACA,eACA,CAAa,CACb,CAAS,CACT,aACA,2BACA,cAEA,8DACA,aACA,cACA,eACA,CAAa,CACb,CACA,CAAK,EACL,mBAAuB,EACvB,SACA,CAAK,CACL,EAgBA,cACA,eACA,CAAS,CACT,CAAM,OAEN,GCjGO,uBACP,kBAAkB,EAAM,EACxB,yBAAiC,EAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,IACA,CACA,CACO,sBACP,cACA;AACA;AACA,IACA,CACA,CACO,sBACP,cACA;AACA;AACA,IACA,CACA,CCAO,cAoDP,GAGA,gBAIA,4BAGA,0BAGA,+BAGA,mBAGA,mBAGA,wBAGA,wBAGA,uBAGA,oCAGA,oCAGA,8BAGA,6BACA,ECpFU,cACV,IAEA,EACA,EACA,EACA,EACA,EANA,KACA,IAMA,aACA,yCACA,KAEA,kBAMA,kBAGA,IAFA,IACA,KACA,KAEA,SADA,gBACA,CAMA,IAJA,IACA,KACA,IACA,IACA,YAbA,MADA,iBACA,EAAsC,IAAtC,GAAsC,SActC,IAGA,gCAEA,KAEA,IACA,yBACA,KAIA,KAEA,EAAc,IACd,IAGA,oBACA,+BAEA,CACA,QACA,CAOW,cACX,SACA,KACA,KACA,2BACA,gCAIA,gBACA,0BAEA,OAIA,QACA,CAGW,cACX,IACA,iCACA,CAAM,SACN,uDAAmE,UAAY,+FAC/E,OACA,CAAS,uBACT,YACA,cACA,eACA,CAAS,CACT,CACA,CDRA,EACA,KACA,OACA,cAC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S,CKoBrB,cLlByBlB,CKmBzB,0BAEA,cACA,uBAEA,eACA,iBACA,CACA,aACA,yBACA,CACA,cACA,QACA,2GACA,uFAAuG,EAAO,yBAC9G,aACA,cACA,eACA,CAAa,CAEb,iBACA,CACA,oBACA,6BAEA,mBACA,4BAEA,mBACA,+BACA,CACA,WACA,wBAEA,YACA,kBACA,CACA,eACA,4BAEA,gBACA,sBACA,CACA,WACA,wBAEA,YACA,kBACA,CACA,eACA,4BAEA,gBACA,sBACA,CACA,WACA,4BACA,sBACA,SAAkB,cAAc,IAAI,UAAU,EAAE,EAAS,EAAE,EAAO,EAAE,UAAU,EAE9E,YACA,iBACA,cACA,CACA,aACA,0BAEA,eACA,4BAEA,gBACA,sBACA,CACA,WACA,wBAEA,YACA,kBACA,CACA,aACA,0BAEA,cACA,oBACA,CACA,eACA,4BAEA,gBACA,sBACA,CACA,eACA,4BAEA,gBACA,sBACA,CACA,eACA,wBAEA,gBACA,yCAAsE,EAAM,EAE5E,WACA,iBAEA,SACA,gBACA,CACA,8CACA,OACA,eACA,mBACA,uBACA,uBACA,uBACA,eACA,uBACA,eACA,uBACA,mBACA,+BACA,eAEA,CACA,QACA,0CACA,CACA,cElLO,gCAKI,yBACX,kBAAgC,EAChC,oDACQ,EAAW,GAUnB,MAVmB,OAUnB,mBACA,WACA,UAA4B,EAAO,GACnC,EADmC,MACd,EAAyB,cAC9C,SAD8C,EAC9C,aACS,CACT,UACA,YAAyB,gBAAc,eACvC,UACA,IAAqE,CAApD,CAAoD,KAAN,GAAG,CAAG,CACrE,CACA,CACA,8CACA,OACA,qBACA,qBACA,aAEA,uBACA,iBACA,6BACA,6BACA,yCACA,yBACA,yBACA,mBACA,eACA,uBACA,uBACA,mCACA,mBAEA,CACA,cACA,uBAEA,cACA,uBAMA,WACA,UAAkB,CAClB,CAKA,SACA,KAPkC,CAOlC,IAAkB,CAClB,CACA,UACA,EAHgC,KAGhC,YAEA,CC9EO,QACP,kBACA,+BACA,qBACA,UAEA,CACA,CACA,oBACA,2BACA,CACA,gBACA,uBACA,CACA,2BACA,kCACA,CACA,CCZA,IAAM,EAAS,4BACf,WACA,IACA,IACA,IACA,IACA,IACA,EACA,iBACA,MACA,kDACA,2CACA,yGACA,aACA,cACA,eACA,CAAa,EAEb,SACA,iCACA,mCACA,UAEA,kDACA,CACA,CAKW,0BACX,kBAA+B,EAC/B,WACA,mBAEA,YADA,IAA4B,iBAAe,IAC3C,CACA,WACA,UACA,aACA,UAEA,eACA,8BACA,iBAKA,OAJA,aAAsD,iBAAe,EACrE,kDAAyG,qBAAe,gBAExH,QACA,CACA,CAEA,SACA,OAA+B,EAAc,UAC7C,CACA,CACA,CAAS,CACT,MAAa,EAAS,EACtB,UACA,IAFsB,EAEtB,QAAgC,EAAO,OACvC,QAAyB,EAAyB,GAClD,oBADkD,GAClD,CACa,QACb,CACA,CACA,8CACA,OACA,qBACA,aAEA,eACA,uBACA,yCACA,WACA,2BACA,mBACA,2BACA,eAEA,CACA,cACA,YAAoB,EAAS,QAC7B,CACA,iBACA,yBACA,uBACA,CACA,qBACA,0DACA,aACA,+HACA,aACA,cACA,eACA,CAAa,EAEb,8BACA,wCAEA,OADA,iBAAgC,EAAW,IAC3C,KAD2C,EAC3C,MACA,KACA,UACA,QACA,CAAS,CACT,CACA,oBACA,4CAGA,OAFA,6BAA4C,EAAW,IACvD,KADuD,GAEvD,aACA,KACA,SACA,CAAS,CACT,CACA,eACA,4CAGA,OAFA,+BACA,QACA,aACA,KACA,SACA,CAAS,CACT,CACA,CChHO,SAASwE,GACdC,CAAiB,CACjBC,CAAkB,EAElB,IAAMC,EAAU,iBAAOD,EAAoB,IAAIE,IAAIF,GAAQA,EACrDG,EAAW,IAAID,IAAIH,EAAKC,GAGxBI,EAAaD,EAASE,MAAM,GAAKJ,EAAQI,MAAM,CAErD,MAAO,CACLN,IAAKK,EACDD,EAAShB,QAAQ,GAAG/C,KAAK,CAAC6D,EAAQI,MAAM,CAAC3C,MAAM,EAC/CyC,EAAShB,QAAQ,cACrBiB,CACF,CACF,CCzBO,IAAME,GAA8B,uBAY9BC,GAAiB,OAbe,yBAgB3CD,GARqC,mBADrC,+BAYD,CAAS,GAE0B,MKvBzB,CLuBwC,MKvBxC,iBACX,cACA,2GACA,CACA,kBACA,YACA,CACA,CACO,yBACP,eAGA,QACA,0BACA,WAIA,sBACA,OAA2B,EAAc,WAEzC,CAFyC,GAEzC,kBAIA,8CAEA,cAEA,OAAuB,EAAc,UACrC,CAAa,CACb,aACA,sBACA,OAA2B,EAAc,aAEzC,sBAIA,8CAEA,OAAuB,EAAc,eACrC,CAAa,CACb,SACA,6BAAqD,EAAc,SACnE,GADmE,CACnE,kBAIA,qDAEA,YAEuB,EAAc,QACrC,CAAa,CACb,EAFqC,aAErC,KACA,6BAAqD,EAAc,oBACnE,sBAIA,qDAEA,YAEuB,EAAc,mBACrC,CACA,CAAS,CACT,CAIA,eACA,oBACA,WACA,UACA,aACA,aACA,UACA,2BAEA,OAA+B,EAAc,UAC7C,CACA,CAF6C,CAGpC,CACT,CAOA,gBACA,8BACA,CACA,CAMA,sBACA,uBACA,SACA,CACA,YACA,sBACA,mBACA,iBACA,EACA,EACA,CACU,iBACV,UAEA,iBAEA,CACA,UACA,sBACA,CACA,OACA,6BACA,yBACA,IACA,CACA,OACA,gCAEA,SACA,iBACA,CACA,aACA,8BACA,kBAEA,CACA,WACA,wCACA,sBAGA,aACA,OACA,EACA,EACA,CAEA,CACA,QACA,wCACA,qBACA,QACA,CACA,CACA,UACA,wCAGA,iBACA,QACA,CACA,CACA,oBACA,qBACA,CACA,CCzKA,sIACA,aACA,cACA,eACA,CAAC,CACD,UACA,UACA,QACA,CACA,WAGA,CACA,MACA,QACA,CACA,OACA,QACA,CACA,YACA,QACA,CACA,eACA,QACA,CACA,CACA,oEACO,SAAS,YAChB,GACA,OAEA,MACA,CC/BO,OAAiC,IEK7B,GHqB4B,IGrB5B,iBACX,cACA,CFP+D,IEO/D,oJACA,CACA,kBACA,YACA,CACA,CACO,MAAM,GACb,eACA,mBAFkC,CAGlC,WACA,UACA,YACA,aACA,UACA,2BAEA,OAA+B,EAAc,UAC7C,CACA,CAF6C,CAGpC,CACT,CACA,CACA,yCA4BO,UACP,iBACA,UAAoC,iBAAe,cACnD,wBACA,SAEA,SACA,UACA,OAEA,MAA8B,GAAgB,WAM9C,GALA,GACA,IAF8C,iBAE9C,KAGA,EADA,WACA,yBACA,GACA,SACA,gBACA,UAA4C,iBAAe,cAC3D,SACA,oBACA,CACA,IACA,CACA,EACA,eACA,WACA,UAEA,QACA,QAGA,cACA,sBACA,4CACA,IAEA,OADA,eACA,CACA,EAA8B,OAC9B,GACA,CACA,CACA,WACA,sBACA,4CACA,IAEA,OADA,YACA,CACA,EAA8B,OAC9B,GACA,CACA,CACA,SACA,OAA+B,EAAc,UAC7C,CACA,CACA,CAAS,EACT,QACA,CACA,CAiCA,iBACA,GATA,mBAWA,YAEA,CCvJA,mBAaA,OAZA,2CACA,uBACA,yBACA,2CACA,6BACA,6EACA,iDACA,yCACA,uCACA,2DACA,mDACA,mCACA,CACA,CAAC,OAAqB,EACtB,eAGA,OAFA,yEACA,iDACA,CACA,CAAC,OAAyB,EAC1B,eAKA,OAJA,mDACA,mCACA,+DACA,2CACA,CACA,CAAC,OAAqB,EACtB,eAgCA,OA/BA,2CACA,yCACA,2DACA,iEACA,+DACA,6DACA,iEACA,6DACA,iEACA,qDACA,6CACA,iCACA,iCACA,yCACA,iDACA,2CACA,uDACA,yDACA,mDACA,yEACA,uDACA,6CACA,2CACA,uDACA,uCACA,+CAEA,gBACA,0BACA,4BACA,gCACA,CACA,CAAC,OAAyB,EAC1B,eAEA,OADA,wCACA,CACA,CAAC,OAAsB,EACvB,eAMA,OALA,iDACA,yCACA,yCACA,yCACA,6CACA,CACA,CAAC,OAAiB,EAClB,eAKA,OAJA,4CACA,4DACA,0CACA,0BACA,CACA,CAAC,OAAoB,EACrB,eAEA,OADA,qCACA,CACA,CAAC,OAAiB,EACd,GAAQ,YAEZ,GAFY,IACZ,+BACA,CACA,CAAC,CAAC,IAAQ,EAAM,EAChB,UADU,EACV,GAEA,OADA,gDACA,CACA,CAAC,OAAgC,EACjC,eAGA,OAFA,sDACA,sDACA,CACA,CAAC,OAA0B,EAC3B,eAEA,OADA,+BACA,CACA,CAAC,OAAqB,EAEf,gBACP,qBACA,2BACA,4BACA,wBACA,kBACA,0BACA,wBACA,kBACA,mCACA,mCACA,mCACA,qCACA,oCACA,uCACA,+BACA,wCACA,EAGO,YACP,oCACA,qCACA,wCACA,EC9HO,SAASE,GACdC,CAAuB,EAEvB,OACc,OAAZA,GACmB,UAAnB,OAAOA,GACP,SAAUA,GACc,YAAxB,OAAOA,EAAQC,IAAI,CCXvB,gDAkBA,SAAQ,0EARR,EAAU,EAAQ,GAAoB,CAS/B,aATU,KASV,MACP,iBACA,mCACA,CACA,CAKA,eACA,CALO,kBACP,8BACA,gBACA,EAEA,aACA,kCAEA,IACA,qBACA,qCAEA,aACA,cACA,iCACS,GAET,OACA,EACA,WACA,yCACA,KAEA,IACA,WACA,QACA,MACA,OACA,CAAS,CACT,CACA,CACA,UAKA,oBACA,sCACA,CACA,aACA,SACA,CACA,0BACA,kBACA,KAEA,OADA,kBACA,CACA,CACA,qBACA,8CACA,CACA,6BACA,kBACA,wBAEA,WAEA,wBACA,mBACA,CACA,YACA,MACA,aAEA,IAAgB,aAAc,sBAC9B,KACA,UACA,EAAU,CACV,KACA,SACA,KAEA,EACA,gBACA,IAAa,GAAwB,wDACrC,WAGA,oFACA,KACA,EAGU,oDACV,QAHA,oCACA,MAIA,MAhEA,KAsEA,OALA,cACA,mBACA,mBACA,eACA,EACA,kFACA,CACA,QAA4D,GAAgB,QAC5E,KAD4E,cAC5E,yEAEA,SACA,QACA,IACA,KACA,aACA,GACA,uBAA+C,GAA6B,QAAQ,kEAAoF,GACxK,QACA,qBACA,CAAyB,EAEzB,EAIA,GAHA,GACA,gDAAuG,IAEvG,WACA,IACA,sBACA,CAAsB,SAEtB,MADA,QACA,CACA,EAAsB,OACtB,GACA,CAEA,IACA,WACA,GAAwB,GAAU,GAElC,IAFkC,GAElC,WACA,QAGA,IACyB,UAEzB,MADA,QACA,CACA,CAAyB,aAKzB,OAHA,QACA,IAEA,CACA,CAAkB,SAGlB,MAFA,QACA,IACA,CACA,CACA,CAAa,EACb,CACA,WACA,WACA,wBACA,KACA,EAAc,CACd,KACA,QACA,GAAqC,4CAGrC,WACA,OACA,6CACA,4BAEA,yBACA,eACA,wBAUA,+CAVA,EACA,yCACA,2BACA,yBAEA,OADA,cACA,uBACA,EACA,yBAEA,CAGA,CAHc,CAlBd,CAsBA,CACA,gBACA,WACA,gFACA,gDACA,CACA,kBAEA,OADA,kCAEA,CACA,wBACA,+BACA,gBACA,CACA,0BACA,+BACA,WACA,IACA,UAEA,CACA,CACA,IAAM,GAAS,MACf,OADe,GACf,GACA,YACA,CAAC,GC7KM,wBAGA,OAFA,uBAGA,UC1DA,UACP,qBACA,MAGA,SAAqD,SDuC9C,KACP,MAAoB,GAAc,ECxC4C,EDwC5C,YAIlC,OACA,qBAJA,MAAsC,2BAA2B,CACjE,gBAIA,wBAHA,MAAgD,sCAIhD,CACA,EChD8E,CD2CY,CC3CZ,wBAC9E,iBAAwD,GAA4B,gBACpF,mDAEA,mDACA,sBACA,CACA,gBACA,uBAEA,SACA,wBACA,iIACA,YACA,cACA,eACA,CAAa,EAEb,0BACA,KAAkB,GAClB,yBAD8C,CAE9C,YACA,SAA4D,CAAtC,KAAsC,CAC5D,EADwE,CAAK,KACzD,EACpB,QACA,CAAS,CAF+B,CAGxC,kBACA,CACA,UAIA,0BACA,KAAkB,GAClB,SACA,YACA,IAH8C,KAGc,CAAtC,KAAsC,CAC5D,EADwE,CAAK,KACzD,EACpB,SACA,CAFwC,OAExC,WACA,CAAS,EACT,kBACA,CACA,CC5BA,iBACA,iGACA,2CACA,cACA,aAA6B,EAAkB,GAC/C,aAD+C,SAC/C,GAIA,aAFA,IAAoC,iBAAe,IAEnD,SACA,QAEA,CACA,CCjCO,OAAqC,6BCDrC,OAAMC,ODCsD,ICD/BC,MAClCC,YAAYC,CAAe,CAAElD,CAAsB,CAAE,CAD5B+C,KAElB,CACF,eAAaG,CAAAA,CAAQ3C,QAAQ,CAAC,KAAO2C,EAAUA,EAAU,KAAE,6BAC5DlD,GAEF,IAAI,CAACmD,IAAI,CAAG,gBACd,CACF,CELA,SACA,mBACA,eACA,eACA,WACA,YACA,WACA,CACA,CAIA,SACA,cACA,eACA,cACA,CACA,CAkBW,SACX,mBACA,mBACA,iBACA,eACA,qBACA,eAGA,iBACA,iBACA,yBACA,yBAMA,aACA,iBACA,sBAEA,sBACA,gBACA,CAKA,cAEA,mBACA,mBAKA,cACA,mBACA,iBACA,CAKA,aACA,qBAGA,OADA,mBACA,CACA,CASA,SACA,2EACA,QACA,sEAAsF,EAAK,yHAC3F,aACA,cACA,eACA,CAAa,EAEb,kBAEA,OADA,iDACA,GAEA,wBACA,KAEA,SACA,uCACA,SACA,uBACU,CAEV,oBACA,oBACA,kBACA,iBACA,CAEA,sDACA,wBACA,yBACA,uBACA,wDACA,CACA,QACA,CAMA,OACA,wBACA,CAMA,OACA,wBACA,KAGA,OADA,mBACA,OAKA,qBACA,qBACA,wBAEA,OACA,OACA,MACA,OACA,CACA,SAEA,CAUA,UACA,wBACA,IACA,mBACA,qBACA,uBACA,CAGA,WACA,uBAKA,kBACA,sBAEA,eE9JoB,IAAIC,GACtB,KAD8BA,KAE9B,EADY,CACDC,EAAMC,IAAI,EAITC,QAAQC,GAAG,CAACC,wBAAwB,EAC9CC,QAAQC,KAAK,CAACC,IAAI,CAACF,QAAS,wBC3CrB,ED4CPpF,MC5CO,0CACX,0BAA8B,EAAQ,QACtC,EAAE,OACF,4BACA,8CACA,0CAKA,cAuEW,cACX,UAGA,uBACA,CCtF4F,uBAC5F,MACA,WAIA,YACA,IACA,gBACA,EAAM,OAEN,eAiBA,KACA,wCACA,qCACA,OACA,qEACA,wHACA,sEACA,CACA,EAzBA,QACA,cACA,CACA,CACA,eACA,OACA,oDACA,yBACA,IACA,oBACA,uBACA,CAAS,CACT,sDACA,0BACA,IAEA,CAUA,uBACA,gBACA,OAEA,SACA,GACA,2BAEA,MAAqB,WD0BrB,KC1BqC,CD0BrC,IAGA,sBACA,IC7BA,KACA,eACA,0BAGA,qBACA,CACO,uBACP,8EACA,kEACA,4EACA,oBACA,4BACA,oBACA,EACA,CACA,CC/DA,IAAM,GAAwC,+HAC9C,aACA,cACA,eACA,CAAC,CACD,OAAM,GACN,UACA,MAAc,EACd,CACA,WAGA,CACA,MACA,CAT2B,KASb,EACd,CACA,OACA,MAAc,EACd,CACA,YACA,EAbsD,IAaxC,EACd,CACA,eACA,KATsD,EAStD,CACA,CACA,CACA,IAAM,GAA4B,IAToB,SASpB,YANoB,OAMpB,6BCzB3B,GD2BP,GACA,IAAmB,GAEnB,IAAe,EGvBR,UACP,GFR6C,SEQ7C,UHmBoC,CGnBlB,MHsBkB,IGtBlB,gBAAiC,EACnD,MFToE,aESpE,SACA,iBACA,eACA,mBACA,sBAAiC,OAAY,IAC7C,sBACA,CACA,SACA,GAAY,GAAU,GACtB,gBACA,KAEA,mEACU,wBAEV,yBAEA,8GACA,YACA,cACA,eACA,CAAa,CAEb,CACA,mBHD4B,CGG5B,iBACA,KAEA,MAA8B,GAAoB,UAClD,IACA,WAFkD,QAElD,QAEA,MAA+B,GAAqB,WAKpD,eALoD,SAKpD,CACA,uBAGA,kCACA,2DACA,iDAOA,OH5B4B,EG4BgB,UAC5C,GADgC,CAEhC,MAAsB,GAAqB,KAC3C,iBAH4C,EAG5C,CACA,CAF2C,CAE1B,QACjB,CAAc,SACd,kCACA,CACA,CAAS,CHnCT,GACe,GAA4B,QAEhC,GAAqB,SGiChC,sBHpCoC,CGoCpC,EHnC2C,CGqC3C,GHnCgC,GGmChC,sBAEA,OADA,sCACA,mBACA,CACA,qBACA,sCACA,iCACA,gBAEA,MAA0B,GAAgB,WAC1C,MACA,IAF0C,EAE1C,0BAA4C,GAAc,uEAC1D,aACA,cACA,eACA,CAAa,EAEb,OAAe,GAAsB,OACrC,YADqC,MACrC,SACA,6BAEA,CACA,qBAIA,GADA,gIACA,iBAEA,IACA,qDACA,CAAc,SACd,wCAAwD,GAAc,2EACtE,OACA,CAAiB,uBACjB,aACA,cACA,eACA,CAAiB,EACjB,CAEA,CACA,CACA,cACA,8JACA,YACA,cACA,eACA,CAAK,CACL,CCpHW,eAEX,IADA,EACA,GACA,aACA,GACA,QAEA,WACA,SACA,CAAa,aAIb,CAAa,EACb,YAEA,EACA,QACA,CEMO,SACP,WACA,iBACA,uGACA,aACA,cACA,eACA,CAAa,EAEb,wCACA,gBACA,CACA,gBACA,iBACA,wGACA,aACA,cACA,eACA,CAAa,CAEb,mBACA,8CAEA,gBACA,CACA,cACA,4BACA,iBACA,gBACA,CACA,CCtDW,cACX,OACA,qDACA,sEACA,2EACA,CACA,CCJA,2CCiCO,yBACP,SACA,cAGA,YAzCA,KACA,OACA,UACA,CAGA,sBACA,mBACA,YAAuB,aAA8B,KACrD,6BACA,IAEA,2CACA,MAAqC,EAAY,EAAE,wBAAsC,SAEzF,UAEA,CACA,CACA,SACA,EAoBA,GAEA,KAAiB,EAA2B,EAAE,EAAI,EAClD,UAIA,QAL2C,KAK3C,MACA,SAAuB,EAA2B,EAAE,WAAa,EACjE,SADiD,CAGjD,OACA,OACA,uBA7BA,YACA,cACA,EAA0B,KAC1B,KACA,iBACA,qBACA,QAAiD,GAAgB,iCAIjE,QACA,EAkBA,EACA,CACA,CEnCO,iBAA8B,EACrC,SADgD,GAChD,GACA,sBACA,uBAEA,cACA,gCAAwC,EAAkB,CAC1D,eAD0D,KAC1D,CACS,uBACT,aACA,cACA,eACA,CAAS,CACT,CACA,cACA,gCAAwC,EAAkB,CAC1D,eAD0D,KAC1D,CACS,uBACT,aACA,cACA,eACA,CAAS,CACT,CACA,YACA,gCAAwC,EAAkB,CAC1D,eAD0D,KAC1D,CACS,uBACT,aACA,cACA,e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,aACA,MACA,MAEA,SACA,QACA,WACA,WAEA,IACA,CCnEA,oFAKA,uBAKA,SACA,iBACA,YAAoB,WAAoB,KACxC,QAEA,YAAoB,YAA6B,KACjD,0BAEA,YAAoB,YAAyB,KAC7C,yBAEA,SACA,CAAC,GAQM,eACP,SACA,IACA,IAWA,GAuFO,cACP,YAAoB,WAAgB,MACpC,sBACA,sBAIA,2BAEA,KADA,4BACA,SACA,IACA,EA1CO,cACP,iBACA,KAGA,YACA,YACA,YACA,MACA,CACA,aACA,aACA,eACA,YACA,MACA,CACA,eACA,aACA,gBACA,eACA,YACA,MACA,CACA,+CAAuD,eAAuB,EAC9E,EAmBA,IACA,CACA,EAtGA,EATA,IAGA,IAFA,SACA,KACA,OACA,gBACA,cACA,IACA,CACA,GAEA,IAGA,IAFA,QACA,IACA,OACA,gBACA,cACA,IACA,CAEA,iBACA,CAOO,eACP,SACA,MACA,+BACA,EACA,GACA,UACA,WACA,EACA,IACA,IACA,YAAoB,WAAgB,MAEpC,SADA,gBACA,CACA,QAIA,IAFA,SACA,KACA,MACA,CA0EO,gBACP,kBACA,iBACA,KAIA,YAAiC,IAAgB,KACjD,kBACA,YACA,KACA,CAEA,iBACA,sBAEA,iBACA,sBAEA,iBACA,qBAGA,qCAEA,aACA,MACA,gBACA,UACA,qCAEA,iCACA,aACA,eACA,cAEA,EACA,EA/GA,gBACA,UAGA,UAEA,cAGA,6CAA6D,QAAU,gBAAgB,EAAE,EAEzF,CACA,iBACA,eEpGA,iBAiSO,0BAAoC,qCAAyC,IACpF,uBACA,wBACA,cACA,uBACA,oBACA,EACA,gBAA2C,EAAM,UACjD,4BACA,YAA4C,GAAW,OAEvD,CAFuD,CAEvD,2BACA,0BAAkF,GAAW,OAC7F,CAD6F,CAC7F,KACA,iBACA,MAAsC,GAAiB,IAEvD,MAAuB,GAAY,CAFoB,CAEpB,GAKnC,IALmC,GACnC,cACA,gBACA,CAAS,EACT,aACA,CACA,CAAK,EACL,GACA,GAAW,EAAsB,CACjC,KACA,QACA,EACA,GACA,GAAW,EAAsB,CACjC,KACA,OAAgB,GAAsB,OAItC,YAJsC,EAItC,CACA,cACA,YACA,WACA,OACA,SACA,SACA,EAAS,KACT,aAA6B,UAAa,KAC1C,OACA,QACA,SACA,IACA,CACA,CEpVA,iECyCO,iBACP,SACA,0EACA,YACA,4DACA,8CAA2D,WAAc,IACzE,uEACA,kBAEA,QACA,CAoGO,cA2GP,cAoEA,mDE3TO,wBACP,oCACA,SACA,YACA,cACA,CACA,SACA,OACA,eACA,qBACA,qBAEA,CACA,CAWO,oBACP,eACA,8EACA,CACA,CAWO,oBACP,eACA,uEACA,CACA,CAWO,oBACP,eACA,4EACA,CACA,EAGA,YACA,YACA,gCACA,gCACA,wBACA,gCACA,gCACA,4BACA,4BACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,qBACA,CAAC,UAAwC,CCnFlC,UAwBP,uBAAuB,IAAY,wBAAwB,EAAc,KAAQ,EAAI,EACrF,GADyE,CACzE,OACA,eACA,cACA,WAAqB,CFlCd,GACP,EACA,MEgCiC,EFhCjC,QAEA,mBACA,EE6BiC,EACjC,CAYA,WACA,qCAA+C,EAAM,EAiIrD,cH/DO,QGgEP,OHhEO,EGgEiB,KHhEjB,EGgEiB,UHhEjB,EGgEiB,OHhEjB,EGgEiB,gBAA+D,MACvF,QACA,EACA,EACA,EACA,IACA,IAYA,EAZA,SAAwB,sCAAuD,EAC/E,KACA,QAAsB,GAAS,CAC/B,IACA,gBAGA,iBAAuC,SAAS,GAAG,EAAa,GAChE,eACA,gBACA,6CAKA,mEACA,OACA,6CACA,0BAGA,6CACA,KAEA,oBAEA,+BACA,KAEA,oDAGA,KAIA,qCACA,qBAYA,EARA,IACA,oBACA,6CACA,0BACA,oDAIA,EAHA,kBAOA,QACA,IACA,sBACA,8BAEA,GACA,WAGA,gBACA,+BAGA,YAGA,qCACA,iBAKA,oDAAyE,qBACzE,OACA,QACA,CAAiB,YACjB,UAA8B,GAAmB,EACjD,CAAiB,EACjB,iCACA,iBACA,UAA8B,GAAmB,GAEjD,SACA,IAHiD,EAGjD,IAA8B,GAAkB,GAIhD,YAJgD,CAIhD,kDACA,QAA6B,MAC7B,OACA,cAmBA,OAAyB,KAjBzB,uBACA,eAEA,gCACA,sBACA,eAEA,wBACA,EAEA,0BACA,mBAIA,eAEyB,sBACzB,CACA,SACA,OACA,UACA,QACA,sBAA+C,IAAkB,aAAqB,CAArB,EACjE,UACA,MAFyG,CAIzG,QACA,CAEA,GACA,gBAIA,GACA,sDAEA,CACA,CAAS,CH1MT,kCACA,cAAkC,IAAM,aAA+B,SAAY,MACnF,cAAiC,IAAM,cAAmC,SAAY,MACtF,kBAJA,EAI8B,kBAJJ,EAA1B,EAI8B,OAJJ,kCAA+D,MAAiB,EAI5E,UAC9B,8BACA,CAAG,CGsMH,CACA,CCvSA,2BAcA,eACA,iBACA,2BACA,uBACA,iBACA,iBAEA,SACA,OACA,eACA,qBACA,qBACA,eACA,eAEA,CACA,EAeA,iCAMA,aAIA,IACA,MACA,OACA,UACA,CAIA,eAEA,kFACA,eACA,EAAG,YACH,mGACA,EAAE,GACF,CAmCA,SAAS,GAAO,KAChB,IADgB,EAChB,eACA,iCACA,qCACA,4BACA,wDACG,mBACH,CACA,QACA,CACA,eACA,YAAiB,mBAAsB,KACvC,wCACA,KAAU,GAAO,mCAxBjB,oBANA,CAOA,IAPA,SAdA,KACA,gCACA,4BACA,eACA,6BACA,2BACA,gEACA,CACA,qCACA,EAYA,EAPA,UAOA,GANA,sBAMA,kCACA,QACA,cACA,gBACA,WACA,CAAE,QACF,EAkBA,SACA,CAAG,kGAAyG,GAAO,+BACnH,+DACA,CAAG,CACH,CACA,QACA,CAQA,iBACA,uBACA,wCACA,IAGA,sBACA,0CACA,GACA,CAAG,IACH,aACA,gBACA,GACA,CACA,sCACA,CAAE,CACF,CAqBA,2BACA,QACA,YAnBA,MA0CA,QApBA,EAFA,OAAmC,WACnC,qCAEA,IACA,aACA,gBACA,UACA,YACA,gBACI,CACJ,CAAI,SACJ,kFACA,uBADA,QAEA,QArJA,EAqJA,CACA,WACA,KACA,qBACA,QACA,CACA,OACA,CACA,GAzCA,EAyCA,SAzCA,EAyCA,SAzCA,EAyCA,MAxCA,IArHA,CAqHA,GACA,gBACA,gBACA,EAqCA,CAEA,uEACA,kDACA,gBACA,IACA,qBACA,QACA,CACA,QACA,CACA,CAIA,aAwBA,eACA,aACA,4BACA,qBACA,qBACA,eACA,oCACA,qBACA,iBACA,0DACA,qBACA,gDACA,sDACA,qDACA,uCACA,2BACA,gBACA,CAUA,eAEA,OADA,2BACA,KAoDA,aACA,iGAEA,OADA,yBACA,KAkBA,eAGA,OAFA,uCACA,sBACA,KAuBA,SAEA,OADA,oBACA,KAEA,UACA,WAIA,GAHA,WAAiC,EAAjC,UAAiC,oFACjC,iDACA,+FACA,uBACA,gCACA,sGAA4H,iBAC5H,uFAAiI,gBACjI,CACA,iBAcA,GAbA,UACA,SACA,0BACA,MACA,CAAI,EACJ,mCACA,gBACA,UACA,qEACA,gBACI,iBACJ,iCACA,KA4CA,OA1CA,4CACA,EAMA,QAQA,EAbA,SACA,KACA,KACA,yBACA,MAEA,8CACA,uCAEA,EADA,GAAsB,+CAAuK,UAAI,mBAA2E;AAC5Q;AAAA,aAAsC,0CAAoI,IAAI,EAAa,CADiF,CAE5Q,YAAwC,EAAU,IAClD;AAAA,EAAwF,QAAY,EACpG,EAAK,IAEL,wCAEA,iCAUA,MATA,+EACA,KACA,yDACA,0DAAgF,GAAW,wNACtF,2GACL,KACA,yDACA,oDAA0E,GAAW,qKAErF,CACA,WACA,OACA,WAAiB,+CAA0K,UAAI,mBAA2E,EAC1Q,UACA,OACA,MACA,CAAK,CACL,UACA,WACA,SACA,aACA,CACA,EAAG,EACH,WACA,CAIA,yBACA,IAOA,IAEA,EAgCA,EAxCA,WACA,OACA,OACA,WACA,eACA,SAEA,YARA,KAQA,QAEA,qBACA,UAAwB,0BAXxB,CAWwB,+BACxB,GAZA,KAY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,UACJ,OACA,WACA,eAlNA,KACA,IACA,oBACA,6CACA,YACA,eACA,wCACA,iCACA,2BACA,0BACA,CAAI,CACJ,CACA,CAAG,UACH,eACA,aACA,WACA,QACA,OACA,CAAE,CACF,EA+LA,gBACA,UACA,WACA,gBACA,wBAEA,CAsKA,UAAkB,OAAI,uBAAmC,EAAI,MAC7D,MACA,EAEA,EADA,aAAyB,SAAS,OAAO,EAAG,GAE5C,kEACA,8BACA,GACA,SACA,KACI,MACJ,iBACA,iFAAwH,EAAE,aAAiB,KAAO,EAAM,sBACxJ,0BACA,CAAI,IAEJ,SACA,KAEA,gCAGA,OAFA,4BAA4D,EAAM,mCAClE,2BAAiD,EAAM,GACvD,QACA,SACA,MACA,UACA,uBACA,OACA,mCACA,mCACA,iBACG,CACH,CACA,CCp6HO,UAIP,eACA,2BACA,MACA,iCACA,OAAqB,uCAErB,iBACA,wDACA,OAAqB,yCAErB,WAAgC,IAAN,GAAM,CAAmB,GAAM,QACzD,2BACA,OAAqB,yCAErB,mCACA,0BACA,8BACA,OACA,kBACA,gGACA,uHACA,EAEA,kDACA,gGACA,OACA,mBACA,0GACA,mGACA,EAGA,yBACA,MACA,iBACA,aAGA,OACA,mBACA,yDACA,+GACA,CAEA,CACA,OACA,mBACA,8DACA,oIACA,CACA,CAgBA,iCACA,+BACA,mBACA,uBAEA,6DAIA,OAHA,cACA;AAAA;AAAA,sBAAuD,cAAe,EAEtE,QACA,CAcA,8BACA,IACA,+BACA,wBAEA,SACA,QACA,CACA,CACA,CEzGO,IAEA,WAmBM,GAAc,CAC3B,gBACA,IAF2B,IAE3B,UACA,gBACA,kBACA,iBACA,EACO,IACP,kBACA,kBACA,gBACA,kBACA,kBACA,2BACA,EAIO,IACP,wBAEA,kBACA,eACA,CC7Ce,UACf,eACA,qBACA,uCACA,YAAuB,qCACvB,uBACA,qBACA,iCACA,4BACA,qCACA,CACA,mBACA,gCACA,kCACA,iCAIA,iBADA,+CAFA,yCAIA,CACA,kCACA,aACA,0DACA,uCAGA,oCAEA,CACA,kCACA,QACA,0EACA,8DACA,CACA,gCACA,QACA,0DAEA,MADA,cACA,iCACA,4DACA,CACA,gCAMA,sBACA,oBACA,iCACA,sCACA,4BAEA,2BACA,+CACA,GACA,2DAEA,gBACA,8BAA8C,UAAgB,yBAE9D,gBACA,0BAA0C,UAAY,yBAEtD,gBACA,4BAA4C,UAAc,yBAE1D,gBACA,gCAAgD,UAAkB,yBAElE,gBACA,+BAA+C,UAAiB,yBAEhE,2CACA,SACA,SACA,SACA,SACA,SACA,wCACA,kBACA,oBACA,IACA,6CACA,CAD+D,CAC/D,uBACA,yBACA,yBACA,yBACA,yBACA,kBACA,WACA,YACA,WACA,YACA,WACA,YACA,WACA,YACA,WACA,YACA,IA1DA,IA0DA,4CAGA,OAFA,2BACA,sCACA,SAEA,YACA,0BAEA,SADA,uBAGA,uBAEA,eADA,cAEA,mBAA8B,kCAAsC,CACpE,CACA,WAA0B,CAC1B,CACA,iBACA,sBACA,gBACA,kBACA,OACA,yBACA,uCAEA,CACA,4BACA,oBACA,gBACA,gBACA,gBACA,uBACA,2BACA,KACA,+BACA,KACA,+BACA,KACA,8BACA,mDACA,GACA,0BACA,QACA,SACA,EAKA,OAHA,KACA,uBAEA,CAAiB,oEACjB,CACA,kBACA,MACA,uGACA,CACA,kBACA,sBAGA,mEAFA,EAGA,CACA,EC3JA,YACA,oBACA,cACA,cACA,wBACA,kBACA,kBACA,cACA,cACA,wBACA,cACA,wBACA,cACA,gBACA,gBACA,oBACA,YACA,oBACA,cACA,cACA,wBACA,4BACA,kBACA,oBACA,uBACA,CAAC,UAAsC,EAahC,gBAAwD,IAC/D,MACA,wCACA,EAGA,8BACA,iBACA,GACK,EAAI,EALT,EAMA,EAeO,eACP,4BACA,wBACA,cACA,kBACA,QAEA,KACA,EAcO,WAEP,qBAEA,YADA,qBAIA,UACA,YACA,YACA,eACA,cACA,YACA,YACA,YACA,eACA,WACA,YACA,aACA,aACA,YACA,kBACA,YACA,gBACA,YACA,iBACA,iBACA,iBACA,aACA,eACA,YACA,YACA,mBACA,cACA,eACA,iBAEA,QADA,YAIA,CACA,EACA,MACA,EAEO,OACP,UACA,QACA,QACA,SACA,QACA,SACA,QACA,CACA,EACO,OACP,uBACA,oBACA,oBACA,QAEA,CACA,QACA,EACO,OACP,sBACA,IACA,oBACA,CACA,SAEA,CAEA,QACA,EAWO,WACP,sBACA,SAEA,iBACA,OAGA,KAAwB,IAFxB,MAEwB,EAAsB,IAAtB,EAAsB,CAE9C,IADA,EACA,eAEA,IACA,uBACA,CACA,SAEA,oBAEA,wBACA,CACA,QACA,EAQO,MACP,mBACA,mBAEA,EAEO,OACP,iBAaA,OAZA,6CACA,sBACA,mBACA,oCACA,yBACA,4BACA,CADuC,IACvC,6BACA,4BAGA,uCAEA,MACA,EClOA,UACA,qBAGA,EAGA,WACA,QACA,EAOA,0CACA,IAFA,qCAEA,eAKI,GAEJ,CAAI,iBAFa,CAEb,sBAEA,GAEJ,CACA,gBACA,EAJkB,MAIlB,UACA,gBACA,kBACA,iBACA,EAEI,GAEJ,CACA,kBACA,kBACA,gBACA,kBACA,iBACA,EAEI,GAEJ,CACA,cAHc,MAId,qBACA,EAEA,GAEA,CACA,UACA,EAEA,2BAGA,SAQA,qBACA,eACA,aACA,2BACA,QACA,EACA,uBACA,eACA,uBACA,iBACA,aACA,eACA,CAKA,UACA,eACA,aACA,WACA,CAIA,OACA,8BAGA,oBACA,aACA,0BACA,yBACA,iBACA,uBACA,aACA,+BACA,CAAK,EACL,CAMA,aAKA,OAJA,qBACA,8BAEA,2BAAyB,aAAkB,EAC3C,KAEA,QACA,sBACA,cACA,mBACA,uBACA,YACA,CACA,UACA,sBACA,oBACA,CAIA,cAAiB,2BAAwB,EACzC,+DACA,CAIA,iBACA,eAGA,+BACA,CACA,gBACA,gCACA,sBACA,CACA,eACA,mBACA,qBAEA,uCACA,oDACA,kCACA,sBACA,qBACA,oBACA,oBACA,CAAK,EACL,kCACA,yBAAgC,CAChC,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AEjE,+BACA,QACA,CAAK,IAOL,OANA,eACA,UAEA,iBACA,yBAEA,CACA,CAiBA,sBACA,yBACA,8BACA,WAAiB,GAAc,QAC/B,WAD+B,IAE/B,wDAAuE,WAAW,GAClF,aAAmB,GAAc,cACjC,EACA,GAFiC,GAEjC,QAAmC,GAAc,WAAkB,KAMnE,GANiD,IACjD,mDACA,SACA,gBACA,iBAAgC,EAEhC,CACA,CAUA,iBACA,QACA,CAQA,sBACA,QACA,CACA,yBACA,kBAGA,wBACA,sFAA6F,8BAAgC,EAC7H,IAIA,CACA,UACA,yBAKA,uBACA,mBAGA,uCACA,WAAiB,GAAc,QAC/B,WAD+B,EAC/B,WACA,CAOA,iBACA,8BACA,SACA,2FAEA,uEACA,YAAoB,WAA0B,IAE9C,CADA,IACA,+BAEA,CAIA,kBACA,oBAAyB,EAAI,CAC7B,CACA,WACA,oBAA0B,GAAc,OAExC,YAFwC,OAGxC,aAA0B,GAAc,QAExC,WAFwC,OAGxC,aAA0B,GAAc,OAExC,YAFwC,OAGxC,aAA0B,GAAc,QAExC,WAFwC,CAGxC,oBAA0B,GAAc,QAExC,EAGA,SALwC,OAMxC,uBACA,sBACA,4BACA,yCACA,CAAM,sBACN,4BACA,uCACA,CAAM,gCACN,uCAEA,+DAEA,CACA,mCACA,OACA,SACA,UACA,MACA,EACA,OAaA,OAZA,IACA,sBACA,4BACA,mBAEA,sFACA,yBACA,IAEA,UAEA,CAAK,EACL,CACA,CACA,qCAaA,OAZA,YACA,YACA,cACA,oCACA,QACA,EACA,GACA,gBAEA,kBACA,EACA,UACA,CACA,CACA,mCAGA,eAFA,eACA,YACA,mBACA,wBAaA,OAXA,yBACA,0BACA,+BAEA,EADA,+BAGA,EACA,GACA,gBAEA,UACA,CACA,CACA,oBACA,cACA,YAEA,IACA,oBACA,CAAM,MAEN,OADA,wDACA,IACA,CACA,CACA,sBACA,SACA,gBACA,8CACA,SAEA,WAAoC,EAAU,GAAG,EAAI,KACrD,MACA,oBACA,4BAEA,uDAEA,CACA,kBACA,CACA,yBACA,6BACA,SAEA,4BACA,SAAc,EAAI,EAAE,EAAO,EAAE,kBAAuB,EAEpD,EAYA,SACA,iBACA,sCACA,6CAEA,mBACA,gBACA,sBACA,kBACA,yBACA,uBACA,4BACA,oBACA,uBACA,EACA,wBACA,EACA,0BACA,EACA,wBACA,EACA,4CACA,gBAAsB,GAAa,WACnC,OADmC,IACnC,kBACA,CACA,qBACA,wFAA2G,GAAU,iBAAqB,GAAU,SACpJ,CACA,KAFoJ,QAEpJ,CACA,0CAAkD,iBAAmB,CACrE,CACA,qBACA,kBACA,gBAAsB,GAAa,WAEnC,OAFmC,IAEnC,CACA,wBACA,qCACA,CACA,WACA,yBAA+B,GAAa,wBAA6B,GAAa,WAEtF,OAFsF,IAGtF,GAAsB,0BACtB,iBACA,0CAEA,gDACA,MACA,WAAc,sBAA0B,EACxC,+BACA,kBACA,2CACA,MACA,CACA,YACA,EAAQ,IACR,IAEA,UACA,SACA,cACA,+BAA8C,OAAW,IACzD,CAAW,EACX,YACA,KACA,UACA,YACA,KACA,UACA,gBAA4B,GAAa,KACzC,aADyC,CACjB,EACxB,YACA,KACA,UACA,kBACA,gCACA,KACA,QACA,SACA,kBACA,qDACA,KACA,SACA,qCAAmD,EAAO,EAC1D,CACA,CAAK,CACL,CAIA,QACA,oBACA,IAtGA,IACA,SACA,oBACA,eACA,YAAkB,IAAS,IAC3B,6BAEA,eACA,EA8FA,IAEA,kBACA,0BACM,sBACN,0BAEA,sBACA,uCACA,kCACA,sBACA,CAAO,IAEP,CACA,iBACA,yBACA,QA3tBA,IA4tBA,eACA,kBAAwB,sCAAwC,8CAChE,kBAIQ,WACR,oBACQ,2BACR,iCACA,qBAEA,0BATA,yBACA,0BACA,oDASA,CAAK,CACL,CACA,aACA,uBACA,SAEA,iBAAsB,GAAa,OACnC,WADmC,EACnC,QAA+B,mCAA2C,OAAI,sBAAwB,CACtG,qBACA,qCACA,4BACA,+BACA,wCAEA,eAEA,CACA,gBAEA,IADA,EACA,OACA,oBACA,GACA,EACA,yDACA,oBACA,iBACA,IAEA,CAAK,EACL,gBACA,CACA,EAGA,WAMA,kBAAgC,EAChC,gBACA,CAAM,YADqC,WACrC,KADqD,eACrD,CACN,gCACA,qBACA,eACA,kBACA,aACA,kBACA,CAAO,CACP,mBACA,CAAO,CACP,kBACA,CACA,EACA,4BACA,WAAY,sBAA0B,YACtC,oCACA,yCACA,8BACA,uCACA,CAAO,EACP,qBACA,GACA,CAAK,EACL,2BACA,WAAY,sBAA0B,YACtC,0BACA,2BAEA,wCACA,IAEA,CAAK,CACL,CAIA,UACA,oBACA,CAIA,WACA,qBACA,CAIA,UACA,oBACA,CASA,QACA,2BACA,CACA,qBACA,0DACA,CAeA,0BACA,yCACA,yBACA,0BACA,sBAyBA,OAxBA,mBACA,MACA,QAEA,CAAK,EACL,mBACA,WACA,MACA,gCACA,4BACA,4CACA,2CACA,cACA,OACA,cAEA,aACA,mBACA,aAEA,EAAQ,IACR,MAEA,CAAK,EACL,iBAAkC,iBAAe,KACjD,CAeA,yBACA,yBACA,UAAU,YAAgB,cAiC1B,OAhCA,GACA,cACA,GAEA,GACA,cACA,GAEA,mBACA,WAEA,GADA,mBACA,GACA,mCACA,4CACA,wBACA,CACA,QACA,CAAK,EACL,mBACA,WACA,MACA,OAEA,+BACA,2BACA,wBAEA,SACA,oBACA,YAEK,EACL,CACA,CAUA,iBAMA,OALA,GACA,iBACA,QACA,GAEA,kBACA,OAEA,CAOA,gBACA,sDACA,CAOA,yBACA,mCACA,SAEA,0BAIA,OAHA,0CACA,UACK,EACL,CACA,CAMA,gBACA,oCACA,CACA,EAGA,IACA,gBACA,cACA,OAAW,2BAAiC,CAO5C,mBACA,oCACA,wBAGA,iBADA,8CAGA,CAAG,CAOH,YACA,+BACA,8BACM,EACN,6BACA,mBAAwB,kCAAsC,CAC9D,CACA,CAAG,CAEH,gBACA,aAAU,mCAAuC,EACjD,kBACA,cACA,cACA,cACA,cACA,8CACA,yCACA,2CACA,2CACA,2EACA,wCACA,oBACA,kBACA,IACA,gCACA,6BACA,6BACA,6BACA,6BACA,WACA,gBACA,WACA,gBACA,WACA,gBACA,WACA,gBACA,gDAGA,OAFA,WACA,sCACA,SACG,CACH,qBACA,SACA,iCAA2C,GAAM,6DAA6D,GAAM,OAEpH,CAAG,CAIH,gBACA,sBACA,gBACA,kBACA,UACA,qBACA,6BACA,uBACA,8BACA,2BACA,kCACA,CACA,CAAG,CAEH,kBACA,oBACA,gBACA,gBACA,wCACA,2BACA,KACA,+BACA,KACA,+BAGA,OAFA,KAEA,CAAa,4CADb,uBACa,CACb,CAAG,CAEH,mBACA,oBACA,gBACA,gBACA,gBACA,sCACA,2BACA,KACA,+BACA,KACA,+BACA,KACA,+BACA,KACA,8BAEA,OAAa,+BAAsC,GAAc,cADjE,CAAoB,IAC6C,GAD7C,aAC6C,CACjE,CAAG,CAEH,uBACA,oBACA,gBACA,uBACA,2BACA,KACA,+BAGA,OAFA,KAEA,CAAa,+CADb,uBACa,CACb,CACA,EAGA,SAWA,kBAAiC,EACjC,2BAAkC,sCAClC,iBACA,mBACA,WACA,sBACA,wBAxoCmB,EAwoCgB,EACnC,qBADkD,KAClD,mBACA,iBACA,iCACA,6CACA,wBACA,WACA,IACA,wBACM,MACN,CACA,sCACA,8BACA,uCACA,uCACA,sBACA,sBACA,4CACA,oBACA,mBACA,mBACA,mBACA,qBACA,0CACA,4CAEA,gCACA,iCAEA,WACA,0BACA,mCACA,YACA,kBACA,oBAEA,CAAO,EACP,mCACA,wBACA,OACA,eAEA,CAAO,EACP,4CACA,oCACA,oBAEA,mBACA,wCACA,kCAGA,CAAO,GAEP,oDACA,+CACA,kDACA,EAAK,CACL,sBACA,gBACA,mBAEA,wBAGA,yBACA,mBACA,sBAEA,8CAGA,2BACA,uBACA,uBACA,eAAuB,EAAK,IAAI,EAAI,IACpC,GAEA,gDACA,2BAA2C,EAC3C,iBAAuB,EAAS,GAAG,GAAU,UAAW,EACxD,GAD6C,CAC7C,YA1tCe,EA0tCY,MAC3B,aADsC,aACtC,MACA,yBACA,0BACA,8BACA,gCACA,oBACA,gDACA,gBACA,MACA,CACA,wBACA,6CACA,cACA,CAAO,CACP,CAAK,wBACL,2CACA,CAIA,uBACA,SACA,CAOA,oBACA,oBACA,sBACA,iCACA,4BACA,YACA,kBACA,gBAEA,gBACA,CAMA,WACA,mDACA,CAMA,cACA,sBACA,6CACA,CAAQ,qBAER,kBACA,EAEA,kBACA,GAAgB,gBAAgB,GAAG,EAAI,EAEvC,GAAc,gBAAgB,KAAK,cAAc,EAAE,EAAI,EAWvD,kBACA,oBACA,sBACA,sBACA,iCACA,4BACA,mBACA,sBACA,MACA,CAAK,KACL,CAOA,WACA,IACA,gHACA,mBAEA,mCAGA,6CACA,qDAEA,wBAEA,CAOA,WACA,+BACA,CAIA,YACA,0BASA,UACA,qBAEA,OADA,2CACA,CACA,CAMA,WACA,qBAEA,OADA,4CACA,CACA,CASA,WACA,qBAEA,OADA,4CACA,CACA,CAMA,aACA,qBAEA,OADA,8CACA,CACA,CAMA,eACA,wBACA,CAOA,QACA,uBACA,SAEA,qBACA,aACA,WAAgB,4CAAiD,OAAO,EACxE,yBACA,YACA,cACA,gBAEA,CAAK,EACL,QACA,CAMA,wBACA,IACA,GACA,WAEA,MAEA,CAIA,uBAGA,CAFA,qBACA,sBAEA,gBACA,iBAAiC,GAAkB,EAAE,wCAAyC,IAE9F,mDACA,qCACA,yCACA,uCACA,yCACA,6CACA,wCACA,CACA,cACA,sDACA,CACA,kBACA,iDACA,CACA,kCAIA,IAHA,iCACA,SACA,KAEA,wBACA,MACA,wCAA+C,EAAsB,QACrE,gBACA,KACA,yBACA,uBACA,EACA,mCAAwC,EAAsB,GAC9D,qBAEA,oCACA,mBACA,gCACA,QACA,iCACA,KAEA,CAAK,EACL,kBACA,6BAEA,kCAEA,GADA,KACA,IACA,4BAIA,OAHA,+BACA,kCAA4C,EAAuB,UAEnE,oCAAoD,GAAwB,UAC5E,CACA,iCACA,mCACA,cACA,qDACA,iCACA,gCACA,CAAO,CACP,CAAK,EACL,uBACA,CACA,kBACA,kCACA,wCACA,CACA,aACA,uDAAgE,mBAAmB,GACnF,sBACA,sBACA,8BACA,uBACA,4BACA,wBACA,sBAEA,kCACA,CAIA,mBACA,6BACA,8BACA,0BACA,kBACA,iFAEA,IACA,iCACA,CAAQ,SACR,iDACA,CACA,kDACA,sBACA,wDAhhDmB,CAghD8C,GAAe,qBAEhF,CACA,iBACA,qCAGA,8BACA,uBACA,kFACA,CACA,gBACA,cACA,cAEA,gBACA,8BACA,EACA,iBAEA,UAEA,gCACA,gBACA,4BACA,EACA,6BACA,EACA,+BACA,EACA,6BACA,EACA,gBAEA,MACA,CAAO,CACP,CAAK,CACL,CACA,2BACA,wCACA,IAGA,gBACA,+BACA,CAAK,OACL,CACA,6BACA,yBAA2C,GAAa,mBACxD,IAGA,gBACA,iCACA,CAAK,OACL,CAIA,eACA,mCACA,GACA,kDACA,yBACA,uBACA,oBACA,sCAEA,qCACA,CAKA,eACA,kDACA,qBACA,8BACA,0CACA,2BACA,wBAEA,CAKA,oBACA,0BACA,4CACA,UAAwB,GAAc,QAEtC,CAAK,CACL,CAIA,QAPsC,SAOtC,CACA,wCACA,KAAW,GAAa,WACxB,OADwB,WAExB,MAAW,GAAa,KACxB,YACA,CAFwB,KAEb,GAAa,QACxB,UADwB,KAExB,SACA,cACA,CACA,CAIA,cACA,qCACA,CAKA,UACA,4BACA,4CACA,CAOA,OACA,uCACA,wEACA,kBAGA,CAQA,cAAgC,EAChC,uBAEA,OADA,sBACA,CACA,CAIA,QACA,qBACA,IAAY,4CAAuC,EACnD,mBAA0B,GAAO,EAAE,GAAO,GAAG,EAAS,IAAI,EAAI,KAC9D,CACA,mBACA,oCAEA,6DAEA,CAKA,UACA,iBAMA,OALA,aACA,WAEA,WAEA,mBACA,CACA,gBACA,wBACA,IACA,sCACA,CAAQ,SACR,iDACA,CACA,MACA,CACA,wCACA,uBAGA,yCACA,gCACA,WAAgB,4CAAiD,8BAAiC,EAClG,IACA,8BACA,CAAM,SACN,iDACA,CACA,2FACA,CACA,kBACA,+CACA,gCACA,mBAEA,CAIA,iBACA,uBACA,UAAY,sCAAuC,EACnD,oCACA,kEACA,uBACA,IACA,sDACA,CAAU,SACV,iDACA,CACA,8BACA,0BACA,wBACA,mFAEA,CACA,wCAAmD,cAAsB,EAAE,GAAO,EAAE,GAAO,EAAE,iBAA6B,YAC1H,YAAsB,uBAA0B,KAChD,uBACA,qBAGA,kBACA,CACA,uCACA,CAAK,CACL,CAQA,8BACA,IACA,+CACA,IACA,OACA,CAAU,SACV,6BAAwC,GAAO,YAC/C,CACA,CAAO,CACP,CAAM,SACN,qCAA4C,GAAO,aACnD,CACA,CACA,kBACA,wEACA,IACA,mEAA8E,EAAM,IACpF,UAEA,CACA,CC1yDe,UACf,iBACA,eAmFA,GACA,kCAA0E,gBAC1E,EArFA,EACA,mBAA4B,GAAQ,kBACpC,+BACA,8BACA,oCACA,CAAS,EACT,gCACA,+BACA,oCACA,CAAS,EACT,0BACA,mCAAuD,aAAe,CACtE,CAAS,CACT,CACA,YACA,6CACA,CAwBA,yBAEA,kCADA,EAwCA,0BAxCA,KACA,eACA,WAEA,OADA,WACA,CACA,CAAS,GAAI,CACb,CACA,4BAGA,OACA,aACA,MACA,iBALA,MAMA,aALA,KAMA,CACA,CACA,6BAGA,OACA,cACA,MACA,iBALA,MAMA,cALA,KAMA,CACA,CACA,CACA,eACA,uBAGA,gCAA8D,CAD9D,qCAKA,OAHA,yBACA,iBACA,sBACA,CACA,CAAK,CACL,CAOA,eACA,yCCpFA,YACA,cACA,cACA,eACA,CAAC,UAA0E,CAC5D,UACf,YACA,kCAmBA,iBACA,eACA,yBAAmC,GAAe,8BAClD,CACA,CEnCe,SACf,mBACA,MAwFA,CACA,sBACA,WAAyB,eAAyB,CAClD,UAAwB,kBAAyB,CACjD,UACA,CAAS,CA7FT,EA6FS,OACT,CA7FA,yCACA,aACA,CACA,YACA,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c,EACzJ,CAAa,EACb,uBACA,uBACA,CAAa,CACb,CACA,YAEA,6BACA,MACA,qCACA,wCACA,KACA,YAAwB,IAAiB,KACzC,WACA,CAAoB,cAAU,4BAA8B,EAAI,EAChE,UACA,MACA,aACA,mCACA,kCACA,kCACA,qCAAuE,KAA4B,QAA6B,OAEhI,CACA,mBACA,WAA6B,GAAc,QAC3C,aAD2C,aAC3C,4EACA,MACA,CACA,CACA,iCACA,YAA0B,GAAc,YACxC,SADwC,KACxC,CAEA,CASA,gBACA,2BAaA,kBAAkC,EAClC,wBACA,gBACA,cACA,SACA,CAAS,GACT,CAMA,kBAA2B,EAC3B,wBACA,gBACA,eACA,CAAS,GACT,CAoKA,UACA,sEACA,yCACA,QAEA,MADA,0CAAuD,EAAK,mBAAmB,YAAY,yBAC3F,sBAA4C,EAAK,mBAAmB,YAAY,yBAEhF,sBACA,CAiBA,uBAA4C,EAC5C,MACA,WACA,mEAEA,sDACA,GACA,gDACA,8DACA,CACA,+BACA,2BAAiD,8BAA6B,EAE9E,wCACA,iBAA4B,kCAAkC,UAAU,sBAA0B,EAClG,cACA,qCAEA,OACA,cACA,UACA,0BACA,EACA,kFACA,kBACA,OAAqB,YAErB,kBACA,mFAAmG,8PAInG,mBACA,IACA,qBACA,uBACA,CACA,UACA,+BACA,CAiDA,iBAA8B,EAC9B,QACA,uDA+CA,uBACA,UACA,gEACA,oHACA,QAEA,4BACA,kCACA,uCACA,CAAa,CAxDb,EACA,uKAGA,wBACA,6BAGA,gBAEA,UAAoB,aAAmC,EACvD,GACA,gDACA,iCACA,CACA,+BACA,2BAAqD,8BAA6B,EAElF,OACA,cACA,UACA,qBACA,UACA,CACA,oBACA,QACA,UACA,qBACyB,CACzB,CACiB,CACjB,EACA,IACA,mGAEA,OADA,2CACA,iBACA,CACA,SACA,6CACA,kBAGA,aAEA,CACA,CAaA,CAOA,qBACA,wCACA,CAYA,kCACA,uBACA,oBACA,eACA,0BACA,sCACA,+BACA,CAAS,CACT,CAMA,WACA,8BACA,CAEA,+BACA,0BACA,8BACA,0DAAoF,KAAc,gBAA2B,GAE7H,OADA,gBACA,CACA,CAEA,WACA,MACA,4BAKA,0BASA,GARA,cAAmC,IACnC,oBACA,KAFgE,EAEhE,GACA,6BACA,iCAAmD,KAAa,kBAA6B,EAI7F,wBACA,mFAGA,OADA,sEAAuF,YAAY,YACnG,KAGA,kCACA,GACA,OACA,SACA,WACA,KACA,EAQA,OAPA,iBACA,yBAGA,qBAEA,4BACA,KAOA,YACA,8BACA,CAMA,YACA,8BACA,CAEA,uBACA,mDACA,kBACA,kCACA,kCACA,SAEA,iEACA,MACA,SAEA,4DAeA,sCAdA,aACA,WACA,oCACA,UACA,wCACA,UACA,8FACA,CACA,CACA,8FACA,kFACA,CAKA,CAAS,CACT,CAEA,0BACA,UAAgB,0BAA4B,GAE5C,UADA,CAD4D,EAC5D,OACA,mCAGA,yBACA,qDACA,kCACA,aACA,QAAwB,8CAAgD,EAUxE,qCAAqD,CATrD,CACA,SACA,QACA,mBACA,YACA,MAA2B,CAC3B,MAA2B,CAC3B,QACA,GACqD,2BACrD,CACA,QACA,CAAS,CACT,CACA,gBACA,mBACA,wDAEA,wBACA,2BACA,oCAGA,CAMA,+BAGA,MAFA,qBACA,kBAEA,CAMA,iCACA,YACA,2EACA,uEACA,2DACA,wEACA,sEACA,wEACA,KACA,CAEA,sBACA,OACA,MAAmB,CACnB,MAAmB,EAQnB,MANA,wCACA,OAA0B,GAA8B,qBAExD,wCACA,OAA0B,GAA8B,yBAExD,CACA,CACA,CCpxBe,SACf,iBACA,gBAA0B,GAAM,IAChC,CACA,cACA,2BAEA,eACA,4BAEA,gBACA,6BAEA,0BACA,uCAEA,wBACA,qCAEA,yBACA,+BACA,CACA,qBACA,kCAEA,0BACA,uCAEA,qBACA,kCAEA,UACA,uBAEA,aACA,0BAEA,aACA,0BAEA,uBACA,oCAEA,iBACA,8BAEA,2BACA,wCAEA,UACA,qBACA,CACA,wBACA,uBACA,+BACA,4BACA,IACA,OACA,CAAa,KACb,CAAS,CACT,CACA,QACA,mBACA,CACA,WACA,sBACA,CACA,YACA,8BACA,CACA,UACA,4BACA,CACA,UACA,qBACA,CACA,WACA,sBACA,CACA,WACA,sBACA,CACA,aACA,wBACA,CACA,cACA,gCACA,CACA,eACA,sCAAgD,GAAgB,WAEhE,EAFgE,eAEhE,CACA,sCAAgD,GAAgB,QAEhE,KAFgE,YAEhE,CAEA,oCACA,CACA,cACA,gCACA,CACA,gBACA,2BACA,CAIA,YACA,kBACA,CACA,CCzGA,QACA,uBAGA,EACA,qBAqCA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA,GAAG,EAAE,QACU,GACf,eACA,mCAEA,cACA,kCAEA,gBACA,oCAEA,wBACA,4CAEA,0BACA,8CAEA,4BACA,YACA,2BAEA,kCAEA,iCACA,YACA,gCAEA,sCACA,CACA,qBACA,yCAEA,UACA,6BACA,CACA,aACA,iCAEA,aACA,iCAEA,uBACA,2CAEA,iBACA,qCAEA,2BACA,+CA4CA,iBACA,MA8BA,GA7BA,iBACA,2BACA,sBACA,iBACA,qBAEA,gBACA,eACA,WACA,oBAA8B,GAC9B,OADwC,eACxC,IACA,uBACA,uBACA,kCACA,qCACA,kCACA,yCAMA,sBACA,EACA,gBAEA,oBAGA,qDACA,yDAEA,6BACA,gCACA,wBAAiC,GAAa,KAC9C,KAD8C,YAC9C,CAA4B,GAAe,GAC3C,SAD2C,CAC3C,2CACA,CAMA,UAEA,uEAMA,sCACA,+BAEA,gCACA,IACA,4BACA,CACA,SACA,sBACA,kCAAwD,EAAa,EACrE,CACA,kCACA,CAOA,cACA,uCACA,CASA,4BAEA,CADA,gCACA,wBACA,KAEA,yCACA,0CACA,uBACA,CAAS,KACT,CAMA,cACA,oBACA,CAOA,uBACA,4BAIA,MAHA,UACA,aAEA,CACA,CAMA,0BACA,kCACA,4BAEA,OADA,aACA,CACA,CAAS,EACT,uBAEA,OADA,wBACA,CACA,CAQA,WACA,6BACA,CAMA,YACA,qCACA,CAMA,kBACA,6CAAuD,GAAgB,OAOvE,MAPuE,OAOvE,CACA,uCACA,CAMA,eACA,wCACA,CAMA,kBACA,2CACA,CAUA,aAA8B,UAAY,EAC1C,kBAA0C,EAAM,EAChD,0CACA,KAOA,QAPA,EACA,UAA6B,GAAe,cAAmB,UAG/D,OAFA,gCACA,sBACA,CACA,CAIA,CAQA,QACA,0BACA,CA+BA,sBACA,6BACA,wBACA,2BACA,sBAEA,IACA,OACA,QACA,CACA,uBACA,wBAEA,CACA,CAMA,iBACA,6BACA,CAMA,sBACA,kCACA,CAOA,eACA,mEACA,CAMA,WACA,mCACA,CAQA,WACA,yDACA,2BACA,qEACA,kCAEA,CAEA,6BAEA,GADA,gCACA,4CACA,gEACA,kBACA,MACA,CACA,6CACA,kCACA,2BACA,+EACA,kBAEA,CAAS,yCACT,yDAAkE,uCAAuC,IACzG,CAEA,2BACA,sCACA,iFACA,2CACA,kCAEA,CAKA,wBAEA,IADA,EACA,KACA,KACA,IAEA,UAEA,oBAEA,IACA,0BACA,CACA,SACA,gEAEA,uBACA,MAGA,wBAEA,2BAKA,iBACA,0BAEA,GACA,4BAEA,2BACA,wBACA,0BACA,OACA,eACA,QXngBO,CWmgBsB,cXngBiB,CWmgBF,KAC5C,EACA,OXrgBqD,CAAC,WWqgBtD,IACA,2CACA,sBAAgD,GAAc,cAC9D,cACA,CAAqB,CAErB,CAAa,GAEb,CAKA,6BACA,mBACA,wBAOA,4BAEA,uBACA,yBACA,0CAA2D,EAAQ,IACnE,CAAa,CAEb,CAEA,2BACA,+BAGA,CAFA,mBACA,6EACA,UACA,uDACA,CAAa,EACb,8BACA,4BAEA,CAAS,EACT,gCACA,6BACA,uBAEA,CAAS,EACT,iCACA,gDACA,sCAEA,CAAS,CACT,CAEA,6BACA,kCAEA,2CAEA,CAEA,0BACA,cACA,qBAEA,WACA,sBACA,GACA,OACA,CACA,CAEA,wBACA,eACA,8CAA2D,eAAe,GAG1E,6CAEA,2CACA,8BACA,2BACA,4CACA,wBACA,iBACA,EACA,6BACA,4BACA,oBAEA,EACA,4BACA,cACA,kCACS,CACT,CAKA,mBACA,iBACA,wCACA,2BACA,sBAEA,CAEA,oBACA,MACA,KACA,QAEA,CACA,qBAAqD,8BAAgC,EACrF,wBACA,CACA,QACA,CAKA,0BACA,4BAmBA,EACA,CAnBA,kDACA,+DACA,QACA,gDXhoBO,GWgoB4H,CACnI,cADkJ,OAClJ,CACA,uEACA,uCACA,yIAEA,mDAAuI,GAAgB,abjiBxH,CaiiBwH,CbjiBvH,QaiiBuH,GACvJ,iCACA,iCACA,oFACA,wEAzmBA,IACA,6DACA,gCAEA,CACA,SAEA,CA/BA,cACA,OACA,aACA,cACS,CACT,QACA,SACA,CAAS,CACT,WACA,uBAEA,OACA,MACA,+CACA,CAAS,CACT,cACA,WACA,CAAS,CACT,aACA,kBACA,CAAS,CAaT,IAimBA,mBACA,iDACA,SAtoBA,IA0oBA,uCXnpBO,GWmpBmH,OAC1H,GACA,CAFqI,GXrpB9H,CWupBU,OACjB,EAD0B,CAC1B,MACA,qBAEA,SACA,iBAEA,KACA,MAAiB,GACjB,+CACA,+CACA,KACA,SACA,+CAAmE,MAAW,EAC9E,CAUA,GATA,QACA,+CACA,+CACA,iDACA,8DACA,sCACA,uCAA0D,YAAoB,wBAA0B,GAGxG,aACA,8CACA,0CAEA,2CACA,iCAEA,QACA,CAEA,uBACA,kCACA,oBACA,cAEA,CACA,CEhsBA,2BACA,iBACA,SACA,yBACA,qBACA,+BACA,+BACA,uBACA,sJACA,CAIA,aACA,yBAKA,aACA,yBAKA,0BACA,yBAEA,EAgBA,4BACA,mBAGA,kBACA,CAAa,wBAAyB,QAAW,GAEjD,kBACA,CAAa,kBAEb,kBACA,qBAEA,GAXA,EAYA,CA4CA,eACA,qBACA,CACA,aACA,oBACA,cACA,aACA,CACA,wBACA,SAA6B,wBAA4C,OAMzE,OALA,2BACA,aACA,QAAe,YAAY,aAC3B,OACA,EAAK,EACL,yBAAmD,aAAe,CAClE,CACA,2BACA,OACA,sBACA,wBACA,EAMA,OALA,2BACA,cACA,QAAe,YAAY,aAC3B,MACA,EAAK,EACL,KAEA,uBACA,2BACA,gBACA,QAAe,YAAY,cAAc,gBAA8B,EAClE,CACL,CACA,+BAKA,OACA,WALA,4BACA,aACA,QAAe,YAAY,cAAc,gBAA8B,GAClE,EAEL,gBAEA,CACA,yBACA,IAKA,OAJA,2BACA,cACA,QAAiB,YAAY,cAAc,gBAA8B,EAClE,EACP,EACA,CAAM,SACN,mCACA,QAEA,QACA,CACA,CACA,sCACA,IACA,sCACA,CAAM,SACN,mCACA,MAEA,QACA,CACA,CACA,EAGA,eACA,qBACA,CACA,aACA,sBACA,cACA,cACA,uBACA,CACA,oBAKA,MAJA,4BACA,aACA,QAAe,YAAY,cAAc,gBAAsC,UAC1E,EACL,iBAEA,uBACA,SAUA,OATA,uBACA,yDAQA,CANA,2BACA,cACA,QAAe,YAAY,cAAc,gBAAsC,SAC/E,OACA,SACA,EAAK,EACL,cAEA,uBACA,iCACA,cACA,QAAe,YAAY,cAAc,gBAA+B,UAAU,OAAQ,EAC1F,MACA,CAAK,EACL,OACA,gDACA,yBAEA,CACA,qBACA,2BACA,gBACA,QAAe,YAAY,cAAc,gBAA+B,UAAU,OAAQ,EAC1F,OAAe,oCACf,CAAK,CACL,CACA,mBACA,SASA,OARA,uBACA,yDAOA,CALA,2BACA,aACA,QAAe,YAAY,cAAc,gBAA+B,UAAU,OAAQ,EAC1F,SACA,EAAK,EACL,cAEA,qBACA,QACA,wBACA,yDAEA,IAMA,OALA,2BACA,cACA,QAAiB,YAAY,cAAc,gBAA+B,UAAU,OAAQ,EAC5F,SACA,CAAO,EACP,EACA,CAAM,SACN,mCACA,QAEA,QACA,CACA,CACA,kCACA,IACA,kCACA,CAAM,SACN,mCACA,6BAAsC,kCAAoD,CAE1F,QACA,CACA,CACA,EAGA,SAMA,eACA,UACA,gBACA,QAAoB,eAAoB,EAExC,2CAAyE,UAAgB,GACzF,YAzNA,YACA,oCACA,OACA,eACA,SACA,OACA,QACA,OACA,UACK,EACL,eAtCA,OACA,mBACA,KACA,iCACA,YACA,wBAIA,mBACA,EA4BA,eACA,mBACA,aACA,SACA,SACA,MAAsB,mCAAqC,EAAI,CAC/D,KACA,KACS,CACT,+BACA,CAAO,EACP,iBACA,mEACA,uBACA,UACA,iBACA,UACA,cACA,0CAAgE,SAAW,EAC3E,CACA,gBACA,oBACA,oBACA,SACA,EAEA,CACA,OAAe,yCACf,CACA,CACA,EAiLA,CACA,UACA,YACA,kBACK,EACL,oDACA,wCACA,yDACA,CAgBA,wBACA,0CACA,CAkBA,2BACA,6CACA,CAaA,uBACA,wCACA,CAaA,+BACA,iDACA,CAaA,oBACA,kCACA,CAgCA,uBACA,qCACA,CAsBA,uBACA,qCACA,CAWA,qBACA,kCACA,CAcA,mBACA,iCACA,CAaA,yBACA,2CACA,CAaA,qBACA,mCACA,CAuBA,sCACA,wDACA,CA4BA,kCACA,gDACA,CACA,mBC1hBA,SAAS,GAAO,GAEhB,KAFgB,EAER,GAAO,wEACf,eACA,EAAG,YACH,mGACA,EAAE,CAAS,CAAP,CACJ,CAmCA,SAAS,GAAO,KAChB,eADgB,EAChB,IACA,iCACA,qCACA,4BACA,wDACG,mBACH,CACA,QACA,CACA,SAAS,GAAc,GACvB,YADuB,EACN,iBAAsB,KACvC,wCACA,KAAU,GAAO,mCACd,SAzBM,CAAe,SAyBN,CA/BlB,CAOA,EAPA,EAdA,GAoBwB,MApBJ,KACpB,EAaoB,CAbpB,QADoB,EACH,GAAO,gBACxB,4BACA,eACA,6BACA,aAAkB,GAAO,WACzB,gEACA,CACA,qCACA,EAY0B,EAPN,UAOpB,GANA,EAMa,QANO,GAAO,OAMD,CANC,CAMD,kCAC1B,QACA,cACA,gBACA,WACA,CAAE,QACF,EAkBkB,SAClB,CAAG,kGAAyG,GAAO,+BACnH,+DACA,CAAG,CACH,CACA,QACA,CAQA,2BACA,+BACA,SACA,yBACA,iBACA,6DACA,cACA,iBACA,CACA,SACA,OACA,eACA,qBACA,mBACA,2BAEA,CACA,EAMA,eACA,0DACA,CAKA,wBACA,iCACA,eACA,mEACA,cACA,kBACA,WACA,CACA,SACA,OAAS,GAAe,GAAc,EAAG,UAAlB,GAAe,IAAG,EAAqB,EAAI,eAAiB,CACnF,CACA,EAKA,oBACA,6BACA,WACA,2EACA,oBACA,CACA,EAoEA,mBACA,MAAgB,GAAc,EAAG,IACjC,SAD8B,MAC9B,GACA,6DAEA,OADA,OACA,CACA,CAgDA,WACA,2CACA,gDACA,SAKA,OAJA,oCAEA,EADA,kEACA,MACA,CAAE,EACF,CACA,EAiCA,qDASA,OACA,iCAEA,iCADA,EACA,IACA,oBAFA,EAEA,yBACA,mEACA,2CACA,oCALA,EAKA,OACA,cACA,+CAEA,CACA,wBACA,EAQA,oBACA,wEAEA,mCACA,6BACA,kBACA,mEACA,4CACA,CAAG,aACH,WACA,SARA,EAQA,oBAAkE,GAAQ,cAC1E,CAAG,CACH,EAAG,wBACH,EAqCA,iCACA,2BACA,KA9BA,YACA,OACA,SACA,sCACA,EACA,oCAA4D,GAAe,GAAc,EAAG,OAC5F,IAhHA,EA+GyF,EA9GzF,yCACA,+BACA,6HACA,EA4GA,QACA,MAEA,EADA,iCAEA,wEACA,iEACA,wBACA,EAAG,aAEH,MADA,+CACQ,GAAe,GAAc,EAAG,OACxC,EAcA,CAfsB,CAetB,EAfqC,EAerC,aACA,iBACA,2CACA,kBACA,oCACA,0DACA,oCADA,QAEA,CACA,eACA,CAAG,qCACH,CAAE,CACF,CAMA,yBACA,OACA,oBACA,2BAEA,uBACA,uBAEA,sBACA,sBAEA,qBACA,cAA+C,GAAe,GAAc,EAAG,MAAc,EAAI,EAApC,GAAe,SAAqB,GAAqB,cAEtH,yBACA,wBAEA,CACA,CAEA,QAAQ,qCADR,cAEA,iBAWA,aAQA,kBAA8B,gBAC9B,2BACA,WACA,aA/NA,YACA,SACA,sDACA,QACA,EA2NA,GACA,WAAe,CAjNG,GAClB,aAgN2B,EAhN3B,GACA,mBACA,EA8M2B,GAC3B,gBACA,CAOA,eAEA,OADA,2BACA,KAUA,eAEA,OADA,kCACA,KA2BA,yBAEA,IACA,OACA,eACA,UACA,CACA,CAAI,SACJ,OAPA,CAOA,2BACA,gBACA,UACA,OACA,CACA,QACA,CACA,CACA,EAKA,qBACA,aACA,iBACA,kBACA,0BACA,gCACA,iBACA,CACA,UACA,kCACA,CACA,SACA,iCACA,CACA,WACA,mCACA,CACA,aAEA,OADA,4CACA,YACA,CACA,gBAEA,IACA,OACA,YAHA,KAGA,mBACA,UACA,CACA,CAAI,SACJ,OAPA,CAOA,2BACA,gBACA,UACA,OACA,CACA,QACA,CACA,CACA,EAKA,qBACA,aACA,iBACA,kBACA,0BACA,8BACA,iBACA,CACA,WACA,sDACA,CACA,UACA,kCACA,CACA,SACA,iCACA,CACA,WACA,mCACA,CACA,aAEA,OADA,4CACA,aAEA,gBAEA,IACA,OACA,kBAHA,KAGA,qBACA,UACA,CACA,CAAI,SACJ,OAPA,CAOA,2BACA,gBACA,UACA,OACA,CACA,QACA,CACA,CACA,EAIA,QACA,UACA,SACA,QACA,cACA,WACA,CACA,EACA,IACA,oBACA,wBAA0B,eAC1B,SACA,EACA,wBACA,kBAA8B,MAC9B,uBACA,eACA,CAQA,8BACA,WACA,mCAEA,IADA,EACA,EAAmB,GAAe,GAAc,EAAG,QACnD,EAAiB,GAD+B,GACF,EAAG,aAAH,QAAG,IAAyC,4BAAoC,EAC9H,aAiBA,GAhBA,6CAEA,CADA,gBACA,sCACA,4CACA,gBACK,qDACL,MACA,6DACA,kEAEA,IACA,8BAA0C,eAAqB,EAC/D,gCACA,qDACA,+JAEA,8EACA,+BACA,qBACA,oCAAqE,MAAU,UAAU,EAAM,IAAS,GAAc,SAAG,EAAS,IAAZ,IAAY,oBAAyE,iBAAyB,EAAI,GACxO,OACA,OACA,QACA,eAEA,CAAG,CACH,CAoEA,oBACA,wCACA,CAuCA,iCACA,WACA,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MAQzE,eC/BA,wBACP,mBACA,SACA,sBACA,sBACA,cACA,WACA,CACA,SACA,OACA,eACA,qBACA,mBACA,cACA,CACA,CACA,CACO,eACP,uDACA,CAWO,oBACP,mBACA,aACA,yBACA,cACA,WACA,CACA,CACO,eACP,sCAgBO,oBACP,iBACA,SACA,6BACA,oBACA,CACA,CAWO,oBACP,qBACA,aACA,YACA,aACA,CACA,CAWO,oBACP,cACA,mEACA,CACA,CACO,eACP,iDAYO,oBACP,cACA,gFACA,CACA,CAWO,oBACP,eACA,iDACA,CACA,CAcO,oBACP,sBACA,qDACA,kBACA,cACA,CACA,SACA,qCAA6C,kBAAqB,qBAAuB,CACzF,CACA,CAcO,oBACP,sBACA,qDACA,kBACA,cACA,CACA,SACA,qCAA6C,kBAAqB,qBAAuB,CACzF,CACA,CAaO,oBACP,cACA,uSAGA,sEACA,CACA,CAcO,oBACP,iBACA,2CACA,CACA,CACO,eACP,gDACA,CAqBO,oBACP,uGACA,+CACA,CACA,CACO,eACP,mDAiBO,oBACP,mBACA,mDACA,cACA,CACA,SACA,qCAA6C,kBAAqB,qBAAuB,CACzF,CACA,CAcO,oBACP,eACA,gDACA,CACA,CC5RA,IAAM,GAAY,6EAKZ,GAAgB,oBAKhB,GALgB,CAKF,KACpB,eADoB,EAEpB,YAAoB,WAAoB,KACxC,QAEA,YAAoB,EAAI,GAAgB,OAAS,KACjD,EAAgB,EAAgB,OADQ,OACR,QAEhC,YAAoB,EAAI,GAAY,OAAS,KAC7C,EAAgB,EAAY,GADQ,CACR,iBAE5B,SACA,CAAC,GAQM,mBACP,YAGA,IAFA,qBACA,gBACA,iBAEA,EAAiB,EAAY,CAD7B,2BAC6B,EAC7B,qBAGA,kBAGA,IAFA,gCACA,eACA,iBAEA,EAAiB,EAAY,CAD7B,2BAC6B,EAC7B,eAGA,CAQO,mBACP,MAAiB,EAAc,IAC/B,QAIA,IAFA,qBACA,gBACA,iBACA,+BACA,qBAGA,UAEA,YAGA,6CAAyD,uBAA8B,GAEvF,CA0BO,SAAS,GAAmB,GACnC,SACA,MACA,QAHmC,MAGnC,iBACA,EACA,GACA,UACA,WACA,EACA,GAAuB,sBACvB,OACQ,SAmEQ,CAAc,MAC9B,QApEsB,CAoEtB,SACA,iBACA,KAIA,YAAiC,IAAgB,KACjD,kBACA,YACA,KACA,CAEA,iBACA,sBAEA,iBACA,sBAEA,iBACA,qBAGA,qCAEA,aACA,MACA,gBACA,UACA,qCAEA,iCACA,aACA,eACA,cAEA,CACA,EAxGsB,MACtB,EACA,YAAoB,WAAgB,KACpC,wBAEA,iBACA,CAsGO,eACP,SACA,GAAoB,sBACpB,MACA,SACA,EACA,YAAoB,WAAgB,KACpC,wBAEA,wBACA,CAMO,eACP,SACA,GAAoB,sBACpB,MACA,SACA,EAIA,OAHA,wBAEA,aACA,UACA,CC5PO,eAEP,OADA,2BACA,CACA,CAiBO,IAAM,GAAS,6DACtB,IACA,UACA,WACA,EAIO,QACP,IAAS,KACT,SAEA,IACA,4CACA,QAEA,CACA,SAEA,QACA,CACA,aACA,mBAEA,cAA8B,cAAc,EAAE,cAAc,EAC5D,IACA,qCACA,sCACA,aACA,cACA,CACA,SAGA,aACA,cACA,CACA,oBAKO,eACP,SACA,aACA,2BACA,IACA,yCACA,gBACA,MACA,CAAa,CACb,CACA,SAEA,CAMA,OAHA,+BACA,MACA,CAAK,EACL,CACA,CACO,IAAM,GAAY,GACzB,EACA,YAFyB,CAEzB,GAEA,oBAWO,kBACP,oCACA,EACO,gBACP,yBACA,MACA,YAEA,IACA,oBACA,CACA,SAMA,WACA,CACA,EACO,gBACP,qBACA,CAMO,UACP,cAGA,+CAGA,eACA,aACA,CAAS,CACT,CACA,CAEO,eACP,mBACA,gBACA,UAAkB,GAAmB,yBAGrC,YAAoB,WAAkB,IACtC,IAAa,GAAe,WAC5B,CAD4B,KAC5B,IAAsB,GAAmB,+BAazC,MAVA,CAEA,kBAA2B,GAAmB,OAC9C,mBAA4B,GAAmB,OAC/C,UAAmB,GAAqB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BACA,qDAEA,oEACA,CACA,CAUO,eACP,MAEA,6CAEA,kBAMA,oCACA,aACA,OACA,QACA,WACA,UACA,kBAA+B,GAAgB,qCAC/C,eAA4B,GAAgB,kCAC5C,UAAuB,GAAgB,6BACvC,wBACkB,GAAgB,8BAClC,MACA,CAAS,CACT,kBACA,yBAEA,oEACA,CACA,CAcO,eACP,MAEA,oDAAmE,GAAG,WACtE,CAQO,cACP,QACA,SAAc,MACd,eADuB,SACvB,QACA,4BACA,2BACA,4FACA,wFACA,CAUO,qBACP,IACA,yCAEA,GACA,MACA,OACA,UACA,UAA2B,GAAoB,8BAC/C,EAEA,uCACA,OACA,UACA,UAA2B,GAAoB,gDAC/C,EAEA,OAAiB,kBACjB,CACA,SACA,OACA,UACA,MDjNO,gBAAqC,SCiNA,CDjNA,EAAiB,EAC7D,UACA,cAAY,GAAY,EACxB,MACA,+DAEA,yBACA,oCAEA,eACA,yDACA,8BACA,OACA,CAAa,CACb,MAEA,8BACA,0EAEA,eACA,6FACA,mEACA,OACA,CAAa,OAEb,GAEA,6BACA,4EAEA,eACA,qGACA,qDACA,OACA,CAAa,OAEb,+EAEA,eACA,qFACA,6DACA,OACA,CAAa,CACb,MAEA,gCAGA,eACA,sDACA,iDACA,OACA,CAAS,OAET,8BAKA,eACA,kBACA,4CACA,OACA,CAAS,OAET,2CAIA,GAFA,IADA,oDACA,OAEA,CACA,gEACA,wCACA,OACA,CAAa,CAGb,CACA,gGACA,6DACA,OACA,CAAS,OAET,6BACA,+BACA,IAAa,GAAa,GAE1B,OAF0B,IAE1B,IACA,WAA4B,0BAA0B,sBACtD,4BACA,OACA,CAAa,EAEb,eAEA,eACA,sBAAuC,QAAgB,8BACvD,2BACA,OACA,CAAa,CAEb,MACA,wBACA,oDAEA,eACA,sDACA,oCACA,OACA,CAAa,CACb,MAEA,2BAGA,eACA,8GACA,yCACA,OACA,CAAS,EAET,eACA,oDACA,4CACA,OACA,CAAK,CACL,ECoF4C,CAC5C,QACA,SACA,CAAa,CACb,CACA,CACA,CAUO,qBACP,IACA,sCAEA,GACA,MACA,OACA,UACA,UAA2B,GAAoB,8BAC/C,EAEA,uCACA,OACA,UACA,UAA2B,GAAoB,gDAC/C,EAEA,OAAiB,kBACjB,CACA,SACA,OACA,UACA,MDhHO,gBAAuC,WCgHA,CDhHiB,EAC/D,cAAY,GAAY,EACxB,MACA,+DAEA,yBACA,oCAEA,eACA,2DACA,8BACA,OACA,CAAa,CACb,MAEA,8BAKA,eACA,kBACA,4CACA,OACA,CAAS,OAET,6BACA,+BACA,IAAa,GAAa,GAE1B,eACA,WAA4B,0BAA0B,sBACtD,4BACA,OACA,CAAa,EAEb,cAEA,eACA,sBAAuC,OAAe,8BACtD,2BACA,OACA,CAAa,CAEb,MACA,2BAGA,eACA,uHACA,yCACA,OACA,CAAS,EAET,eACA,oDACA,4CACA,OACA,CAAK,CACL,ECqD8C,CAC9C,QACA,SACA,CAAa,CACb,CACA,CACA,CACO,QACP,uBACA,wBACA,yCACA,sBAEA,6BACA,yBACA,CAAK,CACL,oBACA,EACO,IAEP,6BACA,uBACA,oBACA,EACA,kBACA,yDACA,qDACA,KACA,eACA,KAEA,gBACA,WACA,cAEA,oBAEA,YAEA,QACA,YAEA,SACA,WACA,KACA,aAGA,UAEA,MAEA,MAEA,CAEA,QACA,CAkCO,SACP,eACA,cAEA,oCACA,0CACA,oCACA,gDACA,uCACA,CAUA,iBACA,4DAAoE,KAAa,sBAAwB,EACzG,CAeA,2BAAuB,qCAA2C,QAClE,EA5DO,IAYA,IAiDP,IAEA,IAAoB,gBAAiD,iCACrE,WACA,UACA,CAAa,EACb,MACA,OAAyB,mBAEzB,0CAEA,+BACA,SAAwB,GAAO,wCAC/B,WAIA,GADA,EASA,UAAuC,KAAQ,GAT/C,EAS4D,MAR5D,CAGA,MADA,8BACA,UACA,mHACA,WAAuC,KAAQ,GAAG,EAAa,EAM/D,eACA,sBAEA,CACA,wBACA,cACA,OA/FO,EA+FP,wCA/FO,EA+FP,wBA9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iD,uBACrE,cACA,6BACA,eAA4B,cAAiB,CAC7C,QACA,CAAa,EACb,QACA,CAAa,EACb,MACA,OAAyB,mBAEzB,qBACA,cACA,0BACA,UACA,OACA,YACA,qBACA,mDACiB,CACJ,CACb,CACA,SACA,GAAgB,GAAW,GAC3B,KAD2B,CAC3B,CAAyB,mBAEzB,OACA,UACA,UAA2B,GAAgB,iCAC3C,CACA,CACA,CACA,CH/qBA,+BAEA,IACA,oDACA,eACA,WACA,CAAa,CACb,eACA,CAAS,EAET,+BAEA,kCAEA,SACA,0BAEA,sBAEA,CIVA,QACA,IbIO,CaJE,UAAU,aACnB,WbIO,CaJS,WAAW,UAC3B,oBACA,kBACA,sBACA,QAAa,GACb,oBACA,EAF4B,IAE5B,GACA,gCACA,gBACA,uBACA,sBACA,eAAoB,EAmBpB,MAGA,KACA,UAIA,WACA,QACA,gEAA0I,QAC1I,CACA,YACA,kDAAqE,uBAAmC,OAAa,CACrH,CACA,qBACA,QACA,2FAEA,sBACA,kDAAqE,uBAAmC,WAAiB,CACzH,CAuBA,eACA,SAIA,uBACA,wBACA,iCACA,4BACA,iCACA,oCACA,6BAeA,6BAQA,4BAOA,4BAaA,oCACA,2BACA,qCACA,kCAOA,eACA,qBACA,sBAIA,2BACA,wBACA,oCAAuD,QAQvD,GAPA,6BACA,iEACA,qDACA,gCACA,4BACA,sBAEA,mBAAmC,KAAS,CAC5C,SAA+B,MADa,SACb,IAAmB,8MAClD,gBACA,uBACA,gBAEA,CA2FA,GA1FA,qCACA,yCACA,gDACA,eAAyB,GAAc,CACvC,UACA,eAFuC,EAEvC,CACA,cACA,+BACS,EACT,eACA,uBACA,WAAqB,GAAY,SACjC,QADiC,eACjC,sBACA,yBACA,iEACA,iCAIA,6CAMA,eACA,iBACA,KACA,MACA,gBAAgC,mBAAmB,gRAGnD,YACA,WAA0B,SAC1B,6CAEA,UACA,+BACA,+BACA,mCACA,qCACA,yCACA,uDACA,+EACA,aAA0B,GAAW,MACrC,EADqC,YACrC,CACA,kDACA,gDACA,2CACA,oDACA,+CACA,CAAa,EAEb,YACA,iEACA,2DACA,qDACA,4CACA,6CACA,EACA,cACA,4DACA,8DACA,gEACA,kEACA,mCACA,sCACA,qCACA,EACA,qBACA,UACA,uBAGoB,KACpB,eADwC,SACxC,cAGA,sBACA,aAAmC,GAAyB,qBAG5D,CAH4D,CAG5D,aACA,mCAIA,sBACA,aAA2B,GAAyB,qBAExC,CAFwC,KAE/B,mEACrB,IACA,sEACA,CACA,SACA,yGACA,CACA,wEACA,0EAIA,gEACA,+BAEA,IACA,gEACA,CACA,KAFmG,CAEnG,GACA,0CACA,CACA,CAAa,CACb,CAIA,sBACA,4BACA,sCACA,CAAa,CAEb,CAIA,wBACA,yBAOA,iBACA,iCACA,cAEA,QACA,CACA,aACA,MACA,gBAAe,gBAAgB,GAAG,iBAAiB,GAAG,GAAQ,IAAI,YAAL,UAAK,GAAyB,EAE3F,aAIA,OAHA,uBACA,oCAEA,KAoBA,mBACA,MACA,0BACA,oCAUA,kCACA,iCACA,gBAEA,yDACA,0BAGA,wBACA,CAAS,GACT,mCAGA,gDAEA,aADA,oCACA,GACA,gEAEA,QACA,CAOA,wBACA,EACA,IACA,SACA,SAgBA,GAfgB,OAChB,EAAyB,GAAsB,SADtB,MACsB,OAC/C,iCACA,aAEA,+BACA,YASgB,MAAS,qCACzB,SAAwB,WAAc,mCACtC,OACA,mEZpPA,GYqPwD,IZrPxD,mCYqPwD,EZrPxD,OYsPA,8BASA,aAA6B,EAC7B,CACA,YAAwB,kBAAwB,EAWhD,OAVA,4EACA,2BACA,qBACA,eACA,wDAGA,+CAEA,CAAiB,IACjB,CAAyB,WACzB,CAGA,OADA,gCACA,CAAqB,WACrB,CACA,SACA,GAAgB,GAAW,GAC3B,KAD2B,EAC3B,0BAA4C,EAAO,EAEnD,2BACA,UAA2B,GAAgB,2CAC3C,CAAa,CACb,QACA,CACA,qCACA,mCACA,CACA,CA0EA,2BACA,UACA,IASA,SAAoB,WARpB,MAA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ACvD,qBADuD,6BACvD,GAGA,kCAGA,OAEA,WACA,sCAEA,IACA,SAA4B,WAAyB,mCACrD,8BACA,cACA,2BACA,iDAGA,yEAEA,CACA,SACA,4CACA,2EACA,MAMA,+CAEA,CACA,SACA,yBACgB,GAAyB,GAKzC,gBAGA,GARyC,KAQzC,SAEA,MACA,QACA,CACA,oBACA,CACA,CACA,2BACA,QACA,MACA,UAAsB,GAGtB,oBAH6C,MAG7C,CACA,uCAaA,4BACA,0CACA,6CAEA,OADA,iFACA,+BAKA,6BACA,uBACA,IACA,4BAA0C,GAO1C,kDAAqE,EAWrE,YAAyC,GAAY,8BACrD,MAAoB,WAAc,kCAClC,KACA,QACA,cACA,UAA0B,GAC1B,YAAuC,GAAY,8BAGnD,GAFA,UACA,8CACA,CACA,gGAGA,sBACA,+BACA,CAAiB,EACjB,OACA,UACA,UAA+B,EAC/B,EAEA,OADA,cAFwD,SAExD,YACA,CACA,CASA,gCAEA,GADA,mCACA,+BACA,iGACA,MAAsB,GAAe,8BACrC,kBACA,MAA0B,GAAe,0CAEzC,OACA,UACA,UAA+B,EAC/B,EAEA,OADA,cAFwD,SAExD,YACA,CACA,CACA,8DACA,OAA6B,2BAK7B,OAFA,6BACA,mCACA,CACA,CACA,SAEA,GADA,yBACgB,GAAW,IAC3B,IAD2B,EAC3B,CAAiC,mBACjC,IAAqB,GAAyB,IAW9C,YAA6C,GAAY,GAXX,CAWW,yBACzD,4DAEA,yFAGA,2BAEA,CAYA,OANA,yBACA,eACA,SACA,qBbltIO,EaktIqC,CAC5C,EACA,wBAFuE,QAEvE,gBACA,CACA,CAEA,MADA,+CACA,CACA,QACA,CACA,6BACA,oBACA,CACA,CACA,sCACA,wDAUA,qCAAkD,8BAA2B,EAG7E,gCAAoD,EAAM,GAC1D,uCAAgE,EAAU,GAC1E,IACA,0BACA,mCAAoD,kBAAgB,EAEpE,SACA,8DACA,IACA,qBACA,CACA,SACA,SACA,CACA,CAAa,EAEb,GADA,qBACA,YACA,YAAg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vB,YAAiB,YADM,MACN,CAAsB,KACvC,wCACA,KAAU,GAAO,mCAxBjB,SAAS,CAAe,UANxB,CAOA,EAPA,EAAS,MA+BS,GA7CT,CAAW,IACpB,CAmBwB,EAnBxB,UAAiB,CAaG,EAbI,OADJ,OACI,EACxB,IADwB,EACxB,sBACA,eACA,6BACA,aAAkB,GAAO,WACzB,SADyB,QACzB,+CACA,CACA,qCACA,EAY0B,EAPN,UAOpB,GANA,EAMa,QANO,GAAO,SAMD,WANC,GAMD,oBAC1B,QACA,cACA,gBACA,WACA,CAAE,QACF,EAkBkB,SAClB,CAAG,kGAAyG,GAAO,+BACnH,+DACA,CAAG,CACH,CACA,QACA,CAiBA,sEAEA,WAcA,mBACA,MAAiB,CA9BC,GAClB,kBACA,OA4B6B,CA5B7B,WACA,EA2B6B,GAC7B,EA1BA,QA2BA,kCACA,kDACA,IAjHA,YACA,SACA,IACA,iBACA,kBACA,CAAG,UAGH,OAFA,wCACA,wCACA,CACA,EAwGA,QACA,kDACA,oBACA,gBACA,kCAEA,GADA,mCACA,yBACA,wBACA,oCAAsD,EAAO,EAC7D,CACA,MACA,eAYA,OACA,MzChTA,eyCiTA,KAD6B,CAM7B,OAJA,KACA,MACA,KAJqD,GAIrD,uUAEA,KAEA,aAxMA,SAEA,EADA,iCAEA,6BACA,IACA,YACA,CAAG,SACH,QACA,CACA,mBACA,sBACA,aAkBA,KACA,kBACA,uBACA,iBACA,kBACA,mCAEA,CACA,QACA,EA3BA,4BACI,uBACJ,qCACI,yBACJ,aAEA,CAAG,SACH,QACA,CACA,QACA,EAmLA,4DACA,UACA,uBACA,MACA,4DACA,MACA,6MACA,0HAA6H,yBAAoC,2EACjK,CACA,WACA,CACA,MACA,MArQA,YACA,sCACA,mBACA,4BACA,eACA,wEACA,4BACA,4CACA,+DACA,CACA,UACA,UACA,WACA,aACA,+BACA,EARA,IASA,EAqPA,eACA,0BAA4C,0BAC5C,CACA,QACA,EArCA,OACA,IACA,yEACA,qEACA,yDAEA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F,CACF,GAEA,OADA,MAAMsF,EAASO,IAAI,CAACC,OAAO,GACpBf,CACT,CNkBO,0BACA,0BACA,0BACA,0BACA,0BACA,0BACA,0BACA,0BACA,0BCrDG,GAAM,EAAD,CAAK,MACT,GAAG,GAAK,MACT,GAAO,GAAD,CAAK,KAEX,GAAM,EAAD,CAAK,MACT,GAAM,EAAD,CAAK,MACV,GAAQ,GAAI,CAAL,QAqDlB,IAA0B,GAAQ,iBCpCb,IAAI/F,QIMlB,IAAM+G,GAAS,CACpBC,QAAS,CAAC,gDAAgD,EC3B9BC,IAAJC,GAAWC,MAAM,CAACC,CAL1CC,UAAW,IACXC,UAAW,IACXC,aAAc,GAChB,EAAC,CIED,QACA,GAAO,CAAI,EAEX,6BACA,qBACA,yBACA,qDAA6D,GAAK,gFAClE,aACA,cACA,eACA,CAAK,EAkCU,eACf,OAAW,GAAO,CAClB,GADkB,CAClB,CACA,QACA,QAjCA,cACA,IACA,qBACA,CAAU,SASV,WACA,iBACA,qBAWA,OAVA,MAAkB,EAAiC,GACnD,OACA,gBACA,KAHmD,GAGnD,uCACA,CAAa,EACb,0BACA,wBACA,uBACA,uBACA,CAAa,EACb,CACA,CACA,CAOA,CAAK,CACL,kDCvDA,qCAA6C,CAC7C,QACA,CAAC,EAAC,CAMF,cACA,0CACA,cACA,QACA,CAAK,CACL,EACA,GACA,uBACA,QACA,CAAK,CACL,0BACA,QACA,CAAK,CACL,kBACA,QACA,CACA,CAAC,EACD,MAAiB,EAAQ,GAAW,EACpC,GACA,OACA,EAHwB,GAGxB,CAEA,cACA,gBAEA,EAkBA,sBACA,QAAY,6GAAsG,EAClH,OACA,WACA,YACA,SACA,MACA,SACA,YACA,cACA,CACA,kBA5BA,WACA,sCAEA,YAAmB,WAAkB,IACrC,kBACA,aACA,KACA,CAQA,MADA,GAFA,GAFA,4CAEA,YAEA,2DACA,YACA,IAcA,CACA,CACA,OAAyB,EAAM,oDAC/B,QACA,cACA,YACA,OACA,WACA,WACA,gBACA,CACA,CACA,CAQA,sBACA,gCACA,MAEA,YAEA,aAAY,eAAsB,EAClC,eACA,8BAAyD,EAAU,GACnE,cACA,uBACA,MAEA,WACA,CACA,CAAK,EACL,SACA,2DAAuE,SAAY,wBACnF,aACA,cACA,eACA,CAAS,EAET,qBACA,KAAY,GAAM,EAClB,UACA,eACA,WACA,aACA,gBACA,4DAA4E,UAAgB,EAAE,MAAY,yBAC1G,aACA,cACA,eACA,CAAa,CACb,aAzCA,WAAY,oBA0CZ,EA1CoC,SACpC,sBAA+B,EAAM,uBACrC,SACA,sBACA,CAAK,CAuCL,SACA,QACA,CACA,CACA,cAUA,OATI,GAAM,qBACV,YAGA,8CACA,OAEA,qBACA,EACA,KACQ,GAAM,QACd,CACA,4BC9GA,yCACA,2BACA,6BACA,gCACA,6BACA,gCACA,6BACA,yBACA,yBACA,gBAQA,gCACA,mCC/CA,wDCCA,4BACA,kCACA,6BACA,kCAgBA,KAWA,cACA,MACA,OACA,4BAAqC,OAAO,EAC5C,sDAAmE,yEAAgF,EACnJ,oDAAgE,SAAS,EACzE,kCAA2C,SAAS,EACpD,iCACA,uCACA,wCAAiD,WAAW,EAC5D,gDACA,wCAAiD,WAAW,EAC5D,iBACA,KAAyB,OAAO,GAAG,2CAAqD,EACxF,yBAA+C,IAAc,EAAE,UAAc,GAAG,EAEhF,cACA,cACA,wBAAqC,KACrC,MACA,SACA,qBACA,WACA,gBACA,QACA,CACA,qCACA,IACA,6CACA,CAAM,MACN,CACA,CACA,QACA,CACA,cACA,MACA,OAEA,qBACA,CACA,SACA,UACA,WACA,SACA,OACA,WACA,SACA,cACA,WACA,CAAI,mBACJ,gBACA,iCACA,EACA,EAeA,MAYA,EAKA,EAfA,EAfA,CACA,OACA,4BACA,SACA,OAAoB,oBAA4B,CAChD,OAAqB,YAAgB,CACrC,wBAAuC,iBAAwB,CAC/D,OACA,OAAqB,SAmBrB,WADA,GADA,EAjBqB,GAkBrB,eACA,QAnBqB,CAAmC,CACxD,OAAmB,UAAc,CACjC,OAAqB,SAsBrB,WADA,GADA,EApBqB,GAqBrB,eACA,QAtBqB,CAAmC,CACxD,OAAwB,iBAKxB,SACA,eACA,MACA,YAGA,QATA,CACA,CA/EA,CAhBA,QACA,eACA,OAA8B,uBAAkC,EAChE,EAaA,GACA,qBACA,sBACA,kBACA,qBACA,qBACA,CAAC,EACD,UAnBA,aACA,+CACA,kBACA,oBACA,OAA6B,kDAA4F,EAEzH,QACA,GACA,IAAoD,eAAkB,SAAa,EAWnF,GAkFA,8BAKA,0BA0DA,QACA,eAEA,qBACA,gBACA,sBACA,KAEA,eADA,KAEA,yBAAiC,UAAa,CAG9C,CACA,oBACA,sCACA,CAIA,WACA,yBAEA,UACA,2CACA,0BACA,CACA,aACA,MACA,+BACA,aACA,yBAEA,8DACA,6CACA,CACA,OACA,0BACA,CACA,UACA,+CACA,eAMA,OALA,cAAoB,UAAa,EACjC,kBACA,SACA,yCAA4E,IAE5E,KAKA,UACA,mBACA,qDAKA,OAJA,kBACA,SACA,yCAA0E,IAE1E,CACA,CAIA,QAEA,OADA,6CACA,KAKA,8CACA,wBAA6B,iDAAiD,EAE9E,WACA,2CAAoD,OAAO,GAAG,4BAA4B,WAAW,EACrG,CACA,EAGA,QACA,mBAGA,KADA,sBAEA,gBACA,+FAEA,aADA,mBA3IA,YACA,MACA,SACA,IAEA,EACA,EACA,EACA,EACA,EANA,KACA,IAMA,aACA,yCACA,KAEA,kBAMA,kBAGA,IAFA,IACA,KACA,KAEA,SADA,gBACA,CAKA,IAJA,IACA,KACA,IACA,IACA,YAZA,MADA,iBACA,EAAkC,IAAlC,GAAkC,SAalC,IAEA,gCACA,KACA,IACA,yBACA,KAEA,KAEA,EAAQ,IACR,IAGA,oBACA,+BAEA,CACA,QACA,EAyFA,GACA,CACA,UACA,IACA,0BACA,CACA,CAIA,UACA,2CACA,0BACA,CAIA,aACA,MACA,wCACA,aACA,SAEA,8DACA,8BACA,CACA,OACA,0BACA,CAIA,UACA,sDACA,eAGA,OA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AEA,WAcA,GAZA,sBACA,UAGA,+BAGA,kBADA,gBAGA,gBAGA,qBACA,yBAEA,CACA,EAEA,OAEA,CACA,CC3DO,QACP,eAIA,iBACA,QACA,CAIA,qBACA,QACA,CAIA,mBACA,QACA,CAIA,yBACA,QACA,CAIA,2BACA,QACA,CAIA,6BACA,QACA,CAIA,mCACA,QACA,CAIA,iCAIA,kCACA,CACO,QACP,CACO,kBACP,UACA,CACO,kBACP,UACA,CACO,kBACP,aACA,CACO,kBACP,aACA,CACO,QACP,gBACA,mBACA,CACO,kBACP,CACO,kBACP,CACO,kBACP,CACO,YAEA,QACA,QACA,QACA,QAEA,QACA,QACA,QAMA,aACP,QACA,EC5FA,YACA,iBACA,sBACA,CAAC,UAA8B,ECNxB,OACP,SACA,WAGA,YACK,CACL,QACA,QACA,GAEA,cAEA,EAIO,GACP,WACA,SAGA,QACA,CAAK,CCzBE,SACP,SACA,OAAe,CACf,CACA,UAF2B,CAE3B,MACA,qBACA,CACA,UACA,QACA,CACA,SACA,WACA,CACA,UACA,YAEA,CCdA,IAAM,GAAQ,UACd,OAAiC,CAM1B,UAEP,OARmD,MAQnD,EAEA,qBAIA,OAHA,gBACA,wBAEA,eAOA,2BACA,OAAe,EAAe,GAAQ,EAAkB,EAAO,SAAzB,EACtC,CAIA,SACA,yCACA,CASA,iBACA,iDACA,CAOA,UACA,0CACA,CACA,qBACA,OAAe,EAAU,KAAQ,EACjC,CAEA,QAHiC,CAGjC,CACA,oCACQ,EAAiB,GAAU,EAAO,SAAlB,EACxB,CACA,EC1DA,YAEA,mBAEA,wBACA,CAAC,UAAgC,ECL1B,0BAIA,sCAIA,IACP,WACA,UACA,WAAgB,EAAU,IAC1B,CCVO,GDSmB,ICTnB,GACP,cAA8B,EAAoB,EAClD,mBACA,CAEA,cACA,yBAGA,kBACA,WACA,CAEA,iBACA,YAGA,cACA,YAEA,WACA,YAEA,YACA,WACA,CAEA,aACA,YAGA,cACA,YAGA,QAEA,cACA,QACA,CAEA,sB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AAe,IACf,KAAS,GACT,CAAC,EAAC","sources":["webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/compiled/react/react.react-server.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/compiled/ua-parser-js/ua-parser.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/experimental/testmode/context.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/experimental/testmode/server-edge.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/compiled/p-queue/index.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/globals.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/error.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/lib/constants.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/utils.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/fetch-event.js","webpack://_N_E/../../../../src/shared/lib/i18n/detect-domain-locale.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/remove-trailing-slash.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/parse-path.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-path-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-path-suffix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/path-has-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/add-locale.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/format-next-pathname-info.ts","webpack://_N_E/../../../src/shared/lib/get-hostname.ts","webpack://_N_E/../../../../src/shared/lib/i18n/normalize-locale-path.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/remove-path-prefix.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/get-next-pathname-info.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/next-url.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/cookies.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/request.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/adapters/reflect.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/response.js","webpack://_N_E/../../../../../src/shared/lib/router/utils/relativize-url.ts","webpack://_N_E/../../../src/client/components/app-router-headers.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/internal-utils.js","webpack://_N_E/../../../../src/shared/lib/page-path/ensure-leading-slash.ts","webpack://_N_E/../../../src/shared/lib/segment.ts","webpack://_N_E/../../../../../src/shared/lib/router/utils/app-paths.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/adapters/headers.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/async-local-storage.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/work-async-storage-instance.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/work-async-storage.external.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/adapters/request-cookies.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/lib/trace/constants.js","webpack://_N_E/../../../src/shared/lib/is-thenable.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/lib/trace/tracer.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/api-utils/index.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/async-storage/draft-mode-provider.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/async-storage/request-store.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/work-unit-async-storage-instance.js","webpack://_N_E/../../../src/shared/lib/invariant-error.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/work-unit-async-storage.external.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/lib/lru-cache.js","webpack://_N_E/../../../../src/server/lib/incremental-cache/tags-manifest.external.ts","webpack://_N_E/../../../../src/server/lib/cache-handlers/default.external.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/use-cache/handlers.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/revalidation-utils.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/async-local-storage.js?f17b","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/after-task-async-storage-instance.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/after-task-async-storage.external.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/after/after-context.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/lib/lazy-result.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/async-storage/work-store.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/web-on-close.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/get-edge-preview-props.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/after/builtin-request-context.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/lib/implicit-tags.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/lib/is-rsc-request.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/adapter.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/utils/helpers.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/utils/constants.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/utils/chunker.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/utils/base64url.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/utils/index.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/cookies.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/createBrowserClient.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1/node_modules/@supabase/supabase-js/dist/tracingRegistry.mjs","webpack://_N_E/../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","webpack://_N_E/../../node_modules/.pnpm/@supabase+functions-js@2.117.2/node_modules/@supabase/functions-js/dist/module/helper.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+functions-js@2.117.2/node_modules/@supabase/functions-js/dist/module/types.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+functions-js@2.117.2/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+postgrest-js@2.117.2/node_modules/@supabase/postgrest-js/dist/index.mjs","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/lib/version.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/lib/constants.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/phoenix.mjs","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/RealtimePostgresFilterBuilder.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+realtime-js@2.117.2/node_modules/@supabase/realtime-js/dist/module/index.js","webpack://_N_E/../../node_modules/.pnpm/iceberg-js@0.8.1/node_modules/iceberg-js/dist/index.mjs","webpack://_N_E/../../node_modules/.pnpm/@supabase+storage-js@2.117.2/node_modules/@supabase/storage-js/dist/index.mjs","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/version.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/constants.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/errors.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/base64url.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/helpers.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/fetch.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/types.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/locks.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/AuthClient.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+auth-js@2.117.2/node_modules/@supabase/auth-js/dist/module/index.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1/node_modules/@supabase/supabase-js/dist/index.mjs","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/version.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/createServerClient.js","webpack://_N_E/../../node_modules/.pnpm/@supabase+ssr@0.7.0_@supabase+supabase-js@2.117.2_@opentelemetry+api@1.9.1_/node_modules/@supabase/ssr/dist/module/index.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/user-agent.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/spec-extension/url-pattern.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/after/after.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/after/index.js","webpack://_N_E/../../../src/client/components/hooks-server-context.ts","webpack://_N_E/../../../src/client/components/static-generation-bailout.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/dynamic-rendering-utils.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/lib/framework/boundary-constants.js","webpack://_N_E/../../../../src/shared/lib/lazy-dynamic/bailout-to-csr.ts","webpack://_N_E/../../../src/server/app-render/dynamic-rendering.ts","webpack://_N_E/../../../src/server/request/utils.ts","webpack://_N_E/../../../src/server/request/connection.ts","webpack://_N_E/../../../../src/shared/lib/utils/reflect-utils.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/action-async-storage-instance.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/app-render/action-async-storage.external.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/lib/picocolors.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/build/output/log.js","webpack://_N_E/../../../src/server/request/root-params.ts","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/server/web/exports/index.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/esm/api/server.js","webpack://_N_E/./src/lib/supabase-env.ts","webpack://_N_E/./src/middleware.ts","webpack://_N_E/../../../../src/client/components/http-access-fallback/http-access-fallback.ts","webpack://_N_E/../../../src/client/components/redirect-status-code.ts","webpack://_N_E/../../../src/client/components/redirect-error.ts","webpack://_N_E/../../../src/client/components/is-next-router-error.ts","webpack://_N_E/","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/experimental/testmode/fetch.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/compiled/react/cjs/react.react-server.production.js","webpack://_N_E/external commonjs \"node:buffer\"","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js","webpack://_N_E/external commonjs \"node:async_hooks\"","webpack://_N_E/../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js","webpack://_N_E/../../node_modules/.pnpm/next@15.5.27_@babel+core@7.29.7_@opentelemetry+api@1.9.1_@types+node@22.20.5_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/next/dist/compiled/cookie/index.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag-api.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/metrics.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics-api.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation-api.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js","webpack://_N_E/../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/index.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.react-server.production.js');\n} else {\n module.exports = require('./cjs/react.react-server.development.js');\n}\n","(()=>{var i={226:function(i,e){(function(o,a){\"use strict\";var r=\"1.0.35\",t=\"\",n=\"?\",s=\"function\",b=\"undefined\",w=\"object\",l=\"string\",d=\"major\",c=\"model\",u=\"name\",p=\"type\",m=\"vendor\",f=\"version\",h=\"architecture\",v=\"console\",g=\"mobile\",k=\"tablet\",x=\"smarttv\",_=\"wearable\",y=\"embedded\",q=350;var T=\"Amazon\",S=\"Apple\",z=\"ASUS\",N=\"BlackBerry\",A=\"Browser\",C=\"Chrome\",E=\"Edge\",O=\"Firefox\",U=\"Google\",j=\"Huawei\",P=\"LG\",R=\"Microsoft\",M=\"Motorola\",B=\"Opera\",V=\"Samsung\",D=\"Sharp\",I=\"Sony\",W=\"Viera\",F=\"Xiaomi\",G=\"Zebra\",H=\"Facebook\",L=\"Chromium OS\",Z=\"Mac OS\";var extend=function(i,e){var o={};for(var a in i){if(e[a]&&e[a].length%2===0){o[a]=e[a].concat(i[a])}else{o[a]=i[a]}}return o},enumerize=function(i){var e={};for(var o=0;o<i.length;o++){e[i[o].toUpperCase()]=i[o]}return e},has=function(i,e){return typeof i===l?lowerize(e).indexOf(lowerize(i))!==-1:false},lowerize=function(i){return i.toLowerCase()},majorize=function(i){return typeof i===l?i.replace(/[^\\d\\.]/g,t).split(\".\")[0]:a},trim=function(i,e){if(typeof i===l){i=i.replace(/^\\s\\s*/,t);return typeof e===b?i:i.substring(0,q)}};var rgxMapper=function(i,e){var o=0,r,t,n,b,l,d;while(o<e.length&&!l){var c=e[o],u=e[o+1];r=t=0;while(r<c.length&&!l){if(!c[r]){break}l=c[r++].exec(i);if(!!l){for(n=0;n<u.length;n++){d=l[++t];b=u[n];if(typeof b===w&&b.length>0){if(b.length===2){if(typeof b[1]==s){this[b[0]]=b[1].call(this,d)}else{this[b[0]]=b[1]}}else if(b.length===3){if(typeof b[1]===s&&!(b[1].exec&&b[1].test)){this[b[0]]=d?b[1].call(this,d,b[2]):a}else{this[b[0]]=d?d.replace(b[1],b[2]):a}}else if(b.length===4){this[b[0]]=d?b[3].call(this,d.replace(b[1],b[2])):a}}else{this[b]=d?d:a}}}}o+=2}},strMapper=function(i,e){for(var o in e){if(typeof e[o]===w&&e[o].length>0){for(var r=0;r<e[o].length;r++){if(has(e[o][r],i)){return o===n?a:o}}}else if(has(e[o],i)){return o===n?a:o}}return i};var $={\"1.0\":\"/8\",1.2:\"/1\",1.3:\"/3\",\"2.0\":\"/412\",\"2.0.2\":\"/416\",\"2.0.3\":\"/417\",\"2.0.4\":\"/419\",\"?\":\"/\"},X={ME:\"4.90\",\"NT 3.11\":\"NT3.51\",\"NT 4.0\":\"NT4.0\",2e3:\"NT 5.0\",XP:[\"NT 5.1\",\"NT 5.2\"],Vista:\"NT 6.0\",7:\"NT 6.1\",8:\"NT 6.2\",8.1:\"NT 6.3\",10:[\"NT 6.4\",\"NT 10.0\"],RT:\"ARM\"};var K={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[f,[u,\"Chrome\"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[f,[u,\"Edge\"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[u,f],[/opios[\\/ ]+([\\w\\.]+)/i],[f,[u,B+\" Mini\"]],[/\\bopr\\/([\\w\\.]+)/i],[f,[u,B]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(heytap|ovi)browser\\/([\\d\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[u,f],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[f,[u,\"UC\"+A]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[f,[u,\"WeChat(Win) Desktop\"]],[/micromessenger\\/([\\w\\.]+)/i],[f,[u,\"WeChat\"]],[/konqueror\\/([\\w\\.]+)/i],[f,[u,\"Konqueror\"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[f,[u,\"IE\"]],[/ya(?:search)?browser\\/([\\w\\.]+)/i],[f,[u,\"Yandex\"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[u,/(.+)/,\"$1 Secure \"+A],f],[/\\bfocus\\/([\\w\\.]+)/i],[f,[u,O+\" Focus\"]],[/\\bopt\\/([\\w\\.]+)/i],[f,[u,B+\" Touch\"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[f,[u,\"Coc Coc\"]],[/dolfin\\/([\\w\\.]+)/i],[f,[u,\"Dolphin\"]],[/coast\\/([\\w\\.]+)/i],[f,[u,B+\" Coast\"]],[/miuibrowser\\/([\\w\\.]+)/i],[f,[u,\"MIUI \"+A]],[/fxios\\/([-\\w\\.]+)/i],[f,[u,O]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[u,\"360 \"+A]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[u,/(.+)/,\"$1 \"+A],f],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[u,/_/g,\" \"],f],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[u,f],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[u],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[u,H],f],[/(kakao(?:talk|story))[\\/ ]([\\w\\.]+)/i,/(naver)\\(.*?(\\d+\\.[\\w\\.]+).*\\)/i,/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[u,f],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[f,[u,\"GSA\"]],[/musical_ly(?:.+app_?version\\/|_)([\\w\\.]+)/i],[f,[u,\"TikTok\"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[f,[u,C+\" Headless\"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[u,C+\" WebView\"],f],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[f,[u,\"Android \"+A]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[u,f],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[f,[u,\"Mobile Safari\"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[u,[f,strMapper,$]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[u,f],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[u,\"Netscape\"],f],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[f,[u,O+\" Reality\"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i,/panasonic;(viera)/i],[u,f],[/(cobalt)\\/([\\w\\.]+)/i],[u,[f,/master.|lts./,\"\"]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[h,\"amd64\"]],[/(ia32(?=;))/i],[[h,lowerize]],[/((?:i[346]|x)86)[;\\)]/i],[[h,\"ia32\"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[h,\"arm64\"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[h,\"armhf\"]],[/windows (ce|mobile); ppc;/i],[[h,\"arm\"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[h,/ower/,t,lowerize]],[/(sun4\\w)[;\\)]/i],[[h,\"sparc\"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[h,lowerize]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[m,V],[p,k]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|sc[g-]?[\\d]+a?|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[c,[m,V],[p,g]],[/(?:\\/|\\()(ip(?:hone|od)[\\w, ]*)(?:\\/|;)/i],[c,[m,S],[p,g]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[c,[m,S],[p,k]],[/(macintosh);/i],[c,[m,S]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[c,[m,D],[p,g]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[c,[m,j],[p,k]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[c,[m,j],[p,g]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[c,/_/g,\" \"],[m,F],[p,g]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[c,/_/g,\" \"],[m,F],[p,k]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[c,[m,\"OPPO\"],[p,g]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[c,[m,\"Vivo\"],[p,g]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[c,[m,\"Realme\"],[p,g]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[c,[m,M],[p,g]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[c,[m,M],[p,k]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[m,P],[p,k]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[c,[m,P],[p,g]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[c,[m,\"Lenovo\"],[p,k]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[c,/_/g,\" \"],[m,\"Nokia\"],[p,g]],[/(pixel c)\\b/i],[c,[m,U],[p,k]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[c,[m,U],[p,g]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[c,[m,I],[p,g]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[c,\"Xperia Tablet\"],[m,I],[p,k]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[c,[m,\"OnePlus\"],[p,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[c,[m,T],[p,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[c,/(.+)/g,\"Fire Phone $1\"],[m,T],[p,g]],[/(playbook);[-\\w\\),; ]+(rim)/i],[c,m,[p,k]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[c,[m,N],[p,g]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[c,[m,z],[p,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[c,[m,z],[p,g]],[/(nexus 9)/i],[c,[m,\"HTC\"],[p,k]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\\.))|sony(?!-bra))[-_ ]?([-\\w]*)/i],[m,[c,/_/g,\" \"],[p,g]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[c,[m,\"Acer\"],[p,k]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[c,[m,\"Meizu\"],[p,g]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[m,c,[p,g]],[/(kobo)\\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[m,c,[p,k]],[/(surface duo)/i],[c,[m,R],[p,k]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[c,[m,\"Fairphone\"],[p,g]],[/(u304aa)/i],[c,[m,\"AT&T\"],[p,g]],[/\\bsie-(\\w*)/i],[c,[m,\"Siemens\"],[p,g]],[/\\b(rct\\w+) b/i],[c,[m,\"RCA\"],[p,k]],[/\\b(venue[\\d ]{2,7}) b/i],[c,[m,\"Dell\"],[p,k]],[/\\b(q(?:mv|ta)\\w+) b/i],[c,[m,\"Verizon\"],[p,k]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[c,[m,\"Barnes & Noble\"],[p,k]],[/\\b(tm\\d{3}\\w+) b/i],[c,[m,\"NuVision\"],[p,k]],[/\\b(k88) b/i],[c,[m,\"ZTE\"],[p,k]],[/\\b(nx\\d{3}j) b/i],[c,[m,\"ZTE\"],[p,g]],[/\\b(gen\\d{3}) b.+49h/i],[c,[m,\"Swiss\"],[p,g]],[/\\b(zur\\d{3}) b/i],[c,[m,\"Swiss\"],[p,k]],[/\\b((zeki)?tb.*\\b) b/i],[c,[m,\"Zeki\"],[p,k]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[m,\"Dragon Touch\"],c,[p,k]],[/\\b(ns-?\\w{0,9}) b/i],[c,[m,\"Insignia\"],[p,k]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[c,[m,\"NextBook\"],[p,k]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,\"Voice\"],c,[p,g]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[m,\"LvTel\"],c,[p,g]],[/\\b(ph-1) /i],[c,[m,\"Essential\"],[p,g]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[c,[m,\"Envizen\"],[p,k]],[/\\b(trio[-\\w\\. ]+) b/i],[c,[m,\"MachSpeed\"],[p,k]],[/\\btu_(1491) b/i],[c,[m,\"Rotor\"],[p,k]],[/(shield[\\w ]+) b/i],[c,[m,\"Nvidia\"],[p,k]],[/(sprint) (\\w+)/i],[m,c,[p,g]],[/(kin\\.[onetw]{3})/i],[[c,/\\./g,\" \"],[m,R],[p,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[c,[m,G],[p,k]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[c,[m,G],[p,g]],[/smart-tv.+(samsung)/i],[m,[p,x]],[/hbbtv.+maple;(\\d+)/i],[[c,/^/,\"SmartTV\"],[m,V],[p,x]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[m,P],[p,x]],[/(apple) ?tv/i],[m,[c,S+\" TV\"],[p,x]],[/crkey/i],[[c,C+\"cast\"],[m,U],[p,x]],[/droid.+aft(\\w)( bui|\\))/i],[c,[m,T],[p,x]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[c,[m,D],[p,x]],[/(bravia[\\w ]+)( bui|\\))/i],[c,[m,I],[p,x]],[/(mitv-\\w{5}) bui/i],[c,[m,F],[p,x]],[/Hbbtv.*(technisat) (.*);/i],[m,c,[p,x]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w\\+ ]*; *([\\w\\d][^;]*);([^;]*)/i],[[m,trim],[c,trim],[p,x]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[p,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,c,[p,v]],[/droid.+; (shield) bui/i],[c,[m,\"Nvidia\"],[p,v]],[/(playstation [345portablevi]+)/i],[c,[m,I],[p,v]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[c,[m,R],[p,v]],[/((pebble))app/i],[m,c,[p,_]],[/(watch)(?: ?os[,\\/]|\\d,\\d\\/)[\\d\\.]+/i],[c,[m,S],[p,_]],[/droid.+; (glass) \\d/i],[c,[m,U],[p,_]],[/droid.+; (wt63?0{2,3})\\)/i],[c,[m,G],[p,_]],[/(quest( 2| pro)?)/i],[c,[m,H],[p,_]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[m,[p,y]],[/(aeobc)\\b/i],[c,[m,T],[p,y]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[c,[p,g]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[c,[p,k]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[p,k]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[p,g]],[/(android[-\\w\\. ]{0,9});.+buil/i],[c,[m,\"Generic\"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[f,[u,E+\"HTML\"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[f,[u,\"Blink\"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i,/\\b(libweb)/i],[u,f],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[u,[f,strMapper,X]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[u,\"Windows\"],[f,strMapper,X]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/ios;fbsv\\/([\\d\\.]+)/i,/cfnetwork\\/.+darwin/i],[[f,/_/g,\".\"],[u,\"iOS\"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[u,Z],[f,/_/g,\".\"]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[u,f],[/\\(bb(10);/i],[f,[u,N]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[f,[u,\"Symbian\"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[f,[u,O+\" OS\"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[f,[u,\"webOS\"]],[/watch(?: ?os[,\\/]|\\d,\\d\\/)([\\d\\.]+)/i],[f,[u,\"watchOS\"]],[/crkey\\/([\\d\\.]+)/i],[f,[u,C+\"cast\"]],[/(cros) [\\w]+(?:\\)| ([\\w\\.]+)\\b)/i],[[u,L],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\\/(\\d+\\.[\\w\\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[u,f],[/(sunos) ?([\\w\\.\\d]*)/i],[[u,\"Solaris\"],f],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\\w\\.]*)/i],[u,f]]};var UAParser=function(i,e){if(typeof i===w){e=i;i=a}if(!(this instanceof UAParser)){return new UAParser(i,e).getResult()}var r=typeof o!==b&&o.navigator?o.navigator:a;var n=i||(r&&r.userAgent?r.userAgent:t);var v=r&&r.userAgentData?r.userAgentData:a;var x=e?extend(K,e):K;var _=r&&r.userAgent==n;this.getBrowser=function(){var i={};i[u]=a;i[f]=a;rgxMapper.call(i,n,x.browser);i[d]=majorize(i[f]);if(_&&r&&r.brave&&typeof r.brave.isBrave==s){i[u]=\"Brave\"}return i};this.getCPU=function(){var i={};i[h]=a;rgxMapper.call(i,n,x.cpu);return i};this.getDevice=function(){var i={};i[m]=a;i[c]=a;i[p]=a;rgxMapper.call(i,n,x.device);if(_&&!i[p]&&v&&v.mobile){i[p]=g}if(_&&i[c]==\"Macintosh\"&&r&&typeof r.standalone!==b&&r.maxTouchPoints&&r.maxTouchPoints>2){i[c]=\"iPad\";i[p]=k}return i};this.getEngine=function(){var i={};i[u]=a;i[f]=a;rgxMapper.call(i,n,x.engine);return i};this.getOS=function(){var i={};i[u]=a;i[f]=a;rgxMapper.call(i,n,x.os);if(_&&!i[u]&&v&&v.platform!=\"Unknown\"){i[u]=v.platform.replace(/chrome os/i,L).replace(/macos/i,Z)}return i};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}};this.getUA=function(){return n};this.setUA=function(i){n=typeof i===l&&i.length>q?trim(i,q):i;return this};this.setUA(n);return this};UAParser.VERSION=r;UAParser.BROWSER=enumerize([u,f,d]);UAParser.CPU=enumerize([h]);UAParser.DEVICE=enumerize([c,m,p,v,g,x,k,_,y]);UAParser.ENGINE=UAParser.OS=enumerize([u,f]);if(typeof e!==b){if(\"object\"!==b&&i.exports){e=i.exports=UAParser}e.UAParser=UAParser}else{if(typeof define===s&&define.amd){define((function(){return UAParser}))}else if(typeof o!==b){o.UAParser=UAParser}}var Q=typeof o!==b&&(o.jQuery||o.Zepto);if(Q&&!Q.ua){var Y=new UAParser;Q.ua=Y.getResult();Q.ua.get=function(){return Y.getUA()};Q.ua.set=function(i){Y.setUA(i);var e=Y.getResult();for(var o in e){Q.ua[o]=e[o]}}}})(typeof window===\"object\"?window:this)}};var e={};function __nccwpck_require__(o){var a=e[o];if(a!==undefined){return a.exports}var r=e[o]={exports:{}};var t=true;try{i[o].call(r.exports,r,r.exports,__nccwpck_require__);t=false}finally{if(t)delete e[o]}return r.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var o=__nccwpck_require__(226);module.exports=o})();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n getTestReqInfo: null,\n withRequest: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n getTestReqInfo: function() {\n return getTestReqInfo;\n },\n withRequest: function() {\n return withRequest;\n }\n});\nconst _nodeasync_hooks = require(\"node:async_hooks\");\nconst testStorage = new _nodeasync_hooks.AsyncLocalStorage();\nfunction extractTestInfoFromRequest(req, reader) {\n const proxyPortHeader = reader.header(req, 'next-test-proxy-port');\n if (!proxyPortHeader) {\n return undefined;\n }\n const url = reader.url(req);\n const proxyPort = Number(proxyPortHeader);\n const testData = reader.header(req, 'next-test-data') || '';\n return {\n url,\n proxyPort,\n testData\n };\n}\nfunction withRequest(req, reader, fn) {\n const testReqInfo = extractTestInfoFromRequest(req, reader);\n if (!testReqInfo) {\n return fn();\n }\n return testStorage.run(testReqInfo, fn);\n}\nfunction getTestReqInfo(req, reader) {\n const testReqInfo = testStorage.getStore();\n if (testReqInfo) {\n return testReqInfo;\n }\n if (req && reader) {\n return extractTestInfoFromRequest(req, reader);\n }\n return undefined;\n}\n\n//# sourceMappingURL=context.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n interceptTestApis: null,\n wrapRequestHandler: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n interceptTestApis: function() {\n return interceptTestApis;\n },\n wrapRequestHandler: function() {\n return wrapRequestHandler;\n }\n});\nconst _context = require(\"./context\");\nconst _fetch = require(\"./fetch\");\nfunction interceptTestApis() {\n return (0, _fetch.interceptFetch)(global.fetch);\n}\nfunction wrapRequestHandler(handler) {\n return (req, fn)=>(0, _context.withRequest)(req, _fetch.reader, ()=>handler(req, fn));\n}\n\n//# sourceMappingURL=server-edge.js.map","(()=>{\"use strict\";var e={993:e=>{var t=Object.prototype.hasOwnProperty,n=\"~\";function Events(){}if(Object.create){Events.prototype=Object.create(null);if(!(new Events).__proto__)n=false}function EE(e,t,n){this.fn=e;this.context=t;this.once=n||false}function addListener(e,t,r,i,s){if(typeof r!==\"function\"){throw new TypeError(\"The listener must be a function\")}var o=new EE(r,i||e,s),u=n?n+t:t;if(!e._events[u])e._events[u]=o,e._eventsCount++;else if(!e._events[u].fn)e._events[u].push(o);else e._events[u]=[e._events[u],o];return e}function clearEvent(e,t){if(--e._eventsCount===0)e._events=new Events;else delete e._events[t]}function EventEmitter(){this._events=new Events;this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events){if(t.call(r,i))e.push(n?i.slice(1):i)}if(Object.getOwnPropertySymbols){return e.concat(Object.getOwnPropertySymbols(r))}return e};EventEmitter.prototype.listeners=function listeners(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++){o[i]=r[i].fn}return o};EventEmitter.prototype.listenerCount=function listenerCount(e){var t=n?n+e:e,r=this._events[t];if(!r)return 0;if(r.fn)return 1;return r.length};EventEmitter.prototype.emit=function emit(e,t,r,i,s,o){var u=n?n+e:e;if(!this._events[u])return false;var a=this._events[u],l=arguments.length,c,h;if(a.fn){if(a.once)this.removeListener(e,a.fn,undefined,true);switch(l){case 1:return a.fn.call(a.context),true;case 2:return a.fn.call(a.context,t),true;case 3:return a.fn.call(a.context,t,r),true;case 4:return a.fn.call(a.context,t,r,i),true;case 5:return a.fn.call(a.context,t,r,i,s),true;case 6:return a.fn.call(a.context,t,r,i,s,o),true}for(h=1,c=new Array(l-1);h<l;h++){c[h-1]=arguments[h]}a.fn.apply(a.context,c)}else{var _=a.length,f;for(h=0;h<_;h++){if(a[h].once)this.removeListener(e,a[h].fn,undefined,true);switch(l){case 1:a[h].fn.call(a[h].context);break;case 2:a[h].fn.call(a[h].context,t);break;case 3:a[h].fn.call(a[h].context,t,r);break;case 4:a[h].fn.call(a[h].context,t,r,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++){c[f-1]=arguments[f]}a[h].fn.apply(a[h].context,c)}}}return true};EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,false)};EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,true)};EventEmitter.prototype.removeListener=function removeListener(e,t,r,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t){clearEvent(this,s);return this}var o=this._events[s];if(o.fn){if(o.fn===t&&(!i||o.once)&&(!r||o.context===r)){clearEvent(this,s)}}else{for(var u=0,a=[],l=o.length;u<l;u++){if(o[u].fn!==t||i&&!o[u].once||r&&o[u].context!==r){a.push(o[u])}}if(a.length)this._events[s]=a.length===1?a[0]:a;else clearEvent(this,s)}return this};EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;if(e){t=n?n+e:e;if(this._events[t])clearEvent(this,t)}else{this._events=new Events;this._eventsCount=0}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prefixed=n;EventEmitter.EventEmitter=EventEmitter;if(true){e.exports=EventEmitter}},213:e=>{e.exports=(e,t)=>{t=t||(()=>{});return e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e}))))}},574:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});function lowerBound(e,t,n){let r=0;let i=e.length;while(i>0){const s=i/2|0;let o=r+s;if(n(e[o],t)<=0){r=++o;i-=s+1}else{i=s}}return r}t[\"default\"]=lowerBound},821:(e,t,n)=>{Object.defineProperty(t,\"__esModule\",{value:true});const r=n(574);class PriorityQueue{constructor(){this._queue=[]}enqueue(e,t){t=Object.assign({priority:0},t);const n={priority:t.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority){this._queue.push(n);return}const i=r.default(this._queue,n,((e,t)=>t.priority-e.priority));this._queue.splice(i,0,n)}dequeue(){const e=this._queue.shift();return e===null||e===void 0?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}t[\"default\"]=PriorityQueue},816:(e,t,n)=>{const r=n(213);class TimeoutError extends Error{constructor(e){super(e);this.name=\"TimeoutError\"}}const pTimeout=(e,t,n)=>new Promise(((i,s)=>{if(typeof t!==\"number\"||t<0){throw new TypeError(\"Expected `milliseconds` to be a positive number\")}if(t===Infinity){i(e);return}const o=setTimeout((()=>{if(typeof n===\"function\"){try{i(n())}catch(e){s(e)}return}const r=typeof n===\"string\"?n:`Promise timed out after ${t} milliseconds`;const o=n instanceof Error?n:new TimeoutError(r);if(typeof e.cancel===\"function\"){e.cancel()}s(o)}),t);r(e.then(i,s),(()=>{clearTimeout(o)}))}));e.exports=pTimeout;e.exports[\"default\"]=pTimeout;e.exports.TimeoutError=TimeoutError}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={exports:{}};var s=true;try{e[n](i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return i.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var n={};(()=>{var e=n;Object.defineProperty(e,\"__esModule\",{value:true});const t=__nccwpck_require__(993);const r=__nccwpck_require__(816);const i=__nccwpck_require__(821);const empty=()=>{};const s=new r.TimeoutError;class PQueue extends t{constructor(e){var t,n,r,s;super();this._intervalCount=0;this._intervalEnd=0;this._pendingCount=0;this._resolveEmpty=empty;this._resolveIdle=empty;e=Object.assign({carryoverConcurrencyCount:false,intervalCap:Infinity,interval:0,concurrency:Infinity,autoStart:true,queueClass:i.default},e);if(!(typeof e.intervalCap===\"number\"&&e.intervalCap>=1)){throw new TypeError(`Expected \\`intervalCap\\` to be a number from 1 and up, got \\`${(n=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:\"\"}\\` (${typeof e.intervalCap})`)}if(e.interval===undefined||!(Number.isFinite(e.interval)&&e.interval>=0)){throw new TypeError(`Expected \\`interval\\` to be a finite number >= 0, got \\`${(s=(r=e.interval)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:\"\"}\\` (${typeof e.interval})`)}this._carryoverConcurrencyCount=e.carryoverConcurrencyCount;this._isIntervalIgnored=e.intervalCap===Infinity||e.interval===0;this._intervalCap=e.intervalCap;this._interval=e.interval;this._queue=new e.queueClass;this._queueClass=e.queueClass;this.concurrency=e.concurrency;this._timeout=e.timeout;this._throwOnTimeout=e.throwOnTimeout===true;this._isPaused=e.autoStart===false}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--;this._tryToStartAnother();this.emit(\"next\")}_resolvePromises(){this._resolveEmpty();this._resolveEmpty=empty;if(this._pendingCount===0){this._resolveIdle();this._resolveIdle=empty;this.emit(\"idle\")}}_onResumeInterval(){this._onInterval();this._initializeIntervalIfNeeded();this._timeoutId=undefined}_isIntervalPaused(){const e=Date.now();if(this._intervalId===undefined){const t=this._intervalEnd-e;if(t<0){this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}else{if(this._timeoutId===undefined){this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),t)}return true}}return false}_tryToStartAnother(){if(this._queue.size===0){if(this._intervalId){clearInterval(this._intervalId)}this._intervalId=undefined;this._resolvePromises();return false}if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();if(!t){return false}this.emit(\"active\");t();if(e){this._initializeIntervalIfNeeded()}return true}}return false}_initializeIntervalIfNeeded(){if(this._isIntervalIgnored||this._intervalId!==undefined){return}this._intervalId=setInterval((()=>{this._onInterval()}),this._interval);this._intervalEnd=Date.now()+this._interval}_onInterval(){if(this._intervalCount===0&&this._pendingCount===0&&this._intervalId){clearInterval(this._intervalId);this._intervalId=undefined}this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;this._processQueue()}_processQueue(){while(this._tryToStartAnother()){}}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e===\"number\"&&e>=1)){throw new TypeError(`Expected \\`concurrency\\` to be a number from 1 and up, got \\`${e}\\` (${typeof e})`)}this._concurrency=e;this._processQueue()}async add(e,t={}){return new Promise(((n,i)=>{const run=async()=>{this._pendingCount++;this._intervalCount++;try{const o=this._timeout===undefined&&t.timeout===undefined?e():r.default(Promise.resolve(e()),t.timeout===undefined?this._timeout:t.timeout,(()=>{if(t.throwOnTimeout===undefined?this._throwOnTimeout:t.throwOnTimeout){i(s)}return undefined}));n(await o)}catch(e){i(e)}this._next()};this._queue.enqueue(run,t);this._tryToStartAnother();this.emit(\"add\")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){if(!this._isPaused){return this}this._isPaused=false;this._processQueue();return this}pause(){this._isPaused=true}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size===0){return}return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t();e()}}))}async onIdle(){if(this._pendingCount===0&&this._queue.size===0){return}return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t();e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}e[\"default\"]=PQueue})();module.exports=n})();","export async function getEdgeInstrumentationModule() {\n const instrumentation = '_ENTRIES' in globalThis && _ENTRIES.middleware_instrumentation && await _ENTRIES.middleware_instrumentation;\n return instrumentation;\n}\nlet instrumentationModulePromise = null;\nasync function registerInstrumentation() {\n // Ensure registerInstrumentation is not called in production build\n if (process.env.NEXT_PHASE === 'phase-production-build') return;\n if (!instrumentationModulePromise) {\n instrumentationModulePromise = getEdgeInstrumentationModule();\n }\n const instrumentation = await instrumentationModulePromise;\n if (instrumentation == null ? void 0 : instrumentation.register) {\n try {\n await instrumentation.register();\n } catch (err) {\n err.message = `An error occurred while loading instrumentation hook: ${err.message}`;\n throw err;\n }\n }\n}\nexport async function edgeInstrumentationOnRequestError(...args) {\n const instrumentation = await getEdgeInstrumentationModule();\n try {\n var _instrumentation_onRequestError;\n await (instrumentation == null ? void 0 : (_instrumentation_onRequestError = instrumentation.onRequestError) == null ? void 0 : _instrumentation_onRequestError.call(instrumentation, ...args));\n } catch (err) {\n // Log the soft error and continue, since the original error has already been thrown\n console.error('Error in instrumentation.onRequestError:', err);\n }\n}\nlet registerInstrumentationPromise = null;\nexport function ensureInstrumentationRegistered() {\n if (!registerInstrumentationPromise) {\n registerInstrumentationPromise = registerInstrumentation();\n }\n return registerInstrumentationPromise;\n}\nfunction getUnsupportedModuleErrorMessage(module) {\n // warning: if you change these messages, you must adjust how dev-overlay's middleware detects modules not found\n return `The edge runtime does not support Node.js '${module}' module.\nLearn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`;\n}\nfunction __import_unsupported(moduleName) {\n const proxy = new Proxy(function() {}, {\n get (_obj, prop) {\n if (prop === 'then') {\n return {};\n }\n throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n },\n construct () {\n throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n },\n apply (_target, _this, args) {\n if (typeof args[0] === 'function') {\n return args[0](proxy);\n }\n throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n }\n });\n return new Proxy({}, {\n get: ()=>proxy\n });\n}\nfunction enhanceGlobals() {\n if (process.env.NEXT_RUNTIME !== 'edge') {\n return;\n }\n // The condition is true when the \"process\" module is provided\n if (process !== global.process) {\n // prefer local process but global.process has correct \"env\"\n process.env = global.process.env;\n global.process = process;\n }\n // to allow building code that import but does not use node.js modules,\n // webpack will expect this function to exist in global scope\n try {\n Object.defineProperty(globalThis, '__import_unsupported', {\n value: __import_unsupported,\n enumerable: false,\n configurable: false\n });\n } catch {}\n // Eagerly fire instrumentation hook to make the startup faster.\n void ensureInstrumentationRegistered();\n}\nenhanceGlobals();\n\n//# sourceMappingURL=globals.js.map","export class PageSignatureError extends Error {\n constructor({ page }){\n super(`The middleware \"${page}\" accepts an async API directly with the form:\n \n export function middleware(request, event) {\n return NextResponse.redirect('/new-location')\n }\n \n Read more: https://nextjs.org/docs/messages/middleware-new-signature\n `);\n }\n}\nexport class RemovedPageError extends Error {\n constructor(){\n super(`The request.page has been deprecated in favour of \\`URLPattern\\`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n `);\n }\n}\nexport class RemovedUAError extends Error {\n constructor(){\n super(`The request.ua has been removed in favour of \\`userAgent\\` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n `);\n }\n}\n\n//# sourceMappingURL=error.js.map","export const TEXT_PLAIN_CONTENT_TYPE_HEADER = 'text/plain';\nexport const HTML_CONTENT_TYPE_HEADER = 'text/html; charset=utf-8';\nexport const JSON_CONTENT_TYPE_HEADER = 'application/json; charset=utf-8';\nexport const NEXT_QUERY_PARAM_PREFIX = 'nxtP';\nexport const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI';\nexport const MATCHED_PATH_HEADER = 'x-matched-path';\nexport const PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate';\nexport const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = 'x-prerender-revalidate-if-generated';\nexport const RSC_PREFETCH_SUFFIX = '.prefetch.rsc';\nexport const RSC_SEGMENTS_DIR_SUFFIX = '.segments';\nexport const RSC_SEGMENT_SUFFIX = '.segment.rsc';\nexport const RSC_SUFFIX = '.rsc';\nexport const ACTION_SUFFIX = '.action';\nexport const NEXT_DATA_SUFFIX = '.json';\nexport const NEXT_META_SUFFIX = '.meta';\nexport const NEXT_BODY_SUFFIX = '.body';\nexport const NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags';\nexport const NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags';\nexport const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = 'x-next-revalidate-tag-token';\nexport const NEXT_RESUME_HEADER = 'next-resume';\n// if these change make sure we update the related\n// documentation as well\nexport const NEXT_CACHE_TAG_MAX_ITEMS = 128;\nexport const NEXT_CACHE_TAG_MAX_LENGTH = 256;\nexport const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;\nexport const NEXT_CACHE_IMPLICIT_TAG_ID = '_N_T_';\n// in seconds\nexport const CACHE_ONE_YEAR = 31536000;\n// in seconds, represents revalidate=false. I.e. never revaliate.\n// We use this value since it can be represented as a V8 SMI for optimal performance.\n// It can also be serialized as JSON if it ever leaks accidentally as an actual value.\nexport const INFINITE_CACHE = 0xfffffffe;\n// Patterns to detect middleware files\nexport const MIDDLEWARE_FILENAME = 'middleware';\nexport const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;\n// Pattern to detect instrumentation hooks file\nexport const INSTRUMENTATION_HOOK_FILENAME = 'instrumentation';\n// Because on Windows absolute paths in the generated code can break because of numbers, eg 1 in the path,\n// we have to use a private alias\nexport const PAGES_DIR_ALIAS = 'private-next-pages';\nexport const DOT_NEXT_ALIAS = 'private-dot-next';\nexport const ROOT_DIR_ALIAS = 'private-next-root-dir';\nexport const APP_DIR_ALIAS = 'private-next-app-dir';\nexport const RSC_MOD_REF_PROXY_ALIAS = 'next/dist/build/webpack/loaders/next-flight-loader/module-proxy';\nexport const RSC_ACTION_VALIDATE_ALIAS = 'private-next-rsc-action-validate';\nexport const RSC_ACTION_PROXY_ALIAS = 'private-next-rsc-server-reference';\nexport const RSC_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper';\nexport const RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = 'private-next-rsc-track-dynamic-import';\nexport const RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption';\nexport const RSC_ACTION_CLIENT_WRAPPER_ALIAS = 'private-next-rsc-action-client-wrapper';\nexport const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;\nexport const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;\nexport const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;\nexport const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;\nexport const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;\nexport const SERVER_PROPS_EXPORT_ERROR = `pages with \\`getServerSideProps\\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;\nexport const GSP_NO_RETURNED_VALUE = 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?';\nexport const GSSP_NO_RETURNED_VALUE = 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?';\nexport const UNSTABLE_REVALIDATE_RENAME_ERROR = 'The `unstable_revalidate` property is available for general use.\\n' + 'Please use `revalidate` instead.';\nexport const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;\nexport const NON_STANDARD_NODE_ENV = `You are using a non-standard \"NODE_ENV\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;\nexport const SSG_FALLBACK_EXPORT_ERROR = `Pages with \\`fallback\\` enabled in \\`getStaticPaths\\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;\nexport const ESLINT_DEFAULT_DIRS = [\n 'app',\n 'pages',\n 'components',\n 'lib',\n 'src'\n];\nexport const SERVER_RUNTIME = {\n edge: 'edge',\n experimentalEdge: 'experimental-edge',\n nodejs: 'nodejs'\n};\n/**\n * The names of the webpack layers. These layers are the primitives for the\n * webpack chunks.\n */ const WEBPACK_LAYERS_NAMES = {\n /**\n * The layer for the shared code between the client and server bundles.\n */ shared: 'shared',\n /**\n * The layer for server-only runtime and picking up `react-server` export conditions.\n * Including app router RSC pages and app router custom routes and metadata routes.\n */ reactServerComponents: 'rsc',\n /**\n * Server Side Rendering layer for app (ssr).\n */ serverSideRendering: 'ssr',\n /**\n * The browser client bundle layer for actions.\n */ actionBrowser: 'action-browser',\n /**\n * The Node.js bundle layer for the API routes.\n */ apiNode: 'api-node',\n /**\n * The Edge Lite bundle layer for the API routes.\n */ apiEdge: 'api-edge',\n /**\n * The layer for the middleware code.\n */ middleware: 'middleware',\n /**\n * The layer for the instrumentation hooks.\n */ instrument: 'instrument',\n /**\n * The layer for assets on the edge.\n */ edgeAsset: 'edge-asset',\n /**\n * The browser client bundle layer for App directory.\n */ appPagesBrowser: 'app-pages-browser',\n /**\n * The browser client bundle layer for Pages directory.\n */ pagesDirBrowser: 'pages-dir-browser',\n /**\n * The Edge Lite bundle layer for Pages directory.\n */ pagesDirEdge: 'pages-dir-edge',\n /**\n * The Node.js bundle layer for Pages directory.\n */ pagesDirNode: 'pages-dir-node'\n};\nconst WEBPACK_LAYERS = {\n ...WEBPACK_LAYERS_NAMES,\n GROUP: {\n builtinReact: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser\n ],\n serverOnly: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware\n ],\n neutralTarget: [\n // pages api\n WEBPACK_LAYERS_NAMES.apiNode,\n WEBPACK_LAYERS_NAMES.apiEdge\n ],\n clientOnly: [\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser\n ],\n bundled: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.shared,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware\n ],\n appPages: [\n // app router pages and layouts\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.actionBrowser\n ]\n }\n};\nconst WEBPACK_RESOURCE_QUERIES = {\n edgeSSREntry: '__next_edge_ssr_entry__',\n metadata: '__next_metadata__',\n metadataRoute: '__next_metadata_route__',\n metadataImageMeta: '__next_metadata_image_meta__'\n};\nexport { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };\n\n//# sourceMappingURL=constants.js.map","import { NEXT_INTERCEPTION_MARKER_PREFIX, NEXT_QUERY_PARAM_PREFIX } from '../../lib/constants';\n/**\n * Converts a Node.js IncomingHttpHeaders object to a Headers object. Any\n * headers with multiple values will be joined with a comma and space. Any\n * headers that have an undefined value will be ignored and others will be\n * coerced to strings.\n *\n * @param nodeHeaders the headers object to convert\n * @returns the converted headers object\n */ export function fromNodeOutgoingHttpHeaders(nodeHeaders) {\n const headers = new Headers();\n for (let [key, value] of Object.entries(nodeHeaders)){\n const values = Array.isArray(value) ? value : [\n value\n ];\n for (let v of values){\n if (typeof v === 'undefined') continue;\n if (typeof v === 'number') {\n v = v.toString();\n }\n headers.append(key, v);\n }\n }\n return headers;\n}\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n \n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/ export function splitCookiesString(cookiesString) {\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while(pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))){\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== '=' && ch !== ';' && ch !== ',';\n }\n while(pos < cookiesString.length){\n start = pos;\n cookiesSeparatorFound = false;\n while(skipWhitespace()){\n ch = cookiesString.charAt(pos);\n if (ch === ',') {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while(pos < cookiesString.length && notSpecialChar()){\n pos += 1;\n }\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === '=') {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n/**\n * Converts a Headers object to a Node.js OutgoingHttpHeaders object. This is\n * required to support the set-cookie header, which may have multiple values.\n *\n * @param headers the headers object to convert\n * @returns the converted headers object\n */ export function toNodeOutgoingHttpHeaders(headers) {\n const nodeHeaders = {};\n const cookies = [];\n if (headers) {\n for (const [key, value] of headers.entries()){\n if (key.toLowerCase() === 'set-cookie') {\n // We may have gotten a comma joined string of cookies, or multiple\n // set-cookie headers. We need to merge them into one header array\n // to represent all the cookies.\n cookies.push(...splitCookiesString(value));\n nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies;\n } else {\n nodeHeaders[key] = value;\n }\n }\n }\n return nodeHeaders;\n}\n/**\n * Validate the correctness of a user-provided URL.\n */ export function validateURL(url) {\n try {\n return String(new URL(String(url)));\n } catch (error) {\n throw Object.defineProperty(new Error(`URL is malformed \"${String(url)}\". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {\n cause: error\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E61\",\n enumerable: false,\n configurable: true\n });\n }\n}\n/**\n * Normalizes `nxtP` and `nxtI` query param values to remove the prefix.\n * This function does not mutate the input key.\n */ export function normalizeNextQueryParam(key) {\n const prefixes = [\n NEXT_QUERY_PARAM_PREFIX,\n NEXT_INTERCEPTION_MARKER_PREFIX\n ];\n for (const prefix of prefixes){\n if (key !== prefix && key.startsWith(prefix)) {\n return key.substring(prefix.length);\n }\n }\n return null;\n}\n\n//# sourceMappingURL=utils.js.map","import { PageSignatureError } from '../error';\nconst responseSymbol = Symbol('response');\nconst passThroughSymbol = Symbol('passThrough');\nconst waitUntilSymbol = Symbol('waitUntil');\nclass FetchEvent {\n constructor(_request, waitUntil){\n this[passThroughSymbol] = false;\n this[waitUntilSymbol] = waitUntil ? {\n kind: 'external',\n function: waitUntil\n } : {\n kind: 'internal',\n promises: []\n };\n }\n // TODO: is this dead code? NextFetchEvent never lets this get called\n respondWith(response) {\n if (!this[responseSymbol]) {\n this[responseSymbol] = Promise.resolve(response);\n }\n }\n // TODO: is this dead code? passThroughSymbol is unused\n passThroughOnException() {\n this[passThroughSymbol] = true;\n }\n waitUntil(promise) {\n if (this[waitUntilSymbol].kind === 'external') {\n // if we received an external waitUntil, we delegate to it\n // TODO(after): this will make us not go through `getServerError(error, 'edge-server')` in `sandbox`\n const waitUntil = this[waitUntilSymbol].function;\n return waitUntil(promise);\n } else {\n // if we didn't receive an external waitUntil, we make it work on our own\n // (and expect the caller to do something with the promises)\n this[waitUntilSymbol].promises.push(promise);\n }\n }\n}\nexport function getWaitUntilPromiseFromEvent(event) {\n return event[waitUntilSymbol].kind === 'internal' ? Promise.all(event[waitUntilSymbol].promises).then(()=>{}) : undefined;\n}\nexport class NextFetchEvent extends FetchEvent {\n constructor(params){\n var _params_context;\n super(params.request, (_params_context = params.context) == null ? void 0 : _params_context.waitUntil);\n this.sourcePage = params.page;\n }\n /**\n * @deprecated The `request` is now the first parameter and the API is now async.\n *\n * Read more: https://nextjs.org/docs/messages/middleware-new-signature\n */ get request() {\n throw Object.defineProperty(new PageSignatureError({\n page: this.sourcePage\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n }\n /**\n * @deprecated Using `respondWith` is no longer needed.\n *\n * Read more: https://nextjs.org/docs/messages/middleware-new-signature\n */ respondWith() {\n throw Object.defineProperty(new PageSignatureError({\n page: this.sourcePage\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n }\n}\n\n//# sourceMappingURL=fetch-event.js.map","import type { DomainLocale } from '../../../server/config-shared'\n\nexport function detectDomainLocale(\n domainItems?: readonly DomainLocale[],\n hostname?: string,\n detectedLocale?: string\n) {\n if (!domainItems) return\n\n if (detectedLocale) {\n detectedLocale = detectedLocale.toLowerCase()\n }\n\n for (const item of domainItems) {\n // remove port if present\n const domainHostname = item.domain?.split(':', 1)[0].toLowerCase()\n if (\n hostname === domainHostname ||\n detectedLocale === item.defaultLocale.toLowerCase() ||\n item.locales?.some((locale) => locale.toLowerCase() === detectedLocale)\n ) {\n return item\n }\n }\n}\n","/**\n * Removes the trailing slash for a given route or page path. Preserves the\n * root page. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n * - `/` -> `/`\n */\nexport function removeTrailingSlash(route: string) {\n return route.replace(/\\/$/, '') || '/'\n}\n","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */\nexport function parsePath(path: string) {\n const hashIndex = path.indexOf('#')\n const queryIndex = path.indexOf('?')\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex)\n\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery\n ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined)\n : '',\n hash: hashIndex > -1 ? path.slice(hashIndex) : '',\n }\n }\n\n return { pathname: path, query: '', hash: '' }\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */\nexport function addPathPrefix(path: string, prefix?: string) {\n if (!path.startsWith('/') || !prefix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${prefix}${pathname}${query}${hash}`\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Similarly to `addPathPrefix`, this function adds a suffix at the end on the\n * provided path. It also works only for paths ensuring the argument starts\n * with a slash.\n */\nexport function addPathSuffix(path: string, suffix?: string) {\n if (!path.startsWith('/') || !suffix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${pathname}${suffix}${query}${hash}`\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */\nexport function pathHasPrefix(path: string, prefix: string) {\n if (typeof path !== 'string') {\n return false\n }\n\n const { pathname } = parsePath(path)\n return pathname === prefix || pathname.startsWith(prefix + '/')\n}\n","import { addPathPrefix } from './add-path-prefix'\nimport { pathHasPrefix } from './path-has-prefix'\n\n/**\n * For a given path and a locale, if the locale is given, it will prefix the\n * locale. The path shouldn't be an API path. If a default locale is given the\n * prefix will be omitted if the locale is already the default locale.\n */\nexport function addLocale(\n path: string,\n locale?: string | false,\n defaultLocale?: string,\n ignorePrefix?: boolean\n) {\n // If no locale was given or the locale is the default locale, we don't need\n // to prefix the path.\n if (!locale || locale === defaultLocale) return path\n\n const lower = path.toLowerCase()\n\n // If the path is an API path or the path already has the locale prefix, we\n // don't need to prefix the path.\n if (!ignorePrefix) {\n if (pathHasPrefix(lower, '/api')) return path\n if (pathHasPrefix(lower, `/${locale.toLowerCase()}`)) return path\n }\n\n // Add the locale prefix to the path.\n return addPathPrefix(path, `/${locale}`)\n}\n","import type { NextPathnameInfo } from './get-next-pathname-info'\nimport { removeTrailingSlash } from './remove-trailing-slash'\nimport { addPathPrefix } from './add-path-prefix'\nimport { addPathSuffix } from './add-path-suffix'\nimport { addLocale } from './add-locale'\n\ninterface ExtendedInfo extends NextPathnameInfo {\n defaultLocale?: string\n ignorePrefix?: boolean\n}\n\nexport function formatNextPathnameInfo(info: ExtendedInfo) {\n let pathname = addLocale(\n info.pathname,\n info.locale,\n info.buildId ? undefined : info.defaultLocale,\n info.ignorePrefix\n )\n\n if (info.buildId || !info.trailingSlash) {\n pathname = removeTrailingSlash(pathname)\n }\n\n if (info.buildId) {\n pathname = addPathSuffix(\n addPathPrefix(pathname, `/_next/data/${info.buildId}`),\n info.pathname === '/' ? 'index.json' : '.json'\n )\n }\n\n pathname = addPathPrefix(pathname, info.basePath)\n return !info.buildId && info.trailingSlash\n ? !pathname.endsWith('/')\n ? addPathSuffix(pathname, '/')\n : pathname\n : removeTrailingSlash(pathname)\n}\n","import type { OutgoingHttpHeaders } from 'http'\n\n/**\n * Takes an object with a hostname property (like a parsed URL) and some\n * headers that may contain Host and returns the preferred hostname.\n * @param parsed An object containing a hostname property.\n * @param headers A dictionary with headers containing a `host`.\n */\nexport function getHostname(\n parsed: { hostname?: string | null },\n headers?: OutgoingHttpHeaders\n): string | undefined {\n // Get the hostname from the headers if it exists, otherwise use the parsed\n // hostname.\n let hostname: string\n if (headers?.host && !Array.isArray(headers.host)) {\n hostname = headers.host.toString().split(':', 1)[0]\n } else if (parsed.hostname) {\n hostname = parsed.hostname\n } else return\n\n return hostname.toLowerCase()\n}\n","export interface PathLocale {\n detectedLocale?: string\n pathname: string\n}\n\n/**\n * A cache of lowercased locales for each list of locales. This is stored as a\n * WeakMap so if the locales are garbage collected, the cache entry will be\n * removed as well.\n */\nconst cache = new WeakMap<readonly string[], readonly string[]>()\n\n/**\n * For a pathname that may include a locale from a list of locales, it\n * removes the locale from the pathname returning it alongside with the\n * detected locale.\n *\n * @param pathname A pathname that may include a locale.\n * @param locales A list of locales.\n * @returns The detected locale and pathname without locale\n */\nexport function normalizeLocalePath(\n pathname: string,\n locales?: readonly string[]\n): PathLocale {\n // If locales is undefined, return the pathname as is.\n if (!locales) return { pathname }\n\n // Get the cached lowercased locales or create a new cache entry.\n let lowercasedLocales = cache.get(locales)\n if (!lowercasedLocales) {\n lowercasedLocales = locales.map((locale) => locale.toLowerCase())\n cache.set(locales, lowercasedLocales)\n }\n\n let detectedLocale: string | undefined\n\n // The first segment will be empty, because it has a leading `/`. If\n // there is no further segment, there is no locale (or it's the default).\n const segments = pathname.split('/', 2)\n\n // If there's no second segment (ie, the pathname is just `/`), there's no\n // locale.\n if (!segments[1]) return { pathname }\n\n // The second segment will contain the locale part if any.\n const segment = segments[1].toLowerCase()\n\n // See if the segment matches one of the locales. If it doesn't, there is\n // no locale (or it's the default).\n const index = lowercasedLocales.indexOf(segment)\n if (index < 0) return { pathname }\n\n // Return the case-sensitive locale.\n detectedLocale = locales[index]\n\n // Remove the `/${locale}` part of the pathname.\n pathname = pathname.slice(detectedLocale.length + 1) || '/'\n\n return { pathname, detectedLocale }\n}\n","import { pathHasPrefix } from './path-has-prefix'\n\n/**\n * Given a path and a prefix it will remove the prefix when it exists in the\n * given path. It ensures it matches exactly without containing extra chars\n * and if the prefix is not there it will be noop.\n *\n * @param path The path to remove the prefix from.\n * @param prefix The prefix to be removed.\n */\nexport function removePathPrefix(path: string, prefix: string): string {\n // If the path doesn't start with the prefix we can return it as is. This\n // protects us from situations where the prefix is a substring of the path\n // prefix such as:\n //\n // For prefix: /blog\n //\n // /blog -> true\n // /blog/ -> true\n // /blog/1 -> true\n // /blogging -> false\n // /blogging/ -> false\n // /blogging/1 -> false\n if (!pathHasPrefix(path, prefix)) {\n return path\n }\n\n // Remove the prefix from the path via slicing.\n const withoutPrefix = path.slice(prefix.length)\n\n // If the path without the prefix starts with a `/` we can return it as is.\n if (withoutPrefix.startsWith('/')) {\n return withoutPrefix\n }\n\n // If the path without the prefix doesn't start with a `/` we need to add it\n // back to the path to make sure it's a valid path.\n return `/${withoutPrefix}`\n}\n","import { normalizeLocalePath } from '../../i18n/normalize-locale-path'\nimport { removePathPrefix } from './remove-path-prefix'\nimport { pathHasPrefix } from './path-has-prefix'\nimport type { I18NProvider } from '../../../../server/lib/i18n-provider'\n\nexport interface NextPathnameInfo {\n /**\n * The base path in case the pathname included it.\n */\n basePath?: string\n /**\n * The buildId for when the parsed URL is a data URL. Parsing it can be\n * disabled with the `parseData` option.\n */\n buildId?: string\n /**\n * If there was a locale in the pathname, this will hold its value.\n */\n locale?: string\n /**\n * The processed pathname without a base path, locale, or data URL elements\n * when parsing it is enabled.\n */\n pathname: string\n /**\n * A boolean telling if the pathname had a trailingSlash. This can be only\n * true if trailingSlash is enabled.\n */\n trailingSlash?: boolean\n}\n\ninterface Options {\n /**\n * When passed to true, this function will also parse Nextjs data URLs.\n */\n parseData?: boolean\n /**\n * A partial of the Next.js configuration to parse the URL.\n */\n nextConfig?: {\n basePath?: string\n i18n?: { locales?: readonly string[] } | null\n trailingSlash?: boolean\n }\n\n /**\n * If provided, this normalizer will be used to detect the locale instead of\n * the default locale detection.\n */\n i18nProvider?: I18NProvider\n}\n\nexport function getNextPathnameInfo(\n pathname: string,\n options: Options\n): NextPathnameInfo {\n const { basePath, i18n, trailingSlash } = options.nextConfig ?? {}\n const info: NextPathnameInfo = {\n pathname,\n trailingSlash: pathname !== '/' ? pathname.endsWith('/') : trailingSlash,\n }\n\n if (basePath && pathHasPrefix(info.pathname, basePath)) {\n info.pathname = removePathPrefix(info.pathname, basePath)\n info.basePath = basePath\n }\n let pathnameNoDataPrefix = info.pathname\n\n if (\n info.pathname.startsWith('/_next/data/') &&\n info.pathname.endsWith('.json')\n ) {\n const paths = info.pathname\n .replace(/^\\/_next\\/data\\//, '')\n .replace(/\\.json$/, '')\n .split('/')\n\n const buildId = paths[0]\n info.buildId = buildId\n pathnameNoDataPrefix =\n paths[1] !== 'index' ? `/${paths.slice(1).join('/')}` : '/'\n\n // update pathname with normalized if enabled although\n // we use normalized to populate locale info still\n if (options.parseData === true) {\n info.pathname = pathnameNoDataPrefix\n }\n }\n\n // If provided, use the locale route normalizer to detect the locale instead\n // of the function below.\n if (i18n) {\n let result = options.i18nProvider\n ? options.i18nProvider.analyze(info.pathname)\n : normalizeLocalePath(info.pathname, i18n.locales)\n\n info.locale = result.detectedLocale\n info.pathname = result.pathname ?? info.pathname\n\n if (!result.detectedLocale && info.buildId) {\n result = options.i18nProvider\n ? options.i18nProvider.analyze(pathnameNoDataPrefix)\n : normalizeLocalePath(pathnameNoDataPrefix, i18n.locales)\n\n if (result.detectedLocale) {\n info.locale = result.detectedLocale\n }\n }\n }\n return info\n}\n","import { detectDomainLocale } from '../../shared/lib/i18n/detect-domain-locale';\nimport { formatNextPathnameInfo } from '../../shared/lib/router/utils/format-next-pathname-info';\nimport { getHostname } from '../../shared/lib/get-hostname';\nimport { getNextPathnameInfo } from '../../shared/lib/router/utils/get-next-pathname-info';\nconst REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\\/\\/)(127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\\[::1\\]|localhost)/;\nfunction parseURL(url, base) {\n return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, 'localhost'), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, 'localhost'));\n}\nconst Internal = Symbol('NextURLInternal');\nexport class NextURL {\n constructor(input, baseOrOpts, opts){\n let base;\n let options;\n if (typeof baseOrOpts === 'object' && 'pathname' in baseOrOpts || typeof baseOrOpts === 'string') {\n base = baseOrOpts;\n options = opts || {};\n } else {\n options = opts || baseOrOpts || {};\n }\n this[Internal] = {\n url: parseURL(input, base ?? options.base),\n options: options,\n basePath: ''\n };\n this.analyze();\n }\n analyze() {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;\n const info = getNextPathnameInfo(this[Internal].url.pathname, {\n nextConfig: this[Internal].options.nextConfig,\n parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,\n i18nProvider: this[Internal].options.i18nProvider\n });\n const hostname = getHostname(this[Internal].url, this[Internal].options.headers);\n this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : detectDomainLocale((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname);\n const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);\n this[Internal].url.pathname = info.pathname;\n this[Internal].defaultLocale = defaultLocale;\n this[Internal].basePath = info.basePath ?? '';\n this[Internal].buildId = info.buildId;\n this[Internal].locale = info.locale ?? defaultLocale;\n this[Internal].trailingSlash = info.trailingSlash;\n }\n formatPathname() {\n return formatNextPathnameInfo({\n basePath: this[Internal].basePath,\n buildId: this[Internal].buildId,\n defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : undefined,\n locale: this[Internal].locale,\n pathname: this[Internal].url.pathname,\n trailingSlash: this[Internal].trailingSlash\n });\n }\n formatSearch() {\n return this[Internal].url.search;\n }\n get buildId() {\n return this[Internal].buildId;\n }\n set buildId(buildId) {\n this[Internal].buildId = buildId;\n }\n get locale() {\n return this[Internal].locale ?? '';\n }\n set locale(locale) {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;\n if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) {\n throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale \"${locale}\"`), \"__NEXT_ERROR_CODE\", {\n value: \"E597\",\n enumerable: false,\n configurable: true\n });\n }\n this[Internal].locale = locale;\n }\n get defaultLocale() {\n return this[Internal].defaultLocale;\n }\n get domainLocale() {\n return this[Internal].domainLocale;\n }\n get searchParams() {\n return this[Internal].url.searchParams;\n }\n get host() {\n return this[Internal].url.host;\n }\n set host(value) {\n this[Internal].url.host = value;\n }\n get hostname() {\n return this[Internal].url.hostname;\n }\n set hostname(value) {\n this[Internal].url.hostname = value;\n }\n get port() {\n return this[Internal].url.port;\n }\n set port(value) {\n this[Internal].url.port = value;\n }\n get protocol() {\n return this[Internal].url.protocol;\n }\n set protocol(value) {\n this[Internal].url.protocol = value;\n }\n get href() {\n const pathname = this.formatPathname();\n const search = this.formatSearch();\n return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`;\n }\n set href(url) {\n this[Internal].url = parseURL(url);\n this.analyze();\n }\n get origin() {\n return this[Internal].url.origin;\n }\n get pathname() {\n return this[Internal].url.pathname;\n }\n set pathname(value) {\n this[Internal].url.pathname = value;\n }\n get hash() {\n return this[Internal].url.hash;\n }\n set hash(value) {\n this[Internal].url.hash = value;\n }\n get search() {\n return this[Internal].url.search;\n }\n set search(value) {\n this[Internal].url.search = value;\n }\n get password() {\n return this[Internal].url.password;\n }\n set password(value) {\n this[Internal].url.password = value;\n }\n get username() {\n return this[Internal].url.username;\n }\n set username(value) {\n this[Internal].url.username = value;\n }\n get basePath() {\n return this[Internal].basePath;\n }\n set basePath(value) {\n this[Internal].basePath = value.startsWith('/') ? value : `/${value}`;\n }\n toString() {\n return this.href;\n }\n toJSON() {\n return this.href;\n }\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n href: this.href,\n origin: this.origin,\n protocol: this.protocol,\n username: this.username,\n password: this.password,\n host: this.host,\n hostname: this.hostname,\n port: this.port,\n pathname: this.pathname,\n search: this.search,\n searchParams: this.searchParams,\n hash: this.hash\n };\n }\n clone() {\n return new NextURL(String(this), this[Internal].options);\n }\n}\n\n//# sourceMappingURL=next-url.js.map","export { RequestCookies, ResponseCookies, stringifyCookie } from 'next/dist/compiled/@edge-runtime/cookies';\n\n//# sourceMappingURL=cookies.js.map","import { NextURL } from '../next-url';\nimport { toNodeOutgoingHttpHeaders, validateURL } from '../utils';\nimport { RemovedUAError, RemovedPageError } from '../error';\nimport { RequestCookies } from './cookies';\nexport const INTERNALS = Symbol('internal request');\n/**\n * This class extends the [Web `Request` API](https://developer.mozilla.org/docs/Web/API/Request) with additional convenience methods.\n *\n * Read more: [Next.js Docs: `NextRequest`](https://nextjs.org/docs/app/api-reference/functions/next-request)\n */ export class NextRequest extends Request {\n constructor(input, init = {}){\n const url = typeof input !== 'string' && 'url' in input ? input.url : String(input);\n validateURL(url);\n // node Request instance requires duplex option when a body\n // is present or it errors, we don't handle this for\n // Request being passed in since it would have already\n // errored if this wasn't configured\n if (process.env.NEXT_RUNTIME !== 'edge') {\n if (init.body && init.duplex !== 'half') {\n init.duplex = 'half';\n }\n }\n if (input instanceof Request) super(input, init);\n else super(url, init);\n const nextUrl = new NextURL(url, {\n headers: toNodeOutgoingHttpHeaders(this.headers),\n nextConfig: init.nextConfig\n });\n this[INTERNALS] = {\n cookies: new RequestCookies(this.headers),\n nextUrl,\n url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? url : nextUrl.toString()\n };\n }\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n cookies: this.cookies,\n nextUrl: this.nextUrl,\n url: this.url,\n // rest of props come from Request\n bodyUsed: this.bodyUsed,\n cache: this.cache,\n credentials: this.credentials,\n destination: this.destination,\n headers: Object.fromEntries(this.headers),\n integrity: this.integrity,\n keepalive: this.keepalive,\n method: this.method,\n mode: this.mode,\n redirect: this.redirect,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n signal: this.signal\n };\n }\n get cookies() {\n return this[INTERNALS].cookies;\n }\n get nextUrl() {\n return this[INTERNALS].nextUrl;\n }\n /**\n * @deprecated\n * `page` has been deprecated in favour of `URLPattern`.\n * Read more: https://nextjs.org/docs/messages/middleware-request-page\n */ get page() {\n throw new RemovedPageError();\n }\n /**\n * @deprecated\n * `ua` has been removed in favour of \\`userAgent\\` function.\n * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n */ get ua() {\n throw new RemovedUAError();\n }\n get url() {\n return this[INTERNALS].url;\n }\n}\n\n//# sourceMappingURL=request.js.map","export class ReflectAdapter {\n static get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n }\n static set(target, prop, value, receiver) {\n return Reflect.set(target, prop, value, receiver);\n }\n static has(target, prop) {\n return Reflect.has(target, prop);\n }\n static deleteProperty(target, prop) {\n return Reflect.deleteProperty(target, prop);\n }\n}\n\n//# sourceMappingURL=reflect.js.map","import { stringifyCookie } from '../../web/spec-extension/cookies';\nimport { NextURL } from '../next-url';\nimport { toNodeOutgoingHttpHeaders, validateURL } from '../utils';\nimport { ReflectAdapter } from './adapters/reflect';\nimport { ResponseCookies } from './cookies';\nconst INTERNALS = Symbol('internal response');\nconst REDIRECTS = new Set([\n 301,\n 302,\n 303,\n 307,\n 308\n]);\nfunction handleMiddlewareField(init, headers) {\n var _init_request;\n if (init == null ? void 0 : (_init_request = init.request) == null ? void 0 : _init_request.headers) {\n if (!(init.request.headers instanceof Headers)) {\n throw Object.defineProperty(new Error('request.headers must be an instance of Headers'), \"__NEXT_ERROR_CODE\", {\n value: \"E119\",\n enumerable: false,\n configurable: true\n });\n }\n const keys = [];\n for (const [key, value] of init.request.headers){\n headers.set('x-middleware-request-' + key, value);\n keys.push(key);\n }\n headers.set('x-middleware-override-headers', keys.join(','));\n }\n}\n/**\n * This class extends the [Web `Response` API](https://developer.mozilla.org/docs/Web/API/Response) with additional convenience methods.\n *\n * Read more: [Next.js Docs: `NextResponse`](https://nextjs.org/docs/app/api-reference/functions/next-response)\n */ export class NextResponse extends Response {\n constructor(body, init = {}){\n super(body, init);\n const headers = this.headers;\n const cookies = new ResponseCookies(headers);\n const cookiesProxy = new Proxy(cookies, {\n get (target, prop, receiver) {\n switch(prop){\n case 'delete':\n case 'set':\n {\n return (...args)=>{\n const result = Reflect.apply(target[prop], target, args);\n const newHeaders = new Headers(headers);\n if (result instanceof ResponseCookies) {\n headers.set('x-middleware-set-cookie', result.getAll().map((cookie)=>stringifyCookie(cookie)).join(','));\n }\n handleMiddlewareField(init, newHeaders);\n return result;\n };\n }\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n this[INTERNALS] = {\n cookies: cookiesProxy,\n url: init.url ? new NextURL(init.url, {\n headers: toNodeOutgoingHttpHeaders(headers),\n nextConfig: init.nextConfig\n }) : undefined\n };\n }\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n cookies: this.cookies,\n url: this.url,\n // rest of props come from Response\n body: this.body,\n bodyUsed: this.bodyUsed,\n headers: Object.fromEntries(this.headers),\n ok: this.ok,\n redirected: this.redirected,\n status: this.status,\n statusText: this.statusText,\n type: this.type\n };\n }\n get cookies() {\n return this[INTERNALS].cookies;\n }\n static json(body, init) {\n const response = Response.json(body, init);\n return new NextResponse(response.body, response);\n }\n static redirect(url, init) {\n const status = typeof init === 'number' ? init : (init == null ? void 0 : init.status) ?? 307;\n if (!REDIRECTS.has(status)) {\n throw Object.defineProperty(new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code'), \"__NEXT_ERROR_CODE\", {\n value: \"E529\",\n enumerable: false,\n configurable: true\n });\n }\n const initObj = typeof init === 'object' ? init : {};\n const headers = new Headers(initObj == null ? void 0 : initObj.headers);\n headers.set('Location', validateURL(url));\n return new NextResponse(null, {\n ...initObj,\n headers,\n status\n });\n }\n static rewrite(destination, init) {\n const headers = new Headers(init == null ? void 0 : init.headers);\n headers.set('x-middleware-rewrite', validateURL(destination));\n handleMiddlewareField(init, headers);\n return new NextResponse(null, {\n ...init,\n headers\n });\n }\n static next(init) {\n const headers = new Headers(init == null ? void 0 : init.headers);\n headers.set('x-middleware-next', '1');\n handleMiddlewareField(init, headers);\n return new NextResponse(null, {\n ...init,\n headers\n });\n }\n}\n\n//# sourceMappingURL=response.js.map","/**\n * The result of parsing a URL relative to a base URL.\n */\nexport type RelativeURL = {\n /**\n * The relative URL. Either a URL including the origin or a relative URL.\n */\n url: string\n\n /**\n * Whether the URL is relative to the base URL.\n */\n isRelative: boolean\n}\n\nexport function parseRelativeURL(\n url: string | URL,\n base: string | URL\n): RelativeURL {\n const baseURL = typeof base === 'string' ? new URL(base) : base\n const relative = new URL(url, base)\n\n // The URL is relative if the origin is the same as the base URL.\n const isRelative = relative.origin === baseURL.origin\n\n return {\n url: isRelative\n ? relative.toString().slice(baseURL.origin.length)\n : relative.toString(),\n isRelative,\n }\n}\n\n/**\n * Given a URL as a string and a base URL it will make the URL relative\n * if the parsed protocol and host is the same as the one in the base\n * URL. Otherwise it returns the same URL string.\n */\nexport function getRelativeURL(url: string | URL, base: string | URL): string {\n const relative = parseRelativeURL(url, base)\n return relative.url\n}\n","export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\n","import { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers';\nconst INTERNAL_QUERY_NAMES = [\n NEXT_RSC_UNION_QUERY\n];\nexport function stripInternalQueries(query) {\n for (const name of INTERNAL_QUERY_NAMES){\n delete query[name];\n }\n}\nexport function stripInternalSearchParams(url) {\n const isStringUrl = typeof url === 'string';\n const instance = isStringUrl ? new URL(url) : url;\n instance.searchParams.delete(NEXT_RSC_UNION_QUERY);\n return isStringUrl ? instance.toString() : instance;\n}\n\n//# sourceMappingURL=internal-utils.js.map","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */\nexport function ensureLeadingSlash(path: string) {\n return path.startsWith('/') ? path : `/${path}`\n}\n","import type { Segment } from '../../server/app-render/types'\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function isParallelRouteSegment(segment: string) {\n return segment.startsWith('@') && segment !== '@children'\n}\n\nexport function addSearchParamsIfPageSegment(\n segment: Segment,\n searchParams: Record<string, string | string[] | undefined>\n) {\n const isPageSegment = segment.includes(PAGE_SEGMENT_KEY)\n\n if (isPageSegment) {\n const stringifiedQuery = JSON.stringify(searchParams)\n return stringifiedQuery !== '{}'\n ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery\n : PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\n","import { ensureLeadingSlash } from '../../page-path/ensure-leading-slash'\nimport { isGroupSegment } from '../../segment'\n\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */\nexport function normalizeAppPath(route: string) {\n return ensureLeadingSlash(\n route.split('/').reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname\n }\n\n // Parallel segments are ignored.\n if (segment[0] === '@') {\n return pathname\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === 'page' || segment === 'route') &&\n index === segments.length - 1\n ) {\n return pathname\n }\n\n return `${pathname}/${segment}`\n }, '')\n )\n}\n\n/** Select the last direct entry, matching Next 15's sorted appPaths at runtime. */\nexport function selectAppPageEntry(\n pathname: string,\n appPaths: readonly string[],\n normalizePathname: (appPath: string) => string = (appPath) =>\n normalizeAppPath(appPath).replace(/%5F/g, '_')\n): string {\n let entry: string | undefined\n for (const appPath of appPaths) {\n if (normalizePathname(appPath) !== pathname) continue\n if (entry === undefined || entry < appPath) entry = appPath\n }\n if (entry === undefined) {\n throw new Error(`Invariant: no direct app page entry found for ${pathname}`)\n }\n return entry\n}\n\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */\nexport function normalizeRscURL(url: string) {\n return url.replace(\n /\\.rsc($|\\?)/,\n // $1 ensures `?` is preserved\n '$1'\n )\n}\n","import { ReflectAdapter } from './reflect';\n/**\n * @internal\n */ export class ReadonlyHeadersError extends Error {\n constructor(){\n super('Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers');\n }\n static callable() {\n throw new ReadonlyHeadersError();\n }\n}\nexport class HeadersAdapter extends Headers {\n constructor(headers){\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super();\n this.headers = new Proxy(headers, {\n get (target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver);\n }\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return;\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver);\n }\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop);\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false;\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original);\n },\n deleteProperty (target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.deleteProperty(target, prop);\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true;\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original);\n }\n });\n }\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */ static seal(headers) {\n return new Proxy(headers, {\n get (target, prop, receiver) {\n switch(prop){\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable;\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */ merge(value) {\n if (Array.isArray(value)) return value.join(', ');\n return value;\n }\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */ static from(headers) {\n if (headers instanceof Headers) return headers;\n return new HeadersAdapter(headers);\n }\n append(name, value) {\n const existing = this.headers[name];\n if (typeof existing === 'string') {\n this.headers[name] = [\n existing,\n value\n ];\n } else if (Array.isArray(existing)) {\n existing.push(value);\n } else {\n this.headers[name] = value;\n }\n }\n delete(name) {\n delete this.headers[name];\n }\n get(name) {\n const value = this.headers[name];\n if (typeof value !== 'undefined') return this.merge(value);\n return null;\n }\n has(name) {\n return typeof this.headers[name] !== 'undefined';\n }\n set(name, value) {\n this.headers[name] = value;\n }\n forEach(callbackfn, thisArg) {\n for (const [name, value] of this.entries()){\n callbackfn.call(thisArg, value, name, this);\n }\n }\n *entries() {\n for (const key of Object.keys(this.headers)){\n const name = key.toLowerCase();\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name);\n yield [\n name,\n value\n ];\n }\n }\n *keys() {\n for (const key of Object.keys(this.headers)){\n const name = key.toLowerCase();\n yield name;\n }\n }\n *values() {\n for (const key of Object.keys(this.headers)){\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key);\n yield value;\n }\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n}\n\n//# sourceMappingURL=headers.js.map","const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), \"__NEXT_ERROR_CODE\", {\n value: \"E504\",\n enumerable: false,\n configurable: true\n});\nclass FakeAsyncLocalStorage {\n disable() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n getStore() {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined;\n }\n run() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n exit() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n enterWith() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n static bind(fn) {\n return fn;\n }\n}\nconst maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;\nexport function createAsyncLocalStorage() {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage();\n }\n return new FakeAsyncLocalStorage();\n}\nexport function bindSnapshot(fn) {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn);\n }\n return FakeAsyncLocalStorage.bind(fn);\n}\nexport function createSnapshot() {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot();\n }\n return function(fn, ...args) {\n return fn(...args);\n };\n}\n\n//# sourceMappingURL=async-local-storage.js.map","import { createAsyncLocalStorage } from './async-local-storage';\nexport const workAsyncStorageInstance = createAsyncLocalStorage();\n\n//# sourceMappingURL=work-async-storage-instance.js.map","// Share the instance module in the next-shared layer\nimport { workAsyncStorageInstance } from './work-async-storage-instance' with {\n 'turbopack-transition': 'next-shared'\n};\nexport { workAsyncStorageInstance as workAsyncStorage };\n\n//# sourceMappingURL=work-async-storage.external.js.map","import { RequestCookies } from '../cookies';\nimport { ResponseCookies } from '../cookies';\nimport { ReflectAdapter } from './reflect';\nimport { workAsyncStorage } from '../../../app-render/work-async-storage.external';\n/**\n * @internal\n */ export class ReadonlyRequestCookiesError extends Error {\n constructor(){\n super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options');\n }\n static callable() {\n throw new ReadonlyRequestCookiesError();\n }\n}\nexport class RequestCookiesAdapter {\n static seal(cookies) {\n return new Proxy(cookies, {\n get (target, prop, receiver) {\n switch(prop){\n case 'clear':\n case 'delete':\n case 'set':\n return ReadonlyRequestCookiesError.callable;\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n}\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies');\nexport function getModifiedCookieValues(cookies) {\n const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES];\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return [];\n }\n return modified;\n}\nexport function appendMutableCookies(headers, mutableCookies) {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies);\n if (modifiedCookieValues.length === 0) {\n return false;\n }\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers);\n const returnedCookies = resCookies.getAll();\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues){\n resCookies.set(cookie);\n }\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies){\n resCookies.set(cookie);\n }\n return true;\n}\nexport class MutableRequestCookiesAdapter {\n static wrap(cookies, onUpdateCookies) {\n const responseCookies = new ResponseCookies(new Headers());\n for (const cookie of cookies.getAll()){\n responseCookies.set(cookie);\n }\n let modifiedValues = [];\n const modifiedCookies = new Set();\n const updateResponseCookies = ()=>{\n // TODO-APP: change method of getting workStore\n const workStore = workAsyncStorage.getStore();\n if (workStore) {\n workStore.pathWasRevalidated = true;\n }\n const allCookies = responseCookies.getAll();\n modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name));\n if (onUpdateCookies) {\n const serializedCookies = [];\n for (const cookie of modifiedValues){\n const tempCookies = new ResponseCookies(new Headers());\n tempCookies.set(cookie);\n serializedCookies.push(tempCookies.toString());\n }\n onUpdateCookies(serializedCookies);\n }\n };\n const wrappedCookies = new Proxy(responseCookies, {\n get (target, prop, receiver) {\n switch(prop){\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues;\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case 'delete':\n return function(...args) {\n modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name);\n try {\n target.delete(...args);\n return wrappedCookies;\n } finally{\n updateResponseCookies();\n }\n };\n case 'set':\n return function(...args) {\n modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name);\n try {\n target.set(...args);\n return wrappedCookies;\n } finally{\n updateResponseCookies();\n }\n };\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n return wrappedCookies;\n }\n}\nexport function createCookiesWithMutableAccessCheck(requestStore) {\n const wrappedCookies = new Proxy(requestStore.mutableCookies, {\n get (target, prop, receiver) {\n switch(prop){\n case 'delete':\n return function(...args) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().delete');\n target.delete(...args);\n return wrappedCookies;\n };\n case 'set':\n return function(...args) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().set');\n target.set(...args);\n return wrappedCookies;\n };\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n return wrappedCookies;\n}\nexport function areCookiesMutableInCurrentPhase(requestStore) {\n return requestStore.phase === 'action';\n}\n/** Ensure that cookies() starts throwing on mutation\n * if we changed phases and can no longer mutate.\n *\n * This can happen when going:\n * 'render' -> 'after'\n * 'action' -> 'render'\n * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) {\n if (!areCookiesMutableInCurrentPhase(requestStore)) {\n // TODO: maybe we can give a more precise error message based on callingExpression?\n throw new ReadonlyRequestCookiesError();\n }\n}\nexport function responseCookiesToRequestCookies(responseCookies) {\n const requestCookies = new RequestCookies(new Headers());\n for (const cookie of responseCookies.getAll()){\n requestCookies.set(cookie);\n }\n return requestCookies;\n}\n\n//# sourceMappingURL=request-cookies.js.map","/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/ // eslint typescript has a bug with TS enums\n/* eslint-disable no-shadow */ var BaseServerSpan = /*#__PURE__*/ function(BaseServerSpan) {\n BaseServerSpan[\"handleRequest\"] = \"BaseServer.handleRequest\";\n BaseServerSpan[\"run\"] = \"BaseServer.run\";\n BaseServerSpan[\"pipe\"] = \"BaseServer.pipe\";\n BaseServerSpan[\"getStaticHTML\"] = \"BaseServer.getStaticHTML\";\n BaseServerSpan[\"render\"] = \"BaseServer.render\";\n BaseServerSpan[\"renderToResponseWithComponents\"] = \"BaseServer.renderToResponseWithComponents\";\n BaseServerSpan[\"renderToResponse\"] = \"BaseServer.renderToResponse\";\n BaseServerSpan[\"renderToHTML\"] = \"BaseServer.renderToHTML\";\n BaseServerSpan[\"renderError\"] = \"BaseServer.renderError\";\n BaseServerSpan[\"renderErrorToResponse\"] = \"BaseServer.renderErrorToResponse\";\n BaseServerSpan[\"renderErrorToHTML\"] = \"BaseServer.renderErrorToHTML\";\n BaseServerSpan[\"render404\"] = \"BaseServer.render404\";\n return BaseServerSpan;\n}(BaseServerSpan || {});\nvar LoadComponentsSpan = /*#__PURE__*/ function(LoadComponentsSpan) {\n LoadComponentsSpan[\"loadDefaultErrorComponents\"] = \"LoadComponents.loadDefaultErrorComponents\";\n LoadComponentsSpan[\"loadComponents\"] = \"LoadComponents.loadComponents\";\n return LoadComponentsSpan;\n}(LoadComponentsSpan || {});\nvar NextServerSpan = /*#__PURE__*/ function(NextServerSpan) {\n NextServerSpan[\"getRequestHandler\"] = \"NextServer.getRequestHandler\";\n NextServerSpan[\"getServer\"] = \"NextServer.getServer\";\n NextServerSpan[\"getServerRequestHandler\"] = \"NextServer.getServerRequestHandler\";\n NextServerSpan[\"createServer\"] = \"createServer.createServer\";\n return NextServerSpan;\n}(NextServerSpan || {});\nvar NextNodeServerSpan = /*#__PURE__*/ function(NextNodeServerSpan) {\n NextNodeServerSpan[\"compression\"] = \"NextNodeServer.compression\";\n NextNodeServerSpan[\"getBuildId\"] = \"NextNodeServer.getBuildId\";\n NextNodeServerSpan[\"createComponentTree\"] = \"NextNodeServer.createComponentTree\";\n NextNodeServerSpan[\"clientComponentLoading\"] = \"NextNodeServer.clientComponentLoading\";\n NextNodeServerSpan[\"getLayoutOrPageModule\"] = \"NextNodeServer.getLayoutOrPageModule\";\n NextNodeServerSpan[\"generateStaticRoutes\"] = \"NextNodeServer.generateStaticRoutes\";\n NextNodeServerSpan[\"generateFsStaticRoutes\"] = \"NextNodeServer.generateFsStaticRoutes\";\n NextNodeServerSpan[\"generatePublicRoutes\"] = \"NextNodeServer.generatePublicRoutes\";\n NextNodeServerSpan[\"generateImageRoutes\"] = \"NextNodeServer.generateImageRoutes.route\";\n NextNodeServerSpan[\"sendRenderResult\"] = \"NextNodeServer.sendRenderResult\";\n NextNodeServerSpan[\"proxyRequest\"] = \"NextNodeServer.proxyRequest\";\n NextNodeServerSpan[\"runApi\"] = \"NextNodeServer.runApi\";\n NextNodeServerSpan[\"render\"] = \"NextNodeServer.render\";\n NextNodeServerSpan[\"renderHTML\"] = \"NextNodeServer.renderHTML\";\n NextNodeServerSpan[\"imageOptimizer\"] = \"NextNodeServer.imageOptimizer\";\n NextNodeServerSpan[\"getPagePath\"] = \"NextNodeServer.getPagePath\";\n NextNodeServerSpan[\"getRoutesManifest\"] = \"NextNodeServer.getRoutesManifest\";\n NextNodeServerSpan[\"findPageComponents\"] = \"NextNodeServer.findPageComponents\";\n NextNodeServerSpan[\"getFontManifest\"] = \"NextNodeServer.getFontManifest\";\n NextNodeServerSpan[\"getServerComponentManifest\"] = \"NextNodeServer.getServerComponentManifest\";\n NextNodeServerSpan[\"getRequestHandler\"] = \"NextNodeServer.getRequestHandler\";\n NextNodeServerSpan[\"renderToHTML\"] = \"NextNodeServer.renderToHTML\";\n NextNodeServerSpan[\"renderError\"] = \"NextNodeServer.renderError\";\n NextNodeServerSpan[\"renderErrorToHTML\"] = \"NextNodeServer.renderErrorToHTML\";\n NextNodeServerSpan[\"render404\"] = \"NextNodeServer.render404\";\n NextNodeServerSpan[\"startResponse\"] = \"NextNodeServer.startResponse\";\n // nested inner span, does not require parent scope name\n NextNodeServerSpan[\"route\"] = \"route\";\n NextNodeServerSpan[\"onProxyReq\"] = \"onProxyReq\";\n NextNodeServerSpan[\"apiResolver\"] = \"apiResolver\";\n NextNodeServerSpan[\"internalFetch\"] = \"internalFetch\";\n return NextNodeServerSpan;\n}(NextNodeServerSpan || {});\nvar StartServerSpan = /*#__PURE__*/ function(StartServerSpan) {\n StartServerSpan[\"startServer\"] = \"startServer.startServer\";\n return StartServerSpan;\n}(StartServerSpan || {});\nvar RenderSpan = /*#__PURE__*/ function(RenderSpan) {\n RenderSpan[\"getServerSideProps\"] = \"Render.getServerSideProps\";\n RenderSpan[\"getStaticProps\"] = \"Render.getStaticProps\";\n RenderSpan[\"renderToString\"] = \"Render.renderToString\";\n RenderSpan[\"renderDocument\"] = \"Render.renderDocument\";\n RenderSpan[\"createBodyResult\"] = \"Render.createBodyResult\";\n return RenderSpan;\n}(RenderSpan || {});\nvar AppRenderSpan = /*#__PURE__*/ function(AppRenderSpan) {\n AppRenderSpan[\"renderToString\"] = \"AppRender.renderToString\";\n AppRenderSpan[\"renderToReadableStream\"] = \"AppRender.renderToReadableStream\";\n AppRenderSpan[\"getBodyResult\"] = \"AppRender.getBodyResult\";\n AppRenderSpan[\"fetch\"] = \"AppRender.fetch\";\n return AppRenderSpan;\n}(AppRenderSpan || {});\nvar RouterSpan = /*#__PURE__*/ function(RouterSpan) {\n RouterSpan[\"executeRoute\"] = \"Router.executeRoute\";\n return RouterSpan;\n}(RouterSpan || {});\nvar NodeSpan = /*#__PURE__*/ function(NodeSpan) {\n NodeSpan[\"runHandler\"] = \"Node.runHandler\";\n return NodeSpan;\n}(NodeSpan || {});\nvar AppRouteRouteHandlersSpan = /*#__PURE__*/ function(AppRouteRouteHandlersSpan) {\n AppRouteRouteHandlersSpan[\"runHandler\"] = \"AppRouteRouteHandlers.runHandler\";\n return AppRouteRouteHandlersSpan;\n}(AppRouteRouteHandlersSpan || {});\nvar ResolveMetadataSpan = /*#__PURE__*/ function(ResolveMetadataSpan) {\n ResolveMetadataSpan[\"generateMetadata\"] = \"ResolveMetadata.generateMetadata\";\n ResolveMetadataSpan[\"generateViewport\"] = \"ResolveMetadata.generateViewport\";\n return ResolveMetadataSpan;\n}(ResolveMetadataSpan || {});\nvar MiddlewareSpan = /*#__PURE__*/ function(MiddlewareSpan) {\n MiddlewareSpan[\"execute\"] = \"Middleware.execute\";\n return MiddlewareSpan;\n}(MiddlewareSpan || {});\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = new Set([\n \"Middleware.execute\",\n \"BaseServer.handleRequest\",\n \"Render.getServerSideProps\",\n \"Render.getStaticProps\",\n \"AppRender.fetch\",\n \"AppRender.getBodyResult\",\n \"Render.renderDocument\",\n \"Node.runHandler\",\n \"AppRouteRouteHandlers.runHandler\",\n \"ResolveMetadata.generateMetadata\",\n \"ResolveMetadata.generateViewport\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.getLayoutOrPageModule\",\n \"NextNodeServer.startResponse\",\n \"NextNodeServer.clientComponentLoading\"\n]);\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = new Set([\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.clientComponentLoading\"\n]);\nexport { BaseServerSpan, LoadComponentsSpan, NextServerSpan, NextNodeServerSpan, StartServerSpan, RenderSpan, RouterSpan, AppRenderSpan, NodeSpan, AppRouteRouteHandlersSpan, ResolveMetadataSpan, MiddlewareSpan, };\n\n//# sourceMappingURL=constants.js.map","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable<T = unknown>(\n promise: Promise<T> | T\n): promise is Promise<T> {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","import { LogSpanAllowList, NextVanillaSpanAllowlist } from './constants';\nimport { isThenable } from '../../../shared/lib/is-thenable';\nconst NEXT_OTEL_PERFORMANCE_PREFIX = process.env.NEXT_OTEL_PERFORMANCE_PREFIX;\nlet api;\n// we want to allow users to use their own version of @opentelemetry/api if they\n// want to, so we try to require it first, and if it fails we fall back to the\n// version that is bundled with Next.js\n// this is because @opentelemetry/api has to be synced with the version of\n// @opentelemetry/tracing that is used, and we don't want to force users to use\n// the version that is bundled with Next.js.\n// the API is ~stable, so this should be fine\nif (process.env.NEXT_RUNTIME === 'edge') {\n api = require('@opentelemetry/api');\n} else {\n try {\n api = require('@opentelemetry/api');\n } catch (err) {\n api = require('next/dist/compiled/@opentelemetry/api');\n }\n}\nconst { context, propagation, trace, SpanStatusCode, SpanKind, ROOT_CONTEXT } = api;\nexport class BubbledError extends Error {\n constructor(bubble, result){\n super(), this.bubble = bubble, this.result = result;\n }\n}\nexport function isBubbledError(error) {\n if (typeof error !== 'object' || error === null) return false;\n return error instanceof BubbledError;\n}\nconst closeSpanWithError = (span, error)=>{\n if (isBubbledError(error) && error.bubble) {\n span.setAttribute('next.bubble', true);\n } else {\n if (error) {\n span.recordException(error);\n span.setAttribute('error.type', error.name);\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error == null ? void 0 : error.message\n });\n }\n span.end();\n};\n/** we use this map to propagate attributes from nested spans to the top span */ const rootSpanAttributesStore = new Map();\nconst rootSpanIdKey = api.createContextKey('next.rootSpanId');\nlet lastSpanId = 0;\nconst getSpanId = ()=>lastSpanId++;\nconst clientTraceDataSetter = {\n set (carrier, key, value) {\n carrier.push({\n key,\n value\n });\n }\n};\nclass NextTracerImpl {\n /**\n * Returns an instance to the trace with configured name.\n * Since wrap / trace can be defined in any place prior to actual trace subscriber initialization,\n * This should be lazily evaluated.\n */ getTracerInstance() {\n return trace.getTracer('next.js', '0.0.1');\n }\n getContext() {\n return context;\n }\n getTracePropagationData() {\n const activeContext = context.active();\n const entries = [];\n propagation.inject(activeContext, entries, clientTraceDataSetter);\n return entries;\n }\n getActiveScopeSpan() {\n return trace.getSpan(context == null ? void 0 : context.active());\n }\n withPropagatedContext(carrier, fn, getter) {\n const activeContext = context.active();\n if (trace.getSpanContext(activeContext)) {\n // Active span is already set, too late to propagate.\n return fn();\n }\n const remoteContext = propagation.extract(activeContext, carrier, getter);\n return context.with(remoteContext, fn);\n }\n trace(...args) {\n var _trace_getSpanContext;\n const [type, fnOrOptions, fnOrEmpty] = args;\n // coerce options form overload\n const { fn, options } = typeof fnOrOptions === 'function' ? {\n fn: fnOrOptions,\n options: {}\n } : {\n fn: fnOrEmpty,\n options: {\n ...fnOrOptions\n }\n };\n const spanName = options.spanName ?? type;\n if (!NextVanillaSpanAllowlist.has(type) && process.env.NEXT_OTEL_VERBOSE !== '1' || options.hideSpan) {\n return fn();\n }\n // Trying to get active scoped span to assign parent. If option specifies parent span manually, will try to use it.\n let spanContext = this.getSpanContext((options == null ? void 0 : options.parentSpan) ?? this.getActiveScopeSpan());\n let isRootSpan = false;\n if (!spanContext) {\n spanContext = (context == null ? void 0 : context.active()) ?? ROOT_CONTEXT;\n isRootSpan = true;\n } else if ((_trace_getSpanContext = trace.getSpanContext(spanContext)) == null ? void 0 : _trace_getSpanContext.isRemote) {\n isRootSpan = true;\n }\n const spanId = getSpanId();\n options.attributes = {\n 'next.span_name': spanName,\n 'next.span_type': type,\n ...options.attributes\n };\n return context.with(spanContext.setValue(rootSpanIdKey, spanId), ()=>this.getTracerInstance().startActiveSpan(spanName, options, (span)=>{\n let startTime;\n if (NEXT_OTEL_PERFORMANCE_PREFIX && type && LogSpanAllowList.has(type)) {\n startTime = 'performance' in globalThis && 'measure' in performance ? globalThis.performance.now() : undefined;\n }\n let cleanedUp = false;\n const onCleanup = ()=>{\n if (cleanedUp) return;\n cleanedUp = true;\n rootSpanAttributesStore.delete(spanId);\n if (startTime) {\n performance.measure(`${NEXT_OTEL_PERFORMANCE_PREFIX}:next-${(type.split('.').pop() || '').replace(/[A-Z]/g, (match)=>'-' + match.toLowerCase())}`, {\n start: startTime,\n end: performance.now()\n });\n }\n };\n if (isRootSpan) {\n rootSpanAttributesStore.set(spanId, new Map(Object.entries(options.attributes ?? {})));\n }\n if (fn.length > 1) {\n try {\n return fn(span, (err)=>closeSpanWithError(span, err));\n } catch (err) {\n closeSpanWithError(span, err);\n throw err;\n } finally{\n onCleanup();\n }\n }\n try {\n const result = fn(span);\n if (isThenable(result)) {\n // If there's error make sure it throws\n return result.then((res)=>{\n span.end();\n // Need to pass down the promise result,\n // it could be react stream response with error { error, stream }\n return res;\n }).catch((err)=>{\n closeSpanWithError(span, err);\n throw err;\n }).finally(onCleanup);\n } else {\n span.end();\n onCleanup();\n }\n return result;\n } catch (err) {\n closeSpanWithError(span, err);\n onCleanup();\n throw err;\n }\n }));\n }\n wrap(...args) {\n const tracer = this;\n const [name, options, fn] = args.length === 3 ? args : [\n args[0],\n {},\n args[1]\n ];\n if (!NextVanillaSpanAllowlist.has(name) && process.env.NEXT_OTEL_VERBOSE !== '1') {\n return fn;\n }\n return function() {\n let optionsObj = options;\n if (typeof optionsObj === 'function' && typeof fn === 'function') {\n optionsObj = optionsObj.apply(this, arguments);\n }\n const lastArgId = arguments.length - 1;\n const cb = arguments[lastArgId];\n if (typeof cb === 'function') {\n const scopeBoundCb = tracer.getContext().bind(context.active(), cb);\n return tracer.trace(name, optionsObj, (_span, done)=>{\n arguments[lastArgId] = function(err) {\n done == null ? void 0 : done(err);\n return scopeBoundCb.apply(this, arguments);\n };\n return fn.apply(this, arguments);\n });\n } else {\n return tracer.trace(name, optionsObj, ()=>fn.apply(this, arguments));\n }\n };\n }\n startSpan(...args) {\n const [type, options] = args;\n const spanContext = this.getSpanContext((options == null ? void 0 : options.parentSpan) ?? this.getActiveScopeSpan());\n return this.getTracerInstance().startSpan(type, options, spanContext);\n }\n getSpanContext(parentSpan) {\n const spanContext = parentSpan ? trace.setSpan(context.active(), parentSpan) : undefined;\n return spanContext;\n }\n getRootSpanAttributes() {\n const spanId = context.active().getValue(rootSpanIdKey);\n return rootSpanAttributesStore.get(spanId);\n }\n setRootSpanAttribute(key, value) {\n const spanId = context.active().getValue(rootSpanIdKey);\n const attributes = rootSpanAttributesStore.get(spanId);\n if (attributes) {\n attributes.set(key, value);\n }\n }\n}\nconst getTracer = (()=>{\n const tracer = new NextTracerImpl();\n return ()=>tracer;\n})();\nexport { getTracer, SpanStatusCode, SpanKind };\n\n//# sourceMappingURL=tracer.js.map","import { HeadersAdapter } from '../web/spec-extension/adapters/headers';\nimport { PRERENDER_REVALIDATE_HEADER, PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER } from '../../lib/constants';\nimport { getTracer } from '../lib/trace/tracer';\nimport { NodeSpan } from '../lib/trace/constants';\nexport function wrapApiHandler(page, handler) {\n return (...args)=>{\n getTracer().setRootSpanAttribute('next.route', page);\n // Call API route method\n return getTracer().trace(NodeSpan.runHandler, {\n spanName: `executing api route (pages) ${page}`\n }, ()=>handler(...args));\n };\n}\n/**\n *\n * @param res response object\n * @param statusCode `HTTP` status code of response\n */ export function sendStatusCode(res, statusCode) {\n res.statusCode = statusCode;\n return res;\n}\n/**\n *\n * @param res response object\n * @param [statusOrUrl] `HTTP` status code of redirect\n * @param url URL of redirect\n */ export function redirect(res, statusOrUrl, url) {\n if (typeof statusOrUrl === 'string') {\n url = statusOrUrl;\n statusOrUrl = 307;\n }\n if (typeof statusOrUrl !== 'number' || typeof url !== 'string') {\n throw Object.defineProperty(new Error(`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`), \"__NEXT_ERROR_CODE\", {\n value: \"E389\",\n enumerable: false,\n configurable: true\n });\n }\n res.writeHead(statusOrUrl, {\n Location: url\n });\n res.write(url);\n res.end();\n return res;\n}\nexport function checkIsOnDemandRevalidate(req, previewProps) {\n const headers = HeadersAdapter.from(req.headers);\n const previewModeId = headers.get(PRERENDER_REVALIDATE_HEADER);\n const isOnDemandRevalidate = previewModeId === previewProps.previewModeId;\n const revalidateOnlyGenerated = headers.has(PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER);\n return {\n isOnDemandRevalidate,\n revalidateOnlyGenerated\n };\n}\nexport const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`;\nexport const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`;\nexport const RESPONSE_LIMIT_DEFAULT = 4 * 1024 * 1024;\nexport const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA);\nexport const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS);\nexport function clearPreviewData(res, options = {}) {\n if (SYMBOL_CLEARED_COOKIES in res) {\n return res;\n }\n const { serialize } = require('next/dist/compiled/cookie');\n const previous = res.getHeader('Set-Cookie');\n res.setHeader(`Set-Cookie`, [\n ...typeof previous === 'string' ? [\n previous\n ] : Array.isArray(previous) ? previous : [],\n serialize(COOKIE_NAME_PRERENDER_BYPASS, '', {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n }),\n serialize(COOKIE_NAME_PRERENDER_DATA, '', {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n })\n ]);\n Object.defineProperty(res, SYMBOL_CLEARED_COOKIES, {\n value: true,\n enumerable: false\n });\n return res;\n}\n/**\n * Custom error class\n */ export class ApiError extends Error {\n constructor(statusCode, message){\n super(message);\n this.statusCode = statusCode;\n }\n}\n/**\n * Sends error in `response`\n * @param res response object\n * @param statusCode of response\n * @param message of response\n */ export function sendError(res, statusCode, message) {\n res.statusCode = statusCode;\n res.statusMessage = message;\n res.end(message);\n}\n/**\n * Execute getter function only if its needed\n * @param LazyProps `req` and `params` for lazyProp\n * @param prop name of property\n * @param getter function to get data\n */ export function setLazyProp({ req }, prop, getter) {\n const opts = {\n configurable: true,\n enumerable: true\n };\n const optsReset = {\n ...opts,\n writable: true\n };\n Object.defineProperty(req, prop, {\n ...opts,\n get: ()=>{\n const value = getter();\n // we set the property on the object to avoid recalculating it\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n return value;\n },\n set: (value)=>{\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n }\n });\n}\n\n//# sourceMappingURL=index.js.map","import { COOKIE_NAME_PRERENDER_BYPASS, checkIsOnDemandRevalidate } from '../api-utils';\nexport class DraftModeProvider {\n constructor(previewProps, req, cookies, mutableCookies){\n var _cookies_get;\n // The logic for draftMode() is very similar to tryGetPreviewData()\n // but Draft Mode does not have any data associated with it.\n const isOnDemandRevalidate = previewProps && checkIsOnDemandRevalidate(req, previewProps).isOnDemandRevalidate;\n const cookieValue = (_cookies_get = cookies.get(COOKIE_NAME_PRERENDER_BYPASS)) == null ? void 0 : _cookies_get.value;\n this._isEnabled = Boolean(!isOnDemandRevalidate && cookieValue && previewProps && (cookieValue === previewProps.previewModeId || // In dev mode, the cookie can be actual hash value preview id but the preview props can still be `development-id`.\n process.env.NODE_ENV !== 'production' && previewProps.previewModeId === 'development-id'));\n this._previewModeId = previewProps == null ? void 0 : previewProps.previewModeId;\n this._mutableCookies = mutableCookies;\n }\n get isEnabled() {\n return this._isEnabled;\n }\n enable() {\n if (!this._previewModeId) {\n throw Object.defineProperty(new Error('Invariant: previewProps missing previewModeId this should never happen'), \"__NEXT_ERROR_CODE\", {\n value: \"E93\",\n enumerable: false,\n configurable: true\n });\n }\n this._mutableCookies.set({\n name: COOKIE_NAME_PRERENDER_BYPASS,\n value: this._previewModeId,\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/'\n });\n this._isEnabled = true;\n }\n disable() {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n this._mutableCookies.set({\n name: COOKIE_NAME_PRERENDER_BYPASS,\n value: '',\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n expires: new Date(0)\n });\n this._isEnabled = false;\n }\n}\n\n//# sourceMappingURL=draft-mode-provider.js.map","import { FLIGHT_HEADERS } from '../../client/components/app-router-headers';\nimport { HeadersAdapter } from '../web/spec-extension/adapters/headers';\nimport { MutableRequestCookiesAdapter, RequestCookiesAdapter, responseCookiesToRequestCookies, createCookiesWithMutableAccessCheck } from '../web/spec-extension/adapters/request-cookies';\nimport { ResponseCookies, RequestCookies } from '../web/spec-extension/cookies';\nimport { DraftModeProvider } from './draft-mode-provider';\nimport { splitCookiesString } from '../web/utils';\nfunction getHeaders(headers) {\n const cleaned = HeadersAdapter.from(headers);\n for (const header of FLIGHT_HEADERS){\n cleaned.delete(header);\n }\n return HeadersAdapter.seal(cleaned);\n}\nfunction getMutableCookies(headers, onUpdateCookies) {\n const cookies = new RequestCookies(HeadersAdapter.from(headers));\n return MutableRequestCookiesAdapter.wrap(cookies, onUpdateCookies);\n}\n/**\n * If middleware set cookies in this request (indicated by `x-middleware-set-cookie`),\n * then merge those into the existing cookie object, so that when `cookies()` is accessed\n * it's able to read the newly set cookies.\n */ function mergeMiddlewareCookies(req, existingCookies) {\n if ('x-middleware-set-cookie' in req.headers && typeof req.headers['x-middleware-set-cookie'] === 'string') {\n const setCookieValue = req.headers['x-middleware-set-cookie'];\n const responseHeaders = new Headers();\n for (const cookie of splitCookiesString(setCookieValue)){\n responseHeaders.append('set-cookie', cookie);\n }\n const responseCookies = new ResponseCookies(responseHeaders);\n // Transfer cookies from ResponseCookies to RequestCookies\n for (const cookie of responseCookies.getAll()){\n existingCookies.set(cookie);\n }\n }\n}\nexport function createRequestStoreForRender(req, res, url, rootParams, implicitTags, onUpdateCookies, previewProps, isHmrRefresh, serverComponentsHmrCache, renderResumeDataCache, devFallbackParams) {\n return createRequestStoreImpl(// Pages start in render phase by default\n 'render', req, res, url, rootParams, implicitTags, onUpdateCookies, renderResumeDataCache, previewProps, isHmrRefresh, serverComponentsHmrCache, devFallbackParams);\n}\nexport function createRequestStoreForAPI(req, url, implicitTags, onUpdateCookies, previewProps) {\n return createRequestStoreImpl(// API routes start in action phase by default\n 'action', req, undefined, url, {}, implicitTags, onUpdateCookies, undefined, previewProps, false, undefined, null);\n}\nfunction createRequestStoreImpl(phase, req, res, url, rootParams, implicitTags, onUpdateCookies, renderResumeDataCache, previewProps, isHmrRefresh, serverComponentsHmrCache, devFallbackParams) {\n function defaultOnUpdateCookies(cookies) {\n if (res) {\n res.setHeader('Set-Cookie', cookies);\n }\n }\n const cache = {};\n return {\n type: 'request',\n phase,\n implicitTags,\n // Rather than just using the whole `url` here, we pull the parts we want\n // to ensure we don't use parts of the URL that we shouldn't. This also\n // lets us avoid requiring an empty string for `search` in the type.\n url: {\n pathname: url.pathname,\n search: url.search ?? ''\n },\n rootParams,\n get headers () {\n if (!cache.headers) {\n // Seal the headers object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.headers = getHeaders(req.headers);\n }\n return cache.headers;\n },\n get cookies () {\n if (!cache.cookies) {\n // if middleware is setting cookie(s), then include those in\n // the initial cached cookies so they can be read in render\n const requestCookies = new RequestCookies(HeadersAdapter.from(req.headers));\n mergeMiddlewareCookies(req, requestCookies);\n // Seal the cookies object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.cookies = RequestCookiesAdapter.seal(requestCookies);\n }\n return cache.cookies;\n },\n set cookies (value){\n cache.cookies = value;\n },\n get mutableCookies () {\n if (!cache.mutableCookies) {\n const mutableCookies = getMutableCookies(req.headers, onUpdateCookies || (res ? defaultOnUpdateCookies : undefined));\n mergeMiddlewareCookies(req, mutableCookies);\n cache.mutableCookies = mutableCookies;\n }\n return cache.mutableCookies;\n },\n get userspaceMutableCookies () {\n if (!cache.userspaceMutableCookies) {\n const userspaceMutableCookies = createCookiesWithMutableAccessCheck(this);\n cache.userspaceMutableCookies = userspaceMutableCookies;\n }\n return cache.userspaceMutableCookies;\n },\n get draftMode () {\n if (!cache.draftMode) {\n cache.draftMode = new DraftModeProvider(previewProps, req, this.cookies, this.mutableCookies);\n }\n return cache.draftMode;\n },\n renderResumeDataCache: renderResumeDataCache ?? null,\n isHmrRefresh,\n serverComponentsHmrCache: serverComponentsHmrCache || globalThis.__serverComponentsHmrCache,\n devFallbackParams\n };\n}\nexport function synchronizeMutableCookies(store) {\n // TODO: does this need to update headers as well?\n store.cookies = RequestCookiesAdapter.seal(responseCookiesToRequestCookies(store.mutableCookies));\n}\n\n//# sourceMappingURL=request-store.js.map","import { createAsyncLocalStorage } from './async-local-storage';\nexport const workUnitAsyncStorageInstance = createAsyncLocalStorage();\n\n//# sourceMappingURL=work-unit-async-storage-instance.js.map","export class InvariantError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(\n `Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`,\n options\n )\n this.name = 'InvariantError'\n }\n}\n","// Share the instance module in the next-shared layer\nimport { workUnitAsyncStorageInstance } from './work-unit-async-storage-instance' with {\n 'turbopack-transition': 'next-shared'\n};\nimport { NEXT_HMR_REFRESH_HASH_COOKIE } from '../../client/components/app-router-headers';\nimport { InvariantError } from '../../shared/lib/invariant-error';\nexport { workUnitAsyncStorageInstance as workUnitAsyncStorage };\nexport function throwForMissingRequestStore(callingExpression) {\n throw Object.defineProperty(new Error(`\\`${callingExpression}\\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`), \"__NEXT_ERROR_CODE\", {\n value: \"E251\",\n enumerable: false,\n configurable: true\n });\n}\nexport function throwInvariantForMissingStore() {\n throw Object.defineProperty(new InvariantError('Expected workUnitAsyncStorage to have a store.'), \"__NEXT_ERROR_CODE\", {\n value: \"E696\",\n enumerable: false,\n configurable: true\n });\n}\nexport function getPrerenderResumeDataCache(workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-ppr':\n return workUnitStore.prerenderResumeDataCache;\n case 'prerender-client':\n // TODO eliminate fetch caching in client scope and stop exposing this data\n // cache during SSR.\n return workUnitStore.prerenderResumeDataCache;\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n return null;\n default:\n return workUnitStore;\n }\n}\nexport function getRenderResumeDataCache(workUnitStore) {\n switch(workUnitStore.type){\n case 'request':\n return workUnitStore.renderResumeDataCache;\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-client':\n if (workUnitStore.renderResumeDataCache) {\n // If we are in a prerender, we might have a render resume data cache\n // that is used to read from prefilled caches.\n return workUnitStore.renderResumeDataCache;\n }\n // fallthrough\n case 'prerender-ppr':\n // Otherwise we return the mutable resume data cache here as an immutable\n // version of the cache as it can also be used for reading.\n return workUnitStore.prerenderResumeDataCache;\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-legacy':\n return null;\n default:\n return workUnitStore;\n }\n}\nexport function getHmrRefreshHash(workStore, workUnitStore) {\n if (workStore.dev) {\n switch(workUnitStore.type){\n case 'cache':\n case 'private-cache':\n case 'prerender':\n case 'prerender-runtime':\n return workUnitStore.hmrRefreshHash;\n case 'request':\n var _workUnitStore_cookies_get;\n return (_workUnitStore_cookies_get = workUnitStore.cookies.get(NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : _workUnitStore_cookies_get.value;\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'unstable-cache':\n break;\n default:\n workUnitStore;\n }\n }\n return undefined;\n}\nexport function isHmrRefresh(workStore, workUnitStore) {\n if (workStore.dev) {\n switch(workUnitStore.type){\n case 'cache':\n case 'private-cache':\n case 'request':\n return workUnitStore.isHmrRefresh ?? false;\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'unstable-cache':\n break;\n default:\n workUnitStore;\n }\n }\n return false;\n}\nexport function getServerComponentsHmrCache(workStore, workUnitStore) {\n if (workStore.dev) {\n switch(workUnitStore.type){\n case 'cache':\n case 'private-cache':\n case 'request':\n return workUnitStore.serverComponentsHmrCache;\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'unstable-cache':\n break;\n default:\n workUnitStore;\n }\n }\n return undefined;\n}\n/**\n * Returns a draft mode provider only if draft mode is enabled.\n */ export function getDraftModeProviderForCacheScope(workStore, workUnitStore) {\n if (workStore.isDraftMode) {\n switch(workUnitStore.type){\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'request':\n return workUnitStore.draftMode;\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n break;\n default:\n workUnitStore;\n }\n }\n return undefined;\n}\nexport function getCacheSignal(workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n return workUnitStore.cacheSignal;\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n return null;\n default:\n return workUnitStore;\n }\n}\nexport function getRuntimeStagePromise(workUnitStore) {\n switch(workUnitStore.type){\n case 'prerender-runtime':\n case 'private-cache':\n return workUnitStore.runtimeStagePromise;\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'unstable-cache':\n return null;\n default:\n return workUnitStore;\n }\n}\n\n//# sourceMappingURL=work-unit-async-storage.external.js.map","/**\n * Node in the doubly-linked list used for LRU tracking.\n * Each node represents a cache entry with bidirectional pointers.\n */ class LRUNode {\n constructor(key, data, size){\n this.prev = null;\n this.next = null;\n this.key = key;\n this.data = data;\n this.size = size;\n }\n}\n/**\n * Sentinel node used for head/tail boundaries.\n * These nodes don't contain actual cache data but simplify list operations.\n */ class SentinelNode {\n constructor(){\n this.prev = null;\n this.next = null;\n }\n}\n/**\n * LRU (Least Recently Used) Cache implementation using a doubly-linked list\n * and hash map for O(1) operations.\n *\n * Algorithm:\n * - Uses a doubly-linked list to maintain access order (most recent at head)\n * - Hash map provides O(1) key-to-node lookup\n * - Sentinel head/tail nodes simplify edge case handling\n * - Size-based eviction supports custom size calculation functions\n *\n * Data Structure Layout:\n * HEAD <-> [most recent] <-> ... <-> [least recent] <-> TAIL\n *\n * Operations:\n * - get(): Move accessed node to head (mark as most recent)\n * - set(): Add new node at head, evict from tail if over capacity\n * - Eviction: Remove least recent node (tail.prev) when size exceeds limit\n */ export class LRUCache {\n constructor(maxSize, calculateSize, onEvict){\n this.cache = new Map();\n this.totalSize = 0;\n this.maxSize = maxSize;\n this.calculateSize = calculateSize;\n this.onEvict = onEvict;\n // Create sentinel nodes to simplify doubly-linked list operations\n // HEAD <-> TAIL (empty list)\n this.head = new SentinelNode();\n this.tail = new SentinelNode();\n this.head.next = this.tail;\n this.tail.prev = this.head;\n }\n /**\n * Adds a node immediately after the head (marks as most recently used).\n * Used when inserting new items or when an item is accessed.\n * PRECONDITION: node must be disconnected (prev/next should be null)\n */ addToHead(node) {\n node.prev = this.head;\n node.next = this.head.next;\n // head.next is always non-null (points to tail or another node)\n this.head.next.prev = node;\n this.head.next = node;\n }\n /**\n * Removes a node from its current position in the doubly-linked list.\n * Updates the prev/next pointers of adjacent nodes to maintain list integrity.\n * PRECONDITION: node must be connected (prev/next are non-null)\n */ removeNode(node) {\n // Connected nodes always have non-null prev/next\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }\n /**\n * Moves an existing node to the head position (marks as most recently used).\n * This is the core LRU operation - accessed items become most recent.\n */ moveToHead(node) {\n this.removeNode(node);\n this.addToHead(node);\n }\n /**\n * Removes and returns the least recently used node (the one before tail).\n * This is called during eviction when the cache exceeds capacity.\n * PRECONDITION: cache is not empty (ensured by caller)\n */ removeTail() {\n const lastNode = this.tail.prev;\n // tail.prev is always non-null and always LRUNode when cache is not empty\n this.removeNode(lastNode);\n return lastNode;\n }\n /**\n * Sets a key-value pair in the cache.\n * If the key exists, updates the value and moves to head.\n * If new, adds at head and evicts from tail if necessary.\n *\n * Time Complexity:\n * - O(1) for uniform item sizes\n * - O(k) where k is the number of items evicted (can be O(N) for variable sizes)\n */ set(key, value) {\n const size = (this.calculateSize == null ? void 0 : this.calculateSize.call(this, value)) ?? 1;\n if (size <= 0) {\n throw Object.defineProperty(new Error(`LRUCache: calculateSize returned ${size}, but size must be > 0. ` + `Items with size 0 would never be evicted, causing unbounded cache growth.`), \"__NEXT_ERROR_CODE\", {\n value: \"E789\",\n enumerable: false,\n configurable: true\n });\n }\n if (size > this.maxSize) {\n console.warn('Single item size exceeds maxSize');\n return false;\n }\n const existing = this.cache.get(key);\n if (existing) {\n // Update existing node: adjust size and move to head (most recent)\n existing.data = value;\n this.totalSize = this.totalSize - existing.size + size;\n existing.size = size;\n this.moveToHead(existing);\n } else {\n // Add new node at head (most recent position)\n const newNode = new LRUNode(key, value, size);\n this.cache.set(key, newNode);\n this.addToHead(newNode);\n this.totalSize += size;\n }\n // Evict least recently used items until under capacity\n while(this.totalSize > this.maxSize && this.cache.size > 0){\n const tail = this.removeTail();\n this.cache.delete(tail.key);\n this.totalSize -= tail.size;\n this.onEvict == null ? void 0 : this.onEvict.call(this, tail.key, tail.data);\n }\n return true;\n }\n /**\n * Checks if a key exists in the cache.\n * This is a pure query operation - does NOT update LRU order.\n *\n * Time Complexity: O(1)\n */ has(key) {\n return this.cache.has(key);\n }\n /**\n * Retrieves a value by key and marks it as most recently used.\n * Moving to head maintains the LRU property for future evictions.\n *\n * Time Complexity: O(1)\n */ get(key) {\n const node = this.cache.get(key);\n if (!node) return undefined;\n // Mark as most recently used by moving to head\n this.moveToHead(node);\n return node.data;\n }\n /**\n * Returns an iterator over the cache entries. The order is outputted in the\n * order of most recently used to least recently used.\n */ *[Symbol.iterator]() {\n let current = this.head.next;\n while(current && current !== this.tail){\n // Between head and tail, current is always LRUNode\n const node = current;\n yield [\n node.key,\n node.data\n ];\n current = current.next;\n }\n }\n /**\n * Removes a specific key from the cache.\n * Updates both the hash map and doubly-linked list.\n *\n * Note: This is an explicit removal and does NOT trigger the `onEvict`\n * callback. Use this for intentional deletions where eviction tracking\n * is not needed.\n *\n * Time Complexity: O(1)\n */ remove(key) {\n const node = this.cache.get(key);\n if (!node) return;\n this.removeNode(node);\n this.cache.delete(key);\n this.totalSize -= node.size;\n }\n /**\n * Returns the number of items in the cache.\n */ get size() {\n return this.cache.size;\n }\n /**\n * Returns the current total size of all cached items.\n * This uses the custom size calculation if provided.\n */ get currentSize() {\n return this.totalSize;\n }\n}\n\n//# sourceMappingURL=lru-cache.js.map","import type { Timestamp } from '../cache-handlers/types'\n\n// We share the tags manifest between the \"use cache\" handlers and the previous\n// file-system cache.\nexport const tagsManifest = new Map<string, number>()\n\nexport const isStale = (tags: string[], timestamp: Timestamp) => {\n for (const tag of tags) {\n const revalidatedAt = tagsManifest.get(tag)\n\n if (typeof revalidatedAt === 'number' && revalidatedAt >= timestamp) {\n return true\n }\n }\n\n return false\n}\n","/**\n * This is the default \"use cache\" handler it defaults to an in-memory store.\n * In-memory caches are fragile and should not use stale-while-revalidate\n * semantics on the caches because it's not worth warming up an entry that's\n * likely going to get evicted before we get to use it anyway. However, we also\n * don't want to reuse a stale entry for too long so stale entries should be\n * considered expired/missing in such cache handlers.\n */\n\nimport { LRUCache } from '../lru-cache'\nimport type { CacheEntry, CacheHandlerV2 } from './types'\nimport {\n isStale,\n tagsManifest,\n} from '../incremental-cache/tags-manifest.external'\n\ntype PrivateCacheEntry = {\n entry: CacheEntry\n\n // For the default cache we store errored cache\n // entries and allow them to be used up to 3 times\n // after that we want to dispose it and try for fresh\n\n // If an entry is errored we return no entry\n // three times so that we retry hitting origin (MISS)\n // and then if it still fails to set after the third we\n // return the errored content and use expiration of\n // Math.min(30, entry.expiration)\n isErrored: boolean\n errorRetryCount: number\n\n // compute size on set since we need to read size\n // of the ReadableStream for LRU evicting\n size: number\n}\n\n// LRU cache default to max 50 MB but in future track\nconst memoryCache = new LRUCache<PrivateCacheEntry>(\n 50 * 1024 * 1024,\n (entry) => entry.size\n)\nconst pendingSets = new Map<string, Promise<void>>()\n\nconst debug = process.env.NEXT_PRIVATE_DEBUG_CACHE\n ? console.debug.bind(console, 'DefaultCacheHandler:')\n : undefined\n\nconst DefaultCacheHandler: CacheHandlerV2 = {\n async get(cacheKey) {\n const pendingPromise = pendingSets.get(cacheKey)\n\n if (pendingPromise) {\n debug?.('get', cacheKey, 'pending')\n await pendingPromise\n }\n\n const privateEntry = memoryCache.get(cacheKey)\n\n if (!privateEntry) {\n debug?.('get', cacheKey, 'not found')\n return undefined\n }\n\n const entry = privateEntry.entry\n if (\n performance.timeOrigin + performance.now() >\n entry.timestamp + entry.revalidate * 1000\n ) {\n // In-memory caches should expire after revalidate time because it is\n // unlikely that a new entry will be able to be used before it is dropped\n // from the cache.\n debug?.('get', cacheKey, 'expired')\n\n return undefined\n }\n\n if (isStale(entry.tags, entry.timestamp)) {\n debug?.('get', cacheKey, 'had stale tag')\n\n return undefined\n }\n const [returnStream, newSaved] = entry.value.tee()\n entry.value = newSaved\n\n debug?.('get', cacheKey, 'found', {\n tags: entry.tags,\n timestamp: entry.timestamp,\n revalidate: entry.revalidate,\n expire: entry.expire,\n })\n\n return {\n ...entry,\n value: returnStream,\n }\n },\n\n async set(cacheKey, pendingEntry) {\n debug?.('set', cacheKey, 'start')\n\n let resolvePending: () => void = () => {}\n const pendingPromise = new Promise<void>((resolve) => {\n resolvePending = resolve\n })\n pendingSets.set(cacheKey, pendingPromise)\n\n const entry = await pendingEntry\n\n let size = 0\n\n try {\n const [value, clonedValue] = entry.value.tee()\n entry.value = value\n const reader = clonedValue.getReader()\n\n for (let chunk; !(chunk = await reader.read()).done; ) {\n size += Buffer.from(chunk.value).byteLength\n }\n\n memoryCache.set(cacheKey, {\n entry,\n isErrored: false,\n errorRetryCount: 0,\n size,\n })\n\n debug?.('set', cacheKey, 'done')\n } catch (err) {\n // TODO: store partial buffer with error after we retry 3 times\n debug?.('set', cacheKey, 'failed', err)\n } finally {\n resolvePending()\n pendingSets.delete(cacheKey)\n }\n },\n\n async refreshTags() {\n // Nothing to do for an in-memory cache handler.\n },\n\n async getExpiration(...tags) {\n const expiration = Math.max(\n ...tags.map((tag) => tagsManifest.get(tag) ?? 0)\n )\n\n debug?.('getExpiration', { tags, expiration })\n\n return expiration\n },\n\n async expireTags(...tags) {\n const timestamp = Math.round(performance.timeOrigin + performance.now())\n debug?.('expireTags', { tags, timestamp })\n\n for (const tag of tags) {\n // TODO: update file-system-cache?\n tagsManifest.set(tag, timestamp)\n }\n },\n}\n\nexport default DefaultCacheHandler\n","import DefaultCacheHandler from '../lib/cache-handlers/default.external';\nconst debug = process.env.NEXT_PRIVATE_DEBUG_CACHE ? (message, ...args)=>{\n console.log(`use-cache: ${message}`, ...args);\n} : undefined;\nconst handlersSymbol = Symbol.for('@next/cache-handlers');\nconst handlersMapSymbol = Symbol.for('@next/cache-handlers-map');\nconst handlersSetSymbol = Symbol.for('@next/cache-handlers-set');\n/**\n * The reference to the cache handlers. We store the cache handlers on the\n * global object so that we can access the same instance across different\n * boundaries (such as different copies of the same module).\n */ const reference = globalThis;\n/**\n * Initialize the cache handlers.\n * @returns `true` if the cache handlers were initialized, `false` if they were already initialized.\n */ export function initializeCacheHandlers() {\n // If the cache handlers have already been initialized, don't do it again.\n if (reference[handlersMapSymbol]) {\n debug == null ? void 0 : debug('cache handlers already initialized');\n return false;\n }\n debug == null ? void 0 : debug('initializing cache handlers');\n reference[handlersMapSymbol] = new Map();\n // Initialize the cache from the symbol contents first.\n if (reference[handlersSymbol]) {\n let fallback;\n if (reference[handlersSymbol].DefaultCache) {\n debug == null ? void 0 : debug('setting \"default\" cache handler from symbol');\n fallback = reference[handlersSymbol].DefaultCache;\n } else {\n debug == null ? void 0 : debug('setting \"default\" cache handler from default');\n fallback = DefaultCacheHandler;\n }\n reference[handlersMapSymbol].set('default', fallback);\n if (reference[handlersSymbol].RemoteCache) {\n debug == null ? void 0 : debug('setting \"remote\" cache handler from symbol');\n reference[handlersMapSymbol].set('remote', reference[handlersSymbol].RemoteCache);\n } else {\n debug == null ? void 0 : debug('setting \"remote\" cache handler from default');\n reference[handlersMapSymbol].set('remote', fallback);\n }\n } else {\n debug == null ? void 0 : debug('setting \"default\" cache handler from default');\n reference[handlersMapSymbol].set('default', DefaultCacheHandler);\n debug == null ? void 0 : debug('setting \"remote\" cache handler from default');\n reference[handlersMapSymbol].set('remote', DefaultCacheHandler);\n }\n // Create a set of the cache handlers.\n reference[handlersSetSymbol] = new Set(reference[handlersMapSymbol].values());\n return true;\n}\n/**\n * Get a cache handler by kind.\n * @param kind - The kind of cache handler to get.\n * @returns The cache handler, or `undefined` if it does not exist.\n * @throws If the cache handlers are not initialized.\n */ export function getCacheHandler(kind) {\n // This should never be called before initializeCacheHandlers.\n if (!reference[handlersMapSymbol]) {\n throw Object.defineProperty(new Error('Cache handlers not initialized'), \"__NEXT_ERROR_CODE\", {\n value: \"E649\",\n enumerable: false,\n configurable: true\n });\n }\n return reference[handlersMapSymbol].get(kind);\n}\n/**\n * Get a set iterator over the cache handlers.\n * @returns An iterator over the cache handlers, or `undefined` if they are not\n * initialized.\n */ export function getCacheHandlers() {\n if (!reference[handlersSetSymbol]) {\n return undefined;\n }\n return reference[handlersSetSymbol].values();\n}\n/**\n * Get a map iterator over the cache handlers (keyed by kind).\n * @returns An iterator over the cache handler entries, or `undefined` if they\n * are not initialized.\n * @throws If the cache handlers are not initialized.\n */ export function getCacheHandlerEntries() {\n if (!reference[handlersMapSymbol]) {\n return undefined;\n }\n return reference[handlersMapSymbol].entries();\n}\n/**\n * Set a cache handler by kind.\n * @param kind - The kind of cache handler to set.\n * @param cacheHandler - The cache handler to set.\n */ export function setCacheHandler(kind, cacheHandler) {\n // This should never be called before initializeCacheHandlers.\n if (!reference[handlersMapSymbol] || !reference[handlersSetSymbol]) {\n throw Object.defineProperty(new Error('Cache handlers not initialized'), \"__NEXT_ERROR_CODE\", {\n value: \"E649\",\n enumerable: false,\n configurable: true\n });\n }\n debug == null ? void 0 : debug('setting cache handler for \"%s\"', kind);\n reference[handlersMapSymbol].set(kind, cacheHandler);\n reference[handlersSetSymbol].add(cacheHandler);\n}\n\n//# sourceMappingURL=handlers.js.map","import { getCacheHandlers } from './use-cache/handlers';\n/** Run a callback, and execute any *new* revalidations added during its runtime. */ export async function withExecuteRevalidates(store, callback) {\n if (!store) {\n return callback();\n }\n // If we executed any revalidates during the request, then we don't want to execute them again.\n // save the state so we can check if anything changed after we're done running callbacks.\n const savedRevalidationState = cloneRevalidationState(store);\n try {\n return await callback();\n } finally{\n // Check if we have any new revalidates, and if so, wait until they are all resolved.\n const newRevalidates = diffRevalidationState(savedRevalidationState, cloneRevalidationState(store));\n await executeRevalidates(store, newRevalidates);\n }\n}\nfunction cloneRevalidationState(store) {\n return {\n pendingRevalidatedTags: store.pendingRevalidatedTags ? [\n ...store.pendingRevalidatedTags\n ] : [],\n pendingRevalidates: {\n ...store.pendingRevalidates\n },\n pendingRevalidateWrites: store.pendingRevalidateWrites ? [\n ...store.pendingRevalidateWrites\n ] : []\n };\n}\nfunction diffRevalidationState(prev, curr) {\n const prevTags = new Set(prev.pendingRevalidatedTags);\n const prevRevalidateWrites = new Set(prev.pendingRevalidateWrites);\n return {\n pendingRevalidatedTags: curr.pendingRevalidatedTags.filter((tag)=>!prevTags.has(tag)),\n pendingRevalidates: Object.fromEntries(Object.entries(curr.pendingRevalidates).filter(([key])=>!(key in prev.pendingRevalidates))),\n pendingRevalidateWrites: curr.pendingRevalidateWrites.filter((promise)=>!prevRevalidateWrites.has(promise))\n };\n}\nasync function revalidateTags(tags, incrementalCache) {\n if (tags.length === 0) {\n return;\n }\n const promises = [];\n if (incrementalCache) {\n promises.push(incrementalCache.revalidateTag(tags));\n }\n const handlers = getCacheHandlers();\n if (handlers) {\n for (const handler of handlers){\n promises.push(handler.expireTags(...tags));\n }\n }\n await Promise.all(promises);\n}\nexport async function executeRevalidates(workStore, state) {\n const pendingRevalidatedTags = (state == null ? void 0 : state.pendingRevalidatedTags) ?? workStore.pendingRevalidatedTags ?? [];\n const pendingRevalidates = (state == null ? void 0 : state.pendingRevalidates) ?? workStore.pendingRevalidates ?? {};\n const pendingRevalidateWrites = (state == null ? void 0 : state.pendingRevalidateWrites) ?? workStore.pendingRevalidateWrites ?? [];\n return Promise.all([\n revalidateTags(pendingRevalidatedTags, workStore.incrementalCache),\n ...Object.values(pendingRevalidates),\n ...pendingRevalidateWrites\n ]);\n}\n\n//# sourceMappingURL=revalidation-utils.js.map","const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), \"__NEXT_ERROR_CODE\", {\n value: \"E504\",\n enumerable: false,\n configurable: true\n});\nclass FakeAsyncLocalStorage {\n disable() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n getStore() {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined;\n }\n run() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n exit() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n enterWith() {\n throw sharedAsyncLocalStorageNotAvailableError;\n }\n static bind(fn) {\n return fn;\n }\n}\nconst maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;\nexport function createAsyncLocalStorage() {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage();\n }\n return new FakeAsyncLocalStorage();\n}\nexport function bindSnapshot(fn) {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn);\n }\n return FakeAsyncLocalStorage.bind(fn);\n}\nexport function createSnapshot() {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot();\n }\n return function(fn, ...args) {\n return fn(...args);\n };\n}\n\n//# sourceMappingURL=async-local-storage.js.map","import { createAsyncLocalStorage } from './async-local-storage';\nexport const afterTaskAsyncStorageInstance = createAsyncLocalStorage();\n\n//# sourceMappingURL=after-task-async-storage-instance.js.map","// Share the instance module in the next-shared layer\nimport { afterTaskAsyncStorageInstance as afterTaskAsyncStorage } from './after-task-async-storage-instance' with {\n 'turbopack-transition': 'next-shared'\n};\nexport { afterTaskAsyncStorage };\n\n//# sourceMappingURL=after-task-async-storage.external.js.map","import PromiseQueue from 'next/dist/compiled/p-queue';\nimport { InvariantError } from '../../shared/lib/invariant-error';\nimport { isThenable } from '../../shared/lib/is-thenable';\nimport { workAsyncStorage } from '../app-render/work-async-storage.external';\nimport { withExecuteRevalidates } from '../revalidation-utils';\nimport { bindSnapshot } from '../app-render/async-local-storage';\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external';\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external';\nexport class AfterContext {\n constructor({ waitUntil, onClose, onTaskError }){\n this.workUnitStores = new Set();\n this.waitUntil = waitUntil;\n this.onClose = onClose;\n this.onTaskError = onTaskError;\n this.callbackQueue = new PromiseQueue();\n this.callbackQueue.pause();\n }\n after(task) {\n if (isThenable(task)) {\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable();\n }\n this.waitUntil(task.catch((error)=>this.reportTaskError('promise', error)));\n } else if (typeof task === 'function') {\n // TODO(after): implement tracing\n this.addCallback(task);\n } else {\n throw Object.defineProperty(new Error('`after()`: Argument must be a promise or a function'), \"__NEXT_ERROR_CODE\", {\n value: \"E50\",\n enumerable: false,\n configurable: true\n });\n }\n }\n addCallback(callback) {\n // if something is wrong, throw synchronously, bubbling up to the `after` callsite.\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable();\n }\n const workUnitStore = workUnitAsyncStorage.getStore();\n if (workUnitStore) {\n this.workUnitStores.add(workUnitStore);\n }\n const afterTaskStore = afterTaskAsyncStorage.getStore();\n // This is used for checking if request APIs can be called inside `after`.\n // Note that we need to check the phase in which the *topmost* `after` was called (which should be \"action\"),\n // not the current phase (which might be \"after\" if we're in a nested after).\n // Otherwise, we might allow `after(() => headers())`, but not `after(() => after(() => headers()))`.\n const rootTaskSpawnPhase = afterTaskStore ? afterTaskStore.rootTaskSpawnPhase // nested after\n : workUnitStore == null ? void 0 : workUnitStore.phase // topmost after\n ;\n // this should only happen once.\n if (!this.runCallbacksOnClosePromise) {\n this.runCallbacksOnClosePromise = this.runCallbacksOnClose();\n this.waitUntil(this.runCallbacksOnClosePromise);\n }\n // Bind the callback to the current execution context (i.e. preserve all currently available ALS-es).\n // We do this because we want all of these to be equivalent in every regard except timing:\n // after(() => x())\n // after(x())\n // await x()\n const wrappedCallback = bindSnapshot(async ()=>{\n try {\n await afterTaskAsyncStorage.run({\n rootTaskSpawnPhase\n }, ()=>callback());\n } catch (error) {\n this.reportTaskError('function', error);\n }\n });\n this.callbackQueue.add(wrappedCallback);\n }\n async runCallbacksOnClose() {\n await new Promise((resolve)=>this.onClose(resolve));\n return this.runCallbacks();\n }\n async runCallbacks() {\n if (this.callbackQueue.size === 0) return;\n for (const workUnitStore of this.workUnitStores){\n workUnitStore.phase = 'after';\n }\n const workStore = workAsyncStorage.getStore();\n if (!workStore) {\n throw Object.defineProperty(new InvariantError('Missing workStore in AfterContext.runCallbacks'), \"__NEXT_ERROR_CODE\", {\n value: \"E547\",\n enumerable: false,\n configurable: true\n });\n }\n return withExecuteRevalidates(workStore, ()=>{\n this.callbackQueue.start();\n return this.callbackQueue.onIdle();\n });\n }\n reportTaskError(taskKind, error) {\n // TODO(after): this is fine for now, but will need better intergration with our error reporting.\n // TODO(after): should we log this if we have a onTaskError callback?\n console.error(taskKind === 'promise' ? `A promise passed to \\`after()\\` rejected:` : `An error occurred in a function passed to \\`after()\\`:`, error);\n if (this.onTaskError) {\n // this is very defensive, but we really don't want anything to blow up in an error handler\n try {\n this.onTaskError == null ? void 0 : this.onTaskError.call(this, error);\n } catch (handlerError) {\n console.error(Object.defineProperty(new InvariantError('`onTaskError` threw while handling an error thrown from an `after` task', {\n cause: handlerError\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E569\",\n enumerable: false,\n configurable: true\n }));\n }\n }\n }\n}\nfunction errorWaitUntilNotAvailable() {\n throw Object.defineProperty(new Error('`after()` will not work correctly, because `waitUntil` is not available in the current environment.'), \"__NEXT_ERROR_CODE\", {\n value: \"E91\",\n enumerable: false,\n configurable: true\n });\n}\n\n//# sourceMappingURL=after-context.js.map","/**\n * Calls the given async function only when the returned promise-like object is\n * awaited. Afterwards, it provides the resolved value synchronously as `value`\n * property.\n */ export function createLazyResult(fn) {\n let pendingResult;\n const result = {\n then (onfulfilled, onrejected) {\n if (!pendingResult) {\n pendingResult = fn();\n }\n pendingResult.then((value)=>{\n result.value = value;\n }).catch(()=>{\n // The externally awaited result will be rejected via `onrejected`. We\n // don't need to handle it here. But we do want to avoid an unhandled\n // rejection.\n });\n return pendingResult.then(onfulfilled, onrejected);\n }\n };\n return result;\n}\nexport function isResolvedLazyResult(result) {\n return result.hasOwnProperty('value');\n}\n\n//# sourceMappingURL=lazy-result.js.map","import { AfterContext } from '../after/after-context';\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths';\nimport { createLazyResult } from '../lib/lazy-result';\nimport { getCacheHandlerEntries } from '../use-cache/handlers';\nimport { createSnapshot } from '../app-render/async-local-storage';\nexport function createWorkStore({ page, renderOpts, isPrefetchRequest, buildId, previouslyRevalidatedTags }) {\n /**\n * Rules of Static & Dynamic HTML:\n *\n * 1.) We must generate static HTML unless the caller explicitly opts\n * in to dynamic HTML support.\n *\n * 2.) If dynamic HTML support is requested, we must honor that request\n * or throw an error. It is the sole responsibility of the caller to\n * ensure they aren't e.g. requesting dynamic HTML for an AMP page.\n *\n * 3.) If the request is in draft mode, we must generate dynamic HTML.\n *\n * 4.) If the request is a server action, we must generate dynamic HTML.\n *\n * These rules help ensure that other existing features like request caching,\n * coalescing, and ISR continue working as intended.\n */ const isStaticGeneration = !renderOpts.shouldWaitOnAllReady && !renderOpts.supportsDynamicResponse && !renderOpts.isDraftMode && !renderOpts.isPossibleServerAction;\n const isDevelopment = renderOpts.dev ?? false;\n const shouldTrackFetchMetrics = isDevelopment || // The only times we want to track fetch metrics outside of development is\n // when we are performing a static generation and we either are in debug\n // mode, or tracking fetch metrics was specifically opted into.\n isStaticGeneration && (!!process.env.NEXT_DEBUG_BUILD || process.env.NEXT_SSG_FETCH_METRICS === '1');\n const store = {\n isStaticGeneration,\n page,\n route: normalizeAppPath(page),\n incrementalCache: // we fallback to a global incremental cache for edge-runtime locally\n // so that it can access the fs cache without mocks\n renderOpts.incrementalCache || globalThis.__incrementalCache,\n cacheLifeProfiles: renderOpts.cacheLifeProfiles,\n isRevalidate: renderOpts.isRevalidate,\n isBuildTimePrerendering: renderOpts.nextExport,\n hasReadableErrorStacks: renderOpts.hasReadableErrorStacks,\n fetchCache: renderOpts.fetchCache,\n isOnDemandRevalidate: renderOpts.isOnDemandRevalidate,\n isDraftMode: renderOpts.isDraftMode,\n isPrefetchRequest,\n buildId,\n reactLoadableManifest: (renderOpts == null ? void 0 : renderOpts.reactLoadableManifest) || {},\n assetPrefix: (renderOpts == null ? void 0 : renderOpts.assetPrefix) || '',\n afterContext: createAfterContext(renderOpts),\n cacheComponentsEnabled: renderOpts.experimental.cacheComponents,\n dev: isDevelopment,\n previouslyRevalidatedTags,\n refreshTagsByCacheKind: createRefreshTagsByCacheKind(),\n runInCleanSnapshot: createSnapshot(),\n shouldTrackFetchMetrics\n };\n // TODO: remove this when we resolve accessing the store outside the execution context\n renderOpts.store = store;\n return store;\n}\nfunction createAfterContext(renderOpts) {\n const { waitUntil, onClose, onAfterTaskError } = renderOpts;\n return new AfterContext({\n waitUntil,\n onClose,\n onTaskError: onAfterTaskError\n });\n}\n/**\n * Creates a map with lazy results that refresh tags for the respective cache\n * kind when they're awaited for the first time.\n */ function createRefreshTagsByCacheKind() {\n const refreshTagsByCacheKind = new Map();\n const cacheHandlers = getCacheHandlerEntries();\n if (cacheHandlers) {\n for (const [kind, cacheHandler] of cacheHandlers){\n if ('refreshTags' in cacheHandler) {\n refreshTagsByCacheKind.set(kind, createLazyResult(async ()=>cacheHandler.refreshTags()));\n }\n }\n }\n return refreshTagsByCacheKind;\n}\n\n//# sourceMappingURL=work-store.js.map","/** Monitor when the consumer finishes reading the response body.\nthat's as close as we can get to `res.on('close')` using web APIs.\n*/ export function trackBodyConsumed(body, onEnd) {\n if (typeof body === 'string') {\n const generator = async function* generate() {\n const encoder = new TextEncoder();\n yield encoder.encode(body);\n onEnd();\n };\n // @ts-expect-error BodyInit typings doesn't seem to include AsyncIterables even though it's supported in practice\n return generator();\n } else {\n return trackStreamConsumed(body, onEnd);\n }\n}\nexport function trackStreamConsumed(stream, onEnd) {\n // NOTE: This function must handle `stream` being aborted or cancelled,\n // so it can't just be this:\n //\n // return stream.pipeThrough(new TransformStream({ flush() { onEnd() } }))\n //\n // because that doesn't handle cancellations.\n // (and cancellation handling via `Transformer.cancel` is only available in node >20)\n const dest = new TransformStream();\n const runOnEnd = ()=>onEnd();\n stream.pipeTo(dest.writable).then(runOnEnd, runOnEnd);\n return dest.readable;\n}\nexport class CloseController {\n onClose(callback) {\n if (this.isClosed) {\n throw Object.defineProperty(new Error('Cannot subscribe to a closed CloseController'), \"__NEXT_ERROR_CODE\", {\n value: \"E365\",\n enumerable: false,\n configurable: true\n });\n }\n this.target.addEventListener('close', callback);\n this.listeners++;\n }\n dispatchClose() {\n if (this.isClosed) {\n throw Object.defineProperty(new Error('Cannot close a CloseController multiple times'), \"__NEXT_ERROR_CODE\", {\n value: \"E229\",\n enumerable: false,\n configurable: true\n });\n }\n if (this.listeners > 0) {\n this.target.dispatchEvent(new Event('close'));\n }\n this.isClosed = true;\n }\n constructor(){\n this.target = new EventTarget();\n this.listeners = 0;\n this.isClosed = false;\n }\n}\n\n//# sourceMappingURL=web-on-close.js.map","/**\n * In edge runtime, these props directly accessed from environment variables.\n * - local: env vars will be injected through edge-runtime as runtime env vars\n * - deployment: env vars will be replaced by edge build pipeline\n */ export function getEdgePreviewProps() {\n return {\n previewModeId: process.env.__NEXT_PREVIEW_MODE_ID || '',\n previewModeSigningKey: process.env.__NEXT_PREVIEW_MODE_SIGNING_KEY || '',\n previewModeEncryptionKey: process.env.__NEXT_PREVIEW_MODE_ENCRYPTION_KEY || ''\n };\n}\n\n//# sourceMappingURL=get-edge-preview-props.js.map","import { createAsyncLocalStorage } from '../app-render/async-local-storage';\nexport function getBuiltinRequestContext() {\n const _globalThis = globalThis;\n const ctx = _globalThis[NEXT_REQUEST_CONTEXT_SYMBOL];\n return ctx == null ? void 0 : ctx.get();\n}\nconst NEXT_REQUEST_CONTEXT_SYMBOL = Symbol.for('@next/request-context');\n/** \"@next/request-context\" has a different signature from AsyncLocalStorage,\n * matching [AsyncContext.Variable](https://github.com/tc39/proposal-async-context).\n * We don't need a full AsyncContext adapter here, just having `.get()` is enough\n */ export function createLocalRequestContext() {\n const storage = createAsyncLocalStorage();\n return {\n get: ()=>storage.getStore(),\n run: (value, callback)=>storage.run(value, callback)\n };\n}\n\n//# sourceMappingURL=builtin-request-context.js.map","import { NEXT_CACHE_IMPLICIT_TAG_ID } from '../../lib/constants';\nimport { getCacheHandlerEntries } from '../use-cache/handlers';\nimport { createLazyResult } from './lazy-result';\nconst getDerivedTags = (pathname)=>{\n const derivedTags = [\n `/layout`\n ];\n // we automatically add the current path segments as tags\n // for revalidatePath handling\n if (pathname.startsWith('/')) {\n const pathnameParts = pathname.split('/');\n for(let i = 1; i < pathnameParts.length + 1; i++){\n let curPathname = pathnameParts.slice(0, i).join('/');\n if (curPathname) {\n // all derived tags other than the page are layout tags\n if (!curPathname.endsWith('/page') && !curPathname.endsWith('/route')) {\n curPathname = `${curPathname}${!curPathname.endsWith('/') ? '/' : ''}layout`;\n }\n derivedTags.push(curPathname);\n }\n }\n }\n return derivedTags;\n};\n/**\n * Creates a map with lazy results that fetch the expiration value for the given\n * tags and respective cache kind when they're awaited for the first time.\n */ function createTagsExpirationsByCacheKind(tags) {\n const expirationsByCacheKind = new Map();\n const cacheHandlers = getCacheHandlerEntries();\n if (cacheHandlers) {\n for (const [kind, cacheHandler] of cacheHandlers){\n if ('getExpiration' in cacheHandler) {\n expirationsByCacheKind.set(kind, createLazyResult(async ()=>cacheHandler.getExpiration(...tags)));\n }\n }\n }\n return expirationsByCacheKind;\n}\nexport async function getImplicitTags(page, url, fallbackRouteParams) {\n const tags = [];\n const hasFallbackRouteParams = fallbackRouteParams && fallbackRouteParams.size > 0;\n // Add the derived tags from the page.\n const derivedTags = getDerivedTags(page);\n for (let tag of derivedTags){\n tag = `${NEXT_CACHE_IMPLICIT_TAG_ID}${tag}`;\n tags.push(tag);\n }\n // Add the tags from the pathname. If the route has unknown params, we don't\n // want to add the pathname as a tag, as it will be invalid.\n if (url.pathname && !hasFallbackRouteParams) {\n const tag = `${NEXT_CACHE_IMPLICIT_TAG_ID}${url.pathname}`;\n tags.push(tag);\n }\n return {\n tags,\n expirationsByCacheKind: createTagsExpirationsByCacheKind(tags)\n };\n}\n\n//# sourceMappingURL=implicit-tags.js.map","/**\n * Normalizes the raw RSC header value. Only the literal string \"1\" is treated\n * as a valid RSC request marker; malformed or repeated values are ignored.\n */ export function isRSCRequestHeader(value) {\n return value === '1';\n}\n\n//# sourceMappingURL=is-rsc-request.js.map","import { PageSignatureError } from './error';\nimport { fromNodeOutgoingHttpHeaders, normalizeNextQueryParam } from './utils';\nimport { NextFetchEvent, getWaitUntilPromiseFromEvent } from './spec-extension/fetch-event';\nimport { NextRequest } from './spec-extension/request';\nimport { NextResponse } from './spec-extension/response';\nimport { parseRelativeURL, getRelativeURL } from '../../shared/lib/router/utils/relativize-url';\nimport { NextURL } from './next-url';\nimport { stripInternalSearchParams } from '../internal-utils';\nimport { normalizeRscURL } from '../../shared/lib/router/utils/app-paths';\nimport { FLIGHT_HEADERS, NEXT_REWRITTEN_PATH_HEADER, NEXT_REWRITTEN_QUERY_HEADER, NEXT_RSC_UNION_QUERY, RSC_HEADER } from '../../client/components/app-router-headers';\nimport { ensureInstrumentationRegistered } from './globals';\nimport { createRequestStoreForAPI } from '../async-storage/request-store';\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external';\nimport { createWorkStore } from '../async-storage/work-store';\nimport { workAsyncStorage } from '../app-render/work-async-storage.external';\nimport { NEXT_ROUTER_PREFETCH_HEADER } from '../../client/components/app-router-headers';\nimport { getTracer } from '../lib/trace/tracer';\nimport { MiddlewareSpan } from '../lib/trace/constants';\nimport { CloseController } from './web-on-close';\nimport { getEdgePreviewProps } from './get-edge-preview-props';\nimport { getBuiltinRequestContext } from '../after/builtin-request-context';\nimport { getImplicitTags } from '../lib/implicit-tags';\nimport { isRSCRequestHeader } from '../lib/is-rsc-request';\nexport class NextRequestHint extends NextRequest {\n constructor(params){\n super(params.input, params.init);\n this.sourcePage = params.page;\n }\n get request() {\n throw Object.defineProperty(new PageSignatureError({\n page: this.sourcePage\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n }\n respondWith() {\n throw Object.defineProperty(new PageSignatureError({\n page: this.sourcePage\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n }\n waitUntil() {\n throw Object.defineProperty(new PageSignatureError({\n page: this.sourcePage\n }), \"__NEXT_ERROR_CODE\", {\n value: \"E394\",\n enumerable: false,\n configurable: true\n });\n }\n}\nconst headersGetter = {\n keys: (headers)=>Array.from(headers.keys()),\n get: (headers, key)=>headers.get(key) ?? undefined\n};\nlet propagator = (request, fn)=>{\n const tracer = getTracer();\n return tracer.withPropagatedContext(request.headers, fn, headersGetter);\n};\nlet testApisIntercepted = false;\nfunction ensureTestApisIntercepted() {\n if (!testApisIntercepted) {\n testApisIntercepted = true;\n if (process.env.NEXT_PRIVATE_TEST_PROXY === 'true') {\n const { interceptTestApis, wrapRequestHandler } = // eslint-disable-next-line @next/internal/typechecked-require -- experimental/testmode is not built ins next/dist/esm\n require('next/dist/experimental/testmode/server-edge');\n interceptTestApis();\n propagator = wrapRequestHandler(propagator);\n }\n }\n}\nexport async function adapter(params) {\n var _getBuiltinRequestContext;\n ensureTestApisIntercepted();\n await ensureInstrumentationRegistered();\n // TODO-APP: use explicit marker for this\n const isEdgeRendering = typeof globalThis.__BUILD_MANIFEST !== 'undefined';\n params.request.url = normalizeRscURL(params.request.url);\n const requestURL = params.bypassNextUrl ? new URL(params.request.url) : new NextURL(params.request.url, {\n headers: params.request.headers,\n nextConfig: params.request.nextConfig\n });\n // Iterator uses an index to keep track of the current iteration. Because of deleting and appending below we can't just use the iterator.\n // Instead we use the keys before iteration.\n const keys = [\n ...requestURL.searchParams.keys()\n ];\n for (const key of keys){\n const value = requestURL.searchParams.getAll(key);\n const normalizedKey = normalizeNextQueryParam(key);\n if (normalizedKey) {\n requestURL.searchParams.delete(normalizedKey);\n for (const val of value){\n requestURL.searchParams.append(normalizedKey, val);\n }\n requestURL.searchParams.delete(key);\n }\n }\n // Ensure users only see page requests, never data requests.\n let buildId = process.env.__NEXT_BUILD_ID || '';\n if ('buildId' in requestURL) {\n buildId = requestURL.buildId || '';\n requestURL.buildId = '';\n }\n const requestHeaders = fromNodeOutgoingHttpHeaders(params.request.headers);\n const isNextDataRequest = requestHeaders.has('x-nextjs-data');\n const isRSCRequest = isRSCRequestHeader(requestHeaders.get(RSC_HEADER));\n if (isNextDataRequest && requestURL.pathname === '/index') {\n requestURL.pathname = '/';\n }\n const flightHeaders = new Map();\n // Headers should only be stripped for middleware\n if (!isEdgeRendering) {\n for (const header of FLIGHT_HEADERS){\n const value = requestHeaders.get(header);\n if (value !== null) {\n flightHeaders.set(header, value);\n requestHeaders.delete(header);\n }\n }\n }\n const normalizeURL = process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? new URL(params.request.url) : requestURL;\n const rscHash = normalizeURL.searchParams.get(NEXT_RSC_UNION_QUERY);\n const request = new NextRequestHint({\n page: params.page,\n // Strip internal query parameters off the request.\n input: stripInternalSearchParams(normalizeURL).toString(),\n init: {\n body: params.request.body,\n headers: requestHeaders,\n method: params.request.method,\n nextConfig: params.request.nextConfig,\n signal: params.request.signal\n }\n });\n /**\n * This allows to identify the request as a data request. The user doesn't\n * need to know about this property neither use it. We add it for testing\n * purposes.\n */ if (isNextDataRequest) {\n Object.defineProperty(request, '__isData', {\n enumerable: false,\n value: true\n });\n }\n if (// If we are inside of the next start sandbox\n // leverage the shared instance if not we need\n // to create a fresh cache instance each time\n !globalThis.__incrementalCacheShared && params.IncrementalCache) {\n ;\n globalThis.__incrementalCache = new params.IncrementalCache({\n CurCacheHandler: params.incrementalCacheHandler,\n minimalMode: process.env.NODE_ENV !== 'development',\n fetchCacheKeyPrefix: process.env.__NEXT_FETCH_CACHE_KEY_PREFIX,\n dev: process.env.NODE_ENV === 'development',\n requestHeaders: params.request.headers,\n getPrerenderManifest: ()=>{\n return {\n version: -1,\n routes: {},\n dynamicRoutes: {},\n notFoundRoutes: [],\n preview: getEdgePreviewProps()\n };\n }\n });\n }\n // if we're in an edge runtime sandbox, we should use the waitUntil\n // that we receive from the enclosing NextServer\n const outerWaitUntil = params.request.waitUntil ?? ((_getBuiltinRequestContext = getBuiltinRequestContext()) == null ? void 0 : _getBuiltinRequestContext.waitUntil);\n const event = new NextFetchEvent({\n request,\n page: params.page,\n context: outerWaitUntil ? {\n waitUntil: outerWaitUntil\n } : undefined\n });\n let response;\n let cookiesFromResponse;\n response = await propagator(request, ()=>{\n // we only care to make async storage available for middleware\n const isMiddleware = params.page === '/middleware' || params.page === '/src/middleware';\n if (isMiddleware) {\n // if we're in an edge function, we only get a subset of `nextConfig` (no `experimental`),\n // so we have to inject it via DefinePlugin.\n // in `next start` this will be passed normally (see `NextNodeServer.runMiddleware`).\n const waitUntil = event.waitUntil.bind(event);\n const closeController = new CloseController();\n return getTracer().trace(MiddlewareSpan.execute, {\n spanName: `middleware ${request.method} ${request.nextUrl.pathname}`,\n attributes: {\n 'http.target': request.nextUrl.pathname,\n 'http.method': request.method\n }\n }, async ()=>{\n try {\n var _params_request_nextConfig_experimental, _params_request_nextConfig, _params_request_nextConfig_experimental1, _params_request_nextConfig1;\n const onUpdateCookies = (cookies)=>{\n cookiesFromResponse = cookies;\n };\n const previewProps = getEdgePreviewProps();\n const page = '/' // Fake Work\n ;\n const fallbackRouteParams = null;\n const implicitTags = await getImplicitTags(page, request.nextUrl, fallbackRouteParams);\n const requestStore = createRequestStoreForAPI(request, request.nextUrl, implicitTags, onUpdateCookies, previewProps);\n const workStore = createWorkStore({\n page,\n renderOpts: {\n cacheLifeProfiles: (_params_request_nextConfig = params.request.nextConfig) == null ? void 0 : (_params_request_nextConfig_experimental = _params_request_nextConfig.experimental) == null ? void 0 : _params_request_nextConfig_experimental.cacheLife,\n experimental: {\n isRoutePPREnabled: false,\n cacheComponents: false,\n authInterrupts: !!((_params_request_nextConfig1 = params.request.nextConfig) == null ? void 0 : (_params_request_nextConfig_experimental1 = _params_request_nextConfig1.experimental) == null ? void 0 : _params_request_nextConfig_experimental1.authInterrupts)\n },\n supportsDynamicResponse: true,\n waitUntil,\n onClose: closeController.onClose.bind(closeController),\n onAfterTaskError: undefined\n },\n isPrefetchRequest: request.headers.get(NEXT_ROUTER_PREFETCH_HEADER) === '1',\n buildId: buildId ?? '',\n previouslyRevalidatedTags: []\n });\n return await workAsyncStorage.run(workStore, ()=>workUnitAsyncStorage.run(requestStore, params.handler, request, event));\n } finally{\n // middleware cannot stream, so we can consider the response closed\n // as soon as the handler returns.\n // we can delay running it until a bit later --\n // if it's needed, we'll have a `waitUntil` lock anyway.\n setTimeout(()=>{\n closeController.dispatchClose();\n }, 0);\n }\n });\n }\n return params.handler(request, event);\n });\n // check if response is a Response object\n if (response && !(response instanceof Response)) {\n throw Object.defineProperty(new TypeError('Expected an instance of Response to be returned'), \"__NEXT_ERROR_CODE\", {\n value: \"E567\",\n enumerable: false,\n configurable: true\n });\n }\n if (response && cookiesFromResponse) {\n response.headers.set('set-cookie', cookiesFromResponse);\n }\n /**\n * For rewrites we must always include the locale in the final pathname\n * so we re-create the NextURL forcing it to include it when the it is\n * an internal rewrite. Also we make sure the outgoing rewrite URL is\n * a data URL if the request was a data request.\n */ const rewrite = response == null ? void 0 : response.headers.get('x-middleware-rewrite');\n if (response && rewrite && (isRSCRequest || !isEdgeRendering)) {\n const destination = new NextURL(rewrite, {\n forceLocale: true,\n headers: params.request.headers,\n nextConfig: params.request.nextConfig\n });\n if (!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE && !isEdgeRendering) {\n if (destination.host === request.nextUrl.host) {\n destination.buildId = buildId || destination.buildId;\n response.headers.set('x-middleware-rewrite', String(destination));\n }\n }\n /**\n * When the request is a data request we must show if there was a rewrite\n * with an internal header so the client knows which component to load\n * from the data request.\n */ const { url: relativeDestination, isRelative } = parseRelativeURL(destination.toString(), requestURL.toString());\n if (!isEdgeRendering && isNextDataRequest && // if the rewrite is external and external rewrite\n // resolving config is enabled don't add this header\n // so the upstream app can set it instead\n !(process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE && relativeDestination.match(/http(s)?:\\/\\//))) {\n response.headers.set('x-nextjs-rewrite', relativeDestination);\n }\n // If this is an RSC request, and the pathname or search has changed, and\n // this isn't an external rewrite, we need to set the rewritten pathname and\n // query headers.\n if (isRSCRequest && isRelative) {\n if (requestURL.pathname !== destination.pathname) {\n response.headers.set(NEXT_REWRITTEN_PATH_HEADER, destination.pathname);\n }\n if (requestURL.search !== destination.search) {\n response.headers.set(NEXT_REWRITTEN_QUERY_HEADER, // remove the leading ? from the search string\n destination.search.slice(1));\n }\n }\n }\n /**\n * Always forward the `_rsc` search parameter to the rewritten URL for RSC requests,\n * unless it's already present. This is necessary to ensure that RSC hash validation\n * works correctly after a rewrite. For internal rewrites, the server can validate the\n * RSC hash using the original URL, so forwarding the `_rsc` parameter is less critical.\n * However, for external rewrites (where the request is proxied to another Next.js server),\n * the external server does not have access to the original URL or its search parameters.\n * In these cases, forwarding the `_rsc` parameter is essential so that the external server\n * can perform the correct RSC hash validation.\n */ if (response && rewrite && isRSCRequest && rscHash) {\n const rewriteURL = new URL(rewrite);\n if (!rewriteURL.searchParams.has(NEXT_RSC_UNION_QUERY)) {\n rewriteURL.searchParams.set(NEXT_RSC_UNION_QUERY, rscHash);\n response.headers.set('x-middleware-rewrite', rewriteURL.toString());\n }\n }\n /**\n * For redirects we will not include the locale in case when it is the\n * default and we must also make sure the outgoing URL is a data one if\n * the incoming request was a data request.\n */ const redirect = response == null ? void 0 : response.headers.get('Location');\n if (response && redirect && !isEdgeRendering) {\n const redirectURL = new NextURL(redirect, {\n forceLocale: false,\n headers: params.request.headers,\n nextConfig: params.request.nextConfig\n });\n /**\n * Responses created from redirects have immutable headers so we have\n * to clone the response to be able to modify it.\n */ response = new Response(response.body, response);\n if (!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE) {\n if (redirectURL.host === requestURL.host) {\n redirectURL.buildId = buildId || redirectURL.buildId;\n response.headers.set('Location', redirectURL.toString());\n }\n }\n /**\n * When the request is a data request we can't use the location header as\n * it may end up with CORS error. Instead we map to an internal header so\n * the client knows the destination.\n */ if (isNextDataRequest) {\n response.headers.delete('Location');\n response.headers.set('x-nextjs-redirect', getRelativeURL(redirectURL.toString(), requestURL.toString()));\n }\n }\n const finalResponse = response ? response : NextResponse.next();\n // Flight headers are not overridable / removable so they are applied at the end.\n const middlewareOverrideHeaders = finalResponse.headers.get('x-middleware-override-headers');\n const overwrittenHeaders = [];\n if (middlewareOverrideHeaders) {\n for (const [key, value] of flightHeaders){\n finalResponse.headers.set(`x-middleware-request-${key}`, value);\n overwrittenHeaders.push(key);\n }\n if (overwrittenHeaders.length > 0) {\n finalResponse.headers.set('x-middleware-override-headers', middlewareOverrideHeaders + ',' + overwrittenHeaders.join(','));\n }\n }\n return {\n response: finalResponse,\n waitUntil: getWaitUntilPromiseFromEvent(event) ?? Promise.resolve(),\n fetchMetrics: request.fetchMetrics\n };\n}\n\n//# sourceMappingURL=adapter.js.map","import { parse as cookieParse, serialize as cookieSerialize } from \"cookie\";\n/**\n * @deprecated Since v0.4.0: Please use {@link parseCookieHeader}. `parse` will\n * not be available for import starting v1.0.0 of `@supabase/ssr`.\n */\nexport const parse = cookieParse;\n/**\n * @deprecated Since v0.4.0: Please use {@link serializeCookieHeader}.\n * `serialize` will not be available for import starting v1.0.0 of\n * `@supabase/ssr`.\n */\nexport const serialize = cookieSerialize;\n/**\n * Parses the `Cookie` HTTP header into an array of cookie name-value objects.\n *\n * @param header The `Cookie` HTTP header. Decodes cookie names and values from\n * URI encoding first.\n */\nexport function parseCookieHeader(header) {\n const parsed = cookieParse(header);\n return Object.keys(parsed ?? {}).map((name) => ({\n name,\n value: parsed[name],\n }));\n}\n/**\n * Converts the arguments to a valid `Set-Cookie` header. Non US-ASCII chars\n * and other forbidden cookie chars will be URI encoded.\n *\n * @param name Name of cookie.\n * @param value Value of cookie.\n */\nexport function serializeCookieHeader(name, value, options) {\n return cookieSerialize(name, value, options);\n}\nexport function isBrowser() {\n return (typeof window !== \"undefined\" && typeof window.document !== \"undefined\");\n}\n//# sourceMappingURL=helpers.js.map","export const DEFAULT_COOKIE_OPTIONS = {\n path: \"/\",\n sameSite: \"lax\",\n httpOnly: false,\n // https://developer.chrome.com/blog/cookie-max-age-expires\n // https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-cookie-lifetime-limits\n maxAge: 400 * 24 * 60 * 60,\n};\n//# sourceMappingURL=constants.js.map","export const MAX_CHUNK_SIZE = 3180;\nconst CHUNK_LIKE_REGEX = /^(.*)[.](0|[1-9][0-9]*)$/;\nexport function isChunkLike(cookieName, key) {\n if (cookieName === key) {\n return true;\n }\n const chunkLike = cookieName.match(CHUNK_LIKE_REGEX);\n if (chunkLike && chunkLike[1] === key) {\n return true;\n }\n return false;\n}\n/**\n * create chunks from a string and return an array of object\n */\nexport function createChunks(key, value, chunkSize) {\n const resolvedChunkSize = chunkSize ?? MAX_CHUNK_SIZE;\n let encodedValue = encodeURIComponent(value);\n if (encodedValue.length <= resolvedChunkSize) {\n return [{ name: key, value }];\n }\n const chunks = [];\n while (encodedValue.length > 0) {\n let encodedChunkHead = encodedValue.slice(0, resolvedChunkSize);\n const lastEscapePos = encodedChunkHead.lastIndexOf(\"%\");\n // Check if the last escaped character is truncated.\n if (lastEscapePos > resolvedChunkSize - 3) {\n // If so, reslice the string to exclude the whole escape sequence.\n // We only reduce the size of the string as the chunk must\n // be smaller than the chunk size.\n encodedChunkHead = encodedChunkHead.slice(0, lastEscapePos);\n }\n let valueHead = \"\";\n // Check if the chunk was split along a valid unicode boundary.\n while (encodedChunkHead.length > 0) {\n try {\n // Try to decode the chunk back and see if it is valid.\n // Stop when the chunk is valid.\n valueHead = decodeURIComponent(encodedChunkHead);\n break;\n }\n catch (error) {\n if (error instanceof URIError &&\n encodedChunkHead.at(-3) === \"%\" &&\n encodedChunkHead.length > 3) {\n encodedChunkHead = encodedChunkHead.slice(0, encodedChunkHead.length - 3);\n }\n else {\n throw error;\n }\n }\n }\n chunks.push(valueHead);\n encodedValue = encodedValue.slice(encodedChunkHead.length);\n }\n return chunks.map((value, i) => ({ name: `${key}.${i}`, value }));\n}\n// Get fully constructed chunks\nexport async function combineChunks(key, retrieveChunk) {\n const value = await retrieveChunk(key);\n if (value) {\n return value;\n }\n let values = [];\n for (let i = 0;; i++) {\n const chunkName = `${key}.${i}`;\n const chunk = await retrieveChunk(chunkName);\n if (!chunk) {\n break;\n }\n values.push(chunk);\n }\n if (values.length > 0) {\n return values.join(\"\");\n }\n return null;\n}\nexport async function deleteChunks(key, retrieveChunk, removeChunk) {\n const value = await retrieveChunk(key);\n if (value) {\n await removeChunk(key);\n }\n for (let i = 0;; i++) {\n const chunkName = `${key}.${i}`;\n const chunk = await retrieveChunk(chunkName);\n if (!chunk) {\n break;\n }\n await removeChunk(chunkName);\n }\n}\n//# sourceMappingURL=chunker.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 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 let queue = 0;\n let queuedBits = 0;\n const emitter = (byte) => {\n queue = (queue << 8) | byte;\n queuedBits += 8;\n while (queuedBits >= 6) {\n const pos = (queue >> (queuedBits - 6)) & 63;\n base64.push(TO_BASE64URL[pos]);\n queuedBits -= 6;\n }\n };\n stringToUTF8(str, emitter);\n if (queuedBits > 0) {\n queue = queue << (6 - queuedBits);\n queuedBits = 6;\n while (queuedBits >= 6) {\n const pos = (queue >> (queuedBits - 6)) & 63;\n base64.push(TO_BASE64URL[pos]);\n queuedBits -= 6;\n }\n }\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 emit = (codepoint) => {\n conv.push(String.fromCodePoint(codepoint));\n };\n const state = {\n utf8seq: 0,\n codepoint: 0,\n };\n let queue = 0;\n let queuedBits = 0;\n for (let i = 0; i < str.length; i += 1) {\n const codepoint = str.charCodeAt(i);\n const bits = FROM_BASE64URL[codepoint];\n if (bits > -1) {\n // valid Base64-URL character\n queue = (queue << 6) | bits;\n queuedBits += 6;\n while (queuedBits >= 8) {\n stringFromUTF8((queue >> (queuedBits - 8)) & 0xff, state, emit);\n queuedBits -= 8;\n }\n }\n else if (bits === -2) {\n // ignore spaces, tabs, newlines, =\n continue;\n }\n else {\n throw new Error(`Invalid Base64-URL character \"${str.at(i)}\" at position ${i}`);\n }\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//# sourceMappingURL=base64url.js.map","export * from \"./helpers\";\nexport * from \"./constants\";\nexport * from \"./chunker\";\nexport * from \"./base64url\";\n//# sourceMappingURL=index.js.map","import { parse, serialize } from \"cookie\";\nimport { DEFAULT_COOKIE_OPTIONS, combineChunks, createChunks, isBrowser, isChunkLike, stringFromBase64URL, stringToBase64URL, } from \"./utils\";\nconst BASE64_PREFIX = \"base64-\";\n/**\n * Creates a storage client that handles cookies correctly for browser and\n * server clients with or without properly provided cookie methods.\n *\n * @param options The options passed to createBrowserClient or createServer client.\n *\n * @param isServerClient Whether it's called from createServerClient.\n */\nexport function createStorageFromOptions(options, isServerClient) {\n const cookies = options.cookies ?? null;\n const cookieEncoding = options.cookieEncoding;\n const setItems = {};\n const removedItems = {};\n let getAll;\n let setAll;\n if (cookies) {\n if (\"get\" in cookies) {\n // Just get is not enough, because the client needs to see what cookies\n // are already set and unset them if necessary. To attempt to fix this\n // behavior for most use cases, we pass \"hints\" which is the keys of the\n // storage items. They are then converted to their corresponding cookie\n // chunk names and are fetched with get. Only 5 chunks are fetched, which\n // should be enough for the majority of use cases, but does not solve\n // those with very large sessions.\n const getWithHints = async (keyHints) => {\n // optimistically find the first 5 potential chunks for the specified key\n const chunkNames = keyHints.flatMap((keyHint) => [\n keyHint,\n ...Array.from({ length: 5 }).map((_, i) => `${keyHint}.${i}`),\n ]);\n const chunks = [];\n for (let i = 0; i < chunkNames.length; i += 1) {\n const value = await cookies.get(chunkNames[i]);\n if (!value && typeof value !== \"string\") {\n continue;\n }\n chunks.push({ name: chunkNames[i], value });\n }\n // TODO: detect and log stale chunks error\n return chunks;\n };\n getAll = async (keyHints) => await getWithHints(keyHints);\n if (\"set\" in cookies && \"remove\" in cookies) {\n setAll = async (setCookies) => {\n for (let i = 0; i < setCookies.length; i += 1) {\n const { name, value, options } = setCookies[i];\n if (value) {\n await cookies.set(name, value, options);\n }\n else {\n await cookies.remove(name, options);\n }\n }\n };\n }\n else if (isServerClient) {\n setAll = async () => {\n console.warn(\"@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.\");\n };\n }\n else {\n throw new Error(\"@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)\");\n }\n }\n else if (\"getAll\" in cookies) {\n getAll = async () => await cookies.getAll();\n if (\"setAll\" in cookies) {\n setAll = cookies.setAll;\n }\n else if (isServerClient) {\n setAll = async () => {\n console.warn(\"@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.\");\n };\n }\n else {\n throw new Error(\"@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)\");\n }\n }\n else {\n // neither get nor getAll is present on cookies, only will occur if pure JavaScript is used, but cookies is an object\n throw new Error(`@supabase/ssr: ${isServerClient ? \"createServerClient\" : \"createBrowserClient\"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).${isBrowser() ? \" As this is called in a browser runtime, consider removing the cookies option object to use the document.cookie API automatically.\" : \"\"}`);\n }\n }\n else if (!isServerClient && isBrowser()) {\n // The environment is browser, so use the document.cookie API to implement getAll and setAll.\n const noHintGetAll = () => {\n const parsed = parse(document.cookie);\n return Object.keys(parsed).map((name) => ({\n name,\n value: parsed[name] ?? \"\",\n }));\n };\n getAll = () => noHintGetAll();\n setAll = (setCookies) => {\n setCookies.forEach(({ name, value, options }) => {\n document.cookie = serialize(name, value, options);\n });\n };\n }\n else if (isServerClient) {\n throw new Error(\"@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)\");\n }\n else {\n // getting cookies when there's no window but we're in browser mode can be OK, because the developer probably is not using auth functions\n getAll = () => {\n return [];\n };\n // this is NOT OK because the developer is using auth functions that require setting some state, so that must error out\n setAll = () => {\n throw new Error(\"@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed\");\n };\n }\n if (!isServerClient) {\n // This is the storage client to be used in browsers. It only\n // works on the cookies abstraction, unlike the server client\n // which only uses cookies to read the initial state. When an\n // item is set, cookies are both cleared and set to values so\n // that stale chunks are not left remaining.\n return {\n getAll, // for type consistency\n setAll, // for type consistency\n setItems, // for type consistency\n removedItems, // for type consistency\n storage: {\n isServer: false,\n getItem: async (key) => {\n const allCookies = await getAll([key]);\n const chunkedCookie = await combineChunks(key, async (chunkName) => {\n const cookie = allCookies?.find(({ name }) => name === chunkName) || null;\n if (!cookie) {\n return null;\n }\n return cookie.value;\n });\n if (!chunkedCookie) {\n return null;\n }\n let decoded = chunkedCookie;\n if (chunkedCookie.startsWith(BASE64_PREFIX)) {\n decoded = stringFromBase64URL(chunkedCookie.substring(BASE64_PREFIX.length));\n }\n return decoded;\n },\n setItem: async (key, value) => {\n const allCookies = await getAll([key]);\n const cookieNames = allCookies?.map(({ name }) => name) || [];\n const removeCookies = new Set(cookieNames.filter((name) => isChunkLike(name, key)));\n let encoded = value;\n if (cookieEncoding === \"base64url\") {\n encoded = BASE64_PREFIX + stringToBase64URL(value);\n }\n const setCookies = createChunks(key, encoded);\n setCookies.forEach(({ name }) => {\n removeCookies.delete(name);\n });\n const removeCookieOptions = {\n ...DEFAULT_COOKIE_OPTIONS,\n ...options?.cookieOptions,\n maxAge: 0,\n };\n const setCookieOptions = {\n ...DEFAULT_COOKIE_OPTIONS,\n ...options?.cookieOptions,\n maxAge: DEFAULT_COOKIE_OPTIONS.maxAge,\n };\n // the NextJS cookieStore API can get confused if the `name` from\n // options.cookieOptions leaks\n delete removeCookieOptions.name;\n delete setCookieOptions.name;\n const allToSet = [\n ...[...removeCookies].map((name) => ({\n name,\n value: \"\",\n options: removeCookieOptions,\n })),\n ...setCookies.map(({ name, value }) => ({\n name,\n value,\n options: setCookieOptions,\n })),\n ];\n if (allToSet.length > 0) {\n await setAll(allToSet);\n }\n },\n removeItem: async (key) => {\n const allCookies = await getAll([key]);\n const cookieNames = allCookies?.map(({ name }) => name) || [];\n const removeCookies = cookieNames.filter((name) => isChunkLike(name, key));\n const removeCookieOptions = {\n ...DEFAULT_COOKIE_OPTIONS,\n ...options?.cookieOptions,\n maxAge: 0,\n };\n // the NextJS cookieStore API can get confused if the `name` from\n // options.cookieOptions leaks\n delete removeCookieOptions.name;\n if (removeCookies.length > 0) {\n await setAll(removeCookies.map((name) => ({\n name,\n value: \"\",\n options: removeCookieOptions,\n })));\n }\n },\n },\n };\n }\n // This is the server client. It only uses getAll to read the initial\n // state. Any subsequent changes to the items is persisted in the\n // setItems and removedItems objects. createServerClient *must* use\n // getAll, setAll and the values in setItems and removedItems to\n // persist the changes *at once* when appropriate (usually only when\n // the TOKEN_REFRESHED, USER_UPDATED or SIGNED_OUT events are fired by\n // the Supabase Auth client).\n return {\n getAll,\n setAll,\n setItems,\n removedItems,\n storage: {\n // to signal to the libraries that these cookies are\n // coming from a server environment and their value\n // should not be trusted\n isServer: true,\n getItem: async (key) => {\n if (typeof setItems[key] === \"string\") {\n return setItems[key];\n }\n if (removedItems[key]) {\n return null;\n }\n const allCookies = await getAll([key]);\n const chunkedCookie = await combineChunks(key, async (chunkName) => {\n const cookie = allCookies?.find(({ name }) => name === chunkName) || null;\n if (!cookie) {\n return null;\n }\n return cookie.value;\n });\n if (!chunkedCookie) {\n return null;\n }\n let decoded = chunkedCookie;\n if (typeof chunkedCookie === \"string\" &&\n chunkedCookie.startsWith(BASE64_PREFIX)) {\n decoded = stringFromBase64URL(chunkedCookie.substring(BASE64_PREFIX.length));\n }\n return decoded;\n },\n setItem: async (key, value) => {\n // We don't have an `onAuthStateChange` event that can let us know that\n // the PKCE code verifier is being set. Therefore, if we see it being\n // set, we need to apply the storage (call `setAll` so the cookie is\n // set properly).\n if (key.endsWith(\"-code-verifier\")) {\n await applyServerStorage({\n getAll,\n setAll,\n // pretend only that the code verifier was set\n setItems: { [key]: value },\n // pretend that nothing was removed\n removedItems: {},\n }, {\n cookieOptions: options?.cookieOptions ?? null,\n cookieEncoding,\n });\n }\n setItems[key] = value;\n delete removedItems[key];\n },\n removeItem: async (key) => {\n // Intentionally not applying the storage when the key is the PKCE code\n // verifier, as usually right after it's removed other items are set,\n // so application of the storage will be handled by the\n // `onAuthStateChange` callback that follows removal -- usually as part\n // of the `exchangeCodeForSession` call.\n delete setItems[key];\n removedItems[key] = true;\n },\n },\n };\n}\n/**\n * When createServerClient needs to apply the created storage to cookies, it\n * should call this function which handles correcly setting cookies for stored\n * and removed items in the storage.\n */\nexport async function applyServerStorage({ getAll, setAll, setItems, removedItems, }, options) {\n const cookieEncoding = options.cookieEncoding;\n const cookieOptions = options.cookieOptions ?? null;\n const allCookies = await getAll([\n ...(setItems ? Object.keys(setItems) : []),\n ...(removedItems ? Object.keys(removedItems) : []),\n ]);\n const cookieNames = allCookies?.map(({ name }) => name) || [];\n const removeCookies = Object.keys(removedItems).flatMap((itemName) => {\n return cookieNames.filter((name) => isChunkLike(name, itemName));\n });\n const setCookies = Object.keys(setItems).flatMap((itemName) => {\n const removeExistingCookiesForItem = new Set(cookieNames.filter((name) => isChunkLike(name, itemName)));\n let encoded = setItems[itemName];\n if (cookieEncoding === \"base64url\") {\n encoded = BASE64_PREFIX + stringToBase64URL(encoded);\n }\n const chunks = createChunks(itemName, encoded);\n chunks.forEach((chunk) => {\n removeExistingCookiesForItem.delete(chunk.name);\n });\n removeCookies.push(...removeExistingCookiesForItem);\n return chunks;\n });\n const removeCookieOptions = {\n ...DEFAULT_COOKIE_OPTIONS,\n ...cookieOptions,\n maxAge: 0,\n };\n const setCookieOptions = {\n ...DEFAULT_COOKIE_OPTIONS,\n ...cookieOptions,\n maxAge: DEFAULT_COOKIE_OPTIONS.maxAge,\n };\n // the NextJS cookieStore API can get confused if the `name` from\n // options.cookieOptions leaks\n delete removeCookieOptions.name;\n delete setCookieOptions.name;\n await setAll([\n ...removeCookies.map((name) => ({\n name,\n value: \"\",\n options: removeCookieOptions,\n })),\n ...setCookies.map(({ name, value }) => ({\n name,\n value,\n options: setCookieOptions,\n })),\n ]);\n}\n//# sourceMappingURL=cookies.js.map","import { createClient, } from \"@supabase/supabase-js\";\nimport { VERSION } from \"./version\";\nimport { isBrowser } from \"./utils\";\nimport { createStorageFromOptions } from \"./cookies\";\nlet cachedBrowserClient;\nexport function createBrowserClient(supabaseUrl, supabaseKey, options) {\n // singleton client is created only if isSingleton is set to true, or if isSingleton is not defined and we detect a browser\n const shouldUseSingleton = options?.isSingleton === true ||\n ((!options || !(\"isSingleton\" in options)) && isBrowser());\n if (shouldUseSingleton && cachedBrowserClient) {\n return cachedBrowserClient;\n }\n if (!supabaseUrl || !supabaseKey) {\n throw new Error(`@supabase/ssr: Your project's URL and API key are required to create a Supabase client!\\n\\nCheck your Supabase project's API settings to find these values\\n\\nhttps://supabase.com/dashboard/project/_/settings/api`);\n }\n const { storage } = createStorageFromOptions({\n ...options,\n cookieEncoding: options?.cookieEncoding ?? \"base64url\",\n }, false);\n const client = createClient(supabaseUrl, supabaseKey, {\n // TODO: resolve type error\n ...options,\n global: {\n ...options?.global,\n headers: {\n ...options?.global?.headers,\n \"X-Client-Info\": `supabase-ssr/${VERSION} createBrowserClient`,\n },\n },\n auth: {\n ...options?.auth,\n ...(options?.cookieOptions?.name\n ? { storageKey: options.cookieOptions.name }\n : null),\n flowType: \"pkce\",\n autoRefreshToken: isBrowser(),\n detectSessionInUrl: isBrowser(),\n persistSession: true,\n storage,\n },\n });\n if (shouldUseSingleton) {\n cachedBrowserClient = client;\n }\n return client;\n}\n//# sourceMappingURL=createBrowserClient.js.map","//#region src/lib/tracingRegistry.ts\nconst EXTRACTOR_KEY = Symbol.for(\"@supabase/supabase-js.traceContextExtractor\");\n/**\n* Register the trace context extractor used by all Supabase clients in this\n* process. Called by the `@supabase/supabase-js/tracing` subpath as an import\n* side effect; the last registration wins.\n*/\nfunction registerTraceContextExtractor(extractor) {\n\tglobalThis[EXTRACTOR_KEY] = extractor;\n}\n/**\n* The currently registered trace context extractor, if any.\n*/\nfunction getTraceContextExtractor() {\n\treturn globalThis[EXTRACTOR_KEY];\n}\n\n//#endregion\nexport { registerTraceContextExtractor as n, getTraceContextExtractor as t };\n//# sourceMappingURL=tracingRegistry.mjs.map","/******************************************************************************\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 * - The API key is sent in the `apikey` header. The `Authorization` header is reserved\n * for the signed-in user's JWT (or a custom auth token) — when there is no session, a\n * new-format API key (`sb_publishable_…` / `sb_secret_…`) is not sent as a Bearer token.\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. Log the full error object so fields like `name`, `context`, and any structured body aren't hidden.\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.error('Function returned an error', errorMessage)\n * } else if (error instanceof FunctionsRelayError) {\n * console.error('Relay error:', error)\n * } else if (error instanceof FunctionsFetchError) {\n * console.error('Fetch error:', error)\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, _b;\n let timeoutId;\n let timeoutController;\n let onAbort;\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 // HTTP header names are case-insensitive, so detect a caller-supplied Content-Type\n // regardless of casing — otherwise the SDK injects a second, conflicting Content-Type.\n const hasContentTypeHeader = !!headers && Object.keys(headers).some((key) => key.toLowerCase() === 'content-type');\n if (functionArgs && !hasContentTypeHeader) {\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 // Store the listener so we can clean it up in finally.\n onAbort = () => timeoutController.abort();\n signal.addEventListener('abort', onAbort);\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 // HTTP media types are case-insensitive (RFC 9110), so normalize before\n // matching — otherwise an \"Application/JSON\" response falls through to text.\n let responseType = ((_a = response.headers.get('Content-Type')) !== null && _a !== void 0 ? _a : 'text/plain')\n .split(';')[0]\n .trim()\n .toLowerCase();\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 // Remove the cross-signal listener to prevent memory leaks when the caller\n // reuses the same AbortSignal across multiple invocations.\n if (onAbort) {\n (_b = options.signal) === null || _b === void 0 ? void 0 : _b.removeEventListener('abort', onAbort);\n }\n }\n });\n }\n}\n//# sourceMappingURL=FunctionsClient.js.map","//#region src/PostgrestError.ts\n/**\n* Error format\n*\n* Returned by every PostgREST request that fails. When something fails, the\n* single most useful field is usually `hint` — Postgres often returns the\n* actionable fix there, not in `message`. Always log the full object (e.g.\n* `console.error(error)`); logging only `error.message` hides the hint.\n*\n* Read the fields in roughly this order of usefulness:\n*\n* - `hint` — actionable guidance from the database when available. For\n* permission-denied errors (`42501`), this is the literal SQL to fix the\n* problem, e.g.\n* `\"Grant the required privileges to the current role with: GRANT SELECT ON public.users TO anon;\"`.\n* Missing column? `hint` suggests the column you probably meant. Whenever\n* Postgres knows the fix, it puts it in `hint`.\n* - `code` — stable error code from PostgREST (e.g. `PGRST301`) or Postgres\n* (e.g. `42501`). Branch on this rather than on `message` text.\n* - `details` — extra context, often the offending value, key, or row.\n* - `message` — human-readable summary. Useful in UI strings; less useful\n* for debugging.\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/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 \\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/fetchWithRetry.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}\n/**\n* Perform a request with the retry policy shared by every PostgREST call.\n*\n* Idempotent methods (GET, HEAD, OPTIONS) are retried up to\n* `DEFAULT_MAX_RETRIES` times when the fetch rejects or the server answers\n* with a retryable status (503, 520). The wait honours the `Retry-After`\n* header when present and backs off exponentially otherwise. Retried\n* attempts carry an `X-Retry-Count` header. Aborted requests and\n* non-idempotent methods are never retried: their rejection propagates\n* unchanged. A response body is drained before its request is retried.\n*/\nasync function fetchWithRetry(fetchImpl, url, request, retryEnabled) {\n\tlet attemptCount = 0;\n\twhile (true) {\n\t\tconst headers = _objectSpread2({}, request.headers);\n\t\tif (attemptCount > 0) headers[\"X-Retry-Count\"] = String(attemptCount);\n\t\tlet res;\n\t\ttry {\n\t\t\tres = await fetchImpl(url, {\n\t\t\t\tmethod: request.method,\n\t\t\t\theaders,\n\t\t\t\tbody: request.body,\n\t\t\t\tsignal: request.signal\n\t\t\t});\n\t\t} catch (fetchError) {\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\") throw fetchError;\n\t\t\tif (!RETRYABLE_METHODS.includes(request.method)) throw fetchError;\n\t\t\tif (retryEnabled && attemptCount < DEFAULT_MAX_RETRIES) {\n\t\t\t\tconst delay = getRetryDelay(attemptCount);\n\t\t\t\tattemptCount++;\n\t\t\t\tawait sleep(delay, request.signal);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthrow fetchError;\n\t\t}\n\t\tif (shouldRetry(request.method, res.status, attemptCount, retryEnabled)) {\n\t\t\tvar _res$headers$get, _res$headers;\n\t\t\tconst retryAfterHeader = (_res$headers$get = (_res$headers = res.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\tconst delay = retryAfterHeader !== null ? Math.max(0, parseInt(retryAfterHeader, 10) || 0) * 1e3 : getRetryDelay(attemptCount);\n\t\t\tawait res.text();\n\t\t\tattemptCount++;\n\t\t\tawait sleep(delay, request.signal);\n\t\t\tcontinue;\n\t\t}\n\t\treturn res;\n\t}\n}\n\n//#endregion\n//#region src/PostgrestBuilder.ts\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* @subcategory Using modifiers\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 on this single PostgREST request, overriding any header\n\t* with the same name set on the client.\n\t*\n\t* This is an advanced escape hatch for one-off needs (passing a custom\n\t* `Authorization` for a single query, attaching a tracing header, etc.).\n\t* Most callers do not need it: configure client-wide headers via the\n\t* `headers` option when constructing the client, and authentication via\n\t* Supabase Auth.\n\t*\n\t* @param name - HTTP header name\n\t* @param value - HTTP header value\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\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* @subcategory Using modifiers\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\tconst headers = {};\n\t\t\t_this.headers.forEach((value, key) => {\n\t\t\t\theaders[key] = value;\n\t\t\t});\n\t\t\tconst res$1 = await fetchWithRetry(_fetch, _this.url.toString(), {\n\t\t\t\tmethod: _this.method,\n\t\t\t\theaders,\n\t\t\t\tbody: JSON.stringify(_this.body, (_, value) => typeof value === \"bigint\" ? value.toString() : value),\n\t\t\t\tsignal: _this.signal\n\t\t\t}, _this.retryEnabled);\n\t\t\treturn await _this.processResponse(res$1);\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$get;\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 try {\n\t\t\t\t\tdata = JSON.parse(body);\n\t\t\t\t} catch (_unused) {\n\t\t\t\t\terror = { message: body };\n\t\t\t\t\tdata = null;\n\t\t\t\t\tif (_this2.shouldThrowOnError) throw new PostgrestError({\n\t\t\t\t\t\tmessage: body,\n\t\t\t\t\t\tdetails: \"\",\n\t\t\t\t\t\thint: \"\",\n\t\t\t\t\t\tcode: \"\"\n\t\t\t\t\t});\n\t\t\t\t}\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$get = res.headers.get(\"content-range\")) === null || _res$headers$get === void 0 ? void 0 : _res$headers$get.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\tif (_this2.shouldThrowOnError) {\n\t\t\t\t\tvar _error$hint;\n\t\t\t\t\tthrow new PostgrestError(_objectSpread2(_objectSpread2({}, error), {}, { hint: (_error$hint = error.hint) !== null && _error$hint !== void 0 ? _error$hint : \"\" }));\n\t\t\t\t}\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 (_unused2) {\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* @subcategory Using modifiers\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\tthrowOnError() {\n\t\treturn super.throwOnError();\n\t}\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\": \"\"\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 `rows`.\n\t*\n\t* @param rows - 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(rows, { foreignTable, referencedTable = foreignTable } = {}) {\n\t\tconst key = typeof referencedTable === \"undefined\" ? \"limit\" : `${referencedTable}.limit`;\n\t\tthis.url.searchParams.set(key, `${rows}`);\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\": 0,\n\t* \"statusText\": \"\"\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* @subcategory Using modifiers\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* Dry-run this request: execute the query but discard the changes.\n\t*\n\t* Server-side, PostgREST runs the query inside a transaction and rolls it back\n\t* instead of committing. The response still contains the data that *would* have\n\t* been returned — `RETURNING` clauses execute and RLS, triggers, and constraints\n\t* are all evaluated — but no row is actually inserted, updated, or deleted.\n\t*\n\t* This affects only the single request it is chained to. The JS caller has no\n\t* handle on the transaction: supabase-js does not group multiple queries into\n\t* one transaction. For multi-statement transactional logic, use a database\n\t* function (`supabase.rpc(...)`).\n\t*\n\t* Sets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\n\t* preferences for the underlying mechanism.\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*\n\t* @example Validate an insert without persisting\n\t* ```ts\n\t* const { data, error } = await supabase\n\t* .from('countries')\n\t* .insert({ name: 'France' })\n\t* .select()\n\t* .rollback()\n\t* // `data` shows what would have been inserted; nothing is saved.\n\t* ```\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 rows - The maximum number of rows that can be affected\n\t*\n\t* @category Database\n\t* @subcategory Using modifiers\n\t*/\n\tmaxAffected(rows) {\n\t\tthis.headers.append(\"Prefer\", \"handling=strict\");\n\t\tthis.headers.append(\"Prefer\", `max-affected=${rows}`);\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\tthrowOnError() {\n\t\treturn super.throwOnError();\n\t}\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\tgt(column, value) {\n\t\tthis.url.searchParams.append(column, `gt.${value}`);\n\t\treturn this;\n\t}\n\tgte(column, value) {\n\t\tthis.url.searchParams.append(column, `gte.${value}`);\n\t\treturn this;\n\t}\n\tlt(column, value) {\n\t\tthis.url.searchParams.append(column, `lt.${value}`);\n\t\treturn this;\n\t}\n\tlte(column, value) {\n\t\tthis.url.searchParams.append(column, `lte.${value}`);\n\t\treturn this;\n\t}\n\tlike(column, pattern) {\n\t\tthis.url.searchParams.append(column, `like.${pattern}`);\n\t\treturn this;\n\t}\n\tlikeAllOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `like(all).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\tlikeAnyOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `like(any).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\tilike(column, pattern) {\n\t\tthis.url.searchParams.append(column, `ilike.${pattern}`);\n\t\treturn this;\n\t}\n\tilikeAllOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `ilike(all).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\tilikeAnyOf(column, patterns) {\n\t\tthis.url.searchParams.append(column, `ilike(any).{${patterns.join(\",\")}}`);\n\t\treturn this;\n\t}\n\tregexMatch(column, pattern) {\n\t\tthis.url.searchParams.append(column, `match.${pattern}`);\n\t\treturn this;\n\t}\n\tregexIMatch(column, pattern) {\n\t\tthis.url.searchParams.append(column, `imatch.${pattern}`);\n\t\treturn this;\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\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\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\trangeGt(column, range) {\n\t\tthis.url.searchParams.append(column, `sr.${range}`);\n\t\treturn this;\n\t}\n\trangeGte(column, range) {\n\t\tthis.url.searchParams.append(column, `nxl.${range}`);\n\t\treturn this;\n\t}\n\trangeLt(column, range) {\n\t\tthis.url.searchParams.append(column, `sl.${range}`);\n\t\treturn this;\n\t}\n\trangeLte(column, range) {\n\t\tthis.url.searchParams.append(column, `nxr.${range}`);\n\t\treturn this;\n\t}\n\trangeAdjacent(column, range) {\n\t\tthis.url.searchParams.append(column, `adj.${range}`);\n\t\treturn this;\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\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\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\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* @exampleDescription Handling errors\n\t* The most useful field on a Postgres error is usually `hint` — when the database knows the fix, it puts the literal SQL there. For example, a permission-denied error (`code: '42501'`) arrives with a `hint` like `\"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\"`. Log the full `error` object so the hint isn't hidden behind `error.message`.\n\t*\n\t* @example Handling errors\n\t* ```js\n\t* const { data, error } = await supabase.from('characters').select()\n\t* if (error) {\n\t* // Logs the full error: message, code, details, and hint.\n\t* console.error(error)\n\t* return\n\t* }\n\t* ```\n\t*\n\t* @exampleResponse Handling errors\n\t* ```json\n\t* {\n\t* \"error\": {\n\t* \"code\": \"42501\",\n\t* \"details\": null,\n\t* \"hint\": \"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\",\n\t* \"message\": \"permission denied for table characters\"\n\t* },\n\t* \"status\": 401,\n\t* \"statusText\": \"\"\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\": \"\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Handling errors\n\t* `error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`.\n\t*\n\t* @example Handling errors\n\t* ```js\n\t* const { error } = await supabase.from('countries').insert({ id: 1, name: 'Mordor' })\n\t* if (error) console.error(error)\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\": \"\"\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\": \"\"\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\": \"\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Handling errors\n\t* `error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT, UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`.\n\t*\n\t* @example Handling errors\n\t* ```js\n\t* const { data, error } = await supabase.from('instruments').upsert({ id: 1, name: 'piano' }).select()\n\t* if (error) console.error(error)\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\": \"\"\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\": \"\"\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\": \"\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Handling errors\n\t* `error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`.\n\t*\n\t* @example Handling errors\n\t* ```js\n\t* const { error } = await supabase.from('instruments').update({ name: 'piano' }).eq('id', 1)\n\t* if (error) console.error(error)\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\": \"\"\n\t* }\n\t* ```\n\t*\n\t* @exampleDescription Handling errors\n\t* `error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT DELETE ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`.\n\t*\n\t* @example Handling errors\n\t* ```js\n\t* const { error } = await supabase.from('countries').delete().eq('id', 1)\n\t* if (error) console.error(error)\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\": \"\"\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 src/PostgrestClient.ts\n/**\n* Build the error for a failed OpenAPI request. PostgREST answers with a JSON\n* error object when it produced the failure itself; proxies and disabled\n* OpenAPI output answer with plain text or an empty body, in which case the\n* body (or, failing that, the status text) becomes the message.\n*/\nfunction toOpenApiError(body, statusText) {\n\ttry {\n\t\tconst parsed = JSON.parse(body);\n\t\tif (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n\t\t\tvar _parsed$message, _parsed$details, _parsed$hint, _parsed$code;\n\t\t\treturn new PostgrestError({\n\t\t\t\tmessage: String((_parsed$message = parsed.message) !== null && _parsed$message !== void 0 ? _parsed$message : body),\n\t\t\t\tdetails: (_parsed$details = parsed.details) !== null && _parsed$details !== void 0 ? _parsed$details : \"\",\n\t\t\t\thint: (_parsed$hint = parsed.hint) !== null && _parsed$hint !== void 0 ? _parsed$hint : \"\",\n\t\t\t\tcode: (_parsed$code = parsed.code) !== null && _parsed$code !== void 0 ? _parsed$code : \"\"\n\t\t\t});\n\t\t}\n\t} catch (_unused) {}\n\treturn new PostgrestError({\n\t\tmessage: body || statusText,\n\t\tdetails: \"\",\n\t\thint: \"\",\n\t\tcode: \"\"\n\t});\n}\n/**\n* Build the response for a request that yielded no readable body: the fetch\n* itself rejected (no status is known, so it is 0), or the body stream failed\n* while being read (the response status is preserved).\n*/\nfunction toTransportFailure(cause, status, statusText) {\n\tvar _err$name;\n\tconst err = cause;\n\treturn {\n\t\tsuccess: false,\n\t\terror: new PostgrestError({\n\t\t\tmessage: `${(_err$name = err === null || err === void 0 ? void 0 : err.name) !== null && _err$name !== void 0 ? _err$name : \"FetchError\"}: ${err === null || err === void 0 ? void 0 : err.message}`,\n\t\t\tdetails: \"\",\n\t\t\thint: \"\",\n\t\t\tcode: \"\"\n\t\t}),\n\t\tdata: null,\n\t\tcount: null,\n\t\tstatus,\n\t\tstatusText\n\t};\n}\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\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* Fetch the OpenAPI description PostgREST publishes for this client's schema.\n\t*\n\t* The document lists only the tables, views and functions the caller's role\n\t* holds privileges on; PostgREST applies that filtering server-side. The\n\t* schema is the one this client was created with, so call `.schema()` first\n\t* to describe a different one. Transient failures are retried according to\n\t* the client's `retry` option, like any other idempotent request.\n\t*\n\t* @example\n\t* ```ts\n\t* const { data, error } = await supabase.getOpenApiSpec()\n\t* ```\n\t*\n\t* @example Describe a schema other than the client default\n\t* ```ts\n\t* const { data, error } = await supabase.schema('billing').getOpenApiSpec()\n\t* ```\n\t*\n\t* @category Database\n\t*/\n\tasync getOpenApiSpec() {\n\t\tvar _this = this;\n\t\tvar _this$fetch;\n\t\tconst headers = new Headers(_this.headers);\n\t\theaders.set(\"Accept\", \"application/openapi+json\");\n\t\tif (_this.schemaName) headers.set(\"Accept-Profile\", _this.schemaName);\n\t\tconst requestHeaders = {};\n\t\theaders.forEach((value, key) => {\n\t\t\trequestHeaders[key] = value;\n\t\t});\n\t\tconst fetchImpl = (_this$fetch = _this.fetch) !== null && _this$fetch !== void 0 ? _this$fetch : globalThis.fetch;\n\t\tlet res;\n\t\ttry {\n\t\t\tvar _this$retry;\n\t\t\tres = await fetchWithRetry(fetchImpl, `${_this.url}/`, {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: requestHeaders\n\t\t\t}, (_this$retry = _this.retry) !== null && _this$retry !== void 0 ? _this$retry : true);\n\t\t} catch (fetchError) {\n\t\t\treturn toTransportFailure(fetchError, 0, \"\");\n\t\t}\n\t\tlet body;\n\t\ttry {\n\t\t\tbody = await res.text();\n\t\t} catch (readError) {\n\t\t\treturn toTransportFailure(readError, res.status, res.statusText);\n\t\t}\n\t\tif (res.ok) try {\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\terror: null,\n\t\t\t\tdata: JSON.parse(body),\n\t\t\t\tcount: null,\n\t\t\t\tstatus: res.status,\n\t\t\t\tstatusText: res.statusText\n\t\t\t};\n\t\t} catch (_unused2) {}\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: toOpenApiError(body, res.statusText),\n\t\t\tdata: null,\n\t\t\tcount: null,\n\t\t\tstatus: res.status,\n\t\t\tstatusText: res.statusText\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$fetch2;\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$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};\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 // Reaching here means an earlier check did not find a native WebSocket,\n // so this Node.js process is missing the global WebSocket (Node.js 22+).\n return {\n type: 'unsupported',\n error: 'Node.js detected but native WebSocket not found.',\n workaround: 'Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.',\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';\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.117.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;\n/** Mirrors the Realtime server's own default for `postgres_changes_options.timeout`. */\nexport const DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT = 15000;\n/**\n * Headroom added to the join timeout when waiting on postgres_changes, covering the\n * CHANNEL_ERROR_BACKOFF_MS sleep (5s by default) the server takes before rejecting a join.\n */\nexport const POSTGRES_CHANGES_WAIT_ERROR_GRACE = 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 // Encode each header field as UTF-8. The length prefixes are byte counts and\n // the decode side uses TextDecoder (UTF-8), so measuring with String.length\n // and writing with charCodeAt would corrupt any multi-byte character (e.g.\n // accents or emoji) and desynchronize the buffer.\n const encoder = new TextEncoder();\n const topic = encoder.encode(message.topic);\n const ref = encoder.encode((_a = message.ref) !== null && _a !== void 0 ? _a : '');\n const joinRef = encoder.encode((_b = message.join_ref) !== null && _b !== void 0 ? _b : '');\n const userEvent = encoder.encode(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 = encoder.encode(Object.keys(rest).length === 0 ? '' : JSON.stringify(rest));\n // Validate byte 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 const view = new DataView(header);\n const bytes = new Uint8Array(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 bytes.set(joinRef, offset);\n offset += joinRef.length;\n bytes.set(ref, offset);\n offset += ref.length;\n bytes.set(topic, offset);\n offset += topic.length;\n bytes.set(userEvent, offset);\n offset += userEvent.length;\n bytes.set(metadata, offset);\n offset += metadata.length;\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 MAX_LONGPOLL_BATCH_SIZE = 100;\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, offset = 0) {\n this.awaitingBatchAck = true;\n const next = offset + MAX_LONGPOLL_BATCH_SIZE;\n const batch = messages.slice(offset, next);\n this.ajax(\"POST\", { \"Content-Type\": \"application/x-ndjson\" }, batch.join(\"\\n\"), () => this.onerror(\"timeout\"), (resp) => {\n if (!resp || resp.status !== 200) {\n this.awaitingBatchAck = false;\n this.onerror(resp && resp.status);\n this.closeAndRetry(1011, \"internal server error\", false);\n } else if (next < messages.length) {\n this.batchSend(messages, next);\n } else if (this.batchBuffer.length > 0) {\n this.batchSend(this.batchBuffer);\n this.batchBuffer = [];\n } else {\n this.awaitingBatchAck = false;\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 = /* @__PURE__ */ Object.create(null);\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.toNullProtoObj(this.clone(currentState));\n newState = this.toNullProtoObj(newState);\n let joins = /* @__PURE__ */ Object.create(null);\n let leaves = /* @__PURE__ */ Object.create(null);\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 state = this.toNullProtoObj(state);\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 // Presence keys are chosen on the server and may collide with\n // Object.prototype properties (\"__proto__\", \"constructor\", ...), so any\n // object indexed by presence key must not have a prototype chain\n //\n // TODO: replace the null-prototype objects with Maps in Phoenix 2.0\n // (breaking change for the lower-level static API)\n static toNullProtoObj(obj) {\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n let cleaned = /* @__PURE__ */ Object.create(null);\n Object.getOwnPropertyNames(obj).forEach((key) => {\n cleaned[key] = obj[key];\n });\n return cleaned;\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 encoder = new TextEncoder();\n let joinRefBytes = encoder.encode(join_ref);\n let refBytes = encoder.encode(ref);\n let topicBytes = encoder.encode(topic);\n let eventBytes = encoder.encode(event);\n this.assertFieldSize(joinRefBytes.byteLength, \"join_ref\");\n this.assertFieldSize(refBytes.byteLength, \"ref\");\n this.assertFieldSize(topicBytes.byteLength, \"topic\");\n this.assertFieldSize(eventBytes.byteLength, \"event\");\n let metaLength = this.META_LENGTH + joinRefBytes.byteLength + refBytes.byteLength + topicBytes.byteLength + eventBytes.byteLength;\n let header = new ArrayBuffer(this.HEADER_LENGTH + metaLength);\n let headerBytes = new Uint8Array(header);\n let view = new DataView(header);\n let offset = 0;\n view.setUint8(offset++, this.KINDS.push);\n view.setUint8(offset++, joinRefBytes.byteLength);\n view.setUint8(offset++, refBytes.byteLength);\n view.setUint8(offset++, topicBytes.byteLength);\n view.setUint8(offset++, eventBytes.byteLength);\n headerBytes.set(joinRefBytes, offset);\n offset += joinRefBytes.byteLength;\n headerBytes.set(refBytes, offset);\n offset += refBytes.byteLength;\n headerBytes.set(topicBytes, offset);\n offset += topicBytes.byteLength;\n headerBytes.set(eventBytes, offset);\n offset += eventBytes.byteLength;\n var combined = new Uint8Array(header.byteLength + payload.byteLength);\n combined.set(headerBytes, 0);\n combined.set(new Uint8Array(payload), header.byteLength);\n return combined.buffer;\n },\n assertFieldSize(size, name) {\n if (size > 255) {\n throw new Error(`unable to convert ${name} to binary: must be less than or equal to 255 bytes, but is ${size} bytes`);\n }\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 && closure(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 // Object spread compiles to Object.assign for ES2017, which treats __proto__ as a setter.\n const descriptors = Object.getOwnPropertyDescriptors(presence);\n const transformedPresence = Object.defineProperties({}, descriptors);\n transformedPresence['presence_ref'] = transformedPresence['phx_ref'];\n delete transformedPresence['phx_ref'];\n delete transformedPresence['phx_ref_prev'];\n return transformedPresence;\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","// Reserved characters that force PostgREST-style quoting: `[,()]` (which the\n// server reads as condition/list delimiters) plus `\"`/`\\` (escaped inside quotes).\nconst PostgrestReservedCharsRegexp = /[,()\"\\\\]/;\nconst needsQuoting = (value) => PostgrestReservedCharsRegexp.test(value) || value !== value.trim();\nconst quote = (value) => `\"${value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')}\"`;\nconst serializeScalar = (value) => {\n const serialized = value === null ? 'null' : String(value);\n return needsQuoting(serialized) ? quote(serialized) : serialized;\n};\nconst serializeIsValue = (value) => value === null ? 'null' : String(value);\n// Builds the `operator.value` portion of a filter (everything after `column=`).\nconst serialize = (operator, value) => {\n if (operator === 'in') {\n const values = Array.isArray(value) ? value : [value];\n if (values.length === 0) {\n throw new Error('Realtime `in` filter requires at least one value.');\n }\n const items = Array.from(new Set(values))\n .map((v) => serializeScalar(v))\n .join(',');\n return `in.(${items})`;\n }\n if (operator === 'is') {\n return `is.${serializeIsValue(value)}`;\n }\n return `${operator}.${serializeScalar(value)}`;\n};\n/**\n * Fluent builder for Postgres Changes `filter` strings.\n *\n * Each method appends a single `column=operator.value` condition. Multiple\n * conditions are combined with commas, which the Realtime server applies as an\n * `AND`. Pass an instance straight to `channel.on('postgres_changes', …)` — the\n * SDK serializes it to a string automatically — or call {@link build} to obtain\n * the string yourself.\n *\n * The builder mirrors the `postgrest-js` filter API (`eq`, `neq`, `in`, `like`,\n * `not`, …) for the operators that Realtime supports. Values containing reserved\n * characters (`,`, `(`, `)`, `\"`, `\\`) — or surrounding whitespace — are\n * automatically double-quoted and escaped the same way PostgREST does, so they\n * survive the server's filter parser; all other values are sent verbatim.\n *\n * The filter is snapshotted when passed to `channel.on(...)`; mutating the\n * builder afterwards does not affect an existing subscription. An empty builder\n * serializes to `''`, which the server treats as \"no filter\".\n *\n * @example\n * channel.on('postgres_changes', {\n * event: '*',\n * schema: 'public',\n * table: 'users',\n * filter: postgresChangesFilter().eq('id', 1).lt('age', 30), // → 'id=eq.1,age=lt.30'\n * }, (payload) => { ... })\n */\nexport class RealtimePostgresFilterBuilder {\n constructor() {\n this.filters = [];\n }\n add(column, operator, value, negate = false) {\n const prefix = negate ? 'not.' : '';\n this.filters.push(`${column}=${prefix}${serialize(operator, value)}`);\n return this;\n }\n /** Match rows where `column` equals `value` (`column=eq.value`). */\n eq(column, value) {\n return this.add(column, 'eq', value);\n }\n /** Match rows where `column` does not equal `value` (`column=neq.value`). */\n neq(column, value) {\n return this.add(column, 'neq', value);\n }\n /** Match rows where `column` is greater than `value` (`column=gt.value`). */\n gt(column, value) {\n return this.add(column, 'gt', value);\n }\n /** Match rows where `column` is greater than or equal to `value` (`column=gte.value`). */\n gte(column, value) {\n return this.add(column, 'gte', value);\n }\n /** Match rows where `column` is less than `value` (`column=lt.value`). */\n lt(column, value) {\n return this.add(column, 'lt', value);\n }\n /** Match rows where `column` is less than or equal to `value` (`column=lte.value`). */\n lte(column, value) {\n return this.add(column, 'lte', value);\n }\n /**\n * Match rows where `column` is one of `values` (`column=in.(a,b,c)`).\n * Requires at least one value; duplicates are removed. An element containing a\n * reserved character is double-quoted (`in.(\"a,b\",c)`), so commas inside an\n * element are preserved. `null` is intentionally not accepted (`IN (null)`\n * never matches in SQL) — use `is`/`not('col','is',null)` for null checks.\n */\n in(column, values) {\n return this.add(column, 'in', values);\n }\n /** Match rows where `column` matches the case-sensitive `pattern` (`column=like.pattern`). */\n like(column, pattern) {\n return this.add(column, 'like', pattern);\n }\n /** Match rows where `column` matches the case-insensitive `pattern` (`column=ilike.pattern`). */\n ilike(column, pattern) {\n return this.add(column, 'ilike', pattern);\n }\n /** Match rows where `column` matches the POSIX regex `pattern` (`column=match.pattern`). */\n match(column, pattern) {\n return this.add(column, 'match', pattern);\n }\n /** Match rows where `column` matches the case-insensitive POSIX regex `pattern` (`column=imatch.pattern`). */\n imatch(column, pattern) {\n return this.add(column, 'imatch', pattern);\n }\n /**\n * Match rows where `column` `IS` the given value (`column=is.null`).\n * Accepts `null`, a boolean, or the keywords `'null' | 'true' | 'false' | 'unknown'`.\n */\n is(column, value) {\n return this.add(column, 'is', value);\n }\n /** Match rows where `column` is distinct from `value` (`column=isdistinct.value`). NULL-safe inequality. */\n isDistinct(column, value) {\n return this.add(column, 'isdistinct', value);\n }\n not(column, operator, value) {\n return this.add(column, operator, value, true);\n }\n /**\n * Serialize all conditions into the comma-separated (AND) filter string.\n *\n * Conditions are joined by commas, which the server applies as `AND`. A scalar\n * value (or single `in` element) that contains a reserved character — `,`,\n * `(`, `)`, `\"`, `\\` — or surrounding whitespace is double-quoted and escaped\n * the way PostgREST does, so commas inside a value are preserved rather than\n * read as a condition boundary.\n */\n build() {\n return this.filters.join(',');\n }\n /** Alias for {@link build}; lets the builder be used wherever a string is expected. */\n toString() {\n return this.build();\n }\n}\n/**\n * Create a {@link RealtimePostgresFilterBuilder} for composing a Postgres\n * Changes `filter`. Conditions are combined with `AND`.\n *\n * @example\n * import { postgresChangesFilter } from '@supabase/realtime-js'\n *\n * channel.on('postgres_changes', {\n * event: 'UPDATE',\n * schema: 'public',\n * table: 'orders',\n * filter: postgresChangesFilter().gt('amount', 100).eq('status', 'open'),\n * }, (payload) => { ... })\n */\nexport const postgresChangesFilter = () => new RealtimePostgresFilterBuilder();\n//# sourceMappingURL=RealtimePostgresFilterBuilder.js.map","import { CHANNEL_EVENTS, CHANNEL_STATES, DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT, POSTGRES_CHANGES_WAIT_ERROR_GRACE, } 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';\nimport { RealtimePostgresFilterBuilder } from './RealtimePostgresFilterBuilder';\nexport { RealtimePostgresFilterBuilder, postgresChangesFilter, } from './RealtimePostgresFilterBuilder';\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 *\n * The optional `callback` receives a `status` and, on failure, an `err` argument.\n * Log the full `err` so its `cause`, `name`, and any structured fields aren't hidden\n * behind `err.message`.\n *\n * @category Realtime\n *\n * @example Handling errors\n * ```js\n * supabase.channel('room1').subscribe((status, err) => {\n * if (status === 'CHANNEL_ERROR' || status === 'TIMED_OUT') {\n * // Log the full error: its `cause` often holds the underlying reason.\n * console.error(status, err)\n * }\n * })\n * ```\n */\n subscribe(callback, timeout = this.timeout) {\n var _a, _b, _c, _d;\n if (!this.socket.isConnected()) {\n this.socket.connect();\n }\n if (this.channelAdapter.isClosed()) {\n const { config: { broadcast, presence, private: isPrivate, postgres_changes_options }, } = 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 = Object.assign({ broadcast, presence: Object.assign(Object.assign({}, presence), { enabled: presence_enabled }), postgres_changes, private: isPrivate }, (postgres_changes_options ? { postgres_changes_options } : {}));\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 const joinTimeout = (postgres_changes_options === null || postgres_changes_options === void 0 ? void 0 : postgres_changes_options.wait) && postgres_changes.length > 0\n ? Math.max(timeout, ((_d = postgres_changes_options.timeout) !== null && _d !== void 0 ? _d : DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT) +\n POSTGRES_CHANGES_WAIT_ERROR_GRACE)\n : timeout;\n this.channelAdapter\n .subscribe(joinTimeout)\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 * Tracking makes this client visible to other subscribers immediately, regardless of this\n * channel's `config.presence.enabled` setting or whether it has a `presence` listener — that\n * flag only affects whether *this* client receives presence updates from others (and, on\n * RLS-protected channels, whether it's authorized to do so).\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);\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 * Registering the same `postgres_changes` filter more than once on a channel is a no-op: the\n * duplicate is ignored and an error is logged, since the server only ever creates one\n * subscription per distinct filter.\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 * Payloads that are `ArrayBuffer` or `ArrayBufferView` (e.g. `Uint8Array`) are sent as\n * `application/octet-stream`; all other payloads are JSON-encoded.\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 isBinary = payload instanceof ArrayBuffer || ArrayBuffer.isView(payload);\n const headers = {\n apikey: this.socket.apiKey ? this.socket.apiKey : '',\n 'Content-Type': isBinary ? 'application/octet-stream' : 'application/json',\n };\n if (this.socket.accessTokenValue) {\n headers['Authorization'] = `Bearer ${this.socket.accessTokenValue}`;\n }\n const url = new URL(this.broadcastEndpointURL);\n url.pathname += `/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(event)}`;\n if (this.private) {\n url.searchParams.set('private', 'true');\n }\n const options = {\n method: 'POST',\n headers,\n body: isBinary ? payload : JSON.stringify(payload),\n };\n const response = await this._fetchWithTimeout(url.toString(), options, (_a = opts.timeout) !== null && _a !== void 0 ? _a : this.timeout);\n if (response.status === 202) {\n return { success: true };\n }\n if (response.status === 404) {\n return Promise.reject(new Error('httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. ' +\n 'Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. ' +\n 'See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md'));\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 const fallbackWarning = '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 if (this.socket.hasLogger()) {\n this.socket.log('channel', fallbackWarning);\n }\n else {\n console.warn(fallbackWarning);\n }\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 var _a;\n const typeLower = type.toLocaleLowerCase();\n // Serialize a postgres_changes filter builder into its string form so the\n // rest of the pipeline (join payload, server binding match) sees a string.\n // Duck-type `build()` in addition to `instanceof` so a builder constructed\n // against a duplicate copy of the package (separate module realm) still works.\n const filterValue = filter === null || filter === void 0 ? void 0 : filter.filter;\n if (filterValue instanceof RealtimePostgresFilterBuilder ||\n (typeof filterValue === 'object' &&\n filterValue !== null &&\n typeof filterValue.build === 'function')) {\n filter = Object.assign(Object.assign({}, filter), { filter: filterValue.build() });\n }\n // The server collapses identical postgres_changes filters, so keeping a duplicate here would\n // desync the client and server binding lists and make `subscribe()` fail with a mismatch.\n if (typeLower === REALTIME_LISTEN_TYPES.POSTGRES_CHANGES) {\n const duplicate = (_a = this.bindings[typeLower]) === null || _a === void 0 ? void 0 : _a.find((bind) => RealtimeChannel.isSamePostgresFilter(bind.filter, filter));\n if (duplicate) {\n this.socket.log('error', `duplicate \\`postgres_changes\\` binding for ${this.topic} ignored`, filter);\n return this;\n }\n }\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 /**\n * Two `postgres_changes` filters are the same when the server would collapse them into a single\n * subscription.\n * @internal\n */\n static isSamePostgresFilter(a, b) {\n var _a, _b, _c, _d;\n const selectA = (_b = (_a = a === null || a === void 0 ? void 0 : a.select) === null || _a === void 0 ? void 0 : _a.join()) !== null && _b !== void 0 ? _b : undefined;\n const selectB = (_d = (_c = b === null || b === void 0 ? void 0 : b.select) === null || _c === void 0 ? void 0 : _c.join()) !== null && _d !== void 0 ? _d : undefined;\n return ((a === null || a === void 0 ? void 0 : a.event) === (b === null || b === void 0 ? void 0 : b.event) &&\n RealtimeChannel.isFilterValueEqual(a === null || a === void 0 ? void 0 : a.schema, b === null || b === void 0 ? void 0 : b.schema) &&\n RealtimeChannel.isFilterValueEqual(a === null || a === void 0 ? void 0 : a.table, b === null || b === void 0 ? void 0 : b.table) &&\n RealtimeChannel.isFilterValueEqual(a === null || a === void 0 ? void 0 : a.filter, b === null || b === void 0 ? void 0 : b.filter) &&\n selectA === selectB);\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 hasLogger() {\n return this.socket.hasLogger();\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 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._authGeneration = 0;\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 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 true if a custom `logger` has been configured on this client.\n *\n * @category Realtime\n */\n hasLogger() {\n return this.socketAdapter.hasLogger();\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 AND no `accessToken` callback is configured,\n * it will be preserved across channel operations (including removeChannel and\n * resubscribe) and the client stays in manual-token mode.\n *\n * When an `accessToken` callback IS configured, the callback is the source of truth:\n * the client remains in callback mode and continues to refresh from it on heartbeat,\n * even after a bootstrap/override `setAuth(token)` call.\n *\n * The callback is called on connect and on every heartbeat (`heartbeatIntervalMs`,\n * default 25000ms). Its token must stay valid past the next call, or the server closes\n * the channel at expiry with no automatic resubscribe.\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 when no accessToken callback is set)\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 const authGeneration = ++this._authGeneration;\n const authPromise = this._performAuth(token, authGeneration);\n if (authGeneration === this._authGeneration) {\n this._authPromise = authPromise;\n }\n try {\n await authPromise;\n }\n finally {\n if (this._authPromise === authPromise) {\n this._authPromise = null;\n }\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).\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, authGeneration) {\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 if (authGeneration !== this._authGeneration) {\n return;\n }\n // Track whether this token was manually set or fetched via callback.\n // The callback is the source of truth for token refresh\n if (this.accessToken) {\n this._manuallySetToken = false;\n }\n else if (isManualToken) {\n this._manuallySetToken = true;\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 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 === 'disconnected')\n return;\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","import RealtimeClient from './RealtimeClient';\nimport RealtimeChannel, { RealtimePostgresFilterBuilder, postgresChangesFilter, REALTIME_LISTEN_TYPES, REALTIME_POSTGRES_CHANGES_LISTEN_EVENT, REALTIME_SUBSCRIBE_STATES, REALTIME_CHANNEL_STATES, } from './RealtimeChannel';\nimport RealtimePresence, { REALTIME_PRESENCE_LISTEN_EVENTS, } from './RealtimePresence';\nimport WebSocketFactory from './lib/websocket-factory';\nexport { RealtimePresence, RealtimeChannel, RealtimeClient, RealtimePostgresFilterBuilder, postgresChangesFilter, REALTIME_LISTEN_TYPES, REALTIME_POSTGRES_CHANGES_LISTEN_EVENT, REALTIME_PRESENCE_LISTEN_EVENTS, REALTIME_SUBSCRIBE_STATES, REALTIME_CHANNEL_STATES, WebSocketFactory, };\n//# sourceMappingURL=index.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\", code) {\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\tthis.code = code;\n\t}\n\ttoJSON() {\n\t\treturn _objectSpread2(_objectSpread2({}, super.toJSON()), {}, { code: this.code });\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* Percent-encodes each segment of a storage path so URL delimiters within a\n* key (e.g. `?`, `#`) can't be interpreted as a querystring/fragment start.\n*\n* Splits on `/` so real path separators stay literal — the storage server\n* routes on them and decodes each segment back to the original key.\n*\n* @param path - A bucket id or `bucketId/objectKey` path\n* @returns The path with each `/`-delimited segment percent-encoded\n*/\nconst encodeStoragePath = (path) => path.split(\"/\").map(encodeURIComponent).join(\"/\");\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, err === null || err === void 0 ? void 0 : err.code));\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* @example Handling errors\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .upload('public/avatar1.png', avatarFile)\n\t*\n\t* if (error) {\n\t* // Log the full error so fields like `statusCode` and `error` (the\n\t* // Storage error name, e.g. \"Duplicate\") aren't hidden behind `error.message`.\n\t* console.error(error)\n\t* return\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* @param options.sourceVersionId The version id of the source object to move.\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\tsourceVersionId: options === null || options === void 0 ? void 0 : options.sourceVersionId\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* @param options.sourceVersionId The version id of the source object to copy.\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\tsourceVersionId: options === null || options === void 0 ? void 0 : options.sourceVersionId\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* @param options.versionId Create a signed URL for a specific object version rather than the current one.\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(_objectSpread2({ expiresIn }, hasTransform ? { transform: options.transform } : {}), (options === null || options === void 0 ? void 0 : options.versionId) != null ? { versionId: options.versionId } : {}), { 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 Optional settings: `transform` to transform the asset before serving it to the client, `cacheNonce` to append a cache nonce parameter to the URL to invalidate the cache, and `versionId` to download a specific object version.\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\tif ((options === null || options === void 0 ? void 0 : options.versionId) != null) query.set(\"versionId\", String(options.versionId));\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* @param options Optional settings, including `versionId` to retrieve a specific object version.\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, options) {\n\t\tvar _this10 = this;\n\t\tconst _path = _this10._getFinalPath(path);\n\t\tconst query = new URLSearchParams();\n\t\tif ((options === null || options === void 0 ? void 0 : options.versionId) != null) query.set(\"versionId\", String(options.versionId));\n\t\tconst queryString = query.toString();\n\t\treturn _this10.handleOperation(async () => {\n\t\t\treturn recursiveToCamel(await get(_this10.fetch, `${_this10.url}/object/info/${_path}${queryString ? `?${queryString}` : \"\"}`, { 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* @param options.versionId Return the URL for a specific object version rather than the current one.\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\tif ((options === null || options === void 0 ? void 0 : options.versionId) != null) query.set(\"versionId\", String(options.versionId));\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. Each entry is either a path (deletes whichever\n\t* version is currently at that path, e.g. `'folder/image.png'`), or `{ path, versionId }` to\n\t* delete an exact version current or archived (e.g. `{ path: 'folder/image.png', versionId: '...' }`).\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* @example Delete a specific object version\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .remove([{ path: 'folder/avatar1.png', versionId: 'noncurrent-version-id' }])\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* Purges the CDN cache for a single object in this bucket.\n\t*\n\t* Maps to `DELETE /cdn/{bucket}/{path}` on the Storage API. The server\n\t* issues a CDN invalidation for the object and returns `{ message: 'success' }`.\n\t*\n\t* **Requires the `service_role` key.** The underlying endpoint enforces\n\t* `service_role` JWT — calls made with the anon key or a user JWT will be\n\t* rejected by the server.\n\t*\n\t* **Hosted CDN feature.** On self-hosted Supabase, the Storage service must\n\t* have `CDN_PURGE_ENDPOINT_URL` configured and the `purgeCache` tenant\n\t* feature enabled, otherwise the server returns an error.\n\t*\n\t* Operates on a single object path. There is no wildcard or recursion: pass\n\t* the exact path of the object you want invalidated.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param path The path (relative to the bucket) of the object to purge, e.g. `folder/avatar.png`.\n\t* @param options Optional purge cache options.\n\t* @param options.transformations If true, purges only transformations (resized/formatted variants), leaving the original cached file intact.\n\t* @param parameters Optional fetch parameters such as an `AbortController` signal.\n\t* @returns Promise with `{ data: { message }, error: null }` on success or `{ data: null, error }` on failure.\n\t*\n\t* @example Purge a single cached object\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .purgeCache('folder/avatar1.png')\n\t* ```\n\t*\n\t* @example Purge only transformations for a single object\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .from('avatars')\n\t* .purgeCache('folder/avatar1.png', { transformations: true })\n\t* ```\n\t*/\n\tasync purgeCache(path, options, parameters) {\n\t\tvar _this13 = this;\n\t\treturn _this13.handleOperation(async () => {\n\t\t\tconst _path = encodeStoragePath(_this13._getFinalPath(path));\n\t\t\tconst query = new URLSearchParams();\n\t\t\tif (options === null || options === void 0 ? void 0 : options.transformations) query.set(\"transformations\", \"true\");\n\t\t\tconst queryString = query.toString();\n\t\t\treturn await remove(_this13.fetch, `${_this13.url}/cdn/${_path}${queryString ? `?${queryString}` : \"\"}`, {}, { headers: _this13.headers }, parameters);\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 _this14 = this;\n\t\treturn _this14.handleOperation(async () => {\n\t\t\tconst sortBy = (options === null || options === void 0 ? void 0 : options.sortBy) ? _objectSpread2(_objectSpread2({}, DEFAULT_SEARCH_OPTIONS.sortBy), options.sortBy) : DEFAULT_SEARCH_OPTIONS.sortBy;\n\t\t\tconst body = _objectSpread2(_objectSpread2(_objectSpread2({}, DEFAULT_SEARCH_OPTIONS), options), {}, {\n\t\t\t\tsortBy,\n\t\t\t\tprefix: path || \"\"\n\t\t\t});\n\t\t\treturn await post(_this14.fetch, `${_this14.url}/object/list/${_this14.bucketId}`, body, { headers: _this14.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 _this15 = this;\n\t\treturn _this15.handleOperation(async () => {\n\t\t\tconst body = _objectSpread2({}, options);\n\t\t\treturn await post(_this15.fetch, `${_this15.url}/object/list-v2/${_this15.bucketId}`, body, { headers: _this15.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.117.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* @param options.versioningStatus the bucket's initial object versioning status.\n\t* The default value is `DISABLED`\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\tversioning_status: options.versioningStatus\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* @param options.versioningStatus the bucket's new object versioning status. `DISABLED` is not\n\t* valid here, there's no transition back to it once versioning has been touched.\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\tversioning_status: options.versioningStatus\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\t/**\n\t* Returns the lifecycle policy stored on a bucket.\n\t*\n\t* Fails with `NoSuchLifecycleConfiguration` when the bucket has no policy.\n\t*\n\t* These rules expire previous versions of objects, not the current one.\n\t* Turn versioning on or there is nothing for the policy to act on.\n\t* Standard buckets only. Returns `FeatureNotEnabled` if lifecycle is off\n\t* for the project.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id The unique identifier of the bucket.\n\t* @returns Promise with the lifecycle configuration or error\n\t*\n\t* @example Get lifecycle configuration\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .getBucketLifecycle('avatars')\n\t* ```\n\t*\n\t* Response:\n\t* ```json\n\t* {\n\t* \"data\": {\n\t* \"rules\": [\n\t* {\n\t* \"id\": \"expire-history\",\n\t* \"status\": \"Enabled\",\n\t* \"filter\": {},\n\t* \"noncurrentVersionExpiration\": {\n\t* \"noncurrentDays\": 30,\n\t* \"newerNoncurrentVersions\": 2\n\t* }\n\t* }\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: `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 getBucketLifecycle(id) {\n\t\tvar _this7 = this;\n\t\treturn _this7.handleOperation(async () => {\n\t\t\treturn await get(_this7.fetch, _this7.bucketLifecycleUrl(id), { headers: _this7.headers });\n\t\t});\n\t}\n\t/**\n\t* Replaces the lifecycle policy on a bucket.\n\t*\n\t* The `rules` array you send is the whole policy. Anything previously stored\n\t* is overwritten. Send at least one rule. Call {@link deleteBucketLifecycle}\n\t* to remove the policy.\n\t*\n\t* Each rule currently supports only `noncurrentVersionExpiration`. `filter`\n\t* is required and must be `{}`. Prefix filters, tag filters, and current-object\n\t* expiration are rejected. Rule IDs must be unique. Omit `id` and the\n\t* server generates one.\n\t*\n\t* Standard buckets only. Returns `FeatureNotEnabled` if lifecycle is off\n\t* for the project.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id The unique identifier of the bucket.\n\t* @param configuration The full lifecycle configuration to store.\n\t* @returns Promise with the stored configuration or error\n\t*\n\t* @example Replace lifecycle configuration\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .updateBucketLifecycle('avatars', {\n\t* rules: [\n\t* {\n\t* id: 'expire-history',\n\t* status: 'Enabled',\n\t* filter: {},\n\t* noncurrentVersionExpiration: {\n\t* noncurrentDays: 30,\n\t* newerNoncurrentVersions: 2,\n\t* },\n\t* },\n\t* ],\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 updateBucketLifecycle(id, configuration) {\n\t\tvar _this8 = this;\n\t\treturn _this8.handleOperation(async () => {\n\t\t\treturn await put(_this8.fetch, _this8.bucketLifecycleUrl(id), configuration, { headers: _this8.headers });\n\t\t});\n\t}\n\t/**\n\t* Removes the lifecycle policy from a bucket.\n\t*\n\t* Safe to call when no policy is stored. The response is still success.\n\t* Standard buckets only. Returns `FeatureNotEnabled` if lifecycle is off\n\t* for the project.\n\t*\n\t* @category Storage\n\t* @subcategory File Buckets\n\t* @param id The unique identifier of the bucket.\n\t* @returns Promise with success message or error\n\t*\n\t* @example Delete lifecycle configuration\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .deleteBucketLifecycle('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 `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 deleteBucketLifecycle(id) {\n\t\tvar _this9 = this;\n\t\treturn _this9.handleOperation(async () => {\n\t\t\treturn await remove(_this9.fetch, _this9.bucketLifecycleUrl(id), {}, { headers: _this9.headers });\n\t\t});\n\t}\n\t/**\n\t* Purges the CDN cache for an entire bucket.\n\t*\n\t* Maps to `DELETE /cdn/{bucket}` on the Storage API. The server\n\t* issues a CDN invalidation for the bucket and returns `{ message: 'success' }`.\n\t*\n\t* **Requires the `service_role` key.** The underlying endpoint enforces\n\t* `service_role` JWT — calls made with the anon key or a user JWT will be\n\t* rejected by the server.\n\t*\n\t* **Hosted CDN feature.** On self-hosted Supabase, the Storage service must\n\t* have `CDN_PURGE_ENDPOINT_URL` configured and the `purgeCache` tenant\n\t* feature enabled, otherwise the server returns an error.\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 purge from cache.\n\t* @param options Optional purge cache options.\n\t* @param options.transformations If true, purges only transformations (resized/formatted variants), leaving original cached files intact.\n\t* @param parameters Optional fetch parameters such as an `AbortController` signal.\n\t* @returns Promise with `{ data: { message }, error: null }` on success or `{ data: null, error }` on failure.\n\t*\n\t* @example Purge cache for an entire bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .purgeBucketCache('avatars')\n\t* ```\n\t*\n\t* @example Purge only transformations for an entire bucket\n\t* ```js\n\t* const { data, error } = await supabase\n\t* .storage\n\t* .purgeBucketCache('avatars', { transformations: true })\n\t* ```\n\t*/\n\tasync purgeBucketCache(id, options, parameters) {\n\t\tvar _this10 = this;\n\t\treturn _this10.handleOperation(async () => {\n\t\t\tconst query = new URLSearchParams();\n\t\t\tif (options === null || options === void 0 ? void 0 : options.transformations) query.set(\"transformations\", \"true\");\n\t\t\tconst queryString = query.toString();\n\t\t\treturn await remove(_this10.fetch, `${_this10.url}/cdn/${encodeStoragePath(id)}${queryString ? `?${queryString}` : \"\"}`, {}, { headers: _this10.headers }, parameters);\n\t\t});\n\t}\n\tbucketLifecycleUrl(id) {\n\t\treturn `${this.url}/bucket/${encodeStoragePath(id)}/lifecycle`;\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 vectors ordered by distance, an optional pagination token, or an 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.117.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;\n/**\n * After a refresh fails, serial callers (including the next auto-refresh\n * tick) within this window receive the cached failure instead of firing\n * another /token request. Two ticks: each outage burns at most one /token\n * call per cooldown window. Cleared on any successful refresh (locally or\n * via BroadcastChannel from another tab) and on `_removeSession`.\n */\nexport const REFRESH_FAILURE_COOLDOWN_MS = 2 * 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;\n/**\n * Reserved query parameter appended to `redirectTo` URLs (behind\n * `experimental.appendPkceFlowIdToRedirects`) that correlates a PKCE callback\n * with the code verifier stored when its flow started. It round-trips through\n * the auth server untouched and identifies a verifier slot in storage — the\n * verifier itself never appears in a URL.\n */\nexport const PKCE_FLOW_ID_PARAM = 'sb_flow_id';\n/**\n * Maximum number of PKCE code verifiers kept in storage at once. Starting a\n * new flow beyond this evicts the oldest pending verifier.\n */\nexport const PKCE_MAX_CONCURRENT_FLOWS = 5;\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 * Returned when the server rotated a refresh token successfully but the\n * client chose not to persist the rotated tokens because the local session\n * changed mid-flight. Usually means a concurrent `signOut` cleared storage\n * between when the refresh started and when it came back.\n *\n * Set on the `error` field of the refresh result so callers can tell \"we\n * got rotated tokens but threw them away\" apart from \"the refresh failed.\"\n * The rotated session on the server will be picked up on the next refresh\n * via GoTrue's parent-of-active path.\n *\n * @example\n * ```ts\n * import { isAuthRefreshDiscardedError } from '@supabase/auth-js'\n *\n * if (isAuthRefreshDiscardedError(error)) {\n * // Concurrent signOut/sign-in raced our refresh. Treat as a no-op.\n * }\n * ```\n */\nexport class AuthRefreshDiscardedError extends CustomAuthError {\n constructor(message = 'Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)') {\n super(message, 'AuthRefreshDiscardedError', 409, undefined);\n }\n}\nexport function isAuthRefreshDiscardedError(error) {\n return isAuthError(error) && error.name === 'AuthRefreshDiscardedError';\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, PKCE_FLOW_ID_PARAM, PKCE_MAX_CONCURRENT_FLOWS, } 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}\nconst PKCE_FLOW_ID_PATTERN = /^[a-zA-Z0-9_-]{8,64}$/;\n/**\n * Returns the flow id if it is a plausible flow id, `null` otherwise. Flow\n * ids can arrive via URL parameters, so anything outside the expected shape\n * is discarded before it is used to build a storage key.\n */\nexport function validatePKCEFlowId(flowId) {\n return typeof flowId === 'string' && PKCE_FLOW_ID_PATTERN.test(flowId) ? flowId : null;\n}\nexport function generatePKCEFlowId() {\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes, dec2hex).join('');\n }\n let flowId = '';\n for (let i = 0; i < 32; i++) {\n flowId += Math.floor(Math.random() * 16).toString(16);\n }\n return flowId;\n}\n// Slot keys deliberately end in `-code-verifier`: @supabase/ssr's server\n// cookie adapter only persists writes immediately for keys with that suffix\n// (no auth event fires when a verifier is stored). They also contain no dot,\n// because @supabase/ssr chunks oversized cookies as `<key>.<number>` and a\n// dot-delimited key could be mistaken for a chunk of the fixed\n// `-code-verifier` cookie and clobbered by its chunk management.\nexport const pkceVerifierSlotKey = (storageKey, flowId) => `${storageKey}-flow-${flowId}-code-verifier`;\nconst pkceFlowIndexKey = (storageKey) => `${storageKey}-flows-code-verifier`;\n/**\n * Storage adapters cannot enumerate keys, so the ids of pending verifier\n * slots are tracked in an index entry, oldest first. Index entries pass\n * through the same validation as URL-provided flow ids: with cookie-based\n * storage the index contents are no more trustworthy than a URL parameter.\n */\nasync function getPKCEFlowIndex(storage, storageKey) {\n const index = await getItemAsync(storage, pkceFlowIndexKey(storageKey));\n return Array.isArray(index)\n ? index.filter((id) => validatePKCEFlowId(id) !== null)\n : [];\n}\n/**\n * The index is read-modify-write without a lock: two concurrent starts (e.g.\n * two tabs) can lose one index update. The losing flow still works — its slot\n * is addressed directly by key — but its entry is missing from the index, so\n * it escapes both ring eviction and removeAllPKCEVerifiers: the orphaned slot\n * persists for the storage medium's lifetime (up to the cookie max age in\n * cookie storage) and repeated races accumulate one orphan each. Accepted\n * trade-off: locking every flow start is far more intrusive than the leak.\n */\nexport async function storePKCEVerifier(storage, storageKey, flowId, verifier, onEvictFlow) {\n await setItemAsync(storage, pkceVerifierSlotKey(storageKey, flowId), verifier);\n const index = (await getPKCEFlowIndex(storage, storageKey)).filter((id) => id !== flowId);\n index.push(flowId);\n while (index.length > PKCE_MAX_CONCURRENT_FLOWS) {\n const evicted = index.shift();\n await removeItemAsync(storage, pkceVerifierSlotKey(storageKey, evicted));\n onEvictFlow === null || onEvictFlow === void 0 ? void 0 : onEvictFlow(evicted);\n }\n await setItemAsync(storage, pkceFlowIndexKey(storageKey), index);\n // Deprecation-window dual write: exchanges that cannot identify their flow\n // (older SDK versions, redirects without the flow id parameter) read the\n // fixed key, which mirrors the most recently started flow.\n await setItemAsync(storage, `${storageKey}-code-verifier`, verifier);\n}\n/**\n * Looks up the verifier for `flowId`. When a flow id is given, only that slot\n * is consulted — deliberately no fallback to the fixed legacy key: submitting\n * another flow's verifier would burn the single-use auth code, and the\n * subsequent cleanup would delete a pending flow's only fallback. The legacy\n * key is read only when no flow id is available at all.\n */\nexport async function retrievePKCEVerifier(storage, storageKey, flowId) {\n if (flowId) {\n const verifier = await getItemAsync(storage, pkceVerifierSlotKey(storageKey, flowId));\n return { verifier: typeof verifier === 'string' ? verifier : null, flowId };\n }\n const verifier = await getItemAsync(storage, `${storageKey}-code-verifier`);\n return { verifier: typeof verifier === 'string' ? verifier : null, flowId: null };\n}\n/**\n * Removes a single flow's verifier. Never clears other flows' slots: with a\n * `flowId` only that slot is deleted (plus the legacy fixed key when it holds\n * the same verifier); without one, only the legacy fixed key is deleted.\n */\nexport async function removePKCEVerifier(storage, storageKey, flowId) {\n const legacyKey = `${storageKey}-code-verifier`;\n if (!flowId) {\n await removeItemAsync(storage, legacyKey);\n return;\n }\n const slotKey = pkceVerifierSlotKey(storageKey, flowId);\n const slotValue = await getItemAsync(storage, slotKey);\n await removeItemAsync(storage, slotKey);\n // Skip the index rewrite when the flow was never indexed (e.g. a failed\n // exchange for an absent slot): on cookie storage every write is a full\n // Set-Cookie cycle.\n const index = await getPKCEFlowIndex(storage, storageKey);\n const remaining = index.filter((id) => id !== flowId);\n if (remaining.length !== index.length) {\n if (remaining.length > 0) {\n await setItemAsync(storage, pkceFlowIndexKey(storageKey), remaining);\n }\n else {\n await removeItemAsync(storage, pkceFlowIndexKey(storageKey));\n }\n }\n if (slotValue != null && slotValue === (await getItemAsync(storage, legacyKey))) {\n await removeItemAsync(storage, legacyKey);\n }\n}\n/**\n * Removes every pending verifier: all slots in the index, the index itself\n * and the fixed legacy key. Used on session teardown (sign-out, invalid\n * session) — matches the pre-slot behavior where tearing down the session\n * deleted the only verifier, and prevents long-lived stale verifier cookies.\n */\nexport async function removeAllPKCEVerifiers(storage, storageKey) {\n const index = await getPKCEFlowIndex(storage, storageKey);\n for (const flowId of index) {\n await removeItemAsync(storage, pkceVerifierSlotKey(storageKey, flowId));\n }\n await removeItemAsync(storage, pkceFlowIndexKey(storageKey));\n await removeItemAsync(storage, `${storageKey}-code-verifier`);\n}\n/**\n * Appends the reserved flow id parameter to a `redirectTo` URL, replacing any\n * existing occurrence. String-based (no URL round-trip) so custom schemes\n * (native deep links) and the exact encoding of the app's own parameters\n * survive untouched; an existing fragment stays at the end of the URL.\n */\nexport function appendFlowIdToRedirectTo(redirectTo, flowId) {\n const hashIndex = redirectTo.indexOf('#');\n let base = hashIndex === -1 ? redirectTo : redirectTo.slice(0, hashIndex);\n const fragment = hashIndex === -1 ? '' : redirectTo.slice(hashIndex);\n const queryIndex = base.indexOf('?');\n if (queryIndex !== -1) {\n const path = base.slice(0, queryIndex);\n const remaining = base\n .slice(queryIndex + 1)\n .split('&')\n .filter((pair) => pair !== '' && pair !== PKCE_FLOW_ID_PARAM && !pair.startsWith(`${PKCE_FLOW_ID_PARAM}=`));\n base = remaining.length > 0 ? `${path}?${remaining.join('&')}` : path;\n }\n const separator = base.includes('?') ? '&' : '?';\n return `${base}${separator}${PKCE_FLOW_ID_PARAM}=${encodeURIComponent(flowId)}${fragment}`;\n}\nexport async function getCodeChallengeAndMethod(storage, storageKey, isPasswordRecovery = false, onEvictFlow) {\n const codeVerifier = generatePKCEVerifier();\n let storedCodeVerifier = codeVerifier;\n if (isPasswordRecovery) {\n storedCodeVerifier += '/recovery';\n }\n const flowId = generatePKCEFlowId();\n await storePKCEVerifier(storage, storageKey, flowId, storedCodeVerifier, onEvictFlow);\n const codeChallenge = await generatePKCEChallenge(codeVerifier);\n const codeChallengeMethod = codeVerifier === codeChallenge ? 'plain' : 's256';\n return [codeChallenge, codeChallengeMethod, flowId];\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}$/i;\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 assertRecoveryCodesExperimentalEnabled(experimental) {\n if (!experimental.recoveryCodes) {\n throw new Error('@supabase/auth-js: the MFA recovery codes API is experimental and disabled by default. Enable it by passing `auth: { experimental: { recoveryCodes: 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// 500, 501, 502, 503, 504: Standard server/gateway errors\n// 520-529, 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 = [\n 500, 501, 502, 503, 504, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530,\n];\nexport async function handleError(error) {\n var _a;\n if (!looksLikeFetchResponse(error)) {\n throw new AuthRetryableFetchError(_getErrorMessage(error), 0);\n }\n let data;\n try {\n data = await error.json();\n }\n catch (e) {\n if (NETWORK_ERROR_CODES.includes(error.status)) {\n // statusText can be empty — HTTP/2 has no reason phrase\n throw new AuthRetryableFetchError(error.statusText || `HTTP ${error.status}`, error.status);\n }\n throw new AuthUnknownError(_getErrorMessage(e), e);\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(data), error.status);\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 // fetch failed (network / CORS / aborted request) — surfaced to the\n // caller as a retryable error below. Deliberately not logged here: an\n // aborted in-flight request (e.g. a superseded page navigation) is a\n // transient condition, and logging the raw error pollutes the console.\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 'mfa/recovery_code',\n 'anonymous',\n 'sso/saml',\n 'magiclink',\n 'web3',\n 'oauth_provider/authorization_code',\n];\nconst FactorTypes = ['totp', 'phone', 'webauthn', 'recovery_code'];\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 { resolveFetch, validateUUID } from './lib/helpers';\nimport { SIGN_OUT_SCOPES, } from './lib/types';\nimport { isAuthError } from './lib/errors';\nexport default class GoTrueAdminApi {\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 params The parameters for generating the link, including the link `type`, the user's `email`, and type-specific options such as `password`, `data`, and `redirectTo`.\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 return await _request(this.fetch, 'GET', `${this.url}/admin/oauth/clients/${clientId}`, {\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 return await _request(this.fetch, 'PUT', `${this.url}/admin/oauth/clients/${clientId}`, {\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 await _request(this.fetch, 'DELETE', `${this.url}/admin/oauth/clients/${clientId}`, {\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 return await _request(this.fetch, 'POST', `${this.url}/admin/oauth/clients/${clientId}/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 return await _request(this.fetch, 'GET', `${this.url}/admin/custom-providers/${identifier}`, {\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 return await _request(this.fetch, 'PUT', `${this.url}/admin/custom-providers/${identifier}`, {\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 await _request(this.fetch, 'DELETE', `${this.url}/admin/custom-providers/${identifier}`, {\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 async _adminListPasskeys(params) {\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 async _adminDeletePasskey(params) {\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","/**\n * Lock primitives retained for backwards-compatible imports. The auth client\n * coordinates refreshes itself (deduping in-instance callers onto a shared\n * in-flight promise) and lets the GoTrue server resolve cross-instance races,\n * so it does not invoke any primitive from this module. The functions still\n * work for direct callers that need a navigator.locks-backed or in-process\n * exclusive lock of their own.\n */\nimport { supportsLocalStorage } from './helpers';\n/**\n * @deprecated Debug flag for `navigatorLock` / `processLock`. The auth\n * client ignores both, so this has no client-side effect.\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 * @deprecated The auth client doesn't acquire locks around auth operations,\n * so this error never originates from `supabase.auth.*` calls. Direct callers\n * of `navigatorLock` / `processLock` still receive it on acquire timeout.\n */\nexport class LockAcquireTimeoutError extends Error {\n constructor(message) {\n super(message);\n this.isAcquireTimeout = true;\n }\n}\n/**\n * @deprecated The auth client doesn't call `navigator.locks`, so this error\n * never originates from `supabase.auth.*` calls. Direct callers of\n * `navigatorLock` still receive it on acquire timeout.\n */\nexport class NavigatorLockAcquireTimeoutError extends LockAcquireTimeoutError {\n}\n/**\n * @deprecated The auth client doesn't run `processLock`, so this error\n * never originates from `supabase.auth.*` calls. Direct callers of\n * `processLock` still receive it on acquire timeout.\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 *\n * @deprecated The auth client coordinates refreshes itself and the server\n * resolves concurrent refresh races, so passing `{ lock: navigatorLock }`\n * to it has no effect. You can safely drop the import from your client setup.\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 clearTimeout(acquireTimeoutTimer);\n // DOMException does not extend Error in Node.js, so use structural check\n if (e !== null && typeof e === 'object' && 'name' in e && e.name === 'AbortError') {\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 *\n * @deprecated The auth client coordinates refreshes itself and the server\n * resolves concurrent refresh races, so passing `{ lock: processLock }`\n * to it has no effect. You can safely drop the import from your client setup.\n *\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 // Only an unverified factor is leftover from the enrollment that just\n // failed, and removing it is what lets a retry with the same name\n // succeed. A verified factor of that name is a passkey the user is\n // already using, so it must never be selected here.\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, PKCE_FLOW_ID_PARAM, REFRESH_FAILURE_COOLDOWN_MS, STORAGE_KEY, } from './lib/constants';\nimport { AuthImplicitGrantRedirectError, AuthInvalidCredentialsError, AuthInvalidJwtError, AuthInvalidTokenResponseError, AuthPKCECodeVerifierMissingError, AuthPKCEGrantCodeExchangeError, AuthRefreshDiscardedError, AuthSessionMissingError, AuthUnknownError, isAuthApiError, isAuthError, isAuthImplicitGrantRedirectError, isAuthRefreshDiscardedError, isAuthRetryableFetchError, isAuthSessionMissingError, } from './lib/errors';\nimport { _request, _sessionResponse, _sessionResponsePassword, _ssoResponse, _userResponse, } from './lib/fetch';\nimport { appendFlowIdToRedirectTo, assertRecoveryCodesExperimentalEnabled, decodeJWT, deepClone, Deferred, expiresAt, generateCallbackId, getAlgorithm, getCodeChallengeAndMethod, getItemAsync, insecureUserWarningProxy, isBrowser, parseParametersFromURL, pkceVerifierSlotKey, removeAllPKCEVerifiers, removeItemAsync, removePKCEVerifier, resolveFetch, retrievePKCEVerifier, retryable, setItemAsync, sleep, supportsLocalStorage, userNotAvailableProxy, validateExp, validatePKCEFlowId, } from './lib/helpers';\nimport { memoryLocalStorageAdapter } from './lib/local-storage';\nimport { LockAcquireTimeoutError } 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. Only used when a custom `lock` is supplied. TODO(v3): remove.\n skipAutoInitialize: false,\n experimental: {},\n};\n/**\n * No-op lock used internally as a placeholder. Kept so older test setups that\n * inject this exact reference do not break; new code never sees it because\n * `this.lock` stays `null` when no custom lock is supplied (lockless path).\n * TODO(v3): remove with the legacy lock path.\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 = {};\n// Warn once per JS realm, not per client instance — server-side apps can\n// construct many clients per process and must not be spammed.\nlet deprecatedLockWarned = false;\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;\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 * Cache of the most recent refresh failure, keyed by the refresh token\n * that failed. Serial callers passing the *same* token within\n * `REFRESH_FAILURE_COOLDOWN_MS` (including subsequent auto-refresh ticks)\n * receive this cached result instead of firing another `/token` request.\n * Callers passing a *different* token (token rotation pickup, explicit\n * `setSession`/`refreshSession({ refresh_token })`, multi-account switch)\n * bypass the cache and attempt a fresh refresh as they should.\n * Cleared on any successful refresh (locally or via BroadcastChannel from\n * another tab) and on `_removeSession`.\n *\n * Pairs with `refreshingDeferred`: concurrent callers share the in-flight\n * promise, serial callers within the cooldown share the failure result.\n */\n this.lastRefreshFailure = null;\n /**\n * Monotonic counter incremented at the top of `_removeSession`, before any\n * `await`. The commit guard inside `_callRefreshToken` captures this value\n * before `_saveSession` and re-checks it after, so a `signOut` that\n * interleaves inside `_saveSession`'s storage-write awaits is still caught\n * (the post-fetch storage snapshot alone misses that window).\n */\n this._sessionRemovalEpoch = 0;\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 /**\n * Non-null only while `initialize()` is running. While open,\n * `_notifyAllSubscribers` enqueues init-chain notifications (those fired with\n * `broadcast = true`, i.e. from `_recoverAndRefresh`) into this array instead\n * of firing directly, so that `initializePromise` is guaranteed to be\n * resolved before any subscriber callback runs. Callbacks that call\n * `getSession()` / `getUser()` etc. would otherwise deadlock because those\n * methods await `initializePromise`. Notifications from the incoming\n * BroadcastChannel handler (`broadcast = false`) are not enqueued — they fire\n * immediately. Flushed (in order) by `initialize()` after `initializePromise`\n * settles.\n */\n this._pendingInitNotifications = null;\n this.detectSessionInUrl = true;\n this.hasCustomAuthorizationHeader = false;\n this.suppressGetSessionWarning = false;\n /**\n * Custom lock function passed via `settings.lock`. When non-null, every auth\n * operation runs inside `_acquireLock`. When null (the default), the client\n * uses its lockless coordination (refresh single-flight + commit guard).\n * TODO(v3): remove along with the legacy lock path.\n */\n this.lock = null;\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.detectSessionInUrl = settings.detectSessionInUrl;\n this.flowType = settings.flowType;\n this.hasCustomAuthorizationHeader = settings.hasCustomAuthorizationHeader;\n this.throwOnError = settings.throwOnError;\n // Always wire `lockAcquireTimeout` even on the lockless path: consumers\n // (including supabase-js tests) read it off the client to verify option\n // flow-through.\n this.lockAcquireTimeout = settings.lockAcquireTimeout;\n // TODO(v3): remove. Legacy opt-in path preserved for backwards\n // compatibility with callers passing a custom `lock` (typically React\n // Native `processLock` or Node multi-process setups). When `settings.lock`\n // is null the client uses its lockless coordination — no `navigator.locks`\n // by default, no implicit `processLock`.\n if (settings.lock != null) {\n this.lock = settings.lock;\n if (!deprecatedLockWarned) {\n deprecatedLockWarned = true;\n console.warn(`${this._logPrefix()} The \"lock\" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`);\n }\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 recoveryCodes: {\n getStatus: this._getRecoveryCodesStatus.bind(this),\n generate: this._generateRecoveryCodes.bind(this),\n verify: this._verifyRecoveryCode.bind(this),\n regenerate: this._regenerateRecoveryCodes.bind(this),\n unenroll: this._unenrollRecoveryCodes.bind(this),\n },\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 (_c = this.broadcastChannel) === null || _c === void 0 ? void 0 : _c.addEventListener('message', async (event) => {\n this._debug('received broadcast notification from other tab or client', event);\n // Another tab successfully refreshed or signed in — any cached\n // failure in this tab is stale and should not block the next\n // refresh attempt.\n if (event.data.event === 'TOKEN_REFRESHED' || event.data.event === 'SIGNED_IN') {\n this.lastRefreshFailure = null;\n }\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 * Initialize the auth client by loading the session from storage or\n * detecting it from the URL after an OAuth, magic-link, or password-recovery\n * redirect.\n *\n * **Most callers do not need to invoke this directly.** The client calls it\n * automatically during construction, and to react to sign-in events (including\n * post-redirect events) you should subscribe to `onAuthStateChange` rather\n * than awaiting `initialize()`.\n *\n * You only need to call it manually when you have opted out of the automatic\n * call by passing `skipAutoInitialize: true` — for example, in an SSR context\n * where you need to control initialization timing. In that case, awaiting\n * `initialize()` returns the resolved session result (or any error encountered\n * while detecting it from the URL).\n *\n * @category Auth\n */\n async initialize() {\n var _a;\n if (this.initializePromise) {\n return await this.initializePromise;\n }\n // Open the notification queue before _initialize() runs so that every\n // _notifyAllSubscribers call inside the init chain enqueues instead of\n // firing. Without this, a callback receiving SIGNED_IN (or TOKEN_REFRESHED\n // / SIGNED_OUT) during _recoverAndRefresh would deadlock if it called\n // getSession() / getUser() — those methods await initializePromise, which\n // can only resolve after the callback returns, which can only return after\n // getSession() resolves. The queue is flushed below after initializePromise\n // has settled, so callbacks run with a fully resolved initializePromise.\n this._pendingInitNotifications = [];\n this.initializePromise = (async () => {\n if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._initialize();\n });\n }\n return await this._initialize();\n })();\n const result = await this.initializePromise;\n // initializePromise is now resolved — flush queued notifications in order.\n // Callbacks can safely call getSession() / getUser() / signOut() etc.\n const queue = (_a = this._pendingInitNotifications) !== null && _a !== void 0 ? _a : [];\n this._pendingInitNotifications = null;\n for (const n of queue) {\n await this._notifyAllSubscribers(n.event, n.session, n.broadcast);\n }\n return result;\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 let flowId = null;\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, flowId] = await this._getCodeChallengeAndMethod();\n }\n res = await _request(this.fetch, 'POST', `${this.url}/signup`, {\n headers: this.headers,\n redirectTo: this._maybeAppendFlowIdToRedirect(options === null || options === void 0 ? void 0 : options.emailRedirectTo, flowId),\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 removePKCEVerifier(this.storage, this.storageKey, flowId);\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 removePKCEVerifier(this.storage, this.storageKey, flowId);\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 * @exampleDescription Handling errors\n * Log the full `error` object so fields like `code`, `status`, and `name` aren't hidden. The `error.code` (e.g. `'invalid_credentials'`, `'email_not_confirmed'`) is often more useful for branching than `error.message`, and the full object surfaces both.\n *\n * @example Handling errors\n * ```js\n * const { data, error } = await supabase.auth.signInWithPassword({\n * email: 'example@email.com',\n * password: 'example-password',\n * })\n * if (error) {\n * console.error(error)\n * return\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 * flowId: <PKCE_FLOW_ID_OR_NULL>\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 * - When several PKCE flows are in flight at once, pass `options.flowId` so\n * the code is exchanged with the verifier created by that specific flow.\n * The flow id is returned by `signInWithOAuth`, and with\n * `experimental.appendPkceFlowIdToRedirects` enabled it also arrives on\n * your callback URL as the reserved `sb_flow_id` query parameter (read\n * automatically in a browser).\n * - When a flow id is present but its stored verifier is gone (evicted,\n * already used, or from another device), the call fails with a verifier\n * missing error instead of trying another flow's verifier — a mismatched\n * verifier would consume the single-use code. Without any flow id the\n * most recently stored verifier is used, as before.\n *\n * @example Exchange Auth Code\n * ```js\n * supabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225')\n * ```\n *\n * @example Exchange Auth Code for a specific flow (e.g. in a server-side callback handler)\n * ```js\n * const flowId = requestUrl.searchParams.get('sb_flow_id')\n * supabase.auth.exchangeCodeForSession(code, flowId ? { flowId } : undefined)\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, options) {\n await this.initializePromise;\n if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return this._acquireLock(this.lockAcquireTimeout, async () => {\n return this._exchangeCodeForSession(authCode, options);\n });\n }\n return this._exchangeCodeForSession(authCode, options);\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, options) {\n const hasExplicitFlowId = (options === null || options === void 0 ? void 0 : options.flowId) != null;\n const requestedFlowId = hasExplicitFlowId\n ? validatePKCEFlowId(options === null || options === void 0 ? void 0 : options.flowId)\n : isBrowser()\n ? validatePKCEFlowId(parseParametersFromURL(window.location.href)[PKCE_FLOW_ID_PARAM])\n : null;\n if (hasExplicitFlowId && !requestedFlowId) {\n this._debug('#_exchangeCodeForSession()', 'provided flowId is not a valid flow id', options === null || options === void 0 ? void 0 : options.flowId);\n }\n // With a flow id (explicit or from the callback URL) the lookup is\n // slot-only and a miss fails fast — see retrievePKCEVerifier. An invalid\n // explicit flow id also fails fast rather than borrowing another flow's\n // verifier.\n const { verifier: storageItem, flowId } = hasExplicitFlowId && !requestedFlowId\n ? { verifier: null, flowId: null }\n : await retrievePKCEVerifier(this.storage, this.storageKey, requestedFlowId);\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 removePKCEVerifier(this.storage, this.storageKey, flowId);\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 removePKCEVerifier(this.storage, this.storageKey, flowId);\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 let flowId = null;\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, flowId] = await this._getCodeChallengeAndMethod();\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: this._maybeAppendFlowIdToRedirect(options === null || options === void 0 ? void 0 : options.emailRedirectTo, flowId),\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 removePKCEVerifier(this.storage, this.storageKey, flowId);\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;\n let flowId = null;\n try {\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod, flowId] = await this._getCodeChallengeAndMethod();\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: this._maybeAppendFlowIdToRedirect((_a = params.options) === null || _a === void 0 ? void 0 : _a.redirectTo, flowId) }), (((_b = params === null || params === void 0 ? void 0 : params.options) === null || _b === void 0 ? void 0 : _b.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 (((_c = result.data) === null || _c === void 0 ? void 0 : _c.url) && isBrowser() && !((_d = params.options) === null || _d === void 0 ? void 0 : _d.skipBrowserRedirect)) {\n window.location.assign(result.data.url);\n }\n return this._returnResult(result);\n }\n catch (error) {\n await removePKCEVerifier(this.storage, this.storageKey, flowId);\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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._reauthenticate();\n });\n }\n return await this._reauthenticate();\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 let flowId = null;\n try {\n const endpoint = `${this.url}/resend`;\n if ('email' in credentials) {\n const { email, type, options } = credentials;\n let codeChallenge = null;\n let codeChallengeMethod = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod, flowId] = await this._getCodeChallengeAndMethod();\n }\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 code_challenge: codeChallenge,\n code_challenge_method: codeChallengeMethod,\n },\n redirectTo: this._maybeAppendFlowIdToRedirect(options === null || options === void 0 ? void 0 : options.emailRedirectTo, flowId),\n });\n if (error) {\n await removePKCEVerifier(this.storage, this.storageKey, flowId);\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 await removePKCEVerifier(this.storage, this.storageKey, flowId);\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 GoTrueClient.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 * - Cross-tab refresh races are handled by the GoTrue server (the rotated token from the first tab is returned to subsequent tabs via the parent-of-active mechanism), so no client-side serialization is needed.\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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return this._useSession(async (result) => {\n return result;\n });\n });\n }\n return await this._useSession(async (result) => {\n return result;\n });\n }\n /**\n * Acquires a global lock based on the storage key.\n *\n * TODO(v3): remove along with the legacy lock path. Only called when\n * `this.lock` is non-null (custom lock supplied via constructor). The\n * default lockless path bypasses this entirely.\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 GoTrueClient.getSession} inside the library. Loads the session\n * via `__loadSession` (which may trigger a refresh if the access token is\n * within the expiry margin) and runs `fn` with the result.\n */\n async _useSession(fn) {\n this._debug('#_useSession', 'begin');\n try {\n // Concurrent callers may both reach __loadSession; storage reads are\n // idempotent, and the only write path inside it (refresh) is\n // single-flighted downstream by `refreshingDeferred` in\n // `_callRefreshToken`. No serialization is needed at this layer.\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 `_useSession`.\n */\n async __loadSession() {\n this._debug('#__loadSession()', 'begin');\n if (this.lock != null && !this.lockAcquired) {\n // TODO(v3): remove. Only meaningful on the legacy lock path.\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 return { data: { session: await this._hydrateSessionUser(currentSession) }, error: null };\n }\n const { data: session, error } = await this._callRefreshToken(currentSession.refresh_token);\n if (error) {\n // A failed refresh does not mean there is no session. Storage is the\n // source of truth at this point, because either:\n // - `_callRefreshToken` kept the original session in storage since\n // the access token is still inside its real expiry window (a\n // proactive refresh that failed non-retryably), or\n // - another caller, in this tab or a different one, committed its\n // own rotated session while this refresh was in flight, so this\n // one was discarded by the commit guard or rejected by the server\n // as already used.\n // Empty storage (concurrent `signOut`) or an expired stored session\n // means the session is genuinely gone and the error stands. Callers\n // that pass an explicit token (`setSession`,\n // `refreshSession({ refresh_token })`) call `_callRefreshToken`\n // directly and surface the failure instead.\n const stored = (await getItemAsync(this.storage, this.storageKey));\n if (stored &&\n this._isValidSession(stored) &&\n stored.expires_at &&\n stored.expires_at * 1000 > Date.now()) {\n return this._returnResult({\n data: { session: await this._hydrateSessionUser(stored) },\n error: null,\n });\n }\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 * Completes a session read back from storage so it matches what callers of\n * `getSession()` expect: fills in `session.user` from `userStorage` when the\n * client keeps the user in split storage, and wraps the user in the\n * insecure-access warning proxy on the server.\n */\n async _hydrateSessionUser(session) {\n if (this.userStorage) {\n const maybeUser = (await getItemAsync(this.userStorage, this.storageKey + '-user'));\n session.user = (maybeUser === null || maybeUser === void 0 ? void 0 : maybeUser.user) ? maybeUser.user : userNotAvailableProxy();\n }\n // Warns when properties of the user are accessed, not when session.user itself is accessed.\n if (this.storage.isServer && session.user && !session.user.__isUserNotAvailableProxy) {\n const suppressWarningRef = { value: this.suppressGetSessionWarning };\n session.user = insecureUserWarningProxy(session.user, suppressWarningRef);\n if (suppressWarningRef.value) {\n this.suppressGetSessionWarning = true;\n }\n }\n return session;\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 let result;\n if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n result = await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._getUser();\n });\n }\n else {\n result = 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 }\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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._updateUser(attributes, options);\n });\n }\n return await this._updateUser(attributes, options);\n }\n async _updateUser(attributes, options = {}) {\n let flowId = null;\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, flowId] = await this._getCodeChallengeAndMethod();\n }\n const { data, error: userError } = await _request(this.fetch, 'PUT', `${this.url}/user`, {\n headers: this.headers,\n redirectTo: this._maybeAppendFlowIdToRedirect(options === null || options === void 0 ? void 0 : options.emailRedirectTo, flowId),\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 removePKCEVerifier(this.storage, this.storageKey, flowId);\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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._setSession(currentSession);\n });\n }\n return await this._setSession(currentSession);\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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._refreshSession(currentSession);\n });\n }\n return await this._refreshSession(currentSession);\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 flowId: params[PKCE_FLOW_ID_PARAM],\n });\n if (error)\n throw error;\n const url = new URL(window.location.href);\n url.searchParams.delete('code');\n url.searchParams.delete(PKCE_FLOW_ID_PARAM);\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 || params.error_description || params.error_code);\n }\n /**\n * Checks if the current URL and backing storage contain parameters given by a PKCE flow\n */\n async _isPKCECallback(params) {\n if (!params.code) {\n return false;\n }\n const flowId = validatePKCEFlowId(params[PKCE_FLOW_ID_PARAM]);\n if (flowId &&\n (await getItemAsync(this.storage, pkceVerifierSlotKey(this.storageKey, flowId)))) {\n return true;\n }\n const currentStorageContent = await getItemAsync(this.storage, `${this.storageKey}-code-verifier`);\n return !!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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return await this._acquireLock(this.lockAcquireTimeout, async () => {\n return await this._signOut(options);\n });\n }\n return await this._signOut(options);\n }\n async _signOut({ scope } = { scope: 'global' }) {\n return await this._useSession(async (result) => {\n var _a;\n const removeCurrentSession = async () => {\n await this._removeSession();\n };\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 if (scope !== 'others') {\n await removeCurrentSession();\n }\n return this._returnResult({ error });\n }\n }\n }\n if (scope !== 'others') {\n await removeCurrentSession();\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 * - Callbacks can be `async` and can safely call other Supabase auth methods (`getUser`, `setSession`, etc.) from inside the callback.\n * - Keep callbacks quick. Events are awaited in order, so a slow callback delays subsequent events to subscribers in this tab.\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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n await this._acquireLock(this.lockAcquireTimeout, async () => {\n this._emitInitialSession(id);\n });\n }\n else {\n await 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 (isAuthRefreshDiscardedError(err)) {\n // Same successful no-op _recoverAndRefresh treats as debug-only: the\n // commit guard discarded a refresh because a concurrent signOut\n // changed session state mid-flight.\n return;\n }\n if (isAuthSessionMissingError(err) ||\n isAuthRetryableFetchError(err) ||\n (isAuthApiError(err) &&\n (err.code === 'refresh_token_not_found' ||\n err.code === 'refresh_token_already_used' ||\n err.code === 'session_expired'))) {\n // A missing session, a transient/aborted network failure (e.g. a\n // superseded page navigation cancelling the in-flight request), or\n // a dead refresh token (e.g. stale SSR cookies) is not an\n // application error — warn rather than surface it raw.\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 let flowId = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod, flowId] = await this._getCodeChallengeAndMethod(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: this._maybeAppendFlowIdToRedirect(options.redirectTo, flowId),\n });\n }\n catch (error) {\n await removePKCEVerifier(this.storage, this.storageKey, flowId);\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 * flowId: <PKCE_FLOW_ID_OR_NULL>\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 let flowId = null;\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, flowId: urlFlowId } = 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 flowId = urlFlowId;\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, flowId },\n error: null,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return this._returnResult({\n data: { provider: credentials.provider, url: null, flowId },\n error,\n });\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 removePKCEVerifier(this.storage, this.storageKey, null);\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 // Refresh tokens are long-lived bearer credentials; do NOT include any\n // fragment of the token in the debug tag, even when `debug: true` is\n // enabled (logs may be forwarded to third-party services).\n const debugName = `#_refreshAccessToken()`;\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, flowId } = 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, flowId }, 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 // `_callRefreshToken` is the single source of truth for refresh\n // outcomes: it removes the session itself when the access token\n // is actually expired, and preserves it when the token is still\n // valid (proactive-preserve). Don't second-guess that here — a\n // local `_removeSession` would emit a duplicate `SIGNED_OUT` on\n // genuine failures and undo the proactive-preserve at init time.\n if (isAuthRefreshDiscardedError(error)) {\n this._debug(debugName, 'refresh discarded by commit guard', error);\n }\n else {\n this._debug(debugName, 'refresh failed', error);\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 if (isAuthRetryableFetchError(err)) {\n // Transient/aborted network failure during session recovery (e.g. a\n // superseded page navigation cancelling the in-flight request). Warn\n // rather than surface it raw; the session is untouched and recovery\n // will run again on the next load.\n console.warn(err);\n }\n else {\n console.error(err);\n }\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 // Serial failure cooldown: callers passing the *same* refresh token\n // after a recent failure receive the cached result instead of firing\n // another `/token` request. This caps the proactive-refresh storm\n // where every `getSession()` call inside the 90s EXPIRY_MARGIN_MS\n // window kept re-firing against the same broken refresh token during\n // outages. Concurrent callers already share `refreshingDeferred`; this\n // cache covers serial callers spaced across cooldown windows.\n //\n // Token-keyed so callers with a fresh refresh token (rotation pickup\n // from another tab, explicit `setSession`/`refreshSession({ refresh_token })`,\n // multi-account switch) bypass the cache and attempt a real refresh.\n if (this.lastRefreshFailure &&\n this.lastRefreshFailure.refreshToken === refreshToken &&\n Date.now() < this.lastRefreshFailure.expiresAt) {\n this._debug('#_callRefreshToken()', 'returning cached failure (cooldown active)');\n return this.lastRefreshFailure.result;\n }\n // Refresh tokens are long-lived bearer credentials; do NOT include any\n // fragment of the token in the debug tag, even when `debug: true` is\n // enabled (logs may be forwarded to third-party services).\n const debugName = `#_callRefreshToken()`;\n this._debug(debugName, 'begin');\n try {\n this.refreshingDeferred = new Deferred();\n // Only callers that arrive while this refresh is in flight await the\n // deferred; the original caller is served by the `throw` in the catch\n // below. Pre-attach a no-op rejection handler so a failing refresh with\n // no concurrent callers cannot surface as an unhandled rejection —\n // concurrent callers attach their own handlers via `.promise` and still\n // observe the rejection.\n this.refreshingDeferred.promise.then(undefined, () => { });\n // Snapshot storage before the fetch. The commit guard discards the\n // rotated tokens only when a non-null pre-fetch snapshot changed under\n // us — typical case: a concurrent `signOut` ran `_removeSession`, or\n // another tab's refresh rewrote the slot. Callers passing\n // externally-sourced tokens (SSR cookie handoff, multi-account\n // switching, `setSession`/`refreshSession({ refresh_token })`) may\n // start from a null snapshot OR from a non-null snapshot whose\n // refresh_token differs from the one they're hydrating; in both\n // cases the guard fires only when storage was *modified between\n // snapshots*, not when the input token disagrees with what's stored.\n const storedAtStart = (await getItemAsync(this.storage, this.storageKey));\n const { data, error } = await this._refreshAccessToken(refreshToken);\n if (error)\n throw error;\n if (!data.session)\n throw new AuthSessionMissingError();\n const storedAfter = (await getItemAsync(this.storage, this.storageKey));\n const storageChangedUnderUs = storedAtStart !== null &&\n (storedAfter === null || storedAfter.refresh_token !== storedAtStart.refresh_token);\n if (storageChangedUnderUs) {\n this._debug(debugName, 'commit guard: storage changed since refresh started, discarding rotated tokens', {\n // Presence indicators only — never log refresh token fragments,\n // even partial. Logs may be forwarded to third-party services.\n startedWith: 'present',\n nowHolds: storedAfter ? 'replaced' : 'cleared',\n });\n const discarded = {\n data: null,\n error: new AuthRefreshDiscardedError(),\n };\n this.refreshingDeferred.resolve(discarded);\n return discarded;\n }\n // Second leg of the commit guard: close the TOCTOU window between the\n // synchronous `storageChangedUnderUs` check and the actual storage\n // writes inside `_saveSession`. A concurrent `signOut → _removeSession`\n // can land inside `_saveSession`'s `await setItemAsync(...)` yields and\n // clear storage just before we overwrite it. Capture the epoch BEFORE\n // the save and re-check after; if it advanced, undo the write directly\n // (do NOT call `_removeSession` — that would emit a duplicate\n // SIGNED_OUT for the concurrent signOut that already fired one).\n const epochBeforeSave = this._sessionRemovalEpoch;\n await this._saveSession(data.session);\n if (this._sessionRemovalEpoch !== epochBeforeSave) {\n this._debug(debugName, 'commit guard (post-save): _removeSession ran during _saveSession, undoing write');\n await removeItemAsync(this.storage, this.storageKey);\n if (this.userStorage) {\n await removeItemAsync(this.userStorage, this.storageKey + '-user');\n }\n const discarded = {\n data: null,\n error: new AuthRefreshDiscardedError(),\n };\n this.refreshingDeferred.resolve(discarded);\n return discarded;\n }\n await this._notifyAllSubscribers('TOKEN_REFRESHED', data.session);\n const result = { data: data.session, error: null };\n // Refresh succeeded — clear any cached failure so the next caller\n // (including the auto-refresh ticker) attempts a real refresh again.\n this.lastRefreshFailure = 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 // Proactive vs reactive distinction: a refresh fires whenever\n // the access token is within EXPIRY_MARGIN_MS of expiry. If the\n // access token is *still valid* at this moment, the refresh was\n // proactive and the existing session is still usable until its\n // real expiry — destroying it now would log out a user whose\n // access token works. If the access token has actually expired,\n // the refresh token is the only credential left and it just got\n // rejected — the session is genuinely dead. `__loadSession`\n // mirrors this distinction on the read path so callers see the\n // preserved session instead of `session: null`.\n const storedNow = (await getItemAsync(this.storage, this.storageKey));\n const accessTokenStillValid = !!((storedNow === null || storedNow === void 0 ? void 0 : storedNow.expires_at) && storedNow.expires_at * 1000 > Date.now());\n if (accessTokenStillValid) {\n this._debug(debugName, 'proactive refresh failed, access token still valid — preserving session');\n }\n else {\n await this._removeSession();\n }\n }\n // Cache the failure so serial callers (and the next auto-refresh\n // tick) passing the same refresh token within the cooldown window\n // receive it synchronously instead of firing another `/token`\n // call. Set after the optional `_removeSession` above (which\n // clears the cache as part of teardown) so the cache survives.\n this.lastRefreshFailure = {\n refreshToken,\n result,\n expiresAt: Date.now() + REFRESH_FAILURE_COOLDOWN_MS,\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 if (this._pendingInitNotifications !== null && broadcast) {\n // We're inside initialize() before initializePromise has resolved, and\n // this notification originates from the init chain (_recoverAndRefresh),\n // which always fires with broadcast = true. Enqueue instead of firing so\n // that callbacks can safely call getSession() / getUser() without\n // deadlocking on initializePromise.\n //\n // Notifications with broadcast = false come from the incoming\n // BroadcastChannel handler (a cross-tab event), not the init chain, so\n // they are fired immediately to preserve multi-tab ordering.\n this._pendingInitNotifications.push({ event, session, broadcast });\n return;\n }\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 // 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 // Bump synchronously, BEFORE any `await`, so that `_callRefreshToken`'s\n // post-save check sees the increment whenever this method has started —\n // even if it hasn't finished. Pairs with the epoch check in\n // `_callRefreshToken`. See `_sessionRemovalEpoch` field doc.\n this._sessionRemovalEpoch += 1;\n this._debug('#_removeSession()');\n // The session is gone — no point holding on to a cached refresh failure\n // for a token that no longer exists. Synchronous, before any `await`.\n this.lastRefreshFailure = null;\n this.suppressGetSessionWarning = false;\n await removeItemAsync(this.storage, this.storageKey);\n await removeAllPKCEVerifiers(this.storage, this.storageKey);\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 * {@link GoTrueClient.startAutoRefresh}\n * {@link GoTrueClient.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 GoTrueClient.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 GoTrueClient.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 * {@link GoTrueClient.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 GoTrueClient.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 * Tears down the client's background work: stops the auto-refresh interval,\n * removes the `visibilitychange` listener, closes the cross-tab\n * `BroadcastChannel`, and clears registered `onAuthStateChange` subscribers.\n *\n * Call this from cleanup hooks when the client is being replaced before\n * its JS realm is destroyed. React Strict Mode and HMR are the common\n * cases. Any in-flight `fetch` calls continue to completion and may still\n * write to storage; dispose doesn't abort them or erase storage.\n *\n * Lifecycle caveat: because in-flight refreshes are not aborted, a\n * disposed instance can still persist a rotated session to storage after\n * `dispose()` returns. A subsequent `createClient` against the same\n * `storageKey` will pick up that session on its next read. If you need\n * strict isolation between client lifecycles, await any pending auth\n * operation before calling `dispose()` (or change the `storageKey` for\n * the replacement client).\n *\n * Safe to call repeatedly.\n *\n * @category Auth\n *\n * @example Cleanup on React unmount\n * ```ts\n * useEffect(() => {\n * const client = createClient(...)\n * return () => { client.auth.dispose() }\n * }, [])\n * ```\n */\n async dispose() {\n var _a;\n this._removeVisibilityChangedCallback();\n await this._stopAutoRefresh();\n (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.close();\n this.broadcastChannel = null;\n this.stateChangeEmitters.clear();\n }\n /**\n * Runs the auto refresh token tick.\n */\n async _autoRefreshTokenTick() {\n this._debug('#_autoRefreshTokenTick()', 'begin');\n if (this.lock != null) {\n // TODO(v3): remove legacy lock path. Uses `_acquireLock(0, ...)` which\n // throws `LockAcquireTimeoutError` immediately if the lock is held —\n // that's the fail-fast skip path that lets the tick bail out instead\n // of queuing behind a long-running operation.\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 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 return;\n }\n // Lockless default: skip if a refresh is already in flight.\n // `_callRefreshToken` also dedupes via the same field; this is just a\n // fast-path skip to avoid an unnecessary storage read.\n if (this.refreshingDeferred !== null) {\n this._debug('#_autoRefreshTokenTick()', 'refresh already in flight, skipping');\n return;\n }\n try {\n const now = Date.now();\n try {\n 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 * 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\n await this.initializePromise;\n if (this.lock != null) {\n // TODO(v3): remove legacy lock path\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 return;\n }\n await this._recoverAndRefresh();\n });\n }\n else {\n if (document.visibilityState !== 'visible') {\n this._debug(methodName, 'visibilityState is no longer visible, skipping recovery');\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 let redirectTo = options === null || options === void 0 ? void 0 : options.redirectTo;\n let codeChallenge = null;\n let codeChallengeMethod = null;\n let flowId = null;\n if (this.flowType === 'pkce') {\n ;\n [codeChallenge, codeChallengeMethod, flowId] = await this._getCodeChallengeAndMethod();\n redirectTo = this._maybeAppendFlowIdToRedirect(redirectTo, flowId);\n }\n const urlParams = [`provider=${encodeURIComponent(provider)}`];\n if (redirectTo) {\n urlParams.push(`redirect_to=${encodeURIComponent(redirectTo)}`);\n }\n if (options === null || options === void 0 ? void 0 : options.scopes) {\n urlParams.push(`scopes=${encodeURIComponent(options.scopes)}`);\n }\n if (codeChallenge != null && codeChallengeMethod != null) {\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: `${url}?${urlParams.join('&')}`, flowId };\n }\n /**\n * Appends the reserved flow id parameter to a redirect URL so the callback\n * can be matched to the verifier stored for its flow. Opt-in via\n * `experimental.appendPkceFlowIdToRedirects`: redirect URLs are validated\n * against the project's allow list including the query string, so an extra\n * parameter can stop exact (non-wildcard) entries from matching.\n */\n _maybeAppendFlowIdToRedirect(redirectTo, flowId) {\n if (!redirectTo || !flowId || !this.experimental.appendPkceFlowIdToRedirects) {\n return redirectTo !== null && redirectTo !== void 0 ? redirectTo : undefined;\n }\n return appendFlowIdToRedirectTo(redirectTo, flowId);\n }\n /**\n * Generates and stores a PKCE challenge/verifier pair for a new flow,\n * logging any pending verifier the bounded slot ring evicts.\n */\n async _getCodeChallengeAndMethod(isPasswordRecovery = false) {\n return getCodeChallengeAndMethod(this.storage, this.storageKey, isPasswordRecovery, (evictedFlowId) => this._debug('#_getCodeChallengeAndMethod()', 'evicted oldest pending PKCE verifier slot', evictedFlowId));\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 const run = 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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return this._acquireLock(this.lockAcquireTimeout, run);\n }\n return run();\n }\n async _challenge(params) {\n const run = 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 if (this.lock != null) {\n // TODO(v3): remove legacy lock path\n return this._acquireLock(this.lockAcquireTimeout, run);\n }\n return run();\n }\n /**\n * {@link GoTrueMFAApi#challengeAndVerify}\n */\n async _challengeAndVerify(params) {\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 * {@link GoTrueMFAApi#listFactors}\n */\n async _listFactors() {\n var _a;\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 recovery_code: [],\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 // Types that are not recognized are pushed to `all` bucket.\n if (factor.status === 'verified' &&\n factor.factor_type in data &&\n Array.isArray(data[factor.factor_type])) {\n ;\n data[factor.factor_type].push(factor);\n }\n }\n return {\n data,\n error: null,\n };\n }\n /**\n * {@link 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 * {@link AuthMFARecoveryCodesApi#getStatus}\n */\n async _getRecoveryCodesStatus() {\n assertRecoveryCodesExperimentalEnabled(this.experimental);\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 { data, error } = await _request(this.fetch, 'GET', `${this.url}/factors/recovery-codes`, {\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 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 * {@link AuthMFARecoveryCodesApi#generate}\n */\n async _generateRecoveryCodes(params) {\n assertRecoveryCodesExperimentalEnabled(this.experimental);\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 { data, error } = await _request(this.fetch, 'POST', `${this.url}/factors/recovery-codes`, {\n // The body is optional server-side; only send one when a name was given.\n body: (params === null || params === void 0 ? void 0 : params.friendlyName) ? { friendly_name: params.friendlyName } : undefined,\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 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 * {@link AuthMFARecoveryCodesApi#verify}\n */\n async _verifyRecoveryCode(params) {\n assertRecoveryCodesExperimentalEnabled(this.experimental);\n const run = 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 { data, error } = await _request(this.fetch, 'POST', `${this.url}/factors/recovery-codes/verify`, {\n body: { code: params.code },\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 // A server-provided expires_at takes precedence over the computed one.\n const session = Object.assign({ expires_at: expiresAt(data.expires_in) }, data);\n await this._saveSession(session);\n await this._notifyAllSubscribers('MFA_CHALLENGE_VERIFIED', session);\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 if (this.lock != null) {\n return this._acquireLock(this.lockAcquireTimeout, run);\n }\n return run();\n }\n /**\n * {@link AuthMFARecoveryCodesApi#regenerate}\n */\n async _regenerateRecoveryCodes() {\n assertRecoveryCodesExperimentalEnabled(this.experimental);\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 { data, error } = await _request(this.fetch, 'POST', `${this.url}/factors/recovery-codes/regenerate`, {\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 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 * {@link AuthMFARecoveryCodesApi#unenroll}\n */\n async _unenrollRecoveryCodes() {\n assertRecoveryCodesExperimentalEnabled(this.experimental);\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 { data, error } = await _request(this.fetch, 'DELETE', `${this.url}/factors/recovery-codes`, {\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 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 * 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 GoTrueClient.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\n * {@link GoTrueClient.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 GoTrueClient.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 // Rethrow as AuthInvalidJwtError so the outer catch converts it to { data, error }.\n try {\n validateExp(payload.exp);\n }\n catch (e) {\n throw new AuthInvalidJwtError(e instanceof Error ? e.message : 'JWT validation failed');\n }\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 * Pass `options.mediation: 'conditional'` to use WebAuthn Conditional UI\n * (passkey autofill) instead of the modal picker; the value is forwarded to\n * `navigator.credentials.get()` unchanged.\n *\n * The challenge fetched in step 1 expires after the server's\n * GOTRUE_WEBAUTHN_CHALLENGE_EXPIRY_DURATION (5 minutes by default). With\n * `mediation: 'conditional'` the autofill prompt can stay pending for longer\n * than that: the browser ceremony then still succeeds, but verification fails\n * with `error_code: \"webauthn_challenge_expired\"`. Recover by calling\n * `signInWithPasskey()` again. It fetches a fresh challenge and, unless you\n * passed your own `options.signal`, cancels the pending ceremony first, so\n * the browser never sees two concurrent WebAuthn requests; the earlier call\n * resolves with a `WebAuthnError` whose code is `ERROR_CEREMONY_ABORTED`. If\n * you pass your own `signal`, abort it before retrying.\n *\n * @category Auth\n *\n * @example Sign in with Conditional UI (passkey autofill)\n * ```js\n * // <input autocomplete=\"username webauthn\" /> somewhere on the page\n * const { data, error } = await supabase.auth.signInWithPasskey({\n * options: {\n * mediation: 'conditional'\n * }\n * });\n * ```\n */\n async signInWithPasskey(credentials) {\n var _a, _b, _c, _d;\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 mediation: (_d = credentials === null || credentials === void 0 ? void 0 : credentials.options) === null || _d === void 0 ? void 0 : _d.mediation,\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.\n *\n * @category Auth\n */\n async registerPasskey(credentials) {\n var _a, _b;\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 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 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 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 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 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 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 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 GoTrueAdminApi from './GoTrueAdminApi';\nconst AuthAdminApi = GoTrueAdminApi;\nexport default AuthAdminApi;\n//# sourceMappingURL=AuthAdminApi.js.map","import GoTrueClient from './GoTrueClient';\nconst AuthClient = GoTrueClient;\nexport default AuthClient;\n//# sourceMappingURL=AuthClient.js.map","import GoTrueAdminApi from './GoTrueAdminApi';\nimport GoTrueClient from './GoTrueClient';\nimport AuthAdminApi from './AuthAdminApi';\nimport AuthClient from './AuthClient';\nexport { GoTrueAdminApi, GoTrueClient, AuthAdminApi, AuthClient };\nexport * from './lib/types';\nexport * from './lib/errors';\nexport { navigatorLock, NavigatorLockAcquireTimeoutError, internals as lockInternals, processLock, } from './lib/locks';\n//# sourceMappingURL=index.js.map","import { t as getTraceContextExtractor } from \"./tracingRegistry.mjs\";\nimport { 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.117.2\";\n\n//#endregion\n//#region src/lib/constants.ts\nlet JS_ENV = \"\";\nlet JS_RUNTIME_VERSION;\nif (typeof Deno !== \"undefined\") {\n\tvar _Deno$version;\n\tJS_ENV = \"deno\";\n\tJS_RUNTIME_VERSION = (_Deno$version = Deno.version) === null || _Deno$version === void 0 ? void 0 : _Deno$version.deno;\n} else if (typeof document !== \"undefined\") JS_ENV = \"web\";\nelse if (typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\") JS_ENV = \"react-native\";\nelse {\n\tvar _process$version;\n\tJS_ENV = \"node\";\n\tconst _process = globalThis[\"process\"];\n\tJS_RUNTIME_VERSION = _process === null || _process === void 0 || (_process$version = _process[\"version\"]) === null || _process$version === void 0 ? void 0 : _process$version.replace(/^v/, \"\");\n}\nconst _runtimeMeta = [`runtime=${JS_ENV}`];\nif (JS_RUNTIME_VERSION) _runtimeMeta.push(`runtime-version=${JS_RUNTIME_VERSION}`);\nconst DEFAULT_HEADERS = { \"X-Client-Info\": `supabase-js/${version}; ${_runtimeMeta.join(\"; \")}` };\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 ../../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};\n/**\n* New-format Supabase API keys (`sb_publishable_…` / `sb_secret_…`) are not JWTs and\n* must never be sent as a Bearer token — they belong only in the `apikey` header.\n* All other keys (legacy JWT keys, `sb_temp_…` temporary keys, unrecognized `sb_`\n* subtypes) keep the Bearer fallback.\n*/\nconst isNewApiKey = (key) => key.startsWith(\"sb_publishable_\") || key.startsWith(\"sb_secret_\");\nconst TEMP_KEY_PREFIX = \"sb_temp_\";\nconst warnedKeySubtypes = /* @__PURE__ */ new Set();\n/**\n* Warn (once per subtype) when an `sb_` key isn't a subtype this SDK version recognizes.\n* Never throws — the server, not the SDK, decides key validity. The key value is never\n* included in the message.\n*/\nconst checkApiKeyFormat = (key) => {\n\tvar _key$match$, _key$match;\n\tif (!key.startsWith(\"sb_\") || isNewApiKey(key) || key.startsWith(TEMP_KEY_PREFIX)) return;\n\tconst subtype = (_key$match$ = (_key$match = key.match(/^sb_[a-zA-Z0-9]+_/)) === null || _key$match === void 0 ? void 0 : _key$match[0]) !== null && _key$match$ !== void 0 ? _key$match$ : \"unknown\";\n\tif (warnedKeySubtypes.has(subtype)) return;\n\twarnedKeySubtypes.add(subtype);\n\tconsole.warn(\"@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.\");\n};\nconst fetchWithAuth = (supabaseKey, supabaseUrl, getAccessToken, customFetch, tracePropagationOptions, options) => {\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\tconst allowKeyAsBearer = !((options === null || options === void 0 ? void 0 : options.omitApiKeyAsBearer) && isNewApiKey(supabaseKey));\n\treturn async (input, init) => {\n\t\tconst realToken = await getAccessToken();\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\")) {\n\t\t\tconst bearer = realToken !== null && realToken !== void 0 ? realToken : allowKeyAsBearer ? supabaseKey : null;\n\t\t\tif (bearer) headers.set(\"Authorization\", `Bearer ${bearer}`);\n\t\t}\n\t\tif (traceTargets) {\n\t\t\tconst traceHeaders = 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};\nlet warnedMissingTracingRuntime = false;\nlet warnedNonW3CPropagator = false;\nfunction getTraceHeaders(input, targets, respectSampling) {\n\tconst extractTraceContext = getTraceContextExtractor();\n\tif (!extractTraceContext) {\n\t\tif (!warnedMissingTracingRuntime) {\n\t\t\twarnedMissingTracingRuntime = true;\n\t\t\tconsole.warn(\"@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.\");\n\t\t}\n\t\treturn null;\n\t}\n\tif (!shouldPropagateToTarget(typeof input === \"string\" ? input : input instanceof URL ? input : input.url, targets)) return null;\n\tconst traceContext = extractTraceContext();\n\tif (!traceContext || !traceContext.traceparent) {\n\t\tvar _traceContext$carrier;\n\t\tif ((traceContext === null || traceContext === void 0 || (_traceContext$carrier = traceContext.carrierKeys) === null || _traceContext$carrier === void 0 ? void 0 : _traceContext$carrier.length) && !warnedNonW3CPropagator) {\n\t\t\twarnedNonW3CPropagator = true;\n\t\t\tconst sentryHint = traceContext.carrierKeys.includes(\"sentry-trace\") ? \" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.\" : \" Configure your tracing SDK to emit W3C trace context on outgoing requests.\";\n\t\t\tconsole.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${traceContext.carrierKeys.join(\", \")}] and no W3C traceparent header, so trace headers will not be attached.` + sentryHint);\n\t\t}\n\t\treturn null;\n\t}\n\tif (respectSampling) {\n\t\tconst parsed = parseTraceParent(traceContext.traceparent);\n\t\tif (parsed && !parsed.isSampled) return { traceparent: traceContext.traceparent };\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}\nlet warnedTopLevelSchema = false;\n/**\n* Warn (once per process) when `schema` is passed at the top level of the client options\n* instead of under `db`. A top-level `schema` is not part of the options shape and is\n* ignored, so queries silently go to the default schema. Never throws.\n*\n* Only `undefined` counts as unset, matching `db.schema`, where any other value is sent\n* as the profile header.\n*/\nfunction checkTopLevelSchemaOption(options) {\n\tif (warnedTopLevelSchema) return;\n\tif (typeof options !== \"object\" || options === null || !(\"schema\" in options) || options.schema === void 0) return;\n\twarnedTopLevelSchema = true;\n\tconsole.warn(\"@supabase/supabase-js: The \\\"schema\\\" option must be nested under \\\"db\\\", e.g. createClient(url, key, { db: { schema: 'myschema' } }). A top-level \\\"schema\\\" is ignored and queries go to the default schema.\");\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 Optional configuration for the client:\n\t* - `db.schema` — You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n\t* - `auth.autoRefreshToken` — Set to `true` if you want to automatically refresh the token before expiring.\n\t* - `auth.persistSession` — Set to `true` if you want to automatically save the user session into local storage.\n\t* - `auth.detectSessionInUrl` — Set to `true` if you want to automatically detect OAuth grants in the URL and sign in the user.\n\t* - `realtime` — Options passed along to the realtime-js constructor.\n\t* - `storage` — Options passed along to the storage-js constructor.\n\t* - `global.fetch` — A custom fetch implementation.\n\t* - `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 runtime's global `fetch` to make HTTP requests,\n\t* but an alternative `fetch` implementation can be provided as an option.\n\t* This is useful in environments where the global `fetch` is unavailable or where you want to customize request behavior.\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 and the tracing runtime to be loaded via\n\t* `import '@supabase/supabase-js/tracing'`. 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 '@supabase/supabase-js/tracing'\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\tcheckApiKeyFormat(supabaseKey);\n\t\tcheckTopLevelSchemaOption(options);\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._getSessionToken.bind(this), settings.global.fetch, settings.tracePropagation);\n\t\tthis.functionsFetch = fetchWithAuth(supabaseKey, supabaseUrl, this._getSessionToken.bind(this), settings.global.fetch, settings.tracePropagation, { omitApiKeyAsBearer: true });\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\tretry: settings.db.retry\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.functionsFetch\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* Fetch the OpenAPI description PostgREST publishes for this client's schema.\n\t*\n\t* The document lists only the tables, views and functions the caller's role\n\t* holds privileges on. The request carries the same `apikey` and\n\t* `Authorization` headers as every other query, so the description is scoped\n\t* to the signed-in user. Call `.schema()` first to describe a schema other\n\t* than the client default.\n\t*\n\t* @example\n\t* ```ts\n\t* const { data, error } = await supabase.getOpenApiSpec()\n\t* ```\n\t*/\n\tgetOpenApiSpec() {\n\t\treturn this.rest.getOpenApiSpec();\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\t/**\n\t* The raw session token — the custom `accessToken` result or the signed-in user's JWT —\n\t* or `null` when there is no session. Unlike {@link _getAccessToken} it does not fall back\n\t* to `supabaseKey`, so callers can distinguish \"no session\" from \"has session\".\n\t*/\n\tasync _getSessionToken() {\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_ : null;\n\t}\n\tasync _getAccessToken() {\n\t\tvar _this2 = this;\n\t\tvar _await$this$_getSessi;\n\t\treturn (_await$this$_getSessi = await _this2._getSessionToken()) !== null && _await$this$_getSessi !== void 0 ? _await$this$_getSessi : _this2.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\" || event === \"INITIAL_SESSION\") && 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\" || globalThis[\"Deno\"] !== void 0) 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) <= 20;\n}\nif (shouldShowDeprecationWarning()) console.warn(\"⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715\");\n\n//#endregion\nexport { FunctionRegion, FunctionsError, FunctionsFetchError, FunctionsHttpError, FunctionsRelayError, PostgrestError, StorageApiError, SupabaseClient, createClient };\n//# sourceMappingURL=index.mjs.map","export const VERSION = '0.7.0';\n//# sourceMappingURL=version.js.map","import { createClient, } from \"@supabase/supabase-js\";\nimport { VERSION } from \"./version\";\nimport { createStorageFromOptions, applyServerStorage } from \"./cookies\";\nexport function createServerClient(supabaseUrl, supabaseKey, options) {\n if (!supabaseUrl || !supabaseKey) {\n throw new Error(`Your project's URL and Key are required to create a Supabase client!\\n\\nCheck your Supabase project's API settings to find these values\\n\\nhttps://supabase.com/dashboard/project/_/settings/api`);\n }\n const { storage, getAll, setAll, setItems, removedItems } = createStorageFromOptions({\n ...options,\n cookieEncoding: options?.cookieEncoding ?? \"base64url\",\n }, true);\n const client = createClient(supabaseUrl, supabaseKey, {\n // TODO: resolve type error\n ...options,\n global: {\n ...options?.global,\n headers: {\n ...options?.global?.headers,\n \"X-Client-Info\": `supabase-ssr/${VERSION} createServerClient`,\n },\n },\n auth: {\n ...(options?.cookieOptions?.name\n ? { storageKey: options.cookieOptions.name }\n : null),\n ...options?.auth,\n flowType: \"pkce\",\n autoRefreshToken: false,\n detectSessionInUrl: false,\n persistSession: true,\n storage,\n },\n });\n client.auth.onAuthStateChange(async (event) => {\n // The SIGNED_IN event is fired very often, but we don't need to\n // apply the storage each time it fires, only if there are changes\n // that need to be set -- which is if setItems / removeItems have\n // data.\n const hasStorageChanges = Object.keys(setItems).length > 0 || Object.keys(removedItems).length > 0;\n if (hasStorageChanges &&\n (event === \"SIGNED_IN\" ||\n event === \"TOKEN_REFRESHED\" ||\n event === \"USER_UPDATED\" ||\n event === \"PASSWORD_RECOVERY\" ||\n event === \"SIGNED_OUT\" ||\n event === \"MFA_CHALLENGE_VERIFIED\")) {\n await applyServerStorage({ getAll, setAll, setItems, removedItems }, {\n cookieOptions: options?.cookieOptions ?? null,\n cookieEncoding: options?.cookieEncoding ?? \"base64url\",\n });\n }\n });\n return client;\n}\n//# sourceMappingURL=createServerClient.js.map","export * from \"./createBrowserClient\";\nexport * from \"./createServerClient\";\nexport * from \"./types\";\nexport * from \"./utils\";\n//# sourceMappingURL=index.js.map","import parseua from 'next/dist/compiled/ua-parser-js';\nexport function isBot(input) {\n return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(input);\n}\nexport function userAgentFromString(input) {\n return {\n ...parseua(input),\n isBot: input === undefined ? false : isBot(input)\n };\n}\nexport function userAgent({ headers }) {\n return userAgentFromString(headers.get('user-agent') || undefined);\n}\n\n//# sourceMappingURL=user-agent.js.map","const GlobalURLPattern = // @ts-expect-error: URLPattern is not available in Node.js\ntypeof URLPattern === 'undefined' ? undefined : URLPattern;\nexport { GlobalURLPattern as URLPattern };\n\n//# sourceMappingURL=url-pattern.js.map","import { workAsyncStorage } from '../app-render/work-async-storage.external';\n/**\n * This function allows you to schedule callbacks to be executed after the current request finishes.\n */ export function after(task) {\n const workStore = workAsyncStorage.getStore();\n if (!workStore) {\n // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore\n throw Object.defineProperty(new Error('`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context'), \"__NEXT_ERROR_CODE\", {\n value: \"E468\",\n enumerable: false,\n configurable: true\n });\n }\n const { afterContext } = workStore;\n return afterContext.after(task);\n}\n\n//# sourceMappingURL=after.js.map","export * from './after';\n\n//# sourceMappingURL=index.js.map","const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'\n\nexport class DynamicServerError extends Error {\n digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE\n\n constructor(public readonly description: string) {\n super(`Dynamic server usage: ${description}`)\n }\n}\n\nexport function isDynamicServerError(err: unknown): err is DynamicServerError {\n if (\n typeof err !== 'object' ||\n err === null ||\n !('digest' in err) ||\n typeof err.digest !== 'string'\n ) {\n return false\n }\n\n return err.digest === DYNAMIC_ERROR_CODE\n}\n","const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT'\n\nexport class StaticGenBailoutError extends Error {\n public readonly code = NEXT_STATIC_GEN_BAILOUT\n}\n\nexport function isStaticGenBailoutError(\n error: unknown\n): error is StaticGenBailoutError {\n if (typeof error !== 'object' || error === null || !('code' in error)) {\n return false\n }\n\n return error.code === NEXT_STATIC_GEN_BAILOUT\n}\n","export function isHangingPromiseRejectionError(err) {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false;\n }\n return err.digest === HANGING_PROMISE_REJECTION;\n}\nconst HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION';\nclass HangingPromiseRejectionError extends Error {\n constructor(route, expression){\n super(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \\`setTimeout\\`, \\`after\\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route \"${route}\".`), this.route = route, this.expression = expression, this.digest = HANGING_PROMISE_REJECTION;\n }\n}\nconst abortListenersBySignal = new WeakMap();\n/**\n * This function constructs a promise that will never resolve. This is primarily\n * useful for cacheComponents where we use promise resolution timing to determine which\n * parts of a render can be included in a prerender.\n *\n * @internal\n */ export function makeHangingPromise(signal, route, expression) {\n if (signal.aborted) {\n return Promise.reject(new HangingPromiseRejectionError(route, expression));\n } else {\n const hangingPromise = new Promise((_, reject)=>{\n const boundRejection = reject.bind(null, new HangingPromiseRejectionError(route, expression));\n let currentListeners = abortListenersBySignal.get(signal);\n if (currentListeners) {\n currentListeners.push(boundRejection);\n } else {\n const listeners = [\n boundRejection\n ];\n abortListenersBySignal.set(signal, listeners);\n signal.addEventListener('abort', ()=>{\n for(let i = 0; i < listeners.length; i++){\n listeners[i]();\n }\n }, {\n once: true\n });\n }\n });\n // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so\n // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct\n // your own promise out of it you'll need to ensure you handle the error when it rejects.\n hangingPromise.catch(ignoreReject);\n return hangingPromise;\n }\n}\nfunction ignoreReject() {}\nexport function makeDevtoolsIOAwarePromise(underlying) {\n // in React DevTools if we resolve in a setTimeout we will observe\n // the promise resolution as something that can suspend a boundary or root.\n return new Promise((resolve)=>{\n // Must use setTimeout to be considered IO React DevTools. setImmediate will not work.\n setTimeout(()=>{\n resolve(underlying);\n }, 0);\n });\n}\n\n//# sourceMappingURL=dynamic-rendering-utils.js.map","export const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';\nexport const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';\nexport const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';\nexport const ROOT_LAYOUT_BOUNDARY_NAME = '__next_root_layout_boundary__';\n\n//# sourceMappingURL=boundary-constants.js.map","// This has to be a shared module which is shared between client component error boundary and dynamic component\nconst BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'\n\n/** An error that should be thrown when we want to bail out to client-side rendering. */\nexport class BailoutToCSRError extends Error {\n public readonly digest = BAILOUT_TO_CSR\n\n constructor(public readonly reason: string) {\n super(`Bail out to client-side rendering: ${reason}`)\n }\n}\n\n/** Checks if a passed argument is an error that is thrown if we want to bail out to client-side rendering. */\nexport function isBailoutToCSRError(err: unknown): err is BailoutToCSRError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === BAILOUT_TO_CSR\n}\n","/**\n * The functions provided by this module are used to communicate certain properties\n * about the currently running code so that Next.js can make decisions on how to handle\n * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.\n *\n * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.\n * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts\n * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of\n * Dynamic indications.\n *\n * The first is simply an intention to be dynamic. unstable_noStore is an example of this where\n * the currently executing code simply declares that the current scope is dynamic but if you use it\n * inside unstable_cache it can still be cached. This type of indication can be removed if we ever\n * make the default dynamic to begin with because the only way you would ever be static is inside\n * a cache scope which this indication does not affect.\n *\n * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic\n * because it means that it is inappropriate to cache this at all. using a dynamic data source inside\n * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should\n * read that data outside the cache and pass it in as an argument to the cached function.\n */\n\nimport type { WorkStore } from '../app-render/work-async-storage.external'\nimport type {\n WorkUnitStore,\n RequestStore,\n PrerenderStoreLegacy,\n PrerenderStoreModern,\n PrerenderStoreModernRuntime,\n} from '../app-render/work-unit-async-storage.external'\n\n// Once postpone is in stable we should switch to importing the postpone export directly\nimport React from 'react'\n\nimport { DynamicServerError } from '../../client/components/hooks-server-context'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n getRuntimeStagePromise,\n workUnitAsyncStorage,\n} from './work-unit-async-storage.external'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n ROOT_LAYOUT_BOUNDARY_NAME,\n} from '../../lib/framework/boundary-constants'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport { BailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nconst hasPostpone = typeof React.unstable_postpone === 'function'\n\nexport type DynamicAccess = {\n /**\n * If debugging, this will contain the stack trace of where the dynamic access\n * occurred. This is used to provide more information to the user about why\n * their page is being rendered dynamically.\n */\n stack?: string\n\n /**\n * The expression that was accessed dynamically.\n */\n expression: string\n}\n\n// Stores dynamic reasons used during an RSC render.\nexport type DynamicTrackingState = {\n /**\n * When true, stack information will also be tracked during dynamic access.\n */\n readonly isDebugDynamicAccesses: boolean | undefined\n\n /**\n * The dynamic accesses that occurred during the render.\n */\n readonly dynamicAccesses: Array<DynamicAccess>\n\n syncDynamicErrorWithStack: null | Error\n}\n\n// Stores dynamic reasons used during an SSR render.\nexport type DynamicValidationState = {\n hasSuspenseAboveBody: boolean\n hasDynamicMetadata: boolean\n hasDynamicViewport: boolean\n hasAllowedDynamic: boolean\n dynamicErrors: Array<Error>\n}\n\nexport function createDynamicTrackingState(\n isDebugDynamicAccesses: boolean | undefined\n): DynamicTrackingState {\n return {\n isDebugDynamicAccesses,\n dynamicAccesses: [],\n syncDynamicErrorWithStack: null,\n }\n}\n\nexport function createDynamicValidationState(): DynamicValidationState {\n return {\n hasSuspenseAboveBody: false,\n hasDynamicMetadata: false,\n hasDynamicViewport: false,\n hasAllowedDynamic: false,\n dynamicErrors: [],\n }\n}\n\nexport function getFirstDynamicReason(\n trackingState: DynamicTrackingState\n): undefined | string {\n return trackingState.dynamicAccesses[0]?.expression\n}\n\n/**\n * This function communicates that the current scope should be treated as dynamic.\n *\n * In most cases this function is a no-op but if called during\n * a PPR prerender it will postpone the current sub-tree and calling\n * it during a normal prerender will cause the entire prerender to abort\n */\nexport function markCurrentScopeAsDynamic(\n store: WorkStore,\n workUnitStore: undefined | Exclude<WorkUnitStore, PrerenderStoreModern>,\n expression: string\n): void {\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return\n case 'prerender-legacy':\n case 'prerender-ppr':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n // If we're forcing dynamic rendering or we're forcing static rendering, we\n // don't need to do anything here because the entire page is already dynamic\n // or it's static and it should not throw or postpone here.\n if (store.forceDynamic || store.forceStatic) return\n\n if (store.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender-ppr':\n return postponeWithTracking(\n store.route,\n expression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n // We aren't prerendering, but we are generating a static page. We need\n // to bail out of static generation.\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n if (process.env.NODE_ENV !== 'production') {\n workUnitStore.usedDynamic = true\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n\n/**\n * This function is meant to be used when prerendering without cacheComponents or PPR.\n * When called during a build it will cause Next.js to consider the route as dynamic.\n *\n * @internal\n */\nexport function throwToInterruptStaticGeneration(\n expression: string,\n store: WorkStore,\n prerenderStore: PrerenderStoreLegacy\n): never {\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n\n prerenderStore.revalidate = 0\n\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n}\n\n/**\n * This function should be used to track whether something dynamic happened even when\n * we are in a dynamic render. This is useful for Dev where all renders are dynamic but\n * we still track whether dynamic APIs were accessed for helpful messaging\n *\n * @internal\n */\nexport function trackDynamicDataInDynamicRender(workUnitStore: WorkUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'prerender-ppr':\n case 'prerender-client':\n break\n case 'request':\n if (process.env.NODE_ENV !== 'production') {\n workUnitStore.usedDynamic = true\n }\n break\n default:\n workUnitStore satisfies never\n }\n}\n\nfunction abortOnSynchronousDynamicDataAccess(\n route: string,\n expression: string,\n prerenderStore: PrerenderStoreModern\n): void {\n const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`\n\n const error = createPrerenderInterruptedError(reason)\n\n prerenderStore.controller.abort(error)\n\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n}\n\nexport function abortOnSynchronousPlatformIOAccess(\n route: string,\n expression: string,\n errorWithStack: Error,\n prerenderStore: PrerenderStoreModern\n): void {\n const dynamicTracking = prerenderStore.dynamicTracking\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore)\n // It is important that we set this tracking value after aborting. Aborts are executed\n // synchronously except for the case where you abort during render itself. By setting this\n // value late we can use it to determine if any of the aborted tasks are the task that\n // called the sync IO expression in the first place.\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack\n }\n }\n}\n\nexport function trackSynchronousPlatformIOAccessInDev(\n requestStore: RequestStore\n): void {\n // We don't actually have a controller to abort but we do the semantic equivalent by\n // advancing the request store out of prerender mode\n requestStore.prerenderPhase = false\n}\n\n/**\n * use this function when prerendering with cacheComponents. If we are doing a\n * prospective prerender we don't actually abort because we want to discover\n * all caches for the shell. If this is the actual prerender we do abort.\n *\n * This function accepts a prerenderStore but the caller should ensure we're\n * actually running in cacheComponents mode.\n *\n * @internal\n */\nexport function abortAndThrowOnSynchronousRequestDataAccess(\n route: string,\n expression: string,\n errorWithStack: Error,\n prerenderStore: PrerenderStoreModern\n): never {\n const prerenderSignal = prerenderStore.controller.signal\n if (prerenderSignal.aborted === false) {\n // TODO it would be better to move this aborted check into the callsite so we can avoid making\n // the error object when it isn't relevant to the aborting of the prerender however\n // since we need the throw semantics regardless of whether we abort it is easier to land\n // this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer\n // to ideal implementation\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore)\n // It is important that we set this tracking value after aborting. Aborts are executed\n // synchronously except for the case where you abort during render itself. By setting this\n // value late we can use it to determine if any of the aborted tasks are the task that\n // called the sync IO expression in the first place.\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack\n }\n }\n }\n throw createPrerenderInterruptedError(\n `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`\n )\n}\n\n/**\n * Use this function when dynamically prerendering with dynamicIO.\n * We don't want to error, because it's better to return something\n * (and we've already aborted the render at the point where the sync dynamic error occured),\n * but we should log an error server-side.\n * @internal\n */\nexport function warnOnSyncDynamicError(dynamicTracking: DynamicTrackingState) {\n if (dynamicTracking.syncDynamicErrorWithStack) {\n // the server did something sync dynamic, likely\n // leading to an early termination of the prerender.\n console.error(dynamicTracking.syncDynamicErrorWithStack)\n }\n}\n\n// For now these implementations are the same so we just reexport\nexport const trackSynchronousRequestDataAccessInDev =\n trackSynchronousPlatformIOAccessInDev\n\n/**\n * This component will call `React.postpone` that throws the postponed error.\n */\ntype PostponeProps = {\n reason: string\n route: string\n}\nexport function Postpone({ reason, route }: PostponeProps): never {\n const prerenderStore = workUnitAsyncStorage.getStore()\n const dynamicTracking =\n prerenderStore && prerenderStore.type === 'prerender-ppr'\n ? prerenderStore.dynamicTracking\n : null\n postponeWithTracking(route, reason, dynamicTracking)\n}\n\nexport function postponeWithTracking(\n route: string,\n expression: string,\n dynamicTracking: null | DynamicTrackingState\n): never {\n assertPostpone()\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n\n React.unstable_postpone(createPostponeReason(route, expression))\n}\n\nfunction createPostponeReason(route: string, expression: string) {\n return (\n `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. ` +\n `React throws this special object to indicate where. It should not be caught by ` +\n `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`\n )\n}\n\nexport function isDynamicPostpone(err: unknown) {\n if (\n typeof err === 'object' &&\n err !== null &&\n typeof (err as any).message === 'string'\n ) {\n return isDynamicPostponeReason((err as any).message)\n }\n return false\n}\n\nfunction isDynamicPostponeReason(reason: string) {\n return (\n reason.includes(\n 'needs to bail out of prerendering at this point because it used'\n ) &&\n reason.includes(\n 'Learn more: https://nextjs.org/docs/messages/ppr-caught-error'\n )\n )\n}\n\nif (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) {\n throw new Error(\n 'Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js'\n )\n}\n\nconst NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED'\n\nfunction createPrerenderInterruptedError(message: string): Error {\n const error = new Error(message)\n ;(error as any).digest = NEXT_PRERENDER_INTERRUPTED\n return error\n}\n\ntype DigestError = Error & {\n digest: string\n}\n\nexport function isPrerenderInterruptedError(\n error: unknown\n): error is DigestError {\n return (\n typeof error === 'object' &&\n error !== null &&\n (error as any).digest === NEXT_PRERENDER_INTERRUPTED &&\n 'name' in error &&\n 'message' in error &&\n error instanceof Error\n )\n}\n\nexport function accessedDynamicData(\n dynamicAccesses: Array<DynamicAccess>\n): boolean {\n return dynamicAccesses.length > 0\n}\n\nexport function consumeDynamicAccess(\n serverDynamic: DynamicTrackingState,\n clientDynamic: DynamicTrackingState\n): DynamicTrackingState['dynamicAccesses'] {\n // We mutate because we only call this once we are no longer writing\n // to the dynamicTrackingState and it's more efficient than creating a new\n // array.\n serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses)\n return serverDynamic.dynamicAccesses\n}\n\nexport function formatDynamicAPIAccesses(\n dynamicAccesses: Array<DynamicAccess>\n): string[] {\n return dynamicAccesses\n .filter(\n (access): access is Required<DynamicAccess> =>\n typeof access.stack === 'string' && access.stack.length > 0\n )\n .map(({ expression, stack }) => {\n stack = stack\n .split('\\n')\n // Remove the \"Error: \" prefix from the first line of the stack trace as\n // well as the first 4 lines of the stack trace which is the distance\n // from the user code and the `new Error().stack` call.\n .slice(4)\n .filter((line) => {\n // Exclude Next.js internals from the stack trace.\n if (line.includes('node_modules/next/')) {\n return false\n }\n\n // Exclude anonymous functions from the stack trace.\n if (line.includes(' (<anonymous>)')) {\n return false\n }\n\n // Exclude Node.js internals from the stack trace.\n if (line.includes(' (node:')) {\n return false\n }\n\n return true\n })\n .join('\\n')\n return `Dynamic API Usage Debug - ${expression}:\\n${stack}`\n })\n}\n\nfunction assertPostpone() {\n if (!hasPostpone) {\n throw new Error(\n `Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`\n )\n }\n}\n\n/**\n * This is a bit of a hack to allow us to abort a render using a Postpone instance instead of an Error which changes React's\n * abort semantics slightly.\n */\nexport function createRenderInBrowserAbortSignal(): AbortSignal {\n const controller = new AbortController()\n controller.abort(new BailoutToCSRError('Render in Browser'))\n return controller.signal\n}\n\n/**\n * In a prerender, we may end up with hanging Promises as inputs due them\n * stalling on connection() or because they're loading dynamic data. In that\n * case we need to abort the encoding of arguments since they'll never complete.\n */\nexport function createHangingInputAbortSignal(\n workUnitStore: WorkUnitStore\n): AbortSignal | undefined {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime':\n const controller = new AbortController()\n\n if (workUnitStore.cacheSignal) {\n // If we have a cacheSignal it means we're in a prospective render. If\n // the input we're waiting on is coming from another cache, we do want\n // to wait for it so that we can resolve this cache entry too.\n workUnitStore.cacheSignal.inputReady().then(() => {\n controller.abort()\n })\n } else {\n // Otherwise we're in the final render and we should already have all\n // our caches filled.\n // If the prerender uses stages, we have wait until the runtime stage,\n // at which point all runtime inputs will be resolved.\n // (otherwise, a runtime prerender might consider `cookies()` hanging\n // even though they'd resolve in the next task.)\n //\n // We might still be waiting on some microtasks so we\n // wait one tick before giving up. When we give up, we still want to\n // render the content of this cache as deeply as we can so that we can\n // suspend as deeply as possible in the tree or not at all if we don't\n // end up waiting for the input.\n const runtimeStagePromise = getRuntimeStagePromise(workUnitStore)\n if (runtimeStagePromise) {\n runtimeStagePromise.then(() =>\n scheduleOnNextTick(() => controller.abort())\n )\n } else {\n scheduleOnNextTick(() => controller.abort())\n }\n }\n\n return controller.signal\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n return undefined\n default:\n workUnitStore satisfies never\n }\n}\n\nexport function annotateDynamicAccess(\n expression: string,\n prerenderStore: PrerenderStoreModern\n) {\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n}\n\nexport function useDynamicRouteParams(expression: string) {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workStore && workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender-client':\n case 'prerender': {\n const fallbackParams = workUnitStore.fallbackRouteParams\n if (fallbackParams && fallbackParams.size > 0) {\n // We are in a prerender with cacheComponents semantics. We are going to\n // hang here and never resolve. This will cause the currently\n // rendering component to effectively be a dynamic hole.\n React.use(\n makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n expression\n )\n )\n }\n break\n }\n case 'prerender-ppr': {\n const fallbackParams = workUnitStore.fallbackRouteParams\n if (fallbackParams && fallbackParams.size > 0) {\n return postponeWithTracking(\n workStore.route,\n expression,\n workUnitStore.dynamicTracking\n )\n }\n break\n }\n case 'prerender-runtime':\n throw new InvariantError(\n `\\`${expression}\\` was called during a runtime prerender. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`\n )\n case 'cache':\n case 'private-cache':\n throw new InvariantError(\n `\\`${expression}\\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`\n )\n case 'prerender-legacy':\n case 'request':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n\nconst hasSuspenseRegex = /\\n\\s+at Suspense \\(<anonymous>\\)/\n\n// Common implicit body tags that React will treat as body when placed directly in html\nconst bodyAndImplicitTags =\n 'body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6'\n\n// Detects when RootLayoutBoundary (our framework marker component) appears\n// after Suspense in the component stack, indicating the root layout is wrapped\n// within a Suspense boundary. Ensures no body/html/implicit-body components are in between.\n//\n// Example matches:\n// at Suspense (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\n//\n// Or with other components in between (but not body/html/implicit-body):\n// at Suspense (<anonymous>)\n// at SomeComponent (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\nconst hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(\n `\\\\n\\\\s+at Suspense \\\\(<anonymous>\\\\)(?:(?!\\\\n\\\\s+at (?:${bodyAndImplicitTags}) \\\\(<anonymous>\\\\))[\\\\s\\\\S])*?\\\\n\\\\s+at ${ROOT_LAYOUT_BOUNDARY_NAME} \\\\([^\\\\n]*\\\\)`\n)\n\nconst hasMetadataRegex = new RegExp(\n `\\\\n\\\\s+at ${METADATA_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst hasViewportRegex = new RegExp(\n `\\\\n\\\\s+at ${VIEWPORT_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst hasOutletRegex = new RegExp(`\\\\n\\\\s+at ${OUTLET_BOUNDARY_NAME}[\\\\n\\\\s]`)\n\nexport function trackAllowedDynamicAccess(\n workStore: WorkStore,\n componentStack: string,\n dynamicValidation: DynamicValidationState,\n clientDynamic: DynamicTrackingState\n) {\n if (hasOutletRegex.test(componentStack)) {\n // We don't need to track that this is dynamic. It is only so when something else is also dynamic.\n return\n } else if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.hasDynamicMetadata = true\n return\n } else if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.hasDynamicViewport = true\n return\n } else if (\n hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(\n componentStack\n )\n ) {\n // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule.\n // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense\n // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering.\n dynamicValidation.hasAllowedDynamic = true\n dynamicValidation.hasSuspenseAboveBody = true\n return\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it so we don't need to report it as a source\n // of disallowed\n dynamicValidation.hasAllowedDynamic = true\n return\n } else if (clientDynamic.syncDynamicErrorWithStack) {\n // This task was the task that called the sync error.\n dynamicValidation.dynamicErrors.push(\n clientDynamic.syncDynamicErrorWithStack\n )\n return\n } else {\n const message = `Route \"${workStore.route}\": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a \"use cache\" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`\n const error = createErrorWithComponentOrOwnerStack(message, componentStack)\n dynamicValidation.dynamicErrors.push(error)\n return\n }\n}\n\n/**\n * In dev mode, we prefer using the owner stack, otherwise the provided\n * component stack is used.\n */\nfunction createErrorWithComponentOrOwnerStack(\n message: string,\n componentStack: string\n) {\n const ownerStack =\n process.env.NODE_ENV !== 'production' && React.captureOwnerStack\n ? React.captureOwnerStack()\n : null\n\n const error = new Error(message)\n error.stack = error.name + ': ' + message + (ownerStack ?? componentStack)\n return error\n}\n\nexport enum PreludeState {\n Full = 0,\n Empty = 1,\n Errored = 2,\n}\n\nexport function logDisallowedDynamicError(\n workStore: WorkStore,\n error: Error\n): void {\n console.error(error)\n\n if (!workStore.dev) {\n if (workStore.hasReadableErrorStacks) {\n console.error(\n `To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \\`next dev\\`, then open \"${workStore.route}\" in your browser to investigate the error.`\n )\n } else {\n console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:\n - Start the app in development mode by running \\`next dev\\`, then open \"${workStore.route}\" in your browser to investigate the error.\n - Rerun the production build with \\`next build --debug-prerender\\` to generate better stack traces.`)\n }\n }\n}\n\nexport function throwIfDisallowedDynamic(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: DynamicValidationState,\n serverDynamic: DynamicTrackingState\n): void {\n if (prelude !== PreludeState.Full) {\n if (dynamicValidation.hasSuspenseAboveBody) {\n // This route has opted into allowing fully dynamic rendering\n // by including a Suspense boundary above the body. In this case\n // a lack of a shell is not considered disallowed so we simply return\n return\n }\n\n if (serverDynamic.syncDynamicErrorWithStack) {\n // There is no shell and the server did something sync dynamic likely\n // leading to an early termination of the prerender before the shell\n // could be completed. We terminate the build/validating render.\n logDisallowedDynamicError(\n workStore,\n serverDynamic.syncDynamicErrorWithStack\n )\n throw new StaticGenBailoutError()\n }\n\n // We didn't have any sync bailouts but there may be user code which\n // blocked the root. We would have captured these during the prerender\n // and can log them here and then terminate the build/validating render\n const dynamicErrors = dynamicValidation.dynamicErrors\n if (dynamicErrors.length > 0) {\n for (let i = 0; i < dynamicErrors.length; i++) {\n logDisallowedDynamicError(workStore, dynamicErrors[i])\n }\n\n throw new StaticGenBailoutError()\n }\n\n // If we got this far then the only other thing that could be blocking\n // the root is dynamic Viewport. If this is dynamic then\n // you need to opt into that by adding a Suspense boundary above the body\n // to indicate your are ok with fully dynamic rendering.\n if (dynamicValidation.hasDynamicViewport) {\n console.error(\n `Route \"${workStore.route}\" has a \\`generateViewport\\` that depends on Request data (\\`cookies()\\`, etc...) or uncached external data (\\`fetch(...)\\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`\n )\n throw new StaticGenBailoutError()\n }\n\n if (prelude === PreludeState.Empty) {\n // If we ever get this far then we messed up the tracking of invalid dynamic.\n // We still adhere to the constraint that you must produce a shell but invite the\n // user to report this as a bug in Next.js.\n console.error(\n `Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`\n )\n throw new StaticGenBailoutError()\n }\n } else {\n if (\n dynamicValidation.hasAllowedDynamic === false &&\n dynamicValidation.hasDynamicMetadata\n ) {\n console.error(\n `Route \"${workStore.route}\" has a \\`generateMetadata\\` that depends on Request data (\\`cookies()\\`, etc...) or uncached external data (\\`fetch(...)\\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`\n )\n throw new StaticGenBailoutError()\n }\n }\n}\n\nexport function delayUntilRuntimeStage<T>(\n prerenderStore: PrerenderStoreModernRuntime,\n result: Promise<T>\n): Promise<T> {\n if (prerenderStore.runtimeStagePromise) {\n return prerenderStore.runtimeStagePromise.then(() => result)\n }\n return result\n}\n","import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore,\n constructorOpt: Function\n): never {\n const error = new Error(\n `Route ${workStore.route} used \"searchParams\" inside \"use cache\". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \"searchParams\" outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n\n throw error\n}\n\nexport function isRequestAPICallableInsideAfter() {\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n return afterTaskStore?.rootTaskSpawnPhase === 'action'\n}\n","import { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n makeHangingPromise,\n makeDevtoolsIOAwarePromise,\n} from '../dynamic-rendering-utils'\nimport { isRequestAPICallableInsideAfter } from './utils'\n\n/**\n * This function allows you to indicate that you require an actual user Request before continuing.\n *\n * During prerendering it will never resolve and during rendering it resolves immediately.\n */\nexport function connection(): Promise<void> {\n const callingExpression = 'connection'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n `Route ${workStore.route} used \"connection\" inside \"after(...)\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic, we override all other logic and always just\n // return a resolving promise without tracking.\n return Promise.resolve(undefined)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`connection\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \"connection\" inside \"use cache\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'private-cache': {\n // It might not be intuitive to throw for private caches as well, but\n // we don't consider runtime prefetches as \"actual requests\" (in the\n // navigation sense), despite allowing them to read cookies.\n const error = new Error(\n `Route ${workStore.route} used \"connection\" inside \"use cache: private\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, connection)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \"connection\" inside a function cached with \"unstable_cache(...)\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // We return a promise that never resolves to allow the prerender to\n // stall at this point.\n return makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n '`connection()`'\n )\n case 'prerender-ppr':\n // We use React's postpone API to interrupt rendering here to create a\n // dynamic hole\n return postponeWithTracking(\n workStore.route,\n 'connection',\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We throw an error here to interrupt prerendering to mark the route\n // as dynamic\n return throwToInterruptStaticGeneration(\n 'connection',\n workStore,\n workUnitStore\n )\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeDevtoolsIOAwarePromise(undefined)\n } else {\n return Promise.resolve(undefined)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n","// This regex will have fast negatives meaning valid identifiers may not pass\n// this test. However this is only used during static generation to provide hints\n// about why a page bailed out of some or all prerendering and we can use bracket notation\n// for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']`\n// even if this would have been fine too `searchParams.ಠ_ಠ`\nconst isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\nexport function describeStringPropertyAccess(target: string, prop: string) {\n if (isDefinitelyAValidIdentifier.test(prop)) {\n return `\\`${target}.${prop}\\``\n }\n return `\\`${target}[${JSON.stringify(prop)}]\\``\n}\n\nexport function describeHasCheckingStringProperty(\n target: string,\n prop: string\n) {\n const stringifiedProp = JSON.stringify(prop)\n return `\\`Reflect.has(${target}, ${stringifiedProp})\\`, \\`${stringifiedProp} in ${target}\\`, or similar`\n}\n\nexport const wellKnownProperties = new Set([\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n 'toLocaleString',\n\n // Promise prototype\n // fallthrough\n 'then',\n 'catch',\n 'finally',\n\n // React Promise extension\n // fallthrough\n 'status',\n\n // React introspection\n 'displayName',\n '_debugInfo',\n\n // Common tested properties\n // fallthrough\n 'toJSON',\n '$$typeof',\n '__esModule',\n\n // Tested by flight when checking for iterables\n '@@iterator',\n])\n","import { createAsyncLocalStorage } from './async-local-storage';\nexport const actionAsyncStorageInstance = createAsyncLocalStorage();\n\n//# sourceMappingURL=action-async-storage-instance.js.map","// Share the instance module in the next-shared layer\nimport { actionAsyncStorageInstance } from './action-async-storage-instance' with {\n 'turbopack-transition': 'next-shared'\n};\nexport { actionAsyncStorageInstance as actionAsyncStorage };\n\n//# sourceMappingURL=action-async-storage.external.js.map","// ISC License\n// Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n//\n// https://github.com/alexeyraspopov/picocolors/blob/b6261487e7b81aaab2440e397a356732cad9e342/picocolors.js#L1\nvar _globalThis;\nconst { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {};\nconst enabled = env && !env.NO_COLOR && (env.FORCE_COLOR || (stdout == null ? void 0 : stdout.isTTY) && !env.CI && env.TERM !== 'dumb');\nconst replaceClose = (str, close, replace, index)=>{\n const start = str.substring(0, index) + replace;\n const end = str.substring(index + close.length);\n const nextIndex = end.indexOf(close);\n return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\nconst formatter = (open, close, replace = open)=>{\n if (!enabled) return String;\n return (input)=>{\n const string = '' + input;\n const index = string.indexOf(close, open.length);\n return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;\n };\n};\nexport const reset = enabled ? (s)=>`\\x1b[0m${s}\\x1b[0m` : String;\nexport const bold = formatter('\\x1b[1m', '\\x1b[22m', '\\x1b[22m\\x1b[1m');\nexport const dim = formatter('\\x1b[2m', '\\x1b[22m', '\\x1b[22m\\x1b[2m');\nexport const italic = formatter('\\x1b[3m', '\\x1b[23m');\nexport const underline = formatter('\\x1b[4m', '\\x1b[24m');\nexport const inverse = formatter('\\x1b[7m', '\\x1b[27m');\nexport const hidden = formatter('\\x1b[8m', '\\x1b[28m');\nexport const strikethrough = formatter('\\x1b[9m', '\\x1b[29m');\nexport const black = formatter('\\x1b[30m', '\\x1b[39m');\nexport const red = formatter('\\x1b[31m', '\\x1b[39m');\nexport const green = formatter('\\x1b[32m', '\\x1b[39m');\nexport const yellow = formatter('\\x1b[33m', '\\x1b[39m');\nexport const blue = formatter('\\x1b[34m', '\\x1b[39m');\nexport const magenta = formatter('\\x1b[35m', '\\x1b[39m');\nexport const purple = formatter('\\x1b[38;2;173;127;168m', '\\x1b[39m');\nexport const cyan = formatter('\\x1b[36m', '\\x1b[39m');\nexport const white = formatter('\\x1b[37m', '\\x1b[39m');\nexport const gray = formatter('\\x1b[90m', '\\x1b[39m');\nexport const bgBlack = formatter('\\x1b[40m', '\\x1b[49m');\nexport const bgRed = formatter('\\x1b[41m', '\\x1b[49m');\nexport const bgGreen = formatter('\\x1b[42m', '\\x1b[49m');\nexport const bgYellow = formatter('\\x1b[43m', '\\x1b[49m');\nexport const bgBlue = formatter('\\x1b[44m', '\\x1b[49m');\nexport const bgMagenta = formatter('\\x1b[45m', '\\x1b[49m');\nexport const bgCyan = formatter('\\x1b[46m', '\\x1b[49m');\nexport const bgWhite = formatter('\\x1b[47m', '\\x1b[49m');\n\n//# sourceMappingURL=picocolors.js.map","import { bold, green, magenta, red, yellow, white } from '../../lib/picocolors';\nimport { LRUCache } from '../../server/lib/lru-cache';\nexport const prefixes = {\n wait: white(bold('○')),\n error: red(bold('⨯')),\n warn: yellow(bold('⚠')),\n ready: '▲',\n info: white(bold(' ')),\n event: green(bold('✓')),\n trace: magenta(bold('»'))\n};\nconst LOGGING_METHOD = {\n log: 'log',\n warn: 'warn',\n error: 'error'\n};\nfunction prefixedLog(prefixType, ...message) {\n if ((message[0] === '' || message[0] === undefined) && message.length === 1) {\n message.shift();\n }\n const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : 'log';\n const prefix = prefixes[prefixType];\n // If there's no message, don't print the prefix but a new line\n if (message.length === 0) {\n console[consoleMethod]('');\n } else {\n // Ensure if there's ANSI escape codes it's concatenated into one string.\n // Chrome DevTool can only handle color if it's in one string.\n if (message.length === 1 && typeof message[0] === 'string') {\n console[consoleMethod](' ' + prefix + ' ' + message[0]);\n } else {\n console[consoleMethod](' ' + prefix, ...message);\n }\n }\n}\nexport function bootstrap(...message) {\n // logging format: ' <prefix> <message>'\n // e.g. ' ✓ Compiled successfully'\n // Add spaces to align with the indent of other logs\n console.log(' ' + message.join(' '));\n}\nexport function wait(...message) {\n prefixedLog('wait', ...message);\n}\nexport function error(...message) {\n prefixedLog('error', ...message);\n}\nexport function warn(...message) {\n prefixedLog('warn', ...message);\n}\nexport function ready(...message) {\n prefixedLog('ready', ...message);\n}\nexport function info(...message) {\n prefixedLog('info', ...message);\n}\nexport function event(...message) {\n prefixedLog('event', ...message);\n}\nexport function trace(...message) {\n prefixedLog('trace', ...message);\n}\nconst warnOnceCache = new LRUCache(10000, (value)=>value.length);\nexport function warnOnce(...message) {\n const key = message.join(' ');\n if (!warnOnceCache.has(key)) {\n warnOnceCache.set(key, key);\n warn(...message);\n }\n}\n\n//# sourceMappingURL=log.js.map","import { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n} from '../app-render/dynamic-rendering'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n workUnitAsyncStorage,\n type PrerenderStoreLegacy,\n type PrerenderStorePPR,\n type StaticPrerenderStore,\n} from '../app-render/work-unit-async-storage.external'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport type { FallbackRouteParams } from './fallback-params'\nimport type { Params, ParamValue } from './params'\nimport {\n describeStringPropertyAccess,\n wellKnownProperties,\n} from '../../shared/lib/utils/reflect-utils'\nimport { actionAsyncStorage } from '../app-render/action-async-storage.external'\nimport { warnOnce } from '../../build/output/log'\n\ninterface CacheLifetime {}\nconst CachedParams = new WeakMap<CacheLifetime, Promise<Params>>()\n\n/**\n * @deprecated import specific root params from `next/root-params` instead.\n */\nexport async function unstable_rootParams(): Promise<Params> {\n warnOnce(\n '`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.'\n )\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Missing workStore in unstable_rootParams')\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workUnitStore) {\n throw new Error(\n `Route ${workStore.route} used \\`unstable_rootParams()\\` in Pages Router. This API is only available within App Router.`\n )\n }\n\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache': {\n throw new Error(\n `Route ${workStore.route} used \\`unstable_rootParams()\\` inside \\`\"use cache\"\\` or \\`unstable_cache\\`. Support for this API inside cache scopes is planned for a future version of Next.js.`\n )\n }\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n return createPrerenderRootParams(\n workUnitStore.rootParams,\n workStore,\n workUnitStore\n )\n case 'private-cache':\n case 'prerender-runtime':\n case 'request':\n return Promise.resolve(workUnitStore.rootParams)\n default:\n return workUnitStore satisfies never\n }\n}\n\nfunction createPrerenderRootParams(\n underlyingParams: Params,\n workStore: WorkStore,\n prerenderStore: StaticPrerenderStore\n): Promise<Params> {\n switch (prerenderStore.type) {\n case 'prerender-client': {\n const exportName = '`unstable_rootParams`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n }\n case 'prerender': {\n const fallbackParams = prerenderStore.fallbackRouteParams\n if (fallbackParams) {\n for (const key in underlyingParams) {\n if (fallbackParams.has(key)) {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const promise = makeHangingPromise<Params>(\n prerenderStore.renderSignal,\n workStore.route,\n '`unstable_rootParams`'\n )\n CachedParams.set(underlyingParams, promise)\n\n return promise\n }\n }\n }\n break\n }\n case 'prerender-ppr': {\n const fallbackParams = prerenderStore.fallbackRouteParams\n if (fallbackParams) {\n for (const key in underlyingParams) {\n if (fallbackParams.has(key)) {\n // We have fallback params at this level so we need to make an erroring\n // params object which will postpone if you access the fallback params\n return makeErroringRootParams(\n underlyingParams,\n fallbackParams,\n workStore,\n prerenderStore\n )\n }\n }\n }\n break\n }\n case 'prerender-legacy':\n break\n default:\n prerenderStore satisfies never\n }\n\n // We don't have any fallback params so we have an entirely static safe params object\n return Promise.resolve(underlyingParams)\n}\n\nfunction makeErroringRootParams(\n underlyingParams: Params,\n fallbackParams: FallbackRouteParams,\n workStore: WorkStore,\n prerenderStore: PrerenderStorePPR | PrerenderStoreLegacy\n): Promise<Params> {\n const cachedParams = CachedParams.get(underlyingParams)\n if (cachedParams) {\n return cachedParams\n }\n\n const augmentedUnderlying = { ...underlyingParams }\n\n // We don't use makeResolvedReactPromise here because params\n // supports copying with spread and we don't want to unnecessarily\n // instrument the promise with spreadable properties of ReactPromise.\n const promise = Promise.resolve(augmentedUnderlying)\n CachedParams.set(underlyingParams, promise)\n\n Object.keys(underlyingParams).forEach((prop) => {\n if (wellKnownProperties.has(prop)) {\n // These properties cannot be shadowed because they need to be the\n // true underlying value for Promises to work correctly at runtime\n } else {\n if (fallbackParams.has(prop)) {\n Object.defineProperty(augmentedUnderlying, prop, {\n get() {\n const expression = describeStringPropertyAccess(\n 'unstable_rootParams',\n prop\n )\n // In most dynamic APIs we also throw if `dynamic = \"error\"` however\n // for params is only dynamic when we're generating a fallback shell\n // and even when `dynamic = \"error\"` we still support generating dynamic\n // fallback shells\n // TODO remove this comment when cacheComponents is the default since there\n // will be no `dynamic = \"error\"`\n if (prerenderStore.type === 'prerender-ppr') {\n // PPR Prerender (no cacheComponents)\n postponeWithTracking(\n workStore.route,\n expression,\n prerenderStore.dynamicTracking\n )\n } else {\n // Legacy Prerender\n throwToInterruptStaticGeneration(\n expression,\n workStore,\n prerenderStore\n )\n }\n },\n enumerable: true,\n })\n } else {\n ;(promise as any)[prop] = underlyingParams[prop]\n }\n }\n })\n\n return promise\n}\n\n/**\n * Used for the compiler-generated `next/root-params` module.\n * @internal\n */\nexport function getRootParam(paramName: string): Promise<ParamValue> {\n const apiName = `\\`import('next/root-params').${paramName}()\\``\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError(`Missing workStore in ${apiName}`)\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (!workUnitStore) {\n throw new Error(\n `Route ${workStore.route} used ${apiName} outside of a Server Component. This is not allowed.`\n )\n }\n\n const actionStore = actionAsyncStorage.getStore()\n if (actionStore) {\n if (actionStore.isAppRoute) {\n // TODO(root-params): add support for route handlers\n throw new Error(\n `Route ${workStore.route} used ${apiName} inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.`\n )\n }\n if (actionStore.isAction && workUnitStore.phase === 'action') {\n // Actions are not fundamentally tied to a route (even if they're always submitted from some page),\n // so root params would be inconsistent if an action is called from multiple roots.\n // Make sure we check if the phase is \"action\" - we should not error in the rerender\n // after an action revalidates or updates cookies (which will still have `actionStore.isAction === true`)\n throw new Error(\n `${apiName} was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.`\n )\n }\n }\n\n switch (workUnitStore.type) {\n case 'unstable-cache':\n case 'cache': {\n throw new Error(\n `Route ${workStore.route} used ${apiName} inside \\`\"use cache\"\\` or \\`unstable_cache\\`. Support for this API inside cache scopes is planned for a future version of Next.js.`\n )\n }\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy': {\n return createPrerenderRootParamPromise(\n paramName,\n workStore,\n workUnitStore,\n apiName\n )\n }\n case 'private-cache':\n case 'prerender-runtime':\n case 'request': {\n break\n }\n default: {\n workUnitStore satisfies never\n }\n }\n return Promise.resolve(workUnitStore.rootParams[paramName])\n}\n\nfunction createPrerenderRootParamPromise(\n paramName: string,\n workStore: WorkStore,\n prerenderStore: StaticPrerenderStore,\n apiName: string\n): Promise<ParamValue> {\n switch (prerenderStore.type) {\n case 'prerender-client': {\n throw new InvariantError(\n `${apiName} must not be used within a client component. Next.js should be preventing ${apiName} from being included in client components statically, but did not in this case.`\n )\n }\n case 'prerender':\n case 'prerender-legacy':\n case 'prerender-ppr':\n default:\n }\n\n const underlyingParams = prerenderStore.rootParams\n\n switch (prerenderStore.type) {\n case 'prerender': {\n // We are in a dynamicIO prerender.\n // The param is a fallback, so it should be treated as dynamic.\n if (\n prerenderStore.fallbackRouteParams &&\n prerenderStore.fallbackRouteParams.has(paramName)\n ) {\n return makeHangingPromise<ParamValue>(\n prerenderStore.renderSignal,\n workStore.route,\n apiName\n )\n }\n break\n }\n case 'prerender-ppr': {\n // We aren't in a dynamicIO prerender, but the param is a fallback,\n // so we need to make an erroring params object which will postpone/error if you access it\n if (\n prerenderStore.fallbackRouteParams &&\n prerenderStore.fallbackRouteParams.has(paramName)\n ) {\n return makeErroringRootParamPromise(\n paramName,\n workStore,\n prerenderStore,\n apiName\n )\n }\n break\n }\n case 'prerender-legacy': {\n // legacy prerenders can't have fallback params\n break\n }\n default: {\n prerenderStore satisfies never\n }\n }\n\n // If the param is not a fallback param, we just return the statically available value.\n return Promise.resolve(underlyingParams[paramName])\n}\n\n/** Deliberately async -- we want to create a rejected promise, not error synchronously. */\nasync function makeErroringRootParamPromise(\n paramName: string,\n workStore: WorkStore,\n prerenderStore: PrerenderStorePPR | PrerenderStoreLegacy,\n apiName: string\n): Promise<ParamValue> {\n const expression = describeStringPropertyAccess(apiName, paramName)\n // In most dynamic APIs, we also throw if `dynamic = \"error\"`.\n // However, root params are only dynamic when we're generating a fallback shell,\n // and even with `dynamic = \"error\"` we still support generating dynamic fallback shells.\n // TODO: remove this comment when dynamicIO is the default since there will be no `dynamic = \"error\"`\n switch (prerenderStore.type) {\n case 'prerender-ppr': {\n return postponeWithTracking(\n workStore.route,\n expression,\n prerenderStore.dynamicTracking\n )\n }\n case 'prerender-legacy': {\n return throwToInterruptStaticGeneration(\n expression,\n workStore,\n prerenderStore\n )\n }\n default: {\n prerenderStore satisfies never\n }\n }\n}\n","// Alias index file of next/server for edge runtime for tree-shaking purpose\nexport { ImageResponse } from '../spec-extension/image-response';\nexport { NextRequest } from '../spec-extension/request';\nexport { NextResponse } from '../spec-extension/response';\nexport { userAgent, userAgentFromString } from '../spec-extension/user-agent';\nexport { URLPattern } from '../spec-extension/url-pattern';\nexport { after } from '../../after';\nexport { connection } from '../../request/connection';\nexport { unstable_rootParams } from '../../request/root-params';\n\n//# sourceMappingURL=index.js.map","export * from '../server/web/exports/index';\n\n//# sourceMappingURL=server.js.map","export function supabaseAnonKey(): string | undefined {\n return present(process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY);\n}\n\nexport function supabaseBrowserUrl(): string | undefined {\n return present(process.env.NEXT_PUBLIC_SUPABASE_URL);\n}\n\nexport function supabaseServerUrl(): string | undefined {\n return present(process.env.SUPABASE_SERVER_URL ?? process.env.NEXT_PUBLIC_SUPABASE_URL);\n}\n\nfunction present(value: string | undefined): string | undefined {\n if (!value) {\n return undefined;\n }\n return value;\n}\n","import { createServerClient } from \"@supabase/ssr\";\nimport { NextResponse, type NextRequest } from \"next/server\";\nimport { supabaseAnonKey, supabaseServerUrl } from \"./lib/supabase-env\";\n\nexport async function middleware(request: NextRequest) {\n let response = NextResponse.next({ request });\n const url = supabaseServerUrl();\n const key = supabaseAnonKey();\n if (!url || !key) {\n return response;\n }\n\n const supabase = createServerClient(url, key, {\n cookies: {\n getAll() {\n return request.cookies.getAll();\n },\n setAll(cookiesToSet) {\n for (const cookie of cookiesToSet) {\n request.cookies.set(cookie.name, cookie.value);\n }\n response = NextResponse.next({ request });\n for (const cookie of cookiesToSet) {\n response.cookies.set(cookie.name, cookie.value, cookie.options);\n }\n },\n },\n });\n await supabase.auth.getUser();\n return response;\n}\n\nexport const config = {\n matcher: [\"/((?!_next/static|_next/image|favicon.ico).*)\"],\n};\n","export const HTTPAccessErrorStatus = {\n NOT_FOUND: 404,\n FORBIDDEN: 403,\n UNAUTHORIZED: 401,\n}\n\nconst ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus))\n\nexport const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK'\n\nexport type HTTPAccessFallbackError = Error & {\n digest: `${typeof HTTP_ERROR_FALLBACK_ERROR_CODE};${string}`\n}\n\n/**\n * Checks an error to determine if it's an error generated by\n * the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.\n *\n * @param error the error that may reference a HTTP access error\n * @returns true if the error is a HTTP access error\n */\nexport function isHTTPAccessFallbackError(\n error: unknown\n): error is HTTPAccessFallbackError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n const [prefix, httpStatus] = error.digest.split(';')\n\n return (\n prefix === HTTP_ERROR_FALLBACK_ERROR_CODE &&\n ALLOWED_CODES.has(Number(httpStatus))\n )\n}\n\nexport function getAccessFallbackHTTPStatus(\n error: HTTPAccessFallbackError\n): number {\n const httpStatus = error.digest.split(';')[1]\n return Number(httpStatus)\n}\n\nexport function getAccessFallbackErrorTypeByStatus(\n status: number\n): 'not-found' | 'forbidden' | 'unauthorized' | undefined {\n switch (status) {\n case 401:\n return 'unauthorized'\n case 403:\n return 'forbidden'\n case 404:\n return 'not-found'\n default:\n return\n }\n}\n","export enum RedirectStatusCode {\n SeeOther = 303,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n}\n","import { RedirectStatusCode } from './redirect-status-code'\n\nexport const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'\n\nexport enum RedirectType {\n push = 'push',\n replace = 'replace',\n}\n\nexport type RedirectError = Error & {\n digest: `${typeof REDIRECT_ERROR_CODE};${RedirectType};${string};${RedirectStatusCode};`\n}\n\n/**\n * Checks an error to determine if it's an error generated by the\n * `redirect(url)` helper.\n *\n * @param error the error that may reference a redirect error\n * @returns true if the error is a redirect error\n */\nexport function isRedirectError(error: unknown): error is RedirectError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n\n const digest = error.digest.split(';')\n const [errorCode, type] = digest\n const destination = digest.slice(2, -2).join(';')\n const status = digest.at(-2)\n\n const statusCode = Number(status)\n\n return (\n errorCode === REDIRECT_ERROR_CODE &&\n (type === 'replace' || type === 'push') &&\n typeof destination === 'string' &&\n !isNaN(statusCode) &&\n statusCode in RedirectStatusCode\n )\n}\n","import {\n isHTTPAccessFallbackError,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\nimport { isRedirectError, type RedirectError } from './redirect-error'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | HTTPAccessFallbackError {\n return isRedirectError(error) || isHTTPAccessFallbackError(error)\n}\n","import \"next/dist/server/web/globals\";\nimport { adapter } from \"next/dist/server/web/adapter\";\n// Import the userland code.\nimport * as _mod from \"private-next-root-dir/src/middleware.ts\";\nimport { edgeInstrumentationOnRequestError } from \"next/dist/server/web/globals\";\nimport { isNextRouterError } from \"next/dist/client/components/is-next-router-error\";\nconst mod = {\n ..._mod\n};\nconst handler = mod.middleware || mod.default;\nconst page = \"/src/middleware\";\nif (typeof handler !== 'function') {\n throw Object.defineProperty(new Error(`The Middleware \"${page}\" must export a \\`middleware\\` or a \\`default\\` function`), \"__NEXT_ERROR_CODE\", {\n value: \"E120\",\n enumerable: false,\n configurable: true\n });\n}\n// Middleware will only sent out the FetchEvent to next server,\n// so load instrumentation module here and track the error inside middleware module.\nfunction errorHandledHandler(fn) {\n return async (...args)=>{\n try {\n return await fn(...args);\n } catch (err) {\n // In development, error the navigation API usage in runtime,\n // since it's not allowed to be used in middleware as it's outside of react component tree.\n if (process.env.NODE_ENV !== 'production') {\n if (isNextRouterError(err)) {\n err.message = `Next.js navigation API is not allowed to be used in Middleware.`;\n throw err;\n }\n }\n const req = args[0];\n const url = new URL(req.url);\n const resource = url.pathname + url.search;\n await edgeInstrumentationOnRequestError(err, {\n path: resource,\n method: req.method,\n headers: Object.fromEntries(req.headers.entries())\n }, {\n routerKind: 'Pages Router',\n routePath: '/middleware',\n routeType: 'middleware',\n revalidateReason: undefined\n });\n throw err;\n }\n };\n}\nexport default function nHandler(opts) {\n return adapter({\n ...opts,\n page,\n handler: errorHandledHandler(handler)\n });\n}\n\n//# sourceMappingURL=middleware.js.map\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n0 && (module.exports = {\n handleFetch: null,\n interceptFetch: null,\n reader: null\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n handleFetch: function() {\n return handleFetch;\n },\n interceptFetch: function() {\n return interceptFetch;\n },\n reader: function() {\n return reader;\n }\n});\nconst _context = require(\"./context\");\nconst reader = {\n url (req) {\n return req.url;\n },\n header (req, name) {\n return req.headers.get(name);\n }\n};\nfunction getTestStack() {\n let stack = (new Error().stack ?? '').split('\\n');\n // Skip the first line and find first non-empty line.\n for(let i = 1; i < stack.length; i++){\n if (stack[i].length > 0) {\n stack = stack.slice(i);\n break;\n }\n }\n // Filter out franmework lines.\n stack = stack.filter((f)=>!f.includes('/next/dist/'));\n // At most 5 lines.\n stack = stack.slice(0, 5);\n // Cleanup some internal info and trim.\n stack = stack.map((s)=>s.replace('webpack-internal:///(rsc)/', '').trim());\n return stack.join(' ');\n}\nasync function buildProxyRequest(testData, request) {\n const { url, method, headers, body, cache, credentials, integrity, mode, redirect, referrer, referrerPolicy } = request;\n return {\n testData,\n api: 'fetch',\n request: {\n url,\n method,\n headers: [\n ...Array.from(headers),\n [\n 'next-test-stack',\n getTestStack()\n ]\n ],\n body: body ? Buffer.from(await request.arrayBuffer()).toString('base64') : null,\n cache,\n credentials,\n integrity,\n mode,\n redirect,\n referrer,\n referrerPolicy\n }\n };\n}\nfunction buildResponse(proxyResponse) {\n const { status, headers, body } = proxyResponse.response;\n return new Response(body ? Buffer.from(body, 'base64') : null, {\n status,\n headers: new Headers(headers)\n });\n}\nasync function handleFetch(originalFetch, request) {\n const testInfo = (0, _context.getTestReqInfo)(request, reader);\n if (!testInfo) {\n // Passthrough non-test requests.\n return originalFetch(request);\n }\n const { testData, proxyPort } = testInfo;\n const proxyRequest = await buildProxyRequest(testData, request);\n const resp = await originalFetch(`http://localhost:${proxyPort}`, {\n method: 'POST',\n body: JSON.stringify(proxyRequest),\n next: {\n // @ts-ignore\n internal: true\n }\n });\n if (!resp.ok) {\n throw Object.defineProperty(new Error(`Proxy request failed: ${resp.status}`), \"__NEXT_ERROR_CODE\", {\n value: \"E146\",\n enumerable: false,\n configurable: true\n });\n }\n const proxyResponse = await resp.json();\n const { api } = proxyResponse;\n switch(api){\n case 'continue':\n return originalFetch(request);\n case 'abort':\n case 'unhandled':\n throw Object.defineProperty(new Error(`Proxy request aborted [${request.method} ${request.url}]`), \"__NEXT_ERROR_CODE\", {\n value: \"E145\",\n enumerable: false,\n configurable: true\n });\n case 'fetch':\n return buildResponse(proxyResponse);\n default:\n return api;\n }\n}\nfunction interceptFetch(originalFetch) {\n global.fetch = function testFetch(input, init) {\n var _init_next;\n // Passthrough internal requests.\n // @ts-ignore\n if (init == null ? void 0 : (_init_next = init.next) == null ? void 0 : _init_next.internal) {\n return originalFetch(input, init);\n }\n return handleFetch(originalFetch, new Request(input, init));\n };\n return ()=>{\n global.fetch = originalFetch;\n };\n}\n\n//# sourceMappingURL=fetch.js.map","/**\n * @license React\n * react.react-server.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar ReactSharedInternals = { H: null, A: null };\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty,\n assign = Object.assign;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n formatProdErrorMessage(\n 31,\n \"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array\n )\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nfunction createCacheRoot() {\n return new WeakMap();\n}\nfunction createCacheNode() {\n return { s: 0, v: void 0, o: null, p: null };\n}\nexports.Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children)) throw Error(formatProdErrorMessage(143));\n return children;\n }\n};\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.cache = function (fn) {\n return function () {\n var dispatcher = ReactSharedInternals.A;\n if (!dispatcher) return fn.apply(null, arguments);\n var fnMap = dispatcher.getCacheForType(createCacheRoot);\n dispatcher = fnMap.get(fn);\n void 0 === dispatcher &&\n ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));\n fnMap = 0;\n for (var l = arguments.length; fnMap < l; fnMap++) {\n var arg = arguments[fnMap];\n if (\n \"function\" === typeof arg ||\n (\"object\" === typeof arg && null !== arg)\n ) {\n var objectCache = dispatcher.o;\n null === objectCache && (dispatcher.o = objectCache = new WeakMap());\n dispatcher = objectCache.get(arg);\n void 0 === dispatcher &&\n ((dispatcher = createCacheNode()), objectCache.set(arg, dispatcher));\n } else\n (objectCache = dispatcher.p),\n null === objectCache && (dispatcher.p = objectCache = new Map()),\n (dispatcher = objectCache.get(arg)),\n void 0 === dispatcher &&\n ((dispatcher = createCacheNode()),\n objectCache.set(arg, dispatcher));\n }\n if (1 === dispatcher.s) return dispatcher.v;\n if (2 === dispatcher.s) throw dispatcher.v;\n try {\n var result = fn.apply(null, arguments);\n fnMap = dispatcher;\n fnMap.s = 1;\n return (fnMap.v = result);\n } catch (error) {\n throw ((result = dispatcher), (result.s = 2), (result.v = error), error);\n }\n };\n};\nexports.cacheSignal = function () {\n var dispatcher = ReactSharedInternals.A;\n return dispatcher ? dispatcher.cacheSignal() : null;\n};\nexports.captureOwnerStack = function () {\n return null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(formatProdErrorMessage(267, element));\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useDebugValue = function () {};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.version = \"19.2.0-canary-0bdb9206-20250818\";\n","module.exports = require(\"node:buffer\");","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n RequestCookies: () => RequestCookies,\n ResponseCookies: () => ResponseCookies,\n parseCookie: () => parseCookie,\n parseSetCookie: () => parseSetCookie,\n stringifyCookie: () => stringifyCookie\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/serialize.ts\nfunction stringifyCookie(c) {\n var _a;\n const attrs = [\n \"path\" in c && c.path && `Path=${c.path}`,\n \"expires\" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === \"number\" ? new Date(c.expires) : c.expires).toUTCString()}`,\n \"maxAge\" in c && typeof c.maxAge === \"number\" && `Max-Age=${c.maxAge}`,\n \"domain\" in c && c.domain && `Domain=${c.domain}`,\n \"secure\" in c && c.secure && \"Secure\",\n \"httpOnly\" in c && c.httpOnly && \"HttpOnly\",\n \"sameSite\" in c && c.sameSite && `SameSite=${c.sameSite}`,\n \"partitioned\" in c && c.partitioned && \"Partitioned\",\n \"priority\" in c && c.priority && `Priority=${c.priority}`\n ].filter(Boolean);\n const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : \"\")}`;\n return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join(\"; \")}`;\n}\nfunction parseCookie(cookie) {\n const map = /* @__PURE__ */ new Map();\n for (const pair of cookie.split(/; */)) {\n if (!pair)\n continue;\n const splitAt = pair.indexOf(\"=\");\n if (splitAt === -1) {\n map.set(pair, \"true\");\n continue;\n }\n const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];\n try {\n map.set(key, decodeURIComponent(value != null ? value : \"true\"));\n } catch {\n }\n }\n return map;\n}\nfunction parseSetCookie(setCookie) {\n if (!setCookie) {\n return void 0;\n }\n const [[name, value], ...attributes] = parseCookie(setCookie);\n const {\n domain,\n expires,\n httponly,\n maxage,\n path,\n samesite,\n secure,\n partitioned,\n priority\n } = Object.fromEntries(\n attributes.map(([key, value2]) => [\n key.toLowerCase().replace(/-/g, \"\"),\n value2\n ])\n );\n const cookie = {\n name,\n value: decodeURIComponent(value),\n domain,\n ...expires && { expires: new Date(expires) },\n ...httponly && { httpOnly: true },\n ...typeof maxage === \"string\" && { maxAge: Number(maxage) },\n path,\n ...samesite && { sameSite: parseSameSite(samesite) },\n ...secure && { secure: true },\n ...priority && { priority: parsePriority(priority) },\n ...partitioned && { partitioned: true }\n };\n return compact(cookie);\n}\nfunction compact(t) {\n const newT = {};\n for (const key in t) {\n if (t[key]) {\n newT[key] = t[key];\n }\n }\n return newT;\n}\nvar SAME_SITE = [\"strict\", \"lax\", \"none\"];\nfunction parseSameSite(string) {\n string = string.toLowerCase();\n return SAME_SITE.includes(string) ? string : void 0;\n}\nvar PRIORITY = [\"low\", \"medium\", \"high\"];\nfunction parsePriority(string) {\n string = string.toLowerCase();\n return PRIORITY.includes(string) ? string : void 0;\n}\nfunction splitCookiesString(cookiesString) {\n if (!cookiesString)\n return [];\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n cookiesSeparatorFound = true;\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n\n// src/request-cookies.ts\nvar RequestCookies = class {\n constructor(requestHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n this._headers = requestHeaders;\n const header = requestHeaders.get(\"cookie\");\n if (header) {\n const parsed = parseCookie(header);\n for (const [name, value] of parsed) {\n this._parsed.set(name, { name, value });\n }\n }\n }\n [Symbol.iterator]() {\n return this._parsed[Symbol.iterator]();\n }\n /**\n * The amount of cookies received from the client\n */\n get size() {\n return this._parsed.size;\n }\n get(...args) {\n const name = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(name);\n }\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed);\n if (!args.length) {\n return all.map(([_, value]) => value);\n }\n const name = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter(([n]) => n === name).map(([_, value]) => value);\n }\n has(name) {\n return this._parsed.has(name);\n }\n set(...args) {\n const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;\n const map = this._parsed;\n map.set(name, { name, value });\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join(\"; \")\n );\n return this;\n }\n /**\n * Delete the cookies matching the passed name or names in the request.\n */\n delete(names) {\n const map = this._parsed;\n const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value]) => stringifyCookie(value)).join(\"; \")\n );\n return result;\n }\n /**\n * Delete all the cookies in the cookies in the request.\n */\n clear() {\n this.delete(Array.from(this._parsed.keys()));\n return this;\n }\n /**\n * Format the cookies in the request as a string for logging\n */\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join(\"; \");\n }\n};\n\n// src/response-cookies.ts\nvar ResponseCookies = class {\n constructor(responseHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n var _a, _b, _c;\n this._headers = responseHeaders;\n const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get(\"set-cookie\")) != null ? _c : [];\n const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);\n for (const cookieString of cookieStrings) {\n const parsed = parseSetCookie(cookieString);\n if (parsed)\n this._parsed.set(parsed.name, parsed);\n }\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.\n */\n get(...args) {\n const key = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(key);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.\n */\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed.values());\n if (!args.length) {\n return all;\n }\n const key = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter((c) => c.name === key);\n }\n has(name) {\n return this._parsed.has(name);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.\n */\n set(...args) {\n const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;\n const map = this._parsed;\n map.set(name, normalizeCookie({ name, value, ...cookie }));\n replace(map, this._headers);\n return this;\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.\n */\n delete(...args) {\n const [name, options] = typeof args[0] === \"string\" ? [args[0]] : [args[0].name, args[0]];\n return this.set({ ...options, name, value: \"\", expires: /* @__PURE__ */ new Date(0) });\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map(stringifyCookie).join(\"; \");\n }\n};\nfunction replace(bag, headers) {\n headers.delete(\"set-cookie\");\n for (const [, value] of bag) {\n const serialized = stringifyCookie(value);\n headers.append(\"set-cookie\", serialized);\n }\n}\nfunction normalizeCookie(cookie = { name: \"\", value: \"\" }) {\n if (typeof cookie.expires === \"number\") {\n cookie.expires = new Date(cookie.expires);\n }\n if (cookie.maxAge) {\n cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);\n }\n if (cookie.path === null || cookie.path === void 0) {\n cookie.path = \"/\";\n }\n return cookie;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n RequestCookies,\n ResponseCookies,\n parseCookie,\n parseSetCookie,\n stringifyCookie\n});\n","module.exports = require(\"node:async_hooks\");","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCookie = parseCookie;\nexports.parse = parseCookie;\nexports.stringifyCookie = stringifyCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\nexports.parseSetCookie = parseSetCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\n/**\n * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n * which has been replaced by the token definition in RFC 7230 appendix B.\n *\n * cookie-name = token\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n *\n * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191\n * Allow same range as cookie value, except `=`, which delimits end of name.\n */\nconst cookieNameRegExp = /^[\\u0021-\\u003A\\u003C\\u003E-\\u007E]+$/;\n/**\n * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n *\n * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n * ; US-ASCII characters excluding CTLs,\n * ; whitespace DQUOTE, comma, semicolon,\n * ; and backslash\n *\n * Allowing more characters: https://github.com/jshttp/cookie/issues/191\n * Comma, backslash, and DQUOTE are not part of the parsing algorithm.\n */\nconst cookieValueRegExp = /^[\\u0021-\\u003A\\u003C-\\u007E]*$/;\n/**\n * RegExp to match domain-value in RFC 6265 sec 4.1.1\n *\n * domain-value = <subdomain>\n * ; defined in [RFC1034], Section 3.5, as\n * ; enhanced by [RFC1123], Section 2.1\n * <subdomain> = <label> | <subdomain> \".\" <label>\n * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n * Labels must be 63 characters or less.\n * 'let-dig' not 'letter' in the first char, per RFC1123\n * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n * <let-dig-hyp> = <let-dig> | \"-\"\n * <let-dig> = <letter> | <digit>\n * <letter> = any one of the 52 alphabetic characters A through Z in\n * upper case and a through z in lower case\n * <digit> = any one of the ten digits 0 through 9\n *\n * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n *\n * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n * character is not permitted, but a trailing %x2E (\".\"), if present, will\n * cause the user agent to ignore the attribute.)\n */\nconst domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n/**\n * RegExp to match path-value in RFC 6265 sec 4.1.1\n *\n * path-value = <any CHAR except CTLs or \";\">\n * CHAR = %x01-7F\n * ; defined in RFC 5234 appendix B.1\n */\nconst pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n/**\n * RegExp to match max-age-value in RFC 6265 sec 5.6.2\n */\nconst maxAgeRegExp = /^-?\\d+$/;\nconst __toString = Object.prototype.toString;\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () { };\n C.prototype = Object.create(null);\n return C;\n})();\n/**\n * Parse a `Cookie` header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n */\nfunction parseCookie(str, options) {\n const obj = new NullObject();\n const len = str.length;\n // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n if (len < 2)\n return obj;\n const dec = options?.decode || decode;\n let index = 0;\n do {\n const eqIdx = eqIndex(str, index, len);\n if (eqIdx === -1)\n break; // No more cookie pairs.\n const endIdx = endIndex(str, index, len);\n if (eqIdx > endIdx) {\n // backtrack on prior semicolon\n index = str.lastIndexOf(\";\", eqIdx - 1) + 1;\n continue;\n }\n const key = valueSlice(str, index, eqIdx);\n // only assign once\n if (obj[key] === undefined) {\n obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));\n }\n index = endIdx + 1;\n } while (index < len);\n return obj;\n}\n/**\n * Stringifies an object into an HTTP `Cookie` header.\n */\nfunction stringifyCookie(cookie, options) {\n const enc = options?.encode || encodeURIComponent;\n const cookieStrings = [];\n for (const name of Object.keys(cookie)) {\n const val = cookie[name];\n if (val === undefined)\n continue;\n if (!cookieNameRegExp.test(name)) {\n throw new TypeError(`cookie name is invalid: ${name}`);\n }\n const value = enc(val);\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`cookie val is invalid: ${val}`);\n }\n cookieStrings.push(`${name}=${value}`);\n }\n return cookieStrings.join(\"; \");\n}\nfunction stringifySetCookie(_name, _val, _opts) {\n const cookie = typeof _name === \"object\"\n ? _name\n : { ..._opts, name: _name, value: String(_val) };\n const options = typeof _val === \"object\" ? _val : _opts;\n const enc = options?.encode || encodeURIComponent;\n if (!cookieNameRegExp.test(cookie.name)) {\n throw new TypeError(`argument name is invalid: ${cookie.name}`);\n }\n const value = cookie.value ? enc(cookie.value) : \"\";\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`argument val is invalid: ${cookie.value}`);\n }\n let str = cookie.name + \"=\" + value;\n if (cookie.maxAge !== undefined) {\n if (!Number.isInteger(cookie.maxAge)) {\n throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);\n }\n str += \"; Max-Age=\" + cookie.maxAge;\n }\n if (cookie.domain) {\n if (!domainValueRegExp.test(cookie.domain)) {\n throw new TypeError(`option domain is invalid: ${cookie.domain}`);\n }\n str += \"; Domain=\" + cookie.domain;\n }\n if (cookie.path) {\n if (!pathValueRegExp.test(cookie.path)) {\n throw new TypeError(`option path is invalid: ${cookie.path}`);\n }\n str += \"; Path=\" + cookie.path;\n }\n if (cookie.expires) {\n if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) {\n throw new TypeError(`option expires is invalid: ${cookie.expires}`);\n }\n str += \"; Expires=\" + cookie.expires.toUTCString();\n }\n if (cookie.httpOnly) {\n str += \"; HttpOnly\";\n }\n if (cookie.secure) {\n str += \"; Secure\";\n }\n if (cookie.partitioned) {\n str += \"; Partitioned\";\n }\n if (cookie.priority) {\n const priority = typeof cookie.priority === \"string\"\n ? cookie.priority.toLowerCase()\n : undefined;\n switch (priority) {\n case \"low\":\n str += \"; Priority=Low\";\n break;\n case \"medium\":\n str += \"; Priority=Medium\";\n break;\n case \"high\":\n str += \"; Priority=High\";\n break;\n default:\n throw new TypeError(`option priority is invalid: ${cookie.priority}`);\n }\n }\n if (cookie.sameSite) {\n const sameSite = typeof cookie.sameSite === \"string\"\n ? cookie.sameSite.toLowerCase()\n : cookie.sameSite;\n switch (sameSite) {\n case true:\n case \"strict\":\n str += \"; SameSite=Strict\";\n break;\n case \"lax\":\n str += \"; SameSite=Lax\";\n break;\n case \"none\":\n str += \"; SameSite=None\";\n break;\n default:\n throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);\n }\n }\n return str;\n}\n/**\n * Deserialize a `Set-Cookie` header into an object.\n *\n * deserialize('foo=bar; httpOnly')\n * => { name: 'foo', value: 'bar', httpOnly: true }\n */\nfunction parseSetCookie(str, options) {\n const dec = options?.decode || decode;\n const len = str.length;\n const endIdx = endIndex(str, 0, len);\n const eqIdx = eqIndex(str, 0, endIdx);\n const setCookie = eqIdx === -1\n ? { name: \"\", value: dec(valueSlice(str, 0, endIdx)) }\n : {\n name: valueSlice(str, 0, eqIdx),\n value: dec(valueSlice(str, eqIdx + 1, endIdx)),\n };\n let index = endIdx + 1;\n while (index < len) {\n const endIdx = endIndex(str, index, len);\n const eqIdx = eqIndex(str, index, endIdx);\n const attr = eqIdx === -1\n ? valueSlice(str, index, endIdx)\n : valueSlice(str, index, eqIdx);\n const val = eqIdx === -1 ? undefined : valueSlice(str, eqIdx + 1, endIdx);\n switch (attr.toLowerCase()) {\n case \"httponly\":\n setCookie.httpOnly = true;\n break;\n case \"secure\":\n setCookie.secure = true;\n break;\n case \"partitioned\":\n setCookie.partitioned = true;\n break;\n case \"domain\":\n setCookie.domain = val;\n break;\n case \"path\":\n setCookie.path = val;\n break;\n case \"max-age\":\n if (val && maxAgeRegExp.test(val))\n setCookie.maxAge = Number(val);\n break;\n case \"expires\":\n if (!val)\n break;\n const date = new Date(val);\n if (Number.isFinite(date.valueOf()))\n setCookie.expires = date;\n break;\n case \"priority\":\n if (!val)\n break;\n const priority = val.toLowerCase();\n if (priority === \"low\" ||\n priority === \"medium\" ||\n priority === \"high\") {\n setCookie.priority = priority;\n }\n break;\n case \"samesite\":\n if (!val)\n break;\n const sameSite = val.toLowerCase();\n if (sameSite === \"lax\" ||\n sameSite === \"strict\" ||\n sameSite === \"none\") {\n setCookie.sameSite = sameSite;\n }\n break;\n }\n index = endIdx + 1;\n }\n return setCookie;\n}\n/**\n * Find the `;` character between `min` and `len` in str.\n */\nfunction endIndex(str, min, len) {\n const index = str.indexOf(\";\", min);\n return index === -1 ? len : index;\n}\n/**\n * Find the `=` character between `min` and `max` in str.\n */\nfunction eqIndex(str, min, max) {\n const index = str.indexOf(\"=\", min);\n return index < max ? index : -1;\n}\n/**\n * Slice out a value between startPod to max.\n */\nfunction valueSlice(str, min, max) {\n let start = min;\n let end = max;\n do {\n const code = str.charCodeAt(start);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n } while (++start < end);\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n end--;\n }\n return str.slice(start, end);\n}\n/**\n * URL-decode string value. Optimized to skip native call when no %.\n */\nfunction decode(str) {\n if (str.indexOf(\"%\") === -1)\n return str;\n try {\n return decodeURIComponent(str);\n }\n catch (e) {\n return str;\n }\n}\n/**\n * Determine if value is a Date.\n */\nfunction isDate(val) {\n return __toString.call(val) === \"[object Date]\";\n}\n//# sourceMappingURL=index.js.map","(()=>{\"use strict\";if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var e={};(()=>{var r=e;\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */r.parse=parse;r.serialize=serialize;var i=decodeURIComponent;var t=encodeURIComponent;var a=/; */;var n=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function parse(e,r){if(typeof e!==\"string\"){throw new TypeError(\"argument str must be a string\")}var t={};var n=r||{};var o=e.split(a);var s=n.decode||i;for(var p=0;p<o.length;p++){var f=o[p];var u=f.indexOf(\"=\");if(u<0){continue}var v=f.substr(0,u).trim();var c=f.substr(++u,f.length).trim();if('\"'==c[0]){c=c.slice(1,-1)}if(undefined==t[v]){t[v]=tryDecode(c,s)}}return t}function serialize(e,r,i){var a=i||{};var o=a.encode||t;if(typeof o!==\"function\"){throw new TypeError(\"option encode is invalid\")}if(!n.test(e)){throw new TypeError(\"argument name is invalid\")}var s=o(r);if(s&&!n.test(s)){throw new TypeError(\"argument val is invalid\")}var p=e+\"=\"+s;if(null!=a.maxAge){var f=a.maxAge-0;if(isNaN(f)||!isFinite(f)){throw new TypeError(\"option maxAge is invalid\")}p+=\"; Max-Age=\"+Math.floor(f)}if(a.domain){if(!n.test(a.domain)){throw new TypeError(\"option domain is invalid\")}p+=\"; Domain=\"+a.domain}if(a.path){if(!n.test(a.path)){throw new TypeError(\"option path is invalid\")}p+=\"; Path=\"+a.path}if(a.expires){if(typeof a.expires.toUTCString!==\"function\"){throw new TypeError(\"option expires is invalid\")}p+=\"; Expires=\"+a.expires.toUTCString()}if(a.httpOnly){p+=\"; HttpOnly\"}if(a.secure){p+=\"; Secure\"}if(a.sameSite){var u=typeof a.sameSite===\"string\"?a.sameSite.toLowerCase():a.sameSite;switch(u){case true:p+=\"; SameSite=Strict\";break;case\"lax\":p+=\"; SameSite=Lax\";break;case\"strict\":p+=\"; SameSite=Strict\";break;case\"none\":p+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return p}function tryDecode(e,r){try{return r(e)}catch(r){return e}}})();module.exports=e})();","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../version';\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(ownVersion) {\n const acceptedVersions = new Set([ownVersion]);\n const rejectedVersions = new Set();\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport const isCompatible = _makeCompatibilityCheck(VERSION);\n//# sourceMappingURL=semver.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);\nconst _global = (typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : {});\nexport function registerGlobal(type, instance, diag, allowOverride = false) {\n var _a;\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);\n return true;\n}\nexport function getGlobal(type) {\n var _a, _b;\n const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexport function unregisterGlobal(type, diag) {\n diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\n//# sourceMappingURL=global-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal } from '../internal/global-utils';\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nexport class DiagComponentLogger {\n constructor(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n debug(...args) {\n return logProxy('debug', this._namespace, args);\n }\n error(...args) {\n return logProxy('error', this._namespace, args);\n }\n info(...args) {\n return logProxy('info', this._namespace, args);\n }\n warn(...args) {\n return logProxy('warn', this._namespace, args);\n }\n verbose(...args) {\n return logProxy('verbose', this._namespace, args);\n }\n}\nfunction logProxy(funcName, namespace, args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n return logger[funcName](namespace, ...args);\n}\n//# sourceMappingURL=ComponentLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport var DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel || (DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagLogLevel } from '../types';\nexport function createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n }\n else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n const theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n//# sourceMappingURL=logLevelLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nconst API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n *\n * @since 1.0.0\n */\nexport class DiagAPI {\n /** Get the singleton instance of the DiagAPI API */\n static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }\n /**\n * Private internal constructor\n * @private\n */\n constructor() {\n function _logProxy(funcName) {\n return function (...args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName](...args);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n // DiagAPI specific functions\n const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {\n var _a, _b, _c;\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n const oldLogger = getGlobal('diag');\n const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = () => {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = (options) => {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n}\n//# sourceMappingURL=diag.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class BaggageImpl {\n constructor(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n getEntry(key) {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n }\n getAllEntries() {\n return Array.from(this._entries.entries());\n }\n setEntry(key, entry) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n removeEntry(key) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n removeEntries(...keys) {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n clear() {\n return new BaggageImpl();\n }\n}\n//# sourceMappingURL=baggage-impl.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nconst diag = DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(entries = {}) {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);\n str = '';\n }\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nclass BaseContext {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext) {\n // for minification\n const self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = (key) => self._currentContext.get(key);\n self.setValue = (key, value) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = (key) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n}\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nconst consoleMap = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n// Save original console methods at module load time, before any instrumentation\n// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals.\n// Exported for testing only — not part of the public API.\nexport const _originalConsoleMethods = {};\nif (typeof console !== 'undefined') {\n const keys = [\n 'error',\n 'warn',\n 'info',\n 'debug',\n 'trace',\n 'log',\n ];\n for (const key of keys) {\n // eslint-disable-next-line no-console\n if (typeof console[key] === 'function') {\n // eslint-disable-next-line no-console\n _originalConsoleMethods[key] = console[key];\n }\n }\n}\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n *\n * @since 1.0.0\n */\nexport class DiagConsoleLogger {\n constructor() {\n function _consoleFunc(funcName) {\n return function (...args) {\n // Prefer original (pre-instrumentation) methods saved at module load time.\n let theFunc = _originalConsoleMethods[funcName];\n // Some environments only expose the console when the F12 developer console is open\n if (typeof theFunc !== 'function') {\n theFunc = _originalConsoleMethods['log'];\n }\n // Fall back in case console was not available at module load time but became available later.\n if (typeof theFunc !== 'function' && console) {\n // eslint-disable-next-line no-console\n theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n }\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n };\n }\n for (let i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n}\n//# sourceMappingURL=consoleLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nexport class NoopMeter {\n constructor() { }\n /**\n * @see {@link Meter.createGauge}\n */\n createGauge(_name, _options) {\n return NOOP_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name, _options) {\n return NOOP_HISTOGRAM_METRIC;\n }\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name, _options) {\n return NOOP_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name, _options) {\n return NOOP_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(_name, _options) {\n return NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(_name, _options) {\n return NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(_name, _options) {\n return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(_callback, _observables) { }\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback) { }\n}\nexport class NoopMetric {\n}\nexport class NoopCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexport class NoopUpDownCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexport class NoopGaugeMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexport class NoopHistogramMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexport class NoopObservableMetric {\n addCallback(_callback) { }\n removeCallback(_callback) { }\n}\nexport class NoopObservableCounterMetric extends NoopObservableMetric {\n}\nexport class NoopObservableGaugeMetric extends NoopObservableMetric {\n}\nexport class NoopObservableUpDownCounterMetric extends NoopObservableMetric {\n}\nexport const NOOP_METER = new NoopMeter();\n// Synchronous instruments\nexport const NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport const NOOP_GAUGE_METRIC = new NoopGaugeMetric();\nexport const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n// Asynchronous instruments\nexport const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n/**\n * Create a no-op Meter\n *\n * @since 1.3.0\n */\nexport function createNoopMeter() {\n return NOOP_METER;\n}\n//# sourceMappingURL=NoopMeter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * The Type of value. It describes how the data is reported.\n *\n * @since 1.3.0\n */\nexport var ValueType;\n(function (ValueType) {\n ValueType[ValueType[\"INT\"] = 0] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n})(ValueType || (ValueType = {}));\n//# sourceMappingURL=Metric.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapGetter = {\n get(carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys(carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapSetter = {\n set(carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from './context';\nexport class NoopContextManager {\n active() {\n return ROOT_CONTEXT;\n }\n with(_context, fn, thisArg, ...args) {\n return fn.call(thisArg, ...args);\n }\n bind(_context, target) {\n return target;\n }\n enable() {\n return this;\n }\n disable() {\n return this;\n }\n}\n//# sourceMappingURL=NoopContextManager.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n *\n * @since 1.0.0\n */\nexport class ContextAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Context API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n }\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n setGlobalContextManager(contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n }\n /**\n * Get the currently active context\n */\n active() {\n return this._getContextManager().active();\n }\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n bind(context, target) {\n return this._getContextManager().bind(context, target);\n }\n _getContextManager() {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n /** Disable and remove the global context manager */\n disable() {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport var TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags || (TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { TraceFlags } from './trace_flags';\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPANID = '0000000000000000';\n/**\n * @since 1.0.0\n */\nexport const INVALID_TRACEID = '00000000000000000000000000000000';\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPAN_CONTEXT = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nexport class NonRecordingSpan {\n constructor(spanContext = INVALID_SPAN_CONTEXT) {\n this._spanContext = spanContext;\n }\n // Returns a SpanContext.\n spanContext() {\n return this._spanContext;\n }\n // By default does nothing\n setAttribute(_key, _value) {\n return this;\n }\n // By default does nothing\n setAttributes(_attributes) {\n return this;\n }\n // By default does nothing\n addEvent(_name, _attributes) {\n return this;\n }\n addLink(_link) {\n return this;\n }\n addLinks(_links) {\n return this;\n }\n // By default does nothing\n setStatus(_status) {\n return this;\n }\n // By default does nothing\n updateName(_name) {\n return this;\n }\n // By default does nothing\n end(_endTime) { }\n // isRecording always returns false for NonRecordingSpan.\n isRecording() {\n return false;\n }\n // By default does nothing\n recordException(_exception, _time) { }\n}\n//# sourceMappingURL=NonRecordingSpan.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createContextKey } from '../context/context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n/**\n * span key\n */\nconst SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan() {\n return getSpan(ContextAPI.getInstance().active());\n}\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\n//# sourceMappingURL=context-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\n// Valid characters (0-9, a-f, A-F) are marked as 1.\nconst isHex = new Uint8Array([\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n]);\nfunction isValidHex(id, length) {\n // As of 1.9.0 the id was allowed to be a non-string value,\n // even though it was not possible in the types.\n if (typeof id !== 'string' || id.length !== length)\n return false;\n let r = 0;\n for (let i = 0; i < id.length; i += 4) {\n r +=\n (isHex[id.charCodeAt(i)] | 0) +\n (isHex[id.charCodeAt(i + 1)] | 0) +\n (isHex[id.charCodeAt(i + 2)] | 0) +\n (isHex[id.charCodeAt(i + 3)] | 0);\n }\n return r === length;\n}\n/**\n * @since 1.0.0\n */\nexport function isValidTraceId(traceId) {\n return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;\n}\n/**\n * @since 1.0.0\n */\nexport function isValidSpanId(spanId) {\n return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;\n}\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n *\n * @since 1.0.0\n */\nexport function isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext) {\n return new NonRecordingSpan(spanContext);\n}\n//# sourceMappingURL=spancontext-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ContextAPI } from '../api/context';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\nconst contextApi = ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nexport class NoopTracer {\n // startSpan starts a noop span.\n startSpan(name, options, context = contextApi.active()) {\n const root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan();\n }\n const parentFromContext = context && getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan();\n }\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = setSpan(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n }\n}\nfunction isSpanContext(spanContext) {\n return (spanContext !== null &&\n typeof spanContext === 'object' &&\n 'spanId' in spanContext &&\n typeof spanContext['spanId'] === 'string' &&\n 'traceId' in spanContext &&\n typeof spanContext['traceId'] === 'string' &&\n 'traceFlags' in spanContext &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopTracer } from './NoopTracer';\nconst NOOP_TRACER = new NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n *\n * @since 1.0.0\n */\nexport class ProxyTracer {\n constructor(provider, name, version, options) {\n this._provider = provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n startSpan(name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n }\n startActiveSpan(_name, _options, _context, _fn) {\n const tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n }\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n _getTracer() {\n if (this._delegate) {\n return this._delegate;\n }\n const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n }\n}\n//# sourceMappingURL=ProxyTracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopTracer } from './NoopTracer';\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nexport class NoopTracerProvider {\n getTracer(_name, _version, _options) {\n return new NoopTracer();\n }\n}\n//# sourceMappingURL=NoopTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n *\n * @deprecated This will be removed in the next major version.\n * @since 1.0.0\n */\nexport class ProxyTracerProvider {\n /**\n * Get a {@link ProxyTracer}\n */\n getTracer(name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));\n }\n getDelegate() {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n }\n /**\n * Set the delegate tracer provider\n */\n setDelegate(delegate) {\n this._delegate = delegate;\n }\n getDelegateTracer(name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n }\n}\n//# sourceMappingURL=ProxyTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n *\n * @since 1.0.0\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport var SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind || (SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * An enumeration of status codes.\n *\n * @since 1.0.0\n */\nexport var SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode || (SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nexport function validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nexport function validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\n//# sourceMappingURL=tracestate-validators.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { validateKey, validateValue } from './tracestate-validators';\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nexport class TraceStateImpl {\n constructor(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n set(key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n const traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n }\n unset(key) {\n const traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n }\n get(key) {\n return this._internalState.get(key);\n }\n serialize() {\n return (Array.from(this._internalState.keys())\n // Use reduceRight() because keys are stored in reverse insertion order.\n .reduceRight((agg, key) => {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR));\n }\n _parse(rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n // Use reduceRight() so new keys (.set(...)) will be placed at the beginning\n .reduceRight((agg, part) => {\n const listMember = part.trim(); // Optional Whitespace (OWS) handling\n const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n const key = listMember.slice(0, i);\n const value = listMember.slice(i + 1, part.length);\n if (validateKey(key) && validateValue(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n }\n // @ts-expect-error TS6133 Accessed in tests only.\n _keys() {\n return Array.from(this._internalState.keys()).reverse();\n }\n _clone() {\n const traceState = new TraceStateImpl();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n }\n}\n//# sourceMappingURL=tracestate-impl.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { TraceStateImpl } from './tracestate-impl';\n/**\n * @since 1.1.0\n */\nexport function createTraceState(rawTraceState) {\n return new TraceStateImpl(rawTraceState);\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/**\n * Entrypoint for context API\n * @since 1.0.0\n */\nexport const context = ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n *\n * @since 1.0.0\n */\nexport const diag = DiagAPI.instance();\n//# sourceMappingURL=diag-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NOOP_METER } from './NoopMeter';\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nexport class NoopMeterProvider {\n getMeter(_name, _version, _options) {\n return NOOP_METER;\n }\n}\nexport const NOOP_METER_PROVIDER = new NoopMeterProvider();\n//# sourceMappingURL=NoopMeterProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'metrics';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nexport class MetricsAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Metrics API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n setGlobalMeterProvider(provider) {\n return registerGlobal(API_NAME, provider, DiagAPI.instance());\n }\n /**\n * Returns the global meter provider.\n */\n getMeterProvider() {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n }\n /**\n * Returns a meter from the global meter provider.\n */\n getMeter(name, version, options) {\n return this.getMeterProvider().getMeter(name, version, options);\n }\n /** Remove the global meter provider */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n//# sourceMappingURL=metrics.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { MetricsAPI } from './api/metrics';\n/**\n * Entrypoint for metrics API\n *\n * @since 1.3.0\n */\nexport const metrics = MetricsAPI.getInstance();\n//# sourceMappingURL=metrics-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nexport class NoopTextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context, _carrier) { }\n /** Noop extract function does nothing and returns the input context */\n extract(context, _carrier) {\n return context;\n }\n fields() {\n return [];\n }\n}\n//# sourceMappingURL=NoopTextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage() {\n return getBaggage(ContextAPI.getInstance().active());\n}\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\n//# sourceMappingURL=context-helpers.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n *\n * @since 1.0.0\n */\nexport class PropagationAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.getActiveBaggage = getActiveBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n }\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n setGlobalPropagator(propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n }\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n inject(context, carrier, setter = defaultTextMapSetter) {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n extract(context, carrier, getter = defaultTextMapGetter) {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n fields() {\n return this._getGlobalPropagator().fields();\n }\n /** Remove the global propagator */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n _getGlobalPropagator() {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\n//# sourceMappingURL=propagation.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/**\n * Entrypoint for propagation API\n *\n * @since 1.0.0\n */\nexport const propagation = PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';\nimport { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n *\n * @since 1.0.0\n */\nexport class TraceAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this._proxyTracerProvider = new ProxyTracerProvider();\n this.wrapSpanContext = wrapSpanContext;\n this.isSpanContextValid = isSpanContextValid;\n this.deleteSpan = deleteSpan;\n this.getSpan = getSpan;\n this.getActiveSpan = getActiveSpan;\n this.getSpanContext = getSpanContext;\n this.setSpan = setSpan;\n this.setSpanContext = setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n setGlobalTracerProvider(provider) {\n const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n /**\n * Returns the global tracer provider.\n */\n getTracerProvider() {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n /**\n * Returns a tracer from the global tracer provider.\n */\n getTracer(name, version) {\n return this.getTracerProvider().getTracer(name, version);\n }\n /** Remove the global tracer provider */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n}\n//# sourceMappingURL=trace.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n/**\n * Entrypoint for trace API\n *\n * @since 1.0.0\n */\nexport const trace = TraceAPI.getInstance();\n//# sourceMappingURL=trace-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport { baggageEntryMetadataFromString } from './baggage/utils';\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport { DiagLogLevel } from './diag/types';\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport { ValueType } from './metrics/Metric';\n// Propagation APIs\nexport { defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';\nexport { ProxyTracer } from './trace/ProxyTracer';\n// TODO: Remove ProxyTracerProvider export in the next major version.\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport { SamplingDecision } from './trace/SamplingResult';\nexport { SpanKind } from './trace/span_kind';\nexport { SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport { createTraceState } from './trace/internal/utils';\nexport { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';\nexport { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { context } from './context-api';\nimport { diag } from './diag-api';\nimport { metrics } from './metrics-api';\nimport { propagation } from './propagation-api';\nimport { trace } from './trace-api';\n// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context,\n diag,\n metrics,\n propagation,\n trace,\n};\n//# sourceMappingURL=index.js.map"],"names":["removeTrailingSlash","route","replace","parsePath","path","hashIndex","indexOf","queryIndex","hasQuery","pathname","substring","query","undefined","hash","slice","addPathPrefix","prefix","startsWith","addPathSuffix","suffix","pathHasPrefix","cache","WeakMap","normalizeLocalePath","locales","detectedLocale","lowercasedLocales","get","map","locale","toLowerCase","set","segments","split","segment","index","length","getNextPathnameInfo","options","result","basePath","i18n","trailingSlash","nextConfig","info","endsWith","removePathPrefix","withoutPrefix","pathnameNoDataPrefix","paths","buildId","join","parseData","i18nProvider","analyze","parsed","headers","hostname","host","Array","isArray","toString","detectDomainLocale","domainItems","item","domainHostname","domain","defaultLocale","some","addLocale","ignorePrefix","lower","parseRelativeURL","url","base","baseURL","URL","relative","isRelative","origin","NEXT_ROUTER_PREFETCH_HEADER","FLIGHT_HEADERS","isThenable","promise","then","InvariantError","Error","constructor","message","name","LRUCache","entry","size","process","env","NEXT_PRIVATE_DEBUG_CACHE","console","debug","bind","reduce","isGroupSegment","React","unstable_postpone","isDynamicPostponeReason","reason","includes","createPostponeReason","expression","bodyAndImplicitTags","ROOT_LAYOUT_BOUNDARY_NAME","METADATA_BOUNDARY_NAME","VIEWPORT_BOUNDARY_NAME","OUTLET_BOUNDARY_NAME","present","value","middleware","request","response","NextResponse","next","supabaseServerUrl","SUPABASE_SERVER_URL","key","supabaseAnonKey","supabase","createServerClient","cookies","getAll","setAll","cookiesToSet","cookie","auth","getUser","config","matcher","Object","Set","values","HTTPAccessErrorStatus","NOT_FOUND","FORBIDDEN","UNAUTHORIZED"],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9,22,23,24,25,26,29,33,34,35,36,37,38,40,41,42,43,44,46,47,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,122,123,129,130,131,132,134,135,143,144,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193]}
|