import { driver as l } from "driver.js";
import "driver.js/dist/driver.css";
const A = (s) => {
  const {
    steps: t,
    prevBtnText: r = "Previous",
    nextBtnText: n = "Next",
    doneBtnText: i = "Done",
    showProgress: o = !0,
    allowClose: a = !1,
    stagePadding: p = 10,
    stageRadius: c = 5,
    allowKeyboardControl: g = !0,
    showButtons: h,
    disableButtons: u,
    popoverClass: y,
    noBackdrop: x = !1,
    onPopoverRender: P = () => {
    },
    onDestroyed: S = () => {
    },
    ...m
  } = s, f = (d, T) => {
    P(d, T.state);
  }, B = () => {
    S();
  }, v = !t || t.length === 1, e = l({
    steps: t,
    prevBtnText: r,
    nextBtnText: n,
    doneBtnText: i,
    showProgress: v ? !1 : o,
    showButtons: v ? ["close"] : h,
    allowClose: a,
    overlayOpacity: x ? 0 : 0.5,
    disableButtons: u,
    progressText: "{{current}} / {{total}}",
    overlayColor: "var(--color-black)",
    stagePadding: p,
    stageRadius: c,
    allowKeyboardControl: g,
    popoverClass: y,
    onPopoverRender: f,
    onDestroyed: B,
    ...m
  });
  return {
    // Use for onboarding tours. Pass in all steps as "steps" parameter for initial configuration.
    run: () => e.drive(),
    // Use for single element highlights -> see useOnboardingTip
    // highlight: (step: OnboardingStep) => driverInstance.highlight(step),
    // Cleanup the onboarding
    destroy: () => e.destroy(),
    // Gets the current state of the onboarding with the current step
    onboardingState: () => e.getState(),
    // Recalculate and redraw the highlight
    refresh: () => e.refresh(),
    // Is the tour or highlight currently active
    isActive: () => e.isActive(),
    // Move to the next step
    moveNext: () => e.moveNext(),
    // Move to the previous step
    movePrevious: () => e.movePrevious(),
    // Move to the step 4
    moveTo: (d) => e.moveTo(d),
    // Is there a next step
    hasNextStep: () => e.hasNextStep(),
    // Is there a previous step
    hasPreviousStep: () => e.hasPreviousStep(),
    // Is the current step the first step
    isFirstStep: () => e.isFirstStep(),
    // Is the current step the last step
    isLastStep: () => e.isLastStep(),
    // Gets the active step index
    getActiveIndex: () => e.getActiveIndex()
  };
}, C = (s) => {
  const { allowClose: t = !0, stagePadding: r = 0, stageRadius: n = 5, noBackdrop: i = !0 } = s || {}, o = l({
    allowClose: t,
    stagePadding: r,
    stageRadius: n,
    overlayOpacity: i ? 0 : 0.5,
    overlayColor: void 0
  });
  return {
    highlight: (a) => o.highlight(a),
    destroy: () => o.destroy(),
    refresh: () => o.refresh(),
    isActive: () => o.isActive()
  };
};
export {
  C as useOnboardingTip,
  A as useOnboardingTour
};
//# sourceMappingURL=useOnboarding.js.map
