@stillwind/integration 0.0.0-stage → 0.1.0-rc.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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -2
  3. package/dist/NPM-THIRD-PARTY-LICENSES +52 -0
  4. package/dist/astro/development.d.ts +15 -0
  5. package/dist/astro/development.js +34 -0
  6. package/dist/astro/development.js.map +1 -0
  7. package/dist/astro/index.d.ts +17 -0
  8. package/dist/astro/index.js +194 -0
  9. package/dist/astro/index.js.map +1 -0
  10. package/dist/astro/middleware.d.ts +2 -0
  11. package/dist/astro/middleware.js +64 -0
  12. package/dist/astro/middleware.js.map +1 -0
  13. package/dist/binding-files-Ds5NpyVV.js +45 -0
  14. package/dist/binding-files-Ds5NpyVV.js.map +1 -0
  15. package/dist/emission-BVi5aRbb.js +520 -0
  16. package/dist/emission-BVi5aRbb.js.map +1 -0
  17. package/dist/fresh/index.d.ts +10 -0
  18. package/dist/fresh/index.js +55 -0
  19. package/dist/fresh/index.js.map +1 -0
  20. package/dist/gen-mapping-D7jFzOEh.js +559 -0
  21. package/dist/gen-mapping-D7jFzOEh.js.map +1 -0
  22. package/dist/index-DFfbZxNT.d.ts +12 -0
  23. package/dist/next/css-loader.d.ts +14 -0
  24. package/dist/next/css-loader.js +58 -0
  25. package/dist/next/css-loader.js.map +1 -0
  26. package/dist/next/index.d.ts +15 -0
  27. package/dist/next/index.js +66 -0
  28. package/dist/next/index.js.map +1 -0
  29. package/dist/node-loader-D-3Ynpy1.d.ts +19 -0
  30. package/dist/nuxt/index.d.ts +13 -0
  31. package/dist/nuxt/index.js +64 -0
  32. package/dist/nuxt/index.js.map +1 -0
  33. package/dist/plugin-C_ZFfzo2.js +2572 -0
  34. package/dist/plugin-C_ZFfzo2.js.map +1 -0
  35. package/dist/plugin-aV0zIIAe.d.ts +278 -0
  36. package/dist/plugin-mPiBLdqa.js +79 -0
  37. package/dist/plugin-mPiBLdqa.js.map +1 -0
  38. package/dist/project-BNw0nZBE.d.ts +58 -0
  39. package/dist/project-C3IH7geC.js +182 -0
  40. package/dist/project-C3IH7geC.js.map +1 -0
  41. package/dist/project-DUGu8g_L.d.ts +15 -0
  42. package/dist/rsbuild/index.d.ts +28 -0
  43. package/dist/rsbuild/index.js +77 -0
  44. package/dist/rsbuild/index.js.map +1 -0
  45. package/dist/rspack/index.d.ts +3 -0
  46. package/dist/rspack/index.js +1 -0
  47. package/dist/rules-BvKsL2at.js +91 -0
  48. package/dist/rules-BvKsL2at.js.map +1 -0
  49. package/dist/session-B9_rp9TH.d.ts +72 -0
  50. package/dist/session-DHUCQMG5.js +117 -0
  51. package/dist/session-DHUCQMG5.js.map +1 -0
  52. package/dist/source-map-loader-CBLiYaBI.d.ts +128 -0
  53. package/dist/sveltekit/handle.d.ts +13 -0
  54. package/dist/sveltekit/handle.js +16 -0
  55. package/dist/sveltekit/handle.js.map +1 -0
  56. package/dist/trace-mapping-DV_eP3r7.d.ts +58 -0
  57. package/dist/turbopack/css-loader.d.ts +15 -0
  58. package/dist/turbopack/css-loader.js +44 -0
  59. package/dist/turbopack/css-loader.js.map +1 -0
  60. package/dist/turbopack/index.d.ts +54 -0
  61. package/dist/turbopack/index.js +1 -0
  62. package/dist/turbopack/loader.d.ts +13 -0
  63. package/dist/turbopack/loader.js +70 -0
  64. package/dist/turbopack/loader.js.map +1 -0
  65. package/dist/turbopack/node-loader.d.ts +2 -0
  66. package/dist/turbopack/node-loader.js +20 -0
  67. package/dist/turbopack/node-loader.js.map +1 -0
  68. package/dist/turbopack/stillwind-turbopack.css +0 -0
  69. package/dist/vite/index.d.ts +3 -0
  70. package/dist/vite/index.js +1 -0
  71. package/dist/vite/runtime-source-map.d.ts +19 -0
  72. package/dist/vite/runtime-source-map.js +106 -0
  73. package/dist/vite/runtime-source-map.js.map +1 -0
  74. package/dist/vite/runtime.d.ts +58 -0
  75. package/dist/vite/runtime.js +90 -0
  76. package/dist/vite/runtime.js.map +1 -0
  77. package/dist/webpack/css-loader.d.ts +17 -0
  78. package/dist/webpack/css-loader.js +36 -0
  79. package/dist/webpack/css-loader.js.map +1 -0
  80. package/dist/webpack/css-map-loader.d.ts +24 -0
  81. package/dist/webpack/css-map-loader.js +43 -0
  82. package/dist/webpack/css-map-loader.js.map +1 -0
  83. package/dist/webpack/document-loader.d.ts +12 -0
  84. package/dist/webpack/document-loader.js +19 -0
  85. package/dist/webpack/document-loader.js.map +1 -0
  86. package/dist/webpack/fragment-loader.d.ts +9 -0
  87. package/dist/webpack/fragment-loader.js +23 -0
  88. package/dist/webpack/fragment-loader.js.map +1 -0
  89. package/dist/webpack/index.d.ts +3 -0
  90. package/dist/webpack/index.js +1 -0
  91. package/dist/webpack/loader.d.ts +35 -0
  92. package/dist/webpack/loader.js +199 -0
  93. package/dist/webpack/loader.js.map +1 -0
  94. package/dist/webpack/source-loader.d.ts +11 -0
  95. package/dist/webpack/source-loader.js +17 -0
  96. package/dist/webpack/source-loader.js.map +1 -0
  97. package/dist/webpack/source-map-loader.d.ts +2 -0
  98. package/dist/webpack/source-map-loader.js +35 -0
  99. package/dist/webpack/source-map-loader.js.map +1 -0
  100. package/dist/webpack/stillwind-fragment.d.ts +1 -0
  101. package/dist/webpack/stillwind-fragment.js +1 -0
  102. package/dist/webpack/stillwind-webpack.css +1 -0
  103. package/package.json +133 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gen-mapping-D7jFzOEh.js","names":["sortComparator","resolveUri","COLUMN","cast"],"sources":["../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../../../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs"],"sourcesContent":["// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n return value;\n}\nfunction decodeSign(num) {\n return num & 1 ? -2147483648 | -(num >>> 1) : num >>> 1;\n}\nfunction encodeInteger(builder, num) {\n do {\n let clamped = num & 31;\n num >>>= 5;\n if (num > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (num > 0);\n}\nfunction encodeSign(num) {\n return num < 0 ? -num << 1 | 1 : num << 1;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line += decodeSign(decodeInteger(reader));\n const column = decodeSign(decodeInteger(reader));\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeSign(decodeInteger(reader));\n const fields = decodeSign(decodeInteger(reader));\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeSign(decodeInteger(reader))] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeSign(decodeInteger(reader));\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n encodeInteger(writer, encodeSign(startLine - state[0]));\n state[0] = startLine;\n encodeInteger(writer, encodeSign(startColumn));\n encodeInteger(writer, encodeSign(kind));\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, encodeSign(fields));\n if (scope.length === 6) encodeInteger(writer, encodeSign(scope[5]));\n for (const v of vars) {\n encodeInteger(writer, encodeSign(v));\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n encodeInteger(writer, encodeSign(endLine - state[0]));\n state[0] = endLine;\n encodeInteger(writer, encodeSign(endColumn));\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn += decodeSign(decodeInteger(reader));\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeSign(decodeInteger(reader));\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = definitionSourcesIndex + decodeSign(decodeInteger(reader));\n definitionScopeIndex = decodeSign(decodeInteger(reader)) + (definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0);\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex += decodeSign(decodeInteger(reader));\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = (sameSource ? callsiteLine : 0) + decodeSign(decodeInteger(reader));\n callsiteColumn = (sameSource && prevLine === callsiteLine ? callsiteColumn : 0) + decodeSign(decodeInteger(reader));\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeSign(decodeInteger(reader));\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeSign(decodeInteger(reader))]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine += decodeSign(decodeInteger(reader));\n bindingColumn = (bindingLine === prevBl ? bindingColumn : 0) + decodeSign(decodeInteger(reader));\n const expression = decodeSign(decodeInteger(reader));\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n encodeInteger(writer, encodeSign(range[1] - state[1]));\n state[1] = range[1];\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, encodeSign(fields));\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n encodeInteger(writer, encodeSign(sourcesIndex - state[2]));\n state[2] = sourcesIndex;\n encodeInteger(writer, encodeSign(scopesIndex - state[3]));\n state[3] = scopesIndex;\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n encodeInteger(writer, encodeSign(sourcesIndex - state[4]));\n state[4] = sourcesIndex;\n encodeInteger(writer, encodeSign(callLine - state[5]));\n state[5] = callLine;\n encodeInteger(writer, encodeSign(callColumn - state[6]));\n state[6] = callColumn;\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, encodeSign(-binding.length));\n const expression = binding[0][0];\n encodeInteger(writer, encodeSign(expression));\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n encodeInteger(writer, encodeSign(expRange[1] - bindingStartLine));\n bindingStartLine = expRange[1];\n encodeInteger(writer, encodeSign(expRange[2] - bindingStartColumn));\n bindingStartColumn = expRange[2];\n encodeInteger(writer, encodeSign(expRange[0]));\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n encodeInteger(writer, encodeSign(endColumn - state[1]));\n state[1] = endColumn;\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/range-mappings.ts\nfunction decodeRangeMappings(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const rangeMappings = [];\n do {\n const semi = reader.indexOf(\";\");\n const indices = [];\n let index = 0;\n while (reader.pos < semi) {\n index += decodeInteger(reader);\n indices.push(index);\n }\n rangeMappings.push(indices);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return rangeMappings;\n}\nfunction encodeRangeMappings(decoded) {\n if (decoded.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < decoded.length; i++) {\n const indices = decoded[i];\n if (i > 0) writer.write(semicolon);\n let index = 0;\n for (let j = 0; j < indices.length; j++) {\n const offset = indices[j];\n encodeInteger(writer, offset - index);\n index = offset;\n }\n }\n return writer.flush();\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn += decodeSign(decodeInteger(reader));\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex += decodeSign(decodeInteger(reader));\n sourceLine += decodeSign(decodeInteger(reader));\n sourceColumn += decodeSign(decodeInteger(reader));\n if (hasMoreVlq(reader, semi)) {\n namesIndex += decodeSign(decodeInteger(reader));\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n encodeInteger(writer, encodeSign(segment[0] - genColumn));\n genColumn = segment[0];\n if (segment.length === 1) continue;\n encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));\n encodeInteger(writer, encodeSign(segment[2] - sourceLine));\n encodeInteger(writer, encodeSign(segment[3] - sourceColumn));\n sourcesIndex = segment[1];\n sourceLine = segment[2];\n sourceColumn = segment[3];\n if (segment.length === 4) continue;\n encodeInteger(writer, encodeSign(segment[4] - namesIndex));\n namesIndex = segment[4];\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n decodeRangeMappings,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes,\n encodeRangeMappings\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\nfunction isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n}\nfunction isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n}\nfunction isAbsolutePath(input) {\n return input.startsWith('/');\n}\nfunction isFileUrl(input) {\n return input.startsWith('file:');\n}\nfunction isRelative(input) {\n return /^[.?#]/.test(input);\n}\nfunction parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');\n}\nfunction parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');\n}\nfunction makeUrl(scheme, user, host, port, path, query, hash) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: 7 /* Absolute */,\n };\n}\nfunction parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = 6 /* SchemeRelative */;\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = 5 /* AbsolutePath */;\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? 3 /* Query */\n : input.startsWith('#')\n ? 2 /* Hash */\n : 4 /* RelativePath */\n : 1 /* Empty */;\n return url;\n}\nfunction stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\nfunction mergePaths(url, base) {\n normalizePath(base, base.type);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url, type) {\n const rel = type <= 4 /* RelativePath */;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nfunction resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n let inputType = url.type;\n if (base && inputType !== 7 /* Absolute */) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n switch (inputType) {\n case 1 /* Empty */:\n url.hash = baseUrl.hash;\n // fall through\n case 2 /* Hash */:\n url.query = baseUrl.query;\n // fall through\n case 3 /* Query */:\n case 4 /* RelativePath */:\n mergePaths(url, baseUrl);\n // fall through\n case 5 /* AbsolutePath */:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n case 6 /* SchemeRelative */:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType)\n inputType = baseType;\n }\n normalizePath(url, inputType);\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n case 2 /* Hash */:\n case 3 /* Query */:\n return queryHash;\n case 4 /* RelativePath */: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n if (!path)\n return queryHash || '.';\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n return path + queryHash;\n }\n case 5 /* AbsolutePath */:\n return url.path + queryHash;\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n\nexport { resolve as default };\n//# sourceMappingURL=resolve-uri.mjs.map\n","// src/trace-mapping.ts\nimport { encode, decode } from \"@jridgewell/sourcemap-codec\";\n\n// src/resolve.ts\nimport resolveUri from \"@jridgewell/resolve-uri\";\n\n// src/strip-filename.ts\nfunction stripFilename(path) {\n if (!path) return \"\";\n const index = path.lastIndexOf(\"/\");\n return path.slice(0, index + 1);\n}\n\n// src/resolve.ts\nfunction resolver(mapUrl, sourceRoot) {\n const from = stripFilename(mapUrl);\n const prefix = sourceRoot ? sourceRoot + \"/\" : \"\";\n return (source) => resolveUri(prefix + (source || \"\"), from);\n}\n\n// src/sourcemap-segment.ts\nvar COLUMN = 0;\nvar SOURCES_INDEX = 1;\nvar SOURCE_LINE = 2;\nvar SOURCE_COLUMN = 3;\nvar NAMES_INDEX = 4;\nvar REV_GENERATED_LINE = 1;\nvar REV_GENERATED_COLUMN = 2;\n\n// src/sort.ts\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n if (!owned) mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\n// src/by-source.ts\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(() => []);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n const sourceIndex2 = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const source = sources[sourceIndex2];\n const segs = source[sourceLine] || (source[sourceLine] = []);\n segs.push([sourceColumn, i, seg[COLUMN]]);\n }\n }\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n for (let j = 0; j < source.length; j++) {\n const line = source[j];\n if (line) line.sort(sortComparator);\n }\n }\n return sources;\n}\n\n// src/binary-search.ts\nvar found = false;\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + (high - low >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1\n };\n}\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return state.lastIndex = binarySearch(haystack, needle, low, high);\n}\n\n// src/types.ts\nfunction parse(map) {\n return typeof map === \"string\" ? JSON.parse(map) : map;\n}\n\n// src/flatten-map.ts\nvar FlattenMap = function(map, mapUrl) {\n const parsed = parse(map);\n if (!(\"sections\" in parsed)) {\n return new TraceMap(parsed, mapUrl);\n }\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const ignoreList = [];\n recurse(\n parsed,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n 0,\n 0,\n Infinity,\n Infinity\n );\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n ignoreList\n };\n return presortedDecodedMap(joined);\n};\nfunction recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc\n );\n }\n}\nfunction addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const parsed = parse(input);\n if (\"sections\" in parsed) return recurse(...arguments);\n const map = new TraceMap(parsed, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map;\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset);\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n if (lineI > stopLine) return;\n const out = getLine(mappings, lineI);\n const cOffset = i === 0 ? columnOffset : 0;\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n if (lineI === stopLine && column >= stopColumn) return;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]\n );\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\nfunction getLine(arr, index) {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n\n// src/trace-mapping.ts\nvar LINE_GTR_ZERO = \"`line` must be greater than 0 (lines start at line 1)\";\nvar COL_GTR_EQ_ZERO = \"`column` must be greater than or equal to 0 (columns start at column 0)\";\nvar LEAST_UPPER_BOUND = -1;\nvar GREATEST_LOWER_BOUND = 1;\nvar TraceMap = class {\n constructor(map, mapUrl) {\n const isString = typeof map === \"string\";\n if (!isString && map._decodedMemo) return map;\n const parsed = parse(map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names || [];\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;\n const resolve = resolver(mapUrl, sourceRoot);\n this.resolvedSources = sources.map(resolve);\n const { mappings } = parsed;\n if (typeof mappings === \"string\") {\n this._encoded = mappings;\n this._decoded = void 0;\n } else if (Array.isArray(mappings)) {\n this._encoded = void 0;\n this._decoded = maybeSort(mappings, isString);\n } else if (parsed.sections) {\n throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);\n } else {\n throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);\n }\n this._decodedMemo = memoizedState();\n this._bySources = void 0;\n this._bySourceMemos = void 0;\n }\n};\nfunction cast(map) {\n return map;\n}\nfunction encodedMappings(map) {\n var _a, _b;\n return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded);\n}\nfunction decodedMappings(map) {\n var _a;\n return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));\n}\nfunction traceSegment(map, line, column) {\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return null;\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND\n );\n return index === -1 ? null : segments[index];\n}\nfunction originalPositionFor(map, needle) {\n let { line, column, bias } = needle;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return OMapping(null, null, null, null);\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND\n );\n if (index === -1) return OMapping(null, null, null, null);\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null\n );\n}\nfunction generatedPositionFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n}\nfunction allGeneratedPositionsFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n}\nfunction eachMapping(map, cb) {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name\n });\n }\n }\n}\nfunction sourceIndex(map, source) {\n const { sources, resolvedSources } = map;\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n return index;\n}\nfunction sourceContentFor(map, source) {\n const { sourcesContent } = map;\n if (sourcesContent == null) return null;\n const index = sourceIndex(map, source);\n return index === -1 ? null : sourcesContent[index];\n}\nfunction isIgnored(map, source) {\n const { ignoreList } = map;\n if (ignoreList == null) return false;\n const index = sourceIndex(map, source);\n return index === -1 ? false : ignoreList.includes(index);\n}\nfunction presortedDecodedMap(map, mapUrl) {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n cast(tracer)._decoded = map.mappings;\n return tracer;\n}\nfunction decodedMap(map) {\n return clone(map, decodedMappings(map));\n}\nfunction encodedMap(map) {\n return clone(map, encodedMappings(map));\n}\nfunction clone(map, mappings) {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n ignoreList: map.ignoreList || map.x_google_ignoreList\n };\n}\nfunction OMapping(source, line, column, name) {\n return { source, line, column, name };\n}\nfunction GMapping(line, column) {\n return { line, column };\n}\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\nfunction sliceGeneratedPositions(segments, memo, line, column, bias) {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n if (!found && bias === LEAST_UPPER_BOUND) min++;\n if (min === -1 || min === segments.length) return [];\n const matchedColumn = found ? column : segments[min][COLUMN];\n if (!found) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\nfunction generatedPosition(map, source, line, column, bias, all) {\n var _a, _b;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex2 = sources.indexOf(source);\n if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source);\n if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);\n const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState));\n const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos));\n const segments = generated[sourceIndex2][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n const memo = bySourceMemos[sourceIndex2];\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n}\nexport {\n FlattenMap as AnyMap,\n FlattenMap,\n GREATEST_LOWER_BOUND,\n LEAST_UPPER_BOUND,\n TraceMap,\n allGeneratedPositionsFor,\n decodedMap,\n decodedMappings,\n eachMapping,\n encodedMap,\n encodedMappings,\n generatedPositionFor,\n isIgnored,\n originalPositionFor,\n presortedDecodedMap,\n sourceContentFor,\n traceSegment\n};\n//# sourceMappingURL=trace-mapping.mjs.map\n","// src/set-array.ts\nvar SetArray = class {\n constructor() {\n this._indexes = { __proto__: null };\n this.array = [];\n }\n};\nfunction cast(set) {\n return set;\n}\nfunction get(setarr, key) {\n return cast(setarr)._indexes[key];\n}\nfunction put(setarr, key) {\n const index = get(setarr, key);\n if (index !== void 0) return index;\n const { array, _indexes: indexes } = cast(setarr);\n const length = array.push(key);\n return indexes[key] = length - 1;\n}\nfunction remove(setarr, key) {\n const index = get(setarr, key);\n if (index === void 0) return;\n const { array, _indexes: indexes } = cast(setarr);\n for (let i = index + 1; i < array.length; i++) {\n const k = array[i];\n array[i - 1] = k;\n indexes[k]--;\n }\n indexes[key] = void 0;\n array.pop();\n}\n\n// src/gen-mapping.ts\nimport {\n encode\n} from \"@jridgewell/sourcemap-codec\";\nimport { TraceMap, decodedMappings } from \"@jridgewell/trace-mapping\";\n\n// src/sourcemap-segment.ts\nvar COLUMN = 0;\nvar SOURCES_INDEX = 1;\nvar SOURCE_LINE = 2;\nvar SOURCE_COLUMN = 3;\nvar NAMES_INDEX = 4;\n\n// src/gen-mapping.ts\nvar NO_NAME = -1;\nvar GenMapping = class {\n constructor({ file, sourceRoot } = {}) {\n this._names = new SetArray();\n this._sources = new SetArray();\n this._sourcesContent = [];\n this._mappings = [];\n this.file = file;\n this.sourceRoot = sourceRoot;\n this._ignoreList = new SetArray();\n }\n};\nfunction cast2(map) {\n return map;\n}\nfunction addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content\n );\n}\nfunction addMapping(map, mapping) {\n return addMappingInternal(false, map, mapping);\n}\nvar maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content\n );\n};\nvar maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping);\n};\nfunction setSourceContent(map, source, content) {\n const {\n _sources: sources,\n _sourcesContent: sourcesContent\n // _originalScopes: originalScopes,\n } = cast2(map);\n const index = put(sources, source);\n sourcesContent[index] = content;\n}\nfunction setIgnore(map, source, ignore = true) {\n const {\n _sources: sources,\n _sourcesContent: sourcesContent,\n _ignoreList: ignoreList\n // _originalScopes: originalScopes,\n } = cast2(map);\n const index = put(sources, source);\n if (index === sourcesContent.length) sourcesContent[index] = null;\n if (ignore) put(ignoreList, index);\n else remove(ignoreList, index);\n}\nfunction toDecodedMap(map) {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n _ignoreList: ignoreList\n // _originalScopes: originalScopes,\n // _generatedRanges: generatedRanges,\n } = cast2(map);\n removeEmptyFinalLines(mappings);\n return {\n version: 3,\n file: map.file || void 0,\n names: names.array,\n sourceRoot: map.sourceRoot || void 0,\n sources: sources.array,\n sourcesContent,\n mappings,\n // originalScopes,\n // generatedRanges,\n ignoreList: ignoreList.array\n };\n}\nfunction toEncodedMap(map) {\n const decoded = toDecodedMap(map);\n return Object.assign({}, decoded, {\n // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),\n // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),\n mappings: encode(decoded.mappings)\n });\n}\nfunction fromMap(input) {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n putAll(cast2(gen)._names, map.names);\n putAll(cast2(gen)._sources, map.sources);\n cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n cast2(gen)._mappings = decodedMappings(map);\n if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList);\n return gen;\n}\nfunction allMappings(map) {\n const out = [];\n const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source = void 0;\n let original = void 0;\n let name = void 0;\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n out.push({ generated, source, original, name });\n }\n }\n return out;\n}\nfunction addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names\n // _originalScopes: originalScopes,\n } = cast2(map);\n const line = getIndex(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n assert(sourceLine);\n assert(sourceColumn);\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n return insert(\n line,\n index,\n name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]\n );\n}\nfunction assert(_val) {\n}\nfunction getIndex(arr, index) {\n for (let i = arr.length; i <= index; i++) {\n arr[i] = [];\n }\n return arr[index];\n}\nfunction getColumnIndex(line, genColumn) {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\nfunction removeEmptyFinalLines(mappings) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\nfunction putAll(setarr, array) {\n for (let i = 0; i < array.length; i++) put(setarr, array[i]);\n}\nfunction skipSourceless(line, index) {\n if (index === 0) return true;\n const prev = line[index - 1];\n return prev.length === 1;\n}\nfunction skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {\n if (index === 0) return false;\n const prev = line[index - 1];\n if (prev.length === 1) return false;\n return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);\n}\nfunction addMappingInternal(skipable, map, mapping) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null\n );\n }\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n source,\n original.line - 1,\n original.column,\n name,\n content\n );\n}\nexport {\n GenMapping,\n addMapping,\n addSegment,\n allMappings,\n fromMap,\n maybeAddMapping,\n maybeAddSegment,\n setIgnore,\n setSourceContent,\n toDecodedMap,\n toEncodedMap\n};\n//# sourceMappingURL=gen-mapping.mjs.map\n"],"ignoreList":[0,1,2,3],"mappings":";AACA,IAAI,QAAQ,IAAI,WAAW,CAAC;AAC5B,IAAI,YAAY,IAAI,WAAW,CAAC;AAChC,IAAI,QAAQ;AACZ,IAAI,4BAAY,IAAI,WAAW,EAAE;AACjC,IAAI,4BAAY,IAAI,WAAW,GAAG;AAClC,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;CACrC,MAAM,IAAI,MAAM,WAAW,CAAC;CAC5B,UAAU,KAAK;CACf,UAAU,KAAK;AACjB;AACA,SAAS,cAAc,QAAQ;CAC7B,IAAI,QAAQ;CACZ,IAAI,QAAQ;CACZ,IAAI,UAAU;CACd,GAAG;EAED,UAAU,UADA,OAAO,KACG;EACpB,UAAU,UAAU,OAAO;EAC3B,SAAS;CACX,SAAS,UAAU;CACnB,OAAO;AACT;AACA,SAAS,WAAW,KAAK;CACvB,OAAO,MAAM,IAAI,cAAc,EAAE,QAAQ,KAAK,QAAQ;AACxD;AACA,SAAS,cAAc,SAAS,KAAK;CACnC,GAAG;EACD,IAAI,UAAU,MAAM;EACpB,SAAS;EACT,IAAI,MAAM,GAAG,WAAW;EACxB,QAAQ,MAAM,UAAU,QAAQ;CAClC,SAAS,MAAM;AACjB;AACA,SAAS,WAAW,KAAK;CACvB,OAAO,MAAM,IAAI,CAAC,OAAO,IAAI,IAAI,OAAO;AAC1C;AACA,SAAS,WAAW,QAAQ,KAAK;CAC/B,IAAI,OAAO,OAAO,KAAK,OAAO;CAC9B,OAAO,OAAO,KAAK,MAAM;AAC3B;AAGA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AW,MAAM,OAAO,cAAc,YAAY,cAAc,YAAY;CACnF,IAAI,UAAU,GAAG,OAAO;CACxB,MAAM,OAAO,KAAK,QAAQ;CAC1B,IAAI,KAAK,WAAW,GAAG,OAAO;CAC9B,OAAO,iBAAiB,KAAK,kBAAkB,eAAe,KAAK,gBAAgB,iBAAiB,KAAK,kBAAkB,gBAAgB,KAAK,WAAW,IAAI,KAAK,eAAe;AACrL"}
@@ -0,0 +1,12 @@
1
+ import { t as IntegrationConfig } from "./project-DUGu8g_L.js";
2
+ import { Plugin } from "vite";
3
+ /**
4
+ * Creates Vite plugins that share compiler state across development and production.
5
+ *
6
+ * @param config - File discovery, project selection, compiler overrides, and CSS emission mode.
7
+ * @returns Plugins for compilation, development CSS delivery, and production emission. Use the
8
+ * array as `plugins: [stillwind()]` to use the project's configuration file.
9
+ */
10
+ declare function stillwind(config?: IntegrationConfig): Plugin[];
11
+ export { stillwind as t };
12
+ //# sourceMappingURL=index-DFfbZxNT.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { t as TurbopackLoaderOptions } from "../project-BNw0nZBE.js";
2
+ import { LoaderContext } from "webpack";
3
+ /** Loader settings that reconstruct document CSS from Next app and pages routes. */
4
+ interface NextLoaderOptions extends TurbopackLoaderOptions {
5
+ /** Configured page extensions without a leading dot, matched case-sensitively. */
6
+ extensions: string[];
7
+ }
8
+ /**
9
+ * Reconstructs document CSS after discovering Next routes with evaluated project settings.
10
+ * @param this - Loader context receiving route watches and asynchronous CSS/map completion or an error.
11
+ */
12
+ export default function nextCssLoader(this: LoaderContext<NextLoaderOptions>): void;
13
+ export {};
14
+ //# sourceMappingURL=css-loader.d.ts.map
@@ -0,0 +1,58 @@
1
+ import { emitStylesheet } from "../turbopack/css-loader.js";
2
+ import path from "node:path";
3
+ import { readdir } from "node:fs/promises";
4
+ // src/next/entries.ts
5
+ /**
6
+ * Discovers route sources beneath app or src/app and pages or src/pages.
7
+ * @param context - Loader context that receives visited directory and missing-directory dependencies.
8
+ * @param options - Evaluated absolute project root and Next page extensions.
9
+ * @returns Sorted absolute route paths. App traversal skips private directories and non-route filenames.
10
+ * @throws If traversal fails for a reason other than a missing directory.
11
+ */
12
+ async function routeEntries(context, options) {
13
+ const entries = [];
14
+ /**
15
+ * Traverses a route directory and appends matching files to entries.
16
+ * @param directory - Absolute directory registered as a context dependency before reading.
17
+ * @param app - Whether app-directory private folders and route filename constraints apply.
18
+ * @returns Completion of recursive traversal.
19
+ * @throws If enumeration fails.
20
+ */
21
+ const visit = async (directory, app) => {
22
+ context.addContextDependency(directory);
23
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
24
+ const file = path.join(directory, entry.name);
25
+ if (entry.isDirectory()) {
26
+ if (!app || !entry.name.startsWith("_")) await visit(file, app);
27
+ } else if (entry.isFile() && options.extensions.some((extension) => entry.name.endsWith(`.${extension}`))) {
28
+ const stem = entry.name.slice(0, entry.name.indexOf("."));
29
+ if (!app || /^(page|layout|template|loading|error|global-error|not-found|default|forbidden|unauthorized)$/.test(stem)) entries.push(file);
30
+ }
31
+ }
32
+ };
33
+ for (const name of ["app", "pages"]) for (const prefix of ["", "src"]) {
34
+ const directory = path.join(options.root, prefix, name);
35
+ try {
36
+ await visit(directory, name === "app");
37
+ break;
38
+ } catch (error) {
39
+ if (error.code !== "ENOENT") throw error;
40
+ context.addMissingDependency(directory);
41
+ }
42
+ }
43
+ return entries.sort();
44
+ }
45
+ // src/next/css-loader.ts
46
+ /**
47
+ * Reconstructs document CSS after discovering Next routes with evaluated project settings.
48
+ * @param this - Loader context receiving route watches and asynchronous CSS/map completion or an error.
49
+ */
50
+ function nextCssLoader() {
51
+ emitStylesheet(this, (options) => routeEntries(this, {
52
+ ...this.getOptions(),
53
+ root: options.root
54
+ }));
55
+ }
56
+ export { nextCssLoader as default };
57
+
58
+ //# sourceMappingURL=css-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-loader.js","names":[],"sources":["../../src/next/entries.ts","../../src/next/css-loader.ts"],"sourcesContent":["import { readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { LoaderContext } from \"webpack\";\n\nimport type { TurbopackLoaderOptions } from \"../turbopack/project.ts\";\n\n/** Loader settings that reconstruct document CSS from Next app and pages routes. */\nexport interface NextLoaderOptions extends TurbopackLoaderOptions {\n /** Configured page extensions without a leading dot, matched case-sensitively. */\n extensions: string[];\n}\n\n/**\n * Discovers route sources beneath app or src/app and pages or src/pages.\n * @param context - Loader context that receives visited directory and missing-directory dependencies.\n * @param options - Evaluated absolute project root and Next page extensions.\n * @returns Sorted absolute route paths. App traversal skips private directories and non-route filenames.\n * @throws If traversal fails for a reason other than a missing directory.\n */\nexport async function routeEntries(\n context: LoaderContext<NextLoaderOptions>,\n options: NextLoaderOptions,\n) {\n const entries: string[] = [];\n /**\n * Traverses a route directory and appends matching files to entries.\n * @param directory - Absolute directory registered as a context dependency before reading.\n * @param app - Whether app-directory private folders and route filename constraints apply.\n * @returns Completion of recursive traversal.\n * @throws If enumeration fails.\n */\n const visit = async (directory: string, app: boolean): Promise<void> => {\n context.addContextDependency(directory);\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const file = path.join(directory, entry.name);\n if (entry.isDirectory()) {\n if (!app || !entry.name.startsWith(\"_\")) {\n await visit(file, app);\n }\n } else if (\n entry.isFile() &&\n options.extensions.some((extension) => entry.name.endsWith(`.${extension}`))\n ) {\n const stem = entry.name.slice(0, entry.name.indexOf(\".\"));\n if (\n !app ||\n /^(page|layout|template|loading|error|global-error|not-found|default|forbidden|unauthorized)$/.test(\n stem,\n )\n ) {\n entries.push(file);\n }\n }\n }\n };\n for (const name of [\"app\", \"pages\"]) {\n for (const prefix of [\"\", \"src\"]) {\n const directory = path.join(options.root, prefix, name);\n try {\n await visit(directory, name === \"app\");\n break;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") {\n throw error;\n }\n context.addMissingDependency(directory);\n }\n }\n }\n return entries.sort();\n}\n","import type { LoaderContext } from \"webpack\";\n\nimport { emitStylesheet } from \"../turbopack/css-loader.ts\";\nimport { routeEntries, type NextLoaderOptions } from \"./entries.ts\";\n\n/**\n * Reconstructs document CSS after discovering Next routes with evaluated project settings.\n * @param this - Loader context receiving route watches and asynchronous CSS/map completion or an error.\n */\nexport default function nextCssLoader(this: LoaderContext<NextLoaderOptions>) {\n emitStylesheet(this, (options) =>\n routeEntries(this, {\n ...this.getOptions(),\n root: options.root,\n }),\n );\n}\n"],"mappings":";;;;;;;;;;;AAoBA,eAAsB,aACpB,SACA,SACA;CACA,MAAM,UAAoB,CAAC;;;;;;;;CAQ3B,MAAM,QAAQ,OAAO,WAAmB,QAAgC;EACtE,QAAQ,qBAAqB,SAAS;EACtC,KAAK,MAAM,SAAS,MAAM,QAAQ,WAAW,EAAE,eAAe,KAAK,CAAC,GAAG;GACrE,MAAM,OAAO,KAAK,KAAK,WAAW,MAAM,IAAI;GAC5C,IAAI,MAAM,YAAY,GAChB;QAAA,CAAC,OAAO,CAAC,MAAM,KAAK,WAAW,GAAG,GACpC,MAAM,MAAM,MAAM,GAAG;GAAA,OAElB,IACL,MAAM,OAAO,KACb,QAAQ,WAAW,MAAM,cAAc,MAAM,KAAK,SAAS,IAAI,WAAW,CAAC,GAC3E;IACA,MAAM,OAAO,MAAM,KAAK,MAAM,GAAG,MAAM,KAAK,QAAQ,GAAG,CAAC;IACxD,IACE,CAAC,OACD,+FAA+F,KAC7F,IACF,GAEA,QAAQ,KAAK,IAAI;GAErB;EACF;CACF;CACA,KAAK,MAAM,QAAQ,CAAC,OAAO,OAAO,GAChC,KAAK,MAAM,UAAU,CAAC,IAAI,KAAK,GAAG;EAChC,MAAM,YAAY,KAAK,KAAK,QAAQ,MAAM,QAAQ,IAAI;EACtD,IAAI;GACF,MAAM,MAAM,WAAW,SAAS,KAAK;GACrC;EACF,SAAS,OAAO;GACd,IAAK,MAAgC,SAAS,UAC5C,MAAM;GAER,QAAQ,qBAAqB,SAAS;EACxC;CACF;CAEF,OAAO,QAAQ,KAAK;AACtB;;;;;;AC9DA,SAAwB,gBAAsD;CAC5E,eAAe,OAAO,YACpB,aAAa,MAAM;EACjB,GAAG,KAAK,WAAW;EACnB,MAAM,QAAQ;CAChB,CAAC,CACH;AACF"}
@@ -0,0 +1,15 @@
1
+ import { SerializableInlineConfig, SerializableInlineConfig as IntegrationConfig } from "@stillwind/config";
2
+ /**
3
+ * Adds Stillwind rules while preserving the application's Next configuration and webpack hook.
4
+ *
5
+ * @param nextConfig - Existing Next configuration, including optional Turbopack rules and webpack hook.
6
+ * @param config - Configuration discovery and inline compiler overrides. Inline values must be
7
+ * serializable; callbacks can be declared in the configuration file.
8
+ * @returns A copy with Stillwind rules appended to both bundler configurations. The original
9
+ * webpack hook runs before Stillwind appends its rules.
10
+ * @throws If inline naming callbacks cannot be serialized. Loaders report configuration errors
11
+ * when the bundler evaluates the settings.
12
+ */
13
+ export declare function withStillwind<T extends object>(nextConfig: T, config?: SerializableInlineConfig): T;
14
+ export type { IntegrationConfig };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { n as createRules, r as loaderPath, t as createLoaderOptions } from "../rules-BvKsL2at.js";
2
+ import { fileURLToPath } from "node:url";
3
+ // src/next/index.ts
4
+ const loader = loaderPath("loader.js");
5
+ const cssLoader = fileURLToPath(new URL("./css-loader.js", import.meta.resolve("@stillwind/integration/next")));
6
+ /**
7
+ * Builds the Next wrapper while deferring project evaluation to isolated loaders.
8
+ * @param nextConfig - Application settings. Omission uses an empty configuration.
9
+ * @param config - Serializable discovery settings and compiler overrides.
10
+ * @returns A copy that preserves existing rules and invokes the original webpack hook before adding Stillwind rules.
11
+ * @throws If inline settings cannot be cloned or installed loader paths cannot be resolved.
12
+ */
13
+ function withStillwind(nextConfig = {}, config = {}) {
14
+ const loaderOptions = {
15
+ ...createLoaderOptions(config, []),
16
+ extensions: nextConfig.pageExtensions ?? [
17
+ "tsx",
18
+ "ts",
19
+ "jsx",
20
+ "js"
21
+ ]
22
+ };
23
+ const rules = { ...nextConfig.turbopack?.rules };
24
+ for (const [pattern, rule] of Object.entries(createRules(loaderOptions, cssLoader))) {
25
+ const previous = rules[pattern];
26
+ rules[pattern] = previous ? [...Array.isArray(previous) ? previous : [previous], rule] : rule;
27
+ }
28
+ return {
29
+ ...nextConfig,
30
+ turbopack: {
31
+ ...nextConfig.turbopack,
32
+ rules
33
+ },
34
+ /**
35
+ * Runs the application hook, then appends source and document-carrier rules to its result.
36
+ * @param webpackConfig - Mutable Next webpack configuration passed to the original hook.
37
+ * @param context - Next's build context forwarded unchanged to that hook.
38
+ * @returns The hook's configuration with Stillwind rules appended.
39
+ * @throws If the application hook fails.
40
+ */
41
+ webpack(webpackConfig, context) {
42
+ const result = nextConfig.webpack ? nextConfig.webpack(webpackConfig, context) : webpackConfig;
43
+ result.module ??= {};
44
+ result.module.rules ??= [];
45
+ result.module.rules.push({
46
+ test: /\.[cm]?[jt]sx?$/,
47
+ exclude: /node_modules/,
48
+ enforce: "pre",
49
+ use: [{
50
+ loader,
51
+ options: loaderOptions
52
+ }]
53
+ }, {
54
+ test: /stillwind-turbopack\.css$/,
55
+ use: [{
56
+ loader: cssLoader,
57
+ options: loaderOptions
58
+ }]
59
+ });
60
+ return result;
61
+ }
62
+ };
63
+ }
64
+ export { withStillwind };
65
+
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/next/index.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\n\nimport type { SerializableInlineConfig } from \"@stillwind/config\";\nimport type { NextConfig } from \"next\";\nimport type { Configuration } from \"webpack\";\n\nimport { createLoaderOptions, createRules, loaderPath } from \"../turbopack/rules.ts\";\n\nexport type { SerializableInlineConfig as IntegrationConfig } from \"@stillwind/config\";\n\nconst loader = loaderPath(\"loader.js\");\n\nconst cssLoader = fileURLToPath(\n new URL(\"./css-loader.js\", import.meta.resolve(\"@stillwind/integration/next\")),\n);\n\n/**\n * Adds Stillwind rules while preserving the application's Next configuration and webpack hook.\n *\n * @param nextConfig - Existing Next configuration, including optional Turbopack rules and webpack hook.\n * @param config - Configuration discovery and inline compiler overrides. Inline values must be\n * serializable; callbacks can be declared in the configuration file.\n * @returns A copy with Stillwind rules appended to both bundler configurations. The original\n * webpack hook runs before Stillwind appends its rules.\n * @throws If inline naming callbacks cannot be serialized. Loaders report configuration errors\n * when the bundler evaluates the settings.\n */\nexport function withStillwind<T extends object>(\n nextConfig: T,\n config?: SerializableInlineConfig,\n): T;\n\n/**\n * Builds the Next wrapper while deferring project evaluation to isolated loaders.\n * @param nextConfig - Application settings. Omission uses an empty configuration.\n * @param config - Serializable discovery settings and compiler overrides.\n * @returns A copy that preserves existing rules and invokes the original webpack hook before adding Stillwind rules.\n * @throws If inline settings cannot be cloned or installed loader paths cannot be resolved.\n */\nexport function withStillwind(nextConfig: NextConfig = {}, config: SerializableInlineConfig = {}) {\n const loaderOptions = {\n ...createLoaderOptions(config, []),\n extensions: nextConfig.pageExtensions ?? [\"tsx\", \"ts\", \"jsx\", \"js\"],\n };\n const rules = { ...nextConfig.turbopack?.rules };\n for (const [pattern, rule] of Object.entries(createRules(loaderOptions, cssLoader))) {\n const previous = rules[pattern];\n rules[pattern] = previous ? [...(Array.isArray(previous) ? previous : [previous]), rule] : rule;\n }\n return {\n ...nextConfig,\n turbopack: {\n ...nextConfig.turbopack,\n rules,\n },\n /**\n * Runs the application hook, then appends source and document-carrier rules to its result.\n * @param webpackConfig - Mutable Next webpack configuration passed to the original hook.\n * @param context - Next's build context forwarded unchanged to that hook.\n * @returns The hook's configuration with Stillwind rules appended.\n * @throws If the application hook fails.\n */\n webpack(\n webpackConfig: Configuration,\n context: Parameters<NonNullable<NextConfig[\"webpack\"]>>[1],\n ) {\n const result: Configuration = nextConfig.webpack\n ? nextConfig.webpack(webpackConfig, context)\n : webpackConfig;\n result.module ??= {};\n result.module.rules ??= [];\n result.module.rules.push(\n {\n test: /\\.[cm]?[jt]sx?$/,\n exclude: /node_modules/,\n enforce: \"pre\",\n use: [\n {\n loader,\n options: loaderOptions,\n },\n ],\n },\n {\n test: /stillwind-turbopack\\.css$/,\n use: [\n {\n loader: cssLoader,\n options: loaderOptions,\n },\n ],\n },\n );\n return result;\n },\n };\n}\n"],"mappings":";;;AAUA,MAAM,SAAS,WAAW,WAAW;AAErC,MAAM,YAAY,cAChB,IAAI,IAAI,mBAAmB,YAAY,QAAQ,6BAA6B,CAAC,CAC/E;;;;;;;;AAyBA,SAAgB,cAAc,aAAyB,CAAC,GAAG,SAAmC,CAAC,GAAG;CAChG,MAAM,gBAAgB;EACpB,GAAG,oBAAoB,QAAQ,CAAC,CAAC;EACjC,YAAY,WAAW,kBAAkB;GAAC;GAAO;GAAM;GAAO;EAAI;CACpE;CACA,MAAM,QAAQ,EAAE,GAAG,WAAW,WAAW,MAAM;CAC/C,KAAK,MAAM,CAAC,SAAS,SAAS,OAAO,QAAQ,YAAY,eAAe,SAAS,CAAC,GAAG;EACnF,MAAM,WAAW,MAAM;EACvB,MAAM,WAAW,WAAW,CAAC,GAAI,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ,GAAI,IAAI,IAAI;CAC7F;CACA,OAAO;EACL,GAAG;EACH,WAAW;GACT,GAAG,WAAW;GACd;EACF;;;;;;;;EAQA,QACE,eACA,SACA;GACA,MAAM,SAAwB,WAAW,UACrC,WAAW,QAAQ,eAAe,OAAO,IACzC;GACJ,OAAO,WAAW,CAAC;GACnB,OAAO,OAAO,UAAU,CAAC;GACzB,OAAO,OAAO,MAAM,KAClB;IACE,MAAM;IACN,SAAS;IACT,SAAS;IACT,KAAK,CACH;KACE;KACA,SAAS;IACX,CACF;GACF,GACA;IACE,MAAM;IACN,KAAK,CACH;KACE,QAAQ;KACR,SAAS;IACX,CACF;GACF,CACF;GACA,OAAO;EACT;CACF;AACF"}
@@ -0,0 +1,19 @@
1
+ import { t as TurbopackLoaderOptions } from "./project-BNw0nZBE.js";
2
+ import { UpstreamSourceMap } from "@stillwind/host";
3
+ import { LoaderContext } from "webpack";
4
+ /** Settings for a compiler loader that executes in Node. */
5
+ type NodeLoaderOptions = TurbopackLoaderOptions & {
6
+ /** Absolute path to the compiled loader implementation. */
7
+ implementation: string;
8
+ };
9
+ /**
10
+ * Loads the compiler in Node without exposing its dependencies to Turbopack's loader tracing.
11
+ * @param this - Loader context with an absolute implementation path and asynchronous completion.
12
+ * @param source - Original source text forwarded to the implementation.
13
+ * @param inputMap - Upstream source map forwarded unchanged.
14
+ * @returns Undefined. The implementation completes the loader callback and registers its dependencies.
15
+ * Import and synchronous invocation errors complete the callback with an error.
16
+ */
17
+ declare function nodeLoader(this: LoaderContext<NodeLoaderOptions>, source: string, inputMap: UpstreamSourceMap): void;
18
+ export { nodeLoader as n, NodeLoaderOptions as t };
19
+ //# sourceMappingURL=node-loader-D-3Ynpy1.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { t as IntegrationConfig } from "../project-DUGu8g_L.js";
2
+ import "../index-DFfbZxNT.js";
3
+ import { NuxtModule } from "nuxt/schema";
4
+ /**
5
+ * Adds the Vite compiler and development SSR stylesheet transport to a Nuxt application.
6
+ *
7
+ * @param config - File discovery, project selection, inline compiler overrides, and CSS emission.
8
+ * Omission reads stillwind.config.* relative to Nuxt's application root during Vite configuration.
9
+ * @returns A Nuxt module that registers the Vite plugins and client stylesheet handling.
10
+ */
11
+ export declare function stillwind(config?: IntegrationConfig): NuxtModule;
12
+ export type { IntegrationConfig };
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,64 @@
1
+ import { r as createViteProject, t as createVitePlugins } from "../plugin-C_ZFfzo2.js";
2
+ import { addPluginTemplate, defineNuxtModule } from "nuxt/kit";
3
+ // src/nuxt/index.ts
4
+ /**
5
+ * Adds the Vite compiler and development SSR stylesheet transport to a Nuxt application.
6
+ *
7
+ * @param config - File discovery, project selection, inline compiler overrides, and CSS emission.
8
+ * Omission reads stillwind.config.* relative to Nuxt's application root during Vite configuration.
9
+ * @returns A Nuxt module that registers the Vite plugins and client stylesheet handling.
10
+ */
11
+ function stillwind(config = {}) {
12
+ return defineNuxtModule({
13
+ meta: { name: "@stillwind/integration" },
14
+ /**
15
+ * Installs compiler plugins and connects the client development server to SSR stylesheet delivery.
16
+ * @param _ - Nuxt module options. Stillwind settings are captured by the factory instead.
17
+ * @param nuxt - Application whose Vite hooks and development plugin template are registered.
18
+ */
19
+ setup(_, nuxt) {
20
+ let ssr;
21
+ nuxt.hook("vite:extendConfig", (viteConfig) => {
22
+ const vite = viteConfig;
23
+ vite.plugins ??= [];
24
+ vite.plugins.unshift(createVitePlugins(createViteProject(config, () => nuxt.options.rootDir)));
25
+ });
26
+ nuxt.hook("vite:serverCreated", (server, { isClient }) => {
27
+ if (!isClient) {
28
+ ssr = server;
29
+ return;
30
+ }
31
+ server.middlewares.use(nuxt.options.app.baseURL + "__stillwind/nuxt.css", (request, response, next) => {
32
+ if (!ssr) return next();
33
+ request.url = "/__stillwind/style.css?environment=ssr";
34
+ ssr.middlewares(request, response, next);
35
+ });
36
+ });
37
+ if (nuxt.options.dev) addPluginTemplate({
38
+ filename: "stillwind-ssr.ts",
39
+ getContents: () => `
40
+ import { defineNuxtPlugin, useHead } from "#app";
41
+
42
+ export default defineNuxtPlugin((nuxt) => {
43
+ const head = useHead({
44
+ link: [
45
+ {
46
+ key: "stillwind-ssr",
47
+ rel: "stylesheet",
48
+ href: ${JSON.stringify(nuxt.options.app.baseURL + "__stillwind/nuxt.css")},
49
+ },
50
+ ],
51
+ });
52
+
53
+ nuxt.hook("app:mounted", () => {
54
+ head.dispose();
55
+ });
56
+ });
57
+ `.trimStart()
58
+ });
59
+ }
60
+ });
61
+ }
62
+ export { stillwind };
63
+
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/nuxt/index.ts"],"sourcesContent":["import { addPluginTemplate, defineNuxtModule } from \"nuxt/kit\";\nimport type { NuxtModule } from \"nuxt/schema\";\nimport type { UserConfig, ViteDevServer } from \"vite\";\n\nimport type { IntegrationConfig } from \"../vite/index.ts\";\nimport { createVitePlugins } from \"../vite/plugin.ts\";\nimport { createViteProject } from \"../vite/project.ts\";\n\nexport type { IntegrationConfig } from \"../vite/index.ts\";\n\n/**\n * Adds the Vite compiler and development SSR stylesheet transport to a Nuxt application.\n *\n * @param config - File discovery, project selection, inline compiler overrides, and CSS emission.\n * Omission reads stillwind.config.* relative to Nuxt's application root during Vite configuration.\n * @returns A Nuxt module that registers the Vite plugins and client stylesheet handling.\n */\nexport function stillwind(config: IntegrationConfig = {}): NuxtModule {\n return defineNuxtModule({\n meta: {\n name: \"@stillwind/integration\",\n },\n /**\n * Installs compiler plugins and connects the client development server to SSR stylesheet delivery.\n * @param _ - Nuxt module options. Stillwind settings are captured by the factory instead.\n * @param nuxt - Application whose Vite hooks and development plugin template are registered.\n */\n setup(_, nuxt) {\n let ssr: ViteDevServer | undefined;\n\n nuxt.hook(\"vite:extendConfig\", (viteConfig) => {\n const vite = viteConfig as UserConfig;\n vite.plugins ??= [];\n vite.plugins.unshift(\n createVitePlugins(createViteProject(config, () => nuxt.options.rootDir)),\n );\n });\n\n nuxt.hook(\"vite:serverCreated\", (server, { isClient }) => {\n if (!isClient) {\n ssr = server;\n return;\n }\n server.middlewares.use(\n nuxt.options.app.baseURL + \"__stillwind/nuxt.css\",\n (request, response, next) => {\n if (!ssr) {\n return next();\n }\n request.url = \"/__stillwind/style.css?environment=ssr\";\n ssr.middlewares(request, response, next);\n },\n );\n });\n\n if (nuxt.options.dev) {\n addPluginTemplate({\n filename: \"stillwind-ssr.ts\",\n getContents: () =>\n `\nimport { defineNuxtPlugin, useHead } from \"#app\";\n\nexport default defineNuxtPlugin((nuxt) => {\n const head = useHead({\n link: [\n {\n key: \"stillwind-ssr\",\n rel: \"stylesheet\",\n href: ${JSON.stringify(nuxt.options.app.baseURL + \"__stillwind/nuxt.css\")},\n },\n ],\n });\n\n nuxt.hook(\"app:mounted\", () => {\n head.dispose();\n });\n});\n`.trimStart(),\n });\n }\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAiBA,SAAgB,UAAU,SAA4B,CAAC,GAAe;CACpE,OAAO,iBAAiB;EACtB,MAAM,EACJ,MAAM,yBACR;;;;;;EAMA,MAAM,GAAG,MAAM;GACb,IAAI;GAEJ,KAAK,KAAK,sBAAsB,eAAe;IAC7C,MAAM,OAAO;IACb,KAAK,YAAY,CAAC;IAClB,KAAK,QAAQ,QACX,kBAAkB,kBAAkB,cAAc,KAAK,QAAQ,OAAO,CAAC,CACzE;GACF,CAAC;GAED,KAAK,KAAK,uBAAuB,QAAQ,EAAE,eAAe;IACxD,IAAI,CAAC,UAAU;KACb,MAAM;KACN;IACF;IACA,OAAO,YAAY,IACjB,KAAK,QAAQ,IAAI,UAAU,yBAC1B,SAAS,UAAU,SAAS;KAC3B,IAAI,CAAC,KACH,OAAO,KAAK;KAEd,QAAQ,MAAM;KACd,IAAI,YAAY,SAAS,UAAU,IAAI;IACzC,CACF;GACF,CAAC;GAED,IAAI,KAAK,QAAQ,KACf,kBAAkB;IAChB,UAAU;IACV,mBACE;;;;;;;;;gBASI,KAAK,UAAU,KAAK,QAAQ,IAAI,UAAU,sBAAsB,EAAE;;;;;;;;;EAShF,UAAU;GACJ,CAAC;EAEL;CACF,CAAC;AACH"}