import { define } from './preactement/define';
import Button from '../Button/Button';
import { jsx as _jsx } from "react/jsx-runtime";
const attributes = ['class-name', 'disabled', 'href', 'is-alternate', 'is-on-dark', 'size', 'type', 'variation', 'target', 'analytics', 'analytics-label-override', 'analytics-event-type-override', 'analytics-parent-heading', 'analytics-parent-type'];

// Mapping `onDark` to `isOnDark` because props starting with "on" indicate an event handler and tests fail due to this expectation

const Wrapper = _ref => {
  let {
    isAlternate,
    isOnDark,
    analytics,
    ...otherProps
  } = _ref;
  return /*#__PURE__*/_jsx(Button, {
    ...otherProps,
    isAlternate: isAlternate && Boolean(JSON.parse(isAlternate)),
    onDark: isOnDark && Boolean(JSON.parse(isOnDark)),
    analytics: analytics && Boolean(JSON.parse(analytics))
  });
};
define('ds-button', () => Wrapper, {
  attributes,
  events: ['onClick', 'onAnalyticsEvent']
});