define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-B3hYoW1m.amd","./forms-B_v2vU59.amd","./utils-DNzj9OOY.amd"],(function(b,i,e,s,r,c){"use strict";if(typeof e>"u")var e=window.Vue;const u=["id","data-view-page-active","data-modal","data-position"],m=e.defineComponent({__name:"dialog",props:{id:{},pageActive:{},width:{default:"600px"},height:{default:"auto"},modal:{type:Boolean,default:!0},position:{},historyType:{default:"push"},classes:{}},emits:["open","close"],setup(o){const n=o,t=s.getDialogWorker(n.id);if(!t)throw new Error("TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()");return e.provide("dialogWorker",t),e.onMounted(()=>{const l=e.getCurrentInstance(),a=l.parent;if(a?.parent?.type.name!=="DialogWrapper")throw new Error("TopDialog cannot be used in a template, use useTopDialog()");if(Array.isArray(a.subTree.children)&&a.subTree.children.length!==1)throw new Error("TopDialog can has only one root element");t.onMounted(a,l)}),e.watch(t.isOpened,()=>{t.isReady.value=!0},{flush:"post",once:!0}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(t).idAttr,class:e.normalizeClass(["top-dialog",o.classes]),style:e.normalizeStyle({"--top-dialog-width":o.width,"--top-dialog-height":o.height}),tabindex:"-1","data-view-page-active":e.unref(t).pageActive.value,"data-modal":o.modal,"data-position":o.position},[a[0]||(a[0]=e.createElementVNode("div",{class:"modal-layer modal-layer-header"},null,-1)),e.createElementVNode("div",{class:"modal-layer modal-layer-body",style:e.normalizeStyle({"min-height":o.height+"px"})},null,4),e.renderSlot(l.$slots,"default")],14,u))}}),p={key:0,style:{display:"none"}},h=["data-order","data-view-page"],v={class:"modal-header"},g={class:"top-title"},f={class:"buttons"},y=["title"],k=["title"],w=["data-order","data-view-page"],B={class:"modal-body"},C=e.defineComponent({__name:"page",props:{isLoading:{type:Boolean},name:{},order:{default:0},prevName:{},footerFullWith:{type:Boolean}},setup(o){const n=o,t=c.useTopDialogSelf(),l=e.computed(()=>({active:t.pageActive?.value===n.name,"i-load-data":n.isLoading||t.isLoadingPage.value}));return(a,d)=>{const E=e.resolveDirective("top-scroll-shadow");return e.unref(t).isReady.value?(e.openBlock(),e.createElementBlock("div",p,[(e.openBlock(),e.createBlock(e.Teleport,{to:"#"+e.unref(t).idAttr+" .modal-layer-header",disabled:!e.unref(t).needShowPage(o.name)},[e.createElementVNode("div",{"data-order":o.order,"data-view-page":o.name,class:e.normalizeClass(l.value)},[e.createElementVNode("div",v,[e.createElementVNode("div",g,[e.renderSlot(a.$slots,"header")]),e.createElementVNode("div",f,[e.renderSlot(a.$slots,"headerButtons")]),e.unref(r.Core).state.isMobile&&o.prevName?(e.openBlock(),e.createElementBlock("div",{key:0,class:"close",title:a.$i18n.Common.Back,"data-top-icon":"",onClick:d[0]||(d[0]=D=>e.unref(t).open(o.prevName))},null,8,y)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"close",title:a.$i18n.Common.Close,"data-top-icon":"","data-action":"top-dialog-close"},null,8,k))])],10,h)],8,["to","disabled"])),(e.openBlock(),e.createBlock(e.Teleport,{to:"#"+e.unref(t).idAttr+" .modal-layer-body",disabled:!e.unref(t).needShowPage(o.name)},[e.createElementVNode("div",{"data-order":o.order,"data-view-page":o.name,class:e.normalizeClass(["has_scroll_container",l.value]),style:e.normalizeStyle({"--top-dialog-footer-height":a.$slots.footer?void 0:"0px"})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",B,[e.renderSlot(a.$slots,"body")])),[[E]]),a.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal-footer",{"modal-footer-fullWith":o.footerFullWith}])},[e.renderSlot(a.$slots,"footer")],2)):e.createCommentVNode("",!0)],14,w)],8,["to","disabled"]))])):e.createCommentVNode("",!0)}}});i._sfc_main=m,i._sfc_main$1=C}));
//# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-WX1HlCFp.amd.js.map
