import { __rest as l, __assign as u } from "../../../../../tslib/tslib.es6.es.js";
import { visualElement as p } from "../index.es.js";
import { getOrigin as d, checkTargetForNewValues as v } from "../utils/setters.es.js";
import { buildHTMLStyles as c } from "./utils/build-styles.es.js";
import { isCSSVariable as g } from "../dom/utils/is-css-variable.es.js";
import { parseDomVariant as V } from "../dom/utils/parse-dom-variant.es.js";
import { isTransformProp as T } from "./utils/transform.es.js";
import { scrapeMotionValuesFromProps as P } from "./utils/scrape-motion-values.es.js";
import { renderHTML as b } from "./utils/render.es.js";
import { getDefaultValueType as y } from "../dom/value-types/defaults.es.js";
import { measureViewportBox as E } from "../../projection/utils/measure.es.js";
function h(t) {
  return window.getComputedStyle(t);
}
var w = {
  treeType: "dom",
  readValueFromInstance: function(t, r) {
    if (T(r)) {
      var o = y(r);
      return o && o.default || 0;
    } else {
      var e = h(t);
      return (g(r) ? e.getPropertyValue(r) : e[r]) || 0;
    }
  },
  sortNodePosition: function(t, r) {
    return t.compareDocumentPosition(r) & 2 ? 1 : -1;
  },
  getBaseTarget: function(t, r) {
    var o;
    return (o = t.style) === null || o === void 0 ? void 0 : o[r];
  },
  measureViewportBox: function(t, r) {
    var o = r.transformPagePoint;
    return E(t, o);
  },
  resetTransform: function(t, r, o) {
    var e = o.transformTemplate;
    r.style.transform = e ? e({}, "") : "none", t.scheduleRender();
  },
  restoreTransform: function(t, r) {
    t.style.transform = r.style.transform;
  },
  removeValueFromRenderState: function(t, r) {
    var o = r.vars, e = r.style;
    delete o[t], delete e[t];
  },
  makeTargetAnimatable: function(t, r, o, e) {
    var n = o.transformValues;
    e === void 0 && (e = !0);
    var m = r.transition, a = r.transitionEnd, i = l(r, ["transition", "transitionEnd"]), s = d(i, m || {}, t);
    if (n && (a && (a = n(a)), i && (i = n(i)), s && (s = n(s))), e) {
      v(t, i, s);
      var f = V(t, i, s, a);
      a = f.transitionEnd, i = f.target;
    }
    return u({ transition: m, transitionEnd: a }, i);
  },
  scrapeMotionValuesFromProps: P,
  build: function(t, r, o, e, n) {
    t.isVisible !== void 0 && (r.style.visibility = t.isVisible ? "visible" : "hidden"), c(r, o, e, n.transformTemplate);
  },
  render: b
}, _ = p(w);
export {
  h as getComputedStyle,
  w as htmlConfig,
  _ as htmlVisualElement
};
//# sourceMappingURL=visual-element.es.js.map
