@febe95/vue-js-modal
Version:
Modal Component for Vue.js
2 lines • 49.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):"object"==typeof exports?exports["vue-js-modal"]=t(require("vue")):e["vue-js-modal"]=t(e.vue)}(self,(e=>(()=>{var t={65:(e,t,n)=>{(e.exports=n(765)(!1)).push([e.id,"\n.vue-dialog {\n font-size: 14px;\n}\n.vue-dialog div {\n box-sizing: border-box;\n}\n.vue-dialog-content {\n flex: 1 0 auto;\n width: 100%;\n padding: 14px;\n}\n.vue-dialog-content-title {\n font-weight: 600;\n padding-bottom: 14px;\n}\n.vue-dialog-buttons {\n display: flex;\n flex: 0 1 auto;\n width: 100%;\n border-top: 1px solid #eee;\n}\n.vue-dialog-buttons-none {\n width: 100%;\n padding-bottom: 14px;\n}\n.vue-dialog-button {\n font-size: inherit;\n background: transparent;\n padding: 0;\n margin: 0;\n border: 0;\n cursor: pointer;\n box-sizing: border-box;\n line-height: 40px;\n height: 40px;\n color: inherit;\n font: inherit;\n outline: none;\n}\n.vue-dialog-button:hover {\n background: #f9f9f9;\n}\n.vue-dialog-button:active {\n background: #f3f3f3;\n}\n.vue-dialog-button:not(:first-of-type) {\n border-left: 1px solid #eee;\n}\n",""])},100:(e,t,n)=>{var o=n(65);"string"==typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);(0,n(534).A)("ba156f46",o,!1,{})},195:(e,t,n)=>{(e.exports=n(765)(!1)).push([e.id,"\n.vm--block-scroll {\n overflow: hidden;\n width: 100vw;\n}\n.vm--container {\n position: fixed;\n box-sizing: border-box;\n left: 0;\n top: 0;\n width: 100%;\n height: 100vh;\n z-index: 999;\n}\n.vm--overlay {\n position: fixed;\n box-sizing: border-box;\n left: 0;\n top: 0;\n width: 100%;\n height: 100vh;\n background: rgba(0, 0, 0, 0.2);\n /* z-index: 999; */\n opacity: 1;\n}\n.vm--container.scrollable {\n height: 100%;\n min-height: 100vh;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n.vm--modal {\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n\n background-color: white;\n border-radius: 3px;\n box-shadow: 0 20px 60px -2px rgba(27, 33, 58, 0.4);\n}\n.vm--container.scrollable .vm--modal {\n margin-bottom: 2px;\n}\n.vm--top-right-slot {\n display: block;\n position: absolute;\n right: 0;\n top: 0;\n}\n.vm-transition--overlay-enter-active,\n.vm-transition--overlay-leave-active {\n transition: all 50ms;\n}\n.vm-transition--overlay-enter-from,\n.vm-transition--overlay-leave-active {\n opacity: 0;\n}\n.vm-transition--modal-enter-active,\n.vm-transition--modal-leave-active {\n transition: all 400ms;\n}\n.vm-transition--modal-enter-from,\n.vm-transition--modal-leave-active {\n opacity: 0;\n transform: translateY(-20px);\n}\n.vm-transition--default-enter-active,\n.vm-transition--default-leave-active {\n transition: all 200ms;\n}\n.vm-transition--default-enter-from,\n.vm-transition--default-leave-active {\n opacity: 0;\n}\n",""])},237:(e,t,n)=>{var o=n(504);e.exports=new o},262:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n}},380:t=>{"use strict";t.exports=e},484:(e,t,n)=>{var o=n(195);"string"==typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);(0,n(534).A)("50992dbc",o,!1,{})},504:e=>{function t(){}t.prototype={on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var o=this;function i(){o.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;o<i;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],i=[];if(o&&t)for(var r=0,a=o.length;r<a;r++)o[r].fn!==t&&o[r].fn._!==t&&i.push(o[r]);return i.length?n[e]=i:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t},534:(e,t,n)=>{"use strict";function o(e,t){for(var n=[],o={},i=0;i<t.length;i++){var r=t[i],a=r[0],s={id:e+":"+i,css:r[1],media:r[2],sourceMap:r[3]};o[a]?o[a].parts.push(s):n.push(o[a]={id:a,parts:[s]})}return n}n.d(t,{A:()=>m});var i="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r={},a=i&&(document.head||document.getElementsByTagName("head")[0]),s=null,l=0,u=!1,c=function(){},d=null,f="data-vue-ssr-id",h="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function m(e,t,n,i){u=n,d=i||{};var a=o(e,t);return p(a),function(t){for(var n=[],i=0;i<a.length;i++){var s=a[i];(l=r[s.id]).refs--,n.push(l)}t?p(a=o(e,t)):a=[];for(i=0;i<n.length;i++){var l;if(0===(l=n[i]).refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete r[l.id]}}}}function p(e){for(var t=0;t<e.length;t++){var n=e[t],o=r[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(b(n.parts[i]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{var a=[];for(i=0;i<n.parts.length;i++)a.push(b(n.parts[i]));r[n.id]={id:n.id,refs:1,parts:a}}}}function v(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function b(e){var t,n,o=document.querySelector("style["+f+'~="'+e.id+'"]');if(o){if(u)return c;o.parentNode.removeChild(o)}if(h){var i=l++;o=s||(s=v()),t=w.bind(null,o,i,!1),n=w.bind(null,o,i,!0)}else o=v(),t=E.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}var y,g=(y=[],function(e,t){return y[e]=t,y.filter(Boolean).join("\n")});function w(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=g(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function E(e,t){var n=t.css,o=t.media,i=t.sourceMap;if(o&&e.setAttribute("media",o),d.ssrId&&e.setAttribute(f,t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},642:(e,t,n)=>{var o=n(745);"string"==typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);(0,n(534).A)("597e3661",o,!1,{})},745:(e,t,n)=>{(e.exports=n(765)(!1)).push([e.id,"\n.vue-modal-top,\n.vue-modal-bottom,\n.vue-modal-left,\n.vue-modal-right,\n.vue-modal-topRight,\n.vue-modal-topLeft,\n.vue-modal-bottomLeft,\n.vue-modal-bottomRight {\n display: block;\n overflow: hidden;\n position: absolute;\n background: transparent;\n z-index: 9999999;\n}\n.vue-modal-topRight,\n.vue-modal-topLeft,\n.vue-modal-bottomLeft,\n.vue-modal-bottomRight {\n width: 12px;\n height: 12px;\n}\n.vue-modal-top {\n right: 12;\n top: 0;\n width: 100%;\n height: 12px;\n cursor: n-resize;\n}\n.vue-modal-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n height: 12px;\n cursor: s-resize;\n}\n.vue-modal-left {\n left: 0;\n top: 0;\n width: 12px;\n height: 100%;\n cursor: w-resize;\n}\n.vue-modal-right {\n right: 0;\n top: 0;\n width: 12px;\n height: 100%;\n cursor: e-resize;\n}\n.vue-modal-topRight {\n right: 0;\n top: 0;\n background: transparent;\n cursor: ne-resize;\n}\n.vue-modal-topLeft {\n left: 0;\n top: 0;\n cursor: nw-resize;\n}\n.vue-modal-bottomLeft {\n left: 0;\n bottom: 0;\n cursor: sw-resize;\n}\n.vue-modal-bottomRight {\n right: 0;\n bottom: 0;\n cursor: se-resize;\n}\n#vue-modal-triangle::after {\n display: block;\n position: absolute;\n content: '';\n background: transparent;\n left: 0;\n top: 0;\n width: 0;\n height: 0;\n border-bottom: 10px solid #ddd;\n border-left: 10px solid transparent;\n}\n#vue-modal-triangle.clicked::after {\n border-bottom: 10px solid #369be9;\n}\n",""])},765:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var i=(a=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),r=o.sources.map((function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"}));return[n].concat(r).concat([i]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},i=0;i<this.length;i++){var r=this[i][0];"number"==typeof r&&(o[r]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&o[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={id:e,exports:{}};return t[e](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";o.r(i),o.d(i,{Dialog:()=>ze,Modal:()=>ge,default:()=>Pe,version:()=>De});var e=o(380),t=["data-modal","aria-expanded"],n={class:"vm--top-right-slot"},r=["aria-expanded"];var a={key:0,class:"vue-modal-top"},s={key:1,class:"vue-modal-bottom"},l={key:2,class:"vue-modal-left"},u={key:3,class:"vue-modal-right"},c={key:4,class:"vue-modal-topRight"},d={key:5,class:"vue-modal-topLeft"},f=["id"],h={key:7,class:"vue-modal-bottomLeft"};var m=function(e,t,n){return n<e?e:n>t?t:n};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=p(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,a,s=[],l=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(s.push(o.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var g=["INPUT","TEXTAREA","SELECT"],w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(){return(e++).toString()}}(),E=function(){var e=window.innerWidth,t=document.documentElement.clientWidth;return e&&t?Math.min(e,t):t||e},k=function(e){return e.split(";").map((function(e){return e.trim()})).filter(Boolean).map((function(e){return e.split(":")})).reduce((function(e,t){var n=b(t,2);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach((function(t){v(e,t,n[t])}))}return e}({},e,v({},n[0],n[1]))}),{})},x=function(e){return e.touches&&e.touches.length>0?e.touches[0]:e};const S={name:"VueJsModalResizer",props:{minHeight:{type:Number,default:0},minWidth:{type:Number,default:0},maxWidth:{type:Number,default:Number.MAX_SAFE_INTEGER},maxHeight:{type:Number,default:Number.MAX_SAFE_INTEGER},viewportWidth:{type:Number,required:!0},viewportHeight:{type:Number,required:!0},resizeIndicator:{type:Boolean,default:!0},resizeEdges:{type:Array,required:!0}},emits:["resize","resize-stop"],data:function(){return{clicked:!1,targetClass:"",size:{},initialX:0,initialY:0}},mounted:function(){this.$el.addEventListener("mousedown",this.start,!1)},computed:{className:function(){return["vue-modal-bottomRight",{clicked:this.clicked}]},getID:function(){return this.resizeIndicator?"vue-modal-triangle":""}},methods:{start:function(e){this.targetClass=e.target.className,this.clicked=!0,this.initialX=e.clientX,this.initialY=e.clientY,window.addEventListener("mousemove",this.mousemove,!1),window.addEventListener("mouseup",this.stop,!1),e.stopPropagation(),e.preventDefault()},stop:function(){this.clicked=!1,this.clicked=!1,this.targetClass="",this.initialX=0,this.initialY=0,window.removeEventListener("mousemove",this.mousemove,!1),window.removeEventListener("mouseup",this.stop,!1),this.$emit("resize-stop",{element:this.$el.parentElement,size:this.size})},mousemove:function(e){this.resize(e)},resize:function(e){var t=this.$el.parentElement,n=e.clientX,o=e.clientY,i=parseInt(t.style.width.replace("px","")),r=parseInt(t.style.height.replace("px",""));if(!(e.clientX>this.viewportWidth||e.clientX<0)&&!(e.clientY>this.viewportHeight||e.clientY<0)&&t){switch(this.targetClass){case"vue-modal-right":n-=t.offsetLeft,o=r;break;case"vue-modal-left":o=r,n=i+(this.initialX-e.clientX);break;case"vue-modal-top":n=i,o=r+(this.initialY-e.clientY);break;case"vue-modal-bottom":n=i,o-=t.offsetTop;break;case"vue-modal-bottomRight":n-=t.offsetLeft,o-=t.offsetTop;break;case"vue-modal-topRight":n-=t.offsetLeft,o=r+(this.initialY-e.clientY);break;case"vue-modal-bottomLeft":n=i+(this.initialX-e.clientX),o-=t.offsetTop;break;case"vue-modal-topLeft":n=i+(this.initialX-e.clientX),o=r+(this.initialY-e.clientY);break;default:console.error("Incorrrect/no resize direction.")}var a=Math.min(E(),this.maxWidth),s=Math.min(window.innerHeight,this.maxHeight);n=m(this.minWidth,a,n),o=m(this.minHeight,s,o),this.initialX=e.clientX,this.initialY=e.clientY,this.size={width:n,height:o};var l={width:n-i,height:o-r};t.style.width=n+"px",t.style.height=o+"px",this.$emit("resize",{element:t,size:this.size,direction:this.targetClass,dimGrowth:l})}}}};o(642);var _=o(262);const T=(0,_.A)(S,[["render",function(t,n,o,i,r,m){return(0,e.openBlock)(),(0,e.createElementBlock)("div",null,[o.resizeEdges.includes("t")?((0,e.openBlock)(),(0,e.createElementBlock)("div",a)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("b")?((0,e.openBlock)(),(0,e.createElementBlock)("div",s)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("l")?((0,e.openBlock)(),(0,e.createElementBlock)("div",l)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("r")?((0,e.openBlock)(),(0,e.createElementBlock)("div",u)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("tr")?((0,e.openBlock)(),(0,e.createElementBlock)("div",c)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("tl")?((0,e.openBlock)(),(0,e.createElementBlock)("div",d)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("br")?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:6,id:m.getID,class:(0,e.normalizeClass)(m.className)},null,10,f)):(0,e.createCommentVNode)("v-if",!0),o.resizeEdges.includes("bl")?((0,e.openBlock)(),(0,e.createElementBlock)("div",h)):(0,e.createCommentVNode)("v-if",!0)])}]]);function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}var z="[-+]?[0-9]*.?[0-9]+",L=[{name:"px",regexp:new RegExp("^".concat(z,"px$"))},{name:"%",regexp:new RegExp("^".concat(z,"%$"))},{name:"px",regexp:new RegExp("^".concat(z,"$"))}],M=function(e){switch(O(e)){case"number":return{type:"px",value:e};case"string":return function(e){if("auto"===e)return{type:e,value:0};var t=L.find((function(t){return t.regexp.test(e)}));return t?{type:t.name,value:parseFloat(e)}:{type:"",value:e}}(e);default:return{type:"",value:e}}},C=function(e){if("string"==typeof e){var t=M(e);return("%"===t.type||"px"===t.type)&&t.value>0}return e>=0},A=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,o){return e[0]===t&&(n=o,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(t,n){var o=e(this.__entries__,t);~o?this.__entries__[o][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,o=e(n,t);~o&&n.splice(o,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,o=this.__entries__;n<o.length;n++){var i=o[n];e.call(t,i[1],i[0])}},t}()}(),B="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,j=void 0!==o.g&&o.g.Math===Math?o.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),R="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(j):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var N=["top","right","bottom","left","width","height","size","weight"],$="undefined"!=typeof MutationObserver,H=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,o=!1,i=0;function r(){n&&(n=!1,e()),o&&s()}function a(){R(r)}function s(){var e=Date.now();if(n){if(e-i<2)return;o=!0}else n=!0,o=!1,setTimeout(a,t);i=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){B&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),$?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){B&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;N.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),D=function(e,t){for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},P=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||j},I=G(0,0,0,0);function W(e){return parseFloat(e)||0}function V(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+W(e["border-"+n+"-width"])}),0)}function X(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return I;var o=P(e).getComputedStyle(e),i=function(e){for(var t={},n=0,o=["top","right","bottom","left"];n<o.length;n++){var i=o[n],r=e["padding-"+i];t[i]=W(r)}return t}(o),r=i.left+i.right,a=i.top+i.bottom,s=W(o.width),l=W(o.height);if("border-box"===o.boxSizing&&(Math.round(s+r)!==t&&(s-=V(o,"left","right")+r),Math.round(l+a)!==n&&(l-=V(o,"top","bottom")+a)),!function(e){return e===P(e).document.documentElement}(e)){var u=Math.round(s+r)-t,c=Math.round(l+a)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(c)&&(l-=c)}return G(i.left,i.top,s,l)}var Y="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof P(e).SVGGraphicsElement}:function(e){return e instanceof P(e).SVGElement&&"function"==typeof e.getBBox};function U(e){return B?Y(e)?function(e){var t=e.getBBox();return G(0,0,t.width,t.height)}(e):X(e):I}function G(e,t,n,o){return{x:e,y:t,width:n,height:o}}var q=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=G(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=U(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),F=function(e,t){var n,o,i,r,a,s,l,u=(o=(n=t).x,i=n.y,r=n.width,a=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),D(l,{x:o,y:i,width:r,height:a,top:i,right:o+r,bottom:a+i,left:o}),l);D(this,{target:e,contentRect:u})},K=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new A,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof P(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new q(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof P(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new F(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),J="undefined"!=typeof WeakMap?new WeakMap:new A,Q=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=H.getInstance(),o=new K(t,n,this);J.set(this,o)};["observe","unobserve","disconnect"].forEach((function(e){Q.prototype[e]=function(){var t;return(t=J.get(this))[e].apply(t,arguments)}}));const Z=void 0!==j.ResizeObserver?j.ResizeObserver:Q;const ee="undefined"!=typeof window&&window.ResizeObserver?ResizeObserver:Z;function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function ne(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,oe(o.key),o)}}function oe(e){var t=function(e,t){if("object"!=te(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=te(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==te(t)?t:t+""}function ie(e){return function(e){if(Array.isArray(e))return re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?re(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var ae=function(e){return function(e,t){return ie(e.querySelectorAll(t)||[])}(e,'button:not([disabled]), select:not([disabled]), a[href]:not([disabled]), area[href]:not([disabled]), [contentEditable=""]:not([disabled]), [contentEditable="true"]:not([disabled]), [contentEditable="TRUE"]:not([disabled]), textarea:not([disabled]), iframe:not([disabled]), input:not([disabled]), summary:not([disabled]), [tabindex]:not([tabindex="-1"])')},se=function(e){return e==document.activeElement};const le=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.root=null,this.elements=[],this.onKeyDown=this.onKeyDown.bind(this),this.enable=this.enable.bind(this),this.disable=this.disable.bind(this),this.firstElement=this.firstElement.bind(this),this.lastElement=this.lastElement.bind(this)}var t,n,o;return t=e,(n=[{key:"lastElement",value:function(){return this.elements[this.elements.length-1]||null}},{key:"firstElement",value:function(){return this.elements[0]||null}},{key:"onKeyDown",value:function(e){if(function(e){return"Tab"===e.key||9===e.keyCode}(e))return e.shiftKey&&se(this.firstElement())?(this.lastElement().focus(),void e.preventDefault()):!document.activeElement||!e.shiftKey&&se(this.lastElement())?(this.firstElement().focus(),void e.preventDefault()):void 0}},{key:"enabled",value:function(){return!!this.root}},{key:"enable",value:function(e){if(e){this.root=e,this.elements=ae(this.root);var t=this.firstElement();t&&t.focus(),this.root.addEventListener("keydown",this.onKeyDown)}}},{key:"disable",value:function(){this.root.removeEventListener("keydown",this.onKeyDown),this.root=null}}])&&ne(t.prototype,n),o&&ne(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}function ce(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ue(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ue(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ue(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,a,s=[],l=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(s.push(o.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var he="vm-transition--default",me="enter",pe="entering",ve="leave",be="leavng";const ye={name:"VueJsModal",emits:["before-open","opened","before-close","closed","resize"],props:{name:{required:!0,type:String},resizable:{type:Boolean,default:!1},resizeEdges:{default:function(){return["r","br","b","bl","l","tl","t","tr"]},validator:function(e){return["r","br","b","bl","l","tl","t","tr"].filter((function(t){return-1!==e.indexOf(t)})).length===e.length},type:Array},centerResize:{type:Boolean,default:!0},resizeIndicator:{type:Boolean,default:!0},adaptive:{type:Boolean,default:!1},draggable:{type:[Boolean,String],default:!1},scrollable:{type:Boolean,default:!1},focusTrap:{type:Boolean,default:!1},reset:{type:Boolean,default:!1},overlayTransition:{type:String,default:"vm-transition--overlay"},transition:{type:String,default:"vm-transition--modal"},clickToClose:{type:Boolean,default:!0},classes:{type:[String,Array],default:function(){return[]}},styles:{type:[String,Array,Object],default:""},minWidth:{type:Number,default:0,validator:function(e){return e>=0}},minHeight:{type:Number,default:0,validator:function(e){return e>=0}},maxWidth:{type:Number,default:Number.MAX_SAFE_INTEGER},maxHeight:{type:Number,default:Number.MAX_SAFE_INTEGER},width:{type:[Number,String],default:600,validator:function(e){return"auto"===e||C(e)}},height:{type:[Number,String],default:300,validator:function(e){return"auto"===e||C(e)}},shiftX:{type:Number,default:.5,validator:function(e){return e>=0&&e<=1}},shiftY:{type:Number,default:.5,validator:function(e){return e>=0&&e<=1}}},components:{Resizer:T},data:function(){return{visible:!1,visibility:{modal:!1,overlay:!1},overlayTransitionState:null,modalTransitionState:null,shiftLeft:0,shiftTop:0,modal:{width:0,widthType:"px",height:0,heightType:"px",renderedHeight:0},viewportHeight:0,viewportWidth:0}},created:function(){this.setInitialSize()},beforeMount:function(){this.$modal.subscription.$on("toggle",this.onToggle),window.addEventListener("resize",this.onWindowResize),window.addEventListener("orientationchange",this.onWindowResize),this.onWindowResize(),this.scrollable&&!this.isAutoHeight&&console.warn('Modal "'.concat(this.name,'" has scrollable flag set to true ')+'but height is not "auto" ('.concat(this.height,")")),this.clickToClose&&window.addEventListener("keyup",this.onEscapeKeyUp)},mounted:function(){var e=this;this.resizeObserver=new ee((function(t){if(t.length>0){var n=de(t,1)[0];e.modal.renderedHeight=n.contentRect.height}})),this.$focusTrap=new le},beforeUnmount:function(){this.$modal.subscription.$off("toggle",this.onToggle),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("orientationchange",this.onWindowResize),this.clickToClose&&window.removeEventListener("keyup",this.onEscapeKeyUp),document.body.classList.remove("vm--block-scroll")},computed:{guaranteedOverlayTransition:function(){return this.overlayTransition||he},guaranteedModalTransition:function(){return this.transition||he},isAutoHeight:function(){return"auto"===this.modal.heightType},position:function(){var e=this.viewportHeight,t=this.viewportWidth,n=this.shiftLeft,o=this.shiftTop,i=this.shiftX,r=this.shiftY,a=this.trueModalWidth,s=this.trueModalHeight,l=t-a,u=Math.max(e-s,0),c=o+r*u;return{left:parseInt(m(0,l,n+i*l)),top:!s&&this.isAutoHeight?void 0:parseInt(m(0,u,c))}},trueModalWidth:function(){var e=this.viewportWidth,t=this.modal,n=this.adaptive,o=this.minWidth,i=this.maxWidth,r="%"===t.widthType?e/100*t.width:t.width;if(n){var a=Math.max(o,Math.min(e,i));return m(o,a,r)}return r},trueModalHeight:function(){var e=this.viewportHeight,t=this.modal,n=this.isAutoHeight,o=this.adaptive,i=this.minHeight,r=this.maxHeight,a="%"===t.heightType?e/100*t.height:t.height;if(n)return this.modal.renderedHeight;if(o){var s=Math.max(i,Math.min(e,r));return m(i,s,a)}return a},autoHeight:function(){return this.adaptive&&this.modal.renderedHeight>=this.viewportHeight?Math.max(this.minHeight,this.viewportHeight)+"px":"auto"},containerClass:function(){return["vm--container",this.scrollable&&this.isAutoHeight&&"scrollable"]},modalClass:function(){return["vm--modal",this.classes]},stylesProp:function(){return"string"==typeof this.styles?k(this.styles):this.styles},modalStyle:function(){return[this.stylesProp,{top:this.position.top+"px",left:this.position.left+"px",width:this.trueModalWidth+"px",height:this.isAutoHeight?this.autoHeight:this.trueModalHeight+"px"}]},isComponentReadyToBeDestroyed:function(){return this.overlayTransitionState===ve&&this.modalTransitionState===ve}},watch:{isComponentReadyToBeDestroyed:function(e){e&&(this.visible=!1)}},methods:{startTransitionEnter:function(){this.visibility.overlay=!0,this.visibility.modal=!0},startTransitionLeave:function(){this.visibility.overlay=!1,this.visibility.modal=!1},beforeOverlayTransitionEnter:function(){this.overlayTransitionState=pe},afterOverlayTransitionEnter:function(){this.overlayTransitionState=me},beforeOverlayTransitionLeave:function(){this.overlayTransitionState=be},afterOverlayTransitionLeave:function(){this.overlayTransitionState=ve},beforeModalTransitionEnter:function(){var e=this;this.modalTransitionState=pe,this.$nextTick((function(){e.resizeObserver.observe(e.$refs.modal)}))},afterModalTransitionEnter:function(){this.modalTransitionState=me,this.draggable&&this.addDraggableListeners(),this.focusTrap&&this.$focusTrap.enable(this.$refs.modal);var e=this.createModalEvent({state:"opened"});this.$emit("opened",e)},beforeModalTransitionLeave:function(){this.modalTransitionState=be,this.$focusTrap.enabled()&&this.$focusTrap.disable()},afterModalTransitionLeave:function(){this.modalTransitionState=ve;var e=this.createModalEvent({state:"closed"});this.$emit("closed",e)},onToggle:function(e,t,n){if(this.name===e){var o=void 0===t?!this.visible:t;this.toggle(o,n)}},setInitialSize:function(){var e=M(this.width),t=M(this.height);this.modal.width=e.value,this.modal.widthType=e.type,this.modal.height=t.value,this.modal.heightType=t.type},onEscapeKeyUp:function(e){27===e.which&&this.visible&&this.$modal.hide(this.name)},onWindowResize:function(){this.viewportWidth=E(),this.viewportHeight=window.innerHeight,this.ensureShiftInWindowBounds()},createModalEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach((function(t){ce(e,t,n[t])}))}return e}({name:this.name,ref:this.$refs.modal||null},e)},onModalResize:function(e){this.modal.widthType="px",this.modal.width=e.size.width,this.modal.heightType="px",this.modal.height=e.size.height,this.centerResize||(this.shiftLeft=this.getResizedShiftLeft(e),this.shiftTop=this.getResizedShiftTop(e));var t=this.modal.size;this.$emit("resize",this.createModalEvent({size:t}))},getResizedShiftLeft:function(e){var t=this.shiftLeft;switch(e.direction){case"vue-modal-topRight":case"vue-modal-bottomRight":case"vue-modal-right":t+=.5*e.dimGrowth.width;break;case"vue-modal-bottomLeft":case"vue-modal-topLeft":case"vue-modal-left":t-=.5*e.dimGrowth.width;break;case"vue-modal-top":case"vue-modal-bottom":break;default:console.error("Could not Find Resize Direction In ShiftLeft")}return t},getResizedShiftTop:function(e){var t=this.shiftTop;switch(e.direction){case"vue-modal-bottom":case"vue-modal-bottomRight":case"vue-modal-bottomLeft":t+=.5*e.dimGrowth.height;break;case"vue-modal-top":case"vue-modal-topRight":case"vue-modal-topLeft":t-=.5*e.dimGrowth.height;break;case"vue-modal-left":case"vue-modal-right":break;default:console.error("Could not Find Resize Direction In ShiftTop")}return t},open:function(e){var t=this;this.reset&&(this.setInitialSize(),this.shiftLeft=0,this.shiftTop=0),this.scrollable&&document.body.classList.add("vm--block-scroll");var n=!1,o=this.createModalEvent({cancel:function(){n=!0},state:"before-open",params:e});this.$emit("before-open",o),n?this.scrollable&&document.body.classList.remove("vm--block-scroll"):("undefined"!=typeof document&&document.activeElement&&"BODY"!==document.activeElement.tagName&&document.activeElement.blur&&document.activeElement.blur(),this.visible=!0,this.$nextTick((function(){t.startTransitionEnter()})))},close:function(e){this.scrollable&&document.body.classList.remove("vm--block-scroll");var t=!1,n=this.createModalEvent({cancel:function(){t=!0},state:"before-close",params:e});this.$emit("before-close",n),t||(this.resizeObserver.unobserve(this.$refs.modal),this.startTransitionLeave())},toggle:function(e,t){this.visible!==e&&(e?this.open(t):this.close(t))},getDraggableElement:function(){return!0===this.draggable?this.$refs.modal:"string"==typeof this.draggable?this.$refs.modal.querySelector(this.draggable):null},onOverlayClick:function(){this.clickToClose&&this.toggle(!1)},addDraggableListeners:function(){var e=this,t=this.getDraggableElement();if(t){var n=0,o=0,i=0,r=0,a=function(t){var a=t.target;if(!(u=a)||-1===g.indexOf(u.nodeName)){var u,c=x(t),d=c.clientX,f=c.clientY;document.addEventListener("mousemove",s),document.addEventListener("touchmove",s),document.addEventListener("mouseup",l),document.addEventListener("touchend",l),n=d,o=f,i=e.shiftLeft,r=e.shiftTop}},s=function(t){var a=x(t),s=a.clientX,l=a.clientY;e.shiftLeft=i+s-n,e.shiftTop=r+l-o,t.preventDefault()},l=function t(n){e.ensureShiftInWindowBounds(),document.removeEventListener("mousemove",s),document.removeEventListener("touchmove",s),document.removeEventListener("mouseup",t),document.removeEventListener("touchend",t),n.preventDefault()};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a)}},ensureShiftInWindowBounds:function(){var e=this.viewportHeight,t=this.viewportWidth,n=this.shiftLeft,o=this.shiftTop,i=this.shiftX,r=this.shiftY,a=this.trueModalWidth,s=this.trueModalHeight,l=t-a,u=Math.max(e-s,0),c=n+i*l,d=o+r*u;this.shiftLeft-=c-m(0,l,c),this.shiftTop-=d-m(0,u,d)}}};o(484);const ge=(0,_.A)(ye,[["render",function(o,i,a,s,l,u){var c=(0,e.resolveComponent)("resizer");return l.visible?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:0,class:(0,e.normalizeClass)(u.containerClass)},[(0,e.createVNode)(e.Transition,{name:u.guaranteedOverlayTransition,onBeforeEnter:u.beforeOverlayTransitionEnter,onAfterEnter:u.afterOverlayTransitionEnter,onBeforeLeave:u.beforeOverlayTransitionLeave,onAfterLeave:u.afterOverlayTransitionLeave},{default:(0,e.withCtx)((function(){return[l.visibility.overlay?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:0,class:"vm--overlay","data-modal":a.name,"aria-expanded":l.visibility.overlay.toString(),onClick:i[0]||(i[0]=(0,e.withModifiers)((function(){return u.onOverlayClick&&u.onOverlayClick.apply(u,arguments)}),["self","stop"]))},[(0,e.createElementVNode)("div",n,[(0,e.renderSlot)(o.$slots,"top-right")])],8,t)):(0,e.createCommentVNode)("v-if",!0)]})),_:3},8,["name","onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"]),(0,e.createVNode)(e.Transition,{name:u.guaranteedModalTransition,onBeforeEnter:u.beforeModalTransitionEnter,onAfterEnter:u.afterModalTransitionEnter,onBeforeLeave:u.beforeModalTransitionLeave,onAfterLeave:u.afterModalTransitionLeave},{default:(0,e.withCtx)((function(){return[l.visibility.modal?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:0,ref:"modal","aria-expanded":l.visibility.modal.toString(),class:(0,e.normalizeClass)(u.modalClass),style:(0,e.normalizeStyle)(u.modalStyle),role:"dialog","aria-modal":"true"},[(0,e.renderSlot)(o.$slots,"default"),a.resizable&&!u.isAutoHeight?((0,e.openBlock)(),(0,e.createBlock)(c,{key:0,"min-width":a.minWidth,"min-height":a.minHeight,"max-width":a.maxWidth,"max-height":a.maxHeight,"viewport-height":l.viewportHeight,"viewport-width":l.viewportWidth,"resize-indicator":a.resizeIndicator,"resize-edges":a.resizeEdges,onResize:u.onModalResize},null,8,["min-width","min-height","max-width","max-height","viewport-height","viewport-width","resize-indicator","resize-edges","onResize"])):(0,e.createCommentVNode)("v-if",!0)],14,r)):(0,e.createCommentVNode)("v-if",!0)]})),_:3},8,["name","onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"])],2)):(0,e.createCommentVNode)("v-if",!0)}]]);var we={class:"vue-dialog-content"},Ee=["innerHTML"],ke=["innerHTML"],xe={key:0,class:"vue-dialog-buttons"},Se=["onClick","innerHTML"],_e={key:1,class:"vue-dialog-buttons-none"};const Te={name:"VueJsDialog",emits:["before-opened","opened","before-closed","closed"],props:{width:{type:[Number,String],default:400},clickToClose:{type:Boolean,default:!0},transition:{type:String,default:""}},data:function(){return{params:{}}},computed:{buttons:function(){return this.params.buttons||[]},buttonStyle:function(){return{flex:"1 1 ".concat(100/this.buttons.length,"%")}}},methods:{beforeOpened:function(e){this.params=e.params||{},this.$emit("before-opened",e)},beforeClosed:function(e){this.params={},this.$emit("before-closed",e)},click:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"click",o=this.buttons[e],i=null==o?void 0:o.handler;"function"==typeof i&&i(e,t,{source:n})}}};o(100);const Oe=(0,_.A)(Te,[["render",function(t,n,o,i,r,a){return(0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.$modal.context.componentName),{name:"dialog",height:"auto",classes:["vue-dialog",r.params.class],width:o.width,"shift-y":.3,adaptive:!0,"focus-trap":!0,"click-to-close":o.clickToClose,transition:o.transition,onBeforeOpen:a.beforeOpened,onBeforeClose:a.beforeClosed,onOpened:n[0]||(n[0]=function(e){return t.$emit("opened",e)}),onClosed:n[1]||(n[1]=function(e){return t.$emit("closed",e)})},{default:(0,e.withCtx)((function(){return[(0,e.createElementVNode)("div",we,[r.params.title?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:0,class:"vue-dialog-content-title",innerHTML:r.params.title||""},null,8,Ee)):(0,e.createCommentVNode)("v-if",!0),r.params.component?((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(r.params.component),(0,e.normalizeProps)((0,e.mergeProps)({key:1},r.params.props)),null,16)):((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:2,innerHTML:r.params.text||""},null,8,ke))]),a.buttons?((0,e.openBlock)(),(0,e.createElementBlock)("div",xe,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(a.buttons,(function(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)("button",{key:n,class:(0,e.normalizeClass)(t.class||"vue-dialog-button"),type:"button",tabindex:"0",style:(0,e.normalizeStyle)(a.buttonStyle),onClick:(0,e.withModifiers)((function(e){return a.click(n,e)}),["stop"]),innerHTML:t.title},null,14,Se)})),128))])):((0,e.openBlock)(),(0,e.createElementBlock)("div",_e))]})),_:1},40,["classes","width","click-to-close","transition","onBeforeOpen","onBeforeClose"])}]]),ze=Oe;var Le=o(237),Me=o.n(Le);function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach((function(t){Be(e,t,n[t])}))}return e}function Be(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ce(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ce(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ce(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const je={data:function(){return{modals:[]}},created:function(){this.$modal.subscription.$emit("set-modal-container",this)},mounted:function(){var e=this;this.$modal.subscription.$on("hide-all",(function(){e.modals=[]}))},methods:{add:function(t){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=w(),s=i.name||"dynamic_modal_"+a;this.modals.push({id:a,modalAttrs:Ae({},i,{name:s}),modalListeners:r,component:(0,e.markRaw)(t),componentAttrs:o}),this.$nextTick((function(){n.$modal.show(s)}))},remove:function(e){var t=this.modals.findIndex((function(t){return t.id===e}));-1!==t&&this.modals.splice(t,1)}}},Re=(0,_.A)(je,[["render",function(t,n,o,i,r,a){var s=(0,e.resolveComponent)("modal");return(0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(r.modals,(function(n){return(0,e.openBlock)(),(0,e.createBlock)(s,(0,e.mergeProps)({key:n.id,ref_for:!0},n.modalAttrs,(0,e.toHandlers)(n.modalListeners),{onClosed:function(e){return a.remove(n.id)}}),{default:(0,e.withCtx)((function(){return[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(n.component),(0,e.mergeProps)({ref_for:!0},n.componentAttrs,{onClose:function(e){return t.$modal.hide(n.modalAttrs.name,e)}}),null,16,["onClose"]))]})),_:2},1040,["onClosed"])})),128)}]]);function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function $e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ne(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ne(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ne(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={$on:function(){return Me().on.apply(Me(),arguments)},$once:function(){return Me().once.apply(Me(),arguments)},$off:function(){return Me().off.apply(Me(),arguments)},$emit:function(){return Me().emit.apply(Me(),arguments)}},i={root:null,componentName:n.componentName||"Modal"};o.$on("set-modal-container",(function(e){i.root.__modalContainer=e}));var r=function(e,t){o.$emit("toggle",e,!0,t)},a=function(e,t){var o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,s=null===(o=i.root)||void 0===o?void 0:o.__modalContainer,l=n.dynamicDefaults||{};null==s||s.add(e,t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach((function(t){$e(e,t,n[t])}))}return e}({},l,r),a)};return{context:i,subscription:o,show:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0];switch(Ne(o)){case"string":r.apply(void 0,t);break;case"object":case"function":a.apply(void 0,t);break;default:console.warn("[vue-js-modal] $modal() received an unsupported argument as a first argument.",o)}},hide:function(e,t){o.$emit("toggle",e,!1,t)},hideAll:function(){o.$emit("hide-all")},toggle:function(e,t){o.$emit("toggle",e,void 0,t)},setDynamicModalContainer:function(){i.root={};var n,o=((n=document.createElement("div")).id="modals-container",document.body.appendChild(n),n),r=(0,e.createVNode)(Re);r.appContext=t._context,(0,e.render)(r,o)}}};var De="__VERSION__";const Pe={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.config.globalProperties.$modal){var n=new He(e,t);if(Object.defineProperty(e.config.globalProperties,"$modal",{get:function(){return n.context.root||n.setDynamicModalContainer(),n}}),e.component(n.context.componentName,ge),t.dialog){var o=t.dialogComponentName||"VDialog";e.component(o,ze)}}}}})(),i})()));
//# sourceMappingURL=index.js.map