@sonordev/site-kit 2.7.1 → 2.7.2

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.
@@ -5027,8 +5027,28 @@ function loadSquareSDK2(environment) {
5027
5027
  }
5028
5028
  function resolveCssVar(name, fallback) {
5029
5029
  if (typeof window === "undefined") return fallback;
5030
- const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
5031
- return value || fallback;
5030
+ const raw = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
5031
+ if (!raw) return fallback;
5032
+ return normalizeColorForSquare(raw) ?? fallback;
5033
+ }
5034
+ function normalizeColorForSquare(value) {
5035
+ const v = value.trim();
5036
+ if (!v) return null;
5037
+ if (/^#[0-9a-f]{6}$/i.test(v)) return v;
5038
+ const eightDigit = /^(#[0-9a-f]{6})[0-9a-f]{2}$/i.exec(v);
5039
+ if (eightDigit) return eightDigit[1];
5040
+ const threeDigit = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(v);
5041
+ if (threeDigit) {
5042
+ const [, r, g, b] = threeDigit;
5043
+ return `#${r}${r}${g}${g}${b}${b}`;
5044
+ }
5045
+ const rgb = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(v);
5046
+ if (rgb) {
5047
+ const [, r, g, b] = rgb;
5048
+ const toHex = (n) => Number(n).toString(16).padStart(2, "0");
5049
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
5050
+ }
5051
+ return null;
5032
5052
  }
5033
5053
  var SINGLE_TICKET_KEY = "__single__";
5034
5054
  function EventCheckout({
@@ -7789,5 +7809,5 @@ exports.registerForEvent = registerForEvent;
7789
7809
  exports.useEventModal = useEventModal;
7790
7810
  exports.validateAddress = validateAddress;
7791
7811
  exports.validateDiscountCode = validateDiscountCode;
7792
- //# sourceMappingURL=chunk-2OGUBINV.js.map
7793
- //# sourceMappingURL=chunk-2OGUBINV.js.map
7812
+ //# sourceMappingURL=chunk-5OX347TD.js.map
7813
+ //# sourceMappingURL=chunk-5OX347TD.js.map