@powerlines/plugin-automd 0.1.341 → 0.1.343

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 (113) hide show
  1. package/README.md +14 -16
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
  3. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  4. package/dist/index.cjs +26 -27
  5. package/dist/index.d.cts +0 -1
  6. package/dist/index.d.cts.map +1 -1
  7. package/dist/index.d.mts +0 -1
  8. package/dist/index.d.mts.map +1 -1
  9. package/dist/index.mjs +5 -6
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/types/plugin.d.cts.map +1 -1
  12. package/dist/types/plugin.d.mts +1 -1
  13. package/dist/types/plugin.d.mts.map +1 -1
  14. package/dist/types/toc.d.cts.map +1 -1
  15. package/dist/types/toc.d.mts.map +1 -1
  16. package/package.json +20 -18
  17. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  18. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -78
  19. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -78
  20. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  21. package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.cjs +0 -5089
  22. package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs +0 -5089
  23. package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs.map +0 -1
  24. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.cjs +0 -654
  25. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.mjs +0 -652
  26. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.mjs.map +0 -1
  27. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +0 -23
  28. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +0 -23
  29. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +0 -1
  30. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +0 -10
  31. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +0 -11
  32. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +0 -1
  33. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +0 -388
  34. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +0 -388
  35. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +0 -1
  36. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +0 -11
  37. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +0 -12
  38. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +0 -1
  39. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
  40. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -46
  41. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +0 -1
  42. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +0 -204
  43. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +0 -203
  44. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs.map +0 -1
  45. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
  46. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1008
  47. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +0 -1
  48. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +0 -128
  49. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +0 -124
  50. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs.map +0 -1
  51. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs +0 -41464
  52. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +0 -41462
  53. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs.map +0 -1
  54. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +0 -4387
  55. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +0 -4385
  56. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs.map +0 -1
  57. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +0 -26
  58. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +0 -27
  59. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs.map +0 -1
  60. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +0 -370
  61. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +0 -368
  62. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs.map +0 -1
  63. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -939
  64. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -940
  65. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +0 -1
  66. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +0 -67
  67. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +0 -65
  68. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.cjs +0 -1350
  70. package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.mjs +0 -1343
  71. package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.mjs.map +0 -1
  72. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -179
  73. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -178
  74. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -20
  76. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -17
  77. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +0 -1
  78. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3975
  79. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3962
  80. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +0 -16
  82. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -15
  83. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs.map +0 -1
  84. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +0 -36
  85. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +0 -34
  86. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs +0 -227
  88. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +0 -226
  89. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs.map +0 -1
  90. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -139
  91. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -134
  92. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -78
  94. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -78
  95. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +0 -1
  96. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs +0 -72
  97. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +0 -70
  98. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs +0 -181
  100. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs +0 -179
  101. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs.map +0 -1
  102. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +0 -12337
  103. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +0 -12338
  104. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +0 -19
  106. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +0 -19
  107. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs.map +0 -1
  108. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +0 -71
  109. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +0 -72
  110. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +0 -110
  112. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +0 -101
  113. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs.map +0 -1
@@ -1,36 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('../../../../node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs');
3
- const require_ofetch_CWycOUEr = require('./shared/ofetch.CWycOUEr.cjs');
4
- let node_http = require("node:http");
5
- node_http = require_rolldown_runtime.__toESM(node_http);
6
- let node_https = require("node:https");
7
- node_https = require_rolldown_runtime.__toESM(node_https);
8
-
9
- //#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
10
- function createNodeFetch() {
11
- if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return require_index.r;
12
- const agentOptions = { keepAlive: true };
13
- const httpAgent = new node_http.default.Agent(agentOptions);
14
- const httpsAgent = new node_https.default.Agent(agentOptions);
15
- const nodeFetchOptions = { agent(parsedURL) {
16
- return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
17
- } };
18
- return function nodeFetchWithKeepAlive(input, init) {
19
- return require_index.r(input, {
20
- ...nodeFetchOptions,
21
- ...init
22
- });
23
- };
24
- }
25
- const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
26
- const Headers = globalThis.Headers || require_index.n;
27
- const AbortController = globalThis.AbortController || require_index.T;
28
- const ofetch = require_ofetch_CWycOUEr.createFetch({
29
- fetch,
30
- Headers,
31
- AbortController
32
- });
33
- const $fetch = ofetch;
34
-
35
- //#endregion
36
- exports.$fetch = $fetch;
@@ -1,34 +0,0 @@
1
- import { T, n, r } from "../../../../node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs";
2
- import { FetchError, createFetch, createFetchError } from "./shared/ofetch.CWycOUEr.mjs";
3
- import http from "node:http";
4
- import https from "node:https";
5
-
6
- //#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
7
- function createNodeFetch() {
8
- if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return r;
9
- const agentOptions = { keepAlive: true };
10
- const httpAgent = new http.Agent(agentOptions);
11
- const httpsAgent = new https.Agent(agentOptions);
12
- const nodeFetchOptions = { agent(parsedURL) {
13
- return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
14
- } };
15
- return function nodeFetchWithKeepAlive(input, init) {
16
- return r(input, {
17
- ...nodeFetchOptions,
18
- ...init
19
- });
20
- };
21
- }
22
- const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();
23
- const Headers = globalThis.Headers || n;
24
- const AbortController = globalThis.AbortController || T;
25
- const ofetch = createFetch({
26
- fetch,
27
- Headers,
28
- AbortController
29
- });
30
- const $fetch = ofetch;
31
-
32
- //#endregion
33
- export { $fetch };
34
- //# sourceMappingURL=node.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.mjs","names":["nodeFetch","Headers$1","AbortController$1"],"sources":["../../../../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs"],"sourcesContent":["import http from 'node:http';\nimport https from 'node:https';\nimport nodeFetch, { AbortController as AbortController$1, Headers as Headers$1 } from 'node-fetch-native';\nimport { c as createFetch } from './shared/ofetch.CWycOUEr.mjs';\nexport { F as FetchError, a as createFetchError } from './shared/ofetch.CWycOUEr.mjs';\nimport 'destr';\nimport 'ufo';\n\nfunction createNodeFetch() {\n const useKeepAlive = JSON.parse(process.env.FETCH_KEEP_ALIVE || \"false\");\n if (!useKeepAlive) {\n return nodeFetch;\n }\n const agentOptions = { keepAlive: true };\n const httpAgent = new http.Agent(agentOptions);\n const httpsAgent = new https.Agent(agentOptions);\n const nodeFetchOptions = {\n agent(parsedURL) {\n return parsedURL.protocol === \"http:\" ? httpAgent : httpsAgent;\n }\n };\n return function nodeFetchWithKeepAlive(input, init) {\n return nodeFetch(input, { ...nodeFetchOptions, ...init });\n };\n}\nconst fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch();\nconst Headers = globalThis.Headers || Headers$1;\nconst AbortController = globalThis.AbortController || AbortController$1;\nconst ofetch = createFetch({ fetch, Headers, AbortController });\nconst $fetch = ofetch;\n\nexport { $fetch, AbortController, Headers, createFetch, createNodeFetch, fetch, ofetch };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAQA,SAAS,kBAAkB;AAEzB,KAAI,CADiB,KAAK,MAAM,QAAQ,IAAI,oBAAoB,QAAQ,CAEtE,QAAOA;CAET,MAAM,eAAe,EAAE,WAAW,MAAM;CACxC,MAAM,YAAY,IAAI,KAAK,MAAM,aAAa;CAC9C,MAAM,aAAa,IAAI,MAAM,MAAM,aAAa;CAChD,MAAM,mBAAmB,EACvB,MAAM,WAAW;AACf,SAAO,UAAU,aAAa,UAAU,YAAY;IAEvD;AACD,QAAO,SAAS,uBAAuB,OAAO,MAAM;AAClD,SAAOA,EAAU,OAAO;GAAE,GAAG;GAAkB,GAAG;GAAM,CAAC;;;AAG7D,MAAM,QAAQ,WAAW,SAAS,GAAG,SAAS,WAAW,MAAM,GAAG,KAAK,GAAG,iBAAiB;AAC3F,MAAM,UAAU,WAAW,WAAWC;AACtC,MAAM,kBAAkB,WAAW,mBAAmBC;AACtD,MAAM,SAAS,YAAY;CAAE;CAAO;CAAS;CAAiB,CAAC;AAC/D,MAAM,SAAS"}
@@ -1,227 +0,0 @@
1
- const require_index = require('../../../../../ufo@1.6.3/node_modules/ufo/dist/index.cjs');
2
- const require_index$1 = require('../../../../../destr@2.0.5/node_modules/destr/dist/index.cjs');
3
-
4
- //#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
5
- var FetchError = class extends Error {
6
- constructor(message, opts) {
7
- super(message, opts);
8
- this.name = "FetchError";
9
- if (opts?.cause && !this.cause) this.cause = opts.cause;
10
- }
11
- };
12
- function createFetchError(ctx) {
13
- const errorMessage = ctx.error?.message || ctx.error?.toString() || "";
14
- const method = ctx.request?.method || ctx.options?.method || "GET";
15
- const url = ctx.request?.url || String(ctx.request) || "/";
16
- const fetchError = new FetchError(`${`[${method}] ${JSON.stringify(url)}`}: ${ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : "<no response>"}${errorMessage ? ` ${errorMessage}` : ""}`, ctx.error ? { cause: ctx.error } : void 0);
17
- for (const key of [
18
- "request",
19
- "options",
20
- "response"
21
- ]) Object.defineProperty(fetchError, key, { get() {
22
- return ctx[key];
23
- } });
24
- for (const [key, refKey] of [
25
- ["data", "_data"],
26
- ["status", "status"],
27
- ["statusCode", "status"],
28
- ["statusText", "statusText"],
29
- ["statusMessage", "statusText"]
30
- ]) Object.defineProperty(fetchError, key, { get() {
31
- return ctx.response && ctx.response[refKey];
32
- } });
33
- return fetchError;
34
- }
35
- const payloadMethods = new Set(Object.freeze([
36
- "PATCH",
37
- "POST",
38
- "PUT",
39
- "DELETE"
40
- ]));
41
- function isPayloadMethod(method = "GET") {
42
- return payloadMethods.has(method.toUpperCase());
43
- }
44
- function isJSONSerializable(value) {
45
- if (value === void 0) return false;
46
- const t = typeof value;
47
- if (t === "string" || t === "number" || t === "boolean" || t === null) return true;
48
- if (t !== "object") return false;
49
- if (Array.isArray(value)) return true;
50
- if (value.buffer) return false;
51
- if (value instanceof FormData || value instanceof URLSearchParams) return false;
52
- return value.constructor && value.constructor.name === "Object" || typeof value.toJSON === "function";
53
- }
54
- const textTypes = /* @__PURE__ */ new Set([
55
- "image/svg",
56
- "application/xml",
57
- "application/xhtml",
58
- "application/html"
59
- ]);
60
- const JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
61
- function detectResponseType(_contentType = "") {
62
- if (!_contentType) return "json";
63
- const contentType = _contentType.split(";").shift() || "";
64
- if (JSON_RE.test(contentType)) return "json";
65
- if (contentType === "text/event-stream") return "stream";
66
- if (textTypes.has(contentType) || contentType.startsWith("text/")) return "text";
67
- return "blob";
68
- }
69
- function resolveFetchOptions(request, input, defaults, Headers) {
70
- const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers);
71
- let query;
72
- if (defaults?.query || defaults?.params || input?.params || input?.query) query = {
73
- ...defaults?.params,
74
- ...defaults?.query,
75
- ...input?.params,
76
- ...input?.query
77
- };
78
- return {
79
- ...defaults,
80
- ...input,
81
- query,
82
- params: query,
83
- headers
84
- };
85
- }
86
- function mergeHeaders(input, defaults, Headers) {
87
- if (!defaults) return new Headers(input);
88
- const headers = new Headers(defaults);
89
- if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) headers.set(key, value);
90
- return headers;
91
- }
92
- async function callHooks(context, hooks) {
93
- if (hooks) if (Array.isArray(hooks)) for (const hook of hooks) await hook(context);
94
- else await hooks(context);
95
- }
96
- const retryStatusCodes = /* @__PURE__ */ new Set([
97
- 408,
98
- 409,
99
- 425,
100
- 429,
101
- 500,
102
- 502,
103
- 503,
104
- 504
105
- ]);
106
- const nullBodyResponses = /* @__PURE__ */ new Set([
107
- 101,
108
- 204,
109
- 205,
110
- 304
111
- ]);
112
- function createFetch(globalOptions = {}) {
113
- const { fetch = globalThis.fetch, Headers = globalThis.Headers, AbortController = globalThis.AbortController } = globalOptions;
114
- async function onError(context) {
115
- const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false;
116
- if (context.options.retry !== false && !isAbort) {
117
- let retries;
118
- if (typeof context.options.retry === "number") retries = context.options.retry;
119
- else retries = isPayloadMethod(context.options.method) ? 0 : 1;
120
- const responseCode = context.response && context.response.status || 500;
121
- if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {
122
- const retryDelay = typeof context.options.retryDelay === "function" ? context.options.retryDelay(context) : context.options.retryDelay || 0;
123
- if (retryDelay > 0) await new Promise((resolve) => setTimeout(resolve, retryDelay));
124
- return $fetchRaw(context.request, {
125
- ...context.options,
126
- retry: retries - 1
127
- });
128
- }
129
- }
130
- const error = createFetchError(context);
131
- if (Error.captureStackTrace) Error.captureStackTrace(error, $fetchRaw);
132
- throw error;
133
- }
134
- const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
135
- const context = {
136
- request: _request,
137
- options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers),
138
- response: void 0,
139
- error: void 0
140
- };
141
- if (context.options.method) context.options.method = context.options.method.toUpperCase();
142
- if (context.options.onRequest) {
143
- await callHooks(context, context.options.onRequest);
144
- if (!(context.options.headers instanceof Headers)) context.options.headers = new Headers(context.options.headers || {});
145
- }
146
- if (typeof context.request === "string") {
147
- if (context.options.baseURL) context.request = require_index.withBase(context.request, context.options.baseURL);
148
- if (context.options.query) {
149
- context.request = require_index.withQuery(context.request, context.options.query);
150
- delete context.options.query;
151
- }
152
- if ("query" in context.options) delete context.options.query;
153
- if ("params" in context.options) delete context.options.params;
154
- }
155
- if (context.options.body && isPayloadMethod(context.options.method)) {
156
- if (isJSONSerializable(context.options.body)) {
157
- const contentType = context.options.headers.get("content-type");
158
- if (typeof context.options.body !== "string") context.options.body = contentType === "application/x-www-form-urlencoded" ? new URLSearchParams(context.options.body).toString() : JSON.stringify(context.options.body);
159
- if (!contentType) context.options.headers.set("content-type", "application/json");
160
- if (!context.options.headers.has("accept")) context.options.headers.set("accept", "application/json");
161
- } else if ("pipeTo" in context.options.body && typeof context.options.body.pipeTo === "function" || typeof context.options.body.pipe === "function") {
162
- if (!("duplex" in context.options)) context.options.duplex = "half";
163
- }
164
- }
165
- let abortTimeout;
166
- if (!context.options.signal && context.options.timeout) {
167
- const controller = new AbortController();
168
- abortTimeout = setTimeout(() => {
169
- const error = /* @__PURE__ */ new Error("[TimeoutError]: The operation was aborted due to timeout");
170
- error.name = "TimeoutError";
171
- error.code = 23;
172
- controller.abort(error);
173
- }, context.options.timeout);
174
- context.options.signal = controller.signal;
175
- }
176
- try {
177
- context.response = await fetch(context.request, context.options);
178
- } catch (error) {
179
- context.error = error;
180
- if (context.options.onRequestError) await callHooks(context, context.options.onRequestError);
181
- return await onError(context);
182
- } finally {
183
- if (abortTimeout) clearTimeout(abortTimeout);
184
- }
185
- if ((context.response.body || context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD") {
186
- const responseType = (context.options.parseResponse ? "json" : context.options.responseType) || detectResponseType(context.response.headers.get("content-type") || "");
187
- switch (responseType) {
188
- case "json": {
189
- const data = await context.response.text();
190
- const parseFunction = context.options.parseResponse || require_index$1.destr;
191
- context.response._data = parseFunction(data);
192
- break;
193
- }
194
- case "stream":
195
- context.response._data = context.response.body || context.response._bodyInit;
196
- break;
197
- default: context.response._data = await context.response[responseType]();
198
- }
199
- }
200
- if (context.options.onResponse) await callHooks(context, context.options.onResponse);
201
- if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {
202
- if (context.options.onResponseError) await callHooks(context, context.options.onResponseError);
203
- return await onError(context);
204
- }
205
- return context.response;
206
- };
207
- const $fetch = async function $fetch2(request, options) {
208
- return (await $fetchRaw(request, options))._data;
209
- };
210
- $fetch.raw = $fetchRaw;
211
- $fetch.native = (...args) => fetch(...args);
212
- $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
213
- ...globalOptions,
214
- ...customGlobalOptions,
215
- defaults: {
216
- ...globalOptions.defaults,
217
- ...customGlobalOptions.defaults,
218
- ...defaultOptions
219
- }
220
- });
221
- return $fetch;
222
- }
223
-
224
- //#endregion
225
- exports.FetchError = FetchError;
226
- exports.createFetch = createFetch;
227
- exports.createFetchError = createFetchError;
@@ -1,226 +0,0 @@
1
- import { withBase, withQuery } from "../../../../../ufo@1.6.3/node_modules/ufo/dist/index.mjs";
2
- import { destr } from "../../../../../destr@2.0.5/node_modules/destr/dist/index.mjs";
3
-
4
- //#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
5
- var FetchError = class extends Error {
6
- constructor(message, opts) {
7
- super(message, opts);
8
- this.name = "FetchError";
9
- if (opts?.cause && !this.cause) this.cause = opts.cause;
10
- }
11
- };
12
- function createFetchError(ctx) {
13
- const errorMessage = ctx.error?.message || ctx.error?.toString() || "";
14
- const method = ctx.request?.method || ctx.options?.method || "GET";
15
- const url = ctx.request?.url || String(ctx.request) || "/";
16
- const fetchError = new FetchError(`${`[${method}] ${JSON.stringify(url)}`}: ${ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : "<no response>"}${errorMessage ? ` ${errorMessage}` : ""}`, ctx.error ? { cause: ctx.error } : void 0);
17
- for (const key of [
18
- "request",
19
- "options",
20
- "response"
21
- ]) Object.defineProperty(fetchError, key, { get() {
22
- return ctx[key];
23
- } });
24
- for (const [key, refKey] of [
25
- ["data", "_data"],
26
- ["status", "status"],
27
- ["statusCode", "status"],
28
- ["statusText", "statusText"],
29
- ["statusMessage", "statusText"]
30
- ]) Object.defineProperty(fetchError, key, { get() {
31
- return ctx.response && ctx.response[refKey];
32
- } });
33
- return fetchError;
34
- }
35
- const payloadMethods = new Set(Object.freeze([
36
- "PATCH",
37
- "POST",
38
- "PUT",
39
- "DELETE"
40
- ]));
41
- function isPayloadMethod(method = "GET") {
42
- return payloadMethods.has(method.toUpperCase());
43
- }
44
- function isJSONSerializable(value) {
45
- if (value === void 0) return false;
46
- const t = typeof value;
47
- if (t === "string" || t === "number" || t === "boolean" || t === null) return true;
48
- if (t !== "object") return false;
49
- if (Array.isArray(value)) return true;
50
- if (value.buffer) return false;
51
- if (value instanceof FormData || value instanceof URLSearchParams) return false;
52
- return value.constructor && value.constructor.name === "Object" || typeof value.toJSON === "function";
53
- }
54
- const textTypes = /* @__PURE__ */ new Set([
55
- "image/svg",
56
- "application/xml",
57
- "application/xhtml",
58
- "application/html"
59
- ]);
60
- const JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
61
- function detectResponseType(_contentType = "") {
62
- if (!_contentType) return "json";
63
- const contentType = _contentType.split(";").shift() || "";
64
- if (JSON_RE.test(contentType)) return "json";
65
- if (contentType === "text/event-stream") return "stream";
66
- if (textTypes.has(contentType) || contentType.startsWith("text/")) return "text";
67
- return "blob";
68
- }
69
- function resolveFetchOptions(request, input, defaults, Headers) {
70
- const headers = mergeHeaders(input?.headers ?? request?.headers, defaults?.headers, Headers);
71
- let query;
72
- if (defaults?.query || defaults?.params || input?.params || input?.query) query = {
73
- ...defaults?.params,
74
- ...defaults?.query,
75
- ...input?.params,
76
- ...input?.query
77
- };
78
- return {
79
- ...defaults,
80
- ...input,
81
- query,
82
- params: query,
83
- headers
84
- };
85
- }
86
- function mergeHeaders(input, defaults, Headers) {
87
- if (!defaults) return new Headers(input);
88
- const headers = new Headers(defaults);
89
- if (input) for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) headers.set(key, value);
90
- return headers;
91
- }
92
- async function callHooks(context, hooks) {
93
- if (hooks) if (Array.isArray(hooks)) for (const hook of hooks) await hook(context);
94
- else await hooks(context);
95
- }
96
- const retryStatusCodes = /* @__PURE__ */ new Set([
97
- 408,
98
- 409,
99
- 425,
100
- 429,
101
- 500,
102
- 502,
103
- 503,
104
- 504
105
- ]);
106
- const nullBodyResponses = /* @__PURE__ */ new Set([
107
- 101,
108
- 204,
109
- 205,
110
- 304
111
- ]);
112
- function createFetch(globalOptions = {}) {
113
- const { fetch = globalThis.fetch, Headers = globalThis.Headers, AbortController = globalThis.AbortController } = globalOptions;
114
- async function onError(context) {
115
- const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false;
116
- if (context.options.retry !== false && !isAbort) {
117
- let retries;
118
- if (typeof context.options.retry === "number") retries = context.options.retry;
119
- else retries = isPayloadMethod(context.options.method) ? 0 : 1;
120
- const responseCode = context.response && context.response.status || 500;
121
- if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {
122
- const retryDelay = typeof context.options.retryDelay === "function" ? context.options.retryDelay(context) : context.options.retryDelay || 0;
123
- if (retryDelay > 0) await new Promise((resolve) => setTimeout(resolve, retryDelay));
124
- return $fetchRaw(context.request, {
125
- ...context.options,
126
- retry: retries - 1
127
- });
128
- }
129
- }
130
- const error = createFetchError(context);
131
- if (Error.captureStackTrace) Error.captureStackTrace(error, $fetchRaw);
132
- throw error;
133
- }
134
- const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
135
- const context = {
136
- request: _request,
137
- options: resolveFetchOptions(_request, _options, globalOptions.defaults, Headers),
138
- response: void 0,
139
- error: void 0
140
- };
141
- if (context.options.method) context.options.method = context.options.method.toUpperCase();
142
- if (context.options.onRequest) {
143
- await callHooks(context, context.options.onRequest);
144
- if (!(context.options.headers instanceof Headers)) context.options.headers = new Headers(context.options.headers || {});
145
- }
146
- if (typeof context.request === "string") {
147
- if (context.options.baseURL) context.request = withBase(context.request, context.options.baseURL);
148
- if (context.options.query) {
149
- context.request = withQuery(context.request, context.options.query);
150
- delete context.options.query;
151
- }
152
- if ("query" in context.options) delete context.options.query;
153
- if ("params" in context.options) delete context.options.params;
154
- }
155
- if (context.options.body && isPayloadMethod(context.options.method)) {
156
- if (isJSONSerializable(context.options.body)) {
157
- const contentType = context.options.headers.get("content-type");
158
- if (typeof context.options.body !== "string") context.options.body = contentType === "application/x-www-form-urlencoded" ? new URLSearchParams(context.options.body).toString() : JSON.stringify(context.options.body);
159
- if (!contentType) context.options.headers.set("content-type", "application/json");
160
- if (!context.options.headers.has("accept")) context.options.headers.set("accept", "application/json");
161
- } else if ("pipeTo" in context.options.body && typeof context.options.body.pipeTo === "function" || typeof context.options.body.pipe === "function") {
162
- if (!("duplex" in context.options)) context.options.duplex = "half";
163
- }
164
- }
165
- let abortTimeout;
166
- if (!context.options.signal && context.options.timeout) {
167
- const controller = new AbortController();
168
- abortTimeout = setTimeout(() => {
169
- const error = /* @__PURE__ */ new Error("[TimeoutError]: The operation was aborted due to timeout");
170
- error.name = "TimeoutError";
171
- error.code = 23;
172
- controller.abort(error);
173
- }, context.options.timeout);
174
- context.options.signal = controller.signal;
175
- }
176
- try {
177
- context.response = await fetch(context.request, context.options);
178
- } catch (error) {
179
- context.error = error;
180
- if (context.options.onRequestError) await callHooks(context, context.options.onRequestError);
181
- return await onError(context);
182
- } finally {
183
- if (abortTimeout) clearTimeout(abortTimeout);
184
- }
185
- if ((context.response.body || context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD") {
186
- const responseType = (context.options.parseResponse ? "json" : context.options.responseType) || detectResponseType(context.response.headers.get("content-type") || "");
187
- switch (responseType) {
188
- case "json": {
189
- const data = await context.response.text();
190
- const parseFunction = context.options.parseResponse || destr;
191
- context.response._data = parseFunction(data);
192
- break;
193
- }
194
- case "stream":
195
- context.response._data = context.response.body || context.response._bodyInit;
196
- break;
197
- default: context.response._data = await context.response[responseType]();
198
- }
199
- }
200
- if (context.options.onResponse) await callHooks(context, context.options.onResponse);
201
- if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {
202
- if (context.options.onResponseError) await callHooks(context, context.options.onResponseError);
203
- return await onError(context);
204
- }
205
- return context.response;
206
- };
207
- const $fetch = async function $fetch2(request, options) {
208
- return (await $fetchRaw(request, options))._data;
209
- };
210
- $fetch.raw = $fetchRaw;
211
- $fetch.native = (...args) => fetch(...args);
212
- $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
213
- ...globalOptions,
214
- ...customGlobalOptions,
215
- defaults: {
216
- ...globalOptions.defaults,
217
- ...customGlobalOptions.defaults,
218
- ...defaultOptions
219
- }
220
- });
221
- return $fetch;
222
- }
223
-
224
- //#endregion
225
- export { FetchError, createFetch, createFetchError };
226
- //# sourceMappingURL=ofetch.CWycOUEr.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ofetch.CWycOUEr.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs"],"sourcesContent":["import destr from 'destr';\nimport { withBase, withQuery } from 'ufo';\n\nclass FetchError extends Error {\n constructor(message, opts) {\n super(message, opts);\n this.name = \"FetchError\";\n if (opts?.cause && !this.cause) {\n this.cause = opts.cause;\n }\n }\n}\nfunction createFetchError(ctx) {\n const errorMessage = ctx.error?.message || ctx.error?.toString() || \"\";\n const method = ctx.request?.method || ctx.options?.method || \"GET\";\n const url = ctx.request?.url || String(ctx.request) || \"/\";\n const requestStr = `[${method}] ${JSON.stringify(url)}`;\n const statusStr = ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : \"<no response>\";\n const message = `${requestStr}: ${statusStr}${errorMessage ? ` ${errorMessage}` : \"\"}`;\n const fetchError = new FetchError(\n message,\n ctx.error ? { cause: ctx.error } : void 0\n );\n for (const key of [\"request\", \"options\", \"response\"]) {\n Object.defineProperty(fetchError, key, {\n get() {\n return ctx[key];\n }\n });\n }\n for (const [key, refKey] of [\n [\"data\", \"_data\"],\n [\"status\", \"status\"],\n [\"statusCode\", \"status\"],\n [\"statusText\", \"statusText\"],\n [\"statusMessage\", \"statusText\"]\n ]) {\n Object.defineProperty(fetchError, key, {\n get() {\n return ctx.response && ctx.response[refKey];\n }\n });\n }\n return fetchError;\n}\n\nconst payloadMethods = new Set(\n Object.freeze([\"PATCH\", \"POST\", \"PUT\", \"DELETE\"])\n);\nfunction isPayloadMethod(method = \"GET\") {\n return payloadMethods.has(method.toUpperCase());\n}\nfunction isJSONSerializable(value) {\n if (value === void 0) {\n return false;\n }\n const t = typeof value;\n if (t === \"string\" || t === \"number\" || t === \"boolean\" || t === null) {\n return true;\n }\n if (t !== \"object\") {\n return false;\n }\n if (Array.isArray(value)) {\n return true;\n }\n if (value.buffer) {\n return false;\n }\n if (value instanceof FormData || value instanceof URLSearchParams) {\n return false;\n }\n return value.constructor && value.constructor.name === \"Object\" || typeof value.toJSON === \"function\";\n}\nconst textTypes = /* @__PURE__ */ new Set([\n \"image/svg\",\n \"application/xml\",\n \"application/xhtml\",\n \"application/html\"\n]);\nconst JSON_RE = /^application\\/(?:[\\w!#$%&*.^`~-]*\\+)?json(;.+)?$/i;\nfunction detectResponseType(_contentType = \"\") {\n if (!_contentType) {\n return \"json\";\n }\n const contentType = _contentType.split(\";\").shift() || \"\";\n if (JSON_RE.test(contentType)) {\n return \"json\";\n }\n if (contentType === \"text/event-stream\") {\n return \"stream\";\n }\n if (textTypes.has(contentType) || contentType.startsWith(\"text/\")) {\n return \"text\";\n }\n return \"blob\";\n}\nfunction resolveFetchOptions(request, input, defaults, Headers) {\n const headers = mergeHeaders(\n input?.headers ?? request?.headers,\n defaults?.headers,\n Headers\n );\n let query;\n if (defaults?.query || defaults?.params || input?.params || input?.query) {\n query = {\n ...defaults?.params,\n ...defaults?.query,\n ...input?.params,\n ...input?.query\n };\n }\n return {\n ...defaults,\n ...input,\n query,\n params: query,\n headers\n };\n}\nfunction mergeHeaders(input, defaults, Headers) {\n if (!defaults) {\n return new Headers(input);\n }\n const headers = new Headers(defaults);\n if (input) {\n for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) {\n headers.set(key, value);\n }\n }\n return headers;\n}\nasync function callHooks(context, hooks) {\n if (hooks) {\n if (Array.isArray(hooks)) {\n for (const hook of hooks) {\n await hook(context);\n }\n } else {\n await hooks(context);\n }\n }\n}\n\nconst retryStatusCodes = /* @__PURE__ */ new Set([\n 408,\n // Request Timeout\n 409,\n // Conflict\n 425,\n // Too Early (Experimental)\n 429,\n // Too Many Requests\n 500,\n // Internal Server Error\n 502,\n // Bad Gateway\n 503,\n // Service Unavailable\n 504\n // Gateway Timeout\n]);\nconst nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]);\nfunction createFetch(globalOptions = {}) {\n const {\n fetch = globalThis.fetch,\n Headers = globalThis.Headers,\n AbortController = globalThis.AbortController\n } = globalOptions;\n async function onError(context) {\n const isAbort = context.error && context.error.name === \"AbortError\" && !context.options.timeout || false;\n if (context.options.retry !== false && !isAbort) {\n let retries;\n if (typeof context.options.retry === \"number\") {\n retries = context.options.retry;\n } else {\n retries = isPayloadMethod(context.options.method) ? 0 : 1;\n }\n const responseCode = context.response && context.response.status || 500;\n if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {\n const retryDelay = typeof context.options.retryDelay === \"function\" ? context.options.retryDelay(context) : context.options.retryDelay || 0;\n if (retryDelay > 0) {\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n }\n return $fetchRaw(context.request, {\n ...context.options,\n retry: retries - 1\n });\n }\n }\n const error = createFetchError(context);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(error, $fetchRaw);\n }\n throw error;\n }\n const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {\n const context = {\n request: _request,\n options: resolveFetchOptions(\n _request,\n _options,\n globalOptions.defaults,\n Headers\n ),\n response: void 0,\n error: void 0\n };\n if (context.options.method) {\n context.options.method = context.options.method.toUpperCase();\n }\n if (context.options.onRequest) {\n await callHooks(context, context.options.onRequest);\n if (!(context.options.headers instanceof Headers)) {\n context.options.headers = new Headers(\n context.options.headers || {}\n /* compat */\n );\n }\n }\n if (typeof context.request === \"string\") {\n if (context.options.baseURL) {\n context.request = withBase(context.request, context.options.baseURL);\n }\n if (context.options.query) {\n context.request = withQuery(context.request, context.options.query);\n delete context.options.query;\n }\n if (\"query\" in context.options) {\n delete context.options.query;\n }\n if (\"params\" in context.options) {\n delete context.options.params;\n }\n }\n if (context.options.body && isPayloadMethod(context.options.method)) {\n if (isJSONSerializable(context.options.body)) {\n const contentType = context.options.headers.get(\"content-type\");\n if (typeof context.options.body !== \"string\") {\n context.options.body = contentType === \"application/x-www-form-urlencoded\" ? new URLSearchParams(\n context.options.body\n ).toString() : JSON.stringify(context.options.body);\n }\n if (!contentType) {\n context.options.headers.set(\"content-type\", \"application/json\");\n }\n if (!context.options.headers.has(\"accept\")) {\n context.options.headers.set(\"accept\", \"application/json\");\n }\n } else if (\n // ReadableStream Body\n \"pipeTo\" in context.options.body && typeof context.options.body.pipeTo === \"function\" || // Node.js Stream Body\n typeof context.options.body.pipe === \"function\"\n ) {\n if (!(\"duplex\" in context.options)) {\n context.options.duplex = \"half\";\n }\n }\n }\n let abortTimeout;\n if (!context.options.signal && context.options.timeout) {\n const controller = new AbortController();\n abortTimeout = setTimeout(() => {\n const error = new Error(\n \"[TimeoutError]: The operation was aborted due to timeout\"\n );\n error.name = \"TimeoutError\";\n error.code = 23;\n controller.abort(error);\n }, context.options.timeout);\n context.options.signal = controller.signal;\n }\n try {\n context.response = await fetch(\n context.request,\n context.options\n );\n } catch (error) {\n context.error = error;\n if (context.options.onRequestError) {\n await callHooks(\n context,\n context.options.onRequestError\n );\n }\n return await onError(context);\n } finally {\n if (abortTimeout) {\n clearTimeout(abortTimeout);\n }\n }\n const hasBody = (context.response.body || // https://github.com/unjs/ofetch/issues/324\n // https://github.com/unjs/ofetch/issues/294\n // https://github.com/JakeChampion/fetch/issues/1454\n context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== \"HEAD\";\n if (hasBody) {\n const responseType = (context.options.parseResponse ? \"json\" : context.options.responseType) || detectResponseType(context.response.headers.get(\"content-type\") || \"\");\n switch (responseType) {\n case \"json\": {\n const data = await context.response.text();\n const parseFunction = context.options.parseResponse || destr;\n context.response._data = parseFunction(data);\n break;\n }\n case \"stream\": {\n context.response._data = context.response.body || context.response._bodyInit;\n break;\n }\n default: {\n context.response._data = await context.response[responseType]();\n }\n }\n }\n if (context.options.onResponse) {\n await callHooks(\n context,\n context.options.onResponse\n );\n }\n if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {\n if (context.options.onResponseError) {\n await callHooks(\n context,\n context.options.onResponseError\n );\n }\n return await onError(context);\n }\n return context.response;\n };\n const $fetch = async function $fetch2(request, options) {\n const r = await $fetchRaw(request, options);\n return r._data;\n };\n $fetch.raw = $fetchRaw;\n $fetch.native = (...args) => fetch(...args);\n $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({\n ...globalOptions,\n ...customGlobalOptions,\n defaults: {\n ...globalOptions.defaults,\n ...customGlobalOptions.defaults,\n ...defaultOptions\n }\n });\n return $fetch;\n}\n\nexport { FetchError as F, createFetchError as a, createFetch as c };\n"],"x_google_ignoreList":[0],"mappings":";;;;AAGA,IAAM,aAAN,cAAyB,MAAM;CAC7B,YAAY,SAAS,MAAM;AACzB,QAAM,SAAS,KAAK;AACpB,OAAK,OAAO;AACZ,MAAI,MAAM,SAAS,CAAC,KAAK,MACvB,MAAK,QAAQ,KAAK;;;AAIxB,SAAS,iBAAiB,KAAK;CAC7B,MAAM,eAAe,IAAI,OAAO,WAAW,IAAI,OAAO,UAAU,IAAI;CACpE,MAAM,SAAS,IAAI,SAAS,UAAU,IAAI,SAAS,UAAU;CAC7D,MAAM,MAAM,IAAI,SAAS,OAAO,OAAO,IAAI,QAAQ,IAAI;CAIvD,MAAM,aAAa,IAAI,WADP,GAFG,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,GAEvB,IADZ,IAAI,WAAW,GAAG,IAAI,SAAS,OAAO,GAAG,IAAI,SAAS,eAAe,kBACzC,eAAe,IAAI,iBAAiB,MAGhF,IAAI,QAAQ,EAAE,OAAO,IAAI,OAAO,GAAG,KAAK,EACzC;AACD,MAAK,MAAM,OAAO;EAAC;EAAW;EAAW;EAAW,CAClD,QAAO,eAAe,YAAY,KAAK,EACrC,MAAM;AACJ,SAAO,IAAI;IAEd,CAAC;AAEJ,MAAK,MAAM,CAAC,K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