"use strict";const e=require("../../../../common/vendor.js"),o=require("./types.js");Math||(l+t+a+s)();const t=()=>"../wd-icon/wd-icon.js",l=()=>"../wd-overlay/wd-overlay.js",a=()=>"../wd-transition/wd-transition.js",s=()=>"../wd-root-portal/wd-root-portal.js",n=e.defineComponent({name:"wd-popup",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"},props:o.popupProps,emits:["update:modelValue","before-enter","enter","before-leave","leave","after-leave","after-enter","click-modal","close"],setup(o,{emit:t}){const l=o,a=t,s=e.computed((()=>l.transition?l.transition:"center"===l.position?["zoom-in","fade"]:"left"===l.position?"slide-left":"right"===l.position?"slide-right":"bottom"===l.position?"slide-up":"top"===l.position?"slide-down":"slide-up")),n=e.ref(0),r=e.computed((()=>`z-index:${l.zIndex}; padding-bottom: ${n.value}px;${l.customStyle}`)),d=e.computed((()=>`wd-popup wd-popup--${l.position} ${l.transition||"center"!==l.position?"":"is-deep"} ${l.customClass||""}`));function i(){a("click-modal"),l.closeOnClickModal&&c()}function c(){a("close"),a("update:modelValue",!1)}function p(){}return e.onBeforeMount((()=>{if(l.safeAreaInsetBottom){const{safeArea:o,screenHeight:t,safeAreaInsets:l}=e.index.getSystemInfoSync();n.value=o?t-(o.bottom||0):0}})),(o,t)=>e.e({a:o.rootPortal},o.rootPortal?e.e({b:o.modal},o.modal?{c:e.o(i),d:e.o(p),e:e.p({show:o.modelValue,"z-index":o.zIndex,"lock-scroll":o.lockScroll,duration:o.duration,"custom-style":o.modalStyle})}:{},{f:o.closable},o.closable?{g:e.o(c),h:e.p({"custom-class":"wd-popup__close",name:"add"})}:{},{i:e.o((e=>a("before-enter"))),j:e.o((e=>a("enter"))),k:e.o((e=>a("after-enter"))),l:e.o((e=>a("before-leave"))),m:e.o((e=>a("leave"))),n:e.o((e=>a("after-leave"))),o:e.p({"lazy-render":o.lazyRender,"custom-class":d.value,"custom-style":r.value,duration:o.duration,show:o.modelValue,name:s.value,destroy:o.hideWhenClose})}):e.e({p:o.modal},o.modal?{q:e.o(i),r:e.o(p),s:e.p({show:o.modelValue,"z-index":o.zIndex,"lock-scroll":o.lockScroll,duration:o.duration,"custom-style":o.modalStyle})}:{},{t:o.closable},o.closable?{v:e.o(c),w:e.p({"custom-class":"wd-popup__close",name:"add"})}:{},{x:e.o((e=>a("before-enter"))),y:e.o((e=>a("enter"))),z:e.o((e=>a("after-enter"))),A:e.o((e=>a("before-leave"))),B:e.o((e=>a("leave"))),C:e.o((e=>a("after-leave"))),D:e.p({"lazy-render":o.lazyRender,"custom-class":d.value,"custom-style":r.value,duration:o.duration,show:o.modelValue,name:s.value,destroy:o.hideWhenClose})}))}}),r=e._export_sfc(n,[["__scopeId","data-v-161bc30f"]]);wx.createComponent(r);
