import{q as g,_ as l,s as v,t as $,P as C}from"./index.TkDYtvUB.js";import{_ as d,$ as P,a0 as T,F as h,Z as m,j as R,i as p,p as x,d as y,P as A,o as V,w as F,b as _,D as b,l as j,a1 as w}from"./index.CPcBO1Os.js";function E(e){let{prefixCls:t,animation:r,transitionName:a}=e;return r?{name:"".concat(t,"-").concat(r)}:a?{name:a}:{}}function L(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,n=e;if(Array.isArray(e)&&(n=g(e)[0]),!n)return null;const s=d(n,t,a);return s.props=r?l(l({},s.props),t):s.props,v(typeof s.props.class!="object"),s}function q(e,t,r){m(d(e,l({},t)),r)}const i=e=>(e||[]).some(t=>P(t)?!(t.type===T||t.type===h&&!i(t.children)):!0)?e:null;function K(e,t,r,a){var n;const s=(n=e[t])===null||n===void 0?void 0:n.call(e,r);return i(s)?s:a==null?void 0:a()}$("bottomLeft","bottomRight","topLeft","topRight");const B=e=>e!==void 0&&(e==="topLeft"||e==="topRight")?"slide-down":"slide-up",G=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?l({name:e,appear:!0,enterFromClass:"".concat(e,"-enter ").concat(e,"-enter-prepare ").concat(e,"-enter-start"),enterActiveClass:"".concat(e,"-enter ").concat(e,"-enter-prepare"),enterToClass:"".concat(e,"-enter ").concat(e,"-enter-active"),leaveFromClass:" ".concat(e,"-leave"),leaveActiveClass:"".concat(e,"-leave ").concat(e,"-leave-active"),leaveToClass:"".concat(e,"-leave ").concat(e,"-leave-active")},t):l({css:!1},t)},I=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?l({name:e,appear:!0,appearActiveClass:"".concat(e),appearToClass:"".concat(e,"-appear ").concat(e,"-appear-active"),enterFromClass:"".concat(e,"-appear ").concat(e,"-enter ").concat(e,"-appear-prepare ").concat(e,"-enter-prepare"),enterActiveClass:"".concat(e),enterToClass:"".concat(e,"-enter ").concat(e,"-appear ").concat(e,"-appear-active ").concat(e,"-enter-active"),leaveActiveClass:"".concat(e," ").concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-active")},t):l({css:!1},t)},O=(e,t,r)=>r!==void 0?r:"".concat(e,"-").concat(t),f=Symbol("PortalContextKey"),D=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0};x(f,{inTriggerContext:t.inTriggerContext,shouldRender:p(()=>{const{sPopupVisible:r,popupRef:a,forceRender:n,autoDestroy:s}=e||{};let u=!1;return(r||a||n)&&(u=!0),!r&&s&&(u=!1),u})})},M=()=>{D({},{inTriggerContext:!1});const e=R(f,{shouldRender:p(()=>!1),inTriggerContext:!1});return{shouldRender:p(()=>e.shouldRender.value||e.inTriggerContext===!1)}},W=y({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:C.func.isRequired,didUpdate:Function},setup(e,t){let{slots:r}=t,a=!0,n;const{shouldRender:s}=M();function u(){s.value&&(n=e.getContainer())}A(()=>{a=!1,u()}),V(()=>{n||u()});const c=F(s,()=>{s.value&&!n&&(n=e.getContainer()),n&&c()});return _(()=>{b(()=>{var o;s.value&&((o=e.didUpdate)===null||o===void 0||o.call(e,e))})}),()=>{var o;return s.value?a?(o=r.default)===null||o===void 0?void 0:o.call(r):n?j(w,{to:n},r):null:null}}});export{W as P,K as a,O as b,L as c,I as d,E as e,B as f,G as g,q as t,D as u};
