'use strict';
import { c } from 'react/compiler-runtime';
import { jsx } from 'react/jsx-runtime';
import { useDraggable } from '@dnd-kit/core';
import { remoteBlobConstants } from '../../../base-repo/constants/remote-blob-constants.js';
import { commonLowerCaseWords } from '../../../base-repo/constants/internal-common-strings.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
const cssPositionValueNames = {
  fixed: commonLowerCaseWords.fixed
};
function Draggable(t0) {
  const $ = c(10);
  const {
    draggableId,
    children
  } = t0;
  let t1;
  if ($[0] !== draggableId) {
    t1 = {
      id: draggableId
    };
    $[0] = draggableId;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const {
    setNodeRef,
    listeners,
    attributes,
    transform,
    isDragging
  } = useDraggable(t1);
  const t2 = transform ? `translate(${transform.x}px, ${transform.y}px)` : void 0;
  const t3 = isDragging ? cssPositionValueNames.fixed : "static";
  const t4 = isDragging ? 9999 : remoteBlobConstants.blobClientRegion;
  let t5;
  if ($[2] !== attributes || $[3] !== children || $[4] !== listeners || $[5] !== setNodeRef || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
    const style = {
      transform: t2,
      position: t3,
      zIndex: t4
    };
    t5 = jsx("div", {
      ref: setNodeRef,
      ...listeners,
      ...attributes,
      style,
      children
    });
    $[2] = attributes;
    $[3] = children;
    $[4] = listeners;
    $[5] = setNodeRef;
    $[6] = t2;
    $[7] = t3;
    $[8] = t4;
    $[9] = t5;
  } else {
    t5 = $[9];
  }
  return t5;
}
__name(Draggable, "Draggable");

export { Draggable };
