@riverbankcms/sdk 0.121.0 → 0.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/{PreviewEditorSidebar-lZ600tJx.mjs → PreviewEditorSidebar-DvJFmC29.mjs} +6 -6
  2. package/dist/{PreviewEditorUI-CTBWzLSb.mjs → PreviewEditorUI-DVHP4bCo.mjs} +3 -3
  3. package/dist/{PreviewQueryProvider-BHT8CJvZ.mjs → PreviewQueryProvider-07EE4uWL.mjs} +1 -1
  4. package/dist/{SdkPreviewModeRuntime-DhPU58s7.mjs → SdkPreviewModeRuntime-BE5eFayo.mjs} +5 -5
  5. package/dist/{SiteChromeCustomizeContext-BkNvpzNZ.mjs → SiteChromeCustomizeContext-4hn4A0HX.mjs} +3 -3
  6. package/dist/_dts/api/src/bookingConfig.d.ts +32 -6
  7. package/dist/_dts/api/src/endpoints.d.ts +1 -1
  8. package/dist/_dts/api/src/index.d.ts +2 -2
  9. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +3 -3
  10. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +23 -11
  11. package/dist/_dts/sdk/src/version.d.ts +1 -1
  12. package/dist/cli/index.mjs +142 -2511
  13. package/dist/client/client.mjs +2 -1
  14. package/dist/preview-next/before-render.mjs +1 -0
  15. package/dist/preview-next/client/runtime.mjs +4 -4
  16. package/dist/preview-next/middleware.mjs +1 -0
  17. package/dist/{previewAuthStore-31xH13Jc.mjs → previewAuthStore-ShY26RNz.mjs} +1 -0
  18. package/dist/{sdk-runtime-BE_vcGua.mjs → sdk-runtime-CJxkFq2B.mjs} +2 -2
  19. package/dist/{separator-CiffYtk3.mjs → separator-CoFmo8uA.mjs} +1 -1
  20. package/dist/server/components.mjs +32 -2401
  21. package/dist/server/index.mjs +2 -1
  22. package/dist/server/next.mjs +34 -2401
  23. package/dist/server/prebuild.mjs +1 -1
  24. package/dist/server/rendering/server.mjs +32 -2404
  25. package/dist/server/rendering.mjs +32 -2401
  26. package/dist/server/server.mjs +2 -1
  27. package/package.json +1 -1
@@ -1,12 +1,7 @@
1
- import { createRequire } from "node:module";
2
1
  import * as React$1 from "react";
3
2
  import React, { forwardRef } from "react";
4
3
  import z, { z as z$1 } from "zod";
5
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- //#region \0rolldown/runtime.js
7
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
- var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
9
- //#endregion
10
5
  //#region ../blocks/src/system/manifest/augmentManifest.ts
11
6
  /**
12
7
  * Augments a block manifest with synthetic fields and other transformations.
@@ -44544,2396 +44539,6 @@ function resolveButtonAffordance(input) {
44544
44539
  return null;
44545
44540
  }
44546
44541
  //#endregion
44547
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/shared.js
44548
- var require_shared = /* @__PURE__ */ __commonJSMin(((exports) => {
44549
- Object.defineProperty(exports, "__esModule", { value: true });
44550
- exports.throttle = exports.EndpointType = exports.isNoPrettyPrint = void 0;
44551
- exports.requestToJSON = requestToJSON;
44552
- exports.isNoPrettyPrint = process.env.AXIOM_NO_PRETTY_PRINT == "true" ? true : false;
44553
- var EndpointType;
44554
- (function(EndpointType) {
44555
- EndpointType["webVitals"] = "web-vitals";
44556
- EndpointType["logs"] = "logs";
44557
- })(EndpointType || (exports.EndpointType = EndpointType = {}));
44558
- /**
44559
- * Transforms a NextRequest or Request object into a JSON-serializable object
44560
- */
44561
- async function requestToJSON(request) {
44562
- const headers = {};
44563
- request.headers.forEach((value, key) => {
44564
- headers[key] = value;
44565
- });
44566
- let cookiesData = {};
44567
- if ("cookies" in request) request.cookies.getAll().forEach((cookie) => {
44568
- cookiesData[cookie.name] = cookie.value;
44569
- });
44570
- else {
44571
- const cookieHeader = headers["cookie"];
44572
- if (cookieHeader) cookiesData = Object.fromEntries(cookieHeader.split(";").map((cookie) => {
44573
- const [key, value] = cookie.trim().split("=");
44574
- return [key, value];
44575
- }));
44576
- }
44577
- let nextUrlData;
44578
- if ("nextUrl" in request) {
44579
- const nextUrl = request.nextUrl;
44580
- nextUrlData = {
44581
- basePath: nextUrl.basePath,
44582
- buildId: nextUrl.buildId,
44583
- hash: nextUrl.hash,
44584
- host: nextUrl.host,
44585
- hostname: nextUrl.hostname,
44586
- href: nextUrl.href,
44587
- origin: nextUrl.origin,
44588
- password: nextUrl.password,
44589
- pathname: nextUrl.pathname,
44590
- port: nextUrl.port,
44591
- protocol: nextUrl.protocol,
44592
- search: nextUrl.search,
44593
- searchParams: Object.fromEntries(nextUrl.searchParams.entries()),
44594
- username: nextUrl.username
44595
- };
44596
- }
44597
- let body;
44598
- if (request.body) try {
44599
- const clonedRequest = request.clone();
44600
- try {
44601
- body = await clonedRequest.json();
44602
- clonedRequest.body?.getReader;
44603
- } catch {
44604
- body = await clonedRequest.text();
44605
- }
44606
- } catch (error) {
44607
- console.warn("Could not parse request body:", error);
44608
- }
44609
- const cache = {
44610
- mode: request.cache,
44611
- credentials: request.credentials,
44612
- redirect: request.redirect,
44613
- referrerPolicy: request.referrerPolicy,
44614
- integrity: request.integrity
44615
- };
44616
- let ip;
44617
- if ("ip" in request) ip = request.ip;
44618
- let geo;
44619
- if ("geo" in request) geo = request.geo;
44620
- return {
44621
- method: request.method,
44622
- url: request.url,
44623
- headers,
44624
- cookies: cookiesData,
44625
- nextUrl: nextUrlData,
44626
- ip,
44627
- geo,
44628
- body,
44629
- cache,
44630
- mode: request.mode,
44631
- destination: request.destination,
44632
- referrer: request.referrer,
44633
- keepalive: request.keepalive,
44634
- signal: {
44635
- aborted: request.signal.aborted,
44636
- reason: request.signal.reason
44637
- }
44638
- };
44639
- }
44640
- const throttle = (fn, wait) => {
44641
- let lastFn, lastTime;
44642
- return function() {
44643
- const context = this, args = arguments;
44644
- if (lastTime == null) lastTime = Date.now();
44645
- clearTimeout(lastFn);
44646
- lastFn = setTimeout(() => {
44647
- if (Date.now() - lastTime >= wait) {
44648
- fn.apply(context, args);
44649
- lastTime = Date.now();
44650
- }
44651
- }, Math.max(wait - (Date.now() - lastTime), 0));
44652
- };
44653
- };
44654
- exports.throttle = throttle;
44655
- }));
44656
- //#endregion
44657
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/generic.js
44658
- var require_generic = /* @__PURE__ */ __commonJSMin(((exports) => {
44659
- Object.defineProperty(exports, "__esModule", { value: true });
44660
- const shared_1 = require_shared();
44661
- const config_1 = require_config();
44662
- var GenericConfig = class {
44663
- constructor() {
44664
- this.proxyPath = "/_axiom";
44665
- this.shouldSendEdgeReport = false;
44666
- this.token = process.env.NEXT_PUBLIC_AXIOM_TOKEN || process.env.AXIOM_TOKEN;
44667
- this.dataset = process.env.NEXT_PUBLIC_AXIOM_DATASET || process.env.AXIOM_DATASET;
44668
- this.environment = process.env.NODE_ENV;
44669
- this.axiomUrl = process.env.NEXT_PUBLIC_AXIOM_URL || process.env.AXIOM_URL || "https://api.axiom.co";
44670
- this.region = process.env.REGION || void 0;
44671
- this.customEndpoint = process.env.NEXT_PUBLIC_AXIOM_CUSTOM_ENDPOINT;
44672
- }
44673
- isEnvVarsSet() {
44674
- return !!(this.axiomUrl && this.dataset && this.token) || !!this.customEndpoint;
44675
- }
44676
- getIngestURL(_) {
44677
- return `${this.axiomUrl}/v1/datasets/${this.dataset}/ingest`;
44678
- }
44679
- getLogsEndpoint() {
44680
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
44681
- return config_1.isBrowser ? `${this.proxyPath}/logs` : this.getIngestURL(shared_1.EndpointType.logs);
44682
- }
44683
- getWebVitalsEndpoint() {
44684
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
44685
- return config_1.isBrowser ? `${this.proxyPath}/web-vitals` : this.getIngestURL(shared_1.EndpointType.webVitals);
44686
- }
44687
- wrapWebVitalsObject(metrics) {
44688
- return metrics.map((m) => ({
44689
- webVital: m,
44690
- _time: (/* @__PURE__ */ new Date()).getTime(),
44691
- platform: {
44692
- environment: this.environment,
44693
- source: "web-vital"
44694
- },
44695
- source: "web-vital"
44696
- }));
44697
- }
44698
- injectPlatformMetadata(logEvent, source) {
44699
- let key = "platform";
44700
- if (config_1.isVercel) key = "vercel";
44701
- logEvent.source = source;
44702
- logEvent[key] = {
44703
- environment: this.environment,
44704
- region: this.region,
44705
- source
44706
- };
44707
- if (config_1.isVercel) {
44708
- logEvent[key].region = process.env.VERCEL_REGION;
44709
- logEvent[key].deploymentId = process.env.VERCEL_DEPLOYMENT_ID;
44710
- logEvent[key].deploymentUrl = process.env.NEXT_PUBLIC_VERCEL_URL;
44711
- logEvent[key].project = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL;
44712
- logEvent.git = {
44713
- commit: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
44714
- repo: process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG,
44715
- ref: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF
44716
- };
44717
- }
44718
- }
44719
- getHeaderOrDefault(req, headerName, defaultValue) {
44720
- return req.headers[headerName] ? req.headers[headerName] : defaultValue;
44721
- }
44722
- };
44723
- exports.default = GenericConfig;
44724
- }));
44725
- //#endregion
44726
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/vercel.js
44727
- var require_vercel = /* @__PURE__ */ __commonJSMin(((exports) => {
44728
- var __importDefault = exports && exports.__importDefault || function(mod) {
44729
- return mod && mod.__esModule ? mod : { "default": mod };
44730
- };
44731
- Object.defineProperty(exports, "__esModule", { value: true });
44732
- const config_1 = require_config();
44733
- const shared_1 = require_shared();
44734
- const generic_1 = __importDefault(require_generic());
44735
- const ingestEndpoint = process.env.NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT || process.env.AXIOM_INGEST_ENDPOINT || "";
44736
- var VercelConfig = class extends generic_1.default {
44737
- constructor(..._args) {
44738
- super(..._args);
44739
- this.provider = "vercel";
44740
- this.shouldSendEdgeReport = true;
44741
- this.region = process.env.VERCEL_REGION || void 0;
44742
- this.environment = process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.VERCEL_ENV || process.env.NODE_ENV || "";
44743
- this.token = void 0;
44744
- this.axiomUrl = ingestEndpoint;
44745
- }
44746
- isEnvVarsSet() {
44747
- return ingestEndpoint != void 0 && ingestEndpoint != "" || !!this.customEndpoint;
44748
- }
44749
- getIngestURL(t) {
44750
- const url = new URL(this.axiomUrl);
44751
- url.searchParams.set("type", t.toString());
44752
- return url.toString();
44753
- }
44754
- getWebVitalsEndpoint() {
44755
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
44756
- return `${this.proxyPath}/web-vitals`;
44757
- }
44758
- getLogsEndpoint() {
44759
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
44760
- return config_1.isBrowser ? `${this.proxyPath}/logs` : this.getIngestURL(shared_1.EndpointType.logs);
44761
- }
44762
- wrapWebVitalsObject(metrics) {
44763
- return {
44764
- webVitals: metrics,
44765
- environment: this.environment
44766
- };
44767
- }
44768
- injectPlatformMetadata(logEvent, source) {
44769
- logEvent.vercel = {
44770
- environment: this.environment,
44771
- region: this.region,
44772
- source
44773
- };
44774
- }
44775
- };
44776
- exports.default = VercelConfig;
44777
- }));
44778
- //#endregion
44779
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/netlify.js
44780
- var require_netlify = /* @__PURE__ */ __commonJSMin(((exports) => {
44781
- var __importDefault = exports && exports.__importDefault || function(mod) {
44782
- return mod && mod.__esModule ? mod : { "default": mod };
44783
- };
44784
- Object.defineProperty(exports, "__esModule", { value: true });
44785
- const generic_1 = __importDefault(require_generic());
44786
- const netlifySiteId = process.env.SITE_ID;
44787
- const netlifyBuildId = process.env.BUILD_ID;
44788
- const netlifyContext = process.env.CONTEXT;
44789
- const netlifyDeploymentUrl = process.env.DEPLOYMENT_URL;
44790
- const netlifyDeploymentId = process.env.DEPLOYMENT_ID;
44791
- var NetlifyConfig = class extends generic_1.default {
44792
- wrapWebVitalsObject(metrics) {
44793
- return metrics.map((m) => ({
44794
- webVital: m,
44795
- _time: (/* @__PURE__ */ new Date()).getTime(),
44796
- netlify: {
44797
- environment: this.environment,
44798
- source: "web-vital",
44799
- siteId: netlifySiteId,
44800
- buildId: netlifyBuildId,
44801
- context: netlifyContext,
44802
- deploymentUrl: netlifyDeploymentUrl,
44803
- deploymentId: netlifyDeploymentId
44804
- }
44805
- }));
44806
- }
44807
- injectPlatformMetadata(logEvent, source) {
44808
- logEvent.netlify = {
44809
- environment: this.environment,
44810
- region: source === "edge" ? process.env.DENO_REGION : process.env.AWS_REGION,
44811
- source,
44812
- siteId: netlifySiteId,
44813
- buildId: netlifyBuildId,
44814
- context: netlifyContext,
44815
- deploymentUrl: netlifyDeploymentUrl,
44816
- deploymentId: source === "edge" ? process.env.DENO_DEPLOYMENT_ID : netlifyDeploymentId
44817
- };
44818
- }
44819
- };
44820
- exports.default = NetlifyConfig;
44821
- }));
44822
- //#endregion
44823
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/package.json
44824
- var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44825
- module.exports = {
44826
- "name": "next-axiom",
44827
- "description": "Send WebVitals from your Next.js project to Axiom.",
44828
- "version": "1.10.0",
44829
- "author": "Axiom, Inc.",
44830
- "license": "MIT",
44831
- "contributors": ["Arne Bahlo <arne@axiom.co>", "Islam Shehata <islam@axiom.co>"],
44832
- "engines": { "node": ">=18" },
44833
- "main": "dist/index.js",
44834
- "types": "dist/index.d.ts",
44835
- "repository": {
44836
- "type": "git",
44837
- "url": "git+https://github.com/axiomhq/next-axiom.git"
44838
- },
44839
- "keywords": [
44840
- "web-vitals",
44841
- "axiom",
44842
- "observability",
44843
- "performance",
44844
- "nextjs"
44845
- ],
44846
- "bugs": { "url": "https://github.com/axiomhq/next-axiom/issues" },
44847
- "homepage": "https://github.com/axiomhq/next-axiom#readme",
44848
- "peerDependencies": {
44849
- "next": ">=14.0",
44850
- "react": ">=18.0.0"
44851
- },
44852
- "devDependencies": {
44853
- "@types/node": "^20.19.26",
44854
- "@types/react": "^18.3.27",
44855
- "@vitest/coverage-v8": "^2.1.9",
44856
- "next": "^14.2.33",
44857
- "prettier": "^3.7.4",
44858
- "react-dom": "^19.2.1",
44859
- "ts-node": "^10.9.2",
44860
- "typescript": "^5.9.3",
44861
- "vitest": "^2.1.9"
44862
- },
44863
- "dependencies": {
44864
- "@vercel/functions": "^2.2.13",
44865
- "use-deep-compare": "^1.3.0",
44866
- "whatwg-fetch": "^3.6.20"
44867
- },
44868
- "scripts": {
44869
- "build": "tsc",
44870
- "format": "prettier --write src/*.ts tests/*.ts",
44871
- "check-format": "prettier -c src/*.ts tests/*.ts",
44872
- "test": "vitest run tests --coverage"
44873
- }
44874
- };
44875
- }));
44876
- //#endregion
44877
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/config.js
44878
- var require_config = /* @__PURE__ */ __commonJSMin(((exports) => {
44879
- var __importDefault = exports && exports.__importDefault || function(mod) {
44880
- return mod && mod.__esModule ? mod : { "default": mod };
44881
- };
44882
- Object.defineProperty(exports, "__esModule", { value: true });
44883
- exports.config = exports.isEdgeRuntime = exports.isBrowser = exports.isWebWorker = exports.isNetlify = exports.isVercel = exports.isVercelIntegration = exports.Version = void 0;
44884
- const generic_1 = __importDefault(require_generic());
44885
- const vercel_1 = __importDefault(require_vercel());
44886
- const netlify_1 = __importDefault(require_netlify());
44887
- exports.Version = require_package().version;
44888
- exports.isVercelIntegration = process.env.NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT || process.env.AXIOM_INGEST_ENDPOINT;
44889
- exports.isVercel = process.env.NEXT_PUBLIC_VERCEL || process.env.VERCEL;
44890
- exports.isNetlify = process.env.NETLIFY == "true";
44891
- exports.isWebWorker = typeof self !== "undefined" && typeof globalThis.WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
44892
- exports.isBrowser = typeof window !== "undefined" || exports.isWebWorker;
44893
- exports.isEdgeRuntime = globalThis.EdgeRuntime ? true : false;
44894
- let config = new generic_1.default();
44895
- exports.config = config;
44896
- if (exports.isVercelIntegration) exports.config = config = new vercel_1.default();
44897
- else if (exports.isNetlify) exports.config = config = new netlify_1.default();
44898
- }));
44899
- //#endregion
44900
- //#region ../../node_modules/.pnpm/whatwg-fetch@3.6.20/node_modules/whatwg-fetch/dist/fetch.umd.js
44901
- var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44902
- (function(global, factory) {
44903
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global.WHATWGFetch = {});
44904
- })(exports, (function(exports$2) {
44905
- "use strict";
44906
- var g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof global !== "undefined" && global || {};
44907
- var support = {
44908
- searchParams: "URLSearchParams" in g,
44909
- iterable: "Symbol" in g && "iterator" in Symbol,
44910
- blob: "FileReader" in g && "Blob" in g && (function() {
44911
- try {
44912
- new Blob();
44913
- return true;
44914
- } catch (e) {
44915
- return false;
44916
- }
44917
- })(),
44918
- formData: "FormData" in g,
44919
- arrayBuffer: "ArrayBuffer" in g
44920
- };
44921
- function isDataView(obj) {
44922
- return obj && DataView.prototype.isPrototypeOf(obj);
44923
- }
44924
- if (support.arrayBuffer) {
44925
- var viewClasses = [
44926
- "[object Int8Array]",
44927
- "[object Uint8Array]",
44928
- "[object Uint8ClampedArray]",
44929
- "[object Int16Array]",
44930
- "[object Uint16Array]",
44931
- "[object Int32Array]",
44932
- "[object Uint32Array]",
44933
- "[object Float32Array]",
44934
- "[object Float64Array]"
44935
- ];
44936
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
44937
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
44938
- };
44939
- }
44940
- function normalizeName(name) {
44941
- if (typeof name !== "string") name = String(name);
44942
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") throw new TypeError("Invalid character in header field name: \"" + name + "\"");
44943
- return name.toLowerCase();
44944
- }
44945
- function normalizeValue(value) {
44946
- if (typeof value !== "string") value = String(value);
44947
- return value;
44948
- }
44949
- function iteratorFor(items) {
44950
- var iterator = { next: function() {
44951
- var value = items.shift();
44952
- return {
44953
- done: value === void 0,
44954
- value
44955
- };
44956
- } };
44957
- if (support.iterable) iterator[Symbol.iterator] = function() {
44958
- return iterator;
44959
- };
44960
- return iterator;
44961
- }
44962
- function Headers(headers) {
44963
- this.map = {};
44964
- if (headers instanceof Headers) headers.forEach(function(value, name) {
44965
- this.append(name, value);
44966
- }, this);
44967
- else if (Array.isArray(headers)) headers.forEach(function(header) {
44968
- if (header.length != 2) throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + header.length);
44969
- this.append(header[0], header[1]);
44970
- }, this);
44971
- else if (headers) Object.getOwnPropertyNames(headers).forEach(function(name) {
44972
- this.append(name, headers[name]);
44973
- }, this);
44974
- }
44975
- Headers.prototype.append = function(name, value) {
44976
- name = normalizeName(name);
44977
- value = normalizeValue(value);
44978
- var oldValue = this.map[name];
44979
- this.map[name] = oldValue ? oldValue + ", " + value : value;
44980
- };
44981
- Headers.prototype["delete"] = function(name) {
44982
- delete this.map[normalizeName(name)];
44983
- };
44984
- Headers.prototype.get = function(name) {
44985
- name = normalizeName(name);
44986
- return this.has(name) ? this.map[name] : null;
44987
- };
44988
- Headers.prototype.has = function(name) {
44989
- return this.map.hasOwnProperty(normalizeName(name));
44990
- };
44991
- Headers.prototype.set = function(name, value) {
44992
- this.map[normalizeName(name)] = normalizeValue(value);
44993
- };
44994
- Headers.prototype.forEach = function(callback, thisArg) {
44995
- for (var name in this.map) if (this.map.hasOwnProperty(name)) callback.call(thisArg, this.map[name], name, this);
44996
- };
44997
- Headers.prototype.keys = function() {
44998
- var items = [];
44999
- this.forEach(function(value, name) {
45000
- items.push(name);
45001
- });
45002
- return iteratorFor(items);
45003
- };
45004
- Headers.prototype.values = function() {
45005
- var items = [];
45006
- this.forEach(function(value) {
45007
- items.push(value);
45008
- });
45009
- return iteratorFor(items);
45010
- };
45011
- Headers.prototype.entries = function() {
45012
- var items = [];
45013
- this.forEach(function(value, name) {
45014
- items.push([name, value]);
45015
- });
45016
- return iteratorFor(items);
45017
- };
45018
- if (support.iterable) Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
45019
- function consumed(body) {
45020
- if (body._noBody) return;
45021
- if (body.bodyUsed) return Promise.reject(/* @__PURE__ */ new TypeError("Already read"));
45022
- body.bodyUsed = true;
45023
- }
45024
- function fileReaderReady(reader) {
45025
- return new Promise(function(resolve, reject) {
45026
- reader.onload = function() {
45027
- resolve(reader.result);
45028
- };
45029
- reader.onerror = function() {
45030
- reject(reader.error);
45031
- };
45032
- });
45033
- }
45034
- function readBlobAsArrayBuffer(blob) {
45035
- var reader = new FileReader();
45036
- var promise = fileReaderReady(reader);
45037
- reader.readAsArrayBuffer(blob);
45038
- return promise;
45039
- }
45040
- function readBlobAsText(blob) {
45041
- var reader = new FileReader();
45042
- var promise = fileReaderReady(reader);
45043
- var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
45044
- var encoding = match ? match[1] : "utf-8";
45045
- reader.readAsText(blob, encoding);
45046
- return promise;
45047
- }
45048
- function readArrayBufferAsText(buf) {
45049
- var view = new Uint8Array(buf);
45050
- var chars = new Array(view.length);
45051
- for (var i = 0; i < view.length; i++) chars[i] = String.fromCharCode(view[i]);
45052
- return chars.join("");
45053
- }
45054
- function bufferClone(buf) {
45055
- if (buf.slice) return buf.slice(0);
45056
- else {
45057
- var view = new Uint8Array(buf.byteLength);
45058
- view.set(new Uint8Array(buf));
45059
- return view.buffer;
45060
- }
45061
- }
45062
- function Body() {
45063
- this.bodyUsed = false;
45064
- this._initBody = function(body) {
45065
- this.bodyUsed = this.bodyUsed;
45066
- this._bodyInit = body;
45067
- if (!body) {
45068
- this._noBody = true;
45069
- this._bodyText = "";
45070
- } else if (typeof body === "string") this._bodyText = body;
45071
- else if (support.blob && Blob.prototype.isPrototypeOf(body)) this._bodyBlob = body;
45072
- else if (support.formData && FormData.prototype.isPrototypeOf(body)) this._bodyFormData = body;
45073
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this._bodyText = body.toString();
45074
- else if (support.arrayBuffer && support.blob && isDataView(body)) {
45075
- this._bodyArrayBuffer = bufferClone(body.buffer);
45076
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
45077
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) this._bodyArrayBuffer = bufferClone(body);
45078
- else this._bodyText = body = Object.prototype.toString.call(body);
45079
- if (!this.headers.get("content-type")) {
45080
- if (typeof body === "string") this.headers.set("content-type", "text/plain;charset=UTF-8");
45081
- else if (this._bodyBlob && this._bodyBlob.type) this.headers.set("content-type", this._bodyBlob.type);
45082
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
45083
- }
45084
- };
45085
- if (support.blob) this.blob = function() {
45086
- var rejected = consumed(this);
45087
- if (rejected) return rejected;
45088
- if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
45089
- else if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
45090
- else if (this._bodyFormData) throw new Error("could not read FormData body as blob");
45091
- else return Promise.resolve(new Blob([this._bodyText]));
45092
- };
45093
- this.arrayBuffer = function() {
45094
- if (this._bodyArrayBuffer) {
45095
- var isConsumed = consumed(this);
45096
- if (isConsumed) return isConsumed;
45097
- else if (ArrayBuffer.isView(this._bodyArrayBuffer)) return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
45098
- else return Promise.resolve(this._bodyArrayBuffer);
45099
- } else if (support.blob) return this.blob().then(readBlobAsArrayBuffer);
45100
- else throw new Error("could not read as ArrayBuffer");
45101
- };
45102
- this.text = function() {
45103
- var rejected = consumed(this);
45104
- if (rejected) return rejected;
45105
- if (this._bodyBlob) return readBlobAsText(this._bodyBlob);
45106
- else if (this._bodyArrayBuffer) return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
45107
- else if (this._bodyFormData) throw new Error("could not read FormData body as text");
45108
- else return Promise.resolve(this._bodyText);
45109
- };
45110
- if (support.formData) this.formData = function() {
45111
- return this.text().then(decode);
45112
- };
45113
- this.json = function() {
45114
- return this.text().then(JSON.parse);
45115
- };
45116
- return this;
45117
- }
45118
- var methods = [
45119
- "CONNECT",
45120
- "DELETE",
45121
- "GET",
45122
- "HEAD",
45123
- "OPTIONS",
45124
- "PATCH",
45125
- "POST",
45126
- "PUT",
45127
- "TRACE"
45128
- ];
45129
- function normalizeMethod(method) {
45130
- var upcased = method.toUpperCase();
45131
- return methods.indexOf(upcased) > -1 ? upcased : method;
45132
- }
45133
- function Request(input, options) {
45134
- if (!(this instanceof Request)) throw new TypeError("Please use the \"new\" operator, this DOM object constructor cannot be called as a function.");
45135
- options = options || {};
45136
- var body = options.body;
45137
- if (input instanceof Request) {
45138
- if (input.bodyUsed) throw new TypeError("Already read");
45139
- this.url = input.url;
45140
- this.credentials = input.credentials;
45141
- if (!options.headers) this.headers = new Headers(input.headers);
45142
- this.method = input.method;
45143
- this.mode = input.mode;
45144
- this.signal = input.signal;
45145
- if (!body && input._bodyInit != null) {
45146
- body = input._bodyInit;
45147
- input.bodyUsed = true;
45148
- }
45149
- } else this.url = String(input);
45150
- this.credentials = options.credentials || this.credentials || "same-origin";
45151
- if (options.headers || !this.headers) this.headers = new Headers(options.headers);
45152
- this.method = normalizeMethod(options.method || this.method || "GET");
45153
- this.mode = options.mode || this.mode || null;
45154
- this.signal = options.signal || this.signal || function() {
45155
- if ("AbortController" in g) return new AbortController().signal;
45156
- }();
45157
- this.referrer = null;
45158
- if ((this.method === "GET" || this.method === "HEAD") && body) throw new TypeError("Body not allowed for GET or HEAD requests");
45159
- this._initBody(body);
45160
- if (this.method === "GET" || this.method === "HEAD") {
45161
- if (options.cache === "no-store" || options.cache === "no-cache") {
45162
- var reParamSearch = /([?&])_=[^&]*/;
45163
- if (reParamSearch.test(this.url)) this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
45164
- else {
45165
- var reQueryString = /\?/;
45166
- this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
45167
- }
45168
- }
45169
- }
45170
- }
45171
- Request.prototype.clone = function() {
45172
- return new Request(this, { body: this._bodyInit });
45173
- };
45174
- function decode(body) {
45175
- var form = new FormData();
45176
- body.trim().split("&").forEach(function(bytes) {
45177
- if (bytes) {
45178
- var split = bytes.split("=");
45179
- var name = split.shift().replace(/\+/g, " ");
45180
- var value = split.join("=").replace(/\+/g, " ");
45181
- form.append(decodeURIComponent(name), decodeURIComponent(value));
45182
- }
45183
- });
45184
- return form;
45185
- }
45186
- function parseHeaders(rawHeaders) {
45187
- var headers = new Headers();
45188
- rawHeaders.replace(/\r?\n[\t ]+/g, " ").split("\r").map(function(header) {
45189
- return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
45190
- }).forEach(function(line) {
45191
- var parts = line.split(":");
45192
- var key = parts.shift().trim();
45193
- if (key) {
45194
- var value = parts.join(":").trim();
45195
- try {
45196
- headers.append(key, value);
45197
- } catch (error) {
45198
- console.warn("Response " + error.message);
45199
- }
45200
- }
45201
- });
45202
- return headers;
45203
- }
45204
- Body.call(Request.prototype);
45205
- function Response(bodyInit, options) {
45206
- if (!(this instanceof Response)) throw new TypeError("Please use the \"new\" operator, this DOM object constructor cannot be called as a function.");
45207
- if (!options) options = {};
45208
- this.type = "default";
45209
- this.status = options.status === void 0 ? 200 : options.status;
45210
- if (this.status < 200 || this.status > 599) throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
45211
- this.ok = this.status >= 200 && this.status < 300;
45212
- this.statusText = options.statusText === void 0 ? "" : "" + options.statusText;
45213
- this.headers = new Headers(options.headers);
45214
- this.url = options.url || "";
45215
- this._initBody(bodyInit);
45216
- }
45217
- Body.call(Response.prototype);
45218
- Response.prototype.clone = function() {
45219
- return new Response(this._bodyInit, {
45220
- status: this.status,
45221
- statusText: this.statusText,
45222
- headers: new Headers(this.headers),
45223
- url: this.url
45224
- });
45225
- };
45226
- Response.error = function() {
45227
- var response = new Response(null, {
45228
- status: 200,
45229
- statusText: ""
45230
- });
45231
- response.ok = false;
45232
- response.status = 0;
45233
- response.type = "error";
45234
- return response;
45235
- };
45236
- var redirectStatuses = [
45237
- 301,
45238
- 302,
45239
- 303,
45240
- 307,
45241
- 308
45242
- ];
45243
- Response.redirect = function(url, status) {
45244
- if (redirectStatuses.indexOf(status) === -1) throw new RangeError("Invalid status code");
45245
- return new Response(null, {
45246
- status,
45247
- headers: { location: url }
45248
- });
45249
- };
45250
- exports$2.DOMException = g.DOMException;
45251
- try {
45252
- new exports$2.DOMException();
45253
- } catch (err) {
45254
- exports$2.DOMException = function(message, name) {
45255
- this.message = message;
45256
- this.name = name;
45257
- var error = Error(message);
45258
- this.stack = error.stack;
45259
- };
45260
- exports$2.DOMException.prototype = Object.create(Error.prototype);
45261
- exports$2.DOMException.prototype.constructor = exports$2.DOMException;
45262
- }
45263
- function fetch(input, init) {
45264
- return new Promise(function(resolve, reject) {
45265
- var request = new Request(input, init);
45266
- if (request.signal && request.signal.aborted) return reject(new exports$2.DOMException("Aborted", "AbortError"));
45267
- var xhr = new XMLHttpRequest();
45268
- function abortXhr() {
45269
- xhr.abort();
45270
- }
45271
- xhr.onload = function() {
45272
- var options = {
45273
- statusText: xhr.statusText,
45274
- headers: parseHeaders(xhr.getAllResponseHeaders() || "")
45275
- };
45276
- if (request.url.indexOf("file://") === 0 && (xhr.status < 200 || xhr.status > 599)) options.status = 200;
45277
- else options.status = xhr.status;
45278
- options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
45279
- var body = "response" in xhr ? xhr.response : xhr.responseText;
45280
- setTimeout(function() {
45281
- resolve(new Response(body, options));
45282
- }, 0);
45283
- };
45284
- xhr.onerror = function() {
45285
- setTimeout(function() {
45286
- reject(/* @__PURE__ */ new TypeError("Network request failed"));
45287
- }, 0);
45288
- };
45289
- xhr.ontimeout = function() {
45290
- setTimeout(function() {
45291
- reject(/* @__PURE__ */ new TypeError("Network request timed out"));
45292
- }, 0);
45293
- };
45294
- xhr.onabort = function() {
45295
- setTimeout(function() {
45296
- reject(new exports$2.DOMException("Aborted", "AbortError"));
45297
- }, 0);
45298
- };
45299
- function fixUrl(url) {
45300
- try {
45301
- return url === "" && g.location.href ? g.location.href : url;
45302
- } catch (e) {
45303
- return url;
45304
- }
45305
- }
45306
- xhr.open(request.method, fixUrl(request.url), true);
45307
- if (request.credentials === "include") xhr.withCredentials = true;
45308
- else if (request.credentials === "omit") xhr.withCredentials = false;
45309
- if ("responseType" in xhr) {
45310
- if (support.blob) xhr.responseType = "blob";
45311
- else if (support.arrayBuffer) xhr.responseType = "arraybuffer";
45312
- }
45313
- if (init && typeof init.headers === "object" && !(init.headers instanceof Headers || g.Headers && init.headers instanceof g.Headers)) {
45314
- var names = [];
45315
- Object.getOwnPropertyNames(init.headers).forEach(function(name) {
45316
- names.push(normalizeName(name));
45317
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
45318
- });
45319
- request.headers.forEach(function(value, name) {
45320
- if (names.indexOf(name) === -1) xhr.setRequestHeader(name, value);
45321
- });
45322
- } else request.headers.forEach(function(value, name) {
45323
- xhr.setRequestHeader(name, value);
45324
- });
45325
- if (request.signal) {
45326
- request.signal.addEventListener("abort", abortXhr);
45327
- xhr.onreadystatechange = function() {
45328
- if (xhr.readyState === 4) request.signal.removeEventListener("abort", abortXhr);
45329
- };
45330
- }
45331
- xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit);
45332
- });
45333
- }
45334
- fetch.polyfill = true;
45335
- if (!g.fetch) {
45336
- g.fetch = fetch;
45337
- g.Headers = Headers;
45338
- g.Request = Request;
45339
- g.Response = Response;
45340
- }
45341
- exports$2.Headers = Headers;
45342
- exports$2.Request = Request;
45343
- exports$2.Response = Response;
45344
- exports$2.fetch = fetch;
45345
- Object.defineProperty(exports$2, "__esModule", { value: true });
45346
- }));
45347
- }));
45348
- //#endregion
45349
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/logger.js
45350
- var require_logger = /* @__PURE__ */ __commonJSMin(((exports) => {
45351
- Object.defineProperty(exports, "__esModule", { value: true });
45352
- exports.log = exports.Logger = exports.LogLevel = void 0;
45353
- exports.prettyPrint = prettyPrint;
45354
- const config_1 = require_config();
45355
- const shared_1 = require_shared();
45356
- const url = config_1.config.getLogsEndpoint();
45357
- const LOG_LEVEL = process.env.NEXT_PUBLIC_AXIOM_LOG_LEVEL || "debug";
45358
- var LogLevel;
45359
- (function(LogLevel) {
45360
- LogLevel[LogLevel["debug"] = 0] = "debug";
45361
- LogLevel[LogLevel["info"] = 1] = "info";
45362
- LogLevel[LogLevel["warn"] = 2] = "warn";
45363
- LogLevel[LogLevel["error"] = 3] = "error";
45364
- LogLevel[LogLevel["off"] = 100] = "off";
45365
- })(LogLevel || (exports.LogLevel = LogLevel = {}));
45366
- var Logger = class Logger {
45367
- constructor(initConfig = {}) {
45368
- this.logEvents = [];
45369
- this.throttledSendLogs = (0, shared_1.throttle)(this.sendLogs, 1e3);
45370
- this.children = [];
45371
- this.logLevel = LogLevel.debug;
45372
- this.config = {
45373
- autoFlush: true,
45374
- source: "frontend-log",
45375
- prettyPrint
45376
- };
45377
- this.debug = (message, args = {}) => {
45378
- this.log(LogLevel.debug, message, args);
45379
- };
45380
- this.info = (message, args = {}) => {
45381
- this.log(LogLevel.info, message, args);
45382
- };
45383
- this.warn = (message, args = {}) => {
45384
- this.log(LogLevel.warn, message, args);
45385
- };
45386
- this.error = (message, args = {}) => {
45387
- this.log(LogLevel.error, message, args);
45388
- };
45389
- this.with = (args) => {
45390
- const child = new Logger({
45391
- ...this.config,
45392
- args: {
45393
- ...this.config.args,
45394
- ...args
45395
- }
45396
- });
45397
- this.children.push(child);
45398
- return child;
45399
- };
45400
- this.withRequest = (req) => {
45401
- return new Logger({
45402
- ...this.config,
45403
- req: {
45404
- ...this.config.req,
45405
- ...req
45406
- }
45407
- });
45408
- };
45409
- this._transformEvent = (level, message, args = {}) => {
45410
- const logEvent = {
45411
- level: LogLevel[level].toString(),
45412
- message,
45413
- _time: new Date(Date.now()).toISOString(),
45414
- source: this.config.source,
45415
- fields: this.config.args || {},
45416
- "@app": { "next-axiom-version": config_1.Version }
45417
- };
45418
- if (args instanceof Error) logEvent.fields = {
45419
- ...logEvent.fields,
45420
- message: args.message,
45421
- stack: args.stack,
45422
- name: args.name,
45423
- cause: args.cause
45424
- };
45425
- else if (typeof args === "object" && args !== null && Object.keys(args).length > 0) {
45426
- const parsedArgs = JSON.parse(JSON.stringify(args, jsonFriendlyErrorReplacer));
45427
- logEvent.fields = {
45428
- ...logEvent.fields,
45429
- ...parsedArgs
45430
- };
45431
- } else if (args && args.length) logEvent.fields = {
45432
- ...logEvent.fields,
45433
- args
45434
- };
45435
- config_1.config.injectPlatformMetadata(logEvent, this.config.source);
45436
- if (this.config.req != null) {
45437
- logEvent.request = this.config.req;
45438
- if (logEvent.platform) logEvent.platform.route = this.config.req.path;
45439
- else if (logEvent.vercel) logEvent.vercel.route = this.config.req.path;
45440
- }
45441
- return logEvent;
45442
- };
45443
- this.log = (level, message, args = {}) => {
45444
- if (level < this.logLevel) return;
45445
- const logEvent = this._transformEvent(level, message, args);
45446
- this.logEvents.push(logEvent);
45447
- if (this.config.autoFlush) this.throttledSendLogs();
45448
- };
45449
- this.attachResponseStatus = (statusCode) => {
45450
- this.logEvents = this.logEvents.map((log) => {
45451
- if (log.request) log.request.statusCode = statusCode;
45452
- return log;
45453
- });
45454
- };
45455
- this.flush = async () => {
45456
- await Promise.all([this.sendLogs(), ...this.children.map((c) => c.flush())]);
45457
- };
45458
- this.initConfig = initConfig;
45459
- if (this.initConfig.logLevel != void 0 && this.initConfig.logLevel >= 0) this.logLevel = this.initConfig.logLevel;
45460
- else if (LOG_LEVEL) this.logLevel = LogLevel[LOG_LEVEL];
45461
- this.config = {
45462
- ...this.config,
45463
- ...initConfig
45464
- };
45465
- }
45466
- logHttpRequest(level, message, request, args) {
45467
- const logEvent = this._transformEvent(level, message, args);
45468
- logEvent.request = request;
45469
- this.logEvents.push(logEvent);
45470
- if (this.config.autoFlush) this.throttledSendLogs();
45471
- }
45472
- middleware(request, config) {
45473
- const req = {
45474
- ip: request.ip,
45475
- region: request.geo?.region,
45476
- method: request.method,
45477
- host: request.nextUrl.hostname,
45478
- path: request.nextUrl.pathname,
45479
- scheme: request.nextUrl.protocol.split(":")[0],
45480
- referer: request.headers.get("Referer"),
45481
- userAgent: request.headers.get("user-agent")
45482
- };
45483
- const message = `${request.method} ${request.nextUrl.pathname}`;
45484
- if (config?.logRequestDetails) return (0, shared_1.requestToJSON)(request).then((details) => {
45485
- const newReq = {
45486
- ...req,
45487
- details: Array.isArray(config.logRequestDetails) ? Object.fromEntries(Object.entries(details).filter(([key]) => config.logRequestDetails.includes(key))) : details
45488
- };
45489
- return this.logHttpRequest(LogLevel.info, message, newReq, {});
45490
- });
45491
- return this.logHttpRequest(LogLevel.info, message, req, {});
45492
- }
45493
- async sendLogs() {
45494
- if (!this.logEvents.length) return;
45495
- if (!config_1.config.isEnvVarsSet()) {
45496
- this.logEvents.forEach((ev) => this.config.prettyPrint ? this.config.prettyPrint(ev) : prettyPrint(ev));
45497
- this.logEvents = [];
45498
- return;
45499
- }
45500
- const method = "POST";
45501
- const keepalive = true;
45502
- const body = JSON.stringify(this.logEvents);
45503
- this.logEvents = [];
45504
- const headers = {
45505
- "Content-Type": "application/json",
45506
- "User-Agent": "next-axiom/v" + config_1.Version
45507
- };
45508
- if (config_1.config.token) headers["Authorization"] = `Bearer ${config_1.config.token}`;
45509
- const reqOptions = {
45510
- body,
45511
- method,
45512
- keepalive,
45513
- headers
45514
- };
45515
- function sendFallback() {
45516
- return fetch(url, reqOptions).catch(console.error);
45517
- }
45518
- try {
45519
- if (typeof fetch === "undefined") return (await require_fetch_umd())(url, reqOptions).catch(console.error);
45520
- else if (config_1.isBrowser && config_1.isVercelIntegration && navigator.sendBeacon) try {
45521
- if (!navigator.sendBeacon.bind(navigator)(url, body)) return sendFallback();
45522
- } catch (error) {
45523
- return sendFallback();
45524
- }
45525
- else return sendFallback();
45526
- } catch (e) {
45527
- console.warn(`Failed to send logs to Axiom: ${e}`);
45528
- this.logEvents = [...this.logEvents, JSON.parse(body)];
45529
- }
45530
- }
45531
- };
45532
- exports.Logger = Logger;
45533
- exports.log = new Logger({});
45534
- const levelColors = {
45535
- info: {
45536
- terminal: "32",
45537
- browser: "lightgreen"
45538
- },
45539
- debug: {
45540
- terminal: "36",
45541
- browser: "lightblue"
45542
- },
45543
- warn: {
45544
- terminal: "33",
45545
- browser: "yellow"
45546
- },
45547
- error: {
45548
- terminal: "31",
45549
- browser: "red"
45550
- }
45551
- };
45552
- function prettyPrint(ev) {
45553
- const hasFields = Object.keys(ev.fields).length > 0;
45554
- if (shared_1.isNoPrettyPrint) {
45555
- let msg = `${ev.level} - ${ev.message}`;
45556
- if (hasFields) msg += " " + JSON.stringify(ev.fields);
45557
- console.log(msg);
45558
- return;
45559
- }
45560
- let msgString = "";
45561
- let args = [ev.level, ev.message];
45562
- if (config_1.isBrowser) {
45563
- msgString = "%c%s - %s";
45564
- args = [`color: ${levelColors[ev.level].browser};`, ...args];
45565
- } else msgString = `\x1b[${levelColors[ev.level].terminal}m%s\x1b[0m - %s`;
45566
- if (hasFields) {
45567
- msgString += " %o";
45568
- args.push(ev.fields);
45569
- }
45570
- if (ev.request) {
45571
- msgString += " %o";
45572
- args.push(ev.request);
45573
- }
45574
- console.log.apply(console, [msgString, ...args]);
45575
- }
45576
- function jsonFriendlyErrorReplacer(key, value) {
45577
- if (value instanceof Error) return {
45578
- ...value,
45579
- name: value.name,
45580
- message: value.message,
45581
- stack: value.stack,
45582
- cause: jsonFriendlyErrorReplacer("", value.cause)
45583
- };
45584
- return value;
45585
- }
45586
- }));
45587
- //#endregion
45588
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/base.js
45589
- var require_base = /* @__PURE__ */ __commonJSMin(((exports) => {
45590
- Object.defineProperty(exports, "__esModule", { value: true });
45591
- }));
45592
- //#endregion
45593
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/headers.js
45594
- var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45595
- var __defProp = Object.defineProperty;
45596
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
45597
- var __getOwnPropNames = Object.getOwnPropertyNames;
45598
- var __hasOwnProp = Object.prototype.hasOwnProperty;
45599
- var __export = (target, all) => {
45600
- for (var name in all) __defProp(target, name, {
45601
- get: all[name],
45602
- enumerable: true
45603
- });
45604
- };
45605
- var __copyProps = (to, from, except, desc) => {
45606
- if (from && typeof from === "object" || typeof from === "function") {
45607
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
45608
- get: () => from[key],
45609
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
45610
- });
45611
- }
45612
- return to;
45613
- };
45614
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45615
- var headers_exports = {};
45616
- __export(headers_exports, {
45617
- CITY_HEADER_NAME: () => CITY_HEADER_NAME,
45618
- COUNTRY_HEADER_NAME: () => COUNTRY_HEADER_NAME,
45619
- EMOJI_FLAG_UNICODE_STARTING_POSITION: () => EMOJI_FLAG_UNICODE_STARTING_POSITION,
45620
- IP_HEADER_NAME: () => IP_HEADER_NAME,
45621
- LATITUDE_HEADER_NAME: () => LATITUDE_HEADER_NAME,
45622
- LONGITUDE_HEADER_NAME: () => LONGITUDE_HEADER_NAME,
45623
- POSTAL_CODE_HEADER_NAME: () => POSTAL_CODE_HEADER_NAME,
45624
- REGION_HEADER_NAME: () => REGION_HEADER_NAME,
45625
- REQUEST_ID_HEADER_NAME: () => REQUEST_ID_HEADER_NAME,
45626
- geolocation: () => geolocation,
45627
- ipAddress: () => ipAddress
45628
- });
45629
- module.exports = __toCommonJS(headers_exports);
45630
- const CITY_HEADER_NAME = "x-vercel-ip-city";
45631
- const COUNTRY_HEADER_NAME = "x-vercel-ip-country";
45632
- const IP_HEADER_NAME = "x-real-ip";
45633
- const LATITUDE_HEADER_NAME = "x-vercel-ip-latitude";
45634
- const LONGITUDE_HEADER_NAME = "x-vercel-ip-longitude";
45635
- const REGION_HEADER_NAME = "x-vercel-ip-country-region";
45636
- const POSTAL_CODE_HEADER_NAME = "x-vercel-ip-postal-code";
45637
- const REQUEST_ID_HEADER_NAME = "x-vercel-id";
45638
- const EMOJI_FLAG_UNICODE_STARTING_POSITION = 127397;
45639
- function getHeader(headers, key) {
45640
- return headers.get(key) ?? void 0;
45641
- }
45642
- function getHeaderWithDecode(request, key) {
45643
- const header = getHeader(request.headers, key);
45644
- return header ? decodeURIComponent(header) : void 0;
45645
- }
45646
- function getFlag(countryCode) {
45647
- const regex = (/* @__PURE__ */ new RegExp("^[A-Z]{2}$")).test(countryCode);
45648
- if (!countryCode || !regex) return void 0;
45649
- return String.fromCodePoint(...countryCode.split("").map((char) => EMOJI_FLAG_UNICODE_STARTING_POSITION + char.charCodeAt(0)));
45650
- }
45651
- function ipAddress(input) {
45652
- return getHeader("headers" in input ? input.headers : input, IP_HEADER_NAME);
45653
- }
45654
- function getRegionFromRequestId(requestId) {
45655
- if (!requestId) return "dev1";
45656
- return requestId.split(":")[0];
45657
- }
45658
- function geolocation(request) {
45659
- return {
45660
- city: getHeaderWithDecode(request, CITY_HEADER_NAME),
45661
- country: getHeader(request.headers, COUNTRY_HEADER_NAME),
45662
- flag: getFlag(getHeader(request.headers, COUNTRY_HEADER_NAME)),
45663
- countryRegion: getHeader(request.headers, REGION_HEADER_NAME),
45664
- region: getRegionFromRequestId(getHeader(request.headers, REQUEST_ID_HEADER_NAME)),
45665
- latitude: getHeader(request.headers, LATITUDE_HEADER_NAME),
45666
- longitude: getHeader(request.headers, LONGITUDE_HEADER_NAME),
45667
- postalCode: getHeader(request.headers, POSTAL_CODE_HEADER_NAME)
45668
- };
45669
- }
45670
- 0 && (module.exports = {
45671
- CITY_HEADER_NAME,
45672
- COUNTRY_HEADER_NAME,
45673
- EMOJI_FLAG_UNICODE_STARTING_POSITION,
45674
- IP_HEADER_NAME,
45675
- LATITUDE_HEADER_NAME,
45676
- LONGITUDE_HEADER_NAME,
45677
- POSTAL_CODE_HEADER_NAME,
45678
- REGION_HEADER_NAME,
45679
- REQUEST_ID_HEADER_NAME,
45680
- geolocation,
45681
- ipAddress
45682
- });
45683
- }));
45684
- //#endregion
45685
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/get-env.js
45686
- var require_get_env = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45687
- var __defProp = Object.defineProperty;
45688
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
45689
- var __getOwnPropNames = Object.getOwnPropertyNames;
45690
- var __hasOwnProp = Object.prototype.hasOwnProperty;
45691
- var __export = (target, all) => {
45692
- for (var name in all) __defProp(target, name, {
45693
- get: all[name],
45694
- enumerable: true
45695
- });
45696
- };
45697
- var __copyProps = (to, from, except, desc) => {
45698
- if (from && typeof from === "object" || typeof from === "function") {
45699
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
45700
- get: () => from[key],
45701
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
45702
- });
45703
- }
45704
- return to;
45705
- };
45706
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45707
- var get_env_exports = {};
45708
- __export(get_env_exports, { getEnv: () => getEnv });
45709
- module.exports = __toCommonJS(get_env_exports);
45710
- const getEnv = (env = process.env) => ({
45711
- /**
45712
- * An indicator to show that System Environment Variables have been exposed to your project's Deployments.
45713
- * @example "1"
45714
- */
45715
- VERCEL: get(env, "VERCEL"),
45716
- /**
45717
- * An indicator that the code is running in a Continuous Integration environment.
45718
- * @example "1"
45719
- */
45720
- CI: get(env, "CI"),
45721
- /**
45722
- * The Environment that the app is deployed and running on.
45723
- * @example "production"
45724
- */
45725
- VERCEL_ENV: get(env, "VERCEL_ENV"),
45726
- /**
45727
- * The domain name of the generated deployment URL. The value does not include the protocol scheme https://.
45728
- * NOTE: This Variable cannot be used in conjunction with Standard Deployment Protection.
45729
- * @example "*.vercel.app"
45730
- */
45731
- VERCEL_URL: get(env, "VERCEL_URL"),
45732
- /**
45733
- * The domain name of the generated Git branch URL. The value does not include the protocol scheme https://.
45734
- * @example "*-git-*.vercel.app"
45735
- */
45736
- VERCEL_BRANCH_URL: get(env, "VERCEL_BRANCH_URL"),
45737
- /**
45738
- * A production domain name of the project. This is useful to reliably generate links that point to production such as OG-image URLs.
45739
- * The value does not include the protocol scheme https://.
45740
- * @example "myproject.vercel.app"
45741
- */
45742
- VERCEL_PROJECT_PRODUCTION_URL: get(env, "VERCEL_PROJECT_PRODUCTION_URL"),
45743
- /**
45744
- * The ID of the Region where the app is running.
45745
- *
45746
- * Possible values:
45747
- * - arn1 (Stockholm, Sweden)
45748
- * - bom1 (Mumbai, India)
45749
- * - cdg1 (Paris, France)
45750
- * - cle1 (Cleveland, USA)
45751
- * - cpt1 (Cape Town, South Africa)
45752
- * - dub1 (Dublin, Ireland)
45753
- * - fra1 (Frankfurt, Germany)
45754
- * - gru1 (São Paulo, Brazil)
45755
- * - hkg1 (Hong Kong)
45756
- * - hnd1 (Tokyo, Japan)
45757
- * - iad1 (Washington, D.C., USA)
45758
- * - icn1 (Seoul, South Korea)
45759
- * - kix1 (Osaka, Japan)
45760
- * - lhr1 (London, United Kingdom)
45761
- * - pdx1 (Portland, USA)
45762
- * - sfo1 (San Francisco, USA)
45763
- * - sin1 (Singapore)
45764
- * - syd1 (Sydney, Australia)
45765
- * - dev1 (Development Region)
45766
- *
45767
- * @example "iad1"
45768
- */
45769
- VERCEL_REGION: get(env, "VERCEL_REGION"),
45770
- /**
45771
- * The unique identifier for the deployment, which can be used to implement Skew Protection.
45772
- * @example "dpl_7Gw5ZMBpQA8h9GF832KGp7nwbuh3"
45773
- */
45774
- VERCEL_DEPLOYMENT_ID: get(env, "VERCEL_DEPLOYMENT_ID"),
45775
- /**
45776
- * When Skew Protection is enabled in Project Settings, this value is set to 1.
45777
- * @example "1"
45778
- */
45779
- VERCEL_SKEW_PROTECTION_ENABLED: get(env, "VERCEL_SKEW_PROTECTION_ENABLED"),
45780
- /**
45781
- * The Protection Bypass for Automation value, if the secret has been generated in the project's Deployment Protection settings.
45782
- */
45783
- VERCEL_AUTOMATION_BYPASS_SECRET: get(env, "VERCEL_AUTOMATION_BYPASS_SECRET"),
45784
- /**
45785
- * The Git Provider the deployment is triggered from.
45786
- * @example "github"
45787
- */
45788
- VERCEL_GIT_PROVIDER: get(env, "VERCEL_GIT_PROVIDER"),
45789
- /**
45790
- * The origin repository the deployment is triggered from.
45791
- * @example "my-site"
45792
- */
45793
- VERCEL_GIT_REPO_SLUG: get(env, "VERCEL_GIT_REPO_SLUG"),
45794
- /**
45795
- * The account that owns the repository the deployment is triggered from.
45796
- * @example "acme"
45797
- */
45798
- VERCEL_GIT_REPO_OWNER: get(env, "VERCEL_GIT_REPO_OWNER"),
45799
- /**
45800
- * The ID of the repository the deployment is triggered from.
45801
- * @example "117716146"
45802
- */
45803
- VERCEL_GIT_REPO_ID: get(env, "VERCEL_GIT_REPO_ID"),
45804
- /**
45805
- * The git branch of the commit the deployment was triggered by.
45806
- * @example "improve-about-page"
45807
- */
45808
- VERCEL_GIT_COMMIT_REF: get(env, "VERCEL_GIT_COMMIT_REF"),
45809
- /**
45810
- * The git SHA of the commit the deployment was triggered by.
45811
- * @example "fa1eade47b73733d6312d5abfad33ce9e4068081"
45812
- */
45813
- VERCEL_GIT_COMMIT_SHA: get(env, "VERCEL_GIT_COMMIT_SHA"),
45814
- /**
45815
- * The message attached to the commit the deployment was triggered by.
45816
- * @example "Update about page"
45817
- */
45818
- VERCEL_GIT_COMMIT_MESSAGE: get(env, "VERCEL_GIT_COMMIT_MESSAGE"),
45819
- /**
45820
- * The username attached to the author of the commit that the project was deployed by.
45821
- * @example "johndoe"
45822
- */
45823
- VERCEL_GIT_COMMIT_AUTHOR_LOGIN: get(env, "VERCEL_GIT_COMMIT_AUTHOR_LOGIN"),
45824
- /**
45825
- * The name attached to the author of the commit that the project was deployed by.
45826
- * @example "John Doe"
45827
- */
45828
- VERCEL_GIT_COMMIT_AUTHOR_NAME: get(env, "VERCEL_GIT_COMMIT_AUTHOR_NAME"),
45829
- /**
45830
- * The git SHA of the last successful deployment for the project and branch.
45831
- * NOTE: This Variable is only exposed when an Ignored Build Step is provided.
45832
- * @example "fa1eade47b73733d6312d5abfad33ce9e4068080"
45833
- */
45834
- VERCEL_GIT_PREVIOUS_SHA: get(env, "VERCEL_GIT_PREVIOUS_SHA"),
45835
- /**
45836
- * The pull request id the deployment was triggered by. If a deployment is created on a branch before a pull request is made, this value will be an empty string.
45837
- * @example "23"
45838
- */
45839
- VERCEL_GIT_PULL_REQUEST_ID: get(env, "VERCEL_GIT_PULL_REQUEST_ID")
45840
- });
45841
- const get = (env, key) => {
45842
- const value = env[key];
45843
- return value === "" ? void 0 : value;
45844
- };
45845
- 0 && (module.exports = { getEnv });
45846
- }));
45847
- //#endregion
45848
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/get-context.js
45849
- var require_get_context = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45850
- var __defProp = Object.defineProperty;
45851
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
45852
- var __getOwnPropNames = Object.getOwnPropertyNames;
45853
- var __hasOwnProp = Object.prototype.hasOwnProperty;
45854
- var __export = (target, all) => {
45855
- for (var name in all) __defProp(target, name, {
45856
- get: all[name],
45857
- enumerable: true
45858
- });
45859
- };
45860
- var __copyProps = (to, from, except, desc) => {
45861
- if (from && typeof from === "object" || typeof from === "function") {
45862
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
45863
- get: () => from[key],
45864
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
45865
- });
45866
- }
45867
- return to;
45868
- };
45869
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45870
- var get_context_exports = {};
45871
- __export(get_context_exports, {
45872
- SYMBOL_FOR_REQ_CONTEXT: () => SYMBOL_FOR_REQ_CONTEXT,
45873
- getContext: () => getContext
45874
- });
45875
- module.exports = __toCommonJS(get_context_exports);
45876
- const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
45877
- function getContext() {
45878
- return globalThis[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
45879
- }
45880
- 0 && (module.exports = {
45881
- SYMBOL_FOR_REQ_CONTEXT,
45882
- getContext
45883
- });
45884
- }));
45885
- //#endregion
45886
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/wait-until.js
45887
- var require_wait_until = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45888
- var __defProp = Object.defineProperty;
45889
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
45890
- var __getOwnPropNames = Object.getOwnPropertyNames;
45891
- var __hasOwnProp = Object.prototype.hasOwnProperty;
45892
- var __export = (target, all) => {
45893
- for (var name in all) __defProp(target, name, {
45894
- get: all[name],
45895
- enumerable: true
45896
- });
45897
- };
45898
- var __copyProps = (to, from, except, desc) => {
45899
- if (from && typeof from === "object" || typeof from === "function") {
45900
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
45901
- get: () => from[key],
45902
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
45903
- });
45904
- }
45905
- return to;
45906
- };
45907
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45908
- var wait_until_exports = {};
45909
- __export(wait_until_exports, { waitUntil: () => waitUntil });
45910
- module.exports = __toCommonJS(wait_until_exports);
45911
- var import_get_context = require_get_context();
45912
- const waitUntil = (promise) => {
45913
- if (promise === null || typeof promise !== "object" || typeof promise.then !== "function") throw new TypeError(`waitUntil can only be called with a Promise, got ${typeof promise}`);
45914
- return (0, import_get_context.getContext)().waitUntil?.(promise);
45915
- };
45916
- 0 && (module.exports = { waitUntil });
45917
- }));
45918
- //#endregion
45919
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/middleware.js
45920
- var require_middleware = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45921
- var __defProp = Object.defineProperty;
45922
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
45923
- var __getOwnPropNames = Object.getOwnPropertyNames;
45924
- var __hasOwnProp = Object.prototype.hasOwnProperty;
45925
- var __export = (target, all) => {
45926
- for (var name in all) __defProp(target, name, {
45927
- get: all[name],
45928
- enumerable: true
45929
- });
45930
- };
45931
- var __copyProps = (to, from, except, desc) => {
45932
- if (from && typeof from === "object" || typeof from === "function") {
45933
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
45934
- get: () => from[key],
45935
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
45936
- });
45937
- }
45938
- return to;
45939
- };
45940
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45941
- var middleware_exports = {};
45942
- __export(middleware_exports, {
45943
- next: () => next,
45944
- rewrite: () => rewrite
45945
- });
45946
- module.exports = __toCommonJS(middleware_exports);
45947
- function handleMiddlewareField(init, headers) {
45948
- if (init?.request?.headers) {
45949
- if (!(init.request.headers instanceof Headers)) throw new Error("request.headers must be an instance of Headers");
45950
- const keys = [];
45951
- for (const [key, value] of init.request.headers) {
45952
- headers.set("x-middleware-request-" + key, value);
45953
- keys.push(key);
45954
- }
45955
- headers.set("x-middleware-override-headers", keys.join(","));
45956
- }
45957
- }
45958
- function rewrite(destination, init) {
45959
- const headers = new Headers(init?.headers ?? {});
45960
- headers.set("x-middleware-rewrite", String(destination));
45961
- handleMiddlewareField(init, headers);
45962
- return new Response(null, {
45963
- ...init,
45964
- headers
45965
- });
45966
- }
45967
- function next(init) {
45968
- const headers = new Headers(init?.headers ?? {});
45969
- headers.set("x-middleware-next", "1");
45970
- handleMiddlewareField(init, headers);
45971
- return new Response(null, {
45972
- ...init,
45973
- headers
45974
- });
45975
- }
45976
- 0 && (module.exports = {
45977
- next,
45978
- rewrite
45979
- });
45980
- }));
45981
- //#endregion
45982
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/cache/in-memory-cache.js
45983
- var require_in_memory_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45984
- var __defProp = Object.defineProperty;
45985
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
45986
- var __getOwnPropNames = Object.getOwnPropertyNames;
45987
- var __hasOwnProp = Object.prototype.hasOwnProperty;
45988
- var __export = (target, all) => {
45989
- for (var name in all) __defProp(target, name, {
45990
- get: all[name],
45991
- enumerable: true
45992
- });
45993
- };
45994
- var __copyProps = (to, from, except, desc) => {
45995
- if (from && typeof from === "object" || typeof from === "function") {
45996
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
45997
- get: () => from[key],
45998
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
45999
- });
46000
- }
46001
- return to;
46002
- };
46003
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46004
- var in_memory_cache_exports = {};
46005
- __export(in_memory_cache_exports, { InMemoryCache: () => InMemoryCache });
46006
- module.exports = __toCommonJS(in_memory_cache_exports);
46007
- var InMemoryCache = class {
46008
- constructor() {
46009
- this.cache = {};
46010
- }
46011
- async get(key) {
46012
- const entry = this.cache[key];
46013
- if (entry) {
46014
- if (entry.ttl && entry.lastModified + entry.ttl * 1e3 < Date.now()) {
46015
- await this.delete(key);
46016
- return null;
46017
- }
46018
- return entry.value;
46019
- }
46020
- return null;
46021
- }
46022
- async set(key, value, options) {
46023
- this.cache[key] = {
46024
- value,
46025
- lastModified: Date.now(),
46026
- ttl: options?.ttl,
46027
- tags: new Set(options?.tags || [])
46028
- };
46029
- }
46030
- async delete(key) {
46031
- delete this.cache[key];
46032
- }
46033
- async expireTag(tag) {
46034
- const tags = Array.isArray(tag) ? tag : [tag];
46035
- for (const key in this.cache) if (Object.prototype.hasOwnProperty.call(this.cache, key)) {
46036
- const entry = this.cache[key];
46037
- if (tags.some((t) => entry.tags.has(t))) delete this.cache[key];
46038
- }
46039
- }
46040
- };
46041
- 0 && (module.exports = { InMemoryCache });
46042
- }));
46043
- //#endregion
46044
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/cache/build-client.js
46045
- var require_build_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46046
- var __defProp = Object.defineProperty;
46047
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46048
- var __getOwnPropNames = Object.getOwnPropertyNames;
46049
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46050
- var __export = (target, all) => {
46051
- for (var name in all) __defProp(target, name, {
46052
- get: all[name],
46053
- enumerable: true
46054
- });
46055
- };
46056
- var __copyProps = (to, from, except, desc) => {
46057
- if (from && typeof from === "object" || typeof from === "function") {
46058
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46059
- get: () => from[key],
46060
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46061
- });
46062
- }
46063
- return to;
46064
- };
46065
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46066
- var build_client_exports = {};
46067
- __export(build_client_exports, { BuildCache: () => BuildCache });
46068
- module.exports = __toCommonJS(build_client_exports);
46069
- var import_index = require_cache();
46070
- var BuildCache = class {
46071
- constructor({ endpoint, headers, onError }) {
46072
- this.get = async (key) => {
46073
- try {
46074
- const res = await fetch(`${this.endpoint}${key}`, {
46075
- headers: this.headers,
46076
- method: "GET"
46077
- });
46078
- if (res.status === 404) return null;
46079
- if (res.status === 200) {
46080
- if (res.headers.get(import_index.HEADERS_VERCEL_CACHE_STATE) !== import_index.PkgCacheState.Fresh) {
46081
- res.body?.cancel?.();
46082
- return null;
46083
- }
46084
- return await res.json();
46085
- } else throw new Error(`Failed to get cache: ${res.statusText}`);
46086
- } catch (error) {
46087
- this.onError?.(error);
46088
- return null;
46089
- }
46090
- };
46091
- this.set = async (key, value, options) => {
46092
- try {
46093
- const optionalHeaders = {};
46094
- if (options?.ttl) optionalHeaders[import_index.HEADERS_VERCEL_REVALIDATE] = options.ttl.toString();
46095
- if (options?.tags && options.tags.length > 0) optionalHeaders[import_index.HEADERS_VERCEL_CACHE_TAGS] = options.tags.join(",");
46096
- if (options?.name) optionalHeaders[import_index.HEADERS_VERCEL_CACHE_ITEM_NAME] = options.name;
46097
- const res = await fetch(`${this.endpoint}${key}`, {
46098
- method: "POST",
46099
- headers: {
46100
- ...this.headers,
46101
- ...optionalHeaders
46102
- },
46103
- body: JSON.stringify(value)
46104
- });
46105
- if (res.status !== 200) throw new Error(`Failed to set cache: ${res.status} ${res.statusText}`);
46106
- } catch (error) {
46107
- this.onError?.(error);
46108
- }
46109
- };
46110
- this.delete = async (key) => {
46111
- try {
46112
- const res = await fetch(`${this.endpoint}${key}`, {
46113
- method: "DELETE",
46114
- headers: this.headers
46115
- });
46116
- if (res.status !== 200) throw new Error(`Failed to delete cache: ${res.statusText}`);
46117
- } catch (error) {
46118
- this.onError?.(error);
46119
- }
46120
- };
46121
- this.expireTag = async (tag) => {
46122
- try {
46123
- if (Array.isArray(tag)) tag = tag.join(",");
46124
- const res = await fetch(`${this.endpoint}revalidate?tags=${tag}`, {
46125
- method: "POST",
46126
- headers: this.headers
46127
- });
46128
- if (res.status !== 200) throw new Error(`Failed to revalidate tag: ${res.statusText}`);
46129
- } catch (error) {
46130
- this.onError?.(error);
46131
- }
46132
- };
46133
- this.endpoint = endpoint;
46134
- this.headers = headers;
46135
- this.onError = onError;
46136
- }
46137
- };
46138
- 0 && (module.exports = { BuildCache });
46139
- }));
46140
- //#endregion
46141
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/cache/index.js
46142
- var require_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46143
- var __defProp = Object.defineProperty;
46144
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46145
- var __getOwnPropNames = Object.getOwnPropertyNames;
46146
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46147
- var __export = (target, all) => {
46148
- for (var name in all) __defProp(target, name, {
46149
- get: all[name],
46150
- enumerable: true
46151
- });
46152
- };
46153
- var __copyProps = (to, from, except, desc) => {
46154
- if (from && typeof from === "object" || typeof from === "function") {
46155
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46156
- get: () => from[key],
46157
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46158
- });
46159
- }
46160
- return to;
46161
- };
46162
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46163
- var cache_exports = {};
46164
- __export(cache_exports, {
46165
- HEADERS_VERCEL_CACHE_ITEM_NAME: () => HEADERS_VERCEL_CACHE_ITEM_NAME,
46166
- HEADERS_VERCEL_CACHE_STATE: () => HEADERS_VERCEL_CACHE_STATE,
46167
- HEADERS_VERCEL_CACHE_TAGS: () => HEADERS_VERCEL_CACHE_TAGS,
46168
- HEADERS_VERCEL_REVALIDATE: () => HEADERS_VERCEL_REVALIDATE,
46169
- PkgCacheState: () => PkgCacheState,
46170
- getCache: () => getCache
46171
- });
46172
- module.exports = __toCommonJS(cache_exports);
46173
- var import_get_context = require_get_context();
46174
- var import_in_memory_cache = require_in_memory_cache();
46175
- var import_build_client = require_build_client();
46176
- const defaultKeyHashFunction = (key) => {
46177
- let hash = 5381;
46178
- for (let i = 0; i < key.length; i++) hash = hash * 33 ^ key.charCodeAt(i);
46179
- return (hash >>> 0).toString(16);
46180
- };
46181
- const defaultNamespaceSeparator = "$";
46182
- let inMemoryCacheInstance = null;
46183
- let buildCacheInstance = null;
46184
- const getCache = (cacheOptions) => {
46185
- const resolveCache = () => {
46186
- let cache;
46187
- if ((0, import_get_context.getContext)().cache) cache = (0, import_get_context.getContext)().cache;
46188
- else cache = getCacheImplementation(process.env.SUSPENSE_CACHE_DEBUG === "true");
46189
- return cache;
46190
- };
46191
- return wrapWithKeyTransformation(resolveCache, createKeyTransformer(cacheOptions));
46192
- };
46193
- function createKeyTransformer(cacheOptions) {
46194
- const hashFunction = cacheOptions?.keyHashFunction || defaultKeyHashFunction;
46195
- return (key) => {
46196
- if (!cacheOptions?.namespace) return hashFunction(key);
46197
- const separator = cacheOptions.namespaceSeparator || defaultNamespaceSeparator;
46198
- return `${cacheOptions.namespace}${separator}${hashFunction(key)}`;
46199
- };
46200
- }
46201
- function wrapWithKeyTransformation(resolveCache, makeKey) {
46202
- return {
46203
- get: (key) => {
46204
- return resolveCache().get(makeKey(key));
46205
- },
46206
- set: (key, value, options) => {
46207
- return resolveCache().set(makeKey(key), value, options);
46208
- },
46209
- delete: (key) => {
46210
- return resolveCache().delete(makeKey(key));
46211
- },
46212
- expireTag: (tag) => {
46213
- return resolveCache().expireTag(tag);
46214
- }
46215
- };
46216
- }
46217
- let warnedCacheUnavailable = false;
46218
- function getCacheImplementation(debug) {
46219
- if (!inMemoryCacheInstance) inMemoryCacheInstance = new import_in_memory_cache.InMemoryCache();
46220
- if (process.env.RUNTIME_CACHE_DISABLE_BUILD_CACHE === "true") {
46221
- debug && console.log("Using InMemoryCache as build cache is disabled");
46222
- return inMemoryCacheInstance;
46223
- }
46224
- const { RUNTIME_CACHE_ENDPOINT, RUNTIME_CACHE_HEADERS } = process.env;
46225
- if (debug) console.log("Runtime cache environment variables:", {
46226
- RUNTIME_CACHE_ENDPOINT,
46227
- RUNTIME_CACHE_HEADERS
46228
- });
46229
- if (!RUNTIME_CACHE_ENDPOINT || !RUNTIME_CACHE_HEADERS) {
46230
- if (!warnedCacheUnavailable) {
46231
- console.warn("Runtime Cache unavailable in this environment. Falling back to in-memory cache.");
46232
- warnedCacheUnavailable = true;
46233
- }
46234
- return inMemoryCacheInstance;
46235
- }
46236
- if (!buildCacheInstance) {
46237
- let parsedHeaders = {};
46238
- try {
46239
- parsedHeaders = JSON.parse(RUNTIME_CACHE_HEADERS);
46240
- } catch (e) {
46241
- console.error("Failed to parse RUNTIME_CACHE_HEADERS:", e);
46242
- return inMemoryCacheInstance;
46243
- }
46244
- buildCacheInstance = new import_build_client.BuildCache({
46245
- endpoint: RUNTIME_CACHE_ENDPOINT,
46246
- headers: parsedHeaders,
46247
- onError: (error) => console.error(error)
46248
- });
46249
- }
46250
- return buildCacheInstance;
46251
- }
46252
- var PkgCacheState = /* @__PURE__ */ ((PkgCacheState2) => {
46253
- PkgCacheState2["Fresh"] = "fresh";
46254
- PkgCacheState2["Stale"] = "stale";
46255
- PkgCacheState2["Expired"] = "expired";
46256
- PkgCacheState2["NotFound"] = "notFound";
46257
- PkgCacheState2["Error"] = "error";
46258
- return PkgCacheState2;
46259
- })(PkgCacheState || {});
46260
- const HEADERS_VERCEL_CACHE_STATE = "x-vercel-cache-state";
46261
- const HEADERS_VERCEL_REVALIDATE = "x-vercel-revalidate";
46262
- const HEADERS_VERCEL_CACHE_TAGS = "x-vercel-cache-tags";
46263
- const HEADERS_VERCEL_CACHE_ITEM_NAME = "x-vercel-cache-item-name";
46264
- 0 && (module.exports = {
46265
- HEADERS_VERCEL_CACHE_ITEM_NAME,
46266
- HEADERS_VERCEL_CACHE_STATE,
46267
- HEADERS_VERCEL_CACHE_TAGS,
46268
- HEADERS_VERCEL_REVALIDATE,
46269
- PkgCacheState,
46270
- getCache
46271
- });
46272
- }));
46273
- //#endregion
46274
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/db-connections/index.js
46275
- var require_db_connections = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46276
- var __defProp = Object.defineProperty;
46277
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46278
- var __getOwnPropNames = Object.getOwnPropertyNames;
46279
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46280
- var __export = (target, all) => {
46281
- for (var name in all) __defProp(target, name, {
46282
- get: all[name],
46283
- enumerable: true
46284
- });
46285
- };
46286
- var __copyProps = (to, from, except, desc) => {
46287
- if (from && typeof from === "object" || typeof from === "function") {
46288
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46289
- get: () => from[key],
46290
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46291
- });
46292
- }
46293
- return to;
46294
- };
46295
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46296
- var db_connections_exports = {};
46297
- __export(db_connections_exports, {
46298
- attachDatabasePool: () => attachDatabasePool,
46299
- experimental_attachDatabasePool: () => experimental_attachDatabasePool
46300
- });
46301
- module.exports = __toCommonJS(db_connections_exports);
46302
- var import_get_context = require_get_context();
46303
- const DEBUG = !!process.env.DEBUG;
46304
- function getIdleTimeout(dbPool) {
46305
- if ("options" in dbPool && dbPool.options) {
46306
- if ("idleTimeoutMillis" in dbPool.options) return typeof dbPool.options.idleTimeoutMillis === "number" ? dbPool.options.idleTimeoutMillis : 1e4;
46307
- if ("maxIdleTimeMS" in dbPool.options) return typeof dbPool.options.maxIdleTimeMS === "number" ? dbPool.options.maxIdleTimeMS : 0;
46308
- if ("status" in dbPool) return 5e3;
46309
- if ("connect" in dbPool && "execute" in dbPool) return 3e4;
46310
- }
46311
- if ("config" in dbPool && dbPool.config) {
46312
- if ("connectionConfig" in dbPool.config && dbPool.config.connectionConfig) return dbPool.config.connectionConfig.idleTimeout || 6e4;
46313
- if ("idleTimeout" in dbPool.config) return typeof dbPool.config.idleTimeout === "number" ? dbPool.config.idleTimeout : 6e4;
46314
- }
46315
- if ("poolTimeout" in dbPool) return typeof dbPool.poolTimeout === "number" ? dbPool.poolTimeout : 6e4;
46316
- if ("idleTimeout" in dbPool) return typeof dbPool.idleTimeout === "number" ? dbPool.idleTimeout : 0;
46317
- return 1e4;
46318
- }
46319
- let idleTimeout = null;
46320
- let idleTimeoutResolve = () => {};
46321
- const bootTime = Date.now();
46322
- const maximumDuration = 900 * 1e3 - 1e3;
46323
- function waitUntilIdleTimeout(dbPool) {
46324
- if (!process.env.VERCEL_URL) return;
46325
- if (idleTimeout) {
46326
- clearTimeout(idleTimeout);
46327
- idleTimeoutResolve();
46328
- }
46329
- const promise = new Promise((resolve) => {
46330
- idleTimeoutResolve = resolve;
46331
- });
46332
- const waitTime = Math.min(getIdleTimeout(dbPool) + 100, maximumDuration - (Date.now() - bootTime));
46333
- idleTimeout = setTimeout(() => {
46334
- idleTimeoutResolve?.();
46335
- if (DEBUG) console.log("Database pool idle timeout reached. Releasing connections.");
46336
- }, waitTime);
46337
- const requestContext = (0, import_get_context.getContext)();
46338
- if (requestContext?.waitUntil) requestContext.waitUntil(promise);
46339
- else console.warn("Pool release event triggered outside of request scope.");
46340
- }
46341
- function attachDatabasePool(dbPool) {
46342
- if (idleTimeout) {
46343
- idleTimeoutResolve?.();
46344
- clearTimeout(idleTimeout);
46345
- }
46346
- if ("on" in dbPool && dbPool.on && "options" in dbPool && "idleTimeoutMillis" in dbPool.options) {
46347
- dbPool.on("release", () => {
46348
- if (DEBUG) console.log("Client released from pool");
46349
- waitUntilIdleTimeout(dbPool);
46350
- });
46351
- return;
46352
- } else if ("on" in dbPool && dbPool.on && "config" in dbPool && dbPool.config && "connectionConfig" in dbPool.config) {
46353
- dbPool.on("release", () => {
46354
- if (DEBUG) console.log("MySQL client released from pool");
46355
- waitUntilIdleTimeout(dbPool);
46356
- });
46357
- return;
46358
- } else if ("on" in dbPool && dbPool.on && "config" in dbPool && dbPool.config && "idleTimeout" in dbPool.config) {
46359
- dbPool.on("release", () => {
46360
- if (DEBUG) console.log("MySQL2/MariaDB client released from pool");
46361
- waitUntilIdleTimeout(dbPool);
46362
- });
46363
- return;
46364
- }
46365
- if ("on" in dbPool && dbPool.on && "options" in dbPool && dbPool.options && "maxIdleTimeMS" in dbPool.options) {
46366
- dbPool.on("connectionCheckedOut", () => {
46367
- if (DEBUG) console.log("MongoDB connection checked out");
46368
- waitUntilIdleTimeout(dbPool);
46369
- });
46370
- return;
46371
- }
46372
- if ("on" in dbPool && dbPool.on && "options" in dbPool && dbPool.options && "socket" in dbPool.options) {
46373
- dbPool.on("end", () => {
46374
- if (DEBUG) console.log("Redis connection ended");
46375
- waitUntilIdleTimeout(dbPool);
46376
- });
46377
- return;
46378
- }
46379
- throw new Error("Unsupported database pool type");
46380
- }
46381
- const experimental_attachDatabasePool = attachDatabasePool;
46382
- 0 && (module.exports = {
46383
- attachDatabasePool,
46384
- experimental_attachDatabasePool
46385
- });
46386
- }));
46387
- //#endregion
46388
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/index.js
46389
- var require_functions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46390
- var __defProp = Object.defineProperty;
46391
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46392
- var __getOwnPropNames = Object.getOwnPropertyNames;
46393
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46394
- var __export = (target, all) => {
46395
- for (var name in all) __defProp(target, name, {
46396
- get: all[name],
46397
- enumerable: true
46398
- });
46399
- };
46400
- var __copyProps = (to, from, except, desc) => {
46401
- if (from && typeof from === "object" || typeof from === "function") {
46402
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46403
- get: () => from[key],
46404
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46405
- });
46406
- }
46407
- return to;
46408
- };
46409
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46410
- var src_exports = {};
46411
- __export(src_exports, {
46412
- attachDatabasePool: () => import_db_connections.attachDatabasePool,
46413
- experimental_attachDatabasePool: () => import_db_connections.experimental_attachDatabasePool,
46414
- geolocation: () => import_headers.geolocation,
46415
- getCache: () => import_cache.getCache,
46416
- getEnv: () => import_get_env.getEnv,
46417
- ipAddress: () => import_headers.ipAddress,
46418
- next: () => import_middleware.next,
46419
- rewrite: () => import_middleware.rewrite,
46420
- waitUntil: () => import_wait_until.waitUntil
46421
- });
46422
- module.exports = __toCommonJS(src_exports);
46423
- var import_headers = require_headers();
46424
- var import_get_env = require_get_env();
46425
- var import_wait_until = require_wait_until();
46426
- var import_middleware = require_middleware();
46427
- var import_cache = require_cache();
46428
- var import_db_connections = require_db_connections();
46429
- 0 && (module.exports = {
46430
- attachDatabasePool,
46431
- experimental_attachDatabasePool,
46432
- geolocation,
46433
- getCache,
46434
- getEnv,
46435
- ipAddress,
46436
- next,
46437
- rewrite,
46438
- waitUntil
46439
- });
46440
- }));
46441
- //#endregion
46442
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/withAxiom.js
46443
- var require_withAxiom = /* @__PURE__ */ __commonJSMin(((exports) => {
46444
- Object.defineProperty(exports, "__esModule", { value: true });
46445
- exports.withAxiomNextConfig = withAxiomNextConfig;
46446
- exports.withAxiomRouteHandler = withAxiomRouteHandler;
46447
- exports.withAxiom = withAxiom;
46448
- const functions_1 = require_functions();
46449
- const config_1 = require_config();
46450
- const logger_1 = require_logger();
46451
- const shared_1 = require_shared();
46452
- function applyAxiomRewrites(nextConfig) {
46453
- return {
46454
- ...nextConfig,
46455
- rewrites: async () => {
46456
- const rewrites = await nextConfig.rewrites?.();
46457
- const webVitalsEndpoint = config_1.config.getIngestURL(shared_1.EndpointType.webVitals);
46458
- const logsEndpoint = config_1.config.getIngestURL(shared_1.EndpointType.logs);
46459
- if (!webVitalsEndpoint && !logsEndpoint) {
46460
- const log = new logger_1.Logger();
46461
- log.warn("axiom: Envvars not detected. If this is production please see https://github.com/axiomhq/next-axiom for help");
46462
- log.warn("axiom: Sending Web Vitals to /dev/null");
46463
- log.warn("axiom: Sending logs to console");
46464
- return rewrites || [];
46465
- }
46466
- const axiomRewrites = [{
46467
- source: `${config_1.config.proxyPath}/web-vitals`,
46468
- destination: webVitalsEndpoint,
46469
- basePath: false
46470
- }, {
46471
- source: `${config_1.config.proxyPath}/logs`,
46472
- destination: logsEndpoint,
46473
- basePath: false
46474
- }];
46475
- if (!rewrites) return axiomRewrites;
46476
- else if (Array.isArray(rewrites)) return rewrites.concat(axiomRewrites);
46477
- else {
46478
- rewrites.afterFiles = (rewrites.afterFiles || []).concat(axiomRewrites);
46479
- return rewrites;
46480
- }
46481
- }
46482
- };
46483
- }
46484
- function withAxiomNextConfig(nextConfigOrFn) {
46485
- if (typeof nextConfigOrFn === "function") return async (phase, ctx) => {
46486
- const nextConfig = await nextConfigOrFn(phase, ctx);
46487
- return applyAxiomRewrites(Object.assign({}, nextConfig));
46488
- };
46489
- return applyAxiomRewrites(Object.assign({}, nextConfigOrFn));
46490
- }
46491
- function withAxiomRouteHandler(handler, config) {
46492
- return async (req, arg) => {
46493
- let region = "";
46494
- if ("geo" in req) region = req.geo?.region ?? "";
46495
- let pathname = "";
46496
- if ("nextUrl" in req) pathname = req.nextUrl.pathname;
46497
- else if (req instanceof Request) pathname = new URL(req.url).pathname;
46498
- const requestDetails = Array.isArray(config?.logRequestDetails) || config?.logRequestDetails === true ? await (0, shared_1.requestToJSON)(req) : void 0;
46499
- const report = {
46500
- startTime: (/* @__PURE__ */ new Date()).getTime(),
46501
- endTime: (/* @__PURE__ */ new Date()).getTime(),
46502
- path: pathname,
46503
- method: req.method,
46504
- host: req.headers.get("host"),
46505
- userAgent: req.headers.get("user-agent"),
46506
- scheme: req.url.split("://")[0],
46507
- ip: req.headers.get("x-forwarded-for"),
46508
- region,
46509
- details: Array.isArray(config?.logRequestDetails) ? Object.fromEntries(Object.entries(requestDetails).filter(([key]) => (config?.logRequestDetails).includes(key))) : requestDetails
46510
- };
46511
- const logger = new logger_1.Logger({
46512
- req: report,
46513
- source: config_1.isEdgeRuntime ? "edge" : "lambda"
46514
- });
46515
- const log = logger.with({});
46516
- log.config.source = `${config_1.isEdgeRuntime ? "edge" : "lambda"}${!config_1.isVercelIntegration ? "-log" : ""}`;
46517
- const axiomContext = req;
46518
- const args = arg;
46519
- axiomContext.log = log;
46520
- try {
46521
- const result = await handler(axiomContext, args);
46522
- report.endTime = (/* @__PURE__ */ new Date()).getTime();
46523
- report.statusCode = result.status;
46524
- report.durationMs = report.endTime - report.startTime;
46525
- if (!config_1.isVercelIntegration) logger.logHttpRequest(logger_1.LogLevel.info, `${req.method} ${report.path} ${report.statusCode} in ${report.endTime - report.startTime}ms`, report, {});
46526
- log.attachResponseStatus(result.status);
46527
- if (config_1.isVercel) (0, functions_1.waitUntil)(logger.flush());
46528
- else await logger.flush();
46529
- return result;
46530
- } catch (error) {
46531
- report.endTime = (/* @__PURE__ */ new Date()).getTime();
46532
- let statusCode = 500;
46533
- let logLevel = logger_1.LogLevel.error;
46534
- if (error instanceof Error) {
46535
- if (error.message === "NEXT_NOT_FOUND") {
46536
- logLevel = config?.notFoundLogLevel ?? logger_1.LogLevel.warn;
46537
- statusCode = 404;
46538
- } else if (error.message === "NEXT_REDIRECT") {
46539
- logLevel = config?.redirectLogLevel ?? logger_1.LogLevel.info;
46540
- const e = error;
46541
- if (e.digest) {
46542
- const d = e.digest.split(";");
46543
- statusCode = parseInt(d[3]);
46544
- } else statusCode = 307;
46545
- }
46546
- }
46547
- report.statusCode = statusCode;
46548
- report.durationMs = report.endTime - report.startTime;
46549
- if (!config_1.isVercelIntegration) logger.logHttpRequest(logLevel, `${req.method} ${report.path} ${report.statusCode} in ${report.endTime - report.startTime}ms`, report, {});
46550
- log.log(logLevel, error.message, { error });
46551
- log.attachResponseStatus(statusCode);
46552
- if (config_1.isVercel) (0, functions_1.waitUntil)(logger.flush());
46553
- else await logger.flush();
46554
- throw error;
46555
- }
46556
- };
46557
- }
46558
- function isNextConfig(param) {
46559
- return typeof param == "object";
46560
- }
46561
- function isNextConfigFn(param) {
46562
- return typeof param === "function" && param.length === 2;
46563
- }
46564
- function withAxiom(param, config) {
46565
- if (typeof param == "function") {
46566
- if (isNextConfigFn(param)) return withAxiomNextConfig(param);
46567
- return withAxiomRouteHandler(param, config);
46568
- } else if (isNextConfig(param)) return withAxiomNextConfig(param);
46569
- return withAxiomRouteHandler(param, config);
46570
- }
46571
- }));
46572
- //#endregion
46573
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/webVitals/webVitals.js
46574
- var require_webVitals$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
46575
- Object.defineProperty(exports, "__esModule", { value: true });
46576
- exports.reportWebVitalsWithPath = reportWebVitalsWithPath;
46577
- const config_1 = require_config();
46578
- const shared_1 = require_shared();
46579
- const url = config_1.config.getWebVitalsEndpoint();
46580
- const throttledSendMetrics = (0, shared_1.throttle)(sendMetrics, 1e3);
46581
- let collectedMetrics = [];
46582
- function reportWebVitalsWithPath(metric, route) {
46583
- collectedMetrics.push({
46584
- route,
46585
- ...metric
46586
- });
46587
- if (!config_1.config.isEnvVarsSet()) return;
46588
- throttledSendMetrics();
46589
- }
46590
- function sendMetrics() {
46591
- const body = JSON.stringify(config_1.config.wrapWebVitalsObject(collectedMetrics));
46592
- const headers = {
46593
- "Content-Type": "application/json",
46594
- "User-Agent": "next-axiom/v" + config_1.Version
46595
- };
46596
- if (config_1.config.token) headers["Authorization"] = `Bearer ${config_1.config.token}`;
46597
- const reqOptions = {
46598
- body,
46599
- method: "POST",
46600
- keepalive: true,
46601
- headers
46602
- };
46603
- function sendFallback() {
46604
- fetch(url, reqOptions).catch(console.error);
46605
- }
46606
- if (config_1.isBrowser && config_1.isVercelIntegration && navigator.sendBeacon) try {
46607
- navigator.sendBeacon.bind(navigator)(url, body);
46608
- } catch (err) {
46609
- sendFallback();
46610
- }
46611
- else sendFallback();
46612
- collectedMetrics = [];
46613
- }
46614
- }));
46615
- //#endregion
46616
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/webVitals/components.js
46617
- var require_components = /* @__PURE__ */ __commonJSMin(((exports) => {
46618
- var __importDefault = exports && exports.__importDefault || function(mod) {
46619
- return mod && mod.__esModule ? mod : { "default": mod };
46620
- };
46621
- Object.defineProperty(exports, "__esModule", { value: true });
46622
- exports.AxiomWebVitals = AxiomWebVitals;
46623
- const react_1$2 = __importDefault(__require("react"));
46624
- const _1 = require_webVitals();
46625
- function AxiomWebVitals({ path }) {
46626
- (0, _1.useReportWebVitals)(path);
46627
- return react_1$2.default.createElement(react_1$2.default.Fragment, null);
46628
- }
46629
- }));
46630
- //#endregion
46631
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/webVitals/index.js
46632
- var require_webVitals = /* @__PURE__ */ __commonJSMin(((exports) => {
46633
- Object.defineProperty(exports, "__esModule", { value: true });
46634
- exports.AxiomWebVitals = void 0;
46635
- exports.useReportWebVitals = useReportWebVitals;
46636
- const navigation_1$1 = __require("next/navigation.js");
46637
- const web_vitals_1 = __require("next/web-vitals.js");
46638
- const webVitals_1 = require_webVitals$1();
46639
- const react_1$1 = __require("react");
46640
- var components_1 = require_components();
46641
- Object.defineProperty(exports, "AxiomWebVitals", {
46642
- enumerable: true,
46643
- get: function() {
46644
- return components_1.AxiomWebVitals;
46645
- }
46646
- });
46647
- function useReportWebVitals(path) {
46648
- const pathName = (0, navigation_1$1.usePathname)();
46649
- /**
46650
- * Refs allows us to stabilize the path name so that we can properly stabilize the reportWebVitalsFn
46651
- */
46652
- const stabilizedPath = (0, react_1$1.useRef)(path || pathName);
46653
- /**
46654
- * If the path changes, we update the stabilizedPath ref
46655
- */
46656
- if (typeof path === "string" && path !== stabilizedPath.current) stabilizedPath.current = pathName;
46657
- else if (typeof path === "string" && path === stabilizedPath.current) stabilizedPath.current = path;
46658
- /**
46659
- * Stabilizing the reportWebVitalsFn avoids reporting the same metrics from multiple paths, it happens because internally
46660
- * the useReportWebVitals from next uses a useEffect to report the metrics, and the reportWebVitalsFn is passed as a dependency
46661
- * to the useEffect, so when the path changes, the useEffect is re-run, and the same metrics are reported again.
46662
- */
46663
- const reportWebVitalsFn = (0, react_1$1.useCallback)((metric) => (0, webVitals_1.reportWebVitalsWithPath)(metric, stabilizedPath.current), []);
46664
- (0, web_vitals_1.useReportWebVitals)(reportWebVitalsFn);
46665
- }
46666
- }));
46667
- //#endregion
46668
- //#region ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js
46669
- var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
46670
- var has = Object.prototype.hasOwnProperty;
46671
- function find(iter, tar, key) {
46672
- for (key of iter.keys()) if (dequal(key, tar)) return key;
46673
- }
46674
- function dequal(foo, bar) {
46675
- var ctor, len, tmp;
46676
- if (foo === bar) return true;
46677
- if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
46678
- if (ctor === Date) return foo.getTime() === bar.getTime();
46679
- if (ctor === RegExp) return foo.toString() === bar.toString();
46680
- if (ctor === Array) {
46681
- if ((len = foo.length) === bar.length) while (len-- && dequal(foo[len], bar[len]));
46682
- return len === -1;
46683
- }
46684
- if (ctor === Set) {
46685
- if (foo.size !== bar.size) return false;
46686
- for (len of foo) {
46687
- tmp = len;
46688
- if (tmp && typeof tmp === "object") {
46689
- tmp = find(bar, tmp);
46690
- if (!tmp) return false;
46691
- }
46692
- if (!bar.has(tmp)) return false;
46693
- }
46694
- return true;
46695
- }
46696
- if (ctor === Map) {
46697
- if (foo.size !== bar.size) return false;
46698
- for (len of foo) {
46699
- tmp = len[0];
46700
- if (tmp && typeof tmp === "object") {
46701
- tmp = find(bar, tmp);
46702
- if (!tmp) return false;
46703
- }
46704
- if (!dequal(len[1], bar.get(tmp))) return false;
46705
- }
46706
- return true;
46707
- }
46708
- if (ctor === ArrayBuffer) {
46709
- foo = new Uint8Array(foo);
46710
- bar = new Uint8Array(bar);
46711
- } else if (ctor === DataView) {
46712
- if ((len = foo.byteLength) === bar.byteLength) while (len-- && foo.getInt8(len) === bar.getInt8(len));
46713
- return len === -1;
46714
- }
46715
- if (ArrayBuffer.isView(foo)) {
46716
- if ((len = foo.byteLength) === bar.byteLength) while (len-- && foo[len] === bar[len]);
46717
- return len === -1;
46718
- }
46719
- if (!ctor || typeof foo === "object") {
46720
- len = 0;
46721
- for (ctor in foo) {
46722
- if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
46723
- if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
46724
- }
46725
- return Object.keys(bar).length === len;
46726
- }
46727
- }
46728
- return foo !== foo && bar !== bar;
46729
- }
46730
- exports.dequal = dequal;
46731
- }));
46732
- //#endregion
46733
- //#region ../../node_modules/.pnpm/use-deep-compare@1.3.0_react@19.2.7/node_modules/use-deep-compare/dist-node/index.js
46734
- var require_dist_node = /* @__PURE__ */ __commonJSMin(((exports) => {
46735
- Object.defineProperty(exports, "__esModule", { value: true });
46736
- function _interopDefault(ex) {
46737
- return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex;
46738
- }
46739
- var React$2 = _interopDefault(__require("react"));
46740
- var dequal = require_dist$1();
46741
- function useDeepCompareMemoize(dependencies) {
46742
- const dependenciesRef = React$2.useRef(dependencies);
46743
- const signalRef = React$2.useRef(0);
46744
- if (!dequal.dequal(dependencies, dependenciesRef.current)) {
46745
- dependenciesRef.current = dependencies;
46746
- signalRef.current += 1;
46747
- }
46748
- return React$2.useMemo(() => dependenciesRef.current, [signalRef.current]);
46749
- }
46750
- /**
46751
- * `useDeepCompareCallback` will return a memoized version of the callback that
46752
- * only changes if one of the `dependencies` has changed.
46753
- *
46754
- * Warning: `useDeepCompareCallback` should not be used with dependencies that
46755
- * are all primitive values. Use `React.useCallback` instead.
46756
- *
46757
- * @see {@link https://react.dev/reference/react/useCallback}
46758
- */
46759
- function useDeepCompareCallback(callback, dependencies) {
46760
- return React$2.useCallback(callback, useDeepCompareMemoize(dependencies));
46761
- }
46762
- /**
46763
- * Accepts a function that contains imperative, possibly effectful code.
46764
- *
46765
- * Warning: `useDeepCompareEffect` should not be used with dependencies that
46766
- * are all primitive values. Use `React.useEffect` instead.
46767
- *
46768
- * @see {@link https://react.dev/reference/react/useEffect}
46769
- */
46770
- function useDeepCompareEffect(effect, dependencies) {
46771
- React$2.useEffect(effect, useDeepCompareMemoize(dependencies));
46772
- }
46773
- /**
46774
- * `useDeepCompareImperativeHandle` customizes the instance value that is exposed to parent components when using `ref`.
46775
- * As always, imperative code using refs should be avoided in most cases.
46776
- *
46777
- * `useDeepCompareImperativeHandle` should be used with `React.forwardRef`.
46778
- *
46779
- * It's similar to `useImperativeHandle`, but uses deep comparison on the dependencies.
46780
- *
46781
- * Warning: `useDeepCompareImperativeHandle` should not be used with dependencies that
46782
- * are all primitive values. Use `React.useImperativeHandle` instead.
46783
- *
46784
- * @see {@link https://react.dev/reference/react/useImperativeHandle}
46785
- */
46786
- function useDeepCompareImperativeHandle(ref, init, dependencies) {
46787
- React$2.useImperativeHandle(ref, init, useDeepCompareMemoize(dependencies));
46788
- }
46789
- /**
46790
- * The signature is identical to `useDeepCompareEffect`, but it fires synchronously after all DOM mutations.
46791
- * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
46792
- * `useDeepCompareLayoutEffect` will be flushed synchronously, before the browser has a chance to paint.
46793
- *
46794
- * Prefer the standard `useDeepCompareEffect` when possible to avoid blocking visual updates.
46795
- *
46796
- * If you’re migrating code from a class component, `useDeepCompareLayoutEffect` fires in the same phase as
46797
- * `componentDidMount` and `componentDidUpdate`.
46798
- *
46799
- * Warning: `useDeepCompareLayoutEffect` should not be used with dependencies that
46800
- * are all primitive values. Use `React.useLayoutEffect` instead.
46801
- *
46802
- * @see {@link https://react.dev/reference/react/useLayoutEffect}
46803
- */
46804
- function useDeepCompareLayoutEffect(effect, dependencies) {
46805
- React$2.useLayoutEffect(effect, useDeepCompareMemoize(dependencies));
46806
- }
46807
- /**
46808
- * `useDeepCompareMemo` will only recompute the memoized value when one of the
46809
- * `dependencies` has changed.
46810
- *
46811
- * Warning: `useDeepCompareMemo` should not be used with dependencies that
46812
- * are all primitive values. Use `React.useMemo` instead.
46813
- *
46814
- * @see {@link https://react.dev/reference/react/useMemo}
46815
- */
46816
- function useDeepCompareMemo(factory, dependencies) {
46817
- return React$2.useMemo(factory, useDeepCompareMemoize(dependencies));
46818
- }
46819
- exports.useDeepCompareCallback = useDeepCompareCallback;
46820
- exports.useDeepCompareEffect = useDeepCompareEffect;
46821
- exports.useDeepCompareImperativeHandle = useDeepCompareImperativeHandle;
46822
- exports.useDeepCompareLayoutEffect = useDeepCompareLayoutEffect;
46823
- exports.useDeepCompareMemo = useDeepCompareMemo;
46824
- }));
46825
- //#endregion
46826
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/hooks.js
46827
- var require_hooks = /* @__PURE__ */ __commonJSMin(((exports) => {
46828
- Object.defineProperty(exports, "__esModule", { value: true });
46829
- exports.useLogger = useLogger;
46830
- const navigation_1 = __require("next/navigation.js");
46831
- const logger_1 = require_logger();
46832
- const react_1 = __require("react");
46833
- const use_deep_compare_1 = require_dist_node();
46834
- function useLogger(config = {}) {
46835
- const path = (0, navigation_1.usePathname)();
46836
- const memoizedConfig = (0, use_deep_compare_1.useDeepCompareMemo)(() => ({
46837
- ...config,
46838
- args: {
46839
- ...config.args ?? {},
46840
- path
46841
- }
46842
- }), [config, path]);
46843
- const logger = (0, react_1.useMemo)(() => new logger_1.Logger(memoizedConfig), [memoizedConfig]);
46844
- (0, react_1.useEffect)(() => {
46845
- return () => {
46846
- if (logger) logger.flush();
46847
- };
46848
- }, [path]);
46849
- return logger;
46850
- }
46851
- }));
46852
- //#endregion
46853
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/index.js
46854
- var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
46855
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
46856
- if (k2 === void 0) k2 = k;
46857
- var desc = Object.getOwnPropertyDescriptor(m, k);
46858
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
46859
- enumerable: true,
46860
- get: function() {
46861
- return m[k];
46862
- }
46863
- };
46864
- Object.defineProperty(o, k2, desc);
46865
- }) : (function(o, m, k, k2) {
46866
- if (k2 === void 0) k2 = k;
46867
- o[k2] = m[k];
46868
- }));
46869
- var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
46870
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
46871
- };
46872
- Object.defineProperty(exports, "__esModule", { value: true });
46873
- exports.useLogger = exports.withAxiomRouteHandler = exports.withAxiomNextConfig = exports.withAxiom = exports.throttle = exports.EndpointType = exports.LogLevel = exports.Logger = exports.log = void 0;
46874
- var logger_1 = require_logger();
46875
- Object.defineProperty(exports, "log", {
46876
- enumerable: true,
46877
- get: function() {
46878
- return logger_1.log;
46879
- }
46880
- });
46881
- Object.defineProperty(exports, "Logger", {
46882
- enumerable: true,
46883
- get: function() {
46884
- return logger_1.Logger;
46885
- }
46886
- });
46887
- Object.defineProperty(exports, "LogLevel", {
46888
- enumerable: true,
46889
- get: function() {
46890
- return logger_1.LogLevel;
46891
- }
46892
- });
46893
- var shared_1 = require_shared();
46894
- Object.defineProperty(exports, "EndpointType", {
46895
- enumerable: true,
46896
- get: function() {
46897
- return shared_1.EndpointType;
46898
- }
46899
- });
46900
- Object.defineProperty(exports, "throttle", {
46901
- enumerable: true,
46902
- get: function() {
46903
- return shared_1.throttle;
46904
- }
46905
- });
46906
- __exportStar(require_base(), exports);
46907
- __exportStar(require_config(), exports);
46908
- var withAxiom_1 = require_withAxiom();
46909
- Object.defineProperty(exports, "withAxiom", {
46910
- enumerable: true,
46911
- get: function() {
46912
- return withAxiom_1.withAxiom;
46913
- }
46914
- });
46915
- Object.defineProperty(exports, "withAxiomNextConfig", {
46916
- enumerable: true,
46917
- get: function() {
46918
- return withAxiom_1.withAxiomNextConfig;
46919
- }
46920
- });
46921
- Object.defineProperty(exports, "withAxiomRouteHandler", {
46922
- enumerable: true,
46923
- get: function() {
46924
- return withAxiom_1.withAxiomRouteHandler;
46925
- }
46926
- });
46927
- __exportStar(require_webVitals(), exports);
46928
- var hooks_1 = require_hooks();
46929
- Object.defineProperty(exports, "useLogger", {
46930
- enumerable: true,
46931
- get: function() {
46932
- return hooks_1.useLogger;
46933
- }
46934
- });
46935
- }));
46936
- //#endregion
46937
44542
  //#region ../logger/src/sanitize.ts
46938
44543
  const DEFAULT_MAX_STRING_LENGTH = 2e3;
46939
44544
  const STRUCTURED_KEYS = /* @__PURE__ */ new Set([
@@ -47015,18 +44620,41 @@ function sanitizeLogFields(fields, options) {
47015
44620
  return sanitizeV2(fields, options?.maxStringLength ?? DEFAULT_MAX_STRING_LENGTH);
47016
44621
  }
47017
44622
  //#endregion
47018
- //#region ../logger/src/next.ts
47019
- var import_dist = require_dist();
47020
- function wrap(base = import_dist.log) {
44623
+ //#region ../logger/src/console.ts
44624
+ function formatLog(level, message, fields) {
44625
+ const entry = {
44626
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
44627
+ level,
44628
+ message,
44629
+ ...sanitizeLogFields(fields)
44630
+ };
44631
+ return JSON.stringify(entry);
44632
+ }
44633
+ function createLogger(baseFields = {}) {
47021
44634
  return {
47022
- debug: (message, fields) => base.debug(message, sanitizeLogFields(fields)),
47023
- info: (message, fields) => base.info(message, sanitizeLogFields(fields)),
47024
- warn: (message, fields) => base.warn(message, sanitizeLogFields(fields)),
47025
- error: (message, fields) => base.error(message, sanitizeLogFields(fields)),
47026
- withFields: (fields) => wrap(base.with(sanitizeLogFields(fields) ?? {}))
44635
+ debug: (msg, fields) => console.debug(formatLog("debug", msg, {
44636
+ ...baseFields,
44637
+ ...fields
44638
+ })),
44639
+ info: (msg, fields) => console.info(formatLog("info", msg, {
44640
+ ...baseFields,
44641
+ ...fields
44642
+ })),
44643
+ warn: (msg, fields) => console.warn(formatLog("warn", msg, {
44644
+ ...baseFields,
44645
+ ...fields
44646
+ })),
44647
+ error: (msg, fields) => console.error(formatLog("error", msg, {
44648
+ ...baseFields,
44649
+ ...fields
44650
+ })),
44651
+ withFields: (fields) => createLogger({
44652
+ ...baseFields,
44653
+ ...fields
44654
+ })
47027
44655
  };
47028
44656
  }
47029
- const logger = wrap();
44657
+ const logger = createLogger();
47030
44658
  //#endregion
47031
44659
  //#region ../blocks/src/system/runtime/nodes/richText-coerce.ts
47032
44660
  function parseRichTextDoc(value) {