function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import React from 'react';
import classNames from 'classnames';
/**
 * 背景区间层：营业时间高亮、过去时间淡化等（当前时间渐变已拆为独立块，见 axis-wrap 内 .pisell-time-navigator-current-gradient）
 */
export function BackgroundLayer(_ref) {
  var orientation = _ref.orientation,
    pastTimeFade = _ref.pastTimeFade,
    businessHoursPx = _ref.businessHoursPx,
    className = _ref.className,
    style = _ref.style;
  var isHorizontal = orientation === 'horizontal';
  return /*#__PURE__*/React.createElement("div", {
    className: classNames('pisell-time-navigator-background', "pisell-time-navigator-background--".concat(orientation), className),
    style: style,
    "aria-hidden": true
  }, businessHoursPx != null && /*#__PURE__*/React.createElement("div", {
    className: "pisell-time-navigator-background-business",
    style: _defineProperty(_defineProperty({}, isHorizontal ? 'left' : 'top', businessHoursPx[0]), isHorizontal ? 'width' : 'height', Math.max(0, businessHoursPx[1] - businessHoursPx[0]))
  }), pastTimeFade && /*#__PURE__*/React.createElement("div", {
    className: "pisell-time-navigator-background-past",
    style: {
      background: pastTimeFade
    }
  }));
}