import { ref } from 'vue';
import canUseDom from '../_util/canUseDom.mjs';

let uuid = 0;
const isBrowserClient = process.env.NODE_ENV !== "test" && canUseDom();
function getUUID() {
  let retId;
  if (isBrowserClient) {
    retId = uuid;
    uuid += 1;
  } else {
    retId = "TEST_OR_SSR";
  }
  return retId;
}
function useId(id = ref(""), prefix = "vc_unique") {
  const innerId = `${prefix}_${getUUID()}`;
  return id.value || innerId;
}

export { getUUID, isBrowserClient, useId };
//# sourceMappingURL=useId.mjs.map
