@fluentic/style 0.1.0-beta.11 → 0.1.0-beta.13

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 (556) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/atomic/layer/layer.ts +7 -3
  3. package/builder/data/data.ts +1 -1
  4. package/builder/selector_override_core.ts +7 -1
  5. package/compiler/compiler/compiler.ts +8 -4
  6. package/compiler/extract/extract.ts +14 -9
  7. package/compiler/extract/types.ts +2 -1
  8. package/compiler/transform/extract/chain/chain.ts +7 -4
  9. package/compiler/transform/extract/chain/extract_chain.ts +14 -0
  10. package/compiler/transform/extract/utils/replacement.ts +6 -1
  11. package/compiler/utils/file_resolver.ts +2 -1
  12. package/config/config/css.ts +19 -0
  13. package/css/sheet.ts +3 -2
  14. package/dist/{combine-Bww7VnSr.js → combine-yuoQ_qpx.js} +2 -2
  15. package/dist/{combine-Bww7VnSr.js.map → combine-yuoQ_qpx.js.map} +1 -1
  16. package/dist/compiler/index.mjs +1 -1
  17. package/dist/{compiler-C3CEGGtI.mjs → compiler-BEHxZYjz.mjs} +35 -16
  18. package/dist/compiler-BEHxZYjz.mjs.map +1 -0
  19. package/dist/config/index.js +2 -2
  20. package/dist/{config-CDjbHwb-.js → config-B5nEd-TV.js} +2 -2
  21. package/dist/{config-CDjbHwb-.js.map → config-B5nEd-TV.js.map} +1 -1
  22. package/dist/{config-C5VWvTav.js → config-BWGBkVrM.js} +4 -4
  23. package/dist/{config-C5VWvTav.js.map → config-BWGBkVrM.js.map} +1 -1
  24. package/dist/{config-BKP5LOkt.js → config-Bqe8Y-4_.js} +2 -2
  25. package/dist/{config-BKP5LOkt.js.map → config-Bqe8Y-4_.js.map} +1 -1
  26. package/dist/{config-DNEnHEf3.js → config-DggQEE-4.js} +3 -3
  27. package/dist/{config-DNEnHEf3.js.map → config-DggQEE-4.js.map} +1 -1
  28. package/dist/{createTransformElement-D8fXZ3wA.js → createTransformElement-B2jSnugo.js} +2 -2
  29. package/dist/{createTransformElement-D8fXZ3wA.js.map → createTransformElement-B2jSnugo.js.map} +1 -1
  30. package/dist/{css-CFxNrYt3.js → css-BQRIvzwZ.js} +41 -20
  31. package/dist/css-BQRIvzwZ.js.map +1 -0
  32. package/dist/{css-BDn0epJ8.js → css-CGMAis1n.js} +7 -7
  33. package/dist/css-CGMAis1n.js.map +1 -0
  34. package/dist/{css-DWBWsyxZ.js → css-D7eTqvMH.js} +9 -2
  35. package/dist/{css-DWBWsyxZ.js.map → css-D7eTqvMH.js.map} +1 -1
  36. package/dist/{css-DEYgrj76.js → css-p_5ZNny_.js} +12 -12
  37. package/dist/css-p_5ZNny_.js.map +1 -0
  38. package/dist/css.js +1 -1
  39. package/dist/{css_extra-nTq_Gw0E.js → css_extra-DuVzUIYx.js} +2 -2
  40. package/dist/{css_extra-nTq_Gw0E.js.map → css_extra-DuVzUIYx.js.map} +1 -1
  41. package/dist/{data-CDrS1Bq4.js → data-QXDBLlWs.js} +7 -7
  42. package/dist/{data-CDrS1Bq4.js.map → data-QXDBLlWs.js.map} +1 -1
  43. package/dist/{debug-YuhEIQVO.js → debug-0iaVEC7z.js} +3 -3
  44. package/dist/{debug-YuhEIQVO.js.map → debug-0iaVEC7z.js.map} +1 -1
  45. package/dist/{debug-BkVbf0Cz.js → debug-CkgcZDaX.js} +2 -2
  46. package/dist/{debug-BkVbf0Cz.js.map → debug-CkgcZDaX.js.map} +1 -1
  47. package/dist/dev/rsc.js +7 -7
  48. package/dist/dev/rsc.js.map +1 -1
  49. package/dist/{dev-0imWmSVb.js → dev-DocaGP3_.js} +7 -7
  50. package/dist/{dev-0imWmSVb.js.map → dev-DocaGP3_.js.map} +1 -1
  51. package/dist/dev.js +1 -1
  52. package/dist/dialect/extracted/index.js +1 -1
  53. package/dist/dialect/index.js +1 -1
  54. package/dist/{elementMarker-kvpMjB49.js → elementMarker-DZjd1NuA.js} +35 -21
  55. package/dist/elementMarker-DZjd1NuA.js.map +1 -0
  56. package/dist/entry/dev/adapter/preact.js +1 -1
  57. package/dist/entry/dev/adapter/react.js +1 -1
  58. package/dist/entry/dev/adapter/solid.js +1 -1
  59. package/dist/entry/dev/css.js +2 -2
  60. package/dist/entry/dev/jsx-dev-runtime.js +2 -2
  61. package/dist/entry/dev/jsx-runtime.js +2 -2
  62. package/dist/entry/dev.js +11 -11
  63. package/dist/entry/prod/css.js +2 -2
  64. package/dist/entry/prod.js +2 -2
  65. package/dist/entry/rsc-dev/adapter/preact.js +1 -1
  66. package/dist/entry/rsc-dev/adapter/react.js +1 -1
  67. package/dist/entry/rsc-dev/adapter/solid.js +1 -1
  68. package/dist/entry/rsc-dev/css.js +2 -2
  69. package/dist/entry/rsc-dev/dev.js +6 -6
  70. package/dist/entry/rsc-dev/dev.js.map +1 -1
  71. package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
  72. package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
  73. package/dist/entry/rsc-dev.js +5 -5
  74. package/dist/entry/rsc-prod/css.js +2 -2
  75. package/dist/entry/rsc-prod.js +2 -2
  76. package/dist/{env-Cz8frh6e.js → env-DJyXPJ9q.js} +40 -19
  77. package/dist/env-DJyXPJ9q.js.map +1 -0
  78. package/dist/getClassName-9CsXbNls.js.map +1 -1
  79. package/dist/{getClassName-DGm-VNDo.js → getClassName-BB_L7U_v.js} +5 -5
  80. package/dist/{getClassName-DGm-VNDo.js.map → getClassName-BB_L7U_v.js.map} +1 -1
  81. package/dist/{getClassName-Dtc4yyYI.js → getClassName-BIqt1S41.js} +4 -4
  82. package/dist/{getClassName-Dtc4yyYI.js.map → getClassName-BIqt1S41.js.map} +1 -1
  83. package/dist/{global-CAc9OjKx.js → global-CBQGormL.js} +2 -2
  84. package/dist/{global-CAc9OjKx.js.map → global-CBQGormL.js.map} +1 -1
  85. package/dist/index.js +9 -9
  86. package/dist/jsx/jsx-dev-runtime.js +1 -1
  87. package/dist/jsx/jsx-dev-runtime.server.js +1 -1
  88. package/dist/jsx/jsx-runtime.js +1 -1
  89. package/dist/jsx/jsx-runtime.server.js +1 -1
  90. package/dist/{jsx-CVxpkS04.js → jsx-BCufpzdb.js} +4 -4
  91. package/dist/{jsx-CVxpkS04.js.map → jsx-BCufpzdb.js.map} +1 -1
  92. package/dist/{jsx_runtime-6Qa1lmz2.js → jsx_runtime-Bu_A8mr4.js} +2 -2
  93. package/dist/{jsx_runtime-6Qa1lmz2.js.map → jsx_runtime-Bu_A8mr4.js.map} +1 -1
  94. package/dist/{loader-_-VjzlrX.mjs → loader-vMHuD1zT.mjs} +3 -3
  95. package/dist/loader-vMHuD1zT.mjs.map +1 -0
  96. package/dist/{misc-B76PUnWe.mjs → misc-9EGKYkZo.mjs} +2 -2
  97. package/dist/{misc-B76PUnWe.mjs.map → misc-9EGKYkZo.mjs.map} +1 -1
  98. package/dist/{namedTokens-5AayGokX.js → namedTokens-DnpyC5XT.js} +3 -3
  99. package/dist/{namedTokens-5AayGokX.js.map → namedTokens-DnpyC5XT.js.map} +1 -1
  100. package/dist/plugin/farm/index.mjs +3 -3
  101. package/dist/plugin/nextjs/index.mjs +4 -4
  102. package/dist/plugin/nextjs/index.mjs.map +1 -1
  103. package/dist/plugin/nextjs/loader.mjs +4 -4
  104. package/dist/plugin/parcel/index.cjs +1 -1
  105. package/dist/plugin/parcel/index.mjs +2 -2
  106. package/dist/plugin/parcel/optimizer.cjs +1 -1
  107. package/dist/plugin/parcel/optimizer.mjs +2 -2
  108. package/dist/plugin/parcel/resolver.cjs +1 -1
  109. package/dist/plugin/parcel/resolver.mjs +2 -2
  110. package/dist/plugin/parcel/runtime.cjs +1 -1
  111. package/dist/plugin/parcel/runtime.mjs +1 -1
  112. package/dist/plugin/parcel/transformer.cjs +1 -1
  113. package/dist/plugin/parcel/transformer.mjs +2 -2
  114. package/dist/plugin/rspack/index.mjs +2 -2
  115. package/dist/plugin/vite/index.mjs +3 -3
  116. package/dist/plugin/webpack/index.mjs +2 -2
  117. package/dist/plugin/webpack/loader.mjs +2 -2
  118. package/dist/presets/tailwind/index.js +3 -3
  119. package/dist/{registry-w8ET5R7v.mjs → registry-DVB7n6V-.mjs} +2 -2
  120. package/dist/{registry-w8ET5R7v.mjs.map → registry-DVB7n6V-.mjs.map} +1 -1
  121. package/dist/{resolveClassNameRuntime-CJjlUP93.js → resolveClassNameRuntime-DvH6j_4N.js} +2 -2
  122. package/dist/{resolveClassNameRuntime-CJjlUP93.js.map → resolveClassNameRuntime-DvH6j_4N.js.map} +1 -1
  123. package/dist/{rules-DaMaMHgb.js → rules-znG9bsKI.js} +8 -8
  124. package/dist/{rules-DaMaMHgb.js.map → rules-znG9bsKI.js.map} +1 -1
  125. package/dist/server.js +13 -13
  126. package/dist/{shared-PK52rW6T.cjs → shared-DaEDCb8I.cjs} +35 -16
  127. package/dist/shared-DaEDCb8I.cjs.map +1 -0
  128. package/dist/{shared-C_cYxNzz.mjs → shared-O-5Fcsxa.mjs} +4 -4
  129. package/dist/{shared-C_cYxNzz.mjs.map → shared-O-5Fcsxa.mjs.map} +1 -1
  130. package/dist/sheet-SlZRjOmw.js +7 -0
  131. package/dist/{sheet-CxkO1Hwt.js.map → sheet-SlZRjOmw.js.map} +1 -1
  132. package/dist/{sidecar-BhvmXYsD.mjs → sidecar-DiYLwXbk.mjs} +3 -3
  133. package/dist/{sidecar-BhvmXYsD.mjs.map → sidecar-DiYLwXbk.mjs.map} +1 -1
  134. package/dist/{style-CAhAnRni.js → style-CtXEZqgx.js} +10 -10
  135. package/dist/{style-CAhAnRni.js.map → style-CtXEZqgx.js.map} +1 -1
  136. package/dist/{styleStore-BzLZwpwy.js → styleStore-BImBZdt6.js} +6 -4
  137. package/dist/styleStore-BImBZdt6.js.map +1 -0
  138. package/dist/{styleStore-DaIJ4OPV.js → styleStore-CBan0gHQ.js} +9 -7
  139. package/dist/styleStore-CBan0gHQ.js.map +1 -0
  140. package/dist/{token-D33mKTka.js → token-DyLO6Hnf.js} +2 -2
  141. package/dist/{token-D33mKTka.js.map → token-DyLO6Hnf.js.map} +1 -1
  142. package/dist/{trace-c2WmBbmX.js → trace-Bsh-Kkg_.js} +2 -2
  143. package/dist/{trace-c2WmBbmX.js.map → trace-Bsh-Kkg_.js.map} +1 -1
  144. package/dist/{trace-B3dpTRJp.js → trace-C1_6fM21.js} +3 -3
  145. package/dist/{trace-B3dpTRJp.js.map → trace-C1_6fM21.js.map} +1 -1
  146. package/dist/{transform-DSpimwwC.js → transform-8TIMiF5A.js} +2 -2
  147. package/dist/{transform-DSpimwwC.js.map → transform-8TIMiF5A.js.map} +1 -1
  148. package/dist/types/adapter/preact.d.ts +1 -0
  149. package/dist/types/adapter/react.d.ts +1 -0
  150. package/dist/types/adapter/solid.d.ts +1 -0
  151. package/dist/types/atomic/atRule/counterStyle.d.ts +10 -0
  152. package/dist/types/atomic/atRule/fontFace.d.ts +10 -0
  153. package/dist/types/atomic/atRule/fontPaletteValues.d.ts +10 -0
  154. package/dist/types/atomic/atRule/fontSrc.d.ts +1 -0
  155. package/dist/types/atomic/atRule/keyframes.d.ts +13 -0
  156. package/dist/types/atomic/atRule/positionTry.d.ts +13 -0
  157. package/dist/types/atomic/atRule/property.d.ts +13 -0
  158. package/dist/types/atomic/atRule/utils.d.ts +5 -0
  159. package/dist/types/atomic/className.d.ts +11 -0
  160. package/dist/types/atomic/debug/className/className.d.ts +9 -0
  161. package/dist/types/atomic/debug/className/index.d.ts +1 -0
  162. package/dist/types/atomic/debug/property/data.d.ts +3 -0
  163. package/dist/types/atomic/debug/property/index.d.ts +1 -0
  164. package/dist/types/atomic/debug/property/property.d.ts +5 -0
  165. package/dist/types/atomic/debug/selector.d.ts +2 -0
  166. package/dist/types/atomic/debug/value.d.ts +5 -0
  167. package/dist/types/atomic/element.d.ts +5 -0
  168. package/dist/types/atomic/layer/index.d.ts +3 -0
  169. package/dist/types/atomic/layer/layer.d.ts +12 -0
  170. package/dist/types/atomic/layer/types.d.ts +30 -0
  171. package/dist/types/atomic/layer/utils.d.ts +4 -0
  172. package/dist/types/atomic/property/index.d.ts +2 -0
  173. package/dist/types/atomic/property/presets.d.ts +4 -0
  174. package/dist/types/atomic/property/property.d.ts +3 -0
  175. package/dist/types/atomic/property/type_maps.d.ts +31 -0
  176. package/dist/types/atomic/property/types.d.ts +4 -0
  177. package/dist/types/atomic/rule.d.ts +5 -0
  178. package/dist/types/atomic/scope.d.ts +3 -0
  179. package/dist/types/atomic/theme.d.ts +7 -0
  180. package/dist/types/atomic/token.d.ts +7 -0
  181. package/dist/types/atomic/utils/cssIdent.d.ts +2 -0
  182. package/dist/types/atomic/utils/cssVar.d.ts +3 -0
  183. package/dist/types/atomic/utils/debug.d.ts +4 -0
  184. package/dist/types/atomic/utils/format.d.ts +5 -0
  185. package/dist/types/atomic/utils/hash.d.ts +1 -0
  186. package/dist/types/atomic/utils/selector.d.ts +6 -0
  187. package/dist/types/atomic/utils/types.d.ts +7 -0
  188. package/dist/types/atomic/value/index.d.ts +2 -0
  189. package/dist/types/atomic/value/unitless.d.ts +1 -0
  190. package/dist/types/atomic/value/value.d.ts +2 -0
  191. package/dist/types/atomic/var.d.ts +4 -0
  192. package/dist/types/builder/classname/class_name_builder.d.ts +4 -0
  193. package/dist/types/builder/classname/fns.d.ts +48 -0
  194. package/dist/types/builder/classname/index.d.ts +3 -0
  195. package/dist/types/builder/classname/types.d.ts +18 -0
  196. package/dist/types/builder/data/check_selector.d.ts +2 -0
  197. package/dist/types/builder/data/const.d.ts +26 -0
  198. package/dist/types/builder/data/create.d.ts +13 -0
  199. package/dist/types/builder/data/data.d.ts +44 -0
  200. package/dist/types/builder/data/debug.d.ts +38 -0
  201. package/dist/types/builder/data/index.d.ts +8 -0
  202. package/dist/types/builder/data/is.d.ts +16 -0
  203. package/dist/types/builder/data/merge/index.d.ts +2 -0
  204. package/dist/types/builder/data/merge/scope.d.ts +7 -0
  205. package/dist/types/builder/data/merge/style.d.ts +6 -0
  206. package/dist/types/builder/data/merge/utils.d.ts +5 -0
  207. package/dist/types/builder/data/selector.d.ts +8 -0
  208. package/dist/types/builder/data/state.d.ts +85 -0
  209. package/dist/types/builder/extract/index.d.ts +7 -0
  210. package/dist/types/builder/extract/scope.d.ts +14 -0
  211. package/dist/types/builder/extract/sheet.d.ts +10 -0
  212. package/dist/types/builder/extract/slot.d.ts +9 -0
  213. package/dist/types/builder/extract/style.d.ts +11 -0
  214. package/dist/types/builder/extract/theme.d.ts +2 -0
  215. package/dist/types/builder/extract/token.d.ts +7 -0
  216. package/dist/types/builder/extract/utils.d.ts +28 -0
  217. package/dist/types/builder/extract/withTokens.d.ts +10 -0
  218. package/dist/types/builder/index.d.ts +2 -0
  219. package/dist/types/builder/selector_override.d.ts +5 -0
  220. package/dist/types/builder/selector_override_core.d.ts +6 -0
  221. package/dist/types/builder/style_builder.d.ts +15 -0
  222. package/dist/types/builder/style_data.d.ts +8 -0
  223. package/dist/types/builder/style_fns.d.ts +14 -0
  224. package/dist/types/builder/token/data.d.ts +10 -0
  225. package/dist/types/builder/token/name.d.ts +3 -0
  226. package/dist/types/builder/token/symbols.d.ts +4 -0
  227. package/dist/types/builder/types/alias.d.ts +59 -0
  228. package/dist/types/builder/types/fns.d.ts +115 -0
  229. package/dist/types/builder/types/index.d.ts +1 -0
  230. package/dist/types/builder/types/types.d.ts +22 -0
  231. package/dist/types/builder/utils.d.ts +9 -0
  232. package/dist/types/compiler/compiler/cache.d.ts +24 -0
  233. package/dist/types/compiler/compiler/compiler.d.ts +28 -0
  234. package/dist/types/compiler/compiler/constants.d.ts +6 -0
  235. package/dist/types/compiler/compiler/index.d.ts +4 -0
  236. package/dist/types/compiler/compiler/types.d.ts +53 -0
  237. package/dist/types/compiler/cssProp.d.ts +8 -0
  238. package/dist/types/compiler/extract/collector.d.ts +8 -0
  239. package/dist/types/compiler/extract/extract.d.ts +6 -0
  240. package/dist/types/compiler/extract/index.d.ts +3 -0
  241. package/dist/types/compiler/extract/types.d.ts +23 -0
  242. package/dist/types/compiler/index.d.ts +3 -0
  243. package/dist/types/compiler/transform/cssProp/index.d.ts +1 -0
  244. package/dist/types/compiler/transform/cssProp/plugin.d.ts +13 -0
  245. package/dist/types/compiler/transform/debug/index.d.ts +2 -0
  246. package/dist/types/compiler/transform/debug/plugin.d.ts +34 -0
  247. package/dist/types/compiler/transform/debug/transform.d.ts +7 -0
  248. package/dist/types/compiler/transform/debug/utils/debug_data.d.ts +11 -0
  249. package/dist/types/compiler/transform/debug/utils/source_url.d.ts +2 -0
  250. package/dist/types/compiler/transform/evaluator/evaluator.d.ts +41 -0
  251. package/dist/types/compiler/transform/evaluator/index.d.ts +3 -0
  252. package/dist/types/compiler/transform/evaluator/tracer.d.ts +8 -0
  253. package/dist/types/compiler/transform/evaluator/types.d.ts +21 -0
  254. package/dist/types/compiler/transform/extract/chain/chain.d.ts +18 -0
  255. package/dist/types/compiler/transform/extract/chain/extract_chain.d.ts +19 -0
  256. package/dist/types/compiler/transform/extract/chain/index.d.ts +3 -0
  257. package/dist/types/compiler/transform/extract/chain/types.d.ts +32 -0
  258. package/dist/types/compiler/transform/extract/index.d.ts +2 -0
  259. package/dist/types/compiler/transform/extract/plugin.d.ts +20 -0
  260. package/dist/types/compiler/transform/extract/transform.d.ts +10 -0
  261. package/dist/types/compiler/transform/extract/utils/imports.d.ts +3 -0
  262. package/dist/types/compiler/transform/extract/utils/replacement.d.ts +9 -0
  263. package/dist/types/compiler/transform/extract/utils/slot.d.ts +4 -0
  264. package/dist/types/compiler/transform/extract/utils/state.d.ts +34 -0
  265. package/dist/types/compiler/transform/extract/utils/theme.d.ts +9 -0
  266. package/dist/types/compiler/transform/extract/utils/token.d.ts +1 -0
  267. package/dist/types/compiler/transform/index.d.ts +5 -0
  268. package/dist/types/compiler/transform/syntax/index.d.ts +5 -0
  269. package/dist/types/compiler/transform/syntax/isStaticStyleValue.d.ts +2 -0
  270. package/dist/types/compiler/transform/syntax/isStyleChainCall.d.ts +2 -0
  271. package/dist/types/compiler/transform/syntax/static_ids.d.ts +16 -0
  272. package/dist/types/compiler/transform/syntax/types.d.ts +4 -0
  273. package/dist/types/compiler/transform/syntax/utils.d.ts +5 -0
  274. package/dist/types/compiler/transform/utils/babel.d.ts +21 -0
  275. package/dist/types/compiler/transform/utils/import.d.ts +2 -0
  276. package/dist/types/compiler/transform/utils/path.d.ts +1 -0
  277. package/dist/types/compiler/transform/utils/selector.d.ts +18 -0
  278. package/dist/types/compiler/utils/constants.d.ts +68 -0
  279. package/dist/types/compiler/utils/file_resolver.d.ts +12 -0
  280. package/dist/types/compiler/utils/import_source.d.ts +28 -0
  281. package/dist/types/compiler/utils/imports.d.ts +6 -0
  282. package/dist/types/compiler/utils/path.d.ts +4 -0
  283. package/dist/types/compiler/utils/sourcemap.d.ts +36 -0
  284. package/dist/types/config/build.d.ts +20 -0
  285. package/dist/types/config/config/check.d.ts +11 -0
  286. package/dist/types/config/config/css.d.ts +28 -0
  287. package/dist/types/config/config/css_extra.d.ts +13 -0
  288. package/dist/types/config/config/debug.d.ts +14 -0
  289. package/dist/types/config/config/dev.d.ts +36 -0
  290. package/dist/types/config/config/runtime.d.ts +10 -0
  291. package/dist/types/config/configure.d.ts +12 -0
  292. package/dist/types/config/constants.d.ts +1 -0
  293. package/dist/types/config/index.d.ts +2 -0
  294. package/dist/types/config/types.d.ts +47 -0
  295. package/dist/types/config/utils.d.ts +2 -0
  296. package/dist/types/css/counterStyle.d.ts +4 -0
  297. package/dist/types/css/fontFace.d.ts +5 -0
  298. package/dist/types/css/fontPaletteValues.d.ts +4 -0
  299. package/dist/types/css/index.d.ts +9 -0
  300. package/dist/types/css/keyframes.d.ts +4 -0
  301. package/dist/types/css/positionTry.d.ts +4 -0
  302. package/dist/types/css/property.d.ts +7 -0
  303. package/dist/types/css/sheet.d.ts +7 -0
  304. package/dist/types/css/styleTarget.d.ts +9 -0
  305. package/dist/types/css/utils.d.ts +19 -0
  306. package/dist/types/dev/config.d.ts +6 -0
  307. package/dist/types/dev/fns.d.ts +14 -0
  308. package/dist/types/dev/index.d.ts +2 -0
  309. package/dist/types/dev/trace.d.ts +8 -0
  310. package/dist/types/dev/utils.d.ts +5 -0
  311. package/dist/types/dialect/extracted/index.d.ts +1 -0
  312. package/dist/types/dialect/index.d.ts +1 -0
  313. package/dist/types/dialect/namedTokens.d.ts +9 -0
  314. package/dist/types/entry/dev/adapter/preact.d.ts +1 -0
  315. package/dist/types/entry/dev/adapter/react.d.ts +1 -0
  316. package/dist/types/entry/dev/adapter/solid.d.ts +1 -0
  317. package/dist/types/entry/dev/config.d.ts +2 -0
  318. package/dist/types/entry/dev/css.d.ts +2 -0
  319. package/dist/types/entry/dev/index.d.ts +3 -0
  320. package/dist/types/entry/dev/jsx_dev_runtime.d.ts +3 -0
  321. package/dist/types/entry/dev/sheet.d.ts +1 -0
  322. package/dist/types/entry/prod/adapter/preact.d.ts +1 -0
  323. package/dist/types/entry/prod/adapter/react.d.ts +1 -0
  324. package/dist/types/entry/prod/adapter/solid.d.ts +1 -0
  325. package/dist/types/entry/prod/config.d.ts +2 -0
  326. package/dist/types/entry/prod/config_debug.d.ts +2 -0
  327. package/dist/types/entry/prod/css.d.ts +2 -0
  328. package/dist/types/entry/prod/extract.d.ts +1 -0
  329. package/dist/types/entry/prod/index.d.ts +2 -0
  330. package/dist/types/entry/prod/jsx_runtime.d.ts +2 -0
  331. package/dist/types/entry/prod/runtime.d.ts +8 -0
  332. package/dist/types/entry/rsc_dev/adapter/preact.d.ts +1 -0
  333. package/dist/types/entry/rsc_dev/adapter/react.d.ts +1 -0
  334. package/dist/types/entry/rsc_dev/adapter/solid.d.ts +1 -0
  335. package/dist/types/entry/rsc_dev/config.d.ts +2 -0
  336. package/dist/types/entry/rsc_dev/css.d.ts +2 -0
  337. package/dist/types/entry/rsc_dev/index.d.ts +2 -0
  338. package/dist/types/entry/rsc_dev/server.d.ts +10 -0
  339. package/dist/types/entry/rsc_prod/adapter/preact.d.ts +1 -0
  340. package/dist/types/entry/rsc_prod/adapter/react.d.ts +1 -0
  341. package/dist/types/entry/rsc_prod/adapter/solid.d.ts +1 -0
  342. package/dist/types/entry/rsc_prod/config.d.ts +2 -0
  343. package/dist/types/entry/rsc_prod/config_debug.d.ts +2 -0
  344. package/dist/types/entry/rsc_prod/css.d.ts +2 -0
  345. package/dist/types/entry/rsc_prod/index.d.ts +2 -0
  346. package/dist/types/entry/rsc_prod/jsx_runtime.d.ts +2 -0
  347. package/dist/types/entry/rsc_prod/runtime.d.ts +4 -0
  348. package/dist/types/entry/rsc_prod/server.d.ts +6 -0
  349. package/dist/types/entry/shared/config.d.ts +1 -0
  350. package/dist/types/entry/shared/config_debug.d.ts +1 -0
  351. package/dist/types/entry/shared/config_dev.d.ts +1 -0
  352. package/dist/types/entry/shared/dev.d.ts +1 -0
  353. package/dist/types/entry/shared/prod.d.ts +1 -0
  354. package/dist/types/entry/shared/utils.d.ts +2 -0
  355. package/dist/types/index.d.ts +9 -0
  356. package/dist/types/jsx/extracted/jsx_runtime.d.ts +7 -0
  357. package/dist/types/jsx/rsc/jsx_runtime.d.ts +7 -0
  358. package/dist/types/jsx/rsc_extracted/jsx_runtime.d.ts +2 -0
  359. package/dist/types/jsx/runtime/jsx_dev_runtime.d.ts +6 -0
  360. package/dist/types/jsx/runtime/jsx_runtime.d.ts +7 -0
  361. package/dist/types/jsx/types/index.d.ts +1 -0
  362. package/dist/types/jsx/types/preact.d.ts +12 -0
  363. package/dist/types/jsx/types/react.d.ts +10 -0
  364. package/dist/types/jsx/types/solid.d.ts +12 -0
  365. package/dist/types/jsx/utils.d.ts +19 -0
  366. package/dist/types/plugin/bundler/farm/index.d.ts +1 -0
  367. package/dist/types/plugin/bundler/farm/plugin.d.ts +91 -0
  368. package/dist/types/plugin/bundler/parcel/index.d.ts +1 -0
  369. package/dist/types/plugin/bundler/parcel/optimizer.d.ts +3 -0
  370. package/dist/types/plugin/bundler/parcel/plugin.d.ts +6 -0
  371. package/dist/types/plugin/bundler/parcel/resolver.d.ts +3 -0
  372. package/dist/types/plugin/bundler/parcel/runtime.d.ts +3 -0
  373. package/dist/types/plugin/bundler/parcel/shared.d.ts +37 -0
  374. package/dist/types/plugin/bundler/parcel/transformer.d.ts +3 -0
  375. package/dist/types/plugin/bundler/rspack/index.d.ts +1 -0
  376. package/dist/types/plugin/bundler/rspack/plugin.d.ts +7 -0
  377. package/dist/types/plugin/bundler/vite/index.d.ts +1 -0
  378. package/dist/types/plugin/bundler/vite/plugin.d.ts +6 -0
  379. package/dist/types/plugin/bundler/vite/state.d.ts +55 -0
  380. package/dist/types/plugin/bundler/webpack/index.d.ts +1 -0
  381. package/dist/types/plugin/bundler/webpack/loader.d.ts +2 -0
  382. package/dist/types/plugin/bundler/webpack/plugin.d.ts +11 -0
  383. package/dist/types/plugin/bundler/webpack/shared/loader.d.ts +31 -0
  384. package/dist/types/plugin/bundler/webpack/shared/registry.d.ts +4 -0
  385. package/dist/types/plugin/bundler/webpack/utils.d.ts +18 -0
  386. package/dist/types/plugin/nextjs/constants.d.ts +3 -0
  387. package/dist/types/plugin/nextjs/html.d.ts +1 -0
  388. package/dist/types/plugin/nextjs/index.d.ts +2 -0
  389. package/dist/types/plugin/nextjs/loader.d.ts +3 -0
  390. package/dist/types/plugin/nextjs/plugin.d.ts +5 -0
  391. package/dist/types/plugin/nextjs/types.d.ts +21 -0
  392. package/dist/types/plugin/nextjs/utils.d.ts +59 -0
  393. package/dist/types/plugin/utils/cache/css_cache.d.ts +34 -0
  394. package/dist/types/plugin/utils/cache/file.d.ts +4 -0
  395. package/dist/types/plugin/utils/cache/index.d.ts +2 -0
  396. package/dist/types/plugin/utils/compiler.d.ts +40 -0
  397. package/dist/types/plugin/utils/constants.d.ts +4 -0
  398. package/dist/types/plugin/utils/cssMarker.d.ts +4 -0
  399. package/dist/types/plugin/utils/cssOutput.d.ts +10 -0
  400. package/dist/types/plugin/utils/filter.d.ts +14 -0
  401. package/dist/types/plugin/utils/imports.d.ts +3 -0
  402. package/dist/types/plugin/utils/index.d.ts +10 -0
  403. package/dist/types/plugin/utils/injection.d.ts +3 -0
  404. package/dist/types/plugin/utils/misc.d.ts +1 -0
  405. package/dist/types/plugin/utils/runtimeEntry.d.ts +8 -0
  406. package/dist/types/plugin/utils/sidecar/index.d.ts +1 -0
  407. package/dist/types/plugin/utils/sidecar/server.d.ts +19 -0
  408. package/dist/types/plugin/utils/sidecar/sidecar.d.ts +17 -0
  409. package/dist/types/plugin/utils/sidecar/utils.d.ts +33 -0
  410. package/dist/types/plugin/utils/sourcemap.d.ts +9 -0
  411. package/dist/types/plugin/utils/virtual.d.ts +12 -0
  412. package/dist/types/presets/tailwind/classname/index.d.ts +2 -0
  413. package/dist/types/presets/tailwind/classname/transform.d.ts +8 -0
  414. package/dist/types/presets/tailwind/classname/types.d.ts +27 -0
  415. package/dist/types/presets/tailwind/index.d.ts +5 -0
  416. package/dist/types/presets/tailwind/selectors.d.ts +68 -0
  417. package/dist/types/presets/tailwind/style/index.d.ts +2 -0
  418. package/dist/types/presets/tailwind/style/transform.d.ts +8 -0
  419. package/dist/types/presets/tailwind/style/types.d.ts +149 -0
  420. package/dist/types/presets/tailwind/theme.d.ts +477 -0
  421. package/dist/types/presets/tailwind/types.d.ts +53 -0
  422. package/dist/types/runtime/adapter/utils.d.ts +12 -0
  423. package/dist/types/runtime/core/cache/combine.d.ts +6 -0
  424. package/dist/types/runtime/core/cache/combineRuntime.d.ts +1 -0
  425. package/dist/types/runtime/core/cache/item.d.ts +15 -0
  426. package/dist/types/runtime/core/cache/itemWithResolver.d.ts +4 -0
  427. package/dist/types/runtime/core/cache/pool.d.ts +16 -0
  428. package/dist/types/runtime/core/cache/prop.d.ts +19 -0
  429. package/dist/types/runtime/core/cache/propCache.d.ts +12 -0
  430. package/dist/types/runtime/core/cache/resolvedItem.d.ts +5 -0
  431. package/dist/types/runtime/core/cache/result.d.ts +9 -0
  432. package/dist/types/runtime/core/cache/stateItem.d.ts +8 -0
  433. package/dist/types/runtime/core/cache/token.d.ts +2 -0
  434. package/dist/types/runtime/core/cache/tokenValues.d.ts +26 -0
  435. package/dist/types/runtime/core/cache/utils/tree.d.ts +12 -0
  436. package/dist/types/runtime/core/cache/utils/walk.d.ts +1 -0
  437. package/dist/types/runtime/core/className.d.ts +18 -0
  438. package/dist/types/runtime/core/combinedStyle.d.ts +20 -0
  439. package/dist/types/runtime/core/createTransformElement.d.ts +4 -0
  440. package/dist/types/runtime/core/elementMarker.d.ts +12 -0
  441. package/dist/types/runtime/core/elementMarkerData.d.ts +7 -0
  442. package/dist/types/runtime/core/getClassName.d.ts +4 -0
  443. package/dist/types/runtime/core/getSheetRules.d.ts +3 -0
  444. package/dist/types/runtime/core/getToken.d.ts +3 -0
  445. package/dist/types/runtime/core/index.d.ts +5 -0
  446. package/dist/types/runtime/core/jsx.d.ts +1 -0
  447. package/dist/types/runtime/core/resolveClassNameRuntime.d.ts +8 -0
  448. package/dist/types/runtime/env.d.ts +2 -0
  449. package/dist/types/runtime/extract/combineStyle.d.ts +27 -0
  450. package/dist/types/runtime/extract/getClassName.d.ts +10 -0
  451. package/dist/types/runtime/extract/index.d.ts +6 -0
  452. package/dist/types/runtime/extract/jsx.d.ts +10 -0
  453. package/dist/types/runtime/extract/token.d.ts +5 -0
  454. package/dist/types/runtime/extract/tokenResolver.d.ts +2 -0
  455. package/dist/types/runtime/rsc/constants.d.ts +4 -0
  456. package/dist/types/runtime/rsc/dev.d.ts +6 -0
  457. package/dist/types/runtime/rsc/getClassName.d.ts +24 -0
  458. package/dist/types/runtime/rsc/index.d.ts +1 -0
  459. package/dist/types/runtime/rsc/jsx.d.ts +1 -0
  460. package/dist/types/runtime/rsc/observer.d.ts +5 -0
  461. package/dist/types/runtime/rsc/styleStore.d.ts +5 -0
  462. package/dist/types/runtime/sheet/element.d.ts +2 -0
  463. package/dist/types/runtime/sheet/global.d.ts +3 -0
  464. package/dist/types/runtime/sheet/index.d.ts +3 -0
  465. package/dist/types/runtime/sheet/insert.d.ts +5 -0
  466. package/dist/types/runtime/sheet/rule.d.ts +8 -0
  467. package/dist/types/runtime/sheet/rules.d.ts +10 -0
  468. package/dist/types/runtime/sheet/theme.d.ts +5 -0
  469. package/dist/types/runtime/style/index.d.ts +3 -0
  470. package/dist/types/runtime/style/scope.d.ts +4 -0
  471. package/dist/types/runtime/style/style.d.ts +27 -0
  472. package/dist/types/runtime/style/token.d.ts +1 -0
  473. package/dist/types/runtime/types.d.ts +28 -0
  474. package/dist/types/selector/assert.d.ts +13 -0
  475. package/dist/types/selector/index.d.ts +5 -0
  476. package/dist/types/selector/presets/default.d.ts +108 -0
  477. package/dist/types/selector/presets/index.d.ts +3 -0
  478. package/dist/types/selector/presets/minimal.d.ts +46 -0
  479. package/dist/types/selector/presets/selectors.d.ts +62 -0
  480. package/dist/types/selector/selector.d.ts +12 -0
  481. package/dist/types/selector/types.d.ts +12 -0
  482. package/dist/types/selector/validate.d.ts +5 -0
  483. package/dist/types/sheet/dev/dev_layer.d.ts +4 -0
  484. package/dist/types/sheet/dev/dev_sort.d.ts +2 -0
  485. package/dist/types/sheet/dev/index.d.ts +5 -0
  486. package/dist/types/sheet/dev/utils.d.ts +26 -0
  487. package/dist/types/sheet/index.d.ts +4 -0
  488. package/dist/types/sheet/prod.d.ts +2 -0
  489. package/dist/types/sheet/sheet.d.ts +2 -0
  490. package/dist/types/sheet/sourcemap.d.ts +11 -0
  491. package/dist/types/sheet/types.d.ts +30 -0
  492. package/dist/types/sheet/utils/dom.d.ts +5 -0
  493. package/dist/types/sheet/utils/index.d.ts +4 -0
  494. package/dist/types/sheet/utils/layer.d.ts +10 -0
  495. package/dist/types/sheet/utils/noop.d.ts +2 -0
  496. package/dist/types/sheet/utils/rule.d.ts +3 -0
  497. package/dist/types/sheet/utils/sourcemap.d.ts +12 -0
  498. package/dist/types/style/classname.d.ts +15 -0
  499. package/dist/types/style/important.d.ts +8 -0
  500. package/dist/types/style/index.d.ts +12 -0
  501. package/dist/types/style/keyframes.d.ts +10 -0
  502. package/dist/types/style/style.d.ts +426 -0
  503. package/dist/types/style/theme.d.ts +5 -0
  504. package/dist/types/style/token.d.ts +29 -0
  505. package/dist/types/style/tokens.d.ts +10 -0
  506. package/dist/types/style/transform.d.ts +21 -0
  507. package/dist/types/style/types.d.ts +22 -0
  508. package/dist/types/style/utils/expose.d.ts +8 -0
  509. package/dist/types/style/utils/index.d.ts +1 -0
  510. package/dist/types/style/value.d.ts +12 -0
  511. package/dist/types/style/valueRef.d.ts +13 -0
  512. package/dist/types/style/weight.d.ts +9 -0
  513. package/dist/types/utils/global.d.ts +4 -0
  514. package/dist/types/utils/hash.d.ts +3 -0
  515. package/dist/types/utils/id.d.ts +12 -0
  516. package/dist/types/utils/object.d.ts +10 -0
  517. package/dist/types/utils/symbol.d.ts +1 -0
  518. package/dist/types/utils/trace.d.ts +21 -0
  519. package/dist/types/utils/type.d.ts +11 -0
  520. package/dist/{utils-H1VInWpd.js → utils-10MTZOuB.js} +31 -15
  521. package/dist/utils-10MTZOuB.js.map +1 -0
  522. package/dist/{utils-NdisireF.mjs → utils-BBN9msTv.mjs} +4 -4
  523. package/dist/{utils-NdisireF.mjs.map → utils-BBN9msTv.mjs.map} +1 -1
  524. package/dist/{utils-DND33M6y.mjs → utils-Bjh9pO87.mjs} +3 -3
  525. package/dist/{utils-DND33M6y.mjs.map → utils-Bjh9pO87.mjs.map} +1 -1
  526. package/dist/{utils-DZK0mfmY.js → utils-DoKJnvxk.js} +3 -3
  527. package/dist/{utils-DZK0mfmY.js.map → utils-DoKJnvxk.js.map} +1 -1
  528. package/dist/utils.js +3 -3
  529. package/dist/{value-CK0-Xbov.js → value-Dg6ALjjj.js} +2 -2
  530. package/dist/{value-CK0-Xbov.js.map → value-Dg6ALjjj.js.map} +1 -1
  531. package/dist/{webpack-D7QO0bKN.mjs → webpack-C1j49Psk.mjs} +5 -5
  532. package/dist/{webpack-D7QO0bKN.mjs.map → webpack-C1j49Psk.mjs.map} +1 -1
  533. package/jsx/types/solid.ts +8 -25
  534. package/package.json +76 -72
  535. package/plugin/bundler/webpack/shared/loader.ts +4 -0
  536. package/plugin/nextjs/plugin.ts +7 -8
  537. package/runtime/rsc/observer.ts +4 -1
  538. package/runtime/rsc/styleStore.ts +6 -2
  539. package/runtime/sheet/rule.ts +2 -2
  540. package/sheet/dev/dev_layer.ts +7 -3
  541. package/sheet/dev/dev_sort.ts +18 -11
  542. package/sheet/prod.ts +7 -3
  543. package/sheet/types.ts +2 -1
  544. package/sheet/utils/layer.ts +2 -1
  545. package/dist/compiler-C3CEGGtI.mjs.map +0 -1
  546. package/dist/css-BDn0epJ8.js.map +0 -1
  547. package/dist/css-CFxNrYt3.js.map +0 -1
  548. package/dist/css-DEYgrj76.js.map +0 -1
  549. package/dist/elementMarker-kvpMjB49.js.map +0 -1
  550. package/dist/env-Cz8frh6e.js.map +0 -1
  551. package/dist/loader-_-VjzlrX.mjs.map +0 -1
  552. package/dist/shared-PK52rW6T.cjs.map +0 -1
  553. package/dist/sheet-CxkO1Hwt.js +0 -7
  554. package/dist/styleStore-BzLZwpwy.js.map +0 -1
  555. package/dist/styleStore-DaIJ4OPV.js.map +0 -1
  556. package/dist/utils-H1VInWpd.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleStore-CBan0gHQ.js","names":[],"sources":["../runtime/rsc/constants.ts","../runtime/rsc/styleStore.ts"],"sourcesContent":["export const ELEMENT_CSS_DATA_ATTR = 'data-css-dev';\n\nexport const PRECOLLECT_LINK_TAG_ATTR = 'data-fluentic-style-rsc-dev-link';\n\nexport const SEED_STYLE_TAG_ATTR = 'data-fluentic-style-rsc-dev-style';\nexport const SEED_STYLE_TAG_HREF = 'href-fluentic-style-rsc-dev-style';\n","import { getLayerBlockCss, getLayerOrderCss, joinLayerCss } from '../../atomic/layer';\nimport { CSS_CONFIG, CSS_CONFIG_DEFAULT, isStyleLayerEnabled } from '../../config/config/css';\nimport { RUNTIME_CONFIG } from '../../config/config/runtime';\nimport type { SheetRule } from '../../sheet';\nimport {\n createSheetLayerState,\n getSheetLayerName,\n getSheetLayerNames,\n getSheetRuleLayerPriority,\n} from '../../sheet/utils';\nimport { clearGlobalData, getGlobalData, globalData } from '../../utils/global';\nimport { IS_SERVER_RUNTIME } from '../env';\n\nconst GLOBAL_KEY = 'runtime.rsc.styleStore';\n\ntype RscStyleStore = {\n rules: SheetRule[];\n keys: Set<string>;\n //\n counter: number;\n lastCounter: number;\n};\n\nexport function addRscStyleRules(rules: SheetRule[]): void {\n if (!RUNTIME_CONFIG.isRSC) return;\n if (!IS_SERVER_RUNTIME) return;\n\n const store = getRscStyleStore();\n\n for (let i = 0, len = rules.length; i < len; i++) {\n const rule = rules[i];\n if (!rule.key || !rule.css || store.keys.has(rule.key)) continue;\n\n store.keys.add(rule.key);\n store.rules.push(rule);\n }\n\n store.counter += 1;\n}\n\nexport function getRscStyleCssIfChanged() {\n const store = getGlobalData<RscStyleStore>(GLOBAL_KEY);\n if (!store) return null;\n\n if (store.counter === store.lastCounter) return null;\n\n store.lastCounter = store.counter;\n\n return getRscStyleCss();\n}\n\nexport function getRscStyleCss(): string {\n if (!RUNTIME_CONFIG.isRSC) return '';\n if (!IS_SERVER_RUNTIME) return '';\n\n const store = getGlobalData<RscStyleStore>(GLOBAL_KEY);\n if (!store?.rules.length) return '';\n\n const layerState = createSheetLayerState();\n\n let hasSheetLayer = false;\n const namedLayers = new Set<string>();\n const cssItems = store.rules.map((rule) => {\n const ruleLayer = rule.layer ?? 'style';\n if (ruleLayer === 'sheet') hasSheetLayer = true;\n if (typeof ruleLayer === 'object') namedLayers.add(ruleLayer.name);\n const layerName = typeof ruleLayer === 'object'\n ? ruleLayer.name\n : ruleLayer === 'sheet'\n ? getSheetLayerName()\n : ruleLayer === false || !isStyleLayerEnabled()\n ? null\n : layerState.getName(getSheetRuleLayerPriority(rule.priority, rule.important));\n\n return layerName ? getLayerBlockCss(layerName, rule.css) : rule.css;\n });\n\n const layerOrderCss = getLayerOrderCss(\n CSS_CONFIG.layers ?? CSS_CONFIG_DEFAULT.layers ?? [],\n getSheetLayerNames(layerState, hasSheetLayer, namedLayers),\n );\n\n return joinLayerCss(layerOrderCss, cssItems);\n}\n\nfunction getRscStyleStore(): RscStyleStore {\n return globalData(GLOBAL_KEY, () => ({\n counter: 0,\n lastCounter: 0,\n rules: [],\n keys: new Set(),\n }));\n}\n\nexport function clearRscStyleStore(): void {\n clearGlobalData(GLOBAL_KEY);\n}\n"],"mappings":";;;;;AAAA,MAAa,wBAAwB;AAErC,MAAa,2BAA2B;AAExC,MAAa,sBAAsB;AACnC,MAAa,sBAAsB;;;ACQnC,MAAM,aAAa;AAUnB,SAAgB,iBAAiB,OAA0B;CACzD,IAAI,CAAC,eAAe,OAAO;CAC3B,IAAI,CAAC,mBAAmB;CAExB,MAAM,QAAQ,iBAAiB;CAE/B,KAAK,IAAI,IAAI,GAAG,MAAM,MAAM,QAAQ,IAAI,KAAK,KAAK;EAChD,MAAM,OAAO,MAAM;EACnB,IAAI,CAAC,KAAK,OAAO,CAAC,KAAK,OAAO,MAAM,KAAK,IAAI,KAAK,GAAG,GAAG;EAExD,MAAM,KAAK,IAAI,KAAK,GAAG;EACvB,MAAM,MAAM,KAAK,IAAI;CACvB;CAEA,MAAM,WAAW;AACnB;AAEA,SAAgB,0BAA0B;CACxC,MAAM,QAAQ,cAA6B,UAAU;CACrD,IAAI,CAAC,OAAO,OAAO;CAEnB,IAAI,MAAM,YAAY,MAAM,aAAa,OAAO;CAEhD,MAAM,cAAc,MAAM;CAE1B,OAAO,eAAe;AACxB;AAEA,SAAgB,iBAAyB;CACvC,IAAI,CAAC,eAAe,OAAO,OAAO;CAClC,IAAI,CAAC,mBAAmB,OAAO;CAE/B,MAAM,QAAQ,cAA6B,UAAU;CACrD,IAAI,CAAC,OAAO,MAAM,QAAQ,OAAO;CAEjC,MAAM,aAAa,sBAAsB;CAEzC,IAAI,gBAAgB;CACpB,MAAM,8BAAc,IAAI,IAAY;CACpC,MAAM,WAAW,MAAM,MAAM,KAAK,SAAS;EACzC,MAAM,YAAY,KAAK,SAAS;EAChC,IAAI,cAAc,SAAS,gBAAgB;EAC3C,IAAI,OAAO,cAAc,UAAU,YAAY,IAAI,UAAU,IAAI;EACjE,MAAM,YAAY,OAAO,cAAc,WACnC,UAAU,OACV,cAAc,UACd,kBAAkB,IAClB,cAAc,SAAS,CAAC,oBAAoB,IAC5C,OACA,WAAW,QAAQ,0BAA0B,KAAK,UAAU,KAAK,SAAS,CAAC;EAE/E,OAAO,YAAY,iBAAiB,WAAW,KAAK,GAAG,IAAI,KAAK;CAClE,CAAC;CAOD,OAAO,aALe,iBACpB,WAAW,UAAU,mBAAmB,UAAU,CAAC,GACnD,mBAAmB,YAAY,eAAe,WAAW,CAG3B,GAAG,QAAQ;AAC7C;AAEA,SAAS,mBAAkC;CACzC,OAAO,WAAW,mBAAmB;EACnC,SAAS;EACT,aAAa;EACb,OAAO,CAAC;EACR,sBAAM,IAAI,IAAI;CAChB,EAAE;AACJ"}
@@ -1,4 +1,4 @@
1
- import { l as symbol, s as globalData, t as CSS_CONFIG } from "./css-DWBWsyxZ.js";
1
+ import { d as symbol, l as globalData, t as CSS_CONFIG } from "./css-D7eTqvMH.js";
2
2
  import { i as createNameFormatter, t as getIdentifierSafeHash } from "./hash-Cr-LCWDt.js";
3
3
  //#region builder/token/symbols.ts
4
4
  const TOKEN_ID = symbol("style:token");
@@ -135,4 +135,4 @@ function getTokenVarFallback(token, tokenNameFormat) {
135
135
  //#endregion
136
136
  export { TOKEN_ID as _, getCssVarRawFallback as a, TOKEN_VAR_NAME as b, createStyleTokenOverride as c, getChildStyleTokenName as d, getStyleTokenId as f, isStyleTokenOverrideData as g, isStyleTokenData as h, escapeCssValue as i, getStyleTokenOverrideDebug as l, getStyleTokenVarName as m, getTokenVar as n, TOKEN_DEBUG as o, getStyleTokenName as p, getTokenVarName as r, createStyleToken as s, getTokenOverrideValue as t, resetStyleTokenIdCounter as u, TOKEN_NAME as v, TOKEN_OVERRIDE as y };
137
137
 
138
- //# sourceMappingURL=token-D33mKTka.js.map
138
+ //# sourceMappingURL=token-DyLO6Hnf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-D33mKTka.js","names":[],"sources":["../builder/token/symbols.ts","../builder/token/data.ts","../builder/token/name.ts","../style/token.ts","../atomic/utils/cssVar.ts","../atomic/token.ts"],"sourcesContent":["import { symbol } from '../../utils/symbol';\n\nexport const TOKEN_ID: unique symbol = symbol('style:token');\nexport const TOKEN_OVERRIDE: unique symbol = symbol('style:token.override');\nexport const TOKEN_NAME: unique symbol = symbol('style:token.name');\nexport const TOKEN_VAR_NAME: unique symbol = symbol('style:token.varName');\n","import type { StyleToken, StyleTokenData, StyleTokenOverride } from '../../style/token';\nimport { TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME } from './symbols';\n\nexport type ExtractedStyleTokenVarName = {\n [TOKEN_VAR_NAME]?: string | null;\n};\n\nexport function isStyleTokenData<T = unknown>(value: unknown): value is StyleToken<T> {\n return !!value &&\n typeof (value as StyleToken)[TOKEN_ID] === 'string' &&\n (value as StyleTokenOverride)[TOKEN_OVERRIDE] !== true;\n}\n\nexport function isStyleTokenOverrideData<T = unknown>(value: unknown): value is StyleTokenOverride<T> {\n return !!value &&\n typeof (value as StyleTokenOverride)[TOKEN_ID] === 'string' &&\n (value as StyleTokenOverride)[TOKEN_OVERRIDE] === true;\n}\n\nexport function getStyleTokenId<T>(token: StyleTokenData<T> | StyleTokenOverride<T>): string {\n return token[TOKEN_ID];\n}\n\nexport function getStyleTokenName<T>(token: StyleTokenData<T> | StyleTokenOverride<T>): string | null {\n return token[TOKEN_NAME] ?? null;\n}\n\nexport function getStyleTokenVarName<T>(token: StyleTokenData<T> | StyleTokenOverride<T>): string | null {\n return (token as ExtractedStyleTokenVarName)[TOKEN_VAR_NAME] ?? null;\n}\n","export function getStyleTokenNameFromId(id: string | undefined): string | null {\n if (!id) return null;\n\n const parts = id.split('--');\n const first = normalizeStyleTokenName(parts[0]);\n\n if (!first) {\n return parts.length > 1 ? normalizeStyleTokenName(parts.slice(1).join('--')) : null;\n }\n\n return normalizeStyleTokenName([first, ...parts.slice(1)].join('--'));\n}\n\nexport function getChildStyleTokenName(\n name: string | null | undefined,\n child: string | null | undefined,\n) {\n const childName = normalizeStyleTokenName(child);\n if (!childName) return normalizeStyleTokenName(name);\n\n const parentName = normalizeStyleTokenName(name);\n return parentName ? parentName + '--' + childName : childName;\n}\n\nexport function normalizeStyleTokenName(value: string | null | undefined): string | null {\n if (!value) return null;\n\n value = value.trim();\n if (!value) return null;\n if (/^\\d+$/.test(value)) return null;\n if (isGeneratedTokenHash(value)) return null;\n\n value = stripGenericTokenPrefix(value);\n if (!value) return null;\n\n const stableSuffix = value.match(/^(.+)-[a-z0-9]{7}$/);\n if (stableSuffix?.[1] && isGeneratedTokenHash(value.slice(-7))) return normalizeStyleTokenName(stableSuffix[1]);\n\n return value;\n}\n\nfunction isGeneratedTokenHash(value: string) {\n return /^[a-z0-9]{7}$/.test(value) && /\\d/.test(value);\n}\n\nfunction stripGenericTokenPrefix(value: string) {\n const parts = value.split('--');\n\n while (parts[0] === 'token' || parts[0] === 'tokens') {\n parts.shift();\n }\n\n return parts.join('--');\n}\n","import type { DebugData } from '../builder/data/debug';\nimport { getStyleTokenId, getStyleTokenName, isStyleTokenData } from '../builder/token/data';\nimport { getStyleTokenNameFromId, normalizeStyleTokenName } from '../builder/token/name';\nimport { globalData } from '../utils/global';\nimport { symbol } from '../utils/symbol';\nexport {\n getStyleTokenId,\n getStyleTokenName,\n getStyleTokenVarName,\n isStyleTokenData,\n isStyleTokenOverrideData,\n} from '../builder/token/data';\nexport { TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME } from '../builder/token/symbols';\nimport { TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME } from '../builder/token/symbols';\n\nexport const TOKEN_DEBUG: unique symbol = symbol('style:token.debug');\n\nexport type StyleTokenData<T = unknown> = {\n [TOKEN_ID]: string;\n [TOKEN_NAME]?: string | null;\n [TOKEN_VAR_NAME]?: string | null;\n [TOKEN_OVERRIDE]?: false;\n value: T;\n ref: StyleTokenData<T> | null;\n};\n\nexport type StyleTokenOverride<T = unknown> = {\n [TOKEN_ID]: string;\n [TOKEN_OVERRIDE]: true;\n [TOKEN_DEBUG]?: DebugData | null;\n [TOKEN_NAME]?: string | null;\n [TOKEN_VAR_NAME]?: string | null;\n value: T;\n ref: StyleTokenData<T> | null;\n};\n\nexport type StyleToken<T = unknown> = StyleTokenData<T> & {\n (value: T | StyleTokenData<T>, debug?: DebugData): StyleTokenOverride<T>;\n};\n\nconst idCounter = globalData('style.token.idCounter', () => ({ value: 0 }));\n\nexport function resetStyleTokenIdCounter() {\n idCounter.value = 0;\n}\n\nexport function createStyleToken<T>(\n value: T | StyleToken<T>,\n stableId?: string,\n debugName?: string | null,\n) {\n const token: StyleToken<T> = (value, debug) => {\n return createStyleTokenOverride(token, value, debug);\n };\n\n token[TOKEN_ID] = stableId || String(idCounter.value++);\n token[TOKEN_NAME] = debugName === undefined ? getStyleTokenNameFromId(stableId) : normalizeStyleTokenName(debugName);\n\n if (isStyleTokenData<T>(value)) {\n token.value = value.value;\n token.ref = value;\n } else {\n token.value = value;\n token.ref = null;\n }\n\n return token;\n}\n\nexport function createStyleTokenOverride<T>(\n token: StyleTokenData<T>,\n value: T | StyleTokenData<T>,\n debug?: DebugData | null,\n): StyleTokenOverride<T> {\n const override: StyleTokenOverride<T> = isStyleTokenData<T>(value)\n ? {\n [TOKEN_ID]: getStyleTokenId(token),\n [TOKEN_OVERRIDE]: true,\n [TOKEN_NAME]: getStyleTokenName(token),\n value: value.value,\n ref: value,\n }\n : {\n [TOKEN_ID]: getStyleTokenId(token),\n [TOKEN_OVERRIDE]: true,\n [TOKEN_NAME]: getStyleTokenName(token),\n value: value as T,\n ref: null,\n };\n\n if (debug) {\n Object.defineProperty(override, TOKEN_DEBUG, {\n configurable: true,\n enumerable: false,\n value: debug,\n });\n }\n\n return override;\n}\n\nexport function getStyleTokenOverrideDebug(\n token: StyleTokenOverride,\n) {\n return token[TOKEN_DEBUG] ?? null;\n}\n","export function getCssVar(varName: string, value: string) {\n return 'var(' + varName + ', ' + escapeCssValue(value) + ')';\n}\n\nexport function getCssVarRawFallback(varName: string, fallbackCss: string) {\n return 'var(' + varName + ', ' + fallbackCss + ')';\n}\n\nexport function escapeCssValue(value: string): string {\n if (!value) return '';\n\n return value\n .trim()\n // Escape existing backslashes first so we don't break them.\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/'/g, \"\\\\'\")\n .replace(/;/g, '\\\\;');\n}\n","import { CSS_CONFIG } from '../config/config/css';\nimport type { TokenNameFormat, TokenNameInfo } from '../config/types';\nimport { getStyleTokenId, getStyleTokenName, type StyleTokenData, type StyleTokenOverride } from '../style/token';\nimport { getCssVar, getCssVarRawFallback } from './utils/cssVar';\nimport { createNameFormatter } from './utils/format';\nimport { getIdentifierSafeHash } from './utils/hash';\n\nexport const TOKEN_NAME_FORMAT = 'token[-(name)]-$hash';\n\nexport const formatTokenName = createNameFormatter<TokenNameInfo>(['name']);\n\nexport function getTokenVarName(\n token: StyleTokenData | StyleTokenOverride,\n format: TokenNameFormat | null,\n) {\n const id = getStyleTokenId(token);\n const debugName = getStyleTokenName(token);\n\n const name = formatTokenName(\n format || TOKEN_NAME_FORMAT,\n getIdentifierSafeHash(id, CSS_CONFIG.hashLength),\n { name: debugName },\n );\n\n return '--' + name;\n}\n\nexport function getTokenVar(\n token: StyleTokenData,\n format: TokenNameFormat | null,\n) {\n return getTokenVarFallback(token, format);\n}\n\nexport function getTokenOverrideValue(\n token: StyleTokenOverride,\n format: TokenNameFormat | null,\n) {\n return token.ref ? getTokenVar(token.ref, format) : token.value;\n}\n\nfunction getTokenVarFallback(\n token: StyleTokenData,\n tokenNameFormat: TokenNameFormat | null,\n): string {\n const varName = getTokenVarName(token, tokenNameFormat);\n\n if (token.ref) {\n return getCssVarRawFallback(\n varName,\n getTokenVarFallback(token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"version":3,"file":"token-DyLO6Hnf.js","names":[],"sources":["../builder/token/symbols.ts","../builder/token/data.ts","../builder/token/name.ts","../style/token.ts","../atomic/utils/cssVar.ts","../atomic/token.ts"],"sourcesContent":["import { symbol } from '../../utils/symbol';\n\nexport const TOKEN_ID: unique symbol = symbol('style:token');\nexport const TOKEN_OVERRIDE: unique symbol = symbol('style:token.override');\nexport const TOKEN_NAME: unique symbol = symbol('style:token.name');\nexport const TOKEN_VAR_NAME: unique symbol = symbol('style:token.varName');\n","import type { StyleToken, StyleTokenData, StyleTokenOverride } from '../../style/token';\nimport { TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME } from './symbols';\n\nexport type ExtractedStyleTokenVarName = {\n [TOKEN_VAR_NAME]?: string | null;\n};\n\nexport function isStyleTokenData<T = unknown>(value: unknown): value is StyleToken<T> {\n return !!value &&\n typeof (value as StyleToken)[TOKEN_ID] === 'string' &&\n (value as StyleTokenOverride)[TOKEN_OVERRIDE] !== true;\n}\n\nexport function isStyleTokenOverrideData<T = unknown>(value: unknown): value is StyleTokenOverride<T> {\n return !!value &&\n typeof (value as StyleTokenOverride)[TOKEN_ID] === 'string' &&\n (value as StyleTokenOverride)[TOKEN_OVERRIDE] === true;\n}\n\nexport function getStyleTokenId<T>(token: StyleTokenData<T> | StyleTokenOverride<T>): string {\n return token[TOKEN_ID];\n}\n\nexport function getStyleTokenName<T>(token: StyleTokenData<T> | StyleTokenOverride<T>): string | null {\n return token[TOKEN_NAME] ?? null;\n}\n\nexport function getStyleTokenVarName<T>(token: StyleTokenData<T> | StyleTokenOverride<T>): string | null {\n return (token as ExtractedStyleTokenVarName)[TOKEN_VAR_NAME] ?? null;\n}\n","export function getStyleTokenNameFromId(id: string | undefined): string | null {\n if (!id) return null;\n\n const parts = id.split('--');\n const first = normalizeStyleTokenName(parts[0]);\n\n if (!first) {\n return parts.length > 1 ? normalizeStyleTokenName(parts.slice(1).join('--')) : null;\n }\n\n return normalizeStyleTokenName([first, ...parts.slice(1)].join('--'));\n}\n\nexport function getChildStyleTokenName(\n name: string | null | undefined,\n child: string | null | undefined,\n) {\n const childName = normalizeStyleTokenName(child);\n if (!childName) return normalizeStyleTokenName(name);\n\n const parentName = normalizeStyleTokenName(name);\n return parentName ? parentName + '--' + childName : childName;\n}\n\nexport function normalizeStyleTokenName(value: string | null | undefined): string | null {\n if (!value) return null;\n\n value = value.trim();\n if (!value) return null;\n if (/^\\d+$/.test(value)) return null;\n if (isGeneratedTokenHash(value)) return null;\n\n value = stripGenericTokenPrefix(value);\n if (!value) return null;\n\n const stableSuffix = value.match(/^(.+)-[a-z0-9]{7}$/);\n if (stableSuffix?.[1] && isGeneratedTokenHash(value.slice(-7))) return normalizeStyleTokenName(stableSuffix[1]);\n\n return value;\n}\n\nfunction isGeneratedTokenHash(value: string) {\n return /^[a-z0-9]{7}$/.test(value) && /\\d/.test(value);\n}\n\nfunction stripGenericTokenPrefix(value: string) {\n const parts = value.split('--');\n\n while (parts[0] === 'token' || parts[0] === 'tokens') {\n parts.shift();\n }\n\n return parts.join('--');\n}\n","import type { DebugData } from '../builder/data/debug';\nimport { getStyleTokenId, getStyleTokenName, isStyleTokenData } from '../builder/token/data';\nimport { getStyleTokenNameFromId, normalizeStyleTokenName } from '../builder/token/name';\nimport { globalData } from '../utils/global';\nimport { symbol } from '../utils/symbol';\nexport {\n getStyleTokenId,\n getStyleTokenName,\n getStyleTokenVarName,\n isStyleTokenData,\n isStyleTokenOverrideData,\n} from '../builder/token/data';\nexport { TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME } from '../builder/token/symbols';\nimport { TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME } from '../builder/token/symbols';\n\nexport const TOKEN_DEBUG: unique symbol = symbol('style:token.debug');\n\nexport type StyleTokenData<T = unknown> = {\n [TOKEN_ID]: string;\n [TOKEN_NAME]?: string | null;\n [TOKEN_VAR_NAME]?: string | null;\n [TOKEN_OVERRIDE]?: false;\n value: T;\n ref: StyleTokenData<T> | null;\n};\n\nexport type StyleTokenOverride<T = unknown> = {\n [TOKEN_ID]: string;\n [TOKEN_OVERRIDE]: true;\n [TOKEN_DEBUG]?: DebugData | null;\n [TOKEN_NAME]?: string | null;\n [TOKEN_VAR_NAME]?: string | null;\n value: T;\n ref: StyleTokenData<T> | null;\n};\n\nexport type StyleToken<T = unknown> = StyleTokenData<T> & {\n (value: T | StyleTokenData<T>, debug?: DebugData): StyleTokenOverride<T>;\n};\n\nconst idCounter = globalData('style.token.idCounter', () => ({ value: 0 }));\n\nexport function resetStyleTokenIdCounter() {\n idCounter.value = 0;\n}\n\nexport function createStyleToken<T>(\n value: T | StyleToken<T>,\n stableId?: string,\n debugName?: string | null,\n) {\n const token: StyleToken<T> = (value, debug) => {\n return createStyleTokenOverride(token, value, debug);\n };\n\n token[TOKEN_ID] = stableId || String(idCounter.value++);\n token[TOKEN_NAME] = debugName === undefined ? getStyleTokenNameFromId(stableId) : normalizeStyleTokenName(debugName);\n\n if (isStyleTokenData<T>(value)) {\n token.value = value.value;\n token.ref = value;\n } else {\n token.value = value;\n token.ref = null;\n }\n\n return token;\n}\n\nexport function createStyleTokenOverride<T>(\n token: StyleTokenData<T>,\n value: T | StyleTokenData<T>,\n debug?: DebugData | null,\n): StyleTokenOverride<T> {\n const override: StyleTokenOverride<T> = isStyleTokenData<T>(value)\n ? {\n [TOKEN_ID]: getStyleTokenId(token),\n [TOKEN_OVERRIDE]: true,\n [TOKEN_NAME]: getStyleTokenName(token),\n value: value.value,\n ref: value,\n }\n : {\n [TOKEN_ID]: getStyleTokenId(token),\n [TOKEN_OVERRIDE]: true,\n [TOKEN_NAME]: getStyleTokenName(token),\n value: value as T,\n ref: null,\n };\n\n if (debug) {\n Object.defineProperty(override, TOKEN_DEBUG, {\n configurable: true,\n enumerable: false,\n value: debug,\n });\n }\n\n return override;\n}\n\nexport function getStyleTokenOverrideDebug(\n token: StyleTokenOverride,\n) {\n return token[TOKEN_DEBUG] ?? null;\n}\n","export function getCssVar(varName: string, value: string) {\n return 'var(' + varName + ', ' + escapeCssValue(value) + ')';\n}\n\nexport function getCssVarRawFallback(varName: string, fallbackCss: string) {\n return 'var(' + varName + ', ' + fallbackCss + ')';\n}\n\nexport function escapeCssValue(value: string): string {\n if (!value) return '';\n\n return value\n .trim()\n // Escape existing backslashes first so we don't break them.\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/'/g, \"\\\\'\")\n .replace(/;/g, '\\\\;');\n}\n","import { CSS_CONFIG } from '../config/config/css';\nimport type { TokenNameFormat, TokenNameInfo } from '../config/types';\nimport { getStyleTokenId, getStyleTokenName, type StyleTokenData, type StyleTokenOverride } from '../style/token';\nimport { getCssVar, getCssVarRawFallback } from './utils/cssVar';\nimport { createNameFormatter } from './utils/format';\nimport { getIdentifierSafeHash } from './utils/hash';\n\nexport const TOKEN_NAME_FORMAT = 'token[-(name)]-$hash';\n\nexport const formatTokenName = createNameFormatter<TokenNameInfo>(['name']);\n\nexport function getTokenVarName(\n token: StyleTokenData | StyleTokenOverride,\n format: TokenNameFormat | null,\n) {\n const id = getStyleTokenId(token);\n const debugName = getStyleTokenName(token);\n\n const name = formatTokenName(\n format || TOKEN_NAME_FORMAT,\n getIdentifierSafeHash(id, CSS_CONFIG.hashLength),\n { name: debugName },\n );\n\n return '--' + name;\n}\n\nexport function getTokenVar(\n token: StyleTokenData,\n format: TokenNameFormat | null,\n) {\n return getTokenVarFallback(token, format);\n}\n\nexport function getTokenOverrideValue(\n token: StyleTokenOverride,\n format: TokenNameFormat | null,\n) {\n return token.ref ? getTokenVar(token.ref, format) : token.value;\n}\n\nfunction getTokenVarFallback(\n token: StyleTokenData,\n tokenNameFormat: TokenNameFormat | null,\n): string {\n const varName = getTokenVarName(token, tokenNameFormat);\n\n if (token.ref) {\n return getCssVarRawFallback(\n varName,\n getTokenVarFallback(token.ref, tokenNameFormat),\n );\n }\n\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evSourcemapTags, Et as getSourcemapRuleCallsite, Nt as normalizeCallsiteSourceUrl, Tt as createSourceMapComment } from "./env-Cz8frh6e.js";
1
+ import { Ct as getDevSourcemapTags, Et as getSourcemapRuleCallsite, Nt as normalizeCallsiteSourceUrl, Tt as createSourceMapComment } from "./env-DJyXPJ9q.js";
2
2
  import { TraceMap, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
3
3
  //#region dev/trace.ts
4
4
  const SOURCE_MAPPING_URL_REGEX = /(?:\/\/|\/\*)[#@]\s*sourceMappingURL=([^\s*]+)(?:\s*\*\/)?/g;
@@ -241,4 +241,4 @@ function isAbsoluteSource(source) {
241
241
  //#endregion
242
242
  export { traceDevSourcemaps };
243
243
 
244
- //# sourceMappingURL=trace-c2WmBbmX.js.map
244
+ //# sourceMappingURL=trace-Bsh-Kkg_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace-c2WmBbmX.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAAiB,IAAI,IAA2C;CACtE,MAAM,6BAAa,IAAI,IAAY;CACnC,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,aAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,MAAM,WAAW,QAAQ,IAAI,KAAK,KAAK;EACrD,MAAM,OAAO,WAAW;EACxB,IAAI,UAAU;EAEd,KAAK,IAAI,IAAI,GAAG,UAAU,KAAK,MAAM,QAAQ,IAAI,SAAS,KAAK;GAC7D,MAAM,OAAO,KAAK,MAAM;GACxB,MAAM,WAAW,yBAAyB,IAAI;GAE9C,IAAI,CAAC,UAAU;GACf,IAAI,mBAAmB,SAAS,aAAa,SAAS,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I,OAAO;EAEX,OAAO,IAAI;CACb,QAAQ;EACN,MAAM,aAAa,eAAe,QAAQ,CAAC,KAAK,GAAG,CAAC;EAEpD,OAAO,eAAe,KAAK,SAAS,OAAO,MAAM,GAAG,UAAU;CAChE;AACF;AAEA,SAAS,eAAe,MAAc,SAAmB;CACvD,IAAI,QAAQ;CAEZ,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,KAAK,QAAQ,MAAM;EAChC,IAAI,SAAS,OAAO,UAAU,MAAM,OAAO,QAAQ,QAAQ;CAC7D;CAEA,OAAO;AACT;AAEA,SAAS,yBAAyB;CAChC,OAAO,iBAAiB,GAAG,SAAS;AACtC;AAEA,SAAS,mBAAmB;CAC1B,OAAO,OAAO,WAAW,cAAc,OAAO;AAChD;AAEA,SAAS,yBACP,QACA,cACA,YACA;CACA,IAAI,iBAAiB,MAAM,GAAG,OAAO;CAErC,IAAI;EACF,IAAI,cAAc,CAAC,iBAAiB,UAAU,GAC5C,OAAO,IAAI,IAAI,WAAW,QAAQ,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE;EAGzE,IAAI,YACF,OAAO,IAAI,IAAI,QAAQ,UAAU,EAAE;EAGrC,OAAO,IAAI,IAAI,QAAQ,YAAY,EAAE;CACvC,QAAQ;EACN,OAAO,aAAa,WAAW,QAAQ,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
1
+ {"version":3,"file":"trace-Bsh-Kkg_.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAA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,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
@@ -1,5 +1,5 @@
1
- import { f as normalizeCallsiteSourceUrl } from "./debug-YuhEIQVO.js";
2
- import { f as getDevSourcemapTags, h as getSourcemapRuleCallsite, m as createSourceMapComment } from "./elementMarker-kvpMjB49.js";
1
+ import { f as normalizeCallsiteSourceUrl } from "./debug-0iaVEC7z.js";
2
+ import { f as getDevSourcemapTags, h as getSourcemapRuleCallsite, m as createSourceMapComment } from "./elementMarker-DZjd1NuA.js";
3
3
  import { TraceMap, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
4
4
  //#region dev/trace.ts
5
5
  const SOURCE_MAPPING_URL_REGEX = /(?:\/\/|\/\*)[#@]\s*sourceMappingURL=([^\s*]+)(?:\s*\*\/)?/g;
@@ -242,4 +242,4 @@ function isAbsoluteSource(source) {
242
242
  //#endregion
243
243
  export { traceDevSourcemaps };
244
244
 
245
- //# sourceMappingURL=trace-B3dpTRJp.js.map
245
+ //# sourceMappingURL=trace-C1_6fM21.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace-B3dpTRJp.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAAiB,IAAI,IAA2C;CACtE,MAAM,6BAAa,IAAI,IAAY;CACnC,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,aAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,MAAM,WAAW,QAAQ,IAAI,KAAK,KAAK;EACrD,MAAM,OAAO,WAAW;EACxB,IAA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odedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;;AAsBA,MAAM,2BAA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,IAAI,IAAI,WAAW,QAAQ,QAAQ,GAAG,IAAI,QAAQ,YAAY,EAAE;EAGzE,IAAI,YACF,OAAO,IAAI,IAAI,QAAQ,UAAU,EAAE;EAGrC,OAAO,IAAI,IAAI,QAAQ,YAAY,EAAE;CACvC,QAAQ;EACN,OAAO,aAAa,WAAW,QAAQ,QAAQ,GAAG,IAAI,SAAS;CACjE;AACF;AAEA,SAAS,iBAAiB,QAAgB;CACxC,OAAO,2BAA2B,KAAK,MAAM,KAAK,OAAO,WAAW,GAAG;AACzE"}
@@ -1,4 +1,4 @@
1
- import { l as symbol } from "./css-DWBWsyxZ.js";
1
+ import { d as symbol } from "./css-D7eTqvMH.js";
2
2
  //#region style/transform.ts
3
3
  const CLASS_NAME_VALUE = symbol("transform.classNameValue");
4
4
  function classNameValue(value, className) {
@@ -20,4 +20,4 @@ function classNameTransform(options) {
20
20
  //#endregion
21
21
  export { styleTransform as i, classNameValue as n, isClassNameValue as r, classNameTransform as t };
22
22
 
23
- //# sourceMappingURL=transform-DSpimwwC.js.map
23
+ //# sourceMappingURL=transform-8TIMiF5A.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform-DSpimwwC.js","names":[],"sources":["../style/transform.ts"],"sourcesContent":["import { symbol } from '../utils/symbol';\nimport type { CSSProperties, StyleObject, StyleValue } from './types';\n\nconst CLASS_NAME_VALUE: unique symbol = symbol('transform.classNameValue');\n\nexport type ClassNameValue<Value = unknown> = {\n readonly [CLASS_NAME_VALUE]: true;\n readonly value: Value;\n readonly className: string;\n};\n\nexport type TransformStyleObject<Style = unknown> = {\n [P in keyof Style]: StyleValue<Style[P] | ClassNameValue<Style[P]>>;\n};\n\nexport type StyleTransform<Style = unknown> = {\n transform(style: StyleObject<Style>): TransformStyleObject<CSSProperties>;\n};\n\nexport type ClassNameTransform<ClassName extends string = string> = {\n transform(className: ClassName): TransformStyleObject<CSSProperties>;\n};\n\nexport function classNameValue<const Value>(\n value: Value,\n className: string,\n): ClassNameValue<Value> {\n return {\n [CLASS_NAME_VALUE]: true,\n value,\n className,\n };\n}\n\nexport function isClassNameValue(value: unknown): value is ClassNameValue {\n return !!value &&\n typeof value === 'object' &&\n (value as ClassNameValue)[CLASS_NAME_VALUE] === true &&\n typeof (value as ClassNameValue).className === 'string';\n}\n\nexport function styleTransform<Style>(options: StyleTransform<Style>) {\n return options;\n}\n\nexport function classNameTransform<ClassName extends string>(options: ClassNameTransform<ClassName>) {\n return options;\n}\n"],"mappings":";;AAGA,MAAM,mBAAkC,OAAO,0BAA0B;AAoBzE,SAAgB,eACd,OACA,WACuB;CACvB,OAAO;GACJ,mBAAmB;EACpB;EACA;CACF;AACF;AAEA,SAAgB,iBAAiB,OAAyC;CACxE,OAAO,CAAC,CAAC,SACP,OAAO,UAAU,YAChB,MAAyB,sBAAsB,QAChD,OAAQ,MAAyB,cAAc;AACnD;AAEA,SAAgB,eAAsB,SAAgC;CACpE,OAAO;AACT;AAEA,SAAgB,mBAA6C,SAAwC;CACnG,OAAO;AACT"}
1
+ {"version":3,"file":"transform-8TIMiF5A.js","names":[],"sources":["../style/transform.ts"],"sourcesContent":["import { symbol } from '../utils/symbol';\nimport type { CSSProperties, StyleObject, StyleValue } from './types';\n\nconst CLASS_NAME_VALUE: unique symbol = symbol('transform.classNameValue');\n\nexport type ClassNameValue<Value = unknown> = {\n readonly [CLASS_NAME_VALUE]: true;\n readonly value: Value;\n readonly className: string;\n};\n\nexport type TransformStyleObject<Style = unknown> = {\n [P in keyof Style]: StyleValue<Style[P] | ClassNameValue<Style[P]>>;\n};\n\nexport type StyleTransform<Style = unknown> = {\n transform(style: StyleObject<Style>): TransformStyleObject<CSSProperties>;\n};\n\nexport type ClassNameTransform<ClassName extends string = string> = {\n transform(className: ClassName): TransformStyleObject<CSSProperties>;\n};\n\nexport function classNameValue<const Value>(\n value: Value,\n className: string,\n): ClassNameValue<Value> {\n return {\n [CLASS_NAME_VALUE]: true,\n value,\n className,\n };\n}\n\nexport function isClassNameValue(value: unknown): value is ClassNameValue {\n return !!value &&\n typeof value === 'object' &&\n (value as ClassNameValue)[CLASS_NAME_VALUE] === true &&\n typeof (value as ClassNameValue).className === 'string';\n}\n\nexport function styleTransform<Style>(options: StyleTransform<Style>) {\n return options;\n}\n\nexport function classNameTransform<ClassName extends string>(options: ClassNameTransform<ClassName>) {\n return options;\n}\n"],"mappings":";;AAGA,MAAM,mBAAkC,OAAO,0BAA0B;AAoBzE,SAAgB,eACd,OACA,WACuB;CACvB,OAAO;GACJ,mBAAmB;EACpB;EACA;CACF;AACF;AAEA,SAAgB,iBAAiB,OAAyC;CACxE,OAAO,CAAC,CAAC,SACP,OAAO,UAAU,YAChB,MAAyB,sBAAsB,QAChD,OAAQ,MAAyB,cAAc;AACnD;AAEA,SAAgB,eAAsB,SAAgC;CACpE,OAAO;AACT;AAEA,SAAgB,mBAA6C,SAAwC;CACnG,OAAO;AACT"}
@@ -0,0 +1 @@
1
+ export { mergeJsxProps } from "../entry/dev/adapter/preact.js";
@@ -0,0 +1 @@
1
+ export { mergeJsxProps } from "../entry/dev/adapter/react.js";
@@ -0,0 +1 @@
1
+ export { mergeJsxProps } from "../entry/dev/adapter/solid.js";
@@ -0,0 +1,10 @@
1
+ import type { NamedAtRuleFormat, TokenNameFormat } from "../../config/types.js";
2
+ import type { StyleTokenData } from "../../style/token.js";
3
+ import type { CSS } from "../utils/types.js";
4
+ export type CounterStyleObject = CSS.AtRule.CounterStyle;
5
+ export declare const COUNTER_STYLE_AT_RULE = "counter-style";
6
+ export declare const formatCounterStyleName: (format: NamedAtRuleFormat | null, id: string, info: import("../../config/types.js").NamedAtRuleInfo) => string;
7
+ export declare function buildCounterStyleCss(format: NamedAtRuleFormat | null, name: string | null, id: string, descriptors: CounterStyleObject, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): {
8
+ name: string;
9
+ css: string;
10
+ };
@@ -0,0 +1,10 @@
1
+ import type { NamedAtRuleFormat, TokenNameFormat } from "../../config/types.js";
2
+ import type { StyleTokenData } from "../../style/token.js";
3
+ import type { CSS } from "../utils/types.js";
4
+ export type FontFaceObject = CSS.AtRule.FontFace;
5
+ export declare const FONT_FACE_AT_RULE = "font-face";
6
+ export declare const formatFontFaceName: (format: NamedAtRuleFormat | null, id: string, info: import("../../config/types.js").NamedAtRuleInfo) => string;
7
+ export declare function buildFontFaceCss(format: NamedAtRuleFormat | null, name: string | null, id: string, descriptors: FontFaceObject, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): {
8
+ name: string;
9
+ css: string;
10
+ };
@@ -0,0 +1,10 @@
1
+ import type { NamedAtRuleFormat, TokenNameFormat } from "../../config/types.js";
2
+ import type { StyleTokenData } from "../../style/token.js";
3
+ import type { CSS } from "../utils/types.js";
4
+ export type FontPaletteValuesObject = CSS.AtRule.FontPaletteValues;
5
+ export declare const FONT_PALETTE_VALUES_AT_RULE = "font-palette-values";
6
+ export declare const formatFontPaletteValuesName: (format: NamedAtRuleFormat | null, id: string, info: import("../../config/types.js").NamedAtRuleInfo) => string;
7
+ export declare function buildFontPaletteValuesCss(format: NamedAtRuleFormat | null, name: string | null, id: string, descriptors: FontPaletteValuesObject, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): {
8
+ name: string;
9
+ css: string;
10
+ };
@@ -0,0 +1 @@
1
+ export declare function fontSrc(url: string, format?: string): string;
@@ -0,0 +1,13 @@
1
+ import type { NamedAtRuleFormat, TokenNameFormat } from "../../config/types.js";
2
+ import type { StyleTokenData } from "../../style/token.js";
3
+ import type { AtRuleStyleObject, CSSProperties } from "../../style/types.js";
4
+ export type KeyframeSelector = 'from' | 'to' | `${number}%` | (string & {});
5
+ export type KeyframesObject<Style = CSSProperties> = {
6
+ [Selector in KeyframeSelector]?: AtRuleStyleObject<Style>;
7
+ };
8
+ export declare const KEYFRAMES_AT_RULE = "keyframes";
9
+ export declare const formatKeyFramesName: (format: NamedAtRuleFormat | null, id: string, info: import("../../config/types.js").NamedAtRuleInfo) => string;
10
+ export declare function buildKeyframesCss(format: NamedAtRuleFormat | null, name: string | null, id: string, frames: KeyframesObject, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): {
11
+ name: string;
12
+ css: string;
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { NamedAtRuleFormat, TokenNameFormat } from "../../config/types.js";
2
+ import type { AtRuleStyleObject } from "../../style/index.js";
3
+ import type { StyleTokenData } from "../../style/token.js";
4
+ import type { CSSProperties } from "../utils/types.js";
5
+ type Properties = Pick<CSSProperties, 'positionArea' | 'insetArea' | 'top' | 'right' | 'bottom' | 'left' | 'inset' | 'insetBlock' | 'insetBlockStart' | 'insetBlockEnd' | 'insetInline' | 'insetInlineStart' | 'insetInlineEnd' | 'width' | 'minWidth' | 'maxWidth' | 'height' | 'minHeight' | 'maxHeight' | 'blockSize' | 'minBlockSize' | 'maxBlockSize' | 'inlineSize' | 'minInlineSize' | 'maxInlineSize' | 'margin' | 'marginBlock' | 'marginBlockStart' | 'marginBlockEnd' | 'marginInline' | 'marginInlineStart' | 'marginInlineEnd'>;
6
+ export type PositionTryObject = AtRuleStyleObject<Properties>;
7
+ export declare const POSITION_TRY_AT_RULE = "position-try";
8
+ export declare const formatPositionTryName: (format: NamedAtRuleFormat | null, id: string, info: import("../../config/types.js").NamedAtRuleInfo) => string;
9
+ export declare function buildPositionTryCss(format: NamedAtRuleFormat | null, name: string | null, id: string, descriptors: PositionTryObject, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): {
10
+ name: string;
11
+ css: string;
12
+ };
13
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { NamedAtRuleFormat, TokenNameFormat } from "../../config/types.js";
2
+ import type { StyleTokenData } from "../../style/token.js";
3
+ export type PropertyObject = {
4
+ syntax: string;
5
+ inherits: boolean;
6
+ initialValue: string | number;
7
+ };
8
+ export declare const PROPERTY_AT_RULE = "property";
9
+ export declare const formatPropertyName: (format: NamedAtRuleFormat | null, id: string, info: import("../../config/types.js").NamedAtRuleInfo) => string;
10
+ export declare function buildPropertyCss(format: NamedAtRuleFormat | null, name: string | null, id: string, descriptors: PropertyObject, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): {
11
+ css: string;
12
+ name: string;
13
+ };
@@ -0,0 +1,5 @@
1
+ import { type NamedAtRuleFormat, type NamedAtRuleInfo, type TokenNameFormat } from "../../config/types.js";
2
+ import { type StyleTokenData } from "../../style/token.js";
3
+ export declare function createAtRuleNameFormatter(defaultFormat: NamedAtRuleFormat, prefix?: string): (format: NamedAtRuleFormat | null, id: string, info: NamedAtRuleInfo) => string;
4
+ export declare function buildNamedAtRuleCss(atRule: string, name: string, descriptors: object, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null): string;
5
+ export declare function buildAtRuleDeclarationCss(style: Record<string, any>, tokens: StyleTokenData[], tokenLookup: Set<string>, tokenNameFormat: TokenNameFormat | null, rawValue: boolean, shouldInclude?: (property: string) => boolean): string;
@@ -0,0 +1,11 @@
1
+ import type { BuilderCallsite, ItemSelector } from "../builder/data/index.js";
2
+ import type { ClassNameFormat, TransformClassNameFormat } from "../config/types.js";
3
+ export { getScopeClassName } from "./scope.js";
4
+ export declare function getAtomicClassName(property: string, priority: number | null, important: boolean, value: string, selector: ItemSelector | null, parentSelector: ItemSelector | null, atRule: ItemSelector[] | null, callsite: BuilderCallsite | null, localClassName: boolean, debugClassName: boolean, classNameFormat: ClassNameFormat | null, transformClassName: string | null, transformClassNameFormat: TransformClassNameFormat | null, sheetClassNameFormat?: ClassNameFormat | null, hashLength?: number | null): string;
5
+ export declare function getClassNameHashLength(options: {
6
+ debugClassName: boolean;
7
+ isDev: boolean;
8
+ devHashLength?: number | null;
9
+ cssHashLength?: number | null;
10
+ }): number;
11
+ export declare function getClassNameDedupe(property: string, priority: number | null, important: boolean, selector: ItemSelector | null, parentSelector: ItemSelector | null, atRule: ItemSelector[] | null): string;
@@ -0,0 +1,9 @@
1
+ import type { ClassNameFormat, ClassNameInfo, TransformClassNameFormat, TransformClassNameInfo } from "../../../config/types.js";
2
+ export declare const CLASS_NAME_FORMAT = "[(atRule)-][(scopeSelector)-](property)[-(selector)][-(value)]--$hash";
3
+ export declare const SHEET_CLASS_NAME_FORMAT = "sheet-(property)[-(value)]--$hash";
4
+ export declare const TRANSFORM_CLASS_NAME_FORMAT = "(className)--$hash";
5
+ export declare const formatClassName: (format: string | ((info: ClassNameInfo) => string), hash: string | null, info: ClassNameInfo) => string;
6
+ export declare const formatTransformClassName: (format: string | ((info: TransformClassNameInfo) => string), hash: string | null, info: TransformClassNameInfo) => string;
7
+ export declare function getDebugClassName(format: ClassNameFormat | null, hash: string, info: ClassNameInfo): string;
8
+ export declare function getDebugSheetClassName(format: ClassNameFormat | null, hash: string, info: ClassNameInfo): string;
9
+ export declare function getDebugTransformClassName(format: TransformClassNameFormat | null, hash: string, info: TransformClassNameInfo): string;
@@ -0,0 +1 @@
1
+ export * from "./className.js";
@@ -0,0 +1,3 @@
1
+ export declare const PROPERTY_ALIASES: Record<string, string>;
2
+ export declare const KEYWORD_VALUE_PROPERTIES: Set<string>;
3
+ export declare const ARBITRARY_VALUE_PROPERTIES: Set<string>;
@@ -0,0 +1 @@
1
+ export * from "./property.js";
@@ -0,0 +1,5 @@
1
+ import { type DebugValueName } from "../value.js";
2
+ export type DebugPropertyName = DebugValueName & {
3
+ property: string;
4
+ };
5
+ export declare function getDebugPropertyName(property: string, value: string): DebugPropertyName | null;
@@ -0,0 +1,2 @@
1
+ export declare function getDebugSelectorName(selector: string): string | null;
2
+ export declare function getDebugAtRuleName(selector: string | string[]): string | null;
@@ -0,0 +1,5 @@
1
+ export type DebugValueName = {
2
+ value: string | null;
3
+ arbitraryValue: string | null;
4
+ };
5
+ export declare function getDebugValueName(value: string): DebugValueName;
@@ -0,0 +1,5 @@
1
+ import type { ElementClassNameFormat, ElementClassNameInfo } from "../config/types.js";
2
+ export declare const ELEMENT_CLASS_NAME_FORMAT = "@(name)";
3
+ export declare const formatElementClassName: (format: string | ((info: ElementClassNameInfo) => string), hash: string | null, info: ElementClassNameInfo) => string;
4
+ export declare function getElementClassName(label: string | undefined, id: string, elementClassNameFormat: ElementClassNameFormat | null): string;
5
+ export declare function getElementMarkerRuleCss(className: string): string;
@@ -0,0 +1,3 @@
1
+ export * from "./layer.js";
2
+ export * from "./types.js";
3
+ export * from "./utils.js";
@@ -0,0 +1,12 @@
1
+ import type { LayerPriority } from "./types.js";
2
+ export declare function compareLayerPriority(p1: LayerPriority, p2: LayerPriority): number;
3
+ export declare function createLayerNamePool(): {
4
+ getLayerName: (layerNamespace: string, priority: LayerPriority) => string;
5
+ getLayerId: (priority: LayerPriority) => string;
6
+ };
7
+ export declare function createLayerPool(layerNamespace: string): {
8
+ getName: (priority: LayerPriority) => string;
9
+ getNames: () => string[];
10
+ };
11
+ export declare function ensureLayerPlaceholder(layers: string[]): string[];
12
+ export declare function flattenCssLayers(layers: readonly string[], layerNames: string | readonly string[]): string[];
@@ -0,0 +1,30 @@
1
+ import { LayerPlaceholder } from "../../config/index.js";
2
+ export { LayerPlaceholder };
3
+ export declare const LayerDefaultLayers: string[];
4
+ export declare const LayerDefaultNamespace = "css";
5
+ export declare const LayerDefaultPriority: LayerPriority;
6
+ export declare const LayerMediaPriorities: {
7
+ base: number;
8
+ media: number;
9
+ priorityMedia: number;
10
+ };
11
+ export declare const LayerSelectorPriorities: {
12
+ base: number;
13
+ parentSelector: number;
14
+ selector: number;
15
+ prioritySelector: number;
16
+ };
17
+ export declare const LayerPropertyPriorities: {
18
+ shorthand: number;
19
+ intermediate: number;
20
+ longhand: number;
21
+ };
22
+ export type LayerPriority = readonly [
23
+ value: number,
24
+ selector: number,
25
+ parentSelector: number,
26
+ media: number,
27
+ atRule: number,
28
+ origin: number,
29
+ property: number
30
+ ];
@@ -0,0 +1,4 @@
1
+ export declare function getLayerOrderCss(layers: readonly string[], layerNames: string | readonly string[]): string;
2
+ export declare function getLayerBlockCss(layerName: string, css: string): string;
3
+ export declare function getLayerBundleCss(layers: readonly string[], layerName: string, css: readonly string[]): string;
4
+ export declare function joinLayerCss(layerOrderCss: string, css: readonly string[]): string;
@@ -0,0 +1,2 @@
1
+ export * from "./property.js";
2
+ export * from "./type_maps.js";
@@ -0,0 +1,4 @@
1
+ import * as data from "./type_maps.js";
2
+ import type { PropertyTypeRecord } from "./types.js";
3
+ export declare const PropertyTypes: typeof data;
4
+ export declare const DefaultPropertyTypes: PropertyTypeRecord;
@@ -0,0 +1,3 @@
1
+ export declare const PROPERTY_DEFAULT_PRIORITY = 0;
2
+ export declare function getPropertyPriority(property: string): number;
3
+ export declare function getCssPropertyName(property: string): string;
@@ -0,0 +1,31 @@
1
+ import type { CSSPropertyName } from "../utils/types.js";
2
+ import { type PropertyTypeRecord } from "./types.js";
3
+ type TypeMap = PropertyTypeRecord<CSSPropertyName>;
4
+ export declare const animation: TypeMap;
5
+ export declare const background: TypeMap;
6
+ export declare const border: TypeMap;
7
+ export declare const columns: TypeMap;
8
+ export declare const containIntrinsicSize: TypeMap;
9
+ export declare const container: TypeMap;
10
+ export declare const flex: TypeMap;
11
+ export declare const font: TypeMap;
12
+ export declare const gap: TypeMap;
13
+ export declare const grid: TypeMap;
14
+ export declare const inset: TypeMap;
15
+ export declare const listStyle: TypeMap;
16
+ export declare const margin: TypeMap;
17
+ export declare const mask: TypeMap;
18
+ export declare const offset: TypeMap;
19
+ export declare const outline: TypeMap;
20
+ export declare const overflow: TypeMap;
21
+ export declare const overscrollBehavior: TypeMap;
22
+ export declare const padding: TypeMap;
23
+ export declare const place: TypeMap;
24
+ export declare const scrollMargin: TypeMap;
25
+ export declare const scrollPadding: TypeMap;
26
+ export declare const scrollTimeline: TypeMap;
27
+ export declare const text: TypeMap;
28
+ export declare const transition: TypeMap;
29
+ export declare const viewTimeline: TypeMap;
30
+ export declare const whiteSpace: TypeMap;
31
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const LONGHAND: number;
2
+ export declare const SHORTHAND: number;
3
+ export declare const INTERMEDIATE: number;
4
+ export type PropertyTypeRecord<T extends string = string> = Partial<Record<T, number>>;
@@ -0,0 +1,5 @@
1
+ import type { ItemSelector } from "../builder/data/state.js";
2
+ import type { ScopeClassNameFormat } from "../config/types.js";
3
+ import { type LayerPriority } from "./layer/index.js";
4
+ export declare function buildAtomicRule(className: string, property: string, value: string, important: boolean, selector: ItemSelector | null, parentSelector: ItemSelector | null, atRules: ItemSelector[] | null, scopeClassNameFormat: ScopeClassNameFormat | null): string;
5
+ export declare function getAtomicRuleLayerPriority(property: string, priority: number | null, selector: ItemSelector | null, parentSelector: ItemSelector | null, atRules: ItemSelector[] | null, isScopeRule?: boolean): LayerPriority;