"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../vc-trigger/context.js"),d=require("./vue-types/index.js"),c=e.defineComponent({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:d.default.func.isRequired,didUpdate:Function},setup(r,{slots:o}){let u=!0,t;const{shouldRender:n}=l.useInjectPortal();function i(){n.value&&(t=r.getContainer())}e.onBeforeMount(()=>{u=!1,i()}),e.onMounted(()=>{t||i()});const a=e.watch(n,()=>{n.value&&!t&&(t=r.getContainer()),t&&a()});return e.onUpdated(()=>{e.nextTick(()=>{n.value&&r.didUpdate?.(r)})}),()=>n.value?u?o.default?.():t?e.createVNode(e.Teleport,{to:t},o):null:null}});exports.default=c;
