import * as __vanilla_filescope__ from "@vanilla-extract/css/fileScope";
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
import { createThemeContract, style, assignVars, composeStyles } from "@vanilla-extract/css";
import { createStyleObject, precomputeValues } from "@capsizecss/core";
__vanilla_filescope__.setFileScope("packages/vanilla-extract/src/capsize.css.ts", "capsize");
const capsizeVars = createThemeContract({
  fontSize: null,
  lineHeight: null,
  capHeightTrim: null,
  baselineTrim: null
});
const capsizeStyle = style(createStyleObject({
  fontSize: capsizeVars.fontSize,
  lineHeight: capsizeVars.lineHeight,
  capHeightTrim: capsizeVars.capHeightTrim,
  baselineTrim: capsizeVars.baselineTrim
}), "capsizeStyle");
__vanilla_filescope__.endFileScope();
const createVanillaStyle = (_ref) => {
  let {
    values,
    mediaQueries,
    debugId
  } = _ref;
  const vars = {
    vars: assignVars(capsizeVars, values)
  };
  if (typeof mediaQueries !== "undefined") {
    const mqs = {};
    Object.entries(mediaQueries["@media"]).forEach((_ref2) => {
      let [mq, val] = _ref2;
      const builtValues = "capHeightTrim" in val ? val : precomputeValues(val);
      mqs[mq] = {
        vars: assignVars(capsizeVars, builtValues)
      };
    });
    vars["@media"] = mqs;
  }
  return composeStyles(capsizeStyle, style(vars, debugId));
};
function createTextStyle() {
  const hasMediaQueries = typeof (arguments.length <= 1 ? void 0 : arguments[1]) !== "undefined" && typeof (arguments.length <= 1 ? void 0 : arguments[1]) !== "string";
  const debugId = hasMediaQueries ? arguments.length <= 2 ? void 0 : arguments[2] : arguments.length <= 1 ? void 0 : arguments[1];
  const mediaQueries = hasMediaQueries ? arguments.length <= 1 ? void 0 : arguments[1] : void 0;
  if ("capHeightTrim" in (arguments.length <= 0 ? void 0 : arguments[0])) {
    return createVanillaStyle({
      values: arguments.length <= 0 ? void 0 : arguments[0],
      mediaQueries,
      debugId
    });
  }
  return createVanillaStyle({
    values: precomputeValues(arguments.length <= 0 ? void 0 : arguments[0]),
    mediaQueries,
    debugId
  });
}
setFileScope("src/lib/css/capsize.css.ts", "braid-design-system");
endFileScope();
export {
  createTextStyle
};
