{"version":3,"file":"vue-modal.umd.min.js","sources":["../node_modules/nanoid/non-secure/index.js","../node_modules/@linusborg/vue-simple-portal/dist/index.mjs","../src/Modal.vue","../node_modules/vue-runtime-helpers/dist/normalize-component.mjs"],"sourcesContent":["// This alphabet uses a-z A-Z 0-9 _- symbols.\n// Symbols are generated for smaller size.\n// -_zyxwvutsrqponmlkjihgfedcba9876543210ZYXWVUTSRQPONMLKJIHGFEDCBA\nvar url = '-_'\n// Loop from 36 to 0 (from z to a and 9 to 0 in Base36).\nvar i = 36\nwhile (i--) {\n // 36 is radix. Number.prototype.toString(36) returns number\n // in Base36 representation. Base36 is like hex, but it uses 0–9 and a-z.\n url += i.toString(36)\n}\n// Loop from 36 to 10 (from Z to A in Base36).\ni = 36\nwhile (i-- - 10) {\n url += i.toString(36).toUpperCase()\n}\n\n/**\n * Generate URL-friendly unique ID. This method use non-secure predictable\n * random generator with bigger collision probability.\n *\n * @param {number} [size=21] The number of symbols in ID.\n *\n * @return {string} Random string.\n *\n * @example\n * const nanoid = require('nanoid/non-secure')\n * model.id = nanoid() //=> \"Uakgb_J5m9g-0JDMbcJqL\"\n *\n * @name nonSecure\n * @function\n */\nmodule.exports = function (size) {\n var id = ''\n i = size || 21\n // Compact alternative for `for (var i = 0; i < size; i++)`\n while (i--) {\n // `| 0` is compact and faster alternative for `Math.floor()`\n id += url[Math.random() * 64 | 0]\n }\n return id\n}\n","\n/**\n * vue-simple-portal\n * version: 0.1.4,\n * (c) Thorsten Lünborg, 2019\n * LICENCE: Apache-2.0\n * http://github.com/linusborg/vue-simple-portal\n*/\nimport Vue from 'vue';\nimport id from 'nanoid/non-secure';\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar config = {\n selector: \"vue-portal-target-\".concat(id())\n};\nvar setSelector = function setSelector(selector) {\n return config.selector = selector;\n};\nvar isBrowser = typeof window !== 'undefined' && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) !== undefined;\n\nvar TargetContainer = Vue.extend({\n // as an abstract component, it doesn't appear in\n // the $parent chain of components.\n // which means the next parent of any component rendered inside of this oen\n // will be the parent from which is was portal'd\n abstract: true,\n name: 'PortalOutlet',\n props: ['nodes', 'tag'],\n data: function data(vm) {\n return {\n updatedNodes: vm.nodes\n };\n },\n render: function render(h) {\n var nodes = this.updatedNodes && this.updatedNodes();\n if (!nodes) return h();\n return nodes.length < 2 && !nodes[0].text ? nodes : h(this.tag || 'DIV', nodes);\n },\n destroyed: function destroyed() {\n var el = this.$el;\n el.parentNode.removeChild(el);\n }\n});\n\nvar Portal = Vue.extend({\n name: 'VueSimplePortal',\n props: {\n disabled: {\n type: Boolean\n },\n prepend: {\n type: Boolean\n },\n selector: {\n type: String,\n default: function _default() {\n return \"#\".concat(config.selector);\n }\n },\n tag: {\n type: String,\n default: 'DIV'\n }\n },\n render: function render(h) {\n if (this.disabled) {\n var nodes = this.$scopedSlots && this.$scopedSlots.default();\n if (!nodes) return h();\n return nodes.length < 2 && !nodes[0].text ? nodes : h(this.tag, nodes);\n }\n\n return h();\n },\n created: function created() {\n if (!this.getTargetEl()) {\n this.insertTargetEl();\n }\n },\n updated: function updated() {\n var _this = this;\n\n // We only update the target container component\n // if the scoped slot function is a fresh one\n // The new slot syntax (since Vue 2.6) can cache unchanged slot functions\n // and we want to respect that here.\n this.$nextTick(function () {\n if (!_this.disabled && _this.slotFn !== _this.$scopedSlots.default) {\n _this.container.updatedNodes = _this.$scopedSlots.default;\n }\n\n _this.slotFn = _this.$scopedSlots.default;\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.unmount();\n },\n watch: {\n disabled: {\n immediate: true,\n handler: function handler(disabled) {\n disabled ? this.unmount() : this.$nextTick(this.mount);\n }\n }\n },\n methods: {\n // This returns the element into which the content should be mounted.\n getTargetEl: function getTargetEl() {\n if (!isBrowser) return;\n return document.querySelector(this.selector);\n },\n insertTargetEl: function insertTargetEl() {\n if (!isBrowser) return;\n var parent = document.querySelector('body');\n var child = document.createElement(this.tag);\n child.id = this.selector.substring(1);\n parent.appendChild(child);\n },\n mount: function mount() {\n var targetEl = this.getTargetEl();\n var el = document.createElement('DIV');\n\n if (this.prepend && targetEl.firstChild) {\n targetEl.insertBefore(el, targetEl.firstChild);\n } else {\n targetEl.appendChild(el);\n }\n\n this.container = new TargetContainer({\n el: el,\n parent: this,\n propsData: {\n tag: this.tag,\n nodes: this.$scopedSlots.default\n }\n });\n },\n unmount: function unmount() {\n if (this.container) {\n this.container.$destroy();\n delete this.container;\n }\n }\n }\n});\n\nfunction install(_Vue) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _Vue.component(options.name || 'portal', Portal);\n\n if (options.defaultSelector) {\n setSelector(options.defaultSelector);\n }\n}\n\nif (typeof window !== 'undefined' && window.Vue && window.Vue === Vue) {\n // plugin was inlcuded directly in a browser\n Vue.use(install);\n}\n\nexport default install;\nexport { Portal, config, setSelector };\n","\n \n \n \n \n \n \n \n \n \n \n \n {{ title }}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n\n","function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\r\n if (typeof shadowMode !== 'boolean') {\r\n createInjectorSSR = createInjector;\r\n createInjector = shadowMode;\r\n shadowMode = false;\r\n }\r\n // Vue.extend constructor export interop.\r\n const options = typeof script === 'function' ? script.options : script;\r\n // render functions\r\n if (template && template.render) {\r\n options.render = template.render;\r\n options.staticRenderFns = template.staticRenderFns;\r\n options._compiled = true;\r\n // functional template\r\n if (isFunctionalTemplate) {\r\n options.functional = true;\r\n }\r\n }\r\n // scopedId\r\n if (scopeId) {\r\n options._scopeId = scopeId;\r\n }\r\n let hook;\r\n if (moduleIdentifier) {\r\n // server build\r\n hook = function (context) {\r\n // 2.3 injection\r\n context =\r\n context || // cached call\r\n (this.$vnode && this.$vnode.ssrContext) || // stateful\r\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional\r\n // 2.2 with runInNewContext: true\r\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\r\n context = __VUE_SSR_CONTEXT__;\r\n }\r\n // inject component styles\r\n if (style) {\r\n style.call(this, createInjectorSSR(context));\r\n }\r\n // register component module identifier for async chunk inference\r\n if (context && context._registeredComponents) {\r\n context._registeredComponents.add(moduleIdentifier);\r\n }\r\n };\r\n // used by ssr in case component is cached and beforeCreate\r\n // never gets called\r\n options._ssrRegister = hook;\r\n }\r\n else if (style) {\r\n hook = shadowMode\r\n ? function (context) {\r\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\r\n }\r\n : function (context) {\r\n style.call(this, createInjector(context));\r\n };\r\n }\r\n if (hook) {\r\n if (options.functional) {\r\n // register for functional component in vue file\r\n const originalRender = options.render;\r\n options.render = function renderWithStyleInjection(h, context) {\r\n hook.call(context);\r\n return originalRender(h, context);\r\n };\r\n }\r\n else {\r\n // inject component registration as beforeCreate hook\r\n const existing = options.beforeCreate;\r\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\r\n }\r\n }\r\n return script;\r\n}\n\nexport default normalizeComponent;\n//# sourceMappingURL=normalize-component.mjs.map\n"],"names":["url","i","toString","toUpperCase","_typeof","obj","Symbol","iterator","constructor","prototype","config","selector","concat","size","id","Math","random","setSelector","isBrowser","window","undefined","document","TargetContainer","Vue","extend","abstract","name","props","data","vm","updatedNodes","nodes","render","h","this","length","text","tag","destroyed","el","$el","parentNode","removeChild","Portal","disabled","type","Boolean","prepend","String","default","$scopedSlots","created","getTargetEl","insertTargetEl","updated","_this","$nextTick","slotFn","container","beforeDestroy","unmount","watch","immediate","handler","mount","methods","querySelector","parent","child","createElement","substring","appendChild","targetEl","firstChild","insertBefore","propsData","$destroy","use","_Vue","options","arguments","component","defaultSelector","const","normalizeComponent","template","style","script","scopeId","isFunctionalTemplate","moduleIdentifier","shadowMode","createInjector","createInjectorSSR","createInjectorShadow","hook","staticRenderFns","_compiled","functional","_scopeId","context","$vnode","ssrContext","__VUE_SSR_CONTEXT__","call","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","originalRender","existing","beforeCreate"],"mappings":"6UAMA,eAHIA,EAAM,KAENC,EAAI,GACDA,KAGLD,GAAOC,EAAEC,SAAS,IAIpB,IADAD,EAAI,GACGA,IAAM,IACXD,GAAOC,EAAEC,SAAS,IAAIC,cCHxB,SAASC,EAAQC,GAWf,OATED,EADoB,mBAAXE,QAAoD,iBAApBA,OAAOC,SACtC,SAAUF,GAClB,cAAcA,GAGN,SAAUA,GAClB,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAI9GA,GAGjB,IAAIK,EAAS,CACXC,SAAU,qBAAqBC,ODMhB,SAAUC,GACzB,IAAIC,EAAK,GAGT,IAFAb,EAAIY,GAAQ,GAELZ,KAELa,GAAMd,EAAoB,GAAhBe,KAAKC,SAAgB,GAEjC,OAAOF,ECd+BA,KAEpCG,EAAc,SAAqBN,GACrC,OAAOD,EAAOC,SAAWA,GAEvBO,EAA8B,oBAAXC,aAAkGC,KAAnD,oBAAbC,SAA2B,YAAcjB,EAAQiB,WAEtGC,EAAkBC,UAAIC,OAAO,CAK/BC,UAAU,EACVC,KAAM,eACNC,MAAO,CAAC,QAAS,OACjBC,KAAM,SAAcC,GAClB,MAAO,CACLC,aAAcD,EAAGE,QAGrBC,OAAQ,SAAgBC,GACtB,IAAIF,EAAQG,KAAKJ,cAAgBI,KAAKJ,eACtC,OAAKC,EACEA,EAAMI,OAAS,IAAMJ,EAAM,GAAGK,KAAOL,EAAQE,EAAEC,KAAKG,KAAO,MAAON,GADtDE,KAGr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