diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3dce414 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/Changes b/Changes index d41df43..96b7e87 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Release history for vue-svg-pan-zoom +$NEXT + +- exposes some of svg-pan-zoom api. (alessiocarrafa, GH#7) + v1.0.1 2019-05-26 - corrects the thumbnail docs in the README. (GH#6) diff --git a/dist/index.js b/dist/index.js index 436deb8..5c179ef 100644 --- a/dist/index.js +++ b/dist/index.js @@ -87,9 +87,9 @@ module.exports = /************************************************************************/ /******/ ({ -/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"5c89b42d-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/Scope.vue?vue&type=template&id=4c74502b&scoped=true&": +/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"165a645e-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/Scope.vue?vue&type=template&id=4c74502b&scoped=true&": /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5c89b42d-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Scope.vue?vue&type=template&id=4c74502b&scoped=true& ***! + !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"165a645e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Scope.vue?vue&type=template&id=4c74502b&scoped=true& ***! \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -123,9 +123,9 @@ render._withStripped = true /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"5c89b42d-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/SvgPanZoom.vue?vue&type=template&id=806a3476&": +/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"165a645e-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/SvgPanZoom.vue?vue&type=template&id=806a3476&": /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5c89b42d-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SvgPanZoom.vue?vue&type=template&id=806a3476& ***! + !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"165a645e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SvgPanZoom.vue?vue&type=template&id=806a3476& ***! \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -168,9 +168,9 @@ render._withStripped = true /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"5c89b42d-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/SvgPanZoomThumbnail.vue?vue&type=template&id=4cd02652&": +/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"165a645e-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/SvgPanZoomThumbnail.vue?vue&type=template&id=4cd02652&": /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5c89b42d-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SvgPanZoomThumbnail.vue?vue&type=template&id=4cd02652& ***! + !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"165a645e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SvgPanZoomThumbnail.vue?vue&type=template&id=4cd02652& ***! \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -237,6 +237,28 @@ __webpack_require__.r(__webpack_exports__); // // // +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// function updateScope() { var main = this.mainSPZ; var thumb = this.thumbnailSPZ; @@ -329,11 +351,12 @@ function updateMainViewPan(evt) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var svg_pan_zoom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! svg-pan-zoom */ "./node_modules/svg-pan-zoom/src/svg-pan-zoom.js"); +/* harmony import */ var svg_pan_zoom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! svg-pan-zoom */ "./node_modules/svg-pan-zoom/src/browserify.js"); /* harmony import */ var svg_pan_zoom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(svg_pan_zoom__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./props */ "./src/props.js"); /* harmony import */ var _EventBus__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EventBus */ "./src/EventBus.js"); /* harmony import */ var _SvgPanZoomThumbnail_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SvgPanZoomThumbnail.vue */ "./src/SvgPanZoomThumbnail.vue"); +/* harmony import */ var _SvgPanZoomApi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SvgPanZoomApi */ "./src/SvgPanZoomApi.js"); // // // @@ -354,11 +377,12 @@ __webpack_require__.r(__webpack_exports__); + /* harmony default export */ __webpack_exports__["default"] = ({ - props: _props__WEBPACK_IMPORTED_MODULE_1__["default"], components: { SvgPanZoomThumbnail: _SvgPanZoomThumbnail_vue__WEBPACK_IMPORTED_MODULE_3__["default"] }, + props: _props__WEBPACK_IMPORTED_MODULE_1__["default"], computed: { has_thumbnail: function has_thumbnail() { return this.$slots.thumbnail; @@ -378,6 +402,12 @@ __webpack_require__.r(__webpack_exports__); return options; } }, + data: function data() { + return { + spz: null, + bus: Object(_EventBus__WEBPACK_IMPORTED_MODULE_2__["EventBus"])() + }; + }, mounted: function mounted() { var _this2 = this; @@ -411,11 +441,13 @@ __webpack_require__.r(__webpack_exports__); this.spz = svg_pan_zoom__WEBPACK_IMPORTED_MODULE_0___default()(this.$slots["default"][0].elm, options); this.$emit('svgpanzoom', this.spz); }, - data: function data() { - return { - spz: null, - bus: Object(_EventBus__WEBPACK_IMPORTED_MODULE_2__["EventBus"])() - }; + methods: { + zoom: function zoom(v) { + this.spz.zoom(v); + }, + zoomBy: function zoomBy(v) { + this.spz.zoomBy(v); + } } }); @@ -447,9 +479,41 @@ __webpack_require__.r(__webpack_exports__); // // // +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// /* harmony default export */ __webpack_exports__["default"] = ({ + components: { + Scope: _Scope_vue__WEBPACK_IMPORTED_MODULE_0__["default"] + }, props: ['onThumbnailShown', 'mainSPZ', 'bus'], + data: function data() { + return { + thumbnailSPZ: null + }; + }, beforeCreate: function beforeCreate() { this.$options.components.SPZ = __webpack_require__(/*! ./SvgPanZoom.vue */ "./src/SvgPanZoom.vue")["default"]; }, @@ -466,14 +530,6 @@ __webpack_require__.r(__webpack_exports__); if (this.onThumbnailShown) { this.onThumbnailShown(); } - }, - components: { - Scope: _Scope_vue__WEBPACK_IMPORTED_MODULE_0__["default"] - }, - data: function data() { - return { - thumbnailSPZ: null - }; } }); @@ -491,7 +547,7 @@ exports = module.exports = __webpack_require__(/*! ../node_modules/poi/node_modu // module -exports.push([module.i, "\n.scope[data-v-4c74502b] {\n fill: red;\n fill-opacity: 0.1;\n stroke: red;\n stroke-width: 2px;\n}\nsvg.thumbViewClass[data-v-4c74502b] {\n border: 1px solid black;\n position: absolute;\n bottom: 5px;\n left: 5px;\n width: 20%;\n height: 30%;\n margin: 3px;\n padding: 3px;\n overflow: hidden;\n z-index: 120;\n}\n", "", {"version":3,"sources":["/home/yanick/work/javascript/vue-svg-pan-zoom/src/src/Scope.vue"],"names":[],"mappings":";AAiFA;IACA,UAAA;IACA,kBAAA;IACA,YAAA;IACA,kBAAA;CACA;AAEA;IACA,wBAAA;IACA,mBAAA;IACA,YAAA;IACA,UAAA;IACA,WAAA;IACA,YAAA;IACA,YAAA;IACA,aAAA;IACA,iBAAA;IACA,aAAA;CACA","file":"Scope.vue?vue&type=style&index=0&id=4c74502b&scoped=true&lang=css&","sourcesContent":["\n\n\n\n\n"],"sourceRoot":""}]); +exports.push([module.i, "\n.scope[data-v-4c74502b] {\n fill: red;\n fill-opacity: 0.1;\n stroke: red;\n stroke-width: 2px;\n}\nsvg.thumbViewClass[data-v-4c74502b] {\n border: 1px solid black;\n position: absolute;\n bottom: 5px;\n left: 5px;\n width: 20%;\n height: 30%;\n margin: 3px;\n padding: 3px;\n overflow: hidden;\n z-index: 120;\n}\n", "", {"version":3,"sources":["/mnt/c/Users/aless/Desktop/vue-svg-pan-zoom/src/src/Scope.vue"],"names":[],"mappings":";AAOA;EACA,UAAA;EACA,kBAAA;EACA,YAAA;EACA,kBAAA;CACA;AAEA;EACA,wBAAA;EACA,mBAAA;EACA,YAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,aAAA;EACA,iBAAA;EACA,aAAA;CACA","file":"Scope.vue?vue&type=style&index=0&id=4c74502b&scoped=true&lang=css&","sourcesContent":["\n\n\n\n\n"],"sourceRoot":""}]); // exports @@ -510,7 +566,7 @@ exports = module.exports = __webpack_require__(/*! ../node_modules/poi/node_modu // module -exports.push([module.i, "\n.thumbView {\n z-index: 110;\n background: white;\n}\n.thumbnail {\n position: absolute;\n bottom: 5px;\n left: 5px;\n width: 20%;\n height: 30%;\n margin: 3px;\n padding: 3px;\n overflow: hidden;\n z-index: 120;\n}\n.thumbnail svg {\n width: 100% !important;\n height: 100% !important;\n}\n\n", "", {"version":3,"sources":["/home/yanick/work/javascript/vue-svg-pan-zoom/src/src/SvgPanZoomThumbnail.vue"],"names":[],"mappings":";AA8CA;IACA,aAAA;IACA,kBAAA;CACA;AAEA;IACA,mBAAA;IACA,YAAA;IACA,UAAA;IACA,WAAA;IACA,YAAA;IACA,YAAA;IACA,aAAA;IACA,iBAAA;IACA,aAAA;CACA;AAEA;MACA,uBAAA;MACA,wBAAA;CACA","file":"SvgPanZoomThumbnail.vue?vue&type=style&index=0&lang=css&","sourcesContent":["\n\n\n\n\n"],"sourceRoot":""}]); +exports.push([module.i, "\n.thumbView {\n z-index: 110;\n background: white;\n}\n.thumbnail {\n position: absolute;\n bottom: 5px;\n left: 5px;\n width: 20%;\n height: 30%;\n margin: 3px;\n padding: 3px;\n overflow: hidden;\n z-index: 120;\n}\n.thumbnail svg {\n width: 100% !important;\n height: 100% !important;\n}\n", "", {"version":3,"sources":["/mnt/c/Users/aless/Desktop/vue-svg-pan-zoom/src/src/SvgPanZoomThumbnail.vue"],"names":[],"mappings":";AAiBA;EACA,aAAA;EACA,kBAAA;CACA;AAEA;EACA,mBAAA;EACA,YAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,aAAA;EACA,iBAAA;EACA,aAAA;CACA;AAEA;EACA,uBAAA;EACA,wBAAA;CACA","file":"SvgPanZoomThumbnail.vue?vue&type=style&index=0&lang=css&","sourcesContent":["\n\n\n\n\n"],"sourceRoot":""}]); // exports @@ -602,6 +658,413 @@ function toComment(sourceMap) { } +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), + +/***/ "./node_modules/setimmediate/setImmediate.js": +/*!***************************************************!*\ + !*** ./node_modules/setimmediate/setImmediate.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { + "use strict"; + + if (global.setImmediate) { + return; + } + + var nextHandle = 1; // Spec says greater than zero + var tasksByHandle = {}; + var currentlyRunningATask = false; + var doc = global.document; + var registerImmediate; + + function setImmediate(callback) { + // Callback can either be a function or a string + if (typeof callback !== "function") { + callback = new Function("" + callback); + } + // Copy function arguments + var args = new Array(arguments.length - 1); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i + 1]; + } + // Store and register the task + var task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; + } + + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + + function run(task) { + var callback = task.callback; + var args = task.args; + switch (args.length) { + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; + } + } + + function runIfPresent(handle) { + // From the spec: "Wait until any invocations of this algorithm started before this one have completed." + // So if we're currently running a task, we'll need to delay this invocation. + if (currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // "too much recursion" error. + setTimeout(runIfPresent, 0, handle); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + run(task); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + + function installNextTickImplementation() { + registerImmediate = function(handle) { + process.nextTick(function () { runIfPresent(handle); }); + }; + } + + function canUsePostMessage() { + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `global.postMessage` means something completely different and can't be used for this purpose. + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage("", "*"); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + + function installPostMessageImplementation() { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + + var messagePrefix = "setImmediate$" + Math.random() + "$"; + var onGlobalMessage = function(event) { + if (event.source === global && + typeof event.data === "string" && + event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + + if (global.addEventListener) { + global.addEventListener("message", onGlobalMessage, false); + } else { + global.attachEvent("onmessage", onGlobalMessage); + } + + registerImmediate = function(handle) { + global.postMessage(messagePrefix + handle, "*"); + }; + } + + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + + registerImmediate = function(handle) { + channel.port2.postMessage(handle); + }; + } + + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + registerImmediate = function(handle) { + // Create a \n\n\n","\n\n\n\n","\n\n\n\n\n","exports = module.exports = require(\"../node_modules/poi/node_modules/css-loader/lib/css-base.js\")(true);\n// imports\n\n\n// module\nexports.push([module.id, \"\\n.scope[data-v-4c74502b] {\\n fill: red;\\n fill-opacity: 0.1;\\n stroke: red;\\n stroke-width: 2px;\\n}\\nsvg.thumbViewClass[data-v-4c74502b] {\\n border: 1px solid black;\\n position: absolute;\\n bottom: 5px;\\n left: 5px;\\n width: 20%;\\n height: 30%;\\n margin: 3px;\\n padding: 3px;\\n overflow: hidden;\\n z-index: 120;\\n}\\n\", \"\", {\"version\":3,\"sources\":[\"/home/yanick/work/javascript/vue-svg-pan-zoom/src/src/Scope.vue\"],\"names\":[],\"mappings\":\";AAiFA;IACA,UAAA;IACA,kBAAA;IACA,YAAA;IACA,kBAAA;CACA;AAEA;IACA,wBAAA;IACA,mBAAA;IACA,YAAA;IACA,UAAA;IACA,WAAA;IACA,YAAA;IACA,YAAA;IACA,aAAA;IACA,iBAAA;IACA,aAAA;CACA\",\"file\":\"Scope.vue?vue&type=style&index=0&id=4c74502b&scoped=true&lang=css&\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n","exports = module.exports = require(\"../node_modules/poi/node_modules/css-loader/lib/css-base.js\")(true);\n// imports\n\n\n// module\nexports.push([module.id, \"\\n.thumbView {\\n z-index: 110;\\n background: white;\\n}\\n.thumbnail {\\n position: absolute;\\n bottom: 5px;\\n left: 5px;\\n width: 20%;\\n height: 30%;\\n margin: 3px;\\n padding: 3px;\\n overflow: hidden;\\n z-index: 120;\\n}\\n.thumbnail svg {\\n width: 100% !important;\\n height: 100% !important;\\n}\\n\\n\", \"\", {\"version\":3,\"sources\":[\"/home/yanick/work/javascript/vue-svg-pan-zoom/src/src/SvgPanZoomThumbnail.vue\"],\"names\":[],\"mappings\":\";AA8CA;IACA,aAAA;IACA,kBAAA;CACA;AAEA;IACA,mBAAA;IACA,YAAA;IACA,UAAA;IACA,WAAA;IACA,YAAA;IACA,YAAA;IACA,aAAA;IACA,iBAAA;IACA,aAAA;CACA;AAEA;MACA,uBAAA;MACA,wBAAA;CACA\",\"file\":\"SvgPanZoomThumbnail.vue?vue&type=style&index=0&lang=css&\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n","var SvgUtils = require('./svg-utilities');\n\nmodule.exports = {\n enable: function(instance) {\n // Select (and create if necessary) defs\n var defs = instance.svg.querySelector('defs')\n if (!defs) {\n defs = document.createElementNS(SvgUtils.svgNS, 'defs')\n instance.svg.appendChild(defs)\n }\n\n // Check for style element, and create it if it doesn't exist\n var styleEl = defs.querySelector('style#svg-pan-zoom-controls-styles');\n if (!styleEl) {\n var style = document.createElementNS(SvgUtils.svgNS, 'style')\n style.setAttribute('id', 'svg-pan-zoom-controls-styles')\n style.setAttribute('type', 'text/css')\n style.textContent = '.svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom-control-background { fill: white; fill-opacity: 0.5; } .svg-pan-zoom-control-background { fill-opacity: 0.8; }'\n defs.appendChild(style)\n }\n\n // Zoom Group\n var zoomGroup = document.createElementNS(SvgUtils.svgNS, 'g');\n zoomGroup.setAttribute('id', 'svg-pan-zoom-controls');\n zoomGroup.setAttribute('transform', 'translate(' + ( instance.width - 70 ) + ' ' + ( instance.height - 76 ) + ') scale(0.75)');\n zoomGroup.setAttribute('class', 'svg-pan-zoom-control');\n\n // Control elements\n zoomGroup.appendChild(this._createZoomIn(instance))\n zoomGroup.appendChild(this._createZoomReset(instance))\n zoomGroup.appendChild(this._createZoomOut(instance))\n\n // Finally append created element\n instance.svg.appendChild(zoomGroup)\n\n // Cache control instance\n instance.controlIcons = zoomGroup\n }\n\n, _createZoomIn: function(instance) {\n var zoomIn = document.createElementNS(SvgUtils.svgNS, 'g');\n zoomIn.setAttribute('id', 'svg-pan-zoom-zoom-in');\n zoomIn.setAttribute('transform', 'translate(30.5 5) scale(0.015)');\n zoomIn.setAttribute('class', 'svg-pan-zoom-control');\n zoomIn.addEventListener('click', function() {instance.getPublicInstance().zoomIn()}, false)\n zoomIn.addEventListener('touchstart', function() {instance.getPublicInstance().zoomIn()}, false)\n\n var zoomInBackground = document.createElementNS(SvgUtils.svgNS, 'rect'); // TODO change these background space fillers to rounded rectangles so they look prettier\n zoomInBackground.setAttribute('x', '0');\n zoomInBackground.setAttribute('y', '0');\n zoomInBackground.setAttribute('width', '1500'); // larger than expected because the whole group is transformed to scale down\n zoomInBackground.setAttribute('height', '1400');\n zoomInBackground.setAttribute('class', 'svg-pan-zoom-control-background');\n zoomIn.appendChild(zoomInBackground);\n\n var zoomInShape = document.createElementNS(SvgUtils.svgNS, 'path');\n zoomInShape.setAttribute('d', 'M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z');\n zoomInShape.setAttribute('class', 'svg-pan-zoom-control-element');\n zoomIn.appendChild(zoomInShape);\n\n return zoomIn\n }\n\n, _createZoomReset: function(instance){\n // reset\n var resetPanZoomControl = document.createElementNS(SvgUtils.svgNS, 'g');\n resetPanZoomControl.setAttribute('id', 'svg-pan-zoom-reset-pan-zoom');\n resetPanZoomControl.setAttribute('transform', 'translate(5 35) scale(0.4)');\n resetPanZoomControl.setAttribute('class', 'svg-pan-zoom-control');\n resetPanZoomControl.addEventListener('click', function() {instance.getPublicInstance().reset()}, false);\n resetPanZoomControl.addEventListener('touchstart', function() {instance.getPublicInstance().reset()}, false);\n\n var resetPanZoomControlBackground = document.createElementNS(SvgUtils.svgNS, 'rect'); // TODO change these background space fillers to rounded rectangles so they look prettier\n resetPanZoomControlBackground.setAttribute('x', '2');\n resetPanZoomControlBackground.setAttribute('y', '2');\n resetPanZoomControlBackground.setAttribute('width', '182'); // larger than expected because the whole group is transformed to scale down\n resetPanZoomControlBackground.setAttribute('height', '58');\n resetPanZoomControlBackground.setAttribute('class', 'svg-pan-zoom-control-background');\n resetPanZoomControl.appendChild(resetPanZoomControlBackground);\n\n var resetPanZoomControlShape1 = document.createElementNS(SvgUtils.svgNS, 'path');\n resetPanZoomControlShape1.setAttribute('d', 'M33.051,20.632c-0.742-0.406-1.854-0.609-3.338-0.609h-7.969v9.281h7.769c1.543,0,2.701-0.188,3.473-0.562c1.365-0.656,2.048-1.953,2.048-3.891C35.032,22.757,34.372,21.351,33.051,20.632z');\n resetPanZoomControlShape1.setAttribute('class', 'svg-pan-zoom-control-element');\n resetPanZoomControl.appendChild(resetPanZoomControlShape1);\n\n var resetPanZoomControlShape2 = document.createElementNS(SvgUtils.svgNS, 'path');\n resetPanZoomControlShape2.setAttribute('d', 'M170.231,0.5H15.847C7.102,0.5,0.5,5.708,0.5,11.84v38.861C0.5,56.833,7.102,61.5,15.847,61.5h154.384c8.745,0,15.269-4.667,15.269-10.798V11.84C185.5,5.708,178.976,0.5,170.231,0.5z M42.837,48.569h-7.969c-0.219-0.766-0.375-1.383-0.469-1.852c-0.188-0.969-0.289-1.961-0.305-2.977l-0.047-3.211c-0.03-2.203-0.41-3.672-1.142-4.406c-0.732-0.734-2.103-1.102-4.113-1.102h-7.05v13.547h-7.055V14.022h16.524c2.361,0.047,4.178,0.344,5.45,0.891c1.272,0.547,2.351,1.352,3.234,2.414c0.731,0.875,1.31,1.844,1.737,2.906s0.64,2.273,0.64,3.633c0,1.641-0.414,3.254-1.242,4.84s-2.195,2.707-4.102,3.363c1.594,0.641,2.723,1.551,3.387,2.73s0.996,2.98,0.996,5.402v2.32c0,1.578,0.063,2.648,0.19,3.211c0.19,0.891,0.635,1.547,1.333,1.969V48.569z M75.579,48.569h-26.18V14.022h25.336v6.117H56.454v7.336h16.781v6H56.454v8.883h19.125V48.569z M104.497,46.331c-2.44,2.086-5.887,3.129-10.34,3.129c-4.548,0-8.125-1.027-10.731-3.082s-3.909-4.879-3.909-8.473h6.891c0.224,1.578,0.662,2.758,1.316,3.539c1.196,1.422,3.246,2.133,6.15,2.133c1.739,0,3.151-0.188,4.236-0.562c2.058-0.719,3.087-2.055,3.087-4.008c0-1.141-0.504-2.023-1.512-2.648c-1.008-0.609-2.607-1.148-4.796-1.617l-3.74-0.82c-3.676-0.812-6.201-1.695-7.576-2.648c-2.328-1.594-3.492-4.086-3.492-7.477c0-3.094,1.139-5.664,3.417-7.711s5.623-3.07,10.036-3.07c3.685,0,6.829,0.965,9.431,2.895c2.602,1.93,3.966,4.73,4.093,8.402h-6.938c-0.128-2.078-1.057-3.555-2.787-4.43c-1.154-0.578-2.587-0.867-4.301-0.867c-1.907,0-3.428,0.375-4.565,1.125c-1.138,0.75-1.706,1.797-1.706,3.141c0,1.234,0.561,2.156,1.682,2.766c0.721,0.406,2.25,0.883,4.589,1.43l6.063,1.43c2.657,0.625,4.648,1.461,5.975,2.508c2.059,1.625,3.089,3.977,3.089,7.055C108.157,41.624,106.937,44.245,104.497,46.331z M139.61,48.569h-26.18V14.022h25.336v6.117h-18.281v7.336h16.781v6h-16.781v8.883h19.125V48.569z M170.337,20.14h-10.336v28.43h-7.266V20.14h-10.383v-6.117h27.984V20.14z');\n resetPanZoomControlShape2.setAttribute('class', 'svg-pan-zoom-control-element');\n resetPanZoomControl.appendChild(resetPanZoomControlShape2);\n\n return resetPanZoomControl\n }\n\n, _createZoomOut: function(instance){\n // zoom out\n var zoomOut = document.createElementNS(SvgUtils.svgNS, 'g');\n zoomOut.setAttribute('id', 'svg-pan-zoom-zoom-out');\n zoomOut.setAttribute('transform', 'translate(30.5 70) scale(0.015)');\n zoomOut.setAttribute('class', 'svg-pan-zoom-control');\n zoomOut.addEventListener('click', function() {instance.getPublicInstance().zoomOut()}, false);\n zoomOut.addEventListener('touchstart', function() {instance.getPublicInstance().zoomOut()}, false);\n\n var zoomOutBackground = document.createElementNS(SvgUtils.svgNS, 'rect'); // TODO change these background space fillers to rounded rectangles so they look prettier\n zoomOutBackground.setAttribute('x', '0');\n zoomOutBackground.setAttribute('y', '0');\n zoomOutBackground.setAttribute('width', '1500'); // larger than expected because the whole group is transformed to scale down\n zoomOutBackground.setAttribute('height', '1400');\n zoomOutBackground.setAttribute('class', 'svg-pan-zoom-control-background');\n zoomOut.appendChild(zoomOutBackground);\n\n var zoomOutShape = document.createElementNS(SvgUtils.svgNS, 'path');\n zoomOutShape.setAttribute('d', 'M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z');\n zoomOutShape.setAttribute('class', 'svg-pan-zoom-control-element');\n zoomOut.appendChild(zoomOutShape);\n\n return zoomOut\n }\n\n, disable: function(instance) {\n if (instance.controlIcons) {\n instance.controlIcons.parentNode.removeChild(instance.controlIcons)\n instance.controlIcons = null\n }\n }\n}\n","var SvgUtils = require('./svg-utilities')\n , Utils = require('./utilities')\n ;\n\nvar ShadowViewport = function(viewport, options){\n this.init(viewport, options)\n}\n\n/**\n * Initialization\n *\n * @param {SVGElement} viewport\n * @param {Object} options\n */\nShadowViewport.prototype.init = function(viewport, options) {\n // DOM Elements\n this.viewport = viewport\n this.options = options\n\n // State cache\n this.originalState = {zoom: 1, x: 0, y: 0}\n this.activeState = {zoom: 1, x: 0, y: 0}\n\n this.updateCTMCached = Utils.proxy(this.updateCTM, this)\n\n // Create a custom requestAnimationFrame taking in account refreshRate\n this.requestAnimationFrame = Utils.createRequestAnimationFrame(this.options.refreshRate)\n\n // ViewBox\n this.viewBox = {x: 0, y: 0, width: 0, height: 0}\n this.cacheViewBox()\n\n // Process CTM\n var newCTM = this.processCTM()\n\n // Update viewport CTM and cache zoom and pan\n this.setCTM(newCTM)\n\n // Update CTM in this frame\n this.updateCTM()\n}\n\n/**\n * Cache initial viewBox value\n * If no viewBox is defined, then use viewport size/position instead for viewBox values\n */\nShadowViewport.prototype.cacheViewBox = function() {\n var svgViewBox = this.options.svg.getAttribute('viewBox')\n\n if (svgViewBox) {\n var viewBoxValues = svgViewBox.split(/[\\s\\,]/).filter(function(v){return v}).map(parseFloat)\n\n // Cache viewbox x and y offset\n this.viewBox.x = viewBoxValues[0]\n this.viewBox.y = viewBoxValues[1]\n this.viewBox.width = viewBoxValues[2]\n this.viewBox.height = viewBoxValues[3]\n\n var zoom = Math.min(this.options.width / this.viewBox.width, this.options.height / this.viewBox.height)\n\n // Update active state\n this.activeState.zoom = zoom\n this.activeState.x = (this.options.width - this.viewBox.width * zoom) / 2\n this.activeState.y = (this.options.height - this.viewBox.height * zoom) / 2\n\n // Force updating CTM\n this.updateCTMOnNextFrame()\n\n this.options.svg.removeAttribute('viewBox')\n } else {\n this.simpleViewBoxCache()\n }\n}\n\n/**\n * Recalculate viewport sizes and update viewBox cache\n */\nShadowViewport.prototype.simpleViewBoxCache = function() {\n var bBox = this.viewport.getBBox()\n\n this.viewBox.x = bBox.x\n this.viewBox.y = bBox.y\n this.viewBox.width = bBox.width\n this.viewBox.height = bBox.height\n}\n\n/**\n * Returns a viewbox object. Safe to alter\n *\n * @return {Object} viewbox object\n */\nShadowViewport.prototype.getViewBox = function() {\n return Utils.extend({}, this.viewBox)\n}\n\n/**\n * Get initial zoom and pan values. Save them into originalState\n * Parses viewBox attribute to alter initial sizes\n *\n * @return {CTM} CTM object based on options\n */\nShadowViewport.prototype.processCTM = function() {\n var newCTM = this.getCTM()\n\n if (this.options.fit || this.options.contain) {\n var newScale;\n if (this.options.fit) {\n newScale = Math.min(this.options.width/this.viewBox.width, this.options.height/this.viewBox.height);\n } else {\n newScale = Math.max(this.options.width/this.viewBox.width, this.options.height/this.viewBox.height);\n }\n\n newCTM.a = newScale; //x-scale\n newCTM.d = newScale; //y-scale\n newCTM.e = -this.viewBox.x * newScale; //x-transform\n newCTM.f = -this.viewBox.y * newScale; //y-transform\n }\n\n if (this.options.center) {\n var offsetX = (this.options.width - (this.viewBox.width + this.viewBox.x * 2) * newCTM.a) * 0.5\n , offsetY = (this.options.height - (this.viewBox.height + this.viewBox.y * 2) * newCTM.a) * 0.5\n\n newCTM.e = offsetX\n newCTM.f = offsetY\n }\n\n // Cache initial values. Based on activeState and fix+center opitons\n this.originalState.zoom = newCTM.a\n this.originalState.x = newCTM.e\n this.originalState.y = newCTM.f\n\n return newCTM\n}\n\n/**\n * Return originalState object. Safe to alter\n *\n * @return {Object}\n */\nShadowViewport.prototype.getOriginalState = function() {\n return Utils.extend({}, this.originalState)\n}\n\n/**\n * Return actualState object. Safe to alter\n *\n * @return {Object}\n */\nShadowViewport.prototype.getState = function() {\n return Utils.extend({}, this.activeState)\n}\n\n/**\n * Get zoom scale\n *\n * @return {Float} zoom scale\n */\nShadowViewport.prototype.getZoom = function() {\n return this.activeState.zoom\n}\n\n/**\n * Get zoom scale for pubilc usage\n *\n * @return {Float} zoom scale\n */\nShadowViewport.prototype.getRelativeZoom = function() {\n return this.activeState.zoom / this.originalState.zoom\n}\n\n/**\n * Compute zoom scale for pubilc usage\n *\n * @return {Float} zoom scale\n */\nShadowViewport.prototype.computeRelativeZoom = function(scale) {\n return scale / this.originalState.zoom\n}\n\n/**\n * Get pan\n *\n * @return {Object}\n */\nShadowViewport.prototype.getPan = function() {\n return {x: this.activeState.x, y: this.activeState.y}\n}\n\n/**\n * Return cached viewport CTM value that can be safely modified\n *\n * @return {SVGMatrix}\n */\nShadowViewport.prototype.getCTM = function() {\n var safeCTM = this.options.svg.createSVGMatrix()\n\n // Copy values manually as in FF they are not itterable\n safeCTM.a = this.activeState.zoom\n safeCTM.b = 0\n safeCTM.c = 0\n safeCTM.d = this.activeState.zoom\n safeCTM.e = this.activeState.x\n safeCTM.f = this.activeState.y\n\n return safeCTM\n}\n\n/**\n * Set a new CTM\n *\n * @param {SVGMatrix} newCTM\n */\nShadowViewport.prototype.setCTM = function(newCTM) {\n var willZoom = this.isZoomDifferent(newCTM)\n , willPan = this.isPanDifferent(newCTM)\n\n if (willZoom || willPan) {\n // Before zoom\n if (willZoom) {\n // If returns false then cancel zooming\n if (this.options.beforeZoom(this.getRelativeZoom(), this.computeRelativeZoom(newCTM.a)) === false) {\n newCTM.a = newCTM.d = this.activeState.zoom\n willZoom = false\n } else {\n this.updateCache(newCTM);\n this.options.onZoom(this.getRelativeZoom())\n }\n }\n\n // Before pan\n if (willPan) {\n var preventPan = this.options.beforePan(this.getPan(), {x: newCTM.e, y: newCTM.f})\n // If prevent pan is an object\n , preventPanX = false\n , preventPanY = false\n\n // If prevent pan is Boolean false\n if (preventPan === false) {\n // Set x and y same as before\n newCTM.e = this.getPan().x\n newCTM.f = this.getPan().y\n\n preventPanX = preventPanY = true\n } else if (Utils.isObject(preventPan)) {\n // Check for X axes attribute\n if (preventPan.x === false) {\n // Prevent panning on x axes\n newCTM.e = this.getPan().x\n preventPanX = true\n } else if (Utils.isNumber(preventPan.x)) {\n // Set a custom pan value\n newCTM.e = preventPan.x\n }\n\n // Check for Y axes attribute\n if (preventPan.y === false) {\n // Prevent panning on x axes\n newCTM.f = this.getPan().y\n preventPanY = true\n } else if (Utils.isNumber(preventPan.y)) {\n // Set a custom pan value\n newCTM.f = preventPan.y\n }\n }\n\n // Update willPan flag\n // Check if newCTM is still different\n if ((preventPanX && preventPanY) || !this.isPanDifferent(newCTM)) {\n willPan = false\n } else {\n this.updateCache(newCTM);\n this.options.onPan(this.getPan());\n }\n }\n\n // Check again if should zoom or pan\n if (willZoom || willPan) {\n this.updateCTMOnNextFrame()\n }\n }\n}\n\nShadowViewport.prototype.isZoomDifferent = function(newCTM) {\n return this.activeState.zoom !== newCTM.a\n}\n\nShadowViewport.prototype.isPanDifferent = function(newCTM) {\n return this.activeState.x !== newCTM.e || this.activeState.y !== newCTM.f\n}\n\n\n/**\n * Update cached CTM and active state\n *\n * @param {SVGMatrix} newCTM\n */\nShadowViewport.prototype.updateCache = function(newCTM) {\n this.activeState.zoom = newCTM.a\n this.activeState.x = newCTM.e\n this.activeState.y = newCTM.f\n}\n\nShadowViewport.prototype.pendingUpdate = false\n\n/**\n * Place a request to update CTM on next Frame\n */\nShadowViewport.prototype.updateCTMOnNextFrame = function() {\n if (!this.pendingUpdate) {\n // Lock\n this.pendingUpdate = true\n\n // Throttle next update\n this.requestAnimationFrame.call(window, this.updateCTMCached)\n }\n}\n\n/**\n * Update viewport CTM with cached CTM\n */\nShadowViewport.prototype.updateCTM = function() {\n var ctm = this.getCTM()\n\n // Updates SVG element\n SvgUtils.setCTM(this.viewport, ctm, this.defs)\n\n // Free the lock\n this.pendingUpdate = false\n\n // Notify about the update\n if(this.options.onUpdatedCTM) {\n this.options.onUpdatedCTM(ctm)\n }\n}\n\nmodule.exports = function(viewport, options){\n return new ShadowViewport(viewport, options)\n}\n","var Wheel = require('./uniwheel')\n, ControlIcons = require('./control-icons')\n, Utils = require('./utilities')\n, SvgUtils = require('./svg-utilities')\n, ShadowViewport = require('./shadow-viewport')\n\nvar SvgPanZoom = function(svg, options) {\n this.init(svg, options)\n}\n\nvar optionsDefaults = {\n viewportSelector: '.svg-pan-zoom_viewport' // Viewport selector. Can be querySelector string or SVGElement\n, panEnabled: true // enable or disable panning (default enabled)\n, controlIconsEnabled: false // insert icons to give user an option in addition to mouse events to control pan/zoom (default disabled)\n, zoomEnabled: true // enable or disable zooming (default enabled)\n, dblClickZoomEnabled: true // enable or disable zooming by double clicking (default enabled)\n, mouseWheelZoomEnabled: true // enable or disable zooming by mouse wheel (default enabled)\n, preventMouseEventsDefault: true // enable or disable preventDefault for mouse events\n, zoomScaleSensitivity: 0.1 // Zoom sensitivity\n, minZoom: 0.5 // Minimum Zoom level\n, maxZoom: 10 // Maximum Zoom level\n, fit: true // enable or disable viewport fit in SVG (default true)\n, contain: false // enable or disable viewport contain the svg (default false)\n, center: true // enable or disable viewport centering in SVG (default true)\n, refreshRate: 'auto' // Maximum number of frames per second (altering SVG's viewport)\n, beforeZoom: null\n, onZoom: null\n, beforePan: null\n, onPan: null\n, customEventsHandler: null\n, eventsListenerElement: null\n, onUpdatedCTM: null\n}\n\nvar passiveListenerOption = {passive: true};\n\nSvgPanZoom.prototype.init = function(svg, options) {\n var that = this\n\n this.svg = svg\n this.defs = svg.querySelector('defs')\n\n // Add default attributes to SVG\n SvgUtils.setupSvgAttributes(this.svg)\n\n // Set options\n this.options = Utils.extend(Utils.extend({}, optionsDefaults), options)\n\n // Set default state\n this.state = 'none'\n\n // Get dimensions\n var boundingClientRectNormalized = SvgUtils.getBoundingClientRectNormalized(svg)\n this.width = boundingClientRectNormalized.width\n this.height = boundingClientRectNormalized.height\n\n // Init shadow viewport\n this.viewport = ShadowViewport(SvgUtils.getOrCreateViewport(this.svg, this.options.viewportSelector), {\n svg: this.svg\n , width: this.width\n , height: this.height\n , fit: this.options.fit\n , contain: this.options.contain\n , center: this.options.center\n , refreshRate: this.options.refreshRate\n // Put callbacks into functions as they can change through time\n , beforeZoom: function(oldScale, newScale) {\n if (that.viewport && that.options.beforeZoom) {return that.options.beforeZoom(oldScale, newScale)}\n }\n , onZoom: function(scale) {\n if (that.viewport && that.options.onZoom) {return that.options.onZoom(scale)}\n }\n , beforePan: function(oldPoint, newPoint) {\n if (that.viewport && that.options.beforePan) {return that.options.beforePan(oldPoint, newPoint)}\n }\n , onPan: function(point) {\n if (that.viewport && that.options.onPan) {return that.options.onPan(point)}\n }\n , onUpdatedCTM: function(ctm) {\n if (that.viewport && that.options.onUpdatedCTM) {return that.options.onUpdatedCTM(ctm)}\n }\n })\n\n // Wrap callbacks into public API context\n var publicInstance = this.getPublicInstance()\n publicInstance.setBeforeZoom(this.options.beforeZoom)\n publicInstance.setOnZoom(this.options.onZoom)\n publicInstance.setBeforePan(this.options.beforePan)\n publicInstance.setOnPan(this.options.onPan)\n publicInstance.setOnUpdatedCTM(this.options.onUpdatedCTM)\n\n if (this.options.controlIconsEnabled) {\n ControlIcons.enable(this)\n }\n\n // Init events handlers\n this.lastMouseWheelEventTime = Date.now()\n this.setupHandlers()\n}\n\n/**\n * Register event handlers\n */\nSvgPanZoom.prototype.setupHandlers = function() {\n var that = this\n , prevEvt = null // use for touchstart event to detect double tap\n ;\n\n this.eventListeners = {\n // Mouse down group\n mousedown: function(evt) {\n var result = that.handleMouseDown(evt, prevEvt);\n prevEvt = evt\n return result;\n }\n , touchstart: function(evt) {\n var result = that.handleMouseDown(evt, prevEvt);\n prevEvt = evt\n return result;\n }\n\n // Mouse up group\n , mouseup: function(evt) {\n return that.handleMouseUp(evt);\n }\n , touchend: function(evt) {\n return that.handleMouseUp(evt);\n }\n\n // Mouse move group\n , mousemove: function(evt) {\n return that.handleMouseMove(evt);\n }\n , touchmove: function(evt) {\n return that.handleMouseMove(evt);\n }\n\n // Mouse leave group\n , mouseleave: function(evt) {\n return that.handleMouseUp(evt);\n }\n , touchleave: function(evt) {\n return that.handleMouseUp(evt);\n }\n , touchcancel: function(evt) {\n return that.handleMouseUp(evt);\n }\n }\n\n // Init custom events handler if available\n if (this.options.customEventsHandler != null) { // jshint ignore:line\n this.options.customEventsHandler.init({\n svgElement: this.svg\n , eventsListenerElement: this.options.eventsListenerElement\n , instance: this.getPublicInstance()\n })\n\n // Custom event handler may halt builtin listeners\n var haltEventListeners = this.options.customEventsHandler.haltEventListeners\n if (haltEventListeners && haltEventListeners.length) {\n for (var i = haltEventListeners.length - 1; i >= 0; i--) {\n if (this.eventListeners.hasOwnProperty(haltEventListeners[i])) {\n delete this.eventListeners[haltEventListeners[i]]\n }\n }\n }\n }\n\n // Bind eventListeners\n for (var event in this.eventListeners) {\n // Attach event to eventsListenerElement or SVG if not available\n (this.options.eventsListenerElement || this.svg)\n .addEventListener(event, this.eventListeners[event], !this.options.preventMouseEventsDefault ? passiveListenerOption : false)\n }\n\n // Zoom using mouse wheel\n if (this.options.mouseWheelZoomEnabled) {\n this.options.mouseWheelZoomEnabled = false // set to false as enable will set it back to true\n this.enableMouseWheelZoom()\n }\n}\n\n/**\n * Enable ability to zoom using mouse wheel\n */\nSvgPanZoom.prototype.enableMouseWheelZoom = function() {\n if (!this.options.mouseWheelZoomEnabled) {\n var that = this\n\n // Mouse wheel listener\n this.wheelListener = function(evt) {\n return that.handleMouseWheel(evt);\n }\n\n // Bind wheelListener\n var isPassiveListener = !this.options.preventMouseEventsDefault\n Wheel.on(this.options.eventsListenerElement || this.svg, this.wheelListener, isPassiveListener)\n\n this.options.mouseWheelZoomEnabled = true\n }\n}\n\n/**\n * Disable ability to zoom using mouse wheel\n */\nSvgPanZoom.prototype.disableMouseWheelZoom = function() {\n if (this.options.mouseWheelZoomEnabled) {\n var isPassiveListener = !this.options.preventMouseEventsDefault\n Wheel.off(this.options.eventsListenerElement || this.svg, this.wheelListener, isPassiveListener)\n this.options.mouseWheelZoomEnabled = false\n }\n}\n\n/**\n * Handle mouse wheel event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseWheel = function(evt) {\n if (!this.options.zoomEnabled || this.state !== 'none') {\n return;\n }\n\n if (this.options.preventMouseEventsDefault){\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n }\n\n // Default delta in case that deltaY is not available\n var delta = evt.deltaY || 1\n , timeDelta = Date.now() - this.lastMouseWheelEventTime\n , divider = 3 + Math.max(0, 30 - timeDelta)\n\n // Update cache\n this.lastMouseWheelEventTime = Date.now()\n\n // Make empirical adjustments for browsers that give deltaY in pixels (deltaMode=0)\n if ('deltaMode' in evt && evt.deltaMode === 0 && evt.wheelDelta) {\n delta = evt.deltaY === 0 ? 0 : Math.abs(evt.wheelDelta) / evt.deltaY\n }\n\n delta = -0.3 < delta && delta < 0.3 ? delta : (delta > 0 ? 1 : -1) * Math.log(Math.abs(delta) + 10) / divider\n\n var inversedScreenCTM = this.svg.getScreenCTM().inverse()\n , relativeMousePoint = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(inversedScreenCTM)\n , zoom = Math.pow(1 + this.options.zoomScaleSensitivity, (-1) * delta); // multiplying by neg. 1 so as to make zoom in/out behavior match Google maps behavior\n\n this.zoomAtPoint(zoom, relativeMousePoint)\n}\n\n/**\n * Zoom in at a SVG point\n *\n * @param {SVGPoint} point\n * @param {Float} zoomScale Number representing how much to zoom\n * @param {Boolean} zoomAbsolute Default false. If true, zoomScale is treated as an absolute value.\n * Otherwise, zoomScale is treated as a multiplied (e.g. 1.10 would zoom in 10%)\n */\nSvgPanZoom.prototype.zoomAtPoint = function(zoomScale, point, zoomAbsolute) {\n var originalState = this.viewport.getOriginalState()\n\n if (!zoomAbsolute) {\n // Fit zoomScale in set bounds\n if (this.getZoom() * zoomScale < this.options.minZoom * originalState.zoom) {\n zoomScale = (this.options.minZoom * originalState.zoom) / this.getZoom()\n } else if (this.getZoom() * zoomScale > this.options.maxZoom * originalState.zoom) {\n zoomScale = (this.options.maxZoom * originalState.zoom) / this.getZoom()\n }\n } else {\n // Fit zoomScale in set bounds\n zoomScale = Math.max(this.options.minZoom * originalState.zoom, Math.min(this.options.maxZoom * originalState.zoom, zoomScale))\n // Find relative scale to achieve desired scale\n zoomScale = zoomScale/this.getZoom()\n }\n\n var oldCTM = this.viewport.getCTM()\n , relativePoint = point.matrixTransform(oldCTM.inverse())\n , modifier = this.svg.createSVGMatrix().translate(relativePoint.x, relativePoint.y).scale(zoomScale).translate(-relativePoint.x, -relativePoint.y)\n , newCTM = oldCTM.multiply(modifier)\n\n if (newCTM.a !== oldCTM.a) {\n this.viewport.setCTM(newCTM)\n }\n}\n\n/**\n * Zoom at center point\n *\n * @param {Float} scale\n * @param {Boolean} absolute Marks zoom scale as relative or absolute\n */\nSvgPanZoom.prototype.zoom = function(scale, absolute) {\n this.zoomAtPoint(scale, SvgUtils.getSvgCenterPoint(this.svg, this.width, this.height), absolute)\n}\n\n/**\n * Zoom used by public instance\n *\n * @param {Float} scale\n * @param {Boolean} absolute Marks zoom scale as relative or absolute\n */\nSvgPanZoom.prototype.publicZoom = function(scale, absolute) {\n if (absolute) {\n scale = this.computeFromRelativeZoom(scale)\n }\n\n this.zoom(scale, absolute)\n}\n\n/**\n * Zoom at point used by public instance\n *\n * @param {Float} scale\n * @param {SVGPoint|Object} point An object that has x and y attributes\n * @param {Boolean} absolute Marks zoom scale as relative or absolute\n */\nSvgPanZoom.prototype.publicZoomAtPoint = function(scale, point, absolute) {\n if (absolute) {\n // Transform zoom into a relative value\n scale = this.computeFromRelativeZoom(scale)\n }\n\n // If not a SVGPoint but has x and y then create a SVGPoint\n if (Utils.getType(point) !== 'SVGPoint') {\n if('x' in point && 'y' in point) {\n point = SvgUtils.createSVGPoint(this.svg, point.x, point.y)\n } else {\n throw new Error('Given point is invalid')\n }\n }\n\n this.zoomAtPoint(scale, point, absolute)\n}\n\n/**\n * Get zoom scale\n *\n * @return {Float} zoom scale\n */\nSvgPanZoom.prototype.getZoom = function() {\n return this.viewport.getZoom()\n}\n\n/**\n * Get zoom scale for public usage\n *\n * @return {Float} zoom scale\n */\nSvgPanZoom.prototype.getRelativeZoom = function() {\n return this.viewport.getRelativeZoom()\n}\n\n/**\n * Compute actual zoom from public zoom\n *\n * @param {Float} zoom\n * @return {Float} zoom scale\n */\nSvgPanZoom.prototype.computeFromRelativeZoom = function(zoom) {\n return zoom * this.viewport.getOriginalState().zoom\n}\n\n/**\n * Set zoom to initial state\n */\nSvgPanZoom.prototype.resetZoom = function() {\n var originalState = this.viewport.getOriginalState()\n\n this.zoom(originalState.zoom, true);\n}\n\n/**\n * Set pan to initial state\n */\nSvgPanZoom.prototype.resetPan = function() {\n this.pan(this.viewport.getOriginalState());\n}\n\n/**\n * Set pan and zoom to initial state\n */\nSvgPanZoom.prototype.reset = function() {\n this.resetZoom()\n this.resetPan()\n}\n\n/**\n * Handle double click event\n * See handleMouseDown() for alternate detection method\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleDblClick = function(evt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault()\n } else {\n evt.returnValue = false\n }\n }\n\n // Check if target was a control button\n if (this.options.controlIconsEnabled) {\n var targetClass = evt.target.getAttribute('class') || ''\n if (targetClass.indexOf('svg-pan-zoom-control') > -1) {\n return false\n }\n }\n\n var zoomFactor\n\n if (evt.shiftKey) {\n zoomFactor = 1/((1 + this.options.zoomScaleSensitivity) * 2) // zoom out when shift key pressed\n } else {\n zoomFactor = (1 + this.options.zoomScaleSensitivity) * 2\n }\n\n var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.svg.getScreenCTM().inverse())\n this.zoomAtPoint(zoomFactor, point)\n}\n\n/**\n * Handle click event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseDown = function(evt, prevEvt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault()\n } else {\n evt.returnValue = false\n }\n }\n\n Utils.mouseAndTouchNormalize(evt, this.svg)\n\n // Double click detection; more consistent than ondblclick\n if (this.options.dblClickZoomEnabled && Utils.isDblClick(evt, prevEvt)){\n this.handleDblClick(evt)\n } else {\n // Pan mode\n this.state = 'pan'\n this.firstEventCTM = this.viewport.getCTM()\n this.stateOrigin = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.firstEventCTM.inverse())\n }\n}\n\n/**\n * Handle mouse move event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseMove = function(evt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault()\n } else {\n evt.returnValue = false\n }\n }\n\n if (this.state === 'pan' && this.options.panEnabled) {\n // Pan mode\n var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(this.firstEventCTM.inverse())\n , viewportCTM = this.firstEventCTM.translate(point.x - this.stateOrigin.x, point.y - this.stateOrigin.y)\n\n this.viewport.setCTM(viewportCTM)\n }\n}\n\n/**\n * Handle mouse button release event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseUp = function(evt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault()\n } else {\n evt.returnValue = false\n }\n }\n\n if (this.state === 'pan') {\n // Quit pan mode\n this.state = 'none'\n }\n}\n\n/**\n * Adjust viewport size (only) so it will fit in SVG\n * Does not center image\n */\nSvgPanZoom.prototype.fit = function() {\n var viewBox = this.viewport.getViewBox()\n , newScale = Math.min(this.width/viewBox.width, this.height/viewBox.height)\n\n this.zoom(newScale, true)\n}\n\n/**\n * Adjust viewport size (only) so it will contain the SVG\n * Does not center image\n */\nSvgPanZoom.prototype.contain = function() {\n var viewBox = this.viewport.getViewBox()\n , newScale = Math.max(this.width/viewBox.width, this.height/viewBox.height)\n\n this.zoom(newScale, true)\n}\n\n/**\n * Adjust viewport pan (only) so it will be centered in SVG\n * Does not zoom/fit/contain image\n */\nSvgPanZoom.prototype.center = function() {\n var viewBox = this.viewport.getViewBox()\n , offsetX = (this.width - (viewBox.width + viewBox.x * 2) * this.getZoom()) * 0.5\n , offsetY = (this.height - (viewBox.height + viewBox.y * 2) * this.getZoom()) * 0.5\n\n this.getPublicInstance().pan({x: offsetX, y: offsetY})\n}\n\n/**\n * Update content cached BorderBox\n * Use when viewport contents change\n */\nSvgPanZoom.prototype.updateBBox = function() {\n this.viewport.simpleViewBoxCache()\n}\n\n/**\n * Pan to a rendered position\n *\n * @param {Object} point {x: 0, y: 0}\n */\nSvgPanZoom.prototype.pan = function(point) {\n var viewportCTM = this.viewport.getCTM()\n viewportCTM.e = point.x\n viewportCTM.f = point.y\n this.viewport.setCTM(viewportCTM)\n}\n\n/**\n * Relatively pan the graph by a specified rendered position vector\n *\n * @param {Object} point {x: 0, y: 0}\n */\nSvgPanZoom.prototype.panBy = function(point) {\n var viewportCTM = this.viewport.getCTM()\n viewportCTM.e += point.x\n viewportCTM.f += point.y\n this.viewport.setCTM(viewportCTM)\n}\n\n/**\n * Get pan vector\n *\n * @return {Object} {x: 0, y: 0}\n */\nSvgPanZoom.prototype.getPan = function() {\n var state = this.viewport.getState()\n\n return {x: state.x, y: state.y}\n}\n\n/**\n * Recalculates cached svg dimensions and controls position\n */\nSvgPanZoom.prototype.resize = function() {\n // Get dimensions\n var boundingClientRectNormalized = SvgUtils.getBoundingClientRectNormalized(this.svg)\n this.width = boundingClientRectNormalized.width\n this.height = boundingClientRectNormalized.height\n\n // Recalculate original state\n var viewport = this.viewport\n viewport.options.width = this.width\n viewport.options.height = this.height\n viewport.processCTM()\n\n // Reposition control icons by re-enabling them\n if (this.options.controlIconsEnabled) {\n this.getPublicInstance().disableControlIcons()\n this.getPublicInstance().enableControlIcons()\n }\n}\n\n/**\n * Unbind mouse events, free callbacks and destroy public instance\n */\nSvgPanZoom.prototype.destroy = function() {\n var that = this\n\n // Free callbacks\n this.beforeZoom = null\n this.onZoom = null\n this.beforePan = null\n this.onPan = null\n this.onUpdatedCTM = null\n\n // Destroy custom event handlers\n if (this.options.customEventsHandler != null) { // jshint ignore:line\n this.options.customEventsHandler.destroy({\n svgElement: this.svg\n , eventsListenerElement: this.options.eventsListenerElement\n , instance: this.getPublicInstance()\n })\n }\n\n // Unbind eventListeners\n for (var event in this.eventListeners) {\n (this.options.eventsListenerElement || this.svg)\n .removeEventListener(event, this.eventListeners[event], !this.options.preventMouseEventsDefault ? passiveListenerOption : false)\n }\n\n // Unbind wheelListener\n this.disableMouseWheelZoom()\n\n // Remove control icons\n this.getPublicInstance().disableControlIcons()\n\n // Reset zoom and pan\n this.reset()\n\n // Remove instance from instancesStore\n instancesStore = instancesStore.filter(function(instance){\n return instance.svg !== that.svg\n })\n\n // Delete options and its contents\n delete this.options\n\n // Delete viewport to make public shadow viewport functions uncallable\n delete this.viewport\n\n // Destroy public instance and rewrite getPublicInstance\n delete this.publicInstance\n delete this.pi\n this.getPublicInstance = function(){\n return null\n }\n}\n\n/**\n * Returns a public instance object\n *\n * @return {Object} Public instance object\n */\nSvgPanZoom.prototype.getPublicInstance = function() {\n var that = this\n\n // Create cache\n if (!this.publicInstance) {\n this.publicInstance = this.pi = {\n // Pan\n enablePan: function() {that.options.panEnabled = true; return that.pi}\n , disablePan: function() {that.options.panEnabled = false; return that.pi}\n , isPanEnabled: function() {return !!that.options.panEnabled}\n , pan: function(point) {that.pan(point); return that.pi}\n , panBy: function(point) {that.panBy(point); return that.pi}\n , getPan: function() {return that.getPan()}\n // Pan event\n , setBeforePan: function(fn) {that.options.beforePan = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi}\n , setOnPan: function(fn) {that.options.onPan = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi}\n // Zoom and Control Icons\n , enableZoom: function() {that.options.zoomEnabled = true; return that.pi}\n , disableZoom: function() {that.options.zoomEnabled = false; return that.pi}\n , isZoomEnabled: function() {return !!that.options.zoomEnabled}\n , enableControlIcons: function() {\n if (!that.options.controlIconsEnabled) {\n that.options.controlIconsEnabled = true\n ControlIcons.enable(that)\n }\n return that.pi\n }\n , disableControlIcons: function() {\n if (that.options.controlIconsEnabled) {\n that.options.controlIconsEnabled = false;\n ControlIcons.disable(that)\n }\n return that.pi\n }\n , isControlIconsEnabled: function() {return !!that.options.controlIconsEnabled}\n // Double click zoom\n , enableDblClickZoom: function() {that.options.dblClickZoomEnabled = true; return that.pi}\n , disableDblClickZoom: function() {that.options.dblClickZoomEnabled = false; return that.pi}\n , isDblClickZoomEnabled: function() {return !!that.options.dblClickZoomEnabled}\n // Mouse wheel zoom\n , enableMouseWheelZoom: function() {that.enableMouseWheelZoom(); return that.pi}\n , disableMouseWheelZoom: function() {that.disableMouseWheelZoom(); return that.pi}\n , isMouseWheelZoomEnabled: function() {return !!that.options.mouseWheelZoomEnabled}\n // Zoom scale and bounds\n , setZoomScaleSensitivity: function(scale) {that.options.zoomScaleSensitivity = scale; return that.pi}\n , setMinZoom: function(zoom) {that.options.minZoom = zoom; return that.pi}\n , setMaxZoom: function(zoom) {that.options.maxZoom = zoom; return that.pi}\n // Zoom event\n , setBeforeZoom: function(fn) {that.options.beforeZoom = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi}\n , setOnZoom: function(fn) {that.options.onZoom = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi}\n // Zooming\n , zoom: function(scale) {that.publicZoom(scale, true); return that.pi}\n , zoomBy: function(scale) {that.publicZoom(scale, false); return that.pi}\n , zoomAtPoint: function(scale, point) {that.publicZoomAtPoint(scale, point, true); return that.pi}\n , zoomAtPointBy: function(scale, point) {that.publicZoomAtPoint(scale, point, false); return that.pi}\n , zoomIn: function() {this.zoomBy(1 + that.options.zoomScaleSensitivity); return that.pi}\n , zoomOut: function() {this.zoomBy(1 / (1 + that.options.zoomScaleSensitivity)); return that.pi}\n , getZoom: function() {return that.getRelativeZoom()}\n // CTM update\n , setOnUpdatedCTM: function(fn) {that.options.onUpdatedCTM = fn === null ? null : Utils.proxy(fn, that.publicInstance); return that.pi}\n // Reset\n , resetZoom: function() {that.resetZoom(); return that.pi}\n , resetPan: function() {that.resetPan(); return that.pi}\n , reset: function() {that.reset(); return that.pi}\n // Fit, Contain and Center\n , fit: function() {that.fit(); return that.pi}\n , contain: function() {that.contain(); return that.pi}\n , center: function() {that.center(); return that.pi}\n // Size and Resize\n , updateBBox: function() {that.updateBBox(); return that.pi}\n , resize: function() {that.resize(); return that.pi}\n , getSizes: function() {\n return {\n width: that.width\n , height: that.height\n , realZoom: that.getZoom()\n , viewBox: that.viewport.getViewBox()\n }\n }\n // Destroy\n , destroy: function() {that.destroy(); return that.pi}\n }\n }\n\n return this.publicInstance\n}\n\n/**\n * Stores pairs of instances of SvgPanZoom and SVG\n * Each pair is represented by an object {svg: SVGSVGElement, instance: SvgPanZoom}\n *\n * @type {Array}\n */\nvar instancesStore = []\n\nvar svgPanZoom = function(elementOrSelector, options){\n var svg = Utils.getSvg(elementOrSelector)\n\n if (svg === null) {\n return null\n } else {\n // Look for existent instance\n for(var i = instancesStore.length - 1; i >= 0; i--) {\n if (instancesStore[i].svg === svg) {\n return instancesStore[i].instance.getPublicInstance()\n }\n }\n\n // If instance not found - create one\n instancesStore.push({\n svg: svg\n , instance: new SvgPanZoom(svg, options)\n })\n\n // Return just pushed instance\n return instancesStore[instancesStore.length - 1].instance.getPublicInstance()\n }\n}\n\nmodule.exports = svgPanZoom;\n","var Utils = require('./utilities')\n , _browser = 'unknown'\n ;\n\n// http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser\nif (/*@cc_on!@*/false || !!document.documentMode) { // internet explorer\n _browser = 'ie';\n}\n\nmodule.exports = {\n svgNS: 'http://www.w3.org/2000/svg'\n, xmlNS: 'http://www.w3.org/XML/1998/namespace'\n, xmlnsNS: 'http://www.w3.org/2000/xmlns/'\n, xlinkNS: 'http://www.w3.org/1999/xlink'\n, evNS: 'http://www.w3.org/2001/xml-events'\n\n /**\n * Get svg dimensions: width and height\n *\n * @param {SVGSVGElement} svg\n * @return {Object} {width: 0, height: 0}\n */\n, getBoundingClientRectNormalized: function(svg) {\n if (svg.clientWidth && svg.clientHeight) {\n return {width: svg.clientWidth, height: svg.clientHeight}\n } else if (!!svg.getBoundingClientRect()) {\n return svg.getBoundingClientRect();\n } else {\n throw new Error('Cannot get BoundingClientRect for SVG.');\n }\n }\n\n /**\n * Gets g element with class of \"viewport\" or creates it if it doesn't exist\n *\n * @param {SVGSVGElement} svg\n * @return {SVGElement} g (group) element\n */\n, getOrCreateViewport: function(svg, selector) {\n var viewport = null\n\n if (Utils.isElement(selector)) {\n viewport = selector\n } else {\n viewport = svg.querySelector(selector)\n }\n\n // Check if there is just one main group in SVG\n if (!viewport) {\n var childNodes = Array.prototype.slice.call(svg.childNodes || svg.children).filter(function(el){\n return el.nodeName !== 'defs' && el.nodeName !== '#text'\n })\n\n // Node name should be SVGGElement and should have no transform attribute\n // Groups with transform are not used as viewport because it involves parsing of all transform possibilities\n if (childNodes.length === 1 && childNodes[0].nodeName === 'g' && childNodes[0].getAttribute('transform') === null) {\n viewport = childNodes[0]\n }\n }\n\n // If no favorable group element exists then create one\n if (!viewport) {\n var viewportId = 'viewport-' + new Date().toISOString().replace(/\\D/g, '');\n viewport = document.createElementNS(this.svgNS, 'g');\n viewport.setAttribute('id', viewportId);\n\n // Internet Explorer (all versions?) can't use childNodes, but other browsers prefer (require?) using childNodes\n var svgChildren = svg.childNodes || svg.children;\n if (!!svgChildren && svgChildren.length > 0) {\n for (var i = svgChildren.length; i > 0; i--) {\n // Move everything into viewport except defs\n if (svgChildren[svgChildren.length - i].nodeName !== 'defs') {\n viewport.appendChild(svgChildren[svgChildren.length - i]);\n }\n }\n }\n svg.appendChild(viewport);\n }\n\n // Parse class names\n var classNames = [];\n if (viewport.getAttribute('class')) {\n classNames = viewport.getAttribute('class').split(' ')\n }\n\n // Set class (if not set already)\n if (!~classNames.indexOf('svg-pan-zoom_viewport')) {\n classNames.push('svg-pan-zoom_viewport')\n viewport.setAttribute('class', classNames.join(' '))\n }\n\n return viewport\n }\n\n /**\n * Set SVG attributes\n *\n * @param {SVGSVGElement} svg\n */\n , setupSvgAttributes: function(svg) {\n // Setting default attributes\n svg.setAttribute('xmlns', this.svgNS);\n svg.setAttributeNS(this.xmlnsNS, 'xmlns:xlink', this.xlinkNS);\n svg.setAttributeNS(this.xmlnsNS, 'xmlns:ev', this.evNS);\n\n // Needed for Internet Explorer, otherwise the viewport overflows\n if (svg.parentNode !== null) {\n var style = svg.getAttribute('style') || '';\n if (style.toLowerCase().indexOf('overflow') === -1) {\n svg.setAttribute('style', 'overflow: hidden; ' + style);\n }\n }\n }\n\n/**\n * How long Internet Explorer takes to finish updating its display (ms).\n */\n, internetExplorerRedisplayInterval: 300\n\n/**\n * Forces the browser to redisplay all SVG elements that rely on an\n * element defined in a 'defs' section. It works globally, for every\n * available defs element on the page.\n * The throttling is intentionally global.\n *\n * This is only needed for IE. It is as a hack to make markers (and 'use' elements?)\n * visible after pan/zoom when there are multiple SVGs on the page.\n * See bug report: https://connect.microsoft.com/IE/feedback/details/781964/\n * also see svg-pan-zoom issue: https://github.com/ariutta/svg-pan-zoom/issues/62\n */\n, refreshDefsGlobal: Utils.throttle(function() {\n var allDefs = document.querySelectorAll('defs');\n var allDefsCount = allDefs.length;\n for (var i = 0; i < allDefsCount; i++) {\n var thisDefs = allDefs[i];\n thisDefs.parentNode.insertBefore(thisDefs, thisDefs);\n }\n }, this ? this.internetExplorerRedisplayInterval : null)\n\n /**\n * Sets the current transform matrix of an element\n *\n * @param {SVGElement} element\n * @param {SVGMatrix} matrix CTM\n * @param {SVGElement} defs\n */\n, setCTM: function(element, matrix, defs) {\n var that = this\n , s = 'matrix(' + matrix.a + ',' + matrix.b + ',' + matrix.c + ',' + matrix.d + ',' + matrix.e + ',' + matrix.f + ')';\n\n element.setAttributeNS(null, 'transform', s);\n if ('transform' in element.style) {\n element.style.transform = s;\n } else if ('-ms-transform' in element.style) {\n element.style['-ms-transform'] = s;\n } else if ('-webkit-transform' in element.style) {\n element.style['-webkit-transform'] = s;\n }\n\n // IE has a bug that makes markers disappear on zoom (when the matrix \"a\" and/or \"d\" elements change)\n // see http://stackoverflow.com/questions/17654578/svg-marker-does-not-work-in-ie9-10\n // and http://srndolha.wordpress.com/2013/11/25/svg-line-markers-may-disappear-in-internet-explorer-11/\n if (_browser === 'ie' && !!defs) {\n // this refresh is intended for redisplaying the SVG during zooming\n defs.parentNode.insertBefore(defs, defs);\n // this refresh is intended for redisplaying the other SVGs on a page when panning a given SVG\n // it is also needed for the given SVG itself, on zoomEnd, if the SVG contains any markers that\n // are located under any other element(s).\n window.setTimeout(function() {\n that.refreshDefsGlobal();\n }, that.internetExplorerRedisplayInterval);\n }\n }\n\n /**\n * Instantiate an SVGPoint object with given event coordinates\n *\n * @param {Event} evt\n * @param {SVGSVGElement} svg\n * @return {SVGPoint} point\n */\n, getEventPoint: function(evt, svg) {\n var point = svg.createSVGPoint()\n\n Utils.mouseAndTouchNormalize(evt, svg)\n\n point.x = evt.clientX\n point.y = evt.clientY\n\n return point\n }\n\n /**\n * Get SVG center point\n *\n * @param {SVGSVGElement} svg\n * @return {SVGPoint}\n */\n, getSvgCenterPoint: function(svg, width, height) {\n return this.createSVGPoint(svg, width / 2, height / 2)\n }\n\n /**\n * Create a SVGPoint with given x and y\n *\n * @param {SVGSVGElement} svg\n * @param {Number} x\n * @param {Number} y\n * @return {SVGPoint}\n */\n, createSVGPoint: function(svg, x, y) {\n var point = svg.createSVGPoint()\n point.x = x\n point.y = y\n\n return point\n }\n}\n","// uniwheel 0.1.2 (customized)\n// A unified cross browser mouse wheel event handler\n// https://github.com/teemualap/uniwheel\n\nmodule.exports = (function(){\n\n //Full details: https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel\n\n var prefix = \"\", _addEventListener, _removeEventListener, support, fns = [];\n var passiveOption = {passive: true};\n\n // detect event model\n if ( window.addEventListener ) {\n _addEventListener = \"addEventListener\";\n _removeEventListener = \"removeEventListener\";\n } else {\n _addEventListener = \"attachEvent\";\n _removeEventListener = \"detachEvent\";\n prefix = \"on\";\n }\n\n // detect available wheel event\n support = \"onwheel\" in document.createElement(\"div\") ? \"wheel\" : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? \"mousewheel\" : // Webkit and IE support at least \"mousewheel\"\n \"DOMMouseScroll\"; // let's assume that remaining browsers are older Firefox\n\n\n function createCallback(element,callback) {\n\n var fn = function(originalEvent) {\n\n !originalEvent && ( originalEvent = window.event );\n\n // create a normalized event object\n var event = {\n // keep a ref to the original event object\n originalEvent: originalEvent,\n target: originalEvent.target || originalEvent.srcElement,\n type: \"wheel\",\n deltaMode: originalEvent.type == \"MozMousePixelScroll\" ? 0 : 1,\n deltaX: 0,\n delatZ: 0,\n preventDefault: function() {\n originalEvent.preventDefault ?\n originalEvent.preventDefault() :\n originalEvent.returnValue = false;\n }\n };\n\n // calculate deltaY (and deltaX) according to the event\n if ( support == \"mousewheel\" ) {\n event.deltaY = - 1/40 * originalEvent.wheelDelta;\n // Webkit also support wheelDeltaX\n originalEvent.wheelDeltaX && ( event.deltaX = - 1/40 * originalEvent.wheelDeltaX );\n } else {\n event.deltaY = originalEvent.detail;\n }\n\n // it's time to fire the callback\n return callback( event );\n\n };\n\n fns.push({\n element: element,\n fn: fn,\n });\n\n return fn;\n }\n\n function getCallback(element) {\n for (var i = 0; i < fns.length; i++) {\n if (fns[i].element === element) {\n return fns[i].fn;\n }\n }\n return function(){};\n }\n\n function removeCallback(element) {\n for (var i = 0; i < fns.length; i++) {\n if (fns[i].element === element) {\n return fns.splice(i,1);\n }\n }\n }\n\n function _addWheelListener(elem, eventName, callback, isPassiveListener ) {\n var cb;\n\n if (support === \"wheel\") {\n cb = callback;\n } else {\n cb = createCallback(elem, callback);\n }\n\n elem[_addEventListener](prefix + eventName, cb, isPassiveListener ? passiveOption : false);\n }\n\n function _removeWheelListener(elem, eventName, callback, isPassiveListener ) {\n\n var cb;\n\n if (support === \"wheel\") {\n cb = callback;\n } else {\n cb = getCallback(elem);\n }\n\n elem[_removeEventListener](prefix + eventName, cb, isPassiveListener ? passiveOption : false);\n\n removeCallback(elem);\n }\n\n function addWheelListener( elem, callback, isPassiveListener ) {\n _addWheelListener(elem, support, callback, isPassiveListener );\n\n // handle MozMousePixelScroll in older Firefox\n if( support == \"DOMMouseScroll\" ) {\n _addWheelListener(elem, \"MozMousePixelScroll\", callback, isPassiveListener );\n }\n }\n\n function removeWheelListener(elem, callback, isPassiveListener){\n _removeWheelListener(elem, support, callback, isPassiveListener);\n\n // handle MozMousePixelScroll in older Firefox\n if( support == \"DOMMouseScroll\" ) {\n _removeWheelListener(elem, \"MozMousePixelScroll\", callback, isPassiveListener);\n }\n }\n\n return {\n on: addWheelListener,\n off: removeWheelListener\n };\n\n})();\n","module.exports = {\n /**\n * Extends an object\n *\n * @param {Object} target object to extend\n * @param {Object} source object to take properties from\n * @return {Object} extended object\n */\n extend: function(target, source) {\n target = target || {};\n for (var prop in source) {\n // Go recursively\n if (this.isObject(source[prop])) {\n target[prop] = this.extend(target[prop], source[prop])\n } else {\n target[prop] = source[prop]\n }\n }\n return target;\n }\n\n /**\n * Checks if an object is a DOM element\n *\n * @param {Object} o HTML element or String\n * @return {Boolean} returns true if object is a DOM element\n */\n, isElement: function(o){\n return (\n o instanceof HTMLElement || o instanceof SVGElement || o instanceof SVGSVGElement || //DOM2\n (o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string')\n );\n }\n\n /**\n * Checks if an object is an Object\n *\n * @param {Object} o Object\n * @return {Boolean} returns true if object is an Object\n */\n, isObject: function(o){\n return Object.prototype.toString.call(o) === '[object Object]';\n }\n\n /**\n * Checks if variable is Number\n *\n * @param {Integer|Float} n\n * @return {Boolean} returns true if variable is Number\n */\n, isNumber: function(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n /**\n * Search for an SVG element\n *\n * @param {Object|String} elementOrSelector DOM Element or selector String\n * @return {Object|Null} SVG or null\n */\n, getSvg: function(elementOrSelector) {\n var element\n , svg;\n\n if (!this.isElement(elementOrSelector)) {\n // If selector provided\n if (typeof elementOrSelector === 'string' || elementOrSelector instanceof String) {\n // Try to find the element\n element = document.querySelector(elementOrSelector)\n\n if (!element) {\n throw new Error('Provided selector did not find any elements. Selector: ' + elementOrSelector)\n return null\n }\n } else {\n throw new Error('Provided selector is not an HTML object nor String')\n return null\n }\n } else {\n element = elementOrSelector\n }\n\n if (element.tagName.toLowerCase() === 'svg') {\n svg = element;\n } else {\n if (element.tagName.toLowerCase() === 'object') {\n svg = element.contentDocument.documentElement;\n } else {\n if (element.tagName.toLowerCase() === 'embed') {\n svg = element.getSVGDocument().documentElement;\n } else {\n if (element.tagName.toLowerCase() === 'img') {\n throw new Error('Cannot script an SVG in an \"img\" element. Please use an \"object\" element or an in-line SVG.');\n } else {\n throw new Error('Cannot get SVG.');\n }\n return null\n }\n }\n }\n\n return svg\n }\n\n /**\n * Attach a given context to a function\n * @param {Function} fn Function\n * @param {Object} context Context\n * @return {Function} Function with certain context\n */\n, proxy: function(fn, context) {\n return function() {\n return fn.apply(context, arguments)\n }\n }\n\n /**\n * Returns object type\n * Uses toString that returns [object SVGPoint]\n * And than parses object type from string\n *\n * @param {Object} o Any object\n * @return {String} Object type\n */\n, getType: function(o) {\n return Object.prototype.toString.apply(o).replace(/^\\[object\\s/, '').replace(/\\]$/, '')\n }\n\n /**\n * If it is a touch event than add clientX and clientY to event object\n *\n * @param {Event} evt\n * @param {SVGSVGElement} svg\n */\n, mouseAndTouchNormalize: function(evt, svg) {\n // If no clientX then fallback\n if (evt.clientX === void 0 || evt.clientX === null) {\n // Fallback\n evt.clientX = 0\n evt.clientY = 0\n\n // If it is a touch event\n if (evt.touches !== void 0 && evt.touches.length) {\n if (evt.touches[0].clientX !== void 0) {\n evt.clientX = evt.touches[0].clientX\n evt.clientY = evt.touches[0].clientY\n } else if (evt.touches[0].pageX !== void 0) {\n var rect = svg.getBoundingClientRect();\n\n evt.clientX = evt.touches[0].pageX - rect.left\n evt.clientY = evt.touches[0].pageY - rect.top\n }\n // If it is a custom event\n } else if (evt.originalEvent !== void 0) {\n if (evt.originalEvent.clientX !== void 0) {\n evt.clientX = evt.originalEvent.clientX\n evt.clientY = evt.originalEvent.clientY\n }\n }\n }\n }\n\n /**\n * Check if an event is a double click/tap\n * TODO: For touch gestures use a library (hammer.js) that takes in account other events\n * (touchmove and touchend). It should take in account tap duration and traveled distance\n *\n * @param {Event} evt\n * @param {Event} prevEvt Previous Event\n * @return {Boolean}\n */\n, isDblClick: function(evt, prevEvt) {\n // Double click detected by browser\n if (evt.detail === 2) {\n return true;\n }\n // Try to compare events\n else if (prevEvt !== void 0 && prevEvt !== null) {\n var timeStampDiff = evt.timeStamp - prevEvt.timeStamp // should be lower than 250 ms\n , touchesDistance = Math.sqrt(Math.pow(evt.clientX - prevEvt.clientX, 2) + Math.pow(evt.clientY - prevEvt.clientY, 2))\n\n return timeStampDiff < 250 && touchesDistance < 10\n }\n\n // Nothing found\n return false;\n }\n\n /**\n * Returns current timestamp as an integer\n *\n * @return {Number}\n */\n, now: Date.now || function() {\n return new Date().getTime();\n }\n\n // From underscore.\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time. Normally, the throttled function will run\n // as much as it can, without ever going more than once per `wait` duration;\n // but if you'd like to disable the execution on the leading edge, pass\n // `{leading: false}`. To disable execution on the trailing edge, ditto.\n// jscs:disable\n// jshint ignore:start\n, throttle: function(func, wait, options) {\n var that = this;\n var context, args, result;\n var timeout = null;\n var previous = 0;\n if (!options) options = {};\n var later = function() {\n previous = options.leading === false ? 0 : that.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n return function() {\n var now = that.now();\n if (!previous && options.leading === false) previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n clearTimeout(timeout);\n timeout = null;\n previous = now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n }\n// jshint ignore:end\n// jscs:enable\n\n /**\n * Create a requestAnimationFrame simulation\n *\n * @param {Number|String} refreshRate\n * @return {Function}\n */\n, createRequestAnimationFrame: function(refreshRate) {\n var timeout = null\n\n // Convert refreshRate to timeout\n if (refreshRate !== 'auto' && refreshRate < 60 && refreshRate > 1) {\n timeout = Math.floor(1000 / refreshRate)\n }\n\n if (timeout === null) {\n return window.requestAnimationFrame || requestTimeout(33)\n } else {\n return requestTimeout(timeout)\n }\n }\n}\n\n/**\n * Create a callback that will execute after a given timeout\n *\n * @param {Function} timeout\n * @return {Function}\n */\nfunction requestTimeout(timeout) {\n return function(callback) {\n window.setTimeout(callback, timeout)\n }\n}\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","// style-loader: Adds some css to the DOM by adding a '\n }\n return css\n}\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","/*!\n * Vue.js v2.6.10\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n/* */\n\nvar emptyObject = Object.freeze({});\n\n// These helpers produce better VM code in JS engines due to their\n// explicitness and function inlining.\nfunction isUndef (v) {\n return v === undefined || v === null\n}\n\nfunction isDef (v) {\n return v !== undefined && v !== null\n}\n\nfunction isTrue (v) {\n return v === true\n}\n\nfunction isFalse (v) {\n return v === false\n}\n\n/**\n * Check if value is primitive.\n */\nfunction isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Get the raw type string of a value, e.g., [object Object].\n */\nvar _toString = Object.prototype.toString;\n\nfunction toRawType (value) {\n return _toString.call(value).slice(8, -1)\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nfunction isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}\n\nfunction isRegExp (v) {\n return _toString.call(v) === '[object RegExp]'\n}\n\n/**\n * Check if val is a valid array index.\n */\nfunction isValidArrayIndex (val) {\n var n = parseFloat(String(val));\n return n >= 0 && Math.floor(n) === n && isFinite(val)\n}\n\nfunction isPromise (val) {\n return (\n isDef(val) &&\n typeof val.then === 'function' &&\n typeof val.catch === 'function'\n )\n}\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction toString (val) {\n return val == null\n ? ''\n : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n ? JSON.stringify(val, null, 2)\n : String(val)\n}\n\n/**\n * Convert an input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n var n = parseFloat(val);\n return isNaN(n) ? val : n\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Check if an attribute is a reserved attribute.\n */\nvar isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n\n/**\n * Remove an item from an array.\n */\nfunction remove (arr, item) {\n if (arr.length) {\n var index = arr.indexOf(item);\n if (index > -1) {\n return arr.splice(index, 1)\n }\n }\n}\n\n/**\n * Check whether an object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n var cache = Object.create(null);\n return (function cachedFn (str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str))\n })\n}\n\n/**\n * Camelize a hyphen-delimited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /\\B([A-Z])/g;\nvar hyphenate = cached(function (str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n});\n\n/**\n * Simple bind polyfill for environments that do not support it,\n * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n * since native bind is now performant enough in most browsers.\n * But removing it would mean breaking code that was able to run in\n * PhantomJS 1.x, so this must be kept for backward compatibility.\n */\n\n/* istanbul ignore next */\nfunction polyfillBind (fn, ctx) {\n function boundFn (a) {\n var l = arguments.length;\n return l\n ? l > 1\n ? fn.apply(ctx, arguments)\n : fn.call(ctx, a)\n : fn.call(ctx)\n }\n\n boundFn._length = fn.length;\n return boundFn\n}\n\nfunction nativeBind (fn, ctx) {\n return fn.bind(ctx)\n}\n\nvar bind = Function.prototype.bind\n ? nativeBind\n : polyfillBind;\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n start = start || 0;\n var i = list.length - start;\n var ret = new Array(i);\n while (i--) {\n ret[i] = list[i + start];\n }\n return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n for (var key in _from) {\n to[key] = _from[key];\n }\n return to\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n}\n\n/* eslint-disable no-unused-vars */\n\n/**\n * Perform no operation.\n * Stubbing args to make Flow happy without leaving useless transpiled code\n * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n */\nfunction noop (a, b, c) {}\n\n/**\n * Always return false.\n */\nvar no = function (a, b, c) { return false; };\n\n/* eslint-enable no-unused-vars */\n\n/**\n * Return the same value.\n */\nvar identity = function (_) { return _; };\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Return the first index at which a loosely equal value can be\n * found in the array (if value is a plain object, the array must\n * contain an object of the same shape), or -1 if it is not present.\n */\nfunction looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}\n\n/**\n * Ensure a function is called only once.\n */\nfunction once (fn) {\n var called = false;\n return function () {\n if (!called) {\n called = true;\n fn.apply(this, arguments);\n }\n }\n}\n\nvar SSR_ATTR = 'data-server-rendered';\n\nvar ASSET_TYPES = [\n 'component',\n 'directive',\n 'filter'\n];\n\nvar LIFECYCLE_HOOKS = [\n 'beforeCreate',\n 'created',\n 'beforeMount',\n 'mounted',\n 'beforeUpdate',\n 'updated',\n 'beforeDestroy',\n 'destroyed',\n 'activated',\n 'deactivated',\n 'errorCaptured',\n 'serverPrefetch'\n];\n\n/* */\n\n\n\nvar config = ({\n /**\n * Option merge strategies (used in core/util/options)\n */\n // $flow-disable-line\n optionMergeStrategies: Object.create(null),\n\n /**\n * Whether to suppress warnings.\n */\n silent: false,\n\n /**\n * Show production mode tip message on boot?\n */\n productionTip: process.env.NODE_ENV !== 'production',\n\n /**\n * Whether to enable devtools\n */\n devtools: process.env.NODE_ENV !== 'production',\n\n /**\n * Whether to record perf\n */\n performance: false,\n\n /**\n * Error handler for watcher errors\n */\n errorHandler: null,\n\n /**\n * Warn handler for watcher warns\n */\n warnHandler: null,\n\n /**\n * Ignore certain custom elements\n */\n ignoredElements: [],\n\n /**\n * Custom user key aliases for v-on\n */\n // $flow-disable-line\n keyCodes: Object.create(null),\n\n /**\n * Check if a tag is reserved so that it cannot be registered as a\n * component. This is platform-dependent and may be overwritten.\n */\n isReservedTag: no,\n\n /**\n * Check if an attribute is reserved so that it cannot be used as a component\n * prop. This is platform-dependent and may be overwritten.\n */\n isReservedAttr: no,\n\n /**\n * Check if a tag is an unknown element.\n * Platform-dependent.\n */\n isUnknownElement: no,\n\n /**\n * Get the namespace of an element\n */\n getTagNamespace: noop,\n\n /**\n * Parse the real tag name for the specific platform.\n */\n parsePlatformTagName: identity,\n\n /**\n * Check if an attribute must be bound using property, e.g. value\n * Platform-dependent.\n */\n mustUseProp: no,\n\n /**\n * Perform updates asynchronously. Intended to be used by Vue Test Utils\n * This will significantly reduce performance if set to false.\n */\n async: true,\n\n /**\n * Exposed for legacy reasons\n */\n _lifecycleHooks: LIFECYCLE_HOOKS\n});\n\n/* */\n\n/**\n * unicode letters used for parsing html tags, component names and property paths.\n * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n */\nvar unicodeRegExp = /a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n Object.defineProperty(obj, key, {\n value: val,\n enumerable: !!enumerable,\n writable: true,\n configurable: true\n });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = new RegExp((\"[^\" + (unicodeRegExp.source) + \".$_\\\\d]\"));\nfunction parsePath (path) {\n if (bailRE.test(path)) {\n return\n }\n var segments = path.split('.');\n return function (obj) {\n for (var i = 0; i < segments.length; i++) {\n if (!obj) { return }\n obj = obj[segments[i]];\n }\n return obj\n }\n}\n\n/* */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;\nvar weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');\nvar isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');\nvar isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge;\nvar isPhantomJS = UA && /phantomjs/.test(UA);\nvar isFF = UA && UA.match(/firefox\\/(\\d+)/);\n\n// Firefox has a \"watch\" function on Object.prototype...\nvar nativeWatch = ({}).watch;\n\nvar supportsPassive = false;\nif (inBrowser) {\n try {\n var opts = {};\n Object.defineProperty(opts, 'passive', ({\n get: function get () {\n /* istanbul ignore next */\n supportsPassive = true;\n }\n })); // https://github.com/facebook/flow/issues/285\n window.addEventListener('test-passive', null, opts);\n } catch (e) {}\n}\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n if (_isServer === undefined) {\n /* istanbul ignore if */\n if (!inBrowser && !inWeex && typeof global !== 'undefined') {\n // detect presence of vue-server-renderer and avoid\n // Webpack shimming the process\n _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';\n } else {\n _isServer = false;\n }\n }\n return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n}\n\nvar hasSymbol =\n typeof Symbol !== 'undefined' && isNative(Symbol) &&\n typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);\n\nvar _Set;\n/* istanbul ignore if */ // $flow-disable-line\nif (typeof Set !== 'undefined' && isNative(Set)) {\n // use native Set when available.\n _Set = Set;\n} else {\n // a non-standard Set polyfill that only works with primitive keys.\n _Set = /*@__PURE__*/(function () {\n function Set () {\n this.set = Object.create(null);\n }\n Set.prototype.has = function has (key) {\n return this.set[key] === true\n };\n Set.prototype.add = function add (key) {\n this.set[key] = true;\n };\n Set.prototype.clear = function clear () {\n this.set = Object.create(null);\n };\n\n return Set;\n }());\n}\n\n/* */\n\nvar warn = noop;\nvar tip = noop;\nvar generateComponentTrace = (noop); // work around flow check\nvar formatComponentName = (noop);\n\nif (process.env.NODE_ENV !== 'production') {\n var hasConsole = typeof console !== 'undefined';\n var classifyRE = /(?:^|[-_])(\\w)/g;\n var classify = function (str) { return str\n .replace(classifyRE, function (c) { return c.toUpperCase(); })\n .replace(/[-_]/g, ''); };\n\n warn = function (msg, vm) {\n var trace = vm ? generateComponentTrace(vm) : '';\n\n if (config.warnHandler) {\n config.warnHandler.call(null, msg, vm, trace);\n } else if (hasConsole && (!config.silent)) {\n console.error((\"[Vue warn]: \" + msg + trace));\n }\n };\n\n tip = function (msg, vm) {\n if (hasConsole && (!config.silent)) {\n console.warn(\"[Vue tip]: \" + msg + (\n vm ? generateComponentTrace(vm) : ''\n ));\n }\n };\n\n formatComponentName = function (vm, includeFile) {\n if (vm.$root === vm) {\n return ''\n }\n var options = typeof vm === 'function' && vm.cid != null\n ? vm.options\n : vm._isVue\n ? vm.$options || vm.constructor.options\n : vm;\n var name = options.name || options._componentTag;\n var file = options.__file;\n if (!name && file) {\n var match = file.match(/([^/\\\\]+)\\.vue$/);\n name = match && match[1];\n }\n\n return (\n (name ? (\"<\" + (classify(name)) + \">\") : \"\") +\n (file && includeFile !== false ? (\" at \" + file) : '')\n )\n };\n\n var repeat = function (str, n) {\n var res = '';\n while (n) {\n if (n % 2 === 1) { res += str; }\n if (n > 1) { str += str; }\n n >>= 1;\n }\n return res\n };\n\n generateComponentTrace = function (vm) {\n if (vm._isVue && vm.$parent) {\n var tree = [];\n var currentRecursiveSequence = 0;\n while (vm) {\n if (tree.length > 0) {\n var last = tree[tree.length - 1];\n if (last.constructor === vm.constructor) {\n currentRecursiveSequence++;\n vm = vm.$parent;\n continue\n } else if (currentRecursiveSequence > 0) {\n tree[tree.length - 1] = [last, currentRecursiveSequence];\n currentRecursiveSequence = 0;\n }\n }\n tree.push(vm);\n vm = vm.$parent;\n }\n return '\\n\\nfound in\\n\\n' + tree\n .map(function (vm, i) { return (\"\" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n : formatComponentName(vm))); })\n .join('\\n')\n } else {\n return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n }\n };\n}\n\n/* */\n\nvar uid = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n this.id = uid++;\n this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n remove(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n if (Dep.target) {\n Dep.target.addDep(this);\n }\n};\n\nDep.prototype.notify = function notify () {\n // stabilize the subscriber list first\n var subs = this.subs.slice();\n if (process.env.NODE_ENV !== 'production' && !config.async) {\n // subs aren't sorted in scheduler if not running async\n // we need to sort them now to make sure they fire in correct\n // order\n subs.sort(function (a, b) { return a.id - b.id; });\n }\n for (var i = 0, l = subs.length; i < l; i++) {\n subs[i].update();\n }\n};\n\n// The current target watcher being evaluated.\n// This is globally unique because only one watcher\n// can be evaluated at a time.\nDep.target = null;\nvar targetStack = [];\n\nfunction pushTarget (target) {\n targetStack.push(target);\n Dep.target = target;\n}\n\nfunction popTarget () {\n targetStack.pop();\n Dep.target = targetStack[targetStack.length - 1];\n}\n\n/* */\n\nvar VNode = function VNode (\n tag,\n data,\n children,\n text,\n elm,\n context,\n componentOptions,\n asyncFactory\n) {\n this.tag = tag;\n this.data = data;\n this.children = children;\n this.text = text;\n this.elm = elm;\n this.ns = undefined;\n this.context = context;\n this.fnContext = undefined;\n this.fnOptions = undefined;\n this.fnScopeId = undefined;\n this.key = data && data.key;\n this.componentOptions = componentOptions;\n this.componentInstance = undefined;\n this.parent = undefined;\n this.raw = false;\n this.isStatic = false;\n this.isRootInsert = true;\n this.isComment = false;\n this.isCloned = false;\n this.isOnce = false;\n this.asyncFactory = asyncFactory;\n this.asyncMeta = undefined;\n this.isAsyncPlaceholder = false;\n};\n\nvar prototypeAccessors = { child: { configurable: true } };\n\n// DEPRECATED: alias for componentInstance for backwards compat.\n/* istanbul ignore next */\nprototypeAccessors.child.get = function () {\n return this.componentInstance\n};\n\nObject.defineProperties( VNode.prototype, prototypeAccessors );\n\nvar createEmptyVNode = function (text) {\n if ( text === void 0 ) text = '';\n\n var node = new VNode();\n node.text = text;\n node.isComment = true;\n return node\n};\n\nfunction createTextVNode (val) {\n return new VNode(undefined, undefined, undefined, String(val))\n}\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);\n\nvar methodsToPatch = [\n 'push',\n 'pop',\n 'shift',\n 'unshift',\n 'splice',\n 'sort',\n 'reverse'\n];\n\n/**\n * Intercept mutating methods and emit events\n */\nmethodsToPatch.forEach(function (method) {\n // cache original method\n var original = arrayProto[method];\n def(arrayMethods, method, function mutator () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = original.apply(this, args);\n var ob = this.__ob__;\n var inserted;\n switch (method) {\n case 'push':\n case 'unshift':\n inserted = args;\n break\n case 'splice':\n inserted = args.slice(2);\n break\n }\n if (inserted) { ob.observeArray(inserted); }\n // notify change\n ob.dep.notify();\n return result\n });\n});\n\n/* */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * In some cases we may want to disable observation inside a component's\n * update computation.\n */\nvar shouldObserve = true;\n\nfunction toggleObserving (value) {\n shouldObserve = value;\n}\n\n/**\n * Observer class that is attached to each observed\n * object. Once attached, the observer converts the target\n * object's property keys into getter/setters that\n * collect dependencies and dispatch updates.\n */\nvar Observer = function Observer (value) {\n this.value = value;\n this.dep = new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (Array.isArray(value)) {\n if (hasProto) {\n protoAugment(value, arrayMethods);\n } else {\n copyAugment(value, arrayMethods, arrayKeys);\n }\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n};\n\n/**\n * Walk through all properties and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n defineReactive$$1(obj, keys[i]);\n }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n for (var i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n};\n\n// helpers\n\n/**\n * Augment a target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}\n\n/**\n * Augment a target Object or Array by defining\n * hidden properties.\n */\n/* istanbul ignore next */\nfunction copyAugment (target, src, keys) {\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n def(target, key, src[key]);\n }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (process.env.NODE_ENV !== 'production' && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set (target, key, val) {\n if (process.env.NODE_ENV !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (target, key) {\n if (process.env.NODE_ENV !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n}\n\n/* */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\nif (process.env.NODE_ENV !== 'production') {\n strats.el = strats.propsData = function (parent, child, vm, key) {\n if (!vm) {\n warn(\n \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n 'creation with the `new` keyword.'\n );\n }\n return defaultStrat(parent, child)\n };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n if (!from) { return to }\n var key, toVal, fromVal;\n\n var keys = hasSymbol\n ? Reflect.ownKeys(from)\n : Object.keys(from);\n\n for (var i = 0; i < keys.length; i++) {\n key = keys[i];\n // in case the object is already observed...\n if (key === '__ob__') { continue }\n toVal = to[key];\n fromVal = from[key];\n if (!hasOwn(to, key)) {\n set(to, key, fromVal);\n } else if (\n toVal !== fromVal &&\n isPlainObject(toVal) &&\n isPlainObject(fromVal)\n ) {\n mergeData(toVal, fromVal);\n }\n }\n return to\n}\n\n/**\n * Data\n */\nfunction mergeDataOrFn (\n parentVal,\n childVal,\n vm\n) {\n if (!vm) {\n // in a Vue.extend merge, both should be functions\n if (!childVal) {\n return parentVal\n }\n if (!parentVal) {\n return childVal\n }\n // when parentVal & childVal are both present,\n // we need to return a function that returns the\n // merged result of both functions... no need to\n // check if parentVal is a function here because\n // it has to be a function to pass previous merges.\n return function mergedDataFn () {\n return mergeData(\n typeof childVal === 'function' ? childVal.call(this, this) : childVal,\n typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal\n )\n }\n } else {\n return function mergedInstanceDataFn () {\n // instance merge\n var instanceData = typeof childVal === 'function'\n ? childVal.call(vm, vm)\n : childVal;\n var defaultData = typeof parentVal === 'function'\n ? parentVal.call(vm, vm)\n : parentVal;\n if (instanceData) {\n return mergeData(instanceData, defaultData)\n } else {\n return defaultData\n }\n }\n }\n}\n\nstrats.data = function (\n parentVal,\n childVal,\n vm\n) {\n if (!vm) {\n if (childVal && typeof childVal !== 'function') {\n process.env.NODE_ENV !== 'production' && warn(\n 'The \"data\" option should be a function ' +\n 'that returns a per-instance value in component ' +\n 'definitions.',\n vm\n );\n\n return parentVal\n }\n return mergeDataOrFn(parentVal, childVal)\n }\n\n return mergeDataOrFn(parentVal, childVal, vm)\n};\n\n/**\n * Hooks and props are merged as arrays.\n */\nfunction mergeHook (\n parentVal,\n childVal\n) {\n var res = childVal\n ? parentVal\n ? parentVal.concat(childVal)\n : Array.isArray(childVal)\n ? childVal\n : [childVal]\n : parentVal;\n return res\n ? dedupeHooks(res)\n : res\n}\n\nfunction dedupeHooks (hooks) {\n var res = [];\n for (var i = 0; i < hooks.length; i++) {\n if (res.indexOf(hooks[i]) === -1) {\n res.push(hooks[i]);\n }\n }\n return res\n}\n\nLIFECYCLE_HOOKS.forEach(function (hook) {\n strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (\n parentVal,\n childVal,\n vm,\n key\n) {\n var res = Object.create(parentVal || null);\n if (childVal) {\n process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);\n return extend(res, childVal)\n } else {\n return res\n }\n}\n\nASSET_TYPES.forEach(function (type) {\n strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (\n parentVal,\n childVal,\n vm,\n key\n) {\n // work around Firefox's Object.prototype.watch...\n if (parentVal === nativeWatch) { parentVal = undefined; }\n if (childVal === nativeWatch) { childVal = undefined; }\n /* istanbul ignore if */\n if (!childVal) { return Object.create(parentVal || null) }\n if (process.env.NODE_ENV !== 'production') {\n assertObjectType(key, childVal, vm);\n }\n if (!parentVal) { return childVal }\n var ret = {};\n extend(ret, parentVal);\n for (var key$1 in childVal) {\n var parent = ret[key$1];\n var child = childVal[key$1];\n if (parent && !Array.isArray(parent)) {\n parent = [parent];\n }\n ret[key$1] = parent\n ? parent.concat(child)\n : Array.isArray(child) ? child : [child];\n }\n return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.inject =\nstrats.computed = function (\n parentVal,\n childVal,\n vm,\n key\n) {\n if (childVal && process.env.NODE_ENV !== 'production') {\n assertObjectType(key, childVal, vm);\n }\n if (!parentVal) { return childVal }\n var ret = Object.create(null);\n extend(ret, parentVal);\n if (childVal) { extend(ret, childVal); }\n return ret\n};\nstrats.provide = mergeDataOrFn;\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n for (var key in options.components) {\n validateComponentName(key);\n }\n}\n\nfunction validateComponentName (name) {\n if (!new RegExp((\"^[a-zA-Z][\\\\-\\\\.0-9_\" + (unicodeRegExp.source) + \"]*$\")).test(name)) {\n warn(\n 'Invalid component name: \"' + name + '\". Component names ' +\n 'should conform to valid custom element name in html5 specification.'\n );\n }\n if (isBuiltInTag(name) || config.isReservedTag(name)) {\n warn(\n 'Do not use built-in or reserved HTML elements as component ' +\n 'id: ' + name\n );\n }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options, vm) {\n var props = options.props;\n if (!props) { return }\n var res = {};\n var i, val, name;\n if (Array.isArray(props)) {\n i = props.length;\n while (i--) {\n val = props[i];\n if (typeof val === 'string') {\n name = camelize(val);\n res[name] = { type: null };\n } else if (process.env.NODE_ENV !== 'production') {\n warn('props must be strings when using array syntax.');\n }\n }\n } else if (isPlainObject(props)) {\n for (var key in props) {\n val = props[key];\n name = camelize(key);\n res[name] = isPlainObject(val)\n ? val\n : { type: val };\n }\n } else if (process.env.NODE_ENV !== 'production') {\n warn(\n \"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\n \"but got \" + (toRawType(props)) + \".\",\n vm\n );\n }\n options.props = res;\n}\n\n/**\n * Normalize all injections into Object-based format\n */\nfunction normalizeInject (options, vm) {\n var inject = options.inject;\n if (!inject) { return }\n var normalized = options.inject = {};\n if (Array.isArray(inject)) {\n for (var i = 0; i < inject.length; i++) {\n normalized[inject[i]] = { from: inject[i] };\n }\n } else if (isPlainObject(inject)) {\n for (var key in inject) {\n var val = inject[key];\n normalized[key] = isPlainObject(val)\n ? extend({ from: key }, val)\n : { from: val };\n }\n } else if (process.env.NODE_ENV !== 'production') {\n warn(\n \"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\n \"but got \" + (toRawType(inject)) + \".\",\n vm\n );\n }\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}\n\nfunction assertObjectType (name, value, vm) {\n if (!isPlainObject(value)) {\n warn(\n \"Invalid value for option \\\"\" + name + \"\\\": expected an Object, \" +\n \"but got \" + (toRawType(value)) + \".\",\n vm\n );\n }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n parent,\n child,\n vm\n) {\n if (process.env.NODE_ENV !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n\n // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n options,\n type,\n id,\n warnMissing\n) {\n /* istanbul ignore if */\n if (typeof id !== 'string') {\n return\n }\n var assets = options[type];\n // check local registration variations first\n if (hasOwn(assets, id)) { return assets[id] }\n var camelizedId = camelize(id);\n if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }\n var PascalCaseId = capitalize(camelizedId);\n if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }\n // fallback to prototype chain\n var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\n if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {\n warn(\n 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n options\n );\n }\n return res\n}\n\n/* */\n\n\n\nfunction validateProp (\n key,\n propOptions,\n propsData,\n vm\n) {\n var prop = propOptions[key];\n var absent = !hasOwn(propsData, key);\n var value = propsData[key];\n // boolean casting\n var booleanIndex = getTypeIndex(Boolean, prop.type);\n if (booleanIndex > -1) {\n if (absent && !hasOwn(prop, 'default')) {\n value = false;\n } else if (value === '' || value === hyphenate(key)) {\n // only cast empty string / same name to boolean if\n // boolean has higher priority\n var stringIndex = getTypeIndex(String, prop.type);\n if (stringIndex < 0 || booleanIndex < stringIndex) {\n value = true;\n }\n }\n }\n // check default value\n if (value === undefined) {\n value = getPropDefaultValue(vm, prop, key);\n // since the default value is a fresh copy,\n // make sure to observe it.\n var prevShouldObserve = shouldObserve;\n toggleObserving(true);\n observe(value);\n toggleObserving(prevShouldObserve);\n }\n if (\n process.env.NODE_ENV !== 'production' &&\n // skip validation for weex recycle-list child component props\n !(false)\n ) {\n assertProp(prop, key, value, vm, absent);\n }\n return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n // no default, return undefined\n if (!hasOwn(prop, 'default')) {\n return undefined\n }\n var def = prop.default;\n // warn against non-factory defaults for Object & Array\n if (process.env.NODE_ENV !== 'production' && isObject(def)) {\n warn(\n 'Invalid default value for prop \"' + key + '\": ' +\n 'Props with type Object/Array must use a factory function ' +\n 'to return the default value.',\n vm\n );\n }\n // the raw prop value was also undefined from previous render,\n // return previous default value to avoid unnecessary watcher trigger\n if (vm && vm.$options.propsData &&\n vm.$options.propsData[key] === undefined &&\n vm._props[key] !== undefined\n ) {\n return vm._props[key]\n }\n // call factory function for non-Function types\n // a value is Function if its prototype is function even across different execution context\n return typeof def === 'function' && getType(prop.type) !== 'Function'\n ? def.call(vm)\n : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}\n\nvar simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;\n\nfunction assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (simpleCheckRE.test(expectedType)) {\n var t = typeof value;\n valid = t === expectedType.toLowerCase();\n // for primitive wrapper objects\n if (!valid && t === 'object') {\n valid = value instanceof type;\n }\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n}\n\nfunction isSameType (a, b) {\n return getType(a) === getType(b)\n}\n\nfunction getTypeIndex (type, expectedTypes) {\n if (!Array.isArray(expectedTypes)) {\n return isSameType(expectedTypes, type) ? 0 : -1\n }\n for (var i = 0, len = expectedTypes.length; i < len; i++) {\n if (isSameType(expectedTypes[i], type)) {\n return i\n }\n }\n return -1\n}\n\nfunction getInvalidTypeMessage (name, value, expectedTypes) {\n var message = \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', '));\n var expectedType = expectedTypes[0];\n var receivedType = toRawType(value);\n var expectedValue = styleValue(value, expectedType);\n var receivedValue = styleValue(value, receivedType);\n // check if we need to specify expected value\n if (expectedTypes.length === 1 &&\n isExplicable(expectedType) &&\n !isBoolean(expectedType, receivedType)) {\n message += \" with value \" + expectedValue;\n }\n message += \", got \" + receivedType + \" \";\n // check if we need to specify received value\n if (isExplicable(receivedType)) {\n message += \"with value \" + receivedValue + \".\";\n }\n return message\n}\n\nfunction styleValue (value, type) {\n if (type === 'String') {\n return (\"\\\"\" + value + \"\\\"\")\n } else if (type === 'Number') {\n return (\"\" + (Number(value)))\n } else {\n return (\"\" + value)\n }\n}\n\nfunction isExplicable (value) {\n var explicitTypes = ['string', 'number', 'boolean'];\n return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })\n}\n\nfunction isBoolean () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })\n}\n\n/* */\n\nfunction handleError (err, vm, info) {\n // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.\n // See: https://github.com/vuejs/vuex/issues/1505\n pushTarget();\n try {\n if (vm) {\n var cur = vm;\n while ((cur = cur.$parent)) {\n var hooks = cur.$options.errorCaptured;\n if (hooks) {\n for (var i = 0; i < hooks.length; i++) {\n try {\n var capture = hooks[i].call(cur, err, vm, info) === false;\n if (capture) { return }\n } catch (e) {\n globalHandleError(e, cur, 'errorCaptured hook');\n }\n }\n }\n }\n }\n globalHandleError(err, vm, info);\n } finally {\n popTarget();\n }\n}\n\nfunction invokeWithErrorHandling (\n handler,\n context,\n args,\n vm,\n info\n) {\n var res;\n try {\n res = args ? handler.apply(context, args) : handler.call(context);\n if (res && !res._isVue && isPromise(res) && !res._handled) {\n res.catch(function (e) { return handleError(e, vm, info + \" (Promise/async)\"); });\n // issue #9511\n // avoid catch triggering multiple times when nested calls\n res._handled = true;\n }\n } catch (e) {\n handleError(e, vm, info);\n }\n return res\n}\n\nfunction globalHandleError (err, vm, info) {\n if (config.errorHandler) {\n try {\n return config.errorHandler.call(null, err, vm, info)\n } catch (e) {\n // if the user intentionally throws the original error in the handler,\n // do not log it twice\n if (e !== err) {\n logError(e, null, 'config.errorHandler');\n }\n }\n }\n logError(err, vm, info);\n}\n\nfunction logError (err, vm, info) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Error in \" + info + \": \\\"\" + (err.toString()) + \"\\\"\"), vm);\n }\n /* istanbul ignore else */\n if ((inBrowser || inWeex) && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n}\n\n/* */\n\nvar isUsingMicroTask = false;\n\nvar callbacks = [];\nvar pending = false;\n\nfunction flushCallbacks () {\n pending = false;\n var copies = callbacks.slice(0);\n callbacks.length = 0;\n for (var i = 0; i < copies.length; i++) {\n copies[i]();\n }\n}\n\n// Here we have async deferring wrappers using microtasks.\n// In 2.5 we used (macro) tasks (in combination with microtasks).\n// However, it has subtle problems when state is changed right before repaint\n// (e.g. #6813, out-in transitions).\n// Also, using (macro) tasks in event handler would cause some weird behaviors\n// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).\n// So we now use microtasks everywhere, again.\n// A major drawback of this tradeoff is that there are some scenarios\n// where microtasks have too high a priority and fire in between supposedly\n// sequential events (e.g. #4521, #6690, which have workarounds)\n// or even between bubbling of the same event (#6566).\nvar timerFunc;\n\n// The nextTick behavior leverages the microtask queue, which can be accessed\n// via either native Promise.then or MutationObserver.\n// MutationObserver has wider support, however it is seriously bugged in\n// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n// completely stops working after triggering a few times... so, if native\n// Promise is available, we will use it:\n/* istanbul ignore next, $flow-disable-line */\nif (typeof Promise !== 'undefined' && isNative(Promise)) {\n var p = Promise.resolve();\n timerFunc = function () {\n p.then(flushCallbacks);\n // In problematic UIWebViews, Promise.then doesn't completely break, but\n // it can get stuck in a weird state where callbacks are pushed into the\n // microtask queue but the queue isn't being flushed, until the browser\n // needs to do some other work, e.g. handle a timer. Therefore we can\n // \"force\" the microtask queue to be flushed by adding an empty timer.\n if (isIOS) { setTimeout(noop); }\n };\n isUsingMicroTask = true;\n} else if (!isIE && typeof MutationObserver !== 'undefined' && (\n isNative(MutationObserver) ||\n // PhantomJS and iOS 7.x\n MutationObserver.toString() === '[object MutationObserverConstructor]'\n)) {\n // Use MutationObserver where native Promise is not available,\n // e.g. PhantomJS, iOS7, Android 4.4\n // (#6466 MutationObserver is unreliable in IE11)\n var counter = 1;\n var observer = new MutationObserver(flushCallbacks);\n var textNode = document.createTextNode(String(counter));\n observer.observe(textNode, {\n characterData: true\n });\n timerFunc = function () {\n counter = (counter + 1) % 2;\n textNode.data = String(counter);\n };\n isUsingMicroTask = true;\n} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\n // Fallback to setImmediate.\n // Techinically it leverages the (macro) task queue,\n // but it is still a better choice than setTimeout.\n timerFunc = function () {\n setImmediate(flushCallbacks);\n };\n} else {\n // Fallback to setTimeout.\n timerFunc = function () {\n setTimeout(flushCallbacks, 0);\n };\n}\n\nfunction nextTick (cb, ctx) {\n var _resolve;\n callbacks.push(function () {\n if (cb) {\n try {\n cb.call(ctx);\n } catch (e) {\n handleError(e, ctx, 'nextTick');\n }\n } else if (_resolve) {\n _resolve(ctx);\n }\n });\n if (!pending) {\n pending = true;\n timerFunc();\n }\n // $flow-disable-line\n if (!cb && typeof Promise !== 'undefined') {\n return new Promise(function (resolve) {\n _resolve = resolve;\n })\n }\n}\n\n/* */\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\nif (process.env.NODE_ENV !== 'production') {\n var allowedGlobals = makeMap(\n 'Infinity,undefined,NaN,isFinite,isNaN,' +\n 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n 'require' // for Webpack/Browserify\n );\n\n var warnNonPresent = function (target, key) {\n warn(\n \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n 'referenced during render. Make sure that this property is reactive, ' +\n 'either in the data option, or for class-based components, by ' +\n 'initializing the property. ' +\n 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',\n target\n );\n };\n\n var warnReservedPrefix = function (target, key) {\n warn(\n \"Property \\\"\" + key + \"\\\" must be accessed with \\\"$data.\" + key + \"\\\" because \" +\n 'properties starting with \"$\" or \"_\" are not proxied in the Vue instance to ' +\n 'prevent conflicts with Vue internals' +\n 'See: https://vuejs.org/v2/api/#data',\n target\n );\n };\n\n var hasProxy =\n typeof Proxy !== 'undefined' && isNative(Proxy);\n\n if (hasProxy) {\n var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\n config.keyCodes = new Proxy(config.keyCodes, {\n set: function set (target, key, value) {\n if (isBuiltInModifier(key)) {\n warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n return false\n } else {\n target[key] = value;\n return true\n }\n }\n });\n }\n\n var hasHandler = {\n has: function has (target, key) {\n var has = key in target;\n var isAllowed = allowedGlobals(key) ||\n (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));\n if (!has && !isAllowed) {\n if (key in target.$data) { warnReservedPrefix(target, key); }\n else { warnNonPresent(target, key); }\n }\n return has || !isAllowed\n }\n };\n\n var getHandler = {\n get: function get (target, key) {\n if (typeof key === 'string' && !(key in target)) {\n if (key in target.$data) { warnReservedPrefix(target, key); }\n else { warnNonPresent(target, key); }\n }\n return target[key]\n }\n };\n\n initProxy = function initProxy (vm) {\n if (hasProxy) {\n // determine which proxy handler to use\n var options = vm.$options;\n var handlers = options.render && options.render._withStripped\n ? getHandler\n : hasHandler;\n vm._renderProxy = new Proxy(vm, handlers);\n } else {\n vm._renderProxy = vm;\n }\n };\n}\n\n/* */\n\nvar seenObjects = new _Set();\n\n/**\n * Recursively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n */\nfunction traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}\n\nfunction _traverse (val, seen) {\n var i, keys;\n var isA = Array.isArray(val);\n if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {\n return\n }\n if (val.__ob__) {\n var depId = val.__ob__.dep.id;\n if (seen.has(depId)) {\n return\n }\n seen.add(depId);\n }\n if (isA) {\n i = val.length;\n while (i--) { _traverse(val[i], seen); }\n } else {\n keys = Object.keys(val);\n i = keys.length;\n while (i--) { _traverse(val[keys[i]], seen); }\n }\n}\n\nvar mark;\nvar measure;\n\nif (process.env.NODE_ENV !== 'production') {\n var perf = inBrowser && window.performance;\n /* istanbul ignore if */\n if (\n perf &&\n perf.mark &&\n perf.measure &&\n perf.clearMarks &&\n perf.clearMeasures\n ) {\n mark = function (tag) { return perf.mark(tag); };\n measure = function (name, startTag, endTag) {\n perf.measure(name, startTag, endTag);\n perf.clearMarks(startTag);\n perf.clearMarks(endTag);\n // perf.clearMeasures(name)\n };\n }\n}\n\n/* */\n\nvar normalizeEvent = cached(function (name) {\n var passive = name.charAt(0) === '&';\n name = passive ? name.slice(1) : name;\n var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first\n name = once$$1 ? name.slice(1) : name;\n var capture = name.charAt(0) === '!';\n name = capture ? name.slice(1) : name;\n return {\n name: name,\n once: once$$1,\n capture: capture,\n passive: passive\n }\n});\n\nfunction createFnInvoker (fns, vm) {\n function invoker () {\n var arguments$1 = arguments;\n\n var fns = invoker.fns;\n if (Array.isArray(fns)) {\n var cloned = fns.slice();\n for (var i = 0; i < cloned.length; i++) {\n invokeWithErrorHandling(cloned[i], null, arguments$1, vm, \"v-on handler\");\n }\n } else {\n // return handler return value for single handlers\n return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\")\n }\n }\n invoker.fns = fns;\n return invoker\n}\n\nfunction updateListeners (\n on,\n oldOn,\n add,\n remove$$1,\n createOnceHandler,\n vm\n) {\n var name, def$$1, cur, old, event;\n for (name in on) {\n def$$1 = cur = on[name];\n old = oldOn[name];\n event = normalizeEvent(name);\n if (isUndef(cur)) {\n process.env.NODE_ENV !== 'production' && warn(\n \"Invalid handler for event \\\"\" + (event.name) + \"\\\": got \" + String(cur),\n vm\n );\n } else if (isUndef(old)) {\n if (isUndef(cur.fns)) {\n cur = on[name] = createFnInvoker(cur, vm);\n }\n if (isTrue(event.once)) {\n cur = on[name] = createOnceHandler(event.name, cur, event.capture);\n }\n add(event.name, cur, event.capture, event.passive, event.params);\n } else if (cur !== old) {\n old.fns = cur;\n on[name] = old;\n }\n }\n for (name in oldOn) {\n if (isUndef(on[name])) {\n event = normalizeEvent(name);\n remove$$1(event.name, oldOn[name], event.capture);\n }\n }\n}\n\n/* */\n\nfunction mergeVNodeHook (def, hookKey, hook) {\n if (def instanceof VNode) {\n def = def.data.hook || (def.data.hook = {});\n }\n var invoker;\n var oldHook = def[hookKey];\n\n function wrappedHook () {\n hook.apply(this, arguments);\n // important: remove merged hook to ensure it's called only once\n // and prevent memory leak\n remove(invoker.fns, wrappedHook);\n }\n\n if (isUndef(oldHook)) {\n // no existing hook\n invoker = createFnInvoker([wrappedHook]);\n } else {\n /* istanbul ignore if */\n if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n // already a merged invoker\n invoker = oldHook;\n invoker.fns.push(wrappedHook);\n } else {\n // existing plain hook\n invoker = createFnInvoker([oldHook, wrappedHook]);\n }\n }\n\n invoker.merged = true;\n def[hookKey] = invoker;\n}\n\n/* */\n\nfunction extractPropsFromVNodeData (\n data,\n Ctor,\n tag\n) {\n // we are only extracting raw values here.\n // validation and default values are handled in the child\n // component itself.\n var propOptions = Ctor.options.props;\n if (isUndef(propOptions)) {\n return\n }\n var res = {};\n var attrs = data.attrs;\n var props = data.props;\n if (isDef(attrs) || isDef(props)) {\n for (var key in propOptions) {\n var altKey = hyphenate(key);\n if (process.env.NODE_ENV !== 'production') {\n var keyInLowerCase = key.toLowerCase();\n if (\n key !== keyInLowerCase &&\n attrs && hasOwn(attrs, keyInLowerCase)\n ) {\n tip(\n \"Prop \\\"\" + keyInLowerCase + \"\\\" is passed to component \" +\n (formatComponentName(tag || Ctor)) + \", but the declared prop name is\" +\n \" \\\"\" + key + \"\\\". \" +\n \"Note that HTML attributes are case-insensitive and camelCased \" +\n \"props need to use their kebab-case equivalents when using in-DOM \" +\n \"templates. You should probably use \\\"\" + altKey + \"\\\" instead of \\\"\" + key + \"\\\".\"\n );\n }\n }\n checkProp(res, props, key, altKey, true) ||\n checkProp(res, attrs, key, altKey, false);\n }\n }\n return res\n}\n\nfunction checkProp (\n res,\n hash,\n key,\n altKey,\n preserve\n) {\n if (isDef(hash)) {\n if (hasOwn(hash, key)) {\n res[key] = hash[key];\n if (!preserve) {\n delete hash[key];\n }\n return true\n } else if (hasOwn(hash, altKey)) {\n res[key] = hash[altKey];\n if (!preserve) {\n delete hash[altKey];\n }\n return true\n }\n }\n return false\n}\n\n/* */\n\n// The template compiler attempts to minimize the need for normalization by\n// statically analyzing the template at compile time.\n//\n// For plain HTML markup, normalization can be completely skipped because the\n// generated render function is guaranteed to return Array. There are\n// two cases where extra normalization is needed:\n\n// 1. When the children contains components - because a functional component\n// may return an Array instead of a single root. In this case, just a simple\n// normalization is needed - if any child is an Array, we flatten the whole\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n// because functional components already normalize their own children.\nfunction simpleNormalizeChildren (children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children)\n }\n }\n return children\n}\n\n// 2. When the children contains constructs that always generated nested Arrays,\n// e.g.