//vue-final-modal@3.4.11 import{Aa as et,Ba as tt,Ca as Ce,Eb as Le,Fb as _e,P as Y,R as Ge,Rb as Be,S as Ze,Sb as nt,T as Qe,U as Xe,W as Me,Wa as Ae,_a as T,bb as O,ca as _,da as ze,fb as W,kb as G,lb as Z,o as We,p as Oe,pb as N,qa as Je,ta as $e,z as m,za as fe}from"./__shared_chunk_VVUPMHWD.js";import"./__shared_chunk_Y7BFQXXC.js";function Q(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Q=function(e){return typeof e}:Q=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(r)}function rt(r,e,t,n,a,l,i){try{var d=r[l](i),s=d.value}catch(y){t(y);return}d.done?e(s):Promise.resolve(s).then(n,a)}function Nt(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var l=r.apply(e,t);function i(s){rt(l,n,a,i,d,"next",s)}function d(s){rt(l,n,a,i,d,"throw",s)}i(void 0)})}}function Rt(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function at(r,e){for(var t=0;tr.length)&&(e=r.length);for(var t=0,n=new Array(e);t1),I=[],he=!1,me=0,dt=-1,X,J,tn=function(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e);return["auto","scroll"].includes(t.overflowY)&&e.scrollHeight>e.clientHeight},nn=function(e,t){return!(e.scrollTop===0&&t<0||e.scrollTop+e.clientHeight+t>=e.scrollHeight&&t>0)},rn=function(e){for(var t=[];e;){if(t.push(e),e.classList.contains("vfm"))return t;e=e.parentElement}return t},an=function(e,t){var n=!1,a=rn(e);return a.forEach(function(l){tn(l)&&nn(l,t)&&(n=!0)}),n},ct=function(e){return I.some(function(){return an(e,-me)})},be=function(e){var t=e||window.event;return ct(t.target)||t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)},on=function(e){if(J===void 0){var t=!!e&&e.reserveScrollBarGap===!0,n=window.innerWidth-document.documentElement.clientWidth;if(t&&n>0){var a=parseInt(getComputedStyle(document.body).getPropertyValue("padding-right"),10);J=document.body.style.paddingRight,document.body.style.paddingRight="".concat(a+n,"px")}}X===void 0&&(X=document.body.style.overflow,document.body.style.overflow="hidden")},ln=function(){J!==void 0&&(document.body.style.paddingRight=J,J=void 0),X!==void 0&&(document.body.style.overflow=X,X=void 0)},un=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},fn=function(e,t){return me=e.targetTouches[0].clientY-dt,ct(e.target)?!1:t&&t.scrollTop===0&&me>0||un(t)&&me<0?be(e):(e.stopPropagation(),!0)},sn=function(e,t){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!I.some(function(a){return a.targetElement===e})){var n={targetElement:e,options:t||{}};I=[].concat(R(I),[n]),st?(e.ontouchstart=function(a){a.targetTouches.length===1&&(dt=a.targetTouches[0].clientY)},e.ontouchmove=function(a){a.targetTouches.length===1&&fn(a,e)},he||(document.addEventListener("touchmove",be,Ve?{passive:!1}:void 0),he=!0)):on(t)}},De=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}I=I.filter(function(t){return t.targetElement!==e}),st?(e.ontouchstart=null,e.ontouchmove=null,he&&I.length===0&&(document.removeEventListener("touchmove",be,Ve?{passive:!1}:void 0),he=!1)):I.length||ln()},ve=function(){},C={Enter:"enter",Entering:"entering",Leave:"leave",Leaving:"leavng"},dn={t:"ns-resize",tr:"nesw-resize",r:"ew-resize",br:"nwse-resize",b:"ns-resize",bl:"nesw-resize",l:"ew-resize",tl:"nwse-resize"},pe={props:{name:{type:String,default:null},modelValue:{type:Boolean,default:!1},ssr:{type:Boolean,default:!0},classes:{type:[String,Object,Array],default:""},overlayClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},styles:{type:[Object,Array],default:function(){return{}}},overlayStyle:{type:[Object,Array],default:function(){return{}}},contentStyle:{type:[Object,Array],default:function(){return{}}},lockScroll:{type:Boolean,default:!0},hideOverlay:{type:Boolean,default:!1},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!1},preventClick:{type:Boolean,default:!1},attach:{type:null,default:!1,validator:function(e){var t=Q(e);return t==="boolean"||t==="string"?!0:e.nodeType===Node.ELEMENT_NODE}},transition:{type:[String,Object],default:"vfm"},overlayTransition:{type:[String,Object],default:"vfm"},keepOverlay:{type:Boolean,default:!1},zIndexAuto:{type:Boolean,default:!0},zIndexBase:{type:[String,Number],default:1e3},zIndex:{type:[Boolean,String,Number],default:!1},focusRetain:{type:Boolean,default:!0},focusTrap:{type:Boolean,default:!1},fitParent:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},dragSelector:{type:String,default:""},keepChangedStyle:{type:Boolean,default:!1},resize:{type:Boolean,default:!1},resizeDirections:{type:Array,default:function(){return["t","tr","r","br","b","bl","l","tl"]},validator:function(e){return["t","tr","r","br","b","bl","l","tl"].filter(function(t){return e.indexOf(t)!==-1}).length===e.length}},minWidth:{type:Number,default:0},minHeight:{type:Number,default:0},maxWidth:{type:Number,default:1/0},maxHeight:{type:Number,default:1/0}},emits:["update:modelValue","click-outside","before-open","opened","before-close","closed","_before-open","_opened","_closed","drag:start","drag:move","drag:end","resize:start","resize:move","resize:end"],setup:function(e,t){var n=t.emit,a=Symbol("vfm"),l=m(null),i=m(null),d=m(null),s=m(null),y=m(null),$=m(null),ee=m(null),te=new Xt,k=m(!1),A=We({modal:!1,overlay:!1,resize:!1}),H=m(null),K=m(null),we=m(!1),ne=m({}),B=m({}),re=m(null),Ne=m(null),ae=ve,oe=ve,gt=N(function(){return typeof e.overlayTransition=="string"?{name:e.overlayTransition}:p({},e.overlayTransition)}),wt=N(function(){return typeof e.transition=="string"?{name:e.transition}:p({},e.transition)}),St=N(function(){return(e.hideOverlay||H.value===C.Leave)&&K.value===C.Leave}),Se=N(function(){return e.zIndex===!1?e.zIndexAuto?+e.zIndexBase+2*(ee.value||0):!1:e.zIndex}),Et=N(function(){return p({},Se.value!==!1&&{zIndex:Se.value})}),xt=N(function(){var o=[B.value];return Array.isArray(e.contentStyle)?o.push.apply(o,R(e.contentStyle)):o.push(e.contentStyle),o});_(function(){return e.modelValue},function(o){if(we.value){we.value=!1;return}if(ie(),!o){if(He("before-close",!0)){oe("hide");return}Re()}}),_(function(){return e.lockScroll},xe),_(function(){return e.hideOverlay},function(o){e.modelValue&&!o&&(A.overlay=!0)}),_(function(){return e.attach},ie),_(St,function(o){o&&(k.value=!1,i.value.style.display="none")},{flush:"post"}),_(function(){return e.drag},function(o){k.value&&(o?Ke():Ue())}),_(function(){return e.resize},function(o){k.value&&(o?qe():Ye())}),_(function(){return e.keepChangedStyle},function(o){o||(B.value={})}),Je(function(){e.api.modals.push(Ee()),ie()}),$e(function(){var o;Re(),e.lockScroll&&i.value&&De(i.value),l==null||(o=l.value)===null||o===void 0||o.remove();var u=e.api.modals.findIndex(function(f){return f.uid===a});e.api.modals.splice(u,1)});function Ee(){return{uid:a,props:e,emit:n,vfmContainer:i,vfmContent:d,vfmResize:s,vfmOverlayTransition:y,vfmTransition:$,getAttachElement:Fe,modalStackIndex:ee,visibility:A,handleLockScroll:xe,$focusTrap:te,toggle:Vt,params:ne}}function ie(){if(e.modelValue){if(n("_before-open",U({type:"_before-open"})),He("before-open",!1)){oe("show");return}var o=Fe();if(o||e.attach===!1){if(e.attach!==!1)if(l.value)o.appendChild(l.value);else{k.value=!0,Y(function(){ie()});return}var u=e.api.openedModals.findIndex(function(f){return f.uid===a});u!==-1&&e.api.openedModals.splice(u,1),e.api.openedModals.push(Ee()),ee.value=e.api.openedModals.length-1,xe(),e.api.openedModals.filter(function(f){return f.uid!==a}).forEach(function(f,h){f.getAttachElement()===o&&(f.modalStackIndex.value=h,!f.props.keepOverlay&&(f.visibility.overlay=!1))}),k.value=!0,Tt()}else o!==!1&&console.warn("Unable to locate target ".concat(e.attach))}}function Re(){var o=e.api.openedModals.findIndex(function(f){return f.uid===a});if(o!==-1&&e.api.openedModals.splice(o,1),e.api.openedModals.length>0){var u=e.api.openedModals[e.api.openedModals.length-1];u.props.focusTrap&&u.$focusTrap.firstElement().focus(),(u.props.focusRetain||u.props.focusTrap)&&u.vfmContainer.value.focus(),!u.props.hideOverlay&&(u.visibility.overlay=!0)}e.drag&&Ue(),e.resize&&Ye(),re.value=null,Ot()}function xe(){e.modelValue&&Y(function(){e.lockScroll?sn(i.value,{reserveScrollBarGap:!0}):De(i.value)})}function Fe(){var o;return e.attach===!1?o=!1:typeof e.attach=="string"?window?o=window.document.querySelector(e.attach):o=!1:o=e.attach,o}function Tt(){A.overlay=!0,A.modal=!0}function Ot(){A.overlay=!1,A.modal=!1}function Mt(){H.value=C.Entering}function zt(){H.value=C.Enter}function Ct(){H.value=C.Leaving}function At(){H.value=C.Leave}function Lt(){K.value=C.Entering}function _t(){K.value=C.Enter,(e.focusRetain||e.focusTrap)&&i.value.focus(),e.focusTrap&&te.enable(i.value),e.drag&&Ke(),e.resize&&qe(),n("_opened"),n("opened",U({type:"opened"})),ae("show")}function Bt(){K.value=C.Leaving,te.enabled()&&te.disable()}function Pt(){K.value=C.Leave,ee.value=null,e.lockScroll&&De(i.value),e.keepChangedStyle||(B.value={});var o=!1,u=U({type:"closed",stop:function(){o=!0}});n("_closed"),n("closed",u),ae("hide"),!o&&(ne.value={})}function Dt(o){Ne.value=o==null?void 0:o.target}function It(){Ne.value===i.value&&re.value!=="resize:move"&&(n("click-outside",U({type:"click-outside"})),e.clickToClose&&n("update:modelValue",!1))}function kt(){k.value&&e.escToClose&&n("update:modelValue",!1)}function U(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return p({ref:Ee()},o)}function He(o,u){var f=!1,h=U({type:o,stop:function(){f=!0}});return n(o,h),f?(we.value=!0,Y(function(){n("update:modelValue",u)}),!0):!1}function Te(o,u,f){re.value="".concat(u,":").concat(f),n(re.value,o)}function Vt(o,u){var f=arguments;return new Promise(function(h,b){ae=function(v){h(v),ae=ve},oe=function(v){b(v),oe=ve};var V=typeof o=="boolean"?o:!e.modelValue;V&&f.length===2&&(ne.value=u),n("update:modelValue",V)})}function le(o){o.stopPropagation();var u="resize",f="drag",h=o.target.getAttribute("direction"),b;if(h)b=u;else if(en(o,d.value,e.dragSelector))b=f;else return;Te(o,b,"start");var V=lt(o),g=i.value.getBoundingClientRect(),v=d.value.getBoundingClientRect(),P=window.getComputedStyle(d.value).position==="absolute",M={top:ut(B.value.top),left:ut(B.value.left)},c=function(){if(e.fitParent){var D={absolute:function(){return{minTop:0,minLeft:0,maxTop:g.height-v.height,maxLeft:g.width-v.width}},relative:function(){return{minTop:M.top+g.top-v.top,minLeft:M.left+g.left-v.left,maxTop:M.top+g.bottom-v.bottom,maxLeft:M.left+g.right-v.right}}};return P?D.absolute():D.relative()}else return{}}(),w=b===u&&Jt(document.body,"cursor",dn[h]),E=function(x){x.stopPropagation(),Te(x,b,"move");var q=lt(x),S={x:q.x-V.x,y:q.y-V.y};b===u&&(S=jt(h,S,g,v,P));var L,j;P?(L=v.top-g.top+S.y,j=v.left-g.left+S.x):(L=M.top+S.y,j=M.left+S.x),b===f&&e.fitParent&&(L=se(c.minTop,L,c.maxTop),j=se(c.minLeft,j,c.maxLeft));var ue=p(p(p({position:"relative",top:L+"px",left:j+"px",margin:"unset",touchAction:"none"},P&&{position:"absolute",transform:"unset",width:v.width+"px",height:v.height+"px"}),S.width&&{width:S.width+"px"}),S.height&&{height:S.height+"px"});B.value=p(p({},B.value),ue)},z=function D(x){x.stopPropagation(),b===u&&w&&w(),setTimeout(function(){Te(x,b,"end")}),ce("move",document,E),ce("up",document,D)};de("move",document,E),de("up",document,z)}function Ke(){de("down",d.value,le),B.value.touchAction="none"}function Ue(){ce("down",d.value,le)}function qe(){A.resize=!0,Y(function(){de("down",s.value,le)})}function Ye(){ce("down",s.value,le),A.resize=!1}function jt(o,u,f,h,b){var V=function(c){var w,E=u[c.axis];E=e.fitParent?se(c.min,E,c.max):E;var z=se(c.minEdge,c.getEdge(E),c.maxEdge);return E=c.getOffsetAxis(z,b),w={},F(w,c.edgeName,z),F(w,c.axis,E),w},g=function(c,w,E,z){var D=h[w],x=f[c]-h[c],q=$t(w);return{axis:E,edgeName:w,min:z?x:-D,max:z?D:x,minEdge:e["min".concat(q)],maxEdge:e["max".concat(q)],getEdge:function(L){return h[w]-L*(z?1:-1)},getOffsetAxis:function(L,j){var ue=h[w]-L;return j?z?ue:0:(z?1:-1)*ue/2}}},v={t:["top","height","y",!0],b:["bottom","height","y",!1],l:["left","width","x",!0],r:["right","width","x",!1]},P={x:0,y:0};return o.split("").forEach(function(M){var c=g.apply(void 0,R(v[M]));P=p(p({},P),V(c))}),P}return{root:l,vfmContainer:i,vfmContent:d,vfmResize:s,vfmOverlayTransition:y,vfmTransition:$,computedOverlayTransition:gt,computedTransition:wt,visible:k,visibility:A,params:ne,calculateZIndex:Se,bindStyle:Et,bindContentStyle:xt,beforeOverlayEnter:Mt,afterOverlayEnter:zt,beforeOverlayLeave:Ct,afterOverlayLeave:At,beforeModalEnter:Lt,afterModalEnter:_t,beforeModalLeave:Bt,afterModalLeave:Pt,onMousedown:Dt,onMouseupContainer:It,onEsc:kt}}},Ie=Qe("data-v-2836fdb5");Ge("data-v-2836fdb5");var cn={key:0,ref:"vfmResize",class:"vfm__resize vfm--absolute vfm--inset vfm--prevent-none vfm--select-none vfm--touch-none"};Ze();var vn=Ie(function(r,e,t,n,a,l){return t.ssr||n.visible?ze((T(),O("div",{key:0,ref:"root",style:n.bindStyle,class:["vfm vfm--inset",[t.attach===!1?"vfm--fixed":"vfm--absolute",{"vfm--prevent-none":t.preventClick}]],onKeydown:e[4]||(e[4]=nt(function(){return n.onEsc&&n.onEsc.apply(n,arguments)},["esc"]))},[W(Le,Z(n.computedOverlayTransition,{onBeforeEnter:n.beforeOverlayEnter,onAfterEnter:n.afterOverlayEnter,onBeforeLeave:n.beforeOverlayLeave,onAfterLeave:n.afterOverlayLeave}),{default:Ie(function(){return[!t.hideOverlay&&n.visibility.overlay?(T(),O("div",{key:0,class:["vfm__overlay vfm--overlay vfm--absolute vfm--inset",t.overlayClass],style:t.overlayStyle},null,6)):G("v-if",!0)]}),_:1},16,["onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"]),W(Le,Z(n.computedTransition,{onBeforeEnter:n.beforeModalEnter,onAfterEnter:n.afterModalEnter,onBeforeLeave:n.beforeModalLeave,onAfterLeave:n.afterModalLeave}),{default:Ie(function(){return[ze(W("div",{ref:"vfmContainer",class:["vfm__container vfm--absolute vfm--inset vfm--outline-none",t.classes],style:t.styles,"aria-expanded":n.visibility.modal.toString(),role:"dialog","aria-modal":"true",tabindex:"-1",onMouseup:e[2]||(e[2]=Be(function(){return n.onMouseupContainer&&n.onMouseupContainer.apply(n,arguments)},["self"])),onMousedown:e[3]||(e[3]=Be(function(){return n.onMousedown&&n.onMousedown.apply(n,arguments)},["self"]))},[W("div",{ref:"vfmContent",class:["vfm__content",[t.contentClass,{"vfm--prevent-auto":t.preventClick}]],style:n.bindContentStyle,onMousedown:e[1]||(e[1]=function(i){return n.onMousedown(null)})},[tt(r.$slots,"default",{params:n.params,close:function(){return r.$emit("update:modelValue",!1)}}),n.visibility.resize&&n.visibility.modal?(T(),O("div",cn,[(T(!0),O(Ae,null,fe(t.resizeDirections,function(i){return T(),O("div",{key:i,direction:i,class:["vfm--resize-".concat(i),"vfm--absolute vfm--prevent-auto"]},null,10,["direction"])}),128))],512)):G("v-if",!0)],38)],46,["aria-expanded"]),[[_e,n.visibility.modal]])]}),_:3},16,["onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"])],38)),[[_e,!t.ssr||n.visible]]):G("v-if",!0)});function mn(r,e){e===void 0&&(e={});var t=e.insertAt;if(!(!r||typeof document=="undefined")){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}}var yn=` .vfm--fixed[data-v-2836fdb5] { position: fixed; } .vfm--absolute[data-v-2836fdb5] { position: absolute; } .vfm--inset[data-v-2836fdb5] { top: 0; right: 0; bottom: 0; left: 0; } .vfm--overlay[data-v-2836fdb5] { background-color: rgba(0, 0, 0, 0.5); } .vfm--prevent-none[data-v-2836fdb5] { pointer-events: none; } .vfm--prevent-auto[data-v-2836fdb5] { pointer-events: auto; } .vfm--outline-none[data-v-2836fdb5]:focus { outline: none; } .vfm-enter-active[data-v-2836fdb5], .vfm-leave-active[data-v-2836fdb5] { transition: opacity 0.2s; } .vfm-enter-from[data-v-2836fdb5], .vfm-leave-to[data-v-2836fdb5] { opacity: 0; } .vfm--touch-none[data-v-2836fdb5] { touch-action: none; } .vfm--select-none[data-v-2836fdb5] { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .vfm--resize-tr[data-v-2836fdb5], .vfm--resize-br[data-v-2836fdb5], .vfm--resize-bl[data-v-2836fdb5], .vfm--resize-tl[data-v-2836fdb5] { width: 12px; height: 12px; z-index: 10; } .vfm--resize-t[data-v-2836fdb5] { top: -6px; left: 0; width: 100%; height: 12px; cursor: ns-resize; } .vfm--resize-tr[data-v-2836fdb5] { top: -6px; right: -6px; cursor: nesw-resize; } .vfm--resize-r[data-v-2836fdb5] { top: 0; right: -6px; width: 12px; height: 100%; cursor: ew-resize; } .vfm--resize-br[data-v-2836fdb5] { bottom: -6px; right: -6px; cursor: nwse-resize; } .vfm--resize-b[data-v-2836fdb5] { bottom: -6px; left: 0; width: 100%; height: 12px; cursor: ns-resize; } .vfm--resize-bl[data-v-2836fdb5] { bottom: -6px; left: -6px; cursor: nesw-resize; } .vfm--resize-l[data-v-2836fdb5] { top: 0; left: -6px; width: 12px; height: 100%; cursor: ew-resize; } .vfm--resize-tl[data-v-2836fdb5] { top: -6px; left: -6px; cursor: nwse-resize; } `;mn(yn);pe.render=vn;pe.__scopeId="data-v-2836fdb5";pe.__file="lib/VueFinalModal.vue";var je={props:{},methods:{slice:function(e){this.api.dynamicModals.splice(e,1)},beforeOpen:function(e,t,n){var a=this;return Nt(function*(){e.ref.params.value=t.params,yield a.$nextTick(),yield a.$nextTick(),t.value||(a.slice(n),t.reject("show"))})()},isString:function(e){return typeof e=="string"}}},hn={class:"modals-container"};function bn(r,e,t,n,a,l){return T(),O("div",hn,[(T(!0),O(Ae,null,fe(r.api.dynamicModals,function(i,d){return T(),O(Me(i.component),Z({key:i.id},i.bind,{modelValue:i.value,"onUpdate:modelValue":function(y){return i.value=y}},Ce(i.on),{on_closed:function(y){return l.slice(d)},on_beforeOpen:function(y){return l.beforeOpen(y,i)},on_opened:i.opened}),et({_:2},[fe(i.slots,function(s,y){return{name:y,fn:Xe(function(){return[G(" eslint-disable vue/no-v-html "),l.isString(s)?(T(),O("div",{key:0,innerHTML:s},null,8,["innerHTML"])):(T(),O(Me(s.component),Z({key:1},s.bind,Ce(s.on||{})),null,16))]})}})]),1040,["modelValue","onUpdate:modelValue","on_closed","on_beforeOpen","on_opened"])}),128))])}je.render=bn;je.__file="lib/ModalsContainer.vue";function pn(){var r=null;return{show:function(t){for(var n=this,a=arguments.length,l=new Array(a>1?a-1:0),i=1;i1?n-1:0),l=1;l1&&arguments[1]!==void 0?arguments[1]:{},n=ft===0?ge:bt(),a=n.$vfm,l=n.VueFinalModal,i=n.ModalsContainer;ft+=1;var d=t.key||mt,s=t.componentName||yt,y=t.dynamicContainerName||ht;Object.defineProperty(e.config.globalProperties,d,{get:function(){return a}}),e.provide(d,a),e.component(s,l),e.component(y,i)},Sn=function(e){return{install:function(n,a){var l=Object.assign({},e,a);pt(n,l)}}};Sn.install=pt;export{xn as $vfm,On as ModalsContainer,Tn as VueFinalModal,bt as defineVfm,Sn as vfmPlugin};