@febe95/vue-js-modal
Version:
Modal Component for Vue.js
1 lines • 61.5 kB
JavaScript
import*as __WEBPACK_EXTERNAL_MODULE_vue__ from"vue";var __webpack_modules__={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 r=n(65);"string"==typeof r&&(r=[[e.id,r,""]]),r.locals&&(e.exports=r.locals);(0,n(534).A)("ba156f46",r,!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 r=n(504);e.exports=new r},262:(e,t)=>{t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},484:(e,t,n)=>{var r=n(195);"string"==typeof r&&(r=[[e.id,r,""]]),r.locals&&(e.exports=r.locals);(0,n(534).A)("50992dbc",r,!1,{})},504:e=>{function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t},534:(e,t,n)=>{function r(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=i[0],s={id:e+":"+o,css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}n.d(t,{A:()=>f});var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)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 i={},a=o&&(document.head||document.getElementsByTagName("head")[0]),s=null,l=0,c=!1,u=function(){},d=null,_="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(e,t,n,o){c=n,d=o||{};var a=r(e,t);return h(a),function(t){for(var n=[],o=0;o<a.length;o++){var s=a[o];(l=i[s.id]).refs--,n.push(l)}t?h(a=r(e,t)):a=[];for(o=0;o<n.length;o++){var l;if(0===(l=n[o]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete i[l.id]}}}}function h(e){for(var t=0;t<e.length;t++){var n=e[t],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(v(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o<n.parts.length;o++)a.push(v(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:a}}}}function m(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function v(e){var t,n,r=document.querySelector("style["+_+'~="'+e.id+'"]');if(r){if(c)return u;r.parentNode.removeChild(r)}if(p){var o=l++;r=s||(s=m()),t=g.bind(null,r,o,!1),n=g.bind(null,r,o,!0)}else r=m(),t=E.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var b,y=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function g(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=y(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function E(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),d.ssrId&&e.setAttribute(_,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},642:(e,t,n)=>{var r=n(745);"string"==typeof r&&(r=[[e.id,r,""]]),r.locals&&(e.exports=r.locals);(0,n(534).A)("597e3661",r,!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]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).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 r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={},x=e=>{var t={};return __webpack_require__.d(t,e),t},y=e=>()=>e;const external_vue_namespaceObject=x({Fragment:()=>__WEBPACK_EXTERNAL_MODULE_vue__.Fragment,Transition:()=>__WEBPACK_EXTERNAL_MODULE_vue__.Transition,createBlock:()=>__WEBPACK_EXTERNAL_MODULE_vue__.createBlock,createCommentVNode:()=>__WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode,createElementBlock:()=>__WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock,createElementVNode:()=>__WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode,createVNode:()=>__WEBPACK_EXTERNAL_MODULE_vue__.createVNode,markRaw:()=>__WEBPACK_EXTERNAL_MODULE_vue__.markRaw,mergeProps:()=>__WEBPACK_EXTERNAL_MODULE_vue__.mergeProps,normalizeClass:()=>__WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass,normalizeProps:()=>__WEBPACK_EXTERNAL_MODULE_vue__.normalizeProps,normalizeStyle:()=>__WEBPACK_EXTERNAL_MODULE_vue__.normalizeStyle,openBlock:()=>__WEBPACK_EXTERNAL_MODULE_vue__.openBlock,render:()=>__WEBPACK_EXTERNAL_MODULE_vue__.render,renderList:()=>__WEBPACK_EXTERNAL_MODULE_vue__.renderList,renderSlot:()=>__WEBPACK_EXTERNAL_MODULE_vue__.renderSlot,resolveComponent:()=>__WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent,resolveDynamicComponent:()=>__WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent,toHandlers:()=>__WEBPACK_EXTERNAL_MODULE_vue__.toHandlers,withCtx:()=>__WEBPACK_EXTERNAL_MODULE_vue__.withCtx,withModifiers:()=>__WEBPACK_EXTERNAL_MODULE_vue__.withModifiers});var _hoisted_1=["data-modal","aria-expanded"],_hoisted_2={class:"vm--top-right-slot"},_hoisted_3=["aria-expanded"];function render(e,t,n,r,o,i){var a=(0,external_vue_namespaceObject.resolveComponent)("resizer");return o.visible?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",{key:0,class:(0,external_vue_namespaceObject.normalizeClass)(i.containerClass)},[(0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition,{name:i.guaranteedOverlayTransition,onBeforeEnter:i.beforeOverlayTransitionEnter,onAfterEnter:i.afterOverlayTransitionEnter,onBeforeLeave:i.beforeOverlayTransitionLeave,onAfterLeave:i.afterOverlayTransitionLeave},{default:(0,external_vue_namespaceObject.withCtx)((function(){return[o.visibility.overlay?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",{key:0,class:"vm--overlay","data-modal":n.name,"aria-expanded":o.visibility.overlay.toString(),onClick:t[0]||(t[0]=(0,external_vue_namespaceObject.withModifiers)((function(){return i.onOverlayClick&&i.onOverlayClick.apply(i,arguments)}),["self","stop"]))},[(0,external_vue_namespaceObject.createElementVNode)("div",_hoisted_2,[(0,external_vue_namespaceObject.renderSlot)(e.$slots,"top-right")])],8,_hoisted_1)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0)]})),_:3},8,["name","onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"]),(0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition,{name:i.guaranteedModalTransition,onBeforeEnter:i.beforeModalTransitionEnter,onAfterEnter:i.afterModalTransitionEnter,onBeforeLeave:i.beforeModalTransitionLeave,onAfterLeave:i.afterModalTransitionLeave},{default:(0,external_vue_namespaceObject.withCtx)((function(){return[o.visibility.modal?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",{key:0,ref:"modal","aria-expanded":o.visibility.modal.toString(),class:(0,external_vue_namespaceObject.normalizeClass)(i.modalClass),style:(0,external_vue_namespaceObject.normalizeStyle)(i.modalStyle),role:"dialog","aria-modal":"true"},[(0,external_vue_namespaceObject.renderSlot)(e.$slots,"default"),n.resizable&&!i.isAutoHeight?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createBlock)(a,{key:0,"min-width":n.minWidth,"min-height":n.minHeight,"max-width":n.maxWidth,"max-height":n.maxHeight,"viewport-height":o.viewportHeight,"viewport-width":o.viewportWidth,"resize-indicator":n.resizeIndicator,"resize-edges":n.resizeEdges,onResize:i.onModalResize},null,8,["min-width","min-height","max-width","max-height","viewport-height","viewport-width","resize-indicator","resize-edges","onResize"])):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0)],14,_hoisted_3)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0)]})),_:3},8,["name","onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"])],2)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0)}var Resizervue_type_template_id_d38f8aa6_hoisted_1={key:0,class:"vue-modal-top"},Resizervue_type_template_id_d38f8aa6_hoisted_2={key:1,class:"vue-modal-bottom"},Resizervue_type_template_id_d38f8aa6_hoisted_3={key:2,class:"vue-modal-left"},_hoisted_4={key:3,class:"vue-modal-right"},_hoisted_5={key:4,class:"vue-modal-topRight"},_hoisted_6={key:5,class:"vue-modal-topLeft"},_hoisted_7=["id"],_hoisted_8={key:7,class:"vue-modal-bottomLeft"};function Resizervue_type_template_id_d38f8aa6_render(e,t,n,r,o,i){return(0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",null,[n.resizeEdges.includes("t")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",Resizervue_type_template_id_d38f8aa6_hoisted_1)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("b")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",Resizervue_type_template_id_d38f8aa6_hoisted_2)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("l")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",Resizervue_type_template_id_d38f8aa6_hoisted_3)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("r")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",_hoisted_4)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("tr")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",_hoisted_5)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("tl")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",_hoisted_6)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("br")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",{key:6,id:i.getID,class:(0,external_vue_namespaceObject.normalizeClass)(i.className)},null,10,_hoisted_7)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0),n.resizeEdges.includes("bl")?((0,external_vue_namespaceObject.openBlock)(),(0,external_vue_namespaceObject.createElementBlock)("div",_hoisted_8)):(0,external_vue_namespaceObject.createCommentVNode)("v-if",!0)])}var inRange=function(e,t,n){return n<e?e:n>t?t:n};function _typeof(e){return _typeof="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},_typeof(e)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){_defineProperty(e,t,n[t])}))}return e}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(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)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}var INPUT_NODE_NAMES=["INPUT","TEXTAREA","SELECT"],generateId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(){return(e++).toString()}}(),createDivInBody=function(){var e=document.createElement("div");return e.id="modals-container",document.body.appendChild(e),e},blurActiveElement=function(){"undefined"!=typeof document&&document.activeElement&&"BODY"!==document.activeElement.tagName&&document.activeElement.blur&&document.activeElement.blur()},windowWidthWithoutScrollbar=function(){var e=window.innerWidth,t=document.documentElement.clientWidth;return e&&t?Math.min(e,t):t||e},stringStylesToObject=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=_slicedToArray(t,2);return _objectSpread({},e,_defineProperty({},n[0],n[1]))}),{})},isInput=function(e){return e&&-1!==INPUT_NODE_NAMES.indexOf(e.nodeName)},getTouchEvent=function(e){return e.touches&&e.touches.length>0?e.touches[0]:e};const Resizervue_type_script_lang_js={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,r=e.clientY,o=parseInt(t.style.width.replace("px","")),i=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,r=i;break;case"vue-modal-left":r=i,n=o+(this.initialX-e.clientX);break;case"vue-modal-top":n=o,r=i+(this.initialY-e.clientY);break;case"vue-modal-bottom":n=o,r-=t.offsetTop;break;case"vue-modal-bottomRight":n-=t.offsetLeft,r-=t.offsetTop;break;case"vue-modal-topRight":n-=t.offsetLeft,r=i+(this.initialY-e.clientY);break;case"vue-modal-bottomLeft":n=o+(this.initialX-e.clientX),r-=t.offsetTop;break;case"vue-modal-topLeft":n=o+(this.initialX-e.clientX),r=i+(this.initialY-e.clientY);break;default:console.error("Incorrrect/no resize direction.")}var a=Math.min(windowWidthWithoutScrollbar(),this.maxWidth),s=Math.min(window.innerHeight,this.maxHeight);n=inRange(this.minWidth,a,n),r=inRange(this.minHeight,s,r),this.initialX=e.clientX,this.initialY=e.clientY,this.size={width:n,height:r};var l={width:n-o,height:r-i};t.style.width=n+"px",t.style.height=r+"px",this.$emit("resize",{element:t,size:this.size,direction:this.targetClass,dimGrowth:l})}}}};var Resizervue_type_style_index_0_id_d38f8aa6_lang_css=__webpack_require__(642),exportHelper=__webpack_require__(262);const __exports__=(0,exportHelper.A)(Resizervue_type_script_lang_js,[["render",Resizervue_type_template_id_d38f8aa6_render]]),Resizer=__exports__;function parser_typeof(e){return parser_typeof="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},parser_typeof(e)}var floatRegexp="[-+]?[0-9]*.?[0-9]+",types=[{name:"px",regexp:new RegExp("^".concat(floatRegexp,"px$"))},{name:"%",regexp:new RegExp("^".concat(floatRegexp,"%$"))},{name:"px",regexp:new RegExp("^".concat(floatRegexp,"$"))}],getType=function(e){if("auto"===e)return{type:e,value:0};var t=types.find((function(t){return t.regexp.test(e)}));return t?{type:t.name,value:parseFloat(e)}:{type:"",value:e}},parseNumber=function(e){switch(parser_typeof(e)){case"number":return{type:"px",value:e};case"string":return getType(e);default:return{type:"",value:e}}},validateNumber=function(e){if("string"==typeof e){var t=parseNumber(e);return("%"===t.type||"px"===t.type)&&t.value>0}return e>=0},MapShim=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!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),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,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,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),isBrowser="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,global$1=void 0!==__webpack_require__.g&&__webpack_require__.g.Math===Math?__webpack_require__.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),requestAnimationFrame$1="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(global$1):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},trailingTimeout=2;function throttle(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){requestAnimationFrame$1(i)}function s(){var e=Date.now();if(n){if(e-o<trailingTimeout)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=e}return s}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported="undefined"!=typeof MutationObserver,ResizeObserverController=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}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(){isBrowser&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(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(){isBrowser&&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;transitionKeys.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}(),defineConfigurable=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},getWindowOf=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+toFloat(e["border-"+n+"-width"])}),0)}function getPaddings(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=toFloat(i)}return t}function getSVGContentRect(e){var t=e.getBBox();return createRectInit(0,0,t.width,t.height)}function getHTMLElementContentRect(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return emptyRect;var r=getWindowOf(e).getComputedStyle(e),o=getPaddings(r),i=o.left+o.right,a=o.top+o.bottom,s=toFloat(r.width),l=toFloat(r.height);if("border-box"===r.boxSizing&&(Math.round(s+i)!==t&&(s-=getBordersSize(r,"left","right")+i),Math.round(l+a)!==n&&(l-=getBordersSize(r,"top","bottom")+a)),!isDocumentElement(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return createRectInit(o.left,o.top,s,l)}var isSVGGraphicsElement="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof getWindowOf(e).SVGGraphicsElement}:function(e){return e instanceof getWindowOf(e).SVGElement&&"function"==typeof e.getBBox};function isDocumentElement(e){return e===getWindowOf(e).document.documentElement}function getContentRect(e){return isBrowser?isSVGGraphicsElement(e)?getSVGContentRect(e):getHTMLElementContentRect(e):emptyRect}function createReadOnlyRect(e){var t=e.x,n=e.y,r=e.width,o=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(i.prototype);return defineConfigurable(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function createRectInit(e,t,n,r){return{x:e,y:t,width:n,height:r}}var ResizeObservation=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=getContentRect(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}(),ResizeObserverEntry=function(e,t){var n=createReadOnlyRect(t);defineConfigurable(this,{target:e,contentRect:n})},ResizeObserverSPI=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new MapShim,"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 getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new ResizeObservation(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 getWindowOf(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 ResizeObserverEntry(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}(),observers="undefined"!=typeof WeakMap?new WeakMap:new MapShim,ResizeObserver_es_ResizeObserver=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=ResizeObserverController.getInstance(),r=new ResizeObserverSPI(t,n,this);observers.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){ResizeObserver_es_ResizeObserver.prototype[e]=function(){var t;return(t=observers.get(this))[e].apply(t,arguments)}}));var index=void 0!==global$1.ResizeObserver?global$1.ResizeObserver:ResizeObserver_es_ResizeObserver;const ResizeObserver_es=index;var observer="undefined"!=typeof window&&window.ResizeObserver?ResizeObserver:ResizeObserver_es;const resizeObserver=observer;function focusTrap_typeof(e){return focusTrap_typeof="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},focusTrap_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,focusTrap_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function focusTrap_toPropertyKey(e){var t=focusTrap_toPrimitive(e,"string");return"symbol"==focusTrap_typeof(t)?t:t+""}function focusTrap_toPrimitive(e,t){if("object"!=focusTrap_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=focusTrap_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||focusTrap_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){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 focusTrap_unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return focusTrap_arrayLikeToArray(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)?focusTrap_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return focusTrap_arrayLikeToArray(e)}function focusTrap_arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var FOCUSABLE_ELEMENTS_QUERY='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"])',isTabPressed=function(e){return"Tab"===e.key||9===e.keyCode},querySelectorAll=function(e,t){return _toConsumableArray(e.querySelectorAll(t)||[])},queryFocusableElements=function(e){return querySelectorAll(e,FOCUSABLE_ELEMENTS_QUERY)},isFocused=function(e){return e==document.activeElement},isNothingFocused=function(){return!document.activeElement},FocusTrap=function(){function e(){_classCallCheck(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)}return _createClass(e,[{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(isTabPressed(e))return e.shiftKey&&isFocused(this.firstElement())?(this.lastElement().focus(),void e.preventDefault()):isNothingFocused()||!e.shiftKey&&isFocused(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=queryFocusableElements(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}}]),e}();const focusTrap=FocusTrap;function Modalvue_type_script_lang_js_typeof(e){return Modalvue_type_script_lang_js_typeof="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},Modalvue_type_script_lang_js_typeof(e)}function Modalvue_type_script_lang_js_objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){Modalvue_type_script_lang_js_defineProperty(e,t,n[t])}))}return e}function Modalvue_type_script_lang_js_defineProperty(e,t,n){return(t=Modalvue_type_script_lang_js_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Modalvue_type_script_lang_js_toPropertyKey(e){var t=Modalvue_type_script_lang_js_toPrimitive(e,"string");return"symbol"==Modalvue_type_script_lang_js_typeof(t)?t:t+""}function Modalvue_type_script_lang_js_toPrimitive(e,t){if("object"!=Modalvue_type_script_lang_js_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Modalvue_type_script_lang_js_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Modalvue_type_script_lang_js_slicedToArray(e,t){return Modalvue_type_script_lang_js_arrayWithHoles(e)||Modalvue_type_script_lang_js_iterableToArrayLimit(e,t)||Modalvue_type_script_lang_js_unsupportedIterableToArray(e,t)||Modalvue_type_script_lang_js_nonIterableRest()}function Modalvue_type_script_lang_js_nonIterableRest(){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 Modalvue_type_script_lang_js_unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return Modalvue_type_script_lang_js_arrayLikeToArray(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)?Modalvue_type_script_lang_js_arrayLikeToArray(e,t):void 0}}function Modalvue_type_script_lang_js_arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Modalvue_type_script_lang_js_iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function Modalvue_type_script_lang_js_arrayWithHoles(e){if(Array.isArray(e))return e}var defaultTransition="vm-transition--default",TransitionState={Enter:"enter",Entering:"entering",Leave:"leave",Leaving:"leavng"};const Modalvue_type_script_lang_js={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||validateNumber(e)}},height:{type:[Number,String],default:300,validator:function(e){return"auto"===e||validateNumber(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},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 resizeObserver((function(t){if(t.length>0){var n=Modalvue_type_script_lang_js_slicedToArray(t,1)[0];e.modal.renderedHeight=n.contentRect.height}})),this.$focusTrap=new focusTrap},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||defaultTransition},guaranteedModalTransition:function(){return this.transition||defaultTransition},isAutoHeight:function(){return"auto"===this.modal.heightType},position:function(){var e=this.viewportHeight,t=this.viewportWidth,n=this.shiftLeft,r=this.shiftTop,o=this.shiftX,i=this.shiftY,a=this.trueModalWidth,s=this.trueModalHeight,l=t-a,c=Math.max(e-s,0),u=r+i*c;return{left:parseInt(inRange(0,l,n+o*l)),top:!s&&this.isAutoHeight?void 0:parseInt(inRange(0,c,u))}},trueModalWidth:function(){var e=this.viewportWidth,t=this.modal,n=this.adaptive,r=this.minWidth,o=this.maxWidth,i="%"===t.widthType?e/100*t.width:t.width;if(n){var a=Math.max(r,Math.min(e,o));return inRange(r,a,i)}return i},trueModalHeight:function(){var e=this.viewportHeight,t=this.modal,n=this.isAutoHeight,r=this.adaptive,o=this.minHeight,i=this.maxHeight,a="%"===t.heightType?e/100*t.height:t.height;if(n)return this.modal.renderedHeight;if(r){var s=Math.max(o,Math.min(e,i));return inRange(o,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?stringStylesToObject(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===TransitionState.Leave&&this.modalTransitionState===TransitionState.Leave}},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=TransitionState.Entering},afterOverlayTransitionEnter:function(){this.overlayTransitionState=TransitionState.Enter},beforeOverlayTransitionLeave:function(){this.overlayTransitionState=TransitionState.Leaving},afterOverlayTransitionLeave:function(){this.overlayTransitionState=TransitionState.Leave},beforeModalTransitionEnter:function(){var e=this;this.modalTransitionState=TransitionState.Entering,this.$nextTick((function(){e.resizeObserver.observe(e.$refs.modal)}))},afterModalTransitionEnter:function(){this.modalTransitionState=TransitionState.Enter,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=TransitionState.Leaving,this.$focusTrap.enabled()&&this.$focusTrap.disable()},afterModalTransitionLeave:function(){this.modalTransitionState=TransitionState.Leave;var e=this.createModalEvent({state:"closed"});this.$emit("closed",e)},onToggle:function(e,t,n){if(this.name===e){var r=void 0===t?!this.visible:t;this.toggle(r,n)}},setInitialSize:function(){var e=parseNumber(this.width),t=parseNumber(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=windowWidthWithoutScrollbar(),this.viewportHeight=window.innerHeight,this.ensureShiftInWindowBounds()},createModalEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Modalvue_type_script_lang_js_objectSpread({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,r=this.createModalEvent({cancel:function(){n=!0},state:"before-open",params:e});this.$emit("before-open",r),n?this.scrollable&&document.body.classList.remove("vm--block-scroll"):(blurActiveElement(),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,r=0,o=0,i=0,a=function(t){var a=t.target;if(!isInput(a)){var c=getTouchEvent(t),u=c.clientX,d=c.clientY;document.addEventListener("mousemove",s),document.addEventListener("touchmove",s),document.addEventListener("mouseup",l),document.addEventListener("touchend",l),n=u,r=d,o=e.shiftLeft,i=e.shiftTop}},s=function(t){var a=getTouchEvent(t),s=a.clientX,l=a.clientY;e.shiftLeft=o+s-n,e.shiftTop=i+l-r,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,r=this.shiftTop,o=this.shiftX,i=this.shiftY,a=this.trueModalWidth,s=this.trueModalHeight,l=t-a,c=Math.max(e-s,0),u=n+o*l,d=r+i*c;this.shiftLeft-=u-inRange(0,l,u),this.shiftTop-=d-inRange(0,c,d)}}};var Modalvue_type_style_index_0_id_2cc15068_lang_css=__webpack_require__(484);const Modal_exports_=(0,exportHelper.A)(Modalvue_type_script_lang_js,[["render",render]]),Modal=Modal_exports_;var Dialogvue_type_template_id_131a59e4_hoisted_1={class:"vue-dialog