var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellTimeNavigator/components/CursorLayer.tsx
var CursorLayer_exports = {};
__export(CursorLayer_exports, {
  CursorLayer: () => CursorLayer
});
module.exports = __toCommonJS(CursorLayer_exports);
var import_react = __toESM(require("react"));
var import_classnames = __toESM(require("classnames"));
var CURSOR_ANCHOR_WIDTH_H = 22;
var CURSOR_LINE_HEIGHT_V = 2;
function CursorLayer({
  orientation,
  value,
  timeFormat,
  formatTimeLabel,
  locale,
  isRealtime,
  offsetPx,
  fixedCenter,
  style,
  className,
  dragInteractive,
  isDragging,
  onDragPointerDown,
  onDragPointerMove,
  onDragPointerUp,
  onDragPointerCancel
}) {
  if (value == null) return null;
  const label = formatTimeLabel ? formatTimeLabel(value) : locale ? value.locale(locale).format(timeFormat) : value.format(timeFormat);
  const isHorizontal = orientation === "horizontal";
  const lineOffset = offsetPx - (isHorizontal ? CURSOR_ANCHOR_WIDTH_H / 2 : CURSOR_LINE_HEIGHT_V / 2);
  const positionStyle = fixedCenter ? style ?? {} : dragInteractive && isHorizontal ? {
    ...style,
    left: offsetPx,
    transform: "translateX(-50%)",
    width: 36
  } : dragInteractive && !isHorizontal ? {
    ...style,
    top: offsetPx,
    transform: "translateX(-50%) translateY(-50%)",
    height: 40
  } : { ...style, [isHorizontal ? "left" : "top"]: lineOffset };
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      className: (0, import_classnames.default)(
        "pisell-time-navigator-cursor",
        `pisell-time-navigator-cursor--${orientation}`,
        { "pisell-time-navigator-cursor--realtime": isRealtime },
        { "pisell-time-navigator-cursor--fixed": fixedCenter },
        { "pisell-time-navigator-cursor--draggable": dragInteractive },
        { "pisell-time-navigator-cursor--dragging": isDragging },
        className
      ),
      style: positionStyle,
      "aria-hidden": true,
      onPointerDown: dragInteractive ? onDragPointerDown : void 0,
      onPointerMove: dragInteractive ? onDragPointerMove : void 0,
      onPointerUp: dragInteractive ? onDragPointerUp : void 0,
      onPointerCancel: dragInteractive ? onDragPointerCancel : void 0
    },
    isHorizontal ? /* @__PURE__ */ import_react.default.createElement(
      "svg",
      {
        className: "pisell-time-navigator-cursor-line pisell-time-navigator-cursor-line--token",
        viewBox: "0 0 22 100",
        preserveAspectRatio: "none",
        focusable: "false",
        "aria-hidden": true
      },
      /* @__PURE__ */ import_react.default.createElement(
        "path",
        {
          fill: "currentColor",
          d: "M 11 0 L 18 11 L 18 100 L 4 100 L 4 11 Z"
        }
      )
    ) : /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-navigator-cursor-line" }),
    /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-navigator-cursor-bubble" }, label)
  );
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  CursorLayer
});
