/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { computed, ref, onMounted, watch } from 'vue';
import { i as isFunction_1 } from '../_chunks/dep-6b22dd27.mjs';
import { getSSRAttach, getAttach } from '../utils/dom.mjs';
import '../_chunks/dep-a0b4a044.mjs';
import '../_chunks/dep-c959a6fb.mjs';
import '../_chunks/dep-b4041200.mjs';
import '../_chunks/dep-0f0c89ff.mjs';
import '../_chunks/dep-1cf2b129.mjs';
import '../_chunks/dep-e3b14d70.mjs';
import '../_chunks/dep-66d6733b.mjs';
import '../_chunks/dep-c31e1d9e.mjs';
import '../utils/easing.mjs';

var useTeleport = function useTeleport(attach, triggerNode) {
  var to = isFunction_1(attach) ? computed(attach) : ref(attach);
  var innerTriggerNode = isFunction_1(triggerNode) ? computed(triggerNode) : ref(triggerNode);
  var element = ref();
  var getElement = function getElement() {
    element.value = getSSRAttach() || getAttach(to.value, innerTriggerNode.value);
  };
  onMounted(function () {
    return getElement();
  });
  watch([to, innerTriggerNode], function () {
    return getElement();
  });
  return element;
};

export { useTeleport as default };
//# sourceMappingURL=useTeleport.mjs.map
